Skip to content

Instantly share code, notes, and snippets.

@goofmint
Last active April 11, 2024 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/e88afe4e092d79a96e2dbc33729c2077 to your computer and use it in GitHub Desktop.
Save goofmint/e88afe4e092d79a96e2dbc33729c2077 to your computer and use it in GitHub Desktop.
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.hexabase=t():e.hexabase=t()}(self,(()=>(()=>{var e={5092:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AbortError:()=>n,DefaultHttpClient:()=>C,HttpClient:()=>h,HttpError:()=>s,HttpResponse:()=>l,HttpTransportType:()=>K,HubConnection:()=>$,HubConnectionBuilder:()=>Z,HubConnectionState:()=>N,JsonHubProtocol:()=>z,LogLevel:()=>p,MessageType:()=>j,NullLogger:()=>_,Subject:()=>L,TimeoutError:()=>r,TransferFormat:()=>G,VERSION:()=>f});class s extends Error{constructor(e,t){const i=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=i}}class r extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class n extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class o extends Error{constructor(e,t){const i=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=i}}class a extends Error{constructor(e,t){const i=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=i}}class c extends Error{constructor(e,t){const i=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=i}}class d extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class u extends Error{constructor(e,t){const i=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=i}}class l{constructor(e,t,i){this.statusCode=e,this.statusText=t,this.content=i}}class h{get(e,t){return this.send({...t,method:"GET",url:e})}post(e,t){return this.send({...t,method:"POST",url:e})}delete(e,t){return this.send({...t,method:"DELETE",url:e})}getCookieString(e){return""}}var p;!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(p||(p={}));class _{constructor(){}log(e,t){}}_.instance=new _;const f="7.0.12";class m{static isRequired(e,t){if(null==e)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,i){if(!(e in t))throw new Error(`Unknown ${i} value: ${e}.`)}}class y{static get isBrowser(){return"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return"object"==typeof self&&"importScripts"in self}static get isReactNative(){return"object"==typeof window&&void 0===window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function g(e,t){let i="";return v(e)?(i=`Binary data of length ${e.byteLength}`,t&&(i+=`. Content: '${function(e){const t=new Uint8Array(e);let i="";return t.forEach((e=>{i+=`0x${e<16?"0":""}${e.toString(16)} `})),i.substr(0,i.length-1)}(e)}'`)):"string"==typeof e&&(i=`String data of length ${e.length}`,t&&(i+=`. Content: '${e}'`)),i}function v(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function b(e,t,i,s,r,n){const o={},[a,c]=I();o[a]=c,e.log(p.Trace,`(${t} transport) sending data. ${g(r,n.logMessageContent)}.`);const d=v(r)?"arraybuffer":"text",u=await i.post(s,{content:r,headers:{...o,...n.headers},responseType:d,timeout:n.timeout,withCredentials:n.withCredentials});e.log(p.Trace,`(${t} transport) request complete. Response status: ${u.statusCode}.`)}class E{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}}class T{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const i=`[${(new Date).toISOString()}] ${p[e]}: ${t}`;switch(e){case p.Critical:case p.Error:this.out.error(i);break;case p.Warning:this.out.warn(i);break;case p.Information:this.out.info(i);break;default:this.out.log(i)}}}}function I(){let e="X-SignalR-User-Agent";return y.isNode&&(e="User-Agent"),[e,w(f,k(),y.isNode?"NodeJS":"Browser",S())]}function w(e,t,i,s){let r="Microsoft SignalR/";const n=e.split(".");return r+=`${n[0]}.${n[1]}`,r+=` (${e}; `,r+=t&&""!==t?`${t}; `:"Unknown OS; ",r+=`${i}`,r+=s?`; ${s}`:"; Unknown Runtime Version",r+=")",r}function k(){if(!y.isNode)return"";switch(process/browser.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process/browser.platform}}function S(){if(y.isNode)return process/browser.versions.node}function O(e){return e.stack?e.stack:e.message?e.message:`${e}`}class A extends h{constructor(e){if(super(),this._logger=e,"undefined"==typeof fetch){const e=require;this._jar=new(e("tough-cookie").CookieJar),this._fetchType=e("node-fetch"),this._fetchType=e("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i.g)return i.g;throw new Error("could not find global")}());if("undefined"==typeof AbortController){const e=require;this._abortControllerType=e("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new n;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let i;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),i=new n});let o,a=null;if(e.timeout){const s=e.timeout;a=setTimeout((()=>{t.abort(),this._logger.log(p.Warning,"Timeout from HTTP request."),i=new r}),s)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},v(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{o=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(i)throw i;throw this._logger.log(p.Warning,`Error from HTTP request. ${e}.`),e}finally{a&&clearTimeout(a),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const e=await D(o,"text");throw new s(e||o.statusText,o.status)}const c=D(o,e.responseType),d=await c;return new l(o.status,o.statusText,d)}getCookieString(e){let t="";return y.isNode&&this._jar&&this._jar.getCookies(e,((e,i)=>t=i.join("; "))),t}}function D(e,t){let i;switch(t){case"arraybuffer":i=e.arrayBuffer();break;case"text":default:i=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return i}class P extends h{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new n):e.method?e.url?new Promise(((t,i)=>{const o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=void 0===e.withCredentials||e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===e.content&&(e.content=void 0),e.content&&(v(e.content)?o.setRequestHeader("Content-Type","application/octet-stream"):o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const a=e.headers;a&&Object.keys(a).forEach((e=>{o.setRequestHeader(e,a[e])})),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),i(new n)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?t(new l(o.status,o.statusText,o.response||o.responseText)):i(new s(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(p.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),i(new s(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(p.Warning,"Timeout from HTTP request."),i(new r)},o.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class C extends h{constructor(e){if(super(),"undefined"!=typeof fetch||y.isNode)this._httpClient=new A(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new P(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new n):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class x{static write(e){return`${e}${x.RecordSeparator}`}static parse(e){if(e[e.length-1]!==x.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(x.RecordSeparator);return t.pop(),t}}x.RecordSeparatorCode=30,x.RecordSeparator=String.fromCharCode(x.RecordSeparatorCode);class R{writeHandshakeRequest(e){return x.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,i;if(v(e)){const s=new Uint8Array(e),r=s.indexOf(x.RecordSeparatorCode);if(-1===r)throw new Error("Message is incomplete.");const n=r+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,n))),i=s.byteLength>n?s.slice(n).buffer:null}else{const s=e,r=s.indexOf(x.RecordSeparator);if(-1===r)throw new Error("Message is incomplete.");const n=r+1;t=s.substring(0,n),i=s.length>n?s.substring(n):null}const s=x.parse(t),r=JSON.parse(s[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[i,r]}}var j,N;!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(j||(j={}));class L{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new E(this,e)}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(N||(N={}));class ${constructor(e,t,i,s){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(p.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},m.isRequired(e,"connection"),m.isRequired(t,"logger"),m.isRequired(i,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this._logger=t,this._protocol=i,this.connection=e,this._reconnectPolicy=s,this._handshakeProtocol=new R,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=N.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:j.Ping})}static create(e,t,i,s){return new $(e,t,i,s)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==N.Disconnected&&this._connectionState!==N.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==N.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=N.Connecting,this._logger.log(p.Debug,"Starting HubConnection.");try{await this._startInternal(),y.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=N.Connected,this._connectionStarted=!0,this._logger.log(p.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=N.Disconnected,this._logger.log(p.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise(((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t}));await this.connection.start(this._protocol.transferFormat);try{const t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(p.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(p.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(p.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){const e=this._startPromise;this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){return this._connectionState===N.Disconnected?(this._logger.log(p.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===N.Disconnecting?(this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=N.Disconnecting,this._logger.log(p.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(p.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new n("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){const[i,s]=this._replaceStreamingParams(t),r=this._createStreamInvocation(e,t,s);let n;const o=new L;return o.cancelCallback=()=>{const e=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],n.then((()=>this._sendWithProtocol(e)))},this._callbacks[r.invocationId]=(e,t)=>{t?o.error(t):e&&(e.type===j.Completion?e.error?o.error(new Error(e.error)):o.complete():o.next(e.item))},n=this._sendWithProtocol(r).catch((e=>{o.error(e),delete this._callbacks[r.invocationId]})),this._launchStreams(i,n),o}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){const[i,s]=this._replaceStreamingParams(t),r=this._sendWithProtocol(this._createInvocation(e,t,!0,s));return this._launchStreams(i,r),r}invoke(e,...t){const[i,s]=this._replaceStreamingParams(t),r=this._createInvocation(e,t,!1,s);return new Promise(((e,t)=>{this._callbacks[r.invocationId]=(i,s)=>{s?t(s):i&&(i.type===j.Completion?i.error?t(new Error(i.error)):e(i.result):t(new Error(`Unexpected message type: ${i.type}`)))};const s=this._sendWithProtocol(r).catch((e=>{t(e),delete this._callbacks[r.invocationId]}));this._launchStreams(i,s)}))}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const i=this._methods[e];if(i)if(t){const s=i.indexOf(t);-1!==s&&(i.splice(s,1),0===i.length&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const t=this._protocol.parseMessages(e,this._logger);for(const e of t)switch(e.type){case j.Invocation:this._invokeClientMethod(e);break;case j.StreamItem:case j.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===j.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(p.Error,`Stream callback threw error: ${O(e)}`)}}break}case j.Ping:break;case j.Close:{this._logger.log(p.Information,"Close message received from server.");const t=e.error?new Error("Server returned an error on close: "+e.error):void 0;!0===e.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}default:this._logger.log(p.Warning,`Invalid message type: ${e.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,i;try{[i,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){const t="Error parsing handshake response: "+e;this._logger.log(p.Error,t);const i=new Error(t);throw this._handshakeRejecter(i),i}if(t.error){const e="Server returned handshake error: "+t.error;this._logger.log(p.Error,e);const i=new Error(e);throw this._handshakeRejecter(i),i}return this._logger.log(p.Debug,"Server handshake complete."),this._handshakeResolver(),i}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout((async()=>{if(this._connectionState===N.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const t=e.target.toLowerCase(),i=this._methods[t];if(!i)return this._logger.log(p.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(p.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const s=i.slice(),r=!!e.invocationId;let n,o,a;for(const i of s)try{const s=n;n=await i.apply(this,e.arguments),r&&n&&s&&(this._logger.log(p.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),o=void 0}catch(e){o=e,this._logger.log(p.Error,`A callback for the method '${t}' threw error '${e}'.`)}a?await this._sendWithProtocol(a):r?(o?a=this._createCompletionMessage(e.invocationId,`${o}`,null):void 0!==n?a=this._createCompletionMessage(e.invocationId,null,n):(this._logger.log(p.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(a)):n&&this._logger.log(p.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(p.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new n("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===N.Disconnecting?this._completeClose(e):this._connectionState===N.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===N.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=N.Disconnected,this._connectionStarted=!1,y.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(p.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let i=0,s=void 0!==e?e:new Error("Attempting to reconnect due to a unknown error."),r=this._getNextRetryDelay(i++,0,s);if(null===r)return this._logger.log(p.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=N.Reconnecting,e?this._logger.log(p.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(p.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(p.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==N.Reconnecting)return void this._logger.log(p.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==r;){if(this._logger.log(p.Information,`Reconnect attempt number ${i} will start in ${r} ms.`),await new Promise((e=>{this._reconnectDelayHandle=setTimeout(e,r)})),this._reconnectDelayHandle=void 0,this._connectionState!==N.Reconnecting)return void this._logger.log(p.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=N.Connected,this._logger.log(p.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(p.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(p.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==N.Reconnecting)return this._logger.log(p.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===N.Disconnecting&&this._completeClose());s=e instanceof Error?e:new Error(e.toString()),r=this._getNextRetryDelay(i++,Date.now()-t,s)}}this._logger.log(p.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${i} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,i){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:i})}catch(i){return this._logger.log(p.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${i}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach((i=>{const s=t[i];try{s(null,e)}catch(t){this._logger.log(p.Error,`Stream 'error' callback called with '${e}' threw error: ${O(t)}`)}}))}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,i,s){if(i)return 0!==s.length?{arguments:t,streamIds:s,target:e,type:j.Invocation}:{arguments:t,target:e,type:j.Invocation};{const i=this._invocationId;return this._invocationId++,0!==s.length?{arguments:t,invocationId:i.toString(),streamIds:s,target:e,type:j.Invocation}:{arguments:t,invocationId:i.toString(),target:e,type:j.Invocation}}}_launchStreams(e,t){if(0!==e.length){t||(t=Promise.resolve());for(const i in e)e[i].subscribe({complete:()=>{t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(i))))},error:e=>{let s;s=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(i,s))))},next:e=>{t=t.then((()=>this._sendWithProtocol(this._createStreamItemMessage(i,e))))}})}}_replaceStreamingParams(e){const t=[],i=[];for(let s=0;s<e.length;s++){const r=e[s];if(this._isObservable(r)){const n=this._invocationId;this._invocationId++,t[n]=r,i.push(n.toString()),e.splice(s,1)}}return[t,i]}_isObservable(e){return e&&e.subscribe&&"function"==typeof e.subscribe}_createStreamInvocation(e,t,i){const s=this._invocationId;return this._invocationId++,0!==i.length?{arguments:t,invocationId:s.toString(),streamIds:i,target:e,type:j.StreamInvocation}:{arguments:t,invocationId:s.toString(),target:e,type:j.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:j.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:j.StreamItem}}_createCompletionMessage(e,t,i){return t?{error:t,invocationId:e,type:j.Completion}:{invocationId:e,result:i,type:j.Completion}}}const M=[0,2e3,1e4,3e4,null];class q{constructor(e){this._retryDelays=void 0!==e?[...e,null]:M}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class U{}U.Authorization="Authorization",U.Cookie="Cookie";class F extends h{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}async send(e){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const i=await this._innerClient.send(e);return t&&401===i.statusCode&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):i}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[U.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[U.Authorization]&&delete e.headers[U.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var K,G;!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(K||(K={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(G||(G={}));class H{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class B{constructor(e,t,i){this._httpClient=e,this._logger=t,this._pollAbort=new H,this._options=i,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(e,t){if(m.isRequired(e,"url"),m.isRequired(t,"transferFormat"),m.isIn(t,G,"transferFormat"),this._url=e,this._logger.log(p.Trace,"(LongPolling transport) Connecting."),t===G.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[i,r]=I(),n={[i]:r,...this._options.headers},o={abortSignal:this._pollAbort.signal,headers:n,timeout:1e5,withCredentials:this._options.withCredentials};t===G.Binary&&(o.responseType="arraybuffer");const a=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${a}.`);const c=await this._httpClient.get(a,o);200!==c.statusCode?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${c.statusCode}.`),this._closeError=new s(c.statusText||"",c.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,o)}async _poll(e,t){try{for(;this._running;)try{const i=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${i}.`);const r=await this._httpClient.get(i,t);204===r.statusCode?(this._logger.log(p.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new s(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(p.Trace,`(LongPolling transport) data received. ${g(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof r?this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(p.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(p.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?b(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(p.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(p.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,i]=I();e[t]=i;const s={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};await this._httpClient.delete(this._url,s),this._logger.log(p.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(p.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(p.Trace,e),this.onclose(this._closeError)}}}class W{constructor(e,t,i,s){this._httpClient=e,this._accessToken=t,this._logger=i,this._options=s,this.onreceive=null,this.onclose=null}async connect(e,t){return m.isRequired(e,"url"),m.isRequired(t,"transferFormat"),m.isIn(t,G,"transferFormat"),this._logger.log(p.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise(((i,s)=>{let r,n=!1;if(t===G.Text){if(y.isBrowser||y.isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),i={};i.Cookie=t;const[s,n]=I();i[s]=n,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...i,...this._options.headers}})}try{r.onmessage=e=>{if(this.onreceive)try{this._logger.log(p.Trace,`(SSE transport) data received. ${g(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},r.onerror=e=>{n?this._close():s(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this._logger.log(p.Information,`SSE connected to ${this._url}`),this._eventSource=r,n=!0,i()}}catch(e){return void s(e)}}else s(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(e){return this._eventSource?b(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class V{constructor(e,t,i,s,r,n){this._logger=i,this._accessTokenFactory=t,this._logMessageContent=s,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=n}async connect(e,t){let i;return m.isRequired(e,"url"),m.isRequired(t,"transferFormat"),m.isIn(t,G,"transferFormat"),this._logger.log(p.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(i=await this._accessTokenFactory()),new Promise(((s,r)=>{let n;e=e.replace(/^http/,"ws");const o=this._httpClient.getCookieString(e);let a=!1;if(y.isNode||y.isReactNative){const t={},[s,r]=I();t[s]=r,i&&(t[U.Authorization]=`Bearer ${i}`),o&&(t[U.Cookie]=o),n=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}else i&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(i)}`);n||(n=new this._webSocketConstructor(e)),t===G.Binary&&(n.binaryType="arraybuffer"),n.onopen=t=>{this._logger.log(p.Information,`WebSocket connected to ${e}.`),this._webSocket=n,a=!0,s()},n.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(p.Information,`(WebSockets transport) ${t}.`)},n.onmessage=e=>{if(this._logger.log(p.Trace,`(WebSockets transport) data received. ${g(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},n.onclose=e=>{if(a)this._close(e);else{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",r(new Error(t))}}}))}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(p.Trace,`(WebSockets transport) sending data. ${g(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(p.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}}class J{constructor(e,t={}){var i;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,m.isRequired(e,"url"),this._logger=void 0===(i=t.logger)?new T(p.Information):null===i?_.instance:void 0!==i.log?i:new T(i),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout;let s=null,r=null;if(y.isNode){const e=require;s=e("ws"),r=e("eventsource")}y.isNode||"undefined"==typeof WebSocket||t.WebSocket?y.isNode&&!t.WebSocket&&s&&(t.WebSocket=s):t.WebSocket=WebSocket,y.isNode||"undefined"==typeof EventSource||t.EventSource?y.isNode&&!t.EventSource&&void 0!==r&&(t.EventSource=r):t.EventSource=EventSource,this._httpClient=new F(t.httpClient||new C(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||G.Binary,m.isIn(e,G,"transferFormat"),this._logger.log(p.Debug,`Starting connection with transfer format '${G[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(p.Error,e),await this._stopPromise,Promise.reject(new n(e))}if("Connected"!==this._connectionState){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(p.Error,e),Promise.reject(new n(e))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Q(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise((e=>{this._stopPromiseResolver=e})),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(p.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(p.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==K.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(K.WebSockets),await this._startTransport(t,e)}else{let i=null,s=0;do{if(i=await this._getNegotiationResponse(t),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new n("The connection was stopped during negotiation.");if(i.error)throw new Error(i.error);if(i.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(i.url&&(t=i.url),i.accessToken){const e=i.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}s++}while(i.url&&s<100);if(100===s&&i.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,i,e)}this.transport instanceof B&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(p.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(p.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={},[i,r]=I();t[i]=r;const n=this._resolveNegotiateUrl(e);this._logger.log(p.Debug,`Sending negotiation request: ${n}.`);try{const e=await this._httpClient.post(n,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==e.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));const i=JSON.parse(e.content);return(!i.negotiateVersion||i.negotiateVersion<1)&&(i.connectionToken=i.connectionId),i}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof s&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(p.Error,t),Promise.reject(new d(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,i,s){let r=this._createConnectUrl(e,i.connectionToken);if(this._isITransport(t))return this._logger.log(p.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(r,s),void(this.connectionId=i.connectionId);const o=[],a=i.availableTransports||[];let d=i;for(const i of a){const a=this._resolveTransportOrError(i,t,s);if(a instanceof Error)o.push(`${i.transport} failed:`),o.push(a);else if(this._isITransport(a)){if(this.transport=a,!d){try{d=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}r=this._createConnectUrl(e,d.connectionToken)}try{return await this._startTransport(r,s),void(this.connectionId=d.connectionId)}catch(e){if(this._logger.log(p.Error,`Failed to start the transport '${i.transport}': ${e}`),d=void 0,o.push(new c(`${i.transport} failed: ${e}`,K[i.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(p.Debug,e),Promise.reject(new n(e))}}}}return o.length>0?Promise.reject(new u(`Unable to connect to the server with any of the available transports. ${o.join(" ")}`,o)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case K.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new V(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case K.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new W(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case K.LongPolling:return new B(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,i){const s=K[e.transport];if(null==s)return this._logger.log(p.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(e,t){return!e||0!=(t&e)}(t,s))return this._logger.log(p.Debug,`Skipping transport '${K[s]}' because it was disabled by the client.`),new a(`'${K[s]}' is disabled by the client.`,s);if(!(e.transferFormats.map((e=>G[e])).indexOf(i)>=0))return this._logger.log(p.Debug,`Skipping transport '${K[s]}' because it does not support the requested transfer format '${G[i]}'.`),new Error(`'${K[s]}' does not support ${G[i]}.`);if(s===K.WebSockets&&!this._options.WebSocket||s===K.ServerSentEvents&&!this._options.EventSource)return this._logger.log(p.Debug,`Skipping transport '${K[s]}' because it is not supported in your environment.'`),new o(`'${K[s]}' is not supported in your environment.`,s);this._logger.log(p.Debug,`Selecting transport '${K[s]}'.`);try{return this._constructTransport(s)}catch(e){return e}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(p.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(p.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),e?this._logger.log(p.Error,`Connection disconnected with error '${e}'.`):this._logger.log(p.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(p.Error,`TransportSendQueue.stop() threw error '${e}'.`)})),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(p.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(p.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!y.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(p.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=e.indexOf("?");let i=e.substring(0,-1===t?e.length:t);return"/"!==i[i.length-1]&&(i+="/"),i+="negotiate",i+=-1===t?"":e.substring(t),-1===i.indexOf("negotiateVersion")&&(i+=-1===t?"?":"&",i+="negotiateVersion="+this._negotiateVersion),i}}class Q{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Y,this._transportResult=new Y,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Y),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Y;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):Q._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(t),e.resolve()}catch(t){e.reject(t)}}}static _concatBuffers(e){const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),i=new Uint8Array(t);let s=0;for(const t of e)i.set(new Uint8Array(t),s),s+=t.byteLength;return i.buffer}}class Y{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class z{constructor(){this.name="json",this.version=1,this.transferFormat=G.Text}parseMessages(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=_.instance);const i=x.parse(e),s=[];for(const e of i){const i=JSON.parse(e);if("number"!=typeof i.type)throw new Error("Invalid payload.");switch(i.type){case j.Invocation:this._isInvocationMessage(i);break;case j.StreamItem:this._isStreamItemMessage(i);break;case j.Completion:this._isCompletionMessage(i);break;case j.Ping:case j.Close:break;default:t.log(p.Information,"Unknown message type '"+i.type+"' ignored.");continue}s.push(i)}return s}writeMessage(e){return x.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if("string"!=typeof e||""===e)throw new Error(t)}}const X={trace:p.Trace,debug:p.Debug,info:p.Information,information:p.Information,warn:p.Warning,warning:p.Warning,error:p.Error,critical:p.Critical,none:p.None};class Z{configureLogging(e){if(m.isRequired(e,"logging"),void 0!==e.log)this.logger=e;else if("string"==typeof e){const t=function(e){const t=X[e.toLowerCase()];if(void 0!==t)return t;throw new Error(`Unknown log level: ${e}`)}(e);this.logger=new T(t)}else this.logger=new T(e);return this}withUrl(e,t){return m.isRequired(e,"url"),m.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return m.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new q(e):this.reconnectPolicy=e:this.reconnectPolicy=new q,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const t=new J(this.url,e);return $.create(t,this.logger||_.instance,this.protocol||new z,this.reconnectPolicy)}}},4098:function(e,t){var i="undefined"!=typeof self?self:this,s=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();!function(e){!function(t){var i={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise((function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}}))}function l(e){var t=new FileReader,i=u(t);return t.readAsArrayBuffer(e),i}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||r(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var e,t,i,s=d(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,i=u(t=new FileReader),t.readAsText(e),i;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),i=new Array(t.length),s=0;s<t.length;s++)i[s]=String.fromCharCode(t[s]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=n(e),t=o(t);var i=this.map[e];this.map[e]=i?i+", "+t:t},c.prototype.delete=function(e){delete this.map[n(e)]},c.prototype.get=function(e){return e=n(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},c.prototype.set=function(e,t){this.map[n(e)]=o(t)},c.prototype.forEach=function(e,t){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(t,this.map[i],i,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,i){e.push(i)})),a(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),a(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,i){e.push([i,t])})),a(e)},i.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(e,t){var i,s,r=(t=t||{}).body;if(e instanceof f){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(s=(i=t.method||this.method||"GET").toUpperCase(),_.indexOf(s)>-1?s:i),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function m(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var i=e.split("="),s=i.shift().replace(/\+/g," "),r=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(r))}})),t}function y(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},p.call(f.prototype),p.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];y.redirect=function(e,t){if(-1===g.indexOf(t))throw new RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var i=Error(e);this.stack=i.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function v(e,s){return new Promise((function(r,n){var o=new f(e,s);if(o.signal&&o.signal.aborted)return n(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function d(){a.abort()}a.onload=function(){var e,t,i={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var i=e.split(":"),s=i.shift().trim();if(s){var r=i.join(":").trim();t.append(s,r)}})),t)};i.url="responseURL"in a?a.responseURL:i.headers.get("X-Request-URL");var s="response"in a?a.response:a.responseText;r(new y(s,i))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&i.blob&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",d),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",d)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}v.polyfill=!0,e.fetch||(e.fetch=v,e.Headers=c,e.Request=f,e.Response=y),t.Headers=c,t.Request=f,t.Response=y,t.fetch=v,Object.defineProperty(t,"__esModule",{value:!0})}({})}(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var r=s;(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},2445:e=>{"use strict";e.exports=function(e){var t=e.uri,i=e.name,s=e.type;this.uri=t,this.name=i,this.type=s}},804:(e,t,i)=>{"use strict";var s=i(1268);e.exports=function e(t,i,r){var n;void 0===i&&(i=""),void 0===r&&(r=s);var o=new Map;function a(e,t){var i=o.get(t);i?i.push.apply(i,e):o.set(t,e)}if(r(t))n=null,a([i],t);else{var c=i?i+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)n=Array.prototype.map.call(t,(function(e,t){return a([""+c+t],e),null}));else if(Array.isArray(t))n=t.map((function(t,i){var s=e(t,""+c+i,r);return s.files.forEach(a),s.clone}));else if(t&&t.constructor===Object)for(var d in n={},t){var u=e(t[d],""+c+d,r);u.files.forEach(a),n[d]=u.clone}else n=t}return{clone:n,files:o}}},4823:(e,t,i)=>{"use strict";t.ReactNativeFile=i(2445),t.extractFiles=i(804),t.isExtractableFile=i(1268)},1268:(e,t,i)=>{"use strict";var s=i(2445);e.exports=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof s}},6230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},8458:function(e,t,i){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=i(4823),n=s(i(3458)),o=i(456),a=function(e){return r.isExtractableFile(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.default=function(e,t,i,s){void 0===s&&(s=o.defaultJsonSerializer);var c=r.extractFiles({query:e,variables:t,operationName:i},"",a),d=c.clone,u=c.files;if(0===u.size){if(!Array.isArray(e))return s.stringify(d);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var l=e.reduce((function(e,i,s){return e.push({query:i,variables:t?t[s]:void 0}),e}),[]);return s.stringify(l)}var h=new("undefined"==typeof FormData?n.default:FormData);h.append("operations",s.stringify(d));var p={},_=0;return u.forEach((function(e){p[++_]=e})),h.append("map",s.stringify(p)),_=0,u.forEach((function(e,t){h.append(""+ ++_,t)})),h}},456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultJsonSerializer=void 0,t.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}},8741:function(e,t,i){"use strict";var s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=void 0;var o=i(8308),a=i(8687),c="ping",d="pong",u="complete",l=function(){function e(e,t,i){this._type=e,this._payload=t,this._id=i}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){var e={type:this.type};return null!=this.id&&null!=this.id&&(e.id=this.id),null!=this.payload&&null!=this.payload&&(e.payload=this.payload),JSON.stringify(e)},enumerable:!1,configurable:!0}),e.parse=function(t,i){var s=JSON.parse(t),r=s.type,n=s.payload,o=s.id;return new e(r,i(n),o)},e}(),h=function(){function e(e,t){var i=this,a=t.onInit,h=t.onAcknowledged,f=t.onPing,m=t.onPong;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.onopen=function(t){return r(i,void 0,void 0,(function(){var t,i,s,r;return n(this,(function(n){switch(n.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},i=(t=e).send,s=p,a?[4,a()]:[3,2];case 1:return r=n.sent(),[3,3];case 2:r=null,n.label=3;case 3:return i.apply(t,[s.apply(void 0,[r]).text]),[2]}}))}))},e.onclose=function(e){i.socketState.acknowledged=!1,i.socketState.subscriptions={}},e.onerror=function(e){console.error(e)},e.onmessage=function(t){try{var r=(g=t.data,void 0===v&&(v=function(e){return e}),l.parse(g,v));switch(r.type){case"connection_ack":return void(i.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(i.socketState.acknowledged=!0,h&&h(r.payload)));case c:return void(f?f(r.payload).then((function(t){return e.send(_(t).text)})):e.send(_(null).text));case d:return void(m&&m(r.payload))}if(!i.socketState.acknowledged)return;if(void 0===r.id||null===r.id||!i.socketState.subscriptions[r.id])return;var n=i.socketState.subscriptions[r.id],a=n.query,p=n.variables,y=n.subscriber;switch(r.type){case"next":return!r.payload.errors&&r.payload.data&&y.next&&y.next(r.payload.data),void(r.payload.errors&&y.error&&y.error(new o.ClientError(s(s({},r.payload),{status:200}),{query:a,variables:p})));case"error":return void(y.error&&y.error(new o.ClientError({errors:r.payload,status:200},{query:a,variables:p})));case u:return y.complete&&y.complete(),void delete i.socketState.subscriptions[r.id]}}catch(t){console.error(t),e.close(1006)}var g,v;e.close(4400,"Unknown graphql-ws message.")}}return e.prototype.makeSubscribe=function(e,t,i,s){var r,n,o=this,a=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[a]={query:e,variables:i,subscriber:s},this.socket.send((r=a,n={query:e,operationName:t,variables:i},new l("subscribe",n,r)).text),function(){o.socket.send(function(e){return new l(u,void 0,e)}(a).text),delete o.socketState.subscriptions[a]}},e.prototype.rawRequest=function(e,t){var i=this;return new Promise((function(s,r){var n;i.rawSubscribe(e,{next:function(e,t){return n={data:e,extensions:t}},error:r,complete:function(){return s(n)}},t)}))},e.prototype.request=function(e,t){var i=this;return new Promise((function(s,r){var n;i.subscribe(e,{next:function(e){return n=e},error:r,complete:function(){return s(n)}},t)}))},e.prototype.subscribe=function(e,t,i){var s=a.resolveRequestDocument(e),r=s.query,n=s.operationName;return this.makeSubscribe(r,n,i,t)},e.prototype.rawSubscribe=function(e,t,i){return this.makeSubscribe(e,void 0,i,t)},e.prototype.ping=function(e){this.socket.send(function(e){return new l(c,e,void 0)}(e).text)},e.prototype.close=function(){this.socket.close(1e3)},e.PROTOCOL="graphql-transport-ws",e}();function p(e){return new l("connection_init",e)}function _(e){return new l(d,e,void 0)}t.GraphQLWebSocketClient=h},8687:function(e,t,i){"use strict";var s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)},r=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},a=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}},d=this&&this.__rest||function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=t.gql=t.resolveRequestDocument=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var l=o(i(4098)),h=l,p=i(8370),_=i(3033),f=u(i(8458)),m=i(456),y=i(2980),g=i(8308);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return g.ClientError}});var v=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof h.Headers?t=function(e){var t={};return e.forEach((function(e,i){t[i]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){var i=e[0],s=e[1];t[i]=s})):t=e),t},b=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},E=function(e){var t=e.url,i=e.query,r=e.variables,n=e.operationName,o=e.headers,d=e.fetch,u=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=f.default(i,r,n,u.jsonSerializer),[4,d(t,s({method:"POST",headers:s(s({},"string"==typeof e?{"Content-Type":"application/json"}:{}),o),body:e},u))];case 1:return[2,a.sent()]}}))}))},T=function(e){var t=e.url,i=e.query,r=e.variables,n=e.operationName,o=e.headers,d=e.fetch,u=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=function(e){var t=e.query,i=e.variables,s=e.operationName,r=e.jsonSerializer;if(!Array.isArray(t)){var n=["query="+encodeURIComponent(b(t))];return i&&n.push("variables="+encodeURIComponent(r.stringify(i))),s&&n.push("operationName="+encodeURIComponent(s)),n.join("&")}if(void 0!==i&&!Array.isArray(i))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,s){return e.push({query:b(t),variables:i?r.stringify(i[s]):void 0}),e}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:i,variables:r,operationName:n,jsonSerializer:u.jsonSerializer}),[4,d(t+"?"+e,s({method:"GET",headers:o},u))];case 1:return[2,a.sent()]}}))}))},I=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,i){return a(this,void 0,void 0,(function(){var r,n,o,a,u,h,p,_,f,m;return c(this,(function(c){return r=y.parseRawRequestArgs(e,t,i),n=this.options,o=n.headers,a=n.fetch,u=void 0===a?l.default:a,h=n.method,p=void 0===h?"POST":h,_=d(n,["headers","fetch","method"]),f=this.url,void 0!==r.signal&&(_.signal=r.signal),m=A(r.query).operationName,[2,w({url:f,query:r.query,variables:r.variables,headers:s(s({},v(D(o))),v(r.requestHeaders)),operationName:m,fetch:u,method:p,fetchOptions:_})]}))}))},e.prototype.request=function(e,t,i){return a(this,void 0,void 0,(function(){var r,n,o,a,u,h,p,_,f,m,g,b;return c(this,(function(c){switch(c.label){case 0:return r=y.parseRequestArgs(e,t,i),n=this.options,o=n.headers,a=n.fetch,u=void 0===a?l.default:a,h=n.method,p=void 0===h?"POST":h,_=d(n,["headers","fetch","method"]),f=this.url,void 0!==r.signal&&(_.signal=r.signal),m=A(r.document),g=m.query,b=m.operationName,[4,w({url:f,query:g,variables:r.variables,headers:s(s({},v(D(o))),v(r.requestHeaders)),operationName:b,fetch:u,method:p,fetchOptions:_})];case 1:return[2,c.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return a(this,void 0,void 0,(function(){var i,r,n,o,a,u,h,p,_,f,m;return c(this,(function(c){switch(c.label){case 0:return i=y.parseBatchRequestArgs(e,t),r=this.options,n=r.headers,o=r.fetch,a=void 0===o?l.default:o,u=r.method,h=void 0===u?"POST":u,p=d(r,["headers","fetch","method"]),_=this.url,void 0!==i.signal&&(p.signal=i.signal),f=i.documents.map((function(e){return A(e.document).query})),m=i.documents.map((function(e){return e.variables})),[4,w({url:_,query:f,variables:m,headers:s(s({},v(D(n))),v(i.requestHeaders)),operationName:void 0,fetch:a,method:h,fetchOptions:p})];case 1:return[2,c.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var i,s=this.options.headers;return s?s[e]=t:this.options.headers=((i={})[e]=t,i),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function w(e){var t=e.url,i=e.query,r=e.variables,n=e.headers,o=e.operationName,u=e.fetch,l=e.method,h=void 0===l?"POST":l,p=e.fetchOptions;return a(this,void 0,void 0,(function(){var e,a,l,_,f,m,y,v,b,I,w;return c(this,(function(c){switch(c.label){case 0:return e="POST"===h.toUpperCase()?E:T,a=Array.isArray(i),[4,e({url:t,query:i,variables:r,operationName:o,headers:n,fetch:u,fetchOptions:p})];case 1:return[4,S(l=c.sent(),p.jsonSerializer)];case 2:if(_=c.sent(),f=a&&Array.isArray(_)?!_.some((function(e){return!e.data})):!!_.data,m=!_.errors||"all"===p.errorPolicy||"ignore"===p.errorPolicy,l.ok&&m&&f)return y=l.headers,v=l.status,_.errors,b=d(_,["errors"]),I="ignore"===p.errorPolicy?b:_,[2,s(s({},a?{data:I}:I),{headers:y,status:v})];throw w="string"==typeof _?{error:_}:_,new g.ClientError(s(s({},w),{status:l.status,headers:l.headers}),{query:i,variables:r})}}))}))}function k(e,t,i,r){return a(this,void 0,void 0,(function(){var n;return c(this,(function(o){return n=y.parseRequestExtendedArgs(e,t,i,r),[2,new I(n.url).request(s({},n))]}))}))}function S(e,t){return void 0===t&&(t=m.defaultJsonSerializer),a(this,void 0,void 0,(function(){var i,s,r;return c(this,(function(n){switch(n.label){case 0:return e.headers.forEach((function(e,t){"content-type"===t.toLowerCase()&&(i=e)})),i&&i.toLowerCase().startsWith("application/json")?(r=(s=t).parse,[4,e.text()]):[3,2];case 1:return[2,r.apply(s,[n.sent()])];case 2:return[2,e.text()]}}))}))}function O(e){var t,i=void 0,s=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===s.length&&(i=null===(t=s[0].name)||void 0===t?void 0:t.value),i}function A(e){if("string"==typeof e){var t=void 0;try{t=O(p.parse(e))}catch(e){}return{query:e,operationName:t}}var i=O(e);return{query:_.print(e),operationName:i}}function D(e){return"function"==typeof e?e():e}t.GraphQLClient=I,t.rawRequest=function(e,t,i,r){return a(this,void 0,void 0,(function(){var n;return c(this,(function(o){return n=y.parseRawRequestExtendedArgs(e,t,i,r),[2,new I(n.url).rawRequest(s({},n))]}))}))},t.request=k,t.batchRequests=function(e,t,i){return a(this,void 0,void 0,(function(){var r;return c(this,(function(n){return r=y.parseBatchRequestsExtendedArgs(e,t,i),[2,new I(r.url).batchRequests(s({},r))]}))}))},t.default=k,t.resolveRequestDocument=A,t.gql=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return e.reduce((function(e,i,s){return""+e+i+(s in t?t[s]:"")}),"")};var P=i(8741);Object.defineProperty(t,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return P.GraphQLWebSocketClient}})},2980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchRequestsExtendedArgs=t.parseRawRequestExtendedArgs=t.parseRequestExtendedArgs=t.parseBatchRequestArgs=t.parseRawRequestArgs=t.parseRequestArgs=void 0,t.parseRequestArgs=function(e,t,i){return e.document?e:{document:e,variables:t,requestHeaders:i,signal:void 0}},t.parseRawRequestArgs=function(e,t,i){return e.query?e:{query:e,variables:t,requestHeaders:i,signal:void 0}},t.parseBatchRequestArgs=function(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}},t.parseRequestExtendedArgs=function(e,t,i,s){return e.document?e:{url:e,document:t,variables:i,requestHeaders:s,signal:void 0}},t.parseRawRequestExtendedArgs=function(e,t,i,s){return e.query?e:{url:e,query:t,variables:i,requestHeaders:s,signal:void 0}},t.parseBatchRequestsExtendedArgs=function(e,t,i){return e.documents?e:{url:e,documents:t,requestHeaders:i,signal:void 0}}},8308:function(e,t){"use strict";var i,s=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function s(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var r=function(e){function t(i,s){var r=this,n=t.extractMessage(i)+": "+JSON.stringify({response:i,request:s});return r=e.call(this,n)||this,Object.setPrototypeOf(r,t.prototype),r.response=i,r.request=s,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return s(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=r},3458:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},5822:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};var s=i(5690),r=i(9016),n=i(8038);class o extends Error{constructor(e,...t){var i,n,c;const{nodes:d,source:u,positions:l,path:h,originalError:p,extensions:_}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=h?h:void 0,this.originalError=null!=p?p:void 0,this.nodes=a(Array.isArray(d)?d:d?[d]:void 0);const f=a(null===(i=this.nodes)||void 0===i?void 0:i.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=u?u:null==f||null===(n=f[0])||void 0===n?void 0:n.source,this.positions=null!=l?l:null==f?void 0:f.map((e=>e.start)),this.locations=l&&u?l.map((e=>(0,r.getLocation)(u,e))):null==f?void 0:f.map((e=>(0,r.getLocation)(e.source,e.start)));const m=(0,s.isObjectLike)(null==p?void 0:p.extensions)?null==p?void 0:p.extensions:void 0;this.extensions=null!==(c=null!=_?_:m)&&void 0!==c?c:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=p&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,n.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,n.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=o},338:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,i){return new s.GraphQLError(`Syntax Error: ${i}`,{source:e,positions:[t]})};var s=i(5822)},7242:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}},8002:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return r(e,[])};const i=10,s=2;function r(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:r(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>s)return"[Array]";const n=Math.min(i,e.length),o=e.length-n,a=[];for(let i=0;i<n;++i)a.push(r(e[i],t));return 1===o?a.push("... 1 more item"):o>1&&a.push(`... ${o} more items`),"["+a.join(", ")+"]"}(e,n);return function(e,t){const i=Object.entries(e);if(0===i.length)return"{}";if(t.length>s)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=i.map((([e,i])=>e+": "+r(i,t)));return"{ "+n.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}},5752:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0,i(8002);t.instanceOf=function(e,t){return e instanceof t}},7706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},5690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}},1807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Token=t.QueryDocumentKeys=t.OperationTypeNode=t.Location=void 0,t.isNode=function(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&n.has(t)};class i{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}t.Location=i;class s{constructor(e,t,i,s,r,n){this.kind=e,this.start=t,this.end=i,this.line=s,this.column=r,this.value=n,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}t.Token=s;const r={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=r;const n=new Set(Object.keys(r));var o;t.OperationTypeNode=o,function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(o||(t.OperationTypeNode=o={}))},849:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringLines=function(e){var t;let i=Number.MAX_SAFE_INTEGER,s=null,n=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],c=r(a);c!==a.length&&(s=null!==(o=s)&&void 0!==o?o:t,n=t,0!==t&&c<i&&(i=c))}return e.map(((e,t)=>0===t?e:e.slice(i))).slice(null!==(t=s)&&void 0!==t?t:0,n+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,i=!1,s=!0,r=!1;for(let n=0;n<e.length;++n)switch(e.codePointAt(n)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,i=!1;break;case 9:case 32:i||(i=t);break;default:s&&(s=i),t=!1}return!t&&(!s||!r)},t.printBlockString=function(e,t){const i=e.replace(/"""/g,'\\"""'),r=i.split(/\r\n|[\n\r]/g),n=1===r.length,o=r.length>1&&r.slice(1).every((e=>0===e.length||(0,s.isWhiteSpace)(e.charCodeAt(0)))),a=i.endsWith('\\"""'),c=e.endsWith('"')&&!a,d=e.endsWith("\\"),u=c||d,l=!(null!=t&&t.minimize)&&(!n||e.length>70||u||o||a);let h="";const p=n&&(0,s.isWhiteSpace)(e.charCodeAt(0));return(l&&!p||o)&&(h+="\n"),h+=i,(l||u)&&(h+="\n"),'"""'+h+'"""'};var s=i(100);function r(e){let t=0;for(;t<e.length&&(0,s.isWhiteSpace)(e.charCodeAt(t));)++t;return t}},100:(e,t)=>{"use strict";function i(e){return e>=48&&e<=57}function s(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=i,t.isLetter=s,t.isNameContinue=function(e){return s(e)||i(e)||95===e},t.isNameStart=function(e){return s(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}},8333:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=i,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(i||(t.DirectiveLocation=i={}))},2828:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=i,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(i||(t.Kind=i={}))},4274:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===a.TokenKind.BANG||e===a.TokenKind.DOLLAR||e===a.TokenKind.AMP||e===a.TokenKind.PAREN_L||e===a.TokenKind.PAREN_R||e===a.TokenKind.SPREAD||e===a.TokenKind.COLON||e===a.TokenKind.EQUALS||e===a.TokenKind.AT||e===a.TokenKind.BRACKET_L||e===a.TokenKind.BRACKET_R||e===a.TokenKind.BRACE_L||e===a.TokenKind.PIPE||e===a.TokenKind.BRACE_R};var s=i(338),r=i(1807),n=i(849),o=i(100),a=i(3175);class c{constructor(e){const t=new r.Token(a.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==a.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=f(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===a.TokenKind.COMMENT);return e}}function d(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function u(e,t){return l(e.charCodeAt(t))&&h(e.charCodeAt(t+1))}function l(e){return e>=55296&&e<=56319}function h(e){return e>=56320&&e<=57343}function p(e,t){const i=e.source.body.codePointAt(t);if(void 0===i)return a.TokenKind.EOF;if(i>=32&&i<=126){const e=String.fromCodePoint(i);return'"'===e?"'\"'":`"${e}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function _(e,t,i,s,n){const o=e.line,a=1+i-e.lineStart;return new r.Token(t,i,s,o,a,n)}function f(e,t){const i=e.source.body,r=i.length;let n=t;for(;n<r;){const t=i.charCodeAt(n);switch(t){case 65279:case 9:case 32:case 44:++n;continue;case 10:++n,++e.line,e.lineStart=n;continue;case 13:10===i.charCodeAt(n+1)?n+=2:++n,++e.line,e.lineStart=n;continue;case 35:return m(e,n);case 33:return _(e,a.TokenKind.BANG,n,n+1);case 36:return _(e,a.TokenKind.DOLLAR,n,n+1);case 38:return _(e,a.TokenKind.AMP,n,n+1);case 40:return _(e,a.TokenKind.PAREN_L,n,n+1);case 41:return _(e,a.TokenKind.PAREN_R,n,n+1);case 46:if(46===i.charCodeAt(n+1)&&46===i.charCodeAt(n+2))return _(e,a.TokenKind.SPREAD,n,n+3);break;case 58:return _(e,a.TokenKind.COLON,n,n+1);case 61:return _(e,a.TokenKind.EQUALS,n,n+1);case 64:return _(e,a.TokenKind.AT,n,n+1);case 91:return _(e,a.TokenKind.BRACKET_L,n,n+1);case 93:return _(e,a.TokenKind.BRACKET_R,n,n+1);case 123:return _(e,a.TokenKind.BRACE_L,n,n+1);case 124:return _(e,a.TokenKind.PIPE,n,n+1);case 125:return _(e,a.TokenKind.BRACE_R,n,n+1);case 34:return 34===i.charCodeAt(n+1)&&34===i.charCodeAt(n+2)?k(e,n):v(e,n)}if((0,o.isDigit)(t)||45===t)return y(e,n,t);if((0,o.isNameStart)(t))return S(e,n);throw(0,s.syntaxError)(e.source,n,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":d(t)||u(i,n)?`Unexpected character: ${p(e,n)}.`:`Invalid character: ${p(e,n)}.`)}return _(e,a.TokenKind.EOF,r,r)}function m(e,t){const i=e.source.body,s=i.length;let r=t+1;for(;r<s;){const e=i.charCodeAt(r);if(10===e||13===e)break;if(d(e))++r;else{if(!u(i,r))break;r+=2}}return _(e,a.TokenKind.COMMENT,t,r,i.slice(t+1,r))}function y(e,t,i){const r=e.source.body;let n=t,c=i,d=!1;if(45===c&&(c=r.charCodeAt(++n)),48===c){if(c=r.charCodeAt(++n),(0,o.isDigit)(c))throw(0,s.syntaxError)(e.source,n,`Invalid number, unexpected digit after 0: ${p(e,n)}.`)}else n=g(e,n,c),c=r.charCodeAt(n);if(46===c&&(d=!0,c=r.charCodeAt(++n),n=g(e,n,c),c=r.charCodeAt(n)),69!==c&&101!==c||(d=!0,c=r.charCodeAt(++n),43!==c&&45!==c||(c=r.charCodeAt(++n)),n=g(e,n,c),c=r.charCodeAt(n)),46===c||(0,o.isNameStart)(c))throw(0,s.syntaxError)(e.source,n,`Invalid number, expected digit but got: ${p(e,n)}.`);return _(e,d?a.TokenKind.FLOAT:a.TokenKind.INT,t,n,r.slice(t,n))}function g(e,t,i){if(!(0,o.isDigit)(i))throw(0,s.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${p(e,t)}.`);const r=e.source.body;let n=t+1;for(;(0,o.isDigit)(r.charCodeAt(n));)++n;return n}function v(e,t){const i=e.source.body,r=i.length;let n=t+1,o=n,c="";for(;n<r;){const r=i.charCodeAt(n);if(34===r)return c+=i.slice(o,n),_(e,a.TokenKind.STRING,t,n+1,c);if(92!==r){if(10===r||13===r)break;if(d(r))++n;else{if(!u(i,n))throw(0,s.syntaxError)(e.source,n,`Invalid character within String: ${p(e,n)}.`);n+=2}}else{c+=i.slice(o,n);const t=117===i.charCodeAt(n+1)?123===i.charCodeAt(n+2)?b(e,n):E(e,n):w(e,n);c+=t.value,n+=t.size,o=n}}throw(0,s.syntaxError)(e.source,n,"Unterminated string.")}function b(e,t){const i=e.source.body;let r=0,n=3;for(;n<12;){const e=i.charCodeAt(t+n++);if(125===e){if(n<5||!d(r))break;return{value:String.fromCodePoint(r),size:n}}if(r=r<<4|I(e),r<0)break}throw(0,s.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+n)}".`)}function E(e,t){const i=e.source.body,r=T(i,t+2);if(d(r))return{value:String.fromCodePoint(r),size:6};if(l(r)&&92===i.charCodeAt(t+6)&&117===i.charCodeAt(t+7)){const e=T(i,t+8);if(h(e))return{value:String.fromCodePoint(r,e),size:12}}throw(0,s.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+6)}".`)}function T(e,t){return I(e.charCodeAt(t))<<12|I(e.charCodeAt(t+1))<<8|I(e.charCodeAt(t+2))<<4|I(e.charCodeAt(t+3))}function I(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function w(e,t){const i=e.source.body;switch(i.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,s.syntaxError)(e.source,t,`Invalid character escape sequence: "${i.slice(t,t+2)}".`)}function k(e,t){const i=e.source.body,r=i.length;let o=e.lineStart,c=t+3,l=c,h="";const f=[];for(;c<r;){const r=i.charCodeAt(c);if(34===r&&34===i.charCodeAt(c+1)&&34===i.charCodeAt(c+2)){h+=i.slice(l,c),f.push(h);const s=_(e,a.TokenKind.BLOCK_STRING,t,c+3,(0,n.dedentBlockStringLines)(f).join("\n"));return e.line+=f.length-1,e.lineStart=o,s}if(92!==r||34!==i.charCodeAt(c+1)||34!==i.charCodeAt(c+2)||34!==i.charCodeAt(c+3))if(10!==r&&13!==r)if(d(r))++c;else{if(!u(i,c))throw(0,s.syntaxError)(e.source,c,`Invalid character within String: ${p(e,c)}.`);c+=2}else h+=i.slice(l,c),f.push(h),13===r&&10===i.charCodeAt(c+1)?c+=2:++c,h="",l=c,o=c;else h+=i.slice(l,c),l=c+1,c+=4}throw(0,s.syntaxError)(e.source,c,"Unterminated string.")}function S(e,t){const i=e.source.body,s=i.length;let r=t+1;for(;r<s;){const e=i.charCodeAt(r);if(!(0,o.isNameContinue)(e))break;++r}return _(e,a.TokenKind.NAME,t,r,i.slice(t,r))}t.Lexer=c},9016:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){let i=0,n=1;for(const o of e.body.matchAll(r)){if("number"==typeof o.index||(0,s.invariant)(!1),o.index>=t)break;i=o.index+o[0].length,n+=1}return{line:n,column:t+1-i}};var s=i(7706);const r=/\r\n|[\n\r]/g},8370:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new u(e,t).parseDocument()},t.parseConstValue=function(e,t){const i=new u(e,t);i.expectToken(d.TokenKind.SOF);const s=i.parseConstValueLiteral();return i.expectToken(d.TokenKind.EOF),s},t.parseType=function(e,t){const i=new u(e,t);i.expectToken(d.TokenKind.SOF);const s=i.parseTypeReference();return i.expectToken(d.TokenKind.EOF),s},t.parseValue=function(e,t){const i=new u(e,t);i.expectToken(d.TokenKind.SOF);const s=i.parseValueLiteral(!1);return i.expectToken(d.TokenKind.EOF),s};var s=i(338),r=i(1807),n=i(8333),o=i(2828),a=i(4274),c=i(2412),d=i(3175);class u{constructor(e,t={}){const i=(0,c.isSource)(e)?e:new c.Source(e);this._lexer=new a.Lexer(i),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(d.TokenKind.NAME);return this.node(e,{kind:o.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:o.Kind.DOCUMENT,definitions:this.many(d.TokenKind.SOF,this.parseDefinition,d.TokenKind.EOF)})}parseDefinition(){if(this.peek(d.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===d.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,s.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(d.TokenKind.BRACE_L))return this.node(e,{kind:o.Kind.OPERATION_DEFINITION,operation:r.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let i;return this.peek(d.TokenKind.NAME)&&(i=this.parseName()),this.node(e,{kind:o.Kind.OPERATION_DEFINITION,operation:t,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(d.TokenKind.NAME);switch(e.value){case"query":return r.OperationTypeNode.QUERY;case"mutation":return r.OperationTypeNode.MUTATION;case"subscription":return r.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(d.TokenKind.PAREN_L,this.parseVariableDefinition,d.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:o.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(d.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(d.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(d.TokenKind.DOLLAR),this.node(e,{kind:o.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:o.Kind.SELECTION_SET,selections:this.many(d.TokenKind.BRACE_L,this.parseSelection,d.TokenKind.BRACE_R)})}parseSelection(){return this.peek(d.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let i,s;return this.expectOptionalToken(d.TokenKind.COLON)?(i=t,s=this.parseName()):s=t,this.node(e,{kind:o.Kind.FIELD,alias:i,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(d.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(d.TokenKind.PAREN_L,t,d.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,i=this.parseName();return this.expectToken(d.TokenKind.COLON),this.node(t,{kind:o.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(d.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(d.TokenKind.NAME)?this.node(e,{kind:o.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:o.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:o.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:o.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case d.TokenKind.BRACKET_L:return this.parseList(e);case d.TokenKind.BRACE_L:return this.parseObject(e);case d.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:o.Kind.INT,value:t.value});case d.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:o.Kind.FLOAT,value:t.value});case d.TokenKind.STRING:case d.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case d.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:o.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:o.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:o.Kind.NULL});default:return this.node(t,{kind:o.Kind.ENUM,value:t.value})}case d.TokenKind.DOLLAR:if(e){if(this.expectToken(d.TokenKind.DOLLAR),this._lexer.token.kind===d.TokenKind.NAME){const e=this._lexer.token.value;throw(0,s.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:o.Kind.STRING,value:e.value,block:e.kind===d.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:o.Kind.LIST,values:this.any(d.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),d.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:o.Kind.OBJECT,fields:this.any(d.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),d.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,i=this.parseName();return this.expectToken(d.TokenKind.COLON),this.node(t,{kind:o.Kind.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(d.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(d.TokenKind.AT),this.node(t,{kind:o.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(d.TokenKind.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(d.TokenKind.BRACKET_R),t=this.node(e,{kind:o.Kind.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(d.TokenKind.BANG)?this.node(e,{kind:o.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:o.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(d.TokenKind.STRING)||this.peek(d.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),s=this.many(d.TokenKind.BRACE_L,this.parseOperationTypeDefinition,d.TokenKind.BRACE_R);return this.node(e,{kind:o.Kind.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:s})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(d.TokenKind.COLON);const i=this.parseNamedType();return this.node(e,{kind:o.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),s=this.parseConstDirectives();return this.node(e,{kind:o.Kind.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:s})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),n=this.parseFieldsDefinition();return this.node(e,{kind:o.Kind.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:s,directives:r,fields:n})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(d.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(d.TokenKind.BRACE_L,this.parseFieldDefinition,d.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),s=this.parseArgumentDefs();this.expectToken(d.TokenKind.COLON);const r=this.parseTypeReference(),n=this.parseConstDirectives();return this.node(e,{kind:o.Kind.FIELD_DEFINITION,description:t,name:i,arguments:s,type:r,directives:n})}parseArgumentDefs(){return this.optionalMany(d.TokenKind.PAREN_L,this.parseInputValueDef,d.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName();this.expectToken(d.TokenKind.COLON);const s=this.parseTypeReference();let r;this.expectOptionalToken(d.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const n=this.parseConstDirectives();return this.node(e,{kind:o.Kind.INPUT_VALUE_DEFINITION,description:t,name:i,type:s,defaultValue:r,directives:n})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),n=this.parseFieldsDefinition();return this.node(e,{kind:o.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:s,directives:r,fields:n})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:o.Kind.UNION_TYPE_DEFINITION,description:t,name:i,directives:s,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(d.TokenKind.EQUALS)?this.delimitedMany(d.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:o.Kind.ENUM_TYPE_DEFINITION,description:t,name:i,directives:s,values:r})}parseEnumValuesDefinition(){return this.optionalMany(d.TokenKind.BRACE_L,this.parseEnumValueDefinition,d.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),s=this.parseConstDirectives();return this.node(e,{kind:o.Kind.ENUM_VALUE_DEFINITION,description:t,name:i,directives:s})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,s.syntaxError)(this._lexer.source,this._lexer.token.start,`${l(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:o.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:s,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(d.TokenKind.BRACE_L,this.parseInputValueDef,d.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===d.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),i=this.optionalMany(d.TokenKind.BRACE_L,this.parseOperationTypeDefinition,d.TokenKind.BRACE_R);if(0===t.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:o.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:o.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===s.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:o.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:s,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===s.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:o.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:s,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();if(0===i.length&&0===s.length)throw this.unexpected();return this.node(e,{kind:o.Kind.UNION_TYPE_EXTENSION,name:t,directives:i,types:s})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();if(0===i.length&&0===s.length)throw this.unexpected();return this.node(e,{kind:o.Kind.ENUM_TYPE_EXTENSION,name:t,directives:i,values:s})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();if(0===i.length&&0===s.length)throw this.unexpected();return this.node(e,{kind:o.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:s})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(d.TokenKind.AT);const i=this.parseName(),s=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const n=this.parseDirectiveLocations();return this.node(e,{kind:o.Kind.DIRECTIVE_DEFINITION,description:t,name:i,arguments:s,repeatable:r,locations:n})}parseDirectiveLocations(){return this.delimitedMany(d.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(n.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new r.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,s.syntaxError)(this._lexer.source,t.start,`Expected ${h(e)}, found ${l(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==d.TokenKind.NAME||t.value!==e)throw(0,s.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${l(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===d.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,s.syntaxError)(this._lexer.source,t.start,`Unexpected ${l(t)}.`)}any(e,t,i){this.expectToken(e);const s=[];for(;!this.expectOptionalToken(i);)s.push(t.call(this));return s}optionalMany(e,t,i){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(i));return e}return[]}many(e,t,i){this.expectToken(e);const s=[];do{s.push(t.call(this))}while(!this.expectOptionalToken(i));return s}delimitedMany(e,t){this.expectOptionalToken(e);const i=[];do{i.push(t.call(this))}while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==d.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,s.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function l(e){const t=e.value;return h(e.kind)+(null!=t?` "${t}"`:"")}function h(e){return(0,a.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=u},8038:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return r(e.source,(0,s.getLocation)(e.source,e.start))},t.printSourceLocation=r;var s=i(9016);function r(e,t){const i=e.locationOffset.column-1,s="".padStart(i)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?i:0,d=t.column+c,u=`${e.name}:${a}:${d}\n`,l=s.split(/\r\n|[\n\r]/g),h=l[r];if(h.length>120){const e=Math.floor(d/80),t=d%80,i=[];for(let e=0;e<h.length;e+=80)i.push(h.slice(e,e+80));return u+n([[`${a} |`,i[0]],...i.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",i[e+1]]])}return u+n([[a-1+" |",l[r-1]],[`${a} |`,h],["|","^".padStart(d)],[`${a+1} |`,l[r+1]]])}function n(e){const t=e.filter((([e,t])=>void 0!==t)),i=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(i)+(t?" "+t:""))).join("\n")}},8942:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(i,s)}"`};const i=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function s(e){return r[e.charCodeAt(0)]}const r=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]},3033:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,n.visit)(e,o)};var s=i(849),r=i(8942),n=i(285);const o={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>a(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=d("(",a(e.variableDefinitions,", "),")"),i=a([e.operation,a([e.name,t]),a(e.directives," ")]," ");return("query"===i?"":i+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:i,directives:s})=>e+": "+t+d(" = ",i)+d(" ",a(s," "))},SelectionSet:{leave:({selections:e})=>c(e)},Field:{leave({alias:e,name:t,arguments:i,directives:s,selectionSet:r}){const n=d("",e,": ")+t;let o=n+d("(",a(i,", "),")");return o.length>80&&(o=n+d("(\n",u(a(i,"\n")),"\n)")),a([o,a(s," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+d(" ",a(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:i})=>a(["...",d("on ",e),a(t," "),i]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:i,directives:s,selectionSet:r})=>`fragment ${e}${d("(",a(i,", "),")")} on ${t} ${d("",a(s," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,s.printBlockString)(e):(0,r.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+a(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+a(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+d("(",a(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:i})=>d("",e,"\n")+a(["schema",a(t," "),c(i)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:i})=>d("",e,"\n")+a(["scalar",t,a(i," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:i,directives:s,fields:r})=>d("",e,"\n")+a(["type",t,d("implements ",a(i," & ")),a(s," "),c(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:i,type:s,directives:r})=>d("",e,"\n")+t+(l(i)?d("(\n",u(a(i,"\n")),"\n)"):d("(",a(i,", "),")"))+": "+s+d(" ",a(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:i,defaultValue:s,directives:r})=>d("",e,"\n")+a([t+": "+i,d("= ",s),a(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:i,directives:s,fields:r})=>d("",e,"\n")+a(["interface",t,d("implements ",a(i," & ")),a(s," "),c(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:i,types:s})=>d("",e,"\n")+a(["union",t,a(i," "),d("= ",a(s," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:i,values:s})=>d("",e,"\n")+a(["enum",t,a(i," "),c(s)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:i})=>d("",e,"\n")+a([t,a(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:i,fields:s})=>d("",e,"\n")+a(["input",t,a(i," "),c(s)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:i,repeatable:s,locations:r})=>d("",e,"\n")+"directive @"+t+(l(i)?d("(\n",u(a(i,"\n")),"\n)"):d("(",a(i,", "),")"))+(s?" repeatable":"")+" on "+a(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>a(["extend schema",a(e," "),c(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>a(["extend scalar",e,a(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:s})=>a(["extend type",e,d("implements ",a(t," & ")),a(i," "),c(s)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:s})=>a(["extend interface",e,d("implements ",a(t," & ")),a(i," "),c(s)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:i})=>a(["extend union",e,a(t," "),d("= ",a(i," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:i})=>a(["extend enum",e,a(t," "),c(i)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:i})=>a(["extend input",e,a(t," "),c(i)]," ")}};function a(e,t=""){var i;return null!==(i=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==i?i:""}function c(e){return d("{\n",u(a(e,"\n")),"\n}")}function d(e,t,i=""){return null!=t&&""!==t?e+t+i:""}function u(e){return d(" ",e.replace(/\n/g,"\n "))}function l(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}},2412:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,n.instanceOf)(e,o)};var s=i(7242),r=i(8002),n=i(5752);class o{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||(0,s.devAssert)(!1,`Body must be a string. Received: ${(0,r.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||(0,s.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,s.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=o},3175:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=i,function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(i||(t.TokenKind=i={}))},285:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=c,t.getVisitFn=function(e,t,i){const{enter:s,leave:r}=c(e,t);return i?r:s},t.visit=function(e,t,i=n.QueryDocumentKeys){const d=new Map;for(const e of Object.values(o.Kind))d.set(e,c(t,e));let u,l,h,p=Array.isArray(e),_=[e],f=-1,m=[],y=e;const g=[],v=[];do{f++;const e=f===_.length,o=e&&0!==m.length;if(e){if(l=0===v.length?void 0:g[g.length-1],y=h,h=v.pop(),o)if(p){y=y.slice();let e=0;for(const[t,i]of m){const s=t-e;null===i?(y.splice(s,1),e++):y[s]=i}}else{y=Object.defineProperties({},Object.getOwnPropertyDescriptors(y));for(const[e,t]of m)y[e]=t}f=u.index,_=u.keys,m=u.edits,p=u.inArray,u=u.prev}else if(h){if(l=p?f:_[f],y=h[l],null==y)continue;g.push(l)}let c;if(!Array.isArray(y)){var b,E;(0,n.isNode)(y)||(0,s.devAssert)(!1,`Invalid AST Node: ${(0,r.inspect)(y)}.`);const i=e?null===(b=d.get(y.kind))||void 0===b?void 0:b.leave:null===(E=d.get(y.kind))||void 0===E?void 0:E.enter;if(c=null==i?void 0:i.call(t,y,l,h,g,v),c===a)break;if(!1===c){if(!e){g.pop();continue}}else if(void 0!==c&&(m.push([l,c]),!e)){if(!(0,n.isNode)(c)){g.pop();continue}y=c}}var T;void 0===c&&o&&m.push([l,y]),e?g.pop():(u={inArray:p,index:f,keys:_,edits:m,prev:u},p=Array.isArray(y),_=p?y:null!==(T=i[y.kind])&&void 0!==T?T:[],f=-1,m=[],h&&v.push(h),h=y)}while(void 0!==u);return 0!==m.length?m[m.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),i=Object.create(null);for(const s of Object.values(o.Kind)){let r=!1;const n=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:i,leave:a}=c(e[t],s);r||(r=null!=i||null!=a),n[t]=i,o[t]=a}if(!r)continue;const d={enter(...i){const s=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var r;const c=null===(r=n[o])||void 0===r?void 0:r.apply(e[o],i);if(!1===c)t[o]=s;else if(c===a)t[o]=a;else if(void 0!==c)return c}},leave(...i){const s=i[0];for(let n=0;n<e.length;n++)if(null===t[n]){var r;const s=null===(r=o[n])||void 0===r?void 0:r.apply(e[n],i);if(s===a)t[n]=a;else if(void 0!==s&&!1!==s)return s}else t[n]===s&&(t[n]=null)}};i[s]=d}return i};var s=i(7242),r=i(8002),n=i(1807),o=i(2828);const a=Object.freeze({});function c(e,t){const i=e[t];return"object"==typeof i?i:"function"==typeof i?{enter:i,leave:void 0}:{enter:e.enter,leave:e.leave}}t.BREAK=a},3300:(e,t,i)=>{"use strict";var s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i.g)return i.g;throw new Error("unable to locate global object")}();e.exports=t=s.fetch,s.fetch&&(t.default=s.fetch.bind(s)),t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response},2186:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t},o=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const c=a(i(5945)),d=a(i(5517)),u=a(i(3250)),l=a(i(9745)),h=i(9868),p=a(i(3216)),_=n(i(5092));t.default=class{constructor(e={}){this._workspaces=[],"dev"===e.env?(this.urlHxb="https://stg-hxb-graph.hexabase.com/graphql",this.restHxb="https://stg-api.hexabase.com",this.pubSubHxb="https://stg-pubsub.hexabase.com/hub"):(this.urlHxb="https://graphql.hexabase.com/graphql",this.restHxb="https://api.hexabase.com",this.pubSubHxb="https://pubsub.hexabase.com/hub");const{url:t,pubsub:i,rest:s}=e;t&&""!==t.trim()&&(this.urlHxb=t),s&&""!==s.trim()&&(this.restHxb=s),i&&""!==i.trim()&&(this.pubSubHxb=i),this.auth=this._initAuth()}_init(){return o(this,void 0,void 0,(function*(){this.users=u.default,h.HxbAbstract.client=this,this.currentWorkspace=yield d.default.get(),this.currentUser=yield this.users.current()}))}setToken(e){return o(this,void 0,void 0,(function*(){this.tokenHxb=e,yield this._init()}))}setPersistence(e){return o(this,void 0,void 0,(function*(){this.auth.setPersistence(e);const t=yield this.auth.getToken();t&&(yield this.setToken(t))}))}login({email:e,password:t,token:i}){return o(this,void 0,void 0,(function*(){if(i)return yield this.setToken(i),!0;if(!e||!t)throw Error("Need token or email and password to initialize sdk");const s=yield this.auth.login({email:e,password:t});if(!s)throw Error("Need login failed to initialize sdk");return yield this.setToken(s),!0}))}logout(){return o(this,void 0,void 0,(function*(){try{this.auth.client.setHeaders({authorization:`Bearer ${this.tokenHxb}`}),yield this.auth.logout()}catch(e){}return this.currentUser=void 0,this.currentWorkspace=void 0,this.tokenHxb="",!0}))}setWorkspace(e){return o(this,void 0,void 0,(function*(){if(this.currentWorkspace&&(this.currentWorkspace==e||this.currentWorkspace.id===e))return!0;const t=e?"string"==typeof e?e:e.id:void 0;if(t){const e=yield this.workspace(t);if(!e)throw new Error(`No workspace ${t}`);this.currentWorkspace=yield d.default.current(e.id)}return this.currentWorkspace.id||(this.currentWorkspace=d.default.fromJson({w_id:t})),!0}))}pubSubUrl(){return`${this.pubSubHxb}?token=${this.tokenHxb}`}_initAuth(){return new c.default(this.urlHxb)}workspaces(){return o(this,void 0,void 0,(function*(){return this._workspaces.length>0||(this._workspaces=yield d.default.all()),this._workspaces}))}workspacesWithCurrent(){return o(this,void 0,void 0,(function*(){if(this._workspaces.length>0&&this.currentWorkspace)return{workspaces:this._workspaces,workspace:this.currentWorkspace};const e=yield d.default.allWithCurrent();return this._workspaces=e.workspaces,this.currentWorkspace=e.workspace,e}))}workspace(e){return o(this,void 0,void 0,(function*(){if(0===this._workspaces.length&&(yield this.workspaces()),e){const t=this._workspaces.find((t=>t.id===e||t.name===e));if(!t)throw new Error(`No workspace ${e}`);return yield t.fetch(),t}return new d.default}))}query(e){return new l.default({projectId:e})}upload(e,t){return p.default.upload(e,t)}download(e){return p.default.download(e)}file(e){return new p.default({id:e})}invite(e,t={},i){return o(this,void 0,void 0,(function*(){const s={users:e.map((e=>i?{email:e,exclusive_w_id:i.id}:{email:e}))};return t.senderAddress&&(s.sender_address=t.senderAddress),t.domain&&(s.domain=t.domain),t.invitationPath&&(s.invitation_path=t.invitationPath),t.noConfirmEmail&&(s.no_confirm_email=t.noConfirmEmail),t.emailTemplatesId&&(s.email_templates_id=t.emailTemplatesId),this.currentWorkspace.rest("post","/api/v0/userinvite",{},s)}))}connectPubSub(){return o(this,void 0,void 0,(function*(){return this.connection||(this.connection=(new _.HubConnectionBuilder).withUrl(this.pubSubUrl(),{skipNegotiation:!0,transport:_.HttpTransportType.WebSockets}).withAutomaticReconnect().configureLogging(_.LogLevel.Information).build(),yield this.connection.start()),!0}))}closePubSub(){return o(this,void 0,void 0,(function*(){return!this.connection||(yield this.connection.stop(),this.connection=void 0,!0)}))}}},9868:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HxbAbstract=void 0;const n=i(8687),o=r(i(2186)),a=r(i(3300)),c=r(i(6230));class d{constructor(e){e&&this.sets(e)}static request(e,t,i){return(new d).request(e,t,i)}request(e,t,i){var s;const r=i instanceof o.default?i:d.client,a=new n.GraphQLClient(r.urlHxb,{timeout:5e4,headers:{authorization:`Bearer ${r.tokenHxb}`}});try{return a.request(e,t)}catch(e){throw JSON.stringify(null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.errors)}}static rest(e,t,i,s,r={}){return(new d).rest(e,t,i,s,r)}rest(e,t,i,r,n={}){return s(this,void 0,void 0,(function*(){const s=i?new URLSearchParams(i).toString():"",o=`${d.client.restHxb}${t}${""!==s?`?${s}`:""}`;try{const t=yield this.exec(e,o,r,n);return"blob"===n.response?yield t.blob():n.binary?JSON.parse(yield t.text()):yield t.json()}catch(e){throw e.response.data}}))}exec(e,t,i,r={}){return s(this,void 0,void 0,(function*(){const s={method:e,headers:{Authorization:`Bearer ${d.client.tokenHxb}`}};if(r.binary||(s.headers=Object.assign(Object.assign({},s.headers),{"Content-Type":"application/json"})),["get","delete"].indexOf(e.toLocaleLowerCase())>-1)return(0,a.default)(t,s);if(["post","put"].indexOf(e.toLocaleLowerCase())>-1)return s.body=yield this._makeBody(i,r.binary),(0,a.default)(t,s);throw new Error(`Method ${e} is not supported`)}))}_makeBody(e={},t=!1){return s(this,void 0,void 0,(function*(){if(!t)return JSON.stringify(e);const i=new c.default,s=e.fileName||e.filename;for(const t in e){const r=e[t];"[object File]"===new String(r)?"undefined"!=typeof window?i.append(t,r,s):i.append(t,Buffer.from(yield r.arrayBuffer()),s):i.append(t,r)}return i}))}static fromJson(e){const t=new this;return t.sets(e),t}sets(e){return e.workspace&&this.set("workspace",e.workspace),e.project&&this.set("project",e.project),e.datastore&&this.set("datastore",e.datastore),e.item&&this.set("item",e.item),Object.keys(e).forEach((t=>{this.set(t,e[t])})),this}set(e,t){return this}}t.HxbAbstract=d},341:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)},n=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Datastore=t.FileObject=t.Workspace=t.User=t.HexabaseSQL=t.Report=t.Project=t.Item=t.HexabaseClient=t.createClient=void 0;const a=o(i(2186));t.HexabaseClient=a.default;const c=o(i(5286));t.Item=c.default;const d=o(i(7437));t.Project=d.default;const u=o(i(5937));t.Report=u.default;const l=o(i(9745));t.HexabaseSQL=l.default;const h=o(i(3250));t.User=h.default;const p=o(i(5517));t.Workspace=p.default;const _=o(i(1210));t.Datastore=_.default;const f=o(i(3216));t.FileObject=f.default,t.createClient=({env:e,email:t,password:i,token:s}={})=>n(void 0,void 0,void 0,(function*(){const r=new a.default({env:e});return s?(yield r.setToken(s),r):(t&&i&&(yield r.login({email:t,password:i})),r)})),r(i(6475),t)},4118:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOGIN=void 0;const s=i(8687);t.LOGIN=s.gql`
mutation Login($loginInput: LoginInput!) {
login(loginInput: $loginInput) {
token
}
}
`},5539:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DATASTORE_GET_FIELD_AUTO_NUMBER=t.DELETE_DATASTORE=t.UPDATE_DATASTORE_SETTING=t.VALIDATE_DS_DISPLAY_ID=t.CREATE_DATASTORE_FROM_TEMPLATE=t.GET_DATASTORE_DETAIL=t.GET_DATASTORES=t.DS_ACTION_SETTING=t.DS_STATUS=t.DS_ACTIONS=t.DS_FIELD_SETTING=t.DS_FIELDS=void 0;const s=i(8687);t.DS_FIELDS=s.gql`
query DatastoreGetFields($datastoreId: String!, $projectId: String) {
datastoreGetFields(datastoreId: $datastoreId, projectId: $projectId) {
field_layout
fields
}
}
`,t.DS_FIELD_SETTING=s.gql`
query DatastoreGetFieldSettings($fieldId: String!, $datastoreId: String!) {
datastoreGetFieldSettings(fieldId: $fieldId, datastoreId: $datastoreId) {
value
workspace_id
project_id
datastore_id
field_id
name {
ja
en
}
display_id
dataType
search
show_list
as_title
status
full_text
unique
hideOnInput
hide_from_api
has_index
roles {
can_execute
can_use
type
name
display_id
role_id
project_id
}
}
}
`,t.DS_ACTIONS=s.gql`
query DatastoreGetActions($datastoreId: String!) {
datastoreGetActions(datastoreId: $datastoreId) {
workspace_id
project_id
datastore_id
action_id
is_status_action
display_id
operation
set_status
name
}
}
`,t.DS_STATUS=s.gql`
query DatastoreGetStatuses($datastoreId: String!) {
datastoreGetStatuses(datastoreId: $datastoreId) {
display_id
name {
ja
en
}
displayed_name
status_id
sort_id
x
y
}
}
`,t.DS_ACTION_SETTING=s.gql`
query DatastoreGetActionSetting($actionId: String!, $datastoreId: String!) {
datastoreGetActionSetting(actionId: $actionId, datastoreId: $datastoreId) {
workspace_id
project_id
datastore_id
action_id
is_status_action
display_id
operation
set_status
name {
ja
en
}
roles {
can_execute
can_use
project_id
type
name
display_id
role_id
}
}
}
`,t.GET_DATASTORES=s.gql`
query Datastores($projectId: String!) {
datastores(projectId: $projectId) {
d_id
data_source
deleted
display_id
display_order
external_service_data
imported
invisible
is_external_service
name
no_status
p_id
show_display_id_to_list
show_in_menu
show_info_to_list
show_only_dev_mode
unread
uploading
use_board_view
use_csv_update
use_external_sync
use_grid_view
use_grid_view_by_default
use_qr_download
use_replace_upload
w_id
ws_name
}
}
`,t.GET_DATASTORE_DETAIL=s.gql`
query DatastoreSetting($datastoreId: String!) {
datastoreSetting(datastoreId: $datastoreId) {
display_id
names
id
field_layout {
display_id
col
id
row
size_x
size_y
}
fields {
as_title
data_type
display_id
display_name
field_index
full_text
id
max_value
min_value
names
options {
o_id
_key
fieldID
}
show_list
search
status
title_order
unique
}
roles {
name
id
display_id
}
statuses {
names
display_id
id
}
}
}
`,t.CREATE_DATASTORE_FROM_TEMPLATE=s.gql`
mutation CreateDatastoreFromTemplate($payload: CreateDatastoreFromSeedReq!) {
createDatastoreFromTemplate(payload: $payload) {
datastoreId
}
}
`,t.VALIDATE_DS_DISPLAY_ID=s.gql`
mutation ValidateDatastoreDisplayID($payload: IsExistsDSDisplayIDExcludeOwnReq!) {
validateDatastoreDisplayID(payload: $payload) {
exits
}
}
`,t.UPDATE_DATASTORE_SETTING=s.gql`
mutation UpdateDatastoreSetting($payload: DatastoreUpdateSetting!) {
updateDatastoreSetting(payload: $payload) {
data
success
}
}
`,t.DELETE_DATASTORE=s.gql`
mutation DeleteDatastore($datastoreId: String!) {
deleteDatastore(datastoreId: $datastoreId) {
data
success
}
}
`,t.DATASTORE_GET_FIELD_AUTO_NUMBER=s.gql`
query DatastoreGetFieldAutoNumber($datastoreId: String!, $fieldId: String!, $projectId: String!, $params: GetFieldAutoNumberQuery) {
datastoreGetFieldAutoNumber(datastoreId: $datastoreId, fieldId: $fieldId, projectId: $projectId, getFieldAutoNumberQuery: $params) {
errors {
description
error
error_code
error_level
reference_id
}
has_error
result
}
}
`},2358:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_ATTACHMENT=t.DELETE_STORAGE=t.GET_DOWNLOAD_FILE=void 0;const s=i(8687);t.GET_DOWNLOAD_FILE=s.gql`
query GetDownloadFile($id: String!) {
getDownloadFile(id: $id){
filename
data
}
}
`,t.DELETE_STORAGE=s.gql`
mutation DeleteStorage($fileId: String!) {
deleteStorage(fileId: $fileId) {
data
success
}
}
`,t.FILE_ATTACHMENT=s.gql`
mutation CreateItemFileAttachment($payload: ItemFileAttachmentPl!) {
createItemFileAttachment(payload: $payload) {
_id
created_at
d_id
contentType
datastore_id
deleted
field_id
display_order
file_id
filename
filepath
name
item_id
i_id
mediaLink
p_id
timeCreated
size
selfLink
temporary
updated
w_id
user_id
}
}
`},9612:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REMOVE_USER_FROM_GROUP=t.ADD_USER_IN_GROUP=t.DELETE_GROUP=t.GET_USERS_IN_GROUP=t.UPDATE_GROUP=t.ADD_GROUP_TREE=void 0;const s=i(8687);t.ADD_GROUP_TREE=s.gql`
mutation addGroupTree($payload: AddGroupReq!) {
addGroupTree(payload: $payload) {
error
groupTree_datastores_res
group {
id
g_id
display_id
name
index
disable_ui_access
is_root
access_key
created_at
}
}
}
`,t.UPDATE_GROUP=s.gql`
query updateGroup(
$payload: UpdateGroupReq!
$groupId: String!
) {
updateGroup(
payload: $payload
groupId: $groupId
) {
error
group {
g_id
group_id
name
index
}
children {
g_id
group_id
name
index
}
count
}
}
`,t.GET_USERS_IN_GROUP=s.gql`
query getUsersInGroup($groupId: String!) {
getUsersInGroup(groupId: $groupId) {
count
members {
u_id
username
email
profile_pic
confirmed
email_sent
is_sv
user_roles {
r_id
role_name
role_id
p_id
application_id
application_name
application_display_order
}
additional_info
}
}
}
`,t.DELETE_GROUP=s.gql`
query deleteGroup($groupId: String!) {
deleteGroup(groupId: $groupId) {
error
}
}
`,t.ADD_USER_IN_GROUP=s.gql`
mutation addUserInGroup($payload: AddUserPayload!) {
addUserInGroup(payload: $payload) {
added
exists
user_profile {
confirmed
email
email_sent
profile_pics {
mediaLink
}
u_id
user_code
username
}
}
}
`,t.REMOVE_USER_FROM_GROUP=s.gql`
mutation removeUserFromGroup($payload: removeUserFromGroupPayload!) {
removeUserFromGroup(payload: $payload) {
error
}
}
`},3697:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DELETE_ITEMS=t.ITEM_WITH_SEARCH=t.POST_DELETE_ITEM_HISTORY=t.POST_UPDATE_ITEM_HISTORY=t.POST_NEW_ITEM_HISTORY=t.EXECUTE_ITEM_ACTION=t.UPDATE_ITEM=t.ITEM_DETAIL=t.DELETE_ITEM_LINK=t.UPDATE_ITEM_LINK=t.ADD_ITEM_LINK=t.ITEM_LINKED=t.DATASTORE_UPDATE_ITEM=t.DELETE_ITEM=t.CREATE_NEW_ITEM=t.CREATE_ITEMID=t.ITEM_HISTORIES=t.DS_ITEMS=void 0;const s=i(8687);t.DS_ITEMS=s.gql`
mutation DatastoreGetDatastoreItems(
$getItemsParameters: GetItemsParameters!
$datastoreId: String!
$projectId: String
) {
datastoreGetDatastoreItems(
getItemsParameters: $getItemsParameters
datastoreId: $datastoreId
projectId: $projectId
) {
items
totalItems
}
}
`,t.ITEM_HISTORIES=s.gql`
query GetHistories(
$itemId: String!
$datastoreId: String!
$projectId: String!
$getHistoryParamQueries: GetHistoryParamQueries
) {
getHistories(
itemId: $itemId
datastoreId: $datastoreId
projectId: $projectId
getHistoryParamQueries: $getHistoryParamQueries
) {
unread
histories {
history_id
display_order
comment
is_unread
created_at
action_id
action_name
transaction_id
action_operation
is_status_action
datastore_id
datastore_name
user_id
username
email
updated_by
updated_at
media_link
is_updated
}
}
}
`,t.CREATE_ITEMID=s.gql`
mutation DatastoreCreateItemID($datastoreId: String!) {
datastoreCreateItemID(datastoreId: $datastoreId) {
item_id
}
}
`,t.CREATE_NEW_ITEM=s.gql`
mutation DatastoreCreateNewItem(
$payload: NewItemActionParameters!
$datastoreId: String!
$projectId: String!
) {
datastoreCreateNewItem(
newItemActionParameters: $payload
datastoreId: $datastoreId
projectId: $projectId
) {
error
history_id
item
item_id
}
}
`,t.DELETE_ITEM=s.gql`
mutation DatastoreDeleteItem(
$deleteItemReq: DeleteItemReq!
$itemId: String!
$datastoreId: String!
$projectId: String!
) {
datastoreDeleteItem(
deleteItemReq: $deleteItemReq
itemId: $itemId
datastoreId: $datastoreId
projectId: $projectId
) {
error
}
}
`,t.DATASTORE_UPDATE_ITEM=s.gql`
mutation DatastoreUpdateItem(
$itemActionParameters: ItemActionParameters!
$itemId: String!
$datastoreId: String!
$projectId: String!
) {
datastoreUpdateItem(
ItemActionParameters: $itemActionParameters
itemId: $itemId
datastoreId: $datastoreId
projectId: $projectId
)
}
`,t.ITEM_LINKED=s.gql`
query DatastoreGetLinkedItems(
$linkedDatastoreId: String!
$itemId: String!
$datastoreId: String!
) {
datastoreGetLinkedItems(
linkedDatastoreId: $linkedDatastoreId
itemId: $itemId
datastoreId: $datastoreId
) {
items
datastore_id
actions {
ID
a_id
display_id
w_id
p_id
d_id
name
status_id
is_status_action
description
display_order
pin_by_default
show_in_home
search_keys
operation
set_status
send_mail
isOwnedBySystem
AccessKeys
action_script {
script
enabled
lang
}
CreatedAt
UpdatedAt
}
stateflowActions {
ID
a_id
w_id
display_id
p_id
d_id
name
status_id
is_status_action
description
show_in_home
display_order
pin_by_default
search_keys
operation
set_status
send_mail
isOwnedBySystem
AccessKeys
action_script {
script
enabled
lang
}
CreatedAt
UpdatedAt
}
fields {
id
f_id
w_id
p_id
d_id
field_csv_name
display_name
name {
ja
en
}
display_id
dataType
search
show_list
as_title
status
fieldIndex
title_order
full_text
unique
min_value
max_value
hideOnInput
hide_from_api
has_index
}
column_settings
}
}
`,t.ADD_ITEM_LINK=s.gql`
mutation AddItemLink(
$datastoreId: String!
$itemId: String!
$itemLinkRequestInput: ItemLinkRequestInput!
$projectId: String!
) {
addItemLink(
datastoreId: $datastoreId
itemId: $itemId
itemLinkRequestInput: $itemLinkRequestInput
projectId: $projectId
) {
data
success
}
}
`,t.UPDATE_ITEM_LINK=s.gql`
mutation UpdateItemLink(
$datastoreId: String!
$itemId: String!
$projectId: String!
$updateItemLinkInput: UpdateItemLinkInput!
) {
updateItemLink(
datastoreId: $datastoreId
itemId: $itemId
projectId: $projectId
updateItemLinkInput: $updateItemLinkInput
) {
data
success
}
}
`,t.DELETE_ITEM_LINK=s.gql`
mutation DeleteItemLink(
$datastoreId: String!
$itemId: String!
$itemLinkRequestInput: ItemLinkRequestInput!
$projectId: String!
) {
deleteItemLink(
datastoreId: $datastoreId
itemId: $itemId
itemLinkRequestInput: $itemLinkRequestInput
projectId: $projectId
) {
data
success
}
}
`,t.ITEM_DETAIL=s.gql`
query GetDatastoreItemDetails(
$itemId: String!
$datastoreId: String!
$projectId: String
$datastoreItemDetailParams: DatastoreItemDetailParams
) {
getDatastoreItemDetails(
itemId: $itemId
datastoreId: $datastoreId
projectId: $projectId
datastoreItemDetailParams: $datastoreItemDetailParams
) {
title
rev_no
field_values
status_list
item_actions
status_actions
status_order
status_action_order
item_action_order
created_at
created_by
updated_at
updated_by
}
}
`,t.UPDATE_ITEM=s.gql`
mutation DatastoreUpdateItem(
$itemUpdatePayload: ItemUpdatePayload!
$itemId: String!
$datastoreId: String!
$projectId: String!
) {
datastoreUpdateItem(
itemUpdatePayload: $itemUpdatePayload
itemId: $itemId
datastoreId: $datastoreId
projectId: $projectId
)
}
`,t.EXECUTE_ITEM_ACTION=s.gql`
mutation DatastoreExecuteItemAction(
$projectId: String!
$datastoreId: String!
$actionId: String!
$itemId: String!
$itemActionParameters: ItemActionParameters!
) {
datastoreExecuteItemAction(
projectId: $projectId
datastoreId: $datastoreId
actionId: $actionId
itemId: $itemId
itemActionParameters: $itemActionParameters
) {
item_id
item
error
}
}
`,t.POST_NEW_ITEM_HISTORY=s.gql`
mutation PostNewItemHistory($payload: CreateCommentItemsParameters!) {
postNewItemHistory(payload: $payload) {
history_id
item_history {
IsChanged
UserObjID
action_id
comment
created_at
datastore_id
datastore_name
display_order
email
history_id
i_id
is_fetchreplymail
is_notify
item_id
media_link
post_for_rel
post_mode
project_id
transaction_id
updated_at
user_id
username
workspace_id
}
}
}
`,t.POST_UPDATE_ITEM_HISTORY=s.gql`
mutation PostUpdateItemHistory($payload: UpdateCommentItemsParameters!) {
postUpdateItemHistory(payload: $payload) {
error
}
}
`,t.POST_DELETE_ITEM_HISTORY=s.gql`
mutation ArchiveItemHistory($payload: ArchiveCommentItemsParameters!) {
archiveItemHistory(payload: $payload) {
error
}
}
`,t.ITEM_WITH_SEARCH=s.gql`
mutation ItemWithSearch($payload: GetItemsParameters!) {
itemWithSearch(getItemsParameters: $payload) {
fields
items
errors {
reference_id
error_level
error_code
error
description
}
totalItems
}
}
`,t.DELETE_ITEMS=s.gql`
mutation DatastoreDeleteDatastoreItems($datastoreId: String!, $projectId: String, $payload: DeleteItemsParameters) {
datastoreDeleteDatastoreItems(datastoreId: $datastoreId, projectId: $projectId, deleteItemsParameters: $payload) {
data
success
}
}
`},9127:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_PROJECT_NAME=t.UPDATE_PROJECT_THEME=t.DELETE_PROJECT=t.GET_INFO_PROJECT=t.PROJECT_ROLES_AND_MEMBER=t.APPLICATION_CREATE_PROJECT=t.GET_TEMPLATES=t.GET_APPLICATION_AND_DATASTORE=t.GET_APPLICATIONS=void 0;const s=i(8687);t.GET_APPLICATIONS=s.gql`
query GetApplications($workspaceId: String!) {
getApplications(workspaceId: $workspaceId) {
application_id
name
display_id
theme
display_order
}
}
`,t.GET_APPLICATION_AND_DATASTORE=s.gql`
query GetApplicationAndDataStore($workspaceId: String!) {
getApplicationAndDataStore(workspaceId: $workspaceId) {
application_id
name
display_id
datastores {
name
datastore_id
}
}
}
`,t.GET_TEMPLATES=s.gql`
query GetTemplates {
getTemplates {
categories {
category
templates {
tp_id
name
description
}
}
enabled
}
}
`,t.APPLICATION_CREATE_PROJECT=s.gql`
mutation ApplicationCreateProject($createProjectParams: CreateProjectParams) {
applicationCreateProject(createProjectParams: $createProjectParams) {
project_id
}
}
`,t.PROJECT_ROLES_AND_MEMBER=s.gql`
query getProjectRolesAndMember(
$workspace_id: String!
$project_id: String!
) {
getProjectRolesAndMember(
workspace_id: $workspace_id
project_id: $project_id
)
}
`,t.GET_INFO_PROJECT=s.gql`
query Query($projectId: String!) {
getInfoProject(projectId: $projectId) {
p_id
display_order
template_id
display_id
name
w_id
}
}
`,t.DELETE_PROJECT=s.gql`
mutation DeleteProject($payload: DeleteProjectPl!) {
deleteProject(payload: $payload) {
data
success
}
}
`,t.UPDATE_PROJECT_THEME=s.gql`
mutation UpdateProjectTheme($payload: UpdateProjectThemePl!) {
updateProjectTheme(payload: $payload) {
data
success
}
}
`,t.UPDATE_PROJECT_NAME=s.gql`
mutation UpdateProjectName($payload: UpdateProjectNamePl!) {
updateProjectName(payload: $payload) {
data
success
}
}
`},1608:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPORT_DEFAULT=t.GET_REPORTS=void 0;const s=i(8687);t.GET_REPORTS=s.gql`
query GetReports($projectId: String!) {
getReports(projectId: $projectId) {
rp_id
title
display_order
hide_menu
}
}
`,t.REPORT_DEFAULT=s.gql`
query ReportData($reportId: String!, $projectId: String!, $reportDataPayload: ReportDataPayload) {
reportData(reportId: $reportId, projectId: $projectId, reportDataPayload: $reportDataPayload) {
errors {
error_level
error_code
reference_id
error
description
}
error
report_title
totalItems
item_index_from
item_index_to
merge_cells {
colspan
rowspan
col
row
}
report_results
report_fields {
title
rpf_id
display_type
data_type
display_id
align
width
negative_sign_type
num_format
num_info {
no_comma
suffix
prefix
}
conditions {
font_weight
cond_rpf_id
condition
cond_type
value
bg_color
ft_color
use_field_ref
value_rpf_id
apply_row
font_size
font_style
negative_sign_type
num_format
}
f_id
d_id
merge_cells
hide
disable_search
use_integrated_report
is_cross_key
}
}
}
`},5299:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.POST_INVITE_USERS=t.LOG_OUT=t.USER_CONFIRMATIONS=t.USER_PASSWORD_EXPIRY=t.USER_REGISTER_CONFIRM=t.USER_REGISTER=t.USER_INFO=void 0;const s=i(8687);t.USER_INFO=s.gql`
query UserInfo {
userInfo {
username
email
profile_pic
u_id
current_workspace_id
is_ws_admin
user_roles {
r_id
role_name
role_id
p_id
application_id
application_name
application_display_order
}
}
}
`,t.USER_REGISTER=s.gql`
query UserRegister($confirmationId: String!) {
userRegister(confirmationId: $confirmationId) {
user {
username
isElapsed
id
email_confirmed
email
confirmed
confirmation_id
}
}
}
`,t.USER_REGISTER_CONFIRM=s.gql`
mutation UserRegisterConfirm($confirmRegisterUserInput: ConfirmRegisterUser!) {
userRegisterConfirm(confirmRegisterUserInput: $confirmRegisterUserInput) {
token
}
}
`,t.USER_PASSWORD_EXPIRY=s.gql`
query UserPasswordExpiry {
userPasswordExpiry {
is_expired
}
}
`,t.USER_CONFIRMATIONS=s.gql`
query UserConfirmations($confirmationId: String!) {
userConfirmations(confirmationId: $confirmationId) {
user {
confirmation_id
confirmed
current_workspace_id
email
tmp_email
email_confirmed
id
isElapsed
username
workspace {
is_root
name
index
id
g_id
display_id
disable_ui_access
created_at
access_key
}
}
}
}
`,t.LOG_OUT=s.gql`
mutation Logout {
logout {
data
success
}
}
`,t.POST_INVITE_USERS=s.gql`
mutation PostInviteUsers($payload: PostInviteUsersPl!) {
postInviteUsers(payload: $payload) {
email
stats
}
}
`},9704:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ARCHIVE_WORKSPACE=t.UPDATE_WORKSPACE_SETTINGS=t.SET_CURRENT_WORKSPACE=t.CREATE_WORKSPACE=t.TASK_QUEUE_STATUS=t.TASK_QUEUE_LIST=t.WORKSPACE_GROUP_TREE=t.WORKSPACE_GROUP_CHILDREN=t.WORKSPACE_USAGE=t.WORKSPACE_FUNCTIONALITY=t.WORKSPACE_PASSWORD_POLICY=t.WORKSPACE_CURRENT=t.WORKSPACE_DETAIL=t.WORKSPACES=void 0;const s=i(8687);t.WORKSPACES=s.gql`
query Workspaces {
workspaces {
workspaces {
workspace_name
workspace_id
}
current_workspace_id
}
}
`,t.WORKSPACE_DETAIL=s.gql`
query Workspace {
workspace {
app_functions {
dashboards {
disable_edit_dash_items
disable_edit_dashboards
}
app_templates {
disable_new_application
disable_save_templates
}
app_settings {
disable_role_settings
disable_program_extension
disable_left_menu_extension
disable_delete_application
disable_change_name
enable_field_values_validation
enable_action_validation
}
csv_import {
use_qr_download
disable_csv_update
disable_replace_import
}
data_reports {
disable_save_reports
disable_csv_downloads
disable_edit_reports
}
item_view {
disable_pin_items
disable_edit_fields
disable_edit_statuses
disable_pagination
disable_change_layouts
disable_edit_actions
hide_link_items
}
datastores {
disable_status_update
disable_grid_view
disable_query
disable_db_settings
disable_borad_view
}
}
created_at
id
languages {
default
lang_cd
use
}
name
plan_name
plan_id
pwd_policy {
expired_day
min_length
lockout_time
lockout_count
use_same_limit
use_pattern_check
use_min_length
use_lockout_time
use_lockout_count
use_language_ja
use_language_en
use_expired_day
same_limit
pattern_check_type
}
redirect {
redirect_url
is_apply_redirect_url_for_disabled_users
}
updated_at
user_id
w_id
ws_admin
user_sessions {
use
default
session_timeout_sec
}
ws_admin_users {
user_name
access_key
email
user_id
}
ws_functions {
ws_settings {
disable_archive
disable_change_name
disable_change_logo
disable_global_search
disable_password_policy
disable_manage_admins
}
task_queue {
show_task_list
}
new_workspaces {
new_workspace
}
group_settings {
disable_group_import
disable_user_import
disable_new_group
disable_group_roles
}
developer_functions {
disable_beta
disable_generate_token
disable_developer_mode
show_access_keys
}
}
ws_usage {
users_limit
items_limit
storage
storage_limit
users
datastores
datastores_limit
items
}
}
}
`,t.WORKSPACE_CURRENT=s.gql`
query WorkspaceCurrent {
workspaceCurrent {
workspace_id
}
}
`,t.WORKSPACE_PASSWORD_POLICY=s.gql`
query WorkspacePasswordPolicy($workingspaceId: String!) {
workspacePasswordPolicy(workingspaceId: $workingspaceId) {
expired_day
lockout_count
lockout_time
min_length
pattern_check_type
same_limit
use_expired_day
use_lockout_count
use_lockout_time
use_min_length
use_pattern_check
use_same_limit
}
}
`,t.WORKSPACE_FUNCTIONALITY=s.gql`
query WorkspaceFunctionality($workingspaceId: String!) {
workspaceFunctionality(workingspaceId: $workingspaceId) {
w_id
ws_functions {
use_global_search
use_beta
use_password_policy
use_create_workspace
}
app_functions {
use_dashboards
use_queries
use_create_application
use_reports
}
}
}
`,t.WORKSPACE_USAGE=s.gql`
query WorkspaceUsage($workingspaceId: String) {
workspaceUsage(workingspaceId: $workingspaceId) {
w_id
usage {
users
users_limit
storage
storage_limit
items
items_limit
datastores_limit
datastores
}
}
}
`,t.WORKSPACE_GROUP_CHILDREN=s.gql`
query WorkspaceGetGroupChildren($groupId: String) {
workspaceGetGroupChildren(groupId: $groupId) {
error
group {
index
name
group_id
g_id
}
children {
index
name
group_id
g_id
}
count
}
}
`,t.WORKSPACE_GROUP_TREE=s.gql`
query getGroupTree {
getGroupTree {
error
result {
id
name
display_id
index
show_child
disable_ui_access
}
}
}
`,t.TASK_QUEUE_LIST=s.gql`
query TaskGetQueueList($workspaceId: String, $queryTaskList: QueryTaskList) {
taskGetQueueList(workspaceId: $workspaceId, queryTaskList: $queryTaskList)
}
`,t.TASK_QUEUE_STATUS=s.gql`
query TaskGetQueueTaskStatus($taskId: String!, $workspaceId: String!) {
taskGetQueueTaskStatus(taskId: $taskId, workspaceId: $workspaceId) {
qt_id
category
status {
id
name
}
created_at
started_at
finished_at
metadata {
w_id
}
}
}
`,t.CREATE_WORKSPACE=s.gql`
mutation CreateWorkspace($createWorkSpaceInput: CreateWorkSpaceInput!) {
createWorkspace(createWorkSpaceInput: $createWorkSpaceInput) {
w_id
}
}
`,t.SET_CURRENT_WORKSPACE=s.gql`
mutation SetCurrentWorkSpace($setCurrentWorkSpaceInput: SetCurrentWorkSpaceInput!) {
setCurrentWorkSpace(setCurrentWorkSpaceInput: $setCurrentWorkSpaceInput) {
success
data
}
}
`,t.UPDATE_WORKSPACE_SETTINGS=s.gql`
mutation UpdateWorkspaceSettings($payload: WorkspaceSettingReq!) {
updateWorkspaceSettings(payload: $payload) {
error
}
}
`,t.ARCHIVE_WORKSPACE=s.gql`
mutation archiveWorkspace($payload: ArchiveWorkspace!) {
archiveWorkspace(payload: $payload) {
error
}
}
`},5612:function(e,t,i){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9868),n=s(i(2786));class o extends r.HxbAbstract{constructor(){super(...arguments),this.roles=[]}set(e,t){switch(e){case"datastore":this.datastore=t;break;case"action_id":this.id=t;break;case"display_id":this.displayId=t;break;case"name":this.name=t;break;case"is_status_action":this.isStatusAction=t;break;case"operation":this.operation=t;break;case"set_status":this.setStatus=t;break;case"role":this.roles=t.map((e=>n.default.fromJson(e)))}return this}}t.default=o},9192:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{constructor(){super(...arguments),this.dashboards={disableEditDashItems:!1,disableEditDashboards:!1},this.appTemplates={disableNewApplication:!1,disableSaveTemplates:!1},this.appSettings={disableRoleSettings:!1,disableProgramExtension:!1,disableLeftMenuExtension:!1,disableDeleteApplication:!1,disableChangeName:!1,enableFieldValuesValidation:!1,enableActionValidation:!1},this.csvImport={useQrDownload:!1,disableCsvUpdate:!1,disableReplaceImport:!1},this.dataReports={disableSaveReports:!1,disableCsvDownloads:!1,disableEditReports:!1},this.itemView={disablePinItems:!1,disableEditFields:!1,disableEditStatuses:!1,disablePagination:!1,disableChangeLayouts:!1,disableEditActions:!1,hideLinkItems:!1},this.datastores={disableStatusUpdate:!1,disableGridView:!1,disableQuery:!1,disableDbSettings:!1,disableBoradView:!1}}set(e,t){switch(e){case"dashboards":this.dashboards.disableEditDashItems=t.disable_edit_dash_items,this.dashboards.disableEditDashboards=t.disable_edit_dashboards;break;case"appTemplates":this.appTemplates.disableNewApplication=t.disable_new_application,this.appTemplates.disableSaveTemplates=t.disable_save_templates;break;case"appSettings":this.appSettings.disableRoleSettings=t.disable_role_settings,this.appSettings.disableProgramExtension=t.disable_program_extension,this.appSettings.disableLeftMenuExtension=t.disable_left_menu_extension,this.appSettings.disableDeleteApplication=t.disable_delete_application,this.appSettings.disableChangeName=t.disable_change_name,this.appSettings.enableFieldValuesValidation=t.enable_field_values_validation,this.appSettings.enableActionValidation=t.enable_action_validation;break;case"csvImport":this.csvImport.useQrDownload=t.use_qr_download,this.csvImport.disableCsvUpdate=t.disable_csv_update,this.csvImport.disableReplaceImport=t.disable_replace_import;break;case"dataReports":this.dataReports.disableSaveReports=t.disable_save_reports,this.dataReports.disableCsvDownloads=t.disable_csv_downloads,this.dataReports.disableEditReports=t.disable_edit_reports;break;case"itemView":this.itemView.disablePinItems=t.disable_pin_items,this.itemView.disableEditFields=t.disable_edit_fields,this.itemView.disableEditStatuses=t.disable_edit_statuses,this.itemView.disablePagination=t.disable_pagination,this.itemView.disableChangeLayouts=t.disable_change_layouts,this.itemView.disableEditActions=t.disable_edit_actions,this.itemView.hideLinkItems=t.hide_link_items;break;case"datastores":this.datastores.disableStatusUpdate=t.disable_status_update,this.datastores.disableGridView=t.disable_grid_view,this.datastores.disableQuery=t.disable_query,this.datastores.disableDbSettings=t.disable_db_settings,this.datastores.disableBoradView=t.disable_borad_view}return this}}t.default=r},5945:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const r=i(8687),n=i(5299),o=i(4118),a=i(2187),c=i(5285);t.default=class{constructor(e){this.urlGraphql=e,this.tokenName="HexabaseToken",this.stateChangeEmitters=new Map,this.client=new r.GraphQLClient(e)}login(e){var t;return s(this,void 0,void 0,(function*(){const i=yield this.client.request(o.LOGIN,{loginInput:e});return yield null===(t=this.persistence)||void 0===t?void 0:t.set(this.tokenName,i.login.token),i.login.token}))}logout(){var e;return s(this,void 0,void 0,(function*(){return yield null===(e=this.persistence)||void 0===e?void 0:e.remove(this.tokenName),(yield this.client.request(n.LOG_OUT)).logout.success}))}getToken(){var e;return s(this,void 0,void 0,(function*(){return yield null===(e=this.persistence)||void 0===e?void 0:e.get(this.tokenName)}))}setPersistence(e){this.persistence=new c.Persistence(e)}onAuthStateChange(e){const t=(0,a.uuid)(),i={id:t,callback:e,unsubscribe:()=>{this.stateChangeEmitters.delete(t)}};return this.stateChangeEmitters.set(t,i),i}}},5285:function(e,t){"use strict";var i,s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Persistence=t.PersistenceType=void 0,function(e){e[e.COOKIE=0]="COOKIE",e[e.STORAGE=1]="STORAGE"}(i=t.PersistenceType||(t.PersistenceType={})),t.Persistence=class{constructor(e){"string"==typeof e?(this.storageType=i.COOKIE,this._cookie=e):(this.storageType=i.STORAGE,this._storage=e)}set(e,t){return s(this,void 0,void 0,(function*(){if(this._storage)if(this.storageType!==i.STORAGE){if(this.storageType===i.COOKIE){const i=this.getCookieObject();i[e]=t,this._cookie=this.getCookieString(i)}}else yield this._storage.setItem(e,t)}))}get(e){return s(this,void 0,void 0,(function*(){return this._storage?this.storageType===i.STORAGE?yield this._storage.getItem(e):this.storageType===i.COOKIE?this.getCookieObject()[e]:null:null}))}remove(e){return s(this,void 0,void 0,(function*(){if(this._storage)if(this.storageType!==i.STORAGE){if(this.storageType===i.COOKIE){const t=this.getCookieObject();delete t[e],this._cookie=this.getCookieString(t)}}else yield this._storage.removeItem(e)}))}getCookieString(e){return this.storageType===i.COOKIE?Object.entries(e).map((([e,t])=>`${e}=${t}`)).join("; "):""}getCookieObject(){return this.storageType===i.COOKIE?Object.fromEntries(this._cookie.split("; ").map((e=>e.split("=")))):{}}}},1210:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=i(5539),a=r(i(1630)),c=r(i(5612)),d=r(i(8609)),u=r(i(5286));class l extends n.HxbAbstract{constructor(e){var t;super(e),this.templateName="SEED1",this._fields=[],this.extendLimitEextareaLength=2e3,this.ignoreSaveTemplate=!1,this.showDisplayIdToList=!1,this.showInMenu=!0,this.showInfoToList=!1,this.showOnlyDevMode=!1,this.useBoardView=!1,this.useCsvUpdate=!1,this.useExternalSync=!1,this.useGridView=!1,this.useGridViewByDefault=!1,this.useWrDownload=!1,this.useReplaceUpload=!1,this.useStatusUpdate=!1,this.useStatusUpdateByDefault=!1,this.displayOrder=0,this.externalServiceUrl="",this.dataSource="",this._actions=[],this.project&&(this.language=null===(t=this.project.workspace.languages)||void 0===t?void 0:t.find((e=>e.default)))}static all({project:e}){return s(this,void 0,void 0,(function*(){const t=(yield l.request(o.GET_DATASTORES,{projectId:e.id})).datastores.map((t=>l.fromJson(Object.assign({project:e},t))));return yield Promise.all(t.map((e=>e.fields()))),t}))}createItemId(){return s(this,void 0,void 0,(function*(){return u.default.createItemId(this)}))}set(e,t){switch(e){case"id":case"d_id":case"datastore_id":t&&""!==t.trim()&&(this.id=t);break;case"project":this.project=t;break;case"name":this.name=t;break;case"display_id":this.displayId=t;break;case"dipaly_order":this.displayOrder=t;break;case"data_source":this.dataSource=t;break;case"deleted":this.deleted=t;break;case"external_service_data":this.externalServiceData=t;break;case"imported":this.imported=t;break;case"invisible":this.invisible=t;break;case"is_external_service":this.isExternalService=t;break;case"no_status":this.noStatus=t;break;case"show_display_id_to_list":this.showDisplayIdToList=t;break;case"show_in_menu":this.showInMenu=t;break;case"show_info_to_list":this.showInfoToList=t;break;case"show_only_dev_mode":this.showOnlyDevMode=t;break;case"unread":this.unread=t;break;case"uploading":this.uploading=t;break;case"use_board_view":this.useBoardView=t;break;case"use_csv_update":this.useCsvUpdate=t;break;case"use_external_sync":this.useExternalSync=t;break;case"use_grid_view":this.useGridView=t;break;case"use_grid_view_by_default":this.useGridViewByDefault=t;break;case"use_qr_download":this.useQrDownload=t;break;case"use_replace_upload":this.useReplaceUpload=t}return this}fetch(){return s(this,void 0,void 0,(function*(){const e=[];e.push(this.request(o.GET_DATASTORE_DETAIL,{datastoreId:this.id})),e.push(this.fields());const t=(yield Promise.all(e))[0];return this.sets(t.datastoreSetting),!0}))}save(){return s(this,void 0,void 0,(function*(){return this.id?this.update():this.create()}))}create(){var e,t;return s(this,void 0,void 0,(function*(){const i=yield l.client.currentUser,s={lang_cd:(null===(e=this.language)||void 0===e?void 0:e.langCd)||"en",project_id:this.project.id,template_name:this.templateName,workspace_id:this.project.workspace.id,user_id:i.id},r=yield this.request(o.CREATE_DATASTORE_FROM_TEMPLATE,{payload:s});return this.id=null===(t=null==r?void 0:r.createDatastoreFromTemplate)||void 0===t?void 0:t.datastoreId,!0}))}validateDisplayId(e){return s(this,void 0,void 0,(function*(){const t={displayId:e,datastoreId:this.id,projectId:this.project.id};return(yield this.request(o.VALIDATE_DS_DISPLAY_ID,{payload:t})).validateDatastoreDisplayID.exits}))}update(){return s(this,void 0,void 0,(function*(){const e={datastore_id:this.id,display_id:this.displayId,extend_limit_textarea_length:this.extendLimitEextareaLength,ignore_save_template:this.ignoreSaveTemplate,is_extend_limit_textarea:2e3!==this.extendLimitEextareaLength,name:this.name,show_display_id_to_list:this.showDisplayIdToList,show_in_menu:this.showInMenu,show_info_to_list:this.showInfoToList,show_only_dev_mode:this.showOnlyDevMode,use_board_view:this.useBoardView,use_csv_update:this.useCsvUpdate,use_external_sync:this.useExternalSync,use_grid_view:this.useGridView,use_grid_view_by_default:this.useGridViewByDefault,use_qr_download:this.useWrDownload,use_replace_upload:this.useReplaceUpload,use_status_update:this.useStatusUpdate};return(yield this.request(o.UPDATE_DATASTORE_SETTING,{payload:e})).updateDatastoreSetting.success}))}fields(){return s(this,void 0,void 0,(function*(){return this._fields.length>0||(this._fields=yield a.default.all(this)),this._fields}))}field(e){return s(this,void 0,void 0,(function*(){return 0===this._fields.length&&(yield this.fields()),this._fields.find((t=>t.id===e||t.displayId===e))}))}fieldSync(e){const t=this._fields.find((t=>t.id===e||t.displayId===e));if(t)return t;throw new Error(`Field ${e} not found in datastore ${this.id}. This datastore has ${this._fields.length} fields.`)}actions(){return s(this,void 0,void 0,(function*(){if(this._actions.length>0)return this._actions;const e=yield this.request(o.DS_ACTIONS,{datastoreId:this.id});return this._actions=e.datastoreGetActions.map((e=>c.default.fromJson(Object.assign({datastore:this},e)))),this._actions}))}statuses(){return s(this,void 0,void 0,(function*(){return(yield this.request(o.DS_STATUS,{datastoreId:this.id})).datastoreGetStatuses.map((e=>d.default.fromJson(Object.assign({datastore:this},e))))}))}action(e){return s(this,void 0,void 0,(function*(){return(yield this.actions()).find((t=>t.operation===e))}))}autoNumber(e,t){return s(this,void 0,void 0,(function*(){const i={datastoreId:this.id,fieldId:e,projectId:this.project.id,getFieldAutoNumberQuery:t};return(yield this.request(o.DATASTORE_GET_FIELD_AUTO_NUMBER,i)).datastoreGetFieldAutoNumber.result.number}))}delete(){return s(this,void 0,void 0,(function*(){const e=yield this.request(o.DELETE_DATASTORE,{datastoreId:this.id});return null==e?void 0:e.deleteDatastore.success}))}items(e,t={}){return s(this,void 0,void 0,(function*(){const{items:i}=yield this.itemsWithCount(e,t);return i}))}search(){return s(this,void 0,void 0,(function*(){const e={datastore_id:this.id,project_id:this.project.id,page:1,per_page:100};return u.default.search(e,this)}))}searchWithCount(e){return s(this,void 0,void 0,(function*(){const t={datastore_id:this.id,project_id:this.project.id,page:e.page,per_page:e.per_page,return_count_only:!0,conditions:e.conditions,use_or_condition:e.use_or_condition||!1,unread_only:e.unread_only||!1,sort_fields:e.sort_fields,sort_field_id:e.sort_field_id,sort_order:e.sort_order,use_field_id:e.use_field_id||!1,use_display_id:!0,include_links:e.include_links||!0,include_lookups:e.include_lookups||!0,return_number_value:e.return_number_value||!0,format:"map",include_fields_data:e.include_fields_data||!0,omit_fields_data:e.omit_fields_data||!1,omit_total_items:e.omit_total_items||!1,data_result_timeout_sec:e.data_result_timeout_sec||30,total_count_timeout_sec:e.total_count_timeout_sec||30,debug_query:!1,select_fields:e.select_fields,select_fields_lookup:e.select_fields_lookup};return u.default.searchWithCount(t,this)}))}itemsWithCount(e={page:1,per_page:10},t={}){return void 0===e.page&&(e.page=1),void 0===e.per_page&&(e.per_page=10),void 0===e.use_display_id&&(e.use_display_id=!0),void 0===e.format&&(e.format="map"),void 0===e.include_links&&(e.include_links=!0),void 0===e.include_lookups&&(e.include_lookups=!0),u.default.all(e,this,t)}item(e){return s(this,void 0,void 0,(function*(){const t=u.default.fromJson({datastore:this,i_id:e});return e&&(yield t.fetch()),t}))}}t.default=l},1630:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=r(i(1210)),a=r(i(961)),c=i(5539),d=r(i(2786)),u=r(i(7437)),l=r(i(5286)),h=r(i(3216)),p=r(i(5655)),_=r(i(3250)),f=i(5053);class m extends n.HxbAbstract{constructor(){super(...arguments),this.roles=[],this._options=[]}set(e,t){switch(e){case"datastore":this.datastore=t;break;case"field_id":this.id=t;break;case"field_name":case"name":this.name=t;break;case"display_id":this.displayId=t;break;case"data_type":case"dataType":this.dataType=t;break;case"search":this.search=t;break;case"show_list":this.showList=t;break;case"as_title":this.asTitle=t;break;case"status":this.status=t;break;case"fieldIndex":this.fieldIndex=t;break;case"title_order":this.titleOrder=t;break;case"full_text":this.fullText=t;break;case"unique":this.unique=t;break;case"hide_from_api":this.hideFromApi=t;break;case"has_index":this.hasIndex=t;break;case"min_value":this.minValue=t;break;case"max_value":this.maxValue=t;break;case"hideOnInput":this.hideOnInput=t;break;case"sizeX":this.sizeX=t;break;case"sizeY":this.sizeY=t;break;case"col":this.col=t;break;case"row":this.row=t;break;case"roles":this.roles=t.map((e=>d.default.fromJson(Object.assign({project:this.datastore.project},e))))}return this}static all(e){return s(this,void 0,void 0,(function*(){const t={projectId:e.project.id,datastoreId:e.id},i=(yield this.request(c.DS_FIELDS,t)).datastoreGetFields,s=Object.keys(i.fields).map((t=>m.fromJson(Object.assign({datastore:e},i.fields[t]))));return Object.keys(i.field_layout).forEach((e=>{const t=s.find((t=>t.id===e)),r=a.default.fromJson(Object.assign({field:t},i.field_layout[e]));t.layout=r})),yield Promise.all(s.map((e=>e.options()))),s}))}valid(e){if(null===e)return!0;switch(this.dataType.toLocaleLowerCase()){case f.DataType.TEXT:case f.DataType.TEXTAREA:return"string"==typeof e;case f.DataType.NUMBER:return"number"==typeof e;case f.DataType.FILE:return""===e||null==e||e instanceof h.default||!!Array.isArray(e)||"string"==typeof e;case f.DataType.DATETIME:return!("string"!=typeof e||!e.match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z/))||!("string"!=typeof e||!e.match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z/))||e instanceof Date;case f.DataType.SELECT:case f.DataType.RADIO:return"string"==typeof e&&!!this.option(e);case f.DataType.CHECKBOX:return"string"==typeof e&&(e=e.split(",")),e.every((e=>this.option(e)));case f.DataType.USERS:return"string"==typeof e||e instanceof _.default||e.every((e=>e instanceof _.default||e.email&&e.user_id));case f.DataType.DSLOOKUP:return null===e||e instanceof l.default||"string"==typeof e||"object"==typeof e&&!(!e.item_id||!e.title);case f.DataType.AUTONUM:case f.DataType.CALC:case f.DataType.LABEL:case f.DataType.SEPARATOR:case f.DataType.STATUS:}return!0}option(e){if(null!==e)return"string"==typeof e?this._options.find((t=>t.id===e||t.displayId===e||t.value.en===e||t.value.ja===e)):this._options.find((t=>t.value===e))}value(e,t){if(null===e)return null;switch(this.dataType.toLocaleLowerCase()){case f.DataType.DSLOOKUP:return"string"==typeof e?e:this._valueDsLookup(e,t);case f.DataType.FILE:return""===e?e:e instanceof h.default?[e]:(Array.isArray(e)||"string"!=typeof e||(e=e.split(",")),e.map((e=>e instanceof h.default?e:"object"==typeof e?h.default.fromJson(e):e.match(/^[a-zA-Z0-9]+$/)?new h.default({id:e}):void 0)));case f.DataType.DATETIME:return e instanceof Date?e:new Date(e);case f.DataType.CHECKBOX:return Array.isArray(e)||(e=[e]),e.map((e=>{const t=this.option(e);return t?t.value:null}));case f.DataType.SELECT:case f.DataType.RADIO:const i=this.option(e);return i?i.value:null;case f.DataType.USERS:return Array.isArray(e)||(e=[e]),e.map((e=>e instanceof _.default?e:_.default.fromJson(e)));case f.DataType.FILE:return Array.isArray(e)||(e=[e]),e.map((e=>h.default.fromJson(e)))}return e}_valueDsLookup(e,t){if(e instanceof l.default)return e;const i=new u.default({workspace:t.item.datastore.project.workspace,id:e.p_id}),s=new o.default({project:i,id:e.d_id});return new l.default({datastore:s,id:e.i_id})}convert(e){return s(this,void 0,void 0,(function*(){switch(this.dataType.toLocaleLowerCase()){case f.DataType.TEXT:case f.DataType.TEXTAREA:if(null===e)return"";if("string"==typeof e)return e;throw new Error(`Field ${this.name} is not string (${e})`);case f.DataType.DSLOOKUP:if(null===e)return e;if(e instanceof l.default)return e.id||(yield e.save()),e.id;throw new Error(`Field ${this.name} is not Item (${e})`);case f.DataType.NUMBER:if(null===e)return null;if("number"==typeof e)return e;throw new Error(`Field ${this.name} is not number (${e})`);case f.DataType.FILE:if(null===e)return null;if(e instanceof h.default&&(e=[e]),Array.isArray(e))return(yield Promise.all(e.map((e=>e.id?e:e.save(this))))).map((e=>e.id));throw new Error(`Field ${this.name} is not FileObject (${e})`);case f.DataType.CHECKBOX:return e?(Array.isArray(e)||(e=[e]),e.map((e=>{const t=this.option(e);if(!t)throw new Error(`Field ${this.name} has not option (${e})`);return t.id}))):null;case f.DataType.SELECT:case f.DataType.RADIO:{if(null===e)return null;const t=this.option(e);if(!t)throw new Error(`Field ${this.name} has not option (${e})`);return t.id}case f.DataType.USERS:return null===e?null:e.map((e=>e.id));case f.DataType.DATETIME:return null===e?null:e.toISOString();case f.DataType.AUTONUM:case f.DataType.CALC:case f.DataType.LABEL:case f.DataType.SEPARATOR:case f.DataType.STATUS:return;default:throw new Error(`Field ${this.name} doesn't support (${e})`)}}))}static get(e,t){return s(this,void 0,void 0,(function*(){const i=yield this.request(c.DS_FIELD_SETTING,{fieldId:t,datastoreId:e.id});return m.fromJson(Object.assign({datastore:e},i.datastoreGetFieldSettings))}))}options(){return s(this,void 0,void 0,(function*(){return this.dataType!==f.DataType.SELECT&&this.dataType!==f.DataType.RADIO&&this.dataType!==f.DataType.CHECKBOX?null:(this._options.length>0||(this._options=yield p.default.all(this)),this._options)}))}}t.default=m},961:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"sizeX":this.sizeX=t;break;case"sizeY":this.sizeY=t;break;case"col":this.col=t;break;case"row":this.row=t;break;case"field":this.field=t}return this}}t.default=r},5655:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9868);class n extends r.HxbAbstract{set(e,t){if(null===t)return this;switch(e){case"_id":case"o_id":this.id=t;break;case"color":this.color=t;break;case"created_at":this.createdAt=new Date(t);break;case"display_id":this.displayId=t;break;case"enabled":this.enabled=t;break;case"selected":this.selected=t;break;case"sort_id":this.sortId=t;break;case"updated_at":this.updatedAt=new Date(t);break;case"value":this.value=t}return this}static all(e){return s(this,void 0,void 0,(function*(){const{datastore:t}=e,i=`/api/v0/applications/${t.project.id}/datastores/${t.id}/fields/${e.id}`;return(yield this.rest("GET",i,{with_options:"true"})).options.map((t=>n.fromJson(Object.assign({field:e},t))))}))}}t.default=n},3216:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9868),n=i(2358);class o extends r.HxbAbstract{set(e,t){switch(e){case"file_id":case"id":case"_id":this.id=t;break;case"item":this.item=t;break;case"datastore":this.datastore=t;break;case"name":case"filename":this.name=t;break;case"data":this.data=t;break;case"contentType":this.contentType=t;break;case"created_at":this.createdAt=new Date(t);break;case"deleted":this.deleted=t;break;case"display_order":this.displayOrder=t;break;case"filepath":this.filepath=t;break;case"mediaLink":this.mediaLink=t;break;case"selfLink":this.selfLink=t;break;case"size":this.size=t;break;case"temporary":this.temporary=t;break;case"timeCreated":this.timeCreated=new Date(t);break;case"updated":this.updated=new Date(t);break;case"user_id":this.userId=t}return this}save(e){return s(this,void 0,void 0,(function*(){return e?this._saveItem(e):this._save()}))}_saveItem(e){return s(this,void 0,void 0,(function*(){if(this.id)return this;const t={filename:this.name,file:this.data,application_id:this.item.datastore.project.id,datastore_id:this.item.datastore.id},i=`/api/v0/items/${this.item.id}/fields/${e.id}/attachments`,s=yield this.rest("post",i,{},t,{binary:!0});return this.set("id",s.file_id),this}))}_save(){return s(this,void 0,void 0,(function*(){if(this.id)return this;const e={fileName:this.name,file:this.data},t=yield this.rest("post","/api/v0/files",{},e,{binary:!0});return this.set("id",t.file_id),this}))}static upload(e,t){return s(this,void 0,void 0,(function*(){const i=new o({name:e,data:t});return yield i.save(),i}))}static download(e){return s(this,void 0,void 0,(function*(){const t=new o({id:e});return yield t.download(),t}))}download(){return s(this,void 0,void 0,(function*(){if(this.data)return this.data;const e=yield this.rest("get",`/api/v0/files/${this.id}`,{},{},{response:"blob"});return this.set("data",e),e}))}delete(){return s(this,void 0,void 0,(function*(){return(yield this.request(n.DELETE_STORAGE,{fileId:this.id})).deleteStorage.success}))}}t.default=o},9583:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9704),o=i(9868),a=i(9612),c=r(i(3250));class d extends o.HxbAbstract{constructor(){super(...arguments),this.disableUiAccess=!1,this._children=[],this._users=[]}set(e,t){switch(e){case"index":this.index=t;break;case"name":this.name=t;break;case"group_id":this.groupId=t;break;case"g_id":case"id":this.id=t;break;case"display_id":this.displayId=t;break;case"show_child":this.showChild=t;break;case"disable_ui_access":this.disableUiAccess=t;break;case"workspace":this.workspace=t;break;case"parent":this._parent=t;break;case"is_root":this.isRoot=t;break;case"access_key":this.accessKey=t;break;case"created_at":this.createdAt=new Date(t)}return this}static all(e){return s(this,void 0,void 0,(function*(){const t=(yield this.request(n.WORKSPACE_GROUP_TREE,{workspaceId:e.id})).getGroupTree.result.map((t=>d.fromJson(Object.assign({workspace:e},t))));return yield Promise.all(t.map((e=>e.fetch()))),t}))}fetch(){return s(this,void 0,void 0,(function*(){const e=yield this.request(n.WORKSPACE_GROUP_CHILDREN,{groupId:this.id}),{group:t,children:i}=e.workspaceGetGroupChildren;return this.sets(t),i&&(this._children=i.map((e=>d.fromJson(Object.assign({workspace:this.workspace},e))))),yield this.users(),!0}))}users(){return s(this,void 0,void 0,(function*(){if(this._users.length>0)return this._users;const e={groupId:this.id},t=yield d.request(a.GET_USERS_IN_GROUP,e);return this._users=t.getUsersInGroup.members.map((e=>c.default.fromJson(e))),this._users}))}addByEmail(e){return s(this,void 0,void 0,(function*(){return yield this.rest("post","/api/v0/users",{},{email:e,g_id:this.id})}))}groups(){return s(this,void 0,void 0,(function*(){return this._children.length>0||(yield this.fetch()),this._children}))}group(e){return s(this,void 0,void 0,(function*(){if(!e)return new d({workspace:this.workspace,parent:this});0===this._children.length&&(yield this.fetch());const t=this._children.find((t=>t.id===e||t.name===e));if(!t)throw new Error(`No group ${e}`);return yield t.fetch(),t}))}save(){return s(this,void 0,void 0,(function*(){return this.id?this.update():this.create()}))}create(){var e;return s(this,void 0,void 0,(function*(){const t={name:this.name,display_id:this.displayId,disable_ui_access:this.disableUiAccess,user_id:null===(e=d.client.currentUser)||void 0===e?void 0:e.id,workspace_id:this.workspace.id};this._parent&&(t.parent_g_id=this._parent.id);const i=yield d.request(a.ADD_GROUP_TREE,{payload:t});return this.sets(i.addGroupTree.group),yield this.fetch(),!0}))}update(){return s(this,void 0,void 0,(function*(){return!0}))}delete(){return s(this,void 0,void 0,(function*(){if("WORKSPACE.DEFAULT_GROUP_NAME"===this.name)throw new Error("Cannot delete default group");yield this.users(),yield Promise.all(this._users.map((e=>this.remove(e))));const e={groupId:this.id};return null==(yield d.request(a.DELETE_GROUP,e)).deleteGroup.error}))}add(e){return s(this,void 0,void 0,(function*(){const t={current_workspace_id:this.workspace.id,email:e.email,group_id:this.id,user_code:e.code,username:e.userName},i=yield d.request(a.ADD_USER_IN_GROUP,{payload:t});return i.addUserInGroup.added&&this._users.push(c.default.fromJson(i.addUserInGroup.user_profile)),!0}))}remove(e){return s(this,void 0,void 0,(function*(){const t={group_id:this.id,user_id:e.id,workspace_id:this.workspace.id};return null==(yield d.request(a.REMOVE_USER_FROM_GROUP,{payload:t})).removeUserFromGroup.error}))}}t.default=d},5286:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=i(3697),a=r(i(3873)),c=r(i(3830)),d=r(i(4218)),u=r(i(2830)),l=r(i(7911)),h=r(i(3216)),p=i(5053),_=r(i(1353));class f extends n.HxbAbstract{constructor(){super(...arguments),this.fields={},this.actions=[],this.statuses=[],this._statusActions=[],this._existAttachment=!1,this._linkItems=[],this._unlinkItems=[],this.ignoreFieldUpdate=!1}set(e,t){switch(e){case"datastore":this.datastore=t;break;case"links":{const e=this.datastore.project;t.forEach((t=>{const i=e.datastoreSync(t.d_id);t.i_ids.forEach((e=>{const t=f.fromJson({datastore:i,i_id:e});this._linkItems.push(new l.default({item:this,linkedItem:t,saved:!0}))}))}));break}case"item_links":{if(0===t.item_count)break;const e=this.datastore.project;t.links.forEach((t=>{const i=e.datastoreSync(t.d_id);t.items.forEach((e=>{const t=f.fromJson({datastore:i,i_id:e.i_id});this._linkItems.push(new l.default({item:this,linkedItem:t,saved:!0}))}))}));break}case"pinned":this.pinned=t;break;case"d_id":case"a_id":case"w_id":case"p_id":break;case"created_at":this.createdAt=new Date(t);break;case"updated_at":this.updatedAt=new Date(t);break;case"rev_no":this.revNo=t;break;case"unread":this.unread=t;break;case"i_id":t&&(this.id=t);break;case"seed_i_id":this.seedItemId=t;break;case"Status":this.statusLabel=t;break;case"status_id":this.statusId=t;break;case"title":this.title=t;break;case"created_by":this.createdBy=t;break;case"updated_by":this.updatedBy=t;break;case"lookup_items":if(""===t||!t)break;const i=this.datastore.project;Object.keys(t).map((e=>{const s=t[e],r=i.datastoreSync(s.d_id),n=f.fromJson(Object.assign({datastore:r},s));this.setFieldValue(e,n)}));break;case"item_actions":this.actions=Object.keys(t).map((e=>c.default.fromJson(Object.assign(Object.assign({display_id:e},t[e]),{item:this}))));break;case"status_list":this.statuses=Object.keys(t).map((e=>d.default.fromJson(Object.assign(Object.assign({display_id:e},t[e]),{item:this}))));break;case"status_actions":this._statusActions=Object.keys(t).map((e=>u.default.fromJson(Object.assign(Object.assign({display_id:e},t[e]),{item:this}))));break;case"status_order":this.statusOrder=t;break;case"status_action_order":this.statusActionOrder=t;break;case"item_action_order":this.itemActionOrder=t;break;case"field_values":Object.keys(t).forEach((e=>{const i=t[e];if(i.dataType===p.DataType.DSLOOKUP&&i.value){const t=this.datastore.project.datastoreSync(i.value.d_id),s=i.value.lookup_item;s.datastore=t;const r=f.fromJson(s);this.setFieldValue(e,r)}else this.setFieldValue(e,i.value)}));break;default:this.setFieldValue(e,t)}return this}add(e,t){if(Array.isArray(t))return this.addAll(e,t);if(this.ignoreFieldUpdate)return this;const i=this.datastore.fieldSync(e);if(!i.valid(t))throw new Error(`Invalid value ${t} for field key ${i.name} in item ${this.id}, datastore ${this.datastore.id}`);return this.fields[e]?this.fields[e].push(i.value(t,{item:this})[0]):this.fields[e]=[i.value(t,{item:this})],this}addAll(e,t){return t.forEach((t=>this.add(e,t))),this}setFieldValue(e,t){if(this.ignoreFieldUpdate)return this;const i=this.datastore.fieldSync(e);if(!i.valid(t))throw new Error(`Invalid value ${t} for field key ${i.name}`);return t=i.value(t,{item:this}),"status"===i.dataType.toLocaleLowerCase()&&(this._status=t),this.fields[i.displayId]=t,this}get(e,t){const i=this.fields[e]&&this.fields[e].field?this.fields[e].value:this.fields[e];return void 0===i||null===i&&t?t:i}static all(e,t,i={}){return s(this,void 0,void 0,(function*(){const s={getItemsParameters:e,datastoreId:t.id,projectId:t.project.id};s.getItemsParameters.return_number_value=!0,s.getItemsParameters.include_lookups=!0,s.getItemsParameters.include_links=!0,s.getItemsParameters.format="map";const r=yield f.request(o.DS_ITEMS,s);for(const e of r.datastoreGetDatastoreItems.items)if(e.item_links&&e.item_links.links&&0!==e.item_links.length)for(const i of e.item_links.links){if(!i.d_id)continue;const e=yield t.project.datastore(i.d_id);yield e.fields()}const n=r.datastoreGetDatastoreItems.items.map((e=>f.fromJson(Object.assign({datastore:t},e)))),a=r.datastoreGetDatastoreItems.totalItems;return i.deep&&(yield Promise.all(n.map((e=>e.fetch())))),{totalCount:a,items:n}}))}static search(e,t){return s(this,void 0,void 0,(function*(){return void 0===e.page&&(e.page=1),void 0===e.per_page&&(e.per_page=100),e.include_lookups=!0,e.include_links=!0,e.return_number_value=!0,e.include_fields_data=!0,e.format="map",(yield this.request(o.ITEM_WITH_SEARCH,{payload:e})).itemWithSearch.items.map((e=>f.fromJson(Object.assign({datastore:t},e))))}))}static searchWithCount(e,t,i={}){return s(this,void 0,void 0,(function*(){void 0===e.page&&(e.page=1),void 0===e.per_page&&(e.per_page=100),e.include_lookups=!0,e.include_links=!0,e.return_number_value=!0,e.include_fields_data=!0,e.format="map",e.use_display_id=!0,e.datastore_id=t.id,e.project_id=t.project.id;const s=yield this.request(o.ITEM_WITH_SEARCH,{payload:e});yield t.project.datastores();const r=s.itemWithSearch.items.map((e=>{const i=f.fromJson(Object.assign({datastore:t},e));return e.lookup_items&&i.set("lookup_items",e.lookup_items),i})),n=s.itemWithSearch.totalItems;return i.deep&&(yield Promise.all(r.map((e=>e.fetch())))),{totalCount:n,items:r}}))}static createItemId(e){return s(this,void 0,void 0,(function*(){return(yield this.request(o.CREATE_ITEMID,{datastoreId:e.id})).datastoreCreateItemID.item_id}))}static delete(e,t){return s(this,void 0,void 0,(function*(){const i={projectId:t.project.id,datastoreId:t.id,deleteItemsParameters:{use_display_id:!0,conditions:e}};return(yield this.request(o.DELETE_ITEMS,i)).datastoreDeleteDatastoreItems.success}))}save({comment:e,actionName:t,params:i}={}){return s(this,void 0,void 0,(function*(){return this.id&&""!==this.id?yield this.update({comment:e,actionName:t,params:i}):yield this.create({actionName:t,params:i}),yield this.fetch(),yield Promise.all(this._linkItems.map((e=>e.create()))),yield Promise.all(this._unlinkItems.map((e=>e.delete()))),this._linkItems=[],this._unlinkItems=[],!0}))}link(e){return this._linkItems.push(new l.default({item:this,linkedItem:e})),this}unlink(e){return this._unlinkItems.push(new l.default({item:this,linkedItem:e})),this}create({actionName:e,params:t}={}){return s(this,void 0,void 0,(function*(){if(!this.datastore)throw new Error("Datastore is required");const i=yield this.actionOrStatusAction(e||"CreateItem"),s={action_id:i&&i.id,return_item_result:!0,is_notify_to_sender:!0,ensure_transaction:!1,exec_children_post_procs:!0,item:yield this.toJson()};t&&(s.as_params=t);const r=yield this.request(o.CREATE_NEW_ITEM,{projectId:this.datastore.project.id,datastoreId:this.datastore.id,payload:s});yield this.datastore.project.datastores();const n={};for(const e of Object.keys(r.datastoreCreateNewItem.item)){const t=yield this.datastore.field(e);t?n[t.displayId]=r.datastoreCreateNewItem.item[e]:n[e]=r.datastoreCreateNewItem.item[e]}for(const e in n){if(!n[e].d_id)continue;const t=this.datastore.project.datastoreSync(n[e].d_id);t&&(n[e]=yield t.item(n[e].item_id))}return this.sets(n),this._setStatus(this._status),this._existAttachment&&(yield this.update(),this._existAttachment=!1),!0}))}execute(e,t=void 0){return s(this,void 0,void 0,(function*(){const i=yield this.actionOrStatusAction(e);if(!i)throw new Error(`Action ${e} not found`);const s={rev_no:this.revNo,datastore_id:this.datastore.id,action_id:i&&i.id,is_notify_to_sender:!0,ensure_transaction:!0,exec_children_post_procs:!0,return_item_result:!0,item:yield this.toJson()};for(const e in s.item)s.item[e]||delete s.item[e];return t&&(s.as_params=t),yield this.request(o.EXECUTE_ITEM_ACTION,{actionId:i.id,datastoreId:this.datastore.id,itemId:this.id,projectId:this.datastore.project.id,itemActionParameters:s}),yield this.fetch(),!0}))}actionOrStatusAction(e){return s(this,void 0,void 0,(function*(){const t=yield this.action(e);if(t)return t;return(yield this._statusActions.find((t=>t.displayId===e||t.id===e||t.name===e)))||void 0}))}update({comment:e,actionName:t,params:i}={}){return s(this,void 0,void 0,(function*(){const s=yield this.actionOrStatusAction(t||"UpdateItem"),r={rev_no:this.revNo,datastore_id:this.datastore.id,action_id:s&&s.id,is_notify_to_sender:!0,ensure_transaction:!0,exec_children_post_procs:!0,return_item_result:!0,item:yield this.toJson()};e&&(r.history={comment:e,datastore_id:this.datastore.id}),i&&(r.as_params=i);const n=yield this.request(o.DATASTORE_UPDATE_ITEM,{datastoreId:this.datastore.id,itemId:this.id,projectId:this.datastore.project.id,itemActionParameters:r}),a={};for(const e in n.datastoreUpdateItem.item){if(a[e]=n.datastoreUpdateItem.item[e],!a[e]||!a[e].d_id)continue;const t=this.datastore.project.datastoreSync(a[e].d_id);t&&(a[e]=yield t.item(a[e].item_id))}return this.sets(a),this._setStatus(this._status),!0}))}toJson(){return s(this,void 0,void 0,(function*(){const e={};for(const t in this.fields){const i=this.datastore.fieldSync(t);if(!i)throw new Error(`Field ${t} is not found`);if(!this.id&&i.dataType===p.DataType.FILE&&this.fields[t]&&this.fields[t].length>0&&this.fields[t].find((e=>!e.id))){this._existAttachment=!0;continue}const s=yield i.convert(this.fields[t]);void 0!==s&&(e[t]=s)}return e}))}statusActions(){return s(this,void 0,void 0,(function*(){return 0===this._statusActions.length&&(yield this.fetch()),this._statusActions}))}status(e){if(e){const t=this._statusActions.find((t=>t.displayId===e));if(!t)throw new Error("Status action is not found");this._updateStatusAction=t;const i=this.statuses.find((e=>e.id===t.nextStatusId));if(!i)throw new Error(`Status is not found ${t.nextStatusId}`);this._setStatus(i)}return this._status.displayId}fetch(){return s(this,void 0,void 0,(function*(){const e={datastoreId:this.datastore.id,itemId:this.id,projectId:this.datastore.project.id,datastoreItemDetailParams:{include_lookups:!0,use_display_id:!0,return_number_value:!0,format:"map",include_linked_items:!0}},t=yield this.request(o.ITEM_DETAIL,e);for(const e in t.getDatastoreItemDetails.field_values){const i=t.getDatastoreItemDetails.field_values[e];"dslookup"===i.dataType&&i.value&&(yield this.datastore.project.datastore(i.value.d_id))}return this.sets(t.getDatastoreItemDetails),this._setStatus(this._status),!0}))}delete(){return s(this,void 0,void 0,(function*(){if(!this.id)throw new Error("This item is not created yet.");const e={a_id:(yield this.action("DeleteItem")).id};return!(yield this.request(o.DELETE_ITEM,{datastoreId:this.datastore.id,itemId:this.id,projectId:this.datastore.project.id,deleteItemReq:e})).datastoreDeleteItem.error}))}action(e){return s(this,void 0,void 0,(function*(){if(0===this.actions.length){if(!this.id)return(yield this.datastore.actions()).find((t=>t.displayId.trim().toLowerCase()===e.trim().toLocaleLowerCase()));this.ignoreFieldUpdate=!0,yield this.fetch(),this.ignoreFieldUpdate=!1}return this.actions.find((t=>t.displayId.trim().toLowerCase()===e.trim().toLocaleLowerCase()))}))}comment(){return new a.default({item:this})}_setStatus(e){if(0!==this.statuses.length)if("string"==typeof e){const e=Object.keys(this.fields).find((e=>"status"===this.datastore.fieldSync(e).dataType));e&&(this._status=this.statuses.find((t=>t.id===this.fields[e]))),delete this.fields[e]}else this._status=e}histories(e){return s(this,void 0,void 0,(function*(){return(yield this.historiesWithUnread()).histories}))}historiesWithUnread(e){return s(this,void 0,void 0,(function*(){const t={projectId:this.datastore.project.id,datastoreId:this.datastore.id,itemId:this.id,getHistoryParamQueries:e},i=yield this.request(o.ITEM_HISTORIES,t),s=i.getHistories.histories.map((e=>a.default.fromJson(Object.assign({item:this},e))));return{unread:i.getHistories.unread,histories:s}}))}links(e){return s(this,void 0,void 0,(function*(){const t=yield this.request(o.ITEM_LINKED,{datastoreId:this.datastore.id,itemId:this.id,linkedDatastoreId:"string"==typeof e?e:e.id});if(0===t.datastoreGetLinkedItems.items.length)return[];const i=yield f.client.currentWorkspace.projects(),s=[];for(const r of t.datastoreGetLinkedItems.items){const t=i.find((e=>e.id===r.p_id)),n="string"==typeof e?yield t.datastore(r.d_id):e;s.push(yield n.item(r.i_id))}return yield Promise.all(s.map((e=>e.fetch()))),s}))}file(){return new h.default({item:this})}subscribe(e,t){var i,r;return s(this,void 0,void 0,(function*(){yield f.client.connectPubSub();const s=this.getEventName(e);null===(i=f.client.connection)||void 0===i||i.on(s,(e=>{const i=_.default.fromJson(e);t(i)})),null===(r=f.client.connection)||void 0===r||r.on("messagereceived",(e=>{e.ok}))}))}unsubscribe(){return s(this,void 0,void 0,(function*(){return yield f.client.closePubSub(),!0}))}getEventName(e){if("UPDATE"===e.toUpperCase()){const e=f.client.currentUser;return`item_view_${this.id}_${null==e?void 0:e.id}`}return""}}t.default=f},3830:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"action_id":this.id=t;break;case"display_id":this.displayId=t;break;case"action_name":this.name=t;break;case"display_order":this.displayOrder=t;break;case"crud_type":this.crudType=t;break;case"item":this.item=t}return this}}t.default=r},3873:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=r(i(3250)),a=i(3697);class c extends n.HxbAbstract{constructor(e){super(e),this.user=new o.default}set(e,t){switch(e){case"history_id":this.id=t;break;case"item":this.item=t;break;case"display_order":this.displayOrder=t;break;case"comment":this.comment=t;break;case"is_unread":this.isUnread=t;break;case"created_at":this.createdAt=new Date(t);break;case"action_id":this.actionId=t;break;case"action_name":this.actionName=t;break;case"transaction_id":this.transactionId=t;break;case"action_operation":this.actionOperation=t;break;case"is_status_action":this.isStatusAction=t;break;case"UserObjID":case"user_id":this.user.id=t;break;case"user":this.user=new o.default({id:t});break;case"updated_by":this.updatedBy=t;break;case"updated_at":this.updatedAt=new Date(t);break;case"media_link":this.mediaLink=t;break;case"is_updated":this.isUpdated=t;break;case"email":this.user.email=t;break;case"username":this.user.userName=t;break;case"datastore_name":case"datastore_id":case"i_id":case"item_id":case"project_id":case"workspace_id":default:break;case"is_fetchreplymail":this.isFetchreplymail=t;break;case"IsChanged":this.isChanged=t;break;case"post_for_rel":this.postForRel=t;break;case"post_mode":this.postMode=t}return this}save(){return s(this,void 0,void 0,(function*(){return this.id?this.update():this.create()}))}create(e=!0){return s(this,void 0,void 0,(function*(){const t={workspace_id:c.client.currentWorkspace.id,project_id:this.item.datastore.project.id,datastore_id:this.item.datastore.id,item_id:this.item.id,post_mode:"",comment:this.comment};e&&(t.is_send_item_unread=!0);const i=yield this.request(a.POST_NEW_ITEM_HISTORY,{payload:t});return this.sets(i.postNewItemHistory.item_history),!0}))}update(){return s(this,void 0,void 0,(function*(){const e={p_id:this.item.datastore.project.id,d_id:this.item.datastore.id,i_id:this.item.id,h_id:this.id,comment:this.comment};return!(yield this.request(a.POST_UPDATE_ITEM_HISTORY,{payload:e})).postUpdateItemHistory.error}))}delete(){return s(this,void 0,void 0,(function*(){const e={p_id:this.item.datastore.project.id,d_id:this.item.datastore.id,i_id:this.item.id,h_id:this.id};return!(yield this.request(a.POST_DELETE_ITEM_HISTORY,{payload:e})).archiveItemHistory.error}))}}t.default=c},4218:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"status_id":this.id=t;break;case"display_id":this.displayId=t;break;case"status_name":this.name=t;break;case"item":this.item=t}return this}}t.default=r},1353:function(e,t,i){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9868),n=s(i(3250));class o extends r.HxbAbstract{constructor(e){super(),this.user=new n.default}set(e,t){switch(e){case"item":this.item=t||void 0;case"_id":this.id=t||"";break;case"user_id":this.user.id=t||"";break;case"user_obj_id":break;case"username":this.user.userName=t||"";break;case"email":this.user.email=t||"";break;case"actionname":this.actionname=t||"";break;case"comment":this.comment=t||"";break;case"post_mode":this.postMode=t||"";break;case"post_for_rel":this.postForEel=t||!1;break;case"ischanged":this.isChanged=t||!1;break;case"is_fetchreplymail":this.isFetchreplymail=t||!1;break;case"file_ids":this.fileIds=t||[];break;case"created_at":this.createdAt=t?new Date(t):void 0;break;case"displayorder":this.displayorder=t||0;break;case"is_notify":this.isNotify=t||!1;break;case"isnotifytosender":this.isNotifyToSender=t||!1;break;case"issenditemunread":this.isSendItemUnread=t||!1}return this}}t.default=o},9858:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"default":this.default=t;break;case"lang_cd":this.langCd=t;break;case"use":this.use=t}return this}}t.default=r},7911:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const r=i(3697),n=i(9868);class o extends n.HxbAbstract{constructor(){super(...arguments),this.saved=!1}set(e,t){switch(e){case"item":this.item=t;break;case"linkedItem":this.linkedItem=t;break;case"saved":this.saved=t}return this}create(){return s(this,void 0,void 0,(function*(){if(this.saved)return!0;const e={projectId:this.item.datastore.project.id,datastoreId:this.item.datastore.id,itemId:this.item.id,itemLinkRequestInput:{link_datastore_id:this.linkedItem.datastore.id,link_item_id:this.linkedItem.id}},t=yield this.request(r.ADD_ITEM_LINK,e);return this.saved=!0,t.addItemLink.success}))}delete(){return s(this,void 0,void 0,(function*(){if(this.saved)return!0;const e={projectId:this.item.datastore.project.id,datastoreId:this.item.datastore.id,itemId:this.item.id,itemLinkRequestInput:{link_datastore_id:this.linkedItem.datastore.id,link_item_id:this.linkedItem.id}},t=yield this.request(r.DELETE_ITEM_LINK,e);return this.saved=!0,t.deleteItemLink.success}))}}t.default=o},514:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"expired_day":this.expiredDay=t;break;case"min_length":this.minLength=t;break;case"lockout_time":this.lockoutTime=t;break;case"lockout_count":this.lockoutCount=t;break;case"use_same_limit":this.useSameLimit=t;break;case"use_pattern_check":this.usePatternCheck=t;break;case"use_min_length":this.useMinLength=t;break;case"use_lockout_time":this.useLockoutTime=t;break;case"use_lockout_count":this.useLockoutCount=t;break;case"use_language_ja":this.useLanguageJa=t;break;case"use_language_en":this.useLanguageEn=t;break;case"use_expired_day":this.useExpiredDay=t;break;case"same_limit":this.sameLimit=t;break;case"pattern_check_type":this.patternCheckType=t}return this}}t.default=r},7437:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=i(9127),a=r(i(1210)),c=r(i(5937)),d=r(i(603));class u extends n.HxbAbstract{constructor(){super(...arguments),this._datastores=[],this._roles=[]}set(e,t){switch(e){case"application_id":case"p_id":case"id":t&&(this.id=t);break;case"name":this.name=t;break;case"display_id":this.displayId=t;break;case"theme":this.theme=t;break;case"display_order":this.displayOrder=t;break;case"workspace":this.workspace=t;break;case"datastores":if(!t)break;this._datastores=t.map((e=>a.default.fromJson(Object.assign({project:this},e))));break;case"template_id":this.templateId=t}return this}static all(e){return s(this,void 0,void 0,(function*(){return(yield this.request(o.GET_APPLICATIONS,{workspaceId:e.id})).getApplications.map((t=>u.fromJson(Object.assign({workspace:e},t))))}))}datastores(){return s(this,void 0,void 0,(function*(){return this._datastores.length>0||(this._datastores=yield a.default.all({project:this})),this._datastores}))}roles(){return s(this,void 0,void 0,(function*(){return this._roles.length>0||(this._roles=yield d.default.all(this)),this._roles}))}datastore(e){return s(this,void 0,void 0,(function*(){if(!e)return new a.default({project:this,id:e});0===this._datastores.length&&(yield this.datastores());const t=this._datastores.find((t=>t.id===e||t.displayId===e||"string"==typeof t.name&&t.name===e?t:"object"!=typeof t.name||t.name.ja!==e&&t.name.en!==e?void 0:t));if(!t)throw new Error(`Datastore ${e} not found`);return yield t.fetch(),t}))}datastoreSync(e){if(!e)return new a.default({project:this,id:e});const t=this._datastores.find((t=>t.id===e||t.displayId===e));if(!t)throw new Error(`Datastore ${e} not found`);return t}reports(){return s(this,void 0,void 0,(function*(){return c.default.all(this)}))}static allWithDatastores(e){return s(this,void 0,void 0,(function*(){const t=(yield this.request(o.GET_APPLICATION_AND_DATASTORE,{workspaceId:e.id})).getApplicationAndDataStore.map((t=>u.fromJson(Object.assign({workspace:e},t)))),i=[];return t.forEach((e=>{i.push(...e._datastores)})),{projects:t,datastores:i}}))}save(){return s(this,void 0,void 0,(function*(){return this.id?this.update():this.create()}))}create(){return s(this,void 0,void 0,(function*(){if("string"==typeof this.name)throw new Error("name Japanese and English are required");const e={name:this.name};this.templateId&&(e.tp_id=this.templateId);const t=yield this.request(o.APPLICATION_CREATE_PROJECT,{createProjectParams:e});return this.id=t.applicationCreateProject.project_id,!0}))}update(){return s(this,void 0,void 0,(function*(){if("string"==typeof this.name)throw new Error("name Japanese and English are required");const e={project_id:this.id,project_name:this.name,project_displayid:this.displayId,theme:this.theme};return(yield this.request(o.UPDATE_PROJECT_NAME,{payload:e})).updateProjectName.success}))}fetch(){return s(this,void 0,void 0,(function*(){const e=yield this.request(o.GET_INFO_PROJECT,{projectId:this.id});return this.sets(e.getInfoProject),!0}))}delete(){return s(this,void 0,void 0,(function*(){const e={project_id:this.id};return(yield this.request(o.DELETE_PROJECT,{payload:e})).deleteProject.success}))}execute(e,t={}){return s(this,void 0,void 0,(function*(){return this.rest("POST",`/api/v0/applications/${this.id}/functions/${e}`,{},t)}))}}t.default=u},2217:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"redirect_url":this.redirectUrl=t;break;case"is_apply_redirect_url_for_disabled_users":this.isApplyRedirectUrlForDisabledUsers=t}return this}}t.default=r},5937:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9868),n=i(1608);class o extends r.HxbAbstract{constructor(){super(...arguments),this._data=[]}set(e,t){switch(e){case"project":this.project=t;break;case"rp_id":case"id":this.id=t;break;case"title":this.title=t;break;case"display_order":this.displayOrder=t;break;case"hide_menu":this.hideMenu=t}return this}static all(e){return s(this,void 0,void 0,(function*(){return(yield this.request(n.GET_REPORTS,{projectId:e.id})).getReports.map((t=>o.fromJson(Object.assign({project:e},t))))}))}data({page:e=1,perPage:t=0,total:i=!0}={}){return s(this,void 0,void 0,(function*(){if(this._data.length>0)return this._data;const s={include_date_at:!0,include_lookups:!0,include_item_ref:!0,return_number_value:!0,page:e,per_page:t,return_utc_datetime:!0,omit_total_items:i},r=yield this.request(n.REPORT_DEFAULT,{projectId:this.project.id,reportId:this.id,reportDataPayload:s});return this._data=r.reportData.report_results,this._data}))}}t.default=o},603:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9127),o=i(9868),a=r(i(3250));class c extends o.HxbAbstract{static all(e){return s(this,void 0,void 0,(function*(){const t={project_id:e.id,workspace_id:e.workspace.id};return(yield c.request(n.PROJECT_ROLES_AND_MEMBER,t)).getProjectRolesAndMember.map((t=>c.fromJson(Object.assign({project:e},t))))}))}set(e,t){switch(e){case"_key":case"id":case"r_id":this.id=t;break;case"display_id":this.displayId=t;break;case"name":this.name=t;break;case"type":this.type=t;break;case"members":this.members=t.map((e=>a.default.fromJson(e)));break;case"project":this.project=t;break;case"created_at":this.createdAt=new Date(t);break;case"access_key":this.accessKey=t;break;case"project_id":break;default:throw new Error(`Unknown key: ${e}`)}return this}}t.default=c},8609:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"status_id":this.id=t;break;case"display_id":this.displayId=t;break;case"name":this.name=t;break;case"displayed_name":this.displayedName=t;break;case"sort_id":this.sortId=t;break;case"x":this.x=t;break;case"y":this.y=t}return this}}t.default=r},2830:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"action_id":this.id=t;break;case"display_id":this.displayId=t;break;case"action_name":this.name=t;break;case"display_order":this.displayOrder=t;break;case"crud_type":this.crudType=t;break;case"item":this.item=t;break;case"next_status_id":this.nextStatusId=t}return this}}t.default=r},6001:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=r(i(6653)),a=i(9127);class c extends n.HxbAbstract{constructor(e){super(),this.category=e}set(e,t){switch(e){case"tp_id":this.id=t;break;case"name":this.name=t;break;case"description":this.description=t}return this}static all(){return s(this,void 0,void 0,(function*(){return(yield this.request(a.GET_TEMPLATES)).getTemplates.categories.map((e=>o.default.fromJson(Object.assign({project:this},e))))}))}}t.default=c},6653:function(e,t,i){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9868),n=s(i(6001));class o extends r.HxbAbstract{constructor(e){super(),this.project=e}set(e,t){switch(e){case"category":this.name=t;break;case"templates":this.templates=t.map((e=>n.default.fromJson(Object.assign({project:this.project},e))))}return this}}t.default=o},3250:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(5299),o=i(9868),a=r(i(5517));class c extends o.HxbAbstract{set(e,t){switch(e){case"user_name":case"username":this.userName=t;break;case"user_code":this.code=t;break;case"access_key":this.accessKey=t;break;case"email":this.email=t;break;case"user_id":case"u_id":this.id=t;break;case"profile_pic":this.profilePicture=t;break;case"current_workspace_id":this.currentWorkspace=new a.default(t);break;case"is_ws_admin":this.isWorkspaceAdmin=t;break;case"media_link":this.mediaLink=t}return this}static register(e){return s(this,void 0,void 0,(function*(){const t=yield this.request(n.USER_REGISTER,{confirmationId:e});return new c(t.userRegister.user)}))}static registerConfirm(e){return s(this,void 0,void 0,(function*(){return(yield this.rest("post","/api/v0/users/registration/confirm",{},e)).token}))}passwordExpired(){return s(this,void 0,void 0,(function*(){return(yield this.request(n.USER_PASSWORD_EXPIRY)).userPasswordExpiry.is_expired}))}static confirm(e){return s(this,void 0,void 0,(function*(){return(yield this.request(n.USER_CONFIRMATIONS,{confirmationId:e})).userConfirmations.user}))}static current(){return s(this,void 0,void 0,(function*(){const e=yield this.request(n.USER_INFO);return c.fromJson(e.userInfo)}))}invite(e){return s(this,void 0,void 0,(function*(){const t={postInviteUsers:void 0,error:void 0};try{const i=yield this.request(n.POST_INVITE_USERS,{payload:e});t.postInviteUsers=null==i?void 0:i.postInviteUsers}catch(e){t.error=JSON.stringify(e.response.errors)}return t}))}}t.default=c},2786:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"can_execute":this.canExecute=t;break;case"can_use":this.canUse=t;break;case"type":this.type=t;break;case"name":this.name=t;break;case"display_id":this.displayId=t;break;case"role_id":this.id=t}return this}}t.default=r},7601:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"use":this.use=t;break;case"default":this.default=t;break;case"session_timeout_sec":this.sessionTimeoutSec=t}return this}}t.default=r},5517:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=r(i(7437)),a=i(9704),c=r(i(9858)),d=r(i(514)),u=r(i(2217)),l=r(i(8455)),h=r(i(1339)),p=r(i(3250)),_=r(i(7601)),f=r(i(9583)),m=r(i(9192)),y=r(i(6001));class g extends n.HxbAbstract{constructor(){super(...arguments),this._groups=[],this._projects=[]}static all(){return s(this,void 0,void 0,(function*(){return(yield g.allWithCurrent()).workspaces}))}static get(e){return s(this,void 0,void 0,(function*(){e&&(yield this._current(e));const t=yield this.request(a.WORKSPACE_DETAIL);return g.fromJson(t.workspace)}))}static current(e){return s(this,void 0,void 0,(function*(){if(e&&!(yield this._current(e)))throw new Error("Set current workspace failed");const t=yield this.get();return e&&t.set("w_id",e),t}))}static _current(e){return s(this,void 0,void 0,(function*(){return(yield this.request(a.SET_CURRENT_WORKSPACE,{setCurrentWorkSpaceInput:{workspace_id:e}})).setCurrentWorkSpace.success}))}static allWithCurrent(){return s(this,void 0,void 0,(function*(){const e=yield this.request(a.WORKSPACES),{workspaces:t,current_workspace_id:i}=e.workspaces,s=t.map((e=>g.fromJson(e)));return{workspaces:s,workspace:s.find((e=>e.id===i))}}))}set(e,t){if(!t)return this;switch(e){case"w_id":case"workspace_id":this.id=t;break;case"ws_key":this.wsKey=t;break;case"workspace_name":case"name":this.name=t;break;case"app_functions":this.appFunctions=m.default.fromJson(t);break;case"created_at":this.createdAt=new Date(t);break;case"updated_at":this.updatedAt=new Date(t);break;case"plan_name":this.planName=t;break;case"plan_id":this.planId=t;break;case"languages":this.languages=t.map((e=>c.default.fromJson(e)));break;case"pwd_policy":this._passwordPolicy=d.default.fromJson(t);break;case"redirect":this.redirect=u.default.fromJson(t);break;case"user_id":this.userId=t;break;case"ws_admin":this.wsAdmin=t;break;case"user_sessions":this.userSession=_.default.fromJson(t);break;case"ws_admin_users":this.workspaceAdminUsers=t.map((e=>p.default.fromJson(e)));break;case"ws_functions":this.workspaceFunction=l.default.fromJson(t),this.workspaceFunction.workspace=this;break;case"ws_usage":this.workspaceUsage=h.default.fromJson(t),this.workspaceUsage.workspace=this}return this}fetch(){return s(this,void 0,void 0,(function*(){yield g.current(this.id);const e=yield this.request(a.WORKSPACE_DETAIL);return this.sets(e.workspace),!0}))}passwordPolicy(){return s(this,void 0,void 0,(function*(){const e=yield this.request(a.WORKSPACE_PASSWORD_POLICY,{workingspaceId:this.id});return this._passwordPolicy=d.default.fromJson(e.workspacePasswordPolicy),this._passwordPolicy}))}functionality(){return s(this,void 0,void 0,(function*(){const e=yield this.request(a.WORKSPACE_FUNCTIONALITY,{workingspaceId:this.id});return this.workspaceFunction||(this.workspaceFunction=new l.default(this)),this.workspaceFunction=l.default.fromJson(Object.assign({workspace:this},e.workspaceFunctionality)),this.workspaceFunction}))}usage(){return s(this,void 0,void 0,(function*(){const e=yield this.request(a.WORKSPACE_USAGE,{workingspaceId:this.id});return this.workspaceUsage=h.default.fromJson(Object.assign({workspace:this},e.workspaceUsage.usage)),this.workspaceUsage}))}groups(){return s(this,void 0,void 0,(function*(){return this._groups.length>0||(this._groups=yield f.default.all(this)),this._groups}))}group(e){return s(this,void 0,void 0,(function*(){if(!e)return new f.default({workspace:this});0===this._groups.length&&(yield this.groups());const t=this._groups.find((t=>t.id===e||t.name===e||t.displayId===e));if(!t)throw new Error(`No such group ${e}`);return t}))}save(){return s(this,void 0,void 0,(function*(){if(this.id)throw new Error("Currently, workspace updating is not support.");return this.create()}))}create(){var e,t;return s(this,void 0,void 0,(function*(){const i={name:this.name},s=yield this.request(a.CREATE_WORKSPACE,{createWorkSpaceInput:i});return!!(null===(e=s.createWorkspace)||void 0===e?void 0:e.w_id)&&(this.id=null===(t=s.createWorkspace)||void 0===t?void 0:t.w_id,!0)}))}toJson(){const e={w_id:this.id,id:this.id};return this.name&&(e.name=this.name),this.planId&&(e.plan_id=this.planId),this.planName&&(e.plan_name=this.planName),this.userId&&(e.user_id=this.userId),e}archive(){return s(this,void 0,void 0,(function*(){const e={w_id:this.id,archived:!0};return!(yield this.request(a.ARCHIVE_WORKSPACE,{payload:e})).error}))}project(e){return s(this,void 0,void 0,(function*(){if(!e)return new o.default({workspace:this});0===this._projects.length&&(yield this.projects());const t=this._projects.find((t=>t.id===e||t.name===e||t.displayId===e));if(!t)throw new Error(`No such project ${e}`);return yield t.fetch(),t}))}projects(){return s(this,void 0,void 0,(function*(){return this._projects.length>0||(this._projects=yield o.default.all(this)),this._projects}))}projectsAndDatastores(){return o.default.allWithDatastores(this)}projectTemplates(){return y.default.all()}invite(e,t={}){return s(this,void 0,void 0,(function*(){return g.client.invite(e,t,this)}))}}t.default=g},8455:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{constructor(){super(...arguments),this.wsSettings={},this.taskQueue={},this.newWorkspaces={},this.groupSettings={},this.developerFunctions={},this.wsFunctions={},this.appFunctions={}}set(e,t){switch(e){case"workspace":this.workspace=t;break;case"ws_settings":this.wsSettings.disableArchive=t.disable_archive,this.wsSettings.disableChangeName=t.disable_change_name,this.wsSettings.disableChangeLogo=t.disable_change_logo,this.wsSettings.disableGlobalSearch=t.disable_global_search,this.wsSettings.disablePasswordPolicy=t.disable_password_policy,this.wsSettings.disableManageAdmins=t.disable_manage_admins;break;case"task_queue":this.taskQueue.showTaskList=t.show_task_list;break;case"new_workspaces":this.newWorkspaces.newWorkspace=t.new_workspace;break;case"group_settings":this.groupSettings.disableGroupImport=t.disable_group_import,this.groupSettings.disableUserImport=t.disable_user_import,this.groupSettings.disableNewGroup=t.disable_new_group,this.groupSettings.disableGroupRoles=t.disable_group_roles;break;case"developer_functions":this.developerFunctions.disableBeta=t.disable_beta,this.developerFunctions.disableGenerateToken=t.disable_generate_token,this.developerFunctions.disableDeveloperMode=t.disable_developer_mode,this.developerFunctions.showAccessKeys=t.show_access_keys;break;case"ws_functions":this.wsFunctions.useGlobalSearch=t.use_global_search,this.wsFunctions.useBeta=t.use_beta,this.wsFunctions.usePasswordPolicy=t.use_password_policy,this.wsFunctions.useCreateWorkspace=t.use_create_workspace;break;case"app_functions":this.appFunctions.useDashboards=t.use_dashboards,this.appFunctions.useQueries=t.use_queries,this.appFunctions.useCreateApplication=t.use_create_application,this.appFunctions.useReports=t.use_reports}return this}}t.default=r},1339:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(9868);class r extends s.HxbAbstract{set(e,t){switch(e){case"workspace":this.workspace=t;break;case"users_limit":this.usersLimit=t;break;case"items_limit":this.itemsLimit=t;break;case"storage":this.storage=t;break;case"storage_limit":this.storageLimit=t;break;case"users":this.users=t;break;case"datastores":this.datastores=t;break;case"datastores_limit":this.datastoresLimit=t;break;case"items":this.items=t}return this}}t.default=r},1556:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static or(e){const t={};return t.conditions=[...e],t.use_or_condition=!0,t}static and(...e){const t={};return e&&(t.conditions=[...e]),t}static equalTo(e,t){const i={};return i.id=e,i.search_value=t.toString().split(","),i.exact_match=!0,i}static greaterThanOrEqualTo(e,t){const i={},s=t.toString().split(",");return s.push(null),i.id=e,i.search_value=s,i}static lessThan(e,t){const i={},s=t.toString().split(",");return s.unshift(null),i.id=e,i.search_value=s,i}static include(e,t){const i={};return i.id=e,i.search_value=t.toString().split(","),i}static notInclude(e,t){const i={};return i.id=e,i.search_value=t.toString().split(","),i.not_match=!0,i}static inArray(e,t){const i={};return i.id=e,i.search_value=t,i.exact_match=!0,i}static notInArray(e,t){const i={};return i.id=e,i.search_value=t,i.exact_match=!0,i.not_match=!0,i}}},9745:function(e,t,i){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9868),n=s(i(2041)),o=s(i(1556));class a extends r.HxbAbstract{constructor(){super(...arguments),this.condition=o.default}set(e,t){switch(e){case"projectId":this.projectId=t;break;case"datastoreId":this.datastoreId=t}return this}from(e){return this.set("datastoreId",e),new n.default({queryClient:this})}query(){return new n.default({queryClient:this})}}t.default=a},2041:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{c(s.next(e))}catch(e){n(e)}}function a(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(9868),o=r(i(5286)),a=r(i(7437));class c extends n.HxbAbstract{constructor(){super(...arguments),this.conditions={},this.query={page:1,per_page:0},this.useDisplayId=!0}set(e,t){return"queryClient"===e&&(this.queryClient=t),this}select(e,t={}){return s(this,void 0,void 0,(function*(){"*"!==e&&("string"==typeof e?this.query.select_fields=(null!=e?e:"*").split(",").map((e=>e.trim())):Array.isArray(e)&&(this.query.select_fields=e));const{items:i}=yield this._execute(t);return i}))}where(e){return Array.isArray(e)||(e=[e]),this.query.conditions=[...e],this}order(e){const t=[];return Object.entries(e).map((([e,i])=>{t.push({id:e,order:i})})),this.query.sort_fields=t,this}limit(e){return this.query.per_page=e,this}offset(e){return this.query.page=e,this}perPage(e){return this.query.per_page=e,this}page(e){return this.query.page=e,this}count(){return s(this,void 0,void 0,(function*(){const{totalCount:e}=yield this._execute();return e}))}_execute(e={}){var t;return s(this,void 0,void 0,(function*(){const i=yield null===(t=c.client.currentWorkspace)||void 0===t?void 0:t.project(this.queryClient.projectId),s=yield null==i?void 0:i.datastore(this.queryClient.datastoreId),r=this._baseParams();return this.query.conditions&&(r.conditions=this.query.conditions),this.query.select_fields&&(r.select_fields=this.query.select_fields),o.default.searchWithCount(r,s,e)}))}_baseParams(){return{page:this.query.page,per_page:this.query.per_page,datastore_id:this.queryClient.datastoreId,project_id:this.queryClient.projectId}}insert(e){return s(this,void 0,void 0,(function*(){return Array.isArray(e)?Promise.all(e.map((e=>this._insert(e)))):this._insert(e)}))}_insert(e){return s(this,void 0,void 0,(function*(){const t=new a.default({id:this.queryClient.projectId}),i=yield t.datastore(this.queryClient.datastoreId),s=yield i.item();return new Promise(((t,i)=>{s.sets(e),s.save().then((()=>t(s))).catch(i)}))}))}update(e){return s(this,void 0,void 0,(function*(){this.limit(0).page(1);const t=yield this.select();return yield Promise.all(t.map((t=>this._update(t,e))))}))}_update(e,t){return s(this,void 0,void 0,(function*(){return new Promise(((i,r)=>s(this,void 0,void 0,(function*(){e.sets(t),e.save().then((()=>i(e))).catch(r)}))))}))}delete(){return s(this,void 0,void 0,(function*(){this.limit(0).page(1);const e=yield this.select();return yield Promise.all(e.map((e=>e.delete()))),!0}))}}t.default=c},7159:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(2844),t)},2844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7771:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(7770),t),r(i(1571),t)},7770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetFieldAutoNumberQuery=void 0,t.GetFieldAutoNumberQuery=class{}},1571:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5053:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(8495),t)},8495:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.DataType=void 0,(i=t.DataType||(t.DataType={})).TEXT="text",i.NUMBER="number",i.STATUS="status",i.AUTONUM="autonum",i.TEXTAREA="textarea",i.SELECT="select",i.FILE="file",i.RADIO="radio",i.CHECKBOX="checkbox",i.CALC="calc",i.DATETIME="datetime",i.USERS="users",i.DSLOOKUP="dslookup",i.LABEL="label",i.SEPARATOR="separator"},1580:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(2167),t)},2167:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2559:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(1684),t),r(i(2170),t)},1684:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2170:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7539:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(7326),t),r(i(5966),t)},7326:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5966:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6475:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(7159),t),r(i(1799),t),r(i(765),t),r(i(7771),t),r(i(1965),t),r(i(8019),t),r(i(4913),t),r(i(7224),t),r(i(2559),t),r(i(1580),t),r(i(5053),t),r(i(7539),t),r(i(900),t)},7224:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(1936),t),r(i(2859),t)},1936:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2859:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemHistoryComment=void 0,t.ItemHistoryComment=class{}},1965:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(5004),t),r(i(148),t)},5004:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},148:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DtTemplates=t.Templates=t.Categories=t.FieldTemplates=t.Application=void 0,t.Application=class{},t.FieldTemplates=class{},t.Categories=class{},t.Templates=class{},t.DtTemplates=class{}},765:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(8406),t),r(i(4705),t)},8406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},900:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(2353),t)},2353:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8019:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(6639),t)},6639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1799:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(3921),t),r(i(1866),t)},3921:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4913:function(e,t,i){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(1328),t),r(i(1932),t)},1328:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuid=void 0,t.uuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}return i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(341)})()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment