From 415a5bf2a8d72282e74b45a38fc5da14dec0399b Mon Sep 17 00:00:00 2001 From: skocheri Date: Thu, 17 Mar 2022 10:55:51 +0530 Subject: [PATCH] Minifying js --- pubcid.js/docs/index.html | 2 +- pubcid.js/docs/pubcid.min.js | 2 +- pubcid.js/docs/pubcid.min.js.map | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubcid.js/docs/index.html b/pubcid.js/docs/index.html index a3f177d..94d7518 100644 --- a/pubcid.js/docs/index.html +++ b/pubcid.js/docs/index.html @@ -10,6 +10,6 @@

Pubcid Collector Script Demo

const pubcid = googletag.encryptedSignalProviders.find(el => el.id === 'pubcid.org'); pubcid.collectorFunction(); -Cookie pubcid.org stored +Local Storage pubcid.org stored diff --git a/pubcid.js/docs/pubcid.min.js b/pubcid.js/docs/pubcid.min.js index 0a956b9..79d0a81 100644 --- a/pubcid.js/docs/pubcid.min.js +++ b/pubcid.js/docs/pubcid.min.js @@ -1,2 +1,2 @@ -(()=>{const o="pubcid.org";window.googletag=window.googletag||{cmd:[]},window.googletag.encryptedSignalProviders=window.googletag.encryptedSignalProviders||[],googletag.encryptedSignalProviders.push({id:"pubcid.org",collectorFunction:function(){return new Promise(((e,n)=>fetch("https://id.sharedid.org/pubcid").then((o=>o.json())).then((e=>document.cookie=o+"="+e[o])).then(e).catch(n)))}})})(); +(()=>{const o="pubcid.org";function e(o){return o?(o^(window&&window.crypto&&window.crypto.getRandomValues?crypto.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random())>>o/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}window.googletag=window.googletag||{cmd:[]},window.googletag.encryptedSignalProviders=window.googletag.encryptedSignalProviders||[],window.pbjs=window.pbjs||[],googletag.encryptedSignalProviders.push({id:o,collectorFunction:function(){return new Promise(((n,t)=>{const i=pbjs.getUserIdsAsEids().filter((function(e){return e&&e.source==o}));let r=i?i[0].uids[0].id:e();window.localStorage.setItem(o,r),r?n(r):t("Setting local storage failed")}))}})})(); //# sourceMappingURL=pubcid.min.js.map \ No newline at end of file diff --git a/pubcid.js/docs/pubcid.min.js.map b/pubcid.js/docs/pubcid.min.js.map index 269cb3a..44b10f0 100644 --- a/pubcid.js/docs/pubcid.min.js.map +++ b/pubcid.js/docs/pubcid.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://pubcid.js/./src/index.js"],"names":["SOURCE","window","googletag","cmd","encryptedSignalProviders","push","id","collectorFunction","Promise","resolve","reject","fetch","then","response","json","data","document","cookie","catch"],"mappings":"MAAA,MAAMA,EAAS,aAGfC,OAAOC,UAAYD,OAAOC,WAAa,CAACC,IAAK,IAC7CF,OAAOC,UAAUE,yBAA2BH,OAAOC,UAAUE,0BAA4B,GAWzFF,UAAUE,yBAAyBC,KAAK,CACpCC,GAAI,aACJC,kBAXJ,WACI,OAAO,IAAIC,SAAQ,CAACC,EAASC,IAAWC,MANhC,kCAOHC,MAAKC,GAAYA,EAASC,SAC1BF,MAAKG,GAAQC,SAASC,OAASjB,EAAS,IAAMe,EAAKf,KACnDY,KAAKH,GACLS,MAAMR,S","file":"pubcid.min.js","sourcesContent":["const SOURCE = 'pubcid.org';\nconst URL = 'https://id.sharedid.org/pubcid';\n\nwindow.googletag = window.googletag || {cmd: []};\nwindow.googletag.encryptedSignalProviders = window.googletag.encryptedSignalProviders || [];\n\nfunction collector() {\n return new Promise((resolve, reject) => fetch(URL)\n .then(response => response.json())\n .then(data => document.cookie = SOURCE + '=' + data[SOURCE])\n .then(resolve)\n .catch(reject)\n );\n}\n\ngoogletag.encryptedSignalProviders.push({\n id: 'pubcid.org',\n collectorFunction: collector\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://pubcid.js/./src/index.js"],"names":["SOURCE","generateUUID","placeholder","window","crypto","getRandomValues","Uint8Array","Math","random","toString","replace","googletag","cmd","encryptedSignalProviders","pbjs","push","id","collectorFunction","Promise","resolve","reject","pubCommonUids","getUserIdsAsEids","filter","eids","source","pubcidValue","uids","localStorage","setItem"],"mappings":"MAAA,MAAMA,EAAS,aA2Bf,SAASC,EAAaC,GAClB,OAAOA,GACAA,GASHC,QAAUA,OAAOC,QAAUD,OAAOC,OAAOC,gBAClCD,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAK,GAE/B,GAAhBC,KAAKC,WAZwBN,EAAc,GAAGO,SAAS,KAC3D,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,SAAUT,GA5BjEE,OAAOQ,UAAYR,OAAOQ,WAAa,CAACC,IAAK,IAC7CT,OAAOQ,UAAUE,yBAA2BV,OAAOQ,UAAUE,0BAA4B,GACzFV,OAAOW,KAAQX,OAAOW,MAAQ,GAyC9BH,UAAUE,yBAAyBE,KAAK,CACpCC,GAAIhB,EACJiB,kBAzCJ,WACI,OAAO,IAAIC,SAAQ,CAACC,EAASC,KACzB,MAAMC,EAAgBP,KAAKQ,mBAAmBC,QAAO,SAAUC,GAC3D,OAAOA,GAAQA,EAAKC,QAAUzB,KAEnC,IAAI0B,EAAcL,EAAgBA,EAAc,GAAGM,KAAK,GAAGX,GAAKf,IAC/DE,OAAOyB,aAAaC,QAAQ7B,EAAQ0B,GAChCA,EACAP,EAAQO,GAERN,EAAO,uC","file":"pubcid.min.js","sourcesContent":["const SOURCE = 'pubcid.org';\n\nwindow.googletag = window.googletag || {cmd: []};\nwindow.googletag.encryptedSignalProviders = window.googletag.encryptedSignalProviders || [];\nwindow.pbjs = window.pbjs || [];\n\nfunction collector() {\n return new Promise((resolve, reject) => {\n const pubCommonUids = pbjs.getUserIdsAsEids().filter(function (eids) {\n return eids && eids.source == SOURCE;\n });\n let pubcidValue = pubCommonUids ? pubCommonUids[0].uids[0].id : generateUUID();\n window.localStorage.setItem(SOURCE, pubcidValue);\n if (pubcidValue) {\n resolve(pubcidValue);\n } else {\n reject(\"Setting local storage failed\");\n }\n });\n}\n\n/**\n * Returns a random v4 UUID of the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx,\n * where each x is replaced with a random hexadecimal digit from 0 to f,\n * and y is replaced with a random hexadecimal digit from 8 to b.\n * https://gist.github.com/jed/982883 via node-uuid\n */\nfunction generateUUID(placeholder) {\n return placeholder\n ? (placeholder ^ getRandomData() >> placeholder / 4).toString(16)\n : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, generateUUID);\n}\n\n/**\n * Returns random data using the Crypto API if available and Math.random if not\n * Method is from https://gist.github.com/jed/982883 like generateUUID, direct link https://gist.github.com/jed/982883#gistcomment-45104\n */\nfunction getRandomData() {\n if (window && window.crypto && window.crypto.getRandomValues) {\n return crypto.getRandomValues(new Uint8Array(1))[0] % 16;\n } else {\n return Math.random() * 16;\n }\n}\n\ngoogletag.encryptedSignalProviders.push({\n id: SOURCE,\n collectorFunction: collector\n});\n"],"sourceRoot":""} \ No newline at end of file