Skip to content

Instantly share code, notes, and snippets.

@hteumeuleu
Created February 21, 2020 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hteumeuleu/82ebecf8241dc841158abacef82c1c5d to your computer and use it in GitHub Desktop.
Save hteumeuleu/82ebecf8241dc841158abacef82c1c5d to your computer and use it in GitHub Desktop.
Script file from Gmail Android APK
(function(){/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
var aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba=function(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}return globalThis},t=ba(this),ca=function(a,b){if(b){var c=t;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&
null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}};
ca("String.prototype.endsWith",function(a){return a?a:function(b,c){if(null==this)throw new TypeError("The 'this' value for String.prototype.endsWith must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype.endsWith must not be a regular expression");var d=this+"";b+="";void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}});
var da=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}},ea=function(){ea=function(){};t.Symbol||(t.Symbol=fa)},ha=function(a,b){this.a=a;aa(this,"description",{configurable:!0,writable:!0,value:b})};ha.prototype.toString=function(){return this.a};
var fa=function(){function a(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new ha("jscomp_symbol_"+(c||"")+"_"+b++,c)}var b=0;return a}(),ja=function(){ea();var a=t.Symbol.iterator;a||(a=t.Symbol.iterator=t.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ia(da(this))}});ja=function(){}},ia=function(a){ja();a={next:a};a[t.Symbol.iterator]=function(){return this};return a};
ca("Array.from",function(a){return a?a:function(b,c,d){c=null!=c?c:function(f){return f};var e=[],g="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];if("function"==typeof g){b=g.call(b);for(var k=0;!(g=b.next()).done;)e.push(c.call(d,g.value,k++))}else for(g=b.length,k=0;k<g;k++)e.push(c.call(d,b[k],k));return e}});
var ka=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:da(a)}},v=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};
ca("WeakMap",function(a){function b(){}function c(h){var l=typeof h;return"object"===l&&null!==h||"function"===l}function d(h){if(!v(h,g)){var l=new b;aa(h,g,{value:l})}}function e(h){var l=Object[h];l&&(Object[h]=function(m){if(m instanceof b)return m;d(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var h=Object.seal({}),l=Object.seal({}),m=new a([[h,2],[l,3]]);if(2!=m.get(h)||3!=m.get(l))return!1;m["delete"](h);m.set(l,4);return!m.has(h)&&4==m.get(l)}catch(r){return!1}}())return a;
var g="$jscomp_hidden_"+Math.random();e("freeze");e("preventExtensions");e("seal");var k=0,f=function(h){this.a=(k+=Math.random()+1).toString();if(h){h=ka(h);for(var l;!(l=h.next()).done;)l=l.value,this.set(l[0],l[1])}};f.prototype.set=function(h,l){if(!c(h))throw Error("Invalid WeakMap key");d(h);if(!v(h,g))throw Error("WeakMap key fail: "+h);h[g][this.a]=l;return this};f.prototype.get=function(h){return c(h)&&v(h,g)?h[g][this.a]:void 0};f.prototype.has=function(h){return c(h)&&v(h,g)&&v(h[g],this.a)};
f.prototype["delete"]=function(h){return c(h)&&v(h,g)&&v(h[g],this.a)?delete h[g][this.a]:!1};return f});
ca("Map",function(a){if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var f=Object.seal({x:4}),h=new a(ka([[f,"s"]]));if("s"!=h.get(f)||1!=h.size||h.get({x:4})||h.set({x:4},"t")!=h||2!=h.size)return!1;var l=h.entries(),m=l.next();if(m.done||m.value[0]!=f||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x||"t"!=m.value[1]||!l.next().done?!1:!0}catch(r){return!1}}())return a;ja();var b=new WeakMap,c=function(f){this.b={};this.a=
g();this.size=0;if(f){f=ka(f);for(var h;!(h=f.next()).done;)h=h.value,this.set(h[0],h[1])}};c.prototype.set=function(f,h){f=0===f?0:f;var l=d(this,f);l.list||(l.list=this.b[l.id]=[]);l.g?l.g.value=h:(l.g={next:this.a,h:this.a.h,head:this.a,key:f,value:h},l.list.push(l.g),this.a.h.next=l.g,this.a.h=l.g,this.size++);return this};c.prototype["delete"]=function(f){f=d(this,f);return f.g&&f.list?(f.list.splice(f.index,1),f.list.length||delete this.b[f.id],f.g.h.next=f.g.next,f.g.next.h=f.g.h,f.g.head=
null,this.size--,!0):!1};c.prototype.clear=function(){this.b={};this.a=this.a.h=g();this.size=0};c.prototype.has=function(f){return!!d(this,f).g};c.prototype.get=function(f){return(f=d(this,f).g)&&f.value};c.prototype.entries=function(){return e(this,function(f){return[f.key,f.value]})};c.prototype.keys=function(){return e(this,function(f){return f.key})};c.prototype.values=function(){return e(this,function(f){return f.value})};c.prototype.forEach=function(f,h){for(var l=this.entries(),m;!(m=l.next()).done;)m=
m.value,f.call(h,m[1],m[0],this)};c.prototype[Symbol.iterator]=c.prototype.entries;var d=function(f,h){var l=h&&typeof h;"object"==l||"function"==l?b.has(h)?l=b.get(h):(l=""+ ++k,b.set(h,l)):l="p_"+h;var m=f.b[l];if(m&&v(f.b,l))for(f=0;f<m.length;f++){var r=m[f];if(h!==h&&r.key!==r.key||h===r.key)return{id:l,list:m,index:f,g:r}}return{id:l,list:m,index:-1,g:void 0}},e=function(f,h){var l=f.a;return ia(function(){if(l){for(;l.head!=f.a;)l=l.h;for(;l.next!=l.head;)return l=l.next,{done:!1,value:h(l)};
l=null}return{done:!0,value:void 0}})},g=function(){var f={};return f.h=f.next=f.head=f},k=0;return c});
var w=this||self,ma=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b},na=function(a,b,c){return a.call.apply(a.bind,arguments)},oa=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}},pa=function(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?
pa=na:pa=oa;return pa.apply(null,arguments)},x=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}},qa=Date.now||function(){return+new Date},y=function(a,b){a=a.split(".");var c=w;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b},ra=function(a,b){function c(){}c.prototype=b.prototype;
a.prototype=new c;a.prototype.constructor=a};var z=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,z);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};ra(z,Error);z.prototype.name="CustomError";var A=function(a,b){a=a.split("%s");for(var c="",d=a.length-1,e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:"%s");z.call(this,c+a[d])};ra(A,z);A.prototype.name="AssertionError";var sa=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},B=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e="string"===typeof a?a.split(""):a,g=0;g<d;g++)g in e&&b.call(c,e[g],g,a)},ta=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,
b,void 0)}:function(a,b){for(var c=a.length,d=[],e=0,g="string"===typeof a?a.split(""):a,k=0;k<c;k++)if(k in g){var f=g[k];b.call(void 0,f,k,a)&&(d[e++]=f)}return d},ua=Array.prototype.map?function(a,b,c){return Array.prototype.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),g="string"===typeof a?a.split(""):a,k=0;k<d;k++)k in g&&(e[k]=b.call(c,g[k],k,a));return e},va=function(a){return Array.prototype.concat.apply([],arguments)},wa=function(a){var b=a.length;if(0<b){for(var c=Array(b),
d=0;d<b;d++)c[d]=a[d];return c}return[]},xa=function(a,b){return va.apply([],ua(a,b,void 0))};var C=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]},D=function(a,b){return-1!=a.indexOf(b)},ya=function(a,b){return a<b?-1:a>b?1:0};var E;a:{var za=w.navigator;if(za){var Aa=za.userAgent;if(Aa){E=Aa;break a}}E=""};var Ba=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},F=function(a){var b={},c;for(c in a)b[c]=a[c];return b};var Ca=function(){return null};var G=function(a,b){this.c=a===Da&&b||"";this.f=Ea};G.prototype.b=!0;G.prototype.a=function(){return this.c};var Ea={},Da={};var H=function(a,b){this.c=a===Fa&&b||"";this.f=Ga};H.prototype.b=!0;H.prototype.a=function(){return this.c.toString()};var I=function(a){return a instanceof H&&a.constructor===H&&a.f===Ga?a.c:"type_error:SafeUrl"},Ha=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,Ia=function(a){if(a instanceof H)return a;a="object"==typeof a&&a.b?a.a():String(a);Ha.test(a)||(a="about:invalid#zClosurez");return new H(Fa,a)},Ga={},Fa={};var J=function(){this.c="";this.f=La};J.prototype.b=!0;var La={};J.prototype.a=function(){return this.c};
var Ma=function(a){var b=new J;b.c=a;return b},Na=Ma(""),Ua=function(a){if(a instanceof H)return'url("'+I(a).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(a instanceof G)a=a instanceof G&&a.constructor===G&&a.f===Ea?a.c:"type_error:Const";else{a=String(a);var b=a.replace(Oa,"$1").replace(Oa,"$1").replace(Pa,"url");if(Qa.test(b)){if(b=!Ra.test(a)){for(var c=b=!0,d=0;d<a.length;d++){var e=a.charAt(d);"'"==e&&c?b=!b:'"'==e&&b&&(c=!c)}b=b&&c&&Sa(a)}a=b?Ta(a):"zClosurez"}else a="zClosurez"}if(/[{;}]/.test(a))throw new A("Value does not allow [{;}], got: %s.",
[a]);return a},Sa=function(a){for(var b=!0,c=/^[-_a-zA-Z0-9]$/,d=0;d<a.length;d++){var e=a.charAt(d);if("]"==e){if(b)return!1;b=!0}else if("["==e){if(!b)return!1;b=!1}else if(!b&&!c.test(e))return!1}return b},Qa=/^[-,."'%_!# a-zA-Z0-9\[\]]+$/,Pa=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,Oa=/\b(calc|cubic-bezier|fit-content|hsl|hsla|matrix|minmax|repeat|rgb|rgba|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,Ra=/\/\*/,Ta=function(a){return a.replace(Pa,
function(b,c,d,e){var g="";d=d.replace(/^(['"])(.*)\1$/,function(k,f,h){g=f;return h});b=Ia(d).a();return c+g+b+g+e})};var K=function(){this.c="";this.f=Va};K.prototype.b=!0;
var Va={},Xa=function(a,b){if(D(a,"<"))throw Error("Selector does not allow '<', got: "+a);var c=a.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(c))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+a);a:{for(var d={"(":")","[":"]"},e=[],g=0;g<c.length;g++){var k=c[g];if(d[k])e.push(d[k]);else{b:{var f=void 0;for(f in d)if(d[f]==k){f=!0;break b}f=!1}if(f&&e.pop()!=k){c=!1;break a}}}c=0==e.length}if(!c)throw Error("() and [] in selector must be balanced, got: "+
a);if(!(b instanceof J)){c="";for(var h in b){if(!/^[-_a-zA-Z0-9]+$/.test(h))throw Error("Name allows only [-_a-zA-Z0-9], got: "+h);d=b[h];null!=d&&(d="array"==ma(d)?ua(d,Ua).join(" "):Ua(d),c+=h+":"+d+";")}b=c?Ma(c):Na}a=a+"{"+(b instanceof J&&b.constructor===J&&b.f===La?b.c:"type_error:SafeStyle").replace(/</g,"\\3C ")+"}";return Wa(a)},Za=function(a){var b="",c=function(d){"array"==ma(d)?B(d,c):b+=Ya(d)};B(arguments,c);return Wa(b)};K.prototype.a=function(){return this.c};
var Ya=function(a){return a instanceof K&&a.constructor===K&&a.f===Va?a.c:"type_error:SafeStyleSheet"},Wa=function(a){var b=new K;b.c=a;return b},$a=Wa("");var L=function(){this.c="";this.f=ab};L.prototype.b=!0;L.prototype.a=function(){return this.c.toString()};var bb=function(a){return a instanceof L&&a.constructor===L&&a.f===ab?a.c:"type_error:SafeHtml"},ab={},M=function(a){var b=new L;b.c=a;return b};M("<!DOCTYPE html>");var cb=M("");M("<br>");var db=function(a){var b=!1,c;return function(){b||(c=a(),b=!0);return c}}(function(){var a=document.createElement("div"),b=document.createElement("div");b.appendChild(document.createElement("div"));a.appendChild(b);b=a.firstChild.firstChild;a.innerHTML=bb(cb);return!b.parentElement}),N=function(a,b){if(db())for(;a.lastChild;)a.removeChild(a.lastChild);a.innerHTML=bb(b)};var fb=function(a,b){var c=eb;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var gb=D(E,"Opera"),O=D(E,"Trident")||D(E,"MSIE"),hb=D(E,"Edge"),ib=D(E,"Gecko")&&!(D(E.toLowerCase(),"webkit")&&!D(E,"Edge"))&&!(D(E,"Trident")||D(E,"MSIE"))&&!D(E,"Edge"),jb=D(E.toLowerCase(),"webkit")&&!D(E,"Edge"),kb=function(){var a=w.document;return a?a.documentMode:void 0},lb;
a:{var mb="",nb=function(){var a=E;if(ib)return/rv:([^\);]+)(\)|;)/.exec(a);if(hb)return/Edge\/([\d\.]+)/.exec(a);if(O)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(jb)return/WebKit\/(\S+)/.exec(a);if(gb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();nb&&(mb=nb?nb[1]:"");if(O){var ob=kb();if(null!=ob&&ob>parseFloat(mb)){lb=String(ob);break a}}lb=mb}
var pb=lb,eb={},qb=function(a){return fb(a,function(){for(var b=0,c=C(String(pb)).split("."),d=C(String(a)).split("."),e=Math.max(c.length,d.length),g=0;0==b&&g<e;g++){var k=c[g]||"",f=d[g]||"";do{k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""];f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];if(0==k[0].length&&0==f[0].length)break;b=ya(0==k[1].length?0:parseInt(k[1],10),0==f[1].length?0:parseInt(f[1],10))||ya(0==k[2].length,0==f[2].length)||ya(k[2],f[2]);k=k[3];f=f[3]}while(0==b)}return 0<=b})},rb;
rb=w.document&&O?kb():void 0;var sb=function(){var a=document;var b="SPAN";"application/xhtml+xml"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)},tb=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};var ub={"* ARIA-CHECKED":!0,"* ARIA-COLCOUNT":!0,"* ARIA-COLINDEX":!0,"* ARIA-DESCRIBEDBY":!0,"* ARIA-DISABLED":!0,"* ARIA-GOOG-EDITABLE":!0,"* ARIA-LABEL":!0,"* ARIA-LABELLEDBY":!0,"* ARIA-MULTILINE":!0,"* ARIA-MULTISELECTABLE":!0,"* ARIA-ORIENTATION":!0,"* ARIA-PLACEHOLDER":!0,"* ARIA-READONLY":!0,"* ARIA-REQUIRED":!0,"* ARIA-ROLEDESCRIPTION":!0,"* ARIA-ROWCOUNT":!0,"* ARIA-ROWINDEX":!0,"* ARIA-SELECTED":!0,"* ABBR":!0,"* ACCEPT":!0,"* ACCESSKEY":!0,"* ALIGN":!0,"* ALT":!0,"* AUTOCOMPLETE":!0,"* AXIS":!0,
"* BGCOLOR":!0,"* BORDER":!0,"* CELLPADDING":!0,"* CELLSPACING":!0,"* CHAROFF":!0,"* CHAR":!0,"* CHECKED":!0,"* CLEAR":!0,"* COLOR":!0,"* COLSPAN":!0,"* COLS":!0,"* COMPACT":!0,"* COORDS":!0,"* DATETIME":!0,"* DIR":!0,"* DISABLED":!0,"* ENCTYPE":!0,"* FACE":!0,"* FRAME":!0,"* HEIGHT":!0,"* HREFLANG":!0,"* HSPACE":!0,"* ISMAP":!0,"* LABEL":!0,"* LANG":!0,"* MAX":!0,"* MAXLENGTH":!0,"* METHOD":!0,"* MULTIPLE":!0,"* NOHREF":!0,"* NOSHADE":!0,"* NOWRAP":!0,"* OPEN":!0,"* READONLY":!0,"* REQUIRED":!0,
"* REL":!0,"* REV":!0,"* ROLE":!0,"* ROWSPAN":!0,"* ROWS":!0,"* RULES":!0,"* SCOPE":!0,"* SELECTED":!0,"* SHAPE":!0,"* SIZE":!0,"* SPAN":!0,"* START":!0,"* SUMMARY":!0,"* TABINDEX":!0,"* TITLE":!0,"* TYPE":!0,"* VALIGN":!0,"* VALUE":!0,"* VSPACE":!0,"* WIDTH":!0},vb={"* USEMAP":!0,"* ACTION":!0,"* CITE":!0,"* HREF":!0,"* LONGDESC":!0,"* SRC":!0,"LINK HREF":!0,"* FOR":!0,"* HEADERS":!0,"* NAME":!0,"A TARGET":!0,"* CLASS":!0,"* ID":!0,"* STYLE":!0};var P={};
function wb(a){if(O&&!qb(9))return[0,0,0,0];var b=P.hasOwnProperty(a)?P[a]:null;if(b)return b;65536<Object.keys(P).length&&(P={});var c=[0,0,0,0];b=xb(a,/\\[0-9A-Fa-f]{6}\s?/g);b=xb(b,/\\[0-9A-Fa-f]{1,5}\s/g);b=xb(b,/\\./g);b=b.replace(/:not\(([^\)]*)\)/g," $1 ");b=b.replace(/{[^]*/gm,"");b=Q(b,c,/(\[[^\]]+\])/g,2);b=Q(b,c,/(#[^\#\s\+>~\.\[:]+)/g,1);b=Q(b,c,/(\.[^\s\+>~\.\[:]+)/g,2);b=Q(b,c,/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,3);b=Q(b,c,/(:[\w-]+\([^\)]*\))/gi,2);
b=Q(b,c,/(:[^\s\+>~\.\[:]+)/g,2);b=b.replace(/[\*\s\+>~]/g," ");b=b.replace(/[#\.]/g," ");Q(b,c,/([^\s\+>~\.\[:]+)/g,3);b=c;return P[a]=b}function Q(a,b,c,d){return a.replace(c,function(e){b[d]+=1;return Array(e.length+1).join(" ")})}function xb(a,b){return a.replace(b,function(c){return Array(c.length+1).join("A")})};var yb={rgb:!0,rgba:!0,alpha:!0,rect:!0,image:!0,"linear-gradient":!0,"radial-gradient":!0,"repeating-linear-gradient":!0,"repeating-radial-gradient":!0,"cubic-bezier":!0,matrix:!0,perspective:!0,rotate:!0,rotate3d:!0,rotatex:!0,rotatey:!0,steps:!0,rotatez:!0,scale:!0,scale3d:!0,scalex:!0,scaley:!0,scalez:!0,skew:!0,skewx:!0,skewy:!0,translate:!0,translate3d:!0,translatex:!0,translatey:!0,translatez:!0},zb=/[\n\f\r"'()*<>]/g,Ab={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29",
"*":"%2a","<":"%3c",">":"%3e"};function Bb(a){return Ab[a]}
var Cb=function(a,b,c){b=C(b);if(""==b)return null;var d=String(b.substr(0,4)).toLowerCase();if(0==("url("<d?-1:"url("==d?0:1)){if(!b.endsWith(")")||1<(b?b.split("(").length-1:0)||1<(b?b.split(")").length-1:0)||!c)a=null;else{a:for(b=b.substring(4,b.length-1),d=0;2>d;d++){var e="\"'".charAt(d);if(b.charAt(0)==e&&b.charAt(b.length-1)==e){b=b.substring(1,b.length-1);break a}}a=c?(a=c(b,a))&&"about:invalid#zClosurez"!=I(a)?'url("'+I(a).replace(zb,Bb)+'")':null:null}return a}if(0<b.indexOf("(")){if(/"|'/.test(b))return null;
for(a=/([\-\w]+)\(/g;c=a.exec(b);)if(!(c[1]in yb))return null}return b};function R(a,b){a=w[a];return a&&a.prototype?(b=Object.getOwnPropertyDescriptor(a.prototype,b))&&b.get||null:null}function S(a,b){return(a=w[a])&&a.prototype&&a.prototype[b]||null}
var Db=R("Element","attributes")||R("Node","attributes"),Eb=S("Element","hasAttribute"),Fb=S("Element","getAttribute"),Gb=S("Element","setAttribute"),Hb=S("Element","removeAttribute"),Ib=S("Element","getElementsByTagName"),Jb=S("Element","matches")||S("Element","msMatchesSelector"),Kb=R("Node","nodeName"),Lb=R("Node","nodeType"),Mb=R("Node","parentNode"),Nb=R("HTMLElement","style")||R("Element","style"),Ob=R("HTMLStyleElement","sheet"),Pb=S("CSSStyleDeclaration","getPropertyValue"),Qb=S("CSSStyleDeclaration",
"setProperty");function T(a,b,c,d){if(a)return a.apply(b);a=b[c];if(!d(a))throw Error("Clobbering detected");return a}function U(a,b,c,d){if(a)return a.apply(b,d);if(O&&10>document.documentMode){if(!b[c].call)throw Error("IE Clobbering detected");}else if("function"!=typeof b[c])throw Error("Clobbering detected");return b[c].apply(b,d)}function Rb(a){return T(Db,a,"attributes",function(b){return b instanceof NamedNodeMap})}
function Sb(a,b,c){try{U(Gb,a,"setAttribute",[b,c])}catch(d){if(-1==d.message.indexOf("A security problem occurred"))throw d;}}function Tb(a){return T(Nb,a,"style",function(b){return b instanceof CSSStyleDeclaration})}function Ub(a){return T(Ob,a,"sheet",function(b){return b instanceof CSSStyleSheet})}function V(a){return T(Kb,a,"nodeName",function(b){return"string"==typeof b})}function Vb(a){return T(Lb,a,"nodeType",function(b){return"number"==typeof b})}
function W(a){return T(Mb,a,"parentNode",function(b){return!(b&&"string"==typeof b.name&&b.name&&"parentnode"==b.name.toLowerCase())})}function Wb(a,b){return U(Pb,a,a.getPropertyValue?"getPropertyValue":"getAttribute",[b])||""}function Xb(a,b,c){U(Qb,a,a.setProperty?"setProperty":"setAttribute",[b,c])};var Yb=O&&10>document.documentMode?null:/\s*([^\s'",]+[^'",]*(('([^'\r\n\f\\]|\\[^])*')|("([^"\r\n\f\\]|\\[^])*")|[^'",])*)/g,Zb={"-webkit-border-horizontal-spacing":!0,"-webkit-border-vertical-spacing":!0},bc=function(a,b,c){var d=[];a=$b(wa(a.cssRules));B(a,function(e){if(b&&!/[a-zA-Z][\w-:\.]*/.test(b))throw Error("Invalid container id");if(!(b&&O&&10==document.documentMode&&/\\['"]/.test(e.selectorText))){var g=b?e.selectorText.replace(Yb,"#"+b+" $1"):e.selectorText;d.push(Xa(g,ac(e.style,c)))}});
return Za(d)},$b=function(a){return ta(a,function(b){return b instanceof CSSStyleRule||b.type==CSSRule.STYLE_RULE})},dc=function(a,b,c){a=cc("<style>"+a+"</style>");return null==a||null==a.sheet?$a:bc(a.sheet,void 0!=b?b:null,c)},cc=function(a){if(O&&!qb(10)||"function"!=typeof w.DOMParser)return null;a=M("<html><head></head><body>"+a+"</body></html>");return(new DOMParser).parseFromString(bb(a),"text/html").body.children[0]},ac=function(a,b){if(!a)return Na;var c=document.createElement("div").style,
d=ec(a);B(d,function(e){var g=jb&&e in Zb?e:e.replace(/^-(?:apple|css|epub|khtml|moz|mso?|o|rim|wap|webkit|xv)-(?=[a-z])/i,"");0!=g.lastIndexOf("--",0)&&0!=g.lastIndexOf("var",0)&&(e=Wb(a,e),e=Cb(g,e,b),null!=e&&Xb(c,g,e))});return Ma(c.cssText||"")},gc=function(a){var b=Array.from(U(Ib,a,"getElementsByTagName",["STYLE"])),c=xa(b,function(e){return wa(Ub(e).cssRules)});c=$b(c);c.sort(function(e,g){e=wb(e.selectorText);a:{g=wb(g.selectorText);for(var k=Math.min(e.length,g.length),f=0;f<k;f++){var h=
e[f];var l=g[f];h=h>l?1:h<l?-1:0;if(0!=h){e=h;break a}}e=e.length;g=g.length;e=e>g?1:e<g?-1:0}return-e});a=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,null,!1);for(var d;d=a.nextNode();)B(c,function(e){U(Jb,d,d.matches?"matches":"msMatchesSelector",[e.selectorText])&&e.style&&fc(d,e.style)});B(b,tb)},fc=function(a,b){var c=ec(a.style),d=ec(b);B(d,function(e){if(!(0<=c.indexOf(e))){var g=Wb(b,e);Xb(a.style,e,g)}})},ec=function(a){var b=ma(a);"array"==b||"object"==b&&"number"==typeof a.length?
a=wa(a):(a=Ba(a),b=sa(a,"cssText"),0<=b&&Array.prototype.splice.call(a,b,1));return a};var hc="undefined"!=typeof WeakMap&&-1!=WeakMap.toString().indexOf("[native code]"),ic=0,jc=function(){this.c=[];this.b=[];this.a="data-elementweakmap-index-"+ic++};jc.prototype.set=function(a,b){if(U(Eb,a,"hasAttribute",[this.a])){var c=parseInt(U(Fb,a,"getAttribute",[this.a])||null,10);this.b[c]=b}else c=this.b.push(b)-1,Sb(a,this.a,c.toString()),this.c.push(a);return this};
jc.prototype.get=function(a){if(U(Eb,a,"hasAttribute",[this.a]))return a=parseInt(U(Fb,a,"getAttribute",[this.a])||null,10),this.b[a]};jc.prototype.clear=function(){this.c.forEach(function(a){U(Hb,a,"removeAttribute",[this.a])},this);this.c=[];this.b=[]};var kc;(kc=!O)||(kc=10<=Number(rb));var lc=kc,mc=!O||null==document.documentMode,nc=function(){};var oc={APPLET:!0,AUDIO:!0,BASE:!0,BGSOUND:!0,EMBED:!0,FORM:!0,IFRAME:!0,ISINDEX:!0,KEYGEN:!0,LAYER:!0,LINK:!0,META:!0,OBJECT:!0,SCRIPT:!0,SVG:!0,STYLE:!0,TEMPLATE:!0,VIDEO:!0};var pc={A:!0,ABBR:!0,ACRONYM:!0,ADDRESS:!0,AREA:!0,ARTICLE:!0,ASIDE:!0,B:!0,BDI:!0,BDO:!0,BIG:!0,BLOCKQUOTE:!0,BR:!0,BUTTON:!0,CAPTION:!0,CENTER:!0,CITE:!0,CODE:!0,COL:!0,COLGROUP:!0,DATA:!0,DATALIST:!0,DD:!0,DEL:!0,DETAILS:!0,DFN:!0,DIALOG:!0,DIR:!0,DIV:!0,DL:!0,DT:!0,EM:!0,FIELDSET:!0,FIGCAPTION:!0,FIGURE:!0,FONT:!0,FOOTER:!0,FORM:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,HEADER:!0,HGROUP:!0,HR:!0,I:!0,IMG:!0,INPUT:!0,INS:!0,KBD:!0,LABEL:!0,LEGEND:!0,LI:!0,MAIN:!0,MAP:!0,MARK:!0,MENU:!0,METER:!0,NAV:!0,
NOSCRIPT:!0,OL:!0,OPTGROUP:!0,OPTION:!0,OUTPUT:!0,P:!0,PRE:!0,PROGRESS:!0,Q:!0,S:!0,SAMP:!0,SECTION:!0,SELECT:!0,SMALL:!0,SOURCE:!0,SPAN:!0,STRIKE:!0,STRONG:!0,STYLE:!0,SUB:!0,SUMMARY:!0,SUP:!0,TABLE:!0,TBODY:!0,TD:!0,TEXTAREA:!0,TFOOT:!0,TH:!0,THEAD:!0,TIME:!0,TR:!0,TT:!0,U:!0,UL:!0,VAR:!0,WBR:!0};var qc={"ANNOTATION-XML":!0,"COLOR-PROFILE":!0,"FONT-FACE":!0,"FONT-FACE-SRC":!0,"FONT-FACE-URI":!0,"FONT-FACE-FORMAT":!0,"FONT-FACE-NAME":!0,"MISSING-GLYPH":!0},uc=function(a){a=a||new rc;sc(a);this.a=F(a.a);this.i=F(a.w);this.c=F(a.C);this.m=a.u;B(a.l,function(b){if(0!=b.lastIndexOf("data-",0))throw new A('Only "data-" attributes allowed, got: %s.',[b]);if(0==b.lastIndexOf("data-sanitizer-",0))throw new A('Attributes with "%s" prefix are not allowed, got: %s.',["data-sanitizer-",b]);this.a["* "+
b.toUpperCase()]=tc},this);B(a.j,function(b){b=b.toUpperCase();if(!D(b,"-")||qc[b])throw new A("Only valid custom element tag names allowed, got: %s.",[b]);this.c[b]=!0},this);this.l=a.c;this.f=a.v;this.b=null;this.j=a.m};ra(uc,nc);
var vc=function(a){return function(b,c){return(b=a(C(b),c))&&"about:invalid#zClosurez"!=I(b)?I(b):null}},rc=function(){this.a={};B([ub,vb],function(a){B(Ba(a),function(b){this.a[b]=tc},this)},this);this.b={};this.l=[];this.j=[];this.w=F(oc);this.C=F(pc);this.u=!1;this.G=Ia;this.F=this.i=this.D=this.c=Ca;this.v=null;this.f=this.m=!1},wc=function(a,b){return function(c,d,e,g){c=a(c,d,e,g);return null==c?null:b(c,d,e,g)}},X=function(a,b,c,d){a[c]&&!b[c]&&(a[c]=wc(a[c],d))},xc=function(){var a=new rc;
return new uc(a)},sc=function(a){if(a.f)throw Error("HtmlSanitizer.Builder.build() can only be used once.");X(a.a,a.b,"* USEMAP",yc);var b=vc(a.G);B(["* ACTION","* CITE","* HREF"],function(d){X(this.a,this.b,d,b)},a);var c=vc(a.c);B(["* LONGDESC","* SRC","LINK HREF"],function(d){X(this.a,this.b,d,c)},a);B(["* FOR","* HEADERS","* NAME"],function(d){X(this.a,this.b,d,x(zc,this.D))},a);X(a.a,a.b,"A TARGET",x(Ac,["_blank","_self"]));X(a.a,a.b,"* CLASS",x(Bc,a.i));X(a.a,a.b,"* ID",x(Cc,a.i));X(a.a,a.b,
"* STYLE",x(a.F,c));a.f=!0},Dc=function(a,b){a||(a="*");return(a+" "+b).toUpperCase()},tc=function(a){return C(a)},Ac=function(a,b){b=C(b);return 0<=sa(a,b.toLowerCase())?b:null},yc=function(a){return(a=C(a))&&"#"==a.charAt(0)?a:null},zc=function(a,b,c){return a(C(b),c)},Bc=function(a,b,c){b=b.split(/(?:\s+)/);for(var d=[],e=0;e<b.length;e++){var g=a(b[e],c);g&&d.push(g)}return 0==d.length?null:d.join(" ")},Cc=function(a,b,c){return a(C(b),c)},Fc=function(a,b){var c=!("STYLE"in a.i)&&"STYLE"in a.c;
c="*"==a.f&&c?"sanitizer-"+(Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^qa()).toString(36)):a.f;a.b=c;if(lc){c=b;if(lc){b=sb();a.b&&"*"==a.f&&(b.id=a.b);a.j&&(c=cc("<div>"+c+"</div>"),gc(c),c=c.innerHTML);c=M(c);var d=document.createElement("template");if(mc&&"content"in d)N(d,c),d=d.content;else{var e=document.implementation.createHTMLDocument("x");d=e.body;N(e.body,c)}c=document.createTreeWalker(d,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null,
!1);for(d=hc?new WeakMap:new jc;e=c.nextNode();){c:{var g=a;var k=e;switch(Vb(k)){case 3:g=Ec(g,k);break c;case 1:if("TEMPLATE"==V(k).toUpperCase())g=null;else{var f=V(k).toUpperCase();if(f in g.i)var h=null;else g.c[f]?h=document.createElement(f):(h=sb(),g.m&&Sb(h,"data-sanitizer-original-tag",f.toLowerCase()));if(h){var l=h,m=Rb(k);if(null!=m)for(var r=0;f=m[r];r++)if(f.specified){var n=g;var p=k,q=f,u=q.name;if(0==u.lastIndexOf("data-sanitizer-",0))n=null;else{var la=V(p);q=q.value;var Ja={tagName:C(la).toLowerCase(),
attributeName:C(u).toLowerCase()},Ka={o:void 0};"style"==Ja.attributeName&&(Ka.o=Tb(p));p=Dc(la,u);p in n.a?(n=n.a[p],n=n(q,Ja,Ka)):(u=Dc(null,u),u in n.a?(n=n.a[u],n=n(q,Ja,Ka)):n=null)}null!==n&&Sb(l,f.name,n)}g=h}else g=null}break c;default:g=null}}if(g){if(1==Vb(g)&&d.set(e,g),e=W(e),k=!1,e)f=Vb(e),h=V(e).toLowerCase(),l=W(e),11!=f||l?"body"==h&&l&&(f=W(l))&&!W(f)&&(k=!0):k=!0,f=null,k||!e?f=b:1==Vb(e)&&(f=d.get(e)),f.content&&(f=f.content),f.appendChild(g)}else for(g=e;e=g.firstChild;)g.removeChild(e)}d.clear&&
d.clear();a=b}else a=sb();0<Rb(a).length&&(b=sb(),b.appendChild(a),a=b);a=(new XMLSerializer).serializeToString(a);a=a.slice(a.indexOf(">")+1,a.lastIndexOf("</"))}else a="";return M(a)},Ec=function(a,b){var c=b.data;(b=W(b))&&"style"==V(b).toLowerCase()&&!("STYLE"in a.i)&&"STYLE"in a.c&&(c=Ya(dc(c,a.b,pa(function(d,e){return this.l(d,{H:e})},a))));return document.createTextNode(c)};var Gc=[],Hc=0,Ic=new Map;function Jc(a){for(var b={left:0,top:0};a;)b.left+=a.offsetLeft,b.top+=a.offsetTop,a=a.offsetParent;return b}function Kc(a,b){for(;a&&(!a.classList||!a.classList.contains(b));)a=a.parentNode;return a||null}function Lc(a){Mc(a.target,!1);Y(!1)}function Nc(a){Mc(a.target,!0);Y(!1)}
function Mc(a,b){var c=a.nextSibling,d="none"==getComputedStyle(c).display;b=b?d?MSG_HIDE_ELIDED:MSG_SHOW_ELIDED:d?MSG_HIDE_ORIGINAL:MSG_SHOW_ORIGINAL;b=Fc(xc(),b);N(a,b);c.style.display=d?"block":"none";d&&Oc([c])}function Pc(a){a=a.getElementsByClassName("mail-message-toggle");for(var b=0,c;c=a[b];b++){var d=Fc(xc(),MSG_SHOW_ORIGINAL);N(c,d);c.onclick=Lc}}
function Qc(a,b){a=a.getElementsByClassName("elided-text");for(var c,d=0,e;e=a[d];d++){c=document.createElement("div");c.className="mail-elided-text";var g=Fc(xc(),MSG_SHOW_ELIDED);N(c,g);c.setAttribute("dir","auto");c.onclick=Nc;e.style.display="none";e.parentNode.insertBefore(c,e);b&&Mc(c,!0)}}
function Oc(a){var b,c;var d=document.body.offsetWidth;for(b=0;b<a.length;b++){var e=a[b];if(c=e.style.zoom)e.style.zoom=1;if(!Rc(e,d,e.scrollWidth)&&NORMALIZE_MESSAGE_WIDTHS){c=e.scrollWidth;c=c>d?d/c:1;var g=e.classList.contains("mail-message-content")?1:(g=Kc(e,"mail-message-content"))?g.style.zoom:1;e.style.zoom=c/g}}}
function Rc(a,b,c){var d=c;var e=[],g=[],k=!1,f=[];if(c<=b)return!0;var h=Date.now();if(a.parentElement.classList.contains("mail-message"))var l=a.parentElement.id;d=!1;d=ENABLE_MUNGE_TABLES?a.querySelectorAll("div[style], textarea[style]"):[];if(d=Sc(d,b,e))d=a.scrollWidth,console.log("ran div-width munger on el="+a+" oldW="+c+" newW="+d+" docW="+b),d<=b&&(k=!0);!k&&(d=ENABLE_MUNGE_IMAGES?a.querySelectorAll("img"):[],d=Tc(d,b,e))&&(d=a.scrollWidth,console.log("ran img munger on el="+a+" oldW="+c+
" newW="+d+" docW="+b),d<=b&&(k=!0));!k&&(d=ENABLE_MUNGE_TABLES?a.querySelectorAll("table"):[],d=Uc(d,Vc,g))&&(d=a.scrollWidth,console.log("ran table munger on el="+a+" oldW="+c+" newW="+d+" docW="+b),d<=b&&(k=!0));!k&&(d=ENABLE_MUNGE_TABLES?a.querySelectorAll("td"):[],d=Uc(d,null,g))&&(d=a.scrollWidth,console.log("ran td munger on el="+a+" oldW="+c+" newW="+d+" docW="+b),d<=b?k=!0:(console.log("Revert table and td munger because it didn't help"),Wc(g)));!k&&NORMALIZE_MESSAGE_WIDTHS&&(f=Xc(b,e),0<
f.length&&(f.forEach(function(m){m.node.style.display="none"}),d=a.scrollWidth,console.log("ran table zoom on el="+a+" oldW="+c+" newW="+d+" docW="+b),d<=b&&(k=!0),f.forEach(function(m){m.node.style.display=m.s})));if(k){if(l)ConversationView.onMessageTransform(JS_TOKEN,l);console.log("munger(s) succeeded, elapsed time="+(Date.now()-h));return!0}Wc(e);0<e.length&&console.log("all mungers failed, changes reversed. elapsed time="+(Date.now()-h));return!1}
function Wc(a){for(var b=0,c;c=a[b];b++)c[0].apply(c[1],c[2])}function Uc(a,b,c){var d,e=!1;var g=0;for(d=a.length;g<d;g++){var k=a[g];b&&!b(k)||k.classList.contains("munged")||(k.classList.add("munged"),e=!0,c.push([k.classList.remove,k.classList,["munged"]]))}return e}
function Sc(a,b,c){var d,e,g=!1;var k=0;for(d=a.length;k<d;k++){var f=a[k];var h=(e=f.style.width||f.style.minWidth)?e.indexOf("px"):-1;0<=h&&e.slice(0,h)>b&&(Z(f,"width",c),Z(f,"minWidth",c),Z(f,"maxWidth",c),f.style.width="100%",f.style.minWidth="",f.style.maxWidth=e,g=!0)}return g}
function Tc(a,b,c){var d,e,g,k=!1,f=[];var h=0;for(d=a.length;h<d;h++){for(g=e=a[h];g&&(!g.tagName||"table"!==g.tagName.toLowerCase());)g=g.parentNode;if(!g){g=e.offsetWidth;var l=e.offsetHeight;var m=e.getAttribute("blocked-src");var r=e.style.marginLeft;var n=e.style.marginRight;var p=0<=(r?r.indexOf("px"):-1)?parseInt(r,10):0;p+=0<=(n?n.indexOf("px"):-1)?parseInt(n,10):0;console.log("nodeOffsetWidth is "+e.offsetWidth+", marginL is "+r+", marginR is "+n+", total margin is "+p);n=m?2:0;g+p>b&&(m?
(Z(e,"maxWidth",f),Z(e,"width",f),Ic.set(e,f)):(Z(e,"maxWidth",c),Z(e,"width",c),Z(e,"height",c)),e.style.maxWidth=b-p-n+"px",e.style.width="100%",null==m&&(e.style.height=5>l?l:"auto"),k=!0)}}return k}
function Xc(a,b){var c=document.querySelectorAll("table"),d=[];c=[].slice.call(c);c.forEach(function(e){e.classList.remove("zoom-out");e.style.zoom=1});c.forEach(function(e){if(!Kc(e,"zoom-out")){var g=a/e.scrollWidth;1>g&&(Z(e,"zoom",b),b.push([e.classList.remove,e.classList,["zoom-out"]]),e.style.zoom=g,e.classList.add("zoom-out"),console.log("zoomed out the table"),d.push({node:e,s:e.style.display}))}});return d}
function Z(a,b,c){var d="data-"+b;a.setAttribute(d,a.style[b]);c.push([Yc,null,[a,b,d]])}function Yc(a,b,c){a.style[b]=c?a.getAttribute(c):""}function Vc(a){return a.hasAttribute("width")||a.style.width}
function Zc(a){var b,c,d=0,e=[],g=[];var k=0;for(b=a.length;k<b;k++){var f=a[k];var h=f.classList.contains("mail-show-images");var l=f.classList.contains(REWRITE_IMAGE_URL_CLASS_NAME);var m=f.getElementsByTagName("img");Hc=m.length;var r=0;for(c=m.length;r<c;r++){var n=m[r];var p=n;var q=l,u=p.getAttribute("blocked-src");q=q&&u?u:p.src;p.src=q;0==q.indexOf(DOC_BASE_URI)&&DOC_BASE_URI!=CONVERSATION_BASE_URI?(q=CONVERSATION_BASE_URI+q.substring(DOC_BASE_URI.length),p=p.src=q):p=SAPI_INLINE_IMAGE_URL_PATTERN&&
q.match(SAPI_INLINE_IMAGE_URL_PATTERN)?q:SAPI_IMAP_INLINE_IMAGE_URL_PATTERN&&q.match(SAPI_IMAP_INLINE_IMAGE_URL_PATTERN)?$c(q):"cid:"==q.substring(0,4)?q:null;q=!1;if(p){e[d]=p;if(0==p.indexOf("https://mail.google.com")||0==p.indexOf("https://"+IMAP_INLINE_ATTACHMENT_AUTHORITY))ad(n),q=!0;g[d]=f.parentNode.id;d++}u=n;var la=u.src;u.src="";u.onload=bd;u.src=la;q||h&&(!p||"cid:"!=p.substring(0,4))||ad(n)}}ConversationView.onInlineAttachmentsParsed(JS_TOKEN,e,g);if(0<e.length)ConversationView.onImageLoadRequestsCreated(JS_TOKEN,
e.length)}function bd(a){Hc--;if(0===Hc){for(var b=document.getElementsByClassName("gmail-ads-delayed-elements"),c=0;c<b.length;c++)b[c].style.visibility="visible";ConversationView.onAllContentLoaded(JS_TOKEN)}if(a&&a.target&&void 0!==a.target.src)ConversationView.onImageLoadFinished(JS_TOKEN,a.target.src);if(a=Kc(a.target,"elided-text")||Kc(a.target,"mail-message-content"))0==Gc.length&&window.setTimeout(cd,0),-1==Gc.indexOf(a)&&Gc.push(a)}
function cd(){Oc(Gc);Y(!1);ConversationView.onAllImagesLoadFinished(JS_TOKEN);Gc=[]}function ad(a){var b=a.src;0==b.indexOf("http://")||0==b.indexOf("https://")||0==b.indexOf("content://")||0==b.indexOf("cid:")?(a.setAttribute("blocked-src",b),a.src="blocked"):0==b.indexOf("btdimap://attachment")&&(a.setAttribute("blocked-src",$c(b)),a.src="blocked")}
function Y(a){var b,c=0,d=document.querySelectorAll(".expanded > .mail-message-content");var e=Array(d.length+1);var g=Array(d.length+1);var k=0;for(b=d.length;k<b;k++){var f=d[k];var h=f.previousElementSibling;e[k]=c;g[k]=Jc(h).top+h.offsetHeight;c=Jc(f.nextElementSibling).top}e[k]=c;g[k]=document.documentElement.scrollHeight;a&&console.log("overlayTops: "+e.toString()+"; overlayBottoms: "+g.toString());ConversationView.onWebContentGeometryChange(JS_TOKEN,e,g)}
function dd(a,b){var c;if(c=a.getAttribute("blocked-src")){var d=!1;if(0==c.indexOf("https://mail.google.com")||0==c.indexOf("https://"+IMAP_INLINE_ATTACHMENT_AUTHORITY))d=ConversationView.downloadInlineAttachment(JS_TOKEN,c,b);d||(a.src=c,a.removeAttribute("blocked-src"),ed(a))}}function ed(a){var b=Ic.get(a);b&&(Wc(b),Ic["delete"](a))}function fd(a,b){a=document.querySelector("#"+gd(a)+" > .mail-message-header");hd(a,b)}
function hd(a,b){a?(a.style.height=b+"px",Y(!1)):console.log("can't set spacer height")}function id(a){Pc(a);Qc(a,!0);Zc([a]);jd(a);Kc(a,"mail-message").classList.contains("expanded")&&Oc([a])}function kd(){var a=document.getElementsByTagName("FORM"),b,c;for(b=0;b<a.length;++b)if("POST"===a[b].method.toUpperCase()){a[b].onsubmit=function(){alert(MSG_FORMS_ARE_DISABLED);return!1};var d=a[b].elements;for(c=0;c<d.length;++c)"submit"!=d[c].type&&(d[c].disabled=!0)}}
function jd(a){a=a.getElementsByTagName("A");for(var b=0;b<a.length;++b){var c=a[b],d=c.getAttribute("href");d&&"#"!=d[0]&&c.addEventListener("click",ld,!0)}}
function ld(a){var b=a.currentTarget,c;for(c=b;(c=c.parentElement)&&!c.classList.contains("mail-message"););var d=b.getAttribute("href");if(d){var e=b.getAttribute("data-saferedirecturl")||"";b=b.getAttribute("data-saferedirectreason")||"";d="gmail-link://?url="+encodeURIComponent(d);e&&(d+="&safeRedirectUrl="+encodeURIComponent(e));b&&(d+="&safeRedirectReason="+encodeURIComponent(b));null!=c&&(d+="&msgId="+encodeURIComponent(c.id));e=d}else e=null;e&&(window.location=e);a.preventDefault();ConversationView.recordLinkClickForDynamicMailHoldbackGroup(JS_TOKEN,
c.id)}function gd(a){a=a.replace(/#/g,"\\#");a=a.replace(/:/g,"\\:");return a=a.replace(/=/g,"\\=")}function $c(a){return 0==!a.indexOf("btdimap://attachment")?null:"https://"+IMAP_INLINE_ATTACHMENT_AUTHORITY+"/"+a.substring(20)}y("setConversationPromotionSpacerHeight",function(a){var b=document.getElementById("conversation-promotion");b?(b.style.height=a+"px",Y(!1)):console.log("can't set spacer for conversation promotion")});
y("setConversationFooterSpacerHeight",function(a){var b=document.getElementById("conversation-footer");b?(b.style.height=a+"px",Y(!1)):console.log("can't set spacer for conversation footer")});y("setMessageHeaderSpacerHeight",fd);y("setMessageFooterSpacerHeight",function(a,b){a=document.querySelector("#"+gd(a)+" > .mail-message-footer");hd(a,b)});
y("setMessageBodyVisible",function(a,b,c,d){var e,g=c?"block":"none";var k=gd(a);var f=document.querySelector("#"+k),h=document.querySelectorAll("#"+k+" > .collapsible");if(f&&0!=h.length){f.classList.toggle("expanded");k=0;for(e=h.length;k<e;k++){var l=h[k];b?c?(l.style.display="block",l.style.position="",l.style.visibility="",l.style.top="",l.style.bottom="",l.style.zIndex="",l.style.left=""):(l.style.position="absolute",l.style.visibility="hidden",l.style.top="0",l.style.bottom="0",l.style.zIndex=
"-999999999",l.style.left="-99999px"):l.style.display=g}c&&Oc(f.getElementsByClassName("mail-message-content"));fd(a,d)}else console.log("can't set body visibility for message with id: "+a)});
y("unblockImages",function(a){for(var b,c,d=c=0,e;e=a[d];d++)if(b=document.getElementById(e)){var g=b.getElementsByClassName("mail-message-content")[0];g&&g.classList.add("mail-show-images");b=b.getElementsByTagName("img");c+=b.length;g=0;for(var k;k=b[g];g++)dd(k,e)}else console.log("can't unblock, no matching message for id: "+e);if(0<c)ConversationView.onImageLoadRequestsCreated(JS_TOKEN,c)});
y("replaceSuperCollapsedBlock",function(a){var b;if(b=document.querySelector(".mail-super-collapsed-block[index='"+a+"']")){a=b.parentNode;var c=M(ConversationView.getSuperCollapseBlockHtml(JS_TOKEN));N(b,c);Pc(b);Qc(b,!1);Zc(b.getElementsByClassName("mail-message-content"));jd(b);for(c=b.firstChild;c;)a.insertBefore(c,b),c=b.firstChild;a.removeChild(b);kd();Y(!1)}else console.log("can't expand super collapsed block at index: "+a)});y("measurePositions",Y);
y("setConversationHeaderSpacerHeight",function(a){var b=document.getElementById("conversation-header");b?(b.style.height=a+"px",Y(!1)):console.log("can't set spacer for conversation header")});y("setSmartMailCardSpacerHeight",function(a,b){(a=document.getElementById(a))?(a.style.height=b+"px",Y(!1)):console.log("can't set spacer for smartmail card")});
y("unblockAllTemporarilyHiddenImages",function(){var a,b;var c=document.getElementsByClassName("mail-message-content");var d=0;for(a=c.length;d<a;d++){var e=c[d];if(b=e.classList.contains("mail-show-images")){var g=e.getElementsByTagName("img");e=0;for(b=g.length;e<b;e++)dd(g[e],"")}}});
y("replaceMessageBodies",function(a){for(var b,c=0,d;d=a[c];c++)(b=document.querySelector("#"+gd(d)+" > .mail-message-content"))?(d=M(ConversationView.getMessageBody(JS_TOKEN,d)),N(b,d),id(b)):console.log("Mail message content for msg "+d+" to replace not found.");kd();Y(!1)});
y("appendMessageHtml",function(){var a=document.createElement("div"),b=M(ConversationView.getNewMessageHtml(JS_TOKEN));N(a,b);a=a.children[0];document.body.insertBefore(a,document.getElementById("conversation-footer"));id(a.querySelector(".mail-message-content"));kd();Y(!1)});
y("refreshInlineAttachment",function(a){for(var b=document.getElementsByTagName("img"),c=0;c<b.length;++c){var d=b[c],e=d.getAttribute("blocked-src");e&&e==a&&(d.removeAttribute("blocked-src"),d.src=""!==ATTACHMENT_DOWNLOAD_FINISH_POSTFIX?e+"/"+ATTACHMENT_DOWNLOAD_FINISH_POSTFIX:e,ed(d))}});document.addEventListener("DOMContentLoaded",function(){ConversationView.createTracingInstant(JS_TOKEN,"DOMContentLoaded");console.log("Measure positions upon DOMContentLoaded");Y(!0);if(ENABLE_CONTENT_READY){var a=ConversationView.getScrollYPercent(JS_TOKEN);a&&document.body.offsetHeight>window.innerHeight&&(document.body.scrollTop=Math.floor(a*document.body.offsetHeight));ConversationView.onContentReady(JS_TOKEN)}});
for(var md=document.getElementsByClassName("gmail-ads-delayed-elements"),nd=0;nd<md.length;nd++)md[nd].style.visibility="hidden";Pc(document.documentElement);Qc(document.documentElement,!1);Zc(document.getElementsByClassName("mail-message-content"));var od,pd,qd,rd;od=document.querySelectorAll(".expanded > .mail-message-content");a:{var sd,td,ud,vd;sd=0;for(td=od.length;sd<td;sd++)if(ud=od[sd],vd=ud.textContent||ud.innerText,0<vd.trim().length){rd=!1;break a}rd=!0}Oc(od);pd=document.getElementById("meta-viewport");
qd=[pd.getAttribute("content")];rd?qd.push(pd.getAttribute("data-zoom-off")):qd.push(pd.getAttribute("data-zoom-on"));pd.setAttribute("content",qd.join(","));kd();console.log("Measure positions in script.js");Y(!0);jd(document.documentElement);}).call(this);
@hteumeuleu
Copy link
Author

Based on this version of the apk: com.google.android.gm_2020.02.02.294309273.release-62090916_minAPI21(nodpi)_apkmirror.com

@hteumeuleu
Copy link
Author

hteumeuleu commented Feb 21, 2020

Random interesting things I see in this file:

Qa = /^[-,."'%_!# a-zA-Z0-9\[\]]+$/,
Pa = /\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,
Oa = /\b(calc|cubic-bezier|fit-content|hsl|hsla|matrix|minmax|repeat|rgb|rgba|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,
var ub = {
    '* ARIA-CHECKED': !0,
    '* ARIA-COLCOUNT': !0,
    '* ARIA-COLINDEX': !0,
    '* ARIA-DESCRIBEDBY': !0,
    '* ARIA-DISABLED': !0,
    '* ARIA-GOOG-EDITABLE': !0,
    '* ARIA-LABEL': !0,
    '* ARIA-LABELLEDBY': !0,
    '* ARIA-MULTILINE': !0,
    '* ARIA-MULTISELECTABLE': !0,
    '* ARIA-ORIENTATION': !0,
    '* ARIA-PLACEHOLDER': !0,
    '* ARIA-READONLY': !0,
    '* ARIA-REQUIRED': !0,
    '* ARIA-ROLEDESCRIPTION': !0,
    '* ARIA-ROWCOUNT': !0,
    '* ARIA-ROWINDEX': !0,
    '* ARIA-SELECTED': !0,
    '* ABBR': !0,
    '* ACCEPT': !0,
    '* ACCESSKEY': !0,
    '* ALIGN': !0,
    '* ALT': !0,
    '* AUTOCOMPLETE': !0,
    '* AXIS': !0,
    '* BGCOLOR': !0,
    '* BORDER': !0,
    '* CELLPADDING': !0,
    '* CELLSPACING': !0,
    '* CHAROFF': !0,
    '* CHAR': !0,
    '* CHECKED': !0,
    '* CLEAR': !0,
    '* COLOR': !0,
    '* COLSPAN': !0,
    '* COLS': !0,
    '* COMPACT': !0,
    '* COORDS': !0,
    '* DATETIME': !0,
    '* DIR': !0,
    '* DISABLED': !0,
    '* ENCTYPE': !0,
    '* FACE': !0,
    '* FRAME': !0,
    '* HEIGHT': !0,
    '* HREFLANG': !0,
    '* HSPACE': !0,
    '* ISMAP': !0,
    '* LABEL': !0,
    '* LANG': !0,
    '* MAX': !0,
    '* MAXLENGTH': !0,
    '* METHOD': !0,
    '* MULTIPLE': !0,
    '* NOHREF': !0,
    '* NOSHADE': !0,
    '* NOWRAP': !0,
    '* OPEN': !0,
    '* READONLY': !0,
    '* REQUIRED': !0,
    '* REL': !0,
    '* REV': !0,
    '* ROLE': !0,
    '* ROWSPAN': !0,
    '* ROWS': !0,
    '* RULES': !0,
    '* SCOPE': !0,
    '* SELECTED': !0,
    '* SHAPE': !0,
    '* SIZE': !0,
    '* SPAN': !0,
    '* START': !0,
    '* SUMMARY': !0,
    '* TABINDEX': !0,
    '* TITLE': !0,
    '* TYPE': !0,
    '* VALIGN': !0,
    '* VALUE': !0,
    '* VSPACE': !0,
    '* WIDTH': !0
  },
  vb = {
    '* USEMAP': !0,
    '* ACTION': !0,
    '* CITE': !0,
    '* HREF': !0,
    '* LONGDESC': !0,
    '* SRC': !0,
    'LINK HREF': !0,
    '* FOR': !0,
    '* HEADERS': !0,
    '* NAME': !0,
    'A TARGET': !0,
    '* CLASS': !0,
    '* ID': !0,
    '* STYLE': !0
  };
  Zb = {
    '-webkit-border-horizontal-spacing': !0,
    '-webkit-border-vertical-spacing': !0
  },

  jc = function () {
    this.c = [
    ];
    this.b = [
    ];
    this.a = 'data-elementweakmap-index-' + ic++
  };

  var oc = {
    APPLET: !0,
    AUDIO: !0,
    BASE: !0,
    BGSOUND: !0,
    EMBED: !0,
    FORM: !0,
    IFRAME: !0,
    ISINDEX: !0,
    KEYGEN: !0,
    LAYER: !0,
    LINK: !0,
    META: !0,
    OBJECT: !0,
    SCRIPT: !0,
    SVG: !0,
    STYLE: !0,
    TEMPLATE: !0,
    VIDEO: !0
  };
  var pc = {
    A: !0,
    ABBR: !0,
    ACRONYM: !0,
    ADDRESS: !0,
    AREA: !0,
    ARTICLE: !0,
    ASIDE: !0,
    B: !0,
    BDI: !0,
    BDO: !0,
    BIG: !0,
    BLOCKQUOTE: !0,
    BR: !0,
    BUTTON: !0,
    CAPTION: !0,
    CENTER: !0,
    CITE: !0,
    CODE: !0,
    COL: !0,
    COLGROUP: !0,
    DATA: !0,
    DATALIST: !0,
    DD: !0,
    DEL: !0,
    DETAILS: !0,
    DFN: !0,
    DIALOG: !0,
    DIR: !0,
    DIV: !0,
    DL: !0,
    DT: !0,
    EM: !0,
    FIELDSET: !0,
    FIGCAPTION: !0,
    FIGURE: !0,
    FONT: !0,
    FOOTER: !0,
    FORM: !0,
    H1: !0,
    H2: !0,
    H3: !0,
    H4: !0,
    H5: !0,
    H6: !0,
    HEADER: !0,
    HGROUP: !0,
    HR: !0,
    I: !0,
    IMG: !0,
    INPUT: !0,
    INS: !0,
    KBD: !0,
    LABEL: !0,
    LEGEND: !0,
    LI: !0,
    MAIN: !0,
    MAP: !0,
    MARK: !0,
    MENU: !0,
    METER: !0,
    NAV: !0,
    NOSCRIPT: !0,
    OL: !0,
    OPTGROUP: !0,
    OPTION: !0,
    OUTPUT: !0,
    P: !0,
    PRE: !0,
    PROGRESS: !0,
    Q: !0,
    S: !0,
    SAMP: !0,
    SECTION: !0,
    SELECT: !0,
    SMALL: !0,
    SOURCE: !0,
    SPAN: !0,
    STRIKE: !0,
    STRONG: !0,
    STYLE: !0,
    SUB: !0,
    SUMMARY: !0,
    SUP: !0,
    TABLE: !0,
    TBODY: !0,
    TD: !0,
    TEXTAREA: !0,
    TFOOT: !0,
    TH: !0,
    THEAD: !0,
    TIME: !0,
    TR: !0,
    TT: !0,
    U: !0,
    UL: !0,
    VAR: !0,
    WBR: !0
  };
  var qc = {
    'ANNOTATION-XML': !0,
    'COLOR-PROFILE': !0,
    'FONT-FACE': !0,
    'FONT-FACE-SRC': !0,
    'FONT-FACE-URI': !0,
    'FONT-FACE-FORMAT': !0,
    'FONT-FACE-NAME': !0,
    'MISSING-GLYPH': !0
  },

  B(a.l, function (b) {
      if (0 != b.lastIndexOf('data-', 0)) throw new A('Only "data-" attributes allowed, got: %s.', [
        b
      ]);
      if (0 == b.lastIndexOf('data-sanitizer-', 0)) throw new A('Attributes with "%s" prefix are not allowed, got: %s.', [
        'data-sanitizer-',
        b
      ]);
      this.a['* ' +
      b.toUpperCase()] = tc
    }, this);

  pd = document.getElementById('meta-viewport');
  qd = [
    pd.getAttribute('content')
  ];
  rd ? qd.push(pd.getAttribute('data-zoom-off'))  : qd.push(pd.getAttribute('data-zoom-on'));
  pd.setAttribute('content', qd.join(','));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment