typeReplace,
  Symbol,
  TypedArrayPrototypeIncludes,
} = primordials;

const { Buffer } = require('buffer');
const {
  codes: {
    ERR_FS_EISDIR,
    ERR_FS_INVALID_SYMLINK_TYPE,
    ERR_INVALID_ARG_TYPE,
    ERR_INVALID_ARG_VALUE,
    ERR_OUT_OF_RANGE
  },
  hideStackFrames,
  uvException
} = require('internal/errors');
const {
  isArrayBufferView,
  isUint8Array,
  isDate,
  isBigUint64Array
} = require('internal/util/types');
const { once } = require('internal/util');
const { toPathIfFileURL } = require('internal/url');
const {
  validateAbortSignal,
  validateBoolean,
  validateFunction,
  validateInt32,
  validateInteger,
  validateObject,
  validateUint32,
} = require('internal/validators');
const pathModule = require('path');
const kType = Symbol('type');
const kStats = Symbol('stats');
const assert = require('internal/assert');

const {
  fs: {
    F_OK = 0,
    W_OK = 0,
    R_OK = 0,
    X_OK = 0,
    COPYFILE_EXCL,
    COPYFILE_FICLONE,
    COPYFILE_FICLONE_FORCE,
    O_APPEND,
    O_CREAT,
    O_EXCL,
    O_RDONLY,
    O_RDWR,
    O_SYNC,
    O_TRUNC,
    O_WRONLY,
    S_IFBLK,
    S_IFCHR,
    S_IFDIR,
    S_IFIFO,
    S_IFLNK,
    S_IFMT,
    S_IFREG,
    S_IFSOCK,
    UV_FS_SYMLINK_DIR,
    UV_FS_SYMLINK_JUNCTION,
    UV_DIRENT_UNKNOWN,
    UV_DIRENT_FILE,
    UV_DIRENT_DIR,
    UV_DIRENT_LINK,
    UV_DIRENT_FIFO,
    UV_DIRENT_SOCKET,
    UV_DIRENT_CHAR,
    UV_DIRENT_BLOCK
  },
  os: {
    errno: {
      EISDIR
    }
  }
} = internalBinding('constants');

// The access modes can be any of F_OK, R_OK, W_OK or X_OK. Some might not be
// available on specific systems. They can be used in combination as well
// (F_OK | R_OK | W_OK | X_OK).
const kMinimumAccessMode = MathMin(F_OK, W_OK, R_OK, X_OK);
const kMaximumAccessMode = F_OK | W_OK | R_OK | X_OK;

const kDefaultCopyMode = 0;
// The copy modes can be any of COPYFILE_EXCL, COPYFILE_FICLONE or
// COPYFILE_FICLONE_FORCE. They can be used in combination as well
// (COPYFILE_EXCL | COPYFILE_FICLONE | COPYFILE_FICLONE_FORCE).
const kMinimumCopyMode = MathMin(
  kDefaultCopyMode,
  COPYFILE_EXCL,
  COPYFILE_FICLONE,
  COPYFILE_FICLONE_FORCE
);
const kMaximumCopyMode = COPYFILE_EXCL |
                         COPYFILE_FICLONE |
                         COPYFILE_FICLONE_FORCE;

// Most platforms don't allow reads or writes >= 2 GB.
// See https://github.com/libuv/libuv/pull/1501.
const kIoMaxLength = 2 ** 31 - 1;

// Use 64kb in case the file type is not a regular file and thus do not know the
// actual file size. Increasing the value further results in more frequent over
// allocation for small files and consumes CPU time and memory that should be
// used else wise.
// Use up to 512kb per read otherwise to partition reading big files to prevent
// blocking other threads in case the available threads are all in use.
const kReadFileUnknownBufferLength = 64 * 1024;
const kReadFileBufferLength = 512 * 1024;

const kWriteFileMaxChunkSize = 512 * 1024;

const kMaxUserId = 2 ** 32 - 1;

const isWindows = process.platform === 'win32';

let fs;
function lazyLoadFs() {
  if (!fs) {
    fs = require('original-fs');
  }
  return fs;
}

function assertEncoding(encoding) {
  if (encoding && !Buffer.isEncoding(encoding)) {
    const reason = 'is invalid encoding';
    throw new ERR_INVALID_ARG_VALUE(encoding, 'encoding', reason);
  }
}

class Dirent {
  constructor(name, type) {
    this.name = name;
    this[kType] = type;
  }

  isDirectory() {
    return this[kType] === UV_DIRENT_DIR;
  }

  isFile() {
    return this[kType] === UV_DIRENT_FILE;
  }

  isBlockDevice() {
    return this[kType] === UV_DIRENT_BLOCK;
  }

  isCharacterDevice() {
    return this[kType] === UV_DIRENT_CHAR;
  }

  isSymbolicLink() {
    return this[kType] === UV_DIRENT_LINK;
  }

  isFIFO() {
    return this[kType] === UV_DIRENT_FIFO;
  }

  isSocket() {
    return this[kType] === UV_DIRENT_SOCKET;
  }
}

class DirentFromStats extends Dirent {
  constructor(name, stats) {
    super(name, null);
    this[kStats] = stats;
  }
}

for (const name of ReflectOwnKeys(Dirent.prototype)) {
  if (name === 'constructor') {
    continue;
  }
  DirentFromStats.prototype[name] = function() {
    return this[kStats][name]();
  };
}

function copyObject(source) {
  const target = {};
  for (const key in source)
    target[key] = source[key];
  return target;
}

const bufferSep = Buffer.from(pathModule.sep);

function join(path, name) {
  if ((typeof path === 'string' || isUint8Array(path)) &&
      name === undefined) {
    return path;
  }

  if (typeof path === 'string' && isUint8Array(name)) {
    const pathBuffer = Buffer.from(pathModule.join(path, pathModule.sep));
    return Buffer.concat([pathBuffer, name]);
  }

  if (typeof path === 'string' && typeof name === 'string') {
    return pathModule.join(path, name);
  }

  if (isUint8Array(path) && isUint8Array(name)) {
    return Buffer.concat([path, bufferSep, name]);
  }

  throw new ERR_INVALID_ARG_TYPE(
    'path', ['string', 'Buffer'], path);
}

function getDirents(path, { 0: names, 1: types }, callback) {
  let i;
  if (typeof callback === 'function') {
    const len = names.length;
    let toFinish = 0;
    callback = once(callback);
    for (i = 0; i < len; i++) {
      const type = types[i];
      if (type === UV_DIRENT_UNKNOWN) {
        const name = names[i];
        const idx = i;
        toFinish++;
        let filepath;
        try {
          filepath = join(path, name);
 dText"))}t.default=r}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/common/api/deprecate.ts":
/*!*************************************!*\
  !*** ./lib/common/api/deprecate.ts ***!
  \*************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});let n=null;function warnOnce(t,n){let i=!1;const o=n?`'${t}' is deprecated and will be removed. Please use '${n}' instead.`:`'${t}' is deprecated and will be removed.`;return()=>{i||e.noDeprecation||(i=!0,r.log(o))}}const r={warnOnce:warnOnce,setHandler:e=>{n=e},getHandler:()=>n,warn:(t,n)=>{e.noDeprecation||r.log(`'${t}' is deprecated. Use '${n}' instead.`)},log:t=>{if("function"!=typeof n){if(e.throwDeprecation)throw new Error(t);return e.traceDeprecation?console.trace(t):console.warn(`(electron) ${t}`)}n(t)},removeFunction:(e,t)=>{if(!e)throw Error(`'${t} function' is invalid or does not exist.`);const n=warnOnce(`${e.name} function`);return function(){n(),e.apply(this,arguments)}},renameFunction:(e,t)=>{const n=warnOnce(`${e.name} function`,`${t} function`);return function(){return n(),e.apply(this,arguments)}},moveAPI(e,t,n){const r=warnOnce(t,n);return function(){return r(),e.apply(this,arguments)}},event:(e,t,n)=>{const r=n.startsWith("-")?warnOnce(`${t} event`):warnOnce(`${t} event`,`${n} event`);return e.on(n,(function(...e){0!==this.listenerCount(t)&&(r(),this.emit(t,...e))}))},removeProperty:(e,t,n)=>{const i=Object.getOwnPropertyDescriptor(e.__proto__,t);if(!i)return r.log(`Unable to remove property '${t}' from an object that lacks it.`),e;if(!i.get||!i.set)return r.log(`Unable to remove property '${t}' from an object does not have a getter / setter`),e;const o=warnOnce(t);return Object.defineProperty(e,t,{configurable:!0,get:()=>(o(),i.get.call(e)),set:t=>(n&&!n.includes(t)||o(),i.set.call(e,t))})},renameProperty:(e,t,n)=>{const r=warnOnce(t,n);return t in e&&!(n in e)&&(r(),e[n]=e[t]),Object.defineProperty(e,t,{get:()=>(r(),e[n]),set:t=>{r(),e[n]=t}})}};t.default=r}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/common/api/module-list.ts":
/*!***************************************!*\
  !*** ./lib/common/api/module-list.ts ***!
  \***************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonModuleList=void 0,t.commonModuleList=[{name:"clipboard",loader:()=>n(/*! ./clipboard */"./lib/common/api/clipboard.ts")},{name:"nativeImage",loader:()=>n(/*! ./native-image */"./lib/common/api/native-image.ts")},{name:"shell",loader:()=>n(/*! ./shell */"./lib/common/api/shell.ts")},{name:"deprecate",loader:()=>n(/*! ./deprecate */"./lib/common/api/deprecate.ts"),private:!0}]},"./lib/common/api/native-image.ts":
/*!****************************************!*\
  !*** ./lib/common/api/native-image.ts ***!
  \****************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const{nativeImage:n}=e._linkedBinding("electron_common_native_image");t.default=n}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/common/api/shell.ts":
/*!*********************************!*\
  !*** ./lib/common/api/shell.ts ***!
  \*********************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=e._linkedBinding("electron_common_shell");t.default=n}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/common/define-properties.ts":
/*!*****************************************!*\
  !*** ./lib/common/define-properties.ts ***!
  \*****************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=void 0;const handleESModule=e=>()=>{const t=e();return t.__esModule&&t.default?t.default:t};t.defineProperties=function defineProperties(e,t){const n={};for(const e of t)n[e.name]={enumerable:!e.private,get:handleESModule(e.loader)};return Object.defineProperties(e,n)}},"./lib/common/init.ts":
/*!****************************!*\
  !*** ./lib/common/init.ts ***!
  \****************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});const i=n(/*! util */"util"),o=n(/*! timers */"timers"),wrapWithActivateUvLoop=function(t){return function wrap(e,t){const n=t(e);e[i.promisify.custom]&&(n[i.promisify.custom]=t(e[i.promisify.custom]));return n}(t,(function(t){return function(...n){return e.activateUvLoop(),t.apply(this,n)}}))};if(e.nextTick=wrapWithActivateUvLoop(e.nextTick),r.setImmediate=o.setImmediate=wrapWithActivateUvLoop(o.setImmediate),r.clearImmediate=o.clearImmediate,o.setTimeout=wrapWithActivateUvLoop(o.setTimeout),o.setInterval=wrapWithActivateUvLoop(o.setInterval),"browser"!==e.type&&"utility_process"!==e.type||(r.setTimeout=o.setTimeout,r.setInterval=o.setInterval),"win32"===e.platform){const{Readable:t}=n(/*! stream */"stream"),r=new t;r.push(null),Object.defineProperty(e,"stdin",{configurable:!1,enumerable:!0,get:()=>r})}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts")._global)},"./lib/common/reset-search-paths.ts":
/*!******************************************!*\
  !*** ./lib/common/reset-search-paths.ts ***!
  \******************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){const t=n(/*! module */"module");if("renderer"===e.type){const e=t._load;t._load=function(t){return"vm"===t&&console.warn("The vm module of Node.js is deprecated in the renderer process and will be removed."),e.apply(this,arguments)}}const makeElectronModule=e=>{const r=new t("electron",null);r.id="electron",r.loaded=!0,r.filename=e,Object.defineProperty(r,"exports",{get:()=>n(/*! electron */"./lib/renderer/api/exports/electron.ts")}),t._cache[e]=r};makeElectronModule("electron"),makeElectronModule("electron/common"),"browser"===e.type&&makeElectronModule("electron/main"),"renderer"===e.type&&makeElectronModule("electron/renderer");const r=t._resolveFilename;t._resolveFilename=function(e,t,n,i){return"electron"===e||e.startsWith("electron/")?"electron":r(e,t,n,i)}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/common/web-view-methods.ts":
/*!****************************************!*\
  !*** ./lib/common/web-view-methods.ts ***!
  \****************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncMethods=t.properties=t.syncMethods=void 0,t.syncMethods=new Set(["getURL","getTitle","isLoading","isLoadingMainFrame","isWaitingForResponse","stop","reload","reloadIgnoringCache","canGoBack","canGoForward","canGoToOffset","clearHistory","goBack","goForward","goToIndex","goToOffset","isCrashed","setUserAgent","getUserAgent","openDevTools","closeDevTools","isDevToolsOpened","isDevToolsFocused","inspectElement","setAudioMuted","isAudioMuted","isCurrentlyAudible","undo","redo","cut","copy","paste","pasteAndMatchStyle","delete","selectAll","unselect","replace","replaceMisspelling","findInPage","stopFindInPage","downloadURL","inspectSharedWorker","inspectServiceWorker","showDefinitionForSelection","getZoomFactor","getZoomLevel","setZoomFactor","setZoomLevel"]),t.properties=new Set(["audioMuted","userAgent","zoomLevel","zoomFactor","frameRate"]),t.asyncMethods=new Set(["capturePage","loadURL","executeJavaScript","insertCSS","insertText","removeInsertedCSS","send","sendToFrame","sendInputEvent","setLayoutZoomLevelLimits","setVisualZoomLevelLimits","print","printToPDF"])},"./lib/common/webpack-provider.ts":
/*!****************************************!*\
  !*** ./lib/common/webpack-provider.ts ***!
  \****************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.process=t._global=void 0;const r="undefined"!=typeof globalThis?globalThis.global:(self||window).global;t._global=r;const i=r.process;t.process=i;const o=r.Buffer;t.Buffer=o},"./lib/renderer/api/context-bridge.ts":
/*!********************************************!*\
  !*** ./lib/renderer/api/context-bridge.ts ***!
  \********************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.internalContextBridge=void 0;const n=e._linkedBinding("electron_renderer_context_bridge"),r={exposeInMainWorld:(t,r)=>((()=>{if(!e.contextIsolated)throw new Error("contextBridge API can only be used when contextIsolation is enabled")})(),n.exposeAPIInMainWorld(t,r))};t.default=r,t.internalContextBridge={contextIsolationEnabled:e.contextIsolated,overrideGlobalValueFromIsolatedWorld:(e,t)=>n._overrideGlobalValueFromIsolatedWorld(e,t,!1),overrideGlobalValueWithDynamicPropsFromIsolatedWorld:(e,t)=>n._overrideGlobalValueFromIsolatedWorld(e,t,!0),overrideGlobalPropertyFromIsolatedWorld:(e,t,r)=>n._overrideGlobalPropertyFromIsolatedWorld(e,t,r||null),isInMainWorld:()=>n._isCalledFromMainWorld()},n._isDebug&&(r.internalContextBridge=t.internalContextBridge)}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/api/crash-reporter.ts":
/*!********************************************!*\
  !*** ./lib/renderer/api/crash-reporter.ts ***!
  \********************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=e._linkedBinding("electron_renderer_crash_reporter");t.default={addExtraParameter(e,t){n.addExtraParameter(e,t)},removeExtraParameter(e){n.removeExtraParameter(e)},getParameters:()=>n.getParameters()}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/api/exports/electron.ts":
/*!**********************************************!*\
  !*** ./lib/renderer/api/exports/electron.ts ***!
  \**********************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(/*! @electron/internal/common/define-properties */"./lib/common/define-properties.ts"),i=n(/*! @electron/internal/common/api/module-list */"./lib/common/api/module-list.ts"),o=n(/*! @electron/internal/renderer/api/module-list */"./lib/renderer/api/module-list.ts");e.exports={},(0,r.defineProperties)(e.exports,i.commonModuleList),(0,r.defineProperties)(e.exports,o.rendererModuleList)},"./lib/renderer/api/ipc-renderer.ts":
/*!******************************************!*\
  !*** ./lib/renderer/api/ipc-renderer.ts ***!
  \******************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=n(/*! events */"events"),{ipc:i}=e._linkedBinding("electron_renderer_ipc"),o=new r.EventEmitter;o.send=function(e,...t){return i.send(!1,e,t)},o.sendSync=function(e,...t){return i.sendSync(!1,e,t)},o.sendToHost=function(e,...t){return i.sendToHost(e,t)},o.sendTo=function(e,t,...n){return i.sendTo(e,t,n)},o.invoke=async function(e,...t){const{error:n,result:r}=await i.invoke(!1,e,t);if(n)throw new Error(`Error invoking remote method '${e}': ${n}`);return r},o.postMessage=function(e,t,n){return i.postMessage(e,t,n)},t.default=o}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/api/module-list.ts":
/*!*****************************************!*\
  !*** ./lib/renderer/api/module-list.ts ***!
  \*****************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rendererModuleList=void 0,t.rendererModuleList=[{name:"contextBridge",loader:()=>n(/*! ./context-bridge */"./lib/renderer/api/context-bridge.ts")},{name:"crashReporter",loader:()=>n(/*! ./crash-reporter */"./lib/renderer/api/crash-reporter.ts")},{name:"ipcRenderer",loader:()=>n(/*! ./ipc-renderer */"./lib/renderer/api/ipc-renderer.ts")},{name:"webFrame",loader:()=>n(/*! ./web-frame */"./lib/renderer/api/web-frame.ts")}]},"./lib/renderer/api/web-frame.ts":
/*!***************************************!*\
  !*** ./lib/renderer/api/web-frame.ts ***!
  \***************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const{mainFrame:n}=e._linkedBinding("electron_renderer_web_frame");t.default=n}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/common-init.ts":
/*!*************************************!*\
  !*** ./lib/renderer/common-init.ts ***!
  \*************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});const i=n(/*! electron */"./lib/renderer/api/exports/electron.ts"),o=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts"),{mainFrame:s}=e._linkedBinding("electron_renderer_web_frame"),a=e._linkedBinding("electron_common_v8_util"),c=s.getWebPreference("nodeIntegration"),l=s.getWebPreference("webviewTag"),d=s.getWebPreference("hiddenPage"),u=s.getWebPreference("isWebView"),p=s.getWebPreference("allowNestedWebView");switch(a.setHiddenValue(r,"ipcNative",{onMessage(e,t,n,r,s,a=!1){if(e&&0!==s)return void console.error(`Message ${t} sent by unexpected WebContents (${s})`);const c=e?o.ipcRendererInternal:i.ipcRenderer;c.emit(t,{sender:c,senderId:s,ports:n,isDirectChannel:a},...r)},onMessageSync(e,t,n){i.ipcRenderer.emit(e,n,...t)},onConnectStatus(e,t){i.ipcRenderer.emit("ms-connect-event",{sender:i.ipcRenderer,senderId:e},t)}}),window.location.protocol){case"devtools:":n(/*! @electron/internal/renderer/inspector */"./lib/renderer/inspector.ts");break;case"chrome-extension:":case"chrome:":break;default:{const{windowSetup:e}=n(/*! @electron/internal/renderer/window-setup */"./lib/renderer/window-setup.ts");e(u,d)}}if(e.isMainFrame){const{webViewInit:e}=n(/*! @electron/internal/renderer/web-view/web-view-init */"./lib/renderer/web-view/web-view-init.ts");e(l,u,p)}const{webFrameInit:b}=n(/*! @electron/internal/renderer/web-frame-init */"./lib/renderer/web-frame-init.ts");if(b(),e.isMainFrame){const{securityWarnings:e}=n(/*! @electron/internal/renderer/security-warnings */"./lib/renderer/security-warnings.ts");e(c)}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts")._global)},"./lib/renderer/init.ts":
/*!******************************!*\
  !*** ./lib/renderer/init.ts ***!
  \******************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});const i=Date.now(),o=n(/*! path */"path"),s=n(/*! module */"module");s.wrapper=["(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { ","\n}.call(this, exports, require, module, __filename, __dirname); });"],e.argv.splice(1,1),n(/*! ../common/reset-search-paths */"./lib/common/reset-search-paths.ts"),n(/*! @electron/internal/common/init */"./lib/common/init.ts");const a=e._linkedBinding("electron_common_v8_util");a.markInitStart&&a.markInitStart(i);const{ipcRendererInternal:c}=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts");e.getProcessMemoryInfo=()=>c.invoke("BROWSER_GET_PROCESS_MEMORY_INFO");const{hasSwitch:l,getSwitchValue:d}=e._linkedBinding("electron_common_command_line"),{mainFrame:u}=e._linkedBinding("electron_renderer_web_frame"),p=u.getWebPreference("nodeIntegration"),b=u.getWebPreference("preload"),w=u.getWebPreference("preloadScripts"),m=l("app-path")?d("app-path"):null;if(b&&w.push(b),n(/*! @electron/internal/renderer/common-init */"./lib/renderer/common-init.ts"),p){const{makeRequireFunction:t}=require("internal/modules/cjs/helpers");if(r.module=new s("electron/js2c/renderer_init"),r.require=t(r.module),"file:"===window.location.protocol){const t=window.location;let n=t.pathname;if("win32"===e.platform){"/"===n[0]&&(n=n.substr(1)),t.hostname.length>0&&e.resourcesPath.startsWith("\\")&&(n=`//${t.host}/${n}`)}r.__filename=o.normalize(decodeURIComponent(n)),r.__dirname=o.dirname(r.__filename),r.module.filename=r.__filename,r.module.paths=s._nodeModulePaths(r.__dirname)}else r.__filename=o.join(e.resourcesPath,"electron.asar","renderer","init.js"),r.__dirname=o.join(e.resourcesPath,"electron.asar","renderer"),m&&(r.module.paths=s._nodeModulePaths(m));window.onerror=function(e,t,n,i,o){return r.process.listenerCount("uncaughtException")>0&&(r.process.emit("uncaughtException",o),!0)}}else e.contextIsolated||e.once("loaded",(function(){delete r.process,delete r.Buffer,delete r.setImmediate,delete r.clearImmediate,delete r.global,delete r.root,delete r.GLOBAL}));a.markInitFinish&&a.markInitFinish(Date.now());for(const e of w)try{s._load(e)}catch(t){console.error(`Unable to load preload script: ${e}`),console.error(t),c.send("BROWSER_PRELOAD_ERROR",e,t)}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts")._global)},"./lib/renderer/inspector.ts":
/*!***********************************!*\
  !*** ./lib/renderer/inspector.ts ***!
  \***********************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(/*! @electron/internal/renderer/api/context-bridge */"./lib/renderer/api/context-bridge.ts"),i=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts"),o=n(/*! @electron/internal/renderer/ipc-renderer-internal-utils */"./lib/renderer/ipc-renderer-internal-utils.ts"),s=n(/*! electron/renderer */"./lib/renderer/api/exports/electron.ts"),{contextIsolationEnabled:a}=r.internalContextBridge;window.onload=function(){a?r.internalContextBridge.overrideGlobalValueFromIsolatedWorld(["InspectorFrontendHost","showContextMenuAtPoint"],createMenu):window.InspectorFrontendHost.showContextMenuAtPoint=createMenu},window.confirm=function(e,t){return o.invokeSync("INSPECTOR_CONFIRM",e,t)};const createMenu=function(e,t,n){const r=function(e,t,n){return 0===n.length&&document.elementsFromPoint(e,t).some(e=>"INPUT"===e.nodeName||"TEXTAREA"===e.nodeName||e.isContentEditable)}(e,t,n);i.ipcRendererInternal.invoke("INSPECTOR_CONTEXT_MENU",n,r).then(e=>{"number"==typeof e&&s.webFrame.executeJavaScript(`window.DevToolsAPI.contextMenuItemSelected(${JSON.stringify(e)})`),s.webFrame.executeJavaScript("window.DevToolsAPI.contextMenuCleared()")})}},"./lib/renderer/ipc-renderer-internal-utils.ts":
/*!*****************************************************!*\
  !*** ./lib/renderer/ipc-renderer-internal-utils.ts ***!
  \*****************************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invokeSync=t.handle=void 0;const r=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts");t.handle=function(e,t){r.ipcRendererInternal.on(e,async(n,r,...i)=>{const o=`${e}_RESPONSE_${r}`;try{n.sender.send(o,null,await t(n,...i))}catch(e){n.sender.send(o,e)}})},t.invokeSync=function invokeSync(e,...t){const[n,i]=r.ipcRendererInternal.sendSync(e,...t);if(n)throw n;return i}},"./lib/renderer/ipc-renderer-internal.ts":
/*!***********************************************!*\
  !*** ./lib/renderer/ipc-renderer-internal.ts ***!
  \***********************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.ipcRendererInternal=void 0;const r=n(/*! events */"events"),{ipc:i}=e._linkedBinding("electron_renderer_ipc");t.ipcRendererInternal=new r.EventEmitter,t.ipcRendererInternal.send=function(e,...t){return i.send(!0,e,t)},t.ipcRendererInternal.sendSync=function(e,...t){return i.sendSync(!0,e,t)},t.ipcRendererInternal.invoke=async function(e,...t){const{error:n,result:r}=await i.invoke(!0,e,t);if(n)throw new Error(`Error invoking remote method '${e}': ${n}`);return r}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/security-warnings.ts":
/*!*******************************************!*\
  !*** ./lib/renderer/security-warnings.ts ***!
  \*******************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.securityWarnings=void 0;const r=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts"),{mainFrame:i}=e._linkedBinding("electron_renderer_web_frame");let o=null;const{platform:s,execPath:a,env:c}=e,l="\nFor more information and help, consult\nhttps://electronjs.org/docs/tutorial/security.\nThis warning will not show up\nonce the app is packaged.",warnAboutNodeWithRemoteContent=function(e){if(!(!e||window&&window.location&&"localhost"===window.location.hostname)&&function(){if(window&&window.location&&window.location.protocol)return/^(http|ftp)s?/gi.test(window.location.protocol)}()){const e=`This renderer process has Node.js integration enabled\n    and attempted to load remote content from '${window.location}'. This\n    exposes users of this app to severe security risks.\n${l}`;console.warn("%cElectron Security Warning (Node.js Integration with Remote Content)","font-weight: bold;",e)}},warnAboutInsecureCSP=function(){if(!i._isEvalAllowed())return;const e=`This renderer process has either no Content Security\n  Policy set or a policy with "unsafe-eval" enabled. This exposes users of\n  this app to unnecessary security risks.\n${l}`;console.warn("%cElectron Security Warning (Insecure Content-Security-Policy)","font-weight: bold;",e)},logSecurityWarnings=function(e,t){warnAboutNodeWithRemoteContent(t),function(e){if(!e||!1!==e.webSecurity)return;const t=`This renderer process has "webSecurity" disabled. This\n  exposes users of this app to severe security risks.\n${l}`;console.warn("%cElectron Security Warning (Disabled webSecurity)","font-weight: bold;",t)}(e),function(){if(!window||!window.performance||!window.performance.getEntriesByType)return;const e=window.performance.getEntriesByType("resource").filter(({name:e})=>{return t=new URL(e),["http:","ftp:"].includes(t.protocol)&&!(e=>["localhost","127.0.0.1","[::1]",""].includes(e.hostname))(t);var t}).map(({name:e})=>`- ${e}`).join("\n");if(!e||0===e.length)return;const t=`This renderer process loads resources using insecure\n  protocols. This exposes users of this app to unnecessary security risks.\n  Consider loading the following resources over HTTPS or FTPS. \n${e}\n  \n${l}`;console.warn("%cElectron Security Warning (Insecure Resources)","font-weight: bold;",t)}(),function(e){if(!e||!e.allowRunningInsecureContent)return;const t=`This renderer process has "allowRunningInsecureContent"\n  enabled. This exposes users of this app to severe security risks.\n\n  ${l}`;console.warn("%cElectron Security Warning (allowRunningInsecureContent)","font-weight: bold;",t)}(e),function(e){if(!e||!e.experimentalFeatures)return;const t=`This renderer process has "experimentalFeatures" enabled.\n  This exposes users of this app to some security risk. If you do not need\n  this feature, you should disable it.\n${l}`;console.warn("%cElectron Security Warning (experimentalFeatures)","font-weight: bold;",t)}(e),function(e){if(!e||!Object.prototype.hasOwnProperty.call(e,"enableBlinkFeatures")||null!=e.enableBlinkFeatures&&0===e.enableBlinkFeatures.length)return;const t=`This renderer process has additional "enableBlinkFeatures"\n  enabled. This exposes users of this app to some security risk. If you do not\n  need this feature, you should disable it.\n${l}`;console.warn("%cElectron Security Warning (enableBlinkFeatures)","font-weight: bold;",t)}(e),warnAboutInsecureCSP(),function(){if(document&&document.querySelectorAll){const e=document.querySelectorAll("[allowpopups]");if(!e||0===e.length)return;const t=`A <webview> has "allowpopups" set to true. This exposes\n    users of this app to some security risk, since popups are just\n    BrowserWindows. If you do not need this feature, you should disable it.\n\n    ${l}`;console.warn("%cElectron Security Warning (allowpopups)","font-weight: bold;",t)}}()};t.securityWarnings=function securityWarnings(e){window.addEventListener("load",(async function(){if(function(){if(null!==o)return o;switch(s){case"darwin":o=a.endsWith("MacOS/Electron")||a.includes("Electron.app/Contents/Frameworks/");break;case"freebsd":case"linux":o=a.endsWith("/electron");break;case"win32":o=a.endsWith("\\electron.exe");break;default:o=!1}return(c&&c.ELECTRON_DISABLE_SECURITY_WARNINGS||window&&window.ELECTRON_DISABLE_SECURITY_WARNINGS)&&(o=!1),(c&&c.ELECTRON_ENABLE_SECURITY_WARNINGS||window&&window.ELECTRON_ENABLE_SECURITY_WARNINGS)&&(o=!0),o}()){const t=await async function(){try{return r.ipcRendererInternal.invoke("BROWSER_GET_LAST_WEB_PREFERENCES")}catch(e){console.warn(`getLastWebPreferences() failed: ${e}`)}}();logSecurityWarnings(t,e)}}),{once:!0})}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/web-frame-init.ts":
/*!****************************************!*\
  !*** ./lib/renderer/web-frame-init.ts ***!
  \****************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.webFrameInit=void 0;const r=n(/*! electron */"./lib/renderer/api/exports/electron.ts"),i=n(/*! @electron/internal/renderer/ipc-renderer-internal-utils */"./lib/renderer/ipc-renderer-internal-utils.ts");t.webFrameInit=()=>{i.handle("RENDERER_WEB_FRAME_METHOD",(e,t,...n)=>r.webFrame[t](...n))}},"./lib/renderer/web-view/guest-view-internal.ts":
/*!******************************************************!*\
  !*** ./lib/renderer/web-view/guest-view-internal.ts ***!
  \******************************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.propertySet=t.propertyGet=t.invokeSync=t.invoke=t.detachGuest=t.createGuest=t.deregisterEvents=t.registerEvents=void 0;const r=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts"),i=n(/*! @electron/internal/renderer/ipc-renderer-internal-utils */"./lib/renderer/ipc-renderer-internal-utils.ts"),{mainFrame:o}=e._linkedBinding("electron_renderer_web_frame"),s={"page-title-updated":"page-title-set"};t.registerEvents=function registerEvents(e,t){r.ipcRendererInternal.on(`GUEST_VIEW_INTERNAL_DESTROY_GUEST-${e}`,(function(){t.reset(),t.dispatchEvent("destroyed",{})})),r.ipcRendererInternal.on(`GUEST_VIEW_INTERNAL_DISPATCH_EVENT-${e}`,(function(e,n,r){null!=s[n]&&t.dispatchEvent(s[n],r),t.dispatchEvent(n,r)}))},t.deregisterEvents=function deregisterEvents(e){r.ipcRendererInternal.removeAllListeners(`GUEST_VIEW_INTERNAL_DESTROY_GUEST-${e}`),r.ipcRendererInternal.removeAllListeners(`GUEST_VIEW_INTERNAL_DISPATCH_EVENT-${e}`)},t.createGuest=function createGuest(e,t,n){if(!(e instanceof HTMLIFrameElement))throw new Error("Invalid embedder frame");const i=o.getWebFrameId(e.contentWindow);if(i<0)throw new Error("Invalid embedder frame");return r.ipcRendererInternal.invoke("GUEST_VIEW_MANAGER_CREATE_AND_ATTACH_GUEST",i,t,n)},t.detachGuest=function detachGuest(e){return i.invokeSync("GUEST_VIEW_MANAGER_DETACH_GUEST",e)},t.invoke=function invoke(e,t,n){return r.ipcRendererInternal.invoke("GUEST_VIEW_MANAGER_CALL",e,t,n)},t.invokeSync=function invokeSync(e,t,n){return i.invokeSync("GUEST_VIEW_MANAGER_CALL",e,t,n)},t.propertyGet=function propertyGet(e,t){return i.invokeSync("GUEST_VIEW_MANAGER_PROPERTY_GET",e,t)},t.propertySet=function propertySet(e,t,n){return i.invokeSync("GUEST_VIEW_MANAGER_PROPERTY_SET",e,t,n)}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/web-view/web-view-attributes.ts":
/*!******************************************************!*\
  !*** ./lib/renderer/web-view/web-view-attributes.ts ***!
  \******************************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupWebViewAttributes=t.SrcAttribute=t.PartitionAttribute=t.WebViewAttribute=void 0;const resolveURL=function(e){return e?new URL(e,location.href).href:""};class WebViewAttribute{constructor(e,t){this.name=e,this.webViewImpl=t,this.ignoreMutation=!1,this.handleMutation=()=>{},this.name=e,this.value=t.webviewNode[e]||"",this.webViewImpl=t,this.defineProperty()}getValue(){return this.webViewImpl.webviewNode.getAttribute(this.name)||this.value}setValue(e){this.webViewImpl.webviewNode.setAttribute(this.name,e||"")}setValueIgnoreMutation(e){this.ignoreMutation=!0,this.setValue(e),this.ignoreMutation=!1}defineProperty(){return Object.defineProperty(this.webViewImpl.webviewNode,this.name,{get:()=>this.getValue(),set:e=>this.setValue(e),enumerable:!0})}}t.WebViewAttribute=WebViewAttribute;class BooleanAttribute extends WebViewAttribute{getValue(){return this.webViewImpl.webviewNode.hasAttribute(this.name)}setValue(e){e?this.webViewImpl.webviewNode.setAttribute(this.name,""):this.webViewImpl.webviewNode.removeAttribute(this.name)}}class PartitionAttribute extends WebViewAttribute{constructor(e){super("partition",e),this.webViewImpl=e,this.validPartitionId=!0,this.handleMutation=(e,t)=>{if(t=t||"",!this.webViewImpl.beforeFirstNavigation)return console.error("The object has already navigated, so its partition cannot be changed."),void this.setValueIgnoreMutation(e);"persist:"===t&&(this.validPartitionId=!1,console.error("Invalid partition attribute."))}}}t.PartitionAttribute=PartitionAttribute;class SrcAttribute extends WebViewAttribute{constructor(e){super("src",e),this.webViewImpl=e,this.handleMutation=(e,t)=>{t||!e?this.parse():this.setValueIgnoreMutation(e)},this.setupMutationObserver()}getValue(){return this.webViewImpl.webviewNode.hasAttribute(this.name)?resolveURL(this.webViewImpl.webviewNode.getAttribute(this.name)):this.value}setValueIgnoreMutation(e){super.setValueIgnoreMutation(e),this.observer.takeRecords()}setupMutationObserver(){this.observer=new MutationObserver(e=>{for(const t of e){const{oldValue:e}=t,n=this.getValue();if(e!==n)return;this.handleMutation(e,n)}});const e={attributes:!0,attributeOldValue:!0,attributeFilter:[this.name]};this.observer.observe(this.webViewImpl.webviewNode,e)}parse(){if(!this.webViewImpl.elementAttached||!this.webViewImpl.attributes.get("partition").validPartitionId||!this.getValue())return;if(null==this.webViewImpl.guestInstanceId)return void(this.webViewImpl.beforeFirstNavigation&&(this.webViewImpl.beforeFirstNavigation=!1,this.webViewImpl.createGuest()));const e={},t=this.webViewImpl.attributes.get("httpreferrer").getValue();t&&(e.httpReferrer=t);const n=this.webViewImpl.attributes.get("useragent").getValue();n&&(e.userAgent=n),this.webViewImpl.webviewNode.loadURL(this.getValue(),e)}}t.SrcAttribute=SrcAttribute;class HttpReferrerAttribute extends WebViewAttribute{constructor(e){super("httpreferrer",e)}}class UserAgentAttribute extends WebViewAttribute{constructor(e){super("useragent",e)}}class PreloadAttribute extends WebViewAttribute{constructor(e){super("preload",e)}getValue(){if(!this.webViewImpl.webviewNode.hasAttribute(this.name))return this.value;let e=resolveURL(this.webViewImpl.webviewNode.getAttribute(this.name));return"file:"!==e.substr(0,5)&&(console.error('Only "file:" protocol is supported in "preload" attribute.'),e=""),e}}class BlinkFeaturesAttribute extends WebViewAttribute{constructor(e){super("blinkfeatures",e)}}class DisableBlinkFeaturesAttribute extends WebViewAttribute{constructor(e){super("disableblinkfeatures",e)}}class WebPreferencesAttribute extends WebViewAttribute{constructor(e){super("webpreferences",e)}}t.setupWebViewAttributes=function setupWebViewAttributes(e){return new Map([["partition",new PartitionAttribute(e)],["src",new SrcAttribute(e)],["httpreferrer",new HttpReferrerAttribute(e)],["useragent",new UserAgentAttribute(e)],["nodeintegration",new BooleanAttribute("nodeintegration",e)],["nodeintegrationinsubframes",new BooleanAttribute("nodeintegrationinsubframes",e)],["plugins",new BooleanAttribute("plugins",e)],["disablewebsecurity",new BooleanAttribute("disablewebsecurity",e)],["allowpopups",new BooleanAttribute("allowpopups",e)],["preload",new PreloadAttribute(e)],["blinkfeatures",new BlinkFeaturesAttribute(e)],["disableblinkfeatures",new DisableBlinkFeaturesAttribute(e)],["webpreferences",new WebPreferencesAttribute(e)]])}},"./lib/renderer/web-view/web-view-element.ts":
/*!***************************************************!*\
  !*** ./lib/renderer/web-view/web-view-element.ts ***!
  \***************************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupWebView=void 0;const r=n(/*! @electron/internal/renderer/web-view/web-view-impl */"./lib/renderer/web-view/web-view-impl.ts"),i=new WeakMap,defineWebViewElement=e=>class WebViewElement extends HTMLElement{static get observedAttributes(){return["partition","src","httpreferrer","useragent","nodeintegration","nodeintegrationinsubframes","plugins","disablewebsecurity","allowpopups","preload","blinkfeatures","disableblinkfeatures","webpreferences"]}constructor(){super(),i.set(this,new r.WebViewImpl(this,e))}getWebContentsId(){const e=i.get(this);if(!e||!e.guestInstanceId)throw new Error("The WebView must be attached to the DOM and the dom-ready event emitted before this method can be called.");return e.guestInstanceId}connectedCallback(){const t=i.get(this);t&&(t.elementAttached||(e.guestViewInternal.registerEvents(t.viewInstanceId,{dispatchEvent:t.dispatchEvent.bind(t),reset:t.reset.bind(t)}),t.elementAttached=!0,t.attributes.get("src").parse()))}attributeChangedCallback(e,t,n){const r=i.get(this);r&&r.handleWebviewAttributeMutation(e,t,n)}disconnectedCallback(){const t=i.get(this);t&&(e.guestViewInternal.deregisterEvents(t.viewInstanceId),t.guestInstanceId&&e.guestViewInternal.detachGuest(t.guestInstanceId),t.elementAttached=!1,t.reset())}};t.setupWebView=e=>{const listener=t=>{"loading"!==document.readyState&&((e=>{const t=defineWebViewElement(e);(0,r.setupMethods)(t,e),e.allowGuestViewElementDefinition(window,()=>{window.customElements.define("webview",t),window.WebView=t,delete t.prototype.connectedCallback,delete t.prototype.disconnectedCallback,delete t.prototype.attributeChangedCallback,delete t.observedAttributes})})(e),window.removeEventListener(t.type,listener,!0))};window.addEventListener("readystatechange",listener,!0)}},"./lib/renderer/web-view/web-view-impl.ts":
/*!************************************************!*\
  !*** ./lib/renderer/web-view/web-view-impl.ts ***!
  \************************************************/
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupMethods=t.WebViewImpl=void 0;const r=n(/*! @electron/internal/common/web-view-methods */"./lib/common/web-view-methods.ts"),i=n(/*! @electron/internal/renderer/web-view/web-view-attributes */"./lib/renderer/web-view/web-view-attributes.ts");let o=0;const getNextId=function(){return++o};t.WebViewImpl=class WebViewImpl{constructor(e,t){this.webviewNode=e,this.hooks=t,this.beforeFirstNavigation=!0,this.elementAttached=!1,this.hasFocus=!1,this.on={},this.internalElement=this.createInternalElement();const n=this.webviewNode.attachShadow({mode:"open"}),r=n.ownerDocument.createElement("style");r.textContent=":host { display: flex; }",n.appendChild(r),this.attributes=(0,i.setupWebViewAttributes)(this),this.viewInstanceId=getNextId(),n.appendChild(this.internalElement),Object.defineProperty(this.webviewNode,"contentWindow",{get:()=>this.internalElement.contentWindow,enumerable:!0})}createInternalElement(){const e=document.createElement("iframe");return e.style.flex="1 1 auto",e.style.width="100%",e.style.border="0",this.hooks.setIsWebView(e),e}reset(){this.guestInstanceId&&(this.guestInstanceId=void 0),this.beforeFirstNavigation=!0,this.attributes.get("partition").validPartitionId=!0;const e=this.createInternalElement(),t=this.internalElement;this.internalElement=e,t&&t.parentNode&&t.parentNode.replaceChild(e,t)}handleWebviewAttributeMutation(e,t,n){this.attributes.has(e)&&!this.attributes.get(e).ignoreMutation&&this.attributes.get(e).handleMutation(t,n)}onElementResize(){const e={newWidth:this.webviewNode.clientWidth,newHeight:this.webviewNode.clientHeight};this.dispatchEvent("resize",e)}createGuest(){this.internalInstanceId=getNextId(),this.hooks.guestViewInternal.createGuest(this.internalElement,this.internalInstanceId,this.buildParams()).then(e=>{this.attachGuestInstance(e)})}dispatchEvent(e,t={}){const n=new Event(e);Object.assign(n,t),this.webviewNode.dispatchEvent(n),"load-commit"===e?this.onLoadCommit(t):"-focus-change"===e&&this.onFocusChange()}setupEventProperty(e){const t=`on${e.toLowerCase()}`;return Object.defineProperty(this.webviewNode,t,{get:()=>this.on[t],set:n=>{if(this.on[t]&&this.webviewNode.removeEventListener(e,this.on[t]),this.on[t]=n,n)return this.webviewNode.addEventListener(e,n)},enumerable:!0})}onLoadCommit(e){const t=this.webviewNode.getAttribute("src"),n=e.url;e.isMainFrame&&t!==n&&this.attributes.get("src").setValueIgnoreMutation(n)}onFocusChange(){const e=this.webviewNode.ownerDocument.activeElement===this.webviewNode;e!==this.hasFocus&&(this.hasFocus=e,this.dispatchEvent(e?"focus":"blur"))}onAttach(e){return this.attributes.get("partition").setValue(e)}buildParams(){const e={instanceId:this.viewInstanceId};for(const[t,n]of this.attributes)e[t]=n.getValue();return e}attachGuestInstance(e){-1!==e&&(this.elementAttached?(this.guestInstanceId=e,this.resizeObserver=new ResizeObserver(this.onElementResize.bind(this)),this.resizeObserver.observe(this.internalElement)):this.hooks.guestViewInternal.detachGuest(e))}};t.setupMethods=(e,t)=>{e.prototype.focus=function(){this.contentWindow.focus()};for(const n of r.syncMethods)e.prototype[n]=function(...e){return t.guestViewInternal.invokeSync(this.getWebContentsId(),n,e)};for(const n of r.asyncMethods)e.prototype[n]=function(...e){return t.guestViewInternal.invoke(this.getWebContentsId(),n,e)};const createPropertyGetter=function(e){return function(){return t.guestViewInternal.propertyGet(this.getWebContentsId(),e)}},createPropertySetter=function(e){return function(n){return t.guestViewInternal.propertySet(this.getWebContentsId(),e,n)}};for(const t of r.properties)Object.defineProperty(e.prototype,t,{get:createPropertyGetter(t),set:createPropertySetter(t)})}},"./lib/renderer/web-view/web-view-init.ts":
/*!************************************************!*\
  !*** ./lib/renderer/web-view/web-view-init.ts ***!
  \************************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.webViewInit=void 0;const r=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts"),i=e._linkedBinding("electron_common_v8_util"),{mainFrame:o}=e._linkedBinding("electron_renderer_web_frame");t.webViewInit=function webViewInit(t,s,a){if(t&&(!s||a)){const t=n(/*! @electron/internal/renderer/web-view/guest-view-internal */"./lib/renderer/web-view/guest-view-internal.ts");if(e.contextIsolated)i.setHiddenValue(window,"guestViewInternal",t);else{const{setupWebView:e}=n(/*! @electron/internal/renderer/web-view/web-view-element */"./lib/renderer/web-view/web-view-element.ts");e({guestViewInternal:t,allowGuestViewElementDefinition:o.allowGuestViewElementDefinition,setIsWebView:e=>i.setHiddenValue(e,"isWebView",!0)})}}s&&function handleFocusBlur(){window.addEventListener("focus",()=>{r.ipcRendererInternal.send("GUEST_VIEW_MANAGER_FOCUS_CHANGE",!0)}),window.addEventListener("blur",()=>{r.ipcRendererInternal.send("GUEST_VIEW_MANAGER_FOCUS_CHANGE",!1)})}()}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},"./lib/renderer/window-setup.ts":
/*!**************************************!*\
  !*** ./lib/renderer/window-setup.ts ***!
  \**************************************/
/*! no static exports found */function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.windowSetup=void 0;const r=n(/*! @electron/internal/renderer/ipc-renderer-internal */"./lib/renderer/ipc-renderer-internal.ts"),i=n(/*! @electron/internal/renderer/api/context-bridge */"./lib/renderer/api/context-bridge.ts"),{contextIsolationEnabled:o}=i.internalContextBridge;t.windowSetup=(t,n)=>{if(e.sandboxed||t||(window.close=function(){r.ipcRendererInternal.send("BROWSER_WINDOW_CLOSE")},o&&i.internalContextBridge.overrideGlobalValueFromIsolatedWorld(["close"],window.close)),window.prompt=function(){throw new Error("prompt() is and will not be supported.")},o&&i.internalContextBridge.overrideGlobalValueFromIsolatedWorld(["prompt"],window.prompt),t){let e=n?"hidden":"visible";r.ipcRendererInternal.on("GUEST_INSTANCE_VISIBILITY_CHANGE",(function(t,n){e!==n&&(e=n,document.dispatchEvent(new Event("visibilitychange")))}));const getDocumentHidden=()=>"visible"!==e;Object.defineProperty(document,"hidden",{get:getDocumentHidden}),o&&i.internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(["document","hidden"],getDocumentHidden);const getDocumentVisibilityState=()=>e;Object.defineProperty(document,"visibilityState",{get:getDocumentVisibilityState}),o&&i.internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(["document","visibilityState"],getDocumentVisibilityState)}}}).call(this,n(/*! @electron/internal/common/webpack-provider */"./lib/common/webpack-provider.ts").process)},events:
/*!*************************!*\
  !*** external "events" ***!
  \*************************/
/*! no static exports found */function(e,t){e.exports=require("events")},module:
/*!*************************!*\
  !*** external "module" ***!
  \*************************/
/*! no static exports found */function(e,t){e.exports=require("module")},path:
/*!***********************!*\
  !*** external "path" ***!
  \***********************/
/*! no static exports found */function(e,t){e.exports=require("path")},stream:
/*!*************************!*\
  !*** external "stream" ***!
  \*************************/
/*! no static exports found */function(e,t){e.exports=require("stream")},timers:
/*!*************************!*\
  !*** external "timers" ***!
  \*************************/
/*! no static exports found */function(e,t){e.exports=require("timers")},util:
/*!***********************!*\
  !*** external "util" ***!
  \***********************/
/*! no static exports found */function(e,t){e.exports=require("util")}})}(globalThis.process||binding.process).argv.includes("--profile-electron-init")?setTimeout(___electron_webpack_init__,0):___electron_webpack_init__()}catch(e){console.error("Electron renderer_init.js script failed to run"),console.error(e)}electron/js2c/renderer_init