posthog-js 1.17.2 → 1.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/array.js +2 -2
- package/dist/es.js +22 -9
- package/dist/module.js +22 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/array.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"zdbk":[function(require,module,exports) {
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LZString=void 0;var o=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function t(o,r){if(!n[o]){n[o]={};for(var e=0;e<o.length;e++)n[o][o.charAt(e)]=e}return n[o][r]}var s={compressToBase64:function(o){if(null==o)return"";var e=s._compress(o,6,function(o){return r.charAt(o)});switch(e.length%4){default:case 0:return e;case 1:return e+"===";case 2:return e+"==";case 3:return e+"="}},decompressFromBase64:function(o){return null==o?"":""==o?null:s._decompress(o.length,32,function(e){return t(r,o.charAt(e))})},compressToUTF16:function(r){return null==r?"":s._compress(r,15,function(r){return o(r+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:s._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=s.compress(o),e=new Uint8Array(2*r.length),n=0,t=r.length;n<t;n++){var i=r.charCodeAt(n);e[2*n]=i>>>8,e[2*n+1]=i%256}return e},decompressFromUint8Array:function(r){if(null==r)return s.decompress(r);for(var e=new Array(r.length/2),n=0,t=e.length;n<t;n++)e[n]=256*r[2*n]+r[2*n+1];var i=[];return e.forEach(function(r){i.push(o(r))}),s.decompress(i.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":s._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(o){return null==o?"":""==o?null:(o=o.replace(/ /g,"+"),s._decompress(o.length,32,function(r){return t(e,o.charAt(r))}))},compress:function(r){return s._compress(r,16,function(r){return o(r)})},_compress:function(o,r,e){if(null==o)return"";var n,t,s,i={},p={},c="",a="",u="",l=2,f=3,h=2,d=[],m=0,v=0;for(s=0;s<o.length;s+=1)if(c=o.charAt(s),Object.prototype.hasOwnProperty.call(i,c)||(i[c]=f++,p[c]=!0),a=u+c,Object.prototype.hasOwnProperty.call(i,a))u=a;else{if(Object.prototype.hasOwnProperty.call(p,u)){if(u.charCodeAt(0)<256){for(n=0;n<h;n++)m<<=1,v==r-1?(v=0,d.push(e(m)),m=0):v++;for(t=u.charCodeAt(0),n=0;n<8;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}else{for(t=1,n=0;n<h;n++)m=m<<1|t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t=0;for(t=u.charCodeAt(0),n=0;n<16;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete p[u]}else for(t=i[u],n=0;n<h;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++),i[a]=f++,u=String(c)}if(""!==u){if(Object.prototype.hasOwnProperty.call(p,u)){if(u.charCodeAt(0)<256){for(n=0;n<h;n++)m<<=1,v==r-1?(v=0,d.push(e(m)),m=0):v++;for(t=u.charCodeAt(0),n=0;n<8;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}else{for(t=1,n=0;n<h;n++)m=m<<1|t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t=0;for(t=u.charCodeAt(0),n=0;n<16;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete p[u]}else for(t=i[u],n=0;n<h;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,n=0;n<h;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(e(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:s._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(r,e,n){var t,s,i,p,c,a,u,l=[],f=4,h=4,d=3,m="",v=[],w={val:n(0),position:e,index:1};for(t=0;t<3;t+=1)l[t]=t;for(i=0,c=Math.pow(2,2),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;switch(i){case 0:for(i=0,c=Math.pow(2,8),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;u=o(i);break;case 1:for(i=0,c=Math.pow(2,16),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;u=o(i);break;case 2:return""}for(l[3]=u,s=u,v.push(u);;){if(w.index>r)return"";for(i=0,c=Math.pow(2,d),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;switch(u=i){case 0:for(i=0,c=Math.pow(2,8),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;l[h++]=o(i),u=h-1,f--;break;case 1:for(i=0,c=Math.pow(2,16),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;l[h++]=o(i),u=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[u])m=l[u];else{if(u!==h)return null;m=s+s.charAt(0)}v.push(m),l[h++]=s+m.charAt(0),s=m,0==--f&&(f=Math.pow(2,d),d++)}}};exports.LZString=s;
|
|
3
3
|
},{}],"EHrm":[function(require,module,exports) {
|
|
4
|
-
module.exports={name:"posthog-js",version:"1.17.
|
|
4
|
+
module.exports={name:"posthog-js",version:"1.17.3",description:"Posthog-js allows you to automatically capture usage and send events to PostHog.",repository:"https://github.com/PostHog/posthog-js",author:"hey@posthog.com",license:"MIT",scripts:{start:"parcel watch src/loader-globals.js --out-file dist/array.js",serve:"parcel serve src/loader-globals.js --port 3001 --out-file dist/array.js",build:"yarn build-array && yarn build-module && yarn build-es-module && yarn process-types && yarn build-react","build-array":"parcel build src/loader-globals.js --out-file dist/array.js --no-source-maps","build-module":"rollup -i src/loader-module.js -f cjs -o dist/module.js -c rollup.config.js","build-es-module":"rollup -i src/loader-module.js -f es -o dist/es.js -c rollup.config.js","build-react":"cd react; yarn; yarn build;","process-types":"mkdir -p dist; eslint src --ext .ts -c .eslintrc.ts.js --fix && tsc && cp -f src/*.d.ts dist/",lint:"eslint src --fix",prepublishOnly:"yarn lint && yarn test && yarn build && yarn test-react",test:"jest src","test-react":"cd react; yarn test","test-watch":"jest --watch src",cypress:"cypress open"},main:"dist/module.js",module:"dist/es.js",files:["dist/*","react/dist/*"],dependencies:{"@sentry/types":"^6.11.0",fflate:"^0.4.1","rrweb-snapshot":"^1.1.7"},devDependencies:{"@babel/core":"7.12.10","@babel/preset-env":"7.12.11","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^8.1.0","@typescript-eslint/eslint-plugin":"^3.5.0","@typescript-eslint/parser":"^3.5.0","babel-eslint":"10.1.0","babel-jest":"^26.6.3",cypress:"^9.2.0",eslint:"7.3.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.21.5","eslint-plugin-react-hooks":"^4.2.0","fast-check":"^2.17.0",given2:"^2.1.7",husky:"^4.2.5",jest:"^26.1.0",jsdom:"16.2.2","jsdom-global":"3.0.2","lint-staged":"^10.2.11",localStorage:"1.0.4","node-fetch":"^2.6.1",parcel:"^1.12.4","posthog-js":"link:.",prettier:"^2.0.5",rollup:"^2.18.2",rrweb:"^1.0.6",sinon:"9.0.2",testcafe:"^1.17.1","testcafe-browser-provider-browserstack":"^1.13.2-alpha.1",typescript:"^3.9.6"},husky:{hooks:{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js,json}":"prettier --write","*.{ts,tsx}":["eslint -c .eslintrc.ts.js --fix","tsc --noEmit --esModuleInterop --jsx react"]},jest:{testPathIgnorePatterns:["/node_modules/","/cypress/","/react/","/test_data/"],moduleFileExtensions:["js","json"],setupFilesAfterEnv:["given2/setup"],clearMocks:!0}};
|
|
5
5
|
},{}],"itQ5":[function(require,module,exports) {
|
|
6
6
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../package.json"),r={DEBUG:!1,LIB_VERSION:e.version},t=r;exports.default=t;
|
|
7
7
|
},{"../package.json":"EHrm"}],"FOZT":[function(require,module,exports) {
|
|
8
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.COPY_IN_PROGRESS_ATTRIBUTE=exports.document=exports.console=exports.userAgent=exports._=exports.window=void 0;var e=n(require("./config"));function n(e){return e&&e.__esModule?e:{default:e}}var r=Array.prototype,o=Function.prototype,t=Object.prototype,i=r.slice,c=t.toString,a=t.hasOwnProperty,s="undefined"!=typeof window?window:{},u=s.navigator||{userAgent:""},d=s.document||{},l=u.userAgent;exports.userAgent=l,exports.document=d,exports.window=s;var f=o.bind,p=r.forEach,h=r.indexOf,w=Array.isArray,g={},v={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};exports._=v;var b={log:function(){if(e.default.DEBUG&&!v.isUndefined(window.console)&&window.console)try{window.console.log.apply(window.console,arguments)}catch(n){v.each(arguments,function(e){window.console.log(e)})}},error:function(){if(e.default.DEBUG&&!v.isUndefined(window.console)&&window.console){var n=["PostHog error:"].concat(Array.prototype.slice.call(arguments));try{window.console.error.apply(window.console,n)}catch(r){v.each(n,function(e){window.console.error(e)})}}},critical:function(){if(!v.isUndefined(window.console)&&window.console){var e=["PostHog error:"].concat(Array.prototype.slice.call(arguments));try{window.console.error.apply(window.console,e)}catch(n){v.each(e,function(e){window.console.error(e)})}}}};exports.console=b,v.bind=function(e,n){var r,o;if(f&&e.bind===f)return f.apply(e,i.call(arguments,1));if(!v.isFunction(e))throw new TypeError;return r=i.call(arguments,2),o=function(){if(!(this instanceof o))return e.apply(n,r.concat(i.call(arguments)));var t={};t.prototype=e.prototype;var c=new t;t.prototype=null;var a=e.apply(c,r.concat(i.call(arguments)));return Object(a)===a?a:c}},v.bind_instance_methods=function(e){for(var n in e)"function"==typeof e[n]&&(e[n]=v.bind(e[n],e))},v.each=function(e,n,r){if(null!=e)if(p&&e.forEach===p)e.forEach(n,r);else if(e.length===+e.length){for(var o=0,t=e.length;o<t;o++)if(o in e&&n.call(r,e[o],o,e)===g)return}else for(var i in e)if(a.call(e,i)&&n.call(r,e[i],i,e)===g)return},v.extend=function(e){return v.each(i.call(arguments,1),function(n){for(var r in n)void 0!==n[r]&&(e[r]=n[r])}),e},v.isArray=w||function(e){return"[object Array]"===c.call(e)},v.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(n){return!1}},v.include=function(e,n){var r=!1;return null===e?r:h&&e.indexOf===h?-1!=e.indexOf(n):(v.each(e,function(e){if(r||(r=e===n))return g}),r)},v.includes=function(e,n){return-1!==e.indexOf(n)},v.isObject=function(e){return e===Object(e)&&!v.isArray(e)},v.isEmptyObject=function(e){if(v.isObject(e)){for(var n in e)if(a.call(e,n))return!1;return!0}return!1},v.isUndefined=function(e){return void 0===e},v.isString=function(e){return"[object String]"==c.call(e)},v.isDate=function(e){return"[object Date]"==c.call(e)},v.isNumber=function(e){return"[object Number]"==c.call(e)},v.encodeDates=function(e){return v.each(e,function(n,r){v.isDate(n)?e[r]=v.formatDate(n):v.isObject(n)&&(e[r]=v.encodeDates(n))}),e},v.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},v.formatDate=function(e){function n(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())},v.safewrap=function(n){return function(){try{return n.apply(this,arguments)}catch(r){b.critical("Implementation error. Please turn on debug and contact support@posthog.com."),e.default.DEBUG&&b.critical(r)}}},v.safewrap_class=function(e,n){for(var r=0;r<n.length;r++)e.prototype[n[r]]=v.safewrap(e.prototype[n[r]])},v.safewrap_instance_methods=function(e){for(var n in e)"function"==typeof e[n]&&(e[n]=v.safewrap(e[n]))},v.strip_empty_properties=function(e){var n={};return v.each(e,function(e,r){v.isString(e)&&e.length>0&&(n[r]=e)}),n};var y="undefined"!=typeof Symbol?Symbol("__deepCircularCopyInProgress__"):"__deepCircularCopyInProgress__";function m(e,n){return e!==Object(e)?n?n(e):e:e[y]?void 0:(e[y]=!0,v.isArray(e)?(r=[],v.each(e,function(e){r.push(m(e,n))})):(r={},v.each(e,function(e,o){o!==y&&(r[o]=m(e,n))})),delete e[y],r);var r}exports.COPY_IN_PROGRESS_ATTRIBUTE=y,v.copyAndTruncateStrings=function(e,n){return m(e,function(e){return"string"==typeof e&&null!==n&&(e=e.slice(0,n)),e},{})},v.base64Encode=function(e){var n,r,o,t,i,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,s=0,u="",d=[];if(!e)return e;e=v.utf8Encode(e);do{n=(i=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=i>>12&63,o=i>>6&63,t=63&i,d[s++]=c.charAt(n)+c.charAt(r)+c.charAt(o)+c.charAt(t)}while(a<e.length);switch(u=d.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u},v.utf8Encode=function(e){var n,r,o,t,i="";for(n=r=0,o=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,t=0;t<o;t++){var c=e.charCodeAt(t),a=null;c<128?r++:a=c>127&&c<2048?String.fromCharCode(c>>6|192,63&c|128):String.fromCharCode(c>>12|224,c>>6&63|128,63&c|128),null!==a&&(r>n&&(i+=e.substring(n,r)),i+=a,n=r=t+1)}return r>n&&(i+=e.substring(n,e.length)),i},v.UUID=function(){var e=function(){for(var e=1*new Date,n=0;e==1*new Date;)n++;return e.toString(16)+n.toString(16)};return function(){var n=(window.screen.height*window.screen.width).toString(16);return e()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,n,r=l,o=[],t=0;function i(e,n){var r,t=0;for(r=0;r<n.length;r++)t|=o[r]<<8*r;return e^t}for(e=0;e<r.length;e++)n=r.charCodeAt(e),o.unshift(255&n),o.length>=4&&(t=i(t,o),o=[]);return o.length>0&&(t=i(t,o)),t.toString(16)}()+"-"+n+"-"+e()}}(),v.isBlockedUA=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp)/i.test(e)},v.HTTPBuildQuery=function(e,n){var r,o,t=[];return v.isUndefined(n)&&(n="&"),v.each(e,function(e,n){r=encodeURIComponent(e.toString()),o=encodeURIComponent(n),t[t.length]=o+"="+r}),t.join(n)},v.getQueryParam=function(e,n){n=n.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){b.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},v.getHashParam=function(e,n){var r=e.match(new RegExp(n+"=([^&]*)"));return r?r[1]:null},v.register_event=function(){function e(n){return n&&(n.preventDefault=e.preventDefault,n.stopPropagation=e.stopPropagation),n}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(n,r,o,t,i){if(n)if(n.addEventListener&&!t)n.addEventListener(r,o,!!i);else{var c="on"+r,a=n[c];n[c]=function(n,r,o){return function(t){if(t=t||e(window.event)){var i,c,a=!0;return v.isFunction(o)&&(i=o(t)),c=r.call(n,t),!1!==i&&!1!==c||(a=!1),a}}}(n,o,a)}else b.error("No valid element provided to register_event")}}(),v.info={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid".split(" "),n="",r={};return v.each(e,function(e){(n=v.getQueryParam(d.URL,e)).length&&(r[e]=n)}),r},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var n=v.info.searchEngine(e),r="yahoo"!=n?"q":"p",o={};if(null!==n){o.$search_engine=n;var t=v.getQueryParam(e,r);t.length&&(o.ph_keyword=t)}return o},browser:function(e,n,r){return n=n||"",r||v.includes(e," OPR/")?v.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":v.includes(e,"IEMobile")||v.includes(e,"WPDesktop")?"Internet Explorer Mobile":v.includes(e,"SamsungBrowser/")?"Samsung Internet":v.includes(e,"Edge")||v.includes(e,"Edg/")?"Microsoft Edge":v.includes(e,"FBIOS")?"Facebook Mobile":v.includes(e,"Chrome")?"Chrome":v.includes(e,"CriOS")?"Chrome iOS":v.includes(e,"UCWEB")||v.includes(e,"UCBrowser")?"UC Browser":v.includes(e,"FxiOS")?"Firefox iOS":v.includes(n,"Apple")?v.includes(e,"Mobile")?"Mobile Safari":"Safari":v.includes(e,"Android")?"Android Mobile":v.includes(e,"Konqueror")?"Konqueror":v.includes(e,"Firefox")?"Firefox":v.includes(e,"MSIE")||v.includes(e,"Trident/")?"Internet Explorer":v.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,n,r){var o={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[v.info.browser(e,n,r)];if(void 0===o)return null;var t=e.match(o);return t?parseFloat(t[t.length-2]):null},os:function(){var e=l;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var n=this.device(e);return"iPad"===n||"Android Tablet"===n?"Tablet":n?"Mobile":"Desktop"},referringDomain:function(e){var n=e.split("/");return n.length>=3?n[2]:""},properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(l,u.vendor,window.opera),$device:v.info.device(l),$device_type:v.info.deviceType(l)}),{$current_url:window.location.href,$host:window.location.host,$pathname:window.location.pathname,$browser_version:v.info.browserVersion(l,u.vendor,window.opera),$screen_height:window.screen.height,$screen_width:window.screen.width,$viewport_height:window.innerHeight,$viewport_width:window.innerWidth,$lib:"web",$lib_version:e.default.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:v.timestamp()/1e3})},people_properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(l,u.vendor,window.opera)}),{$browser_version:v.info.browserVersion(l,u.vendor,window.opera)})}},v.isObject=v.isObject,v.isBlockedUA=v.isBlockedUA,v.isEmptyObject=v.isEmptyObject,v.info=v.info,v.info.device=v.info.device,v.info.browser=v.info.browser,v.info.browserVersion=v.info.browserVersion,v.info.properties=v.info.properties;
|
|
8
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.COPY_IN_PROGRESS_ATTRIBUTE=exports.document=exports.console=exports.userAgent=exports._=exports.window=void 0;var e=n(require("./config"));function n(e){return e&&e.__esModule?e:{default:e}}var r=Array.prototype,o=Function.prototype,t=Object.prototype,i=r.slice,c=t.toString,a=t.hasOwnProperty,s="undefined"!=typeof window?window:{},u=s.navigator||{userAgent:""},d=s.document||{},l=u.userAgent;exports.userAgent=l,exports.document=d,exports.window=s;var f=o.bind,p=r.forEach,h=r.indexOf,w=Array.isArray,g={},v={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};exports._=v;var b={log:function(){if(e.default.DEBUG&&!v.isUndefined(window.console)&&window.console)try{window.console.log.apply(window.console,arguments)}catch(n){v.each(arguments,function(e){window.console.log(e)})}},error:function(){if(e.default.DEBUG&&!v.isUndefined(window.console)&&window.console){var n=["PostHog error:"].concat(Array.prototype.slice.call(arguments));try{window.console.error.apply(window.console,n)}catch(r){v.each(n,function(e){window.console.error(e)})}}},critical:function(){if(!v.isUndefined(window.console)&&window.console){var e=["PostHog error:"].concat(Array.prototype.slice.call(arguments));try{window.console.error.apply(window.console,e)}catch(n){v.each(e,function(e){window.console.error(e)})}}}};exports.console=b,v.bind=function(e,n){var r,o;if(f&&e.bind===f)return f.apply(e,i.call(arguments,1));if(!v.isFunction(e))throw new TypeError;return r=i.call(arguments,2),o=function(){if(!(this instanceof o))return e.apply(n,r.concat(i.call(arguments)));var t={};t.prototype=e.prototype;var c=new t;t.prototype=null;var a=e.apply(c,r.concat(i.call(arguments)));return Object(a)===a?a:c}},v.bind_instance_methods=function(e){for(var n in e)"function"==typeof e[n]&&(e[n]=v.bind(e[n],e))},v.each=function(e,n,r){if(null!=e)if(p&&e.forEach===p)e.forEach(n,r);else if(e.length===+e.length){for(var o=0,t=e.length;o<t;o++)if(o in e&&n.call(r,e[o],o,e)===g)return}else for(var i in e)if(a.call(e,i)&&n.call(r,e[i],i,e)===g)return},v.extend=function(e){return v.each(i.call(arguments,1),function(n){for(var r in n)void 0!==n[r]&&(e[r]=n[r])}),e},v.isArray=w||function(e){return"[object Array]"===c.call(e)},v.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(n){return!1}},v.include=function(e,n){var r=!1;return null===e?r:h&&e.indexOf===h?-1!=e.indexOf(n):(v.each(e,function(e){if(r||(r=e===n))return g}),r)},v.includes=function(e,n){return-1!==e.indexOf(n)},v.isObject=function(e){return e===Object(e)&&!v.isArray(e)},v.isEmptyObject=function(e){if(v.isObject(e)){for(var n in e)if(a.call(e,n))return!1;return!0}return!1},v.isUndefined=function(e){return void 0===e},v.isString=function(e){return"[object String]"==c.call(e)},v.isDate=function(e){return"[object Date]"==c.call(e)},v.isNumber=function(e){return"[object Number]"==c.call(e)},v.encodeDates=function(e){return v.each(e,function(n,r){v.isDate(n)?e[r]=v.formatDate(n):v.isObject(n)&&(e[r]=v.encodeDates(n))}),e},v.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},v.formatDate=function(e){function n(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())},v.safewrap=function(n){return function(){try{return n.apply(this,arguments)}catch(r){b.critical("Implementation error. Please turn on debug and contact support@posthog.com."),e.default.DEBUG&&b.critical(r)}}},v.safewrap_class=function(e,n){for(var r=0;r<n.length;r++)e.prototype[n[r]]=v.safewrap(e.prototype[n[r]])},v.safewrap_instance_methods=function(e){for(var n in e)"function"==typeof e[n]&&(e[n]=v.safewrap(e[n]))},v.strip_empty_properties=function(e){var n={};return v.each(e,function(e,r){v.isString(e)&&e.length>0&&(n[r]=e)}),n};var y="undefined"!=typeof Symbol?Symbol("__deepCircularCopyInProgress__"):"__deepCircularCopyInProgress__";function m(e,n,r){return e!==Object(e)?n?n(e,r):e:e[y]?void 0:(e[y]=!0,v.isArray(e)?(o=[],v.each(e,function(e){o.push(m(e,n))})):(o={},v.each(e,function(e,r){r!==y&&(o[r]=m(e,n,r))})),delete e[y],o);var o}exports.COPY_IN_PROGRESS_ATTRIBUTE=y;var _=["$performance_raw"];v.copyAndTruncateStrings=function(e,n){return m(e,function(e,r){return r&&_.indexOf(r)>-1?e:("string"==typeof e&&null!==n&&(e=e.slice(0,n)),e)})},v.base64Encode=function(e){var n,r,o,t,i,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,s=0,u="",d=[];if(!e)return e;e=v.utf8Encode(e);do{n=(i=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=i>>12&63,o=i>>6&63,t=63&i,d[s++]=c.charAt(n)+c.charAt(r)+c.charAt(o)+c.charAt(t)}while(a<e.length);switch(u=d.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u},v.utf8Encode=function(e){var n,r,o,t,i="";for(n=r=0,o=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,t=0;t<o;t++){var c=e.charCodeAt(t),a=null;c<128?r++:a=c>127&&c<2048?String.fromCharCode(c>>6|192,63&c|128):String.fromCharCode(c>>12|224,c>>6&63|128,63&c|128),null!==a&&(r>n&&(i+=e.substring(n,r)),i+=a,n=r=t+1)}return r>n&&(i+=e.substring(n,e.length)),i},v.UUID=function(){var e=function(){for(var e=1*new Date,n=0;e==1*new Date;)n++;return e.toString(16)+n.toString(16)};return function(){var n=(window.screen.height*window.screen.width).toString(16);return e()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,n,r=l,o=[],t=0;function i(e,n){var r,t=0;for(r=0;r<n.length;r++)t|=o[r]<<8*r;return e^t}for(e=0;e<r.length;e++)n=r.charCodeAt(e),o.unshift(255&n),o.length>=4&&(t=i(t,o),o=[]);return o.length>0&&(t=i(t,o)),t.toString(16)}()+"-"+n+"-"+e()}}(),v.isBlockedUA=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp)/i.test(e)},v.HTTPBuildQuery=function(e,n){var r,o,t=[];return v.isUndefined(n)&&(n="&"),v.each(e,function(e,n){r=encodeURIComponent(e.toString()),o=encodeURIComponent(n),t[t.length]=o+"="+r}),t.join(n)},v.getQueryParam=function(e,n){n=n.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){b.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},v.getHashParam=function(e,n){var r=e.match(new RegExp(n+"=([^&]*)"));return r?r[1]:null},v.register_event=function(){function e(n){return n&&(n.preventDefault=e.preventDefault,n.stopPropagation=e.stopPropagation),n}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(n,r,o,t,i){if(n)if(n.addEventListener&&!t)n.addEventListener(r,o,!!i);else{var c="on"+r,a=n[c];n[c]=function(n,r,o){return function(t){if(t=t||e(window.event)){var i,c,a=!0;return v.isFunction(o)&&(i=o(t)),c=r.call(n,t),!1!==i&&!1!==c||(a=!1),a}}}(n,o,a)}else b.error("No valid element provided to register_event")}}(),v.info={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid".split(" "),n="",r={};return v.each(e,function(e){(n=v.getQueryParam(d.URL,e)).length&&(r[e]=n)}),r},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var n=v.info.searchEngine(e),r="yahoo"!=n?"q":"p",o={};if(null!==n){o.$search_engine=n;var t=v.getQueryParam(e,r);t.length&&(o.ph_keyword=t)}return o},browser:function(e,n,r){return n=n||"",r||v.includes(e," OPR/")?v.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":v.includes(e,"IEMobile")||v.includes(e,"WPDesktop")?"Internet Explorer Mobile":v.includes(e,"SamsungBrowser/")?"Samsung Internet":v.includes(e,"Edge")||v.includes(e,"Edg/")?"Microsoft Edge":v.includes(e,"FBIOS")?"Facebook Mobile":v.includes(e,"Chrome")?"Chrome":v.includes(e,"CriOS")?"Chrome iOS":v.includes(e,"UCWEB")||v.includes(e,"UCBrowser")?"UC Browser":v.includes(e,"FxiOS")?"Firefox iOS":v.includes(n,"Apple")?v.includes(e,"Mobile")?"Mobile Safari":"Safari":v.includes(e,"Android")?"Android Mobile":v.includes(e,"Konqueror")?"Konqueror":v.includes(e,"Firefox")?"Firefox":v.includes(e,"MSIE")||v.includes(e,"Trident/")?"Internet Explorer":v.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,n,r){var o={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[v.info.browser(e,n,r)];if(void 0===o)return null;var t=e.match(o);return t?parseFloat(t[t.length-2]):null},os:function(){var e=l;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var n=this.device(e);return"iPad"===n||"Android Tablet"===n?"Tablet":n?"Mobile":"Desktop"},referringDomain:function(e){var n=e.split("/");return n.length>=3?n[2]:""},properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(l,u.vendor,window.opera),$device:v.info.device(l),$device_type:v.info.deviceType(l)}),{$current_url:window.location.href,$host:window.location.host,$pathname:window.location.pathname,$browser_version:v.info.browserVersion(l,u.vendor,window.opera),$screen_height:window.screen.height,$screen_width:window.screen.width,$viewport_height:window.innerHeight,$viewport_width:window.innerWidth,$lib:"web",$lib_version:e.default.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:v.timestamp()/1e3})},people_properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(l,u.vendor,window.opera)}),{$browser_version:v.info.browserVersion(l,u.vendor,window.opera)})}},v.isObject=v.isObject,v.isBlockedUA=v.isBlockedUA,v.isEmptyObject=v.isEmptyObject,v.info=v.info,v.info.device=v.info.device,v.info.browser=v.info.browser,v.info.browserVersion=v.info.browserVersion,v.info.properties=v.info.properties;
|
|
9
9
|
},{"./config":"itQ5"}],"RYfg":[function(require,module,exports) {
|
|
10
10
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getClassName=r,exports.getSafeText=n,exports.isElementNode=o,exports.isTag=s,exports.isTextNode=i,exports.shouldCaptureDomEvent=u,exports.shouldCaptureElement=a,exports.isSensitiveElement=p,exports.shouldCaptureValue=l,exports.isAngularStyleAttr=d,exports.loadScript=f,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)&&!p(t)&&t.childNodes&&t.childNodes.length&&e._.each(t.childNodes,function(t){i(t)&&t.textContent&&(r+=e._.trim(t.textContent).split(/(\s+)/).filter(l).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),e._.trim(r)}function o(e){return e&&1===e.nodeType}function s(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function i(e){return e&&3===e.nodeType}var c=["a","button","form","input","select","textarea","label"];function u(e,t){if(!e||s(e,"html")||!o(e))return!1;for(var r=!1,n=[e],i=!0,u=e;u.parentNode&&!s(u,"body");)if(11!==u.parentNode.nodeType){if(!(i=u.parentNode))break;if(c.indexOf(i.tagName.toLowerCase())>-1)r=!0;else{var a=window.getComputedStyle(i);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}n.push(i),u=i}else n.push(u.parentNode.host),u=u.parentNode.host;var p=window.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var l=e.tagName.toLowerCase();switch(l){case"html":return!1;case"form":return"submit"===t.type;case"input":return"change"===t.type||"click"===t.type;case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return r?"click"===t.type:"click"===t.type&&(c.indexOf(l)>-1||"true"===e.getAttribute("contenteditable"))}}function a(t){for(var n=t;n.parentNode&&!s(n,"body");n=n.parentNode){var o=r(n).split(" ");if(e._.includes(o,"ph-sensitive")||e._.includes(o,"ph-no-capture"))return!1}if(e._.includes(r(t).split(" "),"ph-include"))return!0;var i=t.type||"";if("string"==typeof i)switch(i.toLowerCase()){case"hidden":case"password":return!1}var c=t.name||t.id||"";if("string"==typeof c){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(c.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function p(e){return!!(s(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||s(e,"select")||s(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function l(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}function d(e){return"string"==typeof e&&("_ngcontent"===e.substring(0,10)||"_nghost"===e.substring(0,7))}function f(e,t){var r=document.createElement("script");r.type="text/javascript",r.src=e,r.onload=t;var n=document.getElementsByTagName("script");n.length>0?n[0].parentNode.insertBefore(r,n[0]):document.body.appendChild(r)}exports.usefulElements=c;
|
|
11
11
|
},{"./utils":"FOZT"}],"Oszc":[function(require,module,exports) {
|
package/dist/es.js
CHANGED
|
@@ -863,7 +863,7 @@ var LZString = {
|
|
|
863
863
|
}
|
|
864
864
|
};
|
|
865
865
|
|
|
866
|
-
var version = "1.17.
|
|
866
|
+
var version = "1.17.3";
|
|
867
867
|
|
|
868
868
|
var Config$1 = {
|
|
869
869
|
DEBUG: false,
|
|
@@ -1171,15 +1171,22 @@ _.strip_empty_properties = function (p) {
|
|
|
1171
1171
|
});
|
|
1172
1172
|
|
|
1173
1173
|
return ret;
|
|
1174
|
-
};
|
|
1175
|
-
// It handles cycles by replacing all references to them with `undefined`
|
|
1176
|
-
// Also supports customizing native values
|
|
1177
|
-
|
|
1174
|
+
};
|
|
1178
1175
|
|
|
1179
1176
|
var COPY_IN_PROGRESS_ATTRIBUTE = typeof Symbol !== 'undefined' ? Symbol('__deepCircularCopyInProgress__') : '__deepCircularCopyInProgress__';
|
|
1177
|
+
/**
|
|
1178
|
+
* Deep copies an object.
|
|
1179
|
+
* It handles cycles by replacing all references to them with `undefined`
|
|
1180
|
+
* Also supports customizing native values
|
|
1181
|
+
*
|
|
1182
|
+
* @param value
|
|
1183
|
+
* @param customizer
|
|
1184
|
+
* @param [key] if provided this is the object key associated with the value to be copied. It allows the customizer function to have context when it runs
|
|
1185
|
+
* @returns {{}|undefined|*}
|
|
1186
|
+
*/
|
|
1180
1187
|
|
|
1181
|
-
function deepCircularCopy(value, customizer) {
|
|
1182
|
-
if (value !== Object(value)) return customizer ? customizer(value) : value; // primitive value
|
|
1188
|
+
function deepCircularCopy(value, customizer, key) {
|
|
1189
|
+
if (value !== Object(value)) return customizer ? customizer(value, key) : value; // primitive value
|
|
1183
1190
|
|
|
1184
1191
|
if (value[COPY_IN_PROGRESS_ATTRIBUTE]) return undefined;
|
|
1185
1192
|
value[COPY_IN_PROGRESS_ATTRIBUTE] = true;
|
|
@@ -1196,7 +1203,7 @@ function deepCircularCopy(value, customizer) {
|
|
|
1196
1203
|
|
|
1197
1204
|
_.each(value, function (val, key) {
|
|
1198
1205
|
if (key !== COPY_IN_PROGRESS_ATTRIBUTE) {
|
|
1199
|
-
result[key] = deepCircularCopy(val, customizer);
|
|
1206
|
+
result[key] = deepCircularCopy(val, customizer, key);
|
|
1200
1207
|
}
|
|
1201
1208
|
});
|
|
1202
1209
|
}
|
|
@@ -1205,8 +1212,14 @@ function deepCircularCopy(value, customizer) {
|
|
|
1205
1212
|
return result;
|
|
1206
1213
|
}
|
|
1207
1214
|
|
|
1215
|
+
var LONG_STRINGS_ALLOW_LIST = ['$performance_raw'];
|
|
1216
|
+
|
|
1208
1217
|
_.copyAndTruncateStrings = function (object, maxStringLength) {
|
|
1209
|
-
return deepCircularCopy(object, function (value) {
|
|
1218
|
+
return deepCircularCopy(object, function (value, key) {
|
|
1219
|
+
if (key && LONG_STRINGS_ALLOW_LIST.indexOf(key) > -1) {
|
|
1220
|
+
return value;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1210
1223
|
if (typeof value === 'string' && maxStringLength !== null) {
|
|
1211
1224
|
value = value.slice(0, maxStringLength);
|
|
1212
1225
|
}
|
package/dist/module.js
CHANGED
|
@@ -865,7 +865,7 @@ var LZString = {
|
|
|
865
865
|
}
|
|
866
866
|
};
|
|
867
867
|
|
|
868
|
-
var version = "1.17.
|
|
868
|
+
var version = "1.17.3";
|
|
869
869
|
|
|
870
870
|
var Config$1 = {
|
|
871
871
|
DEBUG: false,
|
|
@@ -1173,15 +1173,22 @@ _.strip_empty_properties = function (p) {
|
|
|
1173
1173
|
});
|
|
1174
1174
|
|
|
1175
1175
|
return ret;
|
|
1176
|
-
};
|
|
1177
|
-
// It handles cycles by replacing all references to them with `undefined`
|
|
1178
|
-
// Also supports customizing native values
|
|
1179
|
-
|
|
1176
|
+
};
|
|
1180
1177
|
|
|
1181
1178
|
var COPY_IN_PROGRESS_ATTRIBUTE = typeof Symbol !== 'undefined' ? Symbol('__deepCircularCopyInProgress__') : '__deepCircularCopyInProgress__';
|
|
1179
|
+
/**
|
|
1180
|
+
* Deep copies an object.
|
|
1181
|
+
* It handles cycles by replacing all references to them with `undefined`
|
|
1182
|
+
* Also supports customizing native values
|
|
1183
|
+
*
|
|
1184
|
+
* @param value
|
|
1185
|
+
* @param customizer
|
|
1186
|
+
* @param [key] if provided this is the object key associated with the value to be copied. It allows the customizer function to have context when it runs
|
|
1187
|
+
* @returns {{}|undefined|*}
|
|
1188
|
+
*/
|
|
1182
1189
|
|
|
1183
|
-
function deepCircularCopy(value, customizer) {
|
|
1184
|
-
if (value !== Object(value)) return customizer ? customizer(value) : value; // primitive value
|
|
1190
|
+
function deepCircularCopy(value, customizer, key) {
|
|
1191
|
+
if (value !== Object(value)) return customizer ? customizer(value, key) : value; // primitive value
|
|
1185
1192
|
|
|
1186
1193
|
if (value[COPY_IN_PROGRESS_ATTRIBUTE]) return undefined;
|
|
1187
1194
|
value[COPY_IN_PROGRESS_ATTRIBUTE] = true;
|
|
@@ -1198,7 +1205,7 @@ function deepCircularCopy(value, customizer) {
|
|
|
1198
1205
|
|
|
1199
1206
|
_.each(value, function (val, key) {
|
|
1200
1207
|
if (key !== COPY_IN_PROGRESS_ATTRIBUTE) {
|
|
1201
|
-
result[key] = deepCircularCopy(val, customizer);
|
|
1208
|
+
result[key] = deepCircularCopy(val, customizer, key);
|
|
1202
1209
|
}
|
|
1203
1210
|
});
|
|
1204
1211
|
}
|
|
@@ -1207,8 +1214,14 @@ function deepCircularCopy(value, customizer) {
|
|
|
1207
1214
|
return result;
|
|
1208
1215
|
}
|
|
1209
1216
|
|
|
1217
|
+
var LONG_STRINGS_ALLOW_LIST = ['$performance_raw'];
|
|
1218
|
+
|
|
1210
1219
|
_.copyAndTruncateStrings = function (object, maxStringLength) {
|
|
1211
|
-
return deepCircularCopy(object, function (value) {
|
|
1220
|
+
return deepCircularCopy(object, function (value, key) {
|
|
1221
|
+
if (key && LONG_STRINGS_ALLOW_LIST.indexOf(key) > -1) {
|
|
1222
|
+
return value;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1212
1225
|
if (typeof value === 'string' && maxStringLength !== null) {
|
|
1213
1226
|
value = value.slice(0, maxStringLength);
|
|
1214
1227
|
}
|
package/package.json
CHANGED