!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/invoice_pdf/node_modules/chromium-bidi/lib/iife/   drwxr-xr-x
Free 13.05 GB of 57.97 GB (22.51%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     mapperTab.js (268 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
var mapperTab=function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var a=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),a}var a={},r={},n={},s={};var o=Object.freeze({__proto__:null,default:function(e){return{all:e=e||new Map,on:function(t,a){var r=e.get(t);r?r.push(a):e.set(t,[a])},off:function(t,a){var r=e.get(t);r&&(a?r.splice(r.indexOf(a)>>>0,1):e.set(t,[]))},emit:function(t,a){var r=e.get(t);r&&r.slice().map((function(e){e(a)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,a)}))}}}}),i=t(o),c=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.EventEmitter=void 0;const d=c(i);s.EventEmitter=class{#e=(0,d.default)();on(e,t){return this.#e.on(e,t),this}once(e,t){const a=r=>{t(r),this.off(e,a)};return this.on(e,a)}off(e,t){return this.#e.off(e,t),this}emit(e,t){this.#e.emit(e,t)}removeAllListeners(e){return e?this.#e.all.delete(e):this.#e.all.clear(),this}};var u,l={};Object.defineProperty(l,"__esModule",{value:!0}),l.LogType=void 0,function(e){e.bidi="bidi",e.cdp="cdp",e.debug="debug",e.debugError="debug:error",e.debugInfo="debug:info"}(u||(l.LogType=u={}));var h={};Object.defineProperty(h,"__esModule",{value:!0}),h.ProcessingQueue=void 0;const p=l;class m{static LOGGER_PREFIX=`${p.LogType.debug}:queue`;#t;#a;#r=[];#n=!1;constructor(e,t){this.#a=e,this.#t=t}add(e,t){this.#r.push([e,t]),this.#s()}async#s(){if(!this.#n){for(this.#n=!0;this.#r.length>0;){const e=this.#r.shift();if(!e)continue;const[t,a]=e;this.#t?.(m.LOGGER_PREFIX,"Processing event:",a),await t.then((e=>{if("error"!==e.kind)return this.#a(e.value);this.#t?.(p.LogType.debugError,"Event threw before sending:",e.error.message,e.error.stack)})).catch((e=>{this.#t?.(p.LogType.debugError,"Event was not processed:",e?.message)}))}this.#n=!1}}}h.ProcessingQueue=m;var f={},g={},y={};Object.defineProperty(y,"__esModule",{value:!0});var S,v,w,C,b,x={};Object.defineProperty(x,"__esModule",{value:!0}),x.EVENT_NAMES=x.Network=x.BrowsingContext=x.Log=x.Script=x.BiDiModule=void 0,function(e){e.Browser="browser",e.BrowsingContext="browsingContext",e.Cdp="cdp",e.Input="input",e.Log="log",e.Network="network",e.Script="script",e.Session="session"}(S||(x.BiDiModule=S={})),function(e){var t;(t=e.EventNames||(e.EventNames={})).Message="script.message",t.RealmCreated="script.realmCreated",t.RealmDestroyed="script.realmDestroyed"}(v||(x.Script=v={})),function(e){(e.EventNames||(e.EventNames={})).LogEntryAdded="log.entryAdded"}(w||(x.Log=w={})),function(e){var t;(t=e.EventNames||(e.EventNames={})).ContextCreated="browsingContext.contextCreated",t.ContextDestroyed="browsingContext.contextDestroyed",t.DomContentLoaded="browsingContext.domContentLoaded",t.DownloadWillBegin="browsingContext.downloadWillBegin",t.FragmentNavigated="browsingContext.fragmentNavigated",t.Load="browsingContext.load",t.NavigationAborted="browsingContext.navigationAborted",t.NavigationFailed="browsingContext.navigationFailed",t.NavigationStarted="browsingContext.navigationStarted",t.UserPromptClosed="browsingContext.userPromptClosed",t.UserPromptOpened="browsingContext.userPromptOpened"}(C||(x.BrowsingContext=C={})),function(e){var t;(t=e.EventNames||(e.EventNames={})).AuthRequired="network.authRequired",t.BeforeRequestSent="network.beforeRequestSent",t.FetchError="network.fetchError",t.ResponseCompleted="network.responseCompleted",t.ResponseStarted="network.responseStarted"}(b||(x.Network=b={})),x.EVENT_NAMES=new Set([...Object.values(S),...Object.values(C.EventNames),...Object.values(w.EventNames),...Object.values(b.EventNames),...Object.values(v.EventNames)]);var P={};Object.defineProperty(P,"__esModule",{value:!0});var I={};Object.defineProperty(I,"__esModule",{value:!0}),I.UnderspecifiedStoragePartitionException=I.UnableToSetFileInputException=I.UnableToSetCookieException=I.NoSuchStoragePartitionException=I.UnsupportedOperationException=I.UnableToCloseBrowserException=I.UnableToCaptureScreenException=I.UnknownErrorException=I.UnknownCommandException=I.SessionNotCreatedException=I.NoSuchUserContextException=I.NoSuchScriptException=I.NoSuchRequestException=I.NoSuchNodeException=I.NoSuchInterceptException=I.NoSuchHistoryEntryException=I.NoSuchHandleException=I.NoSuchFrameException=I.NoSuchElementException=I.NoSuchAlertException=I.MoveTargetOutOfBoundsException=I.InvalidSessionIdException=I.InvalidArgumentException=I.Exception=void 0;class k{error;message;stacktrace;constructor(e,t,a){this.error=e,this.message=t,this.stacktrace=a}toErrorResponse(e){return{type:"error",id:e,error:this.error,message:this.message,stacktrace:this.stacktrace}}}I.Exception=k;I.InvalidArgumentException=class extends k{constructor(e,t){super("invalid argument",e,t)}};I.InvalidSessionIdException=class extends k{constructor(e,t){super("invalid session id",e,t)}};I.MoveTargetOutOfBoundsException=class extends k{constructor(e,t){super("move target out of bounds",e,t)}};I.NoSuchAlertException=class extends k{constructor(e,t){super("no such alert",e,t)}};I.NoSuchElementException=class extends k{constructor(e,t){super("no such element",e,t)}};I.NoSuchFrameException=class extends k{constructor(e,t){super("no such frame",e,t)}};I.NoSuchHandleException=class extends k{constructor(e,t){super("no such handle",e,t)}};I.NoSuchHistoryEntryException=class extends k{constructor(e,t){super("no such history entry",e,t)}};I.NoSuchInterceptException=class extends k{constructor(e,t){super("no such intercept",e,t)}};I.NoSuchNodeException=class extends k{constructor(e,t){super("no such node",e,t)}};I.NoSuchRequestException=class extends k{constructor(e,t){super("no such request",e,t)}};I.NoSuchScriptException=class extends k{constructor(e,t){super("no such script",e,t)}};I.NoSuchUserContextException=class extends k{constructor(e,t){super("no such user context",e,t)}};I.SessionNotCreatedException=class extends k{constructor(e,t){super("session not created",e,t)}};I.UnknownCommandException=class extends k{constructor(e,t){super("unknown command",e,t)}};I.UnknownErrorException=class extends k{constructor(e,t=(new Error).stack){super("unknown error",e,t)}};I.UnableToCaptureScreenException=class extends k{constructor(e,t){super("unable to capture screen",e,t)}};I.UnableToCloseBrowserException=class extends k{constructor(e,t){super("unable to close browser",e,t)}};I.UnsupportedOperationException=class extends k{constructor(e,t){super("unsupported operation",e,t)}};I.NoSuchStoragePartitionException=class extends k{constructor(e,t){super("no such storage partition",e,t)}};I.UnableToSetCookieException=class extends k{constructor(e,t){super("unable to set cookie",e,t)}};I.UnableToSetFileInputException=class extends k{constructor(e,t){super("unable to set file input",e,t)}};I.UnderspecifiedStoragePartitionException=class extends k{constructor(e,t){super("underspecified storage partition",e,t)}};var R={};Object.defineProperty(R,"__esModule",{value:!0}),function(t){var a=e&&e.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return r(t,e),t},s=e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.ChromiumBidi=t.Cdp=void 0,t.Cdp=n(y),t.ChromiumBidi=n(x),s(P,t),s(I,t),s(R,t)}(g);var E={};Object.defineProperty(E,"__esModule",{value:!0}),E.BidiNoOpParser=void 0;E.BidiNoOpParser=class{parseActivateParams(e){return e}parseCaptureScreenshotParams(e){return e}parseCloseParams(e){return e}parseCreateParams(e){return e}parseGetTreeParams(e){return e}parseHandleUserPromptParams(e){return e}parseNavigateParams(e){return e}parsePrintParams(e){return e}parseReloadParams(e){return e}parseSetViewportParams(e){return e}parseTraverseHistoryParams(e){return e}parseGetSessionParams(e){return e}parseSendCommandParams(e){return e}parseAddPreloadScriptParams(e){return e}parseCallFunctionParams(e){return e}parseDisownParams(e){return e}parseEvaluateParams(e){return e}parseGetRealmsParams(e){return e}parseRemovePreloadScriptParams(e){return e}parsePerformActionsParams(e){return e}parseReleaseActionsParams(e){return e}parseSetFilesParams(e){return e}parseAddInterceptParams(e){return e}parseContinueRequestParams(e){return e}parseContinueResponseParams(e){return e}parseContinueWithAuthParams(e){return e}parseFailRequestParams(e){return e}parseProvideResponseParams(e){return e}parseRemoveInterceptParams(e){return e}parseSetPermissionsParams(e){return e}parseSubscribeParams(e){return e}parseDeleteCookiesParams(e){return e}parseGetCookiesParams(e){return e}parseSetCookieParams(e){return e}};var _={};Object.defineProperty(_,"__esModule",{value:!0}),_.BrowserProcessor=void 0;const T=g;_.BrowserProcessor=class{#o;constructor(e){this.#o=e}close(){return setTimeout((()=>this.#o.sendCommand("Browser.close")),0),{}}async createUserContext(e){const t={proxyServer:e["goog:proxyServer"]??void 0},a=e["goog:proxyBypassList"]??void 0;a&&(t.proxyBypassList=a.join(","));return{userContext:(await this.#o.sendCommand("Target.createBrowserContext",t)).browserContextId}}async removeUserContext(e){if("default"===e)throw new T.InvalidArgumentException("`default` user context cannot be removed");try{await this.#o.sendCommand("Target.disposeBrowserContext",{browserContextId:e})}catch(e){if(e.message.startsWith("Failed to find context with id"))throw new T.NoSuchUserContextException(e.message);throw e}return{}}async getUserContexts(){return{userContexts:[{userContext:"default"},...(await this.#o.sendCommand("Target.getBrowserContexts")).browserContextIds.map((e=>({userContext:e})))]}}};var N={};Object.defineProperty(N,"__esModule",{value:!0}),N.CdpProcessor=void 0;N.CdpProcessor=class{#i;#c;#o;constructor(e,t,a){this.#i=e,this.#c=t,this.#o=a}getSession(e){const t=e.context,a=this.#i.getContext(t).cdpTarget.cdpSessionId;return void 0===a?{}:{session:a}}async sendCommand(e){const t=e.session?this.#c.getCdpClient(e.session):this.#o;return{result:await t.sendCommand(e.method,e.params),session:e.session}}};var j={},O={},M={},B={};Object.defineProperty(B,"__esModule",{value:!0}),B.uuidv4=void 0,B.uuidv4=function(){if("crypto"in globalThis&&"randomUUID"in globalThis.crypto)return globalThis.crypto.randomUUID();const e=new Uint8Array(16);"crypto"in globalThis&&"getRandomValues"in globalThis.crypto?globalThis.crypto.getRandomValues(e):require("crypto").webcrypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=e=>e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),"");return[t(e.subarray(0,4)),t(e.subarray(4,6)),t(e.subarray(6,8)),t(e.subarray(8,10)),t(e.subarray(10,16))].join("-")};var A={};Object.defineProperty(A,"__esModule",{value:!0}),A.ChannelProxy=void 0;const D=g,z=l,L=B;class Z{#d;#u=(0,L.uuidv4)();#t;constructor(e,t){this.#d=e,this.#t=t}async init(e,t){const a=await Z.#l(e),r=await Z.#h(e,a);return this.#p(e,a,t),r}async startListenerFromWindow(e,t){try{const a=await this.#m(e);this.#p(e,a,t)}catch(e){this.#t?.(z.LogType.debugError,e)}}static#f(){return`(${String((()=>{const e=[];let t=null;return{async getMessage(){const a=e.length>0?Promise.resolve():new Promise((e=>{t=e}));return await a,e.shift()},sendMessage(a){e.push(a),null!==t&&(t(),t=null)}}}))})()`}static async#l(e){const t=await e.cdpClient.sendCommand("Runtime.evaluate",{expression:this.#f(),contextId:e.executionContextId,serializationOptions:{serialization:"idOnly"}});if(t.exceptionDetails||void 0===t.result.objectId)throw new Error("Cannot create channel");return t.result.objectId}static async#h(e,t){return(await e.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String((e=>e.sendMessage)),arguments:[{objectId:t}],executionContextId:e.executionContextId,serializationOptions:{serialization:"idOnly"}})).result.objectId}async#p(e,t,a){for(;;)try{const r=await e.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String((async e=>await e.getMessage())),arguments:[{objectId:t}],awaitPromise:!0,executionContextId:e.executionContextId,serializationOptions:{serialization:"deep",maxDepth:this.#d.serializationOptions?.maxObjectDepth??void 0}});if(r.exceptionDetails)throw r.exceptionDetails;for(const t of e.associatedBrowsingContexts)a.registerEvent({type:"event",method:D.ChromiumBidi.Script.EventNames.Message,params:{channel:this.#d.channel,data:e.cdpToBidiValue(r,this.#d.ownership??"none"),source:e.source}},t.id)}catch(e){this.#t?.(z.LogType.debugError,e);break}}async#m(e){const t=await e.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String((e=>{const t=window;if(void 0===t[e])return new Promise((a=>t[e]=a));const a=t[e];return delete t[e],a})),arguments:[{value:this.#u}],executionContextId:e.executionContextId,awaitPromise:!0,serializationOptions:{serialization:"idOnly"}});if(void 0!==t.exceptionDetails||void 0===t.result.objectId)throw new Error(`ChannelHandle not found in window["${this.#u}"]`);return t.result.objectId}getEvalInWindowStr(){const e=String(((e,t)=>{const a=window;return void 0===a[e]?a[e]=t:(a[e](t),delete a[e]),t.sendMessage})),t=Z.#f();return`(${e})('${this.#u}',${t})`}}A.ChannelProxy=Z,Object.defineProperty(M,"__esModule",{value:!0}),M.Realm=void 0;const U=g,F=l,q=B,V=A;class ${#g;#y;#S;#t;#v;#w;#C;constructor(e,t,a,r,n,s,o){this.#g=e,this.#y=t,this.#S=a,this.#t=r,this.#v=n,this.#w=s,this.#C=o,this.#C.addRealm(this)}cdpToBidiValue(e,t){const a=this.serializeForBiDi(e.result.deepSerializedValue,new Map);if(e.result.objectId){const r=e.result.objectId;"root"===t?(a.handle=r,this.#C.knownHandlesToRealmMap.set(r,this.realmId)):this.#b(r).catch((e=>this.#t?.(F.LogType.debugError,e)))}if("object"===e.result.type)switch(e.result.subtype){case"generator":case"iterator":a.type=e.result.subtype,delete a.value}return a}serializeForBiDi(e,t){if(Object.hasOwn(e,"weakLocalObjectReference")){const a=e.weakLocalObjectReference;t.has(a)||t.set(a,(0,q.uuidv4)()),e.internalId=t.get(a),delete e.weakLocalObjectReference}if("platformobject"===e.type)return{type:"object"};const a=e.value;if(void 0===a)return e;if(["array","set","htmlcollection","nodelist"].includes(e.type))for(const e in a)a[e]=this.serializeForBiDi(a[e],t);if(["object","map"].includes(e.type))for(const e in a)a[e]=[this.serializeForBiDi(a[e][0],t),this.serializeForBiDi(a[e][1],t)];return e}get realmId(){return this.#w}get executionContextId(){return this.#S}get origin(){return this.#v}get source(){return{realm:this.realmId}}get cdpClient(){return this.#g}get baseInfo(){return{realm:this.realmId,origin:this.origin}}async evaluate(e,t,a,r,n=!1){const s=await this.cdpClient.sendCommand("Runtime.evaluate",{contextId:this.executionContextId,expression:e,awaitPromise:t,serializationOptions:$.#x("deep",r),userGesture:n});return s.exceptionDetails?await this.#P(s.exceptionDetails,0,a):{realm:this.realmId,result:this.cdpToBidiValue(s,a),type:"success"}}#I(e){if(0===this.associatedBrowsingContexts.length)this.#y.registerEvent(e,null);else for(const t of this.associatedBrowsingContexts)this.#y.registerEvent(e,t.id)}initialize(){this.#I({type:"event",method:U.ChromiumBidi.Script.EventNames.RealmCreated,params:this.realmInfo})}async serializeCdpObject(e,t){const a=$.#k(e),r=await this.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String((e=>e)),awaitPromise:!1,arguments:[a],serializationOptions:{serialization:"deep"},executionContextId:this.executionContextId});return this.cdpToBidiValue(r,t)}static#k(e){return void 0!==e.objectId?{objectId:e.objectId}:void 0!==e.unserializableValue?{unserializableValue:e.unserializableValue}:{value:e.value}}async stringifyObject(e){const{result:t}=await this.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String((e=>String(e))),awaitPromise:!1,arguments:[e],returnByValue:!0,executionContextId:this.executionContextId});return t.value}async#R(e){const t=[];for(const[a,r]of e){let e;e="string"==typeof a?{value:a}:await this.deserializeForCdp(a);const n=await this.deserializeForCdp(r);t.push(e),t.push(n)}return t}async#E(e){return await Promise.all(e.map((e=>this.deserializeForCdp(e))))}async#_(e,t,a){const r=e.stackTrace?.callFrames.map((e=>({url:e.url,functionName:e.functionName,lineNumber:e.lineNumber-t,columnNumber:e.columnNumber})))??[],n=e.exception;return{exception:await this.serializeCdpObject(n,a),columnNumber:e.columnNumber,lineNumber:e.lineNumber-t,stackTrace:{callFrames:r},text:await this.stringifyObject(n)||e.text}}async callFunction(e,t,a,r,n,s,o=!1){const i=`(...args) => {\n      function callFunction(f, args) {\n        const deserializedThis = args.shift();\n        const deserializedArgs = args;\n        return f.apply(deserializedThis, deserializedArgs);\n      }\n      return callFunction((\n        ${e}\n      ), args);\n    }`,c=[await this.deserializeForCdp(t),...await Promise.all(a.map((async e=>await this.deserializeForCdp(e))))];let d;try{d=await this.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:i,awaitPromise:r,arguments:c,serializationOptions:$.#x("deep",s),executionContextId:this.executionContextId,userGesture:o})}catch(e){if(-32e3===e.code&&["Could not find object with given id","Argument should belong to the same JavaScript world as target object","Invalid remote object id"].includes(e.message))throw new U.NoSuchHandleException("Handle was not found.");throw e}return d.exceptionDetails?await this.#P(d.exceptionDetails,1,n):{type:"success",result:this.cdpToBidiValue(d,n),realm:this.realmId}}async deserializeForCdp(e){if("handle"in e&&e.handle)return{objectId:e.handle};if("handle"in e||"sharedId"in e)throw new U.NoSuchHandleException("Handle was not found.");switch(e.type){case"undefined":return{unserializableValue:"undefined"};case"null":return{unserializableValue:"null"};case"string":return{value:e.value};case"number":return"NaN"===e.value?{unserializableValue:"NaN"}:"-0"===e.value?{unserializableValue:"-0"}:"Infinity"===e.value?{unserializableValue:"Infinity"}:"-Infinity"===e.value?{unserializableValue:"-Infinity"}:{value:e.value};case"boolean":return{value:Boolean(e.value)};case"bigint":return{unserializableValue:`BigInt(${JSON.stringify(e.value)})`};case"date":return{unserializableValue:`new Date(Date.parse(${JSON.stringify(e.value)}))`};case"regexp":return{unserializableValue:`new RegExp(${JSON.stringify(e.value.pattern)}, ${JSON.stringify(e.value.flags)})`};case"map":{const t=await this.#R(e.value),{result:a}=await this.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String(((...e)=>{const t=new Map;for(let a=0;a<e.length;a+=2)t.set(e[a],e[a+1]);return t})),awaitPromise:!1,arguments:t,returnByValue:!1,executionContextId:this.executionContextId});return{objectId:a.objectId}}case"object":{const t=await this.#R(e.value),{result:a}=await this.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String(((...e)=>{const t={};for(let a=0;a<e.length;a+=2){t[e[a]]=e[a+1]}return t})),awaitPromise:!1,arguments:t,returnByValue:!1,executionContextId:this.executionContextId});return{objectId:a.objectId}}case"array":{const t=await this.#E(e.value),{result:a}=await this.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String(((...e)=>e)),awaitPromise:!1,arguments:t,returnByValue:!1,executionContextId:this.executionContextId});return{objectId:a.objectId}}case"set":{const t=await this.#E(e.value),{result:a}=await this.cdpClient.sendCommand("Runtime.callFunctionOn",{functionDeclaration:String(((...e)=>new Set(e))),awaitPromise:!1,arguments:t,returnByValue:!1,executionContextId:this.executionContextId});return{objectId:a.objectId}}case"channel":{const t=new V.ChannelProxy(e.value,this.#t);return{objectId:await t.init(this,this.#y)}}}throw new Error(`Value ${JSON.stringify(e)} is not deserializable.`)}async#P(e,t,a){return{exceptionDetails:await this.#_(e,t,a),realm:this.realmId,type:"exception"}}static#x(e,t){return{serialization:e,additionalParameters:$.#T(t),...$.#N(t)}}static#T(e){const t={};return void 0!==e.maxDomDepth&&(t.maxNodeDepth=null===e.maxDomDepth?1e3:e.maxDomDepth),void 0!==e.includeShadowTree&&(t.includeShadowTree=e.includeShadowTree),t}static#N(e){return void 0===e.maxObjectDepth||null===e.maxObjectDepth?{}:{maxDepth:e.maxObjectDepth}}async#b(e){try{await this.cdpClient.sendCommand("Runtime.releaseObject",{objectId:e})}catch(e){if(-32e3!==e.code||"Invalid remote object id"!==e.message)throw e}}async disown(e){this.#C.knownHandlesToRealmMap.get(e)===this.realmId&&(await this.#b(e),this.#C.knownHandlesToRealmMap.delete(e))}dispose(){this.#I({type:"event",method:U.ChromiumBidi.Script.EventNames.RealmDestroyed,params:{realm:this.realmId}})}}M.Realm=$,Object.defineProperty(O,"__esModule",{value:!0}),O.WorkerRealm=void 0;const K=M;class W extends K.Realm{#j;#O;constructor(e,t,a,r,n,s,o,i,c){super(e,t,a,r,n,o,i),this.#O=s,this.#j=c,this.initialize()}get associatedBrowsingContexts(){return this.#O.flatMap((e=>e.associatedBrowsingContexts))}get realmType(){return this.#j}get source(){return{realm:this.realmId,context:this.associatedBrowsingContexts[0]?.id}}get realmInfo(){const e=this.#O.map((e=>e.realmId)),{realmType:t}=this;switch(t){case"dedicated-worker":{const a=e[0];if(void 0===a||1!==e.length)throw new Error("Dedicated worker must have exactly one owner");return{...this.baseInfo,type:t,owners:[a]}}case"service-worker":case"shared-worker":return{...this.baseInfo,type:t}}}}O.WorkerRealm=W;var H={},J={};Object.defineProperty(J,"__esModule",{value:!0}),J.assert=void 0,J.assert=function(e,t){if(!e)throw new Error(t??"Internal assertion failed.")};var G={};Object.defineProperty(G,"__esModule",{value:!0}),G.Deferred=void 0;class X{#M=!1;#B;#A;#D;get isFinished(){return this.#M}constructor(){this.#B=new Promise(((e,t)=>{this.#A=e,this.#D=t})),this.#B.catch((e=>{}))}then(e,t){return this.#B.then(e,t)}catch(e){return this.#B.catch(e)}resolve(e){this.#M||(this.#M=!0,this.#A(e))}reject(e){this.#M||(this.#M=!0,this.#D(e))}finally(e){return this.#B.finally(e)}[Symbol.toStringTag]="Promise"}G.Deferred=X;var Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.inchesFromCm=void 0,Y.inchesFromCm=function(e){return e/2.54};var Q={},ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.parseSharedId=ee.getSharedId=void 0;const te="_element_";ee.getSharedId=function(e,t,a,r){return r?`f.${e}.d.${t}.e.${a}`:`${t}${te}${a}`},ee.parseSharedId=function(e){const t=function(e){const t=e.match(new RegExp(`(.*)${te}(.*)`));if(!t)return null;const a=t[1],r=t[2];if(void 0===a||void 0===r)return null;const n=parseInt(r??"");return isNaN(n)?null:{documentId:a,backendNodeId:n}}(e);if(null!==t)return{...t,frameId:void 0};const a=e.match(/f\.(.*)\.d\.(.*)\.e\.([0-9]*)/);if(!a)return null;const r=a[1],n=a[2],s=a[3];if(void 0===r||void 0===n||void 0===s)return null;const o=parseInt(s??"");return isNaN(o)?null:{frameId:r,documentId:n,backendNodeId:o}},Object.defineProperty(Q,"__esModule",{value:!0}),Q.WindowRealm=void 0;const ae=g,re=M,ne=ee;class se extends re.Realm{#z;#i;#L;sandbox;constructor(e,t,a,r,n,s,o,i,c,d,u){super(a,r,n,s,o,i,c),this.#z=e,this.#i=t,this.#L=u,this.sandbox=d,this.initialize()}#Z(e){const t=this.#i.getAllContexts().find((t=>t.navigableId===e));return t?.id??"UNKNOWN"}get browsingContext(){return this.#i.getContext(this.#z)}get associatedBrowsingContexts(){return[this.browsingContext]}get realmType(){return"window"}get realmInfo(){return{...this.baseInfo,type:this.realmType,context:this.#z,sandbox:this.sandbox}}get source(){return{realm:this.realmId,context:this.browsingContext.id}}serializeForBiDi(e,t){const a=e.value;if("node"===e.type){if(Object.hasOwn(a,"backendNodeId")){let t=this.browsingContext.navigableId??"UNKNOWN";Object.hasOwn(a,"loaderId")&&(t=a.loaderId,delete a.loaderId),e.sharedId=(0,ne.getSharedId)(this.#Z(t),t,a.backendNodeId,this.#L),delete a.backendNodeId}if(Object.hasOwn(a,"children"))for(const e in a.children)a.children[e]=this.serializeForBiDi(a.children[e],t);Object.hasOwn(a,"shadowRoot")&&null!==a.shadowRoot&&(a.shadowRoot=this.serializeForBiDi(a.shadowRoot,t)),""===a.namespaceURI&&(a.namespaceURI=null)}return super.serializeForBiDi(e,t)}async deserializeForCdp(e){if("sharedId"in e&&e.sharedId){const t=(0,ne.parseSharedId)(e.sharedId);if(null===t)throw new ae.NoSuchNodeException(`SharedId "${e.sharedId}" was not found.`);const{documentId:a,backendNodeId:r}=t;if(this.browsingContext.navigableId!==a)throw new ae.NoSuchNodeException(`SharedId "${e.sharedId}" belongs to different document. Current document is ${this.browsingContext.navigableId}.`);try{const{object:e}=await this.cdpClient.sendCommand("DOM.resolveNode",{backendNodeId:r,executionContextId:this.executionContextId});return{objectId:e.objectId}}catch(t){if(-32e3===t.code&&"No node with given id found"===t.message)throw new ae.NoSuchNodeException(`SharedId "${e.sharedId}" was not found.`);throw new ae.UnknownErrorException(t.message,t.stack)}}return await super.deserializeForCdp(e)}async evaluate(e,t,a,r,n){return await this.#i.getContext(this.#z).targetUnblockedOrThrow(),await super.evaluate(e,t,a,r,n)}async callFunction(e,t,a,r,n,s,o){return await this.#i.getContext(this.#z).targetUnblockedOrThrow(),await super.callFunction(e,t,a,r,n,s,o)}}Q.WindowRealm=se,Object.defineProperty(H,"__esModule",{value:!0}),H.serializeOrigin=H.BrowsingContextImpl=void 0;const oe=x,ie=g,ce=J,de=G,ue=l,le=Y,he=Q;class pe{static LOGGER_PREFIX=`${ue.LogType.debug}:browsingContext`;#u;userContext;#U;#F=new Set;#i;#q={DOMContentLoaded:new de.Deferred,load:new de.Deferred};#V={withinDocument:new de.Deferred};#$="about:blank";#y;#C;#K;#W;#H;#L;#t;constructor(e,t,a,r,n,s,o,i,c){this.#W=e,this.#C=t,this.#u=a,this.#U=r,this.userContext=n,this.#y=s,this.#i=o,this.#L=i,this.#t=c}static create(e,t,a,r,n,s,o,i,c){const d=new pe(e,t,a,r,n,s,o,i,c);return d.#J(),o.addContext(d),d.isTopLevelContext()||d.parent.addChild(d.id),s.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.ContextCreated,params:d.serializeToBidiValue()},d.id),d}static getTimestamp(){return(new Date).getTime()}get navigableId(){return this.#K}dispose(){this.#G(),this.#C.deleteRealms({browsingContextId:this.id}),this.isTopLevelContext()||this.parent.#F.delete(this.id),this.#X(),this.#y.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.ContextDestroyed,params:this.serializeToBidiValue()},this.id),this.#i.deleteContextById(this.id)}get id(){return this.#u}get parentId(){return this.#U}get parent(){return null===this.parentId?null:this.#i.getContext(this.parentId)}get directChildren(){return[...this.#F].map((e=>this.#i.getContext(e)))}get allChildren(){const e=this.directChildren;return e.concat(...e.map((e=>e.allChildren)))}isTopLevelContext(){return null===this.#U}get top(){let e=this,t=e.parent;for(;t;)e=t,t=e.parent;return e}addChild(e){this.#F.add(e)}#G(){this.directChildren.map((e=>e.dispose()))}get#Y(){return(0,ce.assert)(this.#H,`No default realm for browsing context ${this.#u}`),this.#H}get cdpTarget(){return this.#W}updateCdpTarget(e){this.#W=e,this.#J()}get url(){return this.#$}async lifecycleLoaded(){await this.#q.load}async targetUnblockedOrThrow(){const e=await this.#W.unblocked;if("error"===e.kind)throw e.error}async getOrCreateSandbox(e){if(void 0===e||""===e)return this.#Y;let t=this.#C.findRealms({browsingContextId:this.id,sandbox:e});return 0===t.length&&(await this.#W.cdpClient.sendCommand("Page.createIsolatedWorld",{frameId:this.id,worldName:e}),t=this.#C.findRealms({browsingContextId:this.id,sandbox:e}),(0,ce.assert)(0!==t.length)),t[0]}serializeToBidiValue(e=0,t=!0){return{context:this.#u,url:this.url,userContext:this.userContext,children:e>0?this.directChildren.map((t=>t.serializeToBidiValue(e-1,!1))):null,...t?{parent:this.#U}:{}}}onTargetInfoChanged(e){this.#$=e.targetInfo.url}#J(){this.#W.cdpClient.on("Page.frameNavigated",(e=>{this.id===e.frame.id&&(this.#$=e.frame.url+(e.frame.urlFragment??""),this.#G())})),this.#W.cdpClient.on("Page.navigatedWithinDocument",(e=>{if(this.id!==e.frameId)return;const t=pe.getTimestamp();this.#$=e.url,this.#V.withinDocument.resolve(e),this.#y.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.FragmentNavigated,params:{context:this.id,navigation:null,timestamp:t,url:this.#$}},this.id)})),this.#W.cdpClient.on("Page.frameStartedLoading",(e=>{this.id===e.frameId&&this.#y.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.NavigationStarted,params:{context:this.id,navigation:null,timestamp:pe.getTimestamp(),url:""}},this.id)})),this.#W.cdpClient.on("Page.lifecycleEvent",(e=>{if(this.id!==e.frameId)return;if("init"===e.name)return void this.#Q(e.loaderId);if("commit"===e.name)return void(this.#K=e.loaderId);if(e.loaderId!==this.#K)return;const t=pe.getTimestamp();switch(e.name){case"DOMContentLoaded":this.#y.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.DomContentLoaded,params:{context:this.id,navigation:this.#K??null,timestamp:t,url:this.#$}},this.id),this.#q.DOMContentLoaded.resolve(e);break;case"load":this.#y.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.Load,params:{context:this.id,navigation:this.#K??null,timestamp:t,url:this.#$}},this.id),this.#q.load.resolve(e)}})),this.#W.cdpClient.on("Runtime.executionContextCreated",(e=>{const{auxData:t,name:a,uniqueId:r,id:n}=e.context;if(!t||t.frameId!==this.id)return;let s,o;switch(t.type){case"isolated":o=a,s=this.#Y.origin;break;case"default":s=me(e.context.origin);break;default:return}const i=new he.WindowRealm(this.id,this.#i,this.#W.cdpClient,this.#y,n,this.#t,s,r,this.#C,o,this.#L);t.isDefault&&(this.#H=i,Promise.all(this.#W.getChannels().map((e=>e.startListenerFromWindow(i,this.#y)))))})),this.#W.cdpClient.on("Runtime.executionContextDestroyed",(e=>{this.#C.deleteRealms({cdpSessionId:this.#W.cdpSessionId,executionContextId:e.executionContextId})})),this.#W.cdpClient.on("Runtime.executionContextsCleared",(()=>{this.#C.deleteRealms({cdpSessionId:this.#W.cdpSessionId})})),this.#W.cdpClient.on("Page.javascriptDialogClosed",(e=>{const t=e.result;this.#y.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.UserPromptClosed,params:{context:this.id,accepted:t,userText:t&&e.userInput?e.userInput:void 0}},this.id)})),this.#W.cdpClient.on("Page.javascriptDialogOpening",(e=>{this.#y.registerEvent({type:"event",method:ie.ChromiumBidi.BrowsingContext.EventNames.UserPromptOpened,params:{context:this.id,type:e.type,message:e.message,defaultValue:e.defaultPrompt||void 0}},this.id)}))}#Q(e){void 0!==e&&this.#K!==e?(this.#ee(),this.#K=e):this.#V.withinDocument.isFinished?this.#V.withinDocument=new de.Deferred:this.#t?.(pe.LOGGER_PREFIX,"Document changed (navigatedWithinDocument)")}#ee(){this.#q.DOMContentLoaded.isFinished?this.#q.DOMContentLoaded=new de.Deferred:this.#t?.(pe.LOGGER_PREFIX,"Document changed (DOMContentLoaded)"),this.#q.load.isFinished?this.#q.load=new de.Deferred:this.#t?.(pe.LOGGER_PREFIX,"Document changed (load)")}#X(){this.#q.DOMContentLoaded.isFinished||this.#q.DOMContentLoaded.reject(new ie.UnknownErrorException("navigation canceled")),this.#q.load.isFinished||this.#q.load.reject(new ie.UnknownErrorException("navigation canceled"))}async navigate(e,t){try{new URL(e)}catch{throw new ie.InvalidArgumentException(`Invalid URL: ${e}`)}await this.targetUnblockedOrThrow();const a=await this.#W.cdpClient.sendCommand("Page.navigate",{url:e,frameId:this.id});if(a.errorText)throw new ie.UnknownErrorException(a.errorText);switch(this.#Q(a.loaderId),t){case"none":break;case"interactive":void 0===a.loaderId?await this.#V.withinDocument:await this.#q.DOMContentLoaded;break;case"complete":void 0===a.loaderId?await this.#V.withinDocument:await this.#q.load}return{navigation:a.loaderId??null,url:"none"===t?e:this.#$}}async reload(e,t){switch(await this.targetUnblockedOrThrow(),await this.#W.cdpClient.sendCommand("Page.reload",{ignoreCache:e}),this.#ee(),t){case"none":break;case"interactive":await this.#q.DOMContentLoaded;break;case"complete":await this.#q.load}return{navigation:"none"===t?null:this.navigableId??null,url:this.url}}async setViewport(e,t){if(null===e&&null===t)await this.#W.cdpClient.sendCommand("Emulation.clearDeviceMetricsOverride");else try{await this.#W.cdpClient.sendCommand("Emulation.setDeviceMetricsOverride",{width:e?e.width:0,height:e?e.height:0,deviceScaleFactor:t||0,mobile:!1,dontSetVisibleSize:!0})}catch(e){if(e.message.startsWith("Width and height values must be positive"))throw new ie.UnsupportedOperationException("Provided viewport dimensions are not supported");throw e}}async handleUserPrompt(e){await this.#W.cdpClient.sendCommand("Page.handleJavaScriptDialog",{accept:e.accept??!0,promptText:e.userText})}async activate(){await this.#W.cdpClient.sendCommand("Page.bringToFront")}async captureScreenshot(e){if(!this.isTopLevelContext())throw new ie.UnsupportedOperationException(`Non-top-level 'context' (${e.context}) is currently not supported`);const t=function(e){const{quality:t,type:a}=e.format??{type:"image/png"};switch(a){case"image/png":return{format:"png"};case"image/jpeg":return{format:"jpeg",...void 0===t?{}:{quality:Math.round(100*t)}};case"image/webp":return{format:"webp",...void 0===t?{}:{quality:Math.round(100*t)}}}throw new ie.InvalidArgumentException(`Image format '${a}' is not a supported format`)}(e);await this.#W.cdpClient.sendCommand("Page.bringToFront");let a,r=!1;switch(e.origin??="viewport",e.origin){case"document":a=String((()=>{const e=document.documentElement;return{x:0,y:0,width:e.scrollWidth,height:e.scrollHeight}})),r=!0;break;case"viewport":a=String((()=>{const e=window.visualViewport;return{x:e.pageLeft,y:e.pageTop,width:e.width,height:e.height}}))}const n=await this.getOrCreateSandbox(void 0),s=await n.callFunction(a,{type:"undefined"},[],!1,"none",{},!1);(0,ce.assert)("success"===s.type);const o=fe(s.result);(0,ce.assert)(o);const i=e.clip?function(e,t){e=ge(e),t=ge(t);const a=Math.max(e.x,t.x),r=Math.max(e.y,t.y);return{x:a,y:r,width:Math.max(Math.min(e.x+e.width,t.x+t.width)-a,0),height:Math.max(Math.min(e.y+e.height,t.y+t.height)-r,0)}}(await this.#te(e.clip),o):o;if(0===i.width||0===i.height)throw new ie.UnableToCaptureScreenException(`Unable to capture screenshot with zero dimensions: width=${i.width}, height=${i.height}`);return await this.#W.cdpClient.sendCommand("Page.captureScreenshot",{clip:{...i,scale:1},...t,captureBeyondViewport:r})}async print(e){const t={};if(void 0!==e.background&&(t.printBackground=e.background),void 0!==e.margin?.bottom&&(t.marginBottom=(0,le.inchesFromCm)(e.margin.bottom)),void 0!==e.margin?.left&&(t.marginLeft=(0,le.inchesFromCm)(e.margin.left)),void 0!==e.margin?.right&&(t.marginRight=(0,le.inchesFromCm)(e.margin.right)),void 0!==e.margin?.top&&(t.marginTop=(0,le.inchesFromCm)(e.margin.top)),void 0!==e.orientation&&(t.landscape="landscape"===e.orientation),void 0!==e.page?.height&&(t.paperHeight=(0,le.inchesFromCm)(e.page.height)),void 0!==e.page?.width&&(t.paperWidth=(0,le.inchesFromCm)(e.page.width)),void 0!==e.pageRanges){for(const t of e.pageRanges){if("number"==typeof t)continue;const e=t.split("-");if(e.length<1||e.length>2)throw new ie.InvalidArgumentException(`Invalid page range: ${t} is not a valid integer range.`);if(1===e.length){ye(e[0]??"");continue}let a,r;const[n="",s=""]=e;if(a=""===n?1:ye(n),r=""===s?Number.MAX_SAFE_INTEGER:ye(s),a>r)throw new ie.InvalidArgumentException(`Invalid page range: ${n} > ${s}`)}t.pageRanges=e.pageRanges.join(",")}void 0!==e.scale&&(t.scale=e.scale),void 0!==e.shrinkToFit&&(t.preferCSSPageSize=!e.shrinkToFit);try{return{data:(await this.#W.cdpClient.sendCommand("Page.printToPDF",t)).data}}catch(e){if("invalid print parameters: content area is empty"===e.message)throw new ie.UnsupportedOperationException(e.message);throw e}}async#te(e){switch(e.type){case"box":return{x:e.x,y:e.y,width:e.width,height:e.height};case"element":{const t=await this.getOrCreateSandbox(void 0),a=await t.callFunction(String((e=>e instanceof Element)),{type:"undefined"},[e.element],!1,"none",{});if("exception"===a.type)throw new ie.NoSuchElementException(`Element '${e.element.sharedId}' was not found`);if((0,ce.assert)("boolean"===a.result.type),!a.result.value)throw new ie.NoSuchElementException(`Node '${e.element.sharedId}' is not an Element`);{const a=await t.callFunction(String((e=>{const t=e.getBoundingClientRect();return{x:t.x,y:t.y,height:t.height,width:t.width}})),{type:"undefined"},[e.element],!1,"none",{});(0,ce.assert)("success"===a.type);const r=fe(a.result);if(!r)throw new ie.UnableToCaptureScreenException(`Could not get bounding box for Element '${e.element.sharedId}'`);return r}}}}async close(){await this.#W.cdpClient.sendCommand("Page.close")}async traverseHistory(e){if(0===e)return;const t=await this.#W.cdpClient.sendCommand("Page.getNavigationHistory"),a=t.entries[t.currentIndex+e];if(!a)throw new ie.NoSuchHistoryEntryException(`No history entry at delta ${e}`);await this.#W.cdpClient.sendCommand("Page.navigateToHistoryEntry",{entryId:a.id})}async toggleModulesIfNeeded(){const e=this.#y.subscriptionManager.isSubscribedToModule(oe.BiDiModule.Network,this.id);await this.#W.toggleNetworkIfNeeded(e)}}function me(e){return["://",""].includes(e)&&(e="null"),e}function fe(e){if("object"!==e.type||void 0===e.value)return;const t=e.value.find((([e])=>"x"===e))?.[1],a=e.value.find((([e])=>"y"===e))?.[1],r=e.value.find((([e])=>"height"===e))?.[1],n=e.value.find((([e])=>"width"===e))?.[1];return"number"===t?.type&&"number"===a?.type&&"number"===r?.type&&"number"===n?.type?{x:t.value,y:a.value,width:n.value,height:r.value}:void 0}function ge(e){return{...e.width<0?{x:e.x+e.width,width:-e.width}:{x:e.x,width:e.width},...e.height<0?{y:e.y+e.height,height:-e.height}:{y:e.y,height:e.height}}}function ye(e){if(e=e.trim(),!/^[0-9]+$/.test(e))throw new ie.InvalidArgumentException(`Invalid integer: ${e}`);return parseInt(e)}H.BrowsingContextImpl=pe,H.serializeOrigin=me;var Se={},ve={},we={};Object.defineProperty(we,"__esModule",{value:!0}),we.getRemoteValuesText=we.logMessageFormatter=void 0;const Ce=J,be=["%s","%d","%i","%f","%o","%O","%c"];function xe(e){return be.some((t=>e.includes(t)))}function Pe(e){let t="";const a=e[0].value.toString(),r=e.slice(1,void 0),n=a.split(new RegExp(be.map((e=>`(${e})`)).join("|"),"g"));for(const a of n)if(void 0!==a&&""!==a)if(xe(a)){const n=r.shift();(0,Ce.assert)(n,`Less value is provided: "${Re(e,!1)}"`),"%s"===a?t+=ke(n):"%d"===a||"%i"===a?"bigint"===n.type||"number"===n.type||"string"===n.type?t+=parseInt(n.value.toString(),10):t+="NaN":"%f"===a?"bigint"===n.type||"number"===n.type||"string"===n.type?t+=parseFloat(n.value.toString()):t+="NaN":t+=Ie(n)}else t+=a;if(r.length>0)throw new Error(`More value is provided: "${Re(e,!1)}"`);return t}function Ie(e){if("array"!==e.type&&"bigint"!==e.type&&"date"!==e.type&&"number"!==e.type&&"object"!==e.type&&"string"!==e.type)return ke(e);if("bigint"===e.type)return`${e.value.toString()}n`;if("number"===e.type)return e.value.toString();if(["date","string"].includes(e.type))return JSON.stringify(e.value);if("object"===e.type)return`{${e.value.map((e=>`${JSON.stringify(e[0])}:${Ie(e[1])}`)).join(",")}}`;if("array"===e.type)return`[${e.value?.map((e=>Ie(e))).join(",")??""}]`;throw Error(`Invalid value type: ${e}`)}function ke(e){if(!Object.hasOwn(e,"value"))return e.type;switch(e.type){case"string":case"number":case"boolean":case"bigint":return String(e.value);case"regexp":return`/${e.value.pattern}/${e.value.flags??""}`;case"date":return new Date(e.value).toString();case"object":return`Object(${e.value?.length??""})`;case"array":return`Array(${e.value?.length??""})`;case"map":return`Map(${e.value?.length})`;case"set":return`Set(${e.value?.length})`;default:return e.type}}function Re(e,t){const a=e[0];return a?"string"===a.type&&xe(a.value.toString())&&t?Pe(e):e.map((e=>ke(e))).join(" "):""}we.logMessageFormatter=Pe,we.getRemoteValuesText=Re,Object.defineProperty(ve,"__esModule",{value:!0}),ve.LogManager=void 0;const Ee=g,_e=l,Te=we;function Ne(e){const t=e?.callFrames.map((e=>({columnNumber:e.columnNumber,functionName:e.functionName,lineNumber:e.lineNumber,url:e.url})));return t?{callFrames:t}:void 0}class je{#y;#C;#W;#t;constructor(e,t,a,r){this.#W=e,this.#C=t,this.#y=a,this.#t=r}static create(e,t,a,r){const n=new je(e,t,a,r);return n.#ae(),n}#ae(){this.#W.cdpClient.on("Runtime.consoleAPICalled",(e=>{const t=this.#C.findRealm({cdpSessionId:this.#W.cdpSessionId,executionContextId:e.executionContextId});if(void 0===t)return void this.#t?.(_e.LogType.cdp,e);const a=void 0===t?Promise.resolve(e.args):Promise.all(e.args.map((e=>t.serializeCdpObject(e,"none"))));for(const r of t.associatedBrowsingContexts)this.#y.registerPromiseEvent(a.then((a=>{return{kind:"success",value:{type:"event",method:Ee.ChromiumBidi.Log.EventNames.LogEntryAdded,params:{level:(r=e.type,["error","assert"].includes(r)?"error":["debug","trace"].includes(r)?"debug":["warn","warning"].includes(r)?"warn":"info"),source:t.source,text:(0,Te.getRemoteValuesText)(a,!0),timestamp:Math.round(e.timestamp),stackTrace:Ne(e.stackTrace),type:"console",method:"warning"===e.type?"warn":e.type,args:a}}};var r})),r.id,Ee.ChromiumBidi.Log.EventNames.LogEntryAdded)})),this.#W.cdpClient.on("Runtime.exceptionThrown",(e=>{const t=this.#C.findRealm({cdpSessionId:this.#W.cdpSessionId,executionContextId:e.exceptionDetails.executionContextId});if(void 0!==t)for(const a of t.associatedBrowsingContexts)this.#y.registerPromiseEvent(je.#re(e,t).then((a=>({kind:"success",value:{type:"event",method:Ee.ChromiumBidi.Log.EventNames.LogEntryAdded,params:{level:"error",source:t.source,text:a,timestamp:Math.round(e.timestamp),stackTrace:Ne(e.exceptionDetails.stackTrace),type:"javascript"}}}))),a.id,Ee.ChromiumBidi.Log.EventNames.LogEntryAdded);else this.#t?.(_e.LogType.cdp,e)}))}static async#re(e,t){return e.exceptionDetails.exception?void 0===t?JSON.stringify(e.exceptionDetails.exception):await t.stringifyObject(e.exceptionDetails.exception):e.exceptionDetails.text}}ve.LogManager=je,Object.defineProperty(Se,"__esModule",{value:!0}),Se.CdpTarget=void 0;const Oe=x,Me=G,Be=ve;class Ae{#u;#g;#o;#y;#ne;#se=new Me.Deferred;#oe;#ie=!1;#ce=!1;static create(e,t,a,r,n,s,o,i,c){const d=new Ae(e,t,a,n,s,i);return Be.LogManager.create(d,r,n,c),d.#de(),d.#ue(),d}constructor(e,t,a,r,n,s){this.#u=e,this.#g=t,this.#y=r,this.#ne=n,this.#o=a,this.#oe=s}get unblocked(){return this.#se}get id(){return this.#u}get cdpClient(){return this.#g}get browserCdpClient(){return this.#o}get cdpSessionId(){return this.#g.sessionId}async#ue(){const e=this.#y.subscriptionManager.isSubscribedToModule(Oe.BiDiModule.Network,this.#u);try{await Promise.all([this.#g.sendCommand("Runtime.enable"),this.#g.sendCommand("Page.enable"),this.#g.sendCommand("Page.setLifecycleEventsEnabled",{enabled:!0}),this.#g.sendCommand("Security.setIgnoreCertificateErrors",{ignore:this.#oe}),e?this.#g.sendCommand("Network.enable"):void 0,this.#g.sendCommand("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0}),this.#le(),this.#g.sendCommand("Runtime.runIfWaitingForDebugger")])}catch(e){if(!this.#g.isCloseError(e))return void this.#se.resolve({kind:"error",error:e})}this.#se.resolve({kind:"success",value:void 0})}async enableFetchIfNeeded(e){if(this.#ie&&!this.#ce){this.#ce=!0;try{await this.#g.sendCommand("Fetch.enable",e)}catch(e){this.#ce=!1}}}async disableFetchIfNeeded(){if(this.#ce){this.#ce=!1;try{await this.#g.sendCommand("Fetch.disable")}catch(e){this.#ce=!0}}}async toggleNetworkIfNeeded(e){if(e!==this.#ie){this.#ie=e;try{await this.#g.sendCommand(this.#ie?"Network.enable":"Network.disable")}catch(t){this.#ie=!e}}}#de(){this.#g.on("*",((e,t)=>{"string"==typeof e&&this.#y.registerEvent({type:"event",method:`cdp.${e}`,params:{event:e,params:t,session:this.cdpSessionId}},null)}))}getChannels(){return this.#ne.find().flatMap((e=>e.channels))}async#le(){for(const e of this.#ne.find({global:!0}))await e.initInTarget(this,!0)}}Se.CdpTarget=Ae,Object.defineProperty(j,"__esModule",{value:!0}),j.BrowsingContextProcessor=void 0;const De=g,ze=l,Le=O,Ze=H,Ue=Se,Fe={service_worker:"service-worker",shared_worker:"shared-worker",worker:"dedicated-worker"};j.BrowsingContextProcessor=class{#o;#c;#he;#y;#i;#pe;#oe;#L;#ne;#C;#me;#t;constructor(e,t,a,r,n,s,o,i,c,d,u,l){this.#oe=c,this.#c=e,this.#o=t,this.#he=a,this.#y=r,this.#i=n,this.#ne=i,this.#pe=o,this.#C=s,this.#L=d,this.#me=u,this.#t=l,this.#de(t)}getTree(e){return{contexts:(void 0===e.root?this.#i.getTopLevelContexts():[this.#i.getContext(e.root)]).map((t=>t.serializeToBidiValue(e.maxDepth??Number.MAX_VALUE)))}}async create(e){let t,a=e.userContext??"default";if(void 0!==e.referenceContext){if(t=this.#i.getContext(e.referenceContext),!t.isTopLevelContext())throw new De.InvalidArgumentException("referenceContext should be a top-level context");a=t.userContext}let r,n=!1;switch(e.type){case"tab":n=!1;break;case"window":n=!0}if("default"!==a){const e=this.#i.getAllContexts().filter((e=>e.userContext===a));e.length||(n=!0)}try{r=await this.#o.sendCommand("Target.createTarget",{url:"about:blank",newWindow:n,browserContextId:"default"===a?void 0:a})}catch(e){if(e.message.startsWith("Failed to find browser context with id")||"browserContextId"===e.message)throw new De.NoSuchUserContextException(`The context ${a} was not found`);throw e}const s=r.targetId,o=this.#i.getContext(s);return await o.lifecycleLoaded(),{context:o.id}}navigate(e){return this.#i.getContext(e.context).navigate(e.url,e.wait??"none")}reload(e){return this.#i.getContext(e.context).reload(e.ignoreCache??!1,e.wait??"none")}async activate(e){const t=this.#i.getContext(e.context);if(!t.isTopLevelContext())throw new De.InvalidArgumentException("Activation is only supported on the top-level context");return await t.activate(),{}}async captureScreenshot(e){const t=this.#i.getContext(e.context);return await t.captureScreenshot(e)}async print(e){const t=this.#i.getContext(e.context);return await t.print(e)}async setViewport(e){const t=this.#i.getContext(e.context);if(!t.isTopLevelContext())throw new De.InvalidArgumentException("Emulating viewport is only supported on the top-level context");return await t.setViewport(e.viewport,e.devicePixelRatio),{}}async traverseHistory(e){const t=this.#i.getContext(e.context);if(!t)throw new De.InvalidArgumentException(`No browsing context with id ${e.context}`);return await t.traverseHistory(e.delta),{}}async handleUserPrompt(e){const t=this.#i.getContext(e.context);return await t.handleUserPrompt(e),{}}async close(e){const t=this.#i.getContext(e.context);if(!t.isTopLevelContext())throw new De.InvalidArgumentException(`Non top-level browsing context ${t.id} cannot be closed.`);try{const a=new Promise((t=>{const a=r=>{r.targetId===e.context&&(this.#o.off("Target.detachedFromTarget",a),t())};this.#o.on("Target.detachedFromTarget",a)}));e.promptUnload?await t.close():await this.#o.sendCommand("Target.closeTarget",{targetId:e.context}),await a}catch(e){if(-32e3!==e.code||"Not attached to an active page"!==e.message)throw e}return{}}#de(e){e.on("Target.attachedToTarget",(t=>{this.#fe(t,e)})),e.on("Target.detachedFromTarget",(e=>{this.#ge(e)})),e.on("Target.targetInfoChanged",(e=>{this.#ye(e)})),e.on("Inspector.targetCrashed",(()=>{this.#Se(e)})),e.on("Page.frameAttached",(e=>{this.#ve(e)})),e.on("Page.frameDetached",(e=>{this.#we(e)}))}#ve(e){const t=this.#i.findContext(e.parentFrameId);void 0!==t&&Ze.BrowsingContextImpl.create(t.cdpTarget,this.#C,e.frameId,e.parentFrameId,t.userContext,this.#y,this.#i,this.#L,this.#t)}#we(e){"swap"!==e.reason&&this.#i.findContext(e.frameId)?.dispose()}#fe(e,t){const{sessionId:a,targetInfo:r}=e,n=this.#c.getCdpClient(a);switch(this.#t?.(ze.LogType.debugInfo,"AttachedToTarget event received:",e),r.type){case"page":case"iframe":{if(r.targetId===this.#he)break;const e=this.#Ce(n,r),t=this.#i.findContext(r.targetId);return void(t?t.updateCdpTarget(e):Ze.BrowsingContextImpl.create(e,this.#C,r.targetId,null,r.browserContextId&&r.browserContextId!==this.#me?r.browserContextId:"default",this.#y,this.#i,this.#L,this.#t))}case"service_worker":case"worker":{const e=this.#C.findRealm({cdpSessionId:t.sessionId});if(!e)break;const a=this.#Ce(n,r);return void this.#be(Fe[r.type],a,e)}case"shared_worker":{const e=this.#Ce(n,r);return void this.#be(Fe[r.type],e)}}n.sendCommand("Runtime.runIfWaitingForDebugger").then((()=>t.sendCommand("Target.detachFromTarget",e))).catch((e=>this.#t?.(ze.LogType.debugError,e)))}#Ce(e,t){this.#de(e);const a=Ue.CdpTarget.create(t.targetId,e,this.#o,this.#C,this.#y,this.#ne,this.#pe,this.#oe,this.#t);return this.#pe.onCdpTargetCreated(a),a}#xe=new Map;#be(e,t,a){t.cdpClient.on("Runtime.executionContextCreated",(r=>{const{uniqueId:n,id:s,origin:o}=r.context,i=new Le.WorkerRealm(t.cdpClient,this.#y,s,this.#t,(0,Ze.serializeOrigin)(o),a?[a]:[],n,this.#C,e);this.#xe.set(t.cdpSessionId,i)}))}#ge(e){const t=this.#i.findContextBySession(e.sessionId);if(t)return t.dispose(),void this.#ne.find({targetId:t.id}).map((e=>e.dispose(t.id)));const a=this.#xe.get(e.sessionId);a&&this.#C.deleteRealms({cdpSessionId:a.cdpClient.sessionId})}#ye(e){const t=this.#i.findContext(e.targetInfo.targetId);t&&t.onTargetInfoChanged(e)}#Se(e){const t=this.#C.findRealms({cdpSessionId:e.sessionId});for(const e of t)e.dispose()}};var qe={},Ve={},$e={};Object.defineProperty($e,"__esModule",{value:!0}),$e.WheelSource=$e.PointerSource=$e.KeySource=$e.NoneSource=void 0;$e.NoneSource=class{type="none"};$e.KeySource=class{type="key";pressed=new Set;#Pe=0;get modifiers(){return this.#Pe}get alt(){return 1==(1&this.#Pe)}set alt(e){this.#Ie(e,1)}get ctrl(){return 2==(2&this.#Pe)}set ctrl(e){this.#Ie(e,2)}get meta(){return 4==(4&this.#Pe)}set meta(e){this.#Ie(e,4)}get shift(){return 8==(8&this.#Pe)}set shift(e){this.#Ie(e,8)}#Ie(e,t){e?this.#Pe|=t:this.#Pe&=~t}};$e.PointerSource=class{type="pointer";subtype;pointerId;pressed=new Set;x=0;y=0;constructor(e,t){this.pointerId=e,this.subtype=t}get buttons(){let e=0;for(const t of this.pressed)switch(t){case 0:e|=1;break;case 1:e|=4;break;case 2:e|=2;break;case 3:e|=8;break;case 4:e|=16}return e}static ClickContext=class e{static#ke=500;static#Re=2;count=0;#Ee;#_e;#Te;constructor(e,t,a){this.#Ee=e,this.#_e=t,this.#Te=a}compare(t){return t.#Te-this.#Te>e.#ke||Math.abs(t.#Ee-this.#Ee)>e.#Re||Math.abs(t.#_e-this.#_e)>e.#Re}};#Ne=new Map;setClickCount(e,t){let a=this.#Ne.get(e);return a&&!a.compare(t)||(a=t),++a.count,this.#Ne.set(e,a),a.count}getClickCount(e){return this.#Ne.get(e)?.count??0}};$e.WheelSource=class{type="wheel"};var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getKeyLocation=Ke.getKeyCode=Ke.getNormalizedKey=void 0,Ke.getNormalizedKey=function(e){switch(e){case"\ue000":return"Unidentified";case"\ue001":return"Cancel";case"\ue002":return"Help";case"\ue003":return"Backspace";case"\ue004":return"Tab";case"\ue005":return"Clear";case"\ue006":return"Return";case"\ue007":return"Enter";case"\ue008":case"\ue050":return"Shift";case"\ue009":case"\ue051":return"Control";case"\ue00a":case"\ue052":return"Alt";case"\ue00b":return"Pause";case"\ue00c":return"Escape";case"\ue00d":return" ";case"\ue00e":case"\ue054":return"PageUp";case"\ue00f":case"\ue055":return"PageDown";case"\ue010":case"\ue056":return"End";case"\ue011":case"\ue057":return"Home";case"\ue012":case"\ue058":return"ArrowLeft";case"\ue013":case"\ue059":return"ArrowUp";case"\ue014":case"\ue05a":return"ArrowRight";case"\ue015":case"\ue05b":return"ArrowDown";case"\ue016":case"\ue05c":return"Insert";case"\ue017":case"\ue05d":return"Delete";case"\ue018":return";";case"\ue019":return"=";case"\ue01a":return"0";case"\ue01b":return"1";case"\ue01c":return"2";case"\ue01d":return"3";case"\ue01e":return"4";case"\ue01f":return"5";case"\ue020":return"6";case"\ue021":return"7";case"\ue022":return"8";case"\ue023":return"9";case"\ue024":return"*";case"\ue025":return"+";case"\ue026":return",";case"\ue027":return"-";case"\ue028":return".";case"\ue029":return"/";case"\ue031":return"F1";case"\ue032":return"F2";case"\ue033":return"F3";case"\ue034":return"F4";case"\ue035":return"F5";case"\ue036":return"F6";case"\ue037":return"F7";case"\ue038":return"F8";case"\ue039":return"F9";case"\ue03a":return"F10";case"\ue03b":return"F11";case"\ue03c":return"F12";case"\ue03d":case"\ue053":return"Meta";case"\ue040":return"ZenkakuHankaku";default:return e}},Ke.getKeyCode=function(e){switch(e){case"`":case"~":return"Backquote";case"\\":case"|":return"Backslash";case"\ue003":return"Backspace";case"[":case"{":return"BracketLeft";case"]":case"}":return"BracketRight";case",":case"<":return"Comma";case"0":case")":return"Digit0";case"1":case"!":return"Digit1";case"2":case"@":return"Digit2";case"3":case"#":return"Digit3";case"4":case"$":return"Digit4";case"5":case"%":return"Digit5";case"6":case"^":return"Digit6";case"7":case"&":return"Digit7";case"8":case"*":return"Digit8";case"9":case"(":return"Digit9";case"=":case"+":return"Equal";case"a":case"A":return"KeyA";case"b":case"B":return"KeyB";case"c":case"C":return"KeyC";case"d":case"D":return"KeyD";case"e":case"E":return"KeyE";case"f":case"F":return"KeyF";case"g":case"G":return"KeyG";case"h":case"H":return"KeyH";case"i":case"I":return"KeyI";case"j":case"J":return"KeyJ";case"k":case"K":return"KeyK";case"l":case"L":return"KeyL";case"m":case"M":return"KeyM";case"n":case"N":return"KeyN";case"o":case"O":return"KeyO";case"p":case"P":return"KeyP";case"q":case"Q":return"KeyQ";case"r":case"R":return"KeyR";case"s":case"S":return"KeyS";case"t":case"T":return"KeyT";case"u":case"U":return"KeyU";case"v":case"V":return"KeyV";case"w":case"W":return"KeyW";case"x":case"X":return"KeyX";case"y":case"Y":return"KeyY";case"z":case"Z":return"KeyZ";case"-":case"_":return"Minus";case".":return"Period";case"'":case'"':return"Quote";case";":case":":return"Semicolon";case"/":case"?":return"Slash";case"\ue00a":return"AltLeft";case"\ue052":return"AltRight";case"\ue009":return"ControlLeft";case"\ue051":return"ControlRight";case"\ue006":return"Enter";case"\ue03d":return"MetaLeft";case"\ue053":return"MetaRight";case"\ue008":return"ShiftLeft";case"\ue050":return"ShiftRight";case" ":case"\ue00d":return"Space";case"\ue004":return"Tab";case"\ue017":return"Delete";case"\ue010":return"End";case"\ue002":return"Help";case"\ue011":return"Home";case"\ue016":return"Insert";case"\ue00f":return"PageDown";case"\ue00e":return"PageUp";case"\ue015":return"ArrowDown";case"\ue012":return"ArrowLeft";case"\ue014":return"ArrowRight";case"\ue013":return"ArrowUp";case"\ue00c":return"Escape";case"\ue031":return"F1";case"\ue032":return"F2";case"\ue033":return"F3";case"\ue034":return"F4";case"\ue035":return"F5";case"\ue036":return"F6";case"\ue037":return"F7";case"\ue038":return"F8";case"\ue039":return"F9";case"\ue03a":return"F10";case"\ue03b":return"F11";case"\ue03c":return"F12";case"\ue01a":case"\ue05c":return"Numpad0";case"\ue01b":case"\ue056":return"Numpad1";case"\ue01c":case"\ue05b":return"Numpad2";case"\ue01d":case"\ue055":return"Numpad3";case"\ue01e":case"\ue058":return"Numpad4";case"\ue01f":return"Numpad5";case"\ue020":case"\ue05a":return"Numpad6";case"\ue021":case"\ue057":return"Numpad7";case"\ue022":case"\ue059":return"Numpad8";case"\ue023":case"\ue054":return"Numpad9";case"\ue025":return"NumpadAdd";case"\ue026":return"NumpadComma";case"\ue028":case"\ue05d":return"NumpadDecimal";case"\ue029":return"NumpadDivide";case"\ue007":return"NumpadEnter";case"\ue024":return"NumpadMultiply";case"\ue027":return"NumpadSubtract";default:return}},Ke.getKeyLocation=function(e){switch(e){case"\ue007":case"\ue008":case"\ue009":case"\ue00a":case"\ue03d":return 1;case"\ue01a":case"\ue01b":case"\ue01c":case"\ue01d":case"\ue01e":case"\ue01f":case"\ue020":case"\ue021":case"\ue022":case"\ue023":case"\ue024":case"\ue025":case"\ue026":case"\ue027":case"\ue028":case"\ue029":case"\ue054":case"\ue055":case"\ue056":case"\ue057":case"\ue058":case"\ue059":case"\ue05a":case"\ue05b":case"\ue05c":case"\ue05d":return 3;case"\ue050":case"\ue051":case"\ue052":case"\ue053":return 2;default:return 0}};var We={};Object.defineProperty(We,"__esModule",{value:!0}),We.KeyToKeyCode=void 0,We.KeyToKeyCode={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,Abort:3,Help:6,Backspace:8,Tab:9,Numpad5:12,NumpadEnter:13,Enter:13,"\\r":13,"\\n":13,ShiftLeft:16,ShiftRight:16,ControlLeft:17,ControlRight:17,AltLeft:18,AltRight:18,Pause:19,CapsLock:20,Escape:27,Convert:28,NonConvert:29,Space:32,Numpad9:33,PageUp:33,Numpad3:34,PageDown:34,End:35,Numpad1:35,Home:36,Numpad7:36,ArrowLeft:37,Numpad4:37,Numpad8:38,ArrowUp:38,ArrowRight:39,Numpad6:39,Numpad2:40,ArrowDown:40,Select:41,Open:43,PrintScreen:44,Insert:45,Numpad0:45,Delete:46,NumpadDecimal:46,Digit0:48,Digit1:49,Digit2:50,Digit3:51,Digit4:52,Digit5:53,Digit6:54,Digit7:55,Digit8:56,Digit9:57,KeyA:65,KeyB:66,KeyC:67,KeyD:68,KeyE:69,KeyF:70,KeyG:71,KeyH:72,KeyI:73,KeyJ:74,KeyK:75,KeyL:76,KeyM:77,KeyN:78,KeyO:79,KeyP:80,KeyQ:81,KeyR:82,KeyS:83,KeyT:84,KeyU:85,KeyV:86,KeyW:87,KeyX:88,KeyY:89,KeyZ:90,MetaLeft:91,MetaRight:92,ContextMenu:93,NumpadMultiply:106,NumpadAdd:107,NumpadSubtract:109,NumpadDivide:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,F20:131,F21:132,F22:133,F23:134,F24:135,NumLock:144,ScrollLock:145,AudioVolumeMute:173,AudioVolumeDown:174,AudioVolumeUp:175,MediaTrackNext:176,MediaTrackPrevious:177,MediaStop:178,MediaPlayPause:179,Semicolon:186,Equal:187,NumpadEqual:187,Comma:188,Minus:189,Period:190,Slash:191,Backquote:192,BracketLeft:219,Backslash:220,BracketRight:221,Quote:222,AltGraph:225,Props:247,Cancel:3,Clear:12,Shift:16,Control:17,Alt:18,Accept:30,ModeChange:31," ":32,Print:42,Execute:43,"\\u0000":46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,Meta:91,"*":106,"+":107,"-":109,"/":111,";":186,"=":187,",":188,".":190,"`":192,"[":219,"\\\\":220,"]":221,"'":222,Attn:246,CrSel:247,ExSel:248,EraseEof:249,Play:250,ZoomOut:251,")":48,"!":49,"@":50,"#":51,$:52,"%":53,"^":54,"&":55,"(":57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,":":186,"<":188,_:189,">":190,"?":191,"~":192,"{":219,"|":220,"}":221,'"':222,Camera:44,EndCall:95,VolumeDown:182,VolumeUp:183},Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.ActionDispatcher=void 0;const He=g,Je=J,Ge=$e,Xe=Ke,Ye=We,Qe=(e=>{const t=e.getClientRects()[0],a=Math.max(0,Math.min(t.x,t.x+t.width)),r=Math.min(window.innerWidth,Math.max(t.x,t.x+t.width)),n=Math.max(0,Math.min(t.y,t.y+t.height));return[a+(r-a>>1),n+(Math.min(window.innerHeight,Math.max(t.y,t.y+t.height))-n>>1)]}).toString(),et=(()=>navigator.platform.toLowerCase().includes("mac")).toString();Ve.ActionDispatcher=class{static isMacOS=async e=>{const t=await(await e.getOrCreateSandbox(void 0)).callFunction(et,{type:"undefined"},[],!1,"none",{});return(0,Je.assert)("exception"!==t.type),(0,Je.assert)("boolean"===t.result.type),t.result.value};#je=0;#Oe=0;#Me;#Be;#Ae;constructor(e,t,a){this.#Me=e,this.#Be=t,this.#Ae=a}async dispatchActions(e){await this.#Me.queue.run((async()=>{for(const t of e)await this.dispatchTickActions(t)}))}async dispatchTickActions(e){this.#je=performance.now(),this.#Oe=0;for(const{action:t}of e)"duration"in t&&void 0!==t.duration&&(this.#Oe=Math.max(this.#Oe,t.duration));const t=[new Promise((e=>setTimeout(e,this.#Oe)))];for(const a of e)t.push(this.#De(a));await Promise.all(t)}async#De({id:e,action:t}){const a=this.#Me.get(e),r=this.#Me.getGlobalKeyState();switch(t.type){case"keyDown":await this.#ze(a,t),this.#Me.cancelList.push({id:e,action:{...t,type:"keyUp"}});break;case"keyUp":await this.#Le(a,t);break;case"pause":break;case"pointerDown":await this.#Ze(a,r,t),this.#Me.cancelList.push({id:e,action:{...t,type:"pointerUp"}});break;case"pointerMove":await this.#Ue(a,r,t);break;case"pointerUp":await this.#Fe(a,r,t);break;case"scroll":await this.#qe(a,r,t)}}#Ze(e,t,a){const{button:r}=a;if(e.pressed.has(r))return;e.pressed.add(r);const{x:n,y:s,subtype:o}=e,{width:i,height:c,pressure:d,twist:u,tangentialPressure:l}=a,{tiltX:h,tiltY:p}=nt(a),{modifiers:m}=t;switch(o){case"mouse":case"pen":return this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchMouseEvent",{type:"mousePressed",x:n,y:s,modifiers:m,button:rt(r),buttons:e.buttons,clickCount:e.setClickCount(r,new Ge.PointerSource.ClickContext(n,s,performance.now())),pointerType:o,tangentialPressure:l,tiltX:h,tiltY:p,twist:u,force:d});case"touch":return this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchTouchEvent",{type:"touchStart",touchPoints:[{x:n,y:s,...st(i??1,c??1),tangentialPressure:l,tiltX:h,tiltY:p,twist:u,force:d,id:e.pointerId}],modifiers:m})}}#Fe(e,t,a){const{button:r}=a;if(!e.pressed.has(r))return;e.pressed.delete(r);const{x:n,y:s,subtype:o}=e,{modifiers:i}=t;switch(o){case"mouse":case"pen":return this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchMouseEvent",{type:"mouseReleased",x:n,y:s,modifiers:i,button:rt(r),buttons:e.buttons,clickCount:e.getClickCount(r),pointerType:o});case"touch":return this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchTouchEvent",{type:"touchEnd",touchPoints:[{x:n,y:s,id:e.pointerId}],modifiers:i})}}async#Ue(e,t,a){const{x:r,y:n,subtype:s}=e,{width:o,height:i,pressure:c,twist:d,tangentialPressure:u,x:l,y:h,origin:p="viewport",duration:m=this.#Oe}=a,{tiltX:f,tiltY:g}=nt(a),{targetX:y,targetY:S}=await this.#Ve(p,l,h,r,n);if(y<0||S<0)throw new He.MoveTargetOutOfBoundsException(`Cannot move beyond viewport (x: ${y}, y: ${S})`);let v;do{const a=m>0?(performance.now()-this.#je)/m:1;let l,h;if(v=a>=1,v?(l=y,h=S):(l=Math.round(a*(y-r)+r),h=Math.round(a*(S-n)+n)),e.x!==l||e.y!==h){const{modifiers:a}=t;switch(s){case"mouse":await this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchMouseEvent",{type:"mouseMoved",x:l,y:h,modifiers:a,clickCount:0,button:rt(e.pressed.values().next().value??5),buttons:e.buttons,pointerType:s,tangentialPressure:u,tiltX:f,tiltY:g,twist:d,force:c});break;case"pen":0!==e.pressed.size&&await this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchMouseEvent",{type:"mouseMoved",x:l,y:h,modifiers:a,clickCount:0,button:rt(e.pressed.values().next().value??5),buttons:e.buttons,pointerType:s,tangentialPressure:u,tiltX:f,tiltY:g,twist:d,force:c});break;case"touch":0!==e.pressed.size&&await this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchTouchEvent",{type:"touchMove",touchPoints:[{x:l,y:h,...st(o??1,i??1),tangentialPressure:u,tiltX:f,tiltY:g,twist:d,force:c,id:e.pointerId}],modifiers:a})}e.x=l,e.y=h}}while(!v)}async#Ve(e,t,a,r,n){let s,o;switch(e){case"viewport":s=t,o=a;break;case"pointer":s=r+t,o=n+a;break;default:{const{x:r,y:n}=await async function(e,t){const a=await e.getOrCreateSandbox(void 0),r=await a.callFunction(Qe,{type:"undefined"},[t],!1,"none",{});if("exception"===r.type)throw new He.NoSuchElementException(`Origin element ${t.sharedId} was not found`);(0,Je.assert)("array"===r.result.type),(0,Je.assert)("number"===r.result.value?.[0]?.type),(0,Je.assert)("number"===r.result.value?.[1]?.type);const{result:{value:[{value:n},{value:s}]}}=r;return{x:n,y:s}}(this.#Be,e.element);s=r+t,o=n+a;break}}return{targetX:s,targetY:o}}async#qe(e,t,a){const{deltaX:r,deltaY:n,x:s,y:o,origin:i="viewport",duration:c=this.#Oe}=a;if("pointer"===i)throw new He.InvalidArgumentException('"pointer" origin is invalid for scrolling.');const{targetX:d,targetY:u}=await this.#Ve(i,s,o,0,0);if(d<0||u<0)throw new He.MoveTargetOutOfBoundsException(`Cannot move beyond viewport (x: ${d}, y: ${u})`);let l,h=0,p=0;do{const e=c>0?(performance.now()-this.#je)/c:1;let a,s;if(l=e>=1,l?(a=r-h,s=n-p):(a=Math.round(e*r-h),s=Math.round(e*n-p)),0!==a||0!==s){const{modifiers:e}=t;await this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchMouseEvent",{type:"mouseWheel",deltaX:a,deltaY:s,x:d,y:u,modifiers:e}),h+=a,p+=s}}while(!l)}async#ze(e,t){if([...t.value].length>1)throw new He.InvalidArgumentException(`Invalid key value: ${t.value}`);const a=t.value,r=(0,Xe.getNormalizedKey)(a),n=e.pressed.has(r),s=(0,Xe.getKeyCode)(a),o=(0,Xe.getKeyLocation)(a);switch(r){case"Alt":e.alt=!0;break;case"Shift":e.shift=!0;break;case"Control":e.ctrl=!0;break;case"Meta":e.meta=!0}e.pressed.add(r);const{modifiers:i}=e,c=tt(r,e),d=at(s??"",e)??c;let u;if(this.#Ae&&e.meta)switch(s){case"KeyA":u="SelectAll";break;case"KeyC":u="Copy";break;case"KeyV":u=e.shift?"PasteAndMatchStyle":"Paste";break;case"KeyX":u="Cut";break;case"KeyZ":u=e.shift?"Redo":"Undo"}const l=[this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchKeyEvent",{type:d?"keyDown":"rawKeyDown",windowsVirtualKeyCode:Ye.KeyToKeyCode[r],key:r,code:s,text:d,unmodifiedText:c,autoRepeat:n,isSystemKey:e.alt||void 0,location:o<3?o:void 0,isKeypad:3===o,modifiers:i,commands:u?[u]:void 0})];"Escape"===r&&(e.alt||(!this.#Ae||e.ctrl||e.meta)&&this.#Ae||l.push(this.#Be.cdpTarget.cdpClient.sendCommand("Input.cancelDragging"))),await Promise.all(l)}#Le(e,t){if([...t.value].length>1)throw new He.InvalidArgumentException(`Invalid key value: ${t.value}`);const a=t.value,r=(0,Xe.getNormalizedKey)(a);if(!e.pressed.has(r))return;const n=(0,Xe.getKeyCode)(a),s=(0,Xe.getKeyLocation)(a);switch(r){case"Alt":e.alt=!1;break;case"Shift":e.shift=!1;break;case"Control":e.ctrl=!1;break;case"Meta":e.meta=!1}e.pressed.delete(r);const{modifiers:o}=e,i=tt(r,e),c=at(n??"",e)??i;return this.#Be.cdpTarget.cdpClient.sendCommand("Input.dispatchKeyEvent",{type:"keyUp",windowsVirtualKeyCode:Ye.KeyToKeyCode[r],key:r,code:n,text:c,unmodifiedText:i,location:s<3?s:void 0,isSystemKey:e.alt||void 0,isKeypad:3===s,modifiers:o})}};const tt=(e,t)=>"Enter"===e?"\r":1===[...e].length?t.shift?e.toLocaleUpperCase("en-US"):e:void 0,at=(e,t)=>{if(t.ctrl){switch(e){case"Digit2":if(t.shift)return"\0";break;case"KeyA":return"\x01";case"KeyB":return"\x02";case"KeyC":return"\x03";case"KeyD":return"\x04";case"KeyE":return"\x05";case"KeyF":return"\x06";case"KeyG":return"\x07";case"KeyH":return"\b";case"KeyI":return"\t";case"KeyJ":return"\n";case"KeyK":return"\v";case"KeyL":return"\f";case"KeyM":return"\r";case"KeyN":return"\x0e";case"KeyO":return"\x0f";case"KeyP":return"\x10";case"KeyQ":return"\x11";case"KeyR":return"\x12";case"KeyS":return"\x13";case"KeyT":return"\x14";case"KeyU":return"\x15";case"KeyV":return"\x16";case"KeyW":return"\x17";case"KeyX":return"\x18";case"KeyY":return"\x19";case"KeyZ":return"\x1a";case"BracketLeft":return"\x1b";case"Backslash":return"\x1c";case"BracketRight":return"\x1d";case"Digit6":if(t.shift)return"\x1e";break;case"Minus":return"\x1f"}return""}if(t.alt)return""};function rt(e){switch(e){case 0:return"left";case 1:return"middle";case 2:return"right";case 3:return"back";case 4:return"forward";default:return"none"}}function nt(e){const t=e.altitudeAngle??0,a=e.azimuthAngle??0;let r=0,n=0;if(0===t&&(0!==a&&a!==2*Math.PI||(r=Math.PI/2),a===Math.PI/2&&(n=Math.PI/2),a===Math.PI&&(r=-Math.PI/2),a===3*Math.PI/2&&(n=-Math.PI/2),a>0&&a<Math.PI/2&&(r=Math.PI/2,n=Math.PI/2),a>Math.PI/2&&a<Math.PI&&(r=-Math.PI/2,n=Math.PI/2),a>Math.PI&&a<3*Math.PI/2&&(r=-Math.PI/2,n=-Math.PI/2),a>3*Math.PI/2&&a<2*Math.PI&&(r=Math.PI/2,n=-Math.PI/2)),0!==t){const e=Math.tan(t);r=Math.atan(Math.cos(a)/e),n=Math.atan(Math.sin(a)/e)}const s=180/Math.PI;return{tiltX:Math.round(r*s),tiltY:Math.round(n*s)}}function st(e,t){return{radiusX:e?e/2:.5,radiusY:t?t/2:.5}}var ot={},it={},ct={};Object.defineProperty(ct,"__esModule",{value:!0}),ct.Mutex=void 0;ct.Mutex=class{#$e=!1;#Ke=[];acquire(){const e={resolved:!1};return this.#$e?new Promise((t=>{this.#Ke.push((()=>t(this.#We.bind(this,e))))})):(this.#$e=!0,Promise.resolve(this.#We.bind(this,e)))}#We(e){if(e.resolved)throw new Error("Cannot release more than once.");e.resolved=!0;const t=this.#Ke.shift();t?t():this.#$e=!1}async run(e){const t=await this.acquire();try{return await e()}finally{t()}}},Object.defineProperty(it,"__esModule",{value:!0}),it.InputState=void 0;const dt=g,ut=ct,lt=$e;it.InputState=class{cancelList=[];#He=new Map;#Je=new ut.Mutex;getOrCreate(e,t,a){let r=this.#He.get(e);if(!r){switch(t){case"none":r=new lt.NoneSource;break;case"key":r=new lt.KeySource;break;case"pointer":{let e="mouse"===a?0:2;const t=new Set;for(const[,e]of this.#He)"pointer"===e.type&&t.add(e.pointerId);for(;t.has(e);)++e;r=new lt.PointerSource(e,a);break}case"wheel":r=new lt.WheelSource;break;default:throw new dt.InvalidArgumentException(`Expected "none", "key", "pointer", or "wheel". Found unknown source type ${t}.`)}return this.#He.set(e,r),r}if(r.type!==t)throw new dt.InvalidArgumentException(`Input source type of ${e} is ${r.type}, but received ${t}.`);return r}get(e){const t=this.#He.get(e);if(!t)throw new dt.UnknownErrorException("Internal error.");return t}getGlobalKeyState(){const e=new lt.KeySource;for(const[,t]of this.#He)if("key"===t.type){for(const a of t.pressed)e.pressed.add(a);e.alt||=t.alt,e.ctrl||=t.ctrl,e.meta||=t.meta,e.shift||=t.shift}return e}get queue(){return this.#Je}},Object.defineProperty(ot,"__esModule",{value:!0}),ot.InputStateManager=void 0;const ht=J,pt=it;class mt extends WeakMap{get(e){return(0,ht.assert)(e.isTopLevelContext()),this.has(e)||this.set(e,new pt.InputState),super.get(e)}}ot.InputStateManager=mt,Object.defineProperty(qe,"__esModule",{value:!0}),qe.InputProcessor=void 0;const ft=g,gt=J,yt=Ve,St=ot;qe.InputProcessor=class{#i;#C;#Ge=new St.InputStateManager;constructor(e,t){this.#i=e,this.#C=t}async performActions(e){const t=this.#i.getContext(e.context),a=this.#Ge.get(t.top),r=this.#Xe(e,a),n=new yt.ActionDispatcher(a,t,await yt.ActionDispatcher.isMacOS(t).catch((()=>!1)));return await n.dispatchActions(r),{}}async releaseActions(e){const t=this.#i.getContext(e.context),a=t.top,r=this.#Ge.get(a),n=new yt.ActionDispatcher(r,t,await yt.ActionDispatcher.isMacOS(t).catch((()=>!1)));return await n.dispatchTickActions(r.cancelList.reverse()),this.#Ge.delete(a),{}}async setFiles(e){const t=this.#i.getContext(e.context),a=await t.getOrCreateSandbox(void 0);let r;try{const t=await a.callFunction(String((function(){return this instanceof HTMLInputElement&&"file"===this.type&&!this.disabled})),e.element,[],!1,"none",{},!1);(0,gt.assert)("success"===t.type),(0,gt.assert)("boolean"===t.result.type),r=t.result.value}catch{throw new ft.NoSuchElementException(`Could not find element ${e.element.sharedId}`)}if(!r)throw new ft.UnableToSetFileInputException(`Element ${e.element.sharedId} is not a mutable file input.`);if(0===e.files.length)return await a.callFunction(String((function(){0!==this.files?.length?(this.files=(new DataTransfer).files,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))):this.dispatchEvent(new Event("cancel",{bubbles:!0}))})),e.element,[],!1,"none",{},!1),{};const n=[];for(let t=0;t<e.files.length;++t){const t=await a.callFunction(String((function(e){return this.files?.item(e)})),e.element,[{type:"number",value:0}],!1,"root",{},!1);if((0,gt.assert)("success"===t.type),"object"!==t.result.type)break;const{handle:r}=t.result;(0,gt.assert)(void 0!==r);const{path:s}=await a.cdpClient.sendCommand("DOM.getFileInfo",{objectId:r});n.push(s),a.disown(r).catch(void 0)}n.sort();const s=[...e.files].sort();if(n.length!==e.files.length||s.some(((e,t)=>n[t]!==e))){const{objectId:t}=await a.deserializeForCdp(e.element);(0,gt.assert)(void 0!==t),await a.cdpClient.sendCommand("DOM.setFileInputFiles",{files:e.files,objectId:t})}else await a.callFunction(String((function(){this.dispatchEvent(new Event("cancel",{bubbles:!0}))})),e.element,[],!1,"none",{},!1);return{}}#Xe(e,t){const a=[];for(const r of e.actions){switch(r.type){case"pointer":{r.parameters??={pointerType:"mouse"},r.parameters.pointerType??="mouse";const e=t.getOrCreate(r.id,"pointer",r.parameters.pointerType);if(e.subtype!==r.parameters.pointerType)throw new ft.InvalidArgumentException(`Expected input source ${r.id} to be ${e.subtype}; got ${r.parameters.pointerType}.`);break}default:t.getOrCreate(r.id,r.type)}const e=r.actions.map((e=>({id:r.id,action:e})));for(let t=0;t<e.length;t++)a.length===t&&a.push([]),a[t].push(e[t])}return a}};var vt={},wt={},Ct={},bt=Object.defineProperty,xt=Object.getOwnPropertyDescriptor,Pt=Object.getOwnPropertyNames,It=Object.prototype.hasOwnProperty,kt={};((e,t)=>{for(var a in t)bt(e,a,{get:t[a],enumerable:!0})})(kt,{URLPattern:()=>ha});var Rt,Et=(Rt=kt,((e,t,a,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Pt(t))!It.call(e,n)&&n!==a&&bt(e,n,{get:()=>t[n],enumerable:!(r=xt(t,n))||r.enumerable});return e})(bt({},"__esModule",{value:!0}),Rt)),_t=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(e,t,a,r,n,s){this.type=e,this.name=t,this.prefix=a,this.value=r,this.suffix=n,this.modifier=s}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}},Tt=/[$_\p{ID_Start}]/u,Nt=/[$_\u200C\u200D\p{ID_Continue}]/u,jt=".*";function Ot(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function Mt(e,t=!1){let a=[],r=0;for(;r<e.length;){let n=e[r],s=function(n){if(!t)throw new TypeError(n);a.push({type:"INVALID_CHAR",index:r,value:e[r++]})};if("*"!==n)if("+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)a.push({type:"CHAR",index:r,value:e[r++]});else{let t=1,n="",o=r+1,i=!1;if("?"===e[o]){s(`Pattern cannot start with "?" at ${o}`);continue}for(;o<e.length;){if(!Ot(e[o],!1)){s(`Invalid character '${e[o]}' at ${o}.`),i=!0;break}if("\\"!==e[o]){if(")"===e[o]){if(t--,0===t){o++;break}}else if("("===e[o]&&(t++,"?"!==e[o+1])){s(`Capturing groups are not allowed at ${o}`),i=!0;break}n+=e[o++]}else n+=e[o++]+e[o++]}if(i)continue;if(t){s(`Unbalanced pattern at ${r}`);continue}if(!n){s(`Missing pattern at ${r}`);continue}a.push({type:"REGEX",index:r,value:n}),r=o}else{let t="",n=r+1;for(;n<e.length;){let a=e.substr(n,1);if(!(n===r+1&&Tt.test(a)||n!==r+1&&Nt.test(a)))break;t+=e[n++]}if(!t){s(`Missing parameter name at ${r}`);continue}a.push({type:"NAME",index:r,value:t}),r=n}else a.push({type:"CLOSE",index:r,value:e[r++]});else a.push({type:"OPEN",index:r,value:e[r++]});else a.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else a.push({type:"OTHER_MODIFIER",index:r,value:e[r++]});else a.push({type:"ASTERISK",index:r,value:e[r++]})}return a.push({type:"END",index:r,value:""}),a}function Bt(e,t={}){let a=Mt(e);t.delimiter??="/#?",t.prefixes??="./";let r=`[^${At(t.delimiter)}]+?`,n=[],s=0,o=0,i=new Set,c=e=>{if(o<a.length&&a[o].type===e)return a[o++].value},d=()=>c("OTHER_MODIFIER")??c("ASTERISK"),u=e=>{let t=c(e);if(void 0!==t)return t;let{type:r,index:n}=a[o];throw new TypeError(`Unexpected ${r} at ${n}, expected ${e}`)},l=()=>{let e,t="";for(;e=c("CHAR")??c("ESCAPED_CHAR");)t+=e;return t},h=t.encodePart||(e=>e),p="",m=e=>{p+=e},f=()=>{p.length&&(n.push(new _t(3,"","",h(p),"",3)),p="")},g=(e,t,a,o,c)=>{let d,u=3;switch(c){case"?":u=1;break;case"*":u=0;break;case"+":u=2}if(!t&&!a&&3===u)return void m(e);if(f(),!t&&!a){if(!e)return;return void n.push(new _t(3,"","",h(e),"",u))}d=a?"*"===a?jt:a:r;let l,p=2;if(d===r?(p=1,d=""):d===jt&&(p=0,d=""),t?l=t:a&&(l=s++),i.has(l))throw new TypeError(`Duplicate name '${l}'.`);i.add(l),n.push(new _t(p,l,h(e),d,h(o),u))};for(;o<a.length;){let e=c("CHAR"),a=c("NAME"),r=c("REGEX");if(!a&&!r&&(r=c("ASTERISK")),a||r){let n=e??"";-1===t.prefixes.indexOf(n)&&(m(n),n=""),f(),g(n,a,r,"",d());continue}let n=e??c("ESCAPED_CHAR");if(n)m(n);else if(c("OPEN")){let e=l(),t=c("NAME"),a=c("REGEX");!t&&!a&&(a=c("ASTERISK"));let r=l();u("CLOSE"),g(e,t,a,r,d())}else f(),u("END")}return n}function At(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Dt(e){return e&&e.ignoreCase?"ui":"u"}function zt(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function Lt(e,t,a={}){a.delimiter??="/#?",a.prefixes??="./",a.sensitive??=!1,a.strict??=!1,a.end??=!0,a.start??=!0,a.endsWith="";let r=a.start?"^":"";for(let n of e){if(3===n.type){3===n.modifier?r+=At(n.value):r+=`(?:${At(n.value)})${zt(n.modifier)}`;continue}t&&t.push(n.name);let e=`[^${At(a.delimiter)}]+?`,s=n.value;(1===n.type?s=e:0===n.type&&(s=jt),n.prefix.length||n.suffix.length)?3!==n.modifier&&1!==n.modifier?(r+=`(?:${At(n.prefix)}`,r+=`((?:${s})(?:`,r+=At(n.suffix),r+=At(n.prefix),r+=`(?:${s}))*)${At(n.suffix)})`,0===n.modifier&&(r+="?")):(r+=`(?:${At(n.prefix)}(${s})${At(n.suffix)})`,r+=zt(n.modifier)):3===n.modifier||1===n.modifier?r+=`(${s})${zt(n.modifier)}`:r+=`((?:${s})${zt(n.modifier)})`}let n=`[${At(a.endsWith)}]|$`,s=`[${At(a.delimiter)}]`;if(a.end)return a.strict||(r+=`${s}?`),a.endsWith.length?r+=`(?=${n})`:r+="$",new RegExp(r,Dt(a));a.strict||(r+=`(?:${s}(?=${n}))?`);let o=!1;if(e.length){let t=e[e.length-1];3===t.type&&3===t.modifier&&(o=a.delimiter.indexOf(t)>-1)}return o||(r+=`(?=${s}|${n})`),new RegExp(r,Dt(a))}var Zt={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Ut={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Ft={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function qt(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function Vt(e){return!(!e||e.length<2)&&("["===e[0]||("\\"===e[0]||"{"===e[0])&&"["===e[1])}var $t=["ftp","file","http","https","ws","wss"];function Kt(e){if(!e)return!0;for(let t of $t)if(e.test(t))return!0;return!1}function Wt(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function Ht(e){if(""===e)return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function Jt(e){if(""===e)return e;let t=new URL("https://example.com");return t.username=e,t.username}function Gt(e){if(""===e)return e;let t=new URL("https://example.com");return t.password=e,t.password}function Xt(e){if(""===e)return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function Yt(e){if(""===e)return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function Qt(e){if(""===e||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function ea(e){if(""===e)return e;let t=new URL("https://example.com");return t.pathname="/"!==e[0]?"/-"+e:e,"/"!==e[0]?t.pathname.substring(2,t.pathname.length):t.pathname}function ta(e){return""===e?e:new URL(`data:${e}`).pathname}function aa(e){if(""===e)return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function ra(e){if(""===e)return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}var na=class{#Ye;#Qe=[];#et={};#tt=0;#at=1;#rt=0;#nt=0;#st=0;#ot=0;#it=!1;constructor(e){this.#Ye=e}get result(){return this.#et}parse(){for(this.#Qe=Mt(this.#Ye,!0);this.#tt<this.#Qe.length;this.#tt+=this.#at){if(this.#at=1,"END"===this.#Qe[this.#tt].type){if(0===this.#nt){this.#ct(),this.#dt()?this.#ut(9,1):this.#lt()?this.#ut(8,1):this.#ut(7,0);continue}if(2===this.#nt){this.#ht(5);continue}this.#ut(10,0);break}if(this.#st>0){if(!this.#pt())continue;this.#st-=1}if(this.#mt())this.#st+=1;else switch(this.#nt){case 0:this.#ft()&&this.#ht(1);break;case 1:if(this.#ft()){this.#gt();let e=7,t=1;this.#yt()?(e=2,t=3):this.#it&&(e=2),this.#ut(e,t)}break;case 2:this.#St()?this.#ht(3):(this.#Ee()||this.#lt()||this.#dt())&&this.#ht(5);break;case 3:this.#vt()?this.#ut(4,1):this.#St()&&this.#ut(5,1);break;case 4:this.#St()&&this.#ut(5,1);break;case 5:this.#_e()?this.#ot+=1:this.#wt()&&(this.#ot-=1),this.#Ct()&&!this.#ot?this.#ut(6,1):this.#Ee()?this.#ut(7,0):this.#lt()?this.#ut(8,1):this.#dt()&&this.#ut(9,1);break;case 6:this.#Ee()?this.#ut(7,0):this.#lt()?this.#ut(8,1):this.#dt()&&this.#ut(9,1);break;case 7:this.#lt()?this.#ut(8,1):this.#dt()&&this.#ut(9,1);break;case 8:this.#dt()&&this.#ut(9,1)}}void 0!==this.#et.hostname&&void 0===this.#et.port&&(this.#et.port="")}#ut(e,t){switch(this.#nt){case 0:case 2:break;case 1:this.#et.protocol=this.#bt();break;case 3:this.#et.username=this.#bt();break;case 4:this.#et.password=this.#bt();break;case 5:this.#et.hostname=this.#bt();break;case 6:this.#et.port=this.#bt();break;case 7:this.#et.pathname=this.#bt();break;case 8:this.#et.search=this.#bt();break;case 9:this.#et.hash=this.#bt()}0!==this.#nt&&10!==e&&([1,2,3,4].includes(this.#nt)&&[6,7,8,9].includes(e)&&(this.#et.hostname??=""),[1,2,3,4,5,6].includes(this.#nt)&&[8,9].includes(e)&&(this.#et.pathname??=this.#it?"/":""),[1,2,3,4,5,6,7].includes(this.#nt)&&9===e&&(this.#et.search??="")),this.#xt(e,t)}#xt(e,t){this.#nt=e,this.#rt=this.#tt+t,this.#tt+=t,this.#at=0}#ct(){this.#tt=this.#rt,this.#at=0}#ht(e){this.#ct(),this.#nt=e}#Pt(e){return e<0&&(e=this.#Qe.length-e),e<this.#Qe.length?this.#Qe[e]:this.#Qe[this.#Qe.length-1]}#It(e,t){let a=this.#Pt(e);return a.value===t&&("CHAR"===a.type||"ESCAPED_CHAR"===a.type||"INVALID_CHAR"===a.type)}#ft(){return this.#It(this.#tt,":")}#yt(){return this.#It(this.#tt+1,"/")&&this.#It(this.#tt+2,"/")}#St(){return this.#It(this.#tt,"@")}#vt(){return this.#It(this.#tt,":")}#Ct(){return this.#It(this.#tt,":")}#Ee(){return this.#It(this.#tt,"/")}#lt(){if(this.#It(this.#tt,"?"))return!0;if("?"!==this.#Qe[this.#tt].value)return!1;let e=this.#Pt(this.#tt-1);return"NAME"!==e.type&&"REGEX"!==e.type&&"CLOSE"!==e.type&&"ASTERISK"!==e.type}#dt(){return this.#It(this.#tt,"#")}#mt(){return"OPEN"==this.#Qe[this.#tt].type}#pt(){return"CLOSE"==this.#Qe[this.#tt].type}#_e(){return this.#It(this.#tt,"[")}#wt(){return this.#It(this.#tt,"]")}#bt(){let e=this.#Qe[this.#tt],t=this.#Pt(this.#rt).index;return this.#Ye.substring(t,e.index)}#gt(){let e={};Object.assign(e,Zt),e.encodePart=Ht;let t=function(e,t,a){return Lt(Bt(e,a),t,a)}(this.#bt(),void 0,e);this.#it=Kt(t)}},sa=["protocol","username","password","hostname","port","pathname","search","hash"],oa="*";function ia(e,t){if("string"!=typeof e)throw new TypeError("parameter 1 is not of type 'string'.");let a=new URL(e,t);return{protocol:a.protocol.substring(0,a.protocol.length-1),username:a.username,password:a.password,hostname:a.hostname,port:a.port,pathname:a.pathname,search:""!==a.search?a.search.substring(1,a.search.length):void 0,hash:""!==a.hash?a.hash.substring(1,a.hash.length):void 0}}function ca(e,t){return t?ua(e):e}function da(e,t,a){let r;if("string"==typeof t.baseURL)try{r=new URL(t.baseURL),void 0===t.protocol&&(e.protocol=ca(r.protocol.substring(0,r.protocol.length-1),a)),!a&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&(e.username=ca(r.username,a)),!a&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&void 0===t.password&&(e.password=ca(r.password,a)),void 0===t.protocol&&void 0===t.hostname&&(e.hostname=ca(r.hostname,a)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&(e.port=ca(r.port,a)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&(e.pathname=ca(r.pathname,a)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&(e.search=ca(r.search.substring(1,r.search.length),a)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&void 0===t.hash&&(e.hash=ca(r.hash.substring(1,r.hash.length),a))}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if("string"==typeof t.protocol&&(e.protocol=function(e,t){return e=function(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}(e,":"),t||""===e?e:Ht(e)}(t.protocol,a)),"string"==typeof t.username&&(e.username=function(e,t){if(t||""===e)return e;let a=new URL("https://example.com");return a.username=e,a.username}(t.username,a)),"string"==typeof t.password&&(e.password=function(e,t){if(t||""===e)return e;let a=new URL("https://example.com");return a.password=e,a.password}(t.password,a)),"string"==typeof t.hostname&&(e.hostname=function(e,t){return t||""===e?e:Vt(e)?Yt(e):Xt(e)}(t.hostname,a)),"string"==typeof t.port&&(e.port=function(e,t,a){return Wt(t)===e&&(e=""),a||""===e?e:Qt(e)}(t.port,e.protocol,a)),"string"==typeof t.pathname){if(e.pathname=t.pathname,r&&!function(e,t){return!(!e.length||"/"!==e[0]&&(!t||e.length<2||"\\"!=e[0]&&"{"!=e[0]||"/"!=e[1]))}(e.pathname,a)){let t=r.pathname.lastIndexOf("/");t>=0&&(e.pathname=ca(r.pathname.substring(0,t+1),a)+e.pathname)}e.pathname=function(e,t,a){if(a||""===e)return e;if(t&&!$t.includes(t))return new URL(`${t}:${e}`).pathname;let r="/"==e[0];return e=new URL(r?e:"/-"+e,"https://example.com").pathname,r||(e=e.substring(2,e.length)),e}(e.pathname,e.protocol,a)}return"string"==typeof t.search&&(e.search=function(e,t){if(e=qt(e,"?"),t||""===e)return e;let a=new URL("https://example.com");return a.search=e,a.search?a.search.substring(1,a.search.length):""}(t.search,a)),"string"==typeof t.hash&&(e.hash=function(e,t){if(e=qt(e,"#"),t||""===e)return e;let a=new URL("https://example.com");return a.hash=e,a.hash?a.hash.substring(1,a.hash.length):""}(t.hash,a)),e}function ua(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function la(e,t){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let a=`[^${function(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}(t.delimiter)}]+?`,r=/[$_\u200C\u200D\p{ID_Continue}]/u,n="";for(let s=0;s<e.length;++s){let o=e[s];if(3===o.type){if(3===o.modifier){n+=ua(o.value);continue}n+=`{${ua(o.value)}}${zt(o.modifier)}`;continue}let i=o.hasCustomName(),c=!!o.suffix.length||!!o.prefix.length&&(1!==o.prefix.length||!t.prefixes.includes(o.prefix)),d=s>0?e[s-1]:null,u=s<e.length-1?e[s+1]:null;if(!c&&i&&1===o.type&&3===o.modifier&&u&&!u.prefix.length&&!u.suffix.length)if(3===u.type){let e=u.value.length>0?u.value[0]:"";c=r.test(e)}else c=!u.hasCustomName();if(!c&&!o.prefix.length&&d&&3===d.type){let e=d.value[d.value.length-1];c=t.prefixes.includes(e)}c&&(n+="{"),n+=ua(o.prefix),i&&(n+=`:${o.name}`),2===o.type?n+=`(${o.value})`:1===o.type?i||(n+=`(${a})`):0===o.type&&(i||d&&3!==d.type&&3===d.modifier&&!c&&""===o.prefix?n+="(.*)":n+="*"),1===o.type&&i&&o.suffix.length&&r.test(o.suffix[0])&&(n+="\\"),n+=ua(o.suffix),c&&(n+="}"),3!==o.modifier&&(n+=zt(o.modifier))}return n}var ha=class{#Ye;#Qe={};#et={};#tt={};#at={};#rt=!1;constructor(e={},t,a){try{let r;if("string"==typeof t?r=t:a=t,"string"==typeof e){let t=new na(e);if(t.parse(),e=t.result,void 0===r&&"string"!=typeof e.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=r}else{if(!e||"object"!=typeof e)throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(r)throw new TypeError("parameter 1 is not of type 'string'.")}typeof a>"u"&&(a={ignoreCase:!1});let n,s={ignoreCase:!0===a.ignoreCase},o={pathname:oa,protocol:oa,username:oa,password:oa,hostname:oa,port:oa,search:oa,hash:oa};for(n of(this.#Ye=da(o,e,!0),Wt(this.#Ye.protocol)===this.#Ye.port&&(this.#Ye.port=""),sa)){if(!(n in this.#Ye))continue;let e={},t=this.#Ye[n];switch(this.#et[n]=[],n){case"protocol":Object.assign(e,Zt),e.encodePart=Ht;break;case"username":Object.assign(e,Zt),e.encodePart=Jt;break;case"password":Object.assign(e,Zt),e.encodePart=Gt;break;case"hostname":Object.assign(e,Ut),Vt(t)?e.encodePart=Yt:e.encodePart=Xt;break;case"port":Object.assign(e,Zt),e.encodePart=Qt;break;case"pathname":Kt(this.#Qe.protocol)?(Object.assign(e,Ft,s),e.encodePart=ea):(Object.assign(e,Zt,s),e.encodePart=ta);break;case"search":Object.assign(e,Zt,s),e.encodePart=aa;break;case"hash":Object.assign(e,Zt,s),e.encodePart=ra}try{this.#at[n]=Bt(t,e),this.#Qe[n]=Lt(this.#at[n],this.#et[n],e),this.#tt[n]=la(this.#at[n],e),this.#rt=this.#rt||this.#at[n].some((e=>2===e.type))}catch{throw new TypeError(`invalid ${n} pattern '${this.#Ye[n]}'.`)}}}catch(e){throw new TypeError(`Failed to construct 'URLPattern': ${e.message}`)}}test(e={},t){let a,r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{r=da(r,"object"==typeof e?e:ia(e,t),!1)}catch{return!1}for(a of sa)if(!this.#Qe[a].exec(r[a]))return!1;return!0}exec(e={},t){let a={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{a=da(a,"object"==typeof e?e:ia(e,t),!1)}catch{return null}let r,n={};for(r of(n.inputs=t?[e,t]:[e],sa)){let e=this.#Qe[r].exec(a[r]);if(!e)return null;let t={};for(let[a,n]of this.#et[r].entries())if("string"==typeof n||"number"==typeof n){let r=e[a+1];t[n]=r}n[r]={input:a[r]??"",groups:t}}return n}static compareComponent(e,t,a){let r=(e,t)=>{for(let a of["type","modifier","prefix","value","suffix"]){if(e[a]<t[a])return-1;if(e[a]!==t[a])return 1}return 0},n=new _t(3,"","","","",3),s=new _t(0,"","","","",3),o=(e,t)=>{let a=0;for(;a<Math.min(e.length,t.length);++a){let n=r(e[a],t[a]);if(n)return n}return e.length===t.length?0:r(e[a]??n,t[a]??n)};return t.#tt[e]||a.#tt[e]?t.#tt[e]&&!a.#tt[e]?o(t.#at[e],[s]):!t.#tt[e]&&a.#tt[e]?o([s],a.#at[e]):o(t.#at[e],a.#at[e]):0}get protocol(){return this.#tt.protocol}get username(){return this.#tt.username}get password(){return this.#tt.password}get hostname(){return this.#tt.hostname}get port(){return this.#tt.port}get pathname(){return this.#tt.pathname}get search(){return this.#tt.search}get hash(){return this.#tt.hash}get hasRegExpGroups(){return this.#rt}};const{URLPattern:pa}=Et;var ma={URLPattern:pa};globalThis.URLPattern||(globalThis.URLPattern=pa),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.URLPattern=void 0;const t=ma;Object.defineProperty(e,"URLPattern",{enumerable:!0,get:function(){return t.URLPattern}}),"URLPattern"in globalThis&&(t.URLPattern=globalThis.URLPattern)}(Ct),Object.defineProperty(wt,"__esModule",{value:!0}),wt.cdpFromSpecUrlPattern=wt.matchUrlPattern=wt.isSpecialScheme=wt.buildUrlPatternString=wt.sameSiteBiDiToCdp=wt.bidiToCdpCookie=wt.cdpToBiDiCookie=wt.cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction=wt.cdpFetchHeadersFromBidiNetworkHeaders=wt.bidiNetworkHeadersFromCdpFetchHeaders=wt.cdpNetworkHeadersFromBidiNetworkHeaders=wt.bidiNetworkHeadersFromCdpNetworkHeaders=wt.computeHeadersSize=void 0;const fa=I,ga=Ct;function ya(e){switch(e){case"Strict":return"strict";case"None":return"none";default:return"lax"}}function Sa(e){switch(e){case"strict":return"Strict";case"lax":return"Lax";case"none":return"None"}throw new fa.InvalidArgumentException(`Unknown 'sameSite' value ${e}`)}function va({protocol:e,hostname:t,port:a,pathname:r,search:n}){if(!(e||t||a||r||n))return"*";let s="";return e&&(s+=e,e.endsWith(":")||(s+=":"),wa(e)&&(s+="//")),t&&(s+=t),a&&(s+=`:${a}`),r&&(r.startsWith("/")||(s+="/"),s+=r),n&&(n.startsWith("?")||(s+="?"),s+=n),s}function wa(e){return["ftp","file","http","https","ws","wss"].includes(e.replace(/:$/,""))}wt.computeHeadersSize=function(e){const t=e.reduce(((e,t)=>`${e}${t.name}: ${t.value.value}\r\n`),"");return(new TextEncoder).encode(t).length},wt.bidiNetworkHeadersFromCdpNetworkHeaders=function(e){return e?Object.entries(e).map((([e,t])=>({name:e,value:{type:"string",value:t}}))):[]},wt.cdpNetworkHeadersFromBidiNetworkHeaders=function(e){if(void 0!==e)return e.reduce(((e,t)=>(e[t.name]=t.value.value,e)),{})},wt.bidiNetworkHeadersFromCdpFetchHeaders=function(e){return e?e.map((({name:e,value:t})=>({name:e,value:{type:"string",value:t}}))):[]},wt.cdpFetchHeadersFromBidiNetworkHeaders=function(e){if(void 0!==e)return e.map((({name:e,value:t})=>({name:e,value:t.value})))},wt.cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction=function(e){switch(e){case"default":return"Default";case"cancel":return"CancelAuth";case"provideCredentials":return"ProvideCredentials"}},wt.cdpToBiDiCookie=function(e){const t={name:e.name,value:{type:"string",value:e.value},domain:e.domain,path:e.path,size:e.size,httpOnly:e.httpOnly,secure:e.secure,sameSite:void 0===e.sameSite?"none":ya(e.sameSite),...e.expires>=0?{expiry:e.expires}:void 0};return t["goog:session"]=e.session,t["goog:priority"]=e.priority,t["goog:sameParty"]=e.sameParty,t["goog:sourceScheme"]=e.sourceScheme,t["goog:sourcePort"]=e.sourcePort,void 0!==e.partitionKey&&(t["goog:partitionKey"]=e.partitionKey),void 0!==e.partitionKeyOpaque&&(t["goog:partitionKeyOpaque"]=e.partitionKeyOpaque),t},wt.bidiToCdpCookie=function(e,t){if("string"!==e.cookie.value.type)throw new fa.UnsupportedOperationException("Only string cookie values are supported");const a=e.cookie.value.value,r={name:e.cookie.name,value:a,domain:e.cookie.domain,path:e.cookie.path??"/",secure:e.cookie.secure??!1,httpOnly:e.cookie.httpOnly??!1,...void 0!==t.sourceOrigin&&{partitionKey:t.sourceOrigin},...void 0!==e.cookie.expiry&&{expires:e.cookie.expiry},...void 0!==e.cookie.sameSite&&{sameSite:Sa(e.cookie.sameSite)}};return void 0!==e.cookie["goog:url"]&&(r.url=e.cookie["goog:url"]),void 0!==e.cookie["goog:priority"]&&(r.priority=e.cookie["goog:priority"]),void 0!==e.cookie["goog:sameParty"]&&(r.sameParty=e.cookie["goog:sameParty"]),void 0!==e.cookie["goog:sourceScheme"]&&(r.sourceScheme=e.cookie["goog:sourceScheme"]),void 0!==e.cookie["goog:sourcePort"]&&(r.sourcePort=e.cookie["goog:sourcePort"]),r},wt.sameSiteBiDiToCdp=Sa,wt.buildUrlPatternString=va,wt.isSpecialScheme=wa,wt.matchUrlPattern=function(e,t){switch(e.type){case"string":return e.pattern===t;case"pattern":return null!==new ga.URLPattern({protocol:e.protocol,hostname:e.hostname,port:e.port,pathname:e.pathname,search:e.search}).exec(t)}},wt.cdpFromSpecUrlPattern=function(e){switch(e.type){case"string":return e.pattern;case"pattern":return va(e)}},Object.defineProperty(vt,"__esModule",{value:!0}),vt.NetworkProcessor=void 0;const Ca=g,ba=J,xa=wt;class Pa{#pe;constructor(e){this.#pe=e}async addIntercept(e){const t=e.urlPatterns??[],a=Pa.parseUrlPatterns(t);return{intercept:await this.#pe.addIntercept({urlPatterns:a,phases:e.phases})}}async continueRequest(e){const t=e.request;void 0!==e.url&&Pa.parseUrlString(e.url);const a=this.#kt(t,"beforeRequestSent"),{url:r,method:n,headers:s}=e,o=(0,xa.cdpFetchHeadersFromBidiNetworkHeaders)(s);return await a.continueRequest(r,n,o),{}}async continueResponse(e){const t=e.request,{statusCode:a,reasonPhrase:r,headers:n}=e,s=this.#kt(t,"responseStarted"),o=(0,xa.cdpFetchHeadersFromBidiNetworkHeaders)(n);return await s.continueResponse({responseCode:a,responsePhrase:r,responseHeaders:o}),{}}async continueWithAuth(e){const t=e.request,a=this.#kt(t,"authRequired");let r,n;if("provideCredentials"===e.action){const{credentials:t}=e;r=t.username,n=t.password,(0,ba.assert)("password"===t.type,`Credentials type ${t.type} must be 'password'`)}const s=(0,xa.cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction)(e.action);return await a.continueWithAuth({response:s,username:r,password:n}),{}}async failRequest({request:e}){const t=this.#Rt(e);if("authRequired"===t.phase)throw new Ca.InvalidArgumentException(`Request '${e}' in 'authRequired' phase cannot be failed`);if(!t.blocked)throw new Ca.NoSuchRequestException(`No blocked request found for network id '${e}'`);return await t.failRequest("Failed"),{}}async provideResponse(e){const{statusCode:t,reasonPhrase:a,headers:r,body:n,request:s}=e,o=(0,xa.cdpFetchHeadersFromBidiNetworkHeaders)(r),i=this.#kt(s,null);return await i.provideResponse({responseCode:t??i.statusCode,responsePhrase:a,responseHeaders:o,body:n?.value}),{}}async removeIntercept(e){return await this.#pe.removeIntercept(e.intercept),{}}#Rt(e){const t=this.#pe.getRequestById(e);if(!t)throw new Ca.NoSuchRequestException(`Network request with ID '${e}' doesn't exist`);return t}#kt(e,t){const a=this.#Rt(e);if(!a.blocked)throw new Ca.NoSuchRequestException(`No blocked request found for network id '${e}'`);if(t&&a.phase!==t)throw new Ca.InvalidArgumentException(`Blocked request for network id '${e}' is in '${a.phase}' phase`);return a}static parseUrlString(e){try{return new URL(e)}catch(t){throw new Ca.InvalidArgumentException(`Invalid URL '${e}': ${t}`)}}static parseUrlPatterns(e){return e.map((e=>{switch(e.type){case"string":return Pa.parseUrlString(e.pattern),e;case"pattern":if(void 0===e.protocol&&void 0===e.hostname&&void 0===e.port&&void 0===e.pathname&&void 0===e.search)return e;if(""===e.protocol)throw new Ca.InvalidArgumentException("URL pattern must specify a protocol");if(""===e.hostname)throw new Ca.InvalidArgumentException("URL pattern must specify a hostname");if((e.hostname?.length??0)>0){if(e.protocol?.match(/^file/i))throw new Ca.InvalidArgumentException("URL pattern protocol cannot be 'file'");if(e.hostname?.includes(":"))throw new Ca.InvalidArgumentException("URL pattern hostname must not contain a colon")}if(""===e.port)throw new Ca.InvalidArgumentException("URL pattern must specify a port");try{new URL((0,xa.buildUrlPatternString)(e))}catch(e){throw new Ca.InvalidArgumentException(`${e}`)}return e}}))}}vt.NetworkProcessor=Pa;var Ia={},ka={};Object.defineProperty(ka,"__esModule",{value:!0}),ka.NetworkRequest=void 0;const Ra=g,Ea=J,_a=G,Ta=wt;class Na{static#Et="UNKNOWN";#u;#_t;#Tt;#Nt=!1;#jt;#Ot={};#Mt={};#Bt=new _a.Deferred;#At=new _a.Deferred;#Dt=new _a.Deferred;#y;#pe;#W;constructor(e,t,a,r,n=0){this.#u=e,this.#y=t,this.#pe=a,this.#W=r,this.#jt=n}get id(){return this.#u}get fetchId(){return this.#_t}get phase(){return this.#Tt}get url(){return this.#Mt.info?.url??this.#Ot.info?.request.url??this.#Ot.paused?.request.url??this.#Mt.paused?.request.url}get redirectCount(){return this.#jt}get blocked(){return this.#zt(this.#Tt)}get cdpClient(){return this.#W.cdpClient}isRedirecting(){return Boolean(this.#Ot.info)}#zt(e){return this.#pe.requestBlockedBy(this,e).size>0}handleRedirect(e){this.#Lt(),this.#Zt(),this.#Mt.hasExtraInfo=e.redirectHasExtraInfo,this.#Mt.info=e.redirectResponse,this.#Ut(!0)}#Ut(e=!1){const t=e||Boolean(this.#Ot.extraInfo)||this.#Nt||Boolean(this.#Mt.info&&!this.#Mt.hasExtraInfo),a=this.#zt("beforeRequestSent"),r=a&&Boolean(this.#Ot.paused)||!a;Boolean(this.#Ot.info)&&(a?r:t)&&this.#Bt.resolve({kind:"success",value:void 0});const n=Boolean(this.#Mt.extraInfo)||this.#Nt||Boolean(this.#Mt.info&&!this.#Mt.hasExtraInfo),s=this.#zt("responseStarted"),o=s&&Boolean(this.#Mt.paused)||!s;(s&&Boolean(this.#Mt.paused)||this.#Mt.info)&&this.#At.resolve({kind:"success",value:void 0}),Boolean(this.#Mt.info)&&n&&o&&this.#Dt.resolve({kind:"success",value:void 0})}onRequestWillBeSentEvent(e){this.#Ot.info=e,this.#Ft(),this.#Ut()}onRequestWillBeSentExtraInfoEvent(e){this.#Ot.extraInfo=e,this.#Ut()}onResponseReceivedExtraInfoEvent(e){this.#Mt.extraInfo=e,this.#Ut()}onResponseReceivedEvent(e){this.#Mt.hasExtraInfo=e.hasExtraInfo,this.#Mt.info=e.response,this.#Lt(),this.#Zt(),this.#Ut()}onServedFromCache(){this.#Nt=!0,this.#Ut()}onLoadingFailedEvent(e){this.#Bt.resolve({kind:"success",value:void 0}),this.#At.resolve({kind:"error",error:new Error("Network event loading failed")}),this.#Dt.resolve({kind:"error",error:new Error("Network event loading failed")}),this.#qt(Promise.resolve({kind:"success",value:void 0}),(()=>({params:{...this.#Vt(),errorText:e.errorText},method:Ra.ChromiumBidi.Network.EventNames.FetchError,type:"event"})),Ra.ChromiumBidi.Network.EventNames.FetchError)}async failRequest(e){(0,Ea.assert)(this.#_t,"Network Interception not set-up."),await this.cdpClient.sendCommand("Fetch.failRequest",{requestId:this.#_t,errorReason:e}),this.#Tt=void 0}onRequestPaused(e){this.#_t=e.requestId,e.responseStatusCode||e.responseErrorReason?(this.#Tt="responseStarted",this.#Mt.paused=e,this.#Ut(),this.blocked?this.#Mt.info||(this.#Lt(),this.#Zt()):this.continueResponse()):(this.#Ot.paused=e,this.#Tt="beforeRequestSent",this.#Ut(),this.blocked||this.continueRequest())}onAuthRequired(e){this.#Tt="authRequired",this.blocked||this.continueWithAuth(),this.#qt(Promise.resolve({kind:"success",value:void 0}),(()=>({params:{...this.#Vt("authRequired"),response:{}},method:Ra.ChromiumBidi.Network.EventNames.AuthRequired,type:"event"})),Ra.ChromiumBidi.Network.EventNames.AuthRequired)}async continueRequest(e,t,a){(0,Ea.assert)(this.#_t,"Network Interception not set-up."),await this.cdpClient.sendCommand("Fetch.continueRequest",{requestId:this.#_t,url:e,method:t,headers:a}),this.#Tt=void 0}async continueResponse({responseCode:e,responsePhrase:t,responseHeaders:a}={}){(0,Ea.assert)(this.#_t,"Network Interception not set-up."),await this.cdpClient.sendCommand("Fetch.continueResponse",{requestId:this.#_t,responseCode:e,responsePhrase:t,responseHeaders:a}),this.#Tt=void 0}async continueWithAuth(e={response:"Default"}){(0,Ea.assert)(this.#_t,"Network Interception not set-up."),await this.cdpClient.sendCommand("Fetch.continueWithAuth",{requestId:this.#_t,authChallengeResponse:e}),this.#Tt=void 0}async provideResponse({responseCode:e,responsePhrase:t,responseHeaders:a,body:r}){(0,Ea.assert)(this.#_t,"Network Interception not set-up."),await this.cdpClient.sendCommand("Fetch.fulfillRequest",{requestId:this.#_t,responseCode:e,responsePhrase:t,responseHeaders:a,...r?{body:btoa(r)}:{}}),this.#Tt=void 0}dispose(){const e={kind:"error",error:new Error("Network processor detached")};this.#Bt.resolve(e),this.#At.resolve(e),this.#Dt.resolve(e)}get#Be(){return this.#Ot.info?.frameId??null}get statusCode(){return this.#Mt.info?.status??this.#Mt.extraInfo?.statusCode??-1}#qt(e,t,a){this.#$t()||this.#y.registerPromiseEvent(e.then((e=>{if("success"===e.kind)try{return{kind:"success",value:t()}}catch(e){return{kind:"error",error:e instanceof Error?e:new Error("Unknown")}}return e})),this.#Be,a)}#Vt(e){const t={isBlocked:!1};if(e&&e===this.#Tt){const a=this.#pe.requestBlockedBy(this,e);t.isBlocked=a.size>0,t.isBlocked&&(t.intercepts=[...a])}return{context:this.#Be,navigation:this.#Kt(),redirectCount:this.#jt,request:this.#Wt(),timestamp:Math.round(1e3*(this.#Ot.info?.wallTime??0)),...t}}#Kt(){return this.#Ot.info&&this.#Ot.info.loaderId&&this.#Ot.info.loaderId===this.#Ot.info.requestId?this.#Ot.info.loaderId:null}#Wt(){const e=this.#Ot.extraInfo?Na.#Ht(this.#Ot.extraInfo.associatedCookies):[],t=(0,Ta.bidiNetworkHeadersFromCdpNetworkHeaders)(this.#Ot.info?.request.headers);return{request:this.#Ot.info?.requestId??Na.#Et,url:this.#Ot.info?.request.url??Na.#Et,method:this.#Ot.info?.request.method??Na.#Et,headers:t,cookies:e,headersSize:(0,Ta.computeHeadersSize)(t),bodySize:0,timings:this.#Jt()}}#Jt(){return{timeOrigin:0,requestTime:0,redirectStart:0,redirectEnd:0,fetchStart:0,dnsStart:0,dnsEnd:0,connectStart:0,connectEnd:0,tlsStart:0,requestStart:0,responseStart:0,responseEnd:0}}#Ft(){this.#qt(this.#Bt,(()=>Object.assign(this.#Gt(),{type:"event"})),Ra.ChromiumBidi.Network.EventNames.BeforeRequestSent)}#Gt(){return(0,Ea.assert)(this.#Ot.info,"RequestWillBeSentEvent is not set"),{method:Ra.ChromiumBidi.Network.EventNames.BeforeRequestSent,params:{...this.#Vt("beforeRequestSent"),initiator:{type:Na.#Xt(this.#Ot.info.initiator.type)}}}}#Lt(){this.#qt(this.#At,(()=>Object.assign(this.#Yt(),{type:"event"})),Ra.ChromiumBidi.Network.EventNames.ResponseStarted)}#Yt(){(0,Ea.assert)(this.#Ot.info,"RequestWillBeSentEvent is not set"),(0,Ea.assert)(this.#Mt.paused||this.#Mt.info,"ResponseReceivedEvent is not set"),this.#Mt.info?.fromDiskCache&&(this.#Mt.extraInfo=void 0);const e=(0,Ta.bidiNetworkHeadersFromCdpNetworkHeaders)(this.#Mt.info?.headers);return{method:Ra.ChromiumBidi.Network.EventNames.ResponseStarted,params:{...this.#Vt("responseStarted"),response:{url:this.#Mt.info?.url??this.#Mt.paused?.request.url??Na.#Et,protocol:this.#Mt.info?.protocol??"",status:this.statusCode||this.#Mt.paused?.responseStatusCode||0,statusText:this.#Mt.info?.statusText||this.#Mt.paused?.responseStatusText||"",fromCache:this.#Mt.info?.fromDiskCache||this.#Mt.info?.fromPrefetchCache||this.#Nt,headers:e,mimeType:this.#Mt.info?.mimeType||"",bytesReceived:this.#Mt.info?.encodedDataLength||0,headersSize:(0,Ta.computeHeadersSize)(e),bodySize:0,content:{size:0}}}}}#Zt(){this.#qt(this.#Dt,(()=>Object.assign(this.#Qt(),{type:"event"})),Ra.ChromiumBidi.Network.EventNames.ResponseCompleted)}#Qt(){(0,Ea.assert)(this.#Ot.info,"RequestWillBeSentEvent is not set"),(0,Ea.assert)(this.#Mt.info,"ResponseReceivedEvent is not set"),this.#Mt.info.fromDiskCache&&(this.#Mt.extraInfo=void 0);const e=(0,Ta.bidiNetworkHeadersFromCdpNetworkHeaders)(this.#Mt.info.headers);return{method:Ra.ChromiumBidi.Network.EventNames.ResponseCompleted,params:{...this.#Vt(),response:{url:this.#Mt.info.url??Na.#Et,protocol:this.#Mt.info.protocol??"",status:this.statusCode,statusText:this.#Mt.info.statusText,fromCache:this.#Mt.info.fromDiskCache||this.#Mt.info.fromPrefetchCache||this.#Nt,headers:e,mimeType:this.#Mt.info.mimeType,bytesReceived:this.#Mt.info.encodedDataLength,headersSize:(0,Ta.computeHeadersSize)(e),bodySize:0,content:{size:0}}}}}#$t(){return this.#Ot.info?.request.url.endsWith("/favicon.ico")??!1}static#Xt(e){switch(e){case"parser":case"script":case"preflight":return e;default:return"other"}}static#Ht(e){return e.filter((({blockedReasons:e})=>!Array.isArray(e)||0===e.length)).map((({cookie:e})=>(0,Ta.cdpToBiDiCookie)(e)))}}ka.NetworkRequest=Na,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.NetworkStorage=void 0;const ja=g,Oa=B,Ma=ka,Ba=wt;Ia.NetworkStorage=class{#y;#ea=new Set;#ta=new Map;#aa=new Map;#ra={request:!1,response:!1,auth:!1};constructor(e,t){this.#y=e,t.on("Target.detachedFromTarget",(({sessionId:e})=>{this.disposeRequestMap(e)}))}#na(e,t,a){let r=this.getRequestById(e);return r||(r=new Ma.NetworkRequest(e,this.#y,this,t,a),this.addRequest(r),r)}onCdpTargetCreated(e){this.#ea.add(e);const t=e.cdpClient,a=[["Network.requestWillBeSent",t=>{const a=this.getRequestById(t.requestId);a&&a.isRedirecting()?(a.handleRedirect(t),this.deleteRequest(t.requestId),this.#na(t.requestId,e,a.redirectCount+1).onRequestWillBeSentEvent(t)):a?a.onRequestWillBeSentEvent(t):this.#na(t.requestId,e).onRequestWillBeSentEvent(t)}],["Network.requestWillBeSentExtraInfo",t=>{this.#na(t.requestId,e).onRequestWillBeSentExtraInfoEvent(t)}],["Network.responseReceived",t=>{this.#na(t.requestId,e).onResponseReceivedEvent(t)}],["Network.responseReceivedExtraInfo",t=>{this.#na(t.requestId,e).onResponseReceivedExtraInfoEvent(t)}],["Network.requestServedFromCache",t=>{this.#na(t.requestId,e).onServedFromCache()}],["Network.loadingFailed",t=>{this.#na(t.requestId,e).onLoadingFailedEvent(t)}],["Fetch.requestPaused",t=>{this.#sa(t,e)}],["Fetch.authRequired",t=>{this.#oa(t,e)}]];for(const[e,r]of a)t.on(e,r)}async toggleInterception(){if(this.#aa.size){const e={request:!1,response:!1,auth:!1};for(const t of this.#aa.values())e.request||=t.phases.includes("beforeRequestSent"),e.response||=t.phases.includes("responseStarted"),e.auth||=t.phases.includes("authRequired");const t=[];if(this.#ra.request===e.request&&this.#ra.response===e.response&&this.#ra.auth===e.auth)return;this.#ra=e,(e.request||e.auth)&&t.push({urlPattern:"*",requestStage:"Request"}),e.response&&t.push({urlPattern:"*",requestStage:"Response"}),await Promise.all([...this.#ea.values()].map((async a=>await a.enableFetchIfNeeded({patterns:t,handleAuthRequests:e.auth}))))}else this.#ra={request:!1,response:!1,auth:!1},await Promise.all([...this.#ea.values()].map((e=>e.disableFetchIfNeeded())))}requestBlockedBy(e,t){if(void 0===e.url||void 0===t)return new Set;const a=new Set;for(const[r,n]of this.#aa.entries())if(n.phases.includes(t))if(0!==n.urlPatterns.length){for(const t of n.urlPatterns)if((0,Ba.matchUrlPattern)(t,e.url)){a.add(r);break}}else a.add(r);return a}disposeRequestMap(e){const t=[...this.#ta.values()].filter((t=>t.cdpClient.sessionId===e));for(const e of t)e.dispose(),this.#ta.delete(e.id)}#sa(e,t){this.#na(e.networkId??"",t).onRequestPaused(e)}#oa(e,t){const a=this.getRequestByFetchId(e.requestId??"");a?a.onAuthRequired(e):t.cdpClient.sendCommand("Fetch.continueWithAuth",{requestId:e.requestId,authChallengeResponse:{response:"Default"}}).catch((()=>{}))}async addIntercept(e){const t=(0,Oa.uuidv4)();return this.#aa.set(t,e),await this.toggleInterception(),t}async removeIntercept(e){if(!this.#aa.has(e))throw new ja.NoSuchInterceptException(`Intercept '${e}' does not exist.`);this.#aa.delete(e),await this.toggleInterception()}getRequestById(e){return this.#ta.get(e)}getRequestByFetchId(e){for(const t of this.#ta.values())if(t.fetchId===e)return t}addRequest(e){this.#ta.set(e.id,e)}deleteRequest(e){const t=this.#ta.get(e);t&&(t.dispose(),this.#ta.delete(e))}};var Aa={};Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.PermissionsProcessor=void 0;const Da=g;Aa.PermissionsProcessor=class{#o;constructor(e){this.#o=e}async setPermissions(e){try{const t=e["goog:userContext"];await this.#o.sendCommand("Browser.setPermission",{origin:e.origin,browserContextId:t&&"default"!==t?t:void 0,permission:{name:e.descriptor.name},setting:e.state})}catch(e){if("Permission can't be granted to opaque origins."===e.message)return{};throw new Da.InvalidArgumentException(e.message)}return{}}};var za={};Object.defineProperty(za,"__esModule",{value:!0}),za.PreloadScriptStorage=void 0;za.PreloadScriptStorage=class{#ia=new Set;find(e){return e?[...this.#ia].filter((t=>(void 0===e.id||e.id===t.id)&&(!(void 0!==e.targetId&&!t.targetIds.has(e.targetId))&&(void 0===e.global||!(e.global&&void 0!==t.contexts||!e.global&&void 0===t.contexts))))):[...this.#ia]}add(e){this.#ia.add(e)}remove(e){for(const t of this.find(e))this.#ia.delete(t)}};var La={},Za={};Object.defineProperty(Za,"__esModule",{value:!0}),Za.PreloadScript=void 0;const Ua=B,Fa=A;Za.PreloadScript=class{#u=(0,Ua.uuidv4)();#ca=[];#da;#ua=new Set;#la;#ha;#pa;get id(){return this.#u}get targetIds(){return this.#ua}constructor(e,t){this.#la=e.arguments?.map((e=>new Fa.ChannelProxy(e.value,t)))??[],this.#da=e.functionDeclaration,this.#ha=e.sandbox,this.#pa=e.contexts}get channels(){return this.#la}get contexts(){return this.#pa}#ma(){const e=`[${this.channels.map((e=>e.getEvalInWindowStr())).join(", ")}]`;return`(()=>{(${this.#da})(...${e})})()`}async initInTargets(e,t){await Promise.all(Array.from(e).map((e=>this.initInTarget(e,t))))}async initInTarget(e,t){const a=await e.cdpClient.sendCommand("Page.addScriptToEvaluateOnNewDocument",{source:this.#ma(),worldName:this.#ha,runImmediately:t});this.#ca.push({target:e,preloadScriptId:a.identifier}),this.#ua.add(e.id)}async remove(){for(const e of this.#ca){const t=e.target,a=e.preloadScriptId;await t.cdpClient.sendCommand("Page.removeScriptToEvaluateOnNewDocument",{identifier:a})}}dispose(e){this.#ca=this.#ca.filter((t=>t.target?.id!==e)),this.#ua.delete(e)}},Object.defineProperty(La,"__esModule",{value:!0}),La.ScriptProcessor=void 0;const qa=g,Va=Za;La.ScriptProcessor=class{#i;#C;#ne;#t;constructor(e,t,a,r){this.#i=e,this.#C=t,this.#ne=a,this.#t=r}async addPreloadScript(e){const t=new Set;if(e.contexts){if(0===e.contexts.length)throw new qa.InvalidArgumentException("Contexts list is empty.");for(const a of e.contexts){const e=this.#i.getContext(a);if(!e.isTopLevelContext())throw new qa.InvalidArgumentException(`Non top-level context '${a}' given.`);t.add(e)}}const a=new Va.PreloadScript(e,this.#t);this.#ne.add(a);const r=0===t.size?new Set(this.#i.getTopLevelContexts().map((e=>e.cdpTarget))):new Set([...t.values()].map((e=>e.cdpTarget)));return await a.initInTargets(r,!1),{script:a.id}}async removePreloadScript(e){const t=e.script,a=this.#ne.find({id:t});if(0===a.length)throw new qa.NoSuchScriptException(`No preload script with BiDi ID '${t}'`);return await Promise.all(a.map((e=>e.remove()))),this.#ne.remove({id:t}),{}}async callFunction(e){const t=await this.#fa(e.target);return await t.callFunction(e.functionDeclaration,e.this??{type:"undefined"},e.arguments??[],e.awaitPromise,e.resultOwnership??"none",e.serializationOptions??{},e.userActivation??!1)}async evaluate(e){const t=await this.#fa(e.target);return await t.evaluate(e.expression,e.awaitPromise,e.resultOwnership??"none",e.serializationOptions??{},e.userActivation??!1)}async disown(e){const t=await this.#fa(e.target);return await Promise.all(e.handles.map((async e=>await t.disown(e)))),{}}getRealms(e){void 0!==e.context&&this.#i.getContext(e.context);return{realms:this.#C.findRealms({browsingContextId:e.context,type:e.type}).map((e=>e.realmInfo))}}async#fa(e){if("realm"in e)return this.#C.getRealm({realmId:e.realm});const t=this.#i.getContext(e.context);return await t.getOrCreateSandbox(e.sandbox)}};var $a={};Object.defineProperty($a,"__esModule",{value:!0}),$a.SessionProcessor=void 0;$a.SessionProcessor=class{#y;constructor(e){this.#y=e}status(){return{ready:!1,message:"already connected"}}async subscribe(e,t=null){return await this.#y.subscribe(e.events,e.contexts??[null],t),{}}async unsubscribe(e,t=null){return await this.#y.unsubscribe(e.events,e.contexts??[null],t),{}}};var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.StorageProcessor=void 0;const Wa=g,Ha=J,Ja=l,Ga=vt,Xa=wt;Ka.StorageProcessor=class{#o;#i;#t;constructor(e,t,a){this.#i=t,this.#o=e,this.#t=a}async getCookies(e){const t=this.#ga(e.partition);return{cookies:(await this.#o.sendCommand("Storage.getCookies",{browserContextId:t.userContext})).cookies.filter((e=>void 0===t.sourceOrigin||e.partitionKey===t.sourceOrigin)).map((e=>(0,Xa.cdpToBiDiCookie)(e))).filter((t=>this.#ya(t,e.filter))),partitionKey:t}}async setCookie(e){const t=this.#ga(e.partition),a=(0,Xa.bidiToCdpCookie)(e,t);try{await this.#o.sendCommand("Storage.setCookies",{cookies:[a],browserContextId:t.userContext})}catch(e){throw this.#t?.(Ja.LogType.debugError,e),new Wa.UnableToSetCookieException(e.toString())}return{partitionKey:t}}#Sa(e){const t=e.context,a=this.#i.getContext(t);return{userContext:"default"===a.userContext?void 0:a.userContext}}#va(e){const t=new Map;let a=e.sourceOrigin;if(void 0!==a){const e=Ga.NetworkProcessor.parseUrlString(a);a="null"===e.origin?e.origin:`${e.protocol}//${e.hostname}`}const r="default"===e.userContext?void 0:e.userContext;for(const[a,r]of Object.entries(e))void 0===a||void 0===r||["type","sourceOrigin","userContext"].includes(a)||t.set(a,r);return t.size>0&&this.#t?.(Ja.LogType.debugInfo,`Unsupported partition keys: ${JSON.stringify(Object.fromEntries(t))}`),{...void 0===a?{}:{sourceOrigin:a},...void 0===r?{}:{userContext:r}}}#ga(e){return void 0===e?{}:"context"===e.type?this.#Sa(e):((0,Ha.assert)("storageKey"===e.type,"Unknown partition type"),this.#va(e))}#ya(e,t){return void 0===t||!(void 0!==t.domain&&t.domain!==e.domain||void 0!==t.name&&t.name!==e.name||void 0!==t.value&&(t.value.type!==e.value.type||t.value.value!==e.value.value)||void 0!==t.path&&t.path!==e.path||void 0!==t.size&&t.size!==e.size||void 0!==t.httpOnly&&t.httpOnly!==e.httpOnly||void 0!==t.secure&&t.secure!==e.secure||void 0!==t.sameSite&&t.sameSite!==e.sameSite||void 0!==t.expiry&&t.expiry!==e.expiry)}};var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.OutgoingMessage=void 0;class Qa{#wa;#Ca;constructor(e,t=null){this.#wa=e,this.#Ca=t}static createFromPromise(e,t){return e.then((e=>"success"===e.kind?{kind:"success",value:new Qa(e.value,t)}:e))}static createResolved(e,t){return Promise.resolve({kind:"success",value:new Qa(e,t)})}get message(){return this.#wa}get channel(){return this.#Ca}}Ya.OutgoingMessage=Qa,Object.defineProperty(f,"__esModule",{value:!0}),f.CommandProcessor=void 0;const er=g,tr=s,ar=l,rr=E,nr=_,sr=N,or=j,ir=qe,cr=vt,dr=Ia,ur=Aa,lr=za,hr=La,pr=$a,mr=Ka,fr=Ya;class gr extends tr.EventEmitter{#ba;#xa;#Pa;#Ia;#ka;#Ra;#Ea;#_a;#Ta;#Na;#t;constructor(e,t,a,r,n,s,o,i,c,d=new rr.BidiNoOpParser,u){super(),this.#Na=d,this.#t=u;const l=new dr.NetworkStorage(a,t),h=new lr.PreloadScriptStorage;this.#ba=new nr.BrowserProcessor(t),this.#xa=new or.BrowsingContextProcessor(e,t,r,a,s,o,l,h,i,c,n,u),this.#Pa=new sr.CdpProcessor(s,e,t),this.#Ia=new ir.InputProcessor(s,o),this.#ka=new cr.NetworkProcessor(l),this.#Ra=new ur.PermissionsProcessor(t),this.#Ea=new hr.ScriptProcessor(s,o,h,u),this.#_a=new pr.SessionProcessor(a),this.#Ta=new mr.StorageProcessor(t,s,u)}async#ja(e){switch(e.method){case"session.end":case"session.new":break;case"browser.close":return this.#ba.close();case"browser.createUserContext":return await this.#ba.createUserContext(e.params);case"browser.getUserContexts":return await this.#ba.getUserContexts();case"browser.removeUserContext":return await this.#ba.removeUserContext(e.params.userContext);case"browsingContext.activate":return await this.#xa.activate(this.#Na.parseActivateParams(e.params));case"browsingContext.captureScreenshot":return await this.#xa.captureScreenshot(this.#Na.parseCaptureScreenshotParams(e.params));case"browsingContext.close":return await this.#xa.close(this.#Na.parseCloseParams(e.params));case"browsingContext.create":return await this.#xa.create(this.#Na.parseCreateParams(e.params));case"browsingContext.getTree":return this.#xa.getTree(this.#Na.parseGetTreeParams(e.params));case"browsingContext.handleUserPrompt":return await this.#xa.handleUserPrompt(this.#Na.parseHandleUserPromptParams(e.params));case"browsingContext.locateNodes":throw new er.UnsupportedOperationException(`Command '${e.method}' not yet implemented.`);case"browsingContext.navigate":return await this.#xa.navigate(this.#Na.parseNavigateParams(e.params));case"browsingContext.print":return await this.#xa.print(this.#Na.parsePrintParams(e.params));case"browsingContext.reload":return await this.#xa.reload(this.#Na.parseReloadParams(e.params));case"browsingContext.setViewport":return await this.#xa.setViewport(this.#Na.parseSetViewportParams(e.params));case"browsingContext.traverseHistory":return await this.#xa.traverseHistory(this.#Na.parseTraverseHistoryParams(e.params));case"cdp.getSession":return this.#Pa.getSession(this.#Na.parseGetSessionParams(e.params));case"cdp.sendCommand":return await this.#Pa.sendCommand(this.#Na.parseSendCommandParams(e.params));case"input.performActions":return await this.#Ia.performActions(this.#Na.parsePerformActionsParams(e.params));case"input.releaseActions":return await this.#Ia.releaseActions(this.#Na.parseReleaseActionsParams(e.params));case"input.setFiles":return await this.#Ia.setFiles(this.#Na.parseSetFilesParams(e.params));case"network.addIntercept":return await this.#ka.addIntercept(this.#Na.parseAddInterceptParams(e.params));case"network.continueRequest":return await this.#ka.continueRequest(this.#Na.parseContinueRequestParams(e.params));case"network.continueResponse":return await this.#ka.continueResponse(this.#Na.parseContinueResponseParams(e.params));case"network.continueWithAuth":return await this.#ka.continueWithAuth(this.#Na.parseContinueWithAuthParams(e.params));case"network.failRequest":return await this.#ka.failRequest(this.#Na.parseFailRequestParams(e.params));case"network.provideResponse":return await this.#ka.provideResponse(this.#Na.parseProvideResponseParams(e.params));case"network.removeIntercept":return await this.#ka.removeIntercept(this.#Na.parseRemoveInterceptParams(e.params));case"permissions.setPermission":return await this.#Ra.setPermissions(this.#Na.parseSetPermissionsParams(e.params));case"script.addPreloadScript":return await this.#Ea.addPreloadScript(this.#Na.parseAddPreloadScriptParams(e.params));case"script.callFunction":return await this.#Ea.callFunction(this.#Na.parseCallFunctionParams(e.params));case"script.disown":return await this.#Ea.disown(this.#Na.parseDisownParams(e.params));case"script.evaluate":return await this.#Ea.evaluate(this.#Na.parseEvaluateParams(e.params));case"script.getRealms":return this.#Ea.getRealms(this.#Na.parseGetRealmsParams(e.params));case"script.removePreloadScript":return await this.#Ea.removePreloadScript(this.#Na.parseRemovePreloadScriptParams(e.params));case"session.status":return this.#_a.status();case"session.subscribe":return await this.#_a.subscribe(this.#Na.parseSubscribeParams(e.params),e.channel);case"session.unsubscribe":return await this.#_a.unsubscribe(this.#Na.parseSubscribeParams(e.params),e.channel);case"storage.deleteCookies":throw new er.UnsupportedOperationException(`${e.method} is not supported yet`);case"storage.getCookies":return await this.#Ta.getCookies(this.#Na.parseGetCookiesParams(e.params));case"storage.setCookie":return await this.#Ta.setCookie(this.#Na.parseSetCookieParams(e.params))}throw new er.UnknownCommandException(`Unknown command '${e.method}'.`)}async processCommand(e){try{const t=await this.#ja(e),a={type:"success",id:e.id,result:t};this.emit("response",{message:fr.OutgoingMessage.createResolved(a,e.channel),event:e.method})}catch(t){if(t instanceof er.Exception)this.emit("response",{message:fr.OutgoingMessage.createResolved(t.toErrorResponse(e.id),e.channel),event:e.method});else{const a=t;this.#t?.(ar.LogType.bidi,a),this.emit("response",{message:fr.OutgoingMessage.createResolved(new er.UnknownErrorException(a.message,a.stack).toErrorResponse(e.id),e.channel),event:e.method})}}}}f.CommandProcessor=gr;var yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.BrowsingContextStorage=void 0;const Sr=g;yr.BrowsingContextStorage=class{#pa=new Map;getTopLevelContexts(){return this.getAllContexts().filter((e=>e.isTopLevelContext()))}getAllContexts(){return Array.from(this.#pa.values())}deleteContextById(e){this.#pa.delete(e)}deleteContext(e){this.#pa.delete(e.id)}addContext(e){this.#pa.set(e.id,e)}hasContext(e){return this.#pa.has(e)}findContext(e){return this.#pa.get(e)}findTopLevelContextId(e){if(null===e)return null;const t=this.findContext(e),a=t?.parentId??null;return null===a?e:this.findTopLevelContextId(a)}findContextBySession(e){for(const t of this.#pa.values())if(t.cdpTarget.cdpSessionId===e)return t}getContext(e){const t=this.findContext(e);if(void 0===t)throw new Sr.NoSuchFrameException(`Context ${e} not found`);return t}};var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.RealmStorage=void 0;const wr=g,Cr=Q;vr.RealmStorage=class{#Oa=new Map;#Ma=new Map;get knownHandlesToRealmMap(){return this.#Oa}addRealm(e){this.#Ma.set(e.realmId,e)}findRealms(e){return Array.from(this.#Ma.values()).filter((t=>(void 0===e.realmId||e.realmId===t.realmId)&&(!(void 0!==e.browsingContextId&&!t.associatedBrowsingContexts.map((e=>e.id)).includes(e.browsingContextId))&&((void 0===e.sandbox||t instanceof Cr.WindowRealm&&e.sandbox===t.sandbox)&&((void 0===e.executionContextId||e.executionContextId===t.executionContextId)&&((void 0===e.origin||e.origin===t.origin)&&((void 0===e.type||e.type===t.realmType)&&(void 0===e.cdpSessionId||e.cdpSessionId===t.cdpClient.sessionId))))))))}findRealm(e){const t=this.findRealms(e);if(1===t.length)return t[0]}getRealm(e){const t=this.findRealm(e);if(void 0===t)throw new wr.NoSuchFrameException(`Realm ${JSON.stringify(e)} not found`);return t}deleteRealms(e){this.findRealms(e).map((e=>{e.dispose(),this.#Ma.delete(e.realmId),Array.from(this.knownHandlesToRealmMap.entries()).filter((([,t])=>t===e.realmId)).map((([e])=>this.knownHandlesToRealmMap.delete(e)))}))}};var br={},xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.Buffer=void 0;xr.Buffer=class{#Ba;#Aa=[];#Da;constructor(e,t){this.#Ba=e,this.#Da=t}get(){return this.#Aa}add(e){for(this.#Aa.push(e);this.#Aa.length>this.#Ba;){const e=this.#Aa.shift();void 0!==e&&this.#Da?.(e)}}};var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.DefaultMap=void 0;class Ir extends Map{#za;constructor(e,t){super(t),this.#za=e}get(e){return this.has(e)||this.set(e,this.#za(e)),super.get(e)}}Pr.DefaultMap=Ir;var kr={};Object.defineProperty(kr,"__esModule",{value:!0}),kr.IdWrapper=void 0;class Rr{static#La=0;#u;constructor(){this.#u=++Rr.#La}get id(){return this.#u}}kr.IdWrapper=Rr;var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.assertSupportedEvent=Er.isCdpEvent=void 0;const _r=g;function Tr(e){return e.split(".").at(0)?.startsWith(_r.ChromiumBidi.BiDiModule.Cdp)??!1}Er.isCdpEvent=Tr,Er.assertSupportedEvent=function(e){if(!_r.ChromiumBidi.EVENT_NAMES.has(e)&&!Tr(e))throw new _r.InvalidArgumentException(`Unknown event: ${e}`)};var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.SubscriptionManager=Nr.unrollEvents=Nr.cartesianProduct=void 0;const jr=g,Or=Er;function Mr(...e){return e.reduce(((e,t)=>e.flatMap((e=>t.map((t=>[e,t].flat()))))))}function Br(e){const t=new Set;function a(e){for(const a of e)t.add(a)}for(const r of e)switch(r){case jr.ChromiumBidi.BiDiModule.BrowsingContext:a(Object.values(jr.ChromiumBidi.BrowsingContext.EventNames));break;case jr.ChromiumBidi.BiDiModule.Log:a(Object.values(jr.ChromiumBidi.Log.EventNames));break;case jr.ChromiumBidi.BiDiModule.Network:a(Object.values(jr.ChromiumBidi.Network.EventNames));break;case jr.ChromiumBidi.BiDiModule.Script:a(Object.values(jr.ChromiumBidi.Script.EventNames));break;default:t.add(r)}return[...t.values()]}Nr.cartesianProduct=Mr,Nr.unrollEvents=Br;Nr.SubscriptionManager=class{#Za=0;#Ua=new Map;#i;constructor(e){this.#i=e}getChannelsSubscribedToEvent(e,t){return Array.from(this.#Ua.keys()).map((a=>({priority:this.#Fa(e,t,a),channel:a}))).filter((({priority:e})=>null!==e)).sort(((e,t)=>e.priority-t.priority)).map((({channel:e})=>e))}#Fa(e,t,a){const r=this.#Ua.get(a);if(void 0===r)return null;const n=this.#i.findTopLevelContextId(t),s=[...new Set([null,n])].map((t=>{const a=r.get(t)?.get(e);if((0,Or.isCdpEvent)(e)){const e=r.get(t)?.get(jr.ChromiumBidi.BiDiModule.Cdp);return a&&e?Math.min(a,e):a??e}return a})).filter((e=>void 0!==e));return 0===s.length?null:Math.min(...s)}isSubscribedToModule(e,t=null){const a=this.#i.findTopLevelContextId(t);for(const t of this.#Ua.values())for(const[r,n]of t.entries())if(a===r||null===r)for(const t of n.keys())if(t.split(".").at(0)===e)return!0;return!1}subscribe(e,t,a){switch(t=this.#i.findTopLevelContextId(t),e){case jr.ChromiumBidi.BiDiModule.BrowsingContext:return void Object.values(jr.ChromiumBidi.BrowsingContext.EventNames).map((e=>this.subscribe(e,t,a)));case jr.ChromiumBidi.BiDiModule.Log:return void Object.values(jr.ChromiumBidi.Log.EventNames).map((e=>this.subscribe(e,t,a)));case jr.ChromiumBidi.BiDiModule.Network:return void Object.values(jr.ChromiumBidi.Network.EventNames).map((e=>this.subscribe(e,t,a)));case jr.ChromiumBidi.BiDiModule.Script:return void Object.values(jr.ChromiumBidi.Script.EventNames).map((e=>this.subscribe(e,t,a)))}this.#Ua.has(a)||this.#Ua.set(a,new Map);const r=this.#Ua.get(a);r.has(t)||r.set(t,new Map);const n=r.get(t);n.has(e)||n.set(e,this.#Za++)}unsubscribeAll(e,t,a){for(const e of t)null!==e&&this.#i.getContext(e);Mr(Br(e),t).map((([e,t])=>this.#qa(e,t,a))).forEach((e=>e()))}unsubscribe(e,t,a){this.unsubscribeAll([e],[t],a)}#qa(e,t,a){if(t=this.#i.findTopLevelContextId(t),!this.#Ua.has(a))throw new jr.InvalidArgumentException(`Cannot unsubscribe from ${e}, ${null===t?"null":t}. No subscription found.`);const r=this.#Ua.get(a);if(!r.has(t))throw new jr.InvalidArgumentException(`Cannot unsubscribe from ${e}, ${null===t?"null":t}. No subscription found.`);const n=r.get(t);if(!n.has(e))throw new jr.InvalidArgumentException(`Cannot unsubscribe from ${e}, ${null===t?"null":t}. No subscription found.`);return()=>{n.delete(e),0===n.size&&r.delete(e),0===r.size&&this.#Ua.delete(a)}}},Object.defineProperty(br,"__esModule",{value:!0}),br.EventManager=void 0;const Ar=g,Dr=xr,zr=Pr,Lr=s,Zr=kr,Ur=Ya,Fr=Er,qr=Nr;class Vr{#Va=new Zr.IdWrapper;#$a;#Ka;constructor(e,t){this.#Ka=e,this.#$a=t}get id(){return this.#Va.id}get contextId(){return this.#$a}get event(){return this.#Ka}}const $r=new Map([[Ar.ChromiumBidi.Log.EventNames.LogEntryAdded,100]]);class Kr extends Lr.EventEmitter{#Wa=new zr.DefaultMap((()=>new Set));#Ha=new Map;#Ja=new Map;#Ga;#i;constructor(e){super(),this.#i=e,this.#Ga=new qr.SubscriptionManager(e)}get subscriptionManager(){return this.#Ga}static#Xa(e,t,a){return JSON.stringify({eventName:e,browsingContext:t,channel:a})}registerEvent(e,t){this.registerPromiseEvent(Promise.resolve({kind:"success",value:e}),t,e.method)}registerPromiseEvent(e,t,a){const r=new Vr(e,t),n=this.#Ga.getChannelsSubscribedToEvent(a,t);this.#Ya(r,a);for(const t of n)this.emit("event",{message:Ur.OutgoingMessage.createFromPromise(e,t),event:a}),this.#Qa(r,t,a)}async subscribe(e,t,a){for(const t of e)(0,Fr.assertSupportedEvent)(t);for(const e of t)null!==e&&this.#i.getContext(e);for(const r of e)for(const e of t){this.#Ga.subscribe(r,e,a);for(const t of this.#er(r,e,a))this.emit("event",{message:Ur.OutgoingMessage.createFromPromise(t.event,a),event:r}),this.#Qa(t,a,r)}await this.toggleModulesIfNeeded()}async unsubscribe(e,t,a){for(const t of e)(0,Fr.assertSupportedEvent)(t);this.#Ga.unsubscribeAll(e,t,a),await this.toggleModulesIfNeeded()}async toggleModulesIfNeeded(){await Promise.all(this.#i.getAllContexts().map((async e=>await e.toggleModulesIfNeeded())))}#Ya(e,t){if(!$r.has(t))return;const a=Kr.#Xa(t,e.contextId);this.#Ha.has(a)||this.#Ha.set(a,new Dr.Buffer($r.get(t))),this.#Ha.get(a).add(e),this.#Wa.get(t).add(e.contextId)}#Qa(e,t,a){if(!$r.has(a))return;const r=Kr.#Xa(a,e.contextId,t);this.#Ja.set(r,Math.max(this.#Ja.get(r)??0,e.id))}#er(e,t,a){const r=Kr.#Xa(e,t),n=Kr.#Xa(e,t,a),s=this.#Ja.get(n)??-1/0,o=this.#Ha.get(r)?.get().filter((e=>e.id>s))??[];return null===t&&Array.from(this.#Wa.get(e).keys()).filter((e=>null!==e&&this.#i.hasContext(e))).map((t=>this.#er(e,t,a))).forEach((e=>o.push(...e))),o.sort(((e,t)=>e.id-t.id))}}br.EventManager=Kr,Object.defineProperty(n,"__esModule",{value:!0}),n.BidiServer=void 0;const Wr=s,Hr=l,Jr=h,Gr=f,Xr=yr,Yr=vr,Qr=br;class en extends Wr.EventEmitter{#tr;#ar;#rr;#y;#i=new Xr.BrowsingContextStorage;#t;#nr=e=>{this.#rr.processCommand(e).catch((e=>{this.#t?.(Hr.LogType.debugError,e)}))};#sr=async e=>{const t=e.message;null!==e.channel&&(t.channel=e.channel),await this.#ar.sendMessage(t)};constructor(e,t,a,r,n,s,o,i){super(),this.#t=i,this.#tr=new Jr.ProcessingQueue(this.#sr,this.#t),this.#ar=e,this.#ar.setOnMessage(this.#nr),this.#y=new Qr.EventManager(this.#i),this.#rr=new Gr.CommandProcessor(t,a,this.#y,r,n,this.#i,new Yr.RealmStorage,s?.acceptInsecureCerts??!1,s?.sharedIdWithFrame??!1,o,this.#t),this.#y.on("event",(({message:e,event:t})=>{this.emitOutgoingMessage(e,t)})),this.#rr.on("response",(({message:e,event:t})=>{this.emitOutgoingMessage(e,t)}))}static async createAndStart(e,t,a,r,n,s,o){const[{browserContextIds:i},{targetInfos:c}]=await Promise.all([a.sendCommand("Target.getBrowserContexts"),a.sendCommand("Target.getTargets")]);let d="default";for(const e of c)if(e.browserContextId&&!i.includes(e.browserContextId)){d=e.browserContextId;break}const u=new en(e,t,a,r,d,n,s,o);return await a.sendCommand("Target.setDiscoverTargets",{discover:!0}),await a.sendCommand("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0}),await u.#or(),u}emitOutgoingMessage(e,t){this.#tr.add(e,t)}close(){this.#ar.close()}async#or(){await Promise.all(this.#i.getTopLevelContexts().map((e=>e.lifecycleLoaded())))}}n.BidiServer=en,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OutgoingMessage=e.EventEmitter=e.BidiServer=void 0;var t=n;Object.defineProperty(e,"BidiServer",{enumerable:!0,get:function(){return t.BidiServer}});var a=s;Object.defineProperty(e,"EventEmitter",{enumerable:!0,get:function(){return a.EventEmitter}});var r=Ya;Object.defineProperty(e,"OutgoingMessage",{enumerable:!0,get:function(){return r.OutgoingMessage}})}(r);var tn={},an={};Object.defineProperty(an,"__esModule",{value:!0}),an.MapperCdpClient=an.CloseError=void 0;const rn=s;class nn extends Error{}an.CloseError=nn;class sn extends rn.EventEmitter{#c;#ir;constructor(e,t){super(),this.#c=e,this.#ir=t}get sessionId(){return this.#ir}sendCommand(e,...t){return this.#c.sendCommand(e,t[0],this.#ir)}isCloseError(e){return e instanceof nn}}an.MapperCdpClient=sn,Object.defineProperty(tn,"__esModule",{value:!0}),tn.MapperCdpConnection=void 0;const on=l,cn=an;class dn{static LOGGER_PREFIX_RECV=`${on.LogType.cdp}:RECV \u25c2`;static LOGGER_PREFIX_SEND=`${on.LogType.cdp}:SEND \u25b8`;#cr;#ar;#dr=new Map;#ur=new Map;#t;#lr=0;constructor(e,t){this.#ar=e,this.#t=t,this.#ar.setOnMessage(this.#hr),this.#cr=this.#pr(void 0)}close(){this.#ar.close();for(const[,{reject:e,error:t}]of this.#ur)e(t);this.#ur.clear(),this.#dr.clear()}async createBrowserSession(){const{sessionId:e}=await this.#cr.sendCommand("Target.attachToBrowserTarget");return this.#pr(e)}getCdpClient(e){const t=this.#dr.get(e);if(!t)throw new Error(`Unknown CDP session ID: ${e}`);return t}sendCommand(e,t,a){return new Promise(((r,n)=>{const s=this.#lr++;this.#ur.set(s,{resolve:r,reject:n,error:new cn.CloseError(`${e} ${JSON.stringify(t)} ${a??""} call rejected because the connection has been closed.`)});const o={id:s,method:e,params:t};a&&(o.sessionId=a),this.#ar.sendMessage(JSON.stringify(o))?.catch((e=>{this.#t?.(on.LogType.debugError,e),this.#ar.close()})),this.#t?.(dn.LOGGER_PREFIX_SEND,o)}))}#hr=e=>{const t=JSON.parse(e);if(this.#t?.(dn.LOGGER_PREFIX_RECV,t),"Target.attachedToTarget"===t.method){const{sessionId:e}=t.params;this.#pr(e)}if(void 0!==t.id){const e=this.#ur.get(t.id);this.#ur.delete(t.id),e&&(t.result?e.resolve(t.result):t.error&&e.reject(t.error))}else if(t.method){const e=this.#dr.get(t.sessionId??void 0);if(e?.emit(t.method,t.params||{}),"Target.detachedFromTarget"===t.method){const{sessionId:e}=t.params,a=this.#dr.get(e);a&&(this.#dr.delete(e),a.removeAllListeners())}}};#pr(e){const t=new cn.MapperCdpClient(this,e);return this.#dr.set(e,t),t}}tn.MapperCdpConnection=dn;var un={},ln={},hn={},pn={},mn={},fn={},gn={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of a)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(t=e.util||(e.util={})),(e.objectUtil||(e.objectUtil={})).mergeShapes=(e,t)=>({...e,...t}),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);e.getParsedType=t=>{switch(typeof t){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(t)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(t)?e.ZodParsedType.array:null===t?e.ZodParsedType.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?e.ZodParsedType.promise:"undefined"!=typeof Map&&t instanceof Map?e.ZodParsedType.map:"undefined"!=typeof Set&&t instanceof Set?e.ZodParsedType.set:"undefined"!=typeof Date&&t instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}}}(gn);var yn={};Object.defineProperty(yn,"__esModule",{value:!0}),yn.ZodError=yn.quotelessJson=yn.ZodIssueCode=void 0;const Sn=gn;yn.ZodIssueCode=Sn.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);yn.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class vn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},a={_errors:[]},r=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(r);else if("invalid_return_type"===n.code)r(n.returnTypeError);else if("invalid_arguments"===n.code)r(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,r=0;for(;r<n.path.length;){const a=n.path[r];r===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return r(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,Sn.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):a.push(e(r));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}yn.ZodError=vn,vn.create=e=>new vn(e),Object.defineProperty(fn,"__esModule",{value:!0});const wn=gn,Cn=yn;fn.default=(e,t)=>{let a;switch(e.code){case Cn.ZodIssueCode.invalid_type:a=e.received===wn.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Cn.ZodIssueCode.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,wn.util.jsonStringifyReplacer)}`;break;case Cn.ZodIssueCode.unrecognized_keys:a=`Unrecognized key(s) in object: ${wn.util.joinValues(e.keys,", ")}`;break;case Cn.ZodIssueCode.invalid_union:a="Invalid input";break;case Cn.ZodIssueCode.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${wn.util.joinValues(e.options)}`;break;case Cn.ZodIssueCode.invalid_enum_value:a=`Invalid enum value. Expected ${wn.util.joinValues(e.options)}, received '${e.received}'`;break;case Cn.ZodIssueCode.invalid_arguments:a="Invalid function arguments";break;case Cn.ZodIssueCode.invalid_return_type:a="Invalid function return type";break;case Cn.ZodIssueCode.invalid_date:a="Invalid date";break;case Cn.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:wn.util.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Cn.ZodIssueCode.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Cn.ZodIssueCode.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Cn.ZodIssueCode.custom:a="Invalid input";break;case Cn.ZodIssueCode.invalid_intersection_types:a="Intersection results could not be merged";break;case Cn.ZodIssueCode.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case Cn.ZodIssueCode.not_finite:a="Number must be finite";break;default:a=t.defaultError,wn.util.assertNever(e)}return{message:a}};var bn=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mn,"__esModule",{value:!0}),mn.getErrorMap=mn.setErrorMap=mn.defaultErrorMap=void 0;const xn=bn(fn);mn.defaultErrorMap=xn.default;let Pn=xn.default;mn.setErrorMap=function(e){Pn=e},mn.getErrorMap=function(){return Pn};var In={};!function(t){var a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const r=mn,n=a(fn);t.makeIssue=e=>{const{data:t,path:a,errorMaps:r,issueData:n}=e,s=[...a,...n.path||[]],o={...n,path:s};let i="";const c=r.filter((e=>!!e)).slice().reverse();for(const e of c)i=e(o,{data:t,defaultError:i}).message;return{...n,path:s,message:n.message||i}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,a){const s=(0,t.makeIssue)({issueData:a,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,(0,r.getErrorMap)(),n.default].filter((e=>!!e))});e.common.issues.push(s)};class s{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,a){const r=[];for(const n of a){if("aborted"===n.status)return t.INVALID;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const a=[];for(const e of t)a.push({key:await e.key,value:await e.value});return s.mergeObjectSync(e,a)}static mergeObjectSync(e,a){const r={};for(const n of a){const{key:a,value:s}=n;if("aborted"===a.status)return t.INVALID;if("aborted"===s.status)return t.INVALID;"dirty"===a.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===a.value||void 0===s.value&&!n.alwaysSet||(r[a.value]=s.value)}return{status:e.value,value:r}}}t.ParseStatus=s,t.INVALID=Object.freeze({status:"aborted"});t.DIRTY=e=>({status:"dirty",value:e});t.OK=e=>({status:"valid",value:e});t.isAborted=e=>"aborted"===e.status;t.isDirty=e=>"dirty"===e.status;t.isValid=e=>"valid"===e.status;t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise}(In);var kn={};Object.defineProperty(kn,"__esModule",{value:!0});var Rn,En={},_n={};Rn=_n,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Rn.errorUtil||(Rn.errorUtil={})),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.date=e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.custom=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=e.discriminatedUnion=void 0;const t=mn,a=_n,r=In,n=gn,s=yn;class o{constructor(e,t,a,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const i=(e,t)=>{if((0,r.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new s.ZodError(e.common.issues);return this._error=t,this._error}}};function c(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:r,description:n}=e;if(t&&(a||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=a?a:t.defaultError},description:n}}class d{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return(0,n.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,n.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new r.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,n.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,r.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const r={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,n.getParsedType)(e)},s=this._parseSync({data:e,path:r.path,parent:r});return i(r,s)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,n.getParsedType)(e)},s=this._parse({data:e,path:a.path,parent:a}),o=await((0,r.isAsync)(s)?s:Promise.resolve(s));return i(a,o)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const n=e(t),o=()=>r.addIssue({code:s.ZodIssueCode.custom,...a(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(o(),!1))):!!n||(o(),!1)}))}refinement(e,t){return this._refinement(((a,r)=>!!e(a)||(r.addIssue("function"==typeof t?t(a,r):t),!1)))}_refinement(e){return new G({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return X.create(this,this._def)}nullable(){return Y.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this,this._def)}promise(){return J.create(this,this._def)}or(e){return M.create([this,e],this._def)}and(e){return z.create(this,e,this._def)}transform(e){return new G({...c(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Q({...c(this._def),innerType:this,defaultValue:t,typeName:se.ZodDefault})}brand(){return new ae({typeName:se.ZodBranded,type:this,...c(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ee({...c(this._def),innerType:this,catchValue:t,typeName:se.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return re.create(this,e)}readonly(){return ne.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}e.ZodType=d,e.Schema=d,e.ZodSchema=d;const u=/^c[^\s-]{8,}$/i,l=/^[a-z][a-z0-9]*$/,h=/^[0-9A-HJKMNP-TV-Z]{26}$/,p=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let f;const g=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,y=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class S extends d{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==n.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.string,received:t.parsedType}),r.INVALID}const t=new r.ParseStatus;let a;for(const d of this._def.checks)if("min"===d.kind)e.data.length<d.value&&(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),t.dirty());else if("max"===d.kind)e.data.length>d.value&&(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),t.dirty());else if("length"===d.kind){const n=e.data.length>d.value,o=e.data.length<d.value;(n||o)&&(a=this._getOrReturnCtx(e,a),n?(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}):o&&(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}),t.dirty())}else if("email"===d.kind)m.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"email",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty());else if("emoji"===d.kind)f||(f=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),f.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty());else if("uuid"===d.kind)p.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty());else if("cuid"===d.kind)u.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty());else if("cuid2"===d.kind)l.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty());else if("ulid"===d.kind)h.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty());else if("url"===d.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"url",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty()}else if("regex"===d.kind){d.regex.lastIndex=0;d.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty())}else if("trim"===d.kind)e.data=e.data.trim();else if("includes"===d.kind)e.data.includes(d.value,d.position)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_string,validation:{includes:d.value,position:d.position},message:d.message}),t.dirty());else if("toLowerCase"===d.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===d.kind)e.data=e.data.toUpperCase();else if("startsWith"===d.kind)e.data.startsWith(d.value)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:d.value},message:d.message}),t.dirty());else if("endsWith"===d.kind)e.data.endsWith(d.value)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:d.value},message:d.message}),t.dirty());else if("datetime"===d.kind){((c=d).precision?c.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${c.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${c.precision}}Z$`):0===c.precision?c.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):c.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:d.message}),t.dirty())}else"ip"===d.kind?(o=e.data,("v4"!==(i=d.version)&&i||!g.test(o))&&("v6"!==i&&i||!y.test(o))&&(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:d.message}),t.dirty())):n.util.assertNever(d);var o,i,c;return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:s.ZodIssueCode.invalid_string,...a.errorUtil.errToObj(r)})}_addCheck(e){return new S({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errorUtil.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...a.errorUtil.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...a.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,a.errorUtil.errToObj(e))}trim(){return new S({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function v(e,t){const a=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,n=a>r?a:r;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}e.ZodString=S,S.create=e=>{var t;return new S({checks:[],typeName:se.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...c(e)})};class w extends d{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==n.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.number,received:t.parsedType}),r.INVALID}let t;const a=new r.ParseStatus;for(const o of this._def.checks)if("int"===o.kind)n.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty());else if("min"===o.kind){(o.inclusive?e.data<o.value:e.data<=o.value)&&(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else if("max"===o.kind){(o.inclusive?e.data>o.value:e.data>=o.value)&&(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else"multipleOf"===o.kind?0!==v(e.data,o.value)&&(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):"finite"===o.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.not_finite,message:o.message}),a.dirty()):n.util.assertNever(o);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,n){return new w({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(n)}]})}_addCheck(e){return new w({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&n.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}e.ZodNumber=w,w.create=e=>new w({checks:[],typeName:se.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...c(e)});class C extends d{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==n.ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.bigint,received:t.parsedType}),r.INVALID}let t;const a=new r.ParseStatus;for(const o of this._def.checks)if("min"===o.kind){(o.inclusive?e.data<o.value:e.data<=o.value)&&(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty())}else if("max"===o.kind){(o.inclusive?e.data>o.value:e.data>=o.value)&&(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty())}else"multipleOf"===o.kind?e.data%o.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):n.util.assertNever(o);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,n){return new C({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(n)}]})}_addCheck(e){return new C({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}e.ZodBigInt=C,C.create=e=>{var t;return new C({checks:[],typeName:se.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...c(e)})};class b extends d{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==n.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.boolean,received:t.parsedType}),r.INVALID}return(0,r.OK)(e.data)}}e.ZodBoolean=b,b.create=e=>new b({typeName:se.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...c(e)});class x extends d{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==n.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.date,received:t.parsedType}),r.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_date}),r.INVALID}const t=new r.ParseStatus;let a;for(const o of this._def.checks)"min"===o.kind?e.data.getTime()<o.value&&(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),t.dirty()):"max"===o.kind?e.data.getTime()>o.value&&(a=this._getOrReturnCtx(e,a),(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),t.dirty()):n.util.assertNever(o);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new x({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}e.ZodDate=x,x.create=e=>new x({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:se.ZodDate,...c(e)});class P extends d{_parse(e){if(this._getType(e)!==n.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.symbol,received:t.parsedType}),r.INVALID}return(0,r.OK)(e.data)}}e.ZodSymbol=P,P.create=e=>new P({typeName:se.ZodSymbol,...c(e)});class I extends d{_parse(e){if(this._getType(e)!==n.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.undefined,received:t.parsedType}),r.INVALID}return(0,r.OK)(e.data)}}e.ZodUndefined=I,I.create=e=>new I({typeName:se.ZodUndefined,...c(e)});class k extends d{_parse(e){if(this._getType(e)!==n.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.null,received:t.parsedType}),r.INVALID}return(0,r.OK)(e.data)}}e.ZodNull=k,k.create=e=>new k({typeName:se.ZodNull,...c(e)});class R extends d{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,r.OK)(e.data)}}e.ZodAny=R,R.create=e=>new R({typeName:se.ZodAny,...c(e)});class E extends d{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,r.OK)(e.data)}}e.ZodUnknown=E,E.create=e=>new E({typeName:se.ZodUnknown,...c(e)});class _ extends d{_parse(e){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.never,received:t.parsedType}),r.INVALID}}e.ZodNever=_,_.create=e=>new _({typeName:se.ZodNever,...c(e)});class T extends d{_parse(e){if(this._getType(e)!==n.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.void,received:t.parsedType}),r.INVALID}return(0,r.OK)(e.data)}}e.ZodVoid=T,T.create=e=>new T({typeName:se.ZodVoid,...c(e)});class N extends d{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),i=this._def;if(t.parsedType!==n.ZodParsedType.array)return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.array,received:t.parsedType}),r.INVALID;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,n=t.data.length<i.exactLength.value;(e||n)&&((0,r.addIssueToContext)(t,{code:e?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:n?i.exactLength.value:void 0,maximum:e?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(null!==i.minLength&&t.data.length<i.minLength.value&&((0,r.addIssueToContext)(t,{code:s.ZodIssueCode.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),null!==i.maxLength&&t.data.length>i.maxLength.value&&((0,r.addIssueToContext)(t,{code:s.ZodIssueCode.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>i.type._parseAsync(new o(t,e,t.path,a))))).then((e=>r.ParseStatus.mergeArray(a,e)));const c=[...t.data].map(((e,a)=>i.type._parseSync(new o(t,e,t.path,a))));return r.ParseStatus.mergeArray(a,c)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:a.errorUtil.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:a.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function j(e){if(e instanceof O){const t={};for(const a in e.shape){const r=e.shape[a];t[a]=X.create(j(r))}return new O({...e._def,shape:()=>t})}return e instanceof N?new N({...e._def,type:j(e.element)}):e instanceof X?X.create(j(e.unwrap())):e instanceof Y?Y.create(j(e.unwrap())):e instanceof L?L.create(e.items.map((e=>j(e)))):e}e.ZodArray=N,N.create=(e,t)=>new N({type:e,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...c(t)});class O extends d{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=n.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==n.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.object,received:t.parsedType}),r.INVALID}const{status:t,ctx:a}=this._processInputParams(e),{shape:i,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof _&&"strip"===this._def.unknownKeys))for(const e in a.data)c.includes(e)||d.push(e);const u=[];for(const e of c){const t=i[e],r=a.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new o(a,r,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof _){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of d)u.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)d.length>0&&((0,r.addIssueToContext)(a,{code:s.ZodIssueCode.unrecognized_keys,keys:d}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of d){const r=a.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new o(a,r,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of u){const a=await t.key;e.push({key:a,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>r.ParseStatus.mergeObjectSync(t,e))):r.ParseStatus.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return a.errorUtil.errToObj,new O({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,s,o,i;const c=null!==(o=null===(s=(n=this._def).errorMap)||void 0===s?void 0:s.call(n,t,r).message)&&void 0!==o?o:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=a.errorUtil.errToObj(e).message)&&void 0!==i?i:c}:{message:c}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:se.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new O({...this._def,catchall:e})}pick(e){const t={};return n.util.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new O({...this._def,shape:()=>t})}omit(e){const t={};return n.util.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new O({...this._def,shape:()=>t})}deepPartial(){return j(this)}partial(e){const t={};return n.util.objectKeys(this.shape).forEach((a=>{const r=this.shape[a];e&&!e[a]?t[a]=r:t[a]=r.optional()})),new O({...this._def,shape:()=>t})}required(e){const t={};return n.util.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof X;)e=e._def.innerType;t[a]=e}})),new O({...this._def,shape:()=>t})}keyof(){return K(n.util.objectKeys(this.shape))}}e.ZodObject=O,O.create=(e,t)=>new O({shape:()=>e,unknownKeys:"strip",catchall:_.create(),typeName:se.ZodObject,...c(t)}),O.strictCreate=(e,t)=>new O({shape:()=>e,unknownKeys:"strict",catchall:_.create(),typeName:se.ZodObject,...c(t)}),O.lazycreate=(e,t)=>new O({shape:e,unknownKeys:"strip",catchall:_.create(),typeName:se.ZodObject,...c(t)});class M extends d{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new s.ZodError(e.ctx.common.issues)));return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_union,unionErrors:a}),r.INVALID}));{let e;const n=[];for(const r of a){const a={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:a});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map((e=>new s.ZodError(e)));return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_union,unionErrors:o}),r.INVALID}}get options(){return this._def.options}}e.ZodUnion=M,M.create=(e,t)=>new M({options:e,typeName:se.ZodUnion,...c(t)});const B=e=>e instanceof V?B(e.schema):e instanceof G?B(e.innerType()):e instanceof $?[e.value]:e instanceof W?e.options:e instanceof H?Object.keys(e.enum):e instanceof Q?B(e._def.innerType):e instanceof I?[void 0]:e instanceof k?[null]:null;class A extends d{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.ZodParsedType.object)return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.object,received:t.parsedType}),r.INVALID;const a=this.discriminator,o=t.data[a],i=this.optionsMap.get(o);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),r.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const r=new Map;for(const a of t){const t=B(a.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new A({typeName:se.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...c(a)})}}function D(e,t){const a=(0,n.getParsedType)(e),r=(0,n.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(a===n.ZodParsedType.object&&r===n.ZodParsedType.object){const a=n.util.objectKeys(t),r=n.util.objectKeys(e).filter((e=>-1!==a.indexOf(e))),s={...e,...t};for(const a of r){const r=D(e[a],t[a]);if(!r.valid)return{valid:!1};s[a]=r.data}return{valid:!0,data:s}}if(a===n.ZodParsedType.array&&r===n.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let r=0;r<e.length;r++){const n=D(e[r],t[r]);if(!n.valid)return{valid:!1};a.push(n.data)}return{valid:!0,data:a}}return a===n.ZodParsedType.date&&r===n.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}e.ZodDiscriminatedUnion=A;class z extends d{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if((0,r.isAborted)(e)||(0,r.isAborted)(n))return r.INVALID;const o=D(e.value,n.value);return o.valid?(((0,r.isDirty)(e)||(0,r.isDirty)(n))&&t.dirty(),{status:t.value,value:o.data}):((0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_intersection_types}),r.INVALID)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}e.ZodIntersection=z,z.create=(e,t,a)=>new z({left:e,right:t,typeName:se.ZodIntersection,...c(a)});class L extends d{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.ZodParsedType.array)return(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.array,received:a.parsedType}),r.INVALID;if(a.data.length<this._def.items.length)return(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.INVALID;!this._def.rest&&a.data.length>this._def.items.length&&((0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...a.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new o(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(i).then((e=>r.ParseStatus.mergeArray(t,e))):r.ParseStatus.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new L({...this._def,rest:e})}}e.ZodTuple=L,L.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new L({items:e,typeName:se.ZodTuple,rest:null,...c(t)})};class Z extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.ZodParsedType.object)return(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.object,received:a.parsedType}),r.INVALID;const i=[],c=this._def.keyType,d=this._def.valueType;for(const e in a.data)i.push({key:c._parse(new o(a,e,a.path,e)),value:d._parse(new o(a,a.data[e],a.path,e))});return a.common.async?r.ParseStatus.mergeObjectAsync(t,i):r.ParseStatus.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,a){return new Z(t instanceof d?{keyType:e,valueType:t,typeName:se.ZodRecord,...c(a)}:{keyType:S.create(),valueType:e,typeName:se.ZodRecord,...c(t)})}}e.ZodRecord=Z;class U extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.ZodParsedType.map)return(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.map,received:a.parsedType}),r.INVALID;const i=this._def.keyType,c=this._def.valueType,d=[...a.data.entries()].map((([e,t],r)=>({key:i._parse(new o(a,e,a.path,[r,"key"])),value:c._parse(new o(a,t,a.path,[r,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of d){const n=await a.key,s=await a.value;if("aborted"===n.status||"aborted"===s.status)return r.INVALID;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of d){const n=a.key,s=a.value;if("aborted"===n.status||"aborted"===s.status)return r.INVALID;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}e.ZodMap=U,U.create=(e,t,a)=>new U({valueType:t,keyType:e,typeName:se.ZodMap,...c(a)});class F extends d{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.ZodParsedType.set)return(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.set,received:a.parsedType}),r.INVALID;const i=this._def;null!==i.minSize&&a.data.size<i.minSize.value&&((0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),null!==i.maxSize&&a.data.size>i.maxSize.value&&((0,r.addIssueToContext)(a,{code:s.ZodIssueCode.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const c=this._def.valueType;function d(e){const a=new Set;for(const n of e){if("aborted"===n.status)return r.INVALID;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const u=[...a.data.values()].map(((e,t)=>c._parse(new o(a,e,a.path,t))));return a.common.async?Promise.all(u).then((e=>d(e))):d(u)}min(e,t){return new F({...this._def,minSize:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new F({...this._def,maxSize:{value:e,message:a.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}e.ZodSet=F,F.create=(e,t)=>new F({valueType:e,minSize:null,maxSize:null,typeName:se.ZodSet,...c(t)});class q extends d{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==n.ZodParsedType.function)return(0,r.addIssueToContext)(a,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.function,received:a.parsedType}),r.INVALID;function o(e,n){return(0,r.makeIssue)({data:e,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter((e=>!!e)),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:n}})}function i(e,n){return(0,r.makeIssue)({data:e,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter((e=>!!e)),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:n}})}const c={errorMap:a.common.contextualErrorMap},d=a.data;if(this._def.returns instanceof J){const e=this;return(0,r.OK)((async function(...t){const a=new s.ZodError([]),r=await e._def.args.parseAsync(t,c).catch((e=>{throw a.addIssue(o(t,e)),a})),n=await Reflect.apply(d,this,r),u=await e._def.returns._def.type.parseAsync(n,c).catch((e=>{throw a.addIssue(i(n,e)),a}));return u}))}{const e=this;return(0,r.OK)((function(...t){const a=e._def.args.safeParse(t,c);if(!a.success)throw new s.ZodError([o(t,a.error)]);const r=Reflect.apply(d,this,a.data),n=e._def.returns.safeParse(r,c);if(!n.success)throw new s.ZodError([i(r,n.error)]);return n.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new q({...this._def,args:L.create(e).rest(E.create())})}returns(e){return new q({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new q({args:e||L.create([]).rest(E.create()),returns:t||E.create(),typeName:se.ZodFunction,...c(a)})}}e.ZodFunction=q;class V extends d{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}e.ZodLazy=V,V.create=(e,t)=>new V({getter:e,typeName:se.ZodLazy,...c(t)});class $ extends d{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{received:t.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),r.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function K(e,t){return new W({values:e,typeName:se.ZodEnum,...c(t)})}e.ZodLiteral=$,$.create=(e,t)=>new $({value:e,typeName:se.ZodLiteral,...c(t)});class W extends d{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return(0,r.addIssueToContext)(t,{expected:n.util.joinValues(a),received:t.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return(0,r.addIssueToContext)(t,{received:t.data,code:s.ZodIssueCode.invalid_enum_value,options:a}),r.INVALID}return(0,r.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return W.create(e)}exclude(e){return W.create(this.options.filter((t=>!e.includes(t))))}}e.ZodEnum=W,W.create=K;class H extends d{_parse(e){const t=n.util.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==n.ZodParsedType.string&&a.parsedType!==n.ZodParsedType.number){const e=n.util.objectValues(t);return(0,r.addIssueToContext)(a,{expected:n.util.joinValues(e),received:a.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(-1===t.indexOf(e.data)){const e=n.util.objectValues(t);return(0,r.addIssueToContext)(a,{received:a.data,code:s.ZodIssueCode.invalid_enum_value,options:e}),r.INVALID}return(0,r.OK)(e.data)}get enum(){return this._def.values}}e.ZodNativeEnum=H,H.create=(e,t)=>new H({values:e,typeName:se.ZodNativeEnum,...c(t)});class J extends d{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.ZodParsedType.promise&&!1===t.common.async)return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.promise,received:t.parsedType}),r.INVALID;const a=t.parsedType===n.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,r.OK)(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}e.ZodPromise=J,J.create=(e,t)=>new J({type:e,typeName:se.ZodPromise,...c(t)});class G extends d{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:e=>{(0,r.addIssueToContext)(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===s.type){const e=s.transform(a.data,o);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:a.path,parent:a}))):this._def.schema._parseSync({data:e,path:a.path,parent:a})}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,o);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?r.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?r.INVALID:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===s.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!(0,r.isValid)(e))return e;const n=s.transform(e.value,o);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>(0,r.isValid)(e)?Promise.resolve(s.transform(e.value,o)).then((e=>({status:t.value,value:e}))):e))}n.util.assertNever(s)}}e.ZodEffects=G,e.ZodTransformer=G,G.create=(e,t,a)=>new G({schema:e,typeName:se.ZodEffects,effect:t,...c(a)}),G.createWithPreprocess=(e,t,a)=>new G({schema:t,effect:{type:"preprocess",transform:e},typeName:se.ZodEffects,...c(a)});class X extends d{_parse(e){return this._getType(e)===n.ZodParsedType.undefined?(0,r.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}e.ZodOptional=X,X.create=(e,t)=>new X({innerType:e,typeName:se.ZodOptional,...c(t)});class Y extends d{_parse(e){return this._getType(e)===n.ZodParsedType.null?(0,r.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}e.ZodNullable=Y,Y.create=(e,t)=>new Y({innerType:e,typeName:se.ZodNullable,...c(t)});class Q extends d{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===n.ZodParsedType.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}e.ZodDefault=Q,Q.create=(e,t)=>new Q({innerType:e,typeName:se.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...c(t)});class ee extends d{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return(0,r.isAsync)(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s.ZodError(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new s.ZodError(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}e.ZodCatch=ee,ee.create=(e,t)=>new ee({innerType:e,typeName:se.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...c(t)});class te extends d{_parse(e){if(this._getType(e)!==n.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,r.addIssueToContext)(t,{code:s.ZodIssueCode.invalid_type,expected:n.ZodParsedType.nan,received:t.parsedType}),r.INVALID}return{status:"valid",value:e.data}}}e.ZodNaN=te,te.create=e=>new te({typeName:se.ZodNaN,...c(e)}),e.BRAND=Symbol("zod_brand");class ae extends d{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}e.ZodBranded=ae;class re extends d{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?r.INVALID:"dirty"===e.status?(t.dirty(),(0,r.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?r.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new re({in:e,out:t,typeName:se.ZodPipeline})}}e.ZodPipeline=re;class ne extends d{_parse(e){const t=this._def.innerType._parse(e);return(0,r.isValid)(t)&&(t.value=Object.freeze(t.value)),t}}e.ZodReadonly=ne,ne.create=(e,t)=>new ne({innerType:e,typeName:se.ZodReadonly,...c(t)});var se;e.custom=(e,t={},a)=>e?R.create().superRefine(((r,n)=>{var s,o;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,i=null===(o=null!==(s=e.fatal)&&void 0!==s?s:a)||void 0===o||o,c="string"==typeof e?{message:e}:e;n.addIssue({code:"custom",...c,fatal:i})}})):R.create(),e.late={object:O.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(se=e.ZodFirstPartyTypeKind||(e.ZodFirstPartyTypeKind={}));e.instanceof=(t,a={message:`Input not instance of ${t.name}`})=>(0,e.custom)((e=>e instanceof t),a);const oe=S.create;e.string=oe;const ie=w.create;e.number=ie;const ce=te.create;e.nan=ce;const de=C.create;e.bigint=de;const ue=b.create;e.boolean=ue;const le=x.create;e.date=le;const he=P.create;e.symbol=he;const pe=I.create;e.undefined=pe;const me=k.create;e.null=me;const fe=R.create;e.any=fe;const ge=E.create;e.unknown=ge;const ye=_.create;e.never=ye;const Se=T.create;e.void=Se;const ve=N.create;e.array=ve;const we=O.create;e.object=we;const Ce=O.strictCreate;e.strictObject=Ce;const be=M.create;e.union=be;const xe=A.create;e.discriminatedUnion=xe;const Pe=z.create;e.intersection=Pe;const Ie=L.create;e.tuple=Ie;const ke=Z.create;e.record=ke;const Re=U.create;e.map=Re;const Ee=F.create;e.set=Ee;const _e=q.create;e.function=_e;const Te=V.create;e.lazy=Te;const Ne=$.create;e.literal=Ne;const je=W.create;e.enum=je;const Oe=H.create;e.nativeEnum=Oe;const Me=J.create;e.promise=Me;const Be=G.create;e.effect=Be,e.transformer=Be;const Ae=X.create;e.optional=Ae;const De=Y.create;e.nullable=De;const ze=G.createWithPreprocess;e.preprocess=ze;const Le=re.create;e.pipeline=Le;e.ostring=()=>oe().optional();e.onumber=()=>ie().optional();e.oboolean=()=>ue().optional(),e.coerce={string:e=>S.create({...e,coerce:!0}),number:e=>w.create({...e,coerce:!0}),boolean:e=>b.create({...e,coerce:!0}),bigint:e=>C.create({...e,coerce:!0}),date:e=>x.create({...e,coerce:!0})},e.NEVER=r.INVALID}(En),function(t){var a=e&&e.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),r=e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(mn,t),r(In,t),r(kn,t),r(gn,t),r(En,t),r(yn,t)}(pn),function(t){var a=e&&e.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return r(t,e),t},s=e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const o=n(pn);t.z=o,s(pn,t),t.default=o}(hn);var Tn={},Nn=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.Permissions=Tn.PermissionsCommandSchema=void 0;const jn=Nn(hn);var On;Tn.PermissionsCommandSchema=jn.default.lazy((()=>On.SetPermissionSchema)),function(e){e.PermissionDescriptorSchema=jn.default.lazy((()=>jn.default.object({name:jn.default.string()})))}(On||(Tn.Permissions=On={})),function(e){e.PermissionStateSchema=jn.default.lazy((()=>jn.default.enum(["granted","denied","prompt"])))}(On||(Tn.Permissions=On={})),function(e){e.SetPermissionSchema=jn.default.lazy((()=>jn.default.object({method:jn.default.literal("permissions.setPermission"),params:e.SetPermissionParametersSchema})))}(On||(Tn.Permissions=On={})),function(e){e.SetPermissionParametersSchema=jn.default.lazy((()=>jn.default.object({descriptor:e.PermissionDescriptorSchema,state:e.PermissionStateSchema,origin:jn.default.string()})))}(On||(Tn.Permissions=On={}));var Mn={};!function(t){var a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Input=t.InputCommandSchema=t.Log=t.LogEventSchema=t.Storage=t.StorageResultSchema=t.StorageCommandSchema=t.Script=t.ScriptResultSchema=t.ScriptCommandSchema=t.ScriptEventSchema=t.Network=t.NetworkResultSchema=t.NetworkEventSchema=t.NetworkCommandSchema=t.BrowsingContext=t.BrowsingContextResultSchema=t.BrowsingContextEventSchema=t.BrowsingContextCommandSchema=t.Browser=t.BrowserResultSchema=t.BrowserCommandSchema=t.SessionResultSchema=t.Session=t.SessionCommandSchema=t.ErrorCodeSchema=t.JsUintSchema=t.JsIntSchema=t.ExtensibleSchema=t.EmptyResultSchema=t.ErrorResponseSchema=t.MessageSchema=t.EmptyParamsSchema=t.ResultDataSchema=t.CommandDataSchema=t.EventDataSchema=t.CommandResponseSchema=t.CommandSchema=t.EventSchema=void 0;const r=a(hn);var n,s,o,i,c,d,u,l;t.EventSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("event")}).and(t.EventDataSchema).and(t.ExtensibleSchema))),t.CommandSchema=r.default.lazy((()=>r.default.object({id:t.JsUintSchema}).and(t.CommandDataSchema).and(t.ExtensibleSchema))),t.CommandResponseSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("success"),id:t.JsUintSchema,result:t.ResultDataSchema}).and(t.ExtensibleSchema))),t.EventDataSchema=r.default.lazy((()=>r.default.union([t.BrowsingContextEventSchema,t.LogEventSchema,t.NetworkEventSchema,t.ScriptEventSchema]))),t.CommandDataSchema=r.default.lazy((()=>r.default.union([t.BrowserCommandSchema,t.BrowsingContextCommandSchema,t.InputCommandSchema,t.NetworkCommandSchema,t.ScriptCommandSchema,t.SessionCommandSchema,t.StorageCommandSchema]))),t.ResultDataSchema=r.default.lazy((()=>r.default.union([t.BrowsingContextResultSchema,t.EmptyResultSchema,t.NetworkResultSchema,t.ScriptResultSchema,t.SessionResultSchema,t.StorageResultSchema]))),t.EmptyParamsSchema=r.default.lazy((()=>t.ExtensibleSchema)),t.MessageSchema=r.default.lazy((()=>r.default.union([t.CommandResponseSchema,t.ErrorResponseSchema,t.EventSchema]))),t.ErrorResponseSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("error"),id:r.default.union([t.JsUintSchema,r.default.null()]),error:t.ErrorCodeSchema,message:r.default.string(),stacktrace:r.default.string().optional()}).and(t.ExtensibleSchema))),t.EmptyResultSchema=r.default.lazy((()=>t.ExtensibleSchema)),t.ExtensibleSchema=r.default.lazy((()=>r.default.record(r.default.string(),r.default.any()))),t.JsIntSchema=r.default.lazy((()=>r.default.number().int().gte(-9007199254740991).lte(9007199254740991))),t.JsUintSchema=r.default.lazy((()=>r.default.number().int().nonnegative().gte(0).lte(9007199254740991))),t.ErrorCodeSchema=r.default.lazy((()=>r.default.enum(["invalid argument","invalid session id","move target out of bounds","no such alert","no such element","no such frame","no such handle","no such history entry","no such intercept","no such node","no such request","no such script","no such storage partition","no such user context","session not created","unable to capture screen","unable to close browser","unable to set cookie","unable to set file input","underspecified storage partition","unknown command","unknown error","unsupported operation"]))),t.SessionCommandSchema=r.default.lazy((()=>r.default.union([n.EndSchema,n.NewSchema,n.StatusSchema,n.SubscribeSchema,n.UnsubscribeSchema]))),function(e){e.ProxyConfigurationSchema=r.default.lazy((()=>r.default.union([e.AutodetectProxyConfigurationSchema,e.DirectProxyConfigurationSchema,e.ManualProxyConfigurationSchema,e.PacProxyConfigurationSchema,e.SystemProxyConfigurationSchema,r.default.object({})])))}(n||(t.Session=n={})),t.SessionResultSchema=r.default.lazy((()=>r.default.union([n.NewResultSchema,n.StatusResultSchema]))),function(e){e.CapabilitiesRequestSchema=r.default.lazy((()=>r.default.object({alwaysMatch:e.CapabilityRequestSchema.optional(),firstMatch:r.default.array(e.CapabilityRequestSchema).optional()})))}(n||(t.Session=n={})),function(e){e.CapabilityRequestSchema=r.default.lazy((()=>r.default.object({acceptInsecureCerts:r.default.boolean().optional(),browserName:r.default.string().optional(),browserVersion:r.default.string().optional(),platformName:r.default.string().optional(),proxy:e.ProxyConfigurationSchema.optional(),webSocketUrl:r.default.boolean().optional()}).and(t.ExtensibleSchema)))}(n||(t.Session=n={})),function(e){e.AutodetectProxyConfigurationSchema=r.default.lazy((()=>r.default.object({proxyType:r.default.literal("autodetect")}).and(t.ExtensibleSchema)))}(n||(t.Session=n={})),function(e){e.DirectProxyConfigurationSchema=r.default.lazy((()=>r.default.object({proxyType:r.default.literal("direct")}).and(t.ExtensibleSchema)))}(n||(t.Session=n={})),function(e){e.ManualProxyConfigurationSchema=r.default.lazy((()=>r.default.object({proxyType:r.default.literal("manual"),ftpProxy:r.default.string().optional(),httpProxy:r.default.string().optional(),sslProxy:r.default.string().optional()}).and(e.SocksProxyConfigurationSchema.or(r.default.object({}))).and(r.default.object({noProxy:r.default.array(r.default.string()).optional()})).and(t.ExtensibleSchema)))}(n||(t.Session=n={})),function(e){e.SocksProxyConfigurationSchema=r.default.lazy((()=>r.default.object({socksProxy:r.default.string(),socksVersion:r.default.number().int().nonnegative().gte(0).lte(255)})))}(n||(t.Session=n={})),function(e){e.PacProxyConfigurationSchema=r.default.lazy((()=>r.default.object({proxyType:r.default.literal("pac"),proxyAutoconfigUrl:r.default.string()}).and(t.ExtensibleSchema)))}(n||(t.Session=n={})),function(e){e.SystemProxyConfigurationSchema=r.default.lazy((()=>r.default.object({proxyType:r.default.literal("system")}).and(t.ExtensibleSchema)))}(n||(t.Session=n={})),function(e){e.SubscriptionRequestSchema=r.default.lazy((()=>r.default.object({events:r.default.array(r.default.string()),contexts:r.default.array(o.BrowsingContextSchema).optional()})))}(n||(t.Session=n={})),function(e){e.StatusSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("session.status"),params:t.EmptyParamsSchema})))}(n||(t.Session=n={})),function(e){e.StatusResultSchema=r.default.lazy((()=>r.default.object({ready:r.default.boolean(),message:r.default.string()})))}(n||(t.Session=n={})),function(e){e.NewSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("session.new"),params:e.NewParametersSchema})))}(n||(t.Session=n={})),function(e){e.NewParametersSchema=r.default.lazy((()=>r.default.object({capabilities:e.CapabilitiesRequestSchema})))}(n||(t.Session=n={})),function(e){e.NewResultSchema=r.default.lazy((()=>r.default.object({sessionId:r.default.string(),capabilities:r.default.object({acceptInsecureCerts:r.default.boolean(),browserName:r.default.string(),browserVersion:r.default.string(),platformName:r.default.string(),setWindowRect:r.default.boolean(),proxy:e.ProxyConfigurationSchema.optional(),webSocketUrl:r.default.string().optional()}).and(t.ExtensibleSchema)})))}(n||(t.Session=n={})),function(e){e.EndSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("session.end"),params:t.EmptyParamsSchema})))}(n||(t.Session=n={})),function(e){e.SubscribeSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("session.subscribe"),params:e.SubscriptionRequestSchema})))}(n||(t.Session=n={})),function(e){e.UnsubscribeSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("session.unsubscribe"),params:e.SubscriptionRequestSchema})))}(n||(t.Session=n={})),t.BrowserCommandSchema=r.default.lazy((()=>r.default.union([s.CloseSchema,s.CreateUserContextSchema,s.GetUserContextsSchema,s.RemoveUserContextSchema]))),t.BrowserResultSchema=r.default.lazy((()=>r.default.union([s.CreateUserContextResultSchema,s.GetUserContextsResultSchema]))),function(e){e.UserContextSchema=r.default.lazy((()=>r.default.string()))}(s||(t.Browser=s={})),function(e){e.UserContextInfoSchema=r.default.lazy((()=>r.default.object({userContext:e.UserContextSchema})))}(s||(t.Browser=s={})),function(e){e.CloseSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browser.close"),params:t.EmptyParamsSchema})))}(s||(t.Browser=s={})),function(e){e.CreateUserContextSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browser.createUserContext"),params:t.EmptyParamsSchema})))}(s||(t.Browser=s={})),function(e){e.CreateUserContextResultSchema=r.default.lazy((()=>e.UserContextInfoSchema))}(s||(t.Browser=s={})),function(e){e.GetUserContextsSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browser.getUserContexts"),params:t.EmptyParamsSchema})))}(s||(t.Browser=s={})),function(e){e.GetUserContextsResultSchema=r.default.lazy((()=>r.default.object({userContexts:r.default.array(e.UserContextInfoSchema).min(1)})))}(s||(t.Browser=s={})),function(e){e.RemoveUserContextSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browser.removeUserContext"),params:r.default.object({userContext:e.UserContextSchema})})))}(s||(t.Browser=s={})),t.BrowsingContextCommandSchema=r.default.lazy((()=>r.default.union([o.ActivateSchema,o.CaptureScreenshotSchema,o.CloseSchema,o.CreateSchema,o.GetTreeSchema,o.HandleUserPromptSchema,o.LocateNodesSchema,o.NavigateSchema,o.PrintSchema,o.ReloadSchema,o.SetViewportSchema,o.TraverseHistorySchema]))),t.BrowsingContextEventSchema=r.default.lazy((()=>r.default.union([o.ContextCreatedSchema,o.ContextDestroyedSchema,o.DomContentLoadedSchema,o.DownloadWillBeginSchema,o.FragmentNavigatedSchema,o.LoadSchema,o.NavigationAbortedSchema,o.NavigationFailedSchema,o.NavigationStartedSchema,o.UserPromptClosedSchema,o.UserPromptOpenedSchema]))),t.BrowsingContextResultSchema=r.default.lazy((()=>r.default.union([o.CaptureScreenshotResultSchema,o.CreateResultSchema,o.GetTreeResultSchema,o.LocateNodesResultSchema,o.NavigateResultSchema,o.PrintResultSchema,o.TraverseHistoryResultSchema]))),function(e){e.BrowsingContextSchema=r.default.lazy((()=>r.default.string()))}(o||(t.BrowsingContext=o={})),function(e){e.InfoListSchema=r.default.lazy((()=>r.default.array(e.InfoSchema)))}(o||(t.BrowsingContext=o={})),function(e){e.InfoSchema=r.default.lazy((()=>r.default.object({children:r.default.union([e.InfoListSchema,r.default.null()]),context:e.BrowsingContextSchema,url:r.default.string(),userContext:s.UserContextSchema,parent:r.default.union([e.BrowsingContextSchema,r.default.null()]).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.LocatorSchema=r.default.lazy((()=>r.default.union([e.CssLocatorSchema,e.InnerTextLocatorSchema,e.XPathLocatorSchema])))}(o||(t.BrowsingContext=o={})),function(e){e.CssLocatorSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("css"),value:r.default.string()})))}(o||(t.BrowsingContext=o={})),function(e){e.InnerTextLocatorSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("innerText"),value:r.default.string(),ignoreCase:r.default.boolean().optional(),matchType:r.default.enum(["full","partial"]).optional(),maxDepth:t.JsUintSchema.optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.XPathLocatorSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("xpath"),value:r.default.string()})))}(o||(t.BrowsingContext=o={})),function(e){e.NavigationSchema=r.default.lazy((()=>r.default.string()))}(o||(t.BrowsingContext=o={})),function(e){e.NavigationInfoSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,navigation:r.default.union([e.NavigationSchema,r.default.null()]),timestamp:t.JsUintSchema,url:r.default.string()})))}(o||(t.BrowsingContext=o={})),function(e){e.ReadinessStateSchema=r.default.lazy((()=>r.default.enum(["none","interactive","complete"])))}(o||(t.BrowsingContext=o={})),function(e){e.ActivateSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.activate"),params:e.ActivateParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.ActivateParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.CaptureScreenshotParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,origin:r.default.enum(["viewport","document"]).default("viewport").optional(),format:e.ImageFormatSchema.optional(),clip:e.ClipRectangleSchema.optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.CaptureScreenshotSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.captureScreenshot"),params:e.CaptureScreenshotParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.ImageFormatSchema=r.default.lazy((()=>r.default.object({type:r.default.string(),quality:r.default.number().gte(0).lte(1).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.ClipRectangleSchema=r.default.lazy((()=>r.default.union([e.BoxClipRectangleSchema,e.ElementClipRectangleSchema])))}(o||(t.BrowsingContext=o={})),function(e){e.ElementClipRectangleSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("element"),element:c.SharedReferenceSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.BoxClipRectangleSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("box"),x:r.default.number(),y:r.default.number(),width:r.default.number(),height:r.default.number()})))}(o||(t.BrowsingContext=o={})),function(e){e.CaptureScreenshotResultSchema=r.default.lazy((()=>r.default.object({data:r.default.string()})))}(o||(t.BrowsingContext=o={})),function(e){e.CloseSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.close"),params:e.CloseParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.CloseParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,promptUnload:r.default.boolean().default(!1).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.CreateSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.create"),params:e.CreateParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.CreateTypeSchema=r.default.lazy((()=>r.default.enum(["tab","window"])))}(o||(t.BrowsingContext=o={})),function(e){e.CreateParametersSchema=r.default.lazy((()=>r.default.object({type:e.CreateTypeSchema,referenceContext:e.BrowsingContextSchema.optional(),background:r.default.boolean().default(!1).optional(),userContext:s.UserContextSchema.optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.CreateResultSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.GetTreeSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.getTree"),params:e.GetTreeParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.GetTreeParametersSchema=r.default.lazy((()=>r.default.object({maxDepth:t.JsUintSchema.optional(),root:e.BrowsingContextSchema.optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.GetTreeResultSchema=r.default.lazy((()=>r.default.object({contexts:e.InfoListSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.HandleUserPromptSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.handleUserPrompt"),params:e.HandleUserPromptParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.HandleUserPromptParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,accept:r.default.boolean().optional(),userText:r.default.string().optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.LocateNodesParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,locator:e.LocatorSchema,maxNodeCount:t.JsUintSchema.gte(1).optional(),ownership:c.ResultOwnershipSchema.optional(),sandbox:r.default.string().optional(),serializationOptions:c.SerializationOptionsSchema.optional(),startNodes:r.default.array(c.SharedReferenceSchema).min(1).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.LocateNodesSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.locateNodes"),params:e.LocateNodesParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.LocateNodesResultSchema=r.default.lazy((()=>r.default.object({nodes:r.default.array(c.NodeRemoteValueSchema)})))}(o||(t.BrowsingContext=o={})),function(e){e.NavigateSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.navigate"),params:e.NavigateParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.NavigateParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,url:r.default.string(),wait:e.ReadinessStateSchema.optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.NavigateResultSchema=r.default.lazy((()=>r.default.object({navigation:r.default.union([e.NavigationSchema,r.default.null()]),url:r.default.string()})))}(o||(t.BrowsingContext=o={})),function(e){e.PrintSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.print"),params:e.PrintParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.PrintParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,background:r.default.boolean().default(!1).optional(),margin:e.PrintMarginParametersSchema.optional(),orientation:r.default.enum(["portrait","landscape"]).default("portrait").optional(),page:e.PrintPageParametersSchema.optional(),pageRanges:r.default.array(r.default.union([t.JsUintSchema,r.default.string()])).optional(),scale:r.default.number().gte(.1).lte(2).default(1).optional(),shrinkToFit:r.default.boolean().default(!0).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.PrintMarginParametersSchema=r.default.lazy((()=>r.default.object({bottom:r.default.number().gte(0).default(1).optional(),left:r.default.number().gte(0).default(1).optional(),right:r.default.number().gte(0).default(1).optional(),top:r.default.number().gte(0).default(1).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.PrintPageParametersSchema=r.default.lazy((()=>r.default.object({height:r.default.number().gte(.0352).default(27.94).optional(),width:r.default.number().gte(.0352).default(21.59).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.PrintResultSchema=r.default.lazy((()=>r.default.object({data:r.default.string()})))}(o||(t.BrowsingContext=o={})),function(e){e.ReloadSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.reload"),params:e.ReloadParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.ReloadParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,ignoreCache:r.default.boolean().optional(),wait:e.ReadinessStateSchema.optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.SetViewportSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.setViewport"),params:e.SetViewportParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.SetViewportParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,viewport:r.default.union([e.ViewportSchema,r.default.null()]).optional(),devicePixelRatio:r.default.union([r.default.number().gt(0),r.default.null()]).optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.ViewportSchema=r.default.lazy((()=>r.default.object({width:t.JsUintSchema,height:t.JsUintSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.TraverseHistorySchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.traverseHistory"),params:e.TraverseHistoryParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.TraverseHistoryParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,delta:t.JsIntSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.TraverseHistoryResultSchema=r.default.lazy((()=>r.default.object({})))}(o||(t.BrowsingContext=o={})),function(e){e.ContextCreatedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.contextCreated"),params:e.InfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.ContextDestroyedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.contextDestroyed"),params:e.InfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.NavigationStartedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.navigationStarted"),params:e.NavigationInfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.FragmentNavigatedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.fragmentNavigated"),params:e.NavigationInfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.DomContentLoadedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.domContentLoaded"),params:e.NavigationInfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.LoadSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.load"),params:e.NavigationInfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.DownloadWillBeginSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.downloadWillBegin"),params:e.NavigationInfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.NavigationAbortedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.navigationAborted"),params:e.NavigationInfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.NavigationFailedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.navigationFailed"),params:e.NavigationInfoSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.UserPromptClosedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.userPromptClosed"),params:e.UserPromptClosedParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.UserPromptClosedParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,accepted:r.default.boolean(),userText:r.default.string().optional()})))}(o||(t.BrowsingContext=o={})),function(e){e.UserPromptOpenedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("browsingContext.userPromptOpened"),params:e.UserPromptOpenedParametersSchema})))}(o||(t.BrowsingContext=o={})),function(e){e.UserPromptOpenedParametersSchema=r.default.lazy((()=>r.default.object({context:e.BrowsingContextSchema,type:r.default.enum(["alert","confirm","prompt","beforeunload"]),message:r.default.string(),defaultValue:r.default.string().optional()})))}(o||(t.BrowsingContext=o={})),t.NetworkCommandSchema=r.default.lazy((()=>r.default.union([i.AddInterceptSchema,i.ContinueRequestSchema,i.ContinueResponseSchema,i.ContinueWithAuthSchema,i.FailRequestSchema,i.ProvideResponseSchema,i.RemoveInterceptSchema]))),t.NetworkEventSchema=r.default.lazy((()=>r.default.union([i.AuthRequiredSchema,i.BeforeRequestSentSchema,i.FetchErrorSchema,i.ResponseCompletedSchema,i.ResponseStartedSchema]))),t.NetworkResultSchema=r.default.lazy((()=>i.AddInterceptResultSchema)),function(e){e.AuthChallengeSchema=r.default.lazy((()=>r.default.object({scheme:r.default.string(),realm:r.default.string()})))}(i||(t.Network=i={})),function(e){e.AuthCredentialsSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("password"),username:r.default.string(),password:r.default.string()})))}(i||(t.Network=i={})),function(e){e.BaseParametersSchema=r.default.lazy((()=>r.default.object({context:r.default.union([o.BrowsingContextSchema,r.default.null()]),isBlocked:r.default.boolean(),navigation:r.default.union([o.NavigationSchema,r.default.null()]),redirectCount:t.JsUintSchema,request:e.RequestDataSchema,timestamp:t.JsUintSchema,intercepts:r.default.array(e.InterceptSchema).min(1).optional()})))}(i||(t.Network=i={})),function(e){e.BytesValueSchema=r.default.lazy((()=>r.default.union([e.StringValueSchema,e.Base64ValueSchema])))}(i||(t.Network=i={})),function(e){e.StringValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("string"),value:r.default.string()})))}(i||(t.Network=i={})),function(e){e.Base64ValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("base64"),value:r.default.string()})))}(i||(t.Network=i={})),function(e){e.SameSiteSchema=r.default.lazy((()=>r.default.enum(["strict","lax","none"])))}(i||(t.Network=i={})),function(e){e.CookieSchema=r.default.lazy((()=>r.default.object({name:r.default.string(),value:e.BytesValueSchema,domain:r.default.string(),path:r.default.string(),size:t.JsUintSchema,httpOnly:r.default.boolean(),secure:r.default.boolean(),sameSite:e.SameSiteSchema,expiry:t.JsUintSchema.optional()}).and(t.ExtensibleSchema)))}(i||(t.Network=i={})),function(e){e.CookieHeaderSchema=r.default.lazy((()=>r.default.object({name:r.default.string(),value:e.BytesValueSchema})))}(i||(t.Network=i={})),function(e){e.FetchTimingInfoSchema=r.default.lazy((()=>r.default.object({timeOrigin:r.default.number(),requestTime:r.default.number(),redirectStart:r.default.number(),redirectEnd:r.default.number(),fetchStart:r.default.number(),dnsStart:r.default.number(),dnsEnd:r.default.number(),connectStart:r.default.number(),connectEnd:r.default.number(),tlsStart:r.default.number(),requestStart:r.default.number(),responseStart:r.default.number(),responseEnd:r.default.number()})))}(i||(t.Network=i={})),function(e){e.HeaderSchema=r.default.lazy((()=>r.default.object({name:r.default.string(),value:e.BytesValueSchema})))}(i||(t.Network=i={})),function(e){e.InitiatorSchema=r.default.lazy((()=>r.default.object({type:r.default.enum(["parser","script","preflight","other"]),columnNumber:t.JsUintSchema.optional(),lineNumber:t.JsUintSchema.optional(),stackTrace:c.StackTraceSchema.optional(),request:e.RequestSchema.optional()})))}(i||(t.Network=i={})),function(e){e.InterceptSchema=r.default.lazy((()=>r.default.string()))}(i||(t.Network=i={})),function(e){e.RequestSchema=r.default.lazy((()=>r.default.string()))}(i||(t.Network=i={})),function(e){e.RequestDataSchema=r.default.lazy((()=>r.default.object({request:e.RequestSchema,url:r.default.string(),method:r.default.string(),headers:r.default.array(e.HeaderSchema),cookies:r.default.array(e.CookieSchema),headersSize:t.JsUintSchema,bodySize:r.default.union([t.JsUintSchema,r.default.null()]),timings:e.FetchTimingInfoSchema})))}(i||(t.Network=i={})),function(e){e.ResponseContentSchema=r.default.lazy((()=>r.default.object({size:t.JsUintSchema})))}(i||(t.Network=i={})),function(e){e.ResponseDataSchema=r.default.lazy((()=>r.default.object({url:r.default.string(),protocol:r.default.string(),status:t.JsUintSchema,statusText:r.default.string(),fromCache:r.default.boolean(),headers:r.default.array(e.HeaderSchema),mimeType:r.default.string(),bytesReceived:t.JsUintSchema,headersSize:r.default.union([t.JsUintSchema,r.default.null()]),bodySize:r.default.union([t.JsUintSchema,r.default.null()]),content:e.ResponseContentSchema,authChallenge:e.AuthChallengeSchema.optional()})))}(i||(t.Network=i={})),function(e){e.SetCookieHeaderSchema=r.default.lazy((()=>r.default.object({name:r.default.string(),value:e.BytesValueSchema,domain:r.default.string().optional(),httpOnly:r.default.boolean().optional(),expiry:r.default.string().optional(),maxAge:t.JsIntSchema.optional(),path:r.default.string().optional(),sameSite:e.SameSiteSchema.optional(),secure:r.default.boolean().optional()})))}(i||(t.Network=i={})),function(e){e.UrlPatternSchema=r.default.lazy((()=>r.default.union([e.UrlPatternPatternSchema,e.UrlPatternStringSchema])))}(i||(t.Network=i={})),function(e){e.UrlPatternPatternSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("pattern"),protocol:r.default.string().optional(),hostname:r.default.string().optional(),port:r.default.string().optional(),pathname:r.default.string().optional(),search:r.default.string().optional()})))}(i||(t.Network=i={})),function(e){e.UrlPatternStringSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("string"),pattern:r.default.string()})))}(i||(t.Network=i={})),function(e){e.AddInterceptParametersSchema=r.default.lazy((()=>r.default.object({phases:r.default.array(e.InterceptPhaseSchema).min(1),contexts:r.default.array(o.BrowsingContextSchema).min(1).optional(),urlPatterns:r.default.array(e.UrlPatternSchema).optional()})))}(i||(t.Network=i={})),function(e){e.AddInterceptSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.addIntercept"),params:e.AddInterceptParametersSchema})))}(i||(t.Network=i={})),function(e){e.InterceptPhaseSchema=r.default.lazy((()=>r.default.enum(["beforeRequestSent","responseStarted","authRequired"])))}(i||(t.Network=i={})),function(e){e.AddInterceptResultSchema=r.default.lazy((()=>r.default.object({intercept:e.InterceptSchema})))}(i||(t.Network=i={})),function(e){e.ContinueRequestSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.continueRequest"),params:e.ContinueRequestParametersSchema})))}(i||(t.Network=i={})),function(e){e.ContinueRequestParametersSchema=r.default.lazy((()=>r.default.object({request:e.RequestSchema,body:e.BytesValueSchema.optional(),cookies:r.default.array(e.CookieHeaderSchema).optional(),headers:r.default.array(e.HeaderSchema).optional(),method:r.default.string().optional(),url:r.default.string().optional()})))}(i||(t.Network=i={})),function(e){e.ContinueResponseSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.continueResponse"),params:e.ContinueResponseParametersSchema})))}(i||(t.Network=i={})),function(e){e.ContinueResponseParametersSchema=r.default.lazy((()=>r.default.object({request:e.RequestSchema,cookies:r.default.array(e.SetCookieHeaderSchema).optional(),credentials:e.AuthCredentialsSchema.optional(),headers:r.default.array(e.HeaderSchema).optional(),reasonPhrase:r.default.string().optional(),statusCode:t.JsUintSchema.optional()})))}(i||(t.Network=i={})),function(e){e.ContinueWithAuthSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.continueWithAuth"),params:e.ContinueWithAuthParametersSchema})))}(i||(t.Network=i={})),function(e){e.ContinueWithAuthParametersSchema=r.default.lazy((()=>r.default.object({request:e.RequestSchema}).and(r.default.union([e.ContinueWithAuthCredentialsSchema,e.ContinueWithAuthNoCredentialsSchema]))))}(i||(t.Network=i={})),function(e){e.ContinueWithAuthCredentialsSchema=r.default.lazy((()=>r.default.object({action:r.default.literal("provideCredentials"),credentials:e.AuthCredentialsSchema})))}(i||(t.Network=i={})),function(e){e.ContinueWithAuthNoCredentialsSchema=r.default.lazy((()=>r.default.object({action:r.default.enum(["default","cancel"])})))}(i||(t.Network=i={})),function(e){e.FailRequestSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.failRequest"),params:e.FailRequestParametersSchema})))}(i||(t.Network=i={})),function(e){e.FailRequestParametersSchema=r.default.lazy((()=>r.default.object({request:e.RequestSchema})))}(i||(t.Network=i={})),function(e){e.ProvideResponseSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.provideResponse"),params:e.ProvideResponseParametersSchema})))}(i||(t.Network=i={})),function(e){e.ProvideResponseParametersSchema=r.default.lazy((()=>r.default.object({request:e.RequestSchema,body:e.BytesValueSchema.optional(),cookies:r.default.array(e.SetCookieHeaderSchema).optional(),headers:r.default.array(e.HeaderSchema).optional(),reasonPhrase:r.default.string().optional(),statusCode:t.JsUintSchema.optional()})))}(i||(t.Network=i={})),function(e){e.RemoveInterceptSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.removeIntercept"),params:e.RemoveInterceptParametersSchema})))}(i||(t.Network=i={})),function(e){e.RemoveInterceptParametersSchema=r.default.lazy((()=>r.default.object({intercept:e.InterceptSchema})))}(i||(t.Network=i={})),t.ScriptEventSchema=r.default.lazy((()=>r.default.union([c.MessageSchema,c.RealmCreatedSchema,c.RealmDestroyedSchema]))),function(e){e.AuthRequiredParametersSchema=r.default.lazy((()=>e.BaseParametersSchema.and(r.default.object({response:e.ResponseDataSchema}))))}(i||(t.Network=i={})),function(e){e.BeforeRequestSentParametersSchema=r.default.lazy((()=>e.BaseParametersSchema.and(r.default.object({initiator:e.InitiatorSchema}))))}(i||(t.Network=i={})),function(e){e.FetchErrorParametersSchema=r.default.lazy((()=>e.BaseParametersSchema.and(r.default.object({errorText:r.default.string()}))))}(i||(t.Network=i={})),function(e){e.ResponseCompletedParametersSchema=r.default.lazy((()=>e.BaseParametersSchema.and(r.default.object({response:e.ResponseDataSchema}))))}(i||(t.Network=i={})),function(e){e.ResponseStartedParametersSchema=r.default.lazy((()=>e.BaseParametersSchema.and(r.default.object({response:e.ResponseDataSchema}))))}(i||(t.Network=i={})),t.ScriptCommandSchema=r.default.lazy((()=>r.default.union([c.AddPreloadScriptSchema,c.CallFunctionSchema,c.DisownSchema,c.EvaluateSchema,c.GetRealmsSchema,c.RemovePreloadScriptSchema]))),t.ScriptResultSchema=r.default.lazy((()=>r.default.union([c.AddPreloadScriptResultSchema,c.EvaluateResultSchema,c.GetRealmsResultSchema]))),function(e){e.AuthRequiredSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.authRequired"),params:e.AuthRequiredParametersSchema})))}(i||(t.Network=i={})),function(e){e.BeforeRequestSentSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.beforeRequestSent"),params:e.BeforeRequestSentParametersSchema})))}(i||(t.Network=i={})),function(e){e.FetchErrorSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.fetchError"),params:e.FetchErrorParametersSchema})))}(i||(t.Network=i={})),function(e){e.ResponseCompletedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.responseCompleted"),params:e.ResponseCompletedParametersSchema})))}(i||(t.Network=i={})),function(e){e.ResponseStartedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("network.responseStarted"),params:e.ResponseStartedParametersSchema})))}(i||(t.Network=i={})),function(e){e.ChannelSchema=r.default.lazy((()=>r.default.string()))}(c||(t.Script=c={})),function(e){e.EvaluateResultSuccessSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("success"),result:e.RemoteValueSchema,realm:e.RealmSchema})))}(c||(t.Script=c={})),function(e){e.ExceptionDetailsSchema=r.default.lazy((()=>r.default.object({columnNumber:t.JsUintSchema,exception:e.RemoteValueSchema,lineNumber:t.JsUintSchema,stackTrace:e.StackTraceSchema,text:r.default.string()})))}(c||(t.Script=c={})),function(e){e.ChannelValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("channel"),value:e.ChannelPropertiesSchema})))}(c||(t.Script=c={})),function(e){e.ChannelPropertiesSchema=r.default.lazy((()=>r.default.object({channel:e.ChannelSchema,serializationOptions:e.SerializationOptionsSchema.optional(),ownership:e.ResultOwnershipSchema.optional()})))}(c||(t.Script=c={})),function(e){e.EvaluateResultSchema=r.default.lazy((()=>r.default.union([e.EvaluateResultSuccessSchema,e.EvaluateResultExceptionSchema])))}(c||(t.Script=c={})),function(e){e.EvaluateResultExceptionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("exception"),exceptionDetails:e.ExceptionDetailsSchema,realm:e.RealmSchema})))}(c||(t.Script=c={})),function(e){e.HandleSchema=r.default.lazy((()=>r.default.string()))}(c||(t.Script=c={})),function(e){e.InternalIdSchema=r.default.lazy((()=>r.default.string()))}(c||(t.Script=c={})),function(e){e.ListLocalValueSchema=r.default.lazy((()=>r.default.array(e.LocalValueSchema)))}(c||(t.Script=c={})),function(e){e.LocalValueSchema=r.default.lazy((()=>r.default.union([e.RemoteReferenceSchema,e.PrimitiveProtocolValueSchema,e.ChannelValueSchema,e.ArrayLocalValueSchema,e.DateLocalValueSchema,e.MapLocalValueSchema,e.ObjectLocalValueSchema,e.RegExpLocalValueSchema,e.SetLocalValueSchema])))}(c||(t.Script=c={})),function(e){e.ArrayLocalValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("array"),value:e.ListLocalValueSchema})))}(c||(t.Script=c={})),function(e){e.DateLocalValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("date"),value:r.default.string()})))}(c||(t.Script=c={})),function(e){e.MappingLocalValueSchema=r.default.lazy((()=>r.default.array(r.default.tuple([r.default.union([e.LocalValueSchema,r.default.string()]),e.LocalValueSchema]))))}(c||(t.Script=c={})),function(e){e.MapLocalValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("map"),value:e.MappingLocalValueSchema})))}(c||(t.Script=c={})),function(e){e.ObjectLocalValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("object"),value:e.MappingLocalValueSchema})))}(c||(t.Script=c={})),function(e){e.RegExpValueSchema=r.default.lazy((()=>r.default.object({pattern:r.default.string(),flags:r.default.string().optional()})))}(c||(t.Script=c={})),function(e){e.RegExpLocalValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("regexp"),value:e.RegExpValueSchema})))}(c||(t.Script=c={})),function(e){e.SetLocalValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("set"),value:e.ListLocalValueSchema})))}(c||(t.Script=c={})),function(e){e.PreloadScriptSchema=r.default.lazy((()=>r.default.string()))}(c||(t.Script=c={})),function(e){e.RealmSchema=r.default.lazy((()=>r.default.string()))}(c||(t.Script=c={})),function(e){e.PrimitiveProtocolValueSchema=r.default.lazy((()=>r.default.union([e.UndefinedValueSchema,e.NullValueSchema,e.StringValueSchema,e.NumberValueSchema,e.BooleanValueSchema,e.BigIntValueSchema])))}(c||(t.Script=c={})),function(e){e.UndefinedValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("undefined")})))}(c||(t.Script=c={})),function(e){e.NullValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("null")})))}(c||(t.Script=c={})),function(e){e.StringValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("string"),value:r.default.string()})))}(c||(t.Script=c={})),function(e){e.SpecialNumberSchema=r.default.lazy((()=>r.default.enum(["NaN","-0","Infinity","-Infinity"])))}(c||(t.Script=c={})),function(e){e.NumberValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("number"),value:r.default.union([r.default.number(),e.SpecialNumberSchema])})))}(c||(t.Script=c={})),function(e){e.BooleanValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("boolean"),value:r.default.boolean()})))}(c||(t.Script=c={})),function(e){e.BigIntValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("bigint"),value:r.default.string()})))}(c||(t.Script=c={})),function(e){e.RealmInfoSchema=r.default.lazy((()=>r.default.union([e.WindowRealmInfoSchema,e.DedicatedWorkerRealmInfoSchema,e.SharedWorkerRealmInfoSchema,e.ServiceWorkerRealmInfoSchema,e.WorkerRealmInfoSchema,e.PaintWorkletRealmInfoSchema,e.AudioWorkletRealmInfoSchema,e.WorkletRealmInfoSchema])))}(c||(t.Script=c={})),function(e){e.BaseRealmInfoSchema=r.default.lazy((()=>r.default.object({realm:e.RealmSchema,origin:r.default.string()})))}(c||(t.Script=c={})),function(e){e.WindowRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("window"),context:o.BrowsingContextSchema,sandbox:r.default.string().optional()}))))}(c||(t.Script=c={})),function(e){e.DedicatedWorkerRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("dedicated-worker"),owners:r.default.tuple([e.RealmSchema])}))))}(c||(t.Script=c={})),function(e){e.SharedWorkerRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("shared-worker")}))))}(c||(t.Script=c={})),function(e){e.ServiceWorkerRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("service-worker")}))))}(c||(t.Script=c={})),function(e){e.WorkerRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("worker")}))))}(c||(t.Script=c={})),function(e){e.PaintWorkletRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("paint-worklet")}))))}(c||(t.Script=c={})),function(e){e.AudioWorkletRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("audio-worklet")}))))}(c||(t.Script=c={})),function(e){e.WorkletRealmInfoSchema=r.default.lazy((()=>e.BaseRealmInfoSchema.and(r.default.object({type:r.default.literal("worklet")}))))}(c||(t.Script=c={})),function(e){e.RealmTypeSchema=r.default.lazy((()=>r.default.enum(["window","dedicated-worker","shared-worker","service-worker","worker","paint-worklet","audio-worklet","worklet"])))}(c||(t.Script=c={})),function(e){e.ListRemoteValueSchema=r.default.lazy((()=>r.default.array(e.RemoteValueSchema)))}(c||(t.Script=c={})),function(e){e.MappingRemoteValueSchema=r.default.lazy((()=>r.default.array(r.default.tuple([r.default.union([e.RemoteValueSchema,r.default.string()]),e.RemoteValueSchema]))))}(c||(t.Script=c={})),function(e){e.RemoteValueSchema=r.default.lazy((()=>r.default.union([e.PrimitiveProtocolValueSchema,e.SymbolRemoteValueSchema,e.ArrayRemoteValueSchema,e.ObjectRemoteValueSchema,e.FunctionRemoteValueSchema,e.RegExpRemoteValueSchema,e.DateRemoteValueSchema,e.MapRemoteValueSchema,e.SetRemoteValueSchema,e.WeakMapRemoteValueSchema,e.WeakSetRemoteValueSchema,e.IteratorRemoteValueSchema,e.GeneratorRemoteValueSchema,e.ErrorRemoteValueSchema,e.ProxyRemoteValueSchema,e.PromiseRemoteValueSchema,e.TypedArrayRemoteValueSchema,e.ArrayBufferRemoteValueSchema,e.NodeListRemoteValueSchema,e.HtmlCollectionRemoteValueSchema,e.NodeRemoteValueSchema,e.WindowProxyRemoteValueSchema])))}(c||(t.Script=c={})),function(e){e.RemoteReferenceSchema=r.default.lazy((()=>r.default.union([e.SharedReferenceSchema,e.RemoteObjectReferenceSchema])))}(c||(t.Script=c={})),function(e){e.SharedReferenceSchema=r.default.lazy((()=>r.default.object({sharedId:e.SharedIdSchema,handle:e.HandleSchema.optional()}).and(t.ExtensibleSchema)))}(c||(t.Script=c={})),function(e){e.RemoteObjectReferenceSchema=r.default.lazy((()=>r.default.object({handle:e.HandleSchema,sharedId:e.SharedIdSchema.optional()}).and(t.ExtensibleSchema)))}(c||(t.Script=c={})),function(e){e.SymbolRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("symbol"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.ArrayRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("array"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional(),value:e.ListRemoteValueSchema.optional()})))}(c||(t.Script=c={})),function(e){e.ObjectRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("object"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional(),value:e.MappingRemoteValueSchema.optional()})))}(c||(t.Script=c={})),function(e){e.FunctionRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("function"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.RegExpRemoteValueSchema=r.default.lazy((()=>r.default.object({handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()}).and(e.RegExpLocalValueSchema)))}(c||(t.Script=c={})),function(e){e.DateRemoteValueSchema=r.default.lazy((()=>r.default.object({handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()}).and(e.DateLocalValueSchema)))}(c||(t.Script=c={})),function(e){e.MapRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("map"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional(),value:e.MappingRemoteValueSchema.optional()})))}(c||(t.Script=c={})),function(e){e.SetRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("set"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional(),value:e.ListRemoteValueSchema.optional()})))}(c||(t.Script=c={})),function(e){e.WeakMapRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("weakmap"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.WeakSetRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("weakset"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.IteratorRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("iterator"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.GeneratorRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("generator"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.ErrorRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("error"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.ProxyRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("proxy"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.PromiseRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("promise"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.TypedArrayRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("typedarray"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.ArrayBufferRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("arraybuffer"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.NodeListRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("nodelist"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional(),value:e.ListRemoteValueSchema.optional()})))}(c||(t.Script=c={})),function(e){e.HtmlCollectionRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("htmlcollection"),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional(),value:e.ListRemoteValueSchema.optional()})))}(c||(t.Script=c={})),function(e){e.NodeRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("node"),sharedId:e.SharedIdSchema.optional(),handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional(),value:e.NodePropertiesSchema.optional()})))}(c||(t.Script=c={})),function(e){e.NodePropertiesSchema=r.default.lazy((()=>r.default.object({nodeType:t.JsUintSchema,childNodeCount:t.JsUintSchema,attributes:r.default.record(r.default.string(),r.default.string()).optional(),children:r.default.array(e.NodeRemoteValueSchema).optional(),localName:r.default.string().optional(),mode:r.default.enum(["open","closed"]).optional(),namespaceURI:r.default.string().optional(),nodeValue:r.default.string().optional(),shadowRoot:r.default.union([e.NodeRemoteValueSchema,r.default.null()]).optional()})))}(c||(t.Script=c={})),function(e){e.WindowProxyRemoteValueSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("window"),value:e.WindowProxyPropertiesSchema,handle:e.HandleSchema.optional(),internalId:e.InternalIdSchema.optional()})))}(c||(t.Script=c={})),function(e){e.WindowProxyPropertiesSchema=r.default.lazy((()=>r.default.object({context:o.BrowsingContextSchema})))}(c||(t.Script=c={})),function(e){e.ResultOwnershipSchema=r.default.lazy((()=>r.default.enum(["root","none"])))}(c||(t.Script=c={})),function(e){e.SerializationOptionsSchema=r.default.lazy((()=>r.default.object({maxDomDepth:r.default.union([t.JsUintSchema,r.default.null()]).default(0).optional(),maxObjectDepth:r.default.union([t.JsUintSchema,r.default.null()]).default(null).optional(),includeShadowTree:r.default.enum(["none","open","all"]).default("none").optional()})))}(c||(t.Script=c={})),function(e){e.SharedIdSchema=r.default.lazy((()=>r.default.string()))}(c||(t.Script=c={})),function(e){e.StackFrameSchema=r.default.lazy((()=>r.default.object({columnNumber:t.JsUintSchema,functionName:r.default.string(),lineNumber:t.JsUintSchema,url:r.default.string()})))}(c||(t.Script=c={})),function(e){e.StackTraceSchema=r.default.lazy((()=>r.default.object({callFrames:r.default.array(e.StackFrameSchema)})))}(c||(t.Script=c={})),function(e){e.SourceSchema=r.default.lazy((()=>r.default.object({realm:e.RealmSchema,context:o.BrowsingContextSchema.optional()})))}(c||(t.Script=c={})),function(e){e.RealmTargetSchema=r.default.lazy((()=>r.default.object({realm:e.RealmSchema})))}(c||(t.Script=c={})),function(e){e.ContextTargetSchema=r.default.lazy((()=>r.default.object({context:o.BrowsingContextSchema,sandbox:r.default.string().optional()})))}(c||(t.Script=c={})),function(e){e.TargetSchema=r.default.lazy((()=>r.default.union([e.RealmTargetSchema,e.ContextTargetSchema])))}(c||(t.Script=c={})),function(e){e.AddPreloadScriptSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.addPreloadScript"),params:e.AddPreloadScriptParametersSchema})))}(c||(t.Script=c={})),function(e){e.AddPreloadScriptParametersSchema=r.default.lazy((()=>r.default.object({functionDeclaration:r.default.string(),arguments:r.default.array(e.ChannelValueSchema).optional(),contexts:r.default.array(o.BrowsingContextSchema).min(1).optional(),sandbox:r.default.string().optional()})))}(c||(t.Script=c={})),function(e){e.AddPreloadScriptResultSchema=r.default.lazy((()=>r.default.object({script:e.PreloadScriptSchema})))}(c||(t.Script=c={})),function(e){e.DisownSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.disown"),params:e.DisownParametersSchema})))}(c||(t.Script=c={})),function(e){e.DisownParametersSchema=r.default.lazy((()=>r.default.object({handles:r.default.array(e.HandleSchema),target:e.TargetSchema})))}(c||(t.Script=c={})),function(e){e.CallFunctionParametersSchema=r.default.lazy((()=>r.default.object({functionDeclaration:r.default.string(),awaitPromise:r.default.boolean(),target:e.TargetSchema,arguments:r.default.array(e.LocalValueSchema).optional(),resultOwnership:e.ResultOwnershipSchema.optional(),serializationOptions:e.SerializationOptionsSchema.optional(),this:e.LocalValueSchema.optional(),userActivation:r.default.boolean().default(!1).optional()})))}(c||(t.Script=c={})),function(e){e.CallFunctionSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.callFunction"),params:e.CallFunctionParametersSchema})))}(c||(t.Script=c={})),function(e){e.EvaluateSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.evaluate"),params:e.EvaluateParametersSchema})))}(c||(t.Script=c={})),function(e){e.EvaluateParametersSchema=r.default.lazy((()=>r.default.object({expression:r.default.string(),target:e.TargetSchema,awaitPromise:r.default.boolean(),resultOwnership:e.ResultOwnershipSchema.optional(),serializationOptions:e.SerializationOptionsSchema.optional(),userActivation:r.default.boolean().default(!1).optional()})))}(c||(t.Script=c={})),function(e){e.GetRealmsSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.getRealms"),params:e.GetRealmsParametersSchema})))}(c||(t.Script=c={})),function(e){e.GetRealmsParametersSchema=r.default.lazy((()=>r.default.object({context:o.BrowsingContextSchema.optional(),type:e.RealmTypeSchema.optional()})))}(c||(t.Script=c={})),function(e){e.GetRealmsResultSchema=r.default.lazy((()=>r.default.object({realms:r.default.array(e.RealmInfoSchema)})))}(c||(t.Script=c={})),function(e){e.RemovePreloadScriptSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.removePreloadScript"),params:e.RemovePreloadScriptParametersSchema})))}(c||(t.Script=c={})),function(e){e.RemovePreloadScriptParametersSchema=r.default.lazy((()=>r.default.object({script:e.PreloadScriptSchema})))}(c||(t.Script=c={})),function(e){e.MessageParametersSchema=r.default.lazy((()=>r.default.object({channel:e.ChannelSchema,data:e.RemoteValueSchema,source:e.SourceSchema})))}(c||(t.Script=c={})),function(e){e.RealmCreatedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.realmCreated"),params:e.RealmInfoSchema})))}(c||(t.Script=c={})),function(e){e.MessageSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.message"),params:e.MessageParametersSchema})))}(c||(t.Script=c={})),function(e){e.RealmDestroyedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("script.realmDestroyed"),params:e.RealmDestroyedParametersSchema})))}(c||(t.Script=c={})),function(e){e.RealmDestroyedParametersSchema=r.default.lazy((()=>r.default.object({realm:e.RealmSchema})))}(c||(t.Script=c={})),t.StorageCommandSchema=r.default.lazy((()=>r.default.union([d.DeleteCookiesSchema,d.GetCookiesSchema,d.SetCookieSchema]))),t.StorageResultSchema=r.default.lazy((()=>r.default.union([d.DeleteCookiesResultSchema,d.GetCookiesResultSchema,d.SetCookieResultSchema]))),function(e){e.PartitionKeySchema=r.default.lazy((()=>r.default.object({userContext:r.default.string().optional(),sourceOrigin:r.default.string().optional()}).and(t.ExtensibleSchema)))}(d||(t.Storage=d={})),function(e){e.GetCookiesSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("storage.getCookies"),params:e.GetCookiesParametersSchema})))}(d||(t.Storage=d={})),function(e){e.CookieFilterSchema=r.default.lazy((()=>r.default.object({name:r.default.string().optional(),value:i.BytesValueSchema.optional(),domain:r.default.string().optional(),path:r.default.string().optional(),size:t.JsUintSchema.optional(),httpOnly:r.default.boolean().optional(),secure:r.default.boolean().optional(),sameSite:i.SameSiteSchema.optional(),expiry:t.JsUintSchema.optional()}).and(t.ExtensibleSchema)))}(d||(t.Storage=d={})),function(e){e.BrowsingContextPartitionDescriptorSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("context"),context:o.BrowsingContextSchema})))}(d||(t.Storage=d={})),function(e){e.StorageKeyPartitionDescriptorSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("storageKey"),userContext:r.default.string().optional(),sourceOrigin:r.default.string().optional()}).and(t.ExtensibleSchema)))}(d||(t.Storage=d={})),function(e){e.PartitionDescriptorSchema=r.default.lazy((()=>r.default.union([e.BrowsingContextPartitionDescriptorSchema,e.StorageKeyPartitionDescriptorSchema])))}(d||(t.Storage=d={})),function(e){e.GetCookiesParametersSchema=r.default.lazy((()=>r.default.object({filter:e.CookieFilterSchema.optional(),partition:e.PartitionDescriptorSchema.optional()})))}(d||(t.Storage=d={})),function(e){e.GetCookiesResultSchema=r.default.lazy((()=>r.default.object({cookies:r.default.array(i.CookieSchema),partitionKey:e.PartitionKeySchema})))}(d||(t.Storage=d={})),function(e){e.SetCookieSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("storage.setCookie"),params:e.SetCookieParametersSchema})))}(d||(t.Storage=d={})),function(e){e.PartialCookieSchema=r.default.lazy((()=>r.default.object({name:r.default.string(),value:i.BytesValueSchema,domain:r.default.string(),path:r.default.string().optional(),httpOnly:r.default.boolean().optional(),secure:r.default.boolean().optional(),sameSite:i.SameSiteSchema.optional(),expiry:t.JsUintSchema.optional()}).and(t.ExtensibleSchema)))}(d||(t.Storage=d={})),function(e){e.SetCookieParametersSchema=r.default.lazy((()=>r.default.object({cookie:e.PartialCookieSchema,partition:e.PartitionDescriptorSchema.optional()})))}(d||(t.Storage=d={})),function(e){e.SetCookieResultSchema=r.default.lazy((()=>r.default.object({partitionKey:e.PartitionKeySchema})))}(d||(t.Storage=d={})),function(e){e.DeleteCookiesSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("storage.deleteCookies"),params:e.DeleteCookiesParametersSchema})))}(d||(t.Storage=d={})),function(e){e.DeleteCookiesParametersSchema=r.default.lazy((()=>r.default.object({filter:e.CookieFilterSchema.optional(),partition:e.PartitionDescriptorSchema.optional()})))}(d||(t.Storage=d={})),function(e){e.DeleteCookiesResultSchema=r.default.lazy((()=>r.default.object({partitionKey:e.PartitionKeySchema})))}(d||(t.Storage=d={})),t.LogEventSchema=r.default.lazy((()=>u.EntryAddedSchema)),function(e){e.LevelSchema=r.default.lazy((()=>r.default.enum(["debug","info","warn","error"])))}(u||(t.Log=u={})),function(e){e.EntrySchema=r.default.lazy((()=>r.default.union([e.GenericLogEntrySchema,e.ConsoleLogEntrySchema,e.JavascriptLogEntrySchema])))}(u||(t.Log=u={})),function(e){e.BaseLogEntrySchema=r.default.lazy((()=>r.default.object({level:e.LevelSchema,source:c.SourceSchema,text:r.default.union([r.default.string(),r.default.null()]),timestamp:t.JsUintSchema,stackTrace:c.StackTraceSchema.optional()})))}(u||(t.Log=u={})),function(e){e.GenericLogEntrySchema=r.default.lazy((()=>e.BaseLogEntrySchema.and(r.default.object({type:r.default.string()}))))}(u||(t.Log=u={})),function(e){e.ConsoleLogEntrySchema=r.default.lazy((()=>e.BaseLogEntrySchema.and(r.default.object({type:r.default.literal("console"),method:r.default.string(),args:r.default.array(c.RemoteValueSchema)}))))}(u||(t.Log=u={})),function(e){e.JavascriptLogEntrySchema=r.default.lazy((()=>e.BaseLogEntrySchema.and(r.default.object({type:r.default.literal("javascript")}))))}(u||(t.Log=u={})),function(e){e.EntryAddedSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("log.entryAdded"),params:e.EntrySchema})))}(u||(t.Log=u={})),t.InputCommandSchema=r.default.lazy((()=>r.default.union([l.PerformActionsSchema,l.ReleaseActionsSchema,l.SetFilesSchema]))),function(e){e.ElementOriginSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("element"),element:c.SharedReferenceSchema})))}(l||(t.Input=l={})),function(e){e.PerformActionsParametersSchema=r.default.lazy((()=>r.default.object({context:o.BrowsingContextSchema,actions:r.default.array(e.SourceActionsSchema)})))}(l||(t.Input=l={})),function(e){e.NoneSourceActionsSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("none"),id:r.default.string(),actions:r.default.array(e.NoneSourceActionSchema)})))}(l||(t.Input=l={})),function(e){e.KeySourceActionsSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("key"),id:r.default.string(),actions:r.default.array(e.KeySourceActionSchema)})))}(l||(t.Input=l={})),function(e){e.PointerSourceActionsSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("pointer"),id:r.default.string(),parameters:e.PointerParametersSchema.optional(),actions:r.default.array(e.PointerSourceActionSchema)})))}(l||(t.Input=l={})),function(e){e.PerformActionsSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("input.performActions"),params:e.PerformActionsParametersSchema})))}(l||(t.Input=l={})),function(e){e.SourceActionsSchema=r.default.lazy((()=>r.default.union([e.NoneSourceActionsSchema,e.KeySourceActionsSchema,e.PointerSourceActionsSchema,e.WheelSourceActionsSchema])))}(l||(t.Input=l={})),function(e){e.NoneSourceActionSchema=r.default.lazy((()=>e.PauseActionSchema))}(l||(t.Input=l={})),function(e){e.KeySourceActionSchema=r.default.lazy((()=>r.default.union([e.PauseActionSchema,e.KeyDownActionSchema,e.KeyUpActionSchema])))}(l||(t.Input=l={})),function(e){e.PointerTypeSchema=r.default.lazy((()=>r.default.enum(["mouse","pen","touch"])))}(l||(t.Input=l={})),function(e){e.PointerParametersSchema=r.default.lazy((()=>r.default.object({pointerType:e.PointerTypeSchema.default("mouse").optional()})))}(l||(t.Input=l={})),function(e){e.WheelSourceActionsSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("wheel"),id:r.default.string(),actions:r.default.array(e.WheelSourceActionSchema)})))}(l||(t.Input=l={})),function(e){e.PointerSourceActionSchema=r.default.lazy((()=>r.default.union([e.PauseActionSchema,e.PointerDownActionSchema,e.PointerUpActionSchema,e.PointerMoveActionSchema])))}(l||(t.Input=l={})),function(e){e.WheelSourceActionSchema=r.default.lazy((()=>r.default.union([e.PauseActionSchema,e.WheelScrollActionSchema])))}(l||(t.Input=l={})),function(e){e.PauseActionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("pause"),duration:t.JsUintSchema.optional()})))}(l||(t.Input=l={})),function(e){e.KeyDownActionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("keyDown"),value:r.default.string()})))}(l||(t.Input=l={})),function(e){e.KeyUpActionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("keyUp"),value:r.default.string()})))}(l||(t.Input=l={})),function(e){e.PointerUpActionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("pointerUp"),button:t.JsUintSchema}).and(e.PointerCommonPropertiesSchema)))}(l||(t.Input=l={})),function(e){e.PointerDownActionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("pointerDown"),button:t.JsUintSchema}).and(e.PointerCommonPropertiesSchema)))}(l||(t.Input=l={})),function(e){e.PointerMoveActionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("pointerMove"),x:t.JsIntSchema,y:t.JsIntSchema,duration:t.JsUintSchema.optional(),origin:e.OriginSchema.optional()}).and(e.PointerCommonPropertiesSchema)))}(l||(t.Input=l={})),function(e){e.WheelScrollActionSchema=r.default.lazy((()=>r.default.object({type:r.default.literal("scroll"),x:t.JsIntSchema,y:t.JsIntSchema,deltaX:t.JsIntSchema,deltaY:t.JsIntSchema,duration:t.JsUintSchema.optional(),origin:e.OriginSchema.default("viewport").optional()})))}(l||(t.Input=l={})),function(e){e.PointerCommonPropertiesSchema=r.default.lazy((()=>r.default.object({width:t.JsUintSchema.default(1).optional(),height:t.JsUintSchema.default(1).optional(),pressure:r.default.number().default(0).optional(),tangentialPressure:r.default.number().default(0).optional(),twist:r.default.number().int().nonnegative().gte(0).lte(359).default(0).optional(),altitudeAngle:r.default.number().gte(0).lte(1.5707963267948966).default(0).optional(),azimuthAngle:r.default.number().gte(0).lte(6.283185307179586).default(0).optional()})))}(l||(t.Input=l={})),function(e){e.OriginSchema=r.default.lazy((()=>r.default.union([r.default.literal("viewport"),r.default.literal("pointer"),e.ElementOriginSchema])))}(l||(t.Input=l={})),function(e){e.ReleaseActionsSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("input.releaseActions"),params:e.ReleaseActionsParametersSchema})))}(l||(t.Input=l={})),function(e){e.ReleaseActionsParametersSchema=r.default.lazy((()=>r.default.object({context:o.BrowsingContextSchema})))}(l||(t.Input=l={})),function(e){e.SetFilesSchema=r.default.lazy((()=>r.default.object({method:r.default.literal("input.setFiles"),params:e.SetFilesParametersSchema})))}(l||(t.Input=l={})),function(e){e.SetFilesParametersSchema=r.default.lazy((()=>r.default.object({context:o.BrowsingContextSchema,element:c.SharedReferenceSchema,files:r.default.array(r.default.string())})))}(l||(t.Input=l={}))}(Mn);var Bn=e&&e.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),An=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Dn=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&Bn(t,e,a);return An(t,e),t};Object.defineProperty(ln,"__esModule",{value:!0}),ln.Permissions=ln.Cdp=ln.Storage=ln.Input=ln.Session=ln.BrowsingContext=ln.Script=ln.Network=ln.parseObject=void 0;const zn=hn,Ln=g,Zn=Dn(Tn),Un=Dn(Mn);function Fn(e,t){const a=t.safeParse(e);if(a.success)return a.data;const r=a.error.errors.map((e=>`${e.message} in ${e.path.map((e=>JSON.stringify(e))).join("/")}.`)).join(" ");throw new Ln.InvalidArgumentException(r)}var qn,Vn,$n,Kn,Wn,Hn,Jn,Gn;ln.parseObject=Fn,function(e){e.parseAddInterceptParameters=function(e){return Fn(e,Un.Network.AddInterceptParametersSchema)},e.parseContinueRequestParameters=function(e){return Fn(e,Un.Network.ContinueRequestParametersSchema)},e.parseContinueResponseParameters=function(e){return Fn(e,Un.Network.ContinueResponseParametersSchema)},e.parseContinueWithAuthParameters=function(e){return Fn(e,Un.Network.ContinueWithAuthParametersSchema)},e.parseFailRequestParameters=function(e){return Fn(e,Un.Network.FailRequestParametersSchema)},e.parseProvideResponseParameters=function(e){return Fn(e,Un.Network.ProvideResponseParametersSchema)},e.parseRemoveInterceptParameters=function(e){return Fn(e,Un.Network.RemoveInterceptParametersSchema)}}(qn||(ln.Network=qn={})),function(e){e.parseGetRealmsParams=function(e){return Fn(e,Un.Script.GetRealmsParametersSchema)},e.parseEvaluateParams=function(e){return Fn(e,Un.Script.EvaluateParametersSchema)},e.parseDisownParams=function(e){return Fn(e,Un.Script.DisownParametersSchema)},e.parseAddPreloadScriptParams=function(e){return Fn(e,Un.Script.AddPreloadScriptParametersSchema)},e.parseRemovePreloadScriptParams=function(e){return Fn(e,Un.Script.RemovePreloadScriptParametersSchema)},e.parseCallFunctionParams=function(e){return Fn(e,Un.Script.CallFunctionParametersSchema)}}(Vn||(ln.Script=Vn={})),function(e){e.parseActivateParams=function(e){return Fn(e,Un.BrowsingContext.ActivateParametersSchema)},e.parseGetTreeParams=function(e){return Fn(e,Un.BrowsingContext.GetTreeParametersSchema)},e.parseNavigateParams=function(e){return Fn(e,Un.BrowsingContext.NavigateParametersSchema)},e.parseReloadParams=function(e){return Fn(e,Un.BrowsingContext.ReloadParametersSchema)},e.parseCreateParams=function(e){return Fn(e,Un.BrowsingContext.CreateParametersSchema)},e.parseCloseParams=function(e){return Fn(e,Un.BrowsingContext.CloseParametersSchema)},e.parseCaptureScreenshotParams=function(e){return Fn(e,Un.BrowsingContext.CaptureScreenshotParametersSchema)},e.parsePrintParams=function(e){return Fn(e,Un.BrowsingContext.PrintParametersSchema)},e.parseSetViewportParams=function(e){return Fn(e,Un.BrowsingContext.SetViewportParametersSchema)},e.parseTraverseHistoryParams=function(e){return Fn(e,Un.BrowsingContext.TraverseHistoryParametersSchema)},e.parseHandleUserPromptParameters=function(e){return Fn(e,Un.BrowsingContext.HandleUserPromptParametersSchema)}}($n||(ln.BrowsingContext=$n={})),function(e){e.parseSubscribeParams=function(e){return Fn(e,Un.Session.SubscriptionRequestSchema)}}(Kn||(ln.Session=Kn={})),function(e){e.parsePerformActionsParams=function(e){return Fn(e,Un.Input.PerformActionsParametersSchema)},e.parseReleaseActionsParams=function(e){return Fn(e,Un.Input.ReleaseActionsParametersSchema)},e.parseSetFilesParams=function(e){return Fn(e,Un.Input.SetFilesParametersSchema)}}(Wn||(ln.Input=Wn={})),function(e){e.parseGetCookiesParams=function(e){return Fn(e,Un.Storage.GetCookiesParametersSchema)},e.parseSetCookieParams=function(e){return Fn(e,Un.Storage.SetCookieParametersSchema)},e.parseDeleteCookiesParams=function(e){return Fn(e,Un.Storage.DeleteCookiesParametersSchema)}}(Hn||(ln.Storage=Hn={})),function(e){const t=zn.z.object({method:zn.z.string(),params:zn.z.object({}).passthrough().optional(),session:zn.z.string().optional()}),a=zn.z.object({context:Un.BrowsingContext.BrowsingContextSchema});e.parseSendCommandRequest=function(e){return Fn(e,t)},e.parseGetSessionRequest=function(e){return Fn(e,a)}}(Jn||(ln.Cdp=Jn={})),function(e){e.parseSetPermissionsParams=function(e){return{...e,...Fn(e,Zn.Permissions.SetPermissionParametersSchema)}}}(Gn||(ln.Permissions=Gn={}));var Xn=e&&e.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),Yn=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qn=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&Xn(t,e,a);return Yn(t,e),t};Object.defineProperty(un,"__esModule",{value:!0}),un.BidiParser=void 0;const es=Qn(ln);un.BidiParser=class{parseActivateParams(e){return es.BrowsingContext.parseActivateParams(e)}parseCaptureScreenshotParams(e){return es.BrowsingContext.parseCaptureScreenshotParams(e)}parseCloseParams(e){return es.BrowsingContext.parseCloseParams(e)}parseCreateParams(e){return es.BrowsingContext.parseCreateParams(e)}parseGetTreeParams(e){return es.BrowsingContext.parseGetTreeParams(e)}parseHandleUserPromptParams(e){return es.BrowsingContext.parseHandleUserPromptParameters(e)}parseNavigateParams(e){return es.BrowsingContext.parseNavigateParams(e)}parsePrintParams(e){return es.BrowsingContext.parsePrintParams(e)}parseReloadParams(e){return es.BrowsingContext.parseReloadParams(e)}parseSetViewportParams(e){return es.BrowsingContext.parseSetViewportParams(e)}parseTraverseHistoryParams(e){return es.BrowsingContext.parseTraverseHistoryParams(e)}parseGetSessionParams(e){return es.Cdp.parseGetSessionRequest(e)}parseSendCommandParams(e){return es.Cdp.parseSendCommandRequest(e)}parsePerformActionsParams(e){return es.Input.parsePerformActionsParams(e)}parseReleaseActionsParams(e){return es.Input.parseReleaseActionsParams(e)}parseSetFilesParams(e){return es.Input.parseSetFilesParams(e)}parseAddInterceptParams(e){return es.Network.parseAddInterceptParameters(e)}parseContinueRequestParams(e){return es.Network.parseContinueRequestParameters(e)}parseContinueResponseParams(e){return es.Network.parseContinueResponseParameters(e)}parseContinueWithAuthParams(e){return es.Network.parseContinueWithAuthParameters(e)}parseFailRequestParams(e){return es.Network.parseFailRequestParameters(e)}parseProvideResponseParams(e){return es.Network.parseProvideResponseParameters(e)}parseRemoveInterceptParams(e){return es.Network.parseRemoveInterceptParameters(e)}parseSetPermissionsParams(e){return es.Permissions.parseSetPermissionsParams(e)}parseAddPreloadScriptParams(e){return es.Script.parseAddPreloadScriptParams(e)}parseCallFunctionParams(e){return es.Script.parseCallFunctionParams(e)}parseDisownParams(e){return es.Script.parseDisownParams(e)}parseEvaluateParams(e){return es.Script.parseEvaluateParams(e)}parseGetRealmsParams(e){return es.Script.parseGetRealmsParams(e)}parseRemovePreloadScriptParams(e){return es.Script.parseRemovePreloadScriptParams(e)}parseSubscribeParams(e){return es.Session.parseSubscribeParams(e)}parseDeleteCookiesParams(e){return es.Storage.parseDeleteCookiesParams(e)}parseGetCookiesParams(e){return es.Storage.parseGetCookiesParams(e)}parseSetCookieParams(e){return es.Storage.parseSetCookieParams(e)}};var ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.log=ts.generatePage=void 0;const as=l;function rs(e){const t=e.split(":")[0],a=`${t}_log`,r=document.getElementById(a);if(r)return r;const n=document.getElementById("details"),s=document.createElement("div");s.className="divider",n.appendChild(s);const o=document.createElement("div");return o.className="item",o.innerHTML=`<h3>${t}</h3><div id="${a}" class="log"></div>`,n.appendChild(o),document.getElementById(a)}function ns(e){return"object"==typeof e?JSON.stringify(e,null,2):e}ts.generatePage=function(){globalThis.document.documentElement&&(globalThis.document.documentElement.innerHTML='<!DOCTYPE html><title>BiDi-CDP Mapper</title><style>body{font-family: Roboto, serif; font-size: 13px; color: #202124;}.log{padding: 12px; font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; font-size: 11px; line-height: 180%; background: #f1f3f4; border-radius: 4px;}.pre{overflow-wrap: break-word; padding: 10px;}.card{margin: 60px auto; padding: 2px 0; max-width: 900px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), 0 1px 6px rgba(0, 0, 0, 0.2); border-radius: 8px;}.divider{height: 1px; background: #f0f0f0;}.item{padding: 16px 20px;}</style><div class="card"><div class="item"><h1>BiDi-CDP Mapper is controlling this tab</h1><p>Closing or reloading it will stop the BiDi process. <a target="_blank" title="BiDi-CDP Mapper GitHub Repository" href="https://github.com/GoogleChromeLabs/chromium-bidi">Details.</a></p></div><div class="divider"></div><details id="details"><summary class="item">Debug information</summary></details></div>',rs(as.LogType.debugInfo),rs(as.LogType.bidi),rs(as.LogType.cdp))},ts.log=function(t,...a){if(!globalThis.document.documentElement)return;t.startsWith(as.LogType.bidi)||e.window?.sendDebugMessage?.(JSON.stringify({logType:t,messages:a}));const r=rs(t),n=document.createElement("div");n.className="pre",n.textContent=[t,...a].map(ns).join(" "),r.appendChild(n),r.childNodes.length>200&&r.removeChild(r.childNodes[0])};var ss={};Object.defineProperty(ss,"__esModule",{value:!0}),ss.WindowCdpTransport=ss.WindowBidiTransport=void 0;const os=l,is=ts;class cs{static LOGGER_PREFIX_RECV=`${os.LogType.bidi}:RECV \u25c2`;static LOGGER_PREFIX_SEND=`${os.LogType.bidi}:SEND \u25b8`;#hr=null;constructor(){window.onBidiMessage=e=>{(0,is.log)(cs.LOGGER_PREFIX_RECV,e);try{const t=cs.#mr(e);this.#hr?.call(null,t)}catch(t){const a=t instanceof Error?t:new Error(t);this.#fr(e,"invalid argument",a,null)}}}setOnMessage(e){this.#hr=e}sendMessage(e){(0,is.log)(cs.LOGGER_PREFIX_SEND,e);const t=JSON.stringify(e);window.sendBidiResponse(t)}close(){this.#hr=null,window.onBidiMessage=null}#fr(e,t,a,r){const n=cs.#gr(e,t,a);r?this.sendMessage({...n,channel:r}):this.sendMessage(n)}static#yr(e){return null===e?"null":Array.isArray(e)?"array":typeof e}static#gr(e,t,a){let r;try{const t=JSON.parse(e);"object"===cs.#yr(t)&&"id"in t&&(r=t.id)}catch{}return{type:"error",id:r,error:t,message:a.message}}static#mr(e){let t;try{t=JSON.parse(e)}catch{throw new Error("Cannot parse data as JSON")}const a=cs.#yr(t);if("object"!==a)throw new Error(`Expected JSON object but got ${a}`);const{id:r,method:n,params:s}=t,o=cs.#yr(r);if("number"!==o||!Number.isInteger(r)||r<0)throw new Error(`Expected unsigned integer but got ${o}`);const i=cs.#yr(n);if("string"!==i)throw new Error(`Expected string method but got ${i}`);const c=cs.#yr(s);if("object"!==c)throw new Error(`Expected object params but got ${c}`);let d=t.channel;if(void 0!==d){const e=cs.#yr(d);if("string"!==e)throw new Error(`Expected string channel but got ${e}`);""===d&&(d=void 0)}return{id:r,method:n,params:s,channel:d}}}ss.WindowBidiTransport=cs;ss.WindowCdpTransport=class{#hr=null;constructor(){window.cdp.onmessage=e=>{this.#hr?.call(null,e)}}setOnMessage(e){this.#hr=e}sendMessage(e){window.cdp.send(e)}close(){this.#hr=null,window.cdp.onmessage=null}},
/**
	 * Copyright 2021 Google LLC.
	 * Copyright (c) Microsoft Corporation.
	 *
	 * Licensed under the Apache License, Version 2.0 (the "License");
	 * you may not use this file except in compliance with the License.
	 * You may obtain a copy of the License at
	 *
	 *     http://www.apache.org/licenses/LICENSE-2.0
	 *
	 * Unless required by applicable law or agreed to in writing, software
	 * distributed under the License is distributed on an "AS IS" BASIS,
	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 * See the License for the specific language governing permissions and
	 * limitations under the License.
	 *
	 * @license
	 */
Object.defineProperty(a,"__esModule",{value:!0});const ds=r,us=tn,ls=l,hs=un,ps=ts,ms=ss;(0,ps.generatePage)();const fs=new ms.WindowBidiTransport,gs=new ms.WindowCdpTransport,ys=new us.MapperCdpConnection(gs,ps.log);return window.runMapperInstance=async(e,t)=>{await async function(e,t){console.log("Launching Mapper instance with selfTargetId:",e);const a=await ds.BidiServer.createAndStart(fs,ys,await ys.createBrowserSession(),e,t,new hs.BidiParser,ps.log);return(0,ps.log)(ls.LogType.debugInfo,"Mapper instance has been launched"),a}(e,t)},a}();
//# sourceMappingURL=mapperTab.js.map

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0179 ]--