posthog-js
Advanced tools
Comparing version 1.189.0 to 1.189.1
@@ -1,2 +0,2 @@ | ||
!function(){"use strict";var e;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(e||(e={}));var r=Array.isArray,n=Object.prototype,t=n.hasOwnProperty,i=n.toString,o=r||function(e){return"[object Array]"===i.call(e)},a=e=>void 0===e,s=e=>null===e,l=e=>"[object Number]"==i.call(e),u={DEBUG:!1,LIB_VERSION:"1.189.0"},c="undefined"!=typeof window?window:void 0,p="undefined"!=typeof globalThis?globalThis:c,f=Array.prototype.forEach,d=null==p?void 0:p.navigator,g=null==p?void 0:p.document,v=null==p?void 0:p.location;null==p||p.fetch,null!=p&&p.XMLHttpRequest&&"withCredentials"in new p.XMLHttpRequest&&p.XMLHttpRequest,null==p||p.AbortController;var h=null==d?void 0:d.userAgent,w=null!=c?c:{},_="[PostHog.js]",m={_log:function(e){if(c&&w.POSTHOG_DEBUG&&!a(c.console)&&c.console){for(var r=("__rrweb_original__"in c.console[e]?c.console[e].__rrweb_original__:c.console[e]),n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];r(_,...t)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];m._log("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];m._log("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];m._log("error",...r)},critical:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];console.error(_,...r)},uninitializedWarning:e=>{m.error("You must initialize PostHog before calling ".concat(e))}},b={};function $(e,r,n){if(o(e))if(f&&e.forEach===f)e.forEach(r,n);else if("length"in e&&e.length===+e.length)for(var t=0,i=e.length;t<i;t++)if(t in e&&r.call(n,e[t],t)===b)return}function E(e,r,n){if(!a(i=e)&&!s(i)){var i;if(o(e))return $(e,r,n);if((e=>e instanceof FormData)(e)){for(var l of e.entries())if(r.call(n,l[1],l[0])===b)return}else for(var u in e)if(t.call(e,u)&&r.call(n,e[u],u)===b)return}}var y=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];return $(n,(function(r){for(var n in r)void 0!==r[n]&&(e[n]=r[n])})),e};function P(e,r){return-1!==e.indexOf(r)}var x=function(e){var r={};return E(e,(function(e,n){var t;t=e,"[object String]"==i.call(t)&&e.length>0&&(r[n]=e)})),r},O=function(e){return e.replace(/^\$/,"")},R=e=>{var r=null==g?void 0:g.createElement("a");return a(r)?null:(r.href=e,r)},S=function(e,r){for(var n,t=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<t.length;i++){var a=t[i].split("=");if(a[0]===r){n=a;break}}if(!o(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){m.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},B="Mobile",I="iOS",A="Android",k="Tablet",j=A+" "+k,C="iPad",M="Apple",F=M+" Watch",T="Safari",D="BlackBerry",L="Samsung",U=L+"Browser",z=L+" Internet",W="Chrome",N=W+" OS",H=W+" "+I,X="Internet Explorer",V=X+" "+B,q="Opera",G=q+" Mini",K="Edge",Z="Microsoft "+K,Q="Firefox",J=Q+" "+I,Y="Nintendo",ee="PlayStation",re="Xbox",ne=A+" "+B,te=B+" "+T,ie="Windows",oe=ie+" Phone",ae="Nokia",se="Ouya",le="Generic",ue=le+" "+B.toLowerCase(),ce=le+" "+k.toLowerCase(),pe="Konqueror",fe="(\\d+(\\.\\d+)?)",de=new RegExp("Version/"+fe),ge=new RegExp(re,"i"),ve=new RegExp(ee+" \\w+","i"),he=new RegExp(Y+" \\w+","i"),we=new RegExp(D+"|PlayBook|BB10","i"),_e={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var me=(e,r)=>r&&P(r,M)||function(e){return P(e,T)&&!P(e,W)&&!P(e,A)}(e),be=function(e,r){return r=r||"",P(e," OPR/")&&P(e,"Mini")?G:P(e," OPR/")?q:we.test(e)?D:P(e,"IE"+B)||P(e,"WPDesktop")?V:P(e,U)?z:P(e,K)||P(e,"Edg/")?Z:P(e,"FBIOS")?"Facebook "+B:P(e,"UCWEB")||P(e,"UCBrowser")?"UC Browser":P(e,"CriOS")?H:P(e,"CrMo")?W:P(e,A)&&P(e,T)?ne:P(e,W)?W:P(e,"FxiOS")?J:P(e.toLowerCase(),pe.toLowerCase())?pe:me(e,r)?P(e,B)?te:T:P(e,Q)?Q:P(e,"MSIE")||P(e,"Trident/")?X:P(e,"Gecko")?Q:""},$e={[V]:[new RegExp("rv:"+fe)],[Z]:[new RegExp(K+"?\\/"+fe)],[W]:[new RegExp("("+W+"|CrMo)\\/"+fe)],[H]:[new RegExp("CriOS\\/"+fe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+fe)],[T]:[de],[te]:[de],[q]:[new RegExp("(Opera|OPR)\\/"+fe)],[Q]:[new RegExp(Q+"\\/"+fe)],[J]:[new RegExp("FxiOS\\/"+fe)],[pe]:[new RegExp("Konqueror[:/]?"+fe,"i")],[D]:[new RegExp(D+" "+fe),de],[ne]:[new RegExp("android\\s"+fe,"i")],[z]:[new RegExp(U+"\\/"+fe)],[X]:[new RegExp("(rv:|MSIE )"+fe)],Mozilla:[new RegExp("rv:"+fe)]},Ee=[[new RegExp(re+"; "+re+" (.*?)[);]","i"),e=>[re,e&&e[1]||""]],[new RegExp(Y,"i"),[Y,""]],[new RegExp(ee,"i"),[ee,""]],[we,[D,""]],[new RegExp(ie,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[oe,""];if(new RegExp(B).test(r)&&!/IEMobile\b/.test(r))return[ie+" "+B,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=n[1],i=_e[t]||"";return/arm/i.test(r)&&(i="RT"),[ie,i]}return[ie,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var r=[e[3],e[4],e[5]||"0"];return[I,r.join(".")]}return[I,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=a(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+A+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+A+")","i"),e=>{if(e&&e[2]){var r=[e[2],e[3],e[4]||"0"];return[A,r.join(".")]}return[A,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];r[1]=n.join(".")}return r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[N,""]],[/Linux|debian/i,["Linux",""]]],ye=function(e){return he.test(e)?Y:ve.test(e)?ee:ge.test(e)?re:new RegExp(se,"i").test(e)?se:new RegExp("("+oe+"|WPDesktop)","i").test(e)?oe:/iPad/.test(e)?C:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?F:we.test(e)?D:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ae,"i").test(e)?ae:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(B).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?A:j:A:new RegExp("(pda|"+B+")","i").test(e)?ue:new RegExp(k,"i").test(e)&&!new RegExp(k+" pc","i").test(e)?ce:""},Pe="https?://(.*)",xe=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],Oe=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer"],Re={campaignParams:function(e){return g?this._campaignParamsFromUrl(g.URL,e):{}},_campaignParamsFromUrl:function(e,r){var n=xe.concat(r||[]),t={};return E(n,(function(r){var n=S(e,r);t[r]=n||null})),t},_searchEngine:function(e){return e?0===e.search(Pe+"google.([^/?]*)")?"google":0===e.search(Pe+"bing.com")?"bing":0===e.search(Pe+"yahoo.com")?"yahoo":0===e.search(Pe+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var r=Re._searchEngine(e),n="yahoo"!=r?"q":"p",t={};if(!s(r)){t.$search_engine=r;var i=g?S(g.referrer,n):"";i.length&&(t.ph_keyword=i)}return t},searchInfo:function(){var e=null==g?void 0:g.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:be,browserVersion:function(e,r){var n=be(e,r),t=$e[n];if(a(t))return null;for(var i=0;i<t.length;i++){var o=t[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var r=0;r<Ee.length;r++){var[n,t]=Ee[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]},device:ye,deviceType:function(e){var r=ye(e);return r===C||r===j||"Kobo"===r||"Kindle Fire"===r||r===ce?k:r===Y||r===re||r===ee||r===se?"Console":r===F?"Wearable":r?B:"Desktop"},referrer:function(){return(null==g?void 0:g.referrer)||"$direct"},referringDomain:function(){var e;return null!=g&&g.referrer&&(null===(e=R(g.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==v?void 0:v.href}},initialPersonPropsFromInfo:function(e){var r,{r:n,u:t}=e,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(r=R(n))||void 0===r?void 0:r.host};if(t){i.$initial_current_url=t;var o=R(t);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,E(this._campaignParamsFromUrl(t),(function(e,r){i["$initial_"+O(r)]=e}))}n&&E(this._searchInfoFromReferrer(n),(function(e,r){i["$initial_"+O(r)]=e}));return i},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},properties:function(){if(!h)return{};var[e,r]=Re.os(h);return y(x({$os:e,$os_version:r,$browser:Re.browser(h,navigator.vendor),$device:Re.device(h),$device_type:Re.deviceType(h),$timezone:Re.timezone()}),{$current_url:null==v?void 0:v.href,$host:null==v?void 0:v.host,$pathname:null==v?void 0:v.pathname,$raw_user_agent:h.length>1e3?h.substring(0,997)+"...":h,$browser_version:Re.browserVersion(h,navigator.vendor),$browser_language:Re.browserLanguage(),$screen_height:null==c?void 0:c.screen.height,$screen_width:null==c?void 0:c.screen.width,$viewport_height:null==c?void 0:c.innerHeight,$viewport_width:null==c?void 0:c.innerWidth,$lib:"web",$lib_version:u.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!h)return{};var[e,r]=Re.os(h);return y(x({$os:e,$os_version:r,$browser:Re.browser(h,navigator.vendor)}),{$browser_version:Re.browserVersion(h,navigator.vendor)})}};function Se(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function Be(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Se(Object(n),!0).forEach((function(r){Ie(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function Ie(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Ae(e,r,n,t){return l(e)?e>n?n:e<r?r:e:n}function ke(e,r){return[...e||[],...o(r)?r:[r]]}function je(e,r){return(a(e)?1:e)*r}function Ce(e,r){return function(e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<Ae(100*r,0,100)}var Me=Object.freeze({__proto__:null,sampleByDistinctId:function(e){return r=>r&&Ce(r.properties.distinct_id,e)?Be(Be({},r),{},{properties:Be(Be({},r.properties),{},{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null},sampleByEvent:function(e,r){return n=>{var t,i,o;return n?P(e,n.event)?100*Math.random()<Ae(100*r,0,100)?Be(Be({},n),{},{properties:Be(Be({},n.properties),{},{$sample_type:ke(null===(t=n.properties)||void 0===t?void 0:t.$sample_type,"sampleByEvent"),$sample_threshold:je(null===(i=n.properties)||void 0===i?void 0:i.$sample_threshold,r),$sampled_events:ke(null===(o=n.properties)||void 0===o?void 0:o.$sampled_events,e)})}):null:n:null}},sampleBySessionId:function(e){return r=>r&&Ce(r.properties.$session_id,e)?Be(Be({},r),{},{properties:Be(Be({},r.properties),{},{$sample_type:ke(r.properties.$sample_type,"sampleBySessionId"),$sample_threshold:je(r.properties.$sample_threshold,e)})}):null},setAllPersonProfilePropertiesAsPersonPropertiesForFlags:e=>{var r=y({},Re.properties(),Re.campaignParams(),Re.referrerInfo()),n={};E(r,(function(e,r){(P(xe,r)||P(Oe,r))&&(n[r]=e)})),e.setPersonPropertiesForFlags(n)}});w.posthogCustomizations=Me}(); | ||
!function(){"use strict";var e;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(e||(e={}));var r=Array.isArray,n=Object.prototype,t=n.hasOwnProperty,i=n.toString,o=r||function(e){return"[object Array]"===i.call(e)},a=e=>void 0===e,s=e=>null===e,l=e=>"[object Number]"==i.call(e),u={DEBUG:!1,LIB_VERSION:"1.189.1"},c="undefined"!=typeof window?window:void 0,p="undefined"!=typeof globalThis?globalThis:c,f=Array.prototype.forEach,d=null==p?void 0:p.navigator,g=null==p?void 0:p.document,v=null==p?void 0:p.location;null==p||p.fetch,null!=p&&p.XMLHttpRequest&&"withCredentials"in new p.XMLHttpRequest&&p.XMLHttpRequest,null==p||p.AbortController;var h=null==d?void 0:d.userAgent,w=null!=c?c:{},_="[PostHog.js]",m={_log:function(e){if(c&&w.POSTHOG_DEBUG&&!a(c.console)&&c.console){for(var r=("__rrweb_original__"in c.console[e]?c.console[e].__rrweb_original__:c.console[e]),n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];r(_,...t)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];m._log("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];m._log("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];m._log("error",...r)},critical:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];console.error(_,...r)},uninitializedWarning:e=>{m.error("You must initialize PostHog before calling ".concat(e))}},b={};function $(e,r,n){if(o(e))if(f&&e.forEach===f)e.forEach(r,n);else if("length"in e&&e.length===+e.length)for(var t=0,i=e.length;t<i;t++)if(t in e&&r.call(n,e[t],t)===b)return}function E(e,r,n){if(!a(i=e)&&!s(i)){var i;if(o(e))return $(e,r,n);if((e=>e instanceof FormData)(e)){for(var l of e.entries())if(r.call(n,l[1],l[0])===b)return}else for(var u in e)if(t.call(e,u)&&r.call(n,e[u],u)===b)return}}var y=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];return $(n,(function(r){for(var n in r)void 0!==r[n]&&(e[n]=r[n])})),e};function P(e,r){return-1!==e.indexOf(r)}var x=function(e){var r={};return E(e,(function(e,n){var t;t=e,"[object String]"==i.call(t)&&e.length>0&&(r[n]=e)})),r},O=function(e){return e.replace(/^\$/,"")},R=e=>{var r=null==g?void 0:g.createElement("a");return a(r)?null:(r.href=e,r)},S=function(e,r){for(var n,t=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<t.length;i++){var a=t[i].split("=");if(a[0]===r){n=a;break}}if(!o(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){m.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},B="Mobile",I="iOS",A="Android",k="Tablet",j=A+" "+k,C="iPad",M="Apple",F=M+" Watch",T="Safari",D="BlackBerry",L="Samsung",U=L+"Browser",z=L+" Internet",W="Chrome",N=W+" OS",H=W+" "+I,X="Internet Explorer",V=X+" "+B,q="Opera",G=q+" Mini",K="Edge",Z="Microsoft "+K,Q="Firefox",J=Q+" "+I,Y="Nintendo",ee="PlayStation",re="Xbox",ne=A+" "+B,te=B+" "+T,ie="Windows",oe=ie+" Phone",ae="Nokia",se="Ouya",le="Generic",ue=le+" "+B.toLowerCase(),ce=le+" "+k.toLowerCase(),pe="Konqueror",fe="(\\d+(\\.\\d+)?)",de=new RegExp("Version/"+fe),ge=new RegExp(re,"i"),ve=new RegExp(ee+" \\w+","i"),he=new RegExp(Y+" \\w+","i"),we=new RegExp(D+"|PlayBook|BB10","i"),_e={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var me=(e,r)=>r&&P(r,M)||function(e){return P(e,T)&&!P(e,W)&&!P(e,A)}(e),be=function(e,r){return r=r||"",P(e," OPR/")&&P(e,"Mini")?G:P(e," OPR/")?q:we.test(e)?D:P(e,"IE"+B)||P(e,"WPDesktop")?V:P(e,U)?z:P(e,K)||P(e,"Edg/")?Z:P(e,"FBIOS")?"Facebook "+B:P(e,"UCWEB")||P(e,"UCBrowser")?"UC Browser":P(e,"CriOS")?H:P(e,"CrMo")?W:P(e,A)&&P(e,T)?ne:P(e,W)?W:P(e,"FxiOS")?J:P(e.toLowerCase(),pe.toLowerCase())?pe:me(e,r)?P(e,B)?te:T:P(e,Q)?Q:P(e,"MSIE")||P(e,"Trident/")?X:P(e,"Gecko")?Q:""},$e={[V]:[new RegExp("rv:"+fe)],[Z]:[new RegExp(K+"?\\/"+fe)],[W]:[new RegExp("("+W+"|CrMo)\\/"+fe)],[H]:[new RegExp("CriOS\\/"+fe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+fe)],[T]:[de],[te]:[de],[q]:[new RegExp("(Opera|OPR)\\/"+fe)],[Q]:[new RegExp(Q+"\\/"+fe)],[J]:[new RegExp("FxiOS\\/"+fe)],[pe]:[new RegExp("Konqueror[:/]?"+fe,"i")],[D]:[new RegExp(D+" "+fe),de],[ne]:[new RegExp("android\\s"+fe,"i")],[z]:[new RegExp(U+"\\/"+fe)],[X]:[new RegExp("(rv:|MSIE )"+fe)],Mozilla:[new RegExp("rv:"+fe)]},Ee=[[new RegExp(re+"; "+re+" (.*?)[);]","i"),e=>[re,e&&e[1]||""]],[new RegExp(Y,"i"),[Y,""]],[new RegExp(ee,"i"),[ee,""]],[we,[D,""]],[new RegExp(ie,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[oe,""];if(new RegExp(B).test(r)&&!/IEMobile\b/.test(r))return[ie+" "+B,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=n[1],i=_e[t]||"";return/arm/i.test(r)&&(i="RT"),[ie,i]}return[ie,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var r=[e[3],e[4],e[5]||"0"];return[I,r.join(".")]}return[I,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=a(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+A+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+A+")","i"),e=>{if(e&&e[2]){var r=[e[2],e[3],e[4]||"0"];return[A,r.join(".")]}return[A,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];r[1]=n.join(".")}return r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[N,""]],[/Linux|debian/i,["Linux",""]]],ye=function(e){return he.test(e)?Y:ve.test(e)?ee:ge.test(e)?re:new RegExp(se,"i").test(e)?se:new RegExp("("+oe+"|WPDesktop)","i").test(e)?oe:/iPad/.test(e)?C:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?F:we.test(e)?D:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ae,"i").test(e)?ae:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(B).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?A:j:A:new RegExp("(pda|"+B+")","i").test(e)?ue:new RegExp(k,"i").test(e)&&!new RegExp(k+" pc","i").test(e)?ce:""},Pe="https?://(.*)",xe=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],Oe=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer"],Re={campaignParams:function(e){return g?this._campaignParamsFromUrl(g.URL,e):{}},_campaignParamsFromUrl:function(e,r){var n=xe.concat(r||[]),t={};return E(n,(function(r){var n=S(e,r);t[r]=n||null})),t},_searchEngine:function(e){return e?0===e.search(Pe+"google.([^/?]*)")?"google":0===e.search(Pe+"bing.com")?"bing":0===e.search(Pe+"yahoo.com")?"yahoo":0===e.search(Pe+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var r=Re._searchEngine(e),n="yahoo"!=r?"q":"p",t={};if(!s(r)){t.$search_engine=r;var i=g?S(g.referrer,n):"";i.length&&(t.ph_keyword=i)}return t},searchInfo:function(){var e=null==g?void 0:g.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:be,browserVersion:function(e,r){var n=be(e,r),t=$e[n];if(a(t))return null;for(var i=0;i<t.length;i++){var o=t[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var r=0;r<Ee.length;r++){var[n,t]=Ee[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]},device:ye,deviceType:function(e){var r=ye(e);return r===C||r===j||"Kobo"===r||"Kindle Fire"===r||r===ce?k:r===Y||r===re||r===ee||r===se?"Console":r===F?"Wearable":r?B:"Desktop"},referrer:function(){return(null==g?void 0:g.referrer)||"$direct"},referringDomain:function(){var e;return null!=g&&g.referrer&&(null===(e=R(g.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==v?void 0:v.href}},initialPersonPropsFromInfo:function(e){var r,{r:n,u:t}=e,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(r=R(n))||void 0===r?void 0:r.host};if(t){i.$initial_current_url=t;var o=R(t);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,E(this._campaignParamsFromUrl(t),(function(e,r){i["$initial_"+O(r)]=e}))}n&&E(this._searchInfoFromReferrer(n),(function(e,r){i["$initial_"+O(r)]=e}));return i},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},properties:function(){if(!h)return{};var[e,r]=Re.os(h);return y(x({$os:e,$os_version:r,$browser:Re.browser(h,navigator.vendor),$device:Re.device(h),$device_type:Re.deviceType(h),$timezone:Re.timezone()}),{$current_url:null==v?void 0:v.href,$host:null==v?void 0:v.host,$pathname:null==v?void 0:v.pathname,$raw_user_agent:h.length>1e3?h.substring(0,997)+"...":h,$browser_version:Re.browserVersion(h,navigator.vendor),$browser_language:Re.browserLanguage(),$screen_height:null==c?void 0:c.screen.height,$screen_width:null==c?void 0:c.screen.width,$viewport_height:null==c?void 0:c.innerHeight,$viewport_width:null==c?void 0:c.innerWidth,$lib:"web",$lib_version:u.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!h)return{};var[e,r]=Re.os(h);return y(x({$os:e,$os_version:r,$browser:Re.browser(h,navigator.vendor)}),{$browser_version:Re.browserVersion(h,navigator.vendor)})}};function Se(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function Be(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Se(Object(n),!0).forEach((function(r){Ie(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function Ie(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Ae(e,r,n,t){return l(e)?e>n?n:e<r?r:e:n}function ke(e,r){return[...e||[],...o(r)?r:[r]]}function je(e,r){return(a(e)?1:e)*r}function Ce(e,r){return function(e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<Ae(100*r,0,100)}var Me=Object.freeze({__proto__:null,sampleByDistinctId:function(e){return r=>r&&Ce(r.properties.distinct_id,e)?Be(Be({},r),{},{properties:Be(Be({},r.properties),{},{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null},sampleByEvent:function(e,r){return n=>{var t,i,o;return n?P(e,n.event)?100*Math.random()<Ae(100*r,0,100)?Be(Be({},n),{},{properties:Be(Be({},n.properties),{},{$sample_type:ke(null===(t=n.properties)||void 0===t?void 0:t.$sample_type,"sampleByEvent"),$sample_threshold:je(null===(i=n.properties)||void 0===i?void 0:i.$sample_threshold,r),$sampled_events:ke(null===(o=n.properties)||void 0===o?void 0:o.$sampled_events,e)})}):null:n:null}},sampleBySessionId:function(e){return r=>r&&Ce(r.properties.$session_id,e)?Be(Be({},r),{},{properties:Be(Be({},r.properties),{},{$sample_type:ke(r.properties.$sample_type,"sampleBySessionId"),$sample_threshold:je(r.properties.$sample_threshold,e)})}):null},setAllPersonProfilePropertiesAsPersonPropertiesForFlags:e=>{var r=y({},Re.properties(),Re.campaignParams(),Re.referrerInfo()),n={};E(r,(function(e,r){(P(xe,r)||P(Oe,r))&&(n[r]=e)})),e.setPersonPropertiesForFlags(n)}});w.posthogCustomizations=Me}(); | ||
//# sourceMappingURL=customizations.full.js.map |
@@ -1,2 +0,2 @@ | ||
!function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var r="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:r,a=Array.prototype.forEach,o=null==i?void 0:i.navigator,l=null==i?void 0:i.document;null==i||i.location,null==i||i.fetch,null!=i&&i.XMLHttpRequest&&"withCredentials"in new i.XMLHttpRequest&&i.XMLHttpRequest,null==i||i.AbortController,null==o||o.userAgent;var s=null!=r?r:{},c="[PostHog.js]",u={_log:function(t){if(r&&s.POSTHOG_DEBUG&&!M(r.console)&&r.console){for(var e=("__rrweb_original__"in r.console[t]?r.console[t].__rrweb_original__:r.console[t]),n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];e(c,...i)}},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u._log("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u._log("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u._log("error",...e)},critical:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];console.error(c,...e)},uninitializedWarning:t=>{u.error("You must initialize PostHog before calling ".concat(t))}},_={},h=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function d(t,e,n){if(w(t))if(a&&t.forEach===a)t.forEach(e,n);else if("length"in t&&t.length===+t.length)for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===_)return}function f(t,e,n){if(!A(t)){if(w(t))return d(t,e,n);if($(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===_)return}else for(var i in t)if(C.call(t,i)&&e.call(n,t[i],i)===_)return}}var m,v=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return d(n,(function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])})),t};function g(t,e){return-1!==t.indexOf(e)}function p(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}!function(t){t.GZipJS="gzip-js",t.Base64="base64"}(m||(m={}));var b=Array.isArray,y=Object.prototype,C=y.hasOwnProperty,k=y.toString,w=b||function(t){return"[object Array]"===k.call(t)},O=t=>"function"==typeof t,x=t=>O(t)&&-1!==t.toString().indexOf("[native code]"),D=t=>!!O(t)&&Object.getOwnPropertyNames(t.prototype||{}).some((t=>t.indexOf("__zone"))),M=t=>void 0===t,E=t=>"[object String]"==k.call(t),N=t=>null===t,A=t=>M(t)||N(t),S=t=>"[object Number]"==k.call(t),$=t=>t instanceof FormData;function j(t){return!!t&&1===t.nodeType}function L(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function P(t){return t?h(t).split(/\s+/):[]}function T(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return P(e)}function R(t){var e="";return H(t)&&!q(t)&&t.childNodes&&t.childNodes.length&&f(t.childNodes,(function(t){var n,r;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(r=t.textContent,n=A(r)?null:h(r).split(/(\s+)/).filter((t=>V(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))&&void 0!==n?n:"")})),h(e)}var F=["a","button","form","input","select","textarea","label"];function H(t){for(var e=t;e.parentNode&&!L(e,"body");e=e.parentNode){var n=T(e);if(g(n,"ph-sensitive")||g(n,"ph-no-capture"))return!1}if(g(T(t),"ph-include"))return!0;var r=t.type||"";if(E(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";if(E(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 q(t){return!!(L(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||L(t,"select")||L(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var z="(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})",G=new RegExp("^(?:".concat(z,")$")),B=new RegExp(z),W="\\d{3}-?\\d{2}-?\\d{4}",X=new RegExp("^(".concat(W,")$")),I=new RegExp("(".concat(W,")"));function V(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(A(t))return!1;if(E(t)){if(t=h(t),(e?G:B).test((t||"").replace(/[- ]/g,"")))return!1;if((e?X:I).test(t))return!1}return!0}function Z(t){var e=R(t);return V(e="".concat(e," ").concat(J(t)).trim())?e:""}function J(t){var e="";return t&&t.childNodes&&t.childNodes.length&&f(t.childNodes,(function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=R(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(J(t)).trim())}catch(t){u.error(t)}})),e}function U(t){return function(t){var n=t.map((t=>{var n,r,i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class)for(var a of(t.attr_class.sort(),t.attr_class))i+=".".concat(a.replace(/"/g,""));var o=e(e(e(e({},t.text?{text:t.text}:{}),{},{"nth-child":null!==(n=t.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{}),t.attr_id?{attr_id:t.attr_id}:{}),t.attributes),l={};return p(o).sort(((t,e)=>{var[n]=t,[r]=e;return n.localeCompare(r)})).forEach((t=>{var[e,n]=t;return l[Y(e.toString())]=Y(n.toString())})),i+=":",i+=p(o).map((t=>{var[e,n]=t;return"".concat(e,'="').concat(n,'"')})).join("")}));return n.join(";")}(function(t){return t.map((t=>{var e,n,r={text:null===(e=t.$el_text)||void 0===e?void 0:e.slice(0,400),tag_name:t.tag_name,href:null===(n=t.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:K(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return p(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,n]=t;return r.attributes[e]=n})),r}))}(t))}function Y(t){return t.replace(/"|\\"/g,'\\"')}function K(t){var e=t.attr__class;return e?w(e)?e:P(e):void 0}function Q(t,e){return e.length>t?e.slice(0,t)+"...":e}function tt(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!j(e));return e}function et(t,e,n,r){var i=t.tagName.toLowerCase(),a={tag_name:i};F.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?a.$el_text=Q(1024,Z(t)):a.$el_text=Q(1024,R(t)));var o=T(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),f(t.attributes,(function(n){var i;if((!q(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!e&&V(n.value)&&(i=n.name,!E(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var o=n.value;"class"===n.name&&(o=P(o).join(" ")),a["attr__"+n.name]=Q(1024,o)}}));for(var l=1,s=1,c=t;c=tt(c);)l++,c.tagName===t.tagName&&s++;return a.nth_child=l,a.nth_of_type=s,a}function nt(t,e){for(var n,i,a,{e:o,maskAllElementAttributes:s,maskAllText:c,elementAttributeIgnoreList:u,elementsChainAsString:_}=e,h=[t],d=t;d.parentNode&&!L(d,"body");)(a=d.parentNode)&&11===a.nodeType?(h.push(d.parentNode.host),d=d.parentNode.host):(h.push(d.parentNode),d=d.parentNode);var m,p,b,y=[],C={},k=!1,w=!1;if(f(h,(t=>{var e=H(t);"a"===t.tagName.toLowerCase()&&(k=t.getAttribute("href"),k=e&&k&&V(k)&&k),g(T(t),"ph-no-capture")&&(w=!0),y.push(et(t,s,c,u));var n=function(t){if(!H(t))return{};var e={};return f(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var n=t.name.replace("data-ph-capture-attribute-",""),r=t.value;n&&r&&V(r)&&(e[n]=r)}})),e}(t);v(C,n)})),w)return{props:{},explicitNoCapture:w};if(c||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?y[0].$el_text=Z(t):y[0].$el_text=R(t)),k){var O,x;y[0].attr__href=k;var D=null===(p=k,b=null==l?void 0:l.createElement("a"),O=M(b)?null:(b.href=p,b))||void 0===O?void 0:O.host,E=null==r||null===(x=r.location)||void 0===x?void 0:x.host;D&&E&&D!==E&&(m=k)}return{props:v({$event_type:o.type,$ce_version:1},_?{$elements_chain:U(y)}:{$elements:y},null!==(n=y[0])&&void 0!==n&&n.$el_text?{$el_text:null===(i=y[0])||void 0===i?void 0:i.$el_text}:{},m&&"click"===o.type?{$external_click_url:m}:{},C)}}var rt={};function it(t){return function(t,e){var n=rt[t];if(n)return n;var r=e[t];if(x(r)&&!D(r))return rt[t]=r.bind(e);var i=e.document;if(i&&O(i.createElement))try{var a=i.createElement("iframe");a.hidden=!0,i.head.appendChild(a);var o=a.contentWindow;o&&o[t]&&(r=o[t]),i.head.removeChild(a)}catch(e){u.warn("Could not create sandbox iframe for ".concat(t," check, bailing to assignableWindow.").concat(t,": "),e)}return r&&O(r)?rt[t]=r.bind(e):r}("MutationObserver",t)}function at(t){var e,n,r=M((e=t).target)?e.srcElement||null:null!==(n=e.target)&&void 0!==n&&n.shadowRoot?e.composedPath()[0]||null:e.target||null;return r?{node:r,originalEvent:t,timestamp:Date.now()}:null}function ot(t,e){return S(t)&&t>=e}class lt{asRequiredConfig(t){var e,n,r,i,a=this._defaultConfig((null==t?void 0:t.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:a.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==t?void 0:t.scroll_threshold_ms)&&void 0!==n?n:a.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:a.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==t?void 0:t.mutation_threshold_ms)&&void 0!==i?i:a.mutation_threshold_ms,__onCapture:a.__onCapture}}constructor(t,e){n(this,"_clicks",[]),n(this,"_defaultConfig",(t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:t}))),n(this,"_onClick",(t=>{var e=at(t);N(e)||this._ignoreClick(e)||this._clicks.push(e),this._clicks.length&&M(this._checkClickTimer)&&(this._checkClickTimer=s.setTimeout((()=>{this._checkClicks()}),1e3))})),n(this,"_onScroll",(()=>{var t=Date.now();t%50==0&&this._clicks.forEach((e=>{M(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))})),n(this,"_onSelectionChange",(()=>{this._lastSelectionChanged=Date.now()})),this.instance=t,this._config=this.asRequiredConfig(e),this._onCapture=this._config.__onCapture}start(t){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(t)}_startMutationObserver(t){if(!this._mutationObserver){var e=it(s);this._mutationObserver=new e((t=>{this.onMutation(t)})),this._mutationObserver.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null===(t=this._mutationObserver)||void 0===t||t.disconnect(),this._mutationObserver=void 0,s.removeEventListener("click",this._onClick),s.removeEventListener("scroll",this._onScroll,!0),s.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(t){this._lastMutation=Date.now()}_startClickObserver(){s.addEventListener("click",this._onClick)}_startScrollObserver(){s.addEventListener("scroll",this._onScroll,!0)}_startSelectionChangedObserver(){s.addEventListener("selectionchange",this._onSelectionChange)}_ignoreClick(t){return!t||(!!("__POSTHOG_TOOLBAR__"===(e=t.node).id||null!==(n=e.closest)&&void 0!==n&&n.call(e,".toolbar-global-fade-container"))||(!!this._clicks.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3))||!(!L(t.node,"html")&&j(t.node)&&!F.includes(t.node.tagName.toLowerCase()))));var e,n}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var t=this._clicks;for(var e of(this._clicks=[],t)){var n;e.mutationDelayMs=null!==(n=e.mutationDelayMs)&&void 0!==n?n:this._lastMutation&&e.timestamp<=this._lastMutation?this._lastMutation-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this._lastSelectionChanged&&e.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-e.timestamp:void 0;var r=ot(e.scrollDelayMs,this._config.scroll_threshold_ms),i=ot(e.selectionChangedDelayMs,this._config.selection_change_threshold_ms),a=ot(e.mutationDelayMs,this._config.mutation_threshold_ms),o=ot(e.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),l=S(e.scrollDelayMs)&&e.scrollDelayMs<this._config.scroll_threshold_ms,c=S(e.mutationDelayMs)&&e.mutationDelayMs<this._config.mutation_threshold_ms,u=S(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this._config.selection_change_threshold_ms;l||c||u||(r||a||o||i?this._onCapture(e,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:a,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:i}):e.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(e))}this._clicks.length&&M(this._checkClickTimer)&&(this._checkClickTimer=s.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(t,n){this.instance.capture("$dead_click",e(e(e({},n),nt(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props),{},{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new lt(t,e)}(); | ||
!function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var r="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:r,a=Array.prototype.forEach,o=null==i?void 0:i.navigator,l=null==i?void 0:i.document;null==i||i.location,null==i||i.fetch,null!=i&&i.XMLHttpRequest&&"withCredentials"in new i.XMLHttpRequest&&i.XMLHttpRequest,null==i||i.AbortController,null==o||o.userAgent;var s=null!=r?r:{},c="[PostHog.js]",u={_log:function(t){if(r&&s.POSTHOG_DEBUG&&!M(r.console)&&r.console){for(var e=("__rrweb_original__"in r.console[t]?r.console[t].__rrweb_original__:r.console[t]),n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];e(c,...i)}},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u._log("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u._log("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];u._log("error",...e)},critical:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];console.error(c,...e)},uninitializedWarning:t=>{u.error("You must initialize PostHog before calling ".concat(t))}},_={},h=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function d(t,e,n){if(w(t))if(a&&t.forEach===a)t.forEach(e,n);else if("length"in t&&t.length===+t.length)for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===_)return}function f(t,e,n){if(!A(t)){if(w(t))return d(t,e,n);if($(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===_)return}else for(var i in t)if(C.call(t,i)&&e.call(n,t[i],i)===_)return}}var m,v=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return d(n,(function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])})),t};function g(t,e){return-1!==t.indexOf(e)}function p(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}!function(t){t.GZipJS="gzip-js",t.Base64="base64"}(m||(m={}));var b=Array.isArray,y=Object.prototype,C=y.hasOwnProperty,k=y.toString,w=b||function(t){return"[object Array]"===k.call(t)},O=t=>"function"==typeof t,x=t=>O(t)&&-1!==t.toString().indexOf("[native code]"),D=t=>!!O(t)&&Object.getOwnPropertyNames(t.prototype||{}).some((t=>t.indexOf("__zone"))),M=t=>void 0===t,E=t=>"[object String]"==k.call(t),N=t=>null===t,A=t=>M(t)||N(t),S=t=>"[object Number]"==k.call(t),$=t=>t instanceof FormData;function j(t){return!!t&&1===t.nodeType}function L(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function P(t){return t?h(t).split(/\s+/):[]}function T(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return P(e)}function R(t){var e="";return H(t)&&!q(t)&&t.childNodes&&t.childNodes.length&&f(t.childNodes,(function(t){var n,r;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(r=t.textContent,n=A(r)?null:h(r).split(/(\s+)/).filter((t=>V(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))&&void 0!==n?n:"")})),h(e)}var F=["a","button","form","input","select","textarea","label"];function H(t){for(var e=t;e.parentNode&&!L(e,"body");e=e.parentNode){var n=T(e);if(g(n,"ph-sensitive")||g(n,"ph-no-capture"))return!1}if(g(T(t),"ph-include"))return!0;var r=t.type||"";if(E(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";if(E(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 q(t){return!!(L(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||L(t,"select")||L(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var z="(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})",G=new RegExp("^(?:".concat(z,")$")),B=new RegExp(z),W="\\d{3}-?\\d{2}-?\\d{4}",X=new RegExp("^(".concat(W,")$")),I=new RegExp("(".concat(W,")"));function V(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(A(t))return!1;if(E(t)){if(t=h(t),(e?G:B).test((t||"").replace(/[- ]/g,"")))return!1;if((e?X:I).test(t))return!1}return!0}function Z(t){var e=R(t);return V(e="".concat(e," ").concat(J(t)).trim())?e:""}function J(t){var e="";return t&&t.childNodes&&t.childNodes.length&&f(t.childNodes,(function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=R(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(J(t)).trim())}catch(t){u.error(t)}})),e}function U(t){return function(t){var n=t.map((t=>{var n,r,i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class)for(var a of(t.attr_class.sort(),t.attr_class))i+=".".concat(a.replace(/"/g,""));var o=e(e(e(e({},t.text?{text:t.text}:{}),{},{"nth-child":null!==(n=t.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{}),t.attr_id?{attr_id:t.attr_id}:{}),t.attributes),l={};return p(o).sort(((t,e)=>{var[n]=t,[r]=e;return n.localeCompare(r)})).forEach((t=>{var[e,n]=t;return l[Y(e.toString())]=Y(n.toString())})),i+=":",i+=p(o).map((t=>{var[e,n]=t;return"".concat(e,'="').concat(n,'"')})).join("")}));return n.join(";")}(function(t){return t.map((t=>{var e,n,r={text:null===(e=t.$el_text)||void 0===e?void 0:e.slice(0,400),tag_name:t.tag_name,href:null===(n=t.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:K(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return p(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,n]=t;return r.attributes[e]=n})),r}))}(t))}function Y(t){return t.replace(/"|\\"/g,'\\"')}function K(t){var e=t.attr__class;return e?w(e)?e:P(e):void 0}function Q(t,e){return e.length>t?e.slice(0,t)+"...":e}function tt(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!j(e));return e}function et(t,e,n,r){var i=t.tagName.toLowerCase(),a={tag_name:i};F.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?a.$el_text=Q(1024,Z(t)):a.$el_text=Q(1024,R(t)));var o=T(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),f(t.attributes,(function(n){var i;if((!q(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!e&&V(n.value)&&(i=n.name,!E(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var o=n.value;"class"===n.name&&(o=P(o).join(" ")),a["attr__"+n.name]=Q(1024,o)}}));for(var l=1,s=1,c=t;c=tt(c);)l++,c.tagName===t.tagName&&s++;return a.nth_child=l,a.nth_of_type=s,a}function nt(t,e){for(var n,i,a,{e:o,maskAllElementAttributes:s,maskAllText:c,elementAttributeIgnoreList:u,elementsChainAsString:_}=e,h=[t],d=t;d.parentNode&&!L(d,"body");)(a=d.parentNode)&&11===a.nodeType?(h.push(d.parentNode.host),d=d.parentNode.host):(h.push(d.parentNode),d=d.parentNode);var m,p,b,y=[],C={},k=!1,w=!1;if(f(h,(t=>{var e=H(t);"a"===t.tagName.toLowerCase()&&(k=t.getAttribute("href"),k=e&&k&&V(k)&&k),g(T(t),"ph-no-capture")&&(w=!0),y.push(et(t,s,c,u));var n=function(t){if(!H(t))return{};var e={};return f(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var n=t.name.replace("data-ph-capture-attribute-",""),r=t.value;n&&r&&V(r)&&(e[n]=r)}})),e}(t);v(C,n)})),w)return{props:{},explicitNoCapture:w};if(c||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?y[0].$el_text=Z(t):y[0].$el_text=R(t)),k){var O,x;y[0].attr__href=k;var D=null===(p=k,b=null==l?void 0:l.createElement("a"),O=M(b)?null:(b.href=p,b))||void 0===O?void 0:O.host,E=null==r||null===(x=r.location)||void 0===x?void 0:x.host;D&&E&&D!==E&&(m=k)}return{props:v({$event_type:o.type,$ce_version:1},_?{}:{$elements:y},{$elements_chain:U(y)},null!==(n=y[0])&&void 0!==n&&n.$el_text?{$el_text:null===(i=y[0])||void 0===i?void 0:i.$el_text}:{},m&&"click"===o.type?{$external_click_url:m}:{},C)}}var rt={};function it(t){return function(t,e){var n=rt[t];if(n)return n;var r=e[t];if(x(r)&&!D(r))return rt[t]=r.bind(e);var i=e.document;if(i&&O(i.createElement))try{var a=i.createElement("iframe");a.hidden=!0,i.head.appendChild(a);var o=a.contentWindow;o&&o[t]&&(r=o[t]),i.head.removeChild(a)}catch(e){u.warn("Could not create sandbox iframe for ".concat(t," check, bailing to assignableWindow.").concat(t,": "),e)}return r&&O(r)?rt[t]=r.bind(e):r}("MutationObserver",t)}function at(t){var e,n,r=M((e=t).target)?e.srcElement||null:null!==(n=e.target)&&void 0!==n&&n.shadowRoot?e.composedPath()[0]||null:e.target||null;return r?{node:r,originalEvent:t,timestamp:Date.now()}:null}function ot(t,e){return S(t)&&t>=e}class lt{asRequiredConfig(t){var e,n,r,i,a=this._defaultConfig((null==t?void 0:t.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:a.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==t?void 0:t.scroll_threshold_ms)&&void 0!==n?n:a.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:a.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==t?void 0:t.mutation_threshold_ms)&&void 0!==i?i:a.mutation_threshold_ms,__onCapture:a.__onCapture}}constructor(t,e){n(this,"_clicks",[]),n(this,"_defaultConfig",(t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:t}))),n(this,"_onClick",(t=>{var e=at(t);N(e)||this._ignoreClick(e)||this._clicks.push(e),this._clicks.length&&M(this._checkClickTimer)&&(this._checkClickTimer=s.setTimeout((()=>{this._checkClicks()}),1e3))})),n(this,"_onScroll",(()=>{var t=Date.now();t%50==0&&this._clicks.forEach((e=>{M(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))})),n(this,"_onSelectionChange",(()=>{this._lastSelectionChanged=Date.now()})),this.instance=t,this._config=this.asRequiredConfig(e),this._onCapture=this._config.__onCapture}start(t){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(t)}_startMutationObserver(t){if(!this._mutationObserver){var e=it(s);this._mutationObserver=new e((t=>{this.onMutation(t)})),this._mutationObserver.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null===(t=this._mutationObserver)||void 0===t||t.disconnect(),this._mutationObserver=void 0,s.removeEventListener("click",this._onClick),s.removeEventListener("scroll",this._onScroll,!0),s.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(t){this._lastMutation=Date.now()}_startClickObserver(){s.addEventListener("click",this._onClick)}_startScrollObserver(){s.addEventListener("scroll",this._onScroll,!0)}_startSelectionChangedObserver(){s.addEventListener("selectionchange",this._onSelectionChange)}_ignoreClick(t){return!t||(!!("__POSTHOG_TOOLBAR__"===(e=t.node).id||null!==(n=e.closest)&&void 0!==n&&n.call(e,".toolbar-global-fade-container"))||(!!this._clicks.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3))||!(!L(t.node,"html")&&j(t.node)&&!F.includes(t.node.tagName.toLowerCase()))));var e,n}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var t=this._clicks;for(var e of(this._clicks=[],t)){var n;e.mutationDelayMs=null!==(n=e.mutationDelayMs)&&void 0!==n?n:this._lastMutation&&e.timestamp<=this._lastMutation?this._lastMutation-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this._lastSelectionChanged&&e.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-e.timestamp:void 0;var r=ot(e.scrollDelayMs,this._config.scroll_threshold_ms),i=ot(e.selectionChangedDelayMs,this._config.selection_change_threshold_ms),a=ot(e.mutationDelayMs,this._config.mutation_threshold_ms),o=ot(e.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),l=S(e.scrollDelayMs)&&e.scrollDelayMs<this._config.scroll_threshold_ms,c=S(e.mutationDelayMs)&&e.mutationDelayMs<this._config.mutation_threshold_ms,u=S(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this._config.selection_change_threshold_ms;l||c||u||(r||a||o||i?this._onCapture(e,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:a,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:i}):e.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(e))}this._clicks.length&&M(this._checkClickTimer)&&(this._checkClickTimer=s.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(t,n){this.instance.capture("$dead_click",e(e(e({},n),nt(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props),{},{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new lt(t,e)}(); | ||
//# sourceMappingURL=dead-clicks-autocapture.js.map |
@@ -24,2 +24,3 @@ import { PostHogFeatureFlags } from './posthog-featureflags'; | ||
import { PostHogExceptions } from './posthog-exceptions'; | ||
import { SiteApps } from './site-apps'; | ||
import { DeadClicksAutocapture } from './extensions/dead-clicks-autocapture'; | ||
@@ -55,2 +56,3 @@ type OnlyValidKeys<T, Shape> = T extends Shape ? (Exclude<keyof T, keyof Shape> extends never ? T : never) : never; | ||
requestRouter: RequestRouter; | ||
siteApps?: SiteApps; | ||
autocapture?: Autocapture; | ||
@@ -57,0 +59,0 @@ heatmaps?: Heatmaps; |
@@ -412,3 +412,3 @@ import { PostHog } from './posthog-core'; | ||
siteApps: { | ||
id: number; | ||
id: string; | ||
url: string; | ||
@@ -415,0 +415,0 @@ }[]; |
{ | ||
"name": "posthog-js", | ||
"version": "1.189.0", | ||
"version": "1.189.1", | ||
"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", |
@@ -157,9 +157,7 @@ import { each, extend, includes, registerEvent } from './utils'; | ||
} | ||
var props = extend(getDefaultProperties(e.type), elementsChainAsString | ||
? { | ||
$elements_chain: getElementsChainString(elementsJson), | ||
} | ||
: { | ||
$elements: elementsJson, | ||
}, ((_d = elementsJson[0]) === null || _d === void 0 ? void 0 : _d['$el_text']) ? { $el_text: (_e = elementsJson[0]) === null || _e === void 0 ? void 0 : _e['$el_text'] } : {}, externalHref && e.type === 'click' ? { $external_click_url: externalHref } : {}, autocaptureAugmentProperties); | ||
var props = extend(getDefaultProperties(e.type), | ||
// Sending "$elements" is deprecated. Only one client on US cloud uses this. | ||
!elementsChainAsString ? { $elements: elementsJson } : {}, | ||
// Always send $elements_chain, as it's needed downstream in site app filtering | ||
{ $elements_chain: getElementsChainString(elementsJson) }, ((_d = elementsJson[0]) === null || _d === void 0 ? void 0 : _d['$el_text']) ? { $el_text: (_e = elementsJson[0]) === null || _e === void 0 ? void 0 : _e['$el_text'] } : {}, externalHref && e.type === 'click' ? { $external_click_url: externalHref } : {}, autocaptureAugmentProperties); | ||
return { props: props }; | ||
@@ -166,0 +164,0 @@ } |
@@ -1,16 +0,5 @@ | ||
var __values = (this && this.__values) || function(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
}; | ||
import { Compression } from './types'; | ||
import { STORED_GROUP_PROPERTIES_KEY, STORED_PERSON_PROPERTIES_KEY } from './constants'; | ||
import { logger } from './utils/logger'; | ||
import { document, assignableWindow } from './utils/globals'; | ||
import { document } from './utils/globals'; | ||
var Decide = /** @class */ (function () { | ||
@@ -47,5 +36,3 @@ function Decide(instance) { | ||
Decide.prototype.parseDecideResponse = function (response) { | ||
var e_1, _a; | ||
var _this = this; | ||
var _b, _c; | ||
this.instance.featureFlags.setReloadingPaused(false); | ||
@@ -71,31 +58,2 @@ // :TRICKY: Reload - start another request if queued! | ||
this.instance._afterDecideResponse(response); | ||
if (response['siteApps']) { | ||
if (this.instance.config.opt_in_site_apps) { | ||
var _loop_1 = function (id, url) { | ||
assignableWindow["__$$ph_site_app_".concat(id)] = this_1.instance; | ||
(_c = (_b = assignableWindow.__PosthogExtensions__) === null || _b === void 0 ? void 0 : _b.loadSiteApp) === null || _c === void 0 ? void 0 : _c.call(_b, this_1.instance, url, function (err) { | ||
if (err) { | ||
return logger.error("Error while initializing PostHog app with config id ".concat(id), err); | ||
} | ||
}); | ||
}; | ||
var this_1 = this; | ||
try { | ||
for (var _d = __values(response['siteApps']), _e = _d.next(); !_e.done; _e = _d.next()) { | ||
var _f = _e.value, id = _f.id, url = _f.url; | ||
_loop_1(id, url); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_e && !_e.done && (_a = _d.return)) _a.call(_d); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
} | ||
else if (response['siteApps'].length > 0) { | ||
logger.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.'); | ||
} | ||
} | ||
}; | ||
@@ -102,0 +60,0 @@ return Decide; |
@@ -24,2 +24,3 @@ import { PostHogFeatureFlags } from './posthog-featureflags'; | ||
import { PostHogExceptions } from './posthog-exceptions'; | ||
import { SiteApps } from './site-apps'; | ||
import { DeadClicksAutocapture } from './extensions/dead-clicks-autocapture'; | ||
@@ -55,2 +56,3 @@ type OnlyValidKeys<T, Shape> = T extends Shape ? (Exclude<keyof T, keyof Shape> extends never ? T : never) : never; | ||
requestRouter: RequestRouter; | ||
siteApps?: SiteApps; | ||
autocapture?: Autocapture; | ||
@@ -57,0 +59,0 @@ heatmaps?: Heatmaps; |
@@ -412,3 +412,3 @@ import { PostHog } from './posthog-core'; | ||
siteApps: { | ||
id: number; | ||
id: string; | ||
url: string; | ||
@@ -415,0 +415,0 @@ }[]; |
{ | ||
"name": "posthog-js", | ||
"version": "1.189.0", | ||
"version": "1.189.1", | ||
"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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
19026882
452
42471