macro-parameters 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1 +1 @@
1
- var e=function(){return e=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},e.apply(this,arguments)};function n(e){var n,t=new RegExp("(^| )"+e+"=([^;]*)(;|$)");return(n=(document.cookie||window.localStorage&&window.localStorage.cookie||"").match(t))?unescape(n[2]):""}function t(e){return"object"==typeof localStorage?localStorage.getItem(e):null}function o(e,n,t,o,r,a){var i=e+"="+escape(n)+(t?";expires="+t.toGMTString():"");document.cookie=i}function r(e){var n=window.externalMacroParam;return n&&"object"==typeof n&&n.hasOwnProperty(e)?n[e]:""}function a(){var e=n("WhaleADID");return null!=e&&""!=e&&null!=e&&e&&e.match(/-/g)&&4==e.match(/-/g).length?o("WhaleADID",e,new Date((new Date).getTime()+31536e6)):o("WhaleADID",e=function(){function e(e){var n=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+n.substr(0,4)+"-"+n.substr(4,4):n}return e()+e(!0)+e(!0)+e()}(),new Date((new Date).getTime()+31536e6)),e}"function"==typeof SuppressedError&&SuppressedError;var i={"[whale_ad_id]":function(){return a()},"[tv_brand]":function(){return function(){if(localStorage.getItem("brand"))return localStorage.getItem("brand");var e="others",n=navigator.userAgent.toLocaleLowerCase(),t=n.indexOf("titanos")>-1,o=n.indexOf("aoc")>-1,r=n.indexOf("philips")>-1,a=n.indexOf("tcl")>-1||n.indexOf("tbrowser")>-1,i=n.indexOf("moka")>-1,c=n.indexOf("skw")>-1,u=n.indexOf("tizen")>-1||n.indexOf("samsung")>-1||n.indexOf("smarthub")>-1,l=n.indexOf("webos")>-1||n.indexOf("lg")>-1||n.indexOf("web0s")>-1||n.indexOf("netcast")>-1,s=n.indexOf("vstvb")>-1;switch(!0){case t:e="Philips";break;case o:e="AOC";break;case r:e="Philips";break;case a:e="TCL";break;case i:e="MOKA";break;case c:e="Skyworth";break;case u:e="Samsung";break;case l:e="LG";break;case s:e="Vestel"}return e}()},"[cntry]":function(){return t("macro_cntry")},"[geo_ip_country]":function(){return t("macro_cntry")},"[platform_id]":function(){return(e=n("profileid")||n("profileId"))&&""!=e?e.split("_")[1]:"Unknown";var e},"[device_user_agent]":function(){var e=navigator.userAgent;return encodeURIComponent(e)},"[device_ip_address]":function(){return r("device_ip_address")},"[menu_language]":function(){var e=navigator.language;return e?e.length>2?e.slice(0,2):e:"un"},"[time_zone]":function(){return(new Date).getTimezoneOffset()}},c={"[whale_gdpr]":function(){return r("whale_gdpr")||("true"==n("relAdvert")?1:0)},"[whale_gdpr_consent]":function(){return n("tcString")||t("default_tcString")},"[relevant_ads]":function(){var e="false";return e=null==(e=(navigator.userAgent.toUpperCase().indexOf("AOC"),n("relAdvert")))?"false":e},"[device_dnt]":function(){return r("device_dnt")||("true"==n("relAdvert")?0:1)},"[device_lmt]":function(){return"true"===n("relAdvert")?0:1},"[privacy_policy]":function(){}},u={"[rnd]":function(){return(new Date).getTime()},"[timestamp]":function(){return(new Date).getTime()},"[ad_sdk_ver]":function(){return""},"[google_pal]":function(){return!window.googleNonce&&n("googleNonce")?n("googleNonce"):(window.googleNonce&&o("googleNonce",window.googleNonce,new Date((new Date).getTime()+216e5)),window.googleNonce||"")}},l={"[device_id]":function(){return n("deviceid")||n("deviceId")},"[session_id]":function(){return window.session_id},"[usertag]":function(){return n("usertag")}};var s=e(e(e(e(e(e({},{"[tv_domain]":function(){return document.domain},"[app_name]":function(){},"[bundle_id]":function(){},"[app_store_url]":function(){},"[src_page_url]":function(){return encodeURIComponent(location.origin||"".concat(location.protocol,"//").concat(location.host||location.hostname).concat(location.port))},"[player_height]":function(){},"[player_width]":function(){},"[placement]":function(){},"[app_store]":function(){return r("app_store")||"Zeasn"}}),{"[provider_id]":function(){},"[channel_no]":function(){},"[channel_category]":function(){},"[channel_name]":function(){},"[iab_category]":function(){},"[avod_id]":function(){},"[avod_genre]":function(){},"[avod_title]":function(){},"[oriented_age]":function(){},"[oriented_gender]":function(){},"[ssai_vendor]":function(){}}),i),c),u),l),d=function(){function e(){var e,n,t;this.params={},e="https://ipapi.zeasn.com/ipapi/location",n=function(e){var n,t,o=e.iso_code;n="macro_cntry",t=o,"object"==typeof localStorage&&localStorage.setItem(n,t)},t=document.createElement("script"),window.zeasnIpapiCallback=function(e){n(e),document.body.removeChild(t)},t.src="".concat(e,"?callback=zeasnIpapiCallback"),document.body.appendChild(t)}return e.prototype.set=function(e){if(e)for(var n in e)e.hasOwnProperty(n)&&(this.params[n]=e[n]);else console.log("Invalid settings")},e.prototype.handle=function(e){return function(e,n){for(var t in s){var o=t.replace("[","\\[").replace("]","\\]"),r=t.replace("[","").replace("]","");e=e.replace(new RegExp(o,"g"),n[r]||s[t]()||"")}return a=/\[.*?\]/g,e.replace(a,"");var a}(e,this.params)},e}();export{d as MacroSubstitution};
1
+ var e=function(){return e=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},e.apply(this,arguments)};function n(e){var n,t=new RegExp("(^| )"+e+"=([^;]*)(;|$)");return(n=(document.cookie||window.localStorage&&window.localStorage.cookie||"").match(t))?unescape(n[2]):""}function t(e,n,t,r,o,i){var a=e+"="+escape(n)+(t?";expires="+t.toGMTString():"");document.cookie=a}function r(e){var n=window.externalMacroParam;return n&&"object"==typeof n&&n.hasOwnProperty(e)?n[e]:""}function o(){var e=n("WhaleADID");return null!=e&&""!=e&&null!=e&&e&&e.match(/-/g)&&4==e.match(/-/g).length?t("WhaleADID",e,new Date((new Date).getTime()+31536e6)):t("WhaleADID",e=function(){function e(e){var n=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+n.substr(0,4)+"-"+n.substr(4,4):n}return e()+e(!0)+e(!0)+e()}(),new Date((new Date).getTime()+31536e6)),e}"function"==typeof SuppressedError&&SuppressedError;var i={"[whale_ad_id]":function(){return o()},"[tv_brand]":function(){return function(){var e="others",n=navigator.userAgent.toLocaleLowerCase(),t=n.indexOf("titanos")>-1,r=n.indexOf("aoc")>-1,o=n.indexOf("philips")>-1,i=n.indexOf("tcl")>-1||n.indexOf("tbrowser")>-1,a=n.indexOf("moka")>-1,c=n.indexOf("skw")>-1,u=n.indexOf("tizen")>-1||n.indexOf("samsung")>-1||n.indexOf("smarthub")>-1,s=n.indexOf("webos")>-1||n.indexOf("lg")>-1||n.indexOf("web0s")>-1||n.indexOf("netcast")>-1,d=n.indexOf("vstvb")>-1;switch(!0){case t:e="Philips";break;case r:e="AOC";break;case o:e="Philips";break;case i:e="TCL";break;case a:e="MOKA";break;case c:e="Skyworth";break;case u:e="Samsung";break;case s:e="LG";break;case d:e="Vestel"}return e}()},"[cntry]":function(){return n("macro_cntry")},"[geo_ip_country]":function(){return n("macro_cntry")},"[platform_id]":function(){return(e=n("profileid")||n("profileId"))&&""!=e?e.split("_")[1]:"Unknown";var e},"[device_user_agent]":function(){var e=navigator.userAgent;return encodeURIComponent(e)},"[device_ip_address]":function(){return r("device_ip_address")},"[menu_language]":function(){var e=navigator.language;return e?e.length>2?e.slice(0,2):e:"un"},"[time_zone]":function(){return(new Date).getTimezoneOffset()}},a={"[whale_gdpr]":function(){return r("whale_gdpr")||("true"==n("relAdvert")?1:0)},"[whale_gdpr_consent]":function(){return n("tcString")},"[relevant_ads]":function(){var e="false";return e=null==(e=(navigator.userAgent.toUpperCase().indexOf("AOC"),n("relAdvert")))?"false":e},"[device_dnt]":function(){return r("device_dnt")||("true"==n("relAdvert")?0:1)},"[device_lmt]":function(){return"true"===n("relAdvert")?0:1},"[privacy_policy]":function(){}},c={"[rnd]":function(){return(new Date).getTime()},"[timestamp]":function(){return(new Date).getTime()},"[ad_sdk_ver]":function(){return""},"[google_pal]":function(){return!window.googleNonce&&n("googleNonce")?n("googleNonce"):(window.googleNonce&&t("googleNonce",window.googleNonce,new Date((new Date).getTime()+216e5)),window.googleNonce||"")}},u={"[device_id]":function(){return n("deviceid")||n("deviceId")},"[session_id]":function(){return window.session_id},"[usertag]":function(){return n("usertag")}};var s=e(e(e(e(e(e({},{"[tv_domain]":function(){return document.domain},"[app_name]":function(){},"[bundle_id]":function(){},"[app_store_url]":function(){},"[src_page_url]":function(){return encodeURIComponent(location.origin||"".concat(location.protocol,"//").concat(location.host||location.hostname).concat(location.port))},"[player_height]":function(){},"[player_width]":function(){},"[placement]":function(){},"[app_store]":function(){return r("app_store")||"Zeasn"}}),{"[provider_id]":function(){},"[channel_no]":function(){},"[channel_category]":function(){},"[channel_name]":function(){},"[iab_category]":function(){},"[avod_id]":function(){},"[avod_genre]":function(){},"[avod_title]":function(){},"[oriented_age]":function(){},"[oriented_gender]":function(){},"[ssai_vendor]":function(){}}),i),a),c),u),d=function(){function e(){var e,n,r;this.params={},e="https://ipapi.zeasn.com/ipapi/location",n=function(e){t("macro_cntry",e.iso_code,new Date((new Date).getTime()+31536e6))},r=document.createElement("script"),window.zeasnIpapiCallback=function(e){n(e),document.body.removeChild(r)},r.src="".concat(e,"?callback=zeasnIpapiCallback"),document.body.appendChild(r)}return e.prototype.set=function(e){if(e)for(var n in e)e.hasOwnProperty(n)&&(this.params[n]=e[n]);else console.log("Invalid settings")},e.prototype.handle=function(e){return function(e,n){for(var t in s){var r=t.replace("[","\\[").replace("]","\\]"),o=t.replace("[","").replace("]","");e=e.replace(new RegExp(r,"g"),n[o]||s[t]()||"")}return i=/\[.*?\]/g,e.replace(i,"");var i}(e,this.params)},e}();export{d as MacroSubstitution};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "macro-parameters",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Provide unified macro parameter retrieval",
5
5
  "main": "index.js",
6
6
  "scripts": {