@coalescesoftware/coa 7.30.7 → 7.30.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/coa.js
CHANGED
|
@@ -1947,7 +1947,7 @@ Calls to async() callback can have unexpected results.`),d=!0,function(g,b){g?c(
|
|
|
1947
1947
|
[cause]: `+(this.cause instanceof Error?this.cause.stack:this.cause?.toString())),this.toFormattedStringWithCode()+`
|
|
1948
1948
|
`+this.stack+n}handleExpressResponse(n){n.status(this.statusCode()).json(this.toTRunError())}};function y1(r){return typeof r=="object"&&r instanceof et}function $8t(r){return typeof r=="object"&&r instanceof Error&&typeof r.code=="string"}var Pee=class extends et{},Ya=class extends et{statusCode(){return 404}},mo=class extends et{statusCode(){return 400}},m3=class extends et{statusCode(){return 403}},y3=class extends et{statusCode(){return 409}},Yp=class extends et{constructor(t="Not implemented",n,i){super(t,n,501,i)}};var rBe=class extends et{constructor(t="Unauthorized",n,i){super(t,n,401,i)}};var Aue=class extends Yp{constructor(n,i,o,s){super(`${i} was not implemented for ${n}`,o,s);this.kind=n;this.sourceName=i}},Nee=class extends Pee{diagnostics;constructor(t,n){super("Unable to determine Deploy Service URL. In CLI contexts, SCHEDULER_ADDRESS must be set. In backend service contexts, use GetDeployServiceURLOnBackend instead.",n),this.diagnostics=t}};function gm(r,t,n,...i){if(!r){let o=`ASSERTION FAILED: ${t}`,s=new et(o);throw n.emerg(o,{stack:s.stack,args:i}),s}}var _Pa,qLi=r=>{_Pa=r},Tc=()=>_Pa;var rqd=M.object({NODE_ENV:M.string().default("development"),LOG_LEVEL:M.string().default("info").optional(),CONSOLE_JSON_LOGS:M.string().default("true").optional(),REACT_APP_COALESCE_VERSION:M.string().default("").optional(),REACT_APP_COALESCE_GIT_HASH:M.string().default("").optional(),HOSTNAME:M.string().default("").optional(),RUNTIME_ENVIRONMENT:M.string().default("").optional()});var pu=function(r){return r.info="info",r.warn="warn",r.error="error",r.debug="debug",r.trace="trace",r.fatal="fatal",r}({}),sSe={[pu.trace]:10,[pu.debug]:20,[pu.info]:30,[pu.warn]:40,[pu.error]:50,[pu.fatal]:60},uhy={10:pu.trace,20:pu.debug,30:pu.info,40:pu.warn,50:pu.error,60:pu.fatal};var TP=function(r){return r.onBeforeDataOut="onBeforeDataOut",r.shouldSendToLogger="shouldSendToLogger",r.onMetadataCalled="onMetadataCalled",r.onBeforeMessageOut="onBeforeMessageOut",r.onContextCalled="onContextCalled",r}({});var vPa=class TPa{context={};hasContext=!1;setContext(t){if(!t){this.context={},this.hasContext=!1;return}this.context=t,this.hasContext=!0}appendContext(t){this.context={...this.context,...t},this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}onChildLoggerCreated({parentContextManager:t,childContextManager:n}){if(t.hasContextData()){let i=t.getContext();n.setContext({...i})}}clone(){let t=new TPa;return t.setContext({...this.context}),t.hasContext=this.hasContext,t}};var X8t=class{id;enabled;level;consoleDebug;constructor(r){this.id=Date.now().toString()+Math.random().toString(),this.enabled=r.enabled??!0,this.consoleDebug=r.consoleDebug??!1,this.level=r.level??"trace"}_sendToLogger(r){if(!this.enabled||sSe[r.logLevel]<sSe[this.level])return;let t=this.shipToLogger(r);if(this.consoleDebug)switch(r.logLevel){case pu.info:console.info(...t);break;case pu.warn:console.warn(...t);break;case pu.error:console.error(...t);break;case pu.trace:console.debug(...t);break;case pu.debug:console.debug(...t);break;case pu.fatal:console.debug(...t);break;default:console.log(...t)}}getLoggerInstance(){throw new Error("This transport does not have a logger instance")}};var IPa=class{err;metadata;structuredLogger;hasMetadata;pluginManager;constructor(r){this.err=null,this.metadata={},this.structuredLogger=r,this.hasMetadata=!1,this.pluginManager=r.pluginManager}withMetadata(r){let{pluginManager:t,structuredLogger:{_config:{consoleDebug:n}}}=this;if(!r)return n&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let i=r;return t.hasPlugins(TP.onMetadataCalled)&&(i=t.runOnMetadataCalled(r,this.structuredLogger),!i)?(n&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata={...this.metadata,...i},this.hasMetadata=!0,this)}withError(r){return this.err=r,this}info(...r){this.structuredLogger.isLevelEnabled(pu.info)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.info,r))}warn(...r){this.structuredLogger.isLevelEnabled(pu.warn)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.warn,r))}error(...r){this.structuredLogger.isLevelEnabled(pu.error)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.error,r))}debug(...r){this.structuredLogger.isLevelEnabled(pu.debug)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.debug,r))}trace(...r){this.structuredLogger.isLevelEnabled(pu.trace)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.trace,r))}fatal(...r){this.structuredLogger.isLevelEnabled(pu.fatal)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.fatal,r))}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(r,t){let{muteMetadata:n}=this.structuredLogger._config,i=n?!1:this.hasMetadata;this.structuredLogger._formatLog({logLevel:r,params:t,metadata:i?this.metadata:null,err:this.err})}},nqd=[TP.onBeforeDataOut,TP.onMetadataCalled,TP.shouldSendToLogger,TP.onBeforeMessageOut,TP.onContextCalled],OPa=class{idToPlugin;onBeforeDataOut=[];shouldSendToLogger=[];onMetadataCalled=[];onBeforeMessageOut=[];onContextCalled=[];constructor(r){this.idToPlugin={},this.mapPlugins(r),this.indexPlugins()}mapPlugins(r){for(let t of r){if(t.id||(t.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[t.id])throw new Error(`[LogLayer] Plugin with id ${t.id} already exists.`);t.registeredAt=Date.now(),this.idToPlugin[t.id]=t}}indexPlugins(){this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];let r=Object.values(this.idToPlugin).sort((t,n)=>t.registeredAt-n.registeredAt);for(let t of r){if(t.disabled)return;for(let n of nqd)t[n]&&t.id&&this[n].push(t.id)}}hasPlugins(r){return this[r].length>0}countPlugins(r){return r?this[r].length:Object.keys(this.idToPlugin).length}addPlugins(r){this.mapPlugins(r),this.indexPlugins()}enablePlugin(r){let t=this.idToPlugin[r];t&&(t.disabled=!1),this.indexPlugins()}disablePlugin(r){let t=this.idToPlugin[r];t&&(t.disabled=!0),this.indexPlugins()}removePlugin(r){delete this.idToPlugin[r],this.indexPlugins()}runOnBeforeDataOut(r,t){let n={...r};for(let i of this.onBeforeDataOut){let o=this.idToPlugin[i];if(o.onBeforeDataOut){let s=o.onBeforeDataOut({data:n.data,logLevel:n.logLevel,error:n.error,metadata:n.metadata,context:n.context},t);s&&(n.data||(n.data={}),Object.assign(n.data,s))}}return n.data}runShouldSendToLogger(r,t){return!this.shouldSendToLogger.some(n=>!this.idToPlugin[n].shouldSendToLogger?.(r,t))}runOnMetadataCalled(r,t){let n={...r};for(let i of this.onMetadataCalled){let o=this.idToPlugin[i].onMetadataCalled?.(n,t);if(o)n=o;else return null}return n}runOnBeforeMessageOut(r,t){let n=[...r.messages];for(let i of this.onBeforeMessageOut){let o=this.idToPlugin[i].onBeforeMessageOut?.({messages:n,logLevel:r.logLevel},t);o&&(n=o)}return n}runOnContextCalled(r,t){let n={...r};for(let i of this.onContextCalled){let o=this.idToPlugin[i].onContextCalled?.(n,t);if(o)n=o;else return null}return n}},Z8t=class RPa{pluginManager;idToTransport;hasMultipleTransports;singleTransport;contextManager;logLevelEnabledStatus={info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0};_config;constructor(t){this._config={...t,enabled:t.enabled??!0},this._config.enabled||this.disableLogging(),this.contextManager=new vPa,this.pluginManager=new OPa(t.plugins||[]),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport)}withContextManager(t){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=t,this}getContextManager(){return this.contextManager}_initializeTransports(t){if(this.idToTransport)for(let n in this.idToTransport)this.idToTransport[n]&&typeof this.idToTransport[n][Symbol.dispose]=="function"&&this.idToTransport[n][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(t)&&t.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(t)?t[0]:t,Array.isArray(t)?this.idToTransport=t.reduce((n,i)=>(n[i.id]=i,n),{}):this.idToTransport={[t.id]:t}}withPrefix(t){let n=this.child();return n._config.prefix=t,n}withContext(t){let n=t;return t?this.pluginManager.hasPlugins(TP.onContextCalled)&&(n=this.pluginManager.runOnContextCalled(t,this),!n)?(this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this):(this.contextManager.appendContext(n),this):(this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this)}clearContext(){return this.contextManager.setContext(void 0),this}getContext(){return this.contextManager.getContext()}addPlugins(t){this.pluginManager.addPlugins(t)}enablePlugin(t){this.pluginManager.enablePlugin(t)}disablePlugin(t){this.pluginManager.disablePlugin(t)}removePlugin(t){this.pluginManager.removePlugin(t)}withMetadata(t){return new IPa(this).withMetadata(t)}withError(t){return new IPa(this).withError(t)}child(){let t=new RPa({...this._config,transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport}).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:t.contextManager,parentLogger:this,childLogger:t}),t}withFreshTransports(t){return this._config.transport=t,this._initializeTransports(t),this}withFreshPlugins(t){return this._config.plugins=t,this.pluginManager=new OPa(t),this}withPluginManager(t){return this.pluginManager=t,this}errorOnly(t,n){let i=n?.logLevel||pu.error;if(!this.isLevelEnabled(i))return;let{copyMsgOnOnlyError:o}=this._config,s={logLevel:i,err:t};(o&&n?.copyMsg!==!1||n?.copyMsg===!0)&&t?.message&&(s.params=[t.message]),this._formatLog(s)}metadataOnly(t,n=pu.info){if(!this.isLevelEnabled(n))return;let{muteMetadata:i,consoleDebug:o}=this._config;if(i)return;if(!t){o&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let s=t;if(this.pluginManager.hasPlugins(TP.onMetadataCalled)&&(s=this.pluginManager.runOnMetadataCalled(t,this),!s)){o&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}let a={logLevel:n,metadata:s};this._formatLog(a)}info(...t){this.isLevelEnabled(pu.info)&&(this._formatMessage(t),this._formatLog({logLevel:pu.info,params:t}))}warn(...t){this.isLevelEnabled(pu.warn)&&(this._formatMessage(t),this._formatLog({logLevel:pu.warn,params:t}))}error(...t){this.isLevelEnabled(pu.error)&&(this._formatMessage(t),this._formatLog({logLevel:pu.error,params:t}))}debug(...t){this.isLevelEnabled(pu.debug)&&(this._formatMessage(t),this._formatLog({logLevel:pu.debug,params:t}))}trace(...t){this.isLevelEnabled(pu.trace)&&(this._formatMessage(t),this._formatLog({logLevel:pu.trace,params:t}))}fatal(...t){this.isLevelEnabled(pu.fatal)&&(this._formatMessage(t),this._formatLog({logLevel:pu.fatal,params:t}))}raw(t){if(!this.isLevelEnabled(t.logLevel))return;let n={logLevel:t.logLevel,params:t.messages,metadata:t.metadata,err:t.error,context:t.context};this._formatMessage(t.messages),this._formatLog(n)}disableLogging(){for(let t of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[t]=!1;return this}enableLogging(){for(let t of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[t]=!0;return this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(t){let n=t;return n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!0),this}disableIndividualLevel(t){let n=t;return n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!1),this}setLevel(t){let n=sSe[t];for(let i of Object.values(pu)){let o=i,s=sSe[i];this.logLevelEnabledStatus[o]=s>=n}return this}isLevelEnabled(t){let n=t;return this.logLevelEnabledStatus[n]}formatContext(t){let{contextFieldName:n,muteContext:i}=this._config;return t&&Object.keys(t).length>0&&!i?n?{[n]:{...t}}:{...t}:{}}formatMetadata(t=null){let{metadataFieldName:n,muteMetadata:i}=this._config;return t&&!i?n?{[n]:{...t}}:{...t}:{}}getLoggerInstance(t){let n=this.idToTransport[t];if(n)return n.getLoggerInstance()}_formatMessage(t=[]){let{prefix:n}=this._config;n&&typeof t[0]=="string"&&(t[0]=`${n} ${t[0]}`)}_formatLog({logLevel:t,params:n=[],metadata:i=null,err:o,context:s=null}){let{errorSerializer:a,errorFieldInMetadata:u,muteContext:l,contextFieldName:c,metadataFieldName:d,errorFieldName:p}=this._config,f=s!==null?s:this.contextManager.getContext(),A=!!i||(l?!1:s!==null?Object.keys(s).length>0:this.contextManager.hasContextData()),g={};if(A)if(c&&c===d){let b=this.formatContext(f)[c],_=this.formatMetadata(i)[d];g={[c]:{...b,..._}}}else g={...this.formatContext(f),...this.formatMetadata(i)};if(o){let b=a?a(o):o;u&&i&&d?g?.[d]?g[d][p]=b:g={...g,[d]:{[p]:b}}:u&&!i&&d?g={...g,[d]:{[p]:b}}:g={...g,[p]:b},A=!0}if(this.pluginManager.hasPlugins(TP.onBeforeDataOut)&&(g=this.pluginManager.runOnBeforeDataOut({data:A?g:void 0,logLevel:t,error:o,metadata:i,context:f},this),g&&!A&&(A=!0)),this.pluginManager.hasPlugins(TP.onBeforeMessageOut)&&(n=this.pluginManager.runOnBeforeMessageOut({messages:[...n],logLevel:t},this)),this.hasMultipleTransports){let b=this._config.transport.filter(_=>_.enabled).map(async _=>{if(!(this.pluginManager.hasPlugins(TP.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],data:A?g:void 0,logLevel:t,transportId:_.id,error:o,metadata:i,context:f},this)))return _._sendToLogger({logLevel:t,messages:[...n],data:A?g:void 0,hasData:A,error:o,metadata:i,context:f})});Promise.all(b).catch(_=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",_)})}else{if(!this.singleTransport?.enabled||this.pluginManager.hasPlugins(TP.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],data:A?g:void 0,logLevel:t,transportId:this.singleTransport.id,error:o,metadata:i,context:f},this))return;this.singleTransport._sendToLogger({logLevel:t,messages:[...n],data:A?g:void 0,hasData:A,error:o,metadata:i,context:f})}}};var MPa=class extends X8t{shipToLoggerFn;constructor(r){super(r),this.shipToLoggerFn=r.shipToLogger}shipToLogger(r){return this.shipToLoggerFn(r)}};var aSe=class extends MPa{};var zut=class r{constructor(t,n,i=void 0){this.defaultMetadata=t;this.transports=n;this._logger=i}get logger(){return this._logger||(this._logger=new Z8t({transport:this.transports}).withContext(this.defaultMetadata)),this._logger}getContext(t){return{...this.defaultMetadata,...t,...vu().logContext}}logDirect(t,n,i){let o=this.getContext(i),s;t==="warning"||t==="alert"?s="warn":t==="emerg"?s="fatal":s=t;for(let a of this.transports)a instanceof aSe&&!a.enabled||a.shipToLogger&&a.shipToLogger({logLevel:s,messages:[n],data:o,hasData:Object.keys(o).length>0})}debug(t,n){this.logDirect("debug",t,n)}info(t,n){this.logDirect("info",t,n)}warning(t,n){this.logDirect("warning",t,n)}error(t,n){this.logDirect("error",t,n)}emerg(t,n){this.logDirect("emerg",t,n)}alert(t,n){this.logDirect("alert",t,n)}log(t,n,i){this.logDirect(t,n,i)}child(t){return new r({...this.defaultMetadata,...t},this.transports,void 0)}silenceConsole(t){for(let n of this.transports)n instanceof aSe&&(n.enabled=!t)}};var iqd=typeof global=="object"&&global&&global.Object===Object&&global,ekt=iqd;var oqd=typeof self=="object"&&self&&self.Object===Object&&self,sqd=ekt||oqd||Function("return this")(),hE=sqd;var aqd=hE.Symbol,jS=aqd;var wPa=Object.prototype,uqd=wPa.hasOwnProperty,cqd=wPa.toString,Fut=jS?jS.toStringTag:void 0;function lqd(r){var t=uqd.call(r,Fut),n=r[Fut];try{r[Fut]=void 0;var i=!0}catch{}var o=cqd.call(r);return i&&(t?r[Fut]=n:delete r[Fut]),o}var PPa=lqd;var dqd=Object.prototype,pqd=dqd.toString;function fqd(r){return pqd.call(r)}var NPa=fqd;var Aqd="[object Null]",hqd="[object Undefined]",DPa=jS?jS.toStringTag:void 0;function gqd(r){return r==null?r===void 0?hqd:Aqd:DPa&&DPa in Object(r)?PPa(r):NPa(r)}var sT=gqd;function mqd(r){return r!=null&&typeof r=="object"}var Ay=mqd;var yqd="[object Symbol]";function bqd(r){return typeof r=="symbol"||Ay(r)&&sT(r)==yqd}var Cj=bqd;function Eqd(r,t){for(var n=-1,i=r==null?0:r.length,o=Array(i);++n<i;)o[n]=t(r[n],n,r);return o}var IP=Eqd;var Cqd=Array.isArray,v0=Cqd;var Sqd=1/0,xPa=jS?jS.prototype:void 0,BPa=xPa?xPa.toString:void 0;function kPa(r){if(typeof r=="string")return r;if(v0(r))return IP(r,kPa)+"";if(Cj(r))return BPa?BPa.call(r):"";var t=r+"";return t=="0"&&1/r==-Sqd?"-0":t}var LPa=kPa;var _qd=/\s/;function vqd(r){for(var t=r.length;t--&&_qd.test(r.charAt(t)););return t}var qPa=vqd;var Tqd=/^\s+/;function Iqd(r){return r&&r.slice(0,qPa(r)+1).replace(Tqd,"")}var zPa=Iqd;function Oqd(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var Th=Oqd;var FPa=NaN,Rqd=/^[-+]0x[0-9a-f]+$/i,Mqd=/^0b[01]+$/i,wqd=/^0o[0-7]+$/i,Pqd=parseInt;function Nqd(r){if(typeof r=="number")return r;if(Cj(r))return FPa;if(Th(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Th(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=zPa(r);var n=Mqd.test(r);return n||wqd.test(r)?Pqd(r.slice(2),n?2:8):Rqd.test(r)?FPa:+r}var QPa=Nqd;var UPa=1/0,Dqd=17976931348623157e292;function xqd(r){if(!r)return r===0?r:0;if(r=QPa(r),r===UPa||r===-UPa){var t=r<0?-1:1;return t*Dqd}return r===r?r:0}var jPa=xqd;function Bqd(r){var t=jPa(r),n=t%1;return t===t?n?t-n:t:0}var GPa=Bqd;function kqd(r){return r}var Sj=kqd;var Lqd="[object AsyncFunction]",qqd="[object Function]",zqd="[object GeneratorFunction]",Fqd="[object Proxy]";function Qqd(r){if(!Th(r))return!1;var t=sT(r);return t==qqd||t==zqd||t==Lqd||t==Fqd}var nBe=Qqd;var Uqd=hE["__core-js_shared__"],tkt=Uqd;var HPa=function(){var r=/[^.]+$/.exec(tkt&&tkt.keys&&tkt.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function jqd(r){return!!HPa&&HPa in r}var WPa=jqd;var Gqd=Function.prototype,Hqd=Gqd.toString;function Wqd(r){if(r!=null){try{return Hqd.call(r)}catch{}try{return r+""}catch{}}return""}var Dee=Wqd;var Vqd=/[\\^$.*+?()[\]{}|]/g,Kqd=/^\[object .+?Constructor\]$/,Yqd=Function.prototype,Jqd=Object.prototype,$qd=Yqd.toString,Xqd=Jqd.hasOwnProperty,Zqd=RegExp("^"+$qd.call(Xqd).replace(Vqd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function e7d(r){if(!Th(r)||WPa(r))return!1;var t=nBe(r)?Zqd:Kqd;return t.test(Dee(r))}var VPa=e7d;function t7d(r,t){return r?.[t]}var KPa=t7d;function r7d(r,t){var n=KPa(r,t);return VPa(n)?n:void 0}var OP=r7d;var n7d=OP(hE,"WeakMap"),rkt=n7d;var YPa=Object.create,i7d=function(){function r(){}return function(t){if(!Th(t))return{};if(YPa)return YPa(t);r.prototype=t;var n=new r;return r.prototype=void 0,n}}(),JPa=i7d;function o7d(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}var $Pa=o7d;function s7d(r,t){var n=-1,i=r.length;for(t||(t=Array(i));++n<i;)t[n]=r[n];return t}var nkt=s7d;var a7d=800,u7d=16,c7d=Date.now;function l7d(r){var t=0,n=0;return function(){var i=c7d(),o=u7d-(i-n);if(n=i,o>0){if(++t>=a7d)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}var XPa=l7d;function d7d(r){return function(){return r}}var ZPa=d7d;var p7d=function(){try{var r=OP(Object,"defineProperty");return r({},"",{}),r}catch{}}(),iBe=p7d;var f7d=iBe?function(r,t){return iBe(r,"toString",{configurable:!0,enumerable:!1,value:ZPa(t),writable:!0})}:Sj,e4a=f7d;var A7d=XPa(e4a),ikt=A7d;function h7d(r,t){for(var n=-1,i=r==null?0:r.length;++n<i&&t(r[n],n,r)!==!1;);return r}var t4a=h7d;function g7d(r,t,n,i){for(var o=r.length,s=n+(i?1:-1);i?s--:++s<o;)if(t(r[s],s,r))return s;return-1}var r4a=g7d;function m7d(r){return r!==r}var n4a=m7d;function y7d(r,t,n){for(var i=n-1,o=r.length;++i<o;)if(r[i]===t)return i;return-1}var i4a=y7d;function b7d(r,t,n){return t===t?i4a(r,t,n):r4a(r,n4a,n)}var o4a=b7d;function E7d(r,t){var n=r==null?0:r.length;return!!n&&o4a(r,t,0)>-1}var s4a=E7d;var C7d=9007199254740991,S7d=/^(?:0|[1-9]\d*)$/;function _7d(r,t){var n=typeof r;return t=t??C7d,!!t&&(n=="number"||n!="symbol"&&S7d.test(r))&&r>-1&&r%1==0&&r<t}var hue=_7d;function v7d(r,t,n){t=="__proto__"&&iBe?iBe(r,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[t]=n}var _j=v7d;function T7d(r,t){return r===t||r!==r&&t!==t}var vj=T7d;var I7d=Object.prototype,O7d=I7d.hasOwnProperty;function R7d(r,t,n){var i=r[t];(!(O7d.call(r,t)&&vj(i,n))||n===void 0&&!(t in r))&&_j(r,t,n)}var oBe=R7d;function M7d(r,t,n,i){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var u=t[s],l=i?i(n[u],r[u],u,n,r):void 0;l===void 0&&(l=r[u]),o?_j(n,u,l):oBe(n,u,l)}return n}var G6=M7d;var a4a=Math.max;function w7d(r,t,n){return t=a4a(t===void 0?r.length-1:t,0),function(){for(var i=arguments,o=-1,s=a4a(i.length-t,0),a=Array(s);++o<s;)a[o]=i[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=i[o];return u[t]=n(a),$Pa(r,this,u)}}var okt=w7d;function P7d(r,t){return ikt(okt(r,t,Sj),r+"")}var skt=P7d;var N7d=9007199254740991;function D7d(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=N7d}var sBe=D7d;function x7d(r){return r!=null&&sBe(r.length)&&!nBe(r)}var H6=x7d;function B7d(r,t,n){if(!Th(n))return!1;var i=typeof t;return(i=="number"?H6(n)&&hue(t,n.length):i=="string"&&t in n)?vj(n[t],r):!1}var akt=B7d;function k7d(r){return skt(function(t,n){var i=-1,o=n.length,s=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=r.length>3&&typeof s=="function"?(o--,s):void 0,a&&akt(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++i<o;){var u=n[i];u&&r(t,u,i,s)}return t})}var u4a=k7d;var L7d=Object.prototype;function q7d(r){var t=r&&r.constructor,n=typeof t=="function"&&t.prototype||L7d;return r===n}var aBe=q7d;function z7d(r,t){for(var n=-1,i=Array(r);++n<r;)i[n]=t(n);return i}var c4a=z7d;var F7d="[object Arguments]";function Q7d(r){return Ay(r)&&sT(r)==F7d}var zLi=Q7d;var l4a=Object.prototype,U7d=l4a.hasOwnProperty,j7d=l4a.propertyIsEnumerable,G7d=zLi(function(){return arguments}())?zLi:function(r){return Ay(r)&&U7d.call(r,"callee")&&!j7d.call(r,"callee")},xee=G7d;function H7d(){return!1}var d4a=H7d;var A4a=typeof exports=="object"&&exports&&!exports.nodeType&&exports,p4a=A4a&&typeof module=="object"&&module&&!module.nodeType&&module,W7d=p4a&&p4a.exports===A4a,f4a=W7d?hE.Buffer:void 0,V7d=f4a?f4a.isBuffer:void 0,K7d=V7d||d4a,Bee=K7d;var Y7d="[object Arguments]",J7d="[object Array]",$7d="[object Boolean]",X7d="[object Date]",Z7d="[object Error]",ezd="[object Function]",tzd="[object Map]",rzd="[object Number]",nzd="[object Object]",izd="[object RegExp]",ozd="[object Set]",szd="[object String]",azd="[object WeakMap]",uzd="[object ArrayBuffer]",czd="[object DataView]",lzd="[object Float32Array]",dzd="[object Float64Array]",pzd="[object Int8Array]",fzd="[object Int16Array]",Azd="[object Int32Array]",hzd="[object Uint8Array]",gzd="[object Uint8ClampedArray]",mzd="[object Uint16Array]",yzd="[object Uint32Array]",b1={};b1[lzd]=b1[dzd]=b1[pzd]=b1[fzd]=b1[Azd]=b1[hzd]=b1[gzd]=b1[mzd]=b1[yzd]=!0;b1[Y7d]=b1[J7d]=b1[uzd]=b1[$7d]=b1[czd]=b1[X7d]=b1[Z7d]=b1[ezd]=b1[tzd]=b1[rzd]=b1[nzd]=b1[izd]=b1[ozd]=b1[szd]=b1[azd]=!1;function bzd(r){return Ay(r)&&sBe(r.length)&&!!b1[sT(r)]}var h4a=bzd;function Ezd(r){return function(t){return r(t)}}var Tj=Ezd;var g4a=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qut=g4a&&typeof module=="object"&&module&&!module.nodeType&&module,Czd=Qut&&Qut.exports===g4a,FLi=Czd&&ekt.process,Szd=function(){try{var r=Qut&&Qut.require&&Qut.require("util").types;return r||FLi&&FLi.binding&&FLi.binding("util")}catch{}}(),W6=Szd;var m4a=W6&&W6.isTypedArray,_zd=m4a?Tj(m4a):h4a,uBe=_zd;var vzd=Object.prototype,Tzd=vzd.hasOwnProperty;function Izd(r,t){var n=v0(r),i=!n&&xee(r),o=!n&&!i&&Bee(r),s=!n&&!i&&!o&&uBe(r),a=n||i||o||s,u=a?c4a(r.length,String):[],l=u.length;for(var c in r)(t||Tzd.call(r,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hue(c,l)))&&u.push(c);return u}var ukt=Izd;function Ozd(r,t){return function(n){return r(t(n))}}var ckt=Ozd;var Rzd=ckt(Object.keys,Object),y4a=Rzd;var Mzd=Object.prototype,wzd=Mzd.hasOwnProperty;function Pzd(r){if(!aBe(r))return y4a(r);var t=[];for(var n in Object(r))wzd.call(r,n)&&n!="constructor"&&t.push(n);return t}var lkt=Pzd;function Nzd(r){return H6(r)?ukt(r):lkt(r)}var LR=Nzd;function Dzd(r){var t=[];if(r!=null)for(var n in Object(r))t.push(n);return t}var b4a=Dzd;var xzd=Object.prototype,Bzd=xzd.hasOwnProperty;function kzd(r){if(!Th(r))return b4a(r);var t=aBe(r),n=[];for(var i in r)i=="constructor"&&(t||!Bzd.call(r,i))||n.push(i);return n}var E4a=kzd;function Lzd(r){return H6(r)?ukt(r,!0):E4a(r)}var Ij=Lzd;var qzd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zzd=/^\w*$/;function Fzd(r,t){if(v0(r))return!1;var n=typeof r;return n=="number"||n=="symbol"||n=="boolean"||r==null||Cj(r)?!0:zzd.test(r)||!qzd.test(r)||t!=null&&r in Object(t)}var cBe=Fzd;var Qzd=OP(Object,"create"),kee=Qzd;function Uzd(){this.__data__=kee?kee(null):{},this.size=0}var C4a=Uzd;function jzd(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var S4a=jzd;var Gzd="__lodash_hash_undefined__",Hzd=Object.prototype,Wzd=Hzd.hasOwnProperty;function Vzd(r){var t=this.__data__;if(kee){var n=t[r];return n===Gzd?void 0:n}return Wzd.call(t,r)?t[r]:void 0}var _4a=Vzd;var Kzd=Object.prototype,Yzd=Kzd.hasOwnProperty;function Jzd(r){var t=this.__data__;return kee?t[r]!==void 0:Yzd.call(t,r)}var v4a=Jzd;var $zd="__lodash_hash_undefined__";function Xzd(r,t){var n=this.__data__;return this.size+=this.has(r)?0:1,n[r]=kee&&t===void 0?$zd:t,this}var T4a=Xzd;function lBe(r){var t=-1,n=r==null?0:r.length;for(this.clear();++t<n;){var i=r[t];this.set(i[0],i[1])}}lBe.prototype.clear=C4a;lBe.prototype.delete=S4a;lBe.prototype.get=_4a;lBe.prototype.has=v4a;lBe.prototype.set=T4a;var QLi=lBe;function Zzd(){this.__data__=[],this.size=0}var I4a=Zzd;function eFd(r,t){for(var n=r.length;n--;)if(vj(r[n][0],t))return n;return-1}var gue=eFd;var tFd=Array.prototype,rFd=tFd.splice;function nFd(r){var t=this.__data__,n=gue(t,r);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():rFd.call(t,n,1),--this.size,!0}var O4a=nFd;function iFd(r){var t=this.__data__,n=gue(t,r);return n<0?void 0:t[n][1]}var R4a=iFd;function oFd(r){return gue(this.__data__,r)>-1}var M4a=oFd;function sFd(r,t){var n=this.__data__,i=gue(n,r);return i<0?(++this.size,n.push([r,t])):n[i][1]=t,this}var w4a=sFd;function dBe(r){var t=-1,n=r==null?0:r.length;for(this.clear();++t<n;){var i=r[t];this.set(i[0],i[1])}}dBe.prototype.clear=I4a;dBe.prototype.delete=O4a;dBe.prototype.get=R4a;dBe.prototype.has=M4a;dBe.prototype.set=w4a;var mue=dBe;var aFd=OP(hE,"Map"),yue=aFd;function uFd(){this.size=0,this.__data__={hash:new QLi,map:new(yue||mue),string:new QLi}}var P4a=uFd;function cFd(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var N4a=cFd;function lFd(r,t){var n=r.__data__;return N4a(t)?n[typeof t=="string"?"string":"hash"]:n.map}var bue=lFd;function dFd(r){var t=bue(this,r).delete(r);return this.size-=t?1:0,t}var D4a=dFd;function pFd(r){return bue(this,r).get(r)}var x4a=pFd;function fFd(r){return bue(this,r).has(r)}var B4a=fFd;function AFd(r,t){var n=bue(this,r),i=n.size;return n.set(r,t),this.size+=n.size==i?0:1,this}var k4a=AFd;function pBe(r){var t=-1,n=r==null?0:r.length;for(this.clear();++t<n;){var i=r[t];this.set(i[0],i[1])}}pBe.prototype.clear=P4a;pBe.prototype.delete=D4a;pBe.prototype.get=x4a;pBe.prototype.has=B4a;pBe.prototype.set=k4a;var uSe=pBe;var hFd="Expected a function";function ULi(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError(hFd);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var a=r.apply(this,i);return n.cache=s.set(o,a)||s,a};return n.cache=new(ULi.Cache||uSe),n}ULi.Cache=uSe;var cSe=ULi;var gFd=500;function mFd(r){var t=cSe(r,function(i){return n.size===gFd&&n.clear(),i}),n=t.cache;return t}var L4a=mFd;var yFd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bFd=/\\(\\)?/g,EFd=L4a(function(r){var t=[];return r.charCodeAt(0)===46&&t.push(""),r.replace(yFd,function(n,i,o,s){t.push(o?s.replace(bFd,"$1"):i||n)}),t}),q4a=EFd;function CFd(r){return r==null?"":LPa(r)}var fBe=CFd;function SFd(r,t){return v0(r)?r:cBe(r,t)?[r]:q4a(fBe(r))}var V6=SFd;var _Fd=1/0;function vFd(r){if(typeof r=="string"||Cj(r))return r;var t=r+"";return t=="0"&&1/r==-_Fd?"-0":t}var K6=vFd;function TFd(r,t){t=V6(t,r);for(var n=0,i=t.length;r!=null&&n<i;)r=r[K6(t[n++])];return n&&n==i?r:void 0}var Eue=TFd;function IFd(r,t,n){var i=r==null?void 0:Eue(r,t);return i===void 0?n:i}var Uut=IFd;function OFd(r,t){for(var n=-1,i=t.length,o=r.length;++n<i;)r[o+n]=t[n];return r}var ABe=OFd;var z4a=jS?jS.isConcatSpreadable:void 0;function RFd(r){return v0(r)||xee(r)||!!(z4a&&r&&r[z4a])}var F4a=RFd;function Q4a(r,t,n,i,o){var s=-1,a=r.length;for(n||(n=F4a),o||(o=[]);++s<a;){var u=r[s];t>0&&n(u)?t>1?Q4a(u,t-1,n,i,o):ABe(o,u):i||(o[o.length]=u)}return o}var U4a=Q4a;function MFd(r){var t=r==null?0:r.length;return t?U4a(r,1):[]}var j4a=MFd;function wFd(r){return ikt(okt(r,void 0,j4a),r+"")}var dkt=wFd;var PFd=ckt(Object.getPrototypeOf,Object),hBe=PFd;var NFd="[object Object]",DFd=Function.prototype,xFd=Object.prototype,G4a=DFd.toString,BFd=xFd.hasOwnProperty,kFd=G4a.call(Object);function LFd(r){if(!Ay(r)||sT(r)!=NFd)return!1;var t=hBe(r);if(t===null)return!0;var n=BFd.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&G4a.call(n)==kFd}var pkt=LFd;function qFd(r,t,n){var i=-1,o=r.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(o);++i<o;)s[i]=r[i+t];return s}var gBe=qFd;function zFd(r,t,n){var i=r.length;return n=n===void 0?i:n,!t&&n>=i?r:gBe(r,t,n)}var H4a=zFd;var FFd="\\ud800-\\udfff",QFd="\\u0300-\\u036f",UFd="\\ufe20-\\ufe2f",jFd="\\u20d0-\\u20ff",GFd=QFd+UFd+jFd,HFd="\\ufe0e\\ufe0f",WFd="\\u200d",VFd=RegExp("["+WFd+FFd+GFd+HFd+"]");function KFd(r){return VFd.test(r)}var mBe=KFd;function YFd(r){return r.split("")}var W4a=YFd;var V4a="\\ud800-\\udfff",JFd="\\u0300-\\u036f",$Fd="\\ufe20-\\ufe2f",XFd="\\u20d0-\\u20ff",ZFd=JFd+$Fd+XFd,eQd="\\ufe0e\\ufe0f",tQd="["+V4a+"]",jLi="["+ZFd+"]",GLi="\\ud83c[\\udffb-\\udfff]",rQd="(?:"+jLi+"|"+GLi+")",K4a="[^"+V4a+"]",Y4a="(?:\\ud83c[\\udde6-\\uddff]){2}",J4a="[\\ud800-\\udbff][\\udc00-\\udfff]",nQd="\\u200d",$4a=rQd+"?",X4a="["+eQd+"]?",iQd="(?:"+nQd+"(?:"+[K4a,Y4a,J4a].join("|")+")"+X4a+$4a+")*",oQd=X4a+$4a+iQd,sQd="(?:"+[K4a+jLi+"?",jLi,Y4a,J4a,tQd].join("|")+")",aQd=RegExp(GLi+"(?="+GLi+")|"+sQd+oQd,"g");function uQd(r){return r.match(aQd)||[]}var Z4a=uQd;function cQd(r){return mBe(r)?Z4a(r):W4a(r)}var eNa=cQd;function lQd(r){return function(t){t=fBe(t);var n=mBe(t)?eNa(t):void 0,i=n?n[0]:t.charAt(0),o=n?H4a(n,1).join(""):t.slice(1);return i[r]()+o}}var tNa=lQd;var dQd=tNa("toUpperCase"),rNa=dQd;function pQd(r){return rNa(fBe(r).toLowerCase())}var _x=pQd;function fQd(r,t,n,i){var o=-1,s=r==null?0:r.length;for(i&&s&&(n=r[++o]);++o<s;)n=t(n,r[o],o,r);return n}var nNa=fQd;var AQd=Math.ceil,hQd=Math.max;function gQd(r,t,n){(n?akt(r,t,n):t===void 0)?t=1:t=hQd(GPa(t),0);var i=r==null?0:r.length;if(!i||t<1)return[];for(var o=0,s=0,a=Array(AQd(i/t));o<i;)a[s++]=gBe(r,o,o+=t);return a}var T7=gQd;function mQd(){this.__data__=new mue,this.size=0}var iNa=mQd;function yQd(r){var t=this.__data__,n=t.delete(r);return this.size=t.size,n}var oNa=yQd;function bQd(r){return this.__data__.get(r)}var sNa=bQd;function EQd(r){return this.__data__.has(r)}var aNa=EQd;var CQd=200;function SQd(r,t){var n=this.__data__;if(n instanceof mue){var i=n.__data__;if(!yue||i.length<CQd-1)return i.push([r,t]),this.size=++n.size,this;n=this.__data__=new uSe(i)}return n.set(r,t),this.size=n.size,this}var uNa=SQd;function yBe(r){var t=this.__data__=new mue(r);this.size=t.size}yBe.prototype.clear=iNa;yBe.prototype.delete=oNa;yBe.prototype.get=sNa;yBe.prototype.has=aNa;yBe.prototype.set=uNa;var Oj=yBe;function _Qd(r,t){return r&&G6(t,LR(t),r)}var cNa=_Qd;function vQd(r,t){return r&&G6(t,Ij(t),r)}var lNa=vQd;var ANa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dNa=ANa&&typeof module=="object"&&module&&!module.nodeType&&module,TQd=dNa&&dNa.exports===ANa,pNa=TQd?hE.Buffer:void 0,fNa=pNa?pNa.allocUnsafe:void 0;function IQd(r,t){if(t)return r.slice();var n=r.length,i=fNa?fNa(n):new r.constructor(n);return r.copy(i),i}var fkt=IQd;function OQd(r,t){for(var n=-1,i=r==null?0:r.length,o=0,s=[];++n<i;){var a=r[n];t(a,n,r)&&(s[o++]=a)}return s}var hNa=OQd;function RQd(){return[]}var Akt=RQd;var MQd=Object.prototype,wQd=MQd.propertyIsEnumerable,gNa=Object.getOwnPropertySymbols,PQd=gNa?function(r){return r==null?[]:(r=Object(r),hNa(gNa(r),function(t){return wQd.call(r,t)}))}:Akt,bBe=PQd;function NQd(r,t){return G6(r,bBe(r),t)}var mNa=NQd;var DQd=Object.getOwnPropertySymbols,xQd=DQd?function(r){for(var t=[];r;)ABe(t,bBe(r)),r=hBe(r);return t}:Akt,hkt=xQd;function BQd(r,t){return G6(r,hkt(r),t)}var yNa=BQd;function kQd(r,t,n){var i=t(r);return v0(r)?i:ABe(i,n(r))}var gkt=kQd;function LQd(r){return gkt(r,LR,bBe)}var jut=LQd;function qQd(r){return gkt(r,Ij,hkt)}var EBe=qQd;var zQd=OP(hE,"DataView"),mkt=zQd;var FQd=OP(hE,"Promise"),ykt=FQd;var QQd=OP(hE,"Set"),bkt=QQd;var bNa="[object Map]",UQd="[object Object]",ENa="[object Promise]",CNa="[object Set]",SNa="[object WeakMap]",_Na="[object DataView]",jQd=Dee(mkt),GQd=Dee(yue),HQd=Dee(ykt),WQd=Dee(bkt),VQd=Dee(rkt),lSe=sT;(mkt&&lSe(new mkt(new ArrayBuffer(1)))!=_Na||yue&&lSe(new yue)!=bNa||ykt&&lSe(ykt.resolve())!=ENa||bkt&&lSe(new bkt)!=CNa||rkt&&lSe(new rkt)!=SNa)&&(lSe=function(r){var t=sT(r),n=t==UQd?r.constructor:void 0,i=n?Dee(n):"";if(i)switch(i){case jQd:return _Na;case GQd:return bNa;case HQd:return ENa;case WQd:return CNa;case VQd:return SNa}return t});var vx=lSe;var KQd=Object.prototype,YQd=KQd.hasOwnProperty;function JQd(r){var t=r.length,n=new r.constructor(t);return t&&typeof r[0]=="string"&&YQd.call(r,"index")&&(n.index=r.index,n.input=r.input),n}var vNa=JQd;var $Qd=hE.Uint8Array,CBe=$Qd;function XQd(r){var t=new r.constructor(r.byteLength);return new CBe(t).set(new CBe(r)),t}var SBe=XQd;function ZQd(r,t){var n=t?SBe(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var TNa=ZQd;var eUd=/\w*$/;function tUd(r){var t=new r.constructor(r.source,eUd.exec(r));return t.lastIndex=r.lastIndex,t}var INa=tUd;var ONa=jS?jS.prototype:void 0,RNa=ONa?ONa.valueOf:void 0;function rUd(r){return RNa?Object(RNa.call(r)):{}}var MNa=rUd;function nUd(r,t){var n=t?SBe(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var Ekt=nUd;var iUd="[object Boolean]",oUd="[object Date]",sUd="[object Map]",aUd="[object Number]",uUd="[object RegExp]",cUd="[object Set]",lUd="[object String]",dUd="[object Symbol]",pUd="[object ArrayBuffer]",fUd="[object DataView]",AUd="[object Float32Array]",hUd="[object Float64Array]",gUd="[object Int8Array]",mUd="[object Int16Array]",yUd="[object Int32Array]",bUd="[object Uint8Array]",EUd="[object Uint8ClampedArray]",CUd="[object Uint16Array]",SUd="[object Uint32Array]";function _Ud(r,t,n){var i=r.constructor;switch(t){case pUd:return SBe(r);case iUd:case oUd:return new i(+r);case fUd:return TNa(r,n);case AUd:case hUd:case gUd:case mUd:case yUd:case bUd:case EUd:case CUd:case SUd:return Ekt(r,n);case sUd:return new i;case aUd:case lUd:return new i(r);case uUd:return INa(r);case cUd:return new i;case dUd:return MNa(r)}}var wNa=_Ud;function vUd(r){return typeof r.constructor=="function"&&!aBe(r)?JPa(hBe(r)):{}}var Ckt=vUd;var TUd="[object Map]";function IUd(r){return Ay(r)&&vx(r)==TUd}var PNa=IUd;var NNa=W6&&W6.isMap,OUd=NNa?Tj(NNa):PNa,DNa=OUd;var RUd="[object Set]";function MUd(r){return Ay(r)&&vx(r)==RUd}var xNa=MUd;var BNa=W6&&W6.isSet,wUd=BNa?Tj(BNa):xNa,kNa=wUd;var PUd=1,NUd=2,DUd=4,LNa="[object Arguments]",xUd="[object Array]",BUd="[object Boolean]",kUd="[object Date]",LUd="[object Error]",qNa="[object Function]",qUd="[object GeneratorFunction]",zUd="[object Map]",FUd="[object Number]",zNa="[object Object]",QUd="[object RegExp]",UUd="[object Set]",jUd="[object String]",GUd="[object Symbol]",HUd="[object WeakMap]",WUd="[object ArrayBuffer]",VUd="[object DataView]",KUd="[object Float32Array]",YUd="[object Float64Array]",JUd="[object Int8Array]",$Ud="[object Int16Array]",XUd="[object Int32Array]",ZUd="[object Uint8Array]",ejd="[object Uint8ClampedArray]",tjd="[object Uint16Array]",rjd="[object Uint32Array]",mg={};mg[LNa]=mg[xUd]=mg[WUd]=mg[VUd]=mg[BUd]=mg[kUd]=mg[KUd]=mg[YUd]=mg[JUd]=mg[$Ud]=mg[XUd]=mg[zUd]=mg[FUd]=mg[zNa]=mg[QUd]=mg[UUd]=mg[jUd]=mg[GUd]=mg[ZUd]=mg[ejd]=mg[tjd]=mg[rjd]=!0;mg[LUd]=mg[qNa]=mg[HUd]=!1;function Skt(r,t,n,i,o,s){var a,u=t&PUd,l=t&NUd,c=t&DUd;if(n&&(a=o?n(r,i,o,s):n(r)),a!==void 0)return a;if(!Th(r))return r;var d=v0(r);if(d){if(a=vNa(r),!u)return nkt(r,a)}else{var p=vx(r),f=p==qNa||p==qUd;if(Bee(r))return fkt(r,u);if(p==zNa||p==LNa||f&&!o){if(a=l||f?{}:Ckt(r),!u)return l?yNa(r,lNa(a,r)):mNa(r,cNa(a,r))}else{if(!mg[p])return o?r:{};a=wNa(r,p,u)}}s||(s=new Oj);var A=s.get(r);if(A)return A;s.set(r,a),kNa(r)?r.forEach(function(_){a.add(Skt(_,t,n,_,r,s))}):DNa(r)&&r.forEach(function(_,v){a.set(v,Skt(_,t,n,v,r,s))});var g=c?l?EBe:jut:l?Ij:LR,b=d?void 0:g(r);return t4a(b||r,function(_,v){b&&(v=_,_=r[v]),oBe(a,v,Skt(_,t,n,v,r,s))}),a}var _Be=Skt;var njd=1,ijd=4;function ojd(r){return _Be(r,njd|ijd)}var Vc=ojd;var sjd=1,ajd=4;function ujd(r,t){return t=typeof t=="function"?t:void 0,_Be(r,sjd|ajd,t)}var HLi=ujd;var cjd="__lodash_hash_undefined__";function ljd(r){return this.__data__.set(r,cjd),this}var FNa=ljd;function djd(r){return this.__data__.has(r)}var QNa=djd;function _kt(r){var t=-1,n=r==null?0:r.length;for(this.__data__=new uSe;++t<n;)this.add(r[t])}_kt.prototype.add=_kt.prototype.push=FNa;_kt.prototype.has=QNa;var vkt=_kt;function pjd(r,t){for(var n=-1,i=r==null?0:r.length;++n<i;)if(t(r[n],n,r))return!0;return!1}var UNa=pjd;function fjd(r,t){return r.has(t)}var Gut=fjd;var Ajd=1,hjd=2;function gjd(r,t,n,i,o,s){var a=n&Ajd,u=r.length,l=t.length;if(u!=l&&!(a&&l>u))return!1;var c=s.get(r),d=s.get(t);if(c&&d)return c==t&&d==r;var p=-1,f=!0,A=n&hjd?new vkt:void 0;for(s.set(r,t),s.set(t,r);++p<u;){var g=r[p],b=t[p];if(i)var _=a?i(b,g,p,t,r,s):i(g,b,p,r,t,s);if(_!==void 0){if(_)continue;f=!1;break}if(A){if(!UNa(t,function(v,O){if(!Gut(A,O)&&(g===v||o(g,v,n,i,s)))return A.push(O)})){f=!1;break}}else if(!(g===b||o(g,b,n,i,s))){f=!1;break}}return s.delete(r),s.delete(t),f}var Tkt=gjd;function mjd(r){var t=-1,n=Array(r.size);return r.forEach(function(i,o){n[++t]=[o,i]}),n}var Ikt=mjd;function yjd(r){var t=-1,n=Array(r.size);return r.forEach(function(i){n[++t]=i}),n}var jNa=yjd;var bjd=1,Ejd=2,Cjd="[object Boolean]",Sjd="[object Date]",_jd="[object Error]",vjd="[object Map]",Tjd="[object Number]",Ijd="[object RegExp]",Ojd="[object Set]",Rjd="[object String]",Mjd="[object Symbol]",wjd="[object ArrayBuffer]",Pjd="[object DataView]",GNa=jS?jS.prototype:void 0,WLi=GNa?GNa.valueOf:void 0;function Njd(r,t,n,i,o,s,a){switch(n){case Pjd:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case wjd:return!(r.byteLength!=t.byteLength||!s(new CBe(r),new CBe(t)));case Cjd:case Sjd:case Tjd:return vj(+r,+t);case _jd:return r.name==t.name&&r.message==t.message;case Ijd:case Rjd:return r==t+"";case vjd:var u=Ikt;case Ojd:var l=i&bjd;if(u||(u=jNa),r.size!=t.size&&!l)return!1;var c=a.get(r);if(c)return c==t;i|=Ejd,a.set(r,t);var d=Tkt(u(r),u(t),i,o,s,a);return a.delete(r),d;case Mjd:if(WLi)return WLi.call(r)==WLi.call(t)}return!1}var HNa=Njd;var Djd=1,xjd=Object.prototype,Bjd=xjd.hasOwnProperty;function kjd(r,t,n,i,o,s){var a=n&Djd,u=jut(r),l=u.length,c=jut(t),d=c.length;if(l!=d&&!a)return!1;for(var p=l;p--;){var f=u[p];if(!(a?f in t:Bjd.call(t,f)))return!1}var A=s.get(r),g=s.get(t);if(A&&g)return A==t&&g==r;var b=!0;s.set(r,t),s.set(t,r);for(var _=a;++p<l;){f=u[p];var v=r[f],O=t[f];if(i)var R=a?i(O,v,f,t,r,s):i(v,O,f,r,t,s);if(!(R===void 0?v===O||o(v,O,n,i,s):R)){b=!1;break}_||(_=f=="constructor")}if(b&&!_){var w=r.constructor,P=t.constructor;w!=P&&"constructor"in r&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof P=="function"&&P instanceof P)&&(b=!1)}return s.delete(r),s.delete(t),b}var WNa=kjd;var Ljd=1,VNa="[object Arguments]",KNa="[object Array]",Okt="[object Object]",qjd=Object.prototype,YNa=qjd.hasOwnProperty;function zjd(r,t,n,i,o,s){var a=v0(r),u=v0(t),l=a?KNa:vx(r),c=u?KNa:vx(t);l=l==VNa?Okt:l,c=c==VNa?Okt:c;var d=l==Okt,p=c==Okt,f=l==c;if(f&&Bee(r)){if(!Bee(t))return!1;a=!0,d=!1}if(f&&!d)return s||(s=new Oj),a||uBe(r)?Tkt(r,t,n,i,o,s):HNa(r,t,l,n,i,o,s);if(!(n&Ljd)){var A=d&&YNa.call(r,"__wrapped__"),g=p&&YNa.call(t,"__wrapped__");if(A||g){var b=A?r.value():r,_=g?t.value():t;return s||(s=new Oj),o(b,_,n,i,s)}}return f?(s||(s=new Oj),WNa(r,t,n,i,o,s)):!1}var JNa=zjd;function $Na(r,t,n,i,o){return r===t?!0:r==null||t==null||!Ay(r)&&!Ay(t)?r!==r&&t!==t:JNa(r,t,n,i,$Na,o)}var vBe=$Na;var Fjd=1,Qjd=2;function Ujd(r,t,n,i){var o=n.length,s=o,a=!i;if(r==null)return!s;for(r=Object(r);o--;){var u=n[o];if(a&&u[2]?u[1]!==r[u[0]]:!(u[0]in r))return!1}for(;++o<s;){u=n[o];var l=u[0],c=r[l],d=u[1];if(a&&u[2]){if(c===void 0&&!(l in r))return!1}else{var p=new Oj;if(i)var f=i(c,d,l,r,t,p);if(!(f===void 0?vBe(d,c,Fjd|Qjd,i,p):f))return!1}}return!0}var XNa=Ujd;function jjd(r){return r===r&&!Th(r)}var Rkt=jjd;function Gjd(r){for(var t=LR(r),n=t.length;n--;){var i=t[n],o=r[i];t[n]=[i,o,Rkt(o)]}return t}var ZNa=Gjd;function Hjd(r,t){return function(n){return n==null?!1:n[r]===t&&(t!==void 0||r in Object(n))}}var Mkt=Hjd;function Wjd(r){var t=ZNa(r);return t.length==1&&t[0][2]?Mkt(t[0][0],t[0][1]):function(n){return n===r||XNa(n,r,t)}}var eDa=Wjd;function Vjd(r,t){return r!=null&&t in Object(r)}var tDa=Vjd;function Kjd(r,t,n){t=V6(t,r);for(var i=-1,o=t.length,s=!1;++i<o;){var a=K6(t[i]);if(!(s=r!=null&&n(r,a)))break;r=r[a]}return s||++i!=o?s:(o=r==null?0:r.length,!!o&&sBe(o)&&hue(a,o)&&(v0(r)||xee(r)))}var wkt=Kjd;function Yjd(r,t){return r!=null&&wkt(r,t,tDa)}var Pkt=Yjd;var Jjd=1,$jd=2;function Xjd(r,t){return cBe(r)&&Rkt(t)?Mkt(K6(r),t):function(n){var i=Uut(n,r);return i===void 0&&i===t?Pkt(n,r):vBe(t,i,Jjd|$jd)}}var rDa=Xjd;function Zjd(r){return function(t){return t?.[r]}}var Nkt=Zjd;function eGd(r){return function(t){return Eue(t,r)}}var nDa=eGd;function tGd(r){return cBe(r)?Nkt(K6(r)):nDa(r)}var iDa=tGd;function rGd(r){return typeof r=="function"?r:r==null?Sj:typeof r=="object"?v0(r)?rDa(r[0],r[1]):eDa(r):iDa(r)}var Y6=rGd;function nGd(r,t,n,i){for(var o=-1,s=r==null?0:r.length;++o<s;){var a=r[o];t(i,a,n(a),r)}return i}var oDa=nGd;function iGd(r){return function(t,n,i){for(var o=-1,s=Object(t),a=i(t),u=a.length;u--;){var l=a[r?u:++o];if(n(s[l],l,s)===!1)break}return t}}var sDa=iGd;var oGd=sDa(),Dkt=oGd;function sGd(r,t){return r&&Dkt(r,t,LR)}var TBe=sGd;function aGd(r,t){return function(n,i){if(n==null)return n;if(!H6(n))return r(n,i);for(var o=n.length,s=t?o:-1,a=Object(n);(t?s--:++s<o)&&i(a[s],s,a)!==!1;);return n}}var aDa=aGd;var uGd=aDa(TBe),xkt=uGd;function cGd(r,t,n,i){return xkt(r,function(o,s,a){t(i,o,n(o),a)}),i}var uDa=cGd;function lGd(r,t){return function(n,i){var o=v0(n)?oDa:uDa,s=t?t():{};return o(n,r,Y6(i,2),s)}}var cDa=lGd;function dGd(r,t,n){(n!==void 0&&!vj(r[t],n)||n===void 0&&!(t in r))&&_j(r,t,n)}var Hut=dGd;function pGd(r){return Ay(r)&&H6(r)}var Bkt=pGd;function fGd(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var Wut=fGd;function AGd(r){return G6(r,Ij(r))}var lDa=AGd;function hGd(r,t,n,i,o,s,a){var u=Wut(r,n),l=Wut(t,n),c=a.get(l);if(c){Hut(r,n,c);return}var d=s?s(u,l,n+"",r,t,a):void 0,p=d===void 0;if(p){var f=v0(l),A=!f&&Bee(l),g=!f&&!A&&uBe(l);d=l,f||A||g?v0(u)?d=u:Bkt(u)?d=nkt(u):A?(p=!1,d=fkt(l,!0)):g?(p=!1,d=Ekt(l,!0)):d=[]:pkt(l)||xee(l)?(d=u,xee(u)?d=lDa(u):(!Th(u)||nBe(u))&&(d=Ckt(l))):p=!1}p&&(a.set(l,d),o(d,l,i,s,a),a.delete(l)),Hut(r,n,d)}var dDa=hGd;function pDa(r,t,n,i,o){r!==t&&Dkt(t,function(s,a){if(o||(o=new Oj),Th(s))dDa(r,t,a,n,pDa,i,o);else{var u=i?i(Wut(r,a),s,a+"",r,t,o):void 0;u===void 0&&(u=s),Hut(r,a,u)}},Ij)}var fDa=pDa;function gGd(r,t,n){for(var i=-1,o=r==null?0:r.length;++i<o;)if(n(t,r[i]))return!0;return!1}var ADa=gGd;function mGd(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var hDa=mGd;function yGd(r){return typeof r=="function"?r:Sj}var gDa=yGd;function bGd(r,t){return IP(t,function(n){return[n,r[n]]})}var mDa=bGd;function EGd(r){var t=-1,n=Array(r.size);return r.forEach(function(i){n[++t]=[i,i]}),n}var yDa=EGd;var CGd="[object Map]",SGd="[object Set]";function _Gd(r){return function(t){var n=vx(t);return n==CGd?Ikt(t):n==SGd?yDa(t):mDa(t,r(t))}}var bDa=_Gd;var vGd=bDa(LR),VLi=vGd;function TGd(r,t){return r&&TBe(r,gDa(t))}var Vut=TGd;function IGd(r){for(var t=-1,n=r==null?0:r.length,i={};++t<n;){var o=r[t];i[o[0]]=o[1]}return i}var KLi=IGd;var OGd=Object.prototype,RGd=OGd.hasOwnProperty;function MGd(r,t){return r!=null&&RGd.call(r,t)}var EDa=MGd;function wGd(r,t){return r!=null&&wkt(r,t,EDa)}var YLi=wGd;var PGd="[object String]";function NGd(r){return typeof r=="string"||!v0(r)&&Ay(r)&&sT(r)==PGd}var CDa=NGd;function DGd(r,t){return IP(t,function(n){return r[n]})}var SDa=DGd;function xGd(r){return r==null?[]:SDa(r,LR(r))}var JLi=xGd;var BGd=Math.min;function kGd(r,t,n){for(var i=n?ADa:s4a,o=r[0].length,s=r.length,a=s,u=Array(s),l=1/0,c=[];a--;){var d=r[a];a&&t&&(d=IP(d,Tj(t))),l=BGd(d.length,l),u[a]=!n&&(t||o>=120&&d.length>=120)?new vkt(a&&d):void 0}d=r[0];var p=-1,f=u[0];e:for(;++p<o&&c.length<l;){var A=d[p],g=t?t(A):A;if(A=n||A!==0?A:0,!(f?Gut(f,g):i(c,g,n))){for(a=s;--a;){var b=u[a];if(!(b?Gut(b,g):i(r[a],g,n)))continue e}f&&f.push(g),c.push(A)}}return c}var _Da=kGd;function LGd(r){return Bkt(r)?r:[]}var vDa=LGd;var qGd=skt(function(r){var t=IP(r,vDa);return t.length&&t[0]===r[0]?_Da(t):[]}),$Li=qGd;function zGd(r,t){return t.length<2?r:Eue(r,gBe(t,0,-1))}var TDa=zGd;var FGd="[object Date]";function QGd(r){return Ay(r)&&sT(r)==FGd}var IDa=QGd;var ODa=W6&&W6.isDate,UGd=ODa?Tj(ODa):IDa,kkt=UGd;function jGd(r,t){return vBe(r,t)}var Cue=jGd;var GGd=cDa(function(r,t,n){_j(r,n,t)}),Sue=GGd;function HGd(r,t){return r<t}var RDa=HGd;function WGd(r,t){var n={};return t=Y6(t,3),TBe(r,function(i,o,s){_j(n,o,t(i,o,s))}),n}var OC=WGd;function VGd(r,t,n){for(var i=-1,o=r.length;++i<o;){var s=r[i],a=t(s);if(a!=null&&(u===void 0?a===a&&!Cj(a):n(a,u)))var u=a,l=s}return l}var MDa=VGd;function KGd(r,t){for(var n,i=-1,o=r.length;++i<o;){var s=t(r[i]);s!==void 0&&(n=n===void 0?s:n+s)}return n}var wDa=KGd;var YGd=u4a(function(r,t,n){fDa(r,t,n)}),XLi=YGd;function JGd(r,t){return r&&r.length?MDa(r,Y6(t,2),RDa):void 0}var ZLi=JGd;var $Gd="Expected a function";function XGd(r){if(typeof r!="function")throw new TypeError($Gd);return function(){var t=arguments;switch(t.length){case 0:return!r.call(this);case 1:return!r.call(this,t[0]);case 2:return!r.call(this,t[0],t[1]);case 3:return!r.call(this,t[0],t[1],t[2])}return!r.apply(this,t)}}var PDa=XGd;function ZGd(r,t){return t=V6(t,r),r=TDa(r,t),r==null||delete r[K6(hDa(t))]}var NDa=ZGd;function eHd(r){return pkt(r)?void 0:r}var DDa=eHd;var tHd=1,rHd=2,nHd=4,iHd=dkt(function(r,t){var n={};if(r==null)return n;var i=!1;t=IP(t,function(s){return s=V6(s,r),i||(i=s.length>1),s}),G6(r,EBe(r),n),i&&(n=_Be(n,tHd|rHd|nHd,DDa));for(var o=t.length;o--;)NDa(n,t[o]);return n}),GS=iHd;function oHd(r,t,n,i){if(!Th(r))return r;t=V6(t,r);for(var o=-1,s=t.length,a=s-1,u=r;u!=null&&++o<s;){var l=K6(t[o]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return r;if(o!=a){var d=u[l];c=i?i(d,l,u):void 0,c===void 0&&(c=Th(d)?d:hue(t[o+1])?[]:{})}oBe(u,l,c),u=u[l]}return r}var Lkt=oHd;function sHd(r,t,n){for(var i=-1,o=t.length,s={};++i<o;){var a=t[i],u=Eue(r,a);n(u,a)&&Lkt(s,V6(a,r),u)}return s}var qkt=sHd;function aHd(r,t){if(r==null)return{};var n=IP(EBe(r),function(i){return[i]});return t=Y6(t),qkt(r,n,function(i,o){return t(i,o[0])})}var zkt=aHd;function uHd(r,t){return zkt(r,PDa(Y6(t)))}var e9i=uHd;var cHd=Nkt("length"),xDa=cHd;var kDa="\\ud800-\\udfff",lHd="\\u0300-\\u036f",dHd="\\ufe20-\\ufe2f",pHd="\\u20d0-\\u20ff",fHd=lHd+dHd+pHd,AHd="\\ufe0e\\ufe0f",hHd="["+kDa+"]",t9i="["+fHd+"]",r9i="\\ud83c[\\udffb-\\udfff]",gHd="(?:"+t9i+"|"+r9i+")",LDa="[^"+kDa+"]",qDa="(?:\\ud83c[\\udde6-\\uddff]){2}",zDa="[\\ud800-\\udbff][\\udc00-\\udfff]",mHd="\\u200d",FDa=gHd+"?",QDa="["+AHd+"]?",yHd="(?:"+mHd+"(?:"+[LDa,qDa,zDa].join("|")+")"+QDa+FDa+")*",bHd=QDa+FDa+yHd,EHd="(?:"+[LDa+t9i+"?",t9i,qDa,zDa,hHd].join("|")+")",BDa=RegExp(r9i+"(?="+r9i+")|"+EHd+bHd,"g");function CHd(r){for(var t=BDa.lastIndex=0;BDa.test(r);)++t;return t}var UDa=CHd;function SHd(r){return mBe(r)?UDa(r):xDa(r)}var jDa=SHd;function _Hd(r,t){return qkt(r,t,function(n,i){return Pkt(r,i)})}var GDa=_Hd;var vHd=dkt(function(r,t){return r==null?{}:GDa(r,t)}),ub=vHd;function THd(r,t,n,i,o){return o(r,function(s,a,u){n=i?(i=!1,s):t(n,s,a,u)}),n}var HDa=THd;function IHd(r,t,n){var i=v0(r)?nNa:HDa,o=arguments.length<3;return i(r,Y6(t,4),n,o,xkt)}var n9i=IHd;function OHd(r,t,n){return r==null?r:Lkt(r,t,n)}var Kut=OHd;var RHd="[object Map]",MHd="[object Set]";function wHd(r){if(r==null)return 0;if(H6(r))return CDa(r)?jDa(r):r.length;var t=vx(r);return t==RHd||t==MHd?r.size:lkt(r).length}var HS=wHd;function PHd(r){return r&&r.length?wDa(r,Sj):0}var i9i=PHd;var Rj=r=>HLi(r,(t,n)=>{if(typeof t=="string"&&typeof n=="string"&&n.match(/(password|token|keypair)/i))return"<REDACTED>"});var Lee=class{constructor(t,n,i){this.logger=t;this.getAllFlags=n;this.getFlagValue=i}getValue(t,n,i){let o=this.getFlagValue(t),s=o===void 0?n:o;return this.assertFeatureFlagType(t,s,i)?s:n}get allFlags(){return this.getAllFlags()}getStringValue(t,n){return this.getValue(t,n,"string")}getNumericValue(t,n){return this.getValue(t,n,"number")}getObjectValue(t,n,i){let o=this.getValue(t,i,"object");return o!==void 0?n.assert(o):void 0}isFeatureEnabled(t,n){return!!this.getValue(t,n,"boolean")}assertFeatureFlagType(t,n,i){return gm(!!oT[t],`'${t}' is not a valid feature flag`,this.logger),n!==void 0&&typeof n!==oT[t].valueType?(this.logger.emerg(`Expected ${oT[t].valueType} feature flag value for ${t}, received ${typeof n}`),!1):i&&oT[t].valueType!==i?(this.logger.emerg(`Expected ${i} for feature flag ${t}, but it is defined as ${oT[t].valueType}`),!1):!0}},RP=class extends Lee{constructor(t,n){super(n??Tc(),()=>t,i=>t[i])}};var Yut=class{constructor(t,n){this.instanceConstructor=t;this.logger=n.child({category:SPa})}logger;_instance;get instance(){return this._instance||(this._instance=new this.instanceConstructor(this.logger)),this._instance}async close(){this._instance&&(await this._instance.close(),this._instance=void 0)}};var o9i="default",s9i=r=>{let t=parseInt(process.env.LAUNCHDARKLY_INIT_TIMEOUT_SEC??"");return isNaN(t)?r:t};var Fkt=r=>{let t={kind:"multi"};return r.user&&(t.user={key:r.user.id,name:r.user.name,anonymous:r.user.id===fue.user.id}),r.org&&(t.organization={key:r.org.id,name:r.org.name}),r.subdomain&&(t.subdomain={key:r.subdomain.id}),r.version&&(t.version={key:r.version.id}),r.email&&(t.email={key:r.email.id}),t},WDa=r=>{switch(r){case"org":return"organization";case"subdomain":return"subdomain";case"user":return"user";case"version":return"version";default:throw new et(`Unsupported feature flags context kind '${r}'`)}},a9i=r=>Object.keys(r).reduce((t,n)=>(oT[n]&&!oT[n].isLegacyOrgFlag&&(t[n]=r[n]),t),{});function aT(){let r=null,t=null,n=new Promise((i,o)=>{r=i,t=o});if(r===null||t===null)throw new Error("The laws of [Javascript] physics have been violated!");return{promise:n,resolve:r,reject:t}}var u9i,dSe;function NHd(r){if(!r||r.trim()==="")return{};let t={},n=r.split(";");for(let i of n){let o=i.trim();if(!o)continue;let s=o.indexOf(":");if(s===-1)continue;let a=o.substring(0,s).trim(),u=o.substring(s+1).trim();if(a){let l=a;if(u==="true")t[l]=!0;else if(u==="false")t[l]=!1;else{let c=Number(u);!isNaN(c)&&u.trim()!==""?t[l]=c:t[l]=u}}}return t}function DHd(){if(dSe!==void 0)return dSe;let r=process.env.COALESCE_TEST_FLAGS;if(!r)return dSe={},dSe;try{return dSe=NHd(r),console.log("[COALESCE_TEST_FLAGS] Parsed test flags from environment:",JSON.stringify(dSe,null,2)),dSe}catch(t){throw new Error(`Failed to parse COALESCE_TEST_FLAGS environment variable: ${t.message}
|
|
1949
1949
|
Value: ${r}`)}}var pSe=()=>(u9i||(u9i=new c9i),u9i),c9i=class{listeners=new Set;flags=new Map;listen(t){return this.listeners.add(t),()=>this.listeners.delete(t)}async setFlag(t,n,i,o){let s=`${t}:${n}`,a=this.flags.get(s);a||(a={},this.flags.set(s,a));let u=a[i];if(a[i]=o,u!==o)for(let l of this.listeners)l(t,n,i,u,o)}getFlags(t){let n=DHd(),i={...n};for(let o in t){let s=t[o].id,a=this.flags.get(`${o}:${s}`);a&&(i={...i,...a})}if(Object.keys(n).length>0){let o=vu(),s=new RP(i);VDa({...o,featureFlags:s})}return i}async clear(){this.flags=new Map,this.listeners=new Set}};var l9i=class{constructor(t){this.logger=t}_isInitialized=!1;async initialize(t){this._isInitialized=!0}get isInitialized(){return this._isInitialized}async identify(t){return new RP(pSe().getFlags(t),this.logger)}async close(){this._isInitialized=!1}setTestFlag(t,n,i,o){return pSe().setFlag(t,n,i,o)}};var Qkt=class extends l9i{listeners=new Set;_context;flags;constructor(t){super(t),this.flags=new Lee(this.logger,()=>pSe().getFlags(this.currentContext),n=>pSe().getFlags(this.currentContext)[n]),pSe().listen(this.onFlagChange.bind(this))}async initializeDefaultFlags(){gm(!this.isInitialized,"MockFeatureFlagsClientService is already initialized",this.logger),this._context=fue}async initialize(t){await super.initialize(t),this._context=t.context}get currentContext(){return gm(!!this._context,"MockFeatureFlagsClientService is not initialized or defaults fetched",this.logger),this._context}get currentFlags(){return this.flags}onChange(t){return this.listeners.add(t),()=>this.listeners.delete(t)}async identify(t){let n=pSe(),i=n.getFlags(this.currentContext);this._context=t;let o=n.getFlags(t),s={},a=new Set([...Object.keys(o),...Object.keys(i)]);for(let l of a){let c=o[l],d=i[l];c!==d&&(s[l]={current:c,previous:d})}let u=aT();return await setTimeout(()=>{this.notifyListeners(s),u.resolve(this.flags)}),u.promise}notifyListeners(t){for(let n of this.listeners)n(t)}onFlagChange(t,n,i,o,s){this.currentContext[t]?.id===n&&this.notifyListeners({[i]:{current:s,previous:o}})}async close(){await super.close(),this._context=void 0}};var k3y=M.object({orgID:Y8t.optional(),userID:J8t.optional(),requestID:M.string().optional()}),Jut,VDa=r=>{let t=Jut;return Jut={...r},t},p9i=()=>(Jut||(Jut={logContext:{},featureFlags:new RP({})}),Jut),d9i=p9i,KDa=r=>{let t=d9i;return d9i=r,t};var vu=()=>d9i();var YDa=()=>process.env.JEST_WORKER_ID!==void 0,JDa=()=>process.env.PLAYWRIGHT==="true"||process.env.REACT_APP_PLAYWRIGHT==="true"?!0:typeof window<"u"&&typeof window.localStorage<"u"?window.localStorage.getItem("playwright")==="true":!1;typeof self>"u"&&typeof global<"u"&&(global.self=global);var uT=()=>typeof process<"u"&&typeof process.release<"u"&&process.release.name==="node",$Da=()=>!uT()&&typeof self<"u"&&(typeof Window>"u"||!(self instanceof Window)),XDa=()=>uT()&&!eval("require")("worker_threads").isMainThread,qf=(0,exa.default)(()=>{let r=uT();return{isWorker:r?XDa():$Da(),isNodeWorker:XDa(),isWebWorker:$Da(),isNode:r,isBrowser:!r,isProduction:!0,isDevelopment:!1,isTest:!1,isPlaywright:JDa(),selfType:typeof self,windowType:typeof Window,selfInstanceOfWindow:typeof Window<"u"&&self instanceof Window,selfPostMessage:typeof self<"u"&&!!self.postMessage}}),Mj=process.env.APPLICATION_CONTEXT||void 0,txa=r=>{if(Mj===void 0)Mj=r;else if(Mj!=="test"&&Mj!==r)throw new Error(`Changing application contexts from ${Mj} to ${r} is disallowed`)},rxa=r=>r===Mj,Ukt=()=>Mj,IBe=()=>Mj==="scheduler"||Mj==="test"&&process.env.GOOGLE_APPLICATION_CREDENTIALS,nxa=()=>Mj==="cleanup",ZDa=()=>{let t=process.env.PORT;return t?parseInt(t):qf().isTest&&typeof process.env.JEST_WORKER_ID=="string"?8080+parseInt(process.env.JEST_WORKER_ID):qf().isTest&&typeof process.env.VITEST_WORKER_ID=="string"?8080+parseInt(process.env.VITEST_WORKER_ID):8080};function mm(){if(uT()){let r=process.env.SCHEDULER_ADDRESS;if(r)return r;throw new Error("Unable to determine base URL")}return self.location.origin}var xHd=r=>`http://${process.env.K8S_COA_TEST_HOST}:${r}`,A9i=()=>process.env.SCHEDULER_ADDRESS?process.env.SCHEDULER_ADDRESS:qf().isTest?xHd(ZDa()):process.env.K8S_COA_SCHEDULER_URL||`http://localhost:${ZDa()}`,BHd=`http://localhost:${process.env.METADATA_SERVICE_PORT||"8808"}`,jkt=(r=BHd)=>{let t=process.env.METADATA_SERVICE_ADDRESS;if(t)return t;let n=process.env.AXIOS_POST_ADDRESS;return n||r},f9i=()=>parseInt(process.env.DEPLOY_SERVICE_PORT||"8008",10),$ut=(r=`http://localhost:${f9i()}`)=>{let t={schedulerAddress:process.env.SCHEDULER_ADDRESS,deployServiceAddress:process.env.DEPLOY_SERVICE_ADDRESS,k8sDeployServiceUrl:process.env.K8S_COA_DEPLOY_SERVICE_URL,axiosPostAddress:process.env.AXIOS_POST_ADDRESS,deployServicePort:f9i(),isTest:qf().isTest,isNode:uT()};if(t.deployServiceAddress)return t.deployServiceAddress;if(t.k8sDeployServiceUrl)return t.k8sDeployServiceUrl;if(t.axiosPostAddress)return t.axiosPostAddress;if(!t.isNode)return"";if(isNaN(t.deployServicePort))throw new Nee(t,"Invalid DEPLOY_SERVICE_PORT value");if(t.schedulerAddress)try{let n=new URL(t.schedulerAddress);return n.hostname!=="localhost"&&n.hostname!=="127.0.0.1"?t.schedulerAddress:`${n.protocol}//${n.hostname}:${t.deployServicePort}`}catch{}if(t.isTest)return r;throw new Nee(t,"Reached drop-through code path in GetDeployServiceURLOnFrontendOrCLI")},ixa=()=>{let r=process.env.DEPLOY_SERVICE_ADDRESS;if(r)return r;let t=process.env.K8S_COA_DEPLOY_SERVICE_URL;if(t)return t;let n=A9i(),i=f9i();if(n)try{let o=new URL(n);if(o.hostname==="localhost"||o.hostname==="127.0.0.1")return`${o.protocol}//${o.hostname}:${i}`;let s=o.hostname,a;if(s.startsWith("pr-scheduler."))a=s.replace("pr-scheduler.","pr-deploy.");else if(s.startsWith("scheduler."))a=s.replace("scheduler.","deploy-service.");else{let u=s.split("."),l=u.indexOf("scheduler");l!==-1&&(u[l]="deploy-service",a=u.join("."))}return a?`${o.protocol}//${a}:${i}`:n}catch{}return`http://localhost:${i}`},fSe=(r=!1,t)=>process.env.DISABLE_PROXIES==="true"||J6()?!1:t?vu().featureFlags.isFeatureEnabled(t,r):r,OBe=()=>mm(),kHd=["app","local","localhost","dev","loadtesting","qa","staging","preview","eu"],oxa=r=>{let t=r?.split("."),n=t?.length?t[0]:void 0;return!n||kHd.includes(n)?void 0:n},LHd="Run timed out. Restart the run, and if this issue persists contact support.",qHd="Marked failed by Coalesce for late network check-in",U3y="Marked failed by Coalesce for missing workspace ID",j3y="Marked failed by Coalesce for no corresponding workspace",J6=()=>!!process.env.COALESCE_COA_CLOUD_JOB_ID;var sxa=["20","22","24"],FHd=typeof process<"u"&&typeof process.release<"u"&&process.release.name==="node"&&!!process.versions.node,QHd=FHd&&sxa.indexOf(process.versions.node.split(".")[0])<0;if(QHd){if(console.error("Node version",process.versions.node,"not supported, use node",sxa.join(" or ")),qf().isTest)throw new Error(`Invalid node version ${process.versions.node} not supported`);process.exit(1)}function $6(r){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(0)var o,s;throw Error("[Immer] minified error nr: "+r+(n.length?" "+n.map(function(a){return"'"+a+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function RBe(r){return!!r&&!!r[zf]}function zee(r){var t;return!!r&&(function(n){if(!n||typeof n!="object")return!1;var i=Object.getPrototypeOf(n);if(i===null)return!0;var o=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===JHd}(r)||Array.isArray(r)||!!r[tct]||!!(!((t=r.constructor)===null||t===void 0)&&t[tct])||_9i(r)||v9i(r))}function MBe(r,t,n){n===void 0&&(n=!1),wBe(r)===0?(n?Object.keys:M9i)(r).forEach(function(i){n&&typeof i=="symbol"||t(i,r[i],r)}):r.forEach(function(i,o){return t(o,i,r)})}function wBe(r){var t=r[zf];return t?t.i>3?t.i-4:t.i:Array.isArray(r)?1:_9i(r)?2:v9i(r)?3:0}function b9i(r,t){return wBe(r)===2?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function UHd(r,t){return wBe(r)===2?r.get(t):r[t]}function fxa(r,t,n){var i=wBe(r);i===2?r.set(t,n):i===3?r.add(n):r[t]=n}function jHd(r,t){return r===t?r!==0||1/r==1/t:r!=r&&t!=t}function _9i(r){return KHd&&r instanceof Map}function v9i(r){return YHd&&r instanceof Set}function WS(r){return r.o||r.t}function T9i(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var t=$Hd(r);delete t[zf];for(var n=M9i(t),i=0;i<n.length;i++){var o=n[i],s=t[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:r[o]})}return Object.create(Object.getPrototypeOf(r),t)}function I9i(r,t){return t===void 0&&(t=!1),O9i(r)||RBe(r)||!zee(r)||(wBe(r)>1&&(r.set=r.add=r.clear=r.delete=GHd),Object.freeze(r),t&&MBe(r,function(n,i){return I9i(i,!0)},!0)),r}function GHd(){$6(2)}function O9i(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function wj(r){var t=C9i[r];return t||$6(18,r),t}function HHd(r,t){C9i[r]||(C9i[r]=t)}function Hkt(){return ect}function h9i(r,t){t&&(wj("Patches"),r.u=[],r.s=[],r.v=t)}function Wkt(r){E9i(r),r.p.forEach(WHd),r.p=null}function E9i(r){r===ect&&(ect=r.l)}function axa(r){return ect={p:[],l:ect,h:r,m:!0,_:0}}function WHd(r){var t=r[zf];t.i===0||t.i===1?t.j():t.g=!0}function g9i(r,t){t._=t.p.length;var n=t.p[0],i=r!==void 0&&r!==n;return t.h.O||wj("ES5").S(t,r,i),i?(n[zf].P&&(Wkt(t),$6(4)),zee(r)&&(r=Vkt(t,r),t.l||Kkt(t,r)),t.u&&wj("Patches").M(n[zf].t,r,t.u,t.s)):r=Vkt(t,n,[]),Wkt(t),t.u&&t.v(t.u,t.s),r!==hxa?r:void 0}function Vkt(r,t,n){if(O9i(t))return t;var i=t[zf];if(!i)return MBe(t,function(u,l){return uxa(r,i,t,u,l,n)},!0),t;if(i.A!==r)return t;if(!i.P)return Kkt(r,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var o=i.i===4||i.i===5?i.o=T9i(i.k):i.o,s=o,a=!1;i.i===3&&(s=new Set(o),o.clear(),a=!0),MBe(s,function(u,l){return uxa(r,i,o,u,l,n,a)}),Kkt(r,o,!1),n&&r.u&&wj("Patches").N(i,n,r.u,r.s)}return i.o}function uxa(r,t,n,i,o,s,a){if(RBe(o)){var u=Vkt(r,o,s&&t&&t.i!==3&&!b9i(t.R,i)?s.concat(i):void 0);if(fxa(n,i,u),!RBe(u))return;r.m=!1}else a&&n.add(o);if(zee(o)&&!O9i(o)){if(!r.h.D&&r._<1)return;Vkt(r,o),t&&t.A.l||Kkt(r,o)}}function Kkt(r,t,n){n===void 0&&(n=!1),!r.l&&r.h.D&&r.m&&I9i(t,n)}function m9i(r,t){var n=r[zf];return(n?WS(n):r)[t]}function cxa(r,t){if(t in r)for(var n=Object.getPrototypeOf(r);n;){var i=Object.getOwnPropertyDescriptor(n,t);if(i)return i;n=Object.getPrototypeOf(n)}}function qee(r){r.P||(r.P=!0,r.l&&qee(r.l))}function y9i(r){r.o||(r.o=T9i(r.t))}function Zut(r,t,n){var i=_9i(t)?wj("MapSet").F(t,n):v9i(t)?wj("MapSet").T(t,n):r.O?function(o,s){var a=Array.isArray(o),u={i:a?1:0,A:s?s.A:Hkt(),P:!1,I:!1,R:{},l:s,t:o,k:null,o:null,j:null,C:!1},l=u,c=S9i;a&&(l=[u],c=Xut);var d=Proxy.revocable(l,c),p=d.revoke,f=d.proxy;return u.k=f,u.j=p,f}(t,n):wj("ES5").J(t,n);return(n?n.A:Hkt()).p.push(i),i}function VHd(r){return RBe(r)||$6(22,r),function t(n){if(!zee(n))return n;var i,o=n[zf],s=wBe(n);if(o){if(!o.P&&(o.i<4||!wj("ES5").K(o)))return o.t;o.I=!0,i=lxa(n,s),o.I=!1}else i=lxa(n,s);return MBe(i,function(a,u){o&&UHd(o.t,a)===u||fxa(i,a,t(u))}),s===3?new Set(i):i}(r)}function lxa(r,t){switch(t){case 2:return new Map(r);case 3:return Array.from(r)}return T9i(r)}function Axa(){function r(u,l){function c(){this.constructor=u}o(u,l),u.prototype=(c.prototype=l.prototype,new c)}function t(u){u.o||(u.R=new Map,u.o=new Map(u.t))}function n(u){u.o||(u.o=new Set,u.t.forEach(function(l){if(zee(l)){var c=Zut(u.A.h,l,u);u.p.set(l,c),u.o.add(c)}else u.o.add(l)}))}function i(u){u.g&&$6(3,JSON.stringify(WS(u)))}var o=function(u,l){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var p in d)d.hasOwnProperty(p)&&(c[p]=d[p])})(u,l)},s=function(){function u(c,d){return this[zf]={i:2,l:d,A:d?d.A:Hkt(),P:!1,I:!1,o:void 0,R:void 0,t:c,k:this,C:!1,g:!1},this}r(u,Map);var l=u.prototype;return Object.defineProperty(l,"size",{get:function(){return WS(this[zf]).size}}),l.has=function(c){return WS(this[zf]).has(c)},l.set=function(c,d){var p=this[zf];return i(p),WS(p).has(c)&&WS(p).get(c)===d||(t(p),qee(p),p.R.set(c,!0),p.o.set(c,d),p.R.set(c,!0)),this},l.delete=function(c){if(!this.has(c))return!1;var d=this[zf];return i(d),t(d),qee(d),d.t.has(c)?d.R.set(c,!1):d.R.delete(c),d.o.delete(c),!0},l.clear=function(){var c=this[zf];i(c),WS(c).size&&(t(c),qee(c),c.R=new Map,MBe(c.t,function(d){c.R.set(d,!1)}),c.o.clear())},l.forEach=function(c,d){var p=this;WS(this[zf]).forEach(function(f,A){c.call(d,p.get(A),A,p)})},l.get=function(c){var d=this[zf];i(d);var p=WS(d).get(c);if(d.I||!zee(p)||p!==d.t.get(c))return p;var f=Zut(d.A.h,p,d);return t(d),d.o.set(c,f),f},l.keys=function(){return WS(this[zf]).keys()},l.values=function(){var c,d=this,p=this.keys();return(c={})[Gkt]=function(){return d.values()},c.next=function(){var f=p.next();return f.done?f:{done:!1,value:d.get(f.value)}},c},l.entries=function(){var c,d=this,p=this.keys();return(c={})[Gkt]=function(){return d.entries()},c.next=function(){var f=p.next();if(f.done)return f;var A=d.get(f.value);return{done:!1,value:[f.value,A]}},c},l[Gkt]=function(){return this.entries()},u}(),a=function(){function u(c,d){return this[zf]={i:3,l:d,A:d?d.A:Hkt(),P:!1,I:!1,o:void 0,t:c,k:this,p:new Map,g:!1,C:!1},this}r(u,Set);var l=u.prototype;return Object.defineProperty(l,"size",{get:function(){return WS(this[zf]).size}}),l.has=function(c){var d=this[zf];return i(d),d.o?!!d.o.has(c)||!(!d.p.has(c)||!d.o.has(d.p.get(c))):d.t.has(c)},l.add=function(c){var d=this[zf];return i(d),this.has(c)||(n(d),qee(d),d.o.add(c)),this},l.delete=function(c){if(!this.has(c))return!1;var d=this[zf];return i(d),n(d),qee(d),d.o.delete(c)||!!d.p.has(c)&&d.o.delete(d.p.get(c))},l.clear=function(){var c=this[zf];i(c),WS(c).size&&(n(c),qee(c),c.o.clear())},l.values=function(){var c=this[zf];return i(c),n(c),c.o.values()},l.entries=function(){var c=this[zf];return i(c),n(c),c.o.entries()},l.keys=function(){return this.values()},l[Gkt]=function(){return this.values()},l.forEach=function(c,d){for(var p=this.values(),f=p.next();!f.done;)c.call(d,f.value,f.value,this),f=p.next()},u}();HHd("MapSet",{F:function(u,l){return new s(u,l)},T:function(u,l){return new a(u,l)}})}var dxa,ect,R9i=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",KHd=typeof Map<"u",YHd=typeof Set<"u",pxa=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",hxa=R9i?Symbol.for("immer-nothing"):((dxa={})["immer-nothing"]=!0,dxa),tct=R9i?Symbol.for("immer-draftable"):"__$immer_draftable",zf=R9i?Symbol.for("immer-state"):"__$immer_state",Gkt=typeof Symbol<"u"&&Symbol.iterator||"@@iterator";var JHd=""+Object.prototype.constructor,M9i=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,$Hd=Object.getOwnPropertyDescriptors||function(r){var t={};return M9i(r).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(r,n)}),t},C9i={},S9i={get:function(r,t){if(t===zf)return r;var n=WS(r);if(!b9i(n,t))return function(o,s,a){var u,l=cxa(s,a);return l?"value"in l?l.value:(u=l.get)===null||u===void 0?void 0:u.call(o.k):void 0}(r,n,t);var i=n[t];return r.I||!zee(i)?i:i===m9i(r.t,t)?(y9i(r),r.o[t]=Zut(r.A.h,i,r)):i},has:function(r,t){return t in WS(r)},ownKeys:function(r){return Reflect.ownKeys(WS(r))},set:function(r,t,n){var i=cxa(WS(r),t);if(i?.set)return i.set.call(r.k,n),!0;if(!r.P){var o=m9i(WS(r),t),s=o?.[zf];if(s&&s.t===n)return r.o[t]=n,r.R[t]=!1,!0;if(jHd(n,o)&&(n!==void 0||b9i(r.t,t)))return!0;y9i(r),qee(r)}return r.o[t]===n&&(n!==void 0||t in r.o)||Number.isNaN(n)&&Number.isNaN(r.o[t])||(r.o[t]=n,r.R[t]=!0),!0},deleteProperty:function(r,t){return m9i(r.t,t)!==void 0||t in r.t?(r.R[t]=!1,y9i(r),qee(r)):delete r.R[t],r.o&&delete r.o[t],!0},getOwnPropertyDescriptor:function(r,t){var n=WS(r),i=Reflect.getOwnPropertyDescriptor(n,t);return i&&{writable:!0,configurable:r.i!==1||t!=="length",enumerable:i.enumerable,value:n[t]}},defineProperty:function(){$6(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){$6(12)}},Xut={};MBe(S9i,function(r,t){Xut[r]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Xut.deleteProperty=function(r,t){return Xut.set.call(this,r,t,void 0)},Xut.set=function(r,t,n){return S9i.set.call(this,r[0],t,n,r[0])};var XHd=function(){function r(n){var i=this;this.O=pxa,this.D=!0,this.produce=function(o,s,a){if(typeof o=="function"&&typeof s!="function"){var u=s;s=o;var l=i;return function(b){var _=this;b===void 0&&(b=u);for(var v=arguments.length,O=Array(v>1?v-1:0),R=1;R<v;R++)O[R-1]=arguments[R];return l.produce(b,function(w){var P;return(P=s).call.apply(P,[_,w].concat(O))})}}var c;if(typeof s!="function"&&$6(6),a!==void 0&&typeof a!="function"&&$6(7),zee(o)){var d=axa(i),p=Zut(i,o,void 0),f=!0;try{c=s(p),f=!1}finally{f?Wkt(d):E9i(d)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(b){return h9i(d,a),g9i(b,d)},function(b){throw Wkt(d),b}):(h9i(d,a),g9i(c,d))}if(!o||typeof o!="object"){if((c=s(o))===void 0&&(c=o),c===hxa&&(c=void 0),i.D&&I9i(c,!0),a){var A=[],g=[];wj("Patches").M(o,c,A,g),a(A,g)}return c}$6(21,o)},this.produceWithPatches=function(o,s){if(typeof o=="function")return function(c){for(var d=arguments.length,p=Array(d>1?d-1:0),f=1;f<d;f++)p[f-1]=arguments[f];return i.produceWithPatches(c,function(A){return o.apply(void 0,[A].concat(p))})};var a,u,l=i.produce(o,s,function(c,d){a=c,u=d});return typeof Promise<"u"&&l instanceof Promise?l.then(function(c){return[c,a,u]}):[l,a,u]},typeof n?.useProxies=="boolean"&&this.setUseProxies(n.useProxies),typeof n?.autoFreeze=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=r.prototype;return t.createDraft=function(n){zee(n)||$6(8),RBe(n)&&(n=VHd(n));var i=axa(this),o=Zut(this,n,void 0);return o[zf].C=!0,E9i(i),o},t.finishDraft=function(n,i){var o=n&&n[zf],s=o.A;return h9i(s,i),g9i(void 0,s)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!pxa&&$6(20),this.O=n},t.applyPatches=function(n,i){var o;for(o=i.length-1;o>=0;o--){var s=i[o];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}o>-1&&(i=i.slice(o+1));var a=wj("Patches").$;return RBe(n)?a(n,i):this.produce(n,function(u){return a(u,i)})},r}(),Tx=new XHd,X6=Tx.produce,H3y=Tx.produceWithPatches.bind(Tx),gxa=Tx.setAutoFreeze.bind(Tx),W3y=Tx.setUseProxies.bind(Tx),V3y=Tx.applyPatches.bind(Tx),K3y=Tx.createDraft.bind(Tx),Y3y=Tx.finishDraft.bind(Tx),mxa=X6;Axa();gxa(!1);var Iza=require("os");var ZHd=["debug","info","warn","error","fatal"],yxa=r=>ZHd.includes(r);var w9i=["ACTUAL_STATE","ADVANCED_DEPLOY","APP","AUTH","BULK_WRITE","CLEANUP_TOOL","CLI","CLI_INTERNAL","COLUMN_LINEAGE","COLUMN_METADATA","COMMON","CONNECTION","DEBUG","DEPLOY","DNS","DOCS","DRAG","ENTITY_API","ENV","ENVIRONMENTS","ERROR_OPERATIONS","FIREBASE","FOLDERS","GIT","GIT_SETTINGS","GOOGLE_DEBUG","GRAPH","HEARTBEAT","INTEGRATIONS","JDBC_SERVICE","JEST","JOBS","JSON_PARSER","LIGHTNING_FS","LISTENERS","MACROS","MAPPING_GRID","METADATA_HYDRATION","METADATA_OPERATIONS","NARROW_METADATA","NODE_TYPES","ORGS","ORG_BOOTSTRAP","ORG_SCANNER","ORG_SETTINGS","ORG_UPGRADE","PACKAGES","PACKAGES_BACKEND","PACKAGE_NAMESPACES","PACKAGE_REGISTRY","PALETTE","PARTNER_CONNECT","PENDO","PERFORMANCE","PIPELINE","PLAN","PLATFORM","PRESYNC","PROBLEM_SCANNER","PROJECTS","RBAC","RENDERER","RUNNER","RUNNER_BACKEND","RUN_RESULTS","RUN_TRANSACTION","SEARCH","SECRETS","SECURE_RUN_AND_WORKSPACE","SERVICE_WORKSPACE_STATUS","SQL_PARSING","SQL_TESTING","STATE","STEPS","STORAGE_LOCATIONS","STRUMENTA","SYSTEM_EMAILS","TEMPLATE_EDITOR","TESTING","TIMING_UTILS","TREE_OPERATIONS","TYPESENSE","UI","USERS","USER_ACTIVATION","USER_MANAGEMENT","USER_SETTINGS","VERSIONING","VERSION_CONTROL_ACTIONS","WORKSPACES","XML_PARSER","YAML","ZIP","AI_COLUMN_DESCRIPTIONS","AI_NODE_DESCRIPTIONS","AI_GIT_COMMIT_MESSAGE","AI_COPILOT","SSO_SETTINGS"],Z6={...Object.fromEntries(w9i.map(r=>[r,{level:"info"}]))};var bxa=["Authorization","Token","Password","Secret","idToken","id_token","clientID","clientSecret","apiKey","snowflakeKeyPairKey","snowflakeKeyPairPass","keyPairKey","keyPairPass","key","keyPair","privateKey","passphrase","serviceAccountKey","bigQueryServiceAccountKey"];var P9i=()=>{let r=new WeakSet;return(t,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))return;r.add(n)}return n}},PBe=r=>{switch(typeof r){case"object":if(r===null)return"null";try{if(r instanceof Error){if(Ag(r)){let t=r.toJSON();try{"config"in t&&typeof t.config=="object"&&t.config!==null&&(delete t.config.httpAgent,delete t.config.httpsAgent)}catch{}return`AxiosError: ${JSON.stringify(t,P9i())}`}if(r instanceof et)return r.toString();if($8t(r))return`Error: [${r.code}] ${r.message}`}switch(r?.constructor?.name){case"Object":case"Array":return JSON.stringify(r,P9i());case"Set":return JSON.stringify(Array.from(r),P9i());case"Error":{let t=r.toString();try{let n=JSON.stringify(r);n!=="{}"&&(t=n)}catch{}return t}case"Null":return"null";case"Function":case"RegExp":return r.toString();case"Date":return r.toDateString();case"ReferenceError":case"TypeError":case"SyntaxError":case"JestAssertionError":return r.toString();case void 0:default:return`attempting to stringify object w/ constructor: ${r?.constructor?.name}; ${JSON.stringify(r)}`}}catch(t){return`Error converting object to string:${t}`}case"undefined":return typeof r;case"bigint":case"number":case"symbol":return r.toString();case"boolean":return String(r);case"string":return r;default:return"Can't convert arg to string"}};var Exa=1e6,Cxa=.8,_ue=r=>{let t;return r&&r.length>5?t="*"+r.substring(r.length-4,r.length):r.length?t="****":t="",t},NBe=r=>{if(r.length===0)return"";if(r.length===1){let o=PBe(r[0]),s=Exa*Cxa/2;return o.length>s?o.slice(0,s):o}let n=Exa*Cxa/2/r.length,i=new Array(r.length);for(let o=0;o<r.length;o++){let s=PBe(r[o]);i[o]=s.length>n?s.slice(0,n):s}return i.join(" ")},eWd=bxa.map(r=>new RegExp(`("${r}"\\s*:\\s*)"(?:\\\\.|[^"])*"`,"gi")),N9i=r=>{if(!r)return"";let t=r;for(let n of eWd)n.lastIndex=0,t=t.replace(n,'$1"[REDACTED]"');return t};var Jkt=class extends et{};var LBe=_t(gE());var qBe=class extends aSe{constructor(n,i){super({level:n,shipToLogger:({logLevel:o,messages:s,data:a,hasData:u})=>{let l=this.format({logLevel:o,messages:s,data:a&&u?a:{}});return this.consoleLog(l),[]}});this.logFormat=i}colorizeLogLevel(n){if(n==="trace"||n==="debug")return LBe.default.magenta(`${n}`);if(n==="info")return LBe.default.green(`${n}`);if(n==="warn")return LBe.default.yellow(`${n}`);if(n==="error")return LBe.default.cyan(`${n}`);if(n==="fatal")return LBe.default.red(`${n}`);{let i=n;throw new et(`Invalid log level ${i}`)}}format(n){if(this.logFormat==="text")return this.textFormat(n);if(this.logFormat==="json")return this.jsonFormat(n);{let i=this.logFormat;throw new et(`Invalid log formatter: ${i}`)}}jsonFormat(n){let{logLevel:i,messages:o,data:s}=n,a=NBe(o);return JSON.stringify({...s,message:a,level:i})}textFormat(n){let{logLevel:i,messages:o,data:s}=n,a=NBe(o),u=[{key:"orgID",prefix:"org"},{key:"workspaceID",prefix:"env"},{key:"userID",prefix:"user"},{key:"runID",prefix:"run"},{key:"runType",prefix:"runType"},{key:"nodeID",prefix:"node"},{key:"kubernetesJobUuid",prefix:"k8s-job"},{key:"planID",prefix:"plan"}],l=process.env.JEST_WORKER_ID?`[SHARD:${process.env.JEST_WORKER_ID}]`:"",c=u.map(({key:A,prefix:g})=>s[A]?`|(${g}:${s[A]})`:"").join(""),d=this.colorizeLogLevel(i),p=s.time??new Date().toISOString(),f=s.loggingArea??"COMMON";return`|${p}|${l}[${f}]${c}|${d}:${a}`}};var nLt={fatal:0,error:1,warn:2,info:3,debug:4},iLt=class{constructor(t,n,i=void 0){this.area=t;this.logLevel=n;this._logger=i;this.currentLevelPriority=nLt[n]}transports=void 0;defaultContext={};currentLevelPriority;isLevelEnabled(t){return nLt[t]<=this.currentLevelPriority}get logger(){return this._logger||(this._logger=this.createLogger()),this._logger}createLogger(){if(!this.transports)throw new et("Must create transports before using the logger!");return new Z8t({transport:this.transports})}noContextLogger(t,n){this.contextLogger(t,void 0,n)}contextLogger(t,n,i){if(!this.isLevelEnabled(t))return;let o=NBe(i);try{o=N9i(o)}catch(l){console.debug(`[${this.area}] Failed to redact sensitive data: ${PBe(l)}`),console.error(`[${this.area}] Failed to redact sensitive data. Swallowing log and returning early.`);return}let a={...vu().logContext,...this.defaultContext,...n,loggingArea:this.area},u=e9i(a,l=>l===void 0);if(this.transports)for(let l of this.transports)l.shipToLogger&&l.shipToLogger({logLevel:t,messages:[o],data:u,hasData:Object.keys(u).length>0})}debug(...t){this.noContextLogger("debug",t)}info(...t){this.noContextLogger("info",t)}warn(...t){this.noContextLogger("warn",t)}error(...t){this.noContextLogger("error",t)}fatal(...t){this.noContextLogger("fatal",t)}alert(...t){this.noContextLogger("warn",t)}app(...t){this.noContextLogger("info",t)}assert(...t){this.noContextLogger("error",t)}emerg(...t){this.noContextLogger("fatal",t)}debugContext(t,...n){this.contextLogger("debug",t,n)}infoContext(t,...n){this.contextLogger("info",t,n)}warnContext(t,...n){this.contextLogger("warn",t,n)}errorContext(t,...n){this.contextLogger("error",t,n)}fatalContext(t,...n){this.contextLogger("fatal",t,n)}alertContext(t,...n){this.contextLogger("warn",t,n)}appContext(t,...n){this.contextLogger("info",t,n)}assertContext(t,...n){this.contextLogger("error",t,n)}emergContext(t,...n){this.contextLogger("fatal",t,n)}logAtLevel(t,...n){this.noContextLogger(t,n)}logContextAtLevel(t,n,...i){this.contextLogger(t,n,i)}getConsoleTransport(){for(let t of this.transports??[])if(t instanceof qBe)return t;throw new Jkt("Invalid confguration: there must always be a console transport")}changeConsoleLogLevel(t){if(t){let n=this.getConsoleTransport();n.level=t,n.enabled=!0,this.currentLevelPriority=nLt[t];return}else{let n=this.getConsoleTransport();n.level=this.logLevel,n.enabled=!1,this.currentLevelPriority=nLt[this.logLevel]}}silenceConsole(t){this.getConsoleTransport().enabled=!t}async close(t){}setDefaultLogContext(t){this.defaultContext={...this.defaultContext,...t}}setTransports(t){if(this.transports)throw new et("Got a repeat call of setTransports()");this.transports=t}getCommonLogger(){if(!this.transports)throw new et("Must create transports before getting a child logger!");return new zut({loggingArea:this.area},this.transports,this.logger)}};var We=r=>{let t=Z6[r];if(!t)throw new Error(`Logging area "${r}" is not a valid LoggingAreas key`);return t.logger||(t.logger=new iLt(r,t.level)),t.logger},U9i=r=>{let t=We("COMMON").getCommonLogger().child(r);return qLi(t),t};var oLt=(r,t)=>{let n=r.toUpperCase(),i=[];if(n in Z6||i.push(`invalid logging area '${n}'`),yxa(t)||i.push("`invalid log level '${logLevel}'`"),i.length)throw i.forEach(s=>{console.error(s)}),new Error("Invalid logging area or log level: "+i.join(", "));We(n).changeConsoleLogLevel(t)},_Wd=r=>{for(let t of w9i)oLt(t,r)},j9i=()=>_Wd("debug");var Fee=r=>{for(let t of Object.keys(Z6))We(t).setDefaultLogContext(r)},Kxa=(r,t)=>{for(let n in Z6){let i=n,{level:o}=Z6[i];r(i).setTransports(t(i,o))}};var zBe=(r,t,n,i,o)=>({orgID:r,workspaceID:t,userID:n,runID:i,nodeID:o}),FBe=(r,t)=>{r.runID=t};var MP={};var sLt=class{constructor(t){this.logger=t}info=(...t)=>this.log("info",void 0,t);debug=(...t)=>this.log("debug",void 0,t);error=(...t)=>this.log("error",void 0,t);assert=(...t)=>this.log("assert",void 0,t);warn=(...t)=>this.log("warn",void 0,t);alert=(...t)=>this.log("alert",void 0,t);emerg=(...t)=>this.log("emerg",void 0,t);fatal=(...t)=>this.log("emerg",void 0,t);app=(...t)=>this.log("app",void 0,t);infoContext=(t,...n)=>this.log("infoContext",t,n);debugContext=(t,...n)=>this.log("debugContext",t,n);errorContext=(t,...n)=>this.log("errorContext",t,n);assertContext=(t,...n)=>this.log("assertContext",t,n);alertContext=(t,...n)=>this.log("alertContext",t,n);warnContext=(t,...n)=>this.log("warnContext",t,n);emergContext=(t,...n)=>this.log("emergContext",t,n);fatalContext=(t,...n)=>this.log("emergContext",t,n);appContext=(t,...n)=>this.log("appContext",t,n);logAtLevel=(t,...n)=>{t==="fatal"?this.log("emerg",void 0,n):this.log(t,void 0,n)};logContextAtLevel=(t,n,...i)=>{t==="fatal"?this.log("emergContext",n,i):this.log(`${t}Context`,n,i)}};var G9i=class extends sLt{constructor(n,i){super(n);this.logContext=i;this.start=performance.now()}start;reset(){this.start=performance.now()}log(n,i,...o){let s=performance.now()-this.start;this.logger[n](i??this.logContext??{},...o,`
|
|
1950
|
-
total event time: `,s.toFixed(0),"ms")}},cT=class extends G9i{shouldAllowInTestEnv;constructor(t,n,i){super(t,n),this.shouldAllowInTestEnv=i??!1}log(t,n,...i){qf().isTest&&!this.shouldAllowInTestEnv||super.log(t,n,"PERF METRIC:",i)}logMetric(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=i||performance.now()-this.start,s={name:t,"time-ms":Math.round(o),...n||{}};n?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}logMetricWithMinDuration(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=performance.now()-this.start;if(o<n)return;let s={name:t,"time-ms":Math.round(o),params:i};i?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}};var Cct=_t(e8()),VJd=_t(XBe()),wMy=(0,Cct.Record)({version:Cct.String,hash:Cct.String}),KJd=()=>({version:"7.30.7",hash:"14d8c3df7b1780dbe45eb743ea73d0228241812d"}),DP=KJd();var ULt,j6a=r=>{ULt=r},G6a=r=>({coalesceSoftwareVersion:DP?.version||"",service:r,env:process.env.REACT_APP_OWNER??"",reactAppCoalesceDev:process.env.REACT_APP_COALESCE_DEV??""}),Pqi=r=>r.includes("production")?"production":r.includes("staging")?"staging":r.includes("qa")?"qa":"development",Nqi=()=>{if(uT()){let r=process.env.RUNTIME_ENVIRONMENT||"development";return rxa("coa")?J6()?Pqi(r):void 0:Pqi(r)}else{let r;try{r=self.ENVIRONMENT}catch{}return typeof r=="string"?Pqi(r):void 0}};var yPn=_t(dza(),1),Cza=_t(L8o(),1),O_e=_t(require("process"),1),IQ0=Object.prototype.toString,OQ0=r=>IQ0.call(r)==="[object Error]",RQ0=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function MQ0(r){return r&&OQ0(r)&&r.name==="TypeError"&&typeof r.message=="string"?r.message==="Load failed"?r.stack===void 0:RQ0.has(r.message):!1}var wQ0=class extends Error{constructor(r){super(),r instanceof Error?(this.originalError=r,{message:r}=r):(this.originalError=new Error(r),this.originalError.stack=this.stack),this.name="AbortError",this.message=r}},gza=(r,t,n)=>{let i=n.retries-(t-1);return r.attemptNumber=t,r.retriesLeft=i,r};async function PQ0(r,t){return new Promise((n,i)=>{t={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...t};let o=Cza.default.operation(t),s=()=>{o.stop(),i(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",s,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",s),o.stop()};o.attempt(async u=>{try{let l=await r(u);a(),n(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof wQ0)throw l.originalError;if(l instanceof TypeError&&!MQ0(l))throw l;if(gza(l,u,t),await t.shouldRetry(l)||(o.stop(),i(l)),await t.onFailedAttempt(l),!o.retry(l))throw o.mainError()}catch(c){gza(c,u,t),a(),i(c)}}})})}var mPn=new Set,q8o=new Set,mza=!1,yza=!1;async function Adt(r,t,n){if(mza)return;mza=!0,mPn.size>0&&t&&console.error(["SYNCHRONOUS TERMINATION NOTICE:","When explicitly exiting the process via process.exit or via a parent process,","asynchronous tasks in your exitHooks will not run. Either remove these tasks,","use gracefulExit() instead of process.exit(), or ensure your parent process","sends a SIGINT to the process running this code."].join(" "));let i=128+n,o=(l=!1)=>{(l===!0||r===!0)&&O_e.default.exit(i)};for(let l of q8o)l(i);if(t){o();return}let s=[],a=0;for(let[l,c]of mPn)a=Math.max(a,c),s.push(Promise.resolve(l(i)));let u=setTimeout(()=>{o(!0)},a);await Promise.all(s),clearTimeout(u),o()}function NQ0(r){let{onExit:t,wait:n,isSynchronous:i}=r,o=[t,n];return i?q8o.add(t):mPn.add(o),yza||(yza=!0,O_e.default.once("beforeExit",Adt.bind(void 0,!0,!1,-128)),O_e.default.once("SIGINT",Adt.bind(void 0,!0,!1,2)),O_e.default.once("SIGTERM",Adt.bind(void 0,!0,!1,15)),O_e.default.once("exit",Adt.bind(void 0,!1,!0,0)),O_e.default.on("message",s=>{s==="shutdown"&&Adt(!0,!0,-128)})),()=>{i?q8o.delete(t):mPn.delete(o)}}function DQ0(r){if(typeof r!="function")throw new TypeError("onExit must be a function");return NQ0({onExit:r,isSynchronous:!0})}function xQ0(){return`${Date.now()}_${Math.floor(Math.random()*1e3)}`}var BQ0=class{currentBucket;logBucket;constructor(){this.logBucket={},this.newLogBucket()}newLogBucket(){this.currentBucket&&delete this.logBucket[this.currentBucket],this.currentBucket=xQ0(),this.logBucket[this.currentBucket]={size:0,logItems:[]}}getLogBucketByteSize(){return this.logBucket[this.currentBucket].size}getLogCount(){return this.logBucket[this.currentBucket].logItems.length}finishLogBatch(){let r=this.logBucket[this.currentBucket].logItems;return this.newLogBucket(),r}addLog(r,t){this.logBucket[this.currentBucket].size+=t,this.logBucket[this.currentBucket].logItems.push(r)}},kQ0=5138022,bza=996147,Eza=3e3,LQ0=995,Sza=class{logStorage;timer=null;apiInstance;config;constructor(r){this.logStorage=new BQ0,this.config=r,r.onInit&&r.onInit();let t=yPn.client.createConfiguration(r.ddClientConf);t.setServerVariables(r?.ddServerConf||{}),this.apiInstance=new yPn.v2.LogsApi(t),this.setupRegularSend(),this.setupExitHook()}sendLogs({logsToSend:r,bucketName:t}){PQ0(async()=>{let n={body:r,contentEncoding:"gzip"},i=await this.apiInstance.submitLog(n);return this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r.length} logs to Datadog completed`),i},{retries:this.config.retries??5}).catch(n=>{this.config.onError&&this.config.onError(n,r)})}setupRegularSend(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug(`Configured to send logs every ${this.config.sendIntervalMs||Eza}ms`),this.timer=setInterval(()=>{let r=this.logStorage.getLogCount(),t=this.logStorage.currentBucket;r>0&&(this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r} logs to Datadog on timer`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:t}))},this.config.sendIntervalMs||Eza))}setupExitHook(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug("Configuring exit hook"),DQ0(()=>{if(this.logStorage.getLogCount()>0){this.config.onDebug&&this.config.onDebug("Shutdown detected. Attempting to send remaining logs to Datadog"),this.timer&&clearInterval(this.timer);let r=this.logStorage.currentBucket;this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:r})}}))}processLog(r){let t={message:JSON.stringify(r)};this.config.ddsource&&(t.ddsource=this.config.ddsource),this.config.ddtags&&(t.ddtags=this.config.ddtags),this.config.service&&(t.service=this.config.service);let n=t.message.length+(t.ddsource?.length||0)+(t.ddtags?.length||0)+(t.hostname?.length||0)+(t.service?.length||0);if(n>bza&&this.config.onError&&this.config.onError(new Error(`Log entry exceeds size limit of ${bza} bytes: ${n}`),[t]),this.config.sendImmediate){this.config.onDebug&&this.config.onDebug("(send-immediate) Sending log to Datadog"),this.sendLogs({logsToSend:[t],bucketName:"send-immediate"});return}this.logStorage.addLog(t,n);let i=this.logStorage.getLogCount();if(this.logStorage.getLogBucketByteSize()>kQ0||i>LQ0){let s=this.logStorage.currentBucket;this.config.onDebug&&this.config.onDebug(`(${s}) Sending ${i} logs to Datadog`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:s})}}};var _za=class extends X8t{messageField;levelField;timestampField;timestampFunction;transport;constructor(r){super(r),this.enabled&&(this.transport=new Sza(r.options),this.messageField=r.messageField??"message",this.levelField=r.levelField??"level",this.timestampField=r.timestampField??"time",this.timestampFunction=r.timestampFunction)}shipToLogger({logLevel:r,messages:t,data:n,hasData:i}){let o={};if(!this.transport)throw new Error("DataDogTransport was previously disabled; enabling the flag manually on the transport instance is not supported.");return n&&i&&Object.assign(o,n),this.timestampFunction?o[this.timestampField]=this.timestampFunction():o[this.timestampField]=new Date().toISOString(),o[this.levelField]=r,o[this.messageField]=t.join(" "),this.transport.processLog(o),t}};var vza=require("node:os");var bPn=class extends qBe{consoleLog(t){process.stdout.write(`${t}${vza.EOL}`)}};var Tza=(r,t,n=!1)=>{let i=G6a(ULt),o={ddClientConf:{authMethods:{apiKeyAuth:"pub04bd017317b60c96b62874179d82ff97"}},sendImmediate:n,ddtags:`env:${i.env},coalesceSoftwareVersion:${i.coalesceSoftwareVersion}`,ddsource:"nodejs",service:`${ULt}`},s=[];return s.push(new bPn(r,t)),s.push(new _za({id:"ddNode",options:o,level:r})),s};var Oza=r=>{j6a(r);let t=process.env.CONSOLE_JSON_LOGS==="true"?"json":"text",n=r==="CLI"||r==="cleanup";Kxa(We,(a,u)=>Tza(u,t,n));let i=Nqi()??"",o=DP?.version??"",s={service:r,category:"global",coalescesoftwareversion:o,hostname:(0,Iza.hostname)(),env:i};return U9i(s)};var uhu=_t(require("node:child_process")),chu=_t(require("node:fs")),Cde=_t(require("node:process"));var Rza,z8o=new WeakMap,qQ0=()=>{},zQ0=class Sce{constructor(t){this.subscribers=[],this.settlement=null,this[Rza]="Unpromise",t instanceof Promise?this.promise=t:this.promise=new Promise(t),this.promise.then(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:n},i?.forEach(({resolve:o})=>{o(n)})}).catch(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"rejected",reason:n},i?.forEach(({reject:o})=>{o(n)})})}subscribe(){let t,n,{settlement:i}=this;if(i===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");let o=FQ0();this.subscribers=QQ0(this.subscribers,o),t=o.promise,n=()=>{this.subscribers!==null&&(this.subscribers=jQ0(this.subscribers,o))}}else{let{status:o}=i;o==="fulfilled"?t=Promise.resolve(i.value):t=Promise.reject(i.reason),n=qQ0}return Object.assign(t,{unsubscribe:n})}then(t,n){let i=this.subscribe(),{unsubscribe:o}=i;return Object.assign(i.then(t,n),{unsubscribe:o})}catch(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.catch(t),{unsubscribe:i})}finally(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.finally(t),{unsubscribe:i})}static proxy(t){let n=Sce.getSubscribablePromise(t);return typeof n<"u"?n:Sce.createSubscribablePromise(t)}static createSubscribablePromise(t){let n=new Sce(t);return z8o.set(t,n),z8o.set(n,n),n}static getSubscribablePromise(t){return z8o.get(t)}static resolve(t){return Sce.proxy(t).subscribe()}static async any(t){let n=t.map(Sce.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async race(t){let n=t.map(Sce.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async raceSingletons(t){let n=t.map(i=>Sce.proxy(i).then(()=>[i]));try{return await Promise.race(n)}finally{for(let i of n)i.unsubscribe()}}};Rza=Symbol.toStringTag;var EPn=zQ0;function FQ0(){let r,t;return{promise:new Promise((n,i)=>{r=n,t=i}),resolve:r,reject:t}}function QQ0(r,t){return[...r,t]}function UQ0(r,t){return[...r.slice(0,t),...r.slice(t+1)]}function jQ0(r,t){let n=r.indexOf(t);return n!==-1?UQ0(r,n):r}var R_e=class extends et{};var TT=async(r,t,n)=>{let i=GQ0(r),o=i.promise.then(()=>{throw new R_e(t)});return await EPn.race([n,o]).finally(i.cancel)},GQ0=r=>{let t=aT(),n=setTimeout(t.resolve,r),i=()=>clearTimeout(n);return{promise:t.promise,cancel:i}};var rIb=global.setImmediate??setTimeout;var aIb=new Error("timeout while waiting for mutex to become available"),uIb=new Error("mutex already locked"),HQ0=new Error("request for lock canceled"),WQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},qx=class{constructor(t,n=HQ0){this._value=t,this._cancelError=n,this._weightedQueues=[],this._weightedWaiters=[]}acquire(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((n,i)=>{this._weightedQueues[t-1]||(this._weightedQueues[t-1]=[]),this._weightedQueues[t-1].push({resolve:n,reject:i}),this._dispatch()})}runExclusive(t,n=1){return WQ0(this,void 0,void 0,function*(){let[i,o]=yield this.acquire(n);try{return yield t(i)}finally{o()}})}waitForUnlock(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise(n=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),this._weightedWaiters[t-1].push(n),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatch()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatch()}cancel(){this._weightedQueues.forEach(t=>t.forEach(n=>n.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var t;for(let n=this._value;n>0;n--){let i=(t=this._weightedQueues[n-1])===null||t===void 0?void 0:t.shift();if(!i)continue;let o=this._value,s=n;this._value-=n,n=this._value+1,i.resolve([o,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(t){let n=!1;return()=>{n||(n=!0,this.release(t))}}_drainUnlockWaiters(){for(let t=this._value;t>0;t--)this._weightedWaiters[t-1]&&(this._weightedWaiters[t-1].forEach(n=>n()),this._weightedWaiters[t-1]=[])}},VQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},yte=class{constructor(t){this._semaphore=new qx(1,t)}acquire(){return VQ0(this,void 0,void 0,function*(){let[,t]=yield this._semaphore.acquire();return t})}runExclusive(t){return this._semaphore.runExclusive(()=>t())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var BG0=_t(Qza());var P0;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(P0||(P0={}));function Uza(r){return r.type===P0.Tag||r.type===P0.Script||r.type===P0.Style}var jza=P0.Root,Gza=P0.Text,Hza=P0.Directive,Wza=P0.Comment,Vza=P0.Script,Kza=P0.Style,Yza=P0.Tag,Jza=P0.CDATA,$za=P0.Doctype;var SPn=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return eFa(this,t)}},gdt=class extends SPn{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}},v6e=class extends gdt{constructor(){super(...arguments),this.type=P0.Text}get nodeType(){return 3}},mdt=class extends gdt{constructor(){super(...arguments),this.type=P0.Comment}get nodeType(){return 8}},ydt=class extends gdt{constructor(t,n){super(n),this.name=t,this.type=P0.Directive}get nodeType(){return 1}},bdt=class extends SPn{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}},Edt=class extends bdt{constructor(){super(...arguments),this.type=P0.CDATA}get nodeType(){return 4}},T6e=class extends bdt{constructor(){super(...arguments),this.type=P0.Root}get nodeType(){return 9}},Cdt=class extends bdt{constructor(t,n,i=[],o=t==="script"?P0.Script:t==="style"?P0.Style:P0.Tag){super(i),this.name=t,this.attribs=n,this.type=o}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map(t=>{var n,i;return{name:t,value:this.attribs[t],namespace:(n=this["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(i=this["x-attribsPrefix"])===null||i===void 0?void 0:i[t]}})}};function bte(r){return Uza(r)}function Q8o(r){return r.type===P0.CDATA}function _Pn(r){return r.type===P0.Text}function U8o(r){return r.type===P0.Comment}function tU0(r){return r.type===P0.Directive}function Zza(r){return r.type===P0.Root}function eFa(r,t=!1){let n;if(_Pn(r))n=new v6e(r.data);else if(U8o(r))n=new mdt(r.data);else if(bte(r)){let i=t?F8o(r.children):[],o=new Cdt(r.name,{...r.attribs},i);i.forEach(s=>s.parent=o),r.namespace!=null&&(o.namespace=r.namespace),r["x-attribsNamespace"]&&(o["x-attribsNamespace"]={...r["x-attribsNamespace"]}),r["x-attribsPrefix"]&&(o["x-attribsPrefix"]={...r["x-attribsPrefix"]}),n=o}else if(Q8o(r)){let i=t?F8o(r.children):[],o=new Edt(i);i.forEach(s=>s.parent=o),n=o}else if(Zza(r)){let i=t?F8o(r.children):[],o=new T6e(i);i.forEach(s=>s.parent=o),r["x-mode"]&&(o["x-mode"]=r["x-mode"]),n=o}else if(tU0(r)){let i=new ydt(r.name,r.data);r["x-name"]!=null&&(i["x-name"]=r["x-name"],i["x-publicId"]=r["x-publicId"],i["x-systemId"]=r["x-systemId"]),n=i}else throw new Error(`Not implemented yet: ${r.type}`);return n.startIndex=r.startIndex,n.endIndex=r.endIndex,r.sourceCodeLocation!=null&&(n.sourceCodeLocation=r.sourceCodeLocation),n}function F8o(r){let t=r.map(n=>eFa(n,!0));for(let n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}var tFa={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},vPn=class{constructor(t,n,i){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(i=n,n=tFa),typeof t=="object"&&(n=t,t=void 0),this.callback=t??null,this.options=n??tFa,this.elementCB=i??null}onparserinit(t){this.parser=t}onreset(){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(t){this.handleCallback(t)}onclosetag(){this.lastNode=null;let t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)}onopentag(t,n){let i=this.options.xmlMode?P0.Tag:void 0,o=new Cdt(t,n,void 0,i);this.addNode(o),this.tagStack.push(o)}ontext(t){let{lastNode:n}=this;if(n&&n.type===P0.Text)n.data+=t,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{let i=new v6e(t);this.addNode(i),this.lastNode=i}}oncomment(t){if(this.lastNode&&this.lastNode.type===P0.Comment){this.lastNode.data+=t;return}let n=new mdt(t);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){let t=new v6e(""),n=new Edt([t]);this.addNode(n),t.parent=n,this.lastNode=t}oncdataend(){this.lastNode=null}onprocessinginstruction(t,n){let i=new ydt(t,n);this.addNode(i)}handleCallback(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t}addNode(t){let n=this.tagStack[this.tagStack.length-1],i=n.children[n.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),n.children.push(t),i&&(t.prev=i,i.next=t),t.parent=n,this.lastNode=null}};var rU0=/\n/g;function nU0(r){let t=[...r.matchAll(rU0)].map(i=>i.index||0);t.unshift(-1);let n=j8o(t,0,t.length);return i=>nFa(n,i)}function j8o(r,t,n){if(n-t==1)return{offset:r[t],index:t+1};let i=Math.ceil((t+n)/2),o=j8o(r,t,i),s=j8o(r,i,n);return{offset:o.offset,low:o,high:s}}function nFa(r,t){return function(n){return Object.prototype.hasOwnProperty.call(n,"index")}(r)?{line:r.index,column:t-r.offset}:nFa(r.high.offset<t?r.high:r.low,t)}function iFa(r,t="",n={}){let i=typeof t!="string"?t:n,o=typeof t=="string"?t:"",s=r.map(iU0),a=!!i.lineNumbers;return function(u,l=0){let c=a?nU0(u):()=>({line:0,column:0}),d=l,p=[];e:for(;d<u.length;){let f=!1;for(let A of s){A.regex.lastIndex=d;let g=A.regex.exec(u);if(g&&g[0].length>0){if(!A.discard){let b=c(d),_=typeof A.replace=="string"?g[0].replace(new RegExp(A.regex.source,A.regex.flags),A.replace):g[0];p.push({state:o,name:A.name,text:_,offset:d,len:g[0].length,line:b.line,column:b.column})}if(d=A.regex.lastIndex,f=!0,A.push){let b=A.push(u,d);p.push(...b.tokens),d=b.offset}if(A.pop)break e;break}}if(!f)break}return{tokens:p,offset:d,complete:u.length<=d}}}function iU0(r,t){return{...r,regex:oU0(r,t)}}function oU0(r,t){if(r.name.length===0)throw new Error(`Rule #${t} has empty name, which is not allowed.`);if(function(n){return Object.prototype.hasOwnProperty.call(n,"regex")}(r))return function(n){if(n.global)throw new Error(`Regular expression /${n.source}/${n.flags} contains the global flag, which is not allowed.`);return n.sticky?n:new RegExp(n.source,n.flags+"y")}(r.regex);if(function(n){return Object.prototype.hasOwnProperty.call(n,"str")}(r)){if(r.str.length===0)throw new Error(`Rule #${t} ("${r.name}") has empty "str" property, which is not allowed.`);return new RegExp(rFa(r.str),"y")}return new RegExp(rFa(r.name),"y")}function rFa(r){return r.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function M_e(r,t){return(n,i)=>{let o=i,s;return i<n.tokens.length?(s=r(n.tokens[i],n,i),s!==void 0&&o++):t?.(n,i),s===void 0?{matched:!1}:{matched:!0,position:o,value:s}}}function G8o(r,t){return r.matched?{matched:!0,position:r.position,value:t(r.value,r.position)}:r}function TPn(r,t){return r.matched?t(r):r}function D3(r,t){return(n,i)=>G8o(r(n,i),(o,s)=>t(o,n,i,s))}function Sdt(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:{matched:!0,position:i,value:t}}}function IPn(...r){return(t,n)=>{for(let i of r){let o=i(t,n);if(o.matched)return o}return{matched:!1}}}function _ce(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:t(n,i)}}function sU0(r,t){return(n,i)=>{let o=[],s=!0;do{let a=r(n,i);a.matched&&t(a.value,o.length+1,n,i,a.position)?(o.push(a.value),i=a.position):s=!1}while(s);return{matched:!0,position:i,value:o}}}function H8o(r){return sU0(r,()=>!0)}function oFa(r){return x3(r,H8o(r),(t,n)=>[t,...n])}function x3(r,t,n){return(i,o)=>TPn(r(i,o),s=>G8o(t(i,s.position),(a,u)=>n(s.value,a,i,o,u)))}function sFa(r,t){return x3(r,t,n=>n)}function W8o(r,t){return x3(r,t,(n,i)=>i)}function OPn(r,t,n,i){return(o,s)=>TPn(r(o,s),a=>TPn(t(o,a.position),u=>G8o(n(o,u.position),(l,c)=>i(a.value,u.value,l,o,s,c))))}function V8o(r,t,n){return OPn(r,t,n,(i,o)=>o)}function aU0(...r){return(t,n)=>{let i=[],o=n;for(let s of r){let a=s(t,o);if(a.matched)i.push(a.value),o=a.position;else return{matched:!1}}return{matched:!0,position:o,value:i}}}function aFa(...r){return uU0(aU0(...r))}function uU0(r){return D3(r,t=>t.flatMap(n=>n))}function cU0(r,t){return(n,i)=>{let o=!0,s=r,a=i;do{let u=t(s,n,a)(n,a);u.matched?(s=u.value,a=u.position):o=!1}while(o);return{matched:!0,position:a,value:s}}}function lU0(r,t,n){return cU0(r,i=>D3(t,(o,s,a,u)=>n(i,o,s,a,u)))}function K8o(r,t,n){return dU0(r,i=>lU0(i,x3(t,n,(o,s)=>[o,s]),(o,[s,a])=>s(o,a)))}function dU0(r,t){return(n,i)=>TPn(r(n,i),o=>t(o.value,n,i,o.position)(n,o.position))}var fU0=iFa([{name:"ws",regex:/[ \t\r\n\f]+/},{name:"idn",regex:/[a-zA-Z_-][a-zA-Z0-9_-]*/},{name:"#id",regex:/#[a-zA-Z0-9_-]+/},{name:"str1",regex:/'(?:\\['\\]|[^\n'\\])*'/},{name:"str2",regex:/"(?:\\["\\]|[^\n"\\])*"/},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]);function fFa([r,t,n],[i,o,s]){return[r+i,t+o,n+s]}function AU0(r){return r.reduce(fFa,[0,0,0])}function _1(r){return M_e(t=>t.name===r?!0:void 0)}var $8o=M_e(r=>r.name==="ws"?null:void 0),Y8o=Sdt($8o,null);function I6e(r){return V8o(Y8o,r,Y8o)}var vdt=M_e(r=>r.name==="idn"?r.text:void 0),hU0=M_e(r=>r.name==="#id"?r.text.slice(1):void 0),gU0=M_e(r=>r.name.startsWith("str")?r.text.slice(1,-1):void 0),AFa=sFa(Sdt(vdt,""),_1("|")),X8o=_ce(x3(AFa,vdt,(r,t)=>({name:t,namespace:r})),D3(vdt,r=>({name:r,namespace:null}))),mU0=_ce(x3(AFa,_1("*"),r=>({type:"universal",namespace:r,specificity:[0,0,0]})),D3(_1("*"),()=>({type:"universal",namespace:null,specificity:[0,0,0]}))),yU0=D3(X8o,({name:r,namespace:t})=>({type:"tag",name:r,namespace:t,specificity:[0,0,1]})),bU0=x3(_1("."),vdt,(r,t)=>({type:"class",name:t,specificity:[0,1,0]})),EU0=D3(hU0,r=>({type:"id",name:r,specificity:[1,0,0]})),uFa=M_e(r=>{if(r.name==="idn"){if(r.text==="i"||r.text==="I")return"i";if(r.text==="s"||r.text==="S")return"s"}}),CU0=_ce(x3(gU0,Sdt(W8o(Y8o,uFa),null),(r,t)=>({value:r,modifier:t})),x3(vdt,Sdt(W8o($8o,uFa),null),(r,t)=>({value:r,modifier:t}))),SU0=IPn(D3(_1("="),()=>"="),x3(_1("~"),_1("="),()=>"~="),x3(_1("|"),_1("="),()=>"|="),x3(_1("^"),_1("="),()=>"^="),x3(_1("$"),_1("="),()=>"$="),x3(_1("*"),_1("="),()=>"*=")),_U0=OPn(_1("["),I6e(X8o),_1("]"),(r,{name:t,namespace:n})=>({type:"attrPresence",name:t,namespace:n,specificity:[0,1,0]})),vU0=V8o(_1("["),OPn(I6e(X8o),SU0,I6e(CU0),({name:r,namespace:t},n,{value:i,modifier:o})=>({type:"attrValue",name:r,namespace:t,matcher:n,value:i,modifier:o,specificity:[0,1,0]})),_1("]")),TU0=_ce(_U0,vU0),IU0=_ce(mU0,yU0),cFa=IPn(EU0,bU0,TU0),lFa=D3(_ce(aFa(IU0,H8o(cFa)),oFa(cFa)),r=>({type:"compound",list:r,specificity:AU0(r.map(t=>t.specificity))})),OU0=IPn(D3(_1(">"),()=>">"),D3(_1("+"),()=>"+"),D3(_1("~"),()=>"~"),x3(_1("|"),_1("|"),()=>"||")),RU0=_ce(I6e(OU0),D3($8o,()=>" ")),J8o=K8o(lFa,D3(RU0,r=>(t,n)=>({type:"compound",list:[...n.list,{type:"combinator",combinator:r,left:t,specificity:t.specificity}],specificity:fFa(t.specificity,n.specificity)})),lFa),SIb=K8o(D3(J8o,r=>({type:"list",list:[r]})),D3(I6e(_1(",")),()=>(r,t)=>({type:"list",list:[...r.list,t]})),J8o);function MU0(r,t){let n=fU0(t);if(!n.complete)throw new Error(`The input "${t}" was only partially tokenized, stopped at offset ${n.offset}!
|
|
1950
|
+
total event time: `,s.toFixed(0),"ms")}},cT=class extends G9i{shouldAllowInTestEnv;constructor(t,n,i){super(t,n),this.shouldAllowInTestEnv=i??!1}log(t,n,...i){qf().isTest&&!this.shouldAllowInTestEnv||super.log(t,n,"PERF METRIC:",i)}logMetric(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=i||performance.now()-this.start,s={name:t,"time-ms":Math.round(o),...n||{}};n?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}logMetricWithMinDuration(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=performance.now()-this.start;if(o<n)return;let s={name:t,"time-ms":Math.round(o),params:i};i?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}};var Cct=_t(e8()),VJd=_t(XBe()),wMy=(0,Cct.Record)({version:Cct.String,hash:Cct.String}),KJd=()=>({version:"7.30.8",hash:"0c366216c76b65310993b36a0f0cfe3c9844933d"}),DP=KJd();var ULt,j6a=r=>{ULt=r},G6a=r=>({coalesceSoftwareVersion:DP?.version||"",service:r,env:process.env.REACT_APP_OWNER??"",reactAppCoalesceDev:process.env.REACT_APP_COALESCE_DEV??""}),Pqi=r=>r.includes("production")?"production":r.includes("staging")?"staging":r.includes("qa")?"qa":"development",Nqi=()=>{if(uT()){let r=process.env.RUNTIME_ENVIRONMENT||"development";return rxa("coa")?J6()?Pqi(r):void 0:Pqi(r)}else{let r;try{r=self.ENVIRONMENT}catch{}return typeof r=="string"?Pqi(r):void 0}};var yPn=_t(dza(),1),Cza=_t(L8o(),1),O_e=_t(require("process"),1),IQ0=Object.prototype.toString,OQ0=r=>IQ0.call(r)==="[object Error]",RQ0=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function MQ0(r){return r&&OQ0(r)&&r.name==="TypeError"&&typeof r.message=="string"?r.message==="Load failed"?r.stack===void 0:RQ0.has(r.message):!1}var wQ0=class extends Error{constructor(r){super(),r instanceof Error?(this.originalError=r,{message:r}=r):(this.originalError=new Error(r),this.originalError.stack=this.stack),this.name="AbortError",this.message=r}},gza=(r,t,n)=>{let i=n.retries-(t-1);return r.attemptNumber=t,r.retriesLeft=i,r};async function PQ0(r,t){return new Promise((n,i)=>{t={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...t};let o=Cza.default.operation(t),s=()=>{o.stop(),i(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",s,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",s),o.stop()};o.attempt(async u=>{try{let l=await r(u);a(),n(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof wQ0)throw l.originalError;if(l instanceof TypeError&&!MQ0(l))throw l;if(gza(l,u,t),await t.shouldRetry(l)||(o.stop(),i(l)),await t.onFailedAttempt(l),!o.retry(l))throw o.mainError()}catch(c){gza(c,u,t),a(),i(c)}}})})}var mPn=new Set,q8o=new Set,mza=!1,yza=!1;async function Adt(r,t,n){if(mza)return;mza=!0,mPn.size>0&&t&&console.error(["SYNCHRONOUS TERMINATION NOTICE:","When explicitly exiting the process via process.exit or via a parent process,","asynchronous tasks in your exitHooks will not run. Either remove these tasks,","use gracefulExit() instead of process.exit(), or ensure your parent process","sends a SIGINT to the process running this code."].join(" "));let i=128+n,o=(l=!1)=>{(l===!0||r===!0)&&O_e.default.exit(i)};for(let l of q8o)l(i);if(t){o();return}let s=[],a=0;for(let[l,c]of mPn)a=Math.max(a,c),s.push(Promise.resolve(l(i)));let u=setTimeout(()=>{o(!0)},a);await Promise.all(s),clearTimeout(u),o()}function NQ0(r){let{onExit:t,wait:n,isSynchronous:i}=r,o=[t,n];return i?q8o.add(t):mPn.add(o),yza||(yza=!0,O_e.default.once("beforeExit",Adt.bind(void 0,!0,!1,-128)),O_e.default.once("SIGINT",Adt.bind(void 0,!0,!1,2)),O_e.default.once("SIGTERM",Adt.bind(void 0,!0,!1,15)),O_e.default.once("exit",Adt.bind(void 0,!1,!0,0)),O_e.default.on("message",s=>{s==="shutdown"&&Adt(!0,!0,-128)})),()=>{i?q8o.delete(t):mPn.delete(o)}}function DQ0(r){if(typeof r!="function")throw new TypeError("onExit must be a function");return NQ0({onExit:r,isSynchronous:!0})}function xQ0(){return`${Date.now()}_${Math.floor(Math.random()*1e3)}`}var BQ0=class{currentBucket;logBucket;constructor(){this.logBucket={},this.newLogBucket()}newLogBucket(){this.currentBucket&&delete this.logBucket[this.currentBucket],this.currentBucket=xQ0(),this.logBucket[this.currentBucket]={size:0,logItems:[]}}getLogBucketByteSize(){return this.logBucket[this.currentBucket].size}getLogCount(){return this.logBucket[this.currentBucket].logItems.length}finishLogBatch(){let r=this.logBucket[this.currentBucket].logItems;return this.newLogBucket(),r}addLog(r,t){this.logBucket[this.currentBucket].size+=t,this.logBucket[this.currentBucket].logItems.push(r)}},kQ0=5138022,bza=996147,Eza=3e3,LQ0=995,Sza=class{logStorage;timer=null;apiInstance;config;constructor(r){this.logStorage=new BQ0,this.config=r,r.onInit&&r.onInit();let t=yPn.client.createConfiguration(r.ddClientConf);t.setServerVariables(r?.ddServerConf||{}),this.apiInstance=new yPn.v2.LogsApi(t),this.setupRegularSend(),this.setupExitHook()}sendLogs({logsToSend:r,bucketName:t}){PQ0(async()=>{let n={body:r,contentEncoding:"gzip"},i=await this.apiInstance.submitLog(n);return this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r.length} logs to Datadog completed`),i},{retries:this.config.retries??5}).catch(n=>{this.config.onError&&this.config.onError(n,r)})}setupRegularSend(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug(`Configured to send logs every ${this.config.sendIntervalMs||Eza}ms`),this.timer=setInterval(()=>{let r=this.logStorage.getLogCount(),t=this.logStorage.currentBucket;r>0&&(this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r} logs to Datadog on timer`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:t}))},this.config.sendIntervalMs||Eza))}setupExitHook(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug("Configuring exit hook"),DQ0(()=>{if(this.logStorage.getLogCount()>0){this.config.onDebug&&this.config.onDebug("Shutdown detected. Attempting to send remaining logs to Datadog"),this.timer&&clearInterval(this.timer);let r=this.logStorage.currentBucket;this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:r})}}))}processLog(r){let t={message:JSON.stringify(r)};this.config.ddsource&&(t.ddsource=this.config.ddsource),this.config.ddtags&&(t.ddtags=this.config.ddtags),this.config.service&&(t.service=this.config.service);let n=t.message.length+(t.ddsource?.length||0)+(t.ddtags?.length||0)+(t.hostname?.length||0)+(t.service?.length||0);if(n>bza&&this.config.onError&&this.config.onError(new Error(`Log entry exceeds size limit of ${bza} bytes: ${n}`),[t]),this.config.sendImmediate){this.config.onDebug&&this.config.onDebug("(send-immediate) Sending log to Datadog"),this.sendLogs({logsToSend:[t],bucketName:"send-immediate"});return}this.logStorage.addLog(t,n);let i=this.logStorage.getLogCount();if(this.logStorage.getLogBucketByteSize()>kQ0||i>LQ0){let s=this.logStorage.currentBucket;this.config.onDebug&&this.config.onDebug(`(${s}) Sending ${i} logs to Datadog`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:s})}}};var _za=class extends X8t{messageField;levelField;timestampField;timestampFunction;transport;constructor(r){super(r),this.enabled&&(this.transport=new Sza(r.options),this.messageField=r.messageField??"message",this.levelField=r.levelField??"level",this.timestampField=r.timestampField??"time",this.timestampFunction=r.timestampFunction)}shipToLogger({logLevel:r,messages:t,data:n,hasData:i}){let o={};if(!this.transport)throw new Error("DataDogTransport was previously disabled; enabling the flag manually on the transport instance is not supported.");return n&&i&&Object.assign(o,n),this.timestampFunction?o[this.timestampField]=this.timestampFunction():o[this.timestampField]=new Date().toISOString(),o[this.levelField]=r,o[this.messageField]=t.join(" "),this.transport.processLog(o),t}};var vza=require("node:os");var bPn=class extends qBe{consoleLog(t){process.stdout.write(`${t}${vza.EOL}`)}};var Tza=(r,t,n=!1)=>{let i=G6a(ULt),o={ddClientConf:{authMethods:{apiKeyAuth:"pub04bd017317b60c96b62874179d82ff97"}},sendImmediate:n,ddtags:`env:${i.env},coalesceSoftwareVersion:${i.coalesceSoftwareVersion}`,ddsource:"nodejs",service:`${ULt}`},s=[];return s.push(new bPn(r,t)),s.push(new _za({id:"ddNode",options:o,level:r})),s};var Oza=r=>{j6a(r);let t=process.env.CONSOLE_JSON_LOGS==="true"?"json":"text",n=r==="CLI"||r==="cleanup";Kxa(We,(a,u)=>Tza(u,t,n));let i=Nqi()??"",o=DP?.version??"",s={service:r,category:"global",coalescesoftwareversion:o,hostname:(0,Iza.hostname)(),env:i};return U9i(s)};var uhu=_t(require("node:child_process")),chu=_t(require("node:fs")),Cde=_t(require("node:process"));var Rza,z8o=new WeakMap,qQ0=()=>{},zQ0=class Sce{constructor(t){this.subscribers=[],this.settlement=null,this[Rza]="Unpromise",t instanceof Promise?this.promise=t:this.promise=new Promise(t),this.promise.then(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:n},i?.forEach(({resolve:o})=>{o(n)})}).catch(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"rejected",reason:n},i?.forEach(({reject:o})=>{o(n)})})}subscribe(){let t,n,{settlement:i}=this;if(i===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");let o=FQ0();this.subscribers=QQ0(this.subscribers,o),t=o.promise,n=()=>{this.subscribers!==null&&(this.subscribers=jQ0(this.subscribers,o))}}else{let{status:o}=i;o==="fulfilled"?t=Promise.resolve(i.value):t=Promise.reject(i.reason),n=qQ0}return Object.assign(t,{unsubscribe:n})}then(t,n){let i=this.subscribe(),{unsubscribe:o}=i;return Object.assign(i.then(t,n),{unsubscribe:o})}catch(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.catch(t),{unsubscribe:i})}finally(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.finally(t),{unsubscribe:i})}static proxy(t){let n=Sce.getSubscribablePromise(t);return typeof n<"u"?n:Sce.createSubscribablePromise(t)}static createSubscribablePromise(t){let n=new Sce(t);return z8o.set(t,n),z8o.set(n,n),n}static getSubscribablePromise(t){return z8o.get(t)}static resolve(t){return Sce.proxy(t).subscribe()}static async any(t){let n=t.map(Sce.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async race(t){let n=t.map(Sce.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async raceSingletons(t){let n=t.map(i=>Sce.proxy(i).then(()=>[i]));try{return await Promise.race(n)}finally{for(let i of n)i.unsubscribe()}}};Rza=Symbol.toStringTag;var EPn=zQ0;function FQ0(){let r,t;return{promise:new Promise((n,i)=>{r=n,t=i}),resolve:r,reject:t}}function QQ0(r,t){return[...r,t]}function UQ0(r,t){return[...r.slice(0,t),...r.slice(t+1)]}function jQ0(r,t){let n=r.indexOf(t);return n!==-1?UQ0(r,n):r}var R_e=class extends et{};var TT=async(r,t,n)=>{let i=GQ0(r),o=i.promise.then(()=>{throw new R_e(t)});return await EPn.race([n,o]).finally(i.cancel)},GQ0=r=>{let t=aT(),n=setTimeout(t.resolve,r),i=()=>clearTimeout(n);return{promise:t.promise,cancel:i}};var rIb=global.setImmediate??setTimeout;var aIb=new Error("timeout while waiting for mutex to become available"),uIb=new Error("mutex already locked"),HQ0=new Error("request for lock canceled"),WQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},qx=class{constructor(t,n=HQ0){this._value=t,this._cancelError=n,this._weightedQueues=[],this._weightedWaiters=[]}acquire(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((n,i)=>{this._weightedQueues[t-1]||(this._weightedQueues[t-1]=[]),this._weightedQueues[t-1].push({resolve:n,reject:i}),this._dispatch()})}runExclusive(t,n=1){return WQ0(this,void 0,void 0,function*(){let[i,o]=yield this.acquire(n);try{return yield t(i)}finally{o()}})}waitForUnlock(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise(n=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),this._weightedWaiters[t-1].push(n),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatch()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatch()}cancel(){this._weightedQueues.forEach(t=>t.forEach(n=>n.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var t;for(let n=this._value;n>0;n--){let i=(t=this._weightedQueues[n-1])===null||t===void 0?void 0:t.shift();if(!i)continue;let o=this._value,s=n;this._value-=n,n=this._value+1,i.resolve([o,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(t){let n=!1;return()=>{n||(n=!0,this.release(t))}}_drainUnlockWaiters(){for(let t=this._value;t>0;t--)this._weightedWaiters[t-1]&&(this._weightedWaiters[t-1].forEach(n=>n()),this._weightedWaiters[t-1]=[])}},VQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},yte=class{constructor(t){this._semaphore=new qx(1,t)}acquire(){return VQ0(this,void 0,void 0,function*(){let[,t]=yield this._semaphore.acquire();return t})}runExclusive(t){return this._semaphore.runExclusive(()=>t())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var BG0=_t(Qza());var P0;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(P0||(P0={}));function Uza(r){return r.type===P0.Tag||r.type===P0.Script||r.type===P0.Style}var jza=P0.Root,Gza=P0.Text,Hza=P0.Directive,Wza=P0.Comment,Vza=P0.Script,Kza=P0.Style,Yza=P0.Tag,Jza=P0.CDATA,$za=P0.Doctype;var SPn=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return eFa(this,t)}},gdt=class extends SPn{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}},v6e=class extends gdt{constructor(){super(...arguments),this.type=P0.Text}get nodeType(){return 3}},mdt=class extends gdt{constructor(){super(...arguments),this.type=P0.Comment}get nodeType(){return 8}},ydt=class extends gdt{constructor(t,n){super(n),this.name=t,this.type=P0.Directive}get nodeType(){return 1}},bdt=class extends SPn{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}},Edt=class extends bdt{constructor(){super(...arguments),this.type=P0.CDATA}get nodeType(){return 4}},T6e=class extends bdt{constructor(){super(...arguments),this.type=P0.Root}get nodeType(){return 9}},Cdt=class extends bdt{constructor(t,n,i=[],o=t==="script"?P0.Script:t==="style"?P0.Style:P0.Tag){super(i),this.name=t,this.attribs=n,this.type=o}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map(t=>{var n,i;return{name:t,value:this.attribs[t],namespace:(n=this["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(i=this["x-attribsPrefix"])===null||i===void 0?void 0:i[t]}})}};function bte(r){return Uza(r)}function Q8o(r){return r.type===P0.CDATA}function _Pn(r){return r.type===P0.Text}function U8o(r){return r.type===P0.Comment}function tU0(r){return r.type===P0.Directive}function Zza(r){return r.type===P0.Root}function eFa(r,t=!1){let n;if(_Pn(r))n=new v6e(r.data);else if(U8o(r))n=new mdt(r.data);else if(bte(r)){let i=t?F8o(r.children):[],o=new Cdt(r.name,{...r.attribs},i);i.forEach(s=>s.parent=o),r.namespace!=null&&(o.namespace=r.namespace),r["x-attribsNamespace"]&&(o["x-attribsNamespace"]={...r["x-attribsNamespace"]}),r["x-attribsPrefix"]&&(o["x-attribsPrefix"]={...r["x-attribsPrefix"]}),n=o}else if(Q8o(r)){let i=t?F8o(r.children):[],o=new Edt(i);i.forEach(s=>s.parent=o),n=o}else if(Zza(r)){let i=t?F8o(r.children):[],o=new T6e(i);i.forEach(s=>s.parent=o),r["x-mode"]&&(o["x-mode"]=r["x-mode"]),n=o}else if(tU0(r)){let i=new ydt(r.name,r.data);r["x-name"]!=null&&(i["x-name"]=r["x-name"],i["x-publicId"]=r["x-publicId"],i["x-systemId"]=r["x-systemId"]),n=i}else throw new Error(`Not implemented yet: ${r.type}`);return n.startIndex=r.startIndex,n.endIndex=r.endIndex,r.sourceCodeLocation!=null&&(n.sourceCodeLocation=r.sourceCodeLocation),n}function F8o(r){let t=r.map(n=>eFa(n,!0));for(let n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}var tFa={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},vPn=class{constructor(t,n,i){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(i=n,n=tFa),typeof t=="object"&&(n=t,t=void 0),this.callback=t??null,this.options=n??tFa,this.elementCB=i??null}onparserinit(t){this.parser=t}onreset(){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(t){this.handleCallback(t)}onclosetag(){this.lastNode=null;let t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)}onopentag(t,n){let i=this.options.xmlMode?P0.Tag:void 0,o=new Cdt(t,n,void 0,i);this.addNode(o),this.tagStack.push(o)}ontext(t){let{lastNode:n}=this;if(n&&n.type===P0.Text)n.data+=t,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{let i=new v6e(t);this.addNode(i),this.lastNode=i}}oncomment(t){if(this.lastNode&&this.lastNode.type===P0.Comment){this.lastNode.data+=t;return}let n=new mdt(t);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){let t=new v6e(""),n=new Edt([t]);this.addNode(n),t.parent=n,this.lastNode=t}oncdataend(){this.lastNode=null}onprocessinginstruction(t,n){let i=new ydt(t,n);this.addNode(i)}handleCallback(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t}addNode(t){let n=this.tagStack[this.tagStack.length-1],i=n.children[n.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),n.children.push(t),i&&(t.prev=i,i.next=t),t.parent=n,this.lastNode=null}};var rU0=/\n/g;function nU0(r){let t=[...r.matchAll(rU0)].map(i=>i.index||0);t.unshift(-1);let n=j8o(t,0,t.length);return i=>nFa(n,i)}function j8o(r,t,n){if(n-t==1)return{offset:r[t],index:t+1};let i=Math.ceil((t+n)/2),o=j8o(r,t,i),s=j8o(r,i,n);return{offset:o.offset,low:o,high:s}}function nFa(r,t){return function(n){return Object.prototype.hasOwnProperty.call(n,"index")}(r)?{line:r.index,column:t-r.offset}:nFa(r.high.offset<t?r.high:r.low,t)}function iFa(r,t="",n={}){let i=typeof t!="string"?t:n,o=typeof t=="string"?t:"",s=r.map(iU0),a=!!i.lineNumbers;return function(u,l=0){let c=a?nU0(u):()=>({line:0,column:0}),d=l,p=[];e:for(;d<u.length;){let f=!1;for(let A of s){A.regex.lastIndex=d;let g=A.regex.exec(u);if(g&&g[0].length>0){if(!A.discard){let b=c(d),_=typeof A.replace=="string"?g[0].replace(new RegExp(A.regex.source,A.regex.flags),A.replace):g[0];p.push({state:o,name:A.name,text:_,offset:d,len:g[0].length,line:b.line,column:b.column})}if(d=A.regex.lastIndex,f=!0,A.push){let b=A.push(u,d);p.push(...b.tokens),d=b.offset}if(A.pop)break e;break}}if(!f)break}return{tokens:p,offset:d,complete:u.length<=d}}}function iU0(r,t){return{...r,regex:oU0(r,t)}}function oU0(r,t){if(r.name.length===0)throw new Error(`Rule #${t} has empty name, which is not allowed.`);if(function(n){return Object.prototype.hasOwnProperty.call(n,"regex")}(r))return function(n){if(n.global)throw new Error(`Regular expression /${n.source}/${n.flags} contains the global flag, which is not allowed.`);return n.sticky?n:new RegExp(n.source,n.flags+"y")}(r.regex);if(function(n){return Object.prototype.hasOwnProperty.call(n,"str")}(r)){if(r.str.length===0)throw new Error(`Rule #${t} ("${r.name}") has empty "str" property, which is not allowed.`);return new RegExp(rFa(r.str),"y")}return new RegExp(rFa(r.name),"y")}function rFa(r){return r.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function M_e(r,t){return(n,i)=>{let o=i,s;return i<n.tokens.length?(s=r(n.tokens[i],n,i),s!==void 0&&o++):t?.(n,i),s===void 0?{matched:!1}:{matched:!0,position:o,value:s}}}function G8o(r,t){return r.matched?{matched:!0,position:r.position,value:t(r.value,r.position)}:r}function TPn(r,t){return r.matched?t(r):r}function D3(r,t){return(n,i)=>G8o(r(n,i),(o,s)=>t(o,n,i,s))}function Sdt(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:{matched:!0,position:i,value:t}}}function IPn(...r){return(t,n)=>{for(let i of r){let o=i(t,n);if(o.matched)return o}return{matched:!1}}}function _ce(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:t(n,i)}}function sU0(r,t){return(n,i)=>{let o=[],s=!0;do{let a=r(n,i);a.matched&&t(a.value,o.length+1,n,i,a.position)?(o.push(a.value),i=a.position):s=!1}while(s);return{matched:!0,position:i,value:o}}}function H8o(r){return sU0(r,()=>!0)}function oFa(r){return x3(r,H8o(r),(t,n)=>[t,...n])}function x3(r,t,n){return(i,o)=>TPn(r(i,o),s=>G8o(t(i,s.position),(a,u)=>n(s.value,a,i,o,u)))}function sFa(r,t){return x3(r,t,n=>n)}function W8o(r,t){return x3(r,t,(n,i)=>i)}function OPn(r,t,n,i){return(o,s)=>TPn(r(o,s),a=>TPn(t(o,a.position),u=>G8o(n(o,u.position),(l,c)=>i(a.value,u.value,l,o,s,c))))}function V8o(r,t,n){return OPn(r,t,n,(i,o)=>o)}function aU0(...r){return(t,n)=>{let i=[],o=n;for(let s of r){let a=s(t,o);if(a.matched)i.push(a.value),o=a.position;else return{matched:!1}}return{matched:!0,position:o,value:i}}}function aFa(...r){return uU0(aU0(...r))}function uU0(r){return D3(r,t=>t.flatMap(n=>n))}function cU0(r,t){return(n,i)=>{let o=!0,s=r,a=i;do{let u=t(s,n,a)(n,a);u.matched?(s=u.value,a=u.position):o=!1}while(o);return{matched:!0,position:a,value:s}}}function lU0(r,t,n){return cU0(r,i=>D3(t,(o,s,a,u)=>n(i,o,s,a,u)))}function K8o(r,t,n){return dU0(r,i=>lU0(i,x3(t,n,(o,s)=>[o,s]),(o,[s,a])=>s(o,a)))}function dU0(r,t){return(n,i)=>TPn(r(n,i),o=>t(o.value,n,i,o.position)(n,o.position))}var fU0=iFa([{name:"ws",regex:/[ \t\r\n\f]+/},{name:"idn",regex:/[a-zA-Z_-][a-zA-Z0-9_-]*/},{name:"#id",regex:/#[a-zA-Z0-9_-]+/},{name:"str1",regex:/'(?:\\['\\]|[^\n'\\])*'/},{name:"str2",regex:/"(?:\\["\\]|[^\n"\\])*"/},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]);function fFa([r,t,n],[i,o,s]){return[r+i,t+o,n+s]}function AU0(r){return r.reduce(fFa,[0,0,0])}function _1(r){return M_e(t=>t.name===r?!0:void 0)}var $8o=M_e(r=>r.name==="ws"?null:void 0),Y8o=Sdt($8o,null);function I6e(r){return V8o(Y8o,r,Y8o)}var vdt=M_e(r=>r.name==="idn"?r.text:void 0),hU0=M_e(r=>r.name==="#id"?r.text.slice(1):void 0),gU0=M_e(r=>r.name.startsWith("str")?r.text.slice(1,-1):void 0),AFa=sFa(Sdt(vdt,""),_1("|")),X8o=_ce(x3(AFa,vdt,(r,t)=>({name:t,namespace:r})),D3(vdt,r=>({name:r,namespace:null}))),mU0=_ce(x3(AFa,_1("*"),r=>({type:"universal",namespace:r,specificity:[0,0,0]})),D3(_1("*"),()=>({type:"universal",namespace:null,specificity:[0,0,0]}))),yU0=D3(X8o,({name:r,namespace:t})=>({type:"tag",name:r,namespace:t,specificity:[0,0,1]})),bU0=x3(_1("."),vdt,(r,t)=>({type:"class",name:t,specificity:[0,1,0]})),EU0=D3(hU0,r=>({type:"id",name:r,specificity:[1,0,0]})),uFa=M_e(r=>{if(r.name==="idn"){if(r.text==="i"||r.text==="I")return"i";if(r.text==="s"||r.text==="S")return"s"}}),CU0=_ce(x3(gU0,Sdt(W8o(Y8o,uFa),null),(r,t)=>({value:r,modifier:t})),x3(vdt,Sdt(W8o($8o,uFa),null),(r,t)=>({value:r,modifier:t}))),SU0=IPn(D3(_1("="),()=>"="),x3(_1("~"),_1("="),()=>"~="),x3(_1("|"),_1("="),()=>"|="),x3(_1("^"),_1("="),()=>"^="),x3(_1("$"),_1("="),()=>"$="),x3(_1("*"),_1("="),()=>"*=")),_U0=OPn(_1("["),I6e(X8o),_1("]"),(r,{name:t,namespace:n})=>({type:"attrPresence",name:t,namespace:n,specificity:[0,1,0]})),vU0=V8o(_1("["),OPn(I6e(X8o),SU0,I6e(CU0),({name:r,namespace:t},n,{value:i,modifier:o})=>({type:"attrValue",name:r,namespace:t,matcher:n,value:i,modifier:o,specificity:[0,1,0]})),_1("]")),TU0=_ce(_U0,vU0),IU0=_ce(mU0,yU0),cFa=IPn(EU0,bU0,TU0),lFa=D3(_ce(aFa(IU0,H8o(cFa)),oFa(cFa)),r=>({type:"compound",list:r,specificity:AU0(r.map(t=>t.specificity))})),OU0=IPn(D3(_1(">"),()=>">"),D3(_1("+"),()=>"+"),D3(_1("~"),()=>"~"),x3(_1("|"),_1("|"),()=>"||")),RU0=_ce(I6e(OU0),D3($8o,()=>" ")),J8o=K8o(lFa,D3(RU0,r=>(t,n)=>({type:"compound",list:[...n.list,{type:"combinator",combinator:r,left:t,specificity:t.specificity}],specificity:fFa(t.specificity,n.specificity)})),lFa),SIb=K8o(D3(J8o,r=>({type:"list",list:[r]})),D3(I6e(_1(",")),()=>(r,t)=>({type:"list",list:[...r.list,t]})),J8o);function MU0(r,t){let n=fU0(t);if(!n.complete)throw new Error(`The input "${t}" was only partially tokenized, stopped at offset ${n.offset}!
|
|
1951
1951
|
`+dFa(t,n.offset));let i=I6e(r)({tokens:n.tokens,options:void 0},0);if(!i.matched)throw new Error(`No match for "${t}" input!`);if(i.position<n.tokens.length){let o=n.tokens[i.position];throw new Error(`The input "${t}" was only partially parsed, stopped at offset ${o.offset}!
|
|
1952
1952
|
`+dFa(t,o.offset,o.len))}return i.value}function dFa(r,t,n=1){return`${r.replace(/(\t)|(\r)|(\n)/g,(i,o,s)=>o?"\u2409":s?"\u240D":"\u240A")}
|
|
1953
1953
|
${"".padEnd(t)}${"^".repeat(n)}`}function hFa(r){return MU0(J8o,r)}function X7(r){if(!r.type)throw new Error("This is not an AST node.");switch(r.type){case"universal":return RPn(r.namespace)+"*";case"tag":return RPn(r.namespace)+r.name;case"class":return"."+r.name;case"id":return"#"+r.name;case"attrPresence":return`[${RPn(r.namespace)}${r.name}]`;case"attrValue":return`[${RPn(r.namespace)}${r.name}${r.matcher}${wU0(r.value)}${r.modifier?r.modifier:""}]`;case"combinator":return X7(r.left)+r.combinator;case"compound":return r.list.reduce((t,n)=>n.type==="combinator"?X7(n)+t:t+X7(n),"");case"list":return r.list.map(X7).join(",")}}function RPn(r){return r||r===""?r+"|":""}function wU0(r){return r.indexOf('"')===-1?`"${r}"`:r.indexOf("'")===-1?`'${r}'`:`"${r.replace('"','\\"')}"`}function _dt(r){if(!r.type)throw new Error("This is not an AST node.");switch(r.type){case"compound":{r.list.forEach(_dt),r.list.sort((t,n)=>gFa(pFa(t),pFa(n)));break}case"combinator":{_dt(r.left);break}case"list":{r.list.forEach(_dt),r.list.sort((t,n)=>X7(t)<X7(n)?-1:1);break}}return r}function pFa(r){switch(r.type){case"universal":return[1];case"tag":return[1];case"id":return[2];case"class":return[3,r.name];case"attrPresence":return[4,X7(r)];case"attrValue":return[5,X7(r)];case"combinator":return[15,X7(r)]}}function Z8o(r,t){return gFa(r,t)}function gFa(r,t){if(!Array.isArray(r)||!Array.isArray(t))throw new Error("Arguments must be arrays.");let n=r.length<t.length?r.length:t.length;for(let i=0;i<n;i++)if(r[i]!==t[i])return r[i]<t[i]?-1:1;return r.length-t.length}var Tdt=class{constructor(t){this.branches=O6e(NU0(t))}build(t){return t(this.branches)}};function NU0(r){let t=r.length,n=new Array(t);for(let i=0;i<t;i++){let[o,s]=r[i],a=DU0(hFa(o));n[i]={ast:a,terminal:{type:"terminal",valueContainer:{index:i,value:s,specificity:a.specificity}}}}return n}function DU0(r){return yFa(r),_dt(r),r}function yFa(r){let t=[];r.list.forEach(n=>{switch(n.type){case"class":t.push({matcher:"~=",modifier:null,name:"class",namespace:null,specificity:n.specificity,type:"attrValue",value:n.name});break;case"id":t.push({matcher:"=",modifier:null,name:"id",namespace:null,specificity:n.specificity,type:"attrValue",value:n.name});break;case"combinator":yFa(n.left),t.push(n);break;case"universal":break;default:t.push(n);break}}),r.list=t}function O6e(r){let t=[];for(;r.length;){let n=CFa(r,a=>!0,bFa),{matches:i,nonmatches:o,empty:s}=BU0(r,n);r=o,i.length&&t.push(kU0(n,i)),s.length&&t.push(...xU0(s))}return t}function xU0(r){let t=[];for(let n of r){let i=n.terminal;if(i.type==="terminal")t.push(i);else{let{matches:o,rest:s}=QU0(i.cont,a=>a.type==="terminal");o.forEach(a=>t.push(a)),s.length&&(i.cont=s,t.push(i))}}return t}function BU0(r,t){let n=[],i=[],o=[];for(let s of r){let a=s.ast.list;a.length?(a.some(l=>bFa(l)===t)?n:i).push(s):o.push(s)}return{matches:n,nonmatches:i,empty:o}}function bFa(r){switch(r.type){case"attrPresence":return`attrPresence ${r.name}`;case"attrValue":return`attrValue ${r.name}`;case"combinator":return`combinator ${r.combinator}`;default:return r.type}}function kU0(r,t){if(r==="tag")return LU0(t);if(r.startsWith("attrValue "))return zU0(r.substring(10),t);if(r.startsWith("attrPresence "))return qU0(r.substring(13),t);if(r==="combinator >")return mFa(">",t);if(r==="combinator +")return mFa("+",t);throw new Error(`Unsupported selector kind: ${r}`)}function LU0(r){let t=eko(r,i=>i.type==="tag",i=>i.name);return{type:"tagName",variants:Object.entries(t).map(([i,o])=>({type:"variant",value:i,cont:O6e(o.items)}))}}function qU0(r,t){for(let n of t)EFa(n,i=>i.type==="attrPresence"&&i.name===r);return{type:"attrPresence",name:r,cont:O6e(t)}}function zU0(r,t){let n=eko(t,o=>o.type==="attrValue"&&o.name===r,o=>`${o.matcher} ${o.modifier||""} ${o.value}`),i=[];for(let o of Object.values(n)){let s=o.oneSimpleSelector,a=FU0(s),u=O6e(o.items);i.push({type:"matcher",matcher:s.matcher,modifier:s.modifier,value:s.value,predicate:a,cont:u})}return{type:"attrValue",name:r,matchers:i}}function FU0(r){if(r.modifier==="i"){let t=r.value.toLowerCase();switch(r.matcher){case"=":return n=>t===n.toLowerCase();case"~=":return n=>n.toLowerCase().split(/[ \t]+/).includes(t);case"^=":return n=>n.toLowerCase().startsWith(t);case"$=":return n=>n.toLowerCase().endsWith(t);case"*=":return n=>n.toLowerCase().includes(t);case"|=":return n=>{let i=n.toLowerCase();return t===i||i.startsWith(t)&&i[t.length]==="-"}}}else{let t=r.value;switch(r.matcher){case"=":return n=>t===n;case"~=":return n=>n.split(/[ \t]+/).includes(t);case"^=":return n=>n.startsWith(t);case"$=":return n=>n.endsWith(t);case"*=":return n=>n.includes(t);case"|=":return n=>t===n||n.startsWith(t)&&n[t.length]==="-"}}}function mFa(r,t){let n=eko(t,o=>o.type==="combinator"&&o.combinator===r,o=>X7(o.left)),i=[];for(let o of Object.values(n)){let s=O6e(o.items),a=o.oneSimpleSelector.left;i.push({ast:a,terminal:{type:"popElement",cont:s}})}return{type:"pushElement",combinator:r,cont:O6e(i)}}function eko(r,t,n){let i={};for(;r.length;){let o=CFa(r,t,n),s=d=>t(d)&&n(d)===o,a=d=>d.ast.list.some(s),{matches:u,rest:l}=UU0(r,a),c=null;for(let d of u){let p=EFa(d,s);c||(c=p)}if(c==null)throw new Error("No simple selector is found.");i[o]={oneSimpleSelector:c,items:u},r=l}return i}function EFa(r,t){let n=r.ast.list,i=new Array(n.length),o=-1;for(let a=n.length;a-- >0;)t(n[a])&&(i[a]=!0,o=a);if(o==-1)throw new Error("Couldn't find the required simple selector.");let s=n[o];return r.ast.list=n.filter((a,u)=>!i[u]),s}function CFa(r,t,n){let i={};for(let a of r){let u={};for(let l of a.ast.list.filter(t))u[n(l)]=!0;for(let l of Object.keys(u))i[l]?i[l]++:i[l]=1}let o="",s=0;for(let a of Object.entries(i))a[1]>s&&(o=a[0],s=a[1]);return o}function QU0(r,t){let n=[],i=[];for(let o of r)t(o)?n.push(o):i.push(o);return{matches:n,rest:i}}function UU0(r,t){let n=[],i=[];for(let o of r)t(o)?n.push(o):i.push(o);return{matches:n,rest:i}}var MPn=class{constructor(t){this.f=t}pickAll(t){return this.f(t)}pick1(t,n=!1){let i=this.f(t),o=i.length;if(o===0)return null;if(o===1)return i[0].value;let s=n?jU0:GU0,a=i[0];for(let u=1;u<o;u++){let l=i[u];s(a,l)&&(a=l)}return a.value}};function jU0(r,t){let n=Z8o(t.specificity,r.specificity);return n>0||n===0&&t.index<r.index}function GU0(r,t){let n=Z8o(t.specificity,r.specificity);return n>0||n===0&&t.index>r.index}function tko(r){return new MPn(R6e(r))}function R6e(r){let t=r.map(HU0);return(n,...i)=>t.flatMap(o=>o(n,...i))}function HU0(r){switch(r.type){case"terminal":{let t=[r.valueContainer];return(n,...i)=>t}case"tagName":return WU0(r);case"attrValue":return KU0(r);case"attrPresence":return VU0(r);case"pushElement":return YU0(r);case"popElement":return $U0(r)}}function WU0(r){let t={};for(let n of r.variants)t[n.value]=R6e(n.cont);return(n,...i)=>{let o=t[n.name];return o?o(n,...i):[]}}function VU0(r){let t=r.name,n=R6e(r.cont);return(i,...o)=>Object.prototype.hasOwnProperty.call(i.attribs,t)?n(i,...o):[]}function KU0(r){let t=[];for(let i of r.matchers){let o=i.predicate,s=R6e(i.cont);t.push((a,u,...l)=>o(a)?s(u,...l):[])}let n=r.name;return(i,...o)=>{let s=i.attribs[n];return s||s===""?t.flatMap(a=>a(s,i,...o)):[]}}function YU0(r){let t=R6e(r.cont),n=r.combinator==="+"?SFa:JU0;return(i,...o)=>{let s=n(i);return s===null?[]:t(s,i,...o)}}var SFa=r=>{let t=r.prev;return t===null?null:bte(t)?t:SFa(t)},JU0=r=>{let t=r.parent;return t&&bte(t)?t:null};function $U0(r){let t=R6e(r.cont);return(n,i,...o)=>t(i,...o)}var wPn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(r=>r.charCodeAt(0)));var PPn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(r=>r.charCodeAt(0)));var rko,XU0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),M6e=(rko=String.fromCodePoint)!==null&&rko!==void 0?rko:function(r){let t="";return r>65535&&(r-=65536,t+=String.fromCharCode(r>>>10&1023|55296),r=56320|r&1023),t+=String.fromCharCode(r),t};function Idt(r){var t;return r>=55296&&r<=57343||r>1114111?65533:(t=XU0.get(r))!==null&&t!==void 0?t:r}var f_;(function(r){r[r.NUM=35]="NUM",r[r.SEMI=59]="SEMI",r[r.EQUALS=61]="EQUALS",r[r.ZERO=48]="ZERO",r[r.NINE=57]="NINE",r[r.LOWER_A=97]="LOWER_A",r[r.LOWER_F=102]="LOWER_F",r[r.LOWER_X=120]="LOWER_X",r[r.LOWER_Z=122]="LOWER_Z",r[r.UPPER_A=65]="UPPER_A",r[r.UPPER_F=70]="UPPER_F",r[r.UPPER_Z=90]="UPPER_Z"})(f_||(f_={}));var ZU0=32,Z8;(function(r){r[r.VALUE_LENGTH=49152]="VALUE_LENGTH",r[r.BRANCH_LENGTH=16256]="BRANCH_LENGTH",r[r.JUMP_TABLE=127]="JUMP_TABLE"})(Z8||(Z8={}));function nko(r){return r>=f_.ZERO&&r<=f_.NINE}function ej0(r){return r>=f_.UPPER_A&&r<=f_.UPPER_F||r>=f_.LOWER_A&&r<=f_.LOWER_F}function tj0(r){return r>=f_.UPPER_A&&r<=f_.UPPER_Z||r>=f_.LOWER_A&&r<=f_.LOWER_Z||nko(r)}function rj0(r){return r===f_.EQUALS||tj0(r)}var p_;(function(r){r[r.EntityStart=0]="EntityStart",r[r.NumericStart=1]="NumericStart",r[r.NumericDecimal=2]="NumericDecimal",r[r.NumericHex=3]="NumericHex",r[r.NamedEntity=4]="NamedEntity"})(p_||(p_={}));var Ete;(function(r){r[r.Legacy=0]="Legacy",r[r.Strict=1]="Strict",r[r.Attribute=2]="Attribute"})(Ete||(Ete={}));var NPn=class{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=p_.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ete.Strict}startEntity(t){this.decodeMode=t,this.state=p_.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case p_.EntityStart:return t.charCodeAt(n)===f_.NUM?(this.state=p_.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=p_.NamedEntity,this.stateNamedEntity(t,n));case p_.NumericStart:return this.stateNumericStart(t,n);case p_.NumericDecimal:return this.stateNumericDecimal(t,n);case p_.NumericHex:return this.stateNumericHex(t,n);case p_.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ZU0)===f_.LOWER_X?(this.state=p_.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=p_.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,o){if(n!==i){let s=i-n;this.result=this.result*Math.pow(o,s)+parseInt(t.substr(n,s),o),this.consumed+=s}}stateNumericHex(t,n){let i=n;for(;n<t.length;){let o=t.charCodeAt(n);if(nko(o)||ej0(o))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){let i=n;for(;n<t.length;){let o=t.charCodeAt(n);if(nko(o))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===f_.SEMI)this.consumed+=1;else if(this.decodeMode===Ete.Strict)return 0;return this.emitCodePoint(Idt(this.result),this.consumed),this.errors&&(t!==f_.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){let{decodeTree:i}=this,o=i[this.treeIndex],s=(o&Z8.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){let a=t.charCodeAt(n);if(this.treeIndex=iko(i,o,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ete.Attribute&&(s===0||rj0(a))?0:this.emitNotTerminatedNamedEntity();if(o=i[this.treeIndex],s=(o&Z8.VALUE_LENGTH)>>14,s!==0){if(a===f_.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ete.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;let{result:n,decodeTree:i}=this,o=(i[n]&Z8.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){let{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Z8.VALUE_LENGTH:o[t+1],i),n===3&&this.emitCodePoint(o[t+2],i),i}end(){var t;switch(this.state){case p_.NamedEntity:return this.result!==0&&(this.decodeMode!==Ete.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case p_.NumericDecimal:return this.emitNumericEntity(0,2);case p_.NumericHex:return this.emitNumericEntity(0,3);case p_.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case p_.EntityStart:return 0}}};function _Fa(r){let t="",n=new NPn(r,i=>t+=M6e(i));return function(o,s){let a=0,u=0;for(;(u=o.indexOf("&",u))>=0;){t+=o.slice(a,u),n.startEntity(s);let c=n.write(o,u+1);if(c<0){a=u+n.end();break}a=u+c,u=c===0?a+1:a}let l=t+o.slice(a);return t="",l}}function iko(r,t,n,i){let o=(t&Z8.BRANCH_LENGTH)>>7,s=t&Z8.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){let l=i-s;return l<0||l>=o?-1:r[n+l]-1}let a=n,u=a+o-1;for(;a<=u;){let l=a+u>>>1,c=r[l];if(c<i)a=l+1;else if(c>i)u=l-1;else return r[l+o]}return-1}var BIb=_Fa(wPn),kIb=_Fa(PPn);var vs;(function(r){r[r.Tab=9]="Tab",r[r.NewLine=10]="NewLine",r[r.FormFeed=12]="FormFeed",r[r.CarriageReturn=13]="CarriageReturn",r[r.Space=32]="Space",r[r.ExclamationMark=33]="ExclamationMark",r[r.Num=35]="Num",r[r.Amp=38]="Amp",r[r.SingleQuote=39]="SingleQuote",r[r.DoubleQuote=34]="DoubleQuote",r[r.Dash=45]="Dash",r[r.Slash=47]="Slash",r[r.Zero=48]="Zero",r[r.Nine=57]="Nine",r[r.Semi=59]="Semi",r[r.Lt=60]="Lt",r[r.Eq=61]="Eq",r[r.Gt=62]="Gt",r[r.Questionmark=63]="Questionmark",r[r.UpperA=65]="UpperA",r[r.LowerA=97]="LowerA",r[r.UpperF=70]="UpperF",r[r.LowerF=102]="LowerF",r[r.UpperZ=90]="UpperZ",r[r.LowerZ=122]="LowerZ",r[r.LowerX=120]="LowerX",r[r.OpeningSquareBracket=91]="OpeningSquareBracket"})(vs||(vs={}));var In;(function(r){r[r.Text=1]="Text",r[r.BeforeTagName=2]="BeforeTagName",r[r.InTagName=3]="InTagName",r[r.InSelfClosingTag=4]="InSelfClosingTag",r[r.BeforeClosingTagName=5]="BeforeClosingTagName",r[r.InClosingTagName=6]="InClosingTagName",r[r.AfterClosingTagName=7]="AfterClosingTagName",r[r.BeforeAttributeName=8]="BeforeAttributeName",r[r.InAttributeName=9]="InAttributeName",r[r.AfterAttributeName=10]="AfterAttributeName",r[r.BeforeAttributeValue=11]="BeforeAttributeValue",r[r.InAttributeValueDq=12]="InAttributeValueDq",r[r.InAttributeValueSq=13]="InAttributeValueSq",r[r.InAttributeValueNq=14]="InAttributeValueNq",r[r.BeforeDeclaration=15]="BeforeDeclaration",r[r.InDeclaration=16]="InDeclaration",r[r.InProcessingInstruction=17]="InProcessingInstruction",r[r.BeforeComment=18]="BeforeComment",r[r.CDATASequence=19]="CDATASequence",r[r.InSpecialComment=20]="InSpecialComment",r[r.InCommentLike=21]="InCommentLike",r[r.BeforeSpecialS=22]="BeforeSpecialS",r[r.SpecialStartSequence=23]="SpecialStartSequence",r[r.InSpecialTag=24]="InSpecialTag",r[r.BeforeEntity=25]="BeforeEntity",r[r.BeforeNumericEntity=26]="BeforeNumericEntity",r[r.InNamedEntity=27]="InNamedEntity",r[r.InNumericEntity=28]="InNumericEntity",r[r.InHexEntity=29]="InHexEntity"})(In||(In={}));function Cte(r){return r===vs.Space||r===vs.NewLine||r===vs.Tab||r===vs.FormFeed||r===vs.CarriageReturn}function DPn(r){return r===vs.Slash||r===vs.Gt||Cte(r)}function vFa(r){return r>=vs.Zero&&r<=vs.Nine}function nj0(r){return r>=vs.LowerA&&r<=vs.LowerZ||r>=vs.UpperA&&r<=vs.UpperZ}function ij0(r){return r>=vs.UpperA&&r<=vs.UpperF||r>=vs.LowerA&&r<=vs.LowerF}var Z7;(function(r){r[r.NoValue=0]="NoValue",r[r.Unquoted=1]="Unquoted",r[r.Single=2]="Single",r[r.Double=3]="Double"})(Z7||(Z7={}));var w4={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},w6e=class{constructor({xmlMode:t=!1,decodeEntities:n=!0},i){this.cbs=i,this.state=In.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=In.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=t,this.decodeEntities=n,this.entityTrie=t?PPn:wPn}reset(){this.state=In.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=In.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(t){this.offset+=this.buffer.length,this.buffer=t,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}getIndex(){return this.index}getSectionStart(){return this.sectionStart}stateText(t){t===vs.Lt||!this.decodeEntities&&this.fastForwardTo(vs.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=In.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&t===vs.Amp&&(this.state=In.BeforeEntity)}stateSpecialStartSequence(t){let n=this.sequenceIndex===this.currentSequence.length;if(!(n?DPn(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=In.InTagName,this.stateInTagName(t)}stateInSpecialTag(t){if(this.sequenceIndex===this.currentSequence.length){if(t===vs.Gt||Cte(t)){let n=this.index-this.currentSequence.length;if(this.sectionStart<n){let i=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=i}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(t);return}this.sequenceIndex=0}(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===w4.TitleEnd?this.decodeEntities&&t===vs.Amp&&(this.state=In.BeforeEntity):this.fastForwardTo(vs.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(t===vs.Lt)}stateCDATASequence(t){t===w4.Cdata[this.sequenceIndex]?++this.sequenceIndex===w4.Cdata.length&&(this.state=In.InCommentLike,this.currentSequence=w4.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=In.InDeclaration,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===t)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===w4.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=In.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(t){return this.xmlMode?!DPn(t):nj0(t)}startSpecial(t,n){this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=n,this.state=In.SpecialStartSequence}stateBeforeTagName(t){if(t===vs.ExclamationMark)this.state=In.BeforeDeclaration,this.sectionStart=this.index+1;else if(t===vs.Questionmark)this.state=In.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(t)){let n=t|32;this.sectionStart=this.index,!this.xmlMode&&n===w4.TitleEnd[2]?this.startSpecial(w4.TitleEnd,3):this.state=!this.xmlMode&&n===w4.ScriptEnd[2]?In.BeforeSpecialS:In.InTagName}else t===vs.Slash?this.state=In.BeforeClosingTagName:(this.state=In.Text,this.stateText(t))}stateInTagName(t){DPn(t)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateBeforeClosingTagName(t){Cte(t)||(t===vs.Gt?this.state=In.Text:(this.state=this.isTagStartChar(t)?In.InClosingTagName:In.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(t){(t===vs.Gt||Cte(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=In.AfterClosingTagName,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.state=In.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(t){t===vs.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=In.InSpecialTag,this.sequenceIndex=0):this.state=In.Text,this.baseState=this.state,this.sectionStart=this.index+1):t===vs.Slash?this.state=In.InSelfClosingTag:Cte(t)||(this.state=In.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(t){t===vs.Gt?(this.cbs.onselfclosingtag(this.index),this.state=In.Text,this.baseState=In.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Cte(t)||(this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateInAttributeName(t){(t===vs.Eq||DPn(t))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=In.AfterAttributeName,this.stateAfterAttributeName(t))}stateAfterAttributeName(t){t===vs.Eq?this.state=In.BeforeAttributeValue:t===vs.Slash||t===vs.Gt?(this.cbs.onattribend(Z7.NoValue,this.index),this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t)):Cte(t)||(this.cbs.onattribend(Z7.NoValue,this.index),this.state=In.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(t){t===vs.DoubleQuote?(this.state=In.InAttributeValueDq,this.sectionStart=this.index+1):t===vs.SingleQuote?(this.state=In.InAttributeValueSq,this.sectionStart=this.index+1):Cte(t)||(this.sectionStart=this.index,this.state=In.InAttributeValueNq,this.stateInAttributeValueNoQuotes(t))}handleInAttributeValue(t,n){t===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===vs.DoubleQuote?Z7.Double:Z7.Single,this.index),this.state=In.BeforeAttributeName):this.decodeEntities&&t===vs.Amp&&(this.baseState=this.state,this.state=In.BeforeEntity)}stateInAttributeValueDoubleQuotes(t){this.handleInAttributeValue(t,vs.DoubleQuote)}stateInAttributeValueSingleQuotes(t){this.handleInAttributeValue(t,vs.SingleQuote)}stateInAttributeValueNoQuotes(t){Cte(t)||t===vs.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Z7.Unquoted,this.index),this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t)):this.decodeEntities&&t===vs.Amp&&(this.baseState=this.state,this.state=In.BeforeEntity)}stateBeforeDeclaration(t){t===vs.OpeningSquareBracket?(this.state=In.CDATASequence,this.sequenceIndex=0):this.state=t===vs.Dash?In.BeforeComment:In.InDeclaration}stateInDeclaration(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=In.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=In.Text,this.sectionStart=this.index+1)}stateBeforeComment(t){t===vs.Dash?(this.state=In.InCommentLike,this.currentSequence=w4.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=In.InDeclaration}stateInSpecialComment(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=In.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){let n=t|32;n===w4.ScriptEnd[3]?this.startSpecial(w4.ScriptEnd,4):n===w4.StyleEnd[3]?this.startSpecial(w4.StyleEnd,4):(this.state=In.InTagName,this.stateInTagName(t))}stateBeforeEntity(t){this.entityExcess=1,this.entityResult=0,t===vs.Num?this.state=In.BeforeNumericEntity:t===vs.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=In.InNamedEntity,this.stateInNamedEntity(t))}stateInNamedEntity(t){if(this.entityExcess+=1,this.trieIndex=iko(this.entityTrie,this.trieCurrent,this.trieIndex+1,t),this.trieIndex<0){this.emitNamedEntity(),this.index--;return}this.trieCurrent=this.entityTrie[this.trieIndex];let n=this.trieCurrent&Z8.VALUE_LENGTH;if(n){let i=(n>>14)-1;if(!this.allowLegacyEntity()&&t!==vs.Semi)this.trieIndex+=i;else{let o=this.index-this.entityExcess+1;o>this.sectionStart&&this.emitPartial(this.sectionStart,o),this.entityResult=this.trieIndex,this.trieIndex+=i,this.entityExcess=0,this.sectionStart=this.index+1,i===0&&this.emitNamedEntity()}}}emitNamedEntity(){if(this.state=this.baseState,this.entityResult===0)return;switch((this.entityTrie[this.entityResult]&Z8.VALUE_LENGTH)>>14){case 1:this.emitCodePoint(this.entityTrie[this.entityResult]&~Z8.VALUE_LENGTH);break;case 2:this.emitCodePoint(this.entityTrie[this.entityResult+1]);break;case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}stateBeforeNumericEntity(t){(t|32)===vs.LowerX?(this.entityExcess++,this.state=In.InHexEntity):(this.state=In.InNumericEntity,this.stateInNumericEntity(t))}emitNumericEntity(t){let n=this.index-this.entityExcess-1;n+2+ +(this.state===In.InHexEntity)!==this.index&&(n>this.sectionStart&&this.emitPartial(this.sectionStart,n),this.sectionStart=this.index+Number(t),this.emitCodePoint(Idt(this.entityResult))),this.state=this.baseState}stateInNumericEntity(t){t===vs.Semi?this.emitNumericEntity(!0):vFa(t)?(this.entityResult=this.entityResult*10+(t-vs.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)}stateInHexEntity(t){t===vs.Semi?this.emitNumericEntity(!0):vFa(t)?(this.entityResult=this.entityResult*16+(t-vs.Zero),this.entityExcess++):ij0(t)?(this.entityResult=this.entityResult*16+((t|32)-vs.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)}allowLegacyEntity(){return!this.xmlMode&&(this.baseState===In.Text||this.baseState===In.InSpecialTag)}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===In.Text||this.state===In.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===In.InAttributeValueDq||this.state===In.InAttributeValueSq||this.state===In.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){let t=this.buffer.charCodeAt(this.index-this.offset);this.state===In.Text?this.stateText(t):this.state===In.SpecialStartSequence?this.stateSpecialStartSequence(t):this.state===In.InSpecialTag?this.stateInSpecialTag(t):this.state===In.CDATASequence?this.stateCDATASequence(t):this.state===In.InAttributeValueDq?this.stateInAttributeValueDoubleQuotes(t):this.state===In.InAttributeName?this.stateInAttributeName(t):this.state===In.InCommentLike?this.stateInCommentLike(t):this.state===In.InSpecialComment?this.stateInSpecialComment(t):this.state===In.BeforeAttributeName?this.stateBeforeAttributeName(t):this.state===In.InTagName?this.stateInTagName(t):this.state===In.InClosingTagName?this.stateInClosingTagName(t):this.state===In.BeforeTagName?this.stateBeforeTagName(t):this.state===In.AfterAttributeName?this.stateAfterAttributeName(t):this.state===In.InAttributeValueSq?this.stateInAttributeValueSingleQuotes(t):this.state===In.BeforeAttributeValue?this.stateBeforeAttributeValue(t):this.state===In.BeforeClosingTagName?this.stateBeforeClosingTagName(t):this.state===In.AfterClosingTagName?this.stateAfterClosingTagName(t):this.state===In.BeforeSpecialS?this.stateBeforeSpecialS(t):this.state===In.InAttributeValueNq?this.stateInAttributeValueNoQuotes(t):this.state===In.InSelfClosingTag?this.stateInSelfClosingTag(t):this.state===In.InDeclaration?this.stateInDeclaration(t):this.state===In.BeforeDeclaration?this.stateBeforeDeclaration(t):this.state===In.BeforeComment?this.stateBeforeComment(t):this.state===In.InProcessingInstruction?this.stateInProcessingInstruction(t):this.state===In.InNamedEntity?this.stateInNamedEntity(t):this.state===In.BeforeEntity?this.stateBeforeEntity(t):this.state===In.InHexEntity?this.stateInHexEntity(t):this.state===In.InNumericEntity?this.stateInNumericEntity(t):this.stateBeforeNumericEntity(t),this.index++}this.cleanup()}finish(){this.state===In.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let t=this.buffer.length+this.offset;this.state===In.InCommentLike?this.currentSequence===w4.CdataEnd?this.cbs.oncdata(this.sectionStart,t,0):this.cbs.oncomment(this.sectionStart,t,0):this.state===In.InNumericEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===In.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===In.InTagName||this.state===In.BeforeAttributeName||this.state===In.BeforeAttributeValue||this.state===In.AfterAttributeName||this.state===In.InAttributeName||this.state===In.InAttributeValueSq||this.state===In.InAttributeValueDq||this.state===In.InAttributeValueNq||this.state===In.InClosingTagName||this.cbs.ontext(this.sectionStart,t)}emitPartial(t,n){this.baseState!==In.Text&&this.baseState!==In.InSpecialTag?this.cbs.onattribdata(t,n):this.cbs.ontext(t,n)}emitCodePoint(t){this.baseState!==In.Text&&this.baseState!==In.InSpecialTag?this.cbs.onattribentity(t):this.cbs.ontextentity(t)}};var P6e=new Set(["input","option","optgroup","select","button","datalist","textarea"]),rh=new Set(["p"]),TFa=new Set(["thead","tbody"]),IFa=new Set(["dd","dt"]),OFa=new Set(["rt","rp"]),oj0=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",rh],["h1",rh],["h2",rh],["h3",rh],["h4",rh],["h5",rh],["h6",rh],["select",P6e],["input",P6e],["output",P6e],["button",P6e],["datalist",P6e],["textarea",P6e],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",IFa],["dt",IFa],["address",rh],["article",rh],["aside",rh],["blockquote",rh],["details",rh],["div",rh],["dl",rh],["fieldset",rh],["figcaption",rh],["figure",rh],["footer",rh],["form",rh],["header",rh],["hr",rh],["main",rh],["nav",rh],["ol",rh],["pre",rh],["section",rh],["table",rh],["ul",rh],["rt",OFa],["rp",OFa],["tbody",TFa],["tfoot",TFa]]),sj0=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),RFa=new Set(["math","svg"]),MFa=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),aj0=/\s|\//,xPn=class{constructor(t,n={}){var i,o,s,a,u;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=t??{},this.lowerCaseTagNames=(i=n.lowerCaseTags)!==null&&i!==void 0?i:!n.xmlMode,this.lowerCaseAttributeNames=(o=n.lowerCaseAttributeNames)!==null&&o!==void 0?o:!n.xmlMode,this.tokenizer=new((s=n.Tokenizer)!==null&&s!==void 0?s:w6e)(this.options,this),(u=(a=this.cbs).onparserinit)===null||u===void 0||u.call(a,this)}ontext(t,n){var i,o;let s=this.getSlice(t,n);this.endIndex=n-1,(o=(i=this.cbs).ontext)===null||o===void 0||o.call(i,s),this.startIndex=n}ontextentity(t){var n,i;let o=this.tokenizer.getSectionStart();this.endIndex=o-1,(i=(n=this.cbs).ontext)===null||i===void 0||i.call(n,M6e(t)),this.startIndex=o}isVoidElement(t){return!this.options.xmlMode&&sj0.has(t)}onopentagname(t,n){this.endIndex=n;let i=this.getSlice(t,n);this.lowerCaseTagNames&&(i=i.toLowerCase()),this.emitOpenTag(i)}emitOpenTag(t){var n,i,o,s;this.openTagStart=this.startIndex,this.tagname=t;let a=!this.options.xmlMode&&oj0.get(t);if(a)for(;this.stack.length>0&&a.has(this.stack[this.stack.length-1]);){let u=this.stack.pop();(i=(n=this.cbs).onclosetag)===null||i===void 0||i.call(n,u,!0)}this.isVoidElement(t)||(this.stack.push(t),RFa.has(t)?this.foreignContext.push(!0):MFa.has(t)&&this.foreignContext.push(!1)),(s=(o=this.cbs).onopentagname)===null||s===void 0||s.call(o,t),this.cbs.onopentag&&(this.attribs={})}endOpenTag(t){var n,i;this.startIndex=this.openTagStart,this.attribs&&((i=(n=this.cbs).onopentag)===null||i===void 0||i.call(n,this.tagname,this.attribs,t),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(t){this.endIndex=t,this.endOpenTag(!1),this.startIndex=t+1}onclosetag(t,n){var i,o,s,a,u,l;this.endIndex=n;let c=this.getSlice(t,n);if(this.lowerCaseTagNames&&(c=c.toLowerCase()),(RFa.has(c)||MFa.has(c))&&this.foreignContext.pop(),this.isVoidElement(c))!this.options.xmlMode&&c==="br"&&((o=(i=this.cbs).onopentagname)===null||o===void 0||o.call(i,"br"),(a=(s=this.cbs).onopentag)===null||a===void 0||a.call(s,"br",{},!0),(l=(u=this.cbs).onclosetag)===null||l===void 0||l.call(u,"br",!1));else{let d=this.stack.lastIndexOf(c);if(d!==-1)if(this.cbs.onclosetag){let p=this.stack.length-d;for(;p--;)this.cbs.onclosetag(this.stack.pop(),p!==0)}else this.stack.length=d;else!this.options.xmlMode&&c==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(t){this.endIndex=t,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=t+1):this.onopentagend(t)}closeCurrentTag(t){var n,i;let o=this.tagname;this.endOpenTag(t),this.stack[this.stack.length-1]===o&&((i=(n=this.cbs).onclosetag)===null||i===void 0||i.call(n,o,!t),this.stack.pop())}onattribname(t,n){this.startIndex=t;let i=this.getSlice(t,n);this.attribname=this.lowerCaseAttributeNames?i.toLowerCase():i}onattribdata(t,n){this.attribvalue+=this.getSlice(t,n)}onattribentity(t){this.attribvalue+=M6e(t)}onattribend(t,n){var i,o;this.endIndex=n,(o=(i=this.cbs).onattribute)===null||o===void 0||o.call(i,this.attribname,this.attribvalue,t===Z7.Double?'"':t===Z7.Single?"'":t===Z7.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(t){let n=t.search(aj0),i=n<0?t:t.substr(0,n);return this.lowerCaseTagNames&&(i=i.toLowerCase()),i}ondeclaration(t,n){this.endIndex=n;let i=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){let o=this.getInstructionName(i);this.cbs.onprocessinginstruction(`!${o}`,`!${i}`)}this.startIndex=n+1}onprocessinginstruction(t,n){this.endIndex=n;let i=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){let o=this.getInstructionName(i);this.cbs.onprocessinginstruction(`?${o}`,`?${i}`)}this.startIndex=n+1}oncomment(t,n,i){var o,s,a,u;this.endIndex=n,(s=(o=this.cbs).oncomment)===null||s===void 0||s.call(o,this.getSlice(t,n-i)),(u=(a=this.cbs).oncommentend)===null||u===void 0||u.call(a),this.startIndex=n+1}oncdata(t,n,i){var o,s,a,u,l,c,d,p,f,A;this.endIndex=n;let g=this.getSlice(t,n-i);this.options.xmlMode||this.options.recognizeCDATA?((s=(o=this.cbs).oncdatastart)===null||s===void 0||s.call(o),(u=(a=this.cbs).ontext)===null||u===void 0||u.call(a,g),(c=(l=this.cbs).oncdataend)===null||c===void 0||c.call(l)):((p=(d=this.cbs).oncomment)===null||p===void 0||p.call(d,`[CDATA[${g}]]`),(A=(f=this.cbs).oncommentend)===null||A===void 0||A.call(f)),this.startIndex=n+1}onend(){var t,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let i=this.stack.length;i>0;this.cbs.onclosetag(this.stack[--i],!0));}(n=(t=this.cbs).onend)===null||n===void 0||n.call(t)}reset(){var t,n,i,o;(n=(t=this.cbs).onreset)===null||n===void 0||n.call(t),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(o=(i=this.cbs).onparserinit)===null||o===void 0||o.call(i,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(t){this.reset(),this.end(t)}getSlice(t,n){for(;t-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let i=this.buffers[0].slice(t-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),i+=this.buffers[0].slice(0,n-this.bufferOffset);return i}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(t){var n,i;if(this.ended){(i=(n=this.cbs).onerror)===null||i===void 0||i.call(n,new Error(".write() after done!"));return}this.buffers.push(t),this.tokenizer.running&&(this.tokenizer.write(t),this.writeIndex++)}end(t){var n,i;if(this.ended){(i=(n=this.cbs).onerror)===null||i===void 0||i.call(n,Error(".end() after done!"));return}t&&this.write(t),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(t){this.write(t)}done(t){this.end(t)}};function BPn(r){for(let t=1;t<r.length;t++)r[t][0]+=r[t-1][0]+1;return r}var uj0=new Map(BPn([[9,"	"],[0,"
"],[22,"!"],[0,"""],[0,"#"],[0,"$"],[0,"%"],[0,"&"],[0,"'"],[0,"("],[0,")"],[0,"*"],[0,"+"],[0,","],[1,"."],[0,"/"],[10,":"],[0,";"],[0,{v:"<",n:8402,o:"<⃒"}],[0,{v:"=",n:8421,o:"=⃥"}],[0,{v:">",n:8402,o:">⃒"}],[0,"?"],[0,"@"],[26,"["],[0,"\"],[0,"]"],[0,"^"],[0,"_"],[0,"`"],[5,{n:106,o:"fj"}],[20,"{"],[0,"|"],[0,"}"],[34," "],[0,"¡"],[0,"¢"],[0,"£"],[0,"¤"],[0,"¥"],[0,"¦"],[0,"§"],[0,"¨"],[0,"©"],[0,"ª"],[0,"«"],[0,"¬"],[0,"­"],[0,"®"],[0,"¯"],[0,"°"],[0,"±"],[0,"²"],[0,"³"],[0,"´"],[0,"µ"],[0,"¶"],[0,"·"],[0,"¸"],[0,"¹"],[0,"º"],[0,"»"],[0,"¼"],[0,"½"],[0,"¾"],[0,"¿"],[0,"À"],[0,"Á"],[0,"Â"],[0,"Ã"],[0,"Ä"],[0,"Å"],[0,"Æ"],[0,"Ç"],[0,"È"],[0,"É"],[0,"Ê"],[0,"Ë"],[0,"Ì"],[0,"Í"],[0,"Î"],[0,"Ï"],[0,"Ð"],[0,"Ñ"],[0,"Ò"],[0,"Ó"],[0,"Ô"],[0,"Õ"],[0,"Ö"],[0,"×"],[0,"Ø"],[0,"Ù"],[0,"Ú"],[0,"Û"],[0,"Ü"],[0,"Ý"],[0,"Þ"],[0,"ß"],[0,"à"],[0,"á"],[0,"â"],[0,"ã"],[0,"ä"],[0,"å"],[0,"æ"],[0,"ç"],[0,"è"],[0,"é"],[0,"ê"],[0,"ë"],[0,"ì"],[0,"í"],[0,"î"],[0,"ï"],[0,"ð"],[0,"ñ"],[0,"ò"],[0,"ó"],[0,"ô"],[0,"õ"],[0,"ö"],[0,"÷"],[0,"ø"],[0,"ù"],[0,"ú"],[0,"û"],[0,"ü"],[0,"ý"],[0,"þ"],[0,"ÿ"],[0,"Ā"],[0,"ā"],[0,"Ă"],[0,"ă"],[0,"Ą"],[0,"ą"],[0,"Ć"],[0,"ć"],[0,"Ĉ"],[0,"ĉ"],[0,"Ċ"],[0,"ċ"],[0,"Č"],[0,"č"],[0,"Ď"],[0,"ď"],[0,"Đ"],[0,"đ"],[0,"Ē"],[0,"ē"],[2,"Ė"],[0,"ė"],[0,"Ę"],[0,"ę"],[0,"Ě"],[0,"ě"],[0,"Ĝ"],[0,"ĝ"],[0,"Ğ"],[0,"ğ"],[0,"Ġ"],[0,"ġ"],[0,"Ģ"],[1,"Ĥ"],[0,"ĥ"],[0,"Ħ"],[0,"ħ"],[0,"Ĩ"],[0,"ĩ"],[0,"Ī"],[0,"ī"],[2,"Į"],[0,"į"],[0,"İ"],[0,"ı"],[0,"IJ"],[0,"ij"],[0,"Ĵ"],[0,"ĵ"],[0,"Ķ"],[0,"ķ"],[0,"ĸ"],[0,"Ĺ"],[0,"ĺ"],[0,"Ļ"],[0,"ļ"],[0,"Ľ"],[0,"ľ"],[0,"Ŀ"],[0,"ŀ"],[0,"Ł"],[0,"ł"],[0,"Ń"],[0,"ń"],[0,"Ņ"],[0,"ņ"],[0,"Ň"],[0,"ň"],[0,"ʼn"],[0,"Ŋ"],[0,"ŋ"],[0,"Ō"],[0,"ō"],[2,"Ő"],[0,"ő"],[0,"Œ"],[0,"œ"],[0,"Ŕ"],[0,"ŕ"],[0,"Ŗ"],[0,"ŗ"],[0,"Ř"],[0,"ř"],[0,"Ś"],[0,"ś"],[0,"Ŝ"],[0,"ŝ"],[0,"Ş"],[0,"ş"],[0,"Š"],[0,"š"],[0,"Ţ"],[0,"ţ"],[0,"Ť"],[0,"ť"],[0,"Ŧ"],[0,"ŧ"],[0,"Ũ"],[0,"ũ"],[0,"Ū"],[0,"ū"],[0,"Ŭ"],[0,"ŭ"],[0,"Ů"],[0,"ů"],[0,"Ű"],[0,"ű"],[0,"Ų"],[0,"ų"],[0,"Ŵ"],[0,"ŵ"],[0,"Ŷ"],[0,"ŷ"],[0,"Ÿ"],[0,"Ź"],[0,"ź"],[0,"Ż"],[0,"ż"],[0,"Ž"],[0,"ž"],[19,"ƒ"],[34,"Ƶ"],[63,"ǵ"],[65,"ȷ"],[142,"ˆ"],[0,"ˇ"],[16,"˘"],[0,"˙"],[0,"˚"],[0,"˛"],[0,"˜"],[0,"˝"],[51,"̑"],[127,"Α"],[0,"Β"],[0,"Γ"],[0,"Δ"],[0,"Ε"],[0,"Ζ"],[0,"Η"],[0,"Θ"],[0,"Ι"],[0,"Κ"],[0,"Λ"],[0,"Μ"],[0,"Ν"],[0,"Ξ"],[0,"Ο"],[0,"Π"],[0,"Ρ"],[1,"Σ"],[0,"Τ"],[0,"Υ"],[0,"Φ"],[0,"Χ"],[0,"Ψ"],[0,"Ω"],[7,"α"],[0,"β"],[0,"γ"],[0,"δ"],[0,"ε"],[0,"ζ"],[0,"η"],[0,"θ"],[0,"ι"],[0,"κ"],[0,"λ"],[0,"μ"],[0,"ν"],[0,"ξ"],[0,"ο"],[0,"π"],[0,"ρ"],[0,"ς"],[0,"σ"],[0,"τ"],[0,"υ"],[0,"φ"],[0,"χ"],[0,"ψ"],[0,"ω"],[7,"ϑ"],[0,"ϒ"],[2,"ϕ"],[0,"ϖ"],[5,"Ϝ"],[0,"ϝ"],[18,"ϰ"],[0,"ϱ"],[3,"ϵ"],[0,"϶"],[10,"Ё"],[0,"Ђ"],[0,"Ѓ"],[0,"Є"],[0,"Ѕ"],[0,"І"],[0,"Ї"],[0,"Ј"],[0,"Љ"],[0,"Њ"],[0,"Ћ"],[0,"Ќ"],[1,"Ў"],[0,"Џ"],[0,"А"],[0,"Б"],[0,"В"],[0,"Г"],[0,"Д"],[0,"Е"],[0,"Ж"],[0,"З"],[0,"И"],[0,"Й"],[0,"К"],[0,"Л"],[0,"М"],[0,"Н"],[0,"О"],[0,"П"],[0,"Р"],[0,"С"],[0,"Т"],[0,"У"],[0,"Ф"],[0,"Х"],[0,"Ц"],[0,"Ч"],[0,"Ш"],[0,"Щ"],[0,"Ъ"],[0,"Ы"],[0,"Ь"],[0,"Э"],[0,"Ю"],[0,"Я"],[0,"а"],[0,"б"],[0,"в"],[0,"г"],[0,"д"],[0,"е"],[0,"ж"],[0,"з"],[0,"и"],[0,"й"],[0,"к"],[0,"л"],[0,"м"],[0,"н"],[0,"о"],[0,"п"],[0,"р"],[0,"с"],[0,"т"],[0,"у"],[0,"ф"],[0,"х"],[0,"ц"],[0,"ч"],[0,"ш"],[0,"щ"],[0,"ъ"],[0,"ы"],[0,"ь"],[0,"э"],[0,"ю"],[0,"я"],[1,"ё"],[0,"ђ"],[0,"ѓ"],[0,"є"],[0,"ѕ"],[0,"і"],[0,"ї"],[0,"ј"],[0,"љ"],[0,"њ"],[0,"ћ"],[0,"ќ"],[1,"ў"],[0,"џ"],[7074," "],[0," "],[0," "],[0," "],[1," "],[0," "],[0," "],[0," "],[0,"​"],[0,"‌"],[0,"‍"],[0,"‎"],[0,"‏"],[0,"‐"],[2,"–"],[0,"—"],[0,"―"],[0,"‖"],[1,"‘"],[0,"’"],[0,"‚"],[1,"“"],[0,"”"],[0,"„"],[1,"†"],[0,"‡"],[0,"•"],[2,"‥"],[0,"…"],[9,"‰"],[0,"‱"],[0,"′"],[0,"″"],[0,"‴"],[0,"‵"],[3,"‹"],[0,"›"],[3,"‾"],[2,"⁁"],[1,"⁃"],[0,"⁄"],[10,"⁏"],[7,"⁗"],[7,{v:" ",n:8202,o:"  "}],[0,"⁠"],[0,"⁡"],[0,"⁢"],[0,"⁣"],[72,"€"],[46,"⃛"],[0,"⃜"],[37,"ℂ"],[2,"℅"],[4,"ℊ"],[0,"ℋ"],[0,"ℌ"],[0,"ℍ"],[0,"ℎ"],[0,"ℏ"],[0,"ℐ"],[0,"ℑ"],[0,"ℒ"],[0,"ℓ"],[1,"ℕ"],[0,"№"],[0,"℗"],[0,"℘"],[0,"ℙ"],[0,"ℚ"],[0,"ℛ"],[0,"ℜ"],[0,"ℝ"],[0,"℞"],[3,"™"],[1,"ℤ"],[2,"℧"],[0,"ℨ"],[0,"℩"],[2,"ℬ"],[0,"ℭ"],[1,"ℯ"],[0,"ℰ"],[0,"ℱ"],[1,"ℳ"],[0,"ℴ"],[0,"ℵ"],[0,"ℶ"],[0,"ℷ"],[0,"ℸ"],[12,"ⅅ"],[0,"ⅆ"],[0,"ⅇ"],[0,"ⅈ"],[10,"⅓"],[0,"⅔"],[0,"⅕"],[0,"⅖"],[0,"⅗"],[0,"⅘"],[0,"⅙"],[0,"⅚"],[0,"⅛"],[0,"⅜"],[0,"⅝"],[0,"⅞"],[49,"←"],[0,"↑"],[0,"→"],[0,"↓"],[0,"↔"],[0,"↕"],[0,"↖"],[0,"↗"],[0,"↘"],[0,"↙"],[0,"↚"],[0,"↛"],[1,{v:"↝",n:824,o:"↝̸"}],[0,"↞"],[0,"↟"],[0,"↠"],[0,"↡"],[0,"↢"],[0,"↣"],[0,"↤"],[0,"↥"],[0,"↦"],[0,"↧"],[1,"↩"],[0,"↪"],[0,"↫"],[0,"↬"],[0,"↭"],[0,"↮"],[1,"↰"],[0,"↱"],[0,"↲"],[0,"↳"],[1,"↵"],[0,"↶"],[0,"↷"],[2,"↺"],[0,"↻"],[0,"↼"],[0,"↽"],[0,"↾"],[0,"↿"],[0,"⇀"],[0,"⇁"],[0,"⇂"],[0,"⇃"],[0,"⇄"],[0,"⇅"],[0,"⇆"],[0,"⇇"],[0,"⇈"],[0,"⇉"],[0,"⇊"],[0,"⇋"],[0,"⇌"],[0,"⇍"],[0,"⇎"],[0,"⇏"],[0,"⇐"],[0,"⇑"],[0,"⇒"],[0,"⇓"],[0,"⇔"],[0,"⇕"],[0,"⇖"],[0,"⇗"],[0,"⇘"],[0,"⇙"],[0,"⇚"],[0,"⇛"],[1,"⇝"],[6,"⇤"],[0,"⇥"],[15,"⇵"],[7,"⇽"],[0,"⇾"],[0,"⇿"],[0,"∀"],[0,"∁"],[0,{v:"∂",n:824,o:"∂̸"}],[0,"∃"],[0,"∄"],[0,"∅"],[1,"∇"],[0,"∈"],[0,"∉"],[1,"∋"],[0,"∌"],[2,"∏"],[0,"∐"],[0,"∑"],[0,"−"],[0,"∓"],[0,"∔"],[1,"∖"],[0,"∗"],[0,"∘"],[1,"√"],[2,"∝"],[0,"∞"],[0,"∟"],[0,{v:"∠",n:8402,o:"∠⃒"}],[0,"∡"],[0,"∢"],[0,"∣"],[0,"∤"],[0,"∥"],[0,"∦"],[0,"∧"],[0,"∨"],[0,{v:"∩",n:65024,o:"∩︀"}],[0,{v:"∪",n:65024,o:"∪︀"}],[0,"∫"],[0,"∬"],[0,"∭"],[0,"∮"],[0,"∯"],[0,"∰"],[0,"∱"],[0,"∲"],[0,"∳"],[0,"∴"],[0,"∵"],[0,"∶"],[0,"∷"],[0,"∸"],[1,"∺"],[0,"∻"],[0,{v:"∼",n:8402,o:"∼⃒"}],[0,{v:"∽",n:817,o:"∽̱"}],[0,{v:"∾",n:819,o:"∾̳"}],[0,"∿"],[0,"≀"],[0,"≁"],[0,{v:"≂",n:824,o:"≂̸"}],[0,"≃"],[0,"≄"],[0,"≅"],[0,"≆"],[0,"≇"],[0,"≈"],[0,"≉"],[0,"≊"],[0,{v:"≋",n:824,o:"≋̸"}],[0,"≌"],[0,{v:"≍",n:8402,o:"≍⃒"}],[0,{v:"≎",n:824,o:"≎̸"}],[0,{v:"≏",n:824,o:"≏̸"}],[0,{v:"≐",n:824,o:"≐̸"}],[0,"≑"],[0,"≒"],[0,"≓"],[0,"≔"],[0,"≕"],[0,"≖"],[0,"≗"],[1,"≙"],[0,"≚"],[1,"≜"],[2,"≟"],[0,"≠"],[0,{v:"≡",n:8421,o:"≡⃥"}],[0,"≢"],[1,{v:"≤",n:8402,o:"≤⃒"}],[0,{v:"≥",n:8402,o:"≥⃒"}],[0,{v:"≦",n:824,o:"≦̸"}],[0,{v:"≧",n:824,o:"≧̸"}],[0,{v:"≨",n:65024,o:"≨︀"}],[0,{v:"≩",n:65024,o:"≩︀"}],[0,{v:"≪",n:new Map(BPn([[824,"≪̸"],[7577,"≪⃒"]]))}],[0,{v:"≫",n:new Map(BPn([[824,"≫̸"],[7577,"≫⃒"]]))}],[0,"≬"],[0,"≭"],[0,"≮"],[0,"≯"],[0,"≰"],[0,"≱"],[0,"≲"],[0,"≳"],[0,"≴"],[0,"≵"],[0,"≶"],[0,"≷"],[0,"≸"],[0,"≹"],[0,"≺"],[0,"≻"],[0,"≼"],[0,"≽"],[0,"≾"],[0,{v:"≿",n:824,o:"≿̸"}],[0,"⊀"],[0,"⊁"],[0,{v:"⊂",n:8402,o:"⊂⃒"}],[0,{v:"⊃",n:8402,o:"⊃⃒"}],[0,"⊄"],[0,"⊅"],[0,"⊆"],[0,"⊇"],[0,"⊈"],[0,"⊉"],[0,{v:"⊊",n:65024,o:"⊊︀"}],[0,{v:"⊋",n:65024,o:"⊋︀"}],[1,"⊍"],[0,"⊎"],[0,{v:"⊏",n:824,o:"⊏̸"}],[0,{v:"⊐",n:824,o:"⊐̸"}],[0,"⊑"],[0,"⊒"],[0,{v:"⊓",n:65024,o:"⊓︀"}],[0,{v:"⊔",n:65024,o:"⊔︀"}],[0,"⊕"],[0,"⊖"],[0,"⊗"],[0,"⊘"],[0,"⊙"],[0,"⊚"],[0,"⊛"],[1,"⊝"],[0,"⊞"],[0,"⊟"],[0,"⊠"],[0,"⊡"],[0,"⊢"],[0,"⊣"],[0,"⊤"],[0,"⊥"],[1,"⊧"],[0,"⊨"],[0,"⊩"],[0,"⊪"],[0,"⊫"],[0,"⊬"],[0,"⊭"],[0,"⊮"],[0,"⊯"],[0,"⊰"],[1,"⊲"],[0,"⊳"],[0,{v:"⊴",n:8402,o:"⊴⃒"}],[0,{v:"⊵",n:8402,o:"⊵⃒"}],[0,"⊶"],[0,"⊷"],[0,"⊸"],[0,"⊹"],[0,"⊺"],[0,"⊻"],[1,"⊽"],[0,"⊾"],[0,"⊿"],[0,"⋀"],[0,"⋁"],[0,"⋂"],[0,"⋃"],[0,"⋄"],[0,"⋅"],[0,"⋆"],[0,"⋇"],[0,"⋈"],[0,"⋉"],[0,"⋊"],[0,"⋋"],[0,"⋌"],[0,"⋍"],[0,"⋎"],[0,"⋏"],[0,"⋐"],[0,"⋑"],[0,"⋒"],[0,"⋓"],[0,"⋔"],[0,"⋕"],[0,"⋖"],[0,"⋗"],[0,{v:"⋘",n:824,o:"⋘̸"}],[0,{v:"⋙",n:824,o:"⋙̸"}],[0,{v:"⋚",n:65024,o:"⋚︀"}],[0,{v:"⋛",n:65024,o:"⋛︀"}],[2,"⋞"],[0,"⋟"],[0,"⋠"],[0,"⋡"],[0,"⋢"],[0,"⋣"],[2,"⋦"],[0,"⋧"],[0,"⋨"],[0,"⋩"],[0,"⋪"],[0,"⋫"],[0,"⋬"],[0,"⋭"],[0,"⋮"],[0,"⋯"],[0,"⋰"],[0,"⋱"],[0,"⋲"],[0,"⋳"],[0,"⋴"],[0,{v:"⋵",n:824,o:"⋵̸"}],[0,"⋶"],[0,"⋷"],[1,{v:"⋹",n:824,o:"⋹̸"}],[0,"⋺"],[0,"⋻"],[0,"⋼"],[0,"⋽"],[0,"⋾"],[6,"⌅"],[0,"⌆"],[1,"⌈"],[0,"⌉"],[0,"⌊"],[0,"⌋"],[0,"⌌"],[0,"⌍"],[0,"⌎"],[0,"⌏"],[0,"⌐"],[1,"⌒"],[0,"⌓"],[1,"⌕"],[0,"⌖"],[5,"⌜"],[0,"⌝"],[0,"⌞"],[0,"⌟"],[2,"⌢"],[0,"⌣"],[9,"⌭"],[0,"⌮"],[7,"⌶"],[6,"⌽"],[1,"⌿"],[60,"⍼"],[51,"⎰"],[0,"⎱"],[2,"⎴"],[0,"⎵"],[0,"⎶"],[37,"⏜"],[0,"⏝"],[0,"⏞"],[0,"⏟"],[2,"⏢"],[4,"⏧"],[59,"␣"],[164,"Ⓢ"],[55,"─"],[1,"│"],[9,"┌"],[3,"┐"],[3,"└"],[3,"┘"],[3,"├"],[7,"┤"],[7,"┬"],[7,"┴"],[7,"┼"],[19,"═"],[0,"║"],[0,"╒"],[0,"╓"],[0,"╔"],[0,"╕"],[0,"╖"],[0,"╗"],[0,"╘"],[0,"╙"],[0,"╚"],[0,"╛"],[0,"╜"],[0,"╝"],[0,"╞"],[0,"╟"],[0,"╠"],[0,"╡"],[0,"╢"],[0,"╣"],[0,"╤"],[0,"╥"],[0,"╦"],[0,"╧"],[0,"╨"],[0,"╩"],[0,"╪"],[0,"╫"],[0,"╬"],[19,"▀"],[3,"▄"],[3,"█"],[8,"░"],[0,"▒"],[0,"▓"],[13,"□"],[8,"▪"],[0,"▫"],[1,"▭"],[0,"▮"],[2,"▱"],[1,"△"],[0,"▴"],[0,"▵"],[2,"▸"],[0,"▹"],[3,"▽"],[0,"▾"],[0,"▿"],[2,"◂"],[0,"◃"],[6,"◊"],[0,"○"],[32,"◬"],[2,"◯"],[8,"◸"],[0,"◹"],[0,"◺"],[0,"◻"],[0,"◼"],[8,"★"],[0,"☆"],[7,"☎"],[49,"♀"],[1,"♂"],[29,"♠"],[2,"♣"],[1,"♥"],[0,"♦"],[3,"♪"],[2,"♭"],[0,"♮"],[0,"♯"],[163,"✓"],[3,"✗"],[8,"✠"],[21,"✶"],[33,"❘"],[25,"❲"],[0,"❳"],[84,"⟈"],[0,"⟉"],[28,"⟦"],[0,"⟧"],[0,"⟨"],[0,"⟩"],[0,"⟪"],[0,"⟫"],[0,"⟬"],[0,"⟭"],[7,"⟵"],[0,"⟶"],[0,"⟷"],[0,"⟸"],[0,"⟹"],[0,"⟺"],[1,"⟼"],[2,"⟿"],[258,"⤂"],[0,"⤃"],[0,"⤄"],[0,"⤅"],[6,"⤌"],[0,"⤍"],[0,"⤎"],[0,"⤏"],[0,"⤐"],[0,"⤑"],[0,"⤒"],[0,"⤓"],[2,"⤖"],[2,"⤙"],[0,"⤚"],[0,"⤛"],[0,"⤜"],[0,"⤝"],[0,"⤞"],[0,"⤟"],[0,"⤠"],[2,"⤣"],[0,"⤤"],[0,"⤥"],[0,"⤦"],[0,"⤧"],[0,"⤨"],[0,"⤩"],[0,"⤪"],[8,{v:"⤳",n:824,o:"⤳̸"}],[1,"⤵"],[0,"⤶"],[0,"⤷"],[0,"⤸"],[0,"⤹"],[2,"⤼"],[0,"⤽"],[7,"⥅"],[2,"⥈"],[0,"⥉"],[0,"⥊"],[0,"⥋"],[2,"⥎"],[0,"⥏"],[0,"⥐"],[0,"⥑"],[0,"⥒"],[0,"⥓"],[0,"⥔"],[0,"⥕"],[0,"⥖"],[0,"⥗"],[0,"⥘"],[0,"⥙"],[0,"⥚"],[0,"⥛"],[0,"⥜"],[0,"⥝"],[0,"⥞"],[0,"⥟"],[0,"⥠"],[0,"⥡"],[0,"⥢"],[0,"⥣"],[0,"⥤"],[0,"⥥"],[0,"⥦"],[0,"⥧"],[0,"⥨"],[0,"⥩"],[0,"⥪"],[0,"⥫"],[0,"⥬"],[0,"⥭"],[0,"⥮"],[0,"⥯"],[0,"⥰"],[0,"⥱"],[0,"⥲"],[0,"⥳"],[0,"⥴"],[0,"⥵"],[0,"⥶"],[1,"⥸"],[0,"⥹"],[1,"⥻"],[0,"⥼"],[0,"⥽"],[0,"⥾"],[0,"⥿"],[5,"⦅"],[0,"⦆"],[4,"⦋"],[0,"⦌"],[0,"⦍"],[0,"⦎"],[0,"⦏"],[0,"⦐"],[0,"⦑"],[0,"⦒"],[0,"⦓"],[0,"⦔"],[0,"⦕"],[0,"⦖"],[3,"⦚"],[1,"⦜"],[0,"⦝"],[6,"⦤"],[0,"⦥"],[0,"⦦"],[0,"⦧"],[0,"⦨"],[0,"⦩"],[0,"⦪"],[0,"⦫"],[0,"⦬"],[0,"⦭"],[0,"⦮"],[0,"⦯"],[0,"⦰"],[0,"⦱"],[0,"⦲"],[0,"⦳"],[0,"⦴"],[0,"⦵"],[0,"⦶"],[0,"⦷"],[1,"⦹"],[1,"⦻"],[0,"⦼"],[1,"⦾"],[0,"⦿"],[0,"⧀"],[0,"⧁"],[0,"⧂"],[0,"⧃"],[0,"⧄"],[0,"⧅"],[3,"⧉"],[3,"⧍"],[0,"⧎"],[0,{v:"⧏",n:824,o:"⧏̸"}],[0,{v:"⧐",n:824,o:"⧐̸"}],[11,"⧜"],[0,"⧝"],[0,"⧞"],[4,"⧣"],[0,"⧤"],[0,"⧥"],[5,"⧫"],[8,"⧴"],[1,"⧶"],[9,"⨀"],[0,"⨁"],[0,"⨂"],[1,"⨄"],[1,"⨆"],[5,"⨌"],[0,"⨍"],[2,"⨐"],[0,"⨑"],[0,"⨒"],[0,"⨓"],[0,"⨔"],[0,"⨕"],[0,"⨖"],[0,"⨗"],[10,"⨢"],[0,"⨣"],[0,"⨤"],[0,"⨥"],[0,"⨦"],[0,"⨧"],[1,"⨩"],[0,"⨪"],[2,"⨭"],[0,"⨮"],[0,"⨯"],[0,"⨰"],[0,"⨱"],[1,"⨳"],[0,"⨴"],[0,"⨵"],[0,"⨶"],[0,"⨷"],[0,"⨸"],[0,"⨹"],[0,"⨺"],[0,"⨻"],[0,"⨼"],[2,"⨿"],[0,"⩀"],[1,"⩂"],[0,"⩃"],[0,"⩄"],[0,"⩅"],[0,"⩆"],[0,"⩇"],[0,"⩈"],[0,"⩉"],[0,"⩊"],[0,"⩋"],[0,"⩌"],[0,"⩍"],[2,"⩐"],[2,"⩓"],[0,"⩔"],[0,"⩕"],[0,"⩖"],[0,"⩗"],[0,"⩘"],[1,"⩚"],[0,"⩛"],[0,"⩜"],[0,"⩝"],[1,"⩟"],[6,"⩦"],[3,"⩪"],[2,{v:"⩭",n:824,o:"⩭̸"}],[0,"⩮"],[0,"⩯"],[0,{v:"⩰",n:824,o:"⩰̸"}],[0,"⩱"],[0,"⩲"],[0,"⩳"],[0,"⩴"],[0,"⩵"],[1,"⩷"],[0,"⩸"],[0,"⩹"],[0,"⩺"],[0,"⩻"],[0,"⩼"],[0,{v:"⩽",n:824,o:"⩽̸"}],[0,{v:"⩾",n:824,o:"⩾̸"}],[0,"⩿"],[0,"⪀"],[0,"⪁"],[0,"⪂"],[0,"⪃"],[0,"⪄"],[0,"⪅"],[0,"⪆"],[0,"⪇"],[0,"⪈"],[0,"⪉"],[0,"⪊"],[0,"⪋"],[0,"⪌"],[0,"⪍"],[0,"⪎"],[0,"⪏"],[0,"⪐"],[0,"⪑"],[0,"⪒"],[0,"⪓"],[0,"⪔"],[0,"⪕"],[0,"⪖"],[0,"⪗"],[0,"⪘"],[0,"⪙"],[0,"⪚"],[2,"⪝"],[0,"⪞"],[0,"⪟"],[0,"⪠"],[0,{v:"⪡",n:824,o:"⪡̸"}],[0,{v:"⪢",n:824,o:"⪢̸"}],[1,"⪤"],[0,"⪥"],[0,"⪦"],[0,"⪧"],[0,"⪨"],[0,"⪩"],[0,"⪪"],[0,"⪫"],[0,{v:"⪬",n:65024,o:"⪬︀"}],[0,{v:"⪭",n:65024,o:"⪭︀"}],[0,"⪮"],[0,{v:"⪯",n:824,o:"⪯̸"}],[0,{v:"⪰",n:824,o:"⪰̸"}],[2,"⪳"],[0,"⪴"],[0,"⪵"],[0,"⪶"],[0,"⪷"],[0,"⪸"],[0,"⪹"],[0,"⪺"],[0,"⪻"],[0,"⪼"],[0,"⪽"],[0,"⪾"],[0,"⪿"],[0,"⫀"],[0,"⫁"],[0,"⫂"],[0,"⫃"],[0,"⫄"],[0,{v:"⫅",n:824,o:"⫅̸"}],[0,{v:"⫆",n:824,o:"⫆̸"}],[0,"⫇"],[0,"⫈"],[2,{v:"⫋",n:65024,o:"⫋︀"}],[0,{v:"⫌",n:65024,o:"⫌︀"}],[2,"⫏"],[0,"⫐"],[0,"⫑"],[0,"⫒"],[0,"⫓"],[0,"⫔"],[0,"⫕"],[0,"⫖"],[0,"⫗"],[0,"⫘"],[0,"⫙"],[0,"⫚"],[0,"⫛"],[8,"⫤"],[1,"⫦"],[0,"⫧"],[0,"⫨"],[0,"⫩"],[1,"⫫"],[0,"⫬"],[0,"⫭"],[0,"⫮"],[0,"⫯"],[0,"⫰"],[0,"⫱"],[0,"⫲"],[0,"⫳"],[9,{v:"⫽",n:8421,o:"⫽⃥"}],[44343,{n:new Map(BPn([[56476,"𝒜"],[1,"𝒞"],[0,"𝒟"],[2,"𝒢"],[2,"𝒥"],[0,"𝒦"],[2,"𝒩"],[0,"𝒪"],[0,"𝒫"],[0,"𝒬"],[1,"𝒮"],[0,"𝒯"],[0,"𝒰"],[0,"𝒱"],[0,"𝒲"],[0,"𝒳"],[0,"𝒴"],[0,"𝒵"],[0,"𝒶"],[0,"𝒷"],[0,"𝒸"],[0,"𝒹"],[1,"𝒻"],[1,"𝒽"],[0,"𝒾"],[0,"𝒿"],[0,"𝓀"],[0,"𝓁"],[0,"𝓂"],[0,"𝓃"],[1,"𝓅"],[0,"𝓆"],[0,"𝓇"],[0,"𝓈"],[0,"𝓉"],[0,"𝓊"],[0,"𝓋"],[0,"𝓌"],[0,"𝓍"],[0,"𝓎"],[0,"𝓏"],[52,"𝔄"],[0,"𝔅"],[1,"𝔇"],[0,"𝔈"],[0,"𝔉"],[0,"𝔊"],[2,"𝔍"],[0,"𝔎"],[0,"𝔏"],[0,"𝔐"],[0,"𝔑"],[0,"𝔒"],[0,"𝔓"],[0,"𝔔"],[1,"𝔖"],[0,"𝔗"],[0,"𝔘"],[0,"𝔙"],[0,"𝔚"],[0,"𝔛"],[0,"𝔜"],[1,"𝔞"],[0,"𝔟"],[0,"𝔠"],[0,"𝔡"],[0,"𝔢"],[0,"𝔣"],[0,"𝔤"],[0,"𝔥"],[0,"𝔦"],[0,"𝔧"],[0,"𝔨"],[0,"𝔩"],[0,"𝔪"],[0,"𝔫"],[0,"𝔬"],[0,"𝔭"],[0,"𝔮"],[0,"𝔯"],[0,"𝔰"],[0,"𝔱"],[0,"𝔲"],[0,"𝔳"],[0,"𝔴"],[0,"𝔵"],[0,"𝔶"],[0,"𝔷"],[0,"𝔸"],[0,"𝔹"],[1,"𝔻"],[0,"𝔼"],[0,"𝔽"],[0,"𝔾"],[1,"𝕀"],[0,"𝕁"],[0,"𝕂"],[0,"𝕃"],[0,"𝕄"],[1,"𝕆"],[3,"𝕊"],[0,"𝕋"],[0,"𝕌"],[0,"𝕍"],[0,"𝕎"],[0,"𝕏"],[0,"𝕐"],[1,"𝕒"],[0,"𝕓"],[0,"𝕔"],[0,"𝕕"],[0,"𝕖"],[0,"𝕗"],[0,"𝕘"],[0,"𝕙"],[0,"𝕚"],[0,"𝕛"],[0,"𝕜"],[0,"𝕝"],[0,"𝕞"],[0,"𝕟"],[0,"𝕠"],[0,"𝕡"],[0,"𝕢"],[0,"𝕣"],[0,"𝕤"],[0,"𝕥"],[0,"𝕦"],[0,"𝕧"],[0,"𝕨"],[0,"𝕩"],[0,"𝕪"],[0,"𝕫"]]))}],[8906,"ff"],[0,"fi"],[0,"fl"],[0,"ffi"],[0,"ffl"]]));var oko=/["&'<>$\x80-\uFFFF]/g,wFa=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),PFa=String.prototype.codePointAt!=null?(r,t)=>r.codePointAt(t):(r,t)=>(r.charCodeAt(t)&64512)===55296?(r.charCodeAt(t)-55296)*1024+r.charCodeAt(t+1)-56320+65536:r.charCodeAt(t);function Odt(r){let t="",n=0,i;for(;(i=oko.exec(r))!==null;){let o=i.index,s=r.charCodeAt(o),a=wFa.get(s);a!==void 0?(t+=r.substring(n,o)+a,n=o+1):(t+=`${r.substring(n,o)}&#x${PFa(r,o).toString(16)};`,n=oko.lastIndex+=+((s&64512)===55296))}return t+r.substr(n)}function sko(r,t){return function(i){let o,s=0,a="";for(;o=r.exec(i);)s!==o.index&&(a+=i.substring(s,o.index)),a+=t.get(o[0].charCodeAt(0)),s=o.index+1;return a+i.substring(s)}}var NFa=sko(/[&<>'"]/g,wFa),kPn=sko(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),LPn=sko(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var DFa;(function(r){r[r.XML=0]="XML",r[r.HTML=1]="HTML"})(DFa||(DFa={}));var xFa;(function(r){r[r.UTF8=0]="UTF8",r[r.ASCII=1]="ASCII",r[r.Extensive=2]="Extensive",r[r.Attribute=3]="Attribute",r[r.Text=4]="Text"})(xFa||(xFa={}));var LFa=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(r=>[r.toLowerCase(),r])),qFa=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(r=>[r.toLowerCase(),r]));var lj0=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function dj0(r){return r.replace(/"/g,""")}function pj0(r,t){var n;if(!r)return;let i=((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)===!1?dj0:t.xmlMode||t.encodeEntities!=="utf8"?Odt:kPn;return Object.keys(r).map(o=>{var s,a;let u=(s=r[o])!==null&&s!==void 0?s:"";return t.xmlMode==="foreign"&&(o=(a=qFa.get(o))!==null&&a!==void 0?a:o),!t.emptyAttrs&&!t.xmlMode&&u===""?o:`${o}="${i(u)}"`}).join(" ")}var zFa=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function Rdt(r,t={}){let n="length"in r?r:[r],i="";for(let o=0;o<n.length;o++)i+=fj0(n[o],t);return i}function fj0(r,t){switch(r.type){case jza:return Rdt(r.children,t);case $za:case Hza:return mj0(r);case Wza:return Ej0(r);case Jza:return bj0(r);case Vza:case Kza:case Yza:return gj0(r,t);case Gza:return yj0(r,t)}}var Aj0=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),hj0=new Set(["svg","math"]);function gj0(r,t){var n;t.xmlMode==="foreign"&&(r.name=(n=LFa.get(r.name))!==null&&n!==void 0?n:r.name,r.parent&&Aj0.has(r.parent.name)&&(t={...t,xmlMode:!1})),!t.xmlMode&&hj0.has(r.name)&&(t={...t,xmlMode:"foreign"});let i=`<${r.name}`,o=pj0(r.attribs,t);return o&&(i+=` ${o}`),r.children.length===0&&(t.xmlMode?t.selfClosingTags!==!1:t.selfClosingTags&&zFa.has(r.name))?(t.xmlMode||(i+=" "),i+="/>"):(i+=">",r.children.length>0&&(i+=Rdt(r.children,t)),(t.xmlMode||!zFa.has(r.name))&&(i+=`</${r.name}>`)),i}function mj0(r){return`<${r.data}>`}function yj0(r,t){var n;let i=r.data||"";return((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)!==!1&&!(!t.xmlMode&&r.parent&&lj0.has(r.parent.name))&&(i=t.xmlMode||t.encodeEntities!=="utf8"?Odt(i):LPn(i)),i}function bj0(r){return`<![CDATA[${r.children[0].data}]]>`}function Ej0(r){return`<!--${r.data}-->`}var FFa;(function(r){r[r.DISCONNECTED=1]="DISCONNECTED",r[r.PRECEDING=2]="PRECEDING",r[r.FOLLOWING=4]="FOLLOWING",r[r.CONTAINS=8]="CONTAINS",r[r.CONTAINED_BY=16]="CONTAINED_BY"})(FFa||(FFa={}));function QFa(r,t){let n=new vPn(void 0,t);return new xPn(n,t).end(r),n.root}var hko=_t(HFa(),1);function gko(r,t,n=()=>{}){if(r===void 0){let i=function(...o){return t(i,...o)};return i}return r>=0?function(...i){return t(gko(r-1,t,n),...i)}:n}function JFa(r,t){let n=0,i=r.length;for(;n<i&&r[n]===t;)++n;for(;i>n&&r[i-1]===t;)--i;return n>0||i<r.length?r.substring(n,i):r}function Bj0(r,t){let n=r.length;for(;n>0&&r[n-1]===t;)--n;return n<r.length?r.substring(0,n):r}function kj0(r){return r.replace(/[\s\S]/g,t=>"\\u"+t.charCodeAt().toString(16).padStart(4,"0"))}function $Fa(r,t){let n=new Map;for(let i=r.length;i-- >0;){let o=r[i],s=t(o);n.set(s,n.has(s)?(0,hko.default)(o,n.get(s),{arrayMerge:Lj0}):o)}return[...n.values()].reverse()}var Lj0=(r,t,n)=>[...t];function D6e(r,t){for(let n of t){if(!r)return;r=r[n]}return r}function WFa(r,t="a",n=26){let i=[];do r-=1,i.push(r%n),r=r/n>>0;while(r>0);let o=t.charCodeAt(0);return i.reverse().map(s=>String.fromCharCode(o+s)).join("")}var cko=["I","X","C","M"],VFa=["V","L","D"];function KFa(r){return[...r+""].map(t=>+t).reverse().map((t,n)=>t%5<4?(t<5?"":VFa[n])+cko[n].repeat(t%5):cko[n]+(t<5?VFa[n]:cko[n+1])).reverse().join("")}var FPn=class{constructor(t,n=void 0){this.lines=[],this.nextLineWords=[],this.maxLineLength=n||t.wordwrap||Number.MAX_VALUE,this.nextLineAvailableChars=this.maxLineLength,this.wrapCharacters=D6e(t,["longWordSplit","wrapCharacters"])||[],this.forceWrapOnLimit=D6e(t,["longWordSplit","forceWrapOnLimit"])||!1,this.stashedSpace=!1,this.wordBreakOpportunity=!1}pushWord(t,n=!1){this.nextLineAvailableChars<=0&&!n&&this.startNewLine();let i=this.nextLineWords.length===0,o=t.length+(i?0:1);if(o<=this.nextLineAvailableChars||n)this.nextLineWords.push(t),this.nextLineAvailableChars-=o;else{let[s,...a]=this.splitLongWord(t);i||this.startNewLine(),this.nextLineWords.push(s),this.nextLineAvailableChars-=s.length;for(let u of a)this.startNewLine(),this.nextLineWords.push(u),this.nextLineAvailableChars-=u.length}}popWord(){let t=this.nextLineWords.pop();if(t!==void 0){let n=this.nextLineWords.length===0,i=t.length+(n?0:1);this.nextLineAvailableChars+=i}return t}concatWord(t,n=!1){if(this.wordBreakOpportunity&&t.length>this.nextLineAvailableChars)this.pushWord(t,n),this.wordBreakOpportunity=!1;else{let i=this.popWord();this.pushWord(i?i.concat(t):t,n)}}startNewLine(t=1){this.lines.push(this.nextLineWords),t>1&&this.lines.push(...Array.from({length:t-1},()=>[])),this.nextLineWords=[],this.nextLineAvailableChars=this.maxLineLength}isEmpty(){return this.lines.length===0&&this.nextLineWords.length===0}clear(){this.lines.length=0,this.nextLineWords.length=0,this.nextLineAvailableChars=this.maxLineLength}toString(){return[...this.lines,this.nextLineWords].map(t=>t.join(" ")).join(`
|
|
@@ -10367,7 +10367,7 @@ The delete attempt failed with this message:
|
|
|
10367
10367
|
`,r.UPLOAD_MISMATCH=`The uploaded data did not match the data from the server.
|
|
10368
10368
|
As a precaution, the file has been deleted.
|
|
10369
10369
|
To be sure the content is the same, you should try uploading the file again.`,r.MD5_RESUMED_UPLOAD="MD5 cannot be used with a continued resumable upload as MD5 cannot be extended from an existing value",r.MISSING_RESUME_CRC32C_FINAL_UPLOAD="The CRC32C is missing for the final portion of a resumed upload, which is required for validation. Please provide `resumeCRC32C` if validation is required, or disable `validation`."})(JI||(JI={}));var QZ=class r extends rx{constructor(t,n,i={}){var o,s;let a={},u;i.generation!==null&&(typeof i.generation=="string"?u=Number(i.generation):u=i.generation,isNaN(u)||(a.generation=u)),Object.assign(a,i.preconditionOpts);let l=i.userProject||t.userProject;typeof l=="string"&&(a.userProject=l);let c={delete:{reqOpts:{qs:a}},exists:{reqOpts:{qs:a}},get:{reqOpts:{qs:a}},getMetadata:{reqOpts:{qs:a}},setMetadata:{reqOpts:{qs:a}}};if(super({parent:t,baseUrl:"/o",id:encodeURIComponent(n),methods:c}),Z0a.add(this),this.bucket=t,this.storage=t.parent,i.generation!==null){let d;typeof i.generation=="string"?d=Number(i.generation):d=i.generation,isNaN(d)||(this.generation=d)}this.kmsKeyName=i.kmsKeyName,this.userProject=l,this.name=n,i.encryptionKey&&this.setEncryptionKey(i.encryptionKey),this.acl=new SEe({request:this.request.bind(this),pathPrefix:"/acl"}),this.crc32cGenerator=i.crc32cGenerator||this.bucket.crc32cGenerator,this.instanceRetryValue=(s=(o=this.storage)===null||o===void 0?void 0:o.retryOptions)===null||s===void 0?void 0:s.autoRetry,this.instancePreconditionOpts=i?.preconditionOpts}get cloudStorageURI(){let t=this.bucket.cloudStorageURI;return t.pathname=this.name,t}shouldRetryBasedOnPreconditionAndIdempotencyStrat(t){var n;return!(t?.ifGenerationMatch===void 0&&((n=this.instancePreconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)}copy(t,n,i){var o,s;let a=new Error(JI.DESTINATION_NO_NAME);if(!t)throw a;let u={};typeof n=="function"?i=n:n&&(u={...n}),i=i||jp.noop;let l,c,d;if(typeof t=="string"){let A=hBm.exec(t);A!==null&&A.length===3?(l=this.storage.bucket(A[1]),c=A[2]):(l=this.bucket,c=t)}else if(t instanceof UZ)l=t,c=this.name;else if(t instanceof r)l=t.bucket,c=t.name,d=t;else throw a;let p={};this.generation!==void 0&&(p.sourceGeneration=this.generation),u.token!==void 0&&(p.rewriteToken=u.token),u.userProject!==void 0&&(p.userProject=u.userProject,delete u.userProject),u.predefinedAcl!==void 0&&(p.destinationPredefinedAcl=u.predefinedAcl,delete u.predefinedAcl),d=d||l.file(c);let f={};if(this.encryptionKey!==void 0&&(f["x-goog-copy-source-encryption-algorithm"]="AES256",f["x-goog-copy-source-encryption-key"]=this.encryptionKeyBase64,f["x-goog-copy-source-encryption-key-sha256"]=this.encryptionKeyHash),d.encryptionKey!==void 0?this.setEncryptionKey(d.encryptionKey):u.destinationKmsKeyName!==void 0?(p.destinationKmsKeyName=u.destinationKmsKeyName,delete u.destinationKmsKeyName):d.kmsKeyName!==void 0&&(p.destinationKmsKeyName=d.kmsKeyName),p.destinationKmsKeyName){this.kmsKeyName=p.destinationKmsKeyName;let A=this.interceptors.indexOf(this.encryptionKeyInterceptor);A>-1&&this.interceptors.splice(A,1)}this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(u?.preconditionOpts)||(this.storage.retryOptions.autoRetry=!1),((o=u.preconditionOpts)===null||o===void 0?void 0:o.ifGenerationMatch)!==void 0&&(p.ifGenerationMatch=(s=u.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch,delete u.preconditionOpts),this.request({method:"POST",uri:`/rewriteTo/b/${l.name}/o/${encodeURIComponent(d.name)}`,qs:p,json:u,headers:f},(A,g)=>{if(this.storage.retryOptions.autoRetry=this.instanceRetryValue,A){i(A,null,g);return}if(g.rewriteToken){let b={token:g.rewriteToken};p.userProject&&(b.userProject=p.userProject),p.destinationKmsKeyName&&(b.destinationKmsKeyName=p.destinationKmsKeyName),this.copy(d,b,i);return}i(null,d,g)})}createReadStream(t={}){t=Object.assign({decompress:!0},t);let n=typeof t.start=="number"||typeof t.end=="number",i=t.end<0,o,s,a=new pxt,u=!0,l=!1;if(typeof t.validation=="string"){let A=t.validation.toLowerCase().trim();u=A==="crc32c",l=A==="md5"}else t.validation===!1&&(u=!1);let c=!n&&(u||l);if(n){if(typeof t.validation=="string"||t.validation===!0)throw new Error(JI.INVALID_VALIDATION_FILE_RANGE);u=!1,l=!1}let d=A=>{A&&(s?.agent&&s.agent.destroy(),a.destroy(A))},p=(A,g,b)=>{if(A){this.getBufferFromReadable(b).then(P=>{A.message=P.toString("utf8"),a.destroy(A)});return}s=b.request;let _=b.toJSON().headers,v=_["content-encoding"]==="gzip",O={},R=_["x-goog-stored-content-encoding"]==="gzip"&&v||_["x-goog-stored-content-encoding"]==="identity",w=[];if(c&&(typeof _["x-goog-hash"]=="string"&&_["x-goog-hash"].split(",").forEach(P=>{let z=P.indexOf("="),j=P.substring(0,z),U=P.substring(z+1);O[j]=U}),o=new mxt({crc32c:u,md5:l,crc32cGenerator:this.crc32cGenerator,crc32cExpected:O.crc32c,md5Expected:O.md5})),l&&!O.md5){let P=new FNe(JI.MD5_NOT_AVAILABLE);P.code="MD5_NOT_AVAILABLE",a.destroy(P);return}R&&c&&o&&w.push(o),v&&t.decompress&&w.push(KMi.createGunzip()),(0,zot.pipeline)(b,...w,a,d)},f=()=>{let A={alt:"media"};this.generation&&(A.generation=this.generation),t.userProject&&(A.userProject=t.userProject);let g={"Accept-Encoding":"gzip","Cache-Control":"no-store"};if(n){let _=typeof t.start=="number"?t.start:"0",v=typeof t.end=="number"?t.end:"";g.Range=`bytes=${i?v:`${_}-${v}`}`}let b={uri:"",headers:g,qs:A};t[jv]&&(b[jv]=t[jv]),this.requestStream(b).on("error",_=>{a.destroy(_)}).on("response",_=>{a.emit("response",_),jp.handleResp(null,_,null,p)}).resume()};return a.on("reading",f),a}createResumableUpload(t,n){var i,o;let s=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let a=this.storage.retryOptions;(((i=s?.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&((o=this.instancePreconditionOpts)===null||o===void 0?void 0:o.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(a.autoRetry=!1),rAd({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((u,l)=>l(u),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:s.metadata,offset:s.offset,origin:s.origin,predefinedAcl:s.predefinedAcl,private:s.private,public:s.public,userProject:s.userProject||this.userProject,retryOptions:a,params:s?.preconditionOpts||this.instancePreconditionOpts,universeDomain:this.bucket.storage.universeDomain,[jv]:s[jv]},n),this.storage.retryOptions.autoRetry=this.instanceRetryValue}createWriteStream(t={}){var n;if((n=t.metadata)!==null&&n!==void 0||(t.metadata={}),t.contentType&&(t.metadata.contentType=t.contentType),!t.metadata.contentType||t.metadata.contentType==="auto"){let A=hAd.default.getType(this.name);A&&(t.metadata.contentType=A)}let i=t.gzip;i==="auto"&&(i=(0,fAd.default)(t.metadata.contentType||"")),i&&(t.metadata.contentEncoding="gzip");let o=!0,s=!1;if(typeof t.validation=="string"?(t.validation=t.validation.toLowerCase(),o=t.validation==="crc32c",s=t.validation==="md5"):t.validation===!1&&(o=!1,s=!1),t.offset){if(s)throw new RangeError(JI.MD5_RESUMED_UPLOAD);if(o&&!t.isPartialUpload&&!t.resumeCRC32C)throw new RangeError(JI.MISSING_RESUME_CRC32C_FINAL_UPLOAD)}let a=A=>{u.destroy(A||void 0)},u=new zot.Writable({final(A){a=A,c.end()},write(A,g,b){c.write(A,g,b)}}),l=[];i&&l.push(KMi.createGzip());let c=new pxt,d=null;if(o||s){let A=t.resumeCRC32C?vEe.from(t.resumeCRC32C):void 0;d=new mxt({crc32c:o,crc32cInstance:A,md5:s,crc32cGenerator:this.crc32cGenerator,updateHashesOnly:!0}),l.push(d)}let p=(0,gAd.default)(),f=!1;return c.on("reading",()=>u.emit("reading")),c.on("writing",()=>u.emit("writing")),p.on("uri",A=>u.emit("uri",A)),p.on("progress",A=>u.emit("progress",A)),p.on("response",A=>u.emit("response",A)),p.once("metadata",()=>{f=!0}),u.once("writing",()=>{t.resumable===!1?this.startSimpleUpload_(p,t):this.startResumableUpload_(p,t),(0,zot.pipeline)(c,...l,p,async A=>{if(A)return a(A);if(!f)try{await new Promise((g,b)=>{p.once("metadata",g),p.once("error",b)})}catch(g){return a(g)}d?.crc32c&&u.emit("crc32c",d.crc32c);try{let g=t.isPartialUpload&&!this.metadata;d&&!g&&await ABm(this,Z0a,"m",dAd).call(this,d,{crc32c:o,md5:s}),a()}catch(g){a(g)}})}),u}delete(t,n){let i=typeof t=="object"?t:{};n=typeof t=="function"?t:n,this.disableAutoRetryConditionallyIdempotent_(this.methods.delete,zU.delete,i),super.delete(i).then(o=>n(null,...o)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}download(t,n){let i;typeof t=="function"?(n=t,i={}):i=t;let o=!1,s=(...c)=>{o||n(...c),o=!0},a=i.destination;delete i.destination;let u=this.createReadStream(i),l=!1;a?u.on("error",s).once("data",c=>{l=!0;let d=VMi.createWriteStream(a);d.write(c),u.pipe(d).on("error",s).on("finish",s)}).on("end",()=>{if(!l){let c=Buffer.alloc(0);try{VMi.writeFileSync(a,c),s(null,c)}catch(d){s(d,c)}}}):this.getBufferFromReadable(u).then(c=>s?.(null,c)).catch(s)}setEncryptionKey(t){return this.encryptionKey=t,this.encryptionKeyBase64=Buffer.from(t).toString("base64"),this.encryptionKeyHash=AAd.createHash("sha256").update(this.encryptionKeyBase64,"base64").digest("base64"),this.encryptionKeyInterceptor={request:n=>(n.headers=n.headers||{},n.headers["x-goog-encryption-algorithm"]="AES256",n.headers["x-goog-encryption-key"]=this.encryptionKeyBase64,n.headers["x-goog-encryption-key-sha256"]=this.encryptionKeyHash,n)},this.interceptors.push(this.encryptionKeyInterceptor),this}getExpirationDate(t){this.getMetadata((n,i,o)=>{if(n){t(n,null,o);return}if(!i.retentionExpirationTime){let s=new Error(JI.EXPIRATION_TIME_NA);t(s,null,o);return}t(null,new Date(i.retentionExpirationTime),o)})}generateSignedPostPolicyV2(t,n){let i=Xq(t,n),o=i.options,s=i.callback,a=new Date(o.expires);if(isNaN(a.getTime()))throw new Error(FZ.EXPIRATION_DATE_INVALID);if(a.valueOf()<Date.now())throw new Error(FZ.EXPIRATION_DATE_PAST);o=Object.assign({},o);let u=[["eq","$key",this.name],{bucket:this.bucket.name}];if(Array.isArray(o.equals)&&(Array.isArray(o.equals[0])||(o.equals=[o.equals]),o.equals.forEach(p=>{if(!Array.isArray(p)||p.length!==2)throw new Error(JI.EQUALS_CONDITION_TWO_ELEMENTS);u.push(["eq",p[0],p[1]])})),Array.isArray(o.startsWith)&&(Array.isArray(o.startsWith[0])||(o.startsWith=[o.startsWith]),o.startsWith.forEach(p=>{if(!Array.isArray(p)||p.length!==2)throw new Error(JI.STARTS_WITH_TWO_ELEMENTS);u.push(["starts-with",p[0],p[1]])})),o.acl&&u.push({acl:o.acl}),o.successRedirect&&u.push({success_action_redirect:o.successRedirect}),o.successStatus&&u.push({success_action_status:o.successStatus}),o.contentLengthRange){let p=o.contentLengthRange.min,f=o.contentLengthRange.max;if(typeof p!="number"||typeof f!="number")throw new Error(JI.CONTENT_LENGTH_RANGE_MIN_MAX);u.push(["content-length-range",p,f])}let l={expiration:a.toISOString(),conditions:u},c=JSON.stringify(l),d=Buffer.from(c).toString("base64");this.storage.authClient.sign(d,o.signingEndpoint).then(p=>{s(null,{string:c,base64:d,signature:p})},p=>{s(new zNe(p.message))})}generateSignedPostPolicyV4(t,n){let i=Xq(t,n),o=i.options,s=i.callback,a=new Date(o.expires);if(isNaN(a.getTime()))throw new Error(FZ.EXPIRATION_DATE_INVALID);if(a.valueOf()<Date.now())throw new Error(FZ.EXPIRATION_DATE_PAST);if(a.valueOf()-Date.now()>lAd*1e3)throw new Error(`Max allowed expiration is seven days (${lAd} seconds).`);o=Object.assign({},o);let u=Object.assign({},o.fields),l=new Date,c=kNe(l,!0),d=kNe(l);(async()=>{let{client_email:f}=await this.storage.authClient.getCredentials(),A=`${f}/${d}/auto/storage/goog4_request`;u={...u,bucket:this.bucket.name,key:this.name,"x-goog-date":c,"x-goog-credential":A,"x-goog-algorithm":"GOOG4-RSA-SHA256"};let g=o.conditions||[];Object.entries(u).forEach(([R,w])=>{R.startsWith("x-ignore-")||g.push({[R]:w})}),delete u.bucket;let b=kNe(a,!0,"-",":"),v=Ufd({conditions:g,expiration:b}),O=Buffer.from(v).toString("base64");try{let R=await this.storage.authClient.sign(O,o.signingEndpoint),w=Buffer.from(R,"base64").toString("hex"),P=this.parent.storage.universeDomain;u.policy=O,u["x-goog-signature"]=w;let z;return this.storage.customEndpoint?z=this.storage.apiEndpoint:o.virtualHostedStyle?z=`https://${this.bucket.name}.storage.${P}/`:o.bucketBoundHostname?z=`${o.bucketBoundHostname}/`:z=`https://storage.${P}/${this.bucket.name}/`,{url:z,fields:u}}catch(R){throw new zNe(R.message)}})().then(f=>s(null,f),s)}getSignedUrl(t,n){let i=efa[t.action],o=Qfd(t.extensionHeaders||{});t.action==="resumable"&&(o["x-goog-resumable"]="start");let s=Object.assign({},t.queryParams);typeof t.responseType=="string"&&(s["response-content-type"]=t.responseType),typeof t.promptSaveAs=="string"&&(s["response-content-disposition"]='attachment; filename="'+t.promptSaveAs+'"'),typeof t.responseDisposition=="string"&&(s["response-content-disposition"]=t.responseDisposition),this.generation&&(s.generation=this.generation.toString());let a={method:i,expires:t.expires,accessibleAt:t.accessibleAt,extensionHeaders:o,queryParams:s,contentMd5:t.contentMd5,contentType:t.contentType,host:t.host};t.cname&&(a.cname=t.cname),t.version&&(a.version=t.version),t.virtualHostedStyle&&(a.virtualHostedStyle=t.virtualHostedStyle),this.signer||(this.signer=new qot(this.storage.authClient,this.bucket,this,this.storage)),this.signer.getSignedUrl(a).then(u=>n(null,u),n)}isPublic(t){var n;let i=((n=this.storage)===null||n===void 0?void 0:n.interceptors)||[],o=this.interceptors||[],a=i.concat(o).reduce((u,l)=>{let c=l.request({uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`});return Object.assign(u,c.headers),u},{});jp.makeRequest({method:"GET",uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`,headers:a},{retryOptions:this.storage.retryOptions},u=>{u?u.code===403?t(null,!1):t(u):t(null,!0)})}makePrivate(t,n){var i,o;let s=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let a={predefinedAcl:s.strict?"private":"projectPrivate"};((i=s.preconditionOpts)===null||i===void 0?void 0:i.ifMetagenerationMatch)!==void 0&&(a.ifMetagenerationMatch=(o=s.preconditionOpts)===null||o===void 0?void 0:o.ifMetagenerationMatch,delete s.preconditionOpts),s.userProject&&(a.userProject=s.userProject);let u={...s.metadata,acl:null};this.setMetadata(u,a,n)}makePublic(t){t=t||jp.noop,this.acl.add({entity:"allUsers",role:"READER"},(n,i,o)=>{t(n,o)})}publicUrl(){return`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`}move(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,i=i||jp.noop,this.copy(t,o,(s,a,u)=>{if(s){s.message="file#copy failed with an error - "+s.message,i(s,null,u);return}this.name!==a.name||this.bucket.name!==a.bucket.name?this.delete(o,(l,c)=>{if(l){l.message="file#delete failed with an error - "+l.message,i(l,a,c);return}i(null,a,u)}):i(null,a,u)})}rename(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,i=i||jp.noop,this.move(t,o,i)}request(t,n){return this.parent.request.call(this,t,n)}rotateEncryptionKey(t,n){var i;n=typeof t=="function"?t:n;let o={};typeof t=="string"||t instanceof Buffer?o={encryptionKey:t}:typeof t=="object"&&(o=t);let s=this.bucket.file(this.id,o),a=((i=o.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)!==void 0?{preconditionOpts:o.preconditionOpts}:{};this.copy(s,a,n)}save(t,n,i){i=typeof n=="function"?n:i;let o=typeof n=="object"?n:{},s=this.storage.retryOptions.maxRetries;this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(o?.preconditionOpts)||(s=0);let a=(0,mAd.default)(async u=>new Promise((l,c)=>{s===0&&(this.storage.retryOptions.autoRetry=!1);let d=this.createWriteStream(o);o.onUploadProgress&&d.on("progress",o.onUploadProgress);let p=f=>this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(f)?c(f):u(f);typeof t=="string"||Buffer.isBuffer(t)?d.on("error",p).on("finish",()=>l()).end(t):(0,zot.pipeline)(t,d,f=>{if(f){if(typeof t!="function")return u(f);p(f)}else l()})}),{retries:s,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});return i?a.then(()=>{if(i)return i()}).catch(i):a}setMetadata(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,zU.setMetadata,o),super.setMetadata(t,o).then(s=>i(null,...s)).catch(i).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setStorageClass(t,n,i){i=typeof n=="function"?n:i;let s={...typeof n=="object"?n:{},storageClass:t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(a,u,l)=>u+"_"+l).toUpperCase()};this.copy(this,s,(a,u,l)=>{if(a){i(a,l);return}this.metadata=u.metadata,i(null,l)})}setUserProject(t){this.bucket.setUserProject.call(this,t)}startResumableUpload_(t,n={}){var i;(i=n.metadata)!==null&&i!==void 0||(n.metadata={});let o=this.storage.retryOptions;this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(n.preconditionOpts)||(o.autoRetry=!1);let s=tAd({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((a,u)=>u(a),{}),file:this.name,generation:this.generation,isPartialUpload:n.isPartialUpload,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:n.metadata,offset:n.offset,predefinedAcl:n.predefinedAcl,private:n.private,public:n.public,uri:n.uri,userProject:n.userProject||this.userProject,retryOptions:{...o},params:n?.preconditionOpts||this.instancePreconditionOpts,chunkSize:n?.chunkSize,highWaterMark:n?.highWaterMark,universeDomain:this.bucket.storage.universeDomain,[jv]:n[jv]});s.on("response",a=>{t.emit("response",a)}).on("uri",a=>{t.emit("uri",a)}).on("metadata",a=>{this.metadata=a,t.emit("metadata")}).on("finish",()=>{t.emit("complete")}).on("progress",a=>t.emit("progress",a)),t.setWritable(s),this.storage.retryOptions.autoRetry=this.instanceRetryValue}startSimpleUpload_(t,n={}){var i;(i=n.metadata)!==null&&i!==void 0||(n.metadata={});let o=this.storage.apiEndpoint,s=this.bucket.name,a=`${o}/upload/storage/v1/b/${s}/o`,u={qs:{name:this.name},uri:a,[jv]:n[jv]};this.generation!==void 0&&(u.qs.ifGenerationMatch=this.generation),this.kmsKeyName!==void 0&&(u.qs.kmsKeyName=this.kmsKeyName),typeof n.timeout=="number"&&(u.timeout=n.timeout),(n.userProject||this.userProject)&&(u.qs.userProject=n.userProject||this.userProject),n.predefinedAcl?u.qs.predefinedAcl=n.predefinedAcl:n.private?u.qs.predefinedAcl="private":n.public&&(u.qs.predefinedAcl="publicRead"),Object.assign(u.qs,this.instancePreconditionOpts,n.preconditionOpts),jp.makeWritableStream(t,{makeAuthenticatedRequest:l=>{this.request(l,(c,d,p)=>{if(c){t.destroy(c);return}this.metadata=d,t.emit("metadata",d),t.emit("response",p),t.emit("complete")})},metadata:n.metadata,request:u})}disableAutoRetryConditionallyIdempotent_(t,n,i){var o,s,a,u;(typeof t=="object"&&((s=(o=t?.reqOpts)===null||o===void 0?void 0:o.qs)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&i?.ifGenerationMatch===void 0&&n===zU.delete&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(this.storage.retryOptions.autoRetry=!1),(typeof t=="object"&&((u=(a=t?.reqOpts)===null||a===void 0?void 0:a.qs)===null||u===void 0?void 0:u.ifMetagenerationMatch)===void 0&&i?.ifMetagenerationMatch===void 0&&n===zU.setMetadata&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(this.storage.retryOptions.autoRetry=!1)}async getBufferFromReadable(t){let n=[];for await(let i of t)n.push(i);return Buffer.concat(n)}};Z0a=new WeakSet,dAd=async function(t,n={}){let i=this.metadata,o=!!(n.crc32c||n.md5);if(n.crc32c&&i.crc32c&&(o=!t.test("crc32c",i.crc32c)),n.md5&&i.md5Hash&&(o=!t.test("md5",i.md5Hash)),o){let s=[],a="",u="";try{await this.delete(),n.md5&&!i.md5Hash?(a="MD5_NOT_AVAILABLE",u=JI.MD5_NOT_AVAILABLE):(a="FILE_NO_UPLOAD",u=JI.UPLOAD_MISMATCH)}catch(c){let d=c;a="FILE_NO_UPLOAD_DELETE",u=`${JI.UPLOAD_MISMATCH_DELETE_FAIL}${d.message}`,s.push(d)}let l=new FNe(u);throw l.code=a,l.errors=s,l}return!0};(0,pAd.promisifyAll)(QZ,{exclude:["cloudStorageURI","publicUrl","request","save","setEncryptionKey","shouldRetryBasedOnPreconditionAndIdempotencyStrat","getBufferFromReadable"]});var yAd=_t(Xg(),1);var YMi;(function(r){r.POLICY_OBJECT_REQUIRED="A policy object is required.",r.PERMISSIONS_REQUIRED="Permissions are required."})(YMi||(YMi={}));var Fot=class{constructor(t){this.request_=t.request.bind(t),this.resourceId_="buckets/"+t.getId()}getPolicy(t,n){let{options:i,callback:o}=Xq(t,n),s={};i.userProject&&(s.userProject=i.userProject),i.requestedPolicyVersion!==null&&i.requestedPolicyVersion!==void 0&&(s.optionsRequestedPolicyVersion=i.requestedPolicyVersion),this.request_({uri:"/iam",qs:s},o)}setPolicy(t,n,i){if(t===null||typeof t!="object")throw new Error(YMi.POLICY_OBJECT_REQUIRED);let{options:o,callback:s}=Xq(n,i),a;t.etag===void 0&&(a=0),this.request_({method:"PUT",uri:"/iam",maxRetries:a,json:Object.assign({resourceId:this.resourceId_},t),qs:o},s)}testPermissions(t,n,i){if(!Array.isArray(t)&&typeof t!="string")throw new Error(YMi.PERMISSIONS_REQUIRED);let{options:o,callback:s}=Xq(n,i),a=Array.isArray(t)?t:[t],u=Object.assign({permissions:a},o);this.request_({uri:"/iam/testPermissions",qs:u,useQuerystring:!0},(l,c)=>{if(l){s(l,null,c);return}let d=Array.isArray(c.permissions)?c.permissions:[],p=a.reduce((f,A)=>(f[A]=d.indexOf(A)>-1,f),{});s(null,p,c)})}};(0,yAd.promisifyAll)(Fot);var bAd=_t(Xg(),1),Qot=class extends rx{constructor(t,n){let i={},o={create:!0,delete:{reqOpts:{qs:i}},get:{reqOpts:{qs:i}},getMetadata:{reqOpts:{qs:i}},exists:!0};super({parent:t,baseUrl:"/notificationConfigs",id:n.toString(),createMethod:t.createNotification.bind(t),methods:o})}};(0,bAd.promisifyAll)(Qot);var TAd=require("stream"),IAd=require("url"),nfa;(function(r){r.list="GET"})(nfa||(nfa={}));var zU;(function(r){r[r.setMetadata=0]="setMetadata",r[r.delete=1]="delete"})(zU||(zU={}));var jZ;(function(r){r.PROVIDE_SOURCE_FILE="You must provide at least one source file.",r.DESTINATION_FILE_NOT_SPECIFIED="A destination file must be specified.",r.CHANNEL_ID_REQUIRED="An ID is required to create a channel.",r.TOPIC_NAME_REQUIRED="A valid topic name is required.",r.CONFIGURATION_OBJECT_PREFIX_REQUIRED="A configuration object with a prefix is required.",r.SPECIFY_FILE_NAME="A file name must be specified.",r.METAGENERATION_NOT_PROVIDED="A metageneration must be provided.",r.SUPPLY_NOTIFICATION_ID="You must supply a notification ID."})(jZ||(jZ={}));var UZ=class r extends rx{getFilesStream(t){return new TAd.Readable}constructor(t,n,i){var o,s,a,u;i=i||{},n=n.replace(/^gs:\/\//,"").replace(/\/+$/,"");let l={};!((o=i?.preconditionOpts)===null||o===void 0)&&o.ifGenerationMatch&&(l.ifGenerationMatch=i.preconditionOpts.ifGenerationMatch),!((s=i?.preconditionOpts)===null||s===void 0)&&s.ifGenerationNotMatch&&(l.ifGenerationNotMatch=i.preconditionOpts.ifGenerationNotMatch),!((a=i?.preconditionOpts)===null||a===void 0)&&a.ifMetagenerationMatch&&(l.ifMetagenerationMatch=i.preconditionOpts.ifMetagenerationMatch),!((u=i?.preconditionOpts)===null||u===void 0)&&u.ifMetagenerationNotMatch&&(l.ifMetagenerationNotMatch=i.preconditionOpts.ifMetagenerationNotMatch);let c=i.userProject;typeof c=="string"&&(l.userProject=c);let d={create:{reqOpts:{qs:l}},delete:{reqOpts:{qs:l}},exists:{reqOpts:{qs:l}},get:{reqOpts:{qs:l}},getMetadata:{reqOpts:{qs:l}},setMetadata:{reqOpts:{qs:l}}};super({parent:t,baseUrl:"/b",id:n,createMethod:t.createBucket.bind(t),methods:d}),this.name=n,this.storage=t,this.userProject=i.userProject,this.acl=new SEe({request:this.request.bind(this),pathPrefix:"/acl"}),this.acl.default=new SEe({request:this.request.bind(this),pathPrefix:"/defaultObjectAcl"}),this.crc32cGenerator=i.crc32cGenerator||this.storage.crc32cGenerator,this.iam=new Fot(this),this.getFilesStream=ifa.paginator.streamify("getFiles"),this.instanceRetryValue=t.retryOptions.autoRetry,this.instancePreconditionOpts=i?.preconditionOpts}get cloudStorageURI(){let t=new IAd.URL("gs://");return t.host=this.name,t}addLifecycleRule(t,n,i){let o={};typeof n=="function"?i=n:n&&(o=n),o=o||{};let s=Array.isArray(t)?t:[t];for(let a of s)a.condition.createdBefore instanceof Date&&(a.condition.createdBefore=a.condition.createdBefore.toISOString().replace(/T.+$/,"")),a.condition.customTimeBefore instanceof Date&&(a.condition.customTimeBefore=a.condition.customTimeBefore.toISOString().replace(/T.+$/,"")),a.condition.noncurrentTimeBefore instanceof Date&&(a.condition.noncurrentTimeBefore=a.condition.noncurrentTimeBefore.toISOString().replace(/T.+$/,""));if(o.append===!1){this.setMetadata({lifecycle:{rule:s}},o,i);return}this.getMetadata((a,u)=>{var l,c;if(a){i(a);return}let d=Array.isArray((l=u.lifecycle)===null||l===void 0?void 0:l.rule)?(c=u.lifecycle)===null||c===void 0?void 0:c.rule:[];this.setMetadata({lifecycle:{rule:d.concat(s)}},o,i)})}combine(t,n,i,o){var s;if(!Array.isArray(t)||t.length===0)throw new Error(jZ.PROVIDE_SOURCE_FILE);if(!n)throw new Error(jZ.DESTINATION_FILE_NOT_SPECIFIED);let a={};typeof i=="function"?o=i:i&&(a=i),this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,zU.setMetadata,a);let u=d=>d instanceof QZ?d:this.file(d);t=t.map(u);let l=u(n);if(o=o||jp.noop,!l.metadata.contentType){let d=SAd.contentType(l.name);d&&(l.metadata.contentType=d)}let c=this.storage.retryOptions.maxRetries;(((s=l?.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&a.ifGenerationMatch===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(c=0),a.ifGenerationMatch===void 0&&Object.assign(a,l.instancePreconditionOpts,a),l.request({method:"POST",uri:"/compose",maxRetries:c,json:{destination:{contentType:l.metadata.contentType},sourceObjects:t.map(d=>{let p={name:d.name};return d.metadata&&d.metadata.generation&&(p.generation=parseInt(d.metadata.generation.toString())),p})},qs:a},(d,p)=>{if(this.storage.retryOptions.autoRetry=this.instanceRetryValue,d){o(d,null,p);return}o(null,l,p)})}createChannel(t,n,i,o){if(typeof t!="string")throw new Error(jZ.CHANNEL_ID_REQUIRED);let s={};typeof i=="function"?o=i:i&&(s=i),this.request({method:"POST",uri:"/o/watch",json:Object.assign({id:t,type:"web_hook"},n),qs:s},(a,u)=>{if(a){o(a,null,u);return}let l=u.resourceId,c=this.storage.channel(t,l);c.metadata=u,o(null,c,u)})}createNotification(t,n,i){let o={};if(typeof n=="function"?i=n:n&&(o=n),t!==null&&typeof t=="object"&&jp.isCustomType(t,"pubsub/topic")&&(t=t.name),typeof t!="string")throw new Error(jZ.TOPIC_NAME_REQUIRED);let a=Object.assign({topic:t},o);a.topic.indexOf("projects")!==0&&(a.topic="projects/{{projectId}}/topics/"+a.topic),a.topic=`//pubsub.${this.storage.universeDomain}/`+a.topic,a.payloadFormat||(a.payloadFormat="JSON_API_V1");let u={};a.userProject&&(u.userProject=a.userProject,delete a.userProject),this.request({method:"POST",uri:"/notificationConfigs",json:LMi(a),qs:u,maxRetries:0},(l,c)=>{if(l){i(l,null,c);return}let d=this.notification(c.id);d.metadata=c,i(null,d,c)})}deleteFiles(t,n){let i={};typeof t=="function"?n=t:t&&(i=t);let o=10,s=1e3,a=[],u=l=>l.delete(i).catch(c=>{if(!i.force)throw c;a.push(c)});(async()=>{try{let l=[],c=(0,tfa.default)(o),d=this.getFilesStream(i);for await(let p of d)l.length>=s&&(await Promise.all(l),l=[]),l.push(c(()=>u(p)).catch(f=>{throw d.destroy(),f}));await Promise.all(l),n(a.length>0?a:null)}catch(l){n(l);return}})()}deleteLabels(t,n,i){let o=new Array,s={};typeof t=="function"?i=t:typeof t=="string"?o=[t]:Array.isArray(t)?o=t:t&&(s=t),typeof n=="function"?i=n:n&&(s=n);let a=u=>{let l=u.reduce((c,d)=>(c[d]=null,c),{});s?.ifMetagenerationMatch!==void 0?this.setLabels(l,s,i):this.setLabels(l,i)};o.length===0?this.getLabels((u,l)=>{if(u){i(u);return}a(Object.keys(l))}):a(o)}disableRequesterPays(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.setMetadata({billing:{requesterPays:!1}},i,n)}enableLogging(t,n){if(!t||typeof t=="function"||typeof t.prefix>"u")throw new Error(jZ.CONFIGURATION_OBJECT_PREFIX_REQUIRED);let i=this.id;t.bucket&&t.bucket instanceof r?i=t.bucket.id:t.bucket&&typeof t.bucket=="string"&&(i=t.bucket);let o={};t?.ifMetagenerationMatch&&(o.ifMetagenerationMatch=t.ifMetagenerationMatch),t?.ifMetagenerationNotMatch&&(o.ifMetagenerationNotMatch=t.ifMetagenerationNotMatch),(async()=>{try{let[s]=await this.iam.getPolicy();s.bindings.push({members:["group:cloud-storage-analytics@google.com"],role:"roles/storage.objectCreator"}),await this.iam.setPolicy(s),this.setMetadata({logging:{logBucket:i,logObjectPrefix:t.prefix}},o,n)}catch(s){n(s);return}})()}enableRequesterPays(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.setMetadata({billing:{requesterPays:!0}},i,n)}file(t,n){if(!t)throw Error(jZ.SPECIFY_FILE_NAME);return new QZ(this,t,n)}getFiles(t,n){let i=typeof t=="object"?t:{};n||(n=t),i=Object.assign({},i),this.request({uri:"/o",qs:i},(o,s)=>{if(o){n(o,null,null,s);return}let u=(s.items?s.items:[]).map(c=>{let d={};i.versions&&(d.generation=c.generation),c.kmsKeyName&&(d.kmsKeyName=c.kmsKeyName);let p=this.file(c.name,d);return p.metadata=c,p}),l=null;s.nextPageToken&&(l=Object.assign({},i,{pageToken:s.nextPageToken})),n(null,u,l,s)})}getLabels(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.getMetadata(i,(o,s)=>{if(o){n(o,null);return}n(null,s?.labels||{})})}getNotifications(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.request({uri:"/notificationConfigs",qs:i},(o,s)=>{if(o){n(o,null,s);return}let u=(s.items?s.items:[]).map(l=>{let c=this.notification(l.id);return c.metadata=l,c});n(null,u,s)})}getSignedUrl(t,n){let o={method:nfa[t.action],expires:t.expires,version:t.version,cname:t.cname,extensionHeaders:t.extensionHeaders||{},queryParams:t.queryParams||{},host:t.host,signingEndpoint:t.signingEndpoint};this.signer||(this.signer=new qot(this.storage.authClient,this,void 0,this.storage)),this.signer.getSignedUrl(o).then(s=>n(null,s),n)}lock(t,n){let i=typeof t;if(i!=="number"&&i!=="string")throw new Error(jZ.METAGENERATION_NOT_PROVIDED);this.request({method:"POST",uri:"/lockRetentionPolicy",qs:{ifMetagenerationMatch:t}},n)}makePrivate(t,n){var i,o,s,a;let u=typeof t=="object"?t:{};n=typeof t=="function"?t:n,u.private=!0;let l={predefinedAcl:"projectPrivate"};u.userProject&&(l.userProject=u.userProject),!((i=u.preconditionOpts)===null||i===void 0)&&i.ifGenerationMatch&&(l.ifGenerationMatch=u.preconditionOpts.ifGenerationMatch),!((o=u.preconditionOpts)===null||o===void 0)&&o.ifGenerationNotMatch&&(l.ifGenerationNotMatch=u.preconditionOpts.ifGenerationNotMatch),!((s=u.preconditionOpts)===null||s===void 0)&&s.ifMetagenerationMatch&&(l.ifMetagenerationMatch=u.preconditionOpts.ifMetagenerationMatch),!((a=u.preconditionOpts)===null||a===void 0)&&a.ifMetagenerationNotMatch&&(l.ifMetagenerationNotMatch=u.preconditionOpts.ifMetagenerationNotMatch);let c={...u.metadata,acl:null};this.setMetadata(c,l,d=>{d&&n(d),(u.includeFiles?(0,rfa.promisify)(this.makeAllFilesPublicPrivate_).call(this,u):Promise.resolve([])).then(f=>n(null,f)).catch(n)})}makePublic(t,n){let i=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let o={public:!0,...i};this.acl.add({entity:"allUsers",role:"READER"}).then(()=>this.acl.default.add({entity:"allUsers",role:"READER"})).then(()=>o.includeFiles?(0,rfa.promisify)(this.makeAllFilesPublicPrivate_).call(this,o):[]).then(s=>n(null,s),n)}notification(t){if(!t)throw new Error(jZ.SUPPLY_NOTIFICATION_ID);return new Qot(this,t)}removeRetentionPeriod(t,n){let i=typeof t=="object"?t:{};n=typeof t=="function"?t:n,this.setMetadata({retentionPolicy:null},i,n)}request(t,n){return this.userProject&&(!t.qs||!t.qs.userProject)&&(t.qs={...t.qs,userProject:this.userProject}),super.request(t,n)}setLabels(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,i=i||jp.noop,this.setMetadata({labels:t},o,i)}setMetadata(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,zU.setMetadata,o),super.setMetadata(t,o).then(s=>i(null,...s)).catch(i).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setRetentionPeriod(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.setMetadata({retentionPolicy:{retentionPeriod:t.toString()}},o,i)}setCorsConfiguration(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.setMetadata({cors:t},o,i)}setStorageClass(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,t=t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(s,a,u)=>a+"_"+u).toUpperCase(),this.setMetadata({storageClass:t},o,i)}setUserProject(t){this.userProject=t,["create","delete","exists","get","getMetadata","setMetadata"].forEach(i=>{let o=this.methods[i];typeof o=="object"&&(typeof o.reqOpts=="object"?Object.assign(o.reqOpts.qs,{userProject:t}):o.reqOpts={qs:{userProject:t}})})}upload(t,n,i){var o,s;let a=d=>{let p=(0,vAd.default)(async f=>{await new Promise((A,g)=>{var b,_;d===0&&(!((_=(b=c?.storage)===null||b===void 0?void 0:b.retryOptions)===null||_===void 0)&&_.autoRetry)&&(c.storage.retryOptions.autoRetry=!1);let v=c.createWriteStream(u);u.onUploadProgress&&v.on("progress",u.onUploadProgress),CAd.createReadStream(t).on("error",f).pipe(v).on("error",O=>this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(O)?g(O):f(O)).on("finish",()=>A())})},{retries:d,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});return i?p.then(()=>{if(i)return i(null,c,c.metadata)}).catch(i):p};if(global.GCLOUD_SANDBOX_ENV)return;let u=typeof n=="object"?n:{};i=typeof n=="function"?n:i,u=Object.assign({metadata:{}},u);let l=this.storage.retryOptions.maxRetries;(((o=u?.preconditionOpts)===null||o===void 0?void 0:o.ifGenerationMatch)===void 0&&((s=this.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(l=0);let c;if(u.destination instanceof QZ)c=u.destination;else if(u.destination!==null&&typeof u.destination=="string")c=this.file(u.destination,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts});else{let d=_Ad.basename(t);c=this.file(d,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}a(l)}makeAllFilesPublicPrivate_(t,n){let o=[],s=[],a=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let u=async l=>{try{await(a.public?l.makePublic():l.makePrivate(a)),s.push(l)}catch(c){if(!a.force)throw c;o.push(c)}};this.getFiles(a).then(([l])=>{let c=(0,tfa.default)(10),d=l.map(p=>c(()=>u(p)));return Promise.all(d)}).then(()=>n(o.length>0?o:null,s),l=>n(l,s))}getId(){return this.id}disableAutoRetryConditionallyIdempotent_(t,n,i){var o,s;typeof t=="object"&&((s=(o=t?.reqOpts)===null||o===void 0?void 0:o.qs)===null||s===void 0?void 0:s.ifMetagenerationMatch)===void 0&&i?.ifMetagenerationMatch===void 0&&(n===zU.setMetadata||n===zU.delete)&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional?this.storage.retryOptions.autoRetry=!1:this.storage.retryOptions.idempotencyStrategy===n2.RetryNever&&(this.storage.retryOptions.autoRetry=!1)}};ifa.paginator.extend(UZ,"getFiles");(0,EAd.promisifyAll)(UZ,{exclude:["cloudStorageURI","request","file","notification"]});var OAd=_t(Xg(),1),QNe=class extends rx{constructor(t,n,i){let o={parent:t,baseUrl:"/channels",id:"",methods:{}};super(o),this.metadata.id=n,this.metadata.resourceId=i}stop(t){t=t||jp.noop,this.request({method:"POST",uri:"/stop",json:this.metadata},(n,i)=>{t(n,i)})}};(0,OAd.promisifyAll)(QNe);var wAd=_t(Bot(),1);var RAd=_t(Xg(),1),UNe=class extends rx{constructor(t,n,i){let o={delete:!0,get:!0,getMetadata:!0,setMetadata:{reqOpts:{method:"PUT"}}},s=i&&i.projectId||t.projectId;super({parent:t,id:n,baseUrl:`/projects/${s}/hmacKeys`,methods:o}),this.storage=t,this.instanceRetryValue=t.retryOptions.autoRetry}setMetadata(t,n,i){this.storage.retryOptions.idempotencyStrategy!==n2.RetryAlways&&(this.storage.retryOptions.autoRetry=!1);let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,super.setMetadata(t,o).then(s=>i(null,...s)).catch(i).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}};(0,RAd.promisifyAll)(UNe);var PAd=_t(JN(),1),n2;(function(r){r[r.RetryAlways=0]="RetryAlways",r[r.RetryConditional=1]="RetryConditional",r[r.RetryNever=2]="RetryNever"})(n2||(n2={}));var FZ;(function(r){r.EXPIRATION_DATE_INVALID="The expiration date provided was invalid.",r.EXPIRATION_DATE_PAST="An expiration date cannot be in the past."})(FZ||(FZ={}));var Uot;(function(r){r.BUCKET_NAME_REQUIRED="A bucket name is needed to use Cloud Storage.",r.BUCKET_NAME_REQUIRED_CREATE="A name is required to create a bucket.",r.HMAC_SERVICE_ACCOUNT="The first argument must be a service account email to create an HMAC key.",r.HMAC_ACCESS_ID="An access ID is needed to create an HmacKey object."})(Uot||(Uot={}));var gBm=/^(\w*):\/\//,mBm=!0,yBm=3,bBm=2,EBm=600,CBm=64,SBm=n2.RetryConditional,_Bm=function(r){var t;let n=i=>i.includes("eai_again")||i==="econnreset"||i==="unexpected connection closure"||i==="epipe"||i==="socket connection timeout";if(r){if([408,429,500,502,503,504].indexOf(r.code)!==-1)return!0;if(typeof r.code=="string"){if(["408","429","500","502","503","504"].indexOf(r.code)!==-1)return!0;let i=r.code.toLowerCase();if(n(i))return!0}if(r.errors)for(let i of r.errors){let o=(t=i?.reason)===null||t===void 0?void 0:t.toString().toLowerCase();if(o&&n(o))return!0}}return!1};var Zq=class r extends Axt{getBucketsStream(){return new ofa.Readable}getHmacKeysStream(){return new ofa.Readable}constructor(t={}){var n,i,o,s,a,u,l,c,d,p,f,A,g,b;let v=`https://storage.${t.universeDomain||PAd.DEFAULT_UNIVERSE}`,O=!1,R=process.env.STORAGE_EMULATOR_HOST;typeof R=="string"&&(v=r.sanitizeEndpoint(R),O=!0),t.apiEndpoint&&(v=r.sanitizeEndpoint(t.apiEndpoint),O=!0),t=Object.assign({},t,{apiEndpoint:v});let w=R||`${t.apiEndpoint}/storage/v1`,P={apiEndpoint:t.apiEndpoint,retryOptions:{autoRetry:((n=t.retryOptions)===null||n===void 0?void 0:n.autoRetry)!==void 0?(i=t.retryOptions)===null||i===void 0?void 0:i.autoRetry:mBm,maxRetries:!((o=t.retryOptions)===null||o===void 0)&&o.maxRetries?(s=t.retryOptions)===null||s===void 0?void 0:s.maxRetries:yBm,retryDelayMultiplier:!((a=t.retryOptions)===null||a===void 0)&&a.retryDelayMultiplier?(u=t.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier:bBm,totalTimeout:!((l=t.retryOptions)===null||l===void 0)&&l.totalTimeout?(c=t.retryOptions)===null||c===void 0?void 0:c.totalTimeout:EBm,maxRetryDelay:!((d=t.retryOptions)===null||d===void 0)&&d.maxRetryDelay?(p=t.retryOptions)===null||p===void 0?void 0:p.maxRetryDelay:CBm,retryableErrorFn:!((f=t.retryOptions)===null||f===void 0)&&f.retryableErrorFn?(A=t.retryOptions)===null||A===void 0?void 0:A.retryableErrorFn:_Bm,idempotencyStrategy:((g=t.retryOptions)===null||g===void 0?void 0:g.idempotencyStrategy)!==void 0?(b=t.retryOptions)===null||b===void 0?void 0:b.idempotencyStrategy:SBm},baseUrl:w,customEndpoint:O,useAuthWithCustomEndpoint:t?.useAuthWithCustomEndpoint,projectIdRequired:!1,scopes:["https://www.googleapis.com/auth/iam","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/devstorage.full_control"],packageJson:(0,wAd.getPackageJSON)()};super(P,t),this.acl=r.acl,this.crc32cGenerator=t.crc32cGenerator||GMi,this.retryOptions=P.retryOptions,this.getBucketsStream=JMi.paginator.streamify("getBuckets"),this.getHmacKeysStream=JMi.paginator.streamify("getHmacKeys")}static sanitizeEndpoint(t){return gBm.test(t)||(t=`https://${t}`),t.replace(/\/+$/,"")}bucket(t,n){if(!t)throw new Error(Uot.BUCKET_NAME_REQUIRED);return new UZ(this,t,n)}channel(t,n){return new QNe(this,t,n)}createBucket(t,n,i){if(!t)throw new Error(Uot.BUCKET_NAME_REQUIRED_CREATE);let o;i?o=n:(i=n,o={});let s={...o,name:t},a={archive:"ARCHIVE",coldline:"COLDLINE",dra:"DURABLE_REDUCED_AVAILABILITY",multiRegional:"MULTI_REGIONAL",nearline:"NEARLINE",regional:"REGIONAL",standard:"STANDARD"},u=Object.keys(a);for(let c of u)if(s[c]){if(o.storageClass&&o.storageClass!==c)throw new Error(`Both \`${c}\` and \`storageClass\` were provided.`);s.storageClass=a[c],delete s[c]}s.requesterPays&&(s.billing={requesterPays:s.requesterPays},delete s.requesterPays);let l={project:this.projectId};s.userProject&&(l.userProject=s.userProject,delete s.userProject),s.enableObjectRetention&&(l.enableObjectRetention=s.enableObjectRetention,delete s.enableObjectRetention),this.request({method:"POST",uri:"/b",qs:l,json:s},(c,d)=>{if(c){i(c,null,d);return}let p=this.bucket(t);p.metadata=d,i(null,p,d)})}createHmacKey(t,n,i){if(typeof t!="string")throw new Error(Uot.HMAC_SERVICE_ACCOUNT);let{options:o,callback:s}=Xq(n,i),a=Object.assign({},o,{serviceAccountEmail:t}),u=a.projectId||this.projectId;delete a.projectId,this.request({method:"POST",uri:`/projects/${u}/hmacKeys`,qs:a,maxRetries:0},(l,c)=>{if(l){s(l,null,null,c);return}let d=c.metadata,p=this.hmacKey(d.accessId,{projectId:d.projectId});p.metadata=c.metadata,s(null,p,c.secret,c)})}getBuckets(t,n){let{options:i,callback:o}=Xq(t,n);i.project=i.project||this.projectId,this.request({uri:"/b",qs:i},(s,a)=>{if(s){o(s,null,null,a);return}let l=(a.items?a.items:[]).map(d=>{let p=this.bucket(d.id);return p.metadata=d,p}),c=a.nextPageToken?Object.assign({},i,{pageToken:a.nextPageToken}):null;o(null,l,c,a)})}getHmacKeys(t,n){let{options:i,callback:o}=Xq(t,n),s=Object.assign({},i),a=s.projectId||this.projectId;delete s.projectId,this.request({uri:`/projects/${a}/hmacKeys`,qs:s},(u,l)=>{if(u){o(u,null,null,l);return}let d=(l.items?l.items:[]).map(f=>{let A=this.hmacKey(f.accessId,{projectId:f.projectId});return A.metadata=f,A}),p=l.nextPageToken?Object.assign({},i,{pageToken:l.nextPageToken}):null;o(null,d,p,l)})}getServiceAccount(t,n){let{options:i,callback:o}=Xq(t,n);this.request({uri:`/projects/${this.projectId}/serviceAccount`,qs:i},(s,a)=>{if(s){o(s,null,a);return}let u={};for(let l in a)if(a.hasOwnProperty(l)){let c=l.replace(/_(\w)/g,(d,p)=>p.toUpperCase());u[c]=a[l]}o(null,u,a)})}hmacKey(t,n){if(!t)throw new Error(Uot.HMAC_ACCESS_ID);return new UNe(this,t,n)}};Zq.Bucket=UZ;Zq.Channel=QNe;Zq.File=QZ;Zq.HmacKey=UNe;Zq.acl={OWNER_ROLE:"OWNER",READER_ROLE:"READER",WRITER_ROLE:"WRITER"};JMi.paginator.extend(Zq,["getBuckets","getHmacKeys"]);(0,MAd.promisifyAll)(Zq,{exclude:["bucket","channel","hmacKey"]});var OBm=_t(D3t(),1);var RBm=_t(JN(),1),NAd=_t(ahi(),1),MBm=_t(Aoe(),1);var DAd=_t(Bot(),1);var vBm,TBm,IBm,wBm=(0,DAd.getPackageJSON)();var joC=32*1024*1024,GoC=32*1024*1024,HoC=32*1024*1024;var sfa={UPLOAD_MANY:"tm.upload_many",DOWNLOAD_MANY:"tm.download_many",UPLOAD_SHARDED:"tm.upload_sharded",DOWNLOAD_SHARDED:"tm.download_sharded"};vBm=new WeakSet,TBm=function(t={}){let n=!1,i=!1;for(let[o,s]of Object.entries(t))o.toLocaleLowerCase().trim()==="x-goog-api-client"?(n=!0,s.includes(sfa.UPLOAD_SHARDED)||(t[o]=`${s} gccl-gcs-cmd/${sfa.UPLOAD_SHARDED}`)):o.toLocaleLowerCase().trim()==="user-agent"&&(i=!0);return n||(t["x-goog-api-client"]=`${qZ()} gccl/${wBm.version} gccl-gcs-cmd/${sfa.UPLOAD_SHARDED}`),i||(t["User-Agent"]=zZ()),t},IBm=function(t,n){if(this.bucket.storage.retryOptions.autoRetry&&this.bucket.storage.retryOptions.retryableErrorFn(t))throw t;n(t)};ur();var PBm=_t(Fgi());var yxt=class{whereClauseDisjunctionLimits={in:30,"not-in":10,"array-contains-any":30};async selectInBatches(t,n,i,o,s){let a=[],u=this.whereClauseDisjunctionLimits[i];for(let l=0;l<o.length;l+=u){let c=o.slice(l,l+u),d=this.createQuery(t,{where:[...s,[n,i,c]]}),p=await this.runQuery(d);a.push(p)}return a.flat()}};var AsC=fB.getTracer("repository");var NBm=500,DBm=10*1024*1024,xBm=.7*DBm,$Mi=class{constructor(t){this.firestoreOperations=t;this.batch=t.batch(),this.batchSize=0,this.requestSize=0,this.batchesCommitted=0,this.batchesToCommit=[this.batch]}batch;batchSize;requestSize;batchesCommitted;batchesToCommit;batchIncrement=async(t,n)=>{let i=eWn(t)+eWn(n),o=this.requestSize+i>=xBm,s=this.batchSize+1>=NBm;o||s?(this.batchSize=1,this.requestSize=i,this.batch=this.firestoreOperations.batch(),this.batchesToCommit.push(this.batch)):(this.batchSize+=1,this.requestSize+=i)};async save(t,n){let i=t,o=i.prepareDataForSave(n);await this.batchIncrement(o,i.docRef.path),this.firestoreOperations.saveDocBatch(this.batch,i.docRef,o)}async merge(t,n){let i=t,o=i.prepareDataForMerge(n);await this.batchIncrement(o,i.docRef.path),this.firestoreOperations.updateDocBatch(this.batch,i.docRef,o)}async delete(t,n){let i=t,o=i.docRef;if(await this.batchIncrement(n,o.path),this.firestoreOperations.deleteDocBatch(this.batch,i.docRef),o.parent.id==="steps"){let s=this.firestoreOperations.collectionRef(o.parent.parent,"deletedSteps"),a=this.firestoreOperations.docRef(s,o.id),u={deletedAt:this.firestoreOperations.getServerTimestampSentinel()};await this.batchIncrement(u,a.path),this.firestoreOperations.saveDocBatch(this.batch,a,u)}}async commit(){if(Tc().info("committing batches!"),this.batchSize)for(let t of this.batchesToCommit)this.batchesCommitted+=1,await this.firestoreOperations.commitBatch(t);return this.batchesCommitted}};var IEe=class extends Are{constructor(n,i,o,s,a,u){super(n);this.id=n;this.ref=i;this.subCollectionNames=o;this.parent=s;this.logContext=a;this.firestoreOperations=u}subCollections=[];runTransaction(n,i){let o=n?.transaction;return tx(o?i(n):this.firestoreOperations.runTransaction(s=>i({...n??{},transaction:s})))}getSubCollection(n,i){let o=this.subCollections[n];return o||(o=new i(this.firestoreOperations.collectionRef(this.ref,n),this,this.logContext,this.firestoreOperations),this.subCollections[n]=o),o}};var Ra=class extends IEe{constructor(n,i,o,s,a,u,l=[]){super(n,i,l,s,a,u);this.docRef=i;this.dataTransform=o}get path(){return this.docRef.path}async fetch(n){let i=n?.transaction,o=i?()=>i.get(this.docRef):()=>this.firestoreOperations.getDoc(this.docRef,n),s=n?.retryOptions,u=await tx((s?()=>xyt(o,{...s,tags:[...s.tags,"[FirestoreEntityRepository.fetch()]",`[${this.path}]`]}):o)());if(!u.exists)throw Tc().info(`Document ${this.path} not found`),new Ya(`Entity ${this.path} not found`);return this.dataTransform.fromStorage(this.id.toString(),this.path,this.firestoreOperations.data(u),this.firestoreOperations,n)}async save(n,i){let o=i?.transaction,s=this.prepareDataForSave(n,i);o?o.set(this.docRef,s):await tx(this.firestoreOperations.saveDoc(this.docRef,s))}async merge(n,i){let o=i?.transaction,s=this.prepareDataForMerge(n,i),a=o?async()=>o.update(this.docRef,s):()=>this.firestoreOperations.updateDoc(this.docRef,s),u=i?.retryOptions;await tx((u?()=>xyt(a,{...u,tags:[...u.tags,"[FirestoreEntityRepository.merge()]",`[${this.path}]`]}):a)())}fetchAndMerge(n,i){return this.runTransaction(i,async o=>{let s=await this.fetch(o);return this.save(this.mergeWithDeletes(s,n),o)})}async delete(n){let i=n?.transaction;i?i.delete(this.docRef):await tx(this.firestoreOperations.deleteDoc(this.docRef))}async recursiveDelete(){let n=this.firestoreOperations.db;if(!Bfd(n))throw new et("Unable to perform repository recursive delete from non-admin firestore.");await tx(n.recursiveDelete(this.docRef))}listen(n,i,o){let s=!0;return this.firestoreOperations.onDocSnapshot(this.docRef,a=>{if(this.firestoreOperations.exists(a))try{Tc().debug(`Listener notification for document ${this.path} modified`),n({type:s?"added":"modified",value:this.dataTransform.fromStorage(this.id.toString(),this.path,this.firestoreOperations.data(a),this.firestoreOperations,o),id:this.id.toString(),hasPendingWrites:this.firestoreOperations.hasPendingWrites(a)}),s=!1}catch(u){i&&i(u)}else Tc().debug(`Listener notification for document ${this.path} removed`),n({type:"removed",id:a.id,hasPendingWrites:this.firestoreOperations.hasPendingWrites(a)})},a=>{Tc().error(`Firestore error listening to document ${this.path} ${a}`),i&&i(dxt(a))})}prepareDataForSave(n,i){if(n.id&&n.id?.toString()!==this.docRef.id)throw new mo(`Attempt to assign a new ID to entity ${this.path} `);let o=this.firestoreOperations.currentUser(),s=this.id.toString(),a={id:this.id,...Vc(n),createdAt:n.createdAt??Mk(),createdBy:n.createdBy??o,updatedAt:Mk(),updatedBy:o};return this.dataTransform.toStorage(s,this.path,a,this.firestoreOperations,i)}prepareDataForMerge(n,i){let o=n.id;if(o&&o.toString()!==this.docRef.id)throw new mo(`Attempt to assign a new ID to entity ${this.path} `);let s={...Vc(n),updatedAt:Mk(),updatedBy:this.firestoreOperations.currentUser()};return this.dataTransform.mergeToStorage(this.id.toString(),this.path,s,this.firestoreOperations)}mergeWithDeletes(n,i){return b3e(this.path,o=>o instanceof nTe?[void 0,!0]:[o,!1],XLi(n,i))}};var XMi=class{constructor(t){this.firestoreOperations=t;this.firestoreOperations=t}async uploadFile(t,n){await this.firestoreOperations.uploadToStorage(t,n)}async downloadFile(t){return this.firestoreOperations.downloadFromStorage(t)}async checkIfReferenceExists(t){return this.firestoreOperations.checkIfStorageReferenceExists(t)}async deleteFile(t){return this.firestoreOperations.deleteFileFromStorage(t)}};ur();var xAd=_t(gUe());var jot=class{constructor(t){this._storage=t}async uploadToStorage(t,n){let i=Gft(this._storage,t),o=(0,xAd.gzip)(new TextEncoder().encode(JSON.stringify(n)));await Z6n(i,o,{contentType:"application/json",contentEncoding:"gzip"})}async downloadFromStorage(t){let n=async()=>{let i=await lsu(this._storage.ref(t));return JSON.parse(Buffer.from(i).toString())};return await this.handleStorageNotFoundError("download",n(),t)}async deleteFileFromStorage(t){await this.handleStorageNotFoundError("delete",this._storage.ref(t).delete(),t)}async checkIfStorageReferenceExists(t){try{return!!await this._storage.ref(t).getDownloadURL()}catch(n){if(n instanceof w1&&n.code==="storage/object-not-found")return!1;throw n}}async handleStorageNotFoundError(t,n,i){try{return await n}catch(o){throw o instanceof w1&&o.code==="storage/object-not-found"?new Ya(`Could not ${t} file from storage (compat) - no file exists at provided path ${i}`):o}}};var FU=fB.getTracer("repository"),afa=class{constructor(t){this.transaction=t}async get(t){return Kjs(t.path),FU.startActiveSpan(`get ${t.path}`,async n=>{n.setAttribute("repositoryType","web"),n.setAttribute("path",t.path),n.setAttribute("operation","get");let i=await this.transaction.get(t);return n.end(),i})}set(t,n){return Yjs(t.path),FU.startActiveSpan(`set ${t.path}`,i=>(i.setAttribute("repositoryType","web"),i.setAttribute("path",t.path),i.setAttribute("operation","set"),this.transaction.set(t,n),i.end(),this))}async update(t,n){return Jjs(t.path),FU.startActiveSpan(`update ${t.path}`,i=>(i.setAttribute("repositoryType","web"),i.setAttribute("path",t.path),i.setAttribute("operation","update"),this.transaction.update(t,n),i.end(),this))}delete(t){return $js(t.path),FU.startActiveSpan(`delete ${t.path}`,n=>(n.setAttribute("repositoryType","web"),n.setAttribute("path",t.path),n.setAttribute("operation","delete"),this.transaction.delete(t),n.end(),this))}getQuery(t){throw new Yp("getQuery is not supported with the web sdk.")}},bxt=class r extends yxt{constructor(n,i=new jot(n.storage())){super();this.app=n;this.storage=i}get db(){return this.app.firestore()}currentUser(){return this.db.app.auth().currentUser?.uid}currentLogContext(){return{userID:this.db.app.auth().currentUser?.uid}}collectionRef(n,i){return n.collection(i)}data(n){return n.data()}docRef(n,i){return n.doc(i)}exists(n){return n.exists}hasPendingWrites(n){return n.metadata.hasPendingWrites}async getDoc(n,i){let o=n;return Vjs(o.path),FU.startActiveSpan(`get ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","get");let a=await o.get();if(!a.metadata.hasPendingWrites)return s.end(),a;let u=hCl(o,i?.pendingWritesTimeoutMs);return s.end(),u})}async addDoc(n,i){let o=n;Ggi(o.path),await FU.startActiveSpan(`set ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","set"),await o.set(i),s.end()})}async saveDoc(n,i){let o=n;return Ggi(n.path),FU.startActiveSpan(`set ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","set"),await o.set(i),s.end()})}async updateDoc(n,i){let o=n;return Wjs(n.path),FU.startActiveSpan(`update ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","update"),await o.update(i),s.end()})}async getChildren(n){throw new Yp("getChildren() is not possible in the firestore web sdk as it lacks listDocuments()")}async deleteDoc(n){let i=n;return Hjs(n.path),FU.startActiveSpan(`delete ${n.path}`,async o=>{o.setAttribute("repositoryType","web"),o.setAttribute("path",n.path),o.setAttribute("operation","delete"),await i.delete(),o.end()})}createQuery(n,i){let o=n,s=i?.where?.filter(a=>a[2]!==void 0);if(s&&s.forEach(a=>o=o.where(r.replaceIDSentinel(a[0]),a[1],a[2])),i?.orderBy?.forEach(a=>o=o.orderBy(a[0],a[1])),i?.startingFrom!==void 0&&(i.orderBy?.length?o=o.startAfter(i.startingFrom):(o=o.orderBy(X0.firestore.FieldPath.documentId()),o=o.startAfter(i.startingFrom.toString()))),i?.limit&&(o=o.limit(i.limit)),i?.selectFields)throw new Yp("Selecting specific fields is not supported with the Firebase web SDK");return o}runQuery(n){return FU.startActiveSpan("get query.unknown",async i=>{i.setAttribute("repositoryType","web"),i.setAttribute("path","query.unknown"),i.setAttribute("operation","get");let o=await n.get();return i.end(),o})}onDocSnapshot(n,i,o){return n.onSnapshot(i,o)}onCollectionSnapshot(n,i,o){return this.onQuerySnapshot(n,i,o)}onQuerySnapshot(n,i,o){return n.onSnapshot(i,o)}snapShotChanges(n){return n.docChanges()}runTransaction(n){return this.db.runTransaction(i=>n(new afa(i)))}batch(){return this.db.batch()}saveDocBatch(n,i,o){n.set(i,o)}updateDocBatch(n,i,o){n.update(i,o)}deleteDocBatch(n,i){n.delete(i)}commitBatch(n){return Xjs(),FU.startActiveSpan("batch",async i=>{i.setAttribute("repositoryType","web"),i.setAttribute("operation","batch commit"),await n.commit(),i.end()})}getServerTimestampSentinel(){return X0.firestore.FieldValue.serverTimestamp()}getDeleteSentinel(){return X0.firestore.FieldValue.delete()}uploadToStorage(n,i){return this.storage.uploadToStorage(n,i)}downloadFromStorage(n){return this.storage.downloadFromStorage(n)}deleteFileFromStorage(n){return this.storage.deleteFileFromStorage(n)}getCount(n){throw new Yp("getCount is not supported with the web sdk.")}async checkIfStorageReferenceExists(n){return this.storage.checkIfStorageReferenceExists(n)}static replaceIDSentinel(n){return n instanceof Vft?X0.firestore.FieldPath.documentId():n}};var ZMi=class r{constructor(t="unknown",n={}){this.collectionName=t;this.listeners=n}getCollection(t){return new r(t,this.listeners)}publishEvents(t){let n=this.listeners[this.collectionName]||{};Object.values(n).forEach(i=>i?.(t))}registerListener(t){let n=Za(),i=this.listeners[this.collectionName];return i||(i={},this.listeners[this.collectionName]=i),i[n]=t,()=>{i[n]=void 0}}};var ewi=(r,t)=>{if(!r)return r;let n=Object.create(Object.getPrototypeOf(r));return Object.assign(n,r),t&&Object.assign(n,t),n},BBm=["run","runs","devRun","devRuns"],kBm=["createEntity","save","delete","recursiveDelete","merge","fetchAndMerge","mergeMetadata"],jNe=class r{providers;flaggedRepositoryParent;constructor(t,n,i,o,s){return this.providers=n,this.flaggedRepositoryParent=t,new Proxy(this,{get:(a,u)=>{if(u==="flaggedRepositoryParent")return t;if(u==="providers")return n;if(BBm.includes(u))return this.providers.firebase[u];if(u==="batch"&&t.id==="root")return s;let{providerId:l,shouldMutateBoth:c}=o(u,i);if(!(l in this.providers))throw new et("[FLAGGED_REPOSITORY] Attempted to access a flagged repository implementation that is not configured.",`Provider ID: ${l}`);let d=a.providers[l]?.[u];if(d instanceof Are){let p=Object.fromEntries(Object.entries(this.providers).map(([f,A])=>[f,A?.[u]]));return new r(d,p,{...i},o,s)}return typeof d=="function"?(...p)=>{let f=t?.[u],A=d,g=this.providers.firebase?.[u],b=this.providers.service?.[u],_=f||A,v={};if(c&&u==="createEntity"){let Y=t.generateID?.(p[0]);v.generateID=()=>Y}let O=ewi(t,v),R=ewi(a.providers[l],v),w=ewi(this.providers.firebase,v),P=ewi(this.providers.service,v),z=f?.bind(O),j=A?.bind(R),U=g?.bind(w),G=b?.bind(P),L=(z||j)?.(...p);if(L instanceof Promise&&(L=new Promise((Y,J)=>{let re=L,ne=[re];kBm.includes(u)&&c&&(_===g?ne.push(G?.(...p)):ne.push(U?.(...p))),Promise.allSettled(ne).then(()=>{re.then(Y).catch(J)}).catch(()=>{console.error("Promise allSettled failed unexpectedly")})})),!(L instanceof Are))return L;let W=Object.fromEntries(Object.entries(this.providers).map(([Y,J])=>[Y,J?.[u]?.bind(J)?.(...p)])),V=i.orgId;u==="org"&&(V=p[0]),u==="get"&&t.id==="orgs"&&(V=p[0]);let q=u==="get"?L:j?.(...p);return new r(q,W,{...i,orgId:V},o,s)}:t[u]}})}},BAd=(r,t,n,i)=>new jNe(r,t,{},n,i);var cP=class extends Are{constructor(n,i,o,s,a,u){super(n);this.id=n;this.collectionName=i;this.subCollectionNames=o;this.parent=s;this.logContext=a;this.serviceOperations=u}subCollections=[];async getToken(){return this.serviceOperations.getToken()}getSubCollection(n,i){let o=this.subCollections[n];return o||(o=new i(this,this.serviceOperations,this.logContext),this.subCollections[n]=o),o}};var twi=class{constructor(t,n,i){this.getMutateAllRepositories=i;this.firestoreBatch=t.batch(),this.serviceBatch=n.batch()}firestoreBatch;serviceBatch;async save(t,n){if(t instanceof cP)return this.serviceBatch.save(t,n);if(t instanceof jNe){let i=t.flaggedRepositoryParent,o=this.getMutateAllRepositories();return i instanceof cP?(o&&this.firestoreBatch.save(t.providers.firebase,n),this.serviceBatch.save(t.providers.service,n)):(o&&t.providers.service&&this.serviceBatch.save(t.providers.service,n),this.firestoreBatch.save(t.providers.firebase,n))}return this.firestoreBatch.save(t,n)}async merge(t,n){if(t instanceof cP)return this.serviceBatch.merge(t,n);if(t instanceof jNe){let i=t.flaggedRepositoryParent,o=this.getMutateAllRepositories();return i instanceof cP?(o&&this.firestoreBatch.merge(t.providers.firebase,n),this.serviceBatch.merge(t.providers.service,n)):(o&&t.providers.service&&this.serviceBatch.merge(t.providers.service,n),this.firestoreBatch.merge(t.providers.firebase,n))}return this.firestoreBatch.merge(t,n)}async delete(t,n){if(t instanceof cP)return this.serviceBatch.delete(t,n);if(t instanceof jNe){let i=t.flaggedRepositoryParent,o=this.getMutateAllRepositories();return i instanceof cP?(o&&this.firestoreBatch.delete(t.providers.firebase,n),this.serviceBatch.delete(t.providers.service,n)):(o&&t.providers.service&&this.serviceBatch.delete(t.providers.service,n),this.firestoreBatch.delete(t.providers.firebase,n))}return this.firestoreBatch.delete(t,n)}async commit(){let[t,n]=await Promise.all([this.serviceBatch.commit(),this.firestoreBatch.commit()]);return Math.max(t,n)}};var yC=class extends cP{constructor(n,i,o,s,a,u=[],l,c){super(n,i,u,s,a,c);this.dataTransform=o;this.hostname=l;this.eventManager=this.serviceOperations.eventManager.getCollection(i)}eventManager;async addAuthHeader(n={}){let i=await this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}get path(){return`${this.parent.path}/${this.collectionName}/${this.id}`}handleNotFound(n,i){if(Ag(n)&&n.status===404){if(i)return!0;throw new Ya(`Couldn't find entity ${this.path} for service backed repository`)}return!1}async fetch(n){let i=await this.addAuthHeader({});try{let s=(await fd.get(`${this.hostname}${this.baseUri}/${this.id}`,{headers:i})).data;return this.dataTransform.fromStorage(this.id.toString(),this.path,s,n)}catch(o){throw this.handleNotFound(o),o}}async save(n,i){let o;try{let s=await this.addAuthHeader();o=this.dataTransform.toStorage(this.id.toString(),this.path,n,i);let{data:a}=await fd.put(`${this.hostname}${this.baseUri}/${this.id}`,o,{headers:s}),u=this.dataTransform.fromStorage(this.id.toString(),this.path,a,i);this.eventManager.publishEvents([{type:"modified",value:u,id:this.id.toString(),hasPendingWrites:!1}])}catch(s){if(this.handleNotFound(s,!0))try{let a=await this.addAuthHeader();o||(o=this.dataTransform.toStorage(this.id.toString(),this.path,n,i));let{data:u}=await fd.post(`${this.hostname}${this.baseUri}`,o,{headers:a}),l=this.dataTransform.fromStorage(this.id.toString(),this.path,u,i);this.eventManager.publishEvents([{type:"added",value:l,id:this.id.toString(),hasPendingWrites:!1}])}catch(a){throw this.handleNotFound(a),a}else throw s}}async merge(n,i){let o=Object.entries(n).reduce((s,[a,u])=>(Kut(s,a,u),s),{});await this.fetchAndMerge(o,i)}async fetchAndMerge(n,i){try{let o=await this.addAuthHeader(),s=this.dataTransform.mergeToStorage(String(this.id),this.path,n,i),{data:a}=await fd.patch(`${this.hostname}${this.baseUri}/${this.id}`,this.mapDataToPatchPayload(s),{headers:o}),u=this.dataTransform.fromStorage(String(this.id),this.path,a,i);this.eventManager.publishEvents([{type:"modified",value:u,id:String(this.id),hasPendingWrites:!1}])}catch(o){throw this.handleNotFound(o),o}}async delete(){try{let n=await this.addAuthHeader({});await fd.delete(`${this.hostname}${this.baseUri}/${this.id}`,{headers:n}),this.eventManager.publishEvents([{type:"removed",value:{},id:this.id.toString(),hasPendingWrites:!1}])}catch(n){throw this.handleNotFound(n),n}}recursiveDelete(){return this.delete()}listen(){throw new Yp}mapDataToPatchPayload(n){let i=this.flattenToPaths(n);return Object.entries(i).reduce((s,[a,u])=>(u===S8n()?Kut(s.delete,a,!0):Kut(s.update,a,u),s),{update:{id:this.id},delete:{}})}flattenToPaths(n){let i={};function o(s,a){Vut(s,(u,l)=>{let c=a?`${a}.${l}`:l;Th(u)&&!Array.isArray(u)?o(u,c):i[c]=u})}return o(n,""),i}};var ufa=r=>r instanceof yC,rwi=class{batches={save:{},merge:{},delete:{}};async save(t,n){if(!ufa(t))throw new et("Entity must be a ServiceEntityRepository for batch writes");let i=t.getCollection(),o=i.id,s=this.batches.save[o];s?s.data.push(n):this.batches.save[o]={collection:i,data:[n]}}async merge(t,n){if(!ufa(t))throw new et("Entity must be a ServiceEntityRepository for batch writes");let i=t.getCollection(),o=i.id,s=this.batches.merge[o];s?s.data.push(n):this.batches.merge[o]={collection:i,data:[n]}}async delete(t){if(!ufa(t))throw new et("Entity must be a ServiceEntityRepository for batch writes");let n=t.getCollection(),i=n.id,o=this.batches.delete[i],s={id:t.id};o?o.data.push(s):this.batches.delete[i]={collection:n,data:[s]}}async commit(){let t=0;if(this.batches.delete.nodes){let n=this.batches.delete.nodes;try{for(let i of T7(n.data,1e3))await n.collection.bulkDelete(i),t+=i.length}catch{}}if(await Promise.allSettled(Object.entries(this.batches.delete).map(async([n,i])=>{if(n!=="nodes")for(let o of T7(i.data,1e3))await i.collection.bulkDelete(o),t+=o.length})),this.batches.merge.nodes){let n=this.batches.merge.nodes;try{for(let i of T7(n.data,1e3))await n.collection.bulkUpdate(i),t+=i.length}catch{}}if(await Promise.allSettled(Object.entries(this.batches.merge).map(async([n,i])=>{if(n!=="nodes")for(let o of T7(i.data,1e3))await i.collection.bulkUpdate(o),t+=o.length})),this.batches.save.nodes){let n=this.batches.save.nodes;try{for(let i of T7(n.data,1e3))await n.collection.bulkSave(i),t+=i.length}catch{}}return await Promise.allSettled(Object.entries(this.batches.save).map(async([n,i])=>{if(n!=="nodes")for(let o of T7(i.data,1e3))await i.collection.bulkSave(o),t+=o.length})),t}};var Ext=class{fromStorage(t,n,i,o){try{return this.transformFromStorage(t,n,i,o)}catch(s){if(o?.onDataTransformError&&o.onDataTransformError(n,s),!o?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} from storage ${s}`),s}return i}toStorage(t,n,i,o){try{return this.transformToStorage(t,n,{id:t,...i},o)}catch(s){if(o?.onDataTransformError&&o.onDataTransformError(n,s),!o?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} to storage ${s}`),s}return i}mergeToStorage(t,n,i,o){try{return this.mergeTransformToStorage(t,n,i,o)}catch(s){if(o?.onDataTransformError&&o.onDataTransformError(n,s),!o?.ignoreDataTransformErrors)throw Tc().debug(`Error merge transforming repository entity ${n} to storage ${s}`),s}return i}},cfa=class extends Ext{constructor(n){super();this.validators=n}transformFromStorage(n,i,o,s){let a=this.getValidatorOptions(n,s?.validatorOptions);return s?.enableStrictValidation?this.validators.strict.assert(o,a):this.validators.standard.assert(o,a)}transformToStorage(n,i,o,s){let a=this.getValidatorOptions(n,s?.validatorOptions);return s?.enableStrictValidation?this.validators.strict.assert(o,a):this.validators.standard.assert(o,a)}mergeTransformToStorage(n,i,o,s){return o}getValidatorOptions(n,i,o=500){let s={...i,statusCode:o};return s.errorMessage||(s.errorMessage=a=>`Found ${a.failures.length} validation failure(s) for ${this.validators.standard.name} ${n}`),s}},lfa=class{transforms;constructor(...t){this.transforms=t}fromStorage(t,n,i,o){return this.transforms.reduce((s,a)=>a.fromStorage(t,n,s,o),i)}toStorage(t,n,i,o){return this.transforms.reduceRight((s,a)=>a.toStorage(t,n,s,o),i)}mergeToStorage(t,n,i,o){return this.transforms.reduceRight((s,a)=>a.mergeToStorage(t,n,s,o),i)}},GZ=class extends Ext{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}},Got=class extends GZ{constructor(n,i=o=>o){super();this.fieldName=n;this.transform=i}transformToStorage(n,i,o){return{id:o[this.fieldName],...GS(o,[this.fieldName])}}mergeTransformToStorage(n,i,o){return o}transformFromStorage(n,i,o){return{...o,[this.fieldName]:this.transform(o.id)}}},dfa=class extends Ext{transformToStorage(t,n,i){let{createdAt:o,createdBy:s,updatedAt:a,updatedBy:u,...l}=i;return l}mergeTransformToStorage(t,n,i){let{createdAt:o,createdBy:s,updatedAt:a,updatedBy:u,...l}=i;return l}transformFromStorage(t,n,i){return i}},nwi=class extends GZ{constructor(n,i=o=>o){super();this.fieldName=n;this.transform=i}transformToStorage(n,i,o){let s=o[this.fieldName];return kkt(s)?{...o,[this.fieldName]:(s.getTime()===yV.SENTINEL_DATE?new Date:s).toISOString()}:o}mergeTransformToStorage(n,i,o){let s=this.transform(o[this.fieldName]);return kkt(s)?{...o,[this.fieldName]:(s.getTime()===yV.SENTINEL_DATE?new Date:s).toISOString()}:o}transformFromStorage(n,i,o){let s=this.transform(o[this.fieldName]);return typeof s=="string"?{...o,[this.fieldName]:new Date(s)}:o}},vR=(r,t)=>{let n=[new dfa,new cfa(r)];return t&&n.unshift(t),new lfa(...n)};var LBm=()=>typeof document<"u"&&document.hidden||typeof navigator<"u"&&!navigator.onLine;function pfa(r,t){let n,i=!0,o=1e3,s=0,a=null,u=!1,l=new AbortController,c=l.signal,d=A=>{if(LBm())return;s++,a||(a=Date.now());let g=Date.now()-a;!u&&s>=3&&g>=1e4&&(u=!0,t.onError?.(A))},p=()=>{o=1e3,s=0,a=null};return(async()=>{for(;i;)try{let A=await t.auth?.(),g={accept:"text/event-stream"};A&&(g.Authorization=A),n&&(g["Last-Event-Id"]=n);let b=await fetch(r,{headers:g,signal:c});if(b.status!==200)throw new Error(await b.text());p(),await qBm(b.body,zBm(FBm(_=>{n=_},t.onMessage))),await new Promise(_=>setTimeout(_,0))}catch(A){if(A.name==="AbortError")break;d(A),await new Promise(g=>setTimeout(g,o)),o=o*2,o>6e4&&(o=6e4)}})().catch(A=>{d(A)}),()=>{i=!1,l.abort()}}async function qBm(r,t){let n=r.getReader(),i;for(;!(i=await n.read()).done;)t(i.value)}function zBm(r){let t,n,i,o=!1;return function(a){t===void 0?(t=a,n=0,i=-1):t=QBm(t,a);let u=t.length,l=0;for(;n<u;){o&&(t[n]===10&&(l=++n),o=!1);let c=-1;for(;n<u&&c===-1;++n)switch(t[n]){case 58:i===-1&&(i=n-l);break;case 13:o=!0,c=n;break;case 10:c=n;break}if(c===-1)break;r(t.subarray(l,c),i),l=n,i=-1}l===u?t=void 0:l!==0&&(t=t.subarray(l),n-=l)}}function FBm(r,t){let n=kAd(),i=new TextDecoder;return function(s,a){if(s.length===0)t?.(n),n=kAd();else if(a>0){let u=i.decode(s.subarray(0,a)),l=a+(s[a+1]===32?2:1),c=i.decode(s.subarray(l));switch(u){case"data":n.data=n.data?n.data+`
|
|
10370
|
-
`+c:c;break;case"event":n.event=c;break;case"id":r(n.id=c);break}}}}function QBm(r,t){let n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),n}function kAd(){return{data:"",event:"",id:""}}var Gv=class extends cP{constructor(n,i,o,s,a,u,l){super(n,n,[],i,s,l);this.dataTransform=o;this.EntityRepositoryConstructor=a;this.hostname=u;this.eventManager=this.serviceOperations.eventManager.getCollection(n)}eventManager;async addAuthHeader(n={}){let i=await this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}get path(){return`${this.parent.path}/${this.id}`}get bulkUri(){throw new Yp("This entity does not support bulk operations")}get(n){return new this.EntityRepositoryConstructor(n,this.parent,this.serviceOperations,this.logContext)}encodeQueryComponent(n){if(n!==void 0)return Buffer.from(JSON.stringify(n)).toString("base64")}async select(n,i){let o=!1,s=0,a=[],u;n?.startingFrom&&(v0(n.startingFrom)?u=n.startingFrom:u=[n.startingFrom]);let l=this.encodeQueryComponent(u),c=n?.where?n?.where.map(_=>({field:_[0],operation:_[1],value:_[2]})):void 0,d=this.encodeQueryComponent(c),p;n?.orderBy&&(n.orderBy.length===0?p=[{field:"id",direction:"asc"}]:p=n?.orderBy.map(_=>({field:_[0],direction:_[1]})));let f=this.encodeQueryComponent(p),A=500,g=n?.limit??1/0;for(;!o;){let _=Math.min(A,g-s),v=await this.addAuthHeader(),O=await fd.get(`${this.hostname}${this.baseUri}`,{headers:v,params:{limit:_,startAfter:l,where:d,orderBy:f}}),R=O.data.data.map(w=>this.dataTransform.fromStorage(w.id.toString(),this.path,w,i));a.push(...R),s+=_,l=O.data.nextCursor,(R.length<_||s>=g)&&(o=!0)}let b=n?.selectFields;return b?a.map(_=>ub(_,b)):a}async selectIDs(n,i){return(await this.select({...n,selectFields:["id"]},i)).map(s=>s.id)}async selectInBatches(n,i,o,s=[]){return this.select({where:[...s,[n,i,o]]})}async createEntity(n,i){let o=await this.generateID(n),s=this.dataTransform.toStorage(o.toString(),`${this.path}/${o}`,n,i),a=await this.addAuthHeader(),l=(await fd.post(`${this.hostname}${this.baseUri}`,s,{headers:a,method:"post"})).data,c=this.dataTransform.fromStorage(String(l.id),`${this.path}/${l.id}`,l,i);return this.eventManager.publishEvents([{type:"added",value:c,id:String(l.id),hasPendingWrites:!1}]),new this.EntityRepositoryConstructor(l.id,this.parent,this.serviceOperations,this.logContext)}listenCollection(n,i,o){let s=this.eventManager.registerListener(n),a;try{console.log(`start subscription ${this.baseSSEUri}`),a=pfa(new URL(this.baseSSEUri,window.location.origin),{auth:async()=>{let u=await this.getToken();return ed(!!u,"Cookie-based auth is not yet supported for service-backed repositories","COMMON"),"Bearer "+u},onMessage:u=>{try{switch(u.event){case"entity":{let l=JSON.parse(u.data);if(l.type==="added"||l.type==="modified"){let c=this.dataTransform.fromStorage(l.id,`${this.path}/${l.id}`,l.value,o);this.eventManager.publishEvents([{type:l.type,value:c,id:l.id,hasPendingWrites:!1}])}else this.eventManager.publishEvents([{type:"removed",value:{},id:l.id,hasPendingWrites:!1}]);break}case"error":{if(i){let l=JSON.parse(u.data),c=new et(l.error.errorString,l.error.errorDetail);i(c)}break}case"connected":case"ready":case"disconnect":default:}}catch(l){We("COMMON").errorContext(this.logContext,"Failed to interpret SSE message",l),l instanceof Error&&i&&i(l)}},onError:u=>{u instanceof Error&&i&&i(u)}}),console.log(`subscription started ${this.baseSSEUri}`),this.select().then(u=>{this.eventManager.publishEvents(u.map(l=>({type:"added",value:l,id:String(l.id),hasPendingWrites:!1})))})}catch(u){if(u instanceof Error&&i)i(u);else throw u}return()=>{s(),a?.()}}listenQuery(n,i,o,s){throw new Yp("Not used by supported entities")}async generateID(n){return n.id??Za()}async bulkSave(n){We("COMMON").warnContext(this.logContext,"Using default bulk save operation",{path:this.path});for(let i of n)try{await this.createEntity(i)}catch(o){i&&i.id&&Ag(o)&&o.status===409?await this.get(i.id).save(i):We("COMMON").errorContext(this.logContext,"Failed to bulk save entity using default operation",{path:this.path},o)}}async bulkUpdate(n){We("COMMON").warnContext(this.logContext,"Using default bulk update operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk update entity without entity ID",{path:this.path}),new et("Tried to bulk update entity without entity ID");await this.get(i.id).merge(i)}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk update entity using default operation",{path:this.path},o)}}async bulkDelete(n){We("COMMON").warnContext(this.logContext,"Using default bulk delete operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk delete entity without entity ID",{path:this.path}),new et("Tried to bulk delete entity without entity ID");await this.get(i.id).delete()}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk delete entity using default operation",{path:this.path},o)}}async getCount(){throw new Yp}};var UBm=zi.merge(SK),jBm=Os("Job",UBm),LAd=vR(jBm,new Got("jobCounter")),ffa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{}}getCollection(){return new Cxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"jobs",LAd,n,o,[],i.hostnames.metadataService,i)}},Cxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("jobs",t,LAd,i,ffa,n.hostnames.metadataService,n)}async generateID(t){if(t.id)return t.id;if(t.jobCounter)return t.jobCounter;let n=await this.select();if(n.length<1)return 1;let o=n.sort((a,u)=>u.id-a.id)[0];return o?o.id+1:1}};var Afa=class r extends GZ{static ID_NUMBER=/^\d+$/;transformToStorage(t,n,i){return{...GS(i,["macroCounter","name","packageInfo"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return r.ID_NUMBER.test(i.id)?{...i,macroCounter:+i.id}:{...i}}},GBm=zi.merge(aL),HBm=Os("Macro",GBm),qAd=vR(HBm,new Afa),hfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{}}getCollection(){return new Sxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"macros",qAd,n,o,[],i.hostnames.metadataService,i)}},Sxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("macros",t,qAd,i,hfa,n.hostnames.metadataService,n)}};var gfa=class extends GZ{transformToStorage(t,n,i){return{...GS(i,["templateCounter"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return i}},WBm=zi.merge(xFe),VBm=Os("NodeType",WBm),zAd=vR(VBm,new gfa),mfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{}}getCollection(){return new _xt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"templates",zAd,n,o,[],i.hostnames.metadataService,i)}},_xt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("templates",t,zAd,i,mfa,n.hostnames.metadataService,n)}};var yfa=class extends GZ{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){let o=[];return i.metadata.columns.forEach(s=>{let a;(i.type==="sourceInput"||s.isSurrogateKey||s.isSystemCreateDate||s.isSystemUpdateDate||s.isSystemStartDate||s.isSystemEndDate||s.isSystemVersion||s.isSystemCurrentFlag)&&(a={strictMatch:!0,values:[]}),o.push({...s,acceptedValues:a})}),{...i,metadata:{...i.metadata,columns:o}}}},KBm=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),YBm=Os("Node",KBm),FAd=vR(YBm,new yfa),bfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"nodes",FAd,n,o,[],i.hostnames.metadataService,i)}mergeMetadata(t){return this.fetchAndMerge({metadata:t})}getCollection(){return new vxt(this.parent,this.serviceOperations,this.logContext)}},vxt=class r extends Gv{static NODE_BULK_LIMIT=1e3;get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get bulkUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes_bulk`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("nodes",t,FAd,i,bfa,n.hostnames.metadataService,n)}listenCollectionOverride(t,n,i,o,s){let a=this.listenCollection(t,o,s);return()=>{a&&a()}}convertFromRestAPIStorage(t,n){return this.dataTransform.fromStorage(n,`${this.path}/${n}`,t)}async getNodesLocationInfo(){let t=await this.select(),n={};return t.forEach(i=>{n[i.id]={operation:i}}),n}async bulkSave(t){let n=t.map(o=>this.dataTransform.toStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkUpdate(t){let n=t.map(o=>this.dataTransform.mergeToStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkDelete(t){let n=t.map(o=>o.id),i;for(let o of T7(n,1e3))try{let s=await this.addAuthHeader();await fd.delete(`${this.hostname}${this.bulkUri}`,{headers:s,data:o})}catch(s){i=s}if(i)throw i;this.eventManager.publishEvents(n.map(o=>({type:"removed",value:{},id:o,hasPendingWrites:!1})))}async bulkPostChunk(t,n,i){let o;for(let s of T7(n,i)){let a=await t();try{await fd.post(`${this.hostname}${this.bulkUri}`,{nodes:s},{headers:a})}catch(u){if(i>1&&Ag(u)&&u.response?.status===ECa.PayloadTooLarge){await this.bulkPostChunk(t,s,Math.max(i/10,1));continue}o=u}}if(o)throw o}};var JBm=zi.merge(VIe),$Bm=Os("Subgraph",JBm),QAd=vR($Bm,new Got("folderCounter")),Efa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{}}getCollection(){return new Txt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"subgraphs",QAd,n,o,[],i.hostnames.metadataService,i)}},Txt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("subgraphs",t,QAd,i,Efa,n.hostnames.metadataService,n)}};var XBm=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),ZBm=Os("WorkspaceUser",XBm),UAd=vR(ZBm),Cfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"users",UAd,n,o,[],i.hostnames.metadataService,i)}getCollection(){return new Ixt(this.parent,this.serviceOperations,this.logContext)}},Ixt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("users",t,UAd,i,Cfa,n.hostnames.metadataService,n)}};var e5m=zi.merge(iWn),t5m=Os("Workspace",e5m),jAd=vR(t5m,new nwi("latestCommitDate")),Sfa=class extends yC{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}getCollection(){return new Oxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"workspaces",jAd,n,o,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"],i.hostnames.metadataService,i)}get nodes(){return this.getSubCollection("nodes",vxt)}node(t){return this.nodes.get(t)}installedPackages=void 0;installedPackage=void 0;get jobs(){return this.getSubCollection("jobs",Cxt)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Sxt)}macro(t){return this.macros.get(t)}nodesLastRefreshed=void 0;nodeLastRefreshed=void 0;get nodeTypes(){return this.getSubCollection("templates",_xt)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("subgraphs",Txt)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Ixt)}workspaceUser(t){return this.workspaceUsers.get(t)}isDevEnv=void 0;removeDeletedSteps=void 0},Oxt=class extends Gv{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}async fetchWorkspacesForPermissions(t){return this.select({where:[["devEnv","==",t]],selectFields:["id","project"]})}constructor(t,n,i){super("workspaces",t,jAd,i,Sfa,n.hostnames.metadataService,n)}};var r5m=zi.merge(OWn),n5m=Os("Org",r5m),GAd=vR(n5m),_fa=class extends yC{constructor(t,n,i,o){super(t,"orgs",GAd,n,{...o,orgID:t},["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"],"NOT_SERVICE_BACKED",i)}get baseUri(){return"orgs"}getCollection(){return new Rxt(this.parent,this.serviceOperations,this.logContext)}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}get workspaces(){return this.getSubCollection("workspaces",Oxt)}workspace(t){return this.workspaces.get(t)}devRuns=void 0;devRun=void 0;globalUsersSettings=void 0;globalUsersSetting=void 0;projects=void 0;project=void 0;runs=void 0;run=void 0;userRoles=void 0;userRole=void 0;getNextCounter=void 0;releaseWorkspaceStatusAndEndRun=void 0;updateLastLoginTime=void 0;writePlanAnalytics=void 0;writeRunAnalyticsSummary=void 0},Rxt=class extends Gv{get baseUri(){return"orgs"}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}constructor(t,n,i){super("orgs",t,GAd,i,_fa,"NOT_SERVICE_BACKED",n)}};var iwi=class extends cP{constructor(t,n){super("root","root",["orgs","users","packagesRegistry","events"],void 0,n,t)}get path(){return"root"}get baseUri(){return"root"}get baseSSEUri(){return"root"}get wsQuery(){return{}}get orgs(){return this.getSubCollection("orgs",Rxt)}org(t){return this.orgs.get(t)}orgsPublic=void 0;orgPublic=void 0;users=void 0;user=void 0;packagesRegistry=void 0;registryPackage=void 0;events=void 0;event=void 0;oauthStates=void 0;oauthState=void 0;activePrompts=void 0;activePrompt=void 0;promptVersions=void 0;promptVersion=void 0;storage=void 0;batch=()=>new rwi;getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}};var Ma=class extends IEe{constructor(n,i,o,s,a,u){super(n.id,n,[],o,s,a);this.collectionRef=n;this.dataTransform=i;this.EntityRepositoryConstructor=u}get path(){return this.collectionRef.path}get(n){let i=this.firestoreOperations.docRef(this.collectionRef,n.toString());return new this.EntityRepositoryConstructor(n,i,this.parent,this.logContext,this.firestoreOperations)}async select(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>this.transformDataFromStorage(u.ref,this.firestoreOperations.data(u),i))}async selectIDs(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>u.id)}async createEntity(n,i){let o=i?.transaction,s=await this.generateID(n),a=this.firestoreOperations.docRef(this.collectionRef,s?.toString()),u=await this.prepareDataForCreate(n,s??a.id,i);return o?o.set(a,u):await tx(this.firestoreOperations.addDoc(a,u)),new this.EntityRepositoryConstructor(s||a.id,a,this.parent,this.logContext,this.firestoreOperations)}listenCollection(n,i,o){let[s,a]=this.getListenCallbacks(n,i,o);return this.firestoreOperations.onCollectionSnapshot(this.collectionRef,s,a)}listenQuery(n,i,o,s){let[a,u]=this.getListenCallbacks(i,o,s);return this.firestoreOperations.onQuerySnapshot(this.firestoreOperations.createQuery(this.collectionRef,n),a,u)}async prepareDataForCreate(n,i,o){let s=n.createdBy??this.firestoreOperations.currentUser(),a={...Vc(n),id:i,createdAt:Mk(),createdBy:s,updatedAt:Mk(),updatedBy:s};return this.dataTransform.toStorage(i.toString(),`${this.path}/${i}`,a,this.firestoreOperations,o)}getListenCallbacks(n,i,o){return[s=>{let a=this.firestoreOperations.snapShotChanges(s).reduce((u,l)=>{try{let c=this.transformDataFromStorage(l.doc.ref,l.doc.data(),o);u.push({type:l.type==="added"?"added":l.type==="removed"?"removed":"modified",value:c,id:c.id.toString(),hasPendingWrites:this.firestoreOperations.hasPendingWrites(l.doc)})}catch(c){i&&i(c)}return u},[]);Tc().debug(`Listener notification for ${a.length} changes in collection ${this.path}`),n(a)},s=>{Tc().error(`Firestore error listening to collection ${this.path}`,s),i&&i(dxt(s))}]}transformDataFromStorage(n,i,o){return this.dataTransform.fromStorage(n.id,n.path,i,this.firestoreOperations,o)}async generateID(n){return n.id}async getCount(){return this.firestoreOperations.getCount(this.collectionRef)}async selectInBatches(n,i,o,s=[]){return(await this.firestoreOperations.selectInBatches(this.collectionRef,n,i,o,s)).map(l=>l.docs).flat().map(l=>this.transformDataFromStorage(l.ref,this.firestoreOperations.data(l)))}};var i5m=M.discriminatedUnion("type",[zi.merge(yi.merge(Iy)),zi.merge(yi.merge(AWn)),zi.merge(yi.merge(yWn)),zi.merge(yi.merge(oWn)),zi.merge(yi.merge(bWn)),zi.merge(yi.merge(dWn)),zi.merge(yi.merge(sWn)),zi.merge(yi.merge(aWn)),zi.merge(yi.merge(hWn)),zi.merge(yi.merge(gWn)),zi.merge(yi.merge(mWn))]),o5m=Os("Event",i5m),HAd=Au(o5m),vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,HAd,i,o,s)}},owi=class extends Ma{constructor(t,n,i,o){super(t,HAd,n,i,o,vfa)}createEventCore(t,n,i,o,s,a,u){return{type:"core",orgID:t,event:n,resourceType:i,resourceID:o,fromID:s,requestedBy:a,requestedByUserAgent:u}}async createDuplicatePkgNodeTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"workspaces.nodeType.duplicate","NodeType",n,i,o,l),type:"duplicate",packageID:s,releaseID:a,workspaceID:u};return(await this.createEntity(d)).id}async createInstallPkgNodeTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.nodeType.install","NodeType",n,"",s,a),type:"install",packageID:n,releaseID:i,workspaceID:o};return(await this.createEntity(l)).id}async createEnableTotpTypeEvent(t,n,i){let o=this.createEventCore(t,"users.auth.enableTotp","Auth","Totp","",n,i);return(await this.createEntity(o)).id}async createDisableTotpTypeEvent(t,n,i,o){let s=this.createEventCore(t,"users.auth.disableTotp","Auth","Totp",i,n,o);return(await this.createEntity(s)).id}async createAIColumnDescriptionsTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"ai.description.columnDescriptions","AI","Description",n,n,l),type:"update",workspaceID:i,nodeID:o,acceptedDescriptionsCount:s,modifiedDescriptionsCount:a,rejectedDescriptionsCount:u};return(await this.createEntity(d)).id}async createNewWorkspaceWizardTypeEvent(t,n,i,o,s,a,u,l,c,d){let p=this.createEventCore(t,"workspaces.create.newWorkspace","NewWorkspace",i.toString(),c?.toString()??"",l,d),f=typeof s=="string"?new Date(s):s,A={...p,type:"create",projectID:n,stepNumber:o,startTime:f,endTime:a,status:u};return(await this.createEntity(A)).id}async createAINodeDescriptionTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"ai.description.nodeDescription","AI",o,"",n,a),type:"update_node_description",workspaceID:i,nodeID:o,action:s};return(await this.createEntity(l)).id}async createAIGitCommitMessageRequestEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI",u,"",n),type:"request",fileCount:i,diffContent:o,charCount:s,latencyMs:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createAIGitCommitMessageActionEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI","",n,u),type:"action",aiMessage:i,finalMessage:o,editDistance:s,action:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createMinimapEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.minimap",n,i,o.toString(),s),type:"minimap",isEnabled:a,time:new Date};return(await this.createEntity(l)).id}async createFilterToggleEvent(t,n,i,o,s){let u={...this.createEventCore(t,"workspaces.graph.filter",n.includes("subgraph")?"Subgraph":"BrowserGraph",n,i.toString(),o),type:"filterToggle",isVisible:s,time:new Date};return(await this.createEntity(u)).id}async createGraphContextFilterEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.contextMenu",i,n,o.toString(),s),type:"graphContextMenu",filter:a,time:new Date};return(await this.createEntity(l)).id}};var s5m=Os("Event",yXu),WAd=Au(s5m),Tfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,WAd,i,o,s)}},swi=class extends Ma{constructor(t,n,i,o){super(t,WAd,n,i,o,Tfa)}};var a5m=We("FIREBASE"),awi=class extends Q_{transformFromStorage(t,n,i){let o=[];i.orgName||(o.push("Adding property orgName with default value"),i.orgName="");let s=i.licenseDetails;return typeof s=="object"&&(s.trialActivator||(o.push("Adding property licenseDetails.trialActivator with default value"),s.trialActivator=""),s.companyName||(o.push("Adding property licenseDetails.companyName with default value"),s.companyName="")),o.length>0&&a5m.debug(`Patched org ${n}`,o),i}};var u5m=zi.merge(J$u),c5m=Os("GitAccount",u5m),VAd=Au(c5m),Ifa=class extends Ra{constructor(t,n,i,o,s){super(t,n,VAd,i,o,s)}},uwi=class extends Ma{constructor(t,n,i,o){super(t,VAd,n,i,o,Ifa)}async generateID(t){return t.id??Za()}};var l5m=zi.merge(TXu),d5m=Os("ProjectGitAccount",l5m),KAd=Au(d5m),Ofa=class extends Ra{constructor(t,n,i,o,s){super(t,n,KAd,i,o,s)}},cwi=class extends Ma{constructor(t,n,i,o){super(t,KAd,n,i,o,Ofa)}async generateID(t){return t.id??Za()}};var p5m=zi.merge(X$u),f5m=Os("GlobalUserSettings",p5m),YAd=Au(f5m),Rfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,YAd,i,o,s,["gitAccounts","projectGitAccounts"])}get gitAccounts(){return this.getSubCollection("gitAccounts",uwi)}gitAccount(t){return this.gitAccounts.get(t)}get projectGitAccounts(){return this.getSubCollection("projectGitAccounts",cwi)}projectGitAccount(t){return this.projectGitAccounts.get(t)}},lwi=class extends Ma{constructor(t,n,i,o){super(t,YAd,n,i,o,Rfa)}listUsers(){return this.firestoreOperations.getChildren(this.collectionRef)}};var A5m=zi.merge(U0s),h5m=Os("Project",A5m),JAd=Au(h5m),Mfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,JAd,i,o,s)}},dwi=class extends Ma{constructor(t,n,i,o){super(t,JAd,n,i,o,Mfa)}async generateID(t){return t.id??Za()}};var pwi=(r,t,n)=>{let i=typeof r=="string"?parseInt(r):r;if(isNaN(i)||i===void 0)throw new t(`Missing or invalid environment ID '${r}' context=${JSON.stringify(n)}`);return i};var g5m=We("FIREBASE"),fwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return"endTime"in o&&(s.push("Removing property 'endTime'"),delete o.endTime),(!o.version||o.version<qFe)&&(s.push(`Updating version ${o.version} to ${qFe}`),o.version=qFe),o.runDetails&&!o.runDetails.environmentID&&("toWorkspaceID"in o.runDetails&&o.runDetails.toWorkspaceID!=null?(s.push(`Found runDetails.toWorkspaceID with value ${o.runDetails.toWorkspaceID}; setting to runDetails.environmentID`),o.runDetails.environmentID=o.runDetails.toWorkspaceID.toString()):(s.push('Setting missing runDetails.environmentID to "0"'),o.runDetails.environmentID="0")),o.runDetails&&"toWorkspaceID"in o.runDetails&&(s.push("Deleting runDetails.toWorkspaceID"),delete o.runDetails.toWorkspaceID),g5m.debug(`Patched run ${n}`,s),o}};var m5m=We("FIREBASE"),Awi=class extends Q_{transformFromStorage(t,n,i){let o=[];return!i.queryResultSequence&&Array.isArray(i.history)&&i.history.length>0&&(o.push("Moving 'history[0]' to 'queryResultSequence'"),i.queryResultSequence=i.history[0]?.queryResultSequence,delete i.history),(i.runExecutionSequenceID===void 0||i.runExecutionSequenceID===null)&&(o.push("Setting 'runExecutionSequenceID' to zero"),i.runExecutionSequenceID=0),(i.name===void 0||i.name===null)&&(o.push("Setting 'name' to 'unknown'"),i.name="unknown"),i.queryResultSequence?.queryResults?.map((s,a)=>{s.isRunning!==!0&&typeof s=="object"&&(s.status||(o.push(`Setting 'status' to 'Failure' for query result ${a}`),s.status="Failure"),s.type||(o.push(`Setting 'type' to 'sql' for query result ${a}`),s.type="sql"),s.exportedRefs||(o.push(`Setting 'exportedRefs' to empty array for query result ${a}`),s.exportedRefs=[]),s.invalidExportedRefs||(o.push(`Setting 'invalidExportedRefs' to empty array for query result ${a}`),s.invalidExportedRefs=[]),s.fields||(o.push(`Setting 'fields' to empty array for query result ${a}`),s.fields=[]),s.sql||(o.push(`Setting 'sql' to empty string for query result ${a}`),s.sql=""),s.rows||(o.push(`Setting 'rows' to empty array for query result ${a}`),s.rows=[]),s.startTime||(o.push(`Setting 'startTime' to ${ofe.toISOString} for query result ${a}`),s.startTime=ofe),s.endTime||(o.push(`Setting 'endTime' to ${ofe.toISOString} for query result ${a}`),s.endTime=ofe),s.fields?.map((u,l)=>{o.push(`Setting 'type' to 'unknown' for field ${l} of query result ${a}`),u.type||(u.type="unknown")}),s.error?.message&&(s.error.errorString||(o.push(`Setting 'error.errorString' to 'error.message' for query result ${a}`),s.error.errorString=s.error.message),o.push(`Removing 'error.message' for query result ${a}`),delete s.error.message),s.error?.originalError&&(o.push(`Removing 'error.originalError' from query result ${a}`),delete s.error.originalError))}),i.runResultVersion=2,i.version=2,o.length>0&&m5m.debug(`Patched run result ${n}`,o),i}};var y5m=zi.merge(RWn),b5m=Os("QueryResult",y5m),mwi=Au(b5m),wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Pfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,wfa)}},Nfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Dfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,Nfa)}},E5m=zi.merge(PWn),C5m=Os("RunResult",E5m),ywi=Au(C5m,new Awi),xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Pfa)}queryResult(t){return this.queryResults.get(t)}},hwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,xfa)}},Bfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Dfa)}queryResult(t){return this.queryResults.get(t)}},gwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,Bfa)}};var OEe=We("FIREBASE"),S5m=M.discriminatedUnion("runType",[zi.merge(J0s),zi.merge(QXu),zi.merge($0s)]),_5m=Os("Run",S5m),Cwi=Au(_5m,new fwi,!0),kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",hwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={},n){return this.merge({...t,runHeartbeat:Mk()},{...n,retryOptions:{attempts:3,tags:["[FirestoreRunRepo.updateHeartbeat()]"],waitSeconds:5}})}},bwi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,kfa)}async createDeployRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},s=(l,c)=>(Z1s(l,"deploy",t.runDetails.forcedDeployment,o),{status:"Deploying",currentlyRunningJobs:l.currentlyRunningJobs?l.currentlyRunningJobs.concat(c):[c]}),a={...t,runDetails:{...t.runDetails}};for(let l of BXu)delete a.runDetails[l];let u=await qfa(this,i,a,s,n);return FBe(o,u.id),OEe.infoContext(o,"FirestoreOrgRepo createDeployRun: finished securing workspace"),u}async createRefreshRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},a=await qfa(this,i,t,(u,l)=>(Z1s(u,"refresh",t.runDetails.forceIgnoreWorkspaceStatus,o),{status:u.status==="Failed Deploy"?u.status:"Refreshing",currentlyRunningJobs:u.currentlyRunningJobs?u.currentlyRunningJobs.concat(l):[l]}),n);return FBe(o,a.id),OEe.infoContext(o,"FirestoreOrgRepo createRefreshRun: finished securing workspace"),a}},Lfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",gwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={}){let n=this.prepareDataForMerge(t);n.runHeartbeat=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,n)}},Ewi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,Lfa)}async createDevRun(t){let n=pwi(t.runDetails.environmentID,mo,this.logContext),i={...this.logContext,environmentID:n},o=(a,u)=>{if(!a.devEnv)throw new mo(`Unable to secure ${a.name}`,`${a.name} is a not a development workspace, context=${JSON.stringify(i)}`);return{currentlyRunningDevJobs:a.currentlyRunningDevJobs?a.currentlyRunningDevJobs.concat(u):[u]}};delete t.runDetails.dependencies;let s=await qfa(this,n,t,o);return FBe(i,s.id),OEe.infoContext(i,"FirestoreOrgRepo createDevRun: finished securing workspace"),s}},qfa=(r,t,n,i,o)=>{let s=r.parent.workspace(t),a={...r.logContext,environmentID:t};return r.runTransaction(o,async u=>{OEe.infoContext(a,"securing workspace status");let[l,c]=await Promise.all([FYn(s,vu().featureFlags,a,"FirestoreDevRunsRepo - createRun",u,vu().authToken),r.parent.getNextCounter(r.id.substring(0,r.id.length-1),1,u)]);FBe(a,c),OEe.infoContext(a,"got workspace doc data, updating workspace",{status:l?.status,jobs:l?.currentlyRunningJobs});let d=()=>{try{return i(l,c)}catch(A){if(OEe.errorContext(a,"createRun: error updating workspace",{error:A}),A instanceof cfe){let g=A.detail??`${l.name} is in state ${l.status},`;throw new y3(A.message,g+` context=${JSON.stringify(a)}.`)}throw A}};await s.merge(d(),u),OEe.infoContext(a,`Run ${c} will use the following mappings:`,l.mappingsV1),OEe.infoContext(a,"reserving run");let p=await r.prepareDataForCreate(n,c);p.runStartTime=r.firestoreOperations.getServerTimestampSentinel(),p.runHeartbeat=r.firestoreOperations.getServerTimestampSentinel();let f=r.get(c);return u.transaction.set(f.docRef,p),f})};var v5m=We("FIREBASE"),Swi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];o.projects||(o.projects={},s.push("Changing userRoles.projects from undefined to empty object"));let a=(u,l,c,d)=>{let p=l.indexOf(c);p>=0&&(s.push(`Changing ${u} role '${c}' to '${d}'`),l[p]=d)};for(let u of Object.values(o?.projects)){u.projectRoles?(a("project",u.projectRoles,"reader","member"),a("project",u.projectRoles,"owner","admin")):(u.projectRoles=[],s.push("Changing project.projectRoles from undefined to empty array"));for(let l of Object.values(u?.environments))l.environmentRoles?a("env",l.environmentRoles,"owner","admin"):(l.environmentRoles=[],s.push("Changing env.environmentRoles from undefined to empty array"))}return s.length>0&&v5m.debug(`Patched userRoles ${n}`,s),i}};var GNe=We("USER_MANAGEMENT"),T5m=zi.merge(GXu),I5m=Os("UserRoles",T5m),$Ad=Au(I5m,new Swi),zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,$Ad,i,o,s)}async upsertProjectRoles(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&!t.projectRoles.includes("admin")&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]);return Object.values(t.environments).forEach(c=>{t.projectRoles.includes("member")?c.environmentRoles=[]:t.projectRoles.includes("admin")?c.environmentRoles=["admin"]:c.environmentRoles=["reader"]}),s.projects[n]=t,await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertProjectRole(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]),c=s.projects[n];return c?c.projectRoles=[t]:s.projects[n]={projectRoles:[t],environments:{}},await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertUserOrganizationRoles(t,n){return await this.runTransaction(n,async i=>{let o;try{o=await this.fetch(i)}catch(c){if(y1(c)&&(c instanceof Ya||c instanceof m3))o={id:this.id,organizationRoles:[],projects:{}};else throw c}let s=o.organizationRoles.includes("admin"),a=t.includes("admin");s&&!a&&await this.throwIfLastOrgAdmin(i);let l=Vc(o.organizationRoles);return o.organizationRoles=t,await this.save(o,i),GNe.infoContext(this.logContext,`User org roles updated for user ${o.id}. Previous roles:`,l,"New roles:",o.organizationRoles),o})}async upsertEnvironmentRoles(t,n,i,o){return await this.runTransaction(o,async s=>{let a=await this.parent.workspace(i).fetch(s);if(a.project!==n||a.devEnv)throw new Ya(`Environment ${i} not found`);let u=await this.fetch(s);if(!u.projects[n]?.projectRoles.length)throw new m3("User must have a project role before being granted any environment roles therein");(u.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&!t.environmentRoles.includes("admin")&&await this.throwIfLastEnvironmentAdmin(n,i,s);let d=Vc(u.projects[n].environments[i]);return u.projects[n].environments[i]=t,await this.save(u,s),GNe.infoContext(this.logContext,`User env roles updated for user ${u.id} at envID ${i} in project ${n}. Previous roles:`,d,"New roles:",u.projects[n].environments[i]),u})}async upsertEnvironmentRole(t,n,i,o,s){return await this.runTransaction(s,async a=>{let u=await this.parent.workspace(i).fetch(a);if(u.project!==n||u.devEnv)throw new Ya(`Environment ${i} not found`);let l=await this.fetch(a);if((l.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastEnvironmentAdmin(n,i,a),!l.projects[n]?.projectRoles.length)if(o?.setDefaultProjectRole)l.projects[n]?l.projects[n].projectRoles=[o.setDefaultProjectRole]:l.projects[n]={projectRoles:[o.setDefaultProjectRole],environments:{}};else throw new m3("User must have a project role before being granted any environment roles therein");let p=Vc(l.projects[n].environments[i]),f=l.projects[n].environments[i];return f?f.environmentRoles=[t]:l.projects[n].environments[i]={environmentRoles:[t]},await this.save(l,a),GNe.infoContext(this.logContext,`User env roles updated for user ${l.id} at envID ${i} in project ${n}. Previous roles:`,p,"New roles:",l.projects[n].environments[i]),l})}async deleteUserProjectRoles(t,n){return await this.runTransaction(n,async i=>{let o=await this.fetch(i);(o.projects[t]?.projectRoles.includes("admin")??!1)&&await this.throwIfLastProjectAdmin(t,i);let a=Vc(o.projects[t]);delete o.projects[t],await this.save(o,i),GNe.infoContext(this.logContext,`User project roles deleted for user ${o.id} at projectID ${t}. Previous roles:`,a)})}async deleteUserEnvironmentRoles(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.fetch(o);(s?.projects[t]?.environments[n]?.environmentRoles.includes("admin")??!1)&&await this.throwIfLastEnvironmentAdmin(t,n,o);let u=Vc(s.projects[t].environments[n]);delete s.projects[t].environments[n],await this.save(s,o),GNe.infoContext(this.logContext,`User environment roles deleted for user ${s.id} at envID ${n} in project ${t}. Previous roles:`,u)})}async throwIfLastOrgAdmin(t){return await this.runTransaction(t,async n=>{if((await this.parent.userRoles.select({where:[["organizationRoles","array-contains","admin"]]},n)).length<2)throw new y3("Role change failed, at least one org admin is required")})}async throwIfLastProjectAdmin(t,n){return await this.runTransaction(n,async i=>{if((await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},i)).length<2)throw new y3("Role change failed, at least one project admin is required")})}async throwIfLastEnvironmentAdmin(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.parent.userRoles.select({where:[[`projects.${t}.environments.${n}.environmentRoles`,"array-contains","admin"]]},o),a=await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},o),u=s.length<2;if(!a.length&&u)throw new y3("Role change failed, at least one environment admin is required")})}},_wi=class extends Ma{constructor(t,n,i,o){super(t,$Ad,n,i,o,zfa)}};var O5m=We("FIREBASE"),vwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return o.status||(s.push("setting missing 'status' property to 'initializing'"),o.status="Initializing"),o.version||(s.push(`setting missing 'version' property to '${PFe}'`),o.version=PFe),o.tagColors||(s.push("Setting missing 'tagColors' property to default"),o.tagColors={backgroundColor:Ahs,textColor:"#e5e5e5"}),o.mappingsV1||(s.push("Setting missing 'mappingsV1' property to '{}'"),o.mappingsV1="{}"),o.version===0&&(o.mappings||(s.push("Setting missing 'mappings' property to empty object"),o.mappings={}),o.deployedWorkspaces||(s.push("Setting missing 'deployedWorkspaces' property to empty object"),o.deployedWorkspaces={})),(o.mappingsV1===null||o.mappingsV1===void 0)&&(s.push("Settings missing 'mappingsV1' property to an empty string"),o.mappingsV1=""),o.name||(o.name=`Workspace${t}`,s.push(`Setting missing 'name' property to '${o.name}`)),s.length>0&&O5m.debug(`Patched workspace ${n}:`,s),o}};var R5m=zi.merge(BFe),M5m=Os("InstalledPackage",R5m),XAd=Au(M5m),Ffa=class extends Ra{constructor(t,n,i,o,s){super(t,n,XAd,i,o,s)}},Twi=class extends Ma{constructor(t,n,i,o){super(t,XAd,n,i,o,Ffa)}};var w5m=zi.merge(SK),P5m=Os("Job",w5m),ZAd=Au(P5m),Qfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ZAd,i,o,s)}async fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{let o=await this.fetch(i);if(o.name!==t.name&&(await this.parent.jobs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.save(super.mergeWithDeletes(o,t),i)}):super.fetchAndMerge(t,n)}},Iwi=class extends Ma{constructor(t,n,i,o){super(t,ZAd,n,i,o,Qfa)}async generateID(t){return t.id??this.parent.parent.getNextCounter("job")}createEntity(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return await super.createEntity(t,i)}):super.createEntity(t,n)}};var N5m=zi.merge(aL),D5m=Os("Macro",N5m),ehd=Au(D5m,void 0,!0),Ufa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ehd,i,o,s)}},Owi=class extends Ma{constructor(t,n,i,o){super(t,ehd,n,i,o,Ufa)}};var x5m=zi.merge(xFe),B5m=Os("NodeType",x5m),thd=Au(B5m),jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,thd,i,o,s)}},Rwi=class extends Ma{constructor(t,n,i,o){super(t,thd,n,i,o,jfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("template")).toString()}};var k5m=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),L5m=Os("Node",k5m),rhd=Au(L5m,new XKn),Gfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,rhd,i,{...o,nodeID:t},s)}async delete(t){if(await super.delete(t),this.docRef.parent.id==="steps"){let n=this.firestoreOperations.collectionRef(this.docRef.parent.parent,"deletedSteps"),i=this.firestoreOperations.docRef(n,this.id);await this.firestoreOperations.saveDoc(i,{deletedAt:this.firestoreOperations.getServerTimestampSentinel()})}}mergeMetadata(t,n){return this.merge(Object.fromEntries(Object.entries(t).map(([i,o])=>[`metadata.${i}`,o])),n)}},Mwi=class extends Ma{constructor(t,n,i,o){super(t,rhd,n,i,o,Gfa)}async generateID(t){return t.id??Za()}listenCollection(t,n,i){throw new Yp("The firestore nodes repository listener is not implemented. Use listenCollectionOverride")}listenCollectionOverride(t,n,i,o,s){let[a,u]=this.getListenCallbacks(t,o,s),l=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.orderBy("updatedAt").startAfter(n),a,u),c=p=>{let A=[...p.docChanges()].map(g=>({type:"removed",id:g.doc.id,doc:g.doc,oldIndex:-1,newIndex:-1})).filter(g=>{let b=g.doc.data(),_=i[g.doc.id];if(_)if(_.updatedAt){let v=new Date(_.updatedAt),O=b.deletedAt?b.deletedAt.toDate():v;return v<=O}else return!0;return!1}).map(g=>({type:"removed",value:{id:g.doc.id},id:g.doc.id,hasPendingWrites:!1}));t(A)},d=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.parent.collection("deletedSteps").orderBy("deletedAt").startAfter(n),c,u);return()=>{l(),d()}}convertFromRestAPIStorage(t,n){return this.transformDataFromStorage({id:n},t)}async getNodesLocationInfo(){let t=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","name","locationName","sqlType","type"]}),n=await this.firestoreOperations.runQuery(t),i={};return n.forEach(o=>{let s=H$u.verify({operation:{...o.data()}});i[o.id]=s}),i}};var q5m=zi.merge(mXu),z5m=Os("NodeLastRefreshed",q5m),nhd=Au(z5m,void 0,!0),Hfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,nhd,i,{...o,nodeID:t},s)}},wwi=class extends Ma{constructor(t,n,i,o){super(t,nhd,n,i,o,Hfa)}async generateID(t){return t.id??Za()}};var F5m=zi.merge(VIe),Q5m=Os("Subgraph",F5m),ihd=Au(Q5m),Wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ihd,i,o,s)}fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.fetch(i)).name!==t.name&&(await this.parent.subgraphs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);let a=this.prepareDataForMerge(t,n);return i.transaction.update(this.docRef,a)}):super.fetchAndMerge(t,n)}},Pwi=class extends Ma{constructor(t,n,i,o){super(t,ihd,n,i,o,Wfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("subgraph")).toString()}async createEntity(t,n){let i=await this.generateID(t);return n?.uniquenessConstraints?this.runTransaction(n,async o=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},o)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.createEntity({...t,id:i},o)}):super.createEntity({...t,id:i},n)}};var U5m=We("FIREBASE"),Nwi=class extends Q_{transformFromStorage(t,n,i){let o=[];return["connectionDetails","authenticator"].forEach(s=>{i?.connectionDetails?.hasOwnProperty(s)&&(o.push(`deleting property 'connectionDetails.${s}']`),delete i.connectionDetails[s])}),o.length>0&&U5m.debug(`Patched workspace user ${n}`,o),i}};var j5m=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),G5m=Os("WorkspaceUser",j5m),ohd=Au(G5m,new Nwi),Vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ohd,i,o,s)}},Dwi=class extends Ma{constructor(t,n,i,o){super(t,ohd,n,i,o,Vfa)}};var H5m=zi.merge(iWn),W5m=Os("Workspace",H5m),shd=Au(W5m,new vwi,!0),Kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,shd,i,o,s,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"])}get installedPackages(){return this.getSubCollection("installedPackages",Twi)}installedPackage(t){return this.installedPackages.get(t)}get jobs(){return this.getSubCollection("jobs",Iwi)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Owi)}macro(t){return this.macros.get(t)}get nodes(){return this.getSubCollection("steps",Mwi)}node(t){return this.nodes.get(t)}get nodesLastRefreshed(){return this.getSubCollection("nodesLastRefreshed",wwi)}nodeLastRefreshed(t){return this.nodesLastRefreshed.get(t)}get nodeTypes(){return this.getSubCollection("templates",Rwi)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("folders",Pwi)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Dwi)}workspaceUser(t){return this.workspaceUsers.get(t)}async isDevEnv(){return!!(await this.fetch()).devEnv}async removeDeletedSteps(){let n=this.firestoreOperations.collectionRef(this.docRef,"deletedSteps").orderBy("__name__").limit(100),i=async(o,s)=>{try{let a=this.parent.parent.batch(),u=await n.get();if(u.size===0){o();return}let c=[...u.docs].map(d=>({docRef:d.ref}));for(let d of c)await a.delete(d,{});await a.commit(),process.nextTick(()=>{i(o,s)})}catch(a){s(a)}};return new Promise((o,s)=>i(o,s))}},xwi=class extends Ma{constructor(t,n,i,o){super(t,shd,n,i,o,Kfa)}async generateID(t){return t.id??this.parent.getNextCounter("workspace")}async fetchWorkspacesForPermissions(t){let n=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","project"],where:[["devEnv","==",t]]});return(await this.firestoreOperations.runQuery(n)).docs.map(s=>s.data())}};var V5m=zi.merge(OWn),K5m=Os("Org",V5m),ahd=Au(K5m,new awi),Y5m={gitRepo:"gitRepo",workspace:"workspace",job:"job",subgraph:"folder",location:"location",connection:"connection",template:"template",run:"run",devRun:"devRun"},Yfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ahd,i,{...o,orgID:t},s,["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"])}get devRuns(){return this.getSubCollection("devRuns",Ewi)}devRun(t){return this.devRuns.get(t)}get globalUsersSettings(){return this.getSubCollection("globalUsersSettings",lwi)}globalUsersSetting(t){return this.globalUsersSettings.get(t)}get projects(){return this.getSubCollection("projects",dwi)}project(t){return this.projects.get(t)}get runs(){return this.getSubCollection("runs",bwi)}run(t){return this.runs.get(t)}get userRoles(){return this.getSubCollection("userRoles",_wi)}userRole(t){return this.userRoles.get(t)}get workspaces(){return this.getSubCollection("workspaces",xwi)}workspace(t){return this.workspaces.get(t)}async getNextCounter(t,n=1,i){if(!n||n<=0)throw new Pee(`getNextCounter() expected reserveCount value greater than zero, received ${n}`);let o=Y5m[t];if(!o)throw new Pee(`getNextCounter() received unsupported counter name '${t}'`);return this.runTransaction(i,async s=>{let a=await this.fetch(s),u=`${o}Counter`,l=u in a?a[u]??0:0;return await this.merge({[u]:l+n},s),l+1})}async releaseWorkspaceStatusAndEndRun(t,n,i,o,s,a){return this.runTransaction(a,async u=>{let l=this.workspace(t),c=await l.fetch(u),{newStatus:d,remainingActiveRuns:p}=await o();c.status=d??c.status,i==="run"?c.currentlyRunningJobs=p:c.currentlyRunningDevJobs=p,await l.save(c,u);let f=this[i](n);return u.transaction.update(f.docRef,{...f.prepareDataForMerge(s,u),runEndTime:this.firestoreOperations.getServerTimestampSentinel()}),c.status})}async updateLastLoginTime(){let t=this.prepareDataForMerge({});t.lastLoginTime=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,t)}async writePlanAnalytics(t,n){let i=this.firestoreOperations.collectionRef(this.docRef,"planAnalytics"),o=this.firestoreOperations.docRef(i,t);await this.firestoreOperations.saveDoc(o,n)}async writeRunAnalyticsSummary(t,n,i,o,s,a){let u=this[n](t),l=this.firestoreOperations.collectionRef(u.docRef,"analyticsSummary"),c=this.firestoreOperations.docRef(l,"summary"),d=this.firestoreOperations.docRef(l,"runPhases"),p=this.firestoreOperations.batch();if(this.firestoreOperations.saveDocBatch(p,c,i),this.firestoreOperations.saveDocBatch(p,d,o),s){let f=this.firestoreOperations.docRef(l,"planPhases");this.firestoreOperations.saveDocBatch(p,f,s)}if(await this.firestoreOperations.commitBatch(p),a.length>0){let f=this.firestoreOperations.collectionRef(d,"queries"),A=500;for(let g=0;g<a.length;g+=A){let b=this.firestoreOperations.batch();a.slice(g,g+A).forEach((v,O)=>{let R=`${v.nodeId}-${v.stageName}-${g+O}`,w=this.firestoreOperations.docRef(f,R);this.firestoreOperations.saveDocBatch(b,w,v)}),await this.firestoreOperations.commitBatch(b)}}}},Bwi=class extends Ma{constructor(t,n,i,o){super(t,ahd,n,i,o,Yfa)}};var J5m=zi.merge(SXu),$5m=Os("OrgPublic",J5m),uhd=Au($5m),Jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,uhd,i,{...o,orgID:t},s)}},kwi=class extends Ma{constructor(t,n,i,o){super(t,uhd,n,i,o,Jfa)}};var X5m=zi.merge(pWn),Z5m=Os("RegistryPackageRelease",X5m),chd=Au(Z5m),$fa=class extends Ra{constructor(t,n,i,o,s){super(t,n,chd,i,o,s)}},Lwi=class extends Ma{constructor(t,n,i,o){super(t,chd,n,i,o,$fa)}};var e6m=zi.merge(fWn),t6m=Os("RegistryPackage",e6m),lhd=Au(t6m),Xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,lhd,i,o,s,["releases"])}get releases(){return this.getSubCollection("releases",Lwi)}release(t){return this.releases.get(t)}},qwi=class extends Ma{constructor(t,n,i,o){super(t,lhd,n,i,o,Xfa)}};var r6m=zi.merge(OXu),n6m=Os("ActivePrompt",r6m),dhd=Au(n6m),i6m=zi.merge(RXu),o6m=Os("PromptVersion",i6m),phd=Au(o6m),Zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,dhd,i,{...o,nodeID:t},s)}},eAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,phd,i,{...o,nodeID:t},s)}},zwi=class extends Ma{constructor(t,n,i,o){super(t,dhd,n,i,o,Zfa)}},Fwi=class extends Ma{constructor(t,n,i,o){super(t,phd,n,i,o,eAa)}};var s6m=We("FIREBASE"),Qwi=class extends Q_{transformFromStorage(t,n,i){return i.accountType||(s6m.debug(`Patched user ${n}: Setting accountType to 'normal'`),i.accountType="normal"),i}};var a6m=zi.merge(nfs),u6m=Os("User",a6m),fhd=Au(u6m,new Qwi),tAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,fhd,i,o,s)}},Uwi=class extends Ma{constructor(t,n,i,o){super(t,fhd,n,i,o,tAa)}};var jwi=class extends IEe{constructor(t){super("root",t.db,["orgs","users","packagesRegistry","events"],void 0,t.currentLogContext(),t)}get path(){return""}get orgs(){return this.getSubCollection("orgs",Bwi)}org(t){return this.orgs.get(t)}get orgsPublic(){return this.getSubCollection("orgsPublic",kwi)}orgPublic(t){return this.orgsPublic.get(t)}get users(){return this.getSubCollection("users",Uwi)}user(t){return this.users.get(t)}get packagesRegistry(){return this.getSubCollection("packagesRegistry",qwi)}registryPackage(t){return this.packagesRegistry.get(t)}get events(){return this.getSubCollection("events",owi)}event(t){return this.events.get(t)}get oauthStates(){return this.getSubCollection("oauthState",swi)}oauthState(t){return this.oauthStates.get(t)}get activePrompts(){return this.getSubCollection("activePrompts",zwi)}activePrompt(t){return this.activePrompts.get(t)}get promptVersions(){return this.getSubCollection("promptVersions",Fwi)}promptVersion(t){return this.promptVersions.get(t)}batch(){return new $Mi(this.firestoreOperations)}getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}storage(){return new XMi(this.firestoreOperations)}};var Gwi=(r,t,n)=>{let i=new ZMi,o=new jwi(r),s=new iwi({...t,eventManager:i},{});return BAd(o,{firebase:o,service:s},n,()=>new twi(o,s,()=>n("",{}).shouldMutateBoth))};var d6m=_t(Fgi());var hhd=()=>{let r=process.env.VITEST_HEARTBEAT_WORKER_PATH_OVERRIDE;if(r&&r!=="undefined")return r;let t="heartbeat-worker.js",n=s=>(0,nAa.join)(s,t),i=s=>(0,nAa.join)(s,"..","build-coa",t),o=n(__dirname);if((0,rAa.existsSync)(o))return o;for(let s of module.paths)for(let a of[n,i]){let u=a(s);if((0,rAa.existsSync)(u))return u}throw new et("Could not find a worker path")};var ghd=(0,Ahd.promisify)(setTimeout),iAa=r=>{if(!r)return;let t=parseInt(r);return isNaN(t)?void 0:t};var p6m=fB.getTracer(Ukt()??"unknown-context"),Hwi=class{logTag="[ManagedHeartbeatWorker]";logContext;task;worker;triggerExit;exitPromise;constructor(t,n,i,o){let{HEARTBEAT_CHECKIN_TIME:s,HEARTBEAT_MAX_LIFESPAN:a}=process.env,u=iAa(s)||5,l=iAa(a)||1/0;this.task={orgID:t,runID:n,runType:i,interval:u,lifespan:l,modality:o},this.logContext={...this.task};let{promise:c,resolve:d}=aT();this.exitPromise=c,this.triggerExit=d}start(){let{runType:t}=this.task,n=p6m.startSpan("run-heartbeat",{attributes:{runType:t}}),i=hhd();We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Starting worker, using path:",i),this.worker=new mhd.Worker(i,{env:process.env,workerData:this.task}),this.worker.on("online",()=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker online")}),this.worker.on("exit",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker exited with code",o),this.triggerExit(),n.end()}),this.worker.on("message",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker message:",o)}),this.worker.on("error",o=>{We("HEARTBEAT").fatalContext(this.logContext,this.logTag,"Worker error:",o)})}async stop(){if(!this.worker)throw new et("Worker was never started!");We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Shutting down worker"),this.worker.postMessage("shutdown"),await Promise.race([this.exitPromise,ghd(1e3).then(()=>this.worker?.terminate())]),We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Finished shutting down worker")}};var REe=(r,t,n="nonCLI")=>{let i=new Hwi(t.parent.id,t.id,r,n);return i.start(),()=>i.stop()};var yhd=(r,t,n,i)=>{if(t.kind==="none")throw new Aue(t.kind,"CreateActiveRunInfoFromDevRun");let o=ije(r.userCredentials,t),s={userID:n,userCredentials:o,runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},runStatus:i?"waitingToRun":"initializing",runType:"devRun",kubernetesJobUuid:i,origin:r.origin};return B3(s),s};var nx=We("RUNNER_BACKEND");var oAa=r=>r.map(t=>t.toLowerCase()),qAC=new Set(["accesstoken","authcode","clientsecret","code","codeverifier","id_token","keypair","newpassword","password","refresh_token","snowflakekeypair","snowflakepassword","token","uid","serviceaccountkey",...oAa(wFe),...oAa(EWn),...oAa(LFe)]);var sAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t);return{runTimeParameters:r.runTimeParameters,runDetails:r.runDetails,userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"deploy",kubernetesJobUuid:i,origin:r.origin}},bhd=async(r,t,n,i,o,s)=>{let a=new cT(nx,o),{measure:u,printSummary:l}=P1("[BECLI_HandleDeploy] end-to-end execution",o),{teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,{runDetails:{environmentID:f,parallelism:A,phasedNodeEdits:g,planID:b}}=r,_=p.org(c),v=parseInt(f);nx.infoContext(o,"Initializing deploy! planId:",b);let O;try{let R=await u("create user context",()=>b6(p,c,d,v,n,o)),w=await u("prepare deploy configuration",()=>{let H=HNe(R,d);return r.runDetails.fromWorkspaceData.userConnections={[v]:{[d]:H}},nx.appContext(o,Yyt(R),"BECLI_HandleDeploy"),sAa(r,R,d,s)}),{connectionManager:P,platform:z}=await u("get backend platform",()=>{let H=Math.max(...Object.values(g).map(L=>Object.keys(L).length));return fae(R,t,lie(H,s?1:A),!0,o)}),j=(H,L,W)=>pei({allWorkspaceData:w.runDetails.fromWorkspaceData,connectionManager:P,logContext:L,platform:z,renderer:i,runID:H,runInfo:w,nodesInRun:hAe(g),teamInfoAndFirebase:t,workspaceID:v,memoryMonitor:new BB},W),U=await u("create run and setup pipeline",()=>lAa(!!s,w,_,P,j,o));O=U.runCounter;let G={...o,runID:O};return await u("save pre-deploy workspace",()=>f6m(p,t,O,v,d,G)),U}catch(R){throw nx.errorContext(o,`Error during deploy for plan ${b}:`,R,R instanceof Error?R.stack:void 0),R}finally{if(!s){let R=performance.now();a.logMetric("deploy-execution",{orgID:c,planID:b,runID:O,workspaceID:v});let w=performance.now()-R;nx.infoContext(o,`[BECLI_HandleDeploy] logMetric took ${(w/1e3).toFixed(3)} seconds`),l()}}},f6m=async(r,t,n,i,o,s)=>{try{let a=`run-${n}.predeploy`,u=`user/${o}/environment/${i}/workspacePreDeploy/${a}`,l=await r.org(t.teamInfo.fbTeamID).workspace(i).fetch();nx.appContext(s,"saving workspace data",l),await r.storage().uploadFile(u,l),nx.appContext(s,`Run ${n}: Saved pre-deploy workspace state to ${u}`)}catch(a){nx.errorContext(s,"Error while saving preDeploy workspace state: ",a)}},aAa=r=>{let{runDetails:t}=r;if(t.jobID&&(t.includeNodesSelector||t.excludeNodesSelector))throw new Error("Unable to process, don't provide a JobID and Node Include/Exclude Selector(s) for 1 Refresh Run")},uAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t),s={runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"refresh",kubernetesJobUuid:i,origin:r.origin};return B3(s),s},HNe=(r,t)=>TB(r,{snowflake:n=>{let i={connectionDetails:{userID:t,user:n.user,role:n.role,warehouse:n.warehouse},connectionType:n.authenticator};return n.authenticator==="KeyPair"&&(i.connectionDetails.keyPair=n.keyPairKey),i},databricks:n=>({connectionKind:"databricks",connectionType:n.authenticator,connectionDetails:{userID:t,path:n.path}}),fabric:n=>({connectionKind:"fabric",connectionType:n.authenticator,connectionDetails:{userID:t,connectionString:n.connectionString}}),bigquery:n=>({connectionKind:"bigquery",connectionType:n.authenticator,connectionDetails:{userID:t,clientEmail:n.clientEmail??""}})}),Ehd=async(r,t,n,i,o,s)=>{let{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,{runDetails:{environmentID:c,jobID:d,parallelism:p}}=r,f=parseInt(c),A=a.org(u);aAa(r);let g=pmt(d);if(!g)nx.infoContext(o,"No job ID, refreshing all steps");else{nx.infoContext(o,"Refreshing job:",g);try{await A.workspace(f).job(g).fetch()}catch(j){throw nx.errorContext(o,`Failed to fetch job ${g}:`,j),j instanceof Ya?JPn(400,`Unable to start job ${g}`,`Job ${g} did not exist`):j}}let b=await b6(a,u,l,f,n,o),_=HNe(b,l);nx.appContext(o,Yyt(b),"BECLI_HandleRefresh"),r.runTimeParameters=await MEe(a,u,f,r.runTimeParameters);let v=uAa(r,b,l,s),O={steps:{},folders:{},jobs:{},macros:{},stepTypes:{}},R=new Set;s||(O=await g3e(f,A,new BB),O.userConnections[f][l]=_,R=tGe(v.runDetails,O)),v.runDetails.refreshDescription=KQe(v.runDetails,O.jobs);let{connectionManager:w,platform:P}=await fae(b,t,s?1:lie(R.size,p),!0,o);return lAa(!!s,v,A,w,(j,U,G)=>eGe({allWorkspaceData:O,connectionManager:w,logContext:U,platform:P,renderer:i,runID:j,runInfo:v,nodesInRun:R,teamInfoAndFirebase:t,workspaceID:f,memoryMonitor:new BB},G),o)};var A6m=async(r,t,n)=>{let o=(await r.org(t).workspace(n).fetch()).runTimeParameters??"";return LKn(o)},MEe=async(r,t,n,i)=>i?qKn(i):A6m(r,t,n),cAa=async(r,t,n,i,o,s)=>{let a=ije(t.userCredentials,i),u=await MEe(r,o.fbTeamID,parseInt(n.runDetails.environmentID),t.runTimeParameters);return n.runType==="refresh"&&(t.runDetails.forceIgnoreWorkspaceStatus!==void 0?n.runDetails.forceIgnoreWorkspaceStatus=t.runDetails.forceIgnoreWorkspaceStatus:n.runDetails.forceIgnoreWorkspaceStatus!==void 0&&delete n.runDetails.forceIgnoreWorkspaceStatus,n.runDetails.executor=t.runDetails.executor),{kubernetesJobUuid:s,origin:t.origin,reRunID:t.runDetails.runID,runDetails:n.runDetails,runStatus:s?"waitingToRun":"initializing",runTimeParameters:u,runType:"refresh",userCredentials:a,userID:o.fbUserID,version:3}},Chd=async(r,t,n,i,o,s,a)=>{let{runDetails:{environmentID:u,parallelism:l},runStatus:c,runType:d}=t,{runDetails:{runID:p}}=r;if(c!=="failed")throw new et(`Run status '${c}' is not eligible for re-run. Only failed jobs can be re-run!`);if(d!=="refresh")throw new et(`Run type '${d}' is not eligible for re-run`);if(!p)throw new et(`Invalid rerun ID '${p}'`);let{rootRepository:f,teamInfo:A,teamInfo:{fbTeamID:g,fbUserID:b}}=n,_=f.org(g),v=parseInt(u),O=await b6(f,g,b,v,i,s),R=HNe(O,b),w=await cAa(f,r,t,O,A,a),P=await g3e(v,_,new BB);w.runDetails.refreshDescription=KQe(w.runDetails,P.jobs),P.userConnections[v][b]=R;let z=await fei(_,w,P),{platform:j,connectionManager:U}=await fae(O,n,lie(z.size,a?1:l),!0,s);return lAa(!!a,w,_,U,(H,L,W)=>eGe({allWorkspaceData:P,connectionManager:U,logContext:L,platform:j,renderer:o,runID:H,runInfo:w,nodesInRun:z,teamInfoAndFirebase:n,workspaceID:v,memoryMonitor:new BB},W),s)},Shd=r=>_hd(r,"runCounter"),Hot=r=>_hd(r,"environment ID"),_hd=(r,t)=>{let n=typeof r=="number"?r:parseInt(r||"");if(!r||isNaN(n))throw new mo(`Specify a valid ${t}`,`400: ${n} is not valid`);return n},lAa=async(r,t,n,i,o,s)=>{if(r){try{nx.appContext(s,`tearing down connection manager for cloud ${t.runType} run`),await i.teardown()}catch(f){nx.errorContext(s,`error tearing down connection manager for cloud ${t.runType} run. Swallowing error.`,f)}let{runRepository:d,logContext:p}=await aCs(t,n,s);return{runCounter:d.id,logContext:p,runCompletion:Promise.resolve()}}let{runRepository:a,logContext:u}=await aCs(t,n,s),l=a.id,c=REe(t.runType,a,t.origin==="CLI"?"CLI":"nonCLI");return{runCounter:l,logContext:u,runCompletion:o(l,u,c)}};var h6m=new Map([["securetoken.googleapis.com",{path:"/securetoken",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}],["identitytoolkit.googleapis.com",{path:"/identitytoolkit",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}]]),vhd=r=>{let t=h6m.get(r.hostname);if(t&&fSe(t.enableByDefault,t.featureFlagName)){let n=new URL(OBe()),i=n.pathname;i.endsWith("/")&&(i=i.slice(0,-1)),r.pathname=i+t.path+r.pathname,r.hostname=n.hostname,r.protocol=n.protocol,r.port=n.port}return r};var Thd=async()=>{let r=fd.interceptors.request.use(t=>(typeof t.url=="string"&&(t.url=vhd(new URL(t.url)).toString()),t));return()=>fd.interceptors.request.eject(r)};var Ihd=_t(gUe());var Wot=We("FIREBASE"),g6m=3,Wwi=class extends jot{_backendUrl;_bucketPath;_forceBypassProxy;_baseStorageUrl;_axiosClient;constructor(t){super(t.storage),this._bucketPath=`v0/b/${t.bucket}/o`,this._backendUrl=t?.backendUrl??mm(),this._forceBypassProxy=!!t?.forceBypassProxy,this._axiosClient=t?.axiosClient,this._baseStorageUrl=t.emulatorStorageHost?`http://${t.emulatorStorageHost}`:"https://firebasestorage.googleapis.com"}async uploadToStorage(t,n){if(!this.isProxyEnabled)return super.uploadToStorage(t,n);Wot.info(`Uploading file to '${t}' via proxy`);let i=(0,Ihd.gzip)(new TextEncoder().encode(JSON.stringify(n))),o=await this.axios();try{let s=await o.post(this.determineProxyUrl(this._bucketPath,{name:t}),{contentEncoding:"gzip",contentType:"application/json",name:t},{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${i.length}`,"X-Goog-Upload-Header-Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable"}}),a=s.headers["x-goog-upload-url"];ed(a,"Missing upload URL in firebase cloud storage upload response","FIREBASE"),a=await this.determineProxyUrl(a);let u=+s.headers["x-goog-upload-chunk-granularity"]||262144,c=i.length,d=0;for(;c>u;){let p=Math.min(c,u),f=d+p,A=i.slice(d,f);await this.uploadChunk(a,A,d,!1),c-=p,d+=p}await this.uploadChunk(a,i.slice(d),d,!0)}catch(s){throw this.handleAxiosError(s)}}async downloadFromStorage(t){if(!this.isProxyEnabled)return super.downloadFromStorage(t);Wot.info(`Downloading file from '${t}' via proxy`);let n=await this.axios();try{return(await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})).data}catch(i){throw this.handleAxiosError(i)}}async deleteFileFromStorage(t){if(!this.isProxyEnabled)return super.deleteFileFromStorage(t);Wot.info(`Deleting file at '${t}' via proxy`);let n=await this.axios();try{await n.delete(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})}catch(i){throw this.handleAxiosError(i)}}async checkIfStorageReferenceExists(t){if(!this.isProxyEnabled)return super.checkIfStorageReferenceExists(t);Wot.info(`Checking if file at '${t}' exists via proxy`);let n=await this.axios();try{return await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`),{headers:{Authorization:`Firebase ${await this.token()}`}}),!0}catch(i){if(Ag(i)&&i.status===404)return!1;throw this.handleAxiosError(i)}}determineProxyUrl(t,n){t=t.replace(/^https:\/\/firebasestorage\.googleapis\.com\//,"");let i="?";if(n)for(let o in n){let s=n[o];s!==void 0&&(t+=`${i}${o}=${encodeURIComponent(s)}`,i="&")}return`${this.proxyUrl}?gcsforward=${encodeURIComponent(t)}`}get isProxyEnabled(){let t=!1;return typeof window<"u"&&(t=window.location.hostname==="localhost"||/(^|\.)local\./.test(window.location.hostname)),!t&&!this._forceBypassProxy&&this._baseStorageUrl==="https://firebasestorage.googleapis.com"&&vu().featureFlags.isFeatureEnabled("proxyGoogleStorage")}async uploadChunk(t,n,i,o){await IA(async()=>{Wot.info(`Uploading ${n.length} bytes at offset ${i} to '${t}'`),await(await this.axios()).post(t,n,{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":`upload${o?", finalize":""}`,"X-Goog-Upload-Offset":`${i}`}})},g6m,Wot,{})}get proxyUrl(){return`${this._backendUrl}/gcs`}async token(){return Mf.instance.getFirebaseIDToken()}async axios(){return this._axiosClient||(this._axiosClient=fd),this._axiosClient}handleAxiosError(t){if(Ag(t)){let i=t.response?.data?.message??t.message;switch(t.status){case 403:return new m3(i);case 404:return new Ya(i);default:return new et(i)}}return t}};var dAa=new Map,m6m=r=>process.env.COALESCE_FORCE_FIREBASE_REPOSITORY==="true"?"firebase":vu().featureFlags.getStringValue("serviceBackedRepositories","").split(",").includes(r)?"service":"firebase",y6m=()=>vu().featureFlags.isFeatureEnabled("mutateAllRepositories",!0),b6m=r=>({providerId:m6m(r),shouldMutateBoth:y6m()}),Ohd=({app:r,storage:t,hostname:n="localhost",token:i})=>{r||(r=X0.app());let o=dAa.get(r.name);if(!o){let s;try{s=$ut()}catch(a){throw a instanceof Nee?(We("CLI_INTERNAL").error("Deploy Service configuration error",a.diagnostics),new et("Unable to connect to Coalesce services. Please check your configuration and ensure you are properly authenticated.")):a}o=Gwi(new bxt(r,t),{getToken:async()=>typeof i=="string"?i:i(),hostnames:{schedulerService:mm(),deployService:s,metadataService:jkt(n)}},b6m),dAa.set(r.name,o)}return o},Rhd=()=>{dAa.clear()};var Mxt=We("RUNNER_BACKEND"),E6m=async r=>{try{return await Zjs(r),X0.app()}catch(t){throw Mxt.error("GetOrSetupFirebase",t),t}},C6m=async(r,t,n)=>{let i;return J6()||(i=new Wwi({storage:X0.storage(),backendUrl:t.emulatorInfo?.storage,bucket:t.storageBucket})),Ohd({app:r,storage:i,hostname:n.origin,token:Mf.instance.getFirebaseIDToken})},S6m=async(r,t,n)=>{let i,o=new lxt(Tc(),n.apiKey,!!n.emulatorInfo,t,void 0,b9e());await o.initialize(),Mf.setInstance(o),MMi(r)?i=await o.loginWithIdToken(r):i=await o.loginWithRefreshToken(r);let s=await X0.firestore().collection("users").doc(i.id).get();if(!s.exists)throw N0a("Authorization failed: User not found in firebase",{userId:i.id},{warning:(l,c)=>Mxt.warn(l,c)});let{currentTeam:a,hasSuperUserAccess:u}=s.data();if(!a)throw N0a("Authorization failed: Firestore user is missing 'currentTeam'",{userID:i.id},{warning:(l,c)=>Mxt.warn(l,c)});return{token:await o.getAuthToken(),context:{userID:i.id,orgID:a,hasSuperUserAccess:!!u}}},_6m=async(r,t,n,i)=>{let o=S9e().instance;return r&&(t.subdomain={id:r}),DP&&(t.version={id:DP.version}),o.isInitialized||await o.initialize({context:t,rootRepository:()=>n,apiClient:X3(void 0,i,{timeout:b9e()})}),o.currentFlags},Vwi=async(r,t)=>{let n=X3(t.origin,void 0,{timeout:b9e()}),i=await IA(async()=>await n.GetDatabase(),4,Mxt,{},{alterRetryStrategy:()=>({name:"backoff",base:1}),logOnRetry:"Retrying to get Firebase configuration",logOnFailure:"Failed to get Firebase configuration",failureLogLevel:"error"}),o=S9e().instance,s=oxa(t.hostname);return process.env.SCHEDULER_ADDRESS=t.origin,o.isInitialized||await IA(async()=>{await o.initializeDefaultFlags(s)},4,Mxt,{},{logOnFailure:"Failed to initialize feature flags service",failureLogLevel:"error",logOnRetry:"Retrying to initialize feature flags service",alterRetryStrategy:()=>({name:"backoff",base:1})}),TFe({logContext:vu().logContext,featureFlags:o.currentFlags},async()=>(await Thd(),pCl(()=>E6m(i),a=>S6m(r,a,i),(a,u)=>C6m(a,i,t),(a,u,l)=>_6m(s,a,u,l))))};var v6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting deploy job coa-${r}`);let s=oZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),a=new UFe(s),{runDetails:u,userCredentials:l}=a,{environmentID:c,parallelism:d,phasedNodeEdits:p,planID:f}=u,A=Hot(c),g=Oce(i,`Unable to parse runID: ${i}`),b={...o,planID:f,runID:g,workspaceID:A},{teamInfo:{fbTeamID:_,fbUserID:v},rootRepository:O}=t,R=O.org(_),w=new cT(Wa,b),{measure:P,printSummary:z}=P1("[CloudDeploy] end-to-end execution",b),j;try{let U=await P("get user connection and adjust credentials",async()=>{let Y=await Rne(R.workspace(A).workspaceUser(v),b),J=vu().featureFlags;return await SNe(_,v,A,l,Y,J),J}),G=await P("create user context",()=>b6(O,_,v,A,DNe(l),b)),{runInfo:H,maxGraphSize:L,memoryMonitor:W}=await P("prepare deploy configuration",async()=>{let Y=sAa(a,G,v,r);Y.id=g;let J=R.run(g);await J.updateHeartbeat({runStatus:"initializing"}),j=REe(Y.runType,J);let re=new wU,ne=Math.max(...Object.values(p).map(X=>Object.keys(X).length));return{runInfo:Y,maxGraphSize:ne,memoryMonitor:re}}),{connectionManager:V,platform:q}=await P("get backend platform",()=>fae(G,t,lie(L,d),!1,b));return await P("run deploy pipeline",()=>pei({allWorkspaceData:H.runDetails.fromWorkspaceData,connectionManager:V,logContext:b,platform:q,renderer:ex(U),runID:g,runInfo:H,nodesInRun:hAe(p),teamInfoAndFirebase:t,workspaceID:A,memoryMonitor:W},j))}catch(U){if(j)try{await j()}catch(G){Wa.errorContext(b,"Unable to clean up heartbeat after handling error",U,"innerError",G)}throw U}finally{w.logMetric("deploy-execution",{orgID:_,workspaceID:A,planID:f,runID:g,kubernetesJobUuid:r}),z()}},T6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting refresh job coa-${r}`);let a=uZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{teamInfo:{fbTeamID:d,fbUserID:p},rootRepository:f}=t,A=f.org(d),g=await Rne(A.workspace(u).workspaceUser(p),c),b=vu().featureFlags;await SNe(d,p,u,a.userCredentials,g,b);let _=await b6(f,d,p,u,DNe(a.userCredentials),c);a.runTimeParameters=await MEe(f,d,u,a.runTimeParameters),aAa(a);let v=uAa(a,_,p,r);v.id=l;let O=A.run(l);await O.updateHeartbeat({runStatus:"initializing"});let R=REe(v.runType,O),w=new wU;try{let P=await g3e(u,A,w),z=tGe(v.runDetails,P);v.runDetails.refreshDescription=KQe(v.runDetails,P.jobs),await O.merge({runDetails:v.runDetails});let j=HNe(_,p);P.userConnections[u][p]=j;let{connectionManager:U,platform:G}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return eGe({allWorkspaceData:P,connectionManager:U,logContext:c,platform:G,renderer:ex(b),runID:l,runInfo:v,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.error("Unable to clean up hearbeat after handling error",P,"innerError",z)}throw P}},I6m=async(r,t,n,i,o)=>{let s="[CloudReRun]";Wa.infoContext(o,`Starting re-run job coa-${r}`);let a=lZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=new jFe(a);B3(u);let{teamInfo:l,teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,f=p.org(c),A=Shd(u.runDetails.runID),g=await f.run(A).fetch();if(!g)throw new Error(`Could not find runInfo for teamID=${c}, oldRunID=${A}`);if(!ggc(g))throw new Error("Run is not eligible for rerun or a dev run");let b=Hot(g.runDetails.environmentID),_=Oce(i,`Unable to parse runID: ${i}`),v={...o,runID:_,workspaceID:b},O=await Rne(f.workspace(b).workspaceUser(d),v),R=vu().featureFlags;await SNe(c,d,b,u.userCredentials,O,R);let w=await b6(p,c,d,b,DNe(u.userCredentials),v),P=await cAa(p,u,g,w,l,r);if(P.id=_,!mgc(P)){let H=`Invalid rerun ID ${P.reRunID}`;throw Wa.errorContext(v,s,H),new mo(H)}let z=Hot(P.runDetails.environmentID);Dp("RUNNER_BACKEND",z===b,v,"Unexpected mismatch between workspace IDs for re-run and original run; workspace for re-run:",z,"workspace for original run:",b);let j=f.run(_);await j.updateHeartbeat({runStatus:"initializing"});let U=REe(P.runType,j),G=new wU;try{let H=await g3e(z,f,G),L=KQe(P.runDetails,H.jobs);await j.merge({runDetails:{...P.runDetails,refreshDescription:L}});let W=await fei(f,P,H),V=HNe(w,d);H.userConnections[z][d]=V;let{connectionManager:q,platform:Y}=await fae(w,t,lie(W.size,P.runDetails.parallelism),!1,v);return eGe({allWorkspaceData:H,connectionManager:q,logContext:v,platform:Y,renderer:ex(R),runID:_,runInfo:P,nodesInRun:W,teamInfoAndFirebase:t,workspaceID:z,memoryMonitor:G},U)}catch(H){try{await U()}catch(L){Wa.error("Unable to clean up hearbeat after handling error",H,"innerError",L)}throw H}},O6m=async(r,t,n,i,o)=>{let s="CloudDevRun:";Wa.infoContext(o,s,`Starting dev run job coa-${r}`);let a=sZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{rootRepository:d,teamInfo:{fbTeamID:p,fbUserID:f}}=t,A=d.org(p),g=await Rne(A.workspace(u).workspaceUser(f),c),b=vu().featureFlags;await SNe(p,f,u,a.userCredentials,g,b);let _=await b6(d,p,f,u,DNe(a.userCredentials),c),v=A.devRun(l);await v.updateHeartbeat({runStatus:"initializing"});let O={...yhd(a,_,f,r),id:l},R=REe(O.runType,v),w=new wU;try{let P=await g3e(u,A,w);P.userConnections[u][f]=HNe(_,f);let z=tGe(O.runDetails,P),{connectionManager:j,platform:U}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return j3c({allWorkspaceData:P,connectionManager:j,logContext:c,platform:U,renderer:ex(b),runID:l,runInfo:O,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.errorContext(c,s,"unable to clean up heartbeat with error",z,"following run error",P)}throw P}},R6m=async(r,t,n,i,o)=>{let s="[CloudPlan]",{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,c=vu().featureFlags,{currentWorkspaceData:d,desiredWorkspaceData:p,disablePresync:f,parameters:A,skippedBeforeCollection:g,userCredentials:b,useRenderCache:_,workspaceID:v}=n,O={...o,planID:i,workspaceID:v},{measure:R,printSummary:w}=P1(s,O);try{let P=await R("get platform and test connection",()=>cfd(l,u,v,a,b,c,O)),z={currentWorkspaceData:{...d,platformKind:P.name},desiredWorkspaceData:{...p,platformKind:P.name},skippedBeforeCollection:g};Wa.infoContext(O,s,`Starting plan job coa-${r}`),await lfd({disablePresync:f,skipPlanContextUpload:c.isFeatureEnabled("skipPlanContextUpload"),useRenderCache:_},ex(c),i,v,l,P,A,z,a,O)}finally{w()}},Mhd=async r=>{let t="[CloudEntry]";Wa.debug("Cloud entrypoint."),g$u(()=>{try{return Wa.getCommonLogger()}catch(b){Wa.error("Failed to get common logger for starting OpenTelemetry SDK",{error:b});return}});let n=process.env.SCHEDULER_ADDRESS;if(!n){let b="No SCHEDULER_ADDRESS defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let i=process.env.COALESCE_COA_CLOUD_TOKEN;if(!i){let b="No COALESCE_COA_CLOUD_TOKEN defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let o=await Vwi(i,new URL(n)),{rootRepository:s,teamInfo:{fbTeamID:a,fbUserID:u},featureFlags:l}=o,c={kubernetesJobUuid:r,orgID:a,userID:u};Wa.infoContext(c,t,"authenticated user");let d,{action:p,id:f,cloudRunAction:A}=M6m(c);p==="plan"?c.planID=f:c.runID=Oce(f,`Unable to parse runID: ${f}`);let g=c;try{await V3c(s,a)&&(j9i(),Wa.debugContext(g,t,"super Debug enabled"));let b=process.env.COALESCE_COA_CLOUD_REQUEST_PATH;if(!b){let v="COALESCE_COA_CLOUD_REQUEST_PATH not set!";throw Wa.emergContext(g,t,v),new et(v)}let _=await w6m(b,s,g);d=TFe({userID:u,orgID:a,logContext:g,featureFlags:l},()=>(Wa.infoContext(g,t,`${p} job ${f} started, waiting for completion`),A(r,o,_,f,g))),await d,Wa.infoContext(g,t,"job completed without exception")}catch(b){return Wa.errorContext(g,t,"error starting coa run",b),p==="plan"?Wa.infoContext(g,t,"plan job failed, no run or workspace related state to clean up"):d?(Wa.infoContext(g,t,"run was initialized, cleaning up run and workspace"),await UYn(f,p,s.org(a),b,g),Wa.infoContext(g,t,"run and workspace cleaned up")):Wa.infoContext(g,t,"run was not initialized, no run related state to clean up"),await dB(1)}await dB(0)},M6m=r=>{let t="[getCloudRunAction]",n=process.env.COALESCE_COA_CLOUD_ACTION,i=()=>{let o=process.env.COALESCE_COA_CLOUD_RUN_COUNTER;if(!o)throw new et("COALESCE_COA_CLOUD_RUN_COUNTER not set!");return o};switch(n){case"deploy":return{id:i(),action:n,cloudRunAction:v6m};case"refresh":return{id:i(),action:n,cloudRunAction:T6m};case"rerun":return{id:i(),action:n,cloudRunAction:I6m};case"devRun":return{id:i(),action:n,cloudRunAction:O6m};case"plan":{let o=process.env.COALESCE_COA_CLOUD_PLAN_ID;if(!o){let s=`Plan ID was not set! planID: ${o}`;throw Wa.emergContext(r,t,s),new et(s)}return{id:o,action:n,cloudRunAction:R6m}}default:{let o=n;throw Wa.emergContext(r,t,`received unexpected COALESCE_COA_CLOUD_ACTION value ${o}`),new et(`Error: COALESCE_COA_CLOUD_ACTION is invalid! value=${o}`)}}},w6m=async(r,t,n)=>{let i="[downloadAndCleanupFile]";Wa.infoContext(n,i,"downloading request data from",r);let o=await t.storage().downloadFile(r),s=Rj(o);Wa.infoContext(n,i,"finished parsing request data as JSON completed; deleting stored request",s);try{await t.storage().deleteFile(r),Wa.infoContext(n,i,"finished deleting stored request; dispatching cloud run")}catch(a){Wa.assertContext(n,i,`error deleting stored request at ${r}...continuing`,a)}return o};var Ghd=_t(jhd(),1),{program:lgC,createCommand:dgC,createArgument:pgC,createOption:fgC,CommanderError:AgC,InvalidArgumentError:TAa,InvalidOptionArgumentError:hgC,Command:Hhd,Argument:ggC,Option:ix,Help:mgC}=Ghd.default;var rat=_t(require("fs")),fCd=_t(Yhd());var Jhd={openapi:"3.1.0",info:{version:"1.0.0",title:"Coalesce API",description:"REST API for performing operations with the Coalesce backend."},servers:[{url:"https://app.coalescesoftware.io",description:"US primary"},{url:"https://app.eu.coalescesoftware.io",description:"Europe primary"},{url:"https://app.australia-southeast1.gcp.coalescesoftware.io",description:"Australia primary"},{url:"https://app.us-east-1.aws.coalescesoftware.io",description:"US AWS US East"},{url:"https://app.us-east-1.aws.privatelink.coalescesoftware.io",description:"US AWS US East with PrivateLink"},{url:"https://app.us-west-2.aws.coalescesoftware.io",description:"US AWS US West"},{url:"https://app.us-west-2.aws.privatelink.coalescesoftware.io",description:"US AWS US West with PrivateLink"},{url:"https://app.northamerica-northeast1.gcp.coalescesoftware.io",description:"Canada Primary"},{url:"https://app.westus2.azure.coalescesoftware.io",description:"US Azure West 2"},{url:"https://app.eastus2.azure.coalescesoftware.io",description:"US Azure East 2"}],security:[{BearerAuth:[]}],"x-coa-private-pointers":["/paths/~1api~1v2~1render","/paths/~1api~1v2~1render~1health","/components/schemas/PackageDefinition","/components/schemas/RenderRequestV2"],components:{schemas:{PlatformKind:{type:"string",enum:["snowflake","fabric","databricks","bigquery"]},DatabaseInfo:{type:"object",required:["apiKey","authDomain","projectId","storageBucket","messagingSenderId","appId","measurementId"],properties:{apiKey:{type:"string"},authDomain:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},appId:{type:"string"},measurementId:{type:"string"},emulatorInfo:{type:"object",required:["auth","firestore","storage"],properties:{auth:{type:"string"},firestore:{type:"string"},storage:{type:"string"}}}}},EnvironmentsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of environment information.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/Environment"}},{type:"array",items:{$ref:"#/components/schemas/EnvironmentSummary"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["number","null"],description:"The field value representing the start of the next page of results."}}},FeatureFlagsClientConfig:{type:"object",description:"Information a client needs to connect to the feature flag service.",required:["launchDarklyClientID"],properties:{launchDarklyClientID:{type:"string"}}},FeatureFlagsValues:{type:"object",description:"Feature flag values.",properties:{featureFlags:{additionalProperties:{oneOf:[{type:"boolean"},{type:"string"},{type:"number"},{type:"object"},{type:"array"}]}}},required:["featureFlags"]},ProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/Project"}}}},ProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Information about a project.",$ref:"#/components/schemas/Project"}}},ProjectGitAccountResponse:{$ref:"#/components/schemas/ProjectGitAccountResponseData"},ProjectGitAccountsResponse:{type:"object",required:["data"],properties:{data:{description:"A colleciton of project git accounts",type:"array",items:{$ref:"#/components/schemas/ProjectGitAccountResponseData"}}}},TypesenseConfigResponse:{description:"Summary of configuration data for Typesense in a given org.","x-coa-private":!0,type:"object",required:["typesenseKey","typesenseHosts"],properties:{typesenseKey:{description:"The Typesense access key scoped to a users org.",type:"string"},typesenseHosts:{description:"The Typesense host address(es) for our cluster(s).",type:"array",items:{type:"string"}}}},EnvironmentSummary:{type:"object",description:"Summary information about an environment.",additionalProperties:!1,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string",description:"The Environment ID."},name:{type:"string",description:"Name of the Environment."},project:{type:"string",description:"The Project ID."},status:{$ref:"#/components/schemas/EnvironmentHealth",description:"Status of the Environment."}},required:["createdAt","id","name","project","status"]},ErrorResponse:{description:"Error detail in addition to the HTTP status code and text.",type:"object",required:["error"],properties:{error:{$ref:"#/components/schemas/Error"}}},NodesResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of nodes for an environment.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/NodeSummary"}},{type:"array",items:{$ref:"#/components/schemas/Node"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["string","null"],description:"The field value representing the start of the next page of results."}}},NodeSummary:{type:"object",properties:{database:{type:"string",description:"The Snowflake database name."},id:{type:"string",description:"The Coalesce Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The database schema name."}},required:["database","id","locationName","name","nodeType","schema"]},OrderByDirection:{description:"The sort order for query results.",type:"string",enum:["asc","desc"]},PackageCreateEntity:{description:"A single package entity to be created.","x-coa-private":!0,type:"object",properties:{macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}}},required:["macros","dependencies","nodeTypes"]},PackageDependency:{description:"A package dependency.","x-coa-private":!0,type:"object",required:["version","macros","dependencies","releaseID","alias","packageID"],properties:{packageID:{type:"string",minLength:1},alias:{type:"string"},version:{type:"string"},releaseID:{type:"string",minLength:1},macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}}},examples:[{name:"foo",version:"1.2.3",macros:"{% macro bar() %}hello,{% endmacro %}",nodeTypes:{},dependencies:{dep:{name:"baz",version:"1.1.1",macros:"{% macro bar() %}world!{% endmacro %}",dependencies:{}}}}]},PackageEntityTagV1:{description:"Identifies the package from which the entity came. (Deprecated, see PackageEntityTagV2).","x-coa-private":!0,type:"object",required:["id","version"],properties:{id:{type:"string"},version:{type:"string"}}},PackageEntityTagV2:{description:"Identifies the package from which the entity came.","x-coa-private":!0,type:"object",required:["id","releaseID"],properties:{id:{type:"string"},releaseID:{type:"string"}}},PackageMacro:{description:"A macro in a package.","x-coa-private":!0,type:"string"},PackageNodeType:{description:"A node type in a collection of nodeTypes to be packaged.","x-coa-private":!0,type:"object",required:["name","version","isDisabled","metadata","id"],properties:{name:{type:"string"},version:{type:"number"},id:{type:"string"},isDisabled:{type:"boolean"},metadata:{type:"object"}}},PackageCreateReleaseInfo:{description:"Package release information for a create operation.","x-coa-private":!0,type:"object",properties:{changeLog:{type:"string"},version:{type:"string"},certified:{type:"boolean"}},required:["changeLog","version"]},PackageCreateEntities:{description:"Entities that are part of a package release.","x-coa-private":!0,required:["dependencies","nodeTypes","macros"],properties:{dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}},macros:{type:"string"}}},RunsOrderBy:{description:"The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type.",type:"string",enum:["id","runStartTime","runEndTime"]},RunsResponse:{description:"A collection of runs.",type:"object",required:["limit","next","orderBy","orderByDirection","data"],properties:{limit:{description:"The maximum number of runs returned by this query.",type:"integer"},next:{description:"The field value representing the start of the next page of results.",type:["number","string","null"]},orderByDirection:{$ref:"#/components/schemas/OrderByDirection"},orderBy:{$ref:"#/components/schemas/RunsOrderBy"},data:{description:"A collection of runs.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/RunSummary"}},{type:"array",items:{$ref:"#/components/schemas/RunInfo"}}]}}},RunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of run results.",type:"array",items:{$ref:"#/components/schemas/RunResult"}}}},StoredRunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"Raw run results from external storage.",type:"array",items:{$ref:"#/components/schemas/StoredRunResult"}}}},RunSummary:{type:"object",properties:{id:{description:"The run ID.",type:"integer"},reRunID:{description:"If this is a re-run, the ID of the original operation.",type:"string"},runStartTime:{description:"The datetime the run started.",type:"string",format:"date-time"},runEndTime:{description:"The datetime the run ended.",type:"string",format:"date-time"},runType:{$ref:"#/components/schemas/RunType"},runStatus:{$ref:"#/components/schemas/RunStatus"},environmentID:{description:"The environment in which the run operation was applied.",type:"string"},runFailureReason:{description:"Information about the cause of a run failure.",type:"string"}},required:["id","runType","runStatus"]},UserEnvironmentRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserEnvironmentRoles"},additionalProperties:!1},UserProjectRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserProjectRoles"},additionalProperties:!1},UserRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserOrgRoles"},additionalProperties:!1},SingleUserRoleResponseV2:{$ref:"#/components/schemas/UserOrgRolesV2"},UserRoleResponseV2:{type:"object",properties:{userRoles:{type:"array",items:{$ref:"#/components/schemas/UserOrgRolesV2"}}},required:["userRoles"],additionalProperties:!1},FivetranProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/FivetranProject"}}}},FivetranProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran project data.",$ref:"#/components/schemas/FivetranProject"}}},FivetranJobsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of job information.",type:"array",items:{$ref:"#/components/schemas/FivetranJob"}}}},FivetranJobHistoryResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran job history data.",$ref:"#/components/schemas/FivetranJobHistory"}}},FivetranRefreshJobResponse:{type:"object",required:["data"],properties:{data:{description:"A fivetran job",$ref:"#/components/schemas/FivetranJobHistory"}}},MetricsItem:{type:"object",required:["name","tags","count"],properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}},count:{type:"integer"}}},MetricsRequest:{type:"object",required:["metrics"],properties:{metrics:{type:"array",items:{$ref:"#/components/schemas/MetricsItem"}}}},BaseEnvironment:{type:"object",description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",additionalProperties:!0,properties:{connectionAccount:{type:"string",description:"The account name for the environment connection."},defaultStorageMapping:{type:"string",nullable:!0},description:{type:"string",description:"The Environment description."},name:{type:"string",description:"The Environment name."},oauthEnabled:{type:"boolean",description:"If OAuth is enabled."},runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},tagColors:{$ref:"#/components/schemas/TagColor"},project:{type:"string"}},required:["name","oauthEnabled","project"]},Environment:{description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",allOf:[{$ref:"#/components/schemas/BaseWorkspaceEnv"},{type:"object",additionalProperties:!0,properties:{runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},currentMappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},required:["createdAt","id","status"]}]},EnvironmentCreateRequest:{"x-coa-private":!0,type:"object",description:"Initial values to set on a newly created environment.",allOf:[{$ref:"#/components/schemas/BaseEnvironment"},{type:"object",properties:{mappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},additionalProperties:!0}]},EnvironmentHealth:{type:"string",enum:["Deleting","Deploying","Failed Deploy","Failed Dev Run","Failed Refresh","Initializing","Refreshing","Running Dev Run","Waiting"]},EnvironmentStorageLocationMappings:{type:"object",description:"The Storage Mapping name.",additionalProperties:{type:"object",properties:{database:{type:"string",description:"The database name."},schema:{type:"string",description:"The database schema."}}}},BaseProject:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},required:["name"]},Project:{description:"A project groups environments and workspaces for easier management and access control.",allOf:[{$ref:"#/components/schemas/BaseProject"},{type:"object",additionalProperties:!0,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},updatedBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string"},status:{$ref:"#/components/schemas/ProjectStatus"},workspaces:{type:"array",items:{$ref:"#/components/schemas/WorkspaceSummary"}}},required:["createdAt","updatedAt","id","status","name"]}]},ProjectCreateRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1,required:["name","platformKind"]},ProjectPatchRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1},ProjectStatus:{type:"string",enum:["active","deleted"]},ProjectGitAccountResponseData:{type:"object",required:["gitAccountID","userID"],properties:{gitAccountID:{type:"string"},userID:{type:"string"}}},ProjectGitAccountSetRequest:{required:["gitAccountID"],properties:{gitAccountID:{type:"string"}}},UserSummary:{type:"object",description:"Summary information about a user.",additionalProperties:!1,properties:{id:{type:"string",description:"The user ID."},firstName:{type:"string",description:"User first name."},lastName:{type:"string",description:"User last name."},email:{type:"string"},accountType:{type:"string",enum:["SSO","normal"]}},required:["id"]},FirestoreWebTimestamp:{type:"object",description:"Timestamp from the web Firestore SDK.",additionalProperties:!1,properties:{seconds:{type:"number"},nanoseconds:{type:"number"}},required:["seconds","nanoseconds"]},FirestoreAdminTimestamp:{type:"object",description:"Timestamp from the admin Firestore SDK.",additionalProperties:!1,properties:{_seconds:{type:"number"},_nanoseconds:{type:"number"}},required:["_seconds","_nanoseconds"]},FirestoreTimestamp:{type:"object",description:"Timestamp from either the web admin Firestore SDKs.",oneOf:[{$ref:"#/components/schemas/FirestoreWebTimestamp"},{$ref:"#/components/schemas/FirestoreAdminTimestamp"}]},"Common.schema1":{type:"string",enum:["snowflake","databricks","fabric","bigquery"]},Error:{type:"object",additionalProperties:!1,properties:{errorString:{description:"The error message.",type:"string"},errorDetail:{description:"Additional detail about the error.",type:"string"}},required:["errorString"]},Node:{type:"object",oneOf:[{$ref:"#/components/schemas/SourceNode"},{$ref:"#/components/schemas/SQLNode"}]},NodeCreateRequest:{type:"object",properties:{nodeType:{$ref:"#/components/schemas/NodeType"},predecessorNodeIDs:{default:[],type:"array",items:{type:"string"},description:"The IDs of the nodes that are predecessors to this node. It can also be empty if it has no predecessors"}},additionalProperties:!1,required:["nodeType","predecessorNodeIDs"]},AliasToStepIDMapping:{type:"object",additionalProperties:{type:"string"}},AppliedColumnTests:{type:"object",description:"Will return `hasNull` or `isDistinct` as true or false if testing is enabled.",additionalProperties:{type:"boolean"}},BaseNode:{type:"object",additionalProperties:!0,properties:{database:{type:"string",description:"The Snowflake database name."},description:{type:"string",description:"The Node description."},id:{type:"string",description:"The Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The Snowflake schema name."}},required:["database","description","id","locationName","name","nodeType","schema"]},ColumnMetadata:{type:"object",additionalProperties:!1,properties:{appliedColumnTests:{$ref:"#/components/schemas/AppliedColumnTests"},columnID:{type:"string",description:"The column ID."},columnReferences:{items:{$ref:"#/components/schemas/IntermediateColumnRefResult"},type:"array"},config:{type:"object",description:"Returns any configuration options from the Node Config Tab.",additionalProperties:!0},dataType:{type:"string",description:"Column data type."},defaultValue:{type:"string",description:"The default column value."},description:{type:"string",description:"The column description."},hashDetails:{$ref:"#/components/schemas/HashMetadata"},hashedColumns:{type:"array",items:{$ref:"#/components/schemas/ColumnReference"}},isBusinessKey:{type:"boolean",description:"Tags the column as a business key."},isChangeTracking:{type:"boolean",description:"Tags the column as a change tracking column in type 2 dimensions."},isSurrogateKey:{type:"boolean",description:"Tags the column as a surrogate key, e.g. DIM_CUSTOMER_KEY."},keyColumnType:{type:"string",enum:["None","primaryBusinessKey","surrogateKey"]},name:{type:"string",description:"The column name."},nullable:{type:"boolean",description:"If the column can contain null values."},primaryKey:{description:"Tags the column as a primary key.",type:"boolean"},sources:{items:{$ref:"#/components/schemas/SourceColumnReferenceV1"},type:"array"},systemColumnType:{type:"string",enum:["None","sysCreateDate","sysCurrentFlag","sysEndDate","sysStartDate","sysUpdateDate","sysVersion"]},transform:{type:"string"},uniqueKey:{type:"boolean"},isSystemCreateDate:{type:"boolean"},isSystemUpdateDate:{type:"boolean"},isSystemStartDate:{type:"boolean"},isSystemEndDate:{type:"boolean"},isSystemVersion:{type:"boolean"},isSystemCurrentFlag:{type:"boolean"}},required:["columnID","dataType","description","name","nullable"]},ColumnReference:{type:"object",additionalProperties:!1,properties:{columnID:{type:"string",description:"Column ID of the source column."},nodeID:{type:"string",description:"Node ID of the source columm."}},required:["columnID","nodeID"]},CustomSQL:{type:"object",additionalProperties:!1,properties:{customSQL:{type:"string"}},required:["customSQL"]},HashAlgorithm:{type:"string",enum:["MD5","SHA1","SHA256"]},HashMetadata:{type:"object",additionalProperties:!1,properties:{hashAlgorithm:{$ref:"#/components/schemas/HashAlgorithm"},hashType:{enum:["ChangeHash","Hash","HubHash","LinkHash","None"],type:"string"},hubHashes:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"}},required:["hashAlgorithm"]},IntermediateColumnRefResult:{additionalProperties:!1,properties:{columnName:{type:"string"},tableName:{type:"string",nullable:!0}},required:["columnName","tableName"],type:"object"},JoinCondition:{type:"object",additionalProperties:!1,properties:{joinCondition:{type:"string"}},required:["joinCondition"]},NodeType:{anyOf:[{type:"string",enum:["Dimension","Fact","Hub","Link","Satellite","Source","Stage","View","persistentStage"]},{type:"string"}]},RefLink:{type:"object",additionalProperties:!1,properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]},SourceColumnReference:{anyOf:[{$ref:"#/components/schemas/SourceColumnReferenceV1"},{$ref:"#/components/schemas/SourceColumnReferenceV2"}]},SourceColumnReferenceV1:{type:"object",additionalProperties:!1,properties:{columnReferences:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"},transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["columnReferences","transform"]},SourceColumnReferenceV2:{type:"object",additionalProperties:!1,properties:{transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["transform"]},SourceMap:{additionalProperties:!1,properties:{aliases:{$ref:"#/components/schemas/AliasToStepIDMapping"},customSQL:{$ref:"#/components/schemas/CustomSQL"},dependencies:{items:{$ref:"#/components/schemas/RefLink"},type:"array"},join:{$ref:"#/components/schemas/JoinCondition"},name:{type:"string"},noLinkRefs:{items:{$ref:"#/components/schemas/RefLink"},type:"array"}},required:["dependencies","join","name","noLinkRefs"],type:"object"},RunStatus:{enum:["canceled","completed","failed","initializing","rendering","running","waitingToRun"],type:"string"},RunType:{enum:["deploy","refresh"],type:"string"},BigQueryUserConnectionType:{type:"string",enum:["ServiceAccount","OAuth"]},DatabricksUserConnectionType:{type:"string",enum:["Token","Cloud","OAuthU2M","OAuthM2M"]},FabricUserConnectionType:{type:"string",enum:["oauth"]},SnowflakeUserConnectionType:{type:"string",enum:["Basic","Cloud","KeyPair","OAuth"]},DeployRunDetails:{type:"object",additionalProperties:!1,description:"Deployment run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},deployCommit:{type:"string",description:"The full commit hash."},deployCommitMessage:{type:"string",description:"The commit message."},environmentID:{type:"string",description:"The Environment ID for this run."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},nodesInRun:{type:"integer",description:"The number of Nodes deployed."}},required:["deployCommit","environmentID"]},RefreshRunDetails:{type:"object",additionalProperties:!1,description:"Refresh run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},environmentID:{type:"string",description:"The Environment ID for this run."},excludeNodesSelector:{type:"string",description:"A selector string of nodes to exclude."},forceIgnoreEnvironmentStatus:{type:"boolean"},includeNodesSelector:{type:"string",description:"A selector string of nodes to include."},jobID:{type:"integer",description:"The Job ID."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},refreshDescription:{type:"string",description:"The Job name."},nodesForRefresh:{type:"integer"},nodesInRun:{type:"integer",description:"The number of Nodes deployed."},executor:{type:"string"}},required:["environmentID"]},RunDetails:{description:"Detailed information about a run.",anyOf:[{$ref:"#/components/schemas/DeployRunDetails"},{$ref:"#/components/schemas/RefreshRunDetails"}]},RunInfo:{description:"The full details of a run, without the run results.",type:"object",additionalProperties:!1,properties:{id:{type:"integer"},reRunID:{type:"string",description:"If this is a re-run, the ID of the original operation."},runDetails:{$ref:"#/components/schemas/RunDetails"},runEndTime:{format:"date-time",type:"string",description:"The datetime when the run ended."},runFailureReason:{type:"string",description:"The reason the run failed."},runHistory:{items:{type:"integer"},type:"array"},runStartTime:{format:"date-time",type:"string",description:"The datetime the run started."},runStatus:{$ref:"#/components/schemas/RunStatus"},runTimeParameters:{type:"object",description:"The default Environment parameters. Parameters changed during deploy will not show here.",additionalProperties:!0},runType:{$ref:"#/components/schemas/RunType"},userCredentials:{oneOf:[{$ref:"#/components/schemas/SnowflakeUserCredentials"},{$ref:"#/components/schemas/DatabricksUserCredentials"},{$ref:"#/components/schemas/FabricUserCredentials"},{$ref:"#/components/schemas/BigQueryUserCredentials"}]},userID:{type:"string"},projectID:{type:"string"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures."},version:{type:"integer"},renderingProgress:{type:"object",description:"Progress information for the rendering phase",properties:{totalNodes:{type:"integer",minimum:0,description:"Total number of nodes to render"},completedNodes:{type:"integer",minimum:0,description:"Number of nodes completed so far"}},required:["totalNodes","completedNodes"]}},required:["id","runDetails","runStatus","runTimeParameters","runType","projectID"]},BigQueryUserCredentials:{description:"Information about the BigQuery account used to perform a run.",type:"object",additionalProperties:!1,properties:{bigQueryAuthType:{$ref:"#/components/schemas/BigQueryUserConnectionType"}},required:["bigQueryAuthType"]},FabricUserCredentials:{description:"Information about the Fabric account used to perform a run.",type:"object",additionalProperties:!1,properties:{fabricConnectionString:{type:"string"},fabricAuthType:{$ref:"#/components/schemas/FabricUserConnectionType"},platformKind:{type:"string"}},required:["fabricConnectionString","fabricAuthType"]},DatabricksUserCredentials:{description:"Information about the Databricks account used to perform a run.",type:"object",additionalProperties:!1,properties:{databricksHost:{type:"string"},databricksAuthType:{$ref:"#/components/schemas/DatabricksUserConnectionType"},databricksPath:{type:"string"}},required:["databricksHost","databricksAuthType","databricksPath"]},SnowflakeUserCredentials:{description:"Information about the Snowflake account used to perform a run.",type:"object",additionalProperties:!1,properties:{snowflakeAccount:{type:"string"},snowflakeAuthType:{$ref:"#/components/schemas/SnowflakeUserConnectionType"},snowflakeRole:{type:"string"},snowflakeUsername:{type:"string"},snowflakeWarehouse:{type:"string"}},required:["snowflakeAccount","snowflakeAuthType","snowflakeUsername"]},QueryResult:{type:"object",additionalProperties:!1,properties:{endTime:{type:"string",format:"date-time"},error:{$ref:"#/components/schemas/Error"},isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string",description:"The name of the Stage the query ran on."},queryID:{type:"string"},rowsDeleted:{type:"integer"},rowsInserted:{type:"integer"},rowsUpdated:{type:"integer"},sql:{type:"string",description:"The SQL query run during the stage."},startTime:{type:"string",format:"date-time"},status:{type:"string",description:"The query status."},success:{type:"boolean",description:"If the query results were run successfully."},type:{type:"string",enum:["sql","sqlTest"]},warehouse:{type:"string",description:"Name of the warehouse."}},required:["isRunning","name","sql","status","success"]},RunResult:{type:"object",additionalProperties:!1,description:"The result output describing each query processed during a run.",properties:{isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string"},nodeID:{type:"string"},runState:{type:"string"},hasTestFailures:{type:"boolean"},origin:{$ref:"#/components/schemas/RunOrigins"},queryResults:{description:"The query result returns the status of different stages such as Delete Table or Rename Table. See the queryResults name for the stage.",items:{$ref:"#/components/schemas/QueryResult"},type:"array"},renderQueryResult:{$ref:"#/components/schemas/QueryResult"}},required:["isRunning","name","nodeID","queryResults"]},RunOrigins:{type:"string",enum:["API","CLI","UI","fivetranAPI"]},StoredRunResult:{type:"object",additionalProperties:!0,description:"Raw run result from external storage matching the core-types RunResult",properties:{id:{type:"string",description:"The node ID"},dataResult:{description:"Data result - can be a record of values or a completed query result",oneOf:[{type:"object",nullable:!0,additionalProperties:{oneOf:[{type:"number"},{type:"string"},{type:"boolean"}]}},{$ref:"#/components/schemas/CompletedQueryResult"}]},name:{type:"string",description:"The name of the node"},queryResultSequence:{$ref:"#/components/schemas/QueryResultSequence"},runExecutionSequenceID:{type:"integer",description:"The execution sequence ID"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures"},runResultVersion:{type:"integer",enum:[2],default:2,description:"Version of the run result format"},runState:{type:"string",enum:["waiting","queued","running","complete","error","skipped","canceled"],description:"The state of the run"},stepRunState:{type:"string",enum:["None","Error","Validated","Created","DataLoaded","Skipped"],description:"The state of the step run"},version:{type:"integer",enum:[2],default:2,description:"Version field"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","name","queryResultSequence","runState","stepRunState","version","createdAt","updatedAt"]},QueryResultSequence:{type:"object",additionalProperties:!0,properties:{name:{type:"string"},queryResults:{type:"array",items:{oneOf:[{$ref:"#/components/schemas/CompletedQueryResult"},{$ref:"#/components/schemas/RunningQueryResult"}]}},isRunning:{type:"boolean"},renderQueryResults:{$ref:"#/components/schemas/CompletedQueryResult",description:"Legacy field - unused"}},required:["name","queryResults","isRunning"]},CompletedQueryResult:{type:"object",additionalProperties:!0,properties:{endTime:{type:"string",format:"date-time"},error:{type:"object",properties:{errorString:{type:"string"},errorDetail:{type:"string"}},required:["errorString","errorDetail"],nullable:!0},fields:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}},isRunning:{type:"boolean"},name:{type:"string"},sql:{type:"string"},startTime:{type:"string",format:"date-time"},status:{type:"string",enum:["Success","Failure","Canceled","Queued","Running","Transaction exceeded data limit, returned a subset of rows"]},success:{type:"boolean"},type:{type:"string",enum:["sql","sqlTest"]},exportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}},invalidExportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}}},required:["name","isRunning","status","success","type","exportedRefs","invalidExportedRefs","startTime","endTime","sql","fields"]},RunningQueryResult:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},isRunning:{type:"boolean",enum:[!0]}},required:["name","isRunning"]},OrgRoles:{type:"object",description:"Specifies role assignments.",required:["organizationRoles","projects"],properties:{organizationRoles:{description:"The organization roles assigned to the user.",type:"array",items:{type:"string"}},projects:{description:"A dictionary of project role assignments keyed by project ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/ProjectRoles"}}},additionalProperties:!0},ProjectRoles:{type:"object",description:"Specifies project role assignments.",required:["projectRoles","environments"],properties:{projectRoles:{type:"array",items:{type:"string"}},environments:{description:"A dictionary of environment role assignments keyed by environment ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/EnvironmentRoles"}}},additionalProperties:!0},EnvironmentRoles:{type:"object",description:"Specifies environment role assignments.",required:["environmentRoles"],properties:{environmentRoles:{description:"The environment roles assigned to the user.",type:"array",items:{type:"string"}}},additionalProperties:!0},UserOrgRoles:{description:"The roles assigned to a user.",allOf:[{$ref:"#/components/schemas/OrgRoles"},{type:"object",required:["user","organizationRoles","projects"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserProjectRoles:{description:"The project roles assigned to the user.",allOf:[{$ref:"#/components/schemas/ProjectRoles"},{type:"object",required:["user","projectRoles","environments"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserEnvironmentRoles:{description:"The environment roles assigned to the user.",allOf:[{$ref:"#/components/schemas/EnvironmentRoles"},{type:"object",required:["user"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserOrgRolesV2:{description:"The roles assigned to a user.",type:"object",properties:{userID:{type:"string"},organizationRole:{description:`The user role for the org. If the user's organization role does not grant any project permissions and an
|
|
10370
|
+
`+c:c;break;case"event":n.event=c;break;case"id":r(n.id=c);break}}}}function QBm(r,t){let n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),n}function kAd(){return{data:"",event:"",id:""}}var Gv=class extends cP{constructor(n,i,o,s,a,u,l){super(n,n,[],i,s,l);this.dataTransform=o;this.EntityRepositoryConstructor=a;this.hostname=u;this.eventManager=this.serviceOperations.eventManager.getCollection(n)}eventManager;async addAuthHeader(n={}){let i=await this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}get path(){return`${this.parent.path}/${this.id}`}get bulkUri(){throw new Yp("This entity does not support bulk operations")}get(n){return new this.EntityRepositoryConstructor(n,this.parent,this.serviceOperations,this.logContext)}encodeQueryComponent(n){if(n!==void 0)return Buffer.from(JSON.stringify(n)).toString("base64")}async select(n,i){let o=!1,s=0,a=[],u;n?.startingFrom&&(v0(n.startingFrom)?u=n.startingFrom:u=[n.startingFrom]);let l=this.encodeQueryComponent(u),c=n?.where?n?.where.map(_=>({field:_[0],operation:_[1],value:_[2]})):void 0,d=this.encodeQueryComponent(c),p;n?.orderBy&&(n.orderBy.length===0?p=[{field:"id",direction:"asc"}]:p=n?.orderBy.map(_=>({field:_[0],direction:_[1]})));let f=this.encodeQueryComponent(p),A=500,g=n?.limit??1/0;for(;!o;){let _=Math.min(A,g-s),v=await this.addAuthHeader(),O=await fd.get(`${this.hostname}${this.baseUri}`,{headers:v,params:{limit:_,startAfter:l,where:d,orderBy:f}}),R=O.data.data.map(w=>this.dataTransform.fromStorage(w.id.toString(),this.path,w,i));a.push(...R),s+=_,l=O.data.nextCursor,(R.length<_||s>=g)&&(o=!0)}let b=n?.selectFields;return b?a.map(_=>ub(_,b)):a}async selectIDs(n,i){return(await this.select({...n,selectFields:["id"]},i)).map(s=>s.id)}async selectInBatches(n,i,o,s=[]){return this.select({where:[...s,[n,i,o]]})}async createEntity(n,i){let o=await this.generateID(n),s=this.dataTransform.toStorage(o.toString(),`${this.path}/${o}`,n,i),a=await this.addAuthHeader(),l=(await fd.post(`${this.hostname}${this.baseUri}`,s,{headers:a,method:"post"})).data,c=this.dataTransform.fromStorage(String(l.id),`${this.path}/${l.id}`,l,i);return this.eventManager.publishEvents([{type:"added",value:c,id:String(l.id),hasPendingWrites:!1}]),new this.EntityRepositoryConstructor(l.id,this.parent,this.serviceOperations,this.logContext)}listenCollection(n,i,o){let s=this.eventManager.registerListener(n),a;try{console.log(`start subscription ${this.baseSSEUri}`),a=pfa(new URL(this.baseSSEUri,window.location.origin),{auth:async()=>{let u=await this.getToken();return ed(!!u,"Cookie-based auth is not yet supported for service-backed repositories","COMMON"),"Bearer "+u},onMessage:u=>{try{switch(u.event){case"entity":{let l=JSON.parse(u.data);if(l.type==="added"||l.type==="modified"){let c=this.dataTransform.fromStorage(l.id,`${this.path}/${l.id}`,l.value,o);this.eventManager.publishEvents([{type:l.type,value:c,id:l.id,hasPendingWrites:!1}])}else this.eventManager.publishEvents([{type:"removed",value:{},id:l.id,hasPendingWrites:!1}]);break}case"error":{if(i){let l=JSON.parse(u.data),c=new et(l.error.errorString,l.error.errorDetail);i(c)}break}case"connected":case"ready":case"disconnect":default:}}catch(l){We("COMMON").errorContext(this.logContext,"Failed to interpret SSE message",l),l instanceof Error&&i&&i(l)}},onError:u=>{u instanceof Error&&i&&i(u)}}),console.log(`subscription started ${this.baseSSEUri}`),this.select().then(u=>{this.eventManager.publishEvents(u.map(l=>({type:"added",value:l,id:String(l.id),hasPendingWrites:!1})))})}catch(u){if(u instanceof Error&&i)i(u);else throw u}return()=>{s(),a?.()}}listenQuery(n,i,o,s){throw new Yp("Not used by supported entities")}async generateID(n){return n.id??Za()}async bulkSave(n){We("COMMON").warnContext(this.logContext,"Using default bulk save operation",{path:this.path});for(let i of n)try{await this.createEntity(i)}catch(o){i&&i.id&&Ag(o)&&o.status===409?await this.get(i.id).save(i):We("COMMON").errorContext(this.logContext,"Failed to bulk save entity using default operation",{path:this.path},o)}}async bulkUpdate(n){We("COMMON").warnContext(this.logContext,"Using default bulk update operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk update entity without entity ID",{path:this.path}),new et("Tried to bulk update entity without entity ID");await this.get(i.id).merge(i)}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk update entity using default operation",{path:this.path},o)}}async bulkDelete(n){We("COMMON").warnContext(this.logContext,"Using default bulk delete operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk delete entity without entity ID",{path:this.path}),new et("Tried to bulk delete entity without entity ID");await this.get(i.id).delete()}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk delete entity using default operation",{path:this.path},o)}}async getCount(){throw new Yp}};var UBm=zi.merge(SK),jBm=Os("Job",UBm),LAd=vR(jBm,new Got("jobCounter")),ffa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{}}getCollection(){return new Cxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"jobs",LAd,n,o,[],i.hostnames.metadataService,i)}},Cxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("jobs",t,LAd,i,ffa,n.hostnames.metadataService,n)}async generateID(t){if(t.id)return t.id;if(t.jobCounter)return t.jobCounter;let n=await this.select();if(n.length<1)return 1;let o=n.sort((a,u)=>u.id-a.id)[0];return o?o.id+1:1}};var Afa=class r extends GZ{static ID_NUMBER=/^\d+$/;transformToStorage(t,n,i){return{...GS(i,["macroCounter","name","packageInfo"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return r.ID_NUMBER.test(i.id)?{...i,macroCounter:+i.id}:{...i}}},GBm=zi.merge(aL),HBm=Os("Macro",GBm),qAd=vR(HBm,new Afa),hfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{}}getCollection(){return new Sxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"macros",qAd,n,o,[],i.hostnames.metadataService,i)}},Sxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("macros",t,qAd,i,hfa,n.hostnames.metadataService,n)}};var gfa=class extends GZ{transformToStorage(t,n,i){return{...GS(i,["templateCounter"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return i}},WBm=zi.merge(xFe),VBm=Os("NodeType",WBm),zAd=vR(VBm,new gfa),mfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{}}getCollection(){return new _xt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"templates",zAd,n,o,[],i.hostnames.metadataService,i)}},_xt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("templates",t,zAd,i,mfa,n.hostnames.metadataService,n)}};var yfa=class extends GZ{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){let o=[];return i.metadata.columns.forEach(s=>{let a;(i.type==="sourceInput"||s.isSurrogateKey||s.isSystemCreateDate||s.isSystemUpdateDate||s.isSystemStartDate||s.isSystemEndDate||s.isSystemVersion||s.isSystemCurrentFlag)&&(a={strictMatch:!0,values:[]}),o.push({...s,acceptedValues:a})}),{...i,metadata:{...i.metadata,columns:o}}}},KBm=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),YBm=Os("Node",KBm),FAd=vR(YBm,new yfa),bfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"nodes",FAd,n,o,[],i.hostnames.metadataService,i)}mergeMetadata(t){return this.fetchAndMerge({metadata:t})}getCollection(){return new vxt(this.parent,this.serviceOperations,this.logContext)}},vxt=class r extends Gv{static NODE_BULK_LIMIT=1e3;get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get bulkUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes_bulk`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("nodes",t,FAd,i,bfa,n.hostnames.metadataService,n)}listenCollectionOverride(t,n,i,o,s){let a=this.listenCollection(t,o,s);return()=>{a&&a()}}convertFromRestAPIStorage(t,n){return this.dataTransform.fromStorage(n,`${this.path}/${n}`,t)}async getNodesLocationInfo(){let t=await this.select(),n={};return t.forEach(i=>{n[i.id]={operation:i}}),n}async bulkSave(t){let n=t.map(o=>this.dataTransform.toStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkUpdate(t){let n=t.map(o=>this.dataTransform.mergeToStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkDelete(t){let n=t.map(o=>o.id),i;for(let o of T7(n,1e3))try{let s=await this.addAuthHeader();await fd.delete(`${this.hostname}${this.bulkUri}`,{headers:s,data:o})}catch(s){i=s}if(i)throw i;this.eventManager.publishEvents(n.map(o=>({type:"removed",value:{},id:o,hasPendingWrites:!1})))}async bulkPostChunk(t,n,i){let o;for(let s of T7(n,i)){let a=await t();try{await fd.post(`${this.hostname}${this.bulkUri}`,{nodes:s},{headers:a})}catch(u){if(i>1&&Ag(u)&&u.response?.status===ECa.PayloadTooLarge){await this.bulkPostChunk(t,s,Math.max(i/10,1));continue}o=u}}if(o)throw o}};var JBm=zi.merge(VIe),$Bm=Os("Subgraph",JBm),QAd=vR($Bm,new Got("folderCounter")),Efa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{}}getCollection(){return new Txt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"subgraphs",QAd,n,o,[],i.hostnames.metadataService,i)}},Txt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("subgraphs",t,QAd,i,Efa,n.hostnames.metadataService,n)}};var XBm=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),ZBm=Os("WorkspaceUser",XBm),UAd=vR(ZBm),Cfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"users",UAd,n,o,[],i.hostnames.metadataService,i)}getCollection(){return new Ixt(this.parent,this.serviceOperations,this.logContext)}},Ixt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("users",t,UAd,i,Cfa,n.hostnames.metadataService,n)}};var e5m=zi.merge(iWn),t5m=Os("Workspace",e5m),jAd=vR(t5m,new nwi("latestCommitDate")),Sfa=class extends yC{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}getCollection(){return new Oxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"workspaces",jAd,n,o,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"],i.hostnames.metadataService,i)}get nodes(){return this.getSubCollection("nodes",vxt)}node(t){return this.nodes.get(t)}installedPackages=void 0;installedPackage=void 0;get jobs(){return this.getSubCollection("jobs",Cxt)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Sxt)}macro(t){return this.macros.get(t)}nodesLastRefreshed=void 0;nodeLastRefreshed=void 0;get nodeTypes(){return this.getSubCollection("templates",_xt)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("subgraphs",Txt)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Ixt)}workspaceUser(t){return this.workspaceUsers.get(t)}isDevEnv=void 0;removeDeletedSteps=void 0},Oxt=class extends Gv{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}async fetchWorkspacesForPermissions(t){return this.select({where:[["devEnv","==",t]],selectFields:["id","project"]})}constructor(t,n,i){super("workspaces",t,jAd,i,Sfa,n.hostnames.metadataService,n)}};var r5m=zi.merge(OWn),n5m=Os("Org",r5m),GAd=vR(n5m),_fa=class extends yC{constructor(t,n,i,o){super(t,"orgs",GAd,n,{...o,orgID:t},["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"],"NOT_SERVICE_BACKED",i)}get baseUri(){return"orgs"}getCollection(){return new Rxt(this.parent,this.serviceOperations,this.logContext)}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}get workspaces(){return this.getSubCollection("workspaces",Oxt)}workspace(t){return this.workspaces.get(t)}devRuns=void 0;devRun=void 0;globalUsersSettings=void 0;globalUsersSetting=void 0;projects=void 0;project=void 0;runs=void 0;run=void 0;userRoles=void 0;userRole=void 0;getNextCounter=void 0;releaseWorkspaceStatusAndEndRun=void 0;updateLastLoginTime=void 0;writePlanAnalytics=void 0;writeRunAnalyticsSummary=void 0},Rxt=class extends Gv{get baseUri(){return"orgs"}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}constructor(t,n,i){super("orgs",t,GAd,i,_fa,"NOT_SERVICE_BACKED",n)}};var iwi=class extends cP{constructor(t,n){super("root","root",["orgs","users","packagesRegistry","events"],void 0,n,t)}get path(){return"root"}get baseUri(){return"root"}get baseSSEUri(){return"root"}get wsQuery(){return{}}get orgs(){return this.getSubCollection("orgs",Rxt)}org(t){return this.orgs.get(t)}orgsPublic=void 0;orgPublic=void 0;users=void 0;user=void 0;packagesRegistry=void 0;registryPackage=void 0;events=void 0;event=void 0;oauthStates=void 0;oauthState=void 0;activePrompts=void 0;activePrompt=void 0;promptVersions=void 0;promptVersion=void 0;storage=void 0;batch=()=>new rwi;getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}};var Ma=class extends IEe{constructor(n,i,o,s,a,u){super(n.id,n,[],o,s,a);this.collectionRef=n;this.dataTransform=i;this.EntityRepositoryConstructor=u}get path(){return this.collectionRef.path}get(n){let i=this.firestoreOperations.docRef(this.collectionRef,n.toString());return new this.EntityRepositoryConstructor(n,i,this.parent,this.logContext,this.firestoreOperations)}async select(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>this.transformDataFromStorage(u.ref,this.firestoreOperations.data(u),i))}async selectIDs(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>u.id)}async createEntity(n,i){let o=i?.transaction,s=await this.generateID(n),a=this.firestoreOperations.docRef(this.collectionRef,s?.toString()),u=await this.prepareDataForCreate(n,s??a.id,i);return o?o.set(a,u):await tx(this.firestoreOperations.addDoc(a,u)),new this.EntityRepositoryConstructor(s||a.id,a,this.parent,this.logContext,this.firestoreOperations)}listenCollection(n,i,o){let[s,a]=this.getListenCallbacks(n,i,o);return this.firestoreOperations.onCollectionSnapshot(this.collectionRef,s,a)}listenQuery(n,i,o,s){let[a,u]=this.getListenCallbacks(i,o,s);return this.firestoreOperations.onQuerySnapshot(this.firestoreOperations.createQuery(this.collectionRef,n),a,u)}async prepareDataForCreate(n,i,o){let s=n.createdBy??this.firestoreOperations.currentUser(),a={...Vc(n),id:i,createdAt:Mk(),createdBy:s,updatedAt:Mk(),updatedBy:s};return this.dataTransform.toStorage(i.toString(),`${this.path}/${i}`,a,this.firestoreOperations,o)}getListenCallbacks(n,i,o){return[s=>{let a=this.firestoreOperations.snapShotChanges(s).reduce((u,l)=>{try{let c=this.transformDataFromStorage(l.doc.ref,l.doc.data(),o);u.push({type:l.type==="added"?"added":l.type==="removed"?"removed":"modified",value:c,id:c.id.toString(),hasPendingWrites:this.firestoreOperations.hasPendingWrites(l.doc)})}catch(c){i&&i(c)}return u},[]);Tc().debug(`Listener notification for ${a.length} changes in collection ${this.path}`),n(a)},s=>{Tc().error(`Firestore error listening to collection ${this.path}`,s),i&&i(dxt(s))}]}transformDataFromStorage(n,i,o){return this.dataTransform.fromStorage(n.id,n.path,i,this.firestoreOperations,o)}async generateID(n){return n.id}async getCount(){return this.firestoreOperations.getCount(this.collectionRef)}async selectInBatches(n,i,o,s=[]){return(await this.firestoreOperations.selectInBatches(this.collectionRef,n,i,o,s)).map(l=>l.docs).flat().map(l=>this.transformDataFromStorage(l.ref,this.firestoreOperations.data(l)))}};var i5m=M.discriminatedUnion("type",[zi.merge(yi.merge(Iy)),zi.merge(yi.merge(AWn)),zi.merge(yi.merge(yWn)),zi.merge(yi.merge(oWn)),zi.merge(yi.merge(bWn)),zi.merge(yi.merge(dWn)),zi.merge(yi.merge(sWn)),zi.merge(yi.merge(aWn)),zi.merge(yi.merge(hWn)),zi.merge(yi.merge(gWn)),zi.merge(yi.merge(mWn))]),o5m=Os("Event",i5m),HAd=Au(o5m),vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,HAd,i,o,s)}},owi=class extends Ma{constructor(t,n,i,o){super(t,HAd,n,i,o,vfa)}createEventCore(t,n,i,o,s,a,u){return{type:"core",orgID:t,event:n,resourceType:i,resourceID:o,fromID:s,requestedBy:a,requestedByUserAgent:u}}async createDuplicatePkgNodeTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"workspaces.nodeType.duplicate","NodeType",n,i,o,l),type:"duplicate",packageID:s,releaseID:a,workspaceID:u};return(await this.createEntity(d)).id}async createInstallPkgNodeTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.nodeType.install","NodeType",n,"",s,a),type:"install",packageID:n,releaseID:i,workspaceID:o};return(await this.createEntity(l)).id}async createEnableTotpTypeEvent(t,n,i){let o=this.createEventCore(t,"users.auth.enableTotp","Auth","Totp","",n,i);return(await this.createEntity(o)).id}async createDisableTotpTypeEvent(t,n,i,o){let s=this.createEventCore(t,"users.auth.disableTotp","Auth","Totp",i,n,o);return(await this.createEntity(s)).id}async createAIColumnDescriptionsTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"ai.description.columnDescriptions","AI","Description",n,n,l),type:"update",workspaceID:i,nodeID:o,acceptedDescriptionsCount:s,modifiedDescriptionsCount:a,rejectedDescriptionsCount:u};return(await this.createEntity(d)).id}async createNewWorkspaceWizardTypeEvent(t,n,i,o,s,a,u,l,c,d){let p=this.createEventCore(t,"workspaces.create.newWorkspace","NewWorkspace",i.toString(),c?.toString()??"",l,d),f=typeof s=="string"?new Date(s):s,A={...p,type:"create",projectID:n,stepNumber:o,startTime:f,endTime:a,status:u};return(await this.createEntity(A)).id}async createAINodeDescriptionTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"ai.description.nodeDescription","AI",o,"",n,a),type:"update_node_description",workspaceID:i,nodeID:o,action:s};return(await this.createEntity(l)).id}async createAIGitCommitMessageRequestEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI",u,"",n),type:"request",fileCount:i,diffContent:o,charCount:s,latencyMs:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createAIGitCommitMessageActionEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI","",n,u),type:"action",aiMessage:i,finalMessage:o,editDistance:s,action:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createMinimapEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.minimap",n,i,o.toString(),s),type:"minimap",isEnabled:a,time:new Date};return(await this.createEntity(l)).id}async createFilterToggleEvent(t,n,i,o,s){let u={...this.createEventCore(t,"workspaces.graph.filter",n.includes("subgraph")?"Subgraph":"BrowserGraph",n,i.toString(),o),type:"filterToggle",isVisible:s,time:new Date};return(await this.createEntity(u)).id}async createGraphContextFilterEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.contextMenu",i,n,o.toString(),s),type:"graphContextMenu",filter:a,time:new Date};return(await this.createEntity(l)).id}};var s5m=Os("Event",yXu),WAd=Au(s5m),Tfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,WAd,i,o,s)}},swi=class extends Ma{constructor(t,n,i,o){super(t,WAd,n,i,o,Tfa)}};var a5m=We("FIREBASE"),awi=class extends Q_{transformFromStorage(t,n,i){let o=[];i.orgName||(o.push("Adding property orgName with default value"),i.orgName="");let s=i.licenseDetails;return typeof s=="object"&&(s.trialActivator||(o.push("Adding property licenseDetails.trialActivator with default value"),s.trialActivator=""),s.companyName||(o.push("Adding property licenseDetails.companyName with default value"),s.companyName="")),o.length>0&&a5m.debug(`Patched org ${n}`,o),i}};var u5m=zi.merge(J$u),c5m=Os("GitAccount",u5m),VAd=Au(c5m),Ifa=class extends Ra{constructor(t,n,i,o,s){super(t,n,VAd,i,o,s)}},uwi=class extends Ma{constructor(t,n,i,o){super(t,VAd,n,i,o,Ifa)}async generateID(t){return t.id??Za()}};var l5m=zi.merge(TXu),d5m=Os("ProjectGitAccount",l5m),KAd=Au(d5m),Ofa=class extends Ra{constructor(t,n,i,o,s){super(t,n,KAd,i,o,s)}},cwi=class extends Ma{constructor(t,n,i,o){super(t,KAd,n,i,o,Ofa)}async generateID(t){return t.id??Za()}};var p5m=zi.merge(X$u),f5m=Os("GlobalUserSettings",p5m),YAd=Au(f5m),Rfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,YAd,i,o,s,["gitAccounts","projectGitAccounts"])}get gitAccounts(){return this.getSubCollection("gitAccounts",uwi)}gitAccount(t){return this.gitAccounts.get(t)}get projectGitAccounts(){return this.getSubCollection("projectGitAccounts",cwi)}projectGitAccount(t){return this.projectGitAccounts.get(t)}},lwi=class extends Ma{constructor(t,n,i,o){super(t,YAd,n,i,o,Rfa)}listUsers(){return this.firestoreOperations.getChildren(this.collectionRef)}};var A5m=zi.merge(U0s),h5m=Os("Project",A5m),JAd=Au(h5m),Mfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,JAd,i,o,s)}},dwi=class extends Ma{constructor(t,n,i,o){super(t,JAd,n,i,o,Mfa)}async generateID(t){return t.id??Za()}};var pwi=(r,t,n)=>{let i=typeof r=="string"?parseInt(r):r;if(isNaN(i)||i===void 0)throw new t(`Missing or invalid environment ID '${r}' context=${JSON.stringify(n)}`);return i};var g5m=We("FIREBASE"),fwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return"endTime"in o&&(s.push("Removing property 'endTime'"),delete o.endTime),(!o.version||o.version<qFe)&&(s.push(`Updating version ${o.version} to ${qFe}`),o.version=qFe),o.runDetails&&!o.runDetails.environmentID&&("toWorkspaceID"in o.runDetails&&o.runDetails.toWorkspaceID!=null?(s.push(`Found runDetails.toWorkspaceID with value ${o.runDetails.toWorkspaceID}; setting to runDetails.environmentID`),o.runDetails.environmentID=o.runDetails.toWorkspaceID.toString()):(s.push('Setting missing runDetails.environmentID to "0"'),o.runDetails.environmentID="0")),o.runDetails&&"toWorkspaceID"in o.runDetails&&(s.push("Deleting runDetails.toWorkspaceID"),delete o.runDetails.toWorkspaceID),g5m.debug(`Patched run ${n}`,s),o}};var m5m=We("FIREBASE"),Awi=class extends Q_{transformFromStorage(t,n,i){let o=[];return!i.queryResultSequence&&Array.isArray(i.history)&&i.history.length>0&&(o.push("Moving 'history[0]' to 'queryResultSequence'"),i.queryResultSequence=i.history[0]?.queryResultSequence,delete i.history),(i.runExecutionSequenceID===void 0||i.runExecutionSequenceID===null)&&(o.push("Setting 'runExecutionSequenceID' to zero"),i.runExecutionSequenceID=0),(i.name===void 0||i.name===null)&&(o.push("Setting 'name' to 'unknown'"),i.name="unknown"),i.queryResultSequence?.queryResults?.map((s,a)=>{s.isRunning!==!0&&typeof s=="object"&&(s.status||(o.push(`Setting 'status' to 'Failure' for query result ${a}`),s.status="Failure"),s.type||(o.push(`Setting 'type' to 'sql' for query result ${a}`),s.type="sql"),s.exportedRefs||(o.push(`Setting 'exportedRefs' to empty array for query result ${a}`),s.exportedRefs=[]),s.invalidExportedRefs||(o.push(`Setting 'invalidExportedRefs' to empty array for query result ${a}`),s.invalidExportedRefs=[]),s.fields||(o.push(`Setting 'fields' to empty array for query result ${a}`),s.fields=[]),s.sql||(o.push(`Setting 'sql' to empty string for query result ${a}`),s.sql=""),s.rows||(o.push(`Setting 'rows' to empty array for query result ${a}`),s.rows=[]),s.startTime||(o.push(`Setting 'startTime' to ${ofe.toISOString} for query result ${a}`),s.startTime=ofe),s.endTime||(o.push(`Setting 'endTime' to ${ofe.toISOString} for query result ${a}`),s.endTime=ofe),s.fields?.map((u,l)=>{o.push(`Setting 'type' to 'unknown' for field ${l} of query result ${a}`),u.type||(u.type="unknown")}),s.error?.message&&(s.error.errorString||(o.push(`Setting 'error.errorString' to 'error.message' for query result ${a}`),s.error.errorString=s.error.message),o.push(`Removing 'error.message' for query result ${a}`),delete s.error.message),s.error?.originalError&&(o.push(`Removing 'error.originalError' from query result ${a}`),delete s.error.originalError))}),i.runResultVersion=2,i.version=2,o.length>0&&m5m.debug(`Patched run result ${n}`,o),i}};var y5m=zi.merge(RWn),b5m=Os("QueryResult",y5m),mwi=Au(b5m),wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Pfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,wfa)}},Nfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Dfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,Nfa)}},E5m=zi.merge(PWn),C5m=Os("RunResult",E5m),ywi=Au(C5m,new Awi),xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Pfa)}queryResult(t){return this.queryResults.get(t)}},hwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,xfa)}},Bfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Dfa)}queryResult(t){return this.queryResults.get(t)}},gwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,Bfa)}};var OEe=We("FIREBASE"),S5m=M.discriminatedUnion("runType",[zi.merge(J0s),zi.merge(QXu),zi.merge($0s)]),_5m=Os("Run",S5m),Cwi=Au(_5m,new fwi,!0),kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",hwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={},n){return this.merge({...t,runHeartbeat:Mk()},{...n,retryOptions:{attempts:3,tags:["[FirestoreRunRepo.updateHeartbeat()]"],waitSeconds:5}})}},bwi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,kfa)}async createDeployRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},s=(l,c)=>(Z1s(l,"deploy",t.runDetails.forcedDeployment,o),{status:"Deploying",currentlyRunningJobs:l.currentlyRunningJobs?l.currentlyRunningJobs.concat(c):[c]}),a={...t,runDetails:{...t.runDetails}};for(let l of BXu)delete a.runDetails[l];let u=await qfa(this,i,a,s,n);return FBe(o,u.id),OEe.infoContext(o,"FirestoreOrgRepo createDeployRun: finished securing workspace"),u}async createRefreshRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},a=await qfa(this,i,t,(u,l)=>(Z1s(u,"refresh",t.runDetails.forceIgnoreWorkspaceStatus,o),{status:u.status==="Failed Deploy"?u.status:"Refreshing",currentlyRunningJobs:u.currentlyRunningJobs?u.currentlyRunningJobs.concat(l):[l]}),n);return FBe(o,a.id),OEe.infoContext(o,"FirestoreOrgRepo createRefreshRun: finished securing workspace"),a}},Lfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",gwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={}){let n=this.prepareDataForMerge(t);n.runHeartbeat=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,n)}},Ewi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,Lfa)}async createDevRun(t){let n=pwi(t.runDetails.environmentID,mo,this.logContext),i={...this.logContext,environmentID:n},o=(a,u)=>{if(!a.devEnv)throw new mo(`Unable to secure ${a.name}`,`${a.name} is a not a development workspace, context=${JSON.stringify(i)}`);return{currentlyRunningDevJobs:a.currentlyRunningDevJobs?a.currentlyRunningDevJobs.concat(u):[u]}};delete t.runDetails.dependencies;let s=await qfa(this,n,t,o);return FBe(i,s.id),OEe.infoContext(i,"FirestoreOrgRepo createDevRun: finished securing workspace"),s}},qfa=(r,t,n,i,o)=>{let s=r.parent.workspace(t),a={...r.logContext,environmentID:t};return r.runTransaction(o,async u=>{OEe.infoContext(a,"securing workspace status");let[l,c]=await Promise.all([FYn(s,vu().featureFlags,a,"FirestoreDevRunsRepo - createRun",u,vu().authToken),r.parent.getNextCounter(r.id.substring(0,r.id.length-1),1,u)]);FBe(a,c),OEe.infoContext(a,"got workspace doc data, updating workspace",{status:l?.status,jobs:l?.currentlyRunningJobs});let d=()=>{try{return i(l,c)}catch(A){if(OEe.errorContext(a,"createRun: error updating workspace",{error:A}),A instanceof cfe){let g=A.detail??`${l.name} is in state ${l.status},`;throw new y3(A.message,g+` context=${JSON.stringify(a)}.`)}throw A}};await s.merge(d(),u),OEe.infoContext(a,`Run ${c} will use the following mappings:`,l.mappingsV1),OEe.infoContext(a,"reserving run");let p=await r.prepareDataForCreate(n,c);p.runStartTime=r.firestoreOperations.getServerTimestampSentinel(),p.runHeartbeat=r.firestoreOperations.getServerTimestampSentinel();let f=r.get(c);return u.transaction.set(f.docRef,p),f})};var v5m=We("FIREBASE"),Swi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];o.projects||(o.projects={},s.push("Changing userRoles.projects from undefined to empty object"));let a=(u,l,c,d)=>{let p=l.indexOf(c);p>=0&&(s.push(`Changing ${u} role '${c}' to '${d}'`),l[p]=d)};for(let u of Object.values(o?.projects)){u.projectRoles?(a("project",u.projectRoles,"reader","member"),a("project",u.projectRoles,"owner","admin")):(u.projectRoles=[],s.push("Changing project.projectRoles from undefined to empty array"));for(let l of Object.values(u?.environments))l.environmentRoles?a("env",l.environmentRoles,"owner","admin"):(l.environmentRoles=[],s.push("Changing env.environmentRoles from undefined to empty array"))}return s.length>0&&v5m.debug(`Patched userRoles ${n}`,s),i}};var GNe=We("USER_MANAGEMENT"),T5m=zi.merge(GXu),I5m=Os("UserRoles",T5m),$Ad=Au(I5m,new Swi),zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,$Ad,i,o,s)}async upsertProjectRoles(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&!t.projectRoles.includes("admin")&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]);return Object.values(t.environments).forEach(c=>{t.projectRoles.includes("member")?c.environmentRoles=[]:t.projectRoles.includes("admin")?c.environmentRoles=["admin"]:c.environmentRoles=["reader"]}),s.projects[n]=t,await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertProjectRole(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]),c=s.projects[n];return c?c.projectRoles=[t]:s.projects[n]={projectRoles:[t],environments:{}},await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertUserOrganizationRoles(t,n){return await this.runTransaction(n,async i=>{let o;try{o=await this.fetch(i)}catch(c){if(y1(c)&&(c instanceof Ya||c instanceof m3))o={id:this.id,organizationRoles:[],projects:{}};else throw c}let s=o.organizationRoles.includes("admin"),a=t.includes("admin");s&&!a&&await this.throwIfLastOrgAdmin(i);let l=Vc(o.organizationRoles);return o.organizationRoles=t,await this.save(o,i),GNe.infoContext(this.logContext,`User org roles updated for user ${o.id}. Previous roles:`,l,"New roles:",o.organizationRoles),o})}async upsertEnvironmentRoles(t,n,i,o){return await this.runTransaction(o,async s=>{let a=await this.parent.workspace(i).fetch(s);if(a.project!==n||a.devEnv)throw new Ya(`Environment ${i} not found`);let u=await this.fetch(s);if(!u.projects[n]?.projectRoles.length)throw new m3("User must have a project role before being granted any environment roles therein");(u.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&!t.environmentRoles.includes("admin")&&await this.throwIfLastEnvironmentAdmin(n,i,s);let d=Vc(u.projects[n].environments[i]);return u.projects[n].environments[i]=t,await this.save(u,s),GNe.infoContext(this.logContext,`User env roles updated for user ${u.id} at envID ${i} in project ${n}. Previous roles:`,d,"New roles:",u.projects[n].environments[i]),u})}async upsertEnvironmentRole(t,n,i,o,s){return await this.runTransaction(s,async a=>{let u=await this.parent.workspace(i).fetch(a);if(u.project!==n||u.devEnv)throw new Ya(`Environment ${i} not found`);let l=await this.fetch(a);if((l.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastEnvironmentAdmin(n,i,a),!l.projects[n]?.projectRoles.length)if(o?.setDefaultProjectRole)l.projects[n]?l.projects[n].projectRoles=[o.setDefaultProjectRole]:l.projects[n]={projectRoles:[o.setDefaultProjectRole],environments:{}};else throw new m3("User must have a project role before being granted any environment roles therein");let p=Vc(l.projects[n].environments[i]),f=l.projects[n].environments[i];return f?f.environmentRoles=[t]:l.projects[n].environments[i]={environmentRoles:[t]},await this.save(l,a),GNe.infoContext(this.logContext,`User env roles updated for user ${l.id} at envID ${i} in project ${n}. Previous roles:`,p,"New roles:",l.projects[n].environments[i]),l})}async deleteUserProjectRoles(t,n){return await this.runTransaction(n,async i=>{let o=await this.fetch(i);(o.projects[t]?.projectRoles.includes("admin")??!1)&&await this.throwIfLastProjectAdmin(t,i);let a=Vc(o.projects[t]);delete o.projects[t],await this.save(o,i),GNe.infoContext(this.logContext,`User project roles deleted for user ${o.id} at projectID ${t}. Previous roles:`,a)})}async deleteUserEnvironmentRoles(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.fetch(o);(s?.projects[t]?.environments[n]?.environmentRoles.includes("admin")??!1)&&await this.throwIfLastEnvironmentAdmin(t,n,o);let u=Vc(s.projects[t].environments[n]);delete s.projects[t].environments[n],await this.save(s,o),GNe.infoContext(this.logContext,`User environment roles deleted for user ${s.id} at envID ${n} in project ${t}. Previous roles:`,u)})}async throwIfLastOrgAdmin(t){return await this.runTransaction(t,async n=>{if((await this.parent.userRoles.select({where:[["organizationRoles","array-contains","admin"]]},n)).length<2)throw new y3("Role change failed, at least one org admin is required")})}async throwIfLastProjectAdmin(t,n){return await this.runTransaction(n,async i=>{if((await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},i)).length<2)throw new y3("Role change failed, at least one project admin is required")})}async throwIfLastEnvironmentAdmin(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.parent.userRoles.select({where:[[`projects.${t}.environments.${n}.environmentRoles`,"array-contains","admin"]]},o),a=await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},o),u=s.length<2;if(!a.length&&u)throw new y3("Role change failed, at least one environment admin is required")})}},_wi=class extends Ma{constructor(t,n,i,o){super(t,$Ad,n,i,o,zfa)}};var O5m=We("FIREBASE"),vwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return o.status||(s.push("setting missing 'status' property to 'initializing'"),o.status="Initializing"),o.version||(s.push(`setting missing 'version' property to '${PFe}'`),o.version=PFe),o.tagColors||(s.push("Setting missing 'tagColors' property to default"),o.tagColors={backgroundColor:Ahs,textColor:"#e5e5e5"}),o.mappingsV1||(s.push("Setting missing 'mappingsV1' property to '{}'"),o.mappingsV1="{}"),o.version===0&&(o.mappings||(s.push("Setting missing 'mappings' property to empty object"),o.mappings={}),o.deployedWorkspaces||(s.push("Setting missing 'deployedWorkspaces' property to empty object"),o.deployedWorkspaces={})),(o.mappingsV1===null||o.mappingsV1===void 0)&&(s.push("Settings missing 'mappingsV1' property to an empty string"),o.mappingsV1=""),o.name||(o.name=`Workspace${t}`,s.push(`Setting missing 'name' property to '${o.name}`)),s.length>0&&O5m.debug(`Patched workspace ${n}:`,s),o}};var R5m=zi.merge(BFe),M5m=Os("InstalledPackage",R5m),XAd=Au(M5m),Ffa=class extends Ra{constructor(t,n,i,o,s){super(t,n,XAd,i,o,s)}},Twi=class extends Ma{constructor(t,n,i,o){super(t,XAd,n,i,o,Ffa)}};var w5m=zi.merge(SK),P5m=Os("Job",w5m),ZAd=Au(P5m),Qfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ZAd,i,o,s)}async fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{let o=await this.fetch(i);if(o.name!==t.name&&(await this.parent.jobs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.save(super.mergeWithDeletes(o,t),i)}):super.fetchAndMerge(t,n)}},Iwi=class extends Ma{constructor(t,n,i,o){super(t,ZAd,n,i,o,Qfa)}async generateID(t){return t.id??this.parent.parent.getNextCounter("job")}createEntity(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return await super.createEntity(t,i)}):super.createEntity(t,n)}};var N5m=zi.merge(aL),D5m=Os("Macro",N5m),ehd=Au(D5m,void 0,!0),Ufa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ehd,i,o,s)}},Owi=class extends Ma{constructor(t,n,i,o){super(t,ehd,n,i,o,Ufa)}};var x5m=zi.merge(xFe),B5m=Os("NodeType",x5m),thd=Au(B5m),jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,thd,i,o,s)}},Rwi=class extends Ma{constructor(t,n,i,o){super(t,thd,n,i,o,jfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("template")).toString()}};var k5m=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),L5m=Os("Node",k5m),rhd=Au(L5m,new XKn),Gfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,rhd,i,{...o,nodeID:t},s)}async delete(t){if(await super.delete(t),this.docRef.parent.id==="steps"){let n=this.firestoreOperations.collectionRef(this.docRef.parent.parent,"deletedSteps"),i=this.firestoreOperations.docRef(n,this.id);await this.firestoreOperations.saveDoc(i,{deletedAt:this.firestoreOperations.getServerTimestampSentinel()})}}mergeMetadata(t,n){return this.merge(Object.fromEntries(Object.entries(t).map(([i,o])=>[`metadata.${i}`,o])),n)}},Mwi=class extends Ma{constructor(t,n,i,o){super(t,rhd,n,i,o,Gfa)}async generateID(t){return t.id??Za()}listenCollection(t,n,i){throw new Yp("The firestore nodes repository listener is not implemented. Use listenCollectionOverride")}listenCollectionOverride(t,n,i,o,s){let[a,u]=this.getListenCallbacks(t,o,s),l=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.orderBy("updatedAt").startAfter(n),a,u),c=p=>{let A=[...p.docChanges()].map(g=>({type:"removed",id:g.doc.id,doc:g.doc,oldIndex:-1,newIndex:-1})).filter(g=>{let b=g.doc.data(),_=i[g.doc.id];if(_)if(_.updatedAt){let v=new Date(_.updatedAt),O=b.deletedAt?b.deletedAt.toDate():v;return v<=O}else return!0;return!1}).map(g=>({type:"removed",value:{id:g.doc.id},id:g.doc.id,hasPendingWrites:!1}));t(A)},d=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.parent.collection("deletedSteps").orderBy("deletedAt").startAfter(n),c,u);return()=>{l(),d()}}convertFromRestAPIStorage(t,n){return this.transformDataFromStorage({id:n},t)}async getNodesLocationInfo(){let t=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","name","locationName","sqlType","type"]}),n=await this.firestoreOperations.runQuery(t),i={};return n.forEach(o=>{let s=H$u.verify({operation:{...o.data()}});i[o.id]=s}),i}};var q5m=zi.merge(mXu),z5m=Os("NodeLastRefreshed",q5m),nhd=Au(z5m,void 0,!0),Hfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,nhd,i,{...o,nodeID:t},s)}},wwi=class extends Ma{constructor(t,n,i,o){super(t,nhd,n,i,o,Hfa)}async generateID(t){return t.id??Za()}};var F5m=zi.merge(VIe),Q5m=Os("Subgraph",F5m),ihd=Au(Q5m),Wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ihd,i,o,s)}fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.fetch(i)).name!==t.name&&(await this.parent.subgraphs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);let a=this.prepareDataForMerge(t,n);return i.transaction.update(this.docRef,a)}):super.fetchAndMerge(t,n)}},Pwi=class extends Ma{constructor(t,n,i,o){super(t,ihd,n,i,o,Wfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("subgraph")).toString()}async createEntity(t,n){let i=await this.generateID(t);return n?.uniquenessConstraints?this.runTransaction(n,async o=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},o)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.createEntity({...t,id:i},o)}):super.createEntity({...t,id:i},n)}};var U5m=We("FIREBASE"),Nwi=class extends Q_{transformFromStorage(t,n,i){let o=[];return["connectionDetails","authenticator"].forEach(s=>{i?.connectionDetails?.hasOwnProperty(s)&&(o.push(`deleting property 'connectionDetails.${s}']`),delete i.connectionDetails[s])}),o.length>0&&U5m.debug(`Patched workspace user ${n}`,o),i}};var j5m=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),G5m=Os("WorkspaceUser",j5m),ohd=Au(G5m,new Nwi),Vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ohd,i,o,s)}},Dwi=class extends Ma{constructor(t,n,i,o){super(t,ohd,n,i,o,Vfa)}};var H5m=zi.merge(iWn),W5m=Os("Workspace",H5m),shd=Au(W5m,new vwi,!0),Kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,shd,i,o,s,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"])}get installedPackages(){return this.getSubCollection("installedPackages",Twi)}installedPackage(t){return this.installedPackages.get(t)}get jobs(){return this.getSubCollection("jobs",Iwi)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Owi)}macro(t){return this.macros.get(t)}get nodes(){return this.getSubCollection("steps",Mwi)}node(t){return this.nodes.get(t)}get nodesLastRefreshed(){return this.getSubCollection("nodesLastRefreshed",wwi)}nodeLastRefreshed(t){return this.nodesLastRefreshed.get(t)}get nodeTypes(){return this.getSubCollection("templates",Rwi)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("folders",Pwi)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Dwi)}workspaceUser(t){return this.workspaceUsers.get(t)}async isDevEnv(){return!!(await this.fetch()).devEnv}async removeDeletedSteps(){let n=this.firestoreOperations.collectionRef(this.docRef,"deletedSteps").orderBy("__name__").limit(100),i=async(o,s)=>{try{let a=this.parent.parent.batch(),u=await n.get();if(u.size===0){o();return}let c=[...u.docs].map(d=>({docRef:d.ref}));for(let d of c)await a.delete(d,{});await a.commit(),process.nextTick(()=>{i(o,s)})}catch(a){s(a)}};return new Promise((o,s)=>i(o,s))}},xwi=class extends Ma{constructor(t,n,i,o){super(t,shd,n,i,o,Kfa)}async generateID(t){return t.id??this.parent.getNextCounter("workspace")}async fetchWorkspacesForPermissions(t){let n=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","project"],where:[["devEnv","==",t]]});return(await this.firestoreOperations.runQuery(n)).docs.map(s=>s.data())}};var V5m=zi.merge(OWn),K5m=Os("Org",V5m),ahd=Au(K5m,new awi),Y5m={gitRepo:"gitRepo",workspace:"workspace",job:"job",subgraph:"folder",location:"location",connection:"connection",template:"template",run:"run",devRun:"devRun"},Yfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ahd,i,{...o,orgID:t},s,["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"])}get devRuns(){return this.getSubCollection("devRuns",Ewi)}devRun(t){return this.devRuns.get(t)}get globalUsersSettings(){return this.getSubCollection("globalUsersSettings",lwi)}globalUsersSetting(t){return this.globalUsersSettings.get(t)}get projects(){return this.getSubCollection("projects",dwi)}project(t){return this.projects.get(t)}get runs(){return this.getSubCollection("runs",bwi)}run(t){return this.runs.get(t)}get userRoles(){return this.getSubCollection("userRoles",_wi)}userRole(t){return this.userRoles.get(t)}get workspaces(){return this.getSubCollection("workspaces",xwi)}workspace(t){return this.workspaces.get(t)}async getNextCounter(t,n=1,i){if(!n||n<=0)throw new Pee(`getNextCounter() expected reserveCount value greater than zero, received ${n}`);let o=Y5m[t];if(!o)throw new Pee(`getNextCounter() received unsupported counter name '${t}'`);return this.runTransaction(i,async s=>{let a=await this.fetch(s),u=`${o}Counter`,l=u in a?a[u]??0:0;return await this.merge({[u]:l+n},s),l+1})}async releaseWorkspaceStatusAndEndRun(t,n,i,o,s,a){return this.runTransaction(a,async u=>{let l=this.workspace(t),c=await l.fetch(u),{newStatus:d,remainingActiveRuns:p}=await o();c.status=d??c.status,i==="run"?c.currentlyRunningJobs=p:c.currentlyRunningDevJobs=p,await l.save(c,u);let f=this[i](n);return u.transaction.update(f.docRef,{...f.prepareDataForMerge(s,u),runEndTime:this.firestoreOperations.getServerTimestampSentinel()}),c.status})}async updateLastLoginTime(){let t=this.prepareDataForMerge({});t.lastLoginTime=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,t)}async writePlanAnalytics(t,n){let i=this.firestoreOperations.collectionRef(this.docRef,"planAnalytics"),o=this.firestoreOperations.docRef(i,t);await this.firestoreOperations.saveDoc(o,n)}async writeRunAnalyticsSummary(t,n,i,o,s,a){let u=this[n](t),l=this.firestoreOperations.collectionRef(u.docRef,"analyticsSummary"),c=this.firestoreOperations.docRef(l,"summary"),d=this.firestoreOperations.docRef(l,"runPhases"),p=this.firestoreOperations.batch();if(this.firestoreOperations.saveDocBatch(p,c,i),this.firestoreOperations.saveDocBatch(p,d,o),s){let f=this.firestoreOperations.docRef(l,"planPhases");this.firestoreOperations.saveDocBatch(p,f,s)}if(await this.firestoreOperations.commitBatch(p),a.length>0){let f=this.firestoreOperations.collectionRef(d,"queries"),A=500;for(let g=0;g<a.length;g+=A){let b=this.firestoreOperations.batch();a.slice(g,g+A).forEach((v,O)=>{let R=`${v.nodeId}-${v.stageName}-${g+O}`,w=this.firestoreOperations.docRef(f,R);this.firestoreOperations.saveDocBatch(b,w,v)}),await this.firestoreOperations.commitBatch(b)}}}},Bwi=class extends Ma{constructor(t,n,i,o){super(t,ahd,n,i,o,Yfa)}};var J5m=zi.merge(SXu),$5m=Os("OrgPublic",J5m),uhd=Au($5m),Jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,uhd,i,{...o,orgID:t},s)}},kwi=class extends Ma{constructor(t,n,i,o){super(t,uhd,n,i,o,Jfa)}};var X5m=zi.merge(pWn),Z5m=Os("RegistryPackageRelease",X5m),chd=Au(Z5m),$fa=class extends Ra{constructor(t,n,i,o,s){super(t,n,chd,i,o,s)}},Lwi=class extends Ma{constructor(t,n,i,o){super(t,chd,n,i,o,$fa)}};var e6m=zi.merge(fWn),t6m=Os("RegistryPackage",e6m),lhd=Au(t6m),Xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,lhd,i,o,s,["releases"])}get releases(){return this.getSubCollection("releases",Lwi)}release(t){return this.releases.get(t)}},qwi=class extends Ma{constructor(t,n,i,o){super(t,lhd,n,i,o,Xfa)}};var r6m=zi.merge(OXu),n6m=Os("ActivePrompt",r6m),dhd=Au(n6m),i6m=zi.merge(RXu),o6m=Os("PromptVersion",i6m),phd=Au(o6m),Zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,dhd,i,{...o,nodeID:t},s)}},eAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,phd,i,{...o,nodeID:t},s)}},zwi=class extends Ma{constructor(t,n,i,o){super(t,dhd,n,i,o,Zfa)}},Fwi=class extends Ma{constructor(t,n,i,o){super(t,phd,n,i,o,eAa)}};var s6m=We("FIREBASE"),Qwi=class extends Q_{transformFromStorage(t,n,i){return i.accountType||(s6m.debug(`Patched user ${n}: Setting accountType to 'normal'`),i.accountType="normal"),i}};var a6m=zi.merge(nfs),u6m=Os("User",a6m),fhd=Au(u6m,new Qwi),tAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,fhd,i,o,s)}},Uwi=class extends Ma{constructor(t,n,i,o){super(t,fhd,n,i,o,tAa)}};var jwi=class extends IEe{constructor(t){super("root",t.db,["orgs","users","packagesRegistry","events"],void 0,t.currentLogContext(),t)}get path(){return""}get orgs(){return this.getSubCollection("orgs",Bwi)}org(t){return this.orgs.get(t)}get orgsPublic(){return this.getSubCollection("orgsPublic",kwi)}orgPublic(t){return this.orgsPublic.get(t)}get users(){return this.getSubCollection("users",Uwi)}user(t){return this.users.get(t)}get packagesRegistry(){return this.getSubCollection("packagesRegistry",qwi)}registryPackage(t){return this.packagesRegistry.get(t)}get events(){return this.getSubCollection("events",owi)}event(t){return this.events.get(t)}get oauthStates(){return this.getSubCollection("oauthState",swi)}oauthState(t){return this.oauthStates.get(t)}get activePrompts(){return this.getSubCollection("activePrompts",zwi)}activePrompt(t){return this.activePrompts.get(t)}get promptVersions(){return this.getSubCollection("promptVersions",Fwi)}promptVersion(t){return this.promptVersions.get(t)}batch(){return new $Mi(this.firestoreOperations)}getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}storage(){return new XMi(this.firestoreOperations)}};var Gwi=(r,t,n)=>{let i=new ZMi,o=new jwi(r),s=new iwi({...t,eventManager:i},{});return BAd(o,{firebase:o,service:s},n,()=>new twi(o,s,()=>n("",{}).shouldMutateBoth))};var d6m=_t(Fgi());var hhd=()=>{let r=process.env.VITEST_HEARTBEAT_WORKER_PATH_OVERRIDE;if(r&&r!=="undefined")return r;let t="heartbeat-worker.js",n=s=>(0,nAa.join)(s,t),i=s=>(0,nAa.join)(s,"..","build-coa",t),o=n(__dirname);if((0,rAa.existsSync)(o))return o;for(let s of module.paths)for(let a of[n,i]){let u=a(s);if((0,rAa.existsSync)(u))return u}throw new et("Could not find a worker path")};var ghd=(0,Ahd.promisify)(setTimeout),iAa=r=>{if(!r)return;let t=parseInt(r);return isNaN(t)?void 0:t};var p6m=fB.getTracer(Ukt()??"unknown-context"),Hwi=class{logTag="[ManagedHeartbeatWorker]";logContext;task;worker;triggerExit;exitPromise;constructor(t,n,i,o){let{HEARTBEAT_CHECKIN_TIME:s,HEARTBEAT_MAX_LIFESPAN:a}=process.env,u=iAa(s)||5,l=iAa(a)||1/0;this.task={orgID:t,runID:n,runType:i,interval:u,lifespan:l,modality:o},this.logContext={...this.task};let{promise:c,resolve:d}=aT();this.exitPromise=c,this.triggerExit=d}start(){let{runType:t}=this.task,n=p6m.startSpan("run-heartbeat",{attributes:{runType:t}}),i=hhd();We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Starting worker, using path:",i),this.worker=new mhd.Worker(i,{env:process.env,workerData:this.task}),this.worker.on("online",()=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker online")}),this.worker.on("exit",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker exited with code",o),this.triggerExit(),n.end()}),this.worker.on("message",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker message:",o)}),this.worker.on("error",o=>{We("HEARTBEAT").fatalContext(this.logContext,this.logTag,"Worker error:",o)})}async stop(){if(!this.worker)throw new et("Worker was never started!");We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Shutting down worker"),this.worker.postMessage("shutdown"),await Promise.race([this.exitPromise,ghd(1e3).then(()=>this.worker?.terminate())]),We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Finished shutting down worker")}};var REe=(r,t,n="nonCLI")=>{let i=new Hwi(t.parent.id,t.id,r,n);return i.start(),()=>i.stop()};var yhd=(r,t,n,i)=>{if(t.kind==="none")throw new Aue(t.kind,"CreateActiveRunInfoFromDevRun");let o=ije(r.userCredentials,t),s={userID:n,userCredentials:o,runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},runStatus:i?"waitingToRun":"initializing",runType:"devRun",kubernetesJobUuid:i,origin:r.origin};return B3(s),s};var nx=We("RUNNER_BACKEND");var oAa=r=>r.map(t=>t.toLowerCase()),qAC=new Set(["accesstoken","authcode","clientsecret","code","codeverifier","id_token","keypair","newpassword","password","refresh_token","snowflakekeypair","snowflakepassword","token","uid","serviceaccountkey",...oAa(wFe),...oAa(EWn),...oAa(LFe),"snowflakekeypairprivatekey","keypairkey"]);var sAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t);return{runTimeParameters:r.runTimeParameters,runDetails:r.runDetails,userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"deploy",kubernetesJobUuid:i,origin:r.origin}},bhd=async(r,t,n,i,o,s)=>{let a=new cT(nx,o),{measure:u,printSummary:l}=P1("[BECLI_HandleDeploy] end-to-end execution",o),{teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,{runDetails:{environmentID:f,parallelism:A,phasedNodeEdits:g,planID:b}}=r,_=p.org(c),v=parseInt(f);nx.infoContext(o,"Initializing deploy! planId:",b);let O;try{let R=await u("create user context",()=>b6(p,c,d,v,n,o)),w=await u("prepare deploy configuration",()=>{let H=HNe(R,d);return r.runDetails.fromWorkspaceData.userConnections={[v]:{[d]:H}},nx.appContext(o,Yyt(R),"BECLI_HandleDeploy"),sAa(r,R,d,s)}),{connectionManager:P,platform:z}=await u("get backend platform",()=>{let H=Math.max(...Object.values(g).map(L=>Object.keys(L).length));return fae(R,t,lie(H,s?1:A),!0,o)}),j=(H,L,W)=>pei({allWorkspaceData:w.runDetails.fromWorkspaceData,connectionManager:P,logContext:L,platform:z,renderer:i,runID:H,runInfo:w,nodesInRun:hAe(g),teamInfoAndFirebase:t,workspaceID:v,memoryMonitor:new BB},W),U=await u("create run and setup pipeline",()=>lAa(!!s,w,_,P,j,o));O=U.runCounter;let G={...o,runID:O};return await u("save pre-deploy workspace",()=>f6m(p,t,O,v,d,G)),U}catch(R){throw nx.errorContext(o,`Error during deploy for plan ${b}:`,R,R instanceof Error?R.stack:void 0),R}finally{if(!s){let R=performance.now();a.logMetric("deploy-execution",{orgID:c,planID:b,runID:O,workspaceID:v});let w=performance.now()-R;nx.infoContext(o,`[BECLI_HandleDeploy] logMetric took ${(w/1e3).toFixed(3)} seconds`),l()}}},f6m=async(r,t,n,i,o,s)=>{try{let a=`run-${n}.predeploy`,u=`user/${o}/environment/${i}/workspacePreDeploy/${a}`,l=await r.org(t.teamInfo.fbTeamID).workspace(i).fetch();nx.appContext(s,"saving workspace data",l),await r.storage().uploadFile(u,l),nx.appContext(s,`Run ${n}: Saved pre-deploy workspace state to ${u}`)}catch(a){nx.errorContext(s,"Error while saving preDeploy workspace state: ",a)}},aAa=r=>{let{runDetails:t}=r;if(t.jobID&&(t.includeNodesSelector||t.excludeNodesSelector))throw new Error("Unable to process, don't provide a JobID and Node Include/Exclude Selector(s) for 1 Refresh Run")},uAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t),s={runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"refresh",kubernetesJobUuid:i,origin:r.origin};return B3(s),s},HNe=(r,t)=>TB(r,{snowflake:n=>{let i={connectionDetails:{userID:t,user:n.user,role:n.role,warehouse:n.warehouse},connectionType:n.authenticator};return n.authenticator==="KeyPair"&&(i.connectionDetails.keyPair=n.keyPairKey),i},databricks:n=>({connectionKind:"databricks",connectionType:n.authenticator,connectionDetails:{userID:t,path:n.path}}),fabric:n=>({connectionKind:"fabric",connectionType:n.authenticator,connectionDetails:{userID:t,connectionString:n.connectionString}}),bigquery:n=>({connectionKind:"bigquery",connectionType:n.authenticator,connectionDetails:{userID:t,clientEmail:n.clientEmail??""}})}),Ehd=async(r,t,n,i,o,s)=>{let{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,{runDetails:{environmentID:c,jobID:d,parallelism:p}}=r,f=parseInt(c),A=a.org(u);aAa(r);let g=pmt(d);if(!g)nx.infoContext(o,"No job ID, refreshing all steps");else{nx.infoContext(o,"Refreshing job:",g);try{await A.workspace(f).job(g).fetch()}catch(j){throw nx.errorContext(o,`Failed to fetch job ${g}:`,j),j instanceof Ya?JPn(400,`Unable to start job ${g}`,`Job ${g} did not exist`):j}}let b=await b6(a,u,l,f,n,o),_=HNe(b,l);nx.appContext(o,Yyt(b),"BECLI_HandleRefresh"),r.runTimeParameters=await MEe(a,u,f,r.runTimeParameters);let v=uAa(r,b,l,s),O={steps:{},folders:{},jobs:{},macros:{},stepTypes:{}},R=new Set;s||(O=await g3e(f,A,new BB),O.userConnections[f][l]=_,R=tGe(v.runDetails,O)),v.runDetails.refreshDescription=KQe(v.runDetails,O.jobs);let{connectionManager:w,platform:P}=await fae(b,t,s?1:lie(R.size,p),!0,o);return lAa(!!s,v,A,w,(j,U,G)=>eGe({allWorkspaceData:O,connectionManager:w,logContext:U,platform:P,renderer:i,runID:j,runInfo:v,nodesInRun:R,teamInfoAndFirebase:t,workspaceID:f,memoryMonitor:new BB},G),o)};var A6m=async(r,t,n)=>{let o=(await r.org(t).workspace(n).fetch()).runTimeParameters??"";return LKn(o)},MEe=async(r,t,n,i)=>i?qKn(i):A6m(r,t,n),cAa=async(r,t,n,i,o,s)=>{let a=ije(t.userCredentials,i),u=await MEe(r,o.fbTeamID,parseInt(n.runDetails.environmentID),t.runTimeParameters);return n.runType==="refresh"&&(t.runDetails.forceIgnoreWorkspaceStatus!==void 0?n.runDetails.forceIgnoreWorkspaceStatus=t.runDetails.forceIgnoreWorkspaceStatus:n.runDetails.forceIgnoreWorkspaceStatus!==void 0&&delete n.runDetails.forceIgnoreWorkspaceStatus,n.runDetails.executor=t.runDetails.executor),{kubernetesJobUuid:s,origin:t.origin,reRunID:t.runDetails.runID,runDetails:n.runDetails,runStatus:s?"waitingToRun":"initializing",runTimeParameters:u,runType:"refresh",userCredentials:a,userID:o.fbUserID,version:3}},Chd=async(r,t,n,i,o,s,a)=>{let{runDetails:{environmentID:u,parallelism:l},runStatus:c,runType:d}=t,{runDetails:{runID:p}}=r;if(c!=="failed")throw new et(`Run status '${c}' is not eligible for re-run. Only failed jobs can be re-run!`);if(d!=="refresh")throw new et(`Run type '${d}' is not eligible for re-run`);if(!p)throw new et(`Invalid rerun ID '${p}'`);let{rootRepository:f,teamInfo:A,teamInfo:{fbTeamID:g,fbUserID:b}}=n,_=f.org(g),v=parseInt(u),O=await b6(f,g,b,v,i,s),R=HNe(O,b),w=await cAa(f,r,t,O,A,a),P=await g3e(v,_,new BB);w.runDetails.refreshDescription=KQe(w.runDetails,P.jobs),P.userConnections[v][b]=R;let z=await fei(_,w,P),{platform:j,connectionManager:U}=await fae(O,n,lie(z.size,a?1:l),!0,s);return lAa(!!a,w,_,U,(H,L,W)=>eGe({allWorkspaceData:P,connectionManager:U,logContext:L,platform:j,renderer:o,runID:H,runInfo:w,nodesInRun:z,teamInfoAndFirebase:n,workspaceID:v,memoryMonitor:new BB},W),s)},Shd=r=>_hd(r,"runCounter"),Hot=r=>_hd(r,"environment ID"),_hd=(r,t)=>{let n=typeof r=="number"?r:parseInt(r||"");if(!r||isNaN(n))throw new mo(`Specify a valid ${t}`,`400: ${n} is not valid`);return n},lAa=async(r,t,n,i,o,s)=>{if(r){try{nx.appContext(s,`tearing down connection manager for cloud ${t.runType} run`),await i.teardown()}catch(f){nx.errorContext(s,`error tearing down connection manager for cloud ${t.runType} run. Swallowing error.`,f)}let{runRepository:d,logContext:p}=await aCs(t,n,s);return{runCounter:d.id,logContext:p,runCompletion:Promise.resolve()}}let{runRepository:a,logContext:u}=await aCs(t,n,s),l=a.id,c=REe(t.runType,a,t.origin==="CLI"?"CLI":"nonCLI");return{runCounter:l,logContext:u,runCompletion:o(l,u,c)}};var h6m=new Map([["securetoken.googleapis.com",{path:"/securetoken",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}],["identitytoolkit.googleapis.com",{path:"/identitytoolkit",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}]]),vhd=r=>{let t=h6m.get(r.hostname);if(t&&fSe(t.enableByDefault,t.featureFlagName)){let n=new URL(OBe()),i=n.pathname;i.endsWith("/")&&(i=i.slice(0,-1)),r.pathname=i+t.path+r.pathname,r.hostname=n.hostname,r.protocol=n.protocol,r.port=n.port}return r};var Thd=async()=>{let r=fd.interceptors.request.use(t=>(typeof t.url=="string"&&(t.url=vhd(new URL(t.url)).toString()),t));return()=>fd.interceptors.request.eject(r)};var Ihd=_t(gUe());var Wot=We("FIREBASE"),g6m=3,Wwi=class extends jot{_backendUrl;_bucketPath;_forceBypassProxy;_baseStorageUrl;_axiosClient;constructor(t){super(t.storage),this._bucketPath=`v0/b/${t.bucket}/o`,this._backendUrl=t?.backendUrl??mm(),this._forceBypassProxy=!!t?.forceBypassProxy,this._axiosClient=t?.axiosClient,this._baseStorageUrl=t.emulatorStorageHost?`http://${t.emulatorStorageHost}`:"https://firebasestorage.googleapis.com"}async uploadToStorage(t,n){if(!this.isProxyEnabled)return super.uploadToStorage(t,n);Wot.info(`Uploading file to '${t}' via proxy`);let i=(0,Ihd.gzip)(new TextEncoder().encode(JSON.stringify(n))),o=await this.axios();try{let s=await o.post(this.determineProxyUrl(this._bucketPath,{name:t}),{contentEncoding:"gzip",contentType:"application/json",name:t},{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${i.length}`,"X-Goog-Upload-Header-Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable"}}),a=s.headers["x-goog-upload-url"];ed(a,"Missing upload URL in firebase cloud storage upload response","FIREBASE"),a=await this.determineProxyUrl(a);let u=+s.headers["x-goog-upload-chunk-granularity"]||262144,c=i.length,d=0;for(;c>u;){let p=Math.min(c,u),f=d+p,A=i.slice(d,f);await this.uploadChunk(a,A,d,!1),c-=p,d+=p}await this.uploadChunk(a,i.slice(d),d,!0)}catch(s){throw this.handleAxiosError(s)}}async downloadFromStorage(t){if(!this.isProxyEnabled)return super.downloadFromStorage(t);Wot.info(`Downloading file from '${t}' via proxy`);let n=await this.axios();try{return(await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})).data}catch(i){throw this.handleAxiosError(i)}}async deleteFileFromStorage(t){if(!this.isProxyEnabled)return super.deleteFileFromStorage(t);Wot.info(`Deleting file at '${t}' via proxy`);let n=await this.axios();try{await n.delete(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})}catch(i){throw this.handleAxiosError(i)}}async checkIfStorageReferenceExists(t){if(!this.isProxyEnabled)return super.checkIfStorageReferenceExists(t);Wot.info(`Checking if file at '${t}' exists via proxy`);let n=await this.axios();try{return await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`),{headers:{Authorization:`Firebase ${await this.token()}`}}),!0}catch(i){if(Ag(i)&&i.status===404)return!1;throw this.handleAxiosError(i)}}determineProxyUrl(t,n){t=t.replace(/^https:\/\/firebasestorage\.googleapis\.com\//,"");let i="?";if(n)for(let o in n){let s=n[o];s!==void 0&&(t+=`${i}${o}=${encodeURIComponent(s)}`,i="&")}return`${this.proxyUrl}?gcsforward=${encodeURIComponent(t)}`}get isProxyEnabled(){let t=!1;return typeof window<"u"&&(t=window.location.hostname==="localhost"||/(^|\.)local\./.test(window.location.hostname)),!t&&!this._forceBypassProxy&&this._baseStorageUrl==="https://firebasestorage.googleapis.com"&&vu().featureFlags.isFeatureEnabled("proxyGoogleStorage")}async uploadChunk(t,n,i,o){await IA(async()=>{Wot.info(`Uploading ${n.length} bytes at offset ${i} to '${t}'`),await(await this.axios()).post(t,n,{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":`upload${o?", finalize":""}`,"X-Goog-Upload-Offset":`${i}`}})},g6m,Wot,{})}get proxyUrl(){return`${this._backendUrl}/gcs`}async token(){return Mf.instance.getFirebaseIDToken()}async axios(){return this._axiosClient||(this._axiosClient=fd),this._axiosClient}handleAxiosError(t){if(Ag(t)){let i=t.response?.data?.message??t.message;switch(t.status){case 403:return new m3(i);case 404:return new Ya(i);default:return new et(i)}}return t}};var dAa=new Map,m6m=r=>process.env.COALESCE_FORCE_FIREBASE_REPOSITORY==="true"?"firebase":vu().featureFlags.getStringValue("serviceBackedRepositories","").split(",").includes(r)?"service":"firebase",y6m=()=>vu().featureFlags.isFeatureEnabled("mutateAllRepositories",!0),b6m=r=>({providerId:m6m(r),shouldMutateBoth:y6m()}),Ohd=({app:r,storage:t,hostname:n="localhost",token:i})=>{r||(r=X0.app());let o=dAa.get(r.name);if(!o){let s;try{s=$ut()}catch(a){throw a instanceof Nee?(We("CLI_INTERNAL").error("Deploy Service configuration error",a.diagnostics),new et("Unable to connect to Coalesce services. Please check your configuration and ensure you are properly authenticated.")):a}o=Gwi(new bxt(r,t),{getToken:async()=>typeof i=="string"?i:i(),hostnames:{schedulerService:mm(),deployService:s,metadataService:jkt(n)}},b6m),dAa.set(r.name,o)}return o},Rhd=()=>{dAa.clear()};var Mxt=We("RUNNER_BACKEND"),E6m=async r=>{try{return await Zjs(r),X0.app()}catch(t){throw Mxt.error("GetOrSetupFirebase",t),t}},C6m=async(r,t,n)=>{let i;return J6()||(i=new Wwi({storage:X0.storage(),backendUrl:t.emulatorInfo?.storage,bucket:t.storageBucket})),Ohd({app:r,storage:i,hostname:n.origin,token:Mf.instance.getFirebaseIDToken})},S6m=async(r,t,n)=>{let i,o=new lxt(Tc(),n.apiKey,!!n.emulatorInfo,t,void 0,b9e());await o.initialize(),Mf.setInstance(o),MMi(r)?i=await o.loginWithIdToken(r):i=await o.loginWithRefreshToken(r);let s=await X0.firestore().collection("users").doc(i.id).get();if(!s.exists)throw N0a("Authorization failed: User not found in firebase",{userId:i.id},{warning:(l,c)=>Mxt.warn(l,c)});let{currentTeam:a,hasSuperUserAccess:u}=s.data();if(!a)throw N0a("Authorization failed: Firestore user is missing 'currentTeam'",{userID:i.id},{warning:(l,c)=>Mxt.warn(l,c)});return{token:await o.getAuthToken(),context:{userID:i.id,orgID:a,hasSuperUserAccess:!!u}}},_6m=async(r,t,n,i)=>{let o=S9e().instance;return r&&(t.subdomain={id:r}),DP&&(t.version={id:DP.version}),o.isInitialized||await o.initialize({context:t,rootRepository:()=>n,apiClient:X3(void 0,i,{timeout:b9e()})}),o.currentFlags},Vwi=async(r,t)=>{let n=X3(t.origin,void 0,{timeout:b9e()}),i=await IA(async()=>await n.GetDatabase(),4,Mxt,{},{alterRetryStrategy:()=>({name:"backoff",base:1}),logOnRetry:"Retrying to get Firebase configuration",logOnFailure:"Failed to get Firebase configuration",failureLogLevel:"error"}),o=S9e().instance,s=oxa(t.hostname);return process.env.SCHEDULER_ADDRESS=t.origin,o.isInitialized||await IA(async()=>{await o.initializeDefaultFlags(s)},4,Mxt,{},{logOnFailure:"Failed to initialize feature flags service",failureLogLevel:"error",logOnRetry:"Retrying to initialize feature flags service",alterRetryStrategy:()=>({name:"backoff",base:1})}),TFe({logContext:vu().logContext,featureFlags:o.currentFlags},async()=>(await Thd(),pCl(()=>E6m(i),a=>S6m(r,a,i),(a,u)=>C6m(a,i,t),(a,u,l)=>_6m(s,a,u,l))))};var v6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting deploy job coa-${r}`);let s=oZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),a=new UFe(s),{runDetails:u,userCredentials:l}=a,{environmentID:c,parallelism:d,phasedNodeEdits:p,planID:f}=u,A=Hot(c),g=Oce(i,`Unable to parse runID: ${i}`),b={...o,planID:f,runID:g,workspaceID:A},{teamInfo:{fbTeamID:_,fbUserID:v},rootRepository:O}=t,R=O.org(_),w=new cT(Wa,b),{measure:P,printSummary:z}=P1("[CloudDeploy] end-to-end execution",b),j;try{let U=await P("get user connection and adjust credentials",async()=>{let Y=await Rne(R.workspace(A).workspaceUser(v),b),J=vu().featureFlags;return await SNe(_,v,A,l,Y,J),J}),G=await P("create user context",()=>b6(O,_,v,A,DNe(l),b)),{runInfo:H,maxGraphSize:L,memoryMonitor:W}=await P("prepare deploy configuration",async()=>{let Y=sAa(a,G,v,r);Y.id=g;let J=R.run(g);await J.updateHeartbeat({runStatus:"initializing"}),j=REe(Y.runType,J);let re=new wU,ne=Math.max(...Object.values(p).map(X=>Object.keys(X).length));return{runInfo:Y,maxGraphSize:ne,memoryMonitor:re}}),{connectionManager:V,platform:q}=await P("get backend platform",()=>fae(G,t,lie(L,d),!1,b));return await P("run deploy pipeline",()=>pei({allWorkspaceData:H.runDetails.fromWorkspaceData,connectionManager:V,logContext:b,platform:q,renderer:ex(U),runID:g,runInfo:H,nodesInRun:hAe(p),teamInfoAndFirebase:t,workspaceID:A,memoryMonitor:W},j))}catch(U){if(j)try{await j()}catch(G){Wa.errorContext(b,"Unable to clean up heartbeat after handling error",U,"innerError",G)}throw U}finally{w.logMetric("deploy-execution",{orgID:_,workspaceID:A,planID:f,runID:g,kubernetesJobUuid:r}),z()}},T6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting refresh job coa-${r}`);let a=uZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{teamInfo:{fbTeamID:d,fbUserID:p},rootRepository:f}=t,A=f.org(d),g=await Rne(A.workspace(u).workspaceUser(p),c),b=vu().featureFlags;await SNe(d,p,u,a.userCredentials,g,b);let _=await b6(f,d,p,u,DNe(a.userCredentials),c);a.runTimeParameters=await MEe(f,d,u,a.runTimeParameters),aAa(a);let v=uAa(a,_,p,r);v.id=l;let O=A.run(l);await O.updateHeartbeat({runStatus:"initializing"});let R=REe(v.runType,O),w=new wU;try{let P=await g3e(u,A,w),z=tGe(v.runDetails,P);v.runDetails.refreshDescription=KQe(v.runDetails,P.jobs),await O.merge({runDetails:v.runDetails});let j=HNe(_,p);P.userConnections[u][p]=j;let{connectionManager:U,platform:G}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return eGe({allWorkspaceData:P,connectionManager:U,logContext:c,platform:G,renderer:ex(b),runID:l,runInfo:v,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.error("Unable to clean up hearbeat after handling error",P,"innerError",z)}throw P}},I6m=async(r,t,n,i,o)=>{let s="[CloudReRun]";Wa.infoContext(o,`Starting re-run job coa-${r}`);let a=lZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=new jFe(a);B3(u);let{teamInfo:l,teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,f=p.org(c),A=Shd(u.runDetails.runID),g=await f.run(A).fetch();if(!g)throw new Error(`Could not find runInfo for teamID=${c}, oldRunID=${A}`);if(!ggc(g))throw new Error("Run is not eligible for rerun or a dev run");let b=Hot(g.runDetails.environmentID),_=Oce(i,`Unable to parse runID: ${i}`),v={...o,runID:_,workspaceID:b},O=await Rne(f.workspace(b).workspaceUser(d),v),R=vu().featureFlags;await SNe(c,d,b,u.userCredentials,O,R);let w=await b6(p,c,d,b,DNe(u.userCredentials),v),P=await cAa(p,u,g,w,l,r);if(P.id=_,!mgc(P)){let H=`Invalid rerun ID ${P.reRunID}`;throw Wa.errorContext(v,s,H),new mo(H)}let z=Hot(P.runDetails.environmentID);Dp("RUNNER_BACKEND",z===b,v,"Unexpected mismatch between workspace IDs for re-run and original run; workspace for re-run:",z,"workspace for original run:",b);let j=f.run(_);await j.updateHeartbeat({runStatus:"initializing"});let U=REe(P.runType,j),G=new wU;try{let H=await g3e(z,f,G),L=KQe(P.runDetails,H.jobs);await j.merge({runDetails:{...P.runDetails,refreshDescription:L}});let W=await fei(f,P,H),V=HNe(w,d);H.userConnections[z][d]=V;let{connectionManager:q,platform:Y}=await fae(w,t,lie(W.size,P.runDetails.parallelism),!1,v);return eGe({allWorkspaceData:H,connectionManager:q,logContext:v,platform:Y,renderer:ex(R),runID:_,runInfo:P,nodesInRun:W,teamInfoAndFirebase:t,workspaceID:z,memoryMonitor:G},U)}catch(H){try{await U()}catch(L){Wa.error("Unable to clean up hearbeat after handling error",H,"innerError",L)}throw H}},O6m=async(r,t,n,i,o)=>{let s="CloudDevRun:";Wa.infoContext(o,s,`Starting dev run job coa-${r}`);let a=sZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{rootRepository:d,teamInfo:{fbTeamID:p,fbUserID:f}}=t,A=d.org(p),g=await Rne(A.workspace(u).workspaceUser(f),c),b=vu().featureFlags;await SNe(p,f,u,a.userCredentials,g,b);let _=await b6(d,p,f,u,DNe(a.userCredentials),c),v=A.devRun(l);await v.updateHeartbeat({runStatus:"initializing"});let O={...yhd(a,_,f,r),id:l},R=REe(O.runType,v),w=new wU;try{let P=await g3e(u,A,w);P.userConnections[u][f]=HNe(_,f);let z=tGe(O.runDetails,P),{connectionManager:j,platform:U}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return j3c({allWorkspaceData:P,connectionManager:j,logContext:c,platform:U,renderer:ex(b),runID:l,runInfo:O,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.errorContext(c,s,"unable to clean up heartbeat with error",z,"following run error",P)}throw P}},R6m=async(r,t,n,i,o)=>{let s="[CloudPlan]",{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,c=vu().featureFlags,{currentWorkspaceData:d,desiredWorkspaceData:p,disablePresync:f,parameters:A,skippedBeforeCollection:g,userCredentials:b,useRenderCache:_,workspaceID:v}=n,O={...o,planID:i,workspaceID:v},{measure:R,printSummary:w}=P1(s,O);try{let P=await R("get platform and test connection",()=>cfd(l,u,v,a,b,c,O)),z={currentWorkspaceData:{...d,platformKind:P.name},desiredWorkspaceData:{...p,platformKind:P.name},skippedBeforeCollection:g};Wa.infoContext(O,s,`Starting plan job coa-${r}`),await lfd({disablePresync:f,skipPlanContextUpload:c.isFeatureEnabled("skipPlanContextUpload"),useRenderCache:_},ex(c),i,v,l,P,A,z,a,O)}finally{w()}},Mhd=async r=>{let t="[CloudEntry]";Wa.debug("Cloud entrypoint."),g$u(()=>{try{return Wa.getCommonLogger()}catch(b){Wa.error("Failed to get common logger for starting OpenTelemetry SDK",{error:b});return}});let n=process.env.SCHEDULER_ADDRESS;if(!n){let b="No SCHEDULER_ADDRESS defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let i=process.env.COALESCE_COA_CLOUD_TOKEN;if(!i){let b="No COALESCE_COA_CLOUD_TOKEN defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let o=await Vwi(i,new URL(n)),{rootRepository:s,teamInfo:{fbTeamID:a,fbUserID:u},featureFlags:l}=o,c={kubernetesJobUuid:r,orgID:a,userID:u};Wa.infoContext(c,t,"authenticated user");let d,{action:p,id:f,cloudRunAction:A}=M6m(c);p==="plan"?c.planID=f:c.runID=Oce(f,`Unable to parse runID: ${f}`);let g=c;try{await V3c(s,a)&&(j9i(),Wa.debugContext(g,t,"super Debug enabled"));let b=process.env.COALESCE_COA_CLOUD_REQUEST_PATH;if(!b){let v="COALESCE_COA_CLOUD_REQUEST_PATH not set!";throw Wa.emergContext(g,t,v),new et(v)}let _=await w6m(b,s,g);d=TFe({userID:u,orgID:a,logContext:g,featureFlags:l},()=>(Wa.infoContext(g,t,`${p} job ${f} started, waiting for completion`),A(r,o,_,f,g))),await d,Wa.infoContext(g,t,"job completed without exception")}catch(b){return Wa.errorContext(g,t,"error starting coa run",b),p==="plan"?Wa.infoContext(g,t,"plan job failed, no run or workspace related state to clean up"):d?(Wa.infoContext(g,t,"run was initialized, cleaning up run and workspace"),await UYn(f,p,s.org(a),b,g),Wa.infoContext(g,t,"run and workspace cleaned up")):Wa.infoContext(g,t,"run was not initialized, no run related state to clean up"),await dB(1)}await dB(0)},M6m=r=>{let t="[getCloudRunAction]",n=process.env.COALESCE_COA_CLOUD_ACTION,i=()=>{let o=process.env.COALESCE_COA_CLOUD_RUN_COUNTER;if(!o)throw new et("COALESCE_COA_CLOUD_RUN_COUNTER not set!");return o};switch(n){case"deploy":return{id:i(),action:n,cloudRunAction:v6m};case"refresh":return{id:i(),action:n,cloudRunAction:T6m};case"rerun":return{id:i(),action:n,cloudRunAction:I6m};case"devRun":return{id:i(),action:n,cloudRunAction:O6m};case"plan":{let o=process.env.COALESCE_COA_CLOUD_PLAN_ID;if(!o){let s=`Plan ID was not set! planID: ${o}`;throw Wa.emergContext(r,t,s),new et(s)}return{id:o,action:n,cloudRunAction:R6m}}default:{let o=n;throw Wa.emergContext(r,t,`received unexpected COALESCE_COA_CLOUD_ACTION value ${o}`),new et(`Error: COALESCE_COA_CLOUD_ACTION is invalid! value=${o}`)}}},w6m=async(r,t,n)=>{let i="[downloadAndCleanupFile]";Wa.infoContext(n,i,"downloading request data from",r);let o=await t.storage().downloadFile(r),s=Rj(o);Wa.infoContext(n,i,"finished parsing request data as JSON completed; deleting stored request",s);try{await t.storage().deleteFile(r),Wa.infoContext(n,i,"finished deleting stored request; dispatching cloud run")}catch(a){Wa.assertContext(n,i,`error deleting stored request at ${r}...continuing`,a)}return o};var Ghd=_t(jhd(),1),{program:lgC,createCommand:dgC,createArgument:pgC,createOption:fgC,CommanderError:AgC,InvalidArgumentError:TAa,InvalidOptionArgumentError:hgC,Command:Hhd,Argument:ggC,Option:ix,Help:mgC}=Ghd.default;var rat=_t(require("fs")),fCd=_t(Yhd());var Jhd={openapi:"3.1.0",info:{version:"1.0.0",title:"Coalesce API",description:"REST API for performing operations with the Coalesce backend."},servers:[{url:"https://app.coalescesoftware.io",description:"US primary"},{url:"https://app.eu.coalescesoftware.io",description:"Europe primary"},{url:"https://app.australia-southeast1.gcp.coalescesoftware.io",description:"Australia primary"},{url:"https://app.us-east-1.aws.coalescesoftware.io",description:"US AWS US East"},{url:"https://app.us-east-1.aws.privatelink.coalescesoftware.io",description:"US AWS US East with PrivateLink"},{url:"https://app.us-west-2.aws.coalescesoftware.io",description:"US AWS US West"},{url:"https://app.us-west-2.aws.privatelink.coalescesoftware.io",description:"US AWS US West with PrivateLink"},{url:"https://app.northamerica-northeast1.gcp.coalescesoftware.io",description:"Canada Primary"},{url:"https://app.westus2.azure.coalescesoftware.io",description:"US Azure West 2"},{url:"https://app.eastus2.azure.coalescesoftware.io",description:"US Azure East 2"}],security:[{BearerAuth:[]}],"x-coa-private-pointers":["/paths/~1api~1v2~1render","/paths/~1api~1v2~1render~1health","/components/schemas/PackageDefinition","/components/schemas/RenderRequestV2"],components:{schemas:{PlatformKind:{type:"string",enum:["snowflake","fabric","databricks","bigquery"]},DatabaseInfo:{type:"object",required:["apiKey","authDomain","projectId","storageBucket","messagingSenderId","appId","measurementId"],properties:{apiKey:{type:"string"},authDomain:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},appId:{type:"string"},measurementId:{type:"string"},emulatorInfo:{type:"object",required:["auth","firestore","storage"],properties:{auth:{type:"string"},firestore:{type:"string"},storage:{type:"string"}}}}},EnvironmentsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of environment information.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/Environment"}},{type:"array",items:{$ref:"#/components/schemas/EnvironmentSummary"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["number","null"],description:"The field value representing the start of the next page of results."}}},FeatureFlagsClientConfig:{type:"object",description:"Information a client needs to connect to the feature flag service.",required:["launchDarklyClientID"],properties:{launchDarklyClientID:{type:"string"}}},FeatureFlagsValues:{type:"object",description:"Feature flag values.",properties:{featureFlags:{additionalProperties:{oneOf:[{type:"boolean"},{type:"string"},{type:"number"},{type:"object"},{type:"array"}]}}},required:["featureFlags"]},ProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/Project"}}}},ProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Information about a project.",$ref:"#/components/schemas/Project"}}},ProjectGitAccountResponse:{$ref:"#/components/schemas/ProjectGitAccountResponseData"},ProjectGitAccountsResponse:{type:"object",required:["data"],properties:{data:{description:"A colleciton of project git accounts",type:"array",items:{$ref:"#/components/schemas/ProjectGitAccountResponseData"}}}},TypesenseConfigResponse:{description:"Summary of configuration data for Typesense in a given org.","x-coa-private":!0,type:"object",required:["typesenseKey","typesenseHosts"],properties:{typesenseKey:{description:"The Typesense access key scoped to a users org.",type:"string"},typesenseHosts:{description:"The Typesense host address(es) for our cluster(s).",type:"array",items:{type:"string"}}}},EnvironmentSummary:{type:"object",description:"Summary information about an environment.",additionalProperties:!1,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string",description:"The Environment ID."},name:{type:"string",description:"Name of the Environment."},project:{type:"string",description:"The Project ID."},status:{$ref:"#/components/schemas/EnvironmentHealth",description:"Status of the Environment."}},required:["createdAt","id","name","project","status"]},ErrorResponse:{description:"Error detail in addition to the HTTP status code and text.",type:"object",required:["error"],properties:{error:{$ref:"#/components/schemas/Error"}}},NodesResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of nodes for an environment.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/NodeSummary"}},{type:"array",items:{$ref:"#/components/schemas/Node"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["string","null"],description:"The field value representing the start of the next page of results."}}},NodeSummary:{type:"object",properties:{database:{type:"string",description:"The Snowflake database name."},id:{type:"string",description:"The Coalesce Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The database schema name."}},required:["database","id","locationName","name","nodeType","schema"]},OrderByDirection:{description:"The sort order for query results.",type:"string",enum:["asc","desc"]},PackageCreateEntity:{description:"A single package entity to be created.","x-coa-private":!0,type:"object",properties:{macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}}},required:["macros","dependencies","nodeTypes"]},PackageDependency:{description:"A package dependency.","x-coa-private":!0,type:"object",required:["version","macros","dependencies","releaseID","alias","packageID"],properties:{packageID:{type:"string",minLength:1},alias:{type:"string"},version:{type:"string"},releaseID:{type:"string",minLength:1},macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}}},examples:[{name:"foo",version:"1.2.3",macros:"{% macro bar() %}hello,{% endmacro %}",nodeTypes:{},dependencies:{dep:{name:"baz",version:"1.1.1",macros:"{% macro bar() %}world!{% endmacro %}",dependencies:{}}}}]},PackageEntityTagV1:{description:"Identifies the package from which the entity came. (Deprecated, see PackageEntityTagV2).","x-coa-private":!0,type:"object",required:["id","version"],properties:{id:{type:"string"},version:{type:"string"}}},PackageEntityTagV2:{description:"Identifies the package from which the entity came.","x-coa-private":!0,type:"object",required:["id","releaseID"],properties:{id:{type:"string"},releaseID:{type:"string"}}},PackageMacro:{description:"A macro in a package.","x-coa-private":!0,type:"string"},PackageNodeType:{description:"A node type in a collection of nodeTypes to be packaged.","x-coa-private":!0,type:"object",required:["name","version","isDisabled","metadata","id"],properties:{name:{type:"string"},version:{type:"number"},id:{type:"string"},isDisabled:{type:"boolean"},metadata:{type:"object"}}},PackageCreateReleaseInfo:{description:"Package release information for a create operation.","x-coa-private":!0,type:"object",properties:{changeLog:{type:"string"},version:{type:"string"},certified:{type:"boolean"}},required:["changeLog","version"]},PackageCreateEntities:{description:"Entities that are part of a package release.","x-coa-private":!0,required:["dependencies","nodeTypes","macros"],properties:{dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}},macros:{type:"string"}}},RunsOrderBy:{description:"The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type.",type:"string",enum:["id","runStartTime","runEndTime"]},RunsResponse:{description:"A collection of runs.",type:"object",required:["limit","next","orderBy","orderByDirection","data"],properties:{limit:{description:"The maximum number of runs returned by this query.",type:"integer"},next:{description:"The field value representing the start of the next page of results.",type:["number","string","null"]},orderByDirection:{$ref:"#/components/schemas/OrderByDirection"},orderBy:{$ref:"#/components/schemas/RunsOrderBy"},data:{description:"A collection of runs.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/RunSummary"}},{type:"array",items:{$ref:"#/components/schemas/RunInfo"}}]}}},RunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of run results.",type:"array",items:{$ref:"#/components/schemas/RunResult"}}}},StoredRunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"Raw run results from external storage.",type:"array",items:{$ref:"#/components/schemas/StoredRunResult"}}}},RunSummary:{type:"object",properties:{id:{description:"The run ID.",type:"integer"},reRunID:{description:"If this is a re-run, the ID of the original operation.",type:"string"},runStartTime:{description:"The datetime the run started.",type:"string",format:"date-time"},runEndTime:{description:"The datetime the run ended.",type:"string",format:"date-time"},runType:{$ref:"#/components/schemas/RunType"},runStatus:{$ref:"#/components/schemas/RunStatus"},environmentID:{description:"The environment in which the run operation was applied.",type:"string"},runFailureReason:{description:"Information about the cause of a run failure.",type:"string"}},required:["id","runType","runStatus"]},UserEnvironmentRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserEnvironmentRoles"},additionalProperties:!1},UserProjectRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserProjectRoles"},additionalProperties:!1},UserRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserOrgRoles"},additionalProperties:!1},SingleUserRoleResponseV2:{$ref:"#/components/schemas/UserOrgRolesV2"},UserRoleResponseV2:{type:"object",properties:{userRoles:{type:"array",items:{$ref:"#/components/schemas/UserOrgRolesV2"}}},required:["userRoles"],additionalProperties:!1},FivetranProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/FivetranProject"}}}},FivetranProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran project data.",$ref:"#/components/schemas/FivetranProject"}}},FivetranJobsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of job information.",type:"array",items:{$ref:"#/components/schemas/FivetranJob"}}}},FivetranJobHistoryResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran job history data.",$ref:"#/components/schemas/FivetranJobHistory"}}},FivetranRefreshJobResponse:{type:"object",required:["data"],properties:{data:{description:"A fivetran job",$ref:"#/components/schemas/FivetranJobHistory"}}},MetricsItem:{type:"object",required:["name","tags","count"],properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}},count:{type:"integer"}}},MetricsRequest:{type:"object",required:["metrics"],properties:{metrics:{type:"array",items:{$ref:"#/components/schemas/MetricsItem"}}}},BaseEnvironment:{type:"object",description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",additionalProperties:!0,properties:{connectionAccount:{type:"string",description:"The account name for the environment connection."},defaultStorageMapping:{type:"string",nullable:!0},description:{type:"string",description:"The Environment description."},name:{type:"string",description:"The Environment name."},oauthEnabled:{type:"boolean",description:"If OAuth is enabled."},runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},tagColors:{$ref:"#/components/schemas/TagColor"},project:{type:"string"}},required:["name","oauthEnabled","project"]},Environment:{description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",allOf:[{$ref:"#/components/schemas/BaseWorkspaceEnv"},{type:"object",additionalProperties:!0,properties:{runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},currentMappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},required:["createdAt","id","status"]}]},EnvironmentCreateRequest:{"x-coa-private":!0,type:"object",description:"Initial values to set on a newly created environment.",allOf:[{$ref:"#/components/schemas/BaseEnvironment"},{type:"object",properties:{mappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},additionalProperties:!0}]},EnvironmentHealth:{type:"string",enum:["Deleting","Deploying","Failed Deploy","Failed Dev Run","Failed Refresh","Initializing","Refreshing","Running Dev Run","Waiting"]},EnvironmentStorageLocationMappings:{type:"object",description:"The Storage Mapping name.",additionalProperties:{type:"object",properties:{database:{type:"string",description:"The database name."},schema:{type:"string",description:"The database schema."}}}},BaseProject:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},required:["name"]},Project:{description:"A project groups environments and workspaces for easier management and access control.",allOf:[{$ref:"#/components/schemas/BaseProject"},{type:"object",additionalProperties:!0,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},updatedBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string"},status:{$ref:"#/components/schemas/ProjectStatus"},workspaces:{type:"array",items:{$ref:"#/components/schemas/WorkspaceSummary"}}},required:["createdAt","updatedAt","id","status","name"]}]},ProjectCreateRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1,required:["name","platformKind"]},ProjectPatchRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1},ProjectStatus:{type:"string",enum:["active","deleted"]},ProjectGitAccountResponseData:{type:"object",required:["gitAccountID","userID"],properties:{gitAccountID:{type:"string"},userID:{type:"string"}}},ProjectGitAccountSetRequest:{required:["gitAccountID"],properties:{gitAccountID:{type:"string"}}},UserSummary:{type:"object",description:"Summary information about a user.",additionalProperties:!1,properties:{id:{type:"string",description:"The user ID."},firstName:{type:"string",description:"User first name."},lastName:{type:"string",description:"User last name."},email:{type:"string"},accountType:{type:"string",enum:["SSO","normal"]}},required:["id"]},FirestoreWebTimestamp:{type:"object",description:"Timestamp from the web Firestore SDK.",additionalProperties:!1,properties:{seconds:{type:"number"},nanoseconds:{type:"number"}},required:["seconds","nanoseconds"]},FirestoreAdminTimestamp:{type:"object",description:"Timestamp from the admin Firestore SDK.",additionalProperties:!1,properties:{_seconds:{type:"number"},_nanoseconds:{type:"number"}},required:["_seconds","_nanoseconds"]},FirestoreTimestamp:{type:"object",description:"Timestamp from either the web admin Firestore SDKs.",oneOf:[{$ref:"#/components/schemas/FirestoreWebTimestamp"},{$ref:"#/components/schemas/FirestoreAdminTimestamp"}]},"Common.schema1":{type:"string",enum:["snowflake","databricks","fabric","bigquery"]},Error:{type:"object",additionalProperties:!1,properties:{errorString:{description:"The error message.",type:"string"},errorDetail:{description:"Additional detail about the error.",type:"string"}},required:["errorString"]},Node:{type:"object",oneOf:[{$ref:"#/components/schemas/SourceNode"},{$ref:"#/components/schemas/SQLNode"}]},NodeCreateRequest:{type:"object",properties:{nodeType:{$ref:"#/components/schemas/NodeType"},predecessorNodeIDs:{default:[],type:"array",items:{type:"string"},description:"The IDs of the nodes that are predecessors to this node. It can also be empty if it has no predecessors"}},additionalProperties:!1,required:["nodeType","predecessorNodeIDs"]},AliasToStepIDMapping:{type:"object",additionalProperties:{type:"string"}},AppliedColumnTests:{type:"object",description:"Will return `hasNull` or `isDistinct` as true or false if testing is enabled.",additionalProperties:{type:"boolean"}},BaseNode:{type:"object",additionalProperties:!0,properties:{database:{type:"string",description:"The Snowflake database name."},description:{type:"string",description:"The Node description."},id:{type:"string",description:"The Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The Snowflake schema name."}},required:["database","description","id","locationName","name","nodeType","schema"]},ColumnMetadata:{type:"object",additionalProperties:!1,properties:{appliedColumnTests:{$ref:"#/components/schemas/AppliedColumnTests"},columnID:{type:"string",description:"The column ID."},columnReferences:{items:{$ref:"#/components/schemas/IntermediateColumnRefResult"},type:"array"},config:{type:"object",description:"Returns any configuration options from the Node Config Tab.",additionalProperties:!0},dataType:{type:"string",description:"Column data type."},defaultValue:{type:"string",description:"The default column value."},description:{type:"string",description:"The column description."},hashDetails:{$ref:"#/components/schemas/HashMetadata"},hashedColumns:{type:"array",items:{$ref:"#/components/schemas/ColumnReference"}},isBusinessKey:{type:"boolean",description:"Tags the column as a business key."},isChangeTracking:{type:"boolean",description:"Tags the column as a change tracking column in type 2 dimensions."},isSurrogateKey:{type:"boolean",description:"Tags the column as a surrogate key, e.g. DIM_CUSTOMER_KEY."},keyColumnType:{type:"string",enum:["None","primaryBusinessKey","surrogateKey"]},name:{type:"string",description:"The column name."},nullable:{type:"boolean",description:"If the column can contain null values."},primaryKey:{description:"Tags the column as a primary key.",type:"boolean"},sources:{items:{$ref:"#/components/schemas/SourceColumnReferenceV1"},type:"array"},systemColumnType:{type:"string",enum:["None","sysCreateDate","sysCurrentFlag","sysEndDate","sysStartDate","sysUpdateDate","sysVersion"]},transform:{type:"string"},uniqueKey:{type:"boolean"},isSystemCreateDate:{type:"boolean"},isSystemUpdateDate:{type:"boolean"},isSystemStartDate:{type:"boolean"},isSystemEndDate:{type:"boolean"},isSystemVersion:{type:"boolean"},isSystemCurrentFlag:{type:"boolean"}},required:["columnID","dataType","description","name","nullable"]},ColumnReference:{type:"object",additionalProperties:!1,properties:{columnID:{type:"string",description:"Column ID of the source column."},nodeID:{type:"string",description:"Node ID of the source columm."}},required:["columnID","nodeID"]},CustomSQL:{type:"object",additionalProperties:!1,properties:{customSQL:{type:"string"}},required:["customSQL"]},HashAlgorithm:{type:"string",enum:["MD5","SHA1","SHA256"]},HashMetadata:{type:"object",additionalProperties:!1,properties:{hashAlgorithm:{$ref:"#/components/schemas/HashAlgorithm"},hashType:{enum:["ChangeHash","Hash","HubHash","LinkHash","None"],type:"string"},hubHashes:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"}},required:["hashAlgorithm"]},IntermediateColumnRefResult:{additionalProperties:!1,properties:{columnName:{type:"string"},tableName:{type:"string",nullable:!0}},required:["columnName","tableName"],type:"object"},JoinCondition:{type:"object",additionalProperties:!1,properties:{joinCondition:{type:"string"}},required:["joinCondition"]},NodeType:{anyOf:[{type:"string",enum:["Dimension","Fact","Hub","Link","Satellite","Source","Stage","View","persistentStage"]},{type:"string"}]},RefLink:{type:"object",additionalProperties:!1,properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]},SourceColumnReference:{anyOf:[{$ref:"#/components/schemas/SourceColumnReferenceV1"},{$ref:"#/components/schemas/SourceColumnReferenceV2"}]},SourceColumnReferenceV1:{type:"object",additionalProperties:!1,properties:{columnReferences:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"},transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["columnReferences","transform"]},SourceColumnReferenceV2:{type:"object",additionalProperties:!1,properties:{transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["transform"]},SourceMap:{additionalProperties:!1,properties:{aliases:{$ref:"#/components/schemas/AliasToStepIDMapping"},customSQL:{$ref:"#/components/schemas/CustomSQL"},dependencies:{items:{$ref:"#/components/schemas/RefLink"},type:"array"},join:{$ref:"#/components/schemas/JoinCondition"},name:{type:"string"},noLinkRefs:{items:{$ref:"#/components/schemas/RefLink"},type:"array"}},required:["dependencies","join","name","noLinkRefs"],type:"object"},RunStatus:{enum:["canceled","completed","failed","initializing","rendering","running","waitingToRun"],type:"string"},RunType:{enum:["deploy","refresh"],type:"string"},BigQueryUserConnectionType:{type:"string",enum:["ServiceAccount","OAuth"]},DatabricksUserConnectionType:{type:"string",enum:["Token","Cloud","OAuthU2M","OAuthM2M"]},FabricUserConnectionType:{type:"string",enum:["oauth"]},SnowflakeUserConnectionType:{type:"string",enum:["Basic","Cloud","KeyPair","OAuth"]},DeployRunDetails:{type:"object",additionalProperties:!1,description:"Deployment run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},deployCommit:{type:"string",description:"The full commit hash."},deployCommitMessage:{type:"string",description:"The commit message."},environmentID:{type:"string",description:"The Environment ID for this run."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},nodesInRun:{type:"integer",description:"The number of Nodes deployed."}},required:["deployCommit","environmentID"]},RefreshRunDetails:{type:"object",additionalProperties:!1,description:"Refresh run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},environmentID:{type:"string",description:"The Environment ID for this run."},excludeNodesSelector:{type:"string",description:"A selector string of nodes to exclude."},forceIgnoreEnvironmentStatus:{type:"boolean"},includeNodesSelector:{type:"string",description:"A selector string of nodes to include."},jobID:{type:"integer",description:"The Job ID."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},refreshDescription:{type:"string",description:"The Job name."},nodesForRefresh:{type:"integer"},nodesInRun:{type:"integer",description:"The number of Nodes deployed."},executor:{type:"string"}},required:["environmentID"]},RunDetails:{description:"Detailed information about a run.",anyOf:[{$ref:"#/components/schemas/DeployRunDetails"},{$ref:"#/components/schemas/RefreshRunDetails"}]},RunInfo:{description:"The full details of a run, without the run results.",type:"object",additionalProperties:!1,properties:{id:{type:"integer"},reRunID:{type:"string",description:"If this is a re-run, the ID of the original operation."},runDetails:{$ref:"#/components/schemas/RunDetails"},runEndTime:{format:"date-time",type:"string",description:"The datetime when the run ended."},runFailureReason:{type:"string",description:"The reason the run failed."},runHistory:{items:{type:"integer"},type:"array"},runStartTime:{format:"date-time",type:"string",description:"The datetime the run started."},runStatus:{$ref:"#/components/schemas/RunStatus"},runTimeParameters:{type:"object",description:"The default Environment parameters. Parameters changed during deploy will not show here.",additionalProperties:!0},runType:{$ref:"#/components/schemas/RunType"},userCredentials:{oneOf:[{$ref:"#/components/schemas/SnowflakeUserCredentials"},{$ref:"#/components/schemas/DatabricksUserCredentials"},{$ref:"#/components/schemas/FabricUserCredentials"},{$ref:"#/components/schemas/BigQueryUserCredentials"}]},userID:{type:"string"},projectID:{type:"string"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures."},version:{type:"integer"},renderingProgress:{type:"object",description:"Progress information for the rendering phase",properties:{totalNodes:{type:"integer",minimum:0,description:"Total number of nodes to render"},completedNodes:{type:"integer",minimum:0,description:"Number of nodes completed so far"}},required:["totalNodes","completedNodes"]}},required:["id","runDetails","runStatus","runTimeParameters","runType","projectID"]},BigQueryUserCredentials:{description:"Information about the BigQuery account used to perform a run.",type:"object",additionalProperties:!1,properties:{bigQueryAuthType:{$ref:"#/components/schemas/BigQueryUserConnectionType"}},required:["bigQueryAuthType"]},FabricUserCredentials:{description:"Information about the Fabric account used to perform a run.",type:"object",additionalProperties:!1,properties:{fabricConnectionString:{type:"string"},fabricAuthType:{$ref:"#/components/schemas/FabricUserConnectionType"},platformKind:{type:"string"}},required:["fabricConnectionString","fabricAuthType"]},DatabricksUserCredentials:{description:"Information about the Databricks account used to perform a run.",type:"object",additionalProperties:!1,properties:{databricksHost:{type:"string"},databricksAuthType:{$ref:"#/components/schemas/DatabricksUserConnectionType"},databricksPath:{type:"string"}},required:["databricksHost","databricksAuthType","databricksPath"]},SnowflakeUserCredentials:{description:"Information about the Snowflake account used to perform a run.",type:"object",additionalProperties:!1,properties:{snowflakeAccount:{type:"string"},snowflakeAuthType:{$ref:"#/components/schemas/SnowflakeUserConnectionType"},snowflakeRole:{type:"string"},snowflakeUsername:{type:"string"},snowflakeWarehouse:{type:"string"}},required:["snowflakeAccount","snowflakeAuthType","snowflakeUsername"]},QueryResult:{type:"object",additionalProperties:!1,properties:{endTime:{type:"string",format:"date-time"},error:{$ref:"#/components/schemas/Error"},isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string",description:"The name of the Stage the query ran on."},queryID:{type:"string"},rowsDeleted:{type:"integer"},rowsInserted:{type:"integer"},rowsUpdated:{type:"integer"},sql:{type:"string",description:"The SQL query run during the stage."},startTime:{type:"string",format:"date-time"},status:{type:"string",description:"The query status."},success:{type:"boolean",description:"If the query results were run successfully."},type:{type:"string",enum:["sql","sqlTest"]},warehouse:{type:"string",description:"Name of the warehouse."}},required:["isRunning","name","sql","status","success"]},RunResult:{type:"object",additionalProperties:!1,description:"The result output describing each query processed during a run.",properties:{isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string"},nodeID:{type:"string"},runState:{type:"string"},hasTestFailures:{type:"boolean"},origin:{$ref:"#/components/schemas/RunOrigins"},queryResults:{description:"The query result returns the status of different stages such as Delete Table or Rename Table. See the queryResults name for the stage.",items:{$ref:"#/components/schemas/QueryResult"},type:"array"},renderQueryResult:{$ref:"#/components/schemas/QueryResult"}},required:["isRunning","name","nodeID","queryResults"]},RunOrigins:{type:"string",enum:["API","CLI","UI","fivetranAPI"]},StoredRunResult:{type:"object",additionalProperties:!0,description:"Raw run result from external storage matching the core-types RunResult",properties:{id:{type:"string",description:"The node ID"},dataResult:{description:"Data result - can be a record of values or a completed query result",oneOf:[{type:"object",nullable:!0,additionalProperties:{oneOf:[{type:"number"},{type:"string"},{type:"boolean"}]}},{$ref:"#/components/schemas/CompletedQueryResult"}]},name:{type:"string",description:"The name of the node"},queryResultSequence:{$ref:"#/components/schemas/QueryResultSequence"},runExecutionSequenceID:{type:"integer",description:"The execution sequence ID"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures"},runResultVersion:{type:"integer",enum:[2],default:2,description:"Version of the run result format"},runState:{type:"string",enum:["waiting","queued","running","complete","error","skipped","canceled"],description:"The state of the run"},stepRunState:{type:"string",enum:["None","Error","Validated","Created","DataLoaded","Skipped"],description:"The state of the step run"},version:{type:"integer",enum:[2],default:2,description:"Version field"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","name","queryResultSequence","runState","stepRunState","version","createdAt","updatedAt"]},QueryResultSequence:{type:"object",additionalProperties:!0,properties:{name:{type:"string"},queryResults:{type:"array",items:{oneOf:[{$ref:"#/components/schemas/CompletedQueryResult"},{$ref:"#/components/schemas/RunningQueryResult"}]}},isRunning:{type:"boolean"},renderQueryResults:{$ref:"#/components/schemas/CompletedQueryResult",description:"Legacy field - unused"}},required:["name","queryResults","isRunning"]},CompletedQueryResult:{type:"object",additionalProperties:!0,properties:{endTime:{type:"string",format:"date-time"},error:{type:"object",properties:{errorString:{type:"string"},errorDetail:{type:"string"}},required:["errorString","errorDetail"],nullable:!0},fields:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}},isRunning:{type:"boolean"},name:{type:"string"},sql:{type:"string"},startTime:{type:"string",format:"date-time"},status:{type:"string",enum:["Success","Failure","Canceled","Queued","Running","Transaction exceeded data limit, returned a subset of rows"]},success:{type:"boolean"},type:{type:"string",enum:["sql","sqlTest"]},exportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}},invalidExportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}}},required:["name","isRunning","status","success","type","exportedRefs","invalidExportedRefs","startTime","endTime","sql","fields"]},RunningQueryResult:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},isRunning:{type:"boolean",enum:[!0]}},required:["name","isRunning"]},OrgRoles:{type:"object",description:"Specifies role assignments.",required:["organizationRoles","projects"],properties:{organizationRoles:{description:"The organization roles assigned to the user.",type:"array",items:{type:"string"}},projects:{description:"A dictionary of project role assignments keyed by project ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/ProjectRoles"}}},additionalProperties:!0},ProjectRoles:{type:"object",description:"Specifies project role assignments.",required:["projectRoles","environments"],properties:{projectRoles:{type:"array",items:{type:"string"}},environments:{description:"A dictionary of environment role assignments keyed by environment ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/EnvironmentRoles"}}},additionalProperties:!0},EnvironmentRoles:{type:"object",description:"Specifies environment role assignments.",required:["environmentRoles"],properties:{environmentRoles:{description:"The environment roles assigned to the user.",type:"array",items:{type:"string"}}},additionalProperties:!0},UserOrgRoles:{description:"The roles assigned to a user.",allOf:[{$ref:"#/components/schemas/OrgRoles"},{type:"object",required:["user","organizationRoles","projects"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserProjectRoles:{description:"The project roles assigned to the user.",allOf:[{$ref:"#/components/schemas/ProjectRoles"},{type:"object",required:["user","projectRoles","environments"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserEnvironmentRoles:{description:"The environment roles assigned to the user.",allOf:[{$ref:"#/components/schemas/EnvironmentRoles"},{type:"object",required:["user"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserOrgRolesV2:{description:"The roles assigned to a user.",type:"object",properties:{userID:{type:"string"},organizationRole:{description:`The user role for the org. If the user's organization role does not grant any project permissions and an
|
|
10371
10371
|
environment or project ID was specified, this will be omitted
|
|
10372
10372
|
`,type:"string"},projectRoles:{description:`For each project, if the user has a role, the key is the project ID and the value is the user's role. If the
|
|
10373
10373
|
user has a role but the role grants to environment permissions to a specified environment, it will be omitted.
|