debian-mirror-gitlab/public/-/sp.js

9 lines
73 KiB
JavaScript
Raw Normal View History

2023-06-20 00:43:36 +05:30
/*!
* Web analytics for Snowplow v3.8.0 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
* Licensed under BSD-3-Clause
2020-10-24 23:57:45 +05:30
*/
2023-06-20 00:43:36 +05:30
"use strict";!function(){function e(e,n){var t,o={};for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)0>n.indexOf(t[r])&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(o[t[r]]=e[t[r]])}return o}function n(e,n,t){if(t||2===arguments.length)for(var o,r=0,a=n.length;r<a;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function t(){var e,n={},t=[],o=[],a=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n])},addJson:function(e,n,a){a&&r(a)&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:a},o.push(e),t.push(e))},addContextEntity:function(e){a.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,o,a),n}}}function o(e){return function(t,o,r){for(var a=function(n,o,r){if(n=JSON.stringify(n),e){if(r=t.add,n){var a=0,i=0,c=[];if(n){n=unescape(encodeURIComponent(n));do{var s=n.charCodeAt(a++),u=n.charCodeAt(a++),l=n.charCodeAt(a++),f=s<<16|u<<8|l;s=f>>18&63,u=f>>12&63,l=f>>6&63,f&=63,c[i++]=He.charAt(s)+He.charAt(u)+He.charAt(l)+He.charAt(f)}while(a<n.length);a=c.join(""),n=((n=n.length%3)?a.slice(0,n-3):a)+"===".slice(n||3)}n=n.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}r.call(t,o,n)}else t.add(r,n)},i=function(n,o){if(!n){var r=t.getPayload();if(e?r.cx:r.co){var a=(n=JSON).parse;if(e){if(r=r.cx){switch(4-r.length%4){case 2:r+="==";break;case 3:r+="="}r=function(e){var n,t=0,o=0,r="",a=[];if(!e)return e;e+="";do{var i=He.indexOf(e.charAt(t++)),c=He.indexOf(e.charAt(t++));r=He.indexOf(e.charAt(t++));var s=He.indexOf(e.charAt(t++)),u=i<<18|c<<12|r<<6|s;i=u>>16&255,c=u>>8&255,u&=255,a[o++]=64===r?String.fromCharCode(i):64===s?String.fromCharCode(i,c):String.fromCharCode(i,c,u)}while(t<e.length);return r=a.join(""),n=r.replace(/\0+$/,""),decodeURIComponent(n.split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(r=r.replace(/-/g,"+").replace(/_/g,"/"))}}else r=r.co;n=a.call(n,r)}else n=void 0}return n?n.data=n.data.concat(o.data):n=o,n},c=void 0,s=0;s<o.length;s++){var u=o[s];"cx"===u.keyIfEncoded?c=i(c,u.json):a(u.json,u.keyIfEncoded,u.keyIfNotEncoded)}o.length=0,r.length&&(c=i(c,o={schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:n([],r,!0)}),r.length=0),c&&a(c,"cx","co")}}function r(e){if(!a(e))return!1;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!0;return!1}function a(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function i(){var e=[],n=[];return{getGlobalPrimitives:function(){return e},getConditionalProviders:function(){return n},addGlobalContexts:function(t){for(var o=[],r=[],a=0;a<t.length;a++){var i=t[a];y(i)?o.push(i):g(i)&&r.push(i)}e=e.concat(r),n=n.concat(o)},clearGlobalContexts:function(){n=[],e=[]},removeGlobalContexts:function(t){for(var o=function(t){y(t)?n=n.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})):g(t)&&(e=e.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})))},r=0;r<t.length;r++)o(t[r])},getApplicableContexts:function(t){e:{for(var o=0,r=t.getJson();o<r.length;o++){var a=r[o];if("ue_px"===a.keyIfEncoded&&"object"==typeof a.json.data&&"string"==typeof(a=a.json.data.schema)){o=a;break e}}o=""}a="string"==typeof(r=t.getPayload().e)?r:"",r=[];var i=b(e,t,a,o);return r.push.apply(r,i),t=function(e,n,t,o){var r;return e=A(e).map((function(e){e:{if(v(e)){var r=e[0],a=!1;try{a=r({event:n.getPayload(),eventType:t,eventSchema:o})}catch(e){a=!1}if(!0===a){e=b(e[1],n,t,o);break e}}else if(h(e)&&function(e,n){var t=0,o=0,r=e.accept;return Array.isArray(r)?e.accept.some((function(e){return w(e,n)}))&&o++:"string"==typeof r&&w(r,n)&&o++,r=e.reject,Array.isArray(r)?e.reject.some((function(e){return w(e,n)}))&&t++:"string"==typeof r&&w(r,n)&&t++,0<o
//# sourceMappingURL=sp.js.map