Skip to content

Instantly share code, notes, and snippets.

@mauryaratan
Created July 28, 2017 12:44
Show Gist options
  • Save mauryaratan/539144cff7df006a5344a1825adfb756 to your computer and use it in GitHub Desktop.
Save mauryaratan/539144cff7df006a5344a1825adfb756 to your computer and use it in GitHub Desktop.
Google Chrome Snippets, can be imported/exported from here https://gist.github.com/soundyogi/03df95505604c8351212 since Chrome doesn't offers any methods to sync it.
{
"snippets": [
{
"name": "dataurl.js",
"content": "// dataurl.js\n// https://github.com/bgrins/devtools-snippets\n// Print out data URLs for all images / canvases on the page.\n\n((() => {\n\n console.group(\"Data URLs\");\n\n [].forEach.call(document.querySelectorAll(\"img\"), i => {\n const c = document.createElement(\"canvas\");\n const ctx = c.getContext(\"2d\");\n c.width = i.width;\n c.height = i.height;\n\n try {\n ctx.drawImage(i, 0, 0);\n console.log(i, c.toDataURL());\n }\n catch(e) {\n console.log(i, \"No Permission - try opening this image in a new tab and running the snippet again?\", i.src);\n }\n });\n\n [].forEach.call(document.querySelectorAll(\"canvas\"), c => {\n try {\n console.log(c, c.toDataURL());\n }\n catch(e) {\n console.log(c, \"No Permission\");\n }\n });\n\n console.groupEnd(\"Data URLs\");\n\n}))();"
},
{
"name": "jqueryify.js",
"content": "// jquerify.js\n// https://github.com/bgrins/devtools-snippets\n// Add jQuery to any page that does not have it already.\n\n((() => {\n\n if ( !window.jQuery ) {\n const dollarInUse = !!window.$;\n const s = document.createElement('script');\n s.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js');\n s.addEventListener('load', () => {\n console.log('jQuery loaded!');\n\n if(dollarInUse) {\n jQuery.noConflict();\n console.log('`$` already in use; use `jQuery`');\n }\n });\n\n document.body.appendChild(s);\n }\n\n}))();"
},
{
"name": "overlay.js",
"content": "// overlay.js\n// Add an semi-transparent image overlay over your page to have pixel-perfect integration with your designs.\n\nconst storageKey = 'overlay-default';\nconst overlayDefault = localStorage.getItem(storageKey) || '';\nconst url = prompt('paste overlay url', overlayDefault);\nif (url) {\n localStorage.setItem(storageKey, url);\n const overlay = document.createElement('div');\n overlay.style.position = 'absolute';\n overlay.style.left = 0;\n overlay.style.top = 0;\n overlay.style.width = '100%';\n overlay.style.height='100%';\n overlay.style.backgroundImage = `url(${url})`;\n overlay.style.backgroundSize = 'cover';\n overlay.style.zIndex=10000;\n overlay.style.opacity = 0.5;\n document.body.appendChild(overlay);\n}"
},
{
"name": "performance.js",
"content": "// performance.js\n// https://github.com/bgrins/devtools-snippets\n// Print out window.performance information.\n// https://developer.mozilla.org/en-US/docs/Navigation_timing\n\n((() => {\n\n const t = window.performance.timing;\n const lt = window.chrome && window.chrome.loadTimes && window.chrome.loadTimes();\n const timings = [];\n\n timings.push({\n label: \"Time Until Page Loaded\",\n time: `${t.loadEventEnd - t.navigationStart}ms`\n });\n timings.push({\n label: \"Time Until DOMContentLoaded\",\n time: `${t.domContentLoadedEventEnd - t.navigationStart}ms`\n });\n timings.push({\n label: \"Total Response Time\",\n time: `${t.responseEnd - t.requestStart}ms`\n });\n timings.push({\n label: \"Connection\",\n time: `${t.connectEnd - t.connectStart}ms`\n });\n timings.push({\n label: \"Response\",\n time: `${t.responseEnd - t.responseStart}ms`\n });\n timings.push({\n label: \"Domain Lookup\",\n time: `${t.domainLookupEnd - t.domainLookupStart}ms`\n });\n timings.push({\n label: \"Load Event\",\n time: `${t.loadEventEnd - t.loadEventStart}ms`\n });\n timings.push({\n label: \"Unload Event\",\n time: `${t.unloadEventEnd - t.unloadEventStart}ms`\n });\n timings.push({\n label: \"DOMContentLoaded Event\",\n time: `${t.domContentLoadedEventEnd - t.domContentLoadedEventStart}ms`\n });\n if(lt) {\n if(lt.wasNpnNegotiated) {\n timings.push({\n label: \"NPN negotiation protocol\",\n time: lt.npnNegotiatedProtocol\n });\n }\n timings.push({\n label: \"Connection Info\",\n time: lt.connectionInfo\n });\n timings.push({\n label: \"First paint after Document load\",\n time: `${Math.ceil(lt.firstPaintTime - lt.finishDocumentLoadTime)}ms`\n });\n }\n\n const navigation = window.performance.navigation;\n const navigationTypes = { };\n navigationTypes[navigation.TYPE_NAVIGATENEXT || 0] = \"Navigation started by clicking on a link, or entering the URL in the user agent's address bar, or form submission.\",\n navigationTypes[navigation.TYPE_RELOAD] = \"Navigation through the reload operation or the location.reload() method.\",\n navigationTypes[navigation.TYPE_BACK_FORWARD] = \"Navigation through a history traversal operation.\",\n navigationTypes[navigation.TYPE_UNDEFINED] = \"Navigation type is undefined.\",\n\n console.group(\"window.performance\");\n\n console.log(window.performance);\n\n console.group(\"Navigation Information\");\n console.log(navigationTypes[navigation.type]);\n console.log(\"Number of redirects that have taken place: \", navigation.redirectCount)\n console.groupEnd(\"Navigation Information\");\n\n console.group(\"Timing\");\n console.log(window.performance.timing);\n console.table(timings, [\"label\", \"time\"]);\n console.groupEnd(\"Timing\");\n\n console.groupEnd(\"window.performance\");\n\n}))();"
},
{
"name": "querystringvalues.js",
"content": "// querystringvalues.js\n// https://github.com/bgrins/devtools-snippets\n// Print out key/value pairs from querystring.\n\n((() => {\n\n const url = location;\n const querystring = location.search.slice(1);\n const tab = querystring.split(\"&\").map(qs => ({\n \"Key\": qs.split(\"=\")[0],\n \"Value\": qs.split(\"=\")[1],\n \"Pretty Value\": decodeURIComponent(qs.split(\"=\")[1]).replace('//g',\" \")\n }));\n\n console.group(\"Querystring Values\");\n console.log(`URL: ${url}\\nQS: ${querystring}`);\n console.table(tab);\n console.groupEnd(\"Querystring Values\");\n\n}))();"
},
{
"name": "showheaders.js",
"content": "// showheaders.js\n// https://github.com/bgrins/devtools-snippets\n// Print out response headers for current URL.\n\n((() => {\n\n const request = new XMLHttpRequest();\n request.open('HEAD',window.location,true);\n \n request.onload = request.onerror = () => {\n const headers = request.getAllResponseHeaders();\n const tab = headers.split(\"\\n\").map(h => ({\n \"Key\": h.split(\": \")[0],\n \"Value\": h.split(\": \")[1]\n })).filter(h => h.Value !== undefined);\n\n console.group(\"Request Headers\");\n console.log(headers);\n console.table(tab);\n console.groupEnd(\"Request Headers\");\n };\n \n request.send(null);\n\n}))();"
},
{
"name": "wrapelement.js",
"content": "// wrapelement.js\n// https://github.com/bgrins/devtools-snippets\n// Wrap a given element in a given type of element\n// wrapElement('.foo', 'h1');\n// wrapElement(document.querySelector('#bar'), 'div');\n//\n// LICENSE: [MIT](http://gkatsev.mit-license.org)\n\n((() => {\n window.wrapElement = (el, whatToWrapIn) => {\n const newParent = document.createElement(whatToWrapIn);\n let oldParent;\n let nextSibling;\n\n if (typeof el === 'string') {\n el = document.querySelector(el);\n }\n\n oldParent = el.parentNode;\n nextSibling = el.nextSibling;\n newParent.appendChild(el);\n if (nextSibling) {\n oldParent.insertBefore(newParent, nextSibling);\n } else {\n oldParent.appendChild(newParent);\n }\n }\n\n}))();"
},
{
"name": "allcolors.js",
"content": "// allcolors.js\n// https://github.com/bgrins/devtools-snippets\n// Print out CSS colors used in elements on the page.\n\n((() => {\n // Should include colors from elements that have a border color but have a zero width?\n const includeBorderColorsWithZeroWidth = false;\n\n const allColors = {};\n const props = [\"background-color\", \"color\", \"border-top-color\", \"border-right-color\", \"border-bottom-color\", \"border-left-color\"];\n const skipColors = {\n \"rgb(0, 0, 0)\": 1,\n \"rgba(0, 0, 0, 0)\": 1,\n \"rgb(255, 255, 255)\": 1\n };\n\n [].forEach.call(document.querySelectorAll(\"*\"), node => {\n const nodeColors = {};\n props.forEach(prop => {\n const color = window.getComputedStyle(node, null).getPropertyValue(prop);\n const thisIsABorderProperty = (prop.includes(\"border\"));\n const notBorderZero = thisIsABorderProperty ? window.getComputedStyle(node, null).getPropertyValue(prop.replace(\"color\", \"width\")) !== \"0px\" : true;\n let colorConditionsMet;\n\n if (includeBorderColorsWithZeroWidth) {\n colorConditionsMet = color && !skipColors[color];\n } else {\n colorConditionsMet = color && !skipColors[color] && notBorderZero;\n }\n\n if (colorConditionsMet) {\n if (!allColors[color]) {\n allColors[color] = {\n count: 0,\n nodes: []\n };\n }\n\n if (!nodeColors[color]) {\n allColors[color].count++;\n allColors[color].nodes.push(node);\n }\n\n nodeColors[color] = true;\n }\n });\n });\n\n function rgbTextToRgbArray(rgbText) {\n return rgbText.replace(/\\s/g, \"\").match(/\\d+,\\d+,\\d+/)[0].split(\",\").map(num => parseInt(num, 10));\n }\n\n function componentToHex(c) {\n const hex = c.toString(16);\n return hex.length == 1 ? `0${hex}` : hex;\n }\n\n function rgbToHex(rgbArray) {\n const r = rgbArray[0];\n const g = rgbArray[1];\n const b = rgbArray[2];\n return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;\n }\n\n let allColorsSorted = [];\n for (const i in allColors) {\n const rgbArray = rgbTextToRgbArray(i);\n const hexValue = rgbToHex(rgbArray);\n\n allColorsSorted.push({\n key: i,\n value: allColors[i],\n hexValue\n });\n }\n\n allColorsSorted = allColorsSorted.sort((a, b) => b.value.count - a.value.count);\n\n const nameStyle = \"font-weight:normal;\";\n const countStyle = \"font-weight:bold;\";\n function colorStyle(color) {\n return `background:${color};color:${color};border:1px solid #333;`;\n };\n\n console.group(`Total colors used in elements on the page: ${window.location.href} are ${allColorsSorted.length}`);\n allColorsSorted.forEach(c => {\n console.groupCollapsed(`%c %c ${c.key} ${c.hexValue} %c(${c.value.count} times)`,\n colorStyle(c.key), nameStyle, countStyle);\n c.value.nodes.forEach(node => {\n console.log(node);\n });\n console.groupEnd();\n });\n console.groupEnd(\"All colors used in elements on the page\");\n\n}))();"
},
{
"name": "console-save.js",
"content": "/**\n * console-save.js\n * \n * A simple way to save objects as .json files from the console, includes a chrome extension along with a plain script.\n * Usage:\n * console.save(data, [filename])\n * Data can be a string or just an object, objects are passed through json.stringify() before writing to file. Filename is optional, defaults to ‘console.json’.\n */\n(function(console){\n\n console.save = function(data, filename){\n\n if(!data) {\n console.error('Console.save: No data')\n return;\n }\n\n if(!filename) filename = 'console.json'\n\n if(typeof data === \"object\"){\n data = JSON.stringify(data, undefined, 4)\n }\n\n var blob = new Blob([data], {type: 'text/json'}),\n e = document.createEvent('MouseEvents'),\n a = document.createElement('a')\n\n a.download = filename\n a.href = window.URL.createObjectURL(blob)\n a.dataset.downloadurl = ['text/json', a.download, a.href].join(':')\n e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)\n a.dispatchEvent(e)\n }\n})(console)"
},
{
"name": "format-css.js",
"content": "// cssprettifier.js\n// https://github.com/bgrins/devtools-snippets\n// Unminify and prettify a CSS file.\n\n/*\n * cssprettifier-bookmarklet\n * Copyright (c) 2013 Addy Osmani, Sindre Sorhus\n * CSSBeautify (c) Sencha, Ariya Hidayat\n * Prism (c) Lea Verou\n * Licensed under the MIT license.\n */\n /*globals document:true*/\n((() => {\n if (document.body.childNodes.length !== 2) {\n console.log(\"CSS Prettify: This page doesn't appear to be a stylesheet. Make sure you run this on a css file\");\n return;\n }\n\n // cssbeautify\n ((() => {\n function a(a,b){\n function s(a){return\" \"===a||\"\\n\"===a||\" \"===a||\"\\r\"===a||\"\\f\"===a}function t(a){return\"'\"===a||'\"'===a}function u(a){return h>=\"a\"&&\"z\">=h||h>=\"A\"&&\"Z\">=h||h>=\"0\"&&\"9\">=h||\"-_*.:#\".includes(a)}function v(){let a;for(a=m;a>0;a-=1)g+=c.indent}function w(){g=r(g),p?g+=\" {\":(g+=\"\\n\",v(),g+=\"{\"),\"\\n\"!==i&&(g+=\"\\n\"),m+=1}function x(){let a;m-=1,g=r(g),q&&(a=g.charAt(g.length-1),\";\"!==a&&\"{\"!==a&&(g+=\";\")),g+=\"\\n\",v(),g+=\"}\",f.push(g),g=\"\"}\n var c;\n var f;\n var h;\n var i;\n let j;\n let k;\n let l;\n var m;\n let n;\n let o;\n var r;\n let d=0;\n const e=a.length;\n var g=\"\";\n var p=!0;\n var q=!1;\n for(c=arguments.length>1?b:{},c.indent===void 0&&(c.indent=\" \"),\"string\"==typeof c.openbrace&&(p=\"end-of-line\"===c.openbrace),\"boolean\"==typeof c.autosemicolon&&(q=c.autosemicolon),r=String.prototype.trimRight?a => a.trimRight():a => a.replace(/\\s+$/,\"\"),l={Start:0,AtRule:1,Block:2,Selector:3,Ruleset:4,Property:5,Separator:6,Expression:7,URL:8},m=0,k=l.Start,o=!1,f=[],a=a.replace(/\\r\\n/g,\"\\n\");e>d;)if(h=a.charAt(d),i=a.charAt(d+1),d+=1,t(n))g+=h,h===n&&(n=null),\"\\\\\"===h&&i===n&&(g+=i,d+=1);else if(t(h))g+=h,n=h;else if(o)g+=h,\"*\"===h&&\"/\"===i&&(o=!1,g+=i,d+=1);else if(\"/\"!==h||\"*\"!==i){if(k===l.Start){if(0===f.length&&s(h)&&0===g.length)continue;if(\" \">=h||h.charCodeAt(0)>=128){k=l.Start,g+=h;continue}if(u(h)||\"[\"===h||\"@\"===h){if(j=r(g),0===j.length)f.length>0&&(g=\"\\n\\n\");else if(\"}\"===j.charAt(j.length-1)||\";\"===j.charAt(j.length-1))g=`${j}\\n\\n`;else for(;;){if(i=g.charAt(g.length-1),\" \"!==i&&9!==i.charCodeAt(0))break;g=g.substr(0,g.length-1)}g+=h,k=\"@\"===h?l.AtRule:l.Selector;continue}}if(k!==l.AtRule)if(k!==l.Block)if(k!==l.Selector)if(k!==l.Ruleset)if(k!==l.Property)if(k!==l.Separator)if(k!==l.Expression)k===l.URL&&\")\"===h&&g.charAt(\"\\\\\"!==g.length-1)?(g+=h,k=l.Expression):g+=h;else{if(\"}\"===h){x(),k=l.Start,m>0&&(k=l.Block);continue}if(\";\"===h){g=r(g),g+=\";\\n\",k=l.Ruleset;continue}if(g+=h,\"(\"===h&&\"l\"===g.charAt(g.length-2)&&\"r\"===g.charAt(g.length-3)&&\"u\"===g.charAt(g.length-4)){k=l.URL;continue}}else{if(!s(h)){g+=h,k=l.Expression;continue}t(i)&&(k=l.Expression)}else{if(\":\"===h){g=r(g),g+=\": \",k=l.Expression,s(i)&&(k=l.Separator);continue}if(\"}\"===h){x(),k=l.Start,m>0&&(k=l.Block);continue}g+=h}else{if(\"}\"===h){x(),k=l.Start,m>0&&(k=l.Block);continue}if(\"\\n\"===h){g=r(g),g+=\"\\n\";continue}if(!s(h)){g=r(g),g+=\"\\n\",v(),g+=h,k=l.Property;continue}g+=h}else{if(\"{\"===h){w(),k=l.Ruleset;continue}if(\"}\"===h){x(),k=l.Start;continue}g+=h}else{if(u(h)){if(j=r(g),0===j.length)f.length>0&&(g=\"\\n\\n\");else if(\"}\"===j.charAt(j.length-1))g=`${j}\\n\\n`;else for(;;){if(i=g.charAt(g.length-1),\" \"!==i&&9!==i.charCodeAt(0))break;g=g.substr(0,g.length-1)}v(),g+=h,k=l.Selector;continue}if(\"}\"===h){x(),k=l.Start;continue}g+=h}else{if(\";\"===h){g+=h,k=l.Start;continue}if(\"{\"===h){j=r(g),w(),k=\"@font-face\"===j?l.Ruleset:l.Block;continue}g+=h}}else o=!0,g+=h,g+=i,d+=1;return g=f.join(\"\")+g\n }\"undefined\"!=typeof exports?module.exports=exports=a:\"object\"==typeof window&&(window.cssbeautify=a)\n }))();\n // prism\n ((() => {\n const e=/\\blang(?:uage)?-(?!\\*)(\\w+)\\b/i;\n\n const t=self.Prism={util:{type(e) {return Object.prototype.toString.call(e).match(/\\[object (\\w+)\\]/)[1]},clone(e) {const n=t.util.type(e);switch(n){case\"Object\":const r={};for(const i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case\"Array\":return e.slice()}return e}},languages:{extend(e, n) {const r=t.util.clone(t.languages[e]);for(const i in n)r[i]=n[i];return r},insertBefore(e, n, r, i=t.languages) {\n const s=i[e], o={};for(const u in s)if(s.hasOwnProperty(u)){if(u==n)for(const a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o\n },DFS(e, n) {for(const r in e){n.call(e,r,e[r]);t.util.type(e)===\"Object\"&&t.languages.DFS(e[r],n)}}},highlightAll(e, n) {const r=document.querySelectorAll('code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code');for(let i=0, s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement(r, i, s) {let o, u, a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,\"\"])[1];u=t.languages[o]}if(!u)return;r.className=`${r.className.replace(e,\"\").replace(/\\s+/g,\" \")} language-${o}`;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=`${a.className.replace(e,\"\").replace(/\\s+/g,\" \")} language-${o}`);let f=r.textContent;if(!f)return;f=f.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\\u00a0/g,\" \");const l={element:r,language:o,grammar:u,code:f};t.hooks.run(\"before-highlight\",l);if(i&&self.Worker){const c=new Worker(t.filename);c.onmessage=e => {l.highlightedCode=n.stringify(JSON.parse(e.data));l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run(\"after-highlight\",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run(\"after-highlight\",l)}},highlight(e, r) {return n.stringify(t.tokenize(e,r))},tokenize(e, n) {const r=t.Token, i=[e], s=n.rest;if(s){for(var o in s)n[o]=s[o];delete n.rest}e:for(var o in n){\n if(!n.hasOwnProperty(o)||!n[o])continue;\n let u=n[o];\n const a=u.inside;\n let f=!!u.lookbehind||0;\n u=u.pattern||u;for(let l=0;l<i.length;l++){const c=i[l];if(i.length>e.length)break e;if(c instanceof r)continue;u.lastIndex=0;var h=u.exec(c);if(h){f&&(f=h[1].length);const p=h.index-1+f, h=h[0].slice(f), d=h.length, v=p+d, m=c.slice(0,p+1), g=c.slice(v+1), y=[l,1];m&&y.push(m);const b=new r(o,a?t.tokenize(h,a):h);y.push(b);g&&y.push(g);Array.prototype.splice.apply(i,y)}}\n }return i},hooks:{all:{},add(e, n) {const r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run(e, n) {const r=t.hooks.all[e];if(!r||!r.length)return;for(let i=0, s;s=r[i++];)s(n)}}};\n\n const n=t.Token=function(e,t){this.type=e;this.content=t};\n n.stringify=e => {if(typeof e==\"string\")return e;if(Object.prototype.toString.call(e)==\"[object Array]\")return e.map(n.stringify).join(\"\");const r={type:e.type,content:n.stringify(e.content),tag:\"span\",classes:[\"token\",e.type],attributes:{}};r.type==\"comment\"&&(r.attributes.spellcheck=\"true\");t.hooks.run(\"wrap\",r);let i=\"\";for(const s in r.attributes)i+=`${s}=\"${r.attributes[s]||\"\"}\"`;return`<${r.tag} class=\"${r.classes.join(\" \")}\" ${i}>${r.content}</${r.tag}>`};if(!self.document){self.addEventListener(\"message\",e => {\n const n=JSON.parse(e.data);\n const r=n.language;\n const i=n.code;\n self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()\n },!1);return}let r=document.getElementsByTagName(\"script\");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute(\"data-manual\")&&document.addEventListener(\"DOMContentLoaded\",t.highlightAll)}\n }))();\n Prism.languages.css={comment:/\\/\\*[\\w\\W]*?\\*\\//g,atrule:/@[\\w-]+?(\\s+[^;{]+)?(?=\\s*{|\\s*;)/gi,url:/url\\(([\"']?).*?\\1\\)/gi,selector:/[^\\{\\}\\s][^\\{\\}]*(?=\\s*\\{)/g,property:/(\\b|\\B)[a-z-]+(?=\\s*:)/ig,string:/(\"|')(\\\\?.)*?\\1/g,important:/\\B!important\\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\\{\\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore(\"markup\",\"tag\",{style:{pattern:/(&lt;|<)style[\\w\\W]*?(>|&gt;)[\\w\\W]*?(&lt;|<)\\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\\w\\W]*?(>|&gt;)|(&lt;|<)\\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});\n\n const prismStyle = document.createElement('style');\n const beautified = cssbeautify(document.body.textContent, {autosemicolon: true});\n const highlighted = Prism.highlight(beautified, Prism.languages.css);\n\n prismStyle.textContent = 'code[class*=\"language-\"],pre[class*=\"language-\"]{color:black;text-shadow:0 1px white;font-family:Consolas,Monaco,\\'Andale Mono\\',monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;}@media print{code[class*=\"language-\"],pre[class*=\"language-\"]{text-shadow:none;}}pre[class*=\"language-\"]{padding:1em;margin:.5em 0;overflow:auto;}:not(pre) > code[class*=\"language-\"],pre[class*=\"language-\"]{background:#f5f2f0;}:not(pre) > code[class*=\"language-\"]{padding:.1em;border-radius:.3em;}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:slategray;}.token.punctuation{color:#999;}.namespace{opacity:.7;}.token.property,.token.tag,.token.boolean,.token.number{color:#905;}.token.selector,.token.attr-name,.token.string{color:#690;}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#a67f59;background:hsla(0,0%,100%,.5);}.token.atrule,.token.attr-value,.token.keyword{color:#07a;}.token.regex,.token.important{color:#e90;}.token.important{font-weight:bold;}.token.entity{cursor:help;}';\n\n document.head.innerHTML = '';\n document.head.appendChild(prismStyle);\n document.body.innerHTML = `<code><pre>${highlighted}</pre></code>`;\n}))();"
},
{
"name": "plainforms.js",
"content": "// plainforms.js\n// https://github.com/bgrins/devtools-snippets\n// Remove HTML5 form features (validations and special input types).\n\n((() => {\n\n ['maxlength', 'required', 'min', 'max', 'pattern', 'step' ].forEach(attr => {\n [].forEach.call(document.querySelectorAll(`[${attr}]`), node => {\n node.removeAttribute(attr);\n });\n });\n\n ['tel', 'url', 'email', 'datetime', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color'].forEach(type => {\n [].forEach.call(document.querySelectorAll(`input[type=${type}]`), node => {\n node.setAttribute('type', 'text');\n });\n });\n\n console.info(\"All HTML5 form validations have been removed.\");\n}))();"
},
{
"name": "format-js.js",
"content": "// format-js.js\n// https://github.com/bgrins/devtools-snippets\n// Prettify JavaScript files directly in browser.\n\n/**\n * jsprettifier-bookmarklet\n * A bookmarklet for prettifying JS directly in your browser\n * https://github.com/marcobarcelos/jsprettifier-bookmarklet\n * Copyright (c) 2015 Marco Barcelos\n * Licensed under the MIT license\n */\n(function () {\n 'use strict';\n\n function prettify() {\n // JSBeautify (c) Einar Lielmanis and contributors, MIT License\n (function(){function e(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function t(e){return e.replace(/^\\s+|\\s+$/g,\"\")}function n(e){return e.replace(/^\\s+/g,\"\")}function _(e,t){\"use strict\";var n=new r(e,t);return n.beautify()}function r(_,r){\"use strict\";function i(e,t){var n=0;e&&(n=e.indentation_level,!z.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level));var _={mode:t,parent:e,last_text:e?e.last_text:\"\",last_word:e?e.last_word:\"\",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:z.get_line_number(),ternary_depth:0};return _}function c(e){var t=e.newlines,n=te.keep_array_indentation&&K(q.mode);if(n)for(_=0;t>_;_+=1)u(_>0);else if(te.max_preserve_newlines&&t>te.max_preserve_newlines&&(t=te.max_preserve_newlines),te.preserve_newlines&&e.newlines>1){u();for(var _=1;t>_;_+=1)u(!0)}Q=e,ee[Q.type]()}function d(e){e=e.replace(/\\x0d/g,\"\");for(var t=[],n=e.indexOf(\"\\n\");-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf(\"\\n\");return e.length&&t.push(e),t}function f(e){if(e=void 0===e?!1:e,!z.just_added_newline())if(te.preserve_newlines&&Q.wanted_newline||e)u(!1,!0);else if(te.wrap_line_length){var t=z.current_line.get_character_count()+Q.text.length+(z.space_before_token?1:0);t>=te.wrap_line_length&&u(!1,!0)}}function u(e,t){if(!t&&\";\"!==q.last_text&&\",\"!==q.last_text&&\"=\"!==q.last_text&&\"TK_OPERATOR\"!==G)for(;q.mode===l.Statement&&!q.if_block&&!q.do_block;)m();z.add_new_line(e)&&(q.multiline_frame=!0)}function p(){z.just_added_newline()&&(te.keep_array_indentation&&K(q.mode)&&Q.wanted_newline?(z.current_line.push(Q.whitespace_before),z.space_before_token=!1):z.set_indent(q.indentation_level)&&(q.line_indent_level=q.indentation_level))}function h(e){return z.raw?void z.add_raw_token(Q):(te.comma_first&&\"TK_COMMA\"===G&&z.just_added_newline()&&\",\"===z.previous_line.last()&&(z.previous_line.pop(),p(),z.add_token(\",\"),z.space_before_token=!0),e=e||Q.text,p(),void z.add_token(e))}function E(){q.indentation_level+=1}function T(){q.indentation_level>0&&(!q.parent||q.indentation_level>q.parent.indentation_level)&&(q.indentation_level-=1)}function R(e){q?(J.push(q),H=q):H=i(null,e),q=i(H,e)}function K(e){return e===l.ArrayLiteral}function x(t){return e(t,[l.Expression,l.ForInitializer,l.Conditional])}function m(){J.length>0&&(H=q,q=J.pop(),H.mode===l.Statement&&z.remove_redundant_indentation(H))}function b(){return q.parent.mode===l.ObjectLiteral&&q.mode===l.Statement&&(\":\"===q.last_text&&0===q.ternary_depth||\"TK_RESERVED\"===G&&e(q.last_text,[\"get\",\"set\"]))}function v(){return\"TK_RESERVED\"===G&&e(q.last_text,[\"var\",\"let\",\"const\"])&&\"TK_WORD\"===Q.type||\"TK_RESERVED\"===G&&\"do\"===q.last_text||\"TK_RESERVED\"===G&&\"return\"===q.last_text&&!Q.wanted_newline||\"TK_RESERVED\"===G&&\"else\"===q.last_text&&(\"TK_RESERVED\"!==Q.type||\"if\"!==Q.text)||\"TK_END_EXPR\"===G&&(H.mode===l.ForInitializer||H.mode===l.Conditional)||\"TK_WORD\"===G&&q.mode===l.BlockStatement&&!q.in_case&&\"--\"!==Q.text&&\"++\"!==Q.text&&\"function\"!==$&&\"TK_WORD\"!==Q.type&&\"TK_RESERVED\"!==Q.type||q.mode===l.ObjectLiteral&&(\":\"===q.last_text&&0===q.ternary_depth||\"TK_RESERVED\"===G&&e(q.last_text,[\"get\",\"set\"]))?(R(l.Statement),E(),\"TK_RESERVED\"===G&&e(q.last_text,[\"var\",\"let\",\"const\"])&&\"TK_WORD\"===Q.type&&(q.declaration_statement=!0),b()||f(\"TK_RESERVED\"===Q.type&&e(Q.text,[\"do\",\"for\",\"if\",\"while\"])),!0):!1}function w(e,n){for(var _=0;_<e.length;_++){var r=t(e[_]);if(r.charAt(0)!==n)return!1}return!0}function S(e,t){for(var n,_=0,r=e.length;r>_;_++)if(n=e[_],n&&0!==n.indexOf(t))return!1;return!0}function A(t){return e(t,[\"case\",\"return\",\"do\",\"if\",\"throw\",\"else\"])}function y(e){var t=F+(e||0);return 0>t||t>=ne.length?null:ne[t]}function O(){v();var t=l.Expression;if(\"[\"===Q.text){if(\"TK_WORD\"===G||\")\"===q.last_text)return\"TK_RESERVED\"===G&&e(q.last_text,U.line_starters)&&(z.space_before_token=!0),R(t),h(),E(),void(te.space_in_paren&&(z.space_before_token=!0));t=l.ArrayLiteral,K(q.mode)&&(\"[\"===q.last_text||\",\"===q.last_text&&(\"]\"===$||\"}\"===$))&&(te.keep_array_indentation||u())}else\"TK_RESERVED\"===G&&\"for\"===q.last_text?t=l.ForInitializer:\"TK_RESERVED\"===G&&e(q.last_text,[\"if\",\"while\"])&&(t=l.Conditional);\";\"===q.last_text||\"TK_START_BLOCK\"===G?u():\"TK_END_EXPR\"===G||\"TK_START_EXPR\"===G||\"TK_END_BLOCK\"===G||\".\"===q.last_text?f(Q.wanted_newline):\"TK_RESERVED\"===G&&\"(\"===Q.text||\"TK_WORD\"===G||\"TK_OPERATOR\"===G?\"TK_RESERVED\"===G&&(\"function\"===q.last_word||\"typeof\"===q.last_word)||\"*\"===q.last_text&&\"function\"===$?te.space_after_anon_function&&(z.space_before_token=!0):\"TK_RESERVED\"!==G||!e(q.last_text,U.line_starters)&&\"catch\"!==q.last_text||te.space_before_conditional&&(z.space_before_token=!0):z.space_before_token=!0,\"(\"===Q.text&&\"TK_RESERVED\"===G&&\"await\"===q.last_word&&(z.space_before_token=!0),\"(\"===Q.text&&(\"TK_EQUALS\"===G||\"TK_OPERATOR\"===G)&&(b()||f()),R(t),h(),te.space_in_paren&&(z.space_before_token=!0),E()}function g(){for(;q.mode===l.Statement;)m();q.multiline_frame&&f(\"]\"===Q.text&&K(q.mode)&&!te.keep_array_indentation),te.space_in_paren&&(\"TK_START_EXPR\"!==G||te.space_in_empty_paren?z.space_before_token=!0:(z.trim(),z.space_before_token=!1)),\"]\"===Q.text&&te.keep_array_indentation?(h(),m()):(m(),h()),z.remove_redundant_indentation(H),q.do_while&&H.mode===l.Conditional&&(H.mode=l.Expression,q.do_block=!1,q.do_while=!1)}function k(){var t=y(1),n=y(2);R(n&&(\":\"===n.text&&e(t.type,[\"TK_STRING\",\"TK_WORD\",\"TK_RESERVED\"])||e(t.text,[\"get\",\"set\"])&&e(n.type,[\"TK_WORD\",\"TK_RESERVED\"]))?e($,[\"class\",\"interface\"])?l.BlockStatement:l.ObjectLiteral:l.BlockStatement);var _=!t.comments_before.length&&\"}\"===t.text,r=_&&\"function\"===q.last_word&&\"TK_END_EXPR\"===G;\"expand\"===te.brace_style||\"none\"===te.brace_style&&Q.wanted_newline?\"TK_OPERATOR\"!==G&&(r||\"TK_EQUALS\"===G||\"TK_RESERVED\"===G&&A(q.last_text)&&\"else\"!==q.last_text)?z.space_before_token=!0:u(!1,!0):\"TK_OPERATOR\"!==G&&\"TK_START_EXPR\"!==G?\"TK_START_BLOCK\"===G?u():z.space_before_token=!0:K(H.mode)&&\",\"===q.last_text&&(\"}\"===$?z.space_before_token=!0:u()),h(),E()}function D(){for(;q.mode===l.Statement;)m();var e=\"TK_START_BLOCK\"===G;\"expand\"===te.brace_style?e||u():e||(K(q.mode)&&te.keep_array_indentation?(te.keep_array_indentation=!1,u(),te.keep_array_indentation=!0):u()),m(),h()}function C(){if(\"TK_RESERVED\"===Q.type&&q.mode!==l.ObjectLiteral&&e(Q.text,[\"set\",\"get\"])&&(Q.type=\"TK_WORD\"),\"TK_RESERVED\"===Q.type&&q.mode===l.ObjectLiteral){var t=y(1);\":\"==t.text&&(Q.type=\"TK_WORD\")}if(v()||!Q.wanted_newline||x(q.mode)||\"TK_OPERATOR\"===G&&\"--\"!==q.last_text&&\"++\"!==q.last_text||\"TK_EQUALS\"===G||!te.preserve_newlines&&\"TK_RESERVED\"===G&&e(q.last_text,[\"var\",\"let\",\"const\",\"set\",\"get\"])||u(),q.do_block&&!q.do_while){if(\"TK_RESERVED\"===Q.type&&\"while\"===Q.text)return z.space_before_token=!0,h(),z.space_before_token=!0,void(q.do_while=!0);u(),q.do_block=!1}if(q.if_block)if(q.else_block||\"TK_RESERVED\"!==Q.type||\"else\"!==Q.text){for(;q.mode===l.Statement;)m();q.if_block=!1,q.else_block=!1}else q.else_block=!0;if(\"TK_RESERVED\"===Q.type&&(\"case\"===Q.text||\"default\"===Q.text&&q.in_case_statement))return u(),(q.case_body||te.jslint_happy)&&(T(),q.case_body=!1),h(),q.in_case=!0,void(q.in_case_statement=!0);if(\"TK_RESERVED\"===Q.type&&\"function\"===Q.text&&((e(q.last_text,[\"}\",\";\"])||z.just_added_newline()&&!e(q.last_text,[\"[\",\"{\",\":\",\"=\",\",\"]))&&(z.just_added_blankline()||Q.comments_before.length||(u(),u(!0))),\"TK_RESERVED\"===G||\"TK_WORD\"===G?\"TK_RESERVED\"===G&&e(q.last_text,[\"get\",\"set\",\"new\",\"return\",\"export\",\"async\"])?z.space_before_token=!0:\"TK_RESERVED\"===G&&\"default\"===q.last_text&&\"export\"===$?z.space_before_token=!0:u():\"TK_OPERATOR\"===G||\"=\"===q.last_text?z.space_before_token=!0:(q.multiline_frame||!x(q.mode)&&!K(q.mode))&&u()),(\"TK_COMMA\"===G||\"TK_START_EXPR\"===G||\"TK_EQUALS\"===G||\"TK_OPERATOR\"===G)&&(b()||f()),\"TK_RESERVED\"===Q.type&&e(Q.text,[\"function\",\"get\",\"set\"]))return h(),void(q.last_word=Q.text);if(Y=\"NONE\",\"TK_END_BLOCK\"===G?\"TK_RESERVED\"===Q.type&&e(Q.text,[\"else\",\"catch\",\"finally\"])?\"expand\"===te.brace_style||\"end-expand\"===te.brace_style||\"none\"===te.brace_style&&Q.wanted_newline?Y=\"NEWLINE\":(Y=\"SPACE\",z.space_before_token=!0):Y=\"NEWLINE\":\"TK_SEMICOLON\"===G&&q.mode===l.BlockStatement?Y=\"NEWLINE\":\"TK_SEMICOLON\"===G&&x(q.mode)?Y=\"SPACE\":\"TK_STRING\"===G?Y=\"NEWLINE\":\"TK_RESERVED\"===G||\"TK_WORD\"===G||\"*\"===q.last_text&&\"function\"===$?Y=\"SPACE\":\"TK_START_BLOCK\"===G?Y=\"NEWLINE\":\"TK_END_EXPR\"===G&&(z.space_before_token=!0,Y=\"NEWLINE\"),\"TK_RESERVED\"===Q.type&&e(Q.text,U.line_starters)&&\")\"!==q.last_text&&(Y=\"else\"===q.last_text||\"export\"===q.last_text?\"SPACE\":\"NEWLINE\"),\"TK_RESERVED\"===Q.type&&e(Q.text,[\"else\",\"catch\",\"finally\"]))if(\"TK_END_BLOCK\"!==G||\"expand\"===te.brace_style||\"end-expand\"===te.brace_style||\"none\"===te.brace_style&&Q.wanted_newline)u();else{z.trim(!0);var n=z.current_line;\"}\"!==n.last()&&u(),z.space_before_token=!0}else\"NEWLINE\"===Y?\"TK_RESERVED\"===G&&A(q.last_text)?z.space_before_token=!0:\"TK_END_EXPR\"!==G?\"TK_START_EXPR\"===G&&\"TK_RESERVED\"===Q.type&&e(Q.text,[\"var\",\"let\",\"const\"])||\":\"===q.last_text||(\"TK_RESERVED\"===Q.type&&\"if\"===Q.text&&\"else\"===q.last_text?z.space_before_token=!0:u()):\"TK_RESERVED\"===Q.type&&e(Q.text,U.line_starters)&&\")\"!==q.last_text&&u():q.multiline_frame&&K(q.mode)&&\",\"===q.last_text&&\"}\"===$?u():\"SPACE\"===Y&&(z.space_before_token=!0);h(),q.last_word=Q.text,\"TK_RESERVED\"===Q.type&&\"do\"===Q.text&&(q.do_block=!0),\"TK_RESERVED\"===Q.type&&\"if\"===Q.text&&(q.if_block=!0)}function N(){for(v()&&(z.space_before_token=!1);q.mode===l.Statement&&!q.if_block&&!q.do_block;)m();h()}function L(){v()?z.space_before_token=!0:\"TK_RESERVED\"===G||\"TK_WORD\"===G?z.space_before_token=!0:\"TK_COMMA\"===G||\"TK_START_EXPR\"===G||\"TK_EQUALS\"===G||\"TK_OPERATOR\"===G?b()||f():u(),h()}function V(){v(),q.declaration_statement&&(q.declaration_assignment=!0),z.space_before_token=!0,h(),z.space_before_token=!0}function I(){return q.declaration_statement?(x(q.parent.mode)&&(q.declaration_assignment=!1),h(),void(q.declaration_assignment?(q.declaration_assignment=!1,u(!1,!0)):(z.space_before_token=!0,te.comma_first&&f()))):(h(),void(q.mode===l.ObjectLiteral||q.mode===l.Statement&&q.parent.mode===l.ObjectLiteral?(q.mode===l.Statement&&m(),u()):(z.space_before_token=!0,te.comma_first&&f())))}function P(){if(v(),\"TK_RESERVED\"===G&&A(q.last_text))return z.space_before_token=!0,void h();if(\"*\"===Q.text&&\"TK_DOT\"===G)return void h();if(\":\"===Q.text&&q.in_case)return q.case_body=!0,E(),h(),u(),void(q.in_case=!1);if(\"::\"===Q.text)return void h();\"TK_OPERATOR\"===G&&f();var t=!0,n=!0;e(Q.text,[\"--\",\"++\",\"!\",\"~\"])||e(Q.text,[\"-\",\"+\"])&&(e(G,[\"TK_START_BLOCK\",\"TK_START_EXPR\",\"TK_EQUALS\",\"TK_OPERATOR\"])||e(q.last_text,U.line_starters)||\",\"===q.last_text)?(t=!1,n=!1,!Q.wanted_newline||\"--\"!==Q.text&&\"++\"!==Q.text||u(!1,!0),\";\"===q.last_text&&x(q.mode)&&(t=!0),\"TK_RESERVED\"===G?t=!0:\"TK_END_EXPR\"===G?t=!(\"]\"===q.last_text&&(\"--\"===Q.text||\"++\"===Q.text)):\"TK_OPERATOR\"===G&&(t=e(Q.text,[\"--\",\"-\",\"++\",\"+\"])&&e(q.last_text,[\"--\",\"-\",\"++\",\"+\"]),e(Q.text,[\"+\",\"-\"])&&e(q.last_text,[\"--\",\"++\"])&&(n=!0)),q.mode!==l.BlockStatement&&q.mode!==l.Statement||\"{\"!==q.last_text&&\";\"!==q.last_text||u()):\":\"===Q.text?0===q.ternary_depth?t=!1:q.ternary_depth-=1:\"?\"===Q.text?q.ternary_depth+=1:\"*\"===Q.text&&\"TK_RESERVED\"===G&&\"function\"===q.last_text&&(t=!1,n=!1),z.space_before_token=z.space_before_token||t,h(),z.space_before_token=n}function M(){if(z.raw)return z.add_raw_token(Q),void(Q.directives&&\"end\"===Q.directives.preserve&&(te.test_output_raw||(z.raw=!1)));if(Q.directives)return u(!1,!0),h(),\"start\"===Q.directives.preserve&&(z.raw=!0),void u(!1,!0);if(!o.newline.test(Q.text)&&!Q.wanted_newline)return z.space_before_token=!0,h(),void(z.space_before_token=!0);var e,t=d(Q.text),_=!1,r=!1,i=Q.whitespace_before,a=i.length;for(u(!1,!0),t.length>1&&(w(t.slice(1),\"*\")?_=!0:S(t.slice(1),i)&&(r=!0)),h(t[0]),e=1;e<t.length;e++)u(!1,!0),_?h(\" \"+n(t[e])):r&&t[e].length>a?h(t[e].substring(a)):z.add_token(t[e]);u(!1,!0)}function B(){Q.wanted_newline?u(!1,!0):z.trim(!0),z.space_before_token=!0,h(),u(!1,!0)}function j(){v(),\"TK_RESERVED\"===G&&A(q.last_text)?z.space_before_token=!0:f(\")\"===q.last_text&&te.break_chained_methods),h()}function W(){h(),\"\\n\"===Q.text[Q.text.length-1]&&u()}function X(){for(;q.mode===l.Statement;)m()}var z,F,U,Q,G,$,Z,q,H,J,Y,ee,te,ne=[],_e=\"\";for(ee={TK_START_EXPR:O,TK_END_EXPR:g,TK_START_BLOCK:k,TK_END_BLOCK:D,TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:N,TK_STRING:L,TK_EQUALS:V,TK_OPERATOR:P,TK_COMMA:I,TK_BLOCK_COMMENT:M,TK_COMMENT:B,TK_DOT:j,TK_UNKNOWN:W,TK_EOF:X},r=r?r:{},te={},void 0!==r.braces_on_own_line&&(te.brace_style=r.braces_on_own_line?\"expand\":\"collapse\"),te.brace_style=r.brace_style?r.brace_style:te.brace_style?te.brace_style:\"collapse\",\"expand-strict\"===te.brace_style&&(te.brace_style=\"expand\"),te.indent_size=r.indent_size?parseInt(r.indent_size,10):4,te.indent_char=r.indent_char?r.indent_char:\" \",te.eol=r.eol?r.eol:\"\\n\",te.preserve_newlines=void 0===r.preserve_newlines?!0:r.preserve_newlines,te.break_chained_methods=void 0===r.break_chained_methods?!1:r.break_chained_methods,te.max_preserve_newlines=void 0===r.max_preserve_newlines?0:parseInt(r.max_preserve_newlines,10),te.space_in_paren=void 0===r.space_in_paren?!1:r.space_in_paren,te.space_in_empty_paren=void 0===r.space_in_empty_paren?!1:r.space_in_empty_paren,te.jslint_happy=void 0===r.jslint_happy?!1:r.jslint_happy,te.space_after_anon_function=void 0===r.space_after_anon_function?!1:r.space_after_anon_function,te.keep_array_indentation=void 0===r.keep_array_indentation?!1:r.keep_array_indentation,te.space_before_conditional=void 0===r.space_before_conditional?!0:r.space_before_conditional,te.unescape_strings=void 0===r.unescape_strings?!1:r.unescape_strings,te.wrap_line_length=void 0===r.wrap_line_length?0:parseInt(r.wrap_line_length,10),te.e4x=void 0===r.e4x?!1:r.e4x,te.end_with_newline=void 0===r.end_with_newline?!1:r.end_with_newline,te.comma_first=void 0===r.comma_first?!1:r.comma_first,te.test_output_raw=void 0===r.test_output_raw?!1:r.test_output_raw,te.jslint_happy&&(te.space_after_anon_function=!0),r.indent_with_tabs&&(te.indent_char=\"\t\",te.indent_size=1),te.eol=te.eol.replace(/\\\\r/,\"\\r\").replace(/\\\\n/,\"\\n\"),Z=\"\";te.indent_size>0;)Z+=te.indent_char,te.indent_size-=1;var re=0;if(_&&_.length){for(;\" \"===_.charAt(re)||\"\t\"===_.charAt(re);)_e+=_.charAt(re),re+=1;_=_.substring(re)}G=\"TK_START_BLOCK\",$=\"\",z=new a(Z,_e),z.raw=te.test_output_raw,J=[],R(l.BlockStatement),this.beautify=function(){var e,t;for(U=new s(_,te,Z),ne=U.tokenize(),F=0;e=y();){for(var n=0;n<e.comments_before.length;n++)c(e.comments_before[n]);c(e),$=q.last_text,G=e.type,q.last_text=e.text,F+=1}return t=z.get_code(),te.end_with_newline&&(t+=\"\\n\"),\"\\n\"!=te.eol&&(t=t.replace(/[\\n]/g,te.eol)),t}}function i(e){var t=0,n=-1,_=[],r=!0;this.set_indent=function(_){t=e.baseIndentLength+_*e.indent_length,n=_},this.get_character_count=function(){return t},this.is_empty=function(){return r},this.last=function(){return this._empty?null:_[_.length-1]},this.push=function(e){_.push(e),t+=e.length,r=!1},this.pop=function(){var e=null;return r||(e=_.pop(),t-=e.length,r=0===_.length),e},this.remove_indent=function(){n>0&&(n-=1,t-=e.indent_length)},this.trim=function(){for(;\" \"===this.last();){_.pop();t-=1}r=0===_.length},this.toString=function(){var t=\"\";return this._empty||(n>=0&&(t=e.indent_cache[n]),t+=_.join(\"\")),t}}function a(e,t){t=t||\"\",this.indent_cache=[t],this.baseIndentLength=t.length,this.indent_length=e.length,this.raw=!1;var n=[];this.baseIndentString=t,this.indent_string=e,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new i(this),n.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return n.length},this.add_new_line=function(e){return 1===this.get_line_number()&&this.just_added_newline()?!1:e||!this.just_added_newline()?(this.raw||this.add_outputline(),!0):!1},this.get_code=function(){var e=n.join(\"\\n\").replace(/[\\r\\n\\t ]+$/,\"\");return e},this.set_indent=function(e){if(n.length>1){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(\" \"),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==l.ForInitializer&&e.mode!==l.Conditional)for(var t=e.start_line_index,_=n.length;_>t;)n[t].remove_indent(),t++},this.trim=function(_){for(_=void 0===_?!1:_,this.current_line.trim(e,t);_&&n.length>1&&this.current_line.is_empty();)n.pop(),this.current_line=n[n.length-1],this.current_line.trim();this.previous_line=n.length>1?n[n.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){if(this.just_added_newline()){if(1===n.length)return!0;var e=n[n.length-2];return e.is_empty()}return!1}}function s(n,_,r){function i(e){if(!e.match(v))return null;var t={};w.lastIndex=0;for(var n=w.exec(e);n;)t[n[1]]=n[2],n=w.exec(e);return t}function a(){var r,a=[];if(p=0,h=\"\",R>=K)return[\"\",\"TK_EOF\"];var v;v=T.length?T[T.length-1]:new c(\"TK_START_BLOCK\",\"{\");var w=n.charAt(R);for(R+=1;e(w,l);){if(o.newline.test(w)?(\"\\n\"!==w||\"\\r\"!==n.charAt(R-2))&&(p+=1,a=[]):a.push(w),R>=K)return[\"\",\"TK_EOF\"];w=n.charAt(R),R+=1}if(a.length&&(h=a.join(\"\")),d.test(w)){var y=!0,O=!0,g=d;for(\"0\"===w&&K>R&&/[Xx]/.test(n.charAt(R))?(y=!1,O=!1,w+=n.charAt(R),R+=1,g=f):(w=\"\",R-=1);K>R&&g.test(n.charAt(R));)w+=n.charAt(R),R+=1,y&&K>R&&\".\"===n.charAt(R)&&(w+=n.charAt(R),R+=1,y=!1),O&&K>R&&/[Ee]/.test(n.charAt(R))&&(w+=n.charAt(R),R+=1,K>R&&/[+-]/.test(n.charAt(R))&&(w+=n.charAt(R),R+=1),O=!1,y=!1);return[w,\"TK_WORD\"]}if(o.isIdentifierStart(n.charCodeAt(R-1))){if(K>R)for(;o.isIdentifierChar(n.charCodeAt(R))&&(w+=n.charAt(R),R+=1,R!==K););return\"TK_DOT\"===v.type||\"TK_RESERVED\"===v.type&&e(v.text,[\"set\",\"get\"])||!e(w,x)?[w,\"TK_WORD\"]:\"in\"===w?[w,\"TK_OPERATOR\"]:[w,\"TK_RESERVED\"]}if(\"(\"===w||\"[\"===w)return[w,\"TK_START_EXPR\"];if(\")\"===w||\"]\"===w)return[w,\"TK_END_EXPR\"];if(\"{\"===w)return[w,\"TK_START_BLOCK\"];if(\"}\"===w)return[w,\"TK_END_BLOCK\"];if(\";\"===w)return[w,\"TK_SEMICOLON\"];if(\"/\"===w){var k=\"\";if(\"*\"===n.charAt(R)){R+=1,m.lastIndex=R;var D=m.exec(n);k=\"/*\"+D[0],R+=D[0].length;var C=i(k);return C&&\"start\"===C.ignore&&(S.lastIndex=R,D=S.exec(n),k+=D[0],R+=D[0].length),k=k.replace(o.lineBreak,\"\\n\"),[k,\"TK_BLOCK_COMMENT\",C]}if(\"/\"===n.charAt(R)){R+=1,b.lastIndex=R;var D=b.exec(n);return k=\"//\"+D[0],R+=D[0].length,[k,\"TK_COMMENT\"]}}if(\"`\"===w||\"'\"===w||'\"'===w||(\"/\"===w||_.e4x&&\"<\"===w&&n.slice(R-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{.*?}))*\\s*(\\/?)\\s*>/))&&(\"TK_RESERVED\"===v.type&&e(v.text,[\"return\",\"case\",\"throw\",\"else\",\"do\",\"typeof\",\"yield\"])||\"TK_END_EXPR\"===v.type&&\")\"===v.text&&v.parent&&\"TK_RESERVED\"===v.parent.type&&e(v.parent.text,[\"if\",\"while\",\"for\"])||e(v.type,[\"TK_COMMENT\",\"TK_START_EXPR\",\"TK_START_BLOCK\",\"TK_END_BLOCK\",\"TK_OPERATOR\",\"TK_EQUALS\",\"TK_EOF\",\"TK_SEMICOLON\",\"TK_COMMA\"]))){var N=w,L=!1,V=!1;if(r=w,\"/\"===N)for(var I=!1;K>R&&(L||I||n.charAt(R)!==N)&&!o.newline.test(n.charAt(R));)r+=n.charAt(R),L?L=!1:(L=\"\\\\\"===n.charAt(R),\"[\"===n.charAt(R)?I=!0:\"]\"===n.charAt(R)&&(I=!1)),R+=1;else if(_.e4x&&\"<\"===N){var P=/<(\\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\\[CDATA\\[[\\s\\S]*?\\]\\])(\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{.*?}))*\\s*(\\/?)\\s*>/g,M=n.slice(R-1),B=P.exec(M);if(B&&0===B.index){for(var j=B[2],W=0;B;){var X=!!B[1],z=B[2],F=!!B[B.length-1]||\"![CDATA[\"===z.slice(0,8);if(z!==j||F||(X?--W:++W),0>=W)break;B=P.exec(M)}var U=B?B.index+B[0].length:M.length;return M=M.slice(0,U),R+=U-1,M=M.replace(o.lineBreak,\"\\n\"),[M,\"TK_STRING\"]}}else for(;K>R&&(L||n.charAt(R)!==N&&(\"`\"===N||!o.newline.test(n.charAt(R))));)(L||\"`\"===N)&&o.newline.test(n.charAt(R))?(\"\\r\"===n.charAt(R)&&\"\\n\"===n.charAt(R+1)&&(R+=1),r+=\"\\n\"):r+=n.charAt(R),L?((\"x\"===n.charAt(R)||\"u\"===n.charAt(R))&&(V=!0),L=!1):L=\"\\\\\"===n.charAt(R),R+=1;if(V&&_.unescape_strings&&(r=s(r)),K>R&&n.charAt(R)===N&&(r+=N,R+=1,\"/\"===N))for(;K>R&&o.isIdentifierStart(n.charCodeAt(R));)r+=n.charAt(R),R+=1;return[r,\"TK_STRING\"]}if(\"#\"===w){if(0===T.length&&\"!\"===n.charAt(R)){for(r=w;K>R&&\"\\n\"!==w;)w=n.charAt(R),r+=w,R+=1;return[t(r)+\"\\n\",\"TK_UNKNOWN\"]}var Q=\"#\";if(K>R&&d.test(n.charAt(R))){do w=n.charAt(R),Q+=w,R+=1;while(K>R&&\"#\"!==w&&\"=\"!==w);return\"#\"===w||(\"[\"===n.charAt(R)&&\"]\"===n.charAt(R+1)?(Q+=\"[]\",R+=2):\"{\"===n.charAt(R)&&\"}\"===n.charAt(R+1)&&(Q+=\"{}\",R+=2)),[Q,\"TK_WORD\"]}}if(\"<\"===w&&(\"?\"===n.charAt(R)||\"%\"===n.charAt(R))){A.lastIndex=R-1;var G=A.exec(n);if(G)return w=G[0],R+=w.length-1,w=w.replace(o.lineBreak,\"\\n\"),[w,\"TK_STRING\"]}if(\"<\"===w&&\"<!--\"===n.substring(R-1,R+3)){for(R+=3,w=\"<!--\";!o.newline.test(n.charAt(R))&&K>R;)w+=n.charAt(R),R++;return E=!0,[w,\"TK_COMMENT\"]}if(\"-\"===w&&E&&\"-->\"===n.substring(R-1,R+2))return E=!1,R+=2,[\"-->\",\"TK_COMMENT\"];if(\".\"===w)return[w,\"TK_DOT\"];if(e(w,u)){for(;K>R&&e(w+n.charAt(R),u)&&(w+=n.charAt(R),R+=1,!(R>=K)););return\",\"===w?[w,\"TK_COMMA\"]:\"=\"===w?[w,\"TK_EQUALS\"]:[w,\"TK_OPERATOR\"]}return[w,\"TK_UNKNOWN\"]}function s(e){for(var t,n=!1,_=\"\",r=0,i=\"\",a=0;n||r<e.length;)if(t=e.charAt(r),r++,n){if(n=!1,\"x\"===t)i=e.substr(r,2),r+=2;else{if(\"u\"!==t){_+=\"\\\\\"+t;continue}i=e.substr(r,4),r+=4}if(!i.match(/^[0123456789abcdefABCDEF]+$/))return e;if(a=parseInt(i,16),a>=0&&32>a){_+=\"x\"===t?\"\\\\x\"+i:\"\\\\u\"+i;continue}if(34===a||39===a||92===a)_+=\"\\\\\"+String.fromCharCode(a);else{if(\"x\"===t&&a>126&&255>=a)return e;_+=String.fromCharCode(a)}}else\"\\\\\"===t?n=!0:_+=t;return _}var l=\"\\n\\r\t \".split(\"\"),d=/[0-9]/,f=/[0123456789abcdefABCDEF]/,u=\"+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>\".split(\" \");this.line_starters=\"continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export\".split(\",\");var p,h,E,T,R,K,x=this.line_starters.concat([\"do\",\"in\",\"else\",\"get\",\"set\",\"new\",\"catch\",\"finally\",\"typeof\",\"yield\",\"async\",\"await\"]),m=/([\\s\\S]*?)((?:\\*\\/)|$)/g,b=/([^\\n\\r\\u2028\\u2029]*)/g,v=/\\/\\* beautify( \\w+[:]\\w+)+ \\*\\//g,w=/ (\\w+)[:](\\w+)/g,S=/([\\s\\S]*?)((?:\\/\\*\\sbeautify\\signore:end\\s\\*\\/)|$)/g,A=/((<\\?php|<\\?=)[\\s\\S]*?\\?>)|(<%[\\s\\S]*?%>)/g;this.tokenize=function(){K=n.length,R=0,E=!1,T=[];for(var e,t,_,r=null,i=[],s=[];!t||\"TK_EOF\"!==t.type;){for(_=a(),e=new c(_[1],_[0],p,h);\"TK_COMMENT\"===e.type||\"TK_BLOCK_COMMENT\"===e.type||\"TK_UNKNOWN\"===e.type;)\"TK_BLOCK_COMMENT\"===e.type&&(e.directives=_[2]),s.push(e),_=a(),e=new c(_[1],_[0],p,h);s.length&&(e.comments_before=s,s=[]),\"TK_START_BLOCK\"===e.type||\"TK_START_EXPR\"===e.type?(e.parent=t,i.push(r),r=e):(\"TK_END_BLOCK\"===e.type||\"TK_END_EXPR\"===e.type)&&r&&(\"]\"===e.text&&\"[\"===r.text||\")\"===e.text&&\"(\"===r.text||\"}\"===e.text&&\"{\"===r.text)&&(e.parent=r.parent,r=i.pop()),T.push(e),t=e}return T}}var o={};(function(e){var t=\"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\",n=\"\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\",_=new RegExp(\"[\"+t+\"]\"),r=new RegExp(\"[\"+t+n+\"]\");e.newline=/[\\n\\r\\u2028\\u2029]/,e.lineBreak=/\\r\\n|[\\n\\r\\u2028\\u2029]/g,e.isIdentifierStart=function(e){return 65>e?36===e:91>e?!0:97>e?95===e:123>e?!0:e>=170&&_.test(String.fromCharCode(e))},e.isIdentifierChar=function(e){return 48>e?36===e:58>e?!0:65>e?!1:91>e?!0:97>e?95===e:123>e?!0:e>=170&&r.test(String.fromCharCode(e))}})(o);var l={BlockStatement:\"BlockStatement\",Statement:\"Statement\",ObjectLiteral:\"ObjectLiteral\",ArrayLiteral:\"ArrayLiteral\",ForInitializer:\"ForInitializer\",Conditional:\"Conditional\",Expression:\"Expression\"},c=function(e,t,n,_,r,i){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=n>0,this.whitespace_before=_||\"\",this.parent=null,this.directives=null};\"function\"==typeof define&&define.amd?define([],function(){return{js_beautify:_}}):\"undefined\"!=typeof exports?exports.js_beautify=_:\"undefined\"!=typeof window?window.js_beautify=_:\"undefined\"!=typeof global&&(global.js_beautify=_)})();\n\n // Prism (c) Lea Verou, MIT License\n (function(){var _self=\"undefined\"!=typeof window?window:\"undefined\"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\\blang(?:uage)?-(?!\\*)(\\w+)\\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):\"Array\"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/\\u00a0/g,\" \")},type:function(e){return Object.prototype.toString.call(e).match(/\\[object (\\w+)\\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case\"Object\":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=t.util.clone(e[r]));return a;case\"Array\":return e.map&&e.map(function(e){return t.util.clone(e)})}return e}},languages:{extend:function(e,n){var a=t.util.clone(t.languages[e]);for(var r in n)a[r]=n[r];return a},insertBefore:function(e,n,a,r){r=r||t.languages;var l=r[e];if(2==arguments.length){a=arguments[1];for(var i in a)a.hasOwnProperty(i)&&(l[i]=a[i]);return l}var o={};for(var s in l)if(l.hasOwnProperty(s)){if(s==n)for(var i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);o[s]=l[s]}return t.languages.DFS(t.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,n,a){for(var r in e)e.hasOwnProperty(r)&&(n.call(e,r,e[r],a||r),\"Object\"===t.util.type(e[r])?t.languages.DFS(e[r],n):\"Array\"===t.util.type(e[r])&&t.languages.DFS(e[r],n,r))}},plugins:{},highlightAll:function(e,n){for(var a,r=document.querySelectorAll('code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code'),l=0;a=r[l++];)t.highlightElement(a,e===!0,n)},highlightElement:function(n,a,r){for(var l,i,o=n;o&&!e.test(o.className);)o=o.parentNode;o&&(l=(o.className.match(e)||[,\"\"])[1],i=t.languages[l]),n.className=n.className.replace(e,\"\").replace(/\\s+/g,\" \")+\" language-\"+l,o=n.parentNode,/pre/i.test(o.nodeName)&&(o.className=o.className.replace(e,\"\").replace(/\\s+/g,\" \")+\" language-\"+l);var s=n.textContent,u={element:n,language:l,grammar:i,code:s};if(!s||!i)return t.hooks.run(\"complete\",u),void 0;if(t.hooks.run(\"before-highlight\",u),a&&_self.Worker){var g=new Worker(t.filename);g.onmessage=function(e){u.highlightedCode=e.data,t.hooks.run(\"before-insert\",u),u.element.innerHTML=u.highlightedCode,r&&r.call(u.element),t.hooks.run(\"after-highlight\",u),t.hooks.run(\"complete\",u)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=t.highlight(u.code,u.grammar,u.language),t.hooks.run(\"before-insert\",u),u.element.innerHTML=u.highlightedCode,r&&r.call(n),t.hooks.run(\"after-highlight\",u),t.hooks.run(\"complete\",u)},highlight:function(e,a,r){var l=t.tokenize(e,a);return n.stringify(t.util.encode(l),r)},tokenize:function(e,n){var a=t.Token,r=[e],l=n.rest;if(l){for(var i in l)n[i]=l[i];delete n.rest}e:for(var i in n)if(n.hasOwnProperty(i)&&n[i]){var o=n[i];o=\"Array\"===t.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,f=0,h=u.alias;u=u.pattern||u;for(var p=0;p<r.length;p++){var d=r[p];if(r.length>e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),P=[p,1];b&&P.push(b);var A=new a(i,g?t.tokenize(m,g):m,h);P.push(A),w&&P.push(w),Array.prototype.splice.apply(r,P)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if(\"string\"==typeof e)return e;if(\"Array\"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join(\"\");var l={type:e.type,content:n.stringify(e.content,a,r),tag:\"span\",classes:[\"token\",e.type],attributes:{},language:a,parent:r};if(\"comment\"==l.type&&(l.attributes.spellcheck=\"true\"),e.alias){var i=\"Array\"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}t.hooks.run(\"wrap\",l);var o=\"\";for(var s in l.attributes)o+=(o?\" \":\"\")+s+'=\"'+(l.attributes[s]||\"\")+'\"';return\"<\"+l.tag+' class=\"'+l.classes.join(\" \")+'\" '+o+\">\"+l.content+\"</\"+l.tag+\">\"},!_self.document)return _self.addEventListener?(_self.addEventListener(\"message\",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code,l=n.immediateClose;_self.postMessage(t.highlight(r,t.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName(\"script\");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute(\"data-manual\")&&document.addEventListener(\"DOMContentLoaded\",t.highlightAll)),_self.Prism}();\"undefined\"!=typeof module&&module.exports&&(module.exports=Prism),\"undefined\"!=typeof global&&(global.Prism=Prism);})();\n Prism.languages.clike={comment:[{pattern:/(^|[^\\\\])\\/\\*[\\w\\W]*?\\*\\//,lookbehind:!0},{pattern:/(^|[^\\\\:])\\/\\/.*/,lookbehind:!0}],string:/([\"'])(\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,\"class-name\":{pattern:/((?:\\b(?:class|interface|extends|implements|trait|instanceof|new)\\s+)|(?:catch\\s+\\())[a-z0-9_\\.\\\\]+/i,lookbehind:!0,inside:{punctuation:/(\\.|\\\\)/}},keyword:/\\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\\b/,\"boolean\":/\\b(true|false)\\b/,\"function\":/[a-z0-9_]+(?=\\()/i,number:/\\b-?(?:0x[\\da-f]+|\\d*\\.?\\d+(?:e[+-]?\\d+)?)\\b/i,operator:/--?|\\+\\+?|!=?=?|<=?|>=?|==?=?|&&?|\\|\\|?|\\?|\\*|\\/|~|\\^|%/,punctuation:/[{}[\\];(),.:]/};\n Prism.languages.javascript=Prism.languages.extend(\"clike\",{keyword:/\\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\\b/,number:/\\b-?(0x[\\dA-Fa-f]+|0b[01]+|0o[0-7]+|\\d*\\.?\\d+([Ee][+-]?\\d+)?|NaN|Infinity)\\b/,\"function\":/[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*(?=\\()/i}),Prism.languages.insertBefore(\"javascript\",\"keyword\",{regex:{pattern:/(^|[^/])\\/(?!\\/)(\\[.+?]|\\\\.|[^/\\\\\\r\\n])+\\/[gimyu]{0,5}(?=\\s*($|[\\r\\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore(\"javascript\",\"class-name\",{\"template-string\":{pattern:/`(?:\\\\`|\\\\?[^`])*`/,inside:{interpolation:{pattern:/\\$\\{[^}]+\\}/,inside:{\"interpolation-punctuation\":{pattern:/^\\$\\{|\\}$/,alias:\"punctuation\"},rest:Prism.languages.javascript}},string:/[\\s\\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore(\"markup\",\"tag\",{script:{pattern:/<script[\\w\\W]*?>[\\w\\W]*?<\\/script>/i,inside:{tag:{pattern:/<script[\\w\\W]*?>|<\\/script>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:\"language-javascript\"}}),Prism.languages.js=Prism.languages.javascript;\n\n // Set style\n var style = document.createElement('style');\n style.textContent = 'body,html{padding:0;margin:0;}code[class*=language-],pre[class*=language-]{color:#333;font-size: 13.5px;font-family: Consolas, \"Liberation Mono\", Menlo, Courier, monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;line-height:1.45;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:.5em .75em;margin:0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#333}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#3554FF}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#395CC7}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#BD0054;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#D63680}.token.function{color:#8054C3}.token.important,.token.regex,.token.variable{color:#0B9BCC}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}';\n document.head.innerHTML = '';\n document.head.appendChild(style);\n\n // Fill body\n var textContent = document.body.textContent;\n var beautified = js_beautify(textContent, { end_with_newline: true, indent_size: 2 });\n var highlighted = Prism.highlight(beautified, Prism.languages.javascript);\n document.body.innerHTML = '<code><pre class=\"language-js\">' + highlighted + '</pre></code>';\n }\n\n // Loading state\n document.body.innerHTML = '<div style=\"color: #bbb; -webkit-filter: blur(1px); filter: blur(1px);\">' + document.body.innerHTML + '</div>';\n setTimeout(prettify, 50);\n\n})();"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment