Files
JiboSDK/node_modules/jibo-analytics/lib/index.js

9 lines
2.0 KiB
JavaScript
Raw Normal View History

2026-03-22 03:21:45 +02:00
/**
* jibo-analytics - Simple Google Measurements Protocol client
* @version v0.1.6
* Copyright (c) 2016, Jibo, Inc. All rights reserved.
* All use of the Jibo SDK is subject to the Jibo SDK End User License Agreement (EULA)
* distributed herewith. If you did not receive a copy of the EULA, you may view a
* copy at https://developers.jibo.com/license.
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.index=e()}}(function(){return function e(n,t,o){function r(f,u){if(!t[f]){if(!n[f]){var a="function"==typeof require&&require;if(!u&&a)return a(f,!0);if(i)return i(f,!0);var d=new Error("Cannot find module '"+f+"'");throw d.code="MODULE_NOT_FOUND",d}var c=t[f]={exports:{}};n[f][0].call(c.exports,function(e){var t=n[f][1][e];return r(t?t:e)},c,c.exports,e,n,t,o)}return t[f].exports}for(var i="function"==typeof require&&require,f=0;f<o.length;f++)r(o[f]);return r}({1:[function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}function i(e){var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.join("&")}function f(e){const n="/collect?"+i(e);var t={hostname:"www.google-analytics.com",port:443,path:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}},o=a["default"].request(t,function(){});o.on("error",function(){}),o.end()}Object.defineProperty(t,"__esModule",{value:!0});var u=e("https"),a=o(u),d=e("assert"),c=o(d);let l,s,p={init(e,n){l=e,s=n||r()},event(e,n,t){(0,c["default"])(l,"analytics.init(UA-*) must be called before any other API calls");var o=t||{};o.v="1",o.tid=l,o.cid=s,o.t="event",o.ec=e,o.ea=n,f(o)}};t["default"]=p},{assert:void 0,https:void 0}]},{},[1])(1)});