This repository has been archived by the owner on Mar 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuzzscreen-extension-0.0.2.js
1 lines (1 loc) · 2.3 KB
/
buzzscreen-extension-0.0.2.js
1
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.BuzzScreen=n():e.BuzzScreen=n()}("undefined"!=typeof self?self:this,function(){return function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="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};n.default=function(){function e(){return"undefined"!==("undefined"==typeof BuzzScreenWhiteLabel?"undefined":r(BuzzScreenWhiteLabel))}function n(e){return Number(e)===parseInt(e)}function t(e){return(void 0===e?"undefined":r(e))===r("string")}function o(e){return n(e)}function u(e){return[c,d].includes(e)}function i(e){try{return(void 0===e?"undefined":r(e))===r("string")&&(JSON.parse(e),!0)}catch(e){return!1}}function f(e){s&&console.info(e)}var c="M",d="F",s=!1;return{GENDER_MALE:c,GENDER_FEMALE:d,ERROR_NO_WHITE_LABEL_CONTEXT:-1,ERROR_INVALID_PARAM:-2,isBuzzScreenWebView:e,setVerbose:function(e){if((void 0===e?"undefined":r(e))!==r(!0))return void console.error("Invalid verbose: "+e+". It must be a boolean value.");s=e},notifySignedIn:function(n,r,c,d){if(!n||!t(n))throw"Invalid userId: "+n;return r&&!o(r)&&console.error("Invalid birthYear: "+r),c&&!u(c)&&console.error("Invalid gender: "+c+". The 'gender' must be either 'BuzzScreen.GENDER_MALE' or 'BuzzScreen.GENDER_FEMALE'"),d&&!i(d)&&console.error("Invalid extraJsonString: "+d),f("The parameters appear to be set correctly."),e()?(BuzzScreenWhiteLabel.notifySignedIn(n,r,c,d),0):(f("There is no Buzzscreen WebView Context."),-1)},notifyNotSignedIn:function(){return e()?(BuzzScreenWhiteLabel.notifyNotSignedIn(),0):(f("There is no Buzzscreen WebView Context."),-1)}}}()}]).default});