1(()=>{"use strict";const e={},t={web:"web",webView:"webView",app:"app"};let n=null,o=null,r=null,s=null;function i(e,t){if(!t||"function"!=typeof t)return e();e().then(e=>t(e))}function a(e,t="",n){const o=y(n.type),r=o.isApp||o.isWebView?n.mobileSchemeUrl:window.location.origin,s=t.replace(/^\/+/,""),i=new URL(e,r);return new URL(s,i).toString()}async function c(e,...t){const n=y(e.type);if(n.isApp||n.isWebView){const e=t[0];if("string"==typeof e&&e.includes(".json")){const t=Object.prototype.hasOwnProperty.call(jsonMap,e);return l({body:t?jsonMap[e]:null,ok:t,status:t?200:404,statusText:t?"OK":"Not Found",url:e})}}return fetch(...t)}function l({body:e,ok:t=!0,status:n=200,statusText:o="OK",url:r=""}){return{ok:t,status:n,statusText:o,url:r,redirected:!1,type:"basic",async json(){if(!t)throw new SyntaxError("Unexpected end of JSON input");return e},text:async()=>JSON.stringify(e),blob:async()=>new Blob([JSON.stringify(e)],{type:"application/json"}),arrayBuffer:async()=>(new TextEncoder).encode(JSON.stringify(e)).buffer,clone:()=>l({body:e,ok:t,status:n,statusText:o,url:r}),headers:new Headers({"content-type":"application/json"})}}function u(){return{id:o,index:0,windowId:r,active:!0,highlighted:!0,pinned:!1,incognito:!1,selected:!0,audible:!1,discarded:!1,autoDiscardable:!0,mutedInfo:{muted:!1},width:window.innerWidth,height:window.innerHeight,url:window.location.href,title:document.title,favIconUrl:document.querySelector('link[rel~="icon"]')?.href||void 0,status:"complete"}}function d(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function p(e={},t={}){const n={...e};for(const[e,o]of Object.entries(t)){const t=n[e];void 0!==o&&(d(o)&&d(t)?n[e]=p(t,o):Array.isArray(o)?n[e]=o.slice():n[e]=o)}return n}function f(){const e=1e9;return Math.floor(1e9*Math.random())+e}function y(e){const n={isWeb:!1,isWebView:!1,isApp:!1};switch(e){case t.web:n.isWeb=!0;break;case t.webView:n.isWebView=!0;break;case t.app:n.isApp=!0}return n}function g(t){const n=t.i18n.baseURL||t.baseURL,o=window.navigator.language?.split("-")[0]||"en",r={};e.i18n={detectLanguage:(e,n)=>i(async()=>{const n={isReliable:!1,languages:[]};try{if(s||(t.i18n.detectLanguage.tinyld?s=t.i18n.detectLanguage.tinyld:t.i18n.detectLanguage.tinyldPath&&(s=await import(t.i18n.detectLanguage.tinyldPath))),!s)return console.warn("tinyld not found!"),n;if("object"!=typeof s)return console.warn("tinyld is not an object!"),n;if("function"!=typeof s.detectAll)return console.warn("detectAll is not a function"),n;const o=s.detectAll(e),r=function(e,t={}){const n=[];if(!Array.isArray(e))return{valid:!1,errors:["Value is not an array."]};if(0===e.length)return{valid:!0,errors:[]};return e.forEach((e,o)=>{null===e||"object"!=typeof e||Array.isArray(e)?n.push(`Item at index ${o} is not an object.`):(Object.prototype.hasOwnProperty.call(e,"lang")?"string"!=typeof e.lang?n.push(`'lang' at index ${o} is not a string.`):""===e.lang.trim()&&n.push(`'lang' at index ${o} is an empty string.`):n.push(`Item at index ${o} is missing 'lang' property.`),Object.prototype.hasOwnProperty.call(e,"accuracy")?"number"!=typeof e.accuracy||Number.isNaN(e.accuracy)?n.push(`'accuracy' at index ${o} is not a valid number.`):("number"==typeof t.accuracyMin&&e.accuracy<t.accuracyMin&&n.push(`'accuracy' at index ${o} is less than minimum ${t.accuracyMin}.`),"number"==typeof t.accuracyMax&&e.accuracy>t.accuracyMax&&n.push(`'accuracy' at index ${o} is greater than maximum ${t.accuracyMax}.`)):n.push(`Item at index ${o} is missing 'accuracy' property.`))}),{valid:0===n.length,errors:n}}(o,{accuracyMin:0,accuracyMax:1});if(!r.valid){for(const e of r.errors)console.warn(e);return n}return n.languages=o.map(e=>({language:e.lang.trim(),percentage:Number((100*e.accuracy).toFixed(2))})),n}catch(e){return console.error(e),n}},n),getAcceptLanguages:e=>i(async()=>navigator.languages||[navigator.language],e),getMessage:(e,s,l)=>i(async()=>{if(!r[o]){if(!await async function(e){const o=a(n,`/_locales/${e}/messages.json`,t);try{const n=await c(t,o);if(!n.ok)throw new Error(`Failed to load messages: ${o}`);const s=await n.json();return r[e]=s,s}catch(e){return console.warn(`[i18n] Could not load ${o}`,e),null}}(o))return""}const i=r[o],l=i?.[e];if(!l)return"";let u=l.message||"";
1if(s){(Array.isArray(s)?s:[s]).forEach((e,t)=>{u=u.replace(new RegExp(`\\$${t+1}`,"g"),e)})}return u},l)}}function w(t){const n=e=>Array.isArray(e)?e:e?[e]:[],o=e=>new Set(e||[]);e.permissions={contains:async(t,r)=>i(async()=>{if(!t)return!1;const r=o(n(t.permissions)),s=o([...n(t.origins),...n(t.host_permissions)]);if(0===r.size&&0===s.size)return!1;let i=new Set,a=new Set;const c=e.runtime.getManifest(),l=[...(c.permissions||[]).filter(e=>!e.includes("://")),...(c.optional_permissions||[]).filter(e=>!e.includes("://"))],u=[...c.host_permissions||[],...c.optional_host_permissions||[],...(c.permissions||[]).filter(e=>e.includes("://")||"<all_urls>"===e),...(c.optional_permissions||[]).filter(e=>e.includes("://")||"<all_urls>"===e)];i=o(l),a=o(u);const d=[...r].every(e=>i.has(e)),p=((e,t)=>{if(!t||0===t.size)return!0;const n=new Set(e),o=n.has("<all_urls>")||n.has("*://*/*")||n.has("http://*/*")&&n.has("https://*/*");return[...t].every(e=>{if("<all_urls>"===e)return o||n.has("<all_urls>");if(n.has(e))return!0;if(o)return!0;const t=/^(\*|https?|file|ftp|wss?|chrome-extension):\/\/([^/]+)\/\*$/.exec(e);if(t){const e=t[1];if(n.has(`${e}://*/*`)||n.has("*://*/*"))return!0}return!1})})(a,s);return d&&p},r)}}function m(){return{id:"web-polyfill",origin:window.location.origin,url:window.location.href,tab:u()}}function h(e){const t=new Set,n="d9355375-2621-4b28-afd1-0d49bf78434b",o="request",r="response",s=new Map;function a(t){e.appAndWebViewMessagingConfig.postMessageFunc({detail:{__webExtensionPolyfill:!0,channel:n,target:"chrome.runtime",...t}})}return e.appAndWebViewMessagingConfig.listenerFunc(e.appAndWebViewMessagingConfig.listenerName,async i=>{const c=function(t){const n=y(e.type);return n.isWebView||n.isApp?t.detail:null}(i);if(function(e){return!(!e||"object"!=typeof e||!0!==e.__webExtensionPolyfill||e.channel!==n||"chrome.runtime"!==e.target)}(c)){if(c.direction===o){const e=await async function(e){if(0===t.size)return;const n=m(),o=[];for(const r of t){const t=await new Promise(t=>{let o=!1;const s=e=>{o||(o=!0,t(e))};try{const i=r(e,n,s);if(!0===i)return;if(i instanceof Promise)return void i.then(e=>{o||(o=!0,t(e))}).catch(e=>{o||(o=!0,t({__runtimeError:!0,message:e instanceof Error?e.message:String(e)}))});o||(o=!0,t(i))}catch(e){o||(o=!0,t({__runtimeError:!0,message:e instanceof Error?e.message:String(e)}))}});void 0!==t&&o.push(t)}return o[0]}(c.message);return void a({direction:r,requestId:c.requestId,response:e})}if(c.direction===r){const e=s.get(c.requestId);if(!e)return;s.delete(c.requestId),e.resolve(c.response)}}}),{sendMessage:(e,t)=>i(()=>new Promise(t=>{const n=window.crypto?.randomUUID?window.crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`;s.set(n,{resolve:t}),a({direction:o,requestId:n,message:e}),window.setTimeout(()=>{const e=s.get(n);e&&(s.delete(n),e.resolve(void 0))},9e4)}),t),onMessage:{addListener(e){t.add(e)},removeListener(e){t.delete(e)},hasListener:e=>t.has(e)}}}function b(e){const{url:t="about:blank"}=e;window.open(t,"_blank");return{...u(),id:f(),url:t,favIconUrl:void 0}}function v(e){const t=u(),n=[];return n.push(t),n}function L(e){u().id===e&&window.location.reload()}function x(e){const t=u();(t.id===e||e instanceof Array&&e.includes(t.id))&&window.close()}function I(e,t){const n=u();if(n.id===e)return t.url&&(window.location.href=t.url),t.title&&(document.title=t.title),n}async function A(t,n=null){return new Promise((o,r)=>{try{e.runtime.sendMessage({type:t,data:n},e=>{try{e&&e.status?"success"===e.status?o(e.data):"error"===e.status?r(e.message):r("Unknown status!"):r(`Invalid response from the extension event listener! Type: ${t}`)}catch(e){r(e)}})}catch(e){r(e)}})}function S(t,n){e.runtime.onMessage.addListener((e,o,r)=>{if(e.type===t)return new Promise(async t=>{try{t(function(e=null,t=null){return{status:"success",data:e,message:t}}(await n(e.data)))}catch(e){t(function(e,t=null){return{status:"error",error:t,message:e}}(e.message))}}).then(r),!0})}function M(e){y(e.type).isWebView&&(S("to-tab/polyfill/create-tab",e=>b(e.createProperties)),S("to-tab/polyfill/query-tab",e=>(e.queryInfo,v())),S("to-tab/polyfill/reload-tab",e=>L(e.tabId)),S("to-tab/polyfill/remove-tabs",e=>x(e.tabIds)),S("to-tab/polyfill/update-tab",e=>I(e.tabId,e.updateProperties)))}function U(t){const o=t.runtime.baseURL||t.baseURL;let r=null,s=new Set;const l=y(t.type),u=l.isWeb?"__proxy_extensions_installed__":"__app_extensions_installed__",p=function(){const e=new Set;
1return{sendMessage:(t,n)=>i(async()=>{if(0===e.size)return;const n=[],o=m();let r=!1;for(const s of e){let e=!1;const i=await new Promise(n=>{const i=s(t,o,t=>{e=!0,n(t)});!0===i?r=!0:i instanceof Promise?i.then(n):e||n(i)});void 0!==i&&n.push(i)}return n[0]},n),onMessage:{addListener(t){e.add(t)},removeListener(t){e.delete(t)},hasListener:t=>e.has(t)}}}(),f=l.isWeb?null:h(t);e.runtime={getContexts:(e={},n)=>i(async()=>{if(null==e||"object"!=typeof e||Array.isArray(e))return[];const n=["POPUP"],o=Object.prototype.hasOwnProperty.call(e,"contextTypes");if(o&&!Array.isArray(e.contextTypes))return[];if(!(o?e.contextTypes:n).filter(e=>n.includes(e)).includes("POPUP"))return[];if(!t.runtime.popupSelector)return[];return document.querySelector(t.runtime.popupSelector)?[{contextType:"POPUP",documentUrl:window.location.href}]:[]},n),getManifest:()=>n,getPlatformInfo:e=>i(async()=>{const e=navigator.userAgent.toLowerCase();let t="linux";/mac os x|macintosh/.test(e)?(t="mac",/iphone|ipad|ipod/.test(e)&&(t="ios")):/iphone|ipad|ipod/.test(e)?t="ios":/windows nt/.test(e)?t="win":/android/.test(e)?t="android":/cros/.test(e)?t="cros":/openbsd/.test(e)?t="openbsd":/fuchsia/.test(e)?t="fuchsia":/linux/.test(e)&&(t="linux");let n="x86-64";return/armv7|armv6l/.test(e)?n="arm":/arm64|aarch64/.test(e)?n="arm64":/x86_64|win64|amd64/.test(e)?n="x86-64":/i686|i386/.test(e)?n="x86-32":/mips64/.test(e)?n="mips64":/mips/.test(e)?n="mips":/riscv64/.test(e)&&(n="riscv64"),{os:t,arch:n,nacl_arch:n}},e),getURL(e){if("string"!=typeof e)throw new TypeError("Error in invocation of runtime.getURL(string path): No matching signature.");return a(o,e,t)},loadResource:(...e)=>c(t,...e),sendMessage(e,t){if(l.isWeb)return p.sendMessage(e,t);if(l.isWebView)return f.sendMessage(e,t);if(l.isApp){const n=function(e){const t={toTab:!1,toPopup:!1,toBg:!1};return d(e)&&"string"==typeof e.type?e.type.startsWith("to-tab/")?(t.toTab=!0,t):e.type.startsWith("to-popup/")?(t.toPopup=!0,t):(e.type.startsWith("to-bg/"),t.toBg=!0,t):t}(e);return n.toTab?f.sendMessage(e,t):p.sendMessage(e,t)}},setUninstallURL:(e,t)=>i(async()=>{if(r&&(window.removeEventListener("beforeunload",r),r=null),!e)return;let t;try{t=new URL(e,window.location.href)}catch(t){throw new Error(`Invalid URL passed to setUninstallURL: ${e}`)}const n=t.toString();r=function(){try{window.open(n,"_blank")}catch(e){console.warn("[setUninstallURL] Failed to open uninstallURL",e)}},window.addEventListener("beforeunload",r)},t),triggerOnInstalledEvent(){const t=window.localStorage.getItem(u)?e.runtime.OnInstalledReason.UPDATE:e.runtime.OnInstalledReason.INSTALL;window.localStorage.setItem(u,"true");const n={reason:t};for(const e of s)try{e(n)}catch(e){console.error("onInstalled listener error:",e)}},onInstalled:{addListener(e){s.add(e)},removeListener(e){s.delete(e)},hasListener:e=>s.has(e)},onMessage:{addListener(e){l.isWeb&&p.onMessage.addListener(e),l.isWebView&&f.onMessage.addListener(e),l.isApp&&(p.onMessage.addListener(e),f.onMessage.addListener(e))},removeListener(e){l.isWeb&&p.onMessage.removeListener(e),l.isWebView&&f.onMessage.removeListener(e),l.isApp&&(p.onMessage.removeListener(e),f.onMessage.removeListener(e))},hasListener:e=>l.isWeb?p.onMessage.hasListener(e):l.isWebView?f.onMessage.hasListener(e):l.isApp?p.onMessage.hasListener(e)||f.onMessage.hasListener(e):void 0},OnInstalledReason:{INSTALL:"install",UPDATE:"update",BROWSER_UPDATE:"browser_update",CHROME_UPDATE:"chrome_update",SHARED_MODULE_UPDATE:"shared_module_update"}}}async function E(e){const t=e.runtime.baseURL||e.baseURL;await async function(e,t){if(n)return n;const o=a(e,"manifest.json",t),r=await c(t,o);if(!r.ok)throw new Error("Failed to load manifest.json");return n=await r.json(),n}(t,e)}window.createChromePolyfill=function(n){if(Object.prototype.hasOwnProperty.call(n,"type")&&(s=n.type,!Object.values(t).some(e=>e===s)))throw new Error("Polyfill type is invalid!");var s;const a=p({baseURL:"/",type:t.web,mobileSchemeUrl:void 0,action:{create:!0},extension:{create:!0,inIncognitoContext:!1},i18n:{create:!0,baseURL:void 0,detectLanguage:{tinyld:null,tinyldPath:null}},identity:{create:!0,redirectURL:void 0},management:{create:!0},permissions:{create:!0},runtime:{create:!0,baseURL:void 0,popupSelector:void 0},storage:{create:!0},tabs:{create:!0}},n);return y(a.type).isWeb?(o=f(),r=f(),a.storage.prefix||(a.storage.prefix="proxy-extension/")):(o=1,r=1,a.storage.prefix||(a.storage.prefix="app-extension/")),a.action.create&&function(t){let n=new Set;e.action={openPopup:(e,n)=>i(async()=>{const e=y(t.type).isWeb?"polyfill-to-proxy/open-popup-event":"polyfill-to-app/open-popup-event";document.dispatchEvent(new CustomEvent(e))},n),setIcon:(e,t)=>i(async()=>{const{path:t,imageData:n,tabId:o,windowId:r}=e;void 0===o&&void 0===r||console.warn("[setIcon] tabId/windowId are ignored in web context");let s=null;if(n){const e=e=>{const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t.toDataURL()};n instanceof ImageData?s=e(n):"object"==typeof n&&(s=e(n[Object.keys(n).map(Number).sort((e,t)=>
1t-e)[0]]))}if(!s&&t)if("string"==typeof t)s=t;else if("object"==typeof t){const e=Object.keys(t).map(Number).sort((e,t)=>t-e);for(const n of e)if(t[n]){s=t[n];break}!s&&Object.values(t).length&&(s=Object.values(t)[0])}if(!s)throw new Error("No valid icon path or imageData provided");document.querySelectorAll('link[rel~="icon"]').forEach(e=>e.remove());const i=document.createElement("link");i.rel="icon",i.href=s,document.head.appendChild(i);const a=document.createElement("img");return a.style.width="32p",a.style.height="32p",a.style.borderRadius="50%",{mockedExtensionIcon:{details:{imageData:n,path:t,tabId:o,windowId:r},iconUrl:s,favicon:i,previewImg:a}}},t),onClicked:{addListener(e){n.add(e)},removeListener(e){n.delete(e)},hasListener:e=>n.has(e)}}}(a),a.extension.create&&function(t){const n=t.extension?.inIncognitoContext||!1;e.extension={inIncognitoContext:n}}(a),a.i18n.create&&g(a),a.identity.create&&function(t){const n=t.identity.redirectURL;e.identity={getRedirectURL:(e="")=>new URL(e,n).toString(),launchWebAuthFlow:({url:e,interactive:t=!0},o)=>i(async()=>new Promise((o,r)=>{t||console.warn("[launchWebAuthFlow] interactive is ignored in web context");let s=!1,i=null,a=null;const c=window.open(e,"_blank","width=500,height=600");if(!c)return console.error("Popup blocked"),void u();function l(e){if(e.origin===window.location.origin&&e.source===c&&e.data&&"string"==typeof e.data)try{const t=new URL(e.data);t.href.startsWith(n)&&u(t.href)}catch(e){console.error(e)}}function u(e=null){if(!s){s=!0,i&&clearInterval(i),a&&clearTimeout(a),window.removeEventListener("message",l);try{c&&c.close()}catch(e){console.error(e)}o(e)}}window.addEventListener("message",l),a=window.setTimeout(()=>{u(),console.error("Auth flow timed out")},12e4),i=window.setInterval(()=>{c.closed&&(u(),console.error("The user did not approve access"))},1e3)}),o)}}(a),a.management.create&&(e.management={uninstallSelf:(e={},t)=>i(async()=>{window.close()},t)}),a.permissions.create&&w(),a.runtime.create&&U(a),a.storage.create&&function(t){const n=new Set,o=t.storage.prefix;function r(e){return"string"==typeof e&&e.startsWith(o)}function s(){return Object.keys(window.localStorage).filter(r)}function a(e,t="local"){0!==Object.keys(e).length&&n.forEach(n=>{try{n(e,t)}catch(e){console.error("Error in chromePolyfill.storage.onChanged listener:",e)}})}e.storage={local:{clear:e=>i(async()=>{const e={};s().forEach(t=>{const n=JSON.parse(window.localStorage.getItem(t));window.localStorage.removeItem(t);const r=t.slice(o.length);e[r]={oldValue:n,newValue:void 0}}),a(e)},e),get:(e,t)=>i(async()=>{const t={},n=s();return e?(Array.isArray(e)?e:"object"==typeof e?Object.keys(e):[e]).forEach(e=>{const n=e.startsWith(o)?e:o+e;null!==window.localStorage.getItem(n)?t[e]=JSON.parse(window.localStorage.getItem(n)):t[e]=void 0}):n.forEach(e=>{const n=window.localStorage.getItem(e);t[e.slice(o.length)]=n?JSON.parse(n):void 0}),t},t),remove:(e,t)=>i(async()=>{const t={};(Array.isArray(e)?e:[e]).forEach(e=>{const n=e.startsWith(o)?e:o+e,r=window.localStorage.getItem(n);if(null!==r){const o=JSON.parse(r);window.localStorage.removeItem(n),t[e]={oldValue:o,newValue:void 0}}}),a(t)},t),set:(e,t)=>i(async()=>{const t={};Object.entries(e).forEach(([e,n])=>{const r=e.startsWith(o)?e:o+e,s=window.localStorage.getItem(r),i=null!==s?JSON.parse(s):void 0;JSON.stringify(i)===JSON.stringify(n)||(window.localStorage.setItem(r,JSON.stringify(n)),t[e]={oldValue:i,newValue:n})}),a(t)},t)},onChanged:{addListener(e){n.add(e)},removeListener(e){n.delete(e)},hasListener:e=>n.has(e)}}}(a),a.tabs.create&&function(t){const n=y(t.type);e.tabs={create:(e,t)=>i(async()=>n.isApp?A("to-tab/polyfill/create-tab",{createProperties:e}):b(e),t),query:(e,t)=>i(async()=>n.isApp?A("to-tab/polyfill/query-tab",{queryInfo:e}):v(),t),reload(e,t,o){let r=o;return"function"==typeof t&&(r=t),i(async()=>{n.isApp?await A("to-tab/polyfill/reload-tab",{tabId:e}):L(e)},r)},remove:(e,t)=>i(async()=>{n.isApp?await A("to-tab/polyfill/remove-tabs",{tabIds:e}):x(e)},t),sendMessage:(t,n,o)=>u().id===t?e.runtime.sendMessage(n,o):i(async()=>{},o),update:(e,t,o)=>i(async()=>n.isApp?A("to-tab/polyfill/update-tab",{tabId:e,updateProperties:t}):I(e,t),o)}}
1(a),M(a),{chromePolyfill:e,chromePolyfillLoader:E(a)}}})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.