posthog-js
Advanced tools
Comparing version 1.2.1 to 1.2.2-beta.0
@@ -0,1 +1,7 @@ | ||
## 1.2.2 - 2020-06-15 | ||
- Allow setting properties on anonymous users | ||
## 1.2.1 - 2020-06-09 | ||
- Simplify passing of API token to editor | ||
## 1.2.0 - 2020-06-08 | ||
@@ -2,0 +8,0 @@ - Support passing various/dynamic parameters to the toolbar |
@@ -6,5 +6,5 @@ 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}({"itQ5":[function(require,module,exports) { | ||
},{"./config":"itQ5"}],"RYfg":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getClassName=r,exports.getSafeText=n,exports.isElementNode=s,exports.isTag=o,exports.isTextNode=c,exports.shouldCaptureDomEvent=u,exports.shouldCaptureElement=a,exports.shouldCaptureValue=p,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 e.className.baseVal||e.getAttribute("class")||"";default:return""}}function n(t){var r="";return a(t)&&t.childNodes&&t.childNodes.length&&e._.each(t.childNodes,function(t){c(t)&&t.textContent&&(r+=e._.trim(t.textContent).split(/(\s+)/).filter(p).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),e._.trim(r)}function s(e){return e&&1===e.nodeType}function o(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function c(e){return e&&3===e.nodeType}var i=["a","button","form","input","select","textarea","label"];function u(e,t){if(!e||o(e,"html")||!s(e))return!1;for(var r=!1,n=[e],c=e;c.parentNode&&!o(c,"body");)i.indexOf(c.parentNode.tagName.toLowerCase())>-1&&(r=!0),n.push(c.parentNode),c=c.parentNode;var u=e.tagName.toLowerCase();switch(u){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&&(i.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}function a(t){for(var n=t;n.parentNode&&!o(n,"body");n=n.parentNode){var s=r(n).split(" ");if(e._.includes(s,"ph-sensitive")||e._.includes(s,"ph-no-capture"))return!1}if(e._.includes(r(t).split(" "),"ph-include"))return!0;if(o(t,"input")&&"button"!=t.type||o(t,"select")||o(t,"textarea")||"true"===t.getAttribute("contenteditable"))return!1;var c=t.type||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.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 p(t){if(null===t||e._.isUndefined(t))return!1;if("string"==typeof t){t=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}exports.usefulElements=i; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getClassName=r,exports.getSafeText=n,exports.isElementNode=s,exports.isTag=o,exports.isTextNode=i,exports.shouldCaptureDomEvent=c,exports.shouldCaptureElement=a,exports.shouldCaptureValue=p,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 e.className.baseVal||e.getAttribute("class")||"";default:return""}}function n(t){var r="";return a(t)&&t.childNodes&&t.childNodes.length&&e._.each(t.childNodes,function(t){i(t)&&t.textContent&&(r+=e._.trim(t.textContent).split(/(\s+)/).filter(p).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),e._.trim(r).substring(0,400)}function s(e){return e&&1===e.nodeType}function o(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function i(e){return e&&3===e.nodeType}var u=["a","button","form","input","select","textarea","label"];function c(e,t){if(!e||o(e,"html")||!s(e))return!1;for(var r=!1,n=[e],i=e;i.parentNode&&!o(i,"body");)u.indexOf(i.parentNode.tagName.toLowerCase())>-1&&(r=!0),n.push(i.parentNode),i=i.parentNode;var c=e.tagName.toLowerCase();switch(c){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&&(u.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}function a(t){for(var n=t;n.parentNode&&!o(n,"body");n=n.parentNode){var s=r(n).split(" ");if(e._.includes(s,"ph-sensitive")||e._.includes(s,"ph-no-capture"))return!1}if(e._.includes(r(t).split(" "),"ph-include"))return!0;if(o(t,"input")&&"button"!=t.type||o(t,"select")||o(t,"textarea")||"true"===t.getAttribute("contenteditable"))return!1;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 p(t){if(null===t||e._.isUndefined(t))return!1;if("string"==typeof t){t=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}exports.usefulElements=u; | ||
},{"./utils":"FOZT"}],"gR3r":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.autocapture=void 0;var e=require("./utils"),t=require("./autocapture-utils"),o={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!(0,t.isElementNode)(e));return e},_loadScript:function(e,t){var o=document.createElement("script");o.type="text/javascript",o.src=e,o.onload=t;var n=document.getElementsByTagName("script");n.length>0?n[0].parentNode.insertBefore(o,n[0]):document.body.appendChild(o)},_getPropertiesFromElement:function(o){var n=o.tagName.toLowerCase(),i={tag_name:n};t.usefulElements.indexOf(n)>-1&&(i.$el_text=(0,t.getSafeText)(o));var r=(0,t.getClassName)(o);r.length>0&&(i.classes=r.split(" ")),(0,t.shouldCaptureElement)(o)&&e._.each(o.attributes,function(e){(0,t.shouldCaptureValue)(e.value)&&(i["attr__"+e.name]=e.value)});for(var a=1,s=1,d=o;d=this._previousElementSibling(d);)a++,d.tagName===o.tagName&&s++;return i.nth_child=a,i.nth_of_type=s,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1,$host:window.location.host,$pathname:window.location.pathname}},_extractCustomPropertyValue:function(o){var n=[];return e._.each(document.querySelectorAll(o.css_selector),function(e){var o;["input","select"].indexOf(e.tagName.toLowerCase())>-1?o=e.value:e.textContent&&(o=e.textContent),(0,t.shouldCaptureValue)(o)&&n.push(o)}),n.join(", ")},_getCustomProperties:function(o){var n={};return e._.each(this._customProperties,function(i){e._.each(i.event_selectors,function(r){var a=document.querySelectorAll(r);e._.each(a,function(r){e._.includes(o,r)&&(0,t.shouldCaptureElement)(r)&&(n[i.name]=this._extractCustomPropertyValue(i))},this)},this)},this),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement:e.target},_captureEvent:function(o,n){var i=this._getEventTarget(o);if((0,t.isTextNode)(i)&&(i=i.parentNode),(0,t.shouldCaptureDomEvent)(i,o)){for(var r=[i],a=i;a.parentNode&&!(0,t.isTag)(a,"body");)r.push(a.parentNode),a=a.parentNode;var s,d=[],c=!1;if(e._.each(r,function(o){var n=(0,t.shouldCaptureElement)(o);"a"===o.tagName.toLowerCase()&&(s=o.getAttribute("href"),s=n&&(0,t.shouldCaptureValue)(s)&&s);var i=(0,t.getClassName)(o).split(" ");e._.includes(i,"ph-no-capture")&&(c=!0),d.push(this._getPropertiesFromElement(o))},this),d[0].$el_text=(0,t.getSafeText)(i),c)return!1;var u=(0,t.getSafeText)(i);u&&u.length&&u;var l=e._.extend(this._getDefaultProperties(o.type),{$elements:d},this._getCustomProperties(r));return n.capture("$autocapture",l),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(t){var o=e._.bind(function(e){e=e||window.event,this._captureEvent(e,t)},this);e._.register_event(document,"submit",o,!1,!0),e._.register_event(document,"change",o,!1,!0),e._.register_event(document,"click",o,!1,!0)},_customProperties:{},init:function(t){if(document&&document.body){var o=t.get_config("token");if(this._initializedTokens.indexOf(o)>-1)console.log('autocapture already initialized for token "'+o+'"');else if(this._initializedTokens.push(o),!this._maybeLoadEditor(t)){var n=e._.bind(function(e){var o=e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&o.toolbarVersion&&0===o.toolbarVersion.indexOf("toolbar")&&(this._loadEditor(t,Object.assign({},o,{apiURL:t.get_config("api_host")})),t.set_config({debug:!0})),e&&e.config&&!0===e.config.enable_collect_everything?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture_enabled=!1},this);t._send_request(t.get_config("api_host")+"/decide/",{verbose:!0,version:"1",lib:"web",token:o},{method:"GET"},t._prepare_callback(n))}}else{console.log("document not ready yet, trying again in 500 milliseconds...");var i=this;setTimeout(function(){i.init(t)},500)}},_editorParamsFromHash:function(t,o){var n;try{var i=e._.getHashParam(o,"state");i=JSON.parse(decodeURIComponent(i));var r=e._.getHashParam(o,"expires_in");n=Object.assign({},i,{accessToken:e._.getHashParam(o,"access_token"),accessTokenExpiresAt:(new Date).getTime()+1e3*Number(r)}),window.sessionStorage.setItem("editorParams",JSON.stringify(n)),window.sessionStorage.setItem("editorActionId",n.actionId),i.desiredHash?window.location.hash=i.desiredHash:window.history?history.replaceState("",document.title,window.location.pathname+window.location.search):window.location.hash=""}catch(a){console.error("Unable to parse data from hash",a)}return n},_maybeLoadEditor:function(t){try{var o=!1;if(e._.getHashParam(window.location.hash,"state")){var n=e._.getHashParam(window.location.hash,"state");o="mpeditor"===(n=JSON.parse(decodeURIComponent(n))).action}var i,r=!!window.sessionStorage.getItem("_mpcehash");return o?i=this._editorParamsFromHash(t,window.location.hash):r?(i=this._editorParamsFromHash(t,window.sessionStorage.getItem("_mpcehash")),window.sessionStorage.removeItem("_mpcehash")):i=JSON.parse(window.sessionStorage.getItem("editorParams")||"{}"),!(!i.token||t.get_config("token")!==i.token)&&(this._loadEditor(t,i),!0)}catch(a){return!1}},_loadEditor:function(t,o){var n=this;if(!window._mpEditorLoaded){window._mpEditorLoaded=!0;var i=o.jsURL||o.apiURL||t.get_config("api_host"),r=o.toolbarVersion&&0===o.toolbarVersion.indexOf("toolbar")?"toolbar.js":"editor.js",a=i+(i.endsWith("/")?"":"/")+"static/"+r+"?_ts="+(new Date).getTime();return this._loadScript(a,function(){window.ph_load_editor(o)}),e._.register_event(window,"turbolinks:load",function(){window._mpEditorLoaded=!1,n._loadEditor(t,o)}),!0}return!1},enabledForProject:function(t,o,n){o=e._.isUndefined(o)?10:o,n=e._.isUndefined(n)?10:n;for(var i=0,r=0;r<t.length;r++)i+=t.charCodeAt(r);return i%o<n},isBrowserSupported:function(){return e._.isFunction(document.querySelectorAll)}};exports.autocapture=o,e._.bind_instance_methods(o),e._.safewrap_instance_methods(o); | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.autocapture=void 0;var e=require("./utils"),t=require("./autocapture-utils"),o={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!(0,t.isElementNode)(e));return e},_loadScript:function(e,t){var o=document.createElement("script");o.type="text/javascript",o.src=e,o.onload=t;var n=document.getElementsByTagName("script");n.length>0?n[0].parentNode.insertBefore(o,n[0]):document.body.appendChild(o)},_getPropertiesFromElement:function(o){var n=o.tagName.toLowerCase(),i={tag_name:n};t.usefulElements.indexOf(n)>-1&&(i.$el_text=(0,t.getSafeText)(o));var r=(0,t.getClassName)(o);r.length>0&&(i.classes=r.split(" ")),(0,t.shouldCaptureElement)(o)&&e._.each(o.attributes,function(e){(0,t.shouldCaptureValue)(e.value)&&(i["attr__"+e.name]=e.value)});for(var a=1,s=1,d=o;d=this._previousElementSibling(d);)a++,d.tagName===o.tagName&&s++;return i.nth_child=a,i.nth_of_type=s,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1,$host:window.location.host,$pathname:window.location.pathname}},_extractCustomPropertyValue:function(o){var n=[];return e._.each(document.querySelectorAll(o.css_selector),function(e){var o;["input","select"].indexOf(e.tagName.toLowerCase())>-1?o=e.value:e.textContent&&(o=e.textContent),(0,t.shouldCaptureValue)(o)&&n.push(o)}),n.join(", ")},_getCustomProperties:function(o){var n={};return e._.each(this._customProperties,function(i){e._.each(i.event_selectors,function(r){var a=document.querySelectorAll(r);e._.each(a,function(r){e._.includes(o,r)&&(0,t.shouldCaptureElement)(r)&&(n[i.name]=this._extractCustomPropertyValue(i))},this)},this)},this),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement:e.target},_captureEvent:function(o,n){var i=this._getEventTarget(o);if((0,t.isTextNode)(i)&&(i=i.parentNode),(0,t.shouldCaptureDomEvent)(i,o)){for(var r=[i],a=i;a.parentNode&&!(0,t.isTag)(a,"body");)r.push(a.parentNode),a=a.parentNode;var s,d=[],c=!1;if(e._.each(r,function(o){var n=(0,t.shouldCaptureElement)(o);"a"===o.tagName.toLowerCase()&&(s=o.getAttribute("href"),s=n&&(0,t.shouldCaptureValue)(s)&&s);var i=(0,t.getClassName)(o).split(" ");e._.includes(i,"ph-no-capture")&&(c=!0),d.push(this._getPropertiesFromElement(o))},this),d[0].$el_text=(0,t.getSafeText)(i),c)return!1;var u=(0,t.getSafeText)(i);u&&u.length&&u;var l=e._.extend(this._getDefaultProperties(o.type),{$elements:d},this._getCustomProperties(r));return n.capture("$autocapture",l),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(t){var o=e._.bind(function(e){e=e||window.event,this._captureEvent(e,t)},this);e._.register_event(document,"submit",o,!1,!0),e._.register_event(document,"change",o,!1,!0),e._.register_event(document,"click",o,!1,!0)},_customProperties:{},init:function(t){if(!this._maybeLoadEditor(t)){var o=t.get_config("token");if(this._initializedTokens.indexOf(o)>-1)console.log('autocapture already initialized for token "'+o+'"');else{this._initializedTokens.push(o);var n=e._.bind(function(e){if(!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){n(e)},500);var o=e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&o.toolbarVersion&&0===o.toolbarVersion.indexOf("toolbar")&&(this._loadEditor(t,Object.assign({},o,{apiURL:t.get_config("api_host")})),t.set_config({debug:!0})),e&&e.config&&!0===e.config.enable_collect_everything?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture_enabled=!1,e.featureFlags.length>0?t.persistence.register({$active_feature_flags:e.featureFlags}):t.persistence.unregister("$active_feature_flags")},this),i=e._.JSONEncode({token:o,distinct_id:t.get_distinct_id()}),r=e._.base64Encode(i);t._send_request(t.get_config("api_host")+"/decide/",{data:r},{method:"POST"},t._prepare_callback(n))}}},_editorParamsFromHash:function(t,o){var n;try{var i=e._.getHashParam(o,"state");i=JSON.parse(decodeURIComponent(i));var r=e._.getHashParam(o,"expires_in");n=Object.assign({},i,{accessToken:e._.getHashParam(o,"access_token"),accessTokenExpiresAt:(new Date).getTime()+1e3*Number(r)}),window.sessionStorage.setItem("editorParams",JSON.stringify(n)),window.sessionStorage.setItem("editorActionId",n.actionId),i.desiredHash?window.location.hash=i.desiredHash:window.history?history.replaceState("",document.title,window.location.pathname+window.location.search):window.location.hash=""}catch(a){console.error("Unable to parse data from hash",a)}return n},_maybeLoadEditor:function(t){try{var o=!1;if(e._.getHashParam(window.location.hash,"state")){var n=e._.getHashParam(window.location.hash,"state");o="mpeditor"===(n=JSON.parse(decodeURIComponent(n))).action}var i,r=!!window.sessionStorage.getItem("_mpcehash");return o?i=this._editorParamsFromHash(t,window.location.hash):r?(i=this._editorParamsFromHash(t,window.sessionStorage.getItem("_mpcehash")),window.sessionStorage.removeItem("_mpcehash")):i=JSON.parse(window.sessionStorage.getItem("editorParams")||"{}"),!(!i.token||t.get_config("token")!==i.token)&&(this._loadEditor(t,i),!0)}catch(a){return!1}},_loadEditor:function(t,o){var n=this;if(!window._mpEditorLoaded){window._mpEditorLoaded=!0;var i=o.jsURL||o.apiURL||t.get_config("api_host"),r=o.toolbarVersion&&0===o.toolbarVersion.indexOf("toolbar")?"toolbar.js":"editor.js",a=i+(i.endsWith("/")?"":"/")+"static/"+r+"?_ts="+(new Date).getTime();return this._loadScript(a,function(){window.ph_load_editor(o)}),e._.register_event(window,"turbolinks:load",function(){window._mpEditorLoaded=!1,n._loadEditor(t,o)}),!0}return!1},enabledForProject:function(t,o,n){o=e._.isUndefined(o)?10:o,n=e._.isUndefined(n)?10:n;for(var i=0,r=0;r<t.length;r++)i+=t.charCodeAt(r);return i%o<n},isBrowserSupported:function(){return e._.isFunction(document.querySelectorAll)}};exports.autocapture=o,e._.bind_instance_methods(o),e._.safewrap_instance_methods(o); | ||
},{"./utils":"FOZT","./autocapture-utils":"RYfg"}],"OjnC":[function(require,module,exports) { | ||
@@ -17,9 +17,11 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinkCapture=exports.FormCapture=void 0;var e=require("./utils"),t=function(){};t.prototype.create_properties=function(){},t.prototype.event_handler=function(){},t.prototype.after_capture_handler=function(){},t.prototype.init=function(e){return this.mp=e,this},t.prototype.capture=function(t,r,n,o){var i=this,p=e._.dom_query(t);if(0!==p.length)return e._.each(p,function(t){e._.register_event(t,this.override_event,function(e){var t={},p=i.create_properties(n,this),a=i.mp.get_config("capture_links_timeout");i.event_handler(e,this,t),window.setTimeout(i.capture_callback(o,p,t,!0),a),i.mp.capture(r,p,i.capture_callback(o,p,t))})},this),!0;e.console.error("The DOM query ("+t+") returned 0 elements")},t.prototype.capture_callback=function(e,t,r,n){n=n||!1;var o=this;return function(){r.callback_fired||(r.callback_fired=!0,e&&!1===e(n,t)||o.after_capture_handler(t,r,n))}},t.prototype.create_properties=function(t,r){return"function"==typeof t?t(r):e._.extend({},t)};var r=function(){this.override_event="click"};exports.LinkCapture=r,e._.inherit(r,t),r.prototype.create_properties=function(e,t){var n=r.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},r.prototype.event_handler=function(e,t,r){r.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,r.href=t.href,r.new_tab||e.preventDefault()},r.prototype.after_capture_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var n=function(){this.override_event="submit"};exports.FormCapture=n,e._.inherit(n,t),n.prototype.event_handler=function(e,t,r){r.element=t,e.preventDefault()},n.prototype.after_capture_handler=function(e,t){setTimeout(function(){t.element.submit()},0)}; | ||
},{"./utils":"FOZT"}],"ecEG":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PostHogPeople=void 0;var e=require("./gdpr-utils"),t=require("./api-actions"),o=require("./utils"),_=function(){};exports.PostHogPeople=_,o._.extend(_.prototype,t.apiActions),_.prototype._init=function(e){this._posthog=e},_.prototype.set=(0,e.addOptOutCheckPostHogPeople)(function(e,_,i){var s=this.set_action(e,_);return o._.isObject(e)&&(i=_),this._get_config("save_referrer")&&this._posthog.persistence.update_referrer_info(document.referrer),s[t.SET_ACTION]=o._.extend({},o._.info.people_properties(),this._posthog.persistence.get_referrer_info(),s[t.SET_ACTION]),this._send_request(s,i)}),_.prototype.set_once=(0,e.addOptOutCheckPostHogPeople)(function(e,t,_){var i=this.set_once_action(e,t);return o._.isObject(e)&&(_=t),this._send_request(i,_)}),_.prototype.toString=function(){return this._posthog.toString()+".people"},_.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var _=this._posthog.get_property("$device_id"),i=this._posthog.get_property("$user_id"),s=this._posthog.get_property("$had_persisted_distinct_id");_&&(e.$device_id=_),i&&(e.$user_id=i),s&&(e.$had_persisted_distinct_id=s);var r=o._.encodeDates(e),n=o._.truncate(r,255),p=o._.JSONEncode(r),d=o._.base64Encode(p);return this._identify_called()?(this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:d},this._posthog._prepare_callback(t,n)),n):(this._enqueue(e),o._.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),n)},_.prototype._get_config=function(e){return this._posthog.get_config(e)},_.prototype._identify_called=function(){return!0===this._posthog._flags.identify_called},_.prototype._enqueue=function(e){t.SET_ACTION in e?this._posthog.persistence._add_to_people_queue(t.SET_ACTION,e):t.SET_ONCE_ACTION in e?this._posthog.persistence._add_to_people_queue(t.SET_ONCE_ACTION,e):o.console.error("Invalid call to _enqueue():",e)},_.prototype._flush_one_queue=function(e,t,_,i){var s=this,r=o._.extend({},this._posthog.persistence._get_queue(e)),n=r;o._.isUndefined(r)||!o._.isObject(r)||o._.isEmptyObject(r)||(s._posthog.persistence._pop_from_people_queue(e,r),i&&(n=i(r)),t.call(s,n,function(t,i){0===t&&s._posthog.persistence._add_to_people_queue(e,r),o._.isUndefined(_)||_(t,i)}))},_.prototype._flush=function(e,o){this._flush_one_queue(t.SET_ACTION,this.set,e),this._flush_one_queue(t.SET_ONCE_ACTION,this.set_once,o)},_.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},_.prototype.set=_.prototype.set,_.prototype.set_once=_.prototype.set_once,_.prototype.toString=_.prototype.toString; | ||
},{"./gdpr-utils":"rxSh","./api-actions":"os8r","./utils":"FOZT"}],"MAdm":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PostHogPeople=void 0;var e=require("./gdpr-utils"),t=require("./api-actions"),o=require("./utils"),_=function(){};exports.PostHogPeople=_,o._.extend(_.prototype,t.apiActions),_.prototype._init=function(e){this._posthog=e},_.prototype.set=(0,e.addOptOutCheckPostHogPeople)(function(e,_,i){var s=this.set_action(e,_);return o._.isObject(e)&&(i=_),this._get_config("save_referrer")&&this._posthog.persistence.update_referrer_info(document.referrer),s[t.SET_ACTION]=o._.extend({},o._.info.people_properties(),this._posthog.persistence.get_referrer_info(),s[t.SET_ACTION]),this._send_request(s,i)}),_.prototype.set_once=(0,e.addOptOutCheckPostHogPeople)(function(e,t,_){var i=this.set_once_action(e,t);return o._.isObject(e)&&(_=t),this._send_request(i,_)}),_.prototype.toString=function(){return this._posthog.toString()+".people"},_.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var _=this._posthog.get_property("$device_id"),i=this._posthog.get_property("$user_id"),s=this._posthog.get_property("$had_persisted_distinct_id");_&&(e.$device_id=_),i&&(e.$user_id=i),s&&(e.$had_persisted_distinct_id=s);var r=o._.encodeDates(e),p=o._.truncate(r,255),n=o._.JSONEncode(r),d=o._.base64Encode(n);return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:d},this._posthog._prepare_callback(t,p)),p},_.prototype._get_config=function(e){return this._posthog.get_config(e)},_.prototype._identify_called=function(){return!0===this._posthog._flags.identify_called},_.prototype._flush_one_queue=function(e,t,_,i){var s=this,r=o._.extend({},this._posthog.persistence._get_queue(e)),p=r;o._.isUndefined(r)||!o._.isObject(r)||o._.isEmptyObject(r)||(s._posthog.persistence._pop_from_people_queue(e,r),i&&(p=i(r)),t.call(s,p,function(t,i){0===t&&s._posthog.persistence._add_to_people_queue(e,r),o._.isUndefined(_)||_(t,i)}))},_.prototype._flush=function(e,o){this._flush_one_queue(t.SET_ACTION,this.set,e),this._flush_one_queue(t.SET_ONCE_ACTION,this.set_once,o)},_.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},_.prototype.set=_.prototype.set,_.prototype.set_once=_.prototype.set_once,_.prototype.toString=_.prototype.toString; | ||
},{"./gdpr-utils":"rxSh","./api-actions":"os8r","./utils":"FOZT"}],"aVqC":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PostHogFeatureFlags=void 0;var e=require("./utils"),t=function(){};exports.PostHogFeatureFlags=t,t.prototype._init=function(e){this._posthog=e},t.prototype.getFlags=function(){return this._posthog.persistence.props.$override_feature_flags?(this._override_warning||console.warn("[PostHog] Overriding feature flags! Feature flags from server were: "+JSON.stringify(this._posthog.persistence.props.$active_feature_flags)),this._override_warning=!0,this._posthog.persistence.props.$override_feature_flags):this._posthog.persistence.props.$active_feature_flags},t.prototype.isFeatureEnabled=function(e){return this.getFlags()?this.getFlags().indexOf(e)>-1:(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)},t.prototype.onFeatureFlags=function(t){if(!this.getFlags())return setTimeout(e._.bind(function(){this._posthog.feature_flags.onFeatureFlags(t)},this),100),!1;t(this.getFlags())},t.prototype.override=function(e){if(!1===e)return this._posthog.persistence.unregister("$override_feature_flags");this._posthog.persistence.register("$override_feature_flags",e)}; | ||
},{"./utils":"FOZT"}],"MAdm":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EVENT_TIMERS_KEY=exports.CAMPAIGN_IDS_KEY=exports.ALIAS_ID_KEY=exports.PEOPLE_DISTINCT_ID_KEY=exports.SET_ONCE_QUEUE_KEY=exports.SET_QUEUE_KEY=exports.PostHogPersistence=void 0;var e=require("./api-actions"),t=i(require("./config")),s=require("./utils");function i(e){return e&&e.__esModule?e:{default:e}}var r="__mps";exports.SET_QUEUE_KEY=r;var o="__mpso";exports.SET_ONCE_QUEUE_KEY=o;var _="__mpus",p="__mpa",n="__mpap",a="__mpr",c="__mpu",h="$people_distinct_id";exports.PEOPLE_DISTINCT_ID_KEY=h;var u="__alias";exports.ALIAS_ID_KEY=u;var d="__cmpns";exports.CAMPAIGN_IDS_KEY=d;var f="__timers";exports.EVENT_TIMERS_KEY=f;var m=[r,o,_,p,n,a,c,h,u,d,f],g=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="ph_"+e.persistence_name:this.name="ph_"+e.token+"_posthog";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(s.console.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&s._.localStorage.is_supported()?this.storage=s._.localStorage:this.storage=s._.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};exports.PostHogPersistence=g,g.prototype.properties=function(){var e={};return s._.each(this.props,function(t,i){s._.include(m,i)||(e[i]=t)}),e},g.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=s._.extend({},e))}},g.prototype.upgrade=function(e){var t,i,r=e.upgrade;r&&(t="ph_super_properties","string"==typeof r&&(t=r),i=this.storage.parse(t),this.storage.remove(t),this.storage.remove(t,!0),i&&(this.props=s._.extend(this.props,i.all,i.events))),e.cookie_name||"posthog"===e.name||(t="ph_"+e.token+"_"+e.name,(i=this.storage.parse(t))&&(this.storage.remove(t),this.storage.remove(t,!0),this.register_once(i))),this.storage===s._.localStorage&&(i=s._.cookie.parse(this.name),s._.cookie.remove(this.name),s._.cookie.remove(this.name,!0),i&&this.register_once(i))},g.prototype.save=function(){this.disabled||(this._expire_notification_campaigns(),this.storage.set(this.name,s._.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure))},g.prototype.remove=function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)},g.prototype.clear=function(){this.remove(),this.props={}},g.prototype.register_once=function(e,t,i){return!!s._.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===i?this.default_expiry:i,s._.each(e,function(e,s){this.props.hasOwnProperty(s)&&this.props[s]!==t||(this.props[s]=e)},this),this.save(),!0)},g.prototype.register=function(e,t){return!!s._.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,s._.extend(this.props,e),this.save(),!0)},g.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},g.prototype._expire_notification_campaigns=s._.safewrap(function(){var e=this.props[d],i=t.default.DEBUG?6e4:36e5;if(e){for(var r in e)1*new Date-e[r]>i&&delete e[r];s._.isEmptyObject(e)&&delete this.props[d]}}),g.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(s._.info.campaignParams()),this.campaign_params_saved=!0)},g.prototype.update_search_keyword=function(e){this.register(s._.info.searchInfo(e))},g.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:s._.info.referringDomain(e)||"$direct"},"")},g.prototype.get_referrer_info=function(){return s._.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},g.prototype.safe_merge=function(e){return s._.each(this.props,function(t,s){s in e||(e[s]=t)}),e},g.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)},g.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},g.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},g.prototype.get_cross_subdomain=function(){return this.cross_subdomain},g.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},g.prototype._add_to_people_queue=function(t,i){var _=this._get_queue_key(t),p=i[t],n=this._get_or_create_queue(e.SET_ACTION),a=this._get_or_create_queue(e.SET_ONCE_ACTION);_===r?s._.extend(n,p):_===o&&s._.each(p,function(e,t){t in a||(a[t]=e)}),this.save()},g.prototype._pop_from_people_queue=function(e,t){var i=this._get_queue(e);s._.isUndefined(i)||(s._.each(t,function(e,t){delete i[t]},this),this.save())},g.prototype._get_queue_key=function(t){return t===e.SET_ACTION?r:t===e.SET_ONCE_ACTION?o:void s.console.error("Invalid queue:",t)},g.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},g.prototype._get_or_create_queue=function(e,t){var i=this._get_queue_key(e);return t=s._.isUndefined(t)?{}:t,this.props[i]||(this.props[i]=t)},g.prototype.set_event_timer=function(e,t){var s=this.props[f]||{};s[e]=t,this.props[f]=s,this.save()},g.prototype.remove_event_timer=function(e){var t=(this.props[f]||{})[e];return s._.isUndefined(t)||(delete this.props[f][e],this.save()),t}; | ||
},{"./api-actions":"os8r","./config":"itQ5","./utils":"FOZT"}],"ok3T":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.init_from_snippet=S,exports.init_as_module=A;var e,t,o=c(require("./config")),i=require("./utils"),r=require("./autocapture"),n=require("./dom-capture"),s=require("./posthog-people"),_=require("./posthog-persistence"),p=require("./gdpr-utils");function c(e){return e&&e.__esModule?e:{default:e}}var a=0,u=1,d=function(){},l={},g="posthog",h=i.window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,f=!h&&-1===i.userAgent.indexOf("MSIE")&&-1===i.userAgent.indexOf("Mozilla"),y=i.window.navigator.sendBeacon;y&&(y=i._.bind(y,i.navigator));var v={api_host:"https://t.posthog.com",api_method:"POST",api_transport:"XHR",autocapture:!0,cdn:"https://cdn.posthog.com",cross_subdomain_cookie:-1===i.document.location.hostname.indexOf("herokuapp.com"),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:function(){},store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,debug:!1,capture_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,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:[],xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0},m=!1,b=function(){},k=function(n,_,p){var c,u=p===g?t:t[p];if(u&&e===a)c=u;else{if(u&&!i._.isArray(u))return void i.console.error("You have already initialized "+p);c=new b}if(c._cached_groups={},c._user_decide_check_complete=!1,c._events_captureed_before_user_decide_check_complete=[],c._init(n,_,p),c.people=new s.PostHogPeople,c.people._init(c),o.default.DEBUG=o.default.DEBUG||c.get_config("debug"),c.__autocapture_enabled=c.get_config("autocapture"),c.get_config("autocapture")){r.autocapture.enabledForProject(c.get_config("token"),100,100)?r.autocapture.isBrowserSupported()?r.autocapture.init(c):(c.__autocapture_enabled=!1,i.console.log("Disabling Automatic Event Collection because this browser is not supported")):(c.__autocapture_enabled=!1,i.console.log("Not in active bucket: disabling Automatic Event Collection."))}return!i._.isUndefined(u)&&i._.isArray(u)&&(c._execute_array.call(c.people,u.people),c._execute_array(u)),c};function w(e){i.window.console.warn("WARNING! posthog."+e+" is deprecated and will be removed soon! Please use posthog."+e.split("captureing").join("capturing")+' instead (without the "e")!')}b.prototype.init=function(e,o,r){if(i._.isUndefined(r))i.console.error("You must name your new library: init(token, config, name)");else{if(r!==g){var n=k(e,o,r);return t[r]=n,n._loaded(),n}i.console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}},b.prototype._init=function(e,t,o){this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(i._.extend({},v,t,{name:o,token:e,callback_fn:(o===g?o:g+"."+o)+"._jsc"})),this._jsc=function(){},this._event_queue=[],this._empty_queue_count=0,this._should_poll=!0,this._poller=function(){},this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.persistence=this.cookie=new _.PostHogPersistence(this.config),this._gdpr_init();var r=i._.UUID();this.get_distinct_id()||this.register_once({distinct_id:r,$device_id:r},""),i.window.addEventListener("unload",this._handle_unload.bind(this))},b.prototype._loaded=function(){this.get_config("loaded")(this),this.get_config("capture_pageview")&&this.capture_pageview()},b.prototype._dom_loaded=function(){i._.each(this.__dom_loaded_queue,function(e){this._capture_dom.apply(this,e)},this),this.has_opted_out_capturing()||(i._.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),this.get_config("request_batching")&&this._event_queue_poll()),delete this.__dom_loaded_queue,delete this.__request_queue},b.prototype._capture_dom=function(e,t){if(this.get_config("img"))return i.console.error("You can't use DOM capturing functions with img = true."),!1;if(!m)return this.__dom_loaded_queue.push([e,t]),!1;var o=(new e).init(this);return o.capture.apply(o,t)},b.prototype._prepare_callback=function(e,t){if(i._.isUndefined(e))return null;if(h){return function(o){e(o,t)}}var o=this._jsc,r=""+Math.floor(1e8*Math.random()),n=this.get_config("callback_fn")+"["+r+"]";return o[r]=function(i){delete o[r],e(i,t)},n},b.prototype._event_enqueue=function(e,t,o,i){this._event_queue.push({url:e,data:t,options:o,callback:i}),this._should_poll||(this._should_poll=!0,this._event_queue_poll())},b.prototype._format_event_queue_data=function(){var e={};return i._.each(this._event_queue,function(t){var o=t.url,i=t.data;void 0===e[o]&&(e[o]=[]),e[o].push(i)}),e},b.prototype._event_queue_poll=function(){var e=this;this._poller=setTimeout(function(){if(e._event_queue.length>0){var t=e._format_event_queue_data(),o=function(o){var r=t[o];i._.each(r,function(e,t){r[t].offset=Math.abs(r[t].timestamp-new Date),delete r[t].timestamp}),n=i._.JSONEncode(r),s=i._.base64Encode(n),e._send_request(o,{data:s},l,d)};for(var r in t){var n,s;o(r)}e._event_queue.length=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e._should_poll=!1,e._empty_queue_count=0),e._should_poll&&e._event_queue_poll()},3e3)},b.prototype._handle_unload=function(){if(this.get_config("request_batching")){clearInterval(this._poller),this.capture("$pageleave");var e={};for(var t in this._event_queue.length>0&&(e=this._format_event_queue_data()),this._event_queue.length=0,e){var o=i._.base64Encode(i._.JSONEncode(e[t]));this._send_request(t,{data:o},{transport:"sendbeacon"},d)}}else this.capture("$pageleave",null,{transport:"sendbeacon"})},b.prototype._send_request=function(e,t,o,r){if(f)this.__request_queue.push(arguments);else{var n={method:this.get_config("api_method"),transport:this.get_config("api_transport")},s=null;r||!i._.isFunction(o)&&"string"!=typeof o||(r=o,o=null),o=i._.extend(n,o||{}),h||(o.method="GET");var _=y&&"sendbeacon"===o.transport.toLowerCase(),p=_||"POST"===o.method,c=this.get_config("verbose");t.verbose&&(c=!0),this.get_config("test")&&(t.test=1),c&&(t.verbose=1),this.get_config("img")&&(t.img=1),h||(r?t.callback=r:(c||this.get_config("test"))&&(t.callback="(function(){})"));var a={};if(a.ip=this.get_config("ip")?1:0,a._=(new Date).getTime().toString(),p&&(s=Array.isArray(t)?"data="+t:"data="+t.data,delete t.data),e+="?"+i._.HTTPBuildQuery(a),"img"in t){var u=i.document.createElement("img");u.src=e,i.document.body.appendChild(u)}else if(_){var d=new Blob([s],{type:"application/x-www-form-urlencoded"});y(e,d)}else if(h)try{var l=new XMLHttpRequest;l.open(o.method,e,!0);var g=this.get_config("xhr_headers");p&&(g["Content-Type"]="application/x-www-form-urlencoded"),i._.each(g,function(e,t){l.setRequestHeader(t,e)}),l.withCredentials=!0,l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){if(r)if(c){var e;try{e=i._.JSONDecode(l.responseText)}catch(o){return void i.console.error(o)}r(e)}else r(Number(l.responseText))}else{var t="Bad HTTP status: "+l.status+" "+l.statusText;i.console.error(t),r&&r(c?{status:0,error:t}:0)}},l.send(s)}catch(b){i.console.error(b)}else{var v=i.document.createElement("script");v.type="text/javascript",v.async=!0,v.defer=!0,v.src=e;var m=i.document.getElementsByTagName("script")[0];m.parentNode.insertBefore(v,m)}}},b.prototype._execute_array=function(e){var t,o=[],r=[],n=[];i._.each(e,function(e){e&&(t=e[0],i._.isArray(t)?n.push(e):"function"==typeof e?e.call(this):i._.isArray(e)&&"alias"===t?o.push(e):i._.isArray(e)&&-1!==t.indexOf("capture")&&"function"==typeof this[t]?n.push(e):r.push(e))},this);var s=function(e,t){i._.each(e,function(e){if(i._.isArray(e[0])){var o=t;i._.each(e,function(e){o=o[e[0]].apply(o,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};s(o,this),s(r,this),s(n,this)},b.prototype.push=function(e){this._execute_array([e])},b.prototype.capture=(0,p.addOptOutCheckPostHogLib)(function(e,t,o,r){r||"function"!=typeof o||(r=o,o=null);var n=(o=o||l).transport;if(n&&(o.transport=n),"function"!=typeof r&&(r=d),i._.isUndefined(e))i.console.error("No event name provided to posthog.capture");else{if(!this._event_is_disabled(e)){(t=t||{}).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!i._.isUndefined(s)){var _=(new Date).getTime()-s;t.$duration=parseFloat((_/1e3).toFixed(3))}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),t=i._.extend({},i._.info.properties(),this.persistence.properties(),t);var p=this.get_config("property_blacklist");i._.isArray(p)?i._.each(p,function(e){delete t[e]}):i.console.error("Invalid value for property_blacklist config: "+p);var c={event:e,properties:t},a=i._.truncate(c,255),u=i._.JSONEncode(a),g=i._.base64Encode(u),h=this.get_config("api_host")+"/e/",f=this._prepare_callback(r,a),y=r!==d||o!==l;return!this.get_config("request_batching")||y?this._send_request(h,{data:g},o,f):(c.timestamp=new Date,this._event_enqueue(h,c,o,f)),a}r(0)}}),b.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},b.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},b.prototype.capture_pageview=function(e){i._.isUndefined(e)&&(e=i.document.location.href),this.capture("$pageview")},b.prototype.capture_links=function(){return this._capture_dom.call(this,n.LinkCapture,arguments)},b.prototype.capture_forms=function(){return this._capture_dom.call(this,FormCaptureer,arguments)},b.prototype.register=function(e,t){this.persistence.register(e,t)},b.prototype.register_once=function(e,t,o){this.persistence.register_once(e,t,o)},b.prototype.unregister=function(e){this.persistence.unregister(e)},b.prototype._register_single=function(e,t){var o={};o[e]=t,this.register(o)},b.prototype.identify=function(e,t,o){if(e){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==r&&e!==this.get_property(_.ALIAS_ID_KEY)&&(this.unregister(_.ALIAS_ID_KEY),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,o),e!==r&&this.capture("$identify",{distinct_id:e,$anon_distinct_id:r})}else i.console.error("Unique user id has not been set in posthog.identify")},b.prototype.reset=function(e){var t=this.get_property("$device_id");this.persistence.clear(),this._flags.identify_called=!1;var o=i._.UUID();this.register_once({distinct_id:o,$device_id:e?o:t},"")},b.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},b.prototype.alias=function(e,t){if(e===this.get_property(_.PEOPLE_DISTINCT_ID_KEY))return i.console.critical("Attempting to create alias for existing People user - aborting."),-2;var o=this;return i._.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(_.ALIAS_ID_KEY,e),this.capture("$create_alias",{alias:e,distinct_id:t},function(){o.identify(e)})):(i.console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},b.prototype.set_config=function(e){i._.isObject(e)&&(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),o.default.DEBUG=o.default.DEBUG||this.get_config("debug"))},b.prototype.get_config=function(e){return this.config[e]},b.prototype.get_property=function(e){return this.persistence.props[e]},b.prototype.toString=function(){var e=this.get_config("name");return e!==g&&(e=g+"."+e),e},b.prototype._event_is_disabled=function(e){return i._.isBlockedUA(i.userAgent)||this._flags.disable_all_events||i._.include(this.__disabled_events,e)},b.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&i._.localStorage.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")&&!i._.cookie.get("ph_optout")||(i._.cookie.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},b.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)},b.prototype._gdpr_call_func=function(e,t){return t=i._.extend({capture:i._.bind(this.capture,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),i._.localStorage.is_supported()||(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})},b.prototype.opt_in_capturing=function(e){e=i._.extend({enable_persistence:!0},e),this._gdpr_call_func(p.optIn,e),this._gdpr_update_persistence(e)},b.prototype.opt_in_captureing=function(e){w("opt_in_captureing"),this.opt_in_capturing(e)},b.prototype.opt_out_capturing=function(e){(e=i._.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(p.optOut,e),this._gdpr_update_persistence(e)},b.prototype.opt_out_captureing=function(e){w("opt_out_captureing"),this.opt_out_capturing(e)},b.prototype.has_opted_in_capturing=function(e){return this._gdpr_call_func(p.hasOptedIn,e)},b.prototype.has_opted_in_captureing=function(e){return w("has_opted_in_captureing"),this.has_opted_in_capturing(e)},b.prototype.has_opted_out_capturing=function(e){return this._gdpr_call_func(p.hasOptedOut,e)},b.prototype.has_opted_out_captureing=function(e){return w("has_opted_out_captureing"),this.has_opted_out_capturing(e)},b.prototype.clear_opt_in_out_capturing=function(e){e=i._.extend({enable_persistence:!0},e),this._gdpr_call_func(p.clearOptInOut,e),this._gdpr_update_persistence(e)},b.prototype.clear_opt_in_out_captureing=function(e){w("clear_opt_in_out_captureing"),this.clear_opt_in_out_capturing(e)},b.prototype.init=b.prototype.init,b.prototype.reset=b.prototype.reset,b.prototype.capture=b.prototype.capture,b.prototype.capture_links=b.prototype.capture_links,b.prototype.capture_forms=b.prototype.capture_forms,b.prototype.capture_pageview=b.prototype.capture_pageview,b.prototype.register=b.prototype.register,b.prototype.register_once=b.prototype.register_once,b.prototype.unregister=b.prototype.unregister,b.prototype.identify=b.prototype.identify,b.prototype.alias=b.prototype.alias,b.prototype.set_config=b.prototype.set_config,b.prototype.get_config=b.prototype.get_config,b.prototype.get_property=b.prototype.get_property,b.prototype.get_distinct_id=b.prototype.get_distinct_id,b.prototype.toString=b.prototype.toString,b.prototype.opt_out_captureing=b.prototype.opt_out_captureing,b.prototype.opt_in_captureing=b.prototype.opt_in_captureing,b.prototype.has_opted_out_captureing=b.prototype.has_opted_out_captureing,b.prototype.has_opted_in_captureing=b.prototype.has_opted_in_captureing,b.prototype.clear_opt_in_out_captureing=b.prototype.clear_opt_in_out_captureing,b.prototype.opt_out_capturing=b.prototype.opt_out_capturing,b.prototype.opt_in_capturing=b.prototype.opt_in_capturing,b.prototype.has_opted_out_capturing=b.prototype.has_opted_out_capturing,b.prototype.has_opted_in_capturing=b.prototype.has_opted_in_capturing,b.prototype.clear_opt_in_out_capturing=b.prototype.clear_opt_in_out_capturing,_.PostHogPersistence.prototype.properties=_.PostHogPersistence.prototype.properties,_.PostHogPersistence.prototype.update_search_keyword=_.PostHogPersistence.prototype.update_search_keyword,_.PostHogPersistence.prototype.update_referrer_info=_.PostHogPersistence.prototype.update_referrer_info,_.PostHogPersistence.prototype.get_cross_subdomain=_.PostHogPersistence.prototype.get_cross_subdomain,_.PostHogPersistence.prototype.clear=_.PostHogPersistence.prototype.clear,i._.safewrap_class(b,["identify"]);var q={},x=function(){i._.each(q,function(e,o){o!==g&&(t[o]=e)}),t._=i._},P=function(){t.init=function(o,r,n){if(n)return t[n]||(t[n]=q[n]=k(o,r,n),t[n]._loaded()),t[n];var s=t;q[g]?s=q[g]:o&&((s=k(o,r,g))._loaded(),q[g]=s),t=s,e===u&&(i.window[g]=t),x()}},E=function(){function e(){e.done||(e.done=!0,m=!0,f=!1,i._.each(q,function(e){e._dom_loaded()}))}if(i.document.addEventListener)"complete"===i.document.readyState?e():i.document.addEventListener("DOMContentLoaded",e,!1);else if(i.document.attachEvent){i.document.attachEvent("onreadystatechange",e);var t=!1;try{t=null===i.window.frameElement}catch(o){}i.document.documentElement.doScroll&&t&&function t(){try{i.document.documentElement.doScroll("left")}catch(o){return void setTimeout(t,1)}e()}()}i._.register_event(i.window,"load",e,!0)};function S(){e=u,i._.isUndefined(i.window.posthog)&&(i.window.posthog=[]),(t=i.window.posthog).__loaded||t.config&&t.persistence?i.console.error("PostHog library has already been downloaded at least once."):(i._.each(t._i,function(e){e&&i._.isArray(e)&&(q[e[e.length-1]]=k.apply(this,e))}),P(),t.init(),i._.each(q,function(e){e._loaded()}),E())}function A(){return e=a,t=new b,P(),t.init(),E(),t} | ||
},{"./config":"itQ5","./utils":"FOZT","./autocapture":"gR3r","./dom-capture":"OjnC","./posthog-people":"ecEG","./posthog-persistence":"MAdm","./gdpr-utils":"rxSh"}],"e2xX":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.init_from_snippet=H,exports.init_as_module=S;var e,t,o=c(require("./config")),i=require("./utils"),r=require("./autocapture"),n=require("./dom-capture"),p=require("./posthog-people"),s=require("./posthog-featureflags"),_=require("./posthog-persistence"),a=require("./gdpr-utils");function c(e){return e&&e.__esModule?e:{default:e}}var u=0,d=1,g=function(){},l={},h="posthog",f=i.window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,y=i.window.navigator.sendBeacon;y&&(y=i._.bind(y,i.navigator));var m={api_host:"https://t.posthog.com",api_method:"POST",api_transport:"XHR",autocapture:!0,cdn:"https://cdn.posthog.com",cross_subdomain_cookie:-1===i.document.location.hostname.indexOf("herokuapp.com"),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:function(){},store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,debug:!1,capture_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,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:[],xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1},v=!1,b=function(){},k=function(n,_,a){var c,d=a===h?t:t[a];if(d&&e===u)c=d;else{if(d&&!i._.isArray(d))return void i.console.error("You have already initialized "+a);c=new b}if(c._cached_groups={},c._user_decide_check_complete=!1,c._events_captureed_before_user_decide_check_complete=[],c._init(n,_,a),c.people=new p.PostHogPeople,c.people._init(c),c.feature_flags=new s.PostHogFeatureFlags,c.feature_flags._init(c),o.default.DEBUG=o.default.DEBUG||c.get_config("debug"),c.__autocapture_enabled=c.get_config("autocapture"),c.get_config("autocapture")){r.autocapture.enabledForProject(c.get_config("token"),100,100)?r.autocapture.isBrowserSupported()?r.autocapture.init(c):(c.__autocapture_enabled=!1,i.console.log("Disabling Automatic Event Collection because this browser is not supported")):(c.__autocapture_enabled=!1,i.console.log("Not in active bucket: disabling Automatic Event Collection."))}return!i._.isUndefined(d)&&i._.isArray(d)&&(c._execute_array.call(c.people,d.people),c._execute_array(d)),c};function w(e){i.window.console.warn("WARNING! posthog."+e+" is deprecated and will be removed soon! Please use posthog."+e.split("captureing").join("capturing")+' instead (without the "e")!')}b.prototype.init=function(e,o,r){if(i._.isUndefined(r))i.console.error("You must name your new library: init(token, config, name)");else{if(r!==h){var n=k(e,o,r);return t[r]=n,n._loaded(),n}i.console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}},b.prototype._init=function(e,t,o){this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(i._.extend({},m,t,{name:o,token:e,callback_fn:(o===h?o:h+"."+o)+"._jsc"})),this._jsc=function(){},this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.persistence=this.cookie=new _.PostHogPersistence(this.config),this._gdpr_init();var r=i._.UUID();this.get_distinct_id()||this.register_once({distinct_id:r,$device_id:r},""),i.window.addEventListener("unload",this._handle_unload.bind(this))},b.prototype._loaded=function(){this.get_config("loaded")(this),this.get_config("capture_pageview")&&this.capture_pageview()},b.prototype._dom_loaded=function(){i._.each(this.__dom_loaded_queue,function(e){this._capture_dom.apply(this,e)},this),this.has_opted_out_capturing()||i._.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},b.prototype._capture_dom=function(e,t){if(this.get_config("img"))return i.console.error("You can't use DOM capturing functions with img = true."),!1;if(!v)return this.__dom_loaded_queue.push([e,t]),!1;var o=(new e).init(this);return o.capture.apply(o,t)},b.prototype._prepare_callback=function(e,t){if(i._.isUndefined(e))return null;if(f){return function(o){e(o,t)}}var o=this._jsc,r=""+Math.floor(1e8*Math.random()),n=this.get_config("callback_fn")+"["+r+"]";return o[r]=function(i){delete o[r],e(i,t)},n},b.prototype._handle_unload=function(){this.capture("$pageleave",null,{transport:"sendbeacon"})},b.prototype._send_request=function(e,t,o,r){var n={method:this.get_config("api_method"),transport:this.get_config("api_transport")},p=null;r||!i._.isFunction(o)&&"string"!=typeof o||(r=o,o=null),o=i._.extend(n,o||{}),f||(o.method="GET");var s=y&&"sendbeacon"===o.transport.toLowerCase(),_=s||"POST"===o.method,a=this.get_config("verbose");t.verbose&&(a=!0),this.get_config("test")&&(t.test=1),a&&(t.verbose=1),this.get_config("img")&&(t.img=1),f||(r?t.callback=r:(a||this.get_config("test"))&&(t.callback="(function(){})"));var c={};if(c.ip=this.get_config("ip")?1:0,c._=(new Date).getTime().toString(),_&&(p=Array.isArray(t)?"data="+t:"data="+t.data,delete t.data),e+="?"+i._.HTTPBuildQuery(c),"img"in t){var u=i.document.createElement("img");u.src=e,i.document.body.appendChild(u)}else if(s){var d=new Blob([p],{type:"application/x-www-form-urlencoded"});y(e,d)}else if(f)try{var g=new XMLHttpRequest;g.open(o.method,e,!0);var l=this.get_config("xhr_headers");_&&(l["Content-Type"]="application/x-www-form-urlencoded"),i._.each(l,function(e,t){g.setRequestHeader(t,e)}),g.withCredentials=!0,g.onreadystatechange=function(){if(4===g.readyState)if(200===g.status){if(r){var e;try{e=i._.JSONDecode(g.responseText)}catch(o){return void i.console.error(o)}r(e)}}else{var t="Bad HTTP status: "+g.status+" "+g.statusText;i.console.error(t),r&&r(a?{status:0,error:t}:0)}},g.send(p)}catch(v){i.console.error(v)}else{var h=i.document.createElement("script");h.type="text/javascript",h.async=!0,h.defer=!0,h.src=e;var m=i.document.getElementsByTagName("script")[0];m.parentNode.insertBefore(h,m)}},b.prototype._execute_array=function(e){var t,o=[],r=[],n=[];i._.each(e,function(e){e&&(t=e[0],i._.isArray(t)?n.push(e):"function"==typeof e?e.call(this):i._.isArray(e)&&"alias"===t?o.push(e):i._.isArray(e)&&-1!==t.indexOf("capture")&&"function"==typeof this[t]?n.push(e):r.push(e))},this);var p=function(e,t){i._.each(e,function(e){if(i._.isArray(e[0])){var o=t;i._.each(e,function(e){o=o[e[0]].apply(o,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};p(o,this),p(r,this),p(n,this)},b.prototype.push=function(e){this._execute_array([e])},b.prototype.capture=(0,a.addOptOutCheckPostHogLib)(function(e,t,o,r){r||"function"!=typeof o||(r=o,o=null);var n=(o=o||l).transport;if(n&&(o.transport=n),"function"!=typeof r&&(r=g),i._.isUndefined(e))i.console.error("No event name provided to posthog.capture");else{if(!this._event_is_disabled(e)){(t=t||{}).token=this.get_config("token");var p=this.persistence.remove_event_timer(e);if(!i._.isUndefined(p)){var s=(new Date).getTime()-p;t.$duration=parseFloat((s/1e3).toFixed(3))}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),t=i._.extend({},i._.info.properties(),this.persistence.properties(),t);var _=this.get_config("property_blacklist");i._.isArray(_)?i._.each(_,function(e){delete t[e]}):i.console.error("Invalid value for property_blacklist config: "+_);var a={event:e,properties:t},c=i._.truncate(a,255),u=i._.JSONEncode(c),d=i._.base64Encode(u),h=this.get_config("api_host")+"/e/",f=this._prepare_callback(r,c);return this._send_request(h,{data:d},o,f),c}r(0)}}),b.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},b.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},b.prototype.capture_pageview=function(e){i._.isUndefined(e)&&(e=i.document.location.href),this.capture("$pageview")},b.prototype.capture_links=function(){return this._capture_dom.call(this,n.LinkCapture,arguments)},b.prototype.capture_forms=function(){return this._capture_dom.call(this,FormCaptureer,arguments)},b.prototype.register=function(e,t){this.persistence.register(e,t)},b.prototype.register_once=function(e,t,o){this.persistence.register_once(e,t,o)},b.prototype.unregister=function(e){this.persistence.unregister(e)},b.prototype._register_single=function(e,t){var o={};o[e]=t,this.register(o)},b.prototype.isFeatureEnabled=function(e){return this.feature_flags.isFeatureEnabled(e)},b.prototype.onFeatureFlags=function(e){return this.feature_flags.onFeatureFlags(e)},b.prototype.identify=function(e,t,o){if(e){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==r&&e!==this.get_property(_.ALIAS_ID_KEY)&&(this.unregister(_.ALIAS_ID_KEY),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,o),e!==r&&this.capture("$identify",{distinct_id:e,$anon_distinct_id:r})}else i.console.error("Unique user id has not been set in posthog.identify")},b.prototype.reset=function(e){var t=this.get_property("$device_id");this.persistence.clear(),this._flags.identify_called=!1;var o=i._.UUID();this.register_once({distinct_id:o,$device_id:e?o:t},"")},b.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},b.prototype.alias=function(e,t){if(e===this.get_property(_.PEOPLE_DISTINCT_ID_KEY))return i.console.critical("Attempting to create alias for existing People user - aborting."),-2;var o=this;return i._.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(_.ALIAS_ID_KEY,e),this.capture("$create_alias",{alias:e,distinct_id:t},function(){o.identify(e)})):(i.console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},b.prototype.set_config=function(e){i._.isObject(e)&&(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),o.default.DEBUG=o.default.DEBUG||this.get_config("debug"))},b.prototype.get_config=function(e){return this.config[e]},b.prototype.get_property=function(e){return this.persistence.props[e]},b.prototype.toString=function(){var e=this.get_config("name");return e!==h&&(e=h+"."+e),e},b.prototype._event_is_disabled=function(e){return i._.isBlockedUA(i.userAgent)||this._flags.disable_all_events||i._.include(this.__disabled_events,e)},b.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&i._.localStorage.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")&&!i._.cookie.get("ph_optout")||(i._.cookie.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},b.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)},b.prototype._gdpr_call_func=function(e,t){return t=i._.extend({capture:i._.bind(this.capture,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),i._.localStorage.is_supported()||(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})},b.prototype.opt_in_capturing=function(e){e=i._.extend({enable_persistence:!0},e),this._gdpr_call_func(a.optIn,e),this._gdpr_update_persistence(e)},b.prototype.opt_in_captureing=function(e){w("opt_in_captureing"),this.opt_in_capturing(e)},b.prototype.opt_out_capturing=function(e){(e=i._.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(a.optOut,e),this._gdpr_update_persistence(e)},b.prototype.opt_out_captureing=function(e){w("opt_out_captureing"),this.opt_out_capturing(e)},b.prototype.has_opted_in_capturing=function(e){return this._gdpr_call_func(a.hasOptedIn,e)},b.prototype.has_opted_in_captureing=function(e){return w("has_opted_in_captureing"),this.has_opted_in_capturing(e)},b.prototype.has_opted_out_capturing=function(e){return this._gdpr_call_func(a.hasOptedOut,e)},b.prototype.has_opted_out_captureing=function(e){return w("has_opted_out_captureing"),this.has_opted_out_capturing(e)},b.prototype.clear_opt_in_out_capturing=function(e){e=i._.extend({enable_persistence:!0},e),this._gdpr_call_func(a.clearOptInOut,e),this._gdpr_update_persistence(e)},b.prototype.clear_opt_in_out_captureing=function(e){w("clear_opt_in_out_captureing"),this.clear_opt_in_out_capturing(e)},b.prototype.init=b.prototype.init,b.prototype.reset=b.prototype.reset,b.prototype.capture=b.prototype.capture,b.prototype.capture_links=b.prototype.capture_links,b.prototype.capture_forms=b.prototype.capture_forms,b.prototype.capture_pageview=b.prototype.capture_pageview,b.prototype.register=b.prototype.register,b.prototype.register_once=b.prototype.register_once,b.prototype.unregister=b.prototype.unregister,b.prototype.identify=b.prototype.identify,b.prototype.alias=b.prototype.alias,b.prototype.set_config=b.prototype.set_config,b.prototype.get_config=b.prototype.get_config,b.prototype.get_property=b.prototype.get_property,b.prototype.get_distinct_id=b.prototype.get_distinct_id,b.prototype.toString=b.prototype.toString,b.prototype.opt_out_captureing=b.prototype.opt_out_captureing,b.prototype.opt_in_captureing=b.prototype.opt_in_captureing,b.prototype.has_opted_out_captureing=b.prototype.has_opted_out_captureing,b.prototype.has_opted_in_captureing=b.prototype.has_opted_in_captureing,b.prototype.clear_opt_in_out_captureing=b.prototype.clear_opt_in_out_captureing,b.prototype.opt_out_capturing=b.prototype.opt_out_capturing,b.prototype.opt_in_capturing=b.prototype.opt_in_capturing,b.prototype.has_opted_out_capturing=b.prototype.has_opted_out_capturing,b.prototype.has_opted_in_capturing=b.prototype.has_opted_in_capturing,b.prototype.clear_opt_in_out_capturing=b.prototype.clear_opt_in_out_capturing,b.prototype.isFeatureEnabled=b.prototype.isFeatureEnabled,b.prototype.onFeatureFlags=b.prototype.onFeatureFlags,_.PostHogPersistence.prototype.properties=_.PostHogPersistence.prototype.properties,_.PostHogPersistence.prototype.update_search_keyword=_.PostHogPersistence.prototype.update_search_keyword,_.PostHogPersistence.prototype.update_referrer_info=_.PostHogPersistence.prototype.update_referrer_info,_.PostHogPersistence.prototype.get_cross_subdomain=_.PostHogPersistence.prototype.get_cross_subdomain,_.PostHogPersistence.prototype.clear=_.PostHogPersistence.prototype.clear,i._.safewrap_class(b,["identify"]);var P={},x=function(){i._.each(P,function(e,o){o!==h&&(t[o]=e)}),t._=i._},E=function(){t.init=function(o,r,n){if(n)return t[n]||(t[n]=P[n]=k(o,r,n),t[n]._loaded()),t[n];var p=t;P[h]?p=P[h]:o&&((p=k(o,r,h))._loaded(),P[h]=p),t=p,e===d&&(i.window[h]=t),x()}},q=function(){function e(){e.done||(e.done=!0,v=!0,i._.each(P,function(e){e._dom_loaded()}))}if(i.document.addEventListener)"complete"===i.document.readyState?e():i.document.addEventListener("DOMContentLoaded",e,!1);else if(i.document.attachEvent){i.document.attachEvent("onreadystatechange",e);var t=!1;try{t=null===i.window.frameElement}catch(o){}i.document.documentElement.doScroll&&t&&function t(){try{i.document.documentElement.doScroll("left")}catch(o){return void setTimeout(t,1)}e()}()}i._.register_event(i.window,"load",e,!0)};function H(){e=d,i._.isUndefined(i.window.posthog)&&(i.window.posthog=[]),(t=i.window.posthog).__loaded||t.config&&t.persistence?i.console.error("PostHog library has already been downloaded at least once."):(i._.each(t._i,function(e){e&&i._.isArray(e)&&(P[e[e.length-1]]=k.apply(this,e))}),E(),t.init(),i._.each(P,function(e){e._loaded()}),q())}function S(){return e=u,t=new b,E(),t.init(),q(),t} | ||
},{"./config":"itQ5","./utils":"FOZT","./autocapture":"gR3r","./dom-capture":"OjnC","./posthog-people":"ecEG","./posthog-featureflags":"aVqC","./posthog-persistence":"MAdm","./gdpr-utils":"rxSh"}],"e2xX":[function(require,module,exports) { | ||
"use strict";var r=require("./posthog-core");(0,r.init_from_snippet)(); | ||
},{"./posthog-core":"ok3T"}]},{},["e2xX"], null) |
{ | ||
"name": "posthog-js", | ||
"version": "1.2.1", | ||
"version": "1.2.2-beta.0", | ||
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/PostHog/posthog-js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
546495
7
4439
3