From 4cb7e1cdf9ab560da52429d91a9f05d1da1e6174 Mon Sep 17 00:00:00 2001 From: turtledreams <62231246+turtledreams@users.noreply.github.com> Date: Wed, 11 Sep 2024 21:33:24 +0900 Subject: [PATCH] minification 4.1 --- lib/countly.min.js | 161 +++++++++++++++++++++++---------------------- 1 file changed, 81 insertions(+), 80 deletions(-) diff --git a/lib/countly.min.js b/lib/countly.min.js index abdc1c04..38710243 100644 --- a/lib/countly.min.js +++ b/lib/countly.min.js @@ -44,7 +44,7 @@ h:f.deserialize(h)}}function w(a,d,e,h){"none"===f.storage||"object"!==L(f.stora !x?b(c.DEBUG,"Storage is disabled. Value with key: "+a+" won't be removed"):(e||(a=f.app_key+"/"+a,f.namespace&&(a=ta(f.namespace)+"/"+a)),"object"===L(f.storage)&&"function"===typeof f.storage.removeItem?f.storage.removeItem(a):(void 0===d&&(d=ra),d?localStorage.removeItem(a):"localstorage"!==f.storage&&Rb(a,"",-1)))}function Zb(){if(y(f.namespace+"cly_id",!1,!0)){w("cly_id",y(f.namespace+"cly_id",!1,!0));w("cly_id_type",y(f.namespace+"cly_id_type",!1,!0));w("cly_event",y(f.namespace+"cly_event", !1,!0));w("cly_session",y(f.namespace+"cly_session",!1,!0));var a=y(f.namespace+"cly_queue",!1,!0);Array.isArray(a)&&(a=a.filter(function(d){return d.app_key===f.app_key}),w("cly_queue",a));y(f.namespace+"cly_cmp_id",!1,!0)&&(w("cly_cmp_id",y(f.namespace+"cly_cmp_id",!1,!0)),w("cly_cmp_uid",y(f.namespace+"cly_cmp_uid",!1,!0)));y(f.namespace+"cly_ignore",!1,!0)&&w("cly_ignore",y(f.namespace+"cly_ignore",!1,!0));T("cly_id",!1,!0);T("cly_id_type",!1,!0);T("cly_event",!1,!0);T("cly_session",!1,!0);T("cly_queue", !1,!0);T("cly_cmp_id",!1,!0);T("cly_cmp_uid",!1,!0);T("cly_ignore",!1,!0)}}if(!(this instanceof q))throw new TypeError("Cannot call a class as a function");var f=this,Ya=!p.i,X=!1,ob="/i",Ua="/o/sdk",bb=u("interval",k,500),Va=u("queue_size",k,1E3),H=[],I=[],S={},sa=[],ea={},da=u("ignore_referrers",k,[]),ub=null,Ia=!0,ka,vb=0,Y=null,Ga=0,Ha=0,nb=0,ab=u("fail_timeout",k,60),Na=u("inactivity_time",k,20),Oa=0,Za=u("session_update",k,60),Ka=u("max_events",k,100),xa=u("max_logs",k,null),ja=u("use_session_cookie", -k,!0),Ja=u("session_cookie_timeout",k,30),$a=!0,Xa=!1,K=u("offline_mode",k,!1),fa={},pa=!0,Sb=F(),ra=!0,ya=null,D=1,Ma=!1,La=0,wb=!1,ia=null,Da=null,la=null,va=u("sdk_name",k,"javascript_native_web"),oa=u("sdk_version",k,"24.4.0");try{localStorage.setItem("cly_testLocal",!0),localStorage.removeItem("cly_testLocal")}catch(a){b(c.ERROR,"Local storage test failed, Halting local storage support: "+a),ra=!1}for(var E={},xb=0;xbwindow.innerHeight?"landscape":"portrait")}})};this.report_conversion=function(a,d){b(c.WARNING,"report_conversion, Deprecated function call! Use 'recordDirectAttribution' in place of this call. Call will be redirected now!");this.recordDirectAttribution(a,d)};this.recordDirectAttribution=function(a,d){b(c.INFO,"recordDirectAttribution, Recording the attribution for campaign ID: ["+ -a+"] and the user ID: ["+d+"]");this.check_consent("attribution")&&(a=a||y("cly_cmp_id")||"cly_organic",(d=d||y("cly_cmp_uid"))?P({campaign_id:a,campaign_user:d}):P({campaign_id:a}))};this.user_details=function(a){b(c.INFO,"user_details, Trying to add user details: ",a);this.check_consent("users")&&(wa(),Q(),b(c.INFO,"user_details, flushed the event queue"),a.name=z(a.name,f.maxValueSize,"user_details",b),a.username=z(a.username,f.maxValueSize,"user_details",b),a.email=z(a.email,f.maxValueSize,"user_details", -b),a.organization=z(a.organization,f.maxValueSize,"user_details",b),a.phone=z(a.phone,f.maxValueSize,"user_details",b),a.picture=z(a.picture,4096,"user_details",b),a.gender=z(a.gender,f.maxValueSize,"user_details",b),a.byear=z(a.byear,f.maxValueSize,"user_details",b),a.custom=ba(a.custom,f.maxKeyLength,f.maxValueSize,f.maxSegmentationValues,"user_details",b),P({user_details:JSON.stringify(za(a,"name username email organization phone picture gender byear custom".split(" ")))}))};var Z={},ha=function(a, -d,e){f.check_consent("users")&&(Z[a]||(Z[a]={}),"$push"===e||"$pull"===e||"$addToSet"===e?(Z[a][e]||(Z[a][e]=[]),Z[a][e].push(d)):Z[a][e]=d)};this.userData={set:function(a,d){b(c.INFO,"[userData] set, Setting user's custom property value: ["+d+"] under the key: ["+a+"]");a=z(a,f.maxKeyLength,"userData set",b);d=z(d,f.maxValueSize,"userData set",b);Z[a]=d},unset:function(a){b(c.INFO,"[userData] unset, Resetting user's custom property with key: ["+a+"] ");Z[a]=""},set_once:function(a,d){b(c.INFO,"[userData] set_once, Setting user's unique custom property value: ["+ -d+"] under the key: ["+a+"] ");a=z(a,f.maxKeyLength,"userData set_once",b);d=z(d,f.maxValueSize,"userData set_once",b);ha(a,d,"$setOnce")},increment:function(a){b(c.INFO,"[userData] increment, Increasing user's custom property value under the key: ["+a+"] by one");a=z(a,f.maxKeyLength,"userData increment",b);ha(a,1,"$inc")},increment_by:function(a,d){b(c.INFO,"[userData] increment_by, Increasing user's custom property value under the key: ["+a+"] by: ["+d+"]");a=z(a,f.maxKeyLength,"userData increment_by", -b);d=z(d,f.maxValueSize,"userData increment_by",b);ha(a,d,"$inc")},multiply:function(a,d){b(c.INFO,"[userData] multiply, Multiplying user's custom property value under the key: ["+a+"] by: ["+d+"]");a=z(a,f.maxKeyLength,"userData multiply",b);d=z(d,f.maxValueSize,"userData multiply",b);ha(a,d,"$mul")},max:function(a,d){b(c.INFO,"[userData] max, Saving user's maximum custom property value compared to the value: ["+d+"] under the key: ["+a+"]");a=z(a,f.maxKeyLength,"userData max",b);d=z(d,f.maxValueSize, -"userData max",b);ha(a,d,"$max")},min:function(a,d){b(c.INFO,"[userData] min, Saving user's minimum custom property value compared to the value: ["+d+"] under the key: ["+a+"]");a=z(a,f.maxKeyLength,"userData min",b);d=z(d,f.maxValueSize,"userData min",b);ha(a,d,"$min")},push:function(a,d){b(c.INFO,"[userData] push, Pushing a value: ["+d+"] under the key: ["+a+"] to user's custom property array");a=z(a,f.maxKeyLength,"userData push",b);d=z(d,f.maxValueSize,"userData push",b);ha(a,d,"$push")},push_unique:function(a, -d){b(c.INFO,"[userData] push_unique, Pushing a unique value: ["+d+"] under the key: ["+a+"] to user's custom property array");a=z(a,f.maxKeyLength,"userData push_unique",b);d=z(d,f.maxValueSize,"userData push_unique",b);ha(a,d,"$addToSet")},pull:function(a,d){b(c.INFO,"[userData] pull, Removing the value: ["+d+"] under the key: ["+a+"] from user's custom property array");ha(a,d,"$pull")},save:function(){b(c.INFO,"[userData] save, Saving changes to user's custom property");f.check_consent("users")&& -(wa(),Q(),b(c.INFO,"user_details, flushed the event queue"),P({user_details:JSON.stringify({custom:Z})}));Z={}}};this.report_trace=function(a){b(c.INFO,"report_trace, Reporting performance trace");if(this.check_consent("apm")){for(var d="type name stz etz apm_metrics apm_attr".split(" "),e=0;e=f.maxBreadcrumbCount;)sa.shift(),b(c.WARNING,"add_log, Reached maximum crashLogs size. Will erase the oldest one.");sa.push(a)}};this.fetch_remote_config=function(a,d,e){var h=null,m=null,g=null;a&&(e||"function"!==typeof a?Array.isArray(a)&& -(h=a):g=a);d&&(e||"function"!==typeof d?Array.isArray(d)&&(m=d):g=d);g||"function"!==typeof e||(g=e);this.useExplicitRcApi?(b(c.INFO,"fetch_remote_config, Fetching remote config"),C(h,m,this.rcAutoOptinAb?1:0,null,g)):(b(c.WARNING,"fetch_remote_config, Fetching remote config, with legacy API"),C(h,m,null,"legacy",g))};this.enrollUserToAb=function(a){b(c.INFO,"enrollUserToAb, Providing AB test keys to opt in for");a&&Array.isArray(a)&&0!==a.length?(a={method:"ab",keys:JSON.stringify(a),av:f.app_version}, -Ea(a),ca("enrollUserToAb",this.url+Ua,a,function(d,e,h){if(!d)try{var m=JSON.parse(h);b(c.DEBUG,"enrollUserToAb, Parsed the response's result: ["+m.result+"]")}catch(g){b(c.ERROR,"enrollUserToAb, Had an issue while parsing the response: "+g)}},!0)):b(c.ERROR,"enrollUserToAb, No keys provided")};this.get_remote_config=function(a){b(c.INFO,"get_remote_config, Getting remote config from storage");return"undefined"!==typeof a?S[a]:S};this.stop_time=function(){b(c.INFO,"stop_time, Stopping tracking duration"); -pa&&(pa=!1,vb=F()-ka,Ha=F()-Ga)};this.start_time=function(){b(c.INFO,"start_time, Starting tracking duration");pa||(pa=!0,ka=F()-vb,Ga=F()-Ha,Ha=0,Ba())};this.track_sessions=function(){function a(){document[e]||!document.hasFocus()?f.stop_time():f.start_time()}function d(){Oa>=Na&&f.start_time();Oa=0}if(x){b(c.INFO,"track_session, Starting tracking user session");this.begin_session();this.start_time();A(window,"beforeunload",function(){wa();Q();f.end_session()});var e="hidden";A(window,"focus",a); -A(window,"blur",a);A(window,"pageshow",a);A(window,"pagehide",a);"onfocusin"in document&&(A(window,"focusin",a),A(window,"focusout",a));e in document?document.addEventListener("visibilitychange",a):"mozHidden"in document?(e="mozHidden",document.addEventListener("mozvisibilitychange",a)):"webkitHidden"in document?(e="webkitHidden",document.addEventListener("webkitvisibilitychange",a)):"msHidden"in document&&(e="msHidden",document.addEventListener("msvisibilitychange",a));A(window,"mousemove",d);A(window, -"click",d);A(window,"keydown",d);A(window,"scroll",d);setInterval(function(){Oa++;Oa>=Na&&f.stop_time()},6E4)}else b(c.WARNING,"track_sessions, window object is not available. Not tracking sessions.")};this.track_pageview=function(a,d,e){if(x||a)if(b(c.INFO,"track_pageview, Tracking page views"),b(c.VERBOSE,"track_pageview, last view is:["+Y+"], current view ID is:["+ia+"], previous view ID is:["+Da+"]"),Y&&wb&&(b(c.DEBUG,"track_pageview, Scroll registry triggered"),tb(),Ma=!0,La=0),na(),Da=ia,ia= -fb(),(a=z(a,f.maxKeyLength,"track_pageview",b))&&Array.isArray(a)&&(d=a,a=null),a||(a=this.getViewName()),void 0===a||""===a)b(c.ERROR,"track_pageview, No page name to track (it is either undefined or empty string). No page view can be tracked.");else if(null===a)b(c.ERROR,"track_pageview, View name returned as null. Page view will be ignored.");else{if(d&&d.length)for(var h=0;h