vue-hotjar
Version:
Vue Hotjar plugin
1 lines • 3.05 kB
JavaScript
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}("undefined"!=typeof self?self:this,(function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){"use strict";t.r(n);var r=function e(n,t){var r,o,i,u;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),r=window,o=document,r.hj=r.hj||function(){(r.hj.q=r.hj.q||[]).push(arguments)},r._hjSettings={hjid:n,hjsv:t},i=o.getElementsByTagName("head")[0],(u=o.createElement("script")).async=1,u.src="https://static.hotjar.com/c/hotjar-"+r._hjSettings.hjid+".js?sv="+r._hjSettings.hjsv,i.appendChild(u)};function o(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,t,r;return n=e,r=[{key:"options",value:function(e){if(function(){var n=new RegExp(/^([0-9])*\d$/g);if(e.id){if(!1===n.test(e.id))throw new Error("Invalid Hotjar Tracking ID");if("string"!=typeof e.id)throw new Error("Hotjar Tracking ID expects a string");return!0}throw new Error("Hotjar Tracking ID is not defined")}()&&function(){if("boolean"!=typeof e.isProduction&&e.isProduction)throw new Error("isProduction expects a boolean");return!0}()&&function(){if("number"!=typeof e.snippetVersion&&e.snippetVersion)throw new Error("snippetVersion expects a number");return!0}())return!0}}],(t=null)&&o(n.prototype,t),r&&o(n,r),e}();function u(e){try{var n=e.id,t=e.snippetVersion,o=void 0===t?6:t,u=e.isProduction,a=void 0===u||u;return i.options(e)&&a?(new r(n,o),window.hj):(console.log("%c 🔥 HotJar Tracking Disabled 🔥","color: #fff; background: #35495d; font-size: 14px; border-radius: 5px; padding: 10px 5px; margin: 20px 0;"),!1)}catch(e){return console.error(e),!1}}n.default={install:function(e,n){"2"===e.version[0]?(e.prototype.$hj=u(n),e.prototype.$hjOptions=n):u(n)}}}])}));