@openeo/js-client 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openeo.d.ts CHANGED
@@ -86,6 +86,13 @@ declare namespace OpenEO {
86
86
  * @param {?string} token
87
87
  */
88
88
  setToken(token: string | null): void;
89
+ /**
90
+ * Tries to resume an existing session.
91
+ *
92
+ * @param {...any} args
93
+ * @returns {boolean} `true` if the session could be resumed, `false` otherwise
94
+ */
95
+ resume(...args: any[]): boolean;
89
96
  /**
90
97
  * Abstract method that extending classes implement the login process with.
91
98
  *
@@ -530,10 +537,18 @@ declare namespace OpenEO {
530
537
  * @type {string | null}
531
538
  */
532
539
  clientId: string | null;
540
+ /**
541
+ * The client secret to use for authentication.
542
+ *
543
+ * Only used for the `client_credentials` grant type.
544
+ *
545
+ * @type {string | null}
546
+ */
547
+ clientSecret: string | null;
533
548
  /**
534
549
  * The grant type (flow) to use for this provider.
535
550
  *
536
- * Either "authorization_code+pkce" (default) or "implicit"
551
+ * Either "authorization_code+pkce" (default), "implicit" or "client_credentials"
537
552
  *
538
553
  * @type {string}
539
554
  */
@@ -569,12 +584,27 @@ declare namespace OpenEO {
569
584
  * @type {Array.<OidcClient>}
570
585
  */
571
586
  defaultClients: Array<OidcClient>;
587
+ /**
588
+ * Additional parameters to include in authorization requests.
589
+ *
590
+ * As defined by the API, these parameters MUST be included when
591
+ * requesting the authorization endpoint.
592
+ *
593
+ * @type {object.<string, *>}
594
+ */
595
+ authorizationParameters: Record<string, any>;
572
596
  /**
573
597
  * The detected default Client.
574
598
  *
575
599
  * @type {OidcClient}
576
600
  */
577
601
  defaultClient: OidcClient;
602
+ /**
603
+ * The cached OpenID Connect well-known configuration document.
604
+ *
605
+ * @type {object.<string, *> | null}
606
+ */
607
+ wellKnownDocument: Record<string, any> | null;
578
608
  /**
579
609
  * Adds a listener to one of the following events:
580
610
  *
@@ -598,7 +628,8 @@ declare namespace OpenEO {
598
628
  /**
599
629
  * Authenticate with OpenID Connect (OIDC).
600
630
  *
601
- * Supported only in Browser environments.
631
+ * Supported in Browser environments for `authorization_code+pkce` and `implicit` grants.
632
+ * The `client_credentials` grant is supported in all environments.
602
633
  *
603
634
  * @async
604
635
  * @param {object.<string, *>} [options={}] - Object with authentication options.
@@ -609,6 +640,53 @@ declare namespace OpenEO {
609
640
  * @see {OidcProvider#refreshTokenScope}
610
641
  */
611
642
  login(options?: Record<string, any>, requestRefreshToken?: boolean): Promise<void>;
643
+ /**
644
+ * Authenticate using the OIDC Client Credentials grant.
645
+ *
646
+ * Requires `clientId` and `clientSecret` to be set.
647
+ * This flow does not use the oidc-client library and works in all environments.
648
+ *
649
+ * @async
650
+ * @protected
651
+ * @returns {Promise<void>}
652
+ * @throws {Error}
653
+ */
654
+ protected loginClientCredentials(): Promise<void>;
655
+ /**
656
+ * Retrieves the OpenID Connect well-known configuration document.
657
+ *
658
+ * @async
659
+ * @returns {Promise<object.<str, *>> | null} The well-known configuration document, or `null` if the issuer URL is not set.
660
+ */
661
+ getWellKnownDocument(): Promise<Record<string, any>> | null;
662
+ /**
663
+ * Discovers the token endpoint from the OpenID Connect issuer.
664
+ *
665
+ * @async
666
+ * @protected
667
+ * @returns {Promise<string>} The token endpoint URL.
668
+ * @throws {Error}
669
+ */
670
+ protected getTokenEndpoint(): Promise<string>;
671
+ /**
672
+ * Checks whether the OpenID Connect provider supports the Client Credentials grant.
673
+ *
674
+ * @async
675
+ * @returns {Promise<boolean|null>} `true` if the Client Credentials grant is supported, `false` otherwise. `null` if unknown.
676
+ */
677
+ supportsClientCredentials(): Promise<boolean | null>;
678
+ /**
679
+ * Restores a previously established OIDC session from storage.
680
+ *
681
+ * Not supported for the `client_credentials` grant as credentials
682
+ * are not persisted. Use `login()` to re-authenticate instead.
683
+ *
684
+ * @async
685
+ * @param {object.<string, *>} [options={}] - Additional options passed to the OIDC UserManager.
686
+ * @returns {Promise<boolean>} `true` if the session could be resumed, `false` otherwise.
687
+ * @see https://github.com/IdentityModel/oidc-client-js/wiki#usermanager
688
+ */
689
+ resume(options?: Record<string, any>): Promise<boolean>;
612
690
  /**
613
691
  * Returns the options for the OIDC client library.
614
692
  *
@@ -644,6 +722,14 @@ declare namespace OpenEO {
644
722
  * @param {string | null} clientId
645
723
  */
646
724
  setClientId(clientId: string | null): void;
725
+ /**
726
+ * Sets the Client Secret for OIDC authentication.
727
+ *
728
+ * Only used for the `client_credentials` grant type.
729
+ *
730
+ * @param {string | null} clientSecret
731
+ */
732
+ setClientSecret(clientSecret: string | null): void;
647
733
  /**
648
734
  * Sets the OIDC User.
649
735
  *
package/openeo.js CHANGED
@@ -2149,6 +2149,17 @@ class AuthProvider {
2149
2149
  }
2150
2150
  }
2151
2151
 
2152
+ /**
2153
+ * Tries to resume an existing session.
2154
+ *
2155
+ * @param {...any} args
2156
+ * @returns {boolean} `true` if the session could be resumed, `false` otherwise
2157
+ */
2158
+ async resume(...args) {
2159
+ // eslint-disable-line no-unused-vars
2160
+ return false;
2161
+ }
2162
+
2152
2163
  /**
2153
2164
  * Abstract method that extending classes implement the login process with.
2154
2165
  *
@@ -6269,6 +6280,7 @@ class OidcProvider extends AuthProvider {
6269
6280
  }
6270
6281
  let providerOptions = provider.getOptions(options);
6271
6282
  let oidc = new Oidc.UserManager(providerOptions);
6283
+ await oidc.clearStaleState();
6272
6284
  return await oidc.signinCallback(url);
6273
6285
  }
6274
6286
 
@@ -6297,10 +6309,19 @@ class OidcProvider extends AuthProvider {
6297
6309
  */
6298
6310
  this.clientId = null;
6299
6311
 
6312
+ /**
6313
+ * The client secret to use for authentication.
6314
+ *
6315
+ * Only used for the `client_credentials` grant type.
6316
+ *
6317
+ * @type {string | null}
6318
+ */
6319
+ this.clientSecret = null;
6320
+
6300
6321
  /**
6301
6322
  * The grant type (flow) to use for this provider.
6302
6323
  *
6303
- * Either "authorization_code+pkce" (default) or "implicit"
6324
+ * Either "authorization_code+pkce" (default), "implicit" or "client_credentials"
6304
6325
  *
6305
6326
  * @type {string}
6306
6327
  */
@@ -6358,6 +6379,13 @@ class OidcProvider extends AuthProvider {
6358
6379
  * @type {OidcClient}
6359
6380
  */
6360
6381
  this.defaultClient = this.detectDefaultClient();
6382
+
6383
+ /**
6384
+ * The cached OpenID Connect well-known configuration document.
6385
+ *
6386
+ * @type {object.<string, *> | null}
6387
+ */
6388
+ this.wellKnownDocument = null;
6361
6389
  }
6362
6390
 
6363
6391
  /**
@@ -6391,7 +6419,8 @@ class OidcProvider extends AuthProvider {
6391
6419
  /**
6392
6420
  * Authenticate with OpenID Connect (OIDC).
6393
6421
  *
6394
- * Supported only in Browser environments.
6422
+ * Supported in Browser environments for `authorization_code+pkce` and `implicit` grants.
6423
+ * The `client_credentials` grant is supported in all environments.
6395
6424
  *
6396
6425
  * @async
6397
6426
  * @param {object.<string, *>} [options={}] - Object with authentication options.
@@ -6405,6 +6434,9 @@ class OidcProvider extends AuthProvider {
6405
6434
  if (!this.issuer || typeof this.issuer !== 'string') {
6406
6435
  throw new Error("No Issuer URL available for OpenID Connect");
6407
6436
  }
6437
+ if (this.grant === 'client_credentials') {
6438
+ return await this.loginClientCredentials();
6439
+ }
6408
6440
  this.manager = new Oidc.UserManager(this.getOptions(options, requestRefreshToken));
6409
6441
  this.addListener('UserLoaded', async () => this.setUser(await this.manager.getUser()), 'js-client');
6410
6442
  this.addListener('AccessTokenExpired', () => this.setUser(null), 'js-client');
@@ -6415,12 +6447,136 @@ class OidcProvider extends AuthProvider {
6415
6447
  }
6416
6448
  }
6417
6449
 
6450
+ /**
6451
+ * Authenticate using the OIDC Client Credentials grant.
6452
+ *
6453
+ * Requires `clientId` and `clientSecret` to be set.
6454
+ * This flow does not use the oidc-client library and works in all environments.
6455
+ *
6456
+ * @async
6457
+ * @protected
6458
+ * @returns {Promise<void>}
6459
+ * @throws {Error}
6460
+ */
6461
+ async loginClientCredentials() {
6462
+ if (!this.clientId || !this.clientSecret) {
6463
+ throw new Error("Client ID and Client Secret are required for the client credentials flow");
6464
+ }
6465
+ let tokenEndpoint = await this.getTokenEndpoint();
6466
+ let params = new URLSearchParams();
6467
+ params.append('grant_type', 'client_credentials');
6468
+ params.append('client_id', this.clientId);
6469
+ params.append('client_secret', this.clientSecret);
6470
+ params.append('scope', this.scopes.join(' '));
6471
+ let response = await Environment.axios.post(tokenEndpoint, params.toString(), {
6472
+ headers: {
6473
+ 'Content-Type': 'application/x-www-form-urlencoded'
6474
+ }
6475
+ });
6476
+ let data = response.data;
6477
+ let user = new Oidc.User({
6478
+ access_token: data.access_token,
6479
+ token_type: data.token_type || 'Bearer',
6480
+ scope: data.scope || this.scopes.join(' '),
6481
+ expires_at: data.expires_in ? Math.floor(Date.now() / 1000) + data.expires_in : undefined,
6482
+ profile: {}
6483
+ });
6484
+ this.setUser(user);
6485
+ }
6486
+
6487
+ /**
6488
+ * Retrieves the OpenID Connect well-known configuration document.
6489
+ *
6490
+ * @async
6491
+ * @returns {Promise<object.<str, *>> | null} The well-known configuration document, or `null` if the issuer URL is not set.
6492
+ */
6493
+ async getWellKnownDocument() {
6494
+ if (!this.issuer || typeof this.issuer !== 'string') {
6495
+ return null;
6496
+ }
6497
+ if (this.wellKnownDocument === null) {
6498
+ const authority = this.issuer.replace('/.well-known/openid-configuration', '');
6499
+ const discoveryUrl = authority + '/.well-known/openid-configuration';
6500
+ const response = await Environment.axios.get(discoveryUrl);
6501
+ this.wellKnownDocument = response.data;
6502
+ }
6503
+ return this.wellKnownDocument;
6504
+ }
6505
+
6506
+ /**
6507
+ * Discovers the token endpoint from the OpenID Connect issuer.
6508
+ *
6509
+ * @async
6510
+ * @protected
6511
+ * @returns {Promise<string>} The token endpoint URL.
6512
+ * @throws {Error}
6513
+ */
6514
+ async getTokenEndpoint() {
6515
+ const wellKnown = await this.getWellKnownDocument();
6516
+ if (!Utils.isObject(wellKnown) || !wellKnown.token_endpoint) {
6517
+ throw new Error("Unable to discover token endpoint from issuer");
6518
+ }
6519
+ return wellKnown.token_endpoint;
6520
+ }
6521
+
6522
+ /**
6523
+ * Checks whether the OpenID Connect provider supports the Client Credentials grant.
6524
+ *
6525
+ * @async
6526
+ * @returns {Promise<boolean|null>} `true` if the Client Credentials grant is supported, `false` otherwise. `null` if unknown.
6527
+ */
6528
+ async supportsClientCredentials() {
6529
+ try {
6530
+ const wellKnown = await this.getWellKnownDocument();
6531
+ if (!Utils.isObject(wellKnown) || !Array.isArray(wellKnown.grant_types_supported)) {
6532
+ return null;
6533
+ }
6534
+ return wellKnown.grant_types_supported.includes('client_credentials');
6535
+ } catch (error) {
6536
+ return null;
6537
+ }
6538
+ }
6539
+
6540
+ /**
6541
+ * Restores a previously established OIDC session from storage.
6542
+ *
6543
+ * Not supported for the `client_credentials` grant as credentials
6544
+ * are not persisted. Use `login()` to re-authenticate instead.
6545
+ *
6546
+ * @async
6547
+ * @param {object.<string, *>} [options={}] - Additional options passed to the OIDC UserManager.
6548
+ * @returns {Promise<boolean>} `true` if the session could be resumed, `false` otherwise.
6549
+ * @see https://github.com/IdentityModel/oidc-client-js/wiki#usermanager
6550
+ */
6551
+ async resume(options = {}) {
6552
+ if (this.grant === 'client_credentials') {
6553
+ return false;
6554
+ }
6555
+ this.manager = new Oidc.UserManager(this.getOptions(options));
6556
+ this.addListener('UserLoaded', async () => this.setUser(await this.manager.getUser()), 'js-client');
6557
+ this.addListener('AccessTokenExpired', () => this.setUser(null), 'js-client');
6558
+ let user = await this.manager.getUser();
6559
+ if (user && user.expired && user.refresh_token) {
6560
+ user = await this.manager.signinSilent();
6561
+ }
6562
+ if (user && !user.expired) {
6563
+ this.setUser(user);
6564
+ return true;
6565
+ }
6566
+ return false;
6567
+ }
6568
+
6418
6569
  /**
6419
6570
  * Logout from the established session.
6420
6571
  *
6421
6572
  * @async
6422
6573
  */
6423
6574
  async logout() {
6575
+ if (this.grant === 'client_credentials') {
6576
+ super.logout();
6577
+ this.setUser(null);
6578
+ return;
6579
+ }
6424
6580
  if (this.manager !== null) {
6425
6581
  try {
6426
6582
  if (OidcProvider.uiMethod === 'popup') {
@@ -6483,6 +6639,8 @@ class OidcProvider extends AuthProvider {
6483
6639
  return 'code';
6484
6640
  case 'implicit':
6485
6641
  return 'token id_token';
6642
+ case 'client_credentials':
6643
+ return null;
6486
6644
  default:
6487
6645
  throw new Error('Grant Type not supported');
6488
6646
  }
@@ -6499,6 +6657,7 @@ class OidcProvider extends AuthProvider {
6499
6657
  switch (grant) {
6500
6658
  case 'authorization_code+pkce':
6501
6659
  case 'implicit':
6660
+ case 'client_credentials':
6502
6661
  this.grant = grant;
6503
6662
  break;
6504
6663
  default:
@@ -6517,6 +6676,17 @@ class OidcProvider extends AuthProvider {
6517
6676
  this.clientId = clientId;
6518
6677
  }
6519
6678
 
6679
+ /**
6680
+ * Sets the Client Secret for OIDC authentication.
6681
+ *
6682
+ * Only used for the `client_credentials` grant type.
6683
+ *
6684
+ * @param {string | null} clientSecret
6685
+ */
6686
+ setClientSecret(clientSecret) {
6687
+ this.clientSecret = clientSecret;
6688
+ }
6689
+
6520
6690
  /**
6521
6691
  * Sets the OIDC User.
6522
6692
  *
@@ -6536,12 +6706,21 @@ class OidcProvider extends AuthProvider {
6536
6706
  /**
6537
6707
  * Returns a display name for the authenticated user.
6538
6708
  *
6709
+ * For the `client_credentials` grant, returns a name based on the client ID.
6710
+ *
6539
6711
  * @returns {string?} Name of the user or `null`
6540
6712
  */
6541
6713
  getDisplayName() {
6542
6714
  if (this.user && Utils.isObject(this.user.profile)) {
6543
6715
  return this.user.profile.name || this.user.profile.preferred_username || this.user.profile.email || null;
6544
6716
  }
6717
+ if (this.grant === 'client_credentials' && this.clientId) {
6718
+ let id = this.clientId;
6719
+ if (id.length > 15) {
6720
+ id = id.slice(0, 5) + '\u2026' + id.slice(-5);
6721
+ }
6722
+ return `Client ${id}`;
6723
+ }
6545
6724
  return null;
6546
6725
  }
6547
6726
 
@@ -6599,7 +6778,7 @@ OidcProvider.redirectUrl = Environment.getUrl().split('#')[0].split('?')[0].repl
6599
6778
  *
6600
6779
  * @type {Array.<string>}
6601
6780
  */
6602
- OidcProvider.grants = ['authorization_code+pkce', 'implicit'];
6781
+ OidcProvider.grants = ['authorization_code+pkce', 'implicit', 'client_credentials'];
6603
6782
  module.exports = OidcProvider;
6604
6783
 
6605
6784
  /***/ },
@@ -6713,7 +6892,7 @@ class OpenEO {
6713
6892
  * @returns {string} Version number (according to SemVer).
6714
6893
  */
6715
6894
  static clientVersion() {
6716
- return "2.10.0";
6895
+ return "2.11.0";
6717
6896
  }
6718
6897
  }
6719
6898
  OpenEO.Environment = __webpack_require__(2458);
package/openeo.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("axios"),require("Oidc"));else if("function"==typeof define&&define.amd)define(["axios","Oidc"],t);else{var r="object"==typeof exports?t(require("axios"),require("Oidc")):t(e.axios,e.Oidc);for(var s in r)("object"==typeof exports?exports:e)[s]=r[s]}}(self,(e,t)=>(()=>{var r={3659(e,t,r){const s=r(768);class i{constructor(e=[],t=!1){if(this.listeners=[],this.processes={},this.addNamespace=t,e instanceof i)for(let t in e.processes)this.addAll(e.processes[t]);else this.addAll(e)}onChange(e,t,r){for(let s of this.listeners)s(e,t,r)}addAll(e,t="backend"){for(var r in e)this.add(e[r],t,!1);this.onChange("addAll",e,t)}add(e,t="backend",r=!0){if(!s.isObject(e))throw new Error("Invalid process; not an object.");if("string"!=typeof e.id)throw new Error("Invalid process; no id specified.");if("string"!=typeof t)throw new Error("Invalid namespace; not a string.");this.processes[t]||(this.processes[t]={}),e=Object.assign(this.addNamespace?{namespace:t}:{},e),this.processes[t][e.id]=e,r&&this.onChange("add",e,t)}count(){return s.size(this.all())}all(){let e=[];for(let t in this.processes)e=e.concat(Object.values(this.processes[t]));return e}hasNamespace(e){return"string"==typeof e&&Boolean(this.processes[e])}namespaces(){return Object.keys(this.processes).sort()}namespace(e){if("string"!=typeof e)return[];let t=this.processes[e];return t?Object.values(t):[]}has(e,t=null){return Boolean(this.get(e,t))}get(e,t=null){return"string"!=typeof e?null:null===t?this.get(e,"user")||this.get(e,"backend"):this.processes[t]&&this.processes[t][e]||null}remove(e=null,t="user"){if("string"!=typeof t)return!1;if(this.processes[t]){if("string"!=typeof e)return delete this.processes[t],this.onChange("remove",null,t),!0;if(this.processes[t][e]){let r=this.processes[t][e];return delete this.processes[t][e],0===s.size(this.processes[t])&&delete this.processes[t],this.onChange("remove",r,t),!0}}return!1}}e.exports=i},779(e,t,r){const s=r(768);class i{static normalizeJsonSchema(e,t=!1){s.isObject(e)?e=[e]:Array.isArray(e)||(e=[]);let r=[];for(let t of e)if(Array.isArray(t.allOf))r.push(Object.assign({},...t.allOf));else if(Array.isArray(t.oneOf)||Array.isArray(t.anyOf)){let e=s.omitFromObject(t,["oneOf","anyOf"]),i=t.oneOf||t.anyOf;for(let t of i)r.push(Object.assign({},e,t))}else r.push(t);if(!t)return r;e=[];for(let t of r)Array.isArray(t.type)?e=e.concat(t.type.map(e=>Object.assign({},t,{type:e}))):e.push(t);return e}static getCallbackParameters(e,t=[]){if(!s.isObject(e)||!e.schema)return[];let r,n=i.normalizeJsonSchema(e.schema);for(;r=t.shift();)n=n.map(e=>i.normalizeJsonSchema(i.getElementJsonSchema(e,r))),n=n.concat(...n);let o=[];for(let e of n){let t=null;if(Array.isArray(e.parameters)?t=e.parameters:s.isObject(e.additionalProperties)&&Array.isArray(e.additionalProperties.parameters)&&(t=e.additionalProperties.parameters),Array.isArray(t)){if(o.length>0&&!s.equals(o,t))throw new Error("Multiple schemas with different callback parameters found.");o=t}}return o}static getCallbackParametersForProcess(e,t,r=[]){if(!s.isObject(e)||!Array.isArray(e.parameters))return[];let n=e.parameters.find(e=>e.name===t);return i.getCallbackParameters(n,r)}static getNativeTypesForJsonSchema(e,t=!1){if(s.isObject(e)&&Array.isArray(e.type)){let r=s.unique(e.type).filter(e=>i.JSON_SCHEMA_TYPES.includes(e));return r.length>0&&r.length<i.JSON_SCHEMA_TYPES.length?r:t?[]:i.JSON_SCHEMA_TYPES}return s.isObject(e)&&"string"==typeof e.type&&i.JSON_SCHEMA_TYPES.includes(e.type)?[e.type]:t?[]:i.JSON_SCHEMA_TYPES}static getElementJsonSchema(e,t=null){let r=i.getNativeTypesForJsonSchema(e);if(s.isObject(e)&&r.includes("array")&&"string"!=typeof t){if(s.isObject(e.items))return e.items;if(Array.isArray(e.items)){if(null!==t&&s.isObject(e.items[t]))return e.items[t];if(s.isObject(e.additionalItems))return e.additionalItems}}if(s.isObject(e)&&r.includes("object")){if(null!==t&&s.isObject(e.properties)&&s.isObject(e.properties[t]))return e.properties[t];if(s.isObject(e.additionalProperties))return e.additionalProperties}return{}}}i.JSON_SCHEMA_TYPES=["string","number","integer","boolean","array","object","null"],e.exports=i},768(e,t,r){var s=r(9252);class i{static isObject(e){return"object"==typeof e&&e===Object(e)&&!Array.isArray(e)}static hasText(e){return"string"==typeof e&&e.length>0}static equals(e,t){return s(e,t)}static pickFromObject(e,t){e=Object(e),"string"==typeof t&&(t=[t]);const r={};return t.forEach(t=>r[t]=e[t]),r}static omitFromObject(e,t){e=Object(e),"string"==typeof t&&(t=[t]);var r=Object.assign({},e);for(let e of t)delete r[e];return r}static mapObject(e,t){const r=Object.keys(e),s=new Array(r.length);return r.forEach((r,i)=>{s[i]=t(e[r],r,e)}),s}static mapObjectValues(e,t){e=Object(e);const r={};return Object.keys(e).forEach(s=>{r[s]=t(e[s],s,e)}),r}static unique(e,t=!1){return t?e.filter((e,t,r)=>r.findIndex(t=>i.equals(e,t))===t):[...new Set(e)]}static size(e){return"object"==typeof e&&null!==e?Array.isArray(e)?e.length:Object.keys(e).length:0}static isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}static deepClone(e){return JSON.parse(JSON.stringify(e))}static normalizeUrl(e,t=null){let r=e.replace(/\/$/,"");return"string"==typeof t&&("/"!==t.substr(0,1)&&(t="/"+t),r+=t.replace(/\/$/,"")),r}static replacePlaceholders(e,t={}){if("string"==typeof e&&i.isObject(t))for(var r in t){let s=t[r];e=e.replace("{"+r+"}",Array.isArray(s)?s.join("; "):s)}return e}static compareStringCaseInsensitive(e,t){return"string"!=typeof e&&(e=String(e)),"string"!=typeof t&&(t=String(t)),e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}static prettifyString(e,t="; "){return Array.isArray(e)||(e=[String(e)]),(e=e.map(e=>{if(e.length>=3){const t=(e,t,r)=>t+" "+r.toUpperCase();return(e=e.includes("_")?e.replace(/([a-zA-Z\d])_([a-zA-Z\d])/g,t):e.includes("-")?e.replace(/([a-zA-Z\d])-([a-zA-Z\d])/g,t):e.replace(/([a-z])([A-Z])/g,t)).charAt(0).toUpperCase()+e.substr(1)}return e})).join(t)}static friendlyLinks(e,t=!0,r=["self"]){let s=[];if(!Array.isArray(e))return s;for(let t of e)t=Object.assign({},t),"string"==typeof t.rel&&r.includes(t.rel.toLowerCase())||("string"==typeof t.title&&0!==t.title.length||("string"==typeof t.rel&&t.rel.length>1?t.title=i.prettifyString(t.rel):t.title=t.href.replace(/^https?:\/\/(www.)?/i,"").replace(/\/$/i,"")),s.push(t));return t&&s.sort((e,t)=>i.compareStringCaseInsensitive(e.title,t.title)),s}}e.exports=i},3304(e,t,r){const{compare:s,compareVersions:i,validate:n}=r(8385);class o{static compare(e,t,r=null){return null!==r?s(e,t,r):i(e,t)}static validate(e){return n(e)}static findCompatible(e,t=!0,r=null,s=null){if(!Array.isArray(e)||0===e.length)return[];let i=e.filter(e=>{if("string"==typeof e.url&&o.validate(e.api_version)){let t=o.validate(r),i=o.validate(s);return t&&i?o.compare(e.api_version,r,">=")&&o.compare(e.api_version,s,"<="):t?o.compare(e.api_version,r,">="):!i||o.compare(e.api_version,s,"<=")}return!1});return 0===i.length?[]:i.sort((e,r)=>{let s=!0===e.production,i=!0===r.production;return t&&s!==i?s?-1:1:-1*o.compare(e.api_version,r.api_version)})}static findLatest(e,t=!0,r=null,s=null){let i=o.findCompatible(e,t,r,s);return i.length>0?i[0]:null}}e.exports=o},1321(e,t,r){var s=r(9139);const i="1.0.0",n={classification:"https://stac-extensions.github.io/classification/v1.1.0/schema.json",datacube:"https://stac-extensions.github.io/datacube/v2.1.0/schema.json",eo:"https://stac-extensions.github.io/eo/v1.0.0/schema.json",file:"https://stac-extensions.github.io/file/v1.0.0/schema.json","item-assets":"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",label:"https://stac-extensions.github.io/label/v1.0.1/schema.json",pointcloud:"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",processing:"https://stac-extensions.github.io/processing/v1.1.0/schema.json",projection:"https://stac-extensions.github.io/projection/v1.0.0/schema.json",raster:"https://stac-extensions.github.io/raster/v1.1.0/schema.json",sar:"https://stac-extensions.github.io/sar/v1.0.0/schema.json",sat:"https://stac-extensions.github.io/sat/v1.0.0/schema.json",scientific:"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",table:"https://stac-extensions.github.io/table/v1.2.0/schema.json",timestamps:"https://stac-extensions.github.io/timestamps/v1.0.0/schema.json",version:"https://stac-extensions.github.io/version/v1.0.0/schema.json",view:"https://stac-extensions.github.io/view/v1.0.0/schema.json"},o={itemAndCollection:{"cube:":n.datacube,"eo:":n.eo,"file:":n.file,"label:":n.label,"pc:":n.pointcloud,"processing:":n.processing,"proj:":n.projection,"raster:":n.raster,"sar:":n.sar,"sat:":n.sat,"sci:":n.scientific,"view:":n.view,version:n.version,deprecated:n.version,published:n.timestamps,expires:n.timestamps,unpublished:n.timestamps},catalog:{},collection:{item_assets:n["item-assets"]},item:{}};o.collection=Object.assign(o.collection,o.itemAndCollection),o.item=Object.assign(o.item,o.itemAndCollection);var a={parseUrl(e){let t=e.match(/^https?:\/\/stac-extensions.github.io\/([^\/]+)\/v([^\/]+)\/[^.]+.json$/i);if(t)return{id:t[1],version:t[2]}}},l={version:i,extensions:{},set(e){if("string"!=typeof e.stac_version?l.version="0.6.0":l.version=e.stac_version,Array.isArray(e.stac_extensions))for(let t of e.stac_extensions){let e=a.parseUrl(t);e&&(l.extensions[e.id]=e.version)}},before(e,t=null){let r=t?l.extensions[t]:l.version;return void 0!==r&&s.compare(r,e,"<")}},c={type(e){let t=typeof e;if("object"===t){if(null===e)return"null";if(Array.isArray(e))return"array"}return t},is:(e,t)=>c.type(e)===t,isDefined:e=>void 0!==e,isObject:e=>"object"==typeof e&&e===Object(e)&&!Array.isArray(e),rename:(e,t,r)=>void 0!==e[t]&&void 0===e[r]&&(e[r]=e[t],delete e[t],!0),forAll(e,t,r){if(e[t]&&"object"==typeof e[t])for(let s in e[t])r(e[t][s])},toArray:(e,t)=>void 0!==e[t]&&!Array.isArray(e[t])&&(e[t]=[e[t]],!0),flattenArray(e,t,r,s=!1){if(Array.isArray(e[t])){for(let i in e[t])if("string"==typeof r[i]){let n=e[t][i];e[r[i]]=s?[n]:n}return delete e[t],!0}return!1},flattenOneElementArray:(e,t,r=!1)=>!(!r&&Array.isArray(e[t]))||1===e[t].length&&(e[t]=e[t][0],!0),removeFromArray(e,t,r){if(Array.isArray(e[t])){let s=e[t].indexOf(r);return s>-1&&e[t].splice(s,1),!0}return!1},ensure:(e,t,r)=>(c.type(r)!==c.type(e[t])&&(e[t]=r),!0),upgradeExtension(e,t){let{id:r,version:i}=a.parseUrl(t),n=e.stac_extensions.findIndex(e=>{let t=a.parseUrl(e);return t&&t.id===r&&s.compare(t.version,i,"<")});return-1!==n&&(e.stac_extensions[n]=t,!0)},addExtension(e,t){let{id:r,version:i}=a.parseUrl(t),n=e.stac_extensions.findIndex(e=>{if(e===t)return!0;let n=a.parseUrl(e);return!(!n||n.id!==r||!s.compare(n.version,i,"<"))});return-1===n?e.stac_extensions.push(t):e.stac_extensions[n]=t,e.stac_extensions.sort(),!0},removeExtension:(e,t)=>c.removeFromArray(e,"stac_extensions",t),migrateExtensionShortnames(e){let t=Object.keys(n),r=Object.values(n);return c.mapValues(e,"stac_extensions",t,r)},populateExtensions(e,t){let r=[];"catalog"!=t&&"collection"!=t||r.push(e),"item"!=t&&"collection"!=t||!c.isObject(e.assets)||(r=r.concat(Object.values(e.assets))),"collection"==t&&c.isObject(e.item_assets)&&(r=r.concat(Object.values(e.item_assets))),"collection"==t&&c.isObject(e.summaries)&&r.push(e.summaries),"item"==t&&c.isObject(e.properties)&&r.push(e.properties);for(let s of r)Object.keys(s).forEach(r=>{let s=r.match(/^(\w+:|[^:]+$)/i);if(Array.isArray(s)){let r=o[t][s[0]];c.is(r,"string")&&c.addExtension(e,r)}})},mapValues(e,t,r,s){let i=e=>{let t=r.indexOf(e);return t>=0?s[t]:e};return Array.isArray(e[t])?e[t]=e[t].map(i):void 0!==e[t]&&(e[t]=i(e[t])),!0},mapObject(e,t){for(let r in e)e[r]=t(e[r],r)},moveTo(e,t,r,s=!1,i=!1){let n;return n=s?i?e=>Array.isArray(e):e=>Array.isArray(e)&&1===e.length:c.isDefined,!!n(e[t])&&(r[t]=s&&!i?e[t][0]:e[t],delete e[t],!0)},runAll(e,t,r,s){for(let i in e)i.startsWith("migrate")||e[i](t,r,s)},toUTC(e,t){if("string"==typeof e[t])try{return e[t]=this.toISOString(e[t]),!0}catch(e){}return delete e[t],!1},toISOString:e=>(e instanceof Date||(e=new Date(e)),e.toISOString().replace(".000",""))},u={multihash:null,hexToUint8(e){if(0===e.length||e.length%2!=0)throw new Error(`The string "${e}" is not valid hex.`);return new Uint8Array(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},uint8ToHex:e=>e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),toMultihash(e,t,r){if(!u.multihash||!c.is(e[t],"string"))return!1;try{const s=u.multihash.encode(u.hexToUint8(e[t]),r);return e[t]=u.uint8ToHex(s),!0}catch(e){return console.warn(e),!1}}},p={migrate:(e,t=!0)=>(l.set(e),t&&(e.stac_version=i),e.type="Catalog",c.ensure(e,"stac_extensions",[]),l.before("1.0.0-rc.1")&&c.migrateExtensionShortnames(e),c.ensure(e,"id",""),c.ensure(e,"description",""),c.ensure(e,"links",[]),c.runAll(p,e,e),l.before("0.8.0")&&c.populateExtensions(e,"catalog"),e)},h={migrate:(e,t=!0)=>(p.migrate(e,t),e.type="Collection",l.before("1.0.0-rc.1")&&c.migrateExtensionShortnames(e),c.ensure(e,"license","proprietary"),c.ensure(e,"extent",{spatial:{bbox:[]},temporal:{interval:[]}}),c.runAll(h,e,e),c.isObject(e.properties)&&(c.removeFromArray(e,"stac_extensions","commons"),delete e.properties),l.before("0.8.0")&&c.populateExtensions(e,"collection"),l.before("1.0.0-beta.1")&&c.mapValues(e,"stac_extensions",["assets"],["item-assets"]),e),extent(e){if(c.ensure(e,"extent",{}),l.before("0.8.0")&&(Array.isArray(e.extent.spatial)&&(e.extent.spatial={bbox:[e.extent.spatial]}),Array.isArray(e.extent.temporal)&&(e.extent.temporal={interval:[e.extent.temporal]})),c.ensure(e.extent,"spatial",{}),c.ensure(e.extent.spatial,"bbox",[]),c.ensure(e.extent,"temporal",{}),c.ensure(e.extent.temporal,"interval",[]),l.before("1.0.0-rc.3")){if(e.extent.temporal.interval.length>1){let t,r;for(let s of e.extent.temporal.interval){if(null===s[0])t=null;else if("string"==typeof s[0]&&null!==t)try{let e=new Date(s[0]);(void 0===t||e<t)&&(t=e)}catch(e){}if(null===s[1])r=null;else if("string"==typeof s[1]&&null!==r)try{let e=new Date(s[1]);(void 0===r||e>r)&&(r=e)}catch(e){}}e.extent.temporal.interval.unshift([t?c.toISOString(t):null,r?c.toISOString(r):null])}if(e.extent.spatial.bbox.length>1){let t=e.extent.spatial.bbox.reduce((e,t)=>Array.isArray(t)?Math.max(t.length,e):e,4);if(t>=4){let r=new Array(t).fill(null),s=t/2;for(let t of e.extent.spatial.bbox){if(!Array.isArray(t)||t.length<4)break;for(let e in t){let i=t[e];null===r[e]?r[e]=i:r[e]=e<s?Math.min(i,r[e]):Math.max(i,r[e])}}-1===r.findIndex(e=>null===e)&&e.extent.spatial.bbox.unshift(r)}}}},collectionAssets(e){l.before("1.0.0-rc.1")&&c.removeExtension(e,"collection-assets"),g.migrateAll(e)},itemAsset(e){l.before("1.0.0-beta.2")&&c.rename(e,"item_assets","assets"),g.migrateAll(e,"item_assets")},summaries(e){if(c.ensure(e,"summaries",{}),l.before("0.8.0")&&c.isObject(e.other_properties)){for(let t in e.other_properties){let r=e.other_properties[t];Array.isArray(r.extent)&&2===r.extent.length?e.summaries[t]={minimum:r.extent[0],maximum:r.extent[1]}:Array.isArray(r.values)&&(r.values.filter(e=>Array.isArray(e)).length===r.values.length?e.summaries[t]=r.values.reduce((e,t)=>e.concat(t),[]):e.summaries[t]=r.values)}delete e.other_properties}if(l.before("1.0.0-beta.1")&&c.isObject(e.properties)&&!e.links.find(e=>["child","item"].includes(e.rel)))for(let t in e.properties){let r=e.properties[t];Array.isArray(r)||(r=[r]),e.summaries[t]=r}l.before("1.0.0-rc.1")&&c.mapObject(e.summaries,e=>(c.rename(e,"min","minimum"),c.rename(e,"max","maximum"),e)),m.migrate(e.summaries,e,!0),c.moveTo(e.summaries,"sci:doi",e,!0)&&c.addExtension(e,n.scientific),c.moveTo(e.summaries,"sci:publications",e,!0,!0)&&c.addExtension(e,n.scientific),c.moveTo(e.summaries,"sci:citation",e,!0)&&c.addExtension(e,n.scientific),c.moveTo(e.summaries,"cube:dimensions",e,!0)&&c.addExtension(e,n.datacube),0===Object.keys(e.summaries).length&&delete e.summaries}},d={migrate(e,t=null,r=!0){l.set(e),r&&(e.stac_version=i),c.ensure(e,"stac_extensions",[]),l.before("1.0.0-rc.1")&&c.migrateExtensionShortnames(e),c.ensure(e,"id",""),c.ensure(e,"type","Feature"),c.isObject(e.geometry)||(e.geometry=null),null!==e.geometry&&c.ensure(e,"bbox",[]),c.ensure(e,"properties",{}),c.ensure(e,"links",[]),c.ensure(e,"assets",{});let s=!1;return c.isObject(t)&&c.isObject(t.properties)&&(c.removeFromArray(e,"stac_extensions","commons"),e.properties=Object.assign({},t.properties,e.properties),s=!0),c.runAll(d,e,e),m.migrate(e.properties,e),g.migrateAll(e),(l.before("0.8.0")||s)&&c.populateExtensions(e,"item"),e}},f={migrate:(e,t=!0)=>(c.ensure(e,"collections",[]),c.ensure(e,"links",[]),c.runAll(f,e,e),e.collections=e.collections.map(e=>h.migrate(e,t)),e)},y={migrate:(e,t=!0)=>(c.ensure(e,"type","FeatureCollection"),c.ensure(e,"features",[]),c.ensure(e,"links",[]),c.runAll(y,e,e),e.features=e.features.map(e=>d.migrate(e,null,t)),e)},g={migrateAll(e,t="assets"){for(let r in e[t])g.migrate(e[t][r],e)},migrate:(e,t)=>(c.runAll(g,e,t),m.migrate(e,t),e),mediaTypes(e){c.is(e.type,"string")&&c.mapValues(e,"type",["image/vnd.stac.geotiff","image/vnd.stac.geotiff; cloud-optimized=true"],["image/tiff; application=geotiff","image/tiff; application=geotiff; profile=cloud-optimized"])},eo(e,t){let r=c.isObject(t.properties)&&Array.isArray(t.properties["eo:bands"])?t.properties["eo:bands"]:[];if(Array.isArray(e["eo:bands"]))for(let t in e["eo:bands"]){let s=e["eo:bands"][t];c.is(s,"number")&&c.isObject(r[s])?s=r[s]:c.isObject(s)||(s={}),e["eo:bands"][t]=s}}},m={migrate:(e,t,r=!1)=>(c.runAll(m,e,t,r),e),_commonMetadata(e){l.before("1.0.0-rc.3")&&(c.toUTC(e,"created"),c.toUTC(e,"updated"))},_timestamps(e,t){c.toUTC(e,"published"),c.toUTC(e,"expires"),c.toUTC(e,"unpublished"),c.upgradeExtension(t,n.timestamps)},_versioningIndicator(e,t){c.upgradeExtension(t,n.version)},checksum(e,t){l.before("0.9.0")&&u.multihash&&(c.rename(e,"checksum:md5","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","md5"),c.rename(e,"checksum:sha1","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","sha1"),c.rename(e,"checksum:sha2","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","sha2-256"),c.rename(e,"checksum:sha3","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","sha3-256")),l.before("1.0.0-rc.1")&&c.rename(e,"checksum:multihash","file:checksum")&&c.addExtension(t,n.file),c.removeExtension(t,"checksum")},classification(e,t){l.before("1.1.0","classification")&&c.forAll(e,"classification:classes",e=>c.rename(e,"color-hint","color_hint")),c.upgradeExtension(t,n.classification)},cube(e,t){c.upgradeExtension(t,n.datacube)},dtr(e,t){l.before("0.9.0")&&(c.rename(e,"dtr:start_datetime","start_datetime"),c.rename(e,"dtr:end_datetime","end_datetime"),c.removeExtension(t,"datetime-range"))},eo(e,t){l.before("0.9.0")&&(c.rename(e,"eo:epsg","proj:epsg")&&c.addExtension(t,n.projection),c.rename(e,"eo:platform","platform"),c.rename(e,"eo:instrument","instruments")&&c.toArray(e,"instruments"),c.rename(e,"eo:constellation","constellation"),c.rename(e,"eo:off_nadir","view:off_nadir")&&c.addExtension(t,n.view),c.rename(e,"eo:azimuth","view:azimuth")&&c.addExtension(t,n.view),c.rename(e,"eo:incidence_angle","view:incidence_angle")&&c.addExtension(t,n.view),c.rename(e,"eo:sun_azimuth","view:sun_azimuth")&&c.addExtension(t,n.view),c.rename(e,"eo:sun_elevation","view:sun_elevation")&&c.addExtension(t,n.view)),l.before("1.0.0-beta.1")&&c.rename(e,"eo:gsd","gsd"),c.upgradeExtension(t,n.eo)},file(e,t){c.upgradeExtension(t,n.file)},label(e,t){l.before("0.8.0")&&(c.rename(e,"label:property","label:properties"),c.rename(e,"label:task","label:tasks"),c.rename(e,"label:overview","label:overviews")&&c.toArray(e,"label:overviews"),c.rename(e,"label:method","label:methods"),c.toArray(e,"label:classes")),c.upgradeExtension(t,n.label)},pc(e,t){l.before("0.8.0")&&c.rename(e,"pc:schema","pc:schemas"),c.upgradeExtension(t,n.pointcloud)},processing(e,t){c.upgradeExtension(t,n.processing)},proj(e,t){c.upgradeExtension(t,n.projection)},raster(e,t){c.upgradeExtension(t,n.raster)},sar(e,t,r){c.rename(e,"sar:incidence_angle","view:incidence_angle")&&c.addExtension(t,n.view),c.rename(e,"sar:pass_direction","sat:orbit_state")&&c.mapValues(e,"sat:orbit_state",[null],["geostationary"])&&c.addExtension(t,n.sat),l.before("0.7.0")&&(c.flattenArray(e,"sar:resolution",["sar:resolution_range","sar:resolution_azimuth"],r),c.flattenArray(e,"sar:pixel_spacing",["sar:pixel_spacing_range","sar:pixel_spacing_azimuth"],r),c.flattenArray(e,"sar:looks",["sar:looks_range","sar:looks_azimuth","sar:looks_equivalent_number"],r),c.rename(e,"sar:off_nadir","view:off_nadir")&&c.addExtension(t,n.view)),l.before("0.9.0")&&(c.rename(e,"sar:platform","platform"),c.rename(e,"sar:instrument","instruments")&&c.toArray(e,"instruments"),c.rename(e,"sar:constellation","constellation"),c.rename(e,"sar:type","sar:product_type"),c.rename(e,"sar:polarization","sar:polarizations"),c.flattenOneElementArray(e,"sar:absolute_orbit",r)&&c.rename(e,"sar:absolute_orbit","sat:absolute_orbit")&&c.addExtension(t,n.sat),c.flattenOneElementArray(e,"sar:relative_orbit",r)&&c.rename(e,"sar:relative_orbit","sat:relative_orbit")&&c.addExtension(t,n.sat)),c.upgradeExtension(t,n.sar)},sat(e,t){l.before("0.9.0")&&(c.rename(e,"sat:off_nadir_angle","sat:off_nadir"),c.rename(e,"sat:azimuth_angle","sat:azimuth"),c.rename(e,"sat:sun_azimuth_angle","sat:sun_azimuth"),c.rename(e,"sat:sun_elevation_angle","sat:sun_elevation")),c.upgradeExtension(t,n.sat)},sci(e,t){c.upgradeExtension(t,n.scientific)},item(e){l.before("0.8.0")&&(c.rename(e,"item:license","license"),c.rename(e,"item:providers","providers"))},table(e,t){c.upgradeExtension(t,n.table)},view(e,t){c.upgradeExtension(t,n.view)}},b={item:(e,t=null,r=!0)=>d.migrate(e,t,r),catalog:(e,t=!0)=>p.migrate(e,t),collection:(e,t=!0)=>h.migrate(e,t),collectionCollection:(e,t=!0)=>f.migrate(e,t),itemCollection:(e,t=!0)=>y.migrate(e,t),stac:(e,t=!0)=>"Feature"===e.type?b.item(e,null,t):"FeatureCollection"===e.type?b.itemCollection(e,t):"Collection"===e.type||!e.type&&c.isDefined(e.extent)&&c.isDefined(e.license)?b.collection(e,t):!e.type&&Array.isArray(e.collections)?b.collectionCollection(e,t):b.catalog(e,t),enableMultihash(e){u.multihash=e}};e.exports=b},9139(e,t){var r,s;void 0===(s="function"==typeof(r=function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(e){var t,r,s=e.replace(/^v/,"").replace(/\+.*$/,""),i=(r="-",-1===(t=s).indexOf(r)?t.length:t.indexOf(r)),n=s.substring(0,i).split(".");return n.push(s.substring(i+1)),n}function r(e){return isNaN(Number(e))?e:Number(e)}function s(t){if("string"!=typeof t)throw new TypeError("Invalid argument expected string");if(!e.test(t))throw new Error("Invalid argument not valid semver ('"+t+"' received)")}function i(e,i){[e,i].forEach(s);for(var n=t(e),o=t(i),a=0;a<Math.max(n.length-1,o.length-1);a++){var l=parseInt(n[a]||0,10),c=parseInt(o[a]||0,10);if(l>c)return 1;if(c>l)return-1}var u=n[n.length-1],p=o[o.length-1];if(u&&p){var h=u.split(".").map(r),d=p.split(".").map(r);for(a=0;a<Math.max(h.length,d.length);a++){if(void 0===h[a]||"string"==typeof d[a]&&"number"==typeof h[a])return-1;if(void 0===d[a]||"string"==typeof h[a]&&"number"==typeof d[a])return 1;if(h[a]>d[a])return 1;if(d[a]>h[a])return-1}}else if(u||p)return u?-1:1;return 0}var n=[">",">=","=","<","<="],o={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};return i.validate=function(t){return"string"==typeof t&&e.test(t)},i.compare=function(e,t,r){!function(e){if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===n.indexOf(e))throw new TypeError("Invalid operator, expected one of "+n.join("|"))}(r);var s=i(e,t);return o[r].indexOf(s)>-1},i})?r.apply(t,[]):r)||(e.exports=s)},6147(e){e.exports=class{constructor(e,t,r){this.id=r.id||null,this.title=r.title||"",this.description=r.description||"",this.type=e,this.connection=t,this.token=null}getId(){let e=this.getType();return this.getProviderId().length>0&&(e+="."+this.getProviderId()),e}getDisplayName(){return null}getType(){return this.type}getProviderId(){return"string"==typeof this.id?this.id:""}getTitle(){return this.title}getDescription(){return this.description}getToken(){const e=this.connection.capabilities().hasConformance("https://api.openeo.org/*/authentication/jwt");return"string"==typeof this.token?e?this.token:this.getType()+"/"+this.getProviderId()+"/"+this.token:null}setToken(e){this.token=e,this.connection.emit("tokenChanged",e),null!==this.token?this.connection.setAuthProvider(this):this.connection.setAuthProvider(null)}async login(...e){throw new Error("Not implemented.",e)}async logout(){this.setToken(null)}}},3054(e){e.exports=class{constructor(e,t=[]){this.connection=e,this.apiToClientNames={},this.clientToApiNames={},this.lastRefreshTime=0,this.extra={};for(let e in t){let r,s;Array.isArray(t[e])?(r=t[e][0],s=t[e][1]):(r=t[e],s=t[e]),this.apiToClientNames[r]=s,this.clientToApiNames[s]=r}}toJSON(){let e={};for(let t in this.clientToApiNames){let r=this.clientToApiNames[t];void 0!==this[t]&&(e[r]=this[t])}return Object.assign(e,this.extra)}setAll(e){for(let t in e)void 0===this.apiToClientNames[t]?this.extra[t]=e[t]:this[this.apiToClientNames[t]]=e[t];return this.lastRefreshTime=Date.now(),this}getDataAge(){return(Date.now()-this.lastRefreshTime)/1e3}getAll(){let e={};for(let t in this.apiToClientNames){let r=this.apiToClientNames[t];void 0!==this[r]&&(e[r]=this[r])}return Object.assign(e,this.extra)}get(e){return void 0!==this.extra[e]?this.extra[e]:null}_convertToRequest(e){let t={};for(let r in e)void 0===this.clientToApiNames[r]?t[r]=e[r]:t[this.clientToApiNames[r]]=e[r];return t}_supports(e){return this.connection.capabilities().hasFeature(e)}}},933(e,t,r){const s=r(2458),i=r(768),n=r(6147);e.exports=class extends n{constructor(e){super("basic",e,{id:null,title:"HTTP Basic",description:"Login with username and password using the method HTTP Basic."}),this.username=null}async login(e,t){let r=await this.connection._send({method:"get",responseType:"json",url:"/credentials/basic",headers:{Authorization:"Basic "+s.base64encode(e+":"+t)}});if(!i.isObject(r.data)||"string"!=typeof r.data.access_token)throw new Error("No access_token returned.");this.username=e,this.setToken(r.data.access_token)}getDisplayName(){return this.username}async logout(){this.username=null,await super.logout()}}},2458(e){e.exports=class{static getName(){return"Browser"}static getUrl(){return window.location.toString()}static setUrl(e){throw new Error("setUrl is not supported in a browser environment.")}static handleErrorResponse(e){return new Promise((t,r)=>{let s=new FileReader;s.onerror=e=>{s.abort(),r(e.target.error)},s.onload=()=>{let e=s.result instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(s.result)):s.result,r="string"==typeof e?JSON.parse(e):e;t(r)},s.readAsText(e.response.data)})}static getResponseType(){return"blob"}static base64encode(e){return btoa(e)}static fileNameForUpload(e){return e.name.split(/(\\|\/)/g).pop()}static dataForUpload(e){return e}static async downloadResults(e,t,r){throw new Error("downloadResults is not supported in a browser environment.")}static saveToFile(e,t){return new Promise((r,s)=>{try{e instanceof Blob||(e=new Blob([e],{type:"application/octet-stream"}));let s=window.URL.createObjectURL(e),i=document.createElement("a");i.style.display="none",i.href=s,i.setAttribute("download",t||"download"),void 0===i.download&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(s),r()}catch(e){console.error(e),s(e)}})}}},1425(e,t,r){const s=r(2804),i=r(7897),n=r(2742),o=r(768),a=r(779),l=r(3659),c=["id","summary","description","categories","parameters","returns","deprecated","experimental","exceptions","examples","links"];class u{static async fromVersion(e=null){let t="https://processes.openeo.org/processes.json";return"string"==typeof e&&(t="https://processes.openeo.org/"+e+"/processes.json"),await u.fromURL(t)}static async fromURL(e){let t=await n(e);return new u(t.data)}constructor(e,t=null,r=void 0){if(this.id=r,this.parent=t,this.parentNode=null,this.parentParameter=null,this.nodes={},this.idCounter={},this.callbackParameterCache={},this.parameters=void 0,this.processes=null,e instanceof l)this.processes=e;else if(o.isObject(e)&&Array.isArray(e.processes))this.processes=new l(e.processes);else{if(!Array.isArray(e))throw new Error("Processes are invalid; must be array or object according to the API.");this.processes=new l(e)}this.processes.all().forEach(e=>this.createFunction(e))}createFunction(e){if(void 0!==this[e.id])throw new Error("Can't create function for process '"+e.id+"'. Already exists in Builder class.");this[e.id]=function(...t){return this.process(e.id,t)}}addProcessSpec(e,t=null){if(!o.isObject(e))throw new Error("Process '"+e.id+"' must be an object.");t||(t="backend"),this.processes.add(e,t),"backend"===t&&this.createFunction(e)}setParent(e,t){this.parentNode=e,this.parentParameter=t}createCallbackParameter(e){return this.callbackParameterCache[e]||(this.callbackParameterCache[e]=i.create(this,e)),this.callbackParameterCache[e]}getParentCallbackParameters(){let e=[];if(this.parentNode&&this.parentParameter)try{e=a.getCallbackParametersForProcess(this.parentNode.spec,this.parentParameter).map(e=>this.createCallbackParameter(e.name))}catch(e){console.warn(e)}return e}addParameter(e,t=!0){if(void 0!==this.getParentCallbackParameters().find(t=>t.name===e.name))return;let r=this;if(t)for(;r.parent;)r=r.parent;Array.isArray(r.parameters)||(r.parameters=[]);let s=r.parameters.findIndex(t=>t.name===e.name);-1!==s?Object.assign(r.parameters[s],e):r.parameters.push(e)}spec(e,t=null){return this.processes.get(e,t)}math(e){let t=new(r(2212))(e);return t.setBuilder(this),t.generate(!1)}supports(e,t=null){return Boolean(this.spec(e,t))}process(e,t={},r=null){let i=null;if(e.includes("@")){let t;[e,...t]=e.split("@"),i=t.join("@")}let n=new s(this,e,t,r,i);return this.nodes[n.id]=n,n}toJSON(){let e={process_graph:o.mapObjectValues(this.nodes,e=>e.toJSON())};return c.forEach(t=>{void 0!==this[t]&&(e[t]=this[t])}),e}generateId(e=""){return e=e.replace("_","").substr(0,6),this.idCounter[e]?this.idCounter[e]++:this.idCounter[e]=1,e+this.idCounter[e]}}e.exports=u},2212(e,t,r){const s=r(6462),i=r(7897),n=r(2804);class o{constructor(e){let t=new s.Parser;this.tree=t.parse(e),this.builder=null}setBuilder(e){this.builder=e}generate(e=!0){let t=this.parseTree(this.tree);if(!(t instanceof n))throw new Error("Invalid formula specified.");return e&&(t.result=!0),t}parseTree(e){let t=Object.keys(e)[0];switch(t){case"Number":return parseFloat(e.Number);case"Identifier":return this.getRef(e.Identifier);case"Expression":return this.parseTree(e.Expression);case"FunctionCall":{let t=[];for(let r in e.FunctionCall.args)t.push(this.parseTree(e.FunctionCall.args[r]));return this.builder.process(e.FunctionCall.name,t)}case"Binary":return this.addOperatorProcess(e.Binary.operator,this.parseTree(e.Binary.left),this.parseTree(e.Binary.right));case"Unary":{let t=this.parseTree(e.Unary.expression);return"-"===e.Unary.operator?"number"==typeof t?-t:this.addOperatorProcess("*",-1,t):t}default:throw new Error("Operation "+t+" not supported.")}}getRef(e){if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if("string"==typeof e&&e.startsWith("#")){let t=e.substring(1);if(t in this.builder.nodes)return{from_node:t}}let t=this.builder.getParentCallbackParameters();if("string"==typeof e&&t.length>0){let r=e.match(/^\$+/),s=r?r[0].length:0;if(s>0&&t.length>=s){let r=e.substring(s);return t[s-1][r]}}let r=new i(e);return this.builder.addParameter(r),r}addOperatorProcess(e,t,r){let s=o.operatorMapping[e],i=this.builder.spec(s);if(s&&i){let n={};if(!Array.isArray(i.parameters)||i.parameters.length<2)throw new Error("Process for operator "+e+" must have at least two parameters");return n[i.parameters[0].name||"x"]=t,n[i.parameters[1].name||"y"]=r,this.builder.process(s,n)}throw new Error("Operator "+e+" not supported")}}o.operatorMapping={"-":"subtract","+":"add","/":"divide","*":"multiply","^":"power"},e.exports=o},2804(e,t,r){const s=r(768),i=r(7897);class n{constructor(e,t,r={},s=null,i=null){if(this.parent=e,this.spec=this.parent.spec(t,i),!this.spec)throw new Error("Process doesn't exist: "+t);this.id=e.generateId(t),this.namespace=i,this.arguments=Array.isArray(r)?this.namedArguments(r):r,this._description=s,this.result=!1,this.addParametersToProcess(this.arguments)}namedArguments(e){if(e.length>(this.spec.parameters||[]).length)throw new Error("More arguments specified than parameters available.");let t={};if(Array.isArray(this.spec.parameters))for(let r=0;r<this.spec.parameters.length;r++)t[this.spec.parameters[r].name]=e[r];return t}addParametersToProcess(e){for(let t in e){let r=e[t];r instanceof i?s.isObject(r.spec.schema)&&this.parent.addParameter(r.spec):r instanceof n?this.addParametersToProcess(r.arguments):(Array.isArray(r)||s.isObject(r))&&this.addParametersToProcess(r)}}description(e){return void 0===e?this._description:(this._description=e,this)}exportArgument(e,t){const o=r(2212);if(s.isObject(e)){if(e instanceof n||e instanceof i)return e.ref();if(e instanceof o){let r=this.createBuilder(this,t);return e.setBuilder(r),e.generate(),r.toJSON()}if(e instanceof Date)return e.toISOString();if("function"==typeof e.toJSON)return e.toJSON();{let r={};for(let s in e)void 0!==e[s]&&(r[s]=this.exportArgument(e[s],t));return r}}return Array.isArray(e)?e.map(e=>this.exportArgument(e),t):"function"==typeof e?this.exportCallback(e,t):e}createBuilder(e=null,t=null){let s=new(r(1425))(this.parent.processes,this.parent);return null!==e&&null!==t&&s.setParent(e,t),s}exportCallback(e,t){let r=this.createBuilder(this,t),i=r.getParentCallbackParameters(),o=e.bind(r)(...i,r);if(Array.isArray(o)&&r.supports("array_create")?o=r.array_create(o):!s.isObject(o)&&r.supports("constant")&&(o=r.constant(o)),o instanceof n)return o.result=!0,r.toJSON();throw new Error("Callback must return BuilderNode")}toJSON(){let e={process_id:this.spec.id,arguments:{}};this.namespace&&(e.namespace=this.namespace);for(let t in this.arguments)void 0!==this.arguments[t]&&(e.arguments[t]=this.exportArgument(this.arguments[t],t));return"function"!=typeof this.description?e.description=this.description:"string"==typeof this._description&&(e.description=this._description),this.result&&(e.result=!0),e}ref(){return{from_node:this.id}}}e.exports=n},7897(e){"use strict";class t{static create(e,r){let s=new t(r,null);if("undefined"!=typeof Proxy)return new Proxy(s,{nodeCache:{},get(t,r,i){if(!Reflect.has(t,r)){if(!this.nodeCache[r]){let t={data:s};"string"==typeof r&&r.match(/^(0|[1-9]\d*)$/)?t.index=parseInt(r,10):t.label=r,this.nodeCache[r]=e.process("array_element",t)}return this.nodeCache[r]}return Reflect.get(t,r,i)},set(e,t,r,s){if(!Reflect.has(e,t))throw new Error("Simplified array access is read-only");return Reflect.set(e,t,r,s)}});throw new Error("Simplified array access not supported, use array_element directly")}constructor(e,t={},r="",s=void 0){this.name=e,this.spec={name:e,schema:"string"==typeof t?{type:t}:t,description:r},void 0!==s&&(this.spec.optional=!0,this.spec.default=s)}toJSON(){return this.spec}ref(){return{from_parameter:this.name}}}e.exports=t},6462(e){let t={Token:{Operator:"Operator",Identifier:"Identifier",Number:"Number"}};const r={"⁰":0,"¹":1,"²":2,"³":3,"⁴":4,"⁵":5,"⁶":6,"⁷":7,"⁸":8,"⁹":9},s=Object.keys(r).join("");t.Lexer=function(){let e="",r=0,i=0,n=0,o=t.Token;function a(){let t=i;return t<r?e.charAt(t):"\0"}function l(){let t="\0",s=i;return s<r&&(t=e.charAt(s),i+=1),t}function c(e){return"\t"===e||" "===e||" "===e}function u(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function p(e){return e>="0"&&e<="9"}function h(e,t){return{type:e,value:t,start:n,end:i-1}}function d(e,t=!1){return"_"===e||u(e)||p(e)||t&&function(e){return"-"===e||"."===e||"~"===e||"@"===e}(e)}function f(){let e;if(function(){let e;for(;i<r&&(e=a(),c(e));)l()}(),!(i>=r)){if(n=i,e=function(){let e,t;if(e=a(),p(e)||"."===e){if(t="","."!==e)for(t=l();e=a(),p(e);)t+=l();if("."===e)for(t+=l();e=a(),p(e);)t+=l();if("e"===e||"E"===e){if(t+=l(),e=a(),"+"!==e&&"-"!==e&&!p(e))throw e="character "+e,i>=r&&(e="<end>"),new SyntaxError("Unexpected "+e+" after the exponent sign");for(t+=l();e=a(),p(e);)t+=l()}if("."===t)throw new SyntaxError("Expecting decimal digits after the dot sign");return h(o.Number,t)}}(),void 0!==e)return e;if(e=function(){let e=a();if(("+-*/()^,"+s).indexOf(e)>=0)return h(o.Operator,l())}(),void 0!==e)return e;if(e=function(){let e=a();if("_"!==(t=e)&&"#"!==t&&"$"!==t&&!u(t))return;var t;let r=l(),s=!1;for(;;){let t=a();if("$"===e)"$"!==t&&(e="");else if("@"===t)s=!0;else if(!d(t,s))break;r+=l()}return h(o.Identifier,r)}(),void 0!==e)return e;throw new SyntaxError("Unknown token from character "+a())}}return{reset:function(t){e=t,r=t.length,i=0},next:f,peek:function(){let e,t=i;try{e=f(),delete e.start,delete e.end}catch(t){e=void 0}return i=t,e}}},t.Parser=function(){let e=new t.Lexer,i=t.Token;function n(e,t){return void 0!==e&&e.type===i.Operator&&t.includes(e.value)}function o(){let t,r=e.peek();return n(r,"-+")?(r=e.next(),t=o(),{Unary:{operator:r.value,expression:t}}):function(){let t,r=e.peek();if(void 0===r)throw new SyntaxError("Unexpected termination of expression");if(r.type===i.Identifier)return r=e.next(),n(e.peek(),"(")?function(t){let r=[],s=e.next();if(!n(s,"("))throw new SyntaxError('Expecting ( in a function call "'+t+'"');if(s=e.peek(),n(s,")")||(r=function(){let t,r,s=[];for(;r=u(),void 0!==r&&(s.push(r),t=e.peek(),n(t,","));)e.next();return s}()),s=e.next(),!n(s,")"))throw new SyntaxError('Expecting ) in a function call "'+t+'"');return{FunctionCall:{name:t,args:r}}}(r.value):{Identifier:r.value};if(r.type===i.Number)return r=e.next(),{Number:r.value};if(n(r,"(")){if(e.next(),t=u(),r=e.next(),!n(r,")"))throw new SyntaxError("Expecting )");return{Expression:t}}throw new SyntaxError("Parse error, can not process token "+r.value)}()}function a(e){return"number"==typeof r[e]?{Number:r[e]}:null}function l(){let t=o(),r=e.peek();for(;n(r,"^"+s);)r=e.next(),t={Binary:{operator:"^",left:t,right:"^"!==r.value?a(r.value):o()}},r=e.peek();return t}function c(){let t=l(),r=e.peek();for(;n(r,"*/");)r=e.next(),t={Binary:{operator:r.value,left:t,right:l()}},r=e.peek();return t}function u(){return function(){let t=c(),r=e.peek();for(;n(r,"+-");)r=e.next(),t={Binary:{operator:r.value,left:t,right:c()}},r=e.peek();return t}()}return{parse:function(t){e.reset(t);let r=u(),s=e.next();if(void 0!==s)throw new SyntaxError("Unexpected token "+s.value);return{Expression:r}}}},e.exports=t},4026(e,t,r){const s=r(768);"function"!=typeof RegExp.escape&&r(6117).shim();const i={capabilities:!0,listFileTypes:"get /file_formats",listServiceTypes:"get /service_types",listUdfRuntimes:"get /udf_runtimes",listProcessingParameters:"get /processing_parameters",listCollections:"get /collections",describeCollection:"get /collections/{}",listCollectionItems:"get /collections/{}/items",describeCollectionItem:"get /collections/{}/items/{}",describeCollectionQueryables:"get /collections/{}/queryables",listProcesses:"get /processes",describeProcess:"get /processes",listAuthProviders:!0,authenticateOIDC:"get /credentials/oidc",authenticateBasic:"get /credentials/basic",describeAccount:"get /me",listFiles:"get /files",getFile:"get /files",uploadFile:"put /files/{}",downloadFile:"get /files/{}",deleteFile:"delete /files/{}",validateProcess:"post /validation",listUserProcesses:"get /process_graphs",describeUserProcess:"get /process_graphs/{}",getUserProcess:"get /process_graphs/{}",setUserProcess:"put /process_graphs/{}",replaceUserProcess:"put /process_graphs/{}",deleteUserProcess:"delete /process_graphs/{}",computeResult:"post /result",listJobs:"get /jobs",createJob:"post /jobs",listServices:"get /services",createService:"post /services",getJob:"get /jobs/{}",describeJob:"get /jobs/{}",updateJob:"patch /jobs/{}",deleteJob:"delete /jobs/{}",estimateJob:"get /jobs/{}/estimate",debugJob:"get /jobs/{}/logs",startJob:"post /jobs/{}/results",stopJob:"delete /jobs/{}/results",listResults:"get /jobs/{}/results",downloadResults:"get /jobs/{}/results",describeService:"get /services/{}",getService:"get /services/{}",updateService:"patch /services/{}",deleteService:"delete /services/{}",debugService:"get /services/{}/logs"};class n{constructor(e){this.data=e,this.featureMap=i,this.features=[],this.validate(),this.init()}validate(){if(!s.isObject(this.data))throw new Error("No capabilities retrieved.");if(!this.data.api_version)throw new Error("Invalid capabilities: No API version retrieved");if(!Array.isArray(this.data.endpoints))throw new Error("Invalid capabilities: No endpoints retrieved")}init(){this.features=this.data.endpoints.map(e=>e.methods.map(t=>`${t} ${e.path.replace(/\{[^}]+\}/g,"{}")}`.toLowerCase())).reduce((e,t)=>e.concat(t),[])}toJSON(){return this.data}apiVersion(){return this.data.api_version}backendVersion(){return this.data.backend_version}title(){return"string"==typeof this.data.title?this.data.title:""}description(){return"string"==typeof this.data.description?this.data.description:""}isStable(){return!0===this.data.production}links(){return Array.isArray(this.data.links)?this.data.links:[]}listFederation(){let e=[];if(s.isObject(this.data.federation))for(const[t,r]of Object.entries(this.data.federation))e.push({id:t,...r});return e}getFederationBackend(e){return{id:e,...this.data.federation[e]}}getFederationBackends(e){return e.map(this.getFederationBackend,this)}listFeatures(){let e=[];for(let t in this.featureMap)(!0===this.featureMap[t]||this.features.includes(this.featureMap[t]))&&e.push(t);return e.sort()}hasFeature(e){let t=this.featureMap[e];return"string"==typeof t&&(t=t.toLowerCase()),!0===t||this.features.some(e=>e===t)}hasConformance(e){if("string"==typeof e&&(e=[e]),!Array.isArray(this.data.conformsTo)||!Array.isArray(e))return!1;const t=e.map(e=>RegExp.escape(e).replaceAll("\\*","[^/]+")).join("|"),r=new RegExp("^("+t+")$");return Boolean(this.data.conformsTo.find(e=>e.match(r)))}currency(){return s.isObject(this.data.billing)&&"string"==typeof this.data.billing.currency?this.data.billing.currency:null}listPlans(){if(s.isObject(this.data.billing)&&Array.isArray(this.data.billing.plans)){let e="string"==typeof this.data.billing.default_plan?this.data.billing.default_plan.toLowerCase():null;return this.data.billing.plans.map(t=>{let r={default:e===t.name.toLowerCase()};return Object.assign({},t,r)})}return[]}migrate(e){return e}}n.Conformance={openeo:"https://api.openeo.org/extensions/openeo/v1.*",stacCollections:["https://api.stacspec.org/v1.*/collections","https://api.stacspec.org/v1.*/ogcapi-features"],stacItems:"https://api.stacspec.org/v1.*/ogcapi-features",commercialData:"https://api.openeo.org/extensions/commercial-data/0.1.*",federation:"https://api.openeo.org/extensions/federation/0.1.*",processingParameters:"https://api.openeo.org/extensions/processing-parameters/0.1.*",remoteProcessDefinition:"https://api.openeo.org/extensions/remote-process-definition/0.1.*",workspaces:"https://api.openeo.org/extensions/workspaces/0.1.*"},e.exports=n},7704(e,t,r){const s=r(2458),i=r(768),n=r(3659),o=r(2742),a=r(1321),l=r(6147),c=r(933),u=r(3688),p=r(4026),h=r(9405),d=r(9649),f=r(4293),y=r(9806),g=r(5497),m=r(1425),b=r(2804),{CollectionPages:v,ItemPages:w,JobPages:x,ProcessPages:A,ServicePages:j,UserFilePages:O}=r(7226),P=["conformance","http://www.opengis.net/def/rel/ogc/1.0/conformance"];e.exports=class{constructor(e,t={},r=null){this.url=r,this.baseUrl=i.normalizeUrl(e),this.authProviderList=null,this.authProvider=null,this.capabilitiesObject=null,this.listeners={},this.options=t,this.processes=new n([],Boolean(t.addNamespaceToProcess)),this.processes.listeners.push((...e)=>this.emit("processesChanged",...e))}async init(){const e=await this._get("/"),t=Object.assign({},e.data);if(t.links=this.makeLinksAbsolute(t.links,e),!Array.isArray(t.conformsTo)&&Array.isArray(t.links)){const e=this._getLinkHref(t.links,P);if(e){const r=await this._get(e);i.isObject(r.data)&&Array.isArray(r.data.conformsTo)&&(t.conformsTo=r.data.conformsTo)}}return this.capabilitiesObject=new p(t),this.capabilitiesObject}async refreshProcessCache(){if(0===this.processes.count())return;const e=this.processes.namespaces().map(e=>{let t=()=>Promise.resolve();if("user"===e){const e=this.processes.namespace("user");this.isAuthenticated()?this.capabilities().hasFeature("listUserProcesses")&&(t=()=>this.listUserProcesses(e)):t=()=>this.processes.remove(null,"user")?Promise.resolve():Promise.reject(new Error("Can't clear user processes"))}else this.capabilities().hasFeature("listProcesses")&&(t=()=>this.listProcesses(e));return t().catch(t=>console.warn(`Could not update processes for namespace '${e}' due to an error: ${t.message}`))});return await Promise.all(e)}getBaseUrl(){return this.baseUrl}getUrl(){return this.url||this.baseUrl}capabilities(){return this.capabilitiesObject}async listFileTypes(){const e=await this._get("/file_formats");return new h(e.data)}async listProcessingParameters(){return(await this._get("/processing_parameters")).data}async listServiceTypes(){return(await this._get("/service_types")).data}async listUdfRuntimes(){return(await this._get("/udf_runtimes")).data}async listCollections(){const e=this.paginateCollections(null);return await e.nextPage([],!1)}paginateCollections(e=50){return new v(this,e)}async describeCollection(e){const t=await this._get("/collections/"+e);return t.data.stac_version?a.collection(t.data):t.data}listCollectionItems(e,t=null,r=null,s=null){let i={};return Array.isArray(t)&&(i.bbox=t.join(",")),Array.isArray(r)&&(i.datetime=r.map(e=>e instanceof Date?e.toISOString():"string"==typeof e?e:"..").join("/")),s>0&&(i.limit=s),new w(this,e,i,s)}normalizeNamespace(e){const t=e.match(/^https?:\/\/.*\/processes\/(@?[\w\-.~:]+)\/?/i);return t&&t.length>1?t[1]:e}async listProcesses(e=null){const t=this.paginateProcesses(e);return await t.nextPage([],!1)}paginateProcesses(e=null,t=50){return new A(this,t,e)}async describeProcess(e,t=null){if(t||(t="backend"),"backend"===t)await this.listProcesses();else{const r=await this._get(`/processes/${this.normalizeNamespace(t)}/${e}`);if(!i.isObject(r.data)||"string"!=typeof r.data.id)throw new Error("Invalid response received for process");this.processes.add(r.data,t)}return this.processes.get(e,t)}async buildProcess(e){return await this.listProcesses(),new m(this.processes,null,e)}async listAuthProviders(){if(null!==this.authProviderList)return this.authProviderList;this.authProviderList=[];const e=this.capabilities();if(e.hasFeature("authenticateOIDC")){const e=await this._get("/credentials/oidc"),t=this.getOidcProviderFactory();if(i.isObject(e.data)&&Array.isArray(e.data.providers)&&"function"==typeof t)for(let r in e.data.providers){const s=t(e.data.providers[r]);s instanceof l&&this.authProviderList.push(s)}}return e.hasFeature("authenticateBasic")&&this.authProviderList.push(new c(this)),this.authProviderList}setOidcProviderFactory(e){this.oidcProviderFactory=e}getOidcProviderFactory(){return"function"==typeof this.oidcProviderFactory?this.oidcProviderFactory:u.isSupported()?e=>new u(this,e):null}async authenticateBasic(e,t){const r=new c(this);await r.login(e,t)}isAuthenticated(){return null!==this.authProvider}emit(e,...t){"function"==typeof this.listeners[e]&&this.listeners[e](...t)}on(e,t){this.listeners[e]=t}off(e){delete this.listeners[e]}getAuthProvider(){return this.authProvider}setAuthProvider(e){e!==this.authProvider&&(this.authProvider=e instanceof l?e:null,this.emit("authProviderChanged",this.authProvider),this.refreshProcessCache())}setAuthToken(e,t,r){const s=new l(e,this,{id:t,title:"Custom",description:""});return s.setToken(r),this.setAuthProvider(s),s}async describeAccount(){return(await this._get("/me")).data}async listFiles(){const e=this.paginateFiles(null);return await e.nextPage()}paginateFiles(e=50){return new O(this,e)}async uploadFile(e,t=null,r=null,i=null){null===t&&(t=s.fileNameForUpload(e));const n=await this.getFile(t);return await n.uploadFile(e,r,i)}async getFile(e){return new d(this,e)}_normalizeUserProcess(e,t={}){return e instanceof y?e=e.toJSON():e instanceof b?(e.result=!0,e=e.parent.toJSON()):i.isObject(e)&&!i.isObject(e.process_graph)&&(e={process_graph:e}),Object.assign({},t,{process:e})}async validateProcess(e){const t=await this._post("/validation",this._normalizeUserProcess(e).process);if(Array.isArray(t.data.errors)){const e=t.data.errors;return e["federation:backends"]=Array.isArray(t.data["federation:backends"])?t.data["federation:backends"]:[],e}throw new Error("Invalid validation response received.")}async listUserProcesses(e=[]){const t=this.paginateUserProcesses(null);return await t.nextPage(e)}paginateUserProcesses(e=50){return this.paginateProcesses("user",e)}async setUserProcess(e,t){const r=new y(this,e);return await r.replaceUserProcess(t)}async getUserProcess(e){const t=new y(this,e);return await t.describeUserProcess()}async computeResult(e,t=null,r=null,n=null,o={}){const a=this._normalizeUserProcess(e,Object.assign({},o,{plan:t,budget:r})),l=await this._post("/result",a,s.getResponseType(),n),c={data:l.data,costs:null,type:null,logs:[]};"number"==typeof l.headers["openeo-costs"]&&(c.costs=l.headers["openeo-costs"]),"string"==typeof l.headers["content-type"]&&(c.type=l.headers["content-type"]);const u=Array.isArray(l.headers.link)?l.headers.link:[l.headers.link];for(let e of u){if("string"!=typeof e)continue;const t=e.match(/^<([^>]+)>;\s?rel="monitor"/i);if(Array.isArray(t)&&t.length>1)try{const e=await this._get(t[1]);i.isObject(e.data)&&Array.isArray(e.data.logs)&&(c.logs=e.data.logs)}catch(e){console.warn(e)}}return c}async downloadResult(e,t,r=null,i=null,n=null){const o=await this.computeResult(e,r,i,n);await s.saveToFile(o.data,t)}async listJobs(e=[]){const t=this.paginateJobs(null);return await t.nextPage(e)}paginateJobs(e=50){return new x(this,e)}async createJob(e,t=null,r=null,s=null,i=null,n={}){n=Object.assign({},n,{title:t,description:r,plan:s,budget:i});const o=this._normalizeUserProcess(e,n),a=await this._post("/jobs",o);if("string"!=typeof a.headers["openeo-identifier"])throw new Error("Response did not contain a Job ID. Job has likely been created, but may not show up yet.");const l=new f(this,a.headers["openeo-identifier"]).setAll(o);return this.capabilities().hasFeature("describeJob")?await l.describeJob():l}async getJob(e){const t=new f(this,e);return await t.describeJob()}async listServices(e=[]){const t=this.paginateServices(null);return await t.nextPage(e)}paginateServices(e=50){return new j(this,e)}async createService(e,t,r=null,s=null,i=!0,n={},o=null,a=null,l={}){const c=this._normalizeUserProcess(e,Object.assign({title:r,description:s,type:t,enabled:i,configuration:n,plan:o,budget:a},l)),u=await this._post("/services",c);if("string"!=typeof u.headers["openeo-identifier"])throw new Error("Response did not contain a Service ID. Service has likely been created, but may not show up yet.");const p=new g(this,u.headers["openeo-identifier"]).setAll(c);return this.capabilities().hasFeature("describeService")?p.describeService():p}async getService(e){const t=new g(this,e);return await t.describeService()}_getLinkHref(e,t){if(Array.isArray(t)||(t=[t]),Array.isArray(e)){const r=e.find(e=>i.isObject(e)&&t.includes(e.rel)&&"string"==typeof e.href);if(r)return r.href}return null}makeLinksAbsolute(e,t=null){if(!Array.isArray(e))return e;let r=null;return r=i.isObject(t)&&t.headers&&t.config&&t.request?t.config.baseURL+t.config.url:"string"!=typeof t?this._getLinkHref(e,"self"):t,r?e.map(e=>{if(!i.isObject(e)||"string"!=typeof e.href)return e;try{const t=new URL(e.href,r);return Object.assign({},e,{href:t.toString()})}catch(t){return e}}):e}async _get(e,t,r,s=null){return await this._send({method:"get",responseType:r,url:e,timeout:"/"===e?5e3:0,params:t},s)}async _post(e,t,r,s=null){const i={method:"post",responseType:r,url:e,data:t};return await this._send(i,s)}async _put(e,t){return await this._send({method:"put",url:e,data:t})}async _patch(e,t){return await this._send({method:"patch",url:e,data:t})}async _delete(e){return await this._send({method:"delete",url:e})}async download(e,t){return(await this._send({method:"get",responseType:s.getResponseType(),url:e,authorization:t})).data}_getAuthHeaders(){const e={};return this.isAuthenticated()&&(e.Authorization="Bearer "+this.authProvider.getToken()),e}async _send(e,t=null){e.baseURL=this.baseUrl,void 0!==e.authorization&&!0!==e.authorization||(e.headers||(e.headers={}),Object.assign(e.headers,this._getAuthHeaders())),e.responseType||(e.responseType="json"),t&&(e.signal=t.signal);try{let t=await o(e);const r=this.capabilities();return r&&(t=r.migrate(t)),t}catch(t){if(o.isCancel(t))throw t;const r=e=>"string"==typeof e&&-1!==e.indexOf("/json"),n=(e,t)=>("string"==typeof t.message&&(e.message=t.message),e.code="string"==typeof t.code?t.code:"",e.id=t.id,e.links=Array.isArray(t.links)?t.links:[],e);if(i.isObject(t.response)&&i.isObject(t.response.data)&&(r(t.response.data.type)||i.isObject(t.response.headers)&&r(t.response.headers["content-type"]))){if(e.responseType!==s.getResponseType())throw n(t,t.response.data);try{throw n(t,await s.handleErrorResponse(t))}catch(e){console.error(e)}}throw t}}}},9405(e,t,r){const s=r(768);e.exports=class{constructor(e){if(this.data={input:{},output:{}},s.isObject(e)){for(let t of["input","output"])for(let r in e[t])s.isObject(e[t])&&(this.data[t][r.toUpperCase()]=e[t][r]);this["federation:missing"]=e["federation:missing"]}}toJSON(){return this.data}getInputTypes(){return this.data.input}getOutputTypes(){return this.data.output}getInputType(e){return this._findType(e,"input")}getOutputType(e){return this._findType(e,"output")}_findType(e,t){return(e=e.toUpperCase())in this.data[t]?this.data[t][e]:null}}},4293(e,t,r){const s=r(2458),i=r(3054),n=r(2431),o=r(768),a=r(1321),l=["finished","canceled","error"];e.exports=class extends i{constructor(e,t){super(e,["id","title","description","process","status","progress","created","updated","plan","costs","budget","usage",["log_level","logLevel"],"links"]),this.id=t,this.title=void 0,this.description=void 0,this.process=void 0,this.status=void 0,this.progress=void 0,this.created=void 0,this.updated=void 0,this.plan=void 0,this.costs=void 0,this.budget=void 0}async describeJob(){let e=await this.connection._get("/jobs/"+this.id);return this.setAll(e.data)}async updateJob(e){return await this.connection._patch("/jobs/"+this.id,this._convertToRequest(e)),this._supports("describeJob")?await this.describeJob():this.setAll(e)}async deleteJob(){await this.connection._delete("/jobs/"+this.id)}async estimateJob(){return(await this.connection._get("/jobs/"+this.id+"/estimate")).data}debugJob(e=null){return new n(this.connection,"/jobs/"+this.id+"/logs",e)}monitorJob(e,t=60,r=!0){if("function"!=typeof e||t<1)return;let s=this.connection.capabilities();if(!s.hasFeature("describeJob"))throw new Error("Monitoring Jobs not supported by the back-end.");let i=this.status,n=null,o=null;s.hasFeature("debugJob")&&r&&(o=this.debugJob());let a=async()=>{this.getDataAge()>1&&await this.describeJob();let t=o?await o.nextLogs():[];(i!==this.status||t.length>0)&&e(this,t),i=this.status,l.includes(this.status)&&c()};setTimeout(a,0),n=setInterval(a,1e3*t);let c=()=>{n&&(clearInterval(n),n=null)};return c}async startJob(){return await this.connection._post("/jobs/"+this.id+"/results",{}),this._supports("describeJob")?await this.describeJob():this}async stopJob(){return await this.connection._delete("/jobs/"+this.id+"/results"),this._supports("describeJob")?await this.describeJob():this}async getResultsAsStac(){let e=await this.connection._get("/jobs/"+this.id+"/results");if(!o.isObject(e)||!o.isObject(e.data))throw new Error("Results received from the back-end are invalid");let t=a.stac(e.data);return o.isObject(t.assets)||(t.assets={}),"Feature"===t.type?"number"==typeof e.headers["openeo-costs"]&&(t.properties.costs=e.headers["openeo-costs"]):"number"==typeof e.headers["openeo-costs"]&&(t.costs=e.headers["openeo-costs"]),t}async listResults(){let e=await this.getResultsAsStac();return o.isObject(e.assets)?Object.values(e.assets):[]}async downloadResults(e){let t=await this.listResults();return await s.downloadResults(this.connection,t,e)}}},2431(e,t,r){const s=r(768);e.exports=class{constructor(e,t,r=null){this.connection=e,this.endpoint=t,this.lastId="",this.level=r,this.missing=new Set}async nextLogs(e=null){let t=await this.next(e);return Array.isArray(t.logs)?t.logs:[]}getMissingBackends(){return Array.from(this.missing)}async next(e=null){let t={offset:this.lastId};e>0&&(t.limit=e),this.level&&(t.level=this.level);let r=await this.connection._get(this.endpoint,t);return Array.isArray(r.data.logs)&&r.data.logs.length>0?(r.data.logs=r.data.logs.filter(e=>s.isObject(e)&&"string"==typeof e.id),this.lastId=r.data.logs[r.data.logs.length-1].id):r.data.logs=[],r.data.links=Array.isArray(r.data.links)?r.data.links:[],Array.isArray(r.data["federation:missing"])&&r.data["federation:missing"].forEach(e=>this.missing.add(e)),r.data}}},3688(e,t,r){const s=r(768),i=r(6147),n=r(2458),o=r(2117);class a extends i{static isSupported(){return s.isObject(o)&&Boolean(o.UserManager)}static async signinCallback(e=null,t={}){let r=n.getUrl();e||(e=new a(null,{})).setGrant(r.includes("?")?"authorization_code+pkce":"implicit");let s=e.getOptions(t),i=new o.UserManager(s);return await i.signinCallback(r)}constructor(e,t){super("oidc",e,t),this.manager=null,this.listeners={},this.user=null,this.clientId=null,this.grant="authorization_code+pkce",this.issuer=t.issuer||"",this.scopes=Array.isArray(t.scopes)&&t.scopes.length>0?t.scopes:["openid"],this.refreshTokenScope="offline_access",this.links=Array.isArray(t.links)?t.links:[],this.defaultClients=Array.isArray(t.default_clients)?t.default_clients:[],this.authorizationParameters=s.isObject(t.authorization_parameters)?t.authorization_parameters:{},this.defaultClient=this.detectDefaultClient()}addListener(e,t,r="default"){this.manager.events[`add${e}`](t),this.listeners[`${r}:${e}`]=t}removeListener(e,t="default"){this.manager.events[`remove${e}`](this.listeners[e]),delete this.listeners[`${t}:${e}`]}async login(e={},t=!1){if(!this.issuer||"string"!=typeof this.issuer)throw new Error("No Issuer URL available for OpenID Connect");this.manager=new o.UserManager(this.getOptions(e,t)),this.addListener("UserLoaded",async()=>this.setUser(await this.manager.getUser()),"js-client"),this.addListener("AccessTokenExpired",()=>this.setUser(null),"js-client"),"popup"===a.uiMethod?await this.manager.signinPopup():await this.manager.signinRedirect()}async logout(){if(null!==this.manager){try{"popup"===a.uiMethod?await this.manager.signoutPopup():await this.manager.signoutRedirect({post_logout_redirect_uri:n.getUrl()})}catch(e){console.warn(e)}super.logout(),this.removeListener("UserLoaded","js-client"),this.removeListener("AccessTokenExpired","js-client"),this.manager=null,this.setUser(null)}}getOptions(e={},t=!1){let r=this.getResponseType(),s=this.scopes.slice(0);return t&&!s.includes(this.refreshTokenScope)&&s.push(this.refreshTokenScope),Object.assign({client_id:this.clientId,redirect_uri:a.redirectUrl,authority:this.issuer.replace("/.well-known/openid-configuration",""),scope:s.join(" "),validateSubOnSilentRenew:!0,response_type:r,response_mode:r.includes("code")?"query":"fragment",extraQueryParams:this.authorizationParameters},e)}getResponseType(){switch(this.grant){case"authorization_code+pkce":return"code";case"implicit":return"token id_token";default:throw new Error("Grant Type not supported")}}setGrant(e){switch(e){case"authorization_code+pkce":case"implicit":this.grant=e;break;default:throw new Error("Grant Type not supported")}}setClientId(e){this.clientId=e}setUser(e){e?(this.user=e,this.setToken(e.access_token)):(this.user=null,this.setToken(null))}getDisplayName(){return this.user&&s.isObject(this.user.profile)&&(this.user.profile.name||this.user.profile.preferred_username||this.user.profile.email)||null}detectDefaultClient(){for(let e of a.grants){let t=this.defaultClients.find(t=>Boolean(t.grant_types.includes(e)&&Array.isArray(t.redirect_urls)&&t.redirect_urls.find(e=>e.startsWith(a.redirectUrl))));if(t)return this.setGrant(e),this.setClientId(t.id),this.defaultClient=t,t}return null}}a.uiMethod="redirect",a.redirectUrl=n.getUrl().split("#")[0].split("?")[0].replace(/\/$/,""),a.grants=["authorization_code+pkce","implicit"],e.exports=a},1224(e,t,r){const s=r(2742),i=r(768),n=r(3304),o=r(7704),a=r(4293),l=r(2431),c=r(9649),u=r(9806),p=r(5497),h=r(6147),d=r(933),f=r(3688),y=r(4026),g=r(9405),m=r(1425),b=r(2804),v=r(7897),w=r(2212),x="1.0.0-rc.2",A="1.x.x";class j{static async connect(e,t={}){let r=i.normalizeUrl(e,"/.well-known/openeo"),o=e,a=null;try{if(a=await s.get(r,{timeout:5e3}),!i.isObject(a.data)||!Array.isArray(a.data.versions))throw new Error("Well-Known Document doesn't list any versions.")}catch(e){console.warn("Can't read well-known document, connecting directly to the specified URL as fallback mechanism. Reason: "+e.message)}if(i.isObject(a)){let e=n.findLatest(a.data.versions,!0,x,A);if(null===e)throw new Error("Server not supported. Client only supports the API versions between "+x+" and "+A);o=e.url}let l=await j.connectDirect(o,t);return l.url=e,l}static async connectDirect(e,t={}){let r=new o(e,t),s=await r.init();if(n.compare(s.apiVersion(),x,"<")||n.compare(s.apiVersion(),A,">"))throw new Error("Client only supports the API versions between "+x+" and "+A);return r}static clientVersion(){return"2.10.0"}}j.Environment=r(2458),e.exports={AbortController,AuthProvider:h,BasicProvider:d,Capabilities:y,Connection:o,FileTypes:g,Job:a,Logs:l,OidcProvider:f,OpenEO:j,Service:p,UserFile:c,UserProcess:u,Builder:m,BuilderNode:b,Parameter:v,Formula:w}},7226(e,t,r){const s=r(4293),i=r(5497),n=r(9649),o=r(9806),a=r(768),l=r(1321),c="federation:missing";class u{constructor(e,t,r,s,i={},n="id"){this.connection=e,this.nextUrl=t,this.key=r,this.primaryKey=n,this.cls=s,i.limit>0||delete i.limit,this.params=i}hasNextPage(){return null!==this.nextUrl}async nextPage(e=[],t=!0){const r=await this.connection._get(this.nextUrl,this.params);let s=r.data;if(!a.isObject(s))throw new Error("Response is invalid, is not an object");if(!Array.isArray(s[this.key]))throw new Error(`Response is invalid, '${this.key}' property is not an array`);let i=s[this.key].map(t=>{let r=e.find(e=>e[this.primaryKey]===t[this.primaryKey]);return r?r.setAll(t):r=this._createObject(t),r});return i=this._cache(i),s.links=this._ensureArray(s.links),this.connection._getLinkHref(s.links,"self")||s.links.push({rel:"self",href:this.nextUrl}),this.nextUrl=this._getNextLink(r),this.params=null,t?(i.links=s.links,i[c]=this._ensureArray(s[c]),i):(s[this.key]=i,s)}_ensureArray(e){return Array.isArray(e)?e:[]}_createObject(e){if(this.cls){const t=new(0,this.cls)(this.connection,e[this.primaryKey]);return t.setAll(e),t}return e}_cache(e){return e}_getNextLink(e){const t=this.connection.makeLinksAbsolute(e.data.links,e);return this.connection._getLinkHref(t,"next")}[Symbol.asyncIterator](){return{self:this,async next(){const e=!this.self.hasNextPage();let t;return e||(t=await this.self.nextPage()),{done:e,value:t}}}}}e.exports={Pages:u,CollectionPages:class extends u{constructor(e,t=null){super(e,"/collections","collections",null,{limit:t})}_createObject(e){return e.stac_version?l.collection(e):e}},ItemPages:class extends u{constructor(e,t,r){super(e,`/collections/${t}/items`,"features",null,r)}_createObject(e){return e.stac_version?l.item(e):e}},JobPages:class extends u{constructor(e,t=null){super(e,"/jobs","jobs",s,{limit:t})}},ProcessPages:class extends u{constructor(e,t=null,r=null){let s;r||(r="backend");let i=null;"user"===r?(s="/process_graphs",i=o):(s="/processes","backend"!==r&&(s+=`/${e.normalizeNamespace(r)}`)),super(e,s,"processes",i,{limit:t}),this.namespace=r}_cache(e){const t=e.map(e=>"function"==typeof e.toJSON?e.toJSON():e);if(this.connection.processes.addAll(t,this.namespace),!this.cls)for(let t in e)e[t]=this.connection.processes.get(e[t].id,this.namespace);return e}},ServicePages:class extends u{constructor(e,t=null){super(e,"/services","services",i,{limit:t})}},UserFilePages:class extends u{constructor(e,t=null){super(e,"/files","files",n,{limit:t},"path")}}}},5497(e,t,r){const s=r(3054),i=r(2431);e.exports=class extends s{constructor(e,t){super(e,["id","title","description","process","url","type","enabled","configuration","attributes","created","plan","costs","budget","usage",["log_level","logLevel"],"links"]),this.id=t,this.title=void 0,this.description=void 0,this.process=void 0,this.url=void 0,this.type=void 0,this.enabled=void 0,this.configuration=void 0,this.attributes=void 0,this.created=void 0,this.plan=void 0,this.costs=void 0,this.budget=void 0}async describeService(){let e=await this.connection._get("/services/"+this.id);return this.setAll(e.data)}async updateService(e){return await this.connection._patch("/services/"+this.id,this._convertToRequest(e)),this._supports("describeService")?await this.describeService():this.setAll(e)}async deleteService(){await this.connection._delete("/services/"+this.id)}debugService(e=null){return new i(this.connection,"/services/"+this.id+"/logs",e)}monitorService(e,t=60,r=!0){if("function"!=typeof e||t<1)return;let s=this.connection.capabilities();if(!s.hasFeature("describeService"))throw new Error("Monitoring Services not supported by the back-end.");let i=this.enabled,n=null,o=null;s.hasFeature("debugService")&&r&&(o=this.debugService());let a=async()=>{this.getDataAge()>1&&await this.describeService();let t=o?await o.nextLogs():[];(i!==this.enabled||t.length>0)&&e(this,t),i=this.enabled};return setTimeout(a,0),n=setInterval(a,1e3*t),()=>{n&&(clearInterval(n),n=null)}}}},9649(e,t,r){const s=r(2458),i=r(3054);e.exports=class extends i{constructor(e,t){super(e,["path","size","modified"]),this.path=t,this.size=void 0,this.modified=void 0}async retrieveFile(){return await this.connection.download("/files/"+this.path,!0)}async downloadFile(e){let t=await this.connection.download("/files/"+this.path,!0);return await s.saveToFile(t,e)}async uploadFile(e,t=null,r=null){let i={method:"put",url:"/files/"+this.path,data:s.dataForUpload(e),headers:{"Content-Type":"application/octet-stream"}};"function"==typeof t&&(i.onUploadProgress=e=>{let r=Math.round(100*e.loaded/e.total);t(r,this)});let n=await this.connection._send(i,r);return this.setAll(n.data)}async deleteFile(){await this.connection._delete("/files/"+this.path)}}},9806(e,t,r){const s=r(3054),i=r(768);e.exports=class extends s{constructor(e,t){super(e,["id","summary","description","categories","parameters","returns","deprecated","experimental","exceptions","examples","links",["process_graph","processGraph"]]),this.id=t,this.summary=void 0,this.description=void 0,this.categories=void 0,this.parameters=void 0,this.returns=void 0,this.deprecated=void 0,this.experimental=void 0,this.exceptions=void 0,this.examples=void 0,this.links=void 0,this.processGraph=void 0}async describeUserProcess(){let e=await this.connection._get("/process_graphs/"+this.id);if(!i.isObject(e.data)||"string"!=typeof e.data.id)throw new Error("Invalid response received for user process");return this.connection.processes.add(e.data,"user"),this.setAll(e.data)}async replaceUserProcess(e){if(await this.connection._put("/process_graphs/"+this.id,this._convertToRequest(e)),this._supports("describeUserProcess"))return this.describeUserProcess();{let t=this.setAll(e);return this.connection.processes.add(t.toJSON(),"user"),t}}async deleteUserProcess(){await this.connection._delete("/process_graphs/"+this.id),this.connection.processes.remove(this.id,"user")}}},3144(e,t,r){"use strict";var s=r(6743),i=r(1002),n=r(76),o=r(7119);e.exports=o||s.call(n,i)},2205(e,t,r){"use strict";var s=r(6743),i=r(1002),n=r(3144);e.exports=function(){return n(s,i,arguments)}},1002(e){"use strict";e.exports=Function.prototype.apply},76(e){"use strict";e.exports=Function.prototype.call},3126(e,t,r){"use strict";var s=r(6743),i=r(9675),n=r(76),o=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return o(s,n,e)}},7119(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},8075(e,t,r){"use strict";var s=r(453),i=r(487),n=i(s("String.prototype.indexOf"));e.exports=function(e,t){var r=s(e,!!t);return"function"==typeof r&&n(e,".prototype.")>-1?i(r):r}},487(e,t,r){"use strict";var s=r(6897),i=r(655),n=r(3126),o=r(2205);e.exports=function(e){var t=n(arguments),r=e.length-(arguments.length-1);return s(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:o}):e.exports.apply=o},6556(e,t,r){"use strict";var s=r(453),i=r(3126),n=i([s("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=s(e,!!t);return"function"==typeof r&&n(e,".prototype.")>-1?i([r]):r}},8385(e,t,r){"use strict";r.r(t),r.d(t,{compare:()=>u,compareVersions:()=>c,satisfies:()=>f,validate:()=>y,validateStrict:()=>g});const s=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,i=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(s);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},n=e=>"*"===e||"x"===e||"X"===e,o=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},a=(e,t)=>{if(n(e)||n(t))return 0;const[r,s]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(o(e),o(t));return r>s?1:r<s?-1:0},l=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const s=a(e[r]||"0",t[r]||"0");if(0!==s)return s}return 0},c=(e,t)=>{const r=i(e),s=i(t),n=r.pop(),o=s.pop(),a=l(r,s);return 0!==a?a:n&&o?l(n.split("."),o.split(".")):n||o?n?-1:1:0},u=(e,t,r)=>{d(r);const s=c(e,t);return p[r].includes(s)},p={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},h=Object.keys(p),d=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===h.indexOf(e))throw new Error(`Invalid operator, expected one of ${h.join("|")}`)},f=(e,t)=>{if((t=t.replace(/([><=]+)\s+/g,"$1")).includes("||"))return t.split("||").some(t=>f(e,t));if(t.includes(" - ")){const[r,s]=t.split(" - ",2);return f(e,`>=${r} <=${s}`)}if(t.includes(" "))return t.trim().replace(/\s{2,}/g," ").split(" ").every(t=>f(e,t));const r=t.match(/^([<>=~^]+)/),s=r?r[1]:"=";if("^"!==s&&"~"!==s)return u(e,t,s);const[n,o,a,,c]=i(e),[p,h,d,,y]=i(t),g=[n,o,a],m=[p,null!=h?h:"x",null!=d?d:"x"];if(y){if(!c)return!1;if(0!==l(g,m))return!1;if(-1===l(c.split("."),y.split(".")))return!1}const b=m.findIndex(e=>"0"!==e)+1,v="~"===s?2:b>1?b:1;return 0===l(g.slice(0,v),m.slice(0,v))&&-1!==l(g.slice(v),m.slice(v))},y=e=>"string"==typeof e&&/^[v\d]/.test(e)&&s.test(e),g=e=>"string"==typeof e&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(e)},41(e,t,r){"use strict";var s=r(655),i=r(8068),n=r(9675),o=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new n("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new n("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],p=!!o&&o(e,t);if(s)s(e,t,{configurable:null===c&&p?p.configurable:!c,enumerable:null===a&&p?p.enumerable:!a,value:r,writable:null===l&&p?p.writable:!l});else{if(!u&&(a||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},8452(e,t,r){"use strict";var s=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),n=Object.prototype.toString,o=Array.prototype.concat,a=r(41),l=r(592)(),c=function(e,t,r,s){if(t in e)if(!0===s){if(e[t]===r)return}else if("function"!=typeof(i=s)||"[object Function]"!==n.call(i)||!s())return;var i;l?a(e,t,r,!0):a(e,t,r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},n=s(t);i&&(n=o.call(n,Object.getOwnPropertySymbols(t)));for(var a=0;a<n.length;a+=1)c(e,n[a],t[n[a]],r[n[a]])};u.supportsDescriptors=!!l,e.exports=u},7176(e,t,r){"use strict";var s,i=r(3126),n=r(5795);try{s=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!s&&n&&n(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},655(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1237(e){"use strict";e.exports=EvalError},9383(e){"use strict";e.exports=Error},9290(e){"use strict";e.exports=RangeError},9538(e){"use strict";e.exports=ReferenceError},8068(e){"use strict";e.exports=SyntaxError},9675(e){"use strict";e.exports=TypeError},5345(e){"use strict";e.exports=URIError},9612(e){"use strict";e.exports=Object},9252(e){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var s,i,n;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(i=s;0!==i--;)if(!e(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],r.get(i[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((s=t.length)!=r.length)return!1;for(i=s;0!==i--;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((s=(n=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=s;0!==i--;)if(!Object.prototype.hasOwnProperty.call(r,n[i]))return!1;for(i=s;0!==i--;){var o=n[i];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},2682(e,t,r){"use strict";var s=r(9600),i=Object.prototype.toString,n=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!s(t))throw new TypeError("iterator must be a function");var o,a;arguments.length>=3&&(o=r),a=e,"[object Array]"===i.call(a)?function(e,t,r){for(var s=0,i=e.length;s<i;s++)n.call(e,s)&&(null==r?t(e[s],s,e):t.call(r,e[s],s,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var s=0,i=e.length;s<i;s++)null==r?t(e.charAt(s),s,e):t.call(r,e.charAt(s),s,e)}(e,t,o):function(e,t,r){for(var s in e)n.call(e,s)&&(null==r?t(e[s],s,e):t.call(r,e[s],s,e))}(e,t,o)}},9353(e){"use strict";var t=Object.prototype.toString,r=Math.max,s=function(e,t){for(var r=[],s=0;s<e.length;s+=1)r[s]=e[s];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var n,o=function(e){for(var t=[],r=1,s=0;r<e.length;r+=1,s+=1)t[s]=e[r];return t}(arguments),a=r(0,i.length-o.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(n=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var t=i.apply(this,s(o,arguments));return Object(t)===t?t:this}return i.apply(e,s(o,arguments))}),i.prototype){var u=function(){};u.prototype=i.prototype,n.prototype=new u,u.prototype=null}return n}},6743(e,t,r){"use strict";var s=r(9353);e.exports=Function.prototype.bind||s},453(e,t,r){"use strict";var s,i=r(9612),n=r(9383),o=r(1237),a=r(9290),l=r(9538),c=r(8068),u=r(9675),p=r(5345),h=r(1514),d=r(8968),f=r(6188),y=r(8002),g=r(5880),m=r(414),b=r(3093),v=Function,w=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch(e){}},x=r(5795),A=r(655),j=function(){throw new u},O=x?function(){try{return j}catch(e){try{return x(arguments,"callee").get}catch(e){return j}}}():j,P=r(4039)(),_=r(3628),S=r(1064),k=r(8648),E=r(1002),C=r(76),T={},U="undefined"!=typeof Uint8Array&&_?_(Uint8Array):s,F={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?s:ArrayBuffer,"%ArrayIteratorPrototype%":P&&_?_([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":"undefined"==typeof Atomics?s:Atomics,"%BigInt%":"undefined"==typeof BigInt?s:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?s:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?s:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?s:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?s:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?s:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":T,"%Int8Array%":"undefined"==typeof Int8Array?s:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?s:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":P&&_?_(_([][Symbol.iterator]())):s,"%JSON%":"object"==typeof JSON?JSON:s,"%Map%":"undefined"==typeof Map?s:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&P&&_?_((new Map)[Symbol.iterator]()):s,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?s:Promise,"%Proxy%":"undefined"==typeof Proxy?s:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?s:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?s:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&P&&_?_((new Set)[Symbol.iterator]()):s,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":P&&_?_(""[Symbol.iterator]()):s,"%Symbol%":P?Symbol:s,"%SyntaxError%":c,"%ThrowTypeError%":O,"%TypedArray%":U,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?s:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?s:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?s:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?s:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?s:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?s:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?s:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":E,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":S,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":f,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":b,"%Reflect.getPrototypeOf%":k};if(_)try{null.error}catch(e){var I=_(_(e));F["%Error.prototype%"]=I}var R=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var s=e("%AsyncGeneratorFunction%");s&&(r=s.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&_&&(r=_(i.prototype))}return F[t]=r,r},N={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},J=r(6743),z=r(9957),M=J.call(C,Array.prototype.concat),$=J.call(E,Array.prototype.splice),B=J.call(C,String.prototype.replace),L=J.call(C,String.prototype.slice),D=J.call(C,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,H=function(e,t){var r,s=e;if(z(N,s)&&(s="%"+(r=N[s])[0]+"%"),z(F,s)){var i=F[s];if(i===T&&(i=R(s)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:s,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===D(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=L(e,0,1),r=L(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var s=[];return B(e,G,function(e,t,r,i){s[s.length]=r?B(i,V,"$1"):t||e}),s}(e),s=r.length>0?r[0]:"",i=H("%"+s+"%",t),n=i.name,o=i.value,a=!1,l=i.alias;l&&(s=l[0],$(r,M([0,1],l)));for(var p=1,h=!0;p<r.length;p+=1){var d=r[p],f=L(d,0,1),y=L(d,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new c("property names with quotes must have matching quotes");if("constructor"!==d&&h||(a=!0),z(F,n="%"+(s+="."+d)+"%"))o=F[n];else if(null!=o){if(!(d in o)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(x&&p+1>=r.length){var g=x(o,d);o=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[d]}else h=z(o,d),o=o[d];h&&!a&&(F[n]=o)}}return o}},1064(e,t,r){"use strict";var s=r(9612);e.exports=s.getPrototypeOf||null},8648(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},3628(e,t,r){"use strict";var s=r(8648),i=r(1064),n=r(7176);e.exports=s?function(e){return s(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:n?function(e){return n(e)}:null},6549(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},5795(e,t,r){"use strict";var s=r(6549);if(s)try{s([],"length")}catch(e){s=null}e.exports=s},592(e,t,r){"use strict";var s=r(655),i=function(){return!!s};i.hasArrayLengthDefineBug=function(){if(!s)return null;try{return 1!==s([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},4039(e,t,r){"use strict";var s="undefined"!=typeof Symbol&&Symbol,i=r(1333);e.exports=function(){return"function"==typeof s&&"function"==typeof Symbol&&"symbol"==typeof s("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var s in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(e,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},9092(e,t,r){"use strict";var s=r(1333);e.exports=function(){return s()&&!!Symbol.toStringTag}},9957(e,t,r){"use strict";var s=Function.prototype.call,i=Object.prototype.hasOwnProperty,n=r(6743);e.exports=n.call(s,i)},9600(e){"use strict";var t,r,s=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var n=/^\s*class\b/,o=function(e){try{var t=s.call(e);return n.test(t)}catch(e){return!1}},a=function(e){try{return!o(e)&&(s.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),p=function(){return!1};if("object"==typeof document){var h=document.all;l.call(h)===l.call(document.all)&&(p=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!o(e)&&a(e)}:function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(o(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},4035(e,t,r){"use strict";var s,i=r(6556),n=r(9092)(),o=r(9957),a=r(5795);if(n){var l=i("RegExp.prototype.exec"),c={},u=function(){throw c},p={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(p[Symbol.toPrimitive]=u),s=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!t||!o(t,"value"))return!1;try{l(e,p)}catch(e){return e===c}}}else{var h=i("Object.prototype.toString");s=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=s},1514(e){"use strict";e.exports=Math.abs},8968(e){"use strict";e.exports=Math.floor},3331(e,t,r){"use strict";var s=r(4459);e.exports=function(e){return("number"==typeof e||"bigint"==typeof e)&&!s(e)&&e!==1/0&&e!==-1/0}},7440(e,t,r){"use strict";var s=r(1514),i=r(8968),n=r(4459),o=r(3331);e.exports=function(e){if("number"!=typeof e||n(e)||!o(e))return!1;var t=s(e);return i(t)===t}},4459(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},6188(e){"use strict";e.exports=Math.max},8002(e){"use strict";e.exports=Math.min},1350(e,t,r){"use strict";var s=r(8968);e.exports=function(e,t){var r=e%t;return s(r>=0?r:r+t)}},5880(e){"use strict";e.exports=Math.pow},414(e){"use strict";e.exports=Math.round},3093(e,t,r){"use strict";var s=r(4459);e.exports=function(e){return s(e)||0===e?e:e<0?-1:1}},8875(e,t,r){"use strict";var s;if(!Object.keys){var i=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=r(1093),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();s=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===n.call(e),s=o(e),a=t&&"[object String]"===n.call(e),h=[];if(!t&&!r&&!s)throw new TypeError("Object.keys called on a non-object");var f=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)h.push(String(y));if(s&&e.length>0)for(var g=0;g<e.length;++g)h.push(String(g));else for(var m in e)f&&"prototype"===m||!i.call(e,m)||h.push(String(m));if(l)for(var b=function(e){if("undefined"==typeof window||!d)return p(e);try{return p(e)}catch(e){return!1}}(e),v=0;v<u.length;++v)b&&"constructor"===u[v]||!i.call(e,u[v])||h.push(u[v]);return h}}e.exports=s},1189(e,t,r){"use strict";var s=Array.prototype.slice,i=r(1093),n=Object.keys,o=n?function(e){return n(e)}:r(8875),a=Object.keys;o.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(s.call(e)):a(e)})}else Object.keys=o;return Object.keys||o},e.exports=o},1093(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),s="[object Arguments]"===r;return s||(s="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),s}},6460(e,t,r){"use strict";var s=r(4210),i=r(6698),n=r(2114),o=r(6156),a=r(3519),l=r(2161),c=r(3703),u=r(9675),p=r(2656),h=r(2682),d=r(9721),f=d(/^\s$/),y=d(/^[\n\r\u2028\u2029]$/),g={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r",__proto__:null};e.exports=function(e){if(!p(e))throw new u("Assertion failed: `c` must be a valid Unicode code point");var t=a(e);if(i("^$\\.*+?()[]{}|",t,0)>-1||"/"===t)return"\\"+t;if(t in g)return"\\"+g[t];if(i(",-=<>#&!%:;@~'`\"",t,0)>-1||f(t)||y(t)||l(e)||c(e)){if(e<255){var r=s(e,16);return"\\x"+n(r,2,"0","START")}var d="";return h(t,function(e){d+=o(e)}),d}return t}},3835(e,t,r){"use strict";var s=r(6460),i=r(4210),n=r(280),o=r(9721),a=r(2682),l=r(9675),c=o(/^[\da-zA-Z]$/),u=r(8075)("String.prototype.charCodeAt"),p=function(e){var t=u(e,0);if(t<55296||t>56319||1===e.length)return t;var r=u(e,1);return r<56320||r>57343?t:1024*(t-55296)+(r-56320)+65536};e.exports=function(e){if("string"!=typeof e)throw new l("`S` must be a String");var t="",r=n(e);return a(r,function(e){if(""===t&&c(e)){var r=i(p(e),16);t+="\\x"+r}else t+=s(p(e))}),t}},6117(e,t,r){"use strict";var s=r(8452),i=r(487),n=r(3835),o=r(1570),a=r(0),l=i(n,null);s(l,{getPolyfill:o,implementation:n,method:n,shim:a}),e.exports=l},1570(e,t,r){"use strict";var s=r(3835);e.exports=function(){return RegExp.escape||s}},0(e,t,r){"use strict";var s=r(8452),i=r(1570)();e.exports=function(){return s(RegExp,{escape:i}),RegExp.escape}},9721(e,t,r){"use strict";var s=r(6556),i=r(4035),n=s("RegExp.prototype.exec"),o=r(9675);e.exports=function(e){if(!i(e))throw new o("`regex` must be a RegExp");return function(t){return null!==n(e,t)}}},6897(e,t,r){"use strict";var s=r(453),i=r(41),n=r(592)(),o=r(5795),a=r(9675),l=s("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],s=!0,c=!0;if("length"in e&&o){var u=o(e,"length");u&&!u.configurable&&(s=!1),u&&!u.writable&&(c=!1)}return(s||c||!r)&&(n?i(e,"length",t,!0,!0):i(e,"length",t)),e}},2117(e){"use strict";e.exports=t},2742(t){"use strict";t.exports=e},7312(e,t,r){"use strict";var s=r(9675),i=r(6556),n=r(2161),o=r(3703),a=r(3254),l=i("String.prototype.charAt"),c=i("String.prototype.charCodeAt");e.exports=function(e,t){if("string"!=typeof e)throw new s("Assertion failed: `string` must be a String");var r=e.length;if(t<0||t>=r)throw new s("Assertion failed: `position` must be >= 0, and < the length of `string`");var i=c(e,t),u=l(e,t),p=n(i),h=o(i);if(!p&&!h)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(h||t+1===r)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=c(e,t+1);return o(d)?{"[[CodePoint]]":a(i,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4210(e,t,r){"use strict";var s=r(9675),i=r(6556),n=r(7440),o=i("Number.prototype.toString");e.exports=function(e,t){if("number"!=typeof e)throw new s("Assertion failed: `x` must be a Number");if(!n(t)||t<2||t>36)throw new s("Assertion failed: `radix` must be an integer >= 2 and <= 36");return o(e,t)}},6698(e,t,r){"use strict";var s=r(6556),i=r(9675),n=r(7440),o=s("String.prototype.slice");e.exports=function(e,t,r){if("string"!=typeof e)throw new i("Assertion failed: `string` must be a String");if("string"!=typeof t)throw new i("Assertion failed: `searchValue` must be a String");if(!n(r)||r<0)throw new i("Assertion failed: `fromIndex` must be a non-negative integer");var s=e.length;if(""===t&&r<=s)return r;for(var a=t.length,l=r;l<=s-a;l+=1)if(o(e,l,l+a)===t)return l;return-1}},2114(e,t,r){"use strict";var s=r(9675),i=r(6556),n=r(7440),o=i("String.prototype.slice");e.exports=function(e,t,r,i){if("string"!=typeof e)throw new s("Assertion failed: `S` must be a String");if(!n(t)||t<0)throw new s("Assertion failed: `maxLength` must be a non-negative integer");if("string"!=typeof r)throw new s("Assertion failed: `fillString` must be a String");if("start"!==i&&"end"!==i&&"START"!==i&&"END"!==i)throw new s("Assertion failed: `placement` must be ~START~ or ~END~");var a=e.length;if(t<=a)return e;if(""===r)return e;for(var l=t-a,c="";c.length<l;)c+=r;return c=o(c,0,l),"start"===i||"START"===i?c+e:e+c}},280(e,t,r){"use strict";var s=r(9675),i=r(7312);e.exports=function(e){if("string"!=typeof e)throw new s("Assertion failed: `string` must be a String");for(var t=[],r=e.length,n=0;n<r;){var o=i(e,n);t[t.length]=o["[[CodePoint]]"],n+=o["[[CodeUnitCount]]"]}return t}},3519(e,t,r){"use strict";var s=r(453),i=r(9675),n=s("%String.fromCharCode%"),o=r(5986),a=r(4224),l=r(2656);e.exports=function(e){if(!l(e))throw new i("Assertion failed: `cp` must be >= 0 and <= 0x10FFFF");return e<=65535?n(e):n(o((e-65536)/1024)+55296)+n(a(e-65536,1024)+56320)}},3254(e,t,r){"use strict";var s=r(453),i=r(9675),n=s("%String.fromCharCode%"),o=r(2161),a=r(3703);e.exports=function(e,t){if(!o(e)||!a(t))throw new i("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return n(e)+n(t)}},6156(e,t,r){"use strict";var s=r(9675),i=r(6556),n=i("String.prototype.charCodeAt"),o=i("Number.prototype.toString"),a=i("String.prototype.toLowerCase"),l=r(2114);e.exports=function(e){if("string"!=typeof e||1!==e.length)throw new s("Assertion failed: `C` must be a single code unit");var t=n(e,0);if(t>65535)throw new s("`Assertion failed: numeric value of `C` must be <= 0xFFFF");return"\\u"+l(a(o(t,16)),4,"0","start")}},5986(e,t,r){"use strict";var s=r(8968);e.exports=function(e){return"bigint"==typeof e?e:s(e)}},4224(e,t,r){"use strict";var s=r(113);e.exports=function(e,t){return s(e,t)}},2656(e){"use strict";e.exports=function(e){return"number"==typeof e&&e>=0&&e<=1114111&&(0|e)===e}},2161(e){"use strict";e.exports=function(e){return"number"==typeof e&&e>=55296&&e<=56319}},3703(e){"use strict";e.exports=function(e){return"number"==typeof e&&e>=56320&&e<=57343}},113(e,t,r){"use strict";e.exports=r(1350)}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return r[e].call(n.exports,n,n.exports,i),n.exports}return i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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(1224)})());
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("axios"),require("Oidc"));else if("function"==typeof define&&define.amd)define(["axios","Oidc"],t);else{var r="object"==typeof exports?t(require("axios"),require("Oidc")):t(e.axios,e.Oidc);for(var s in r)("object"==typeof exports?exports:e)[s]=r[s]}}(self,(e,t)=>(()=>{var r={3659(e,t,r){const s=r(768);class i{constructor(e=[],t=!1){if(this.listeners=[],this.processes={},this.addNamespace=t,e instanceof i)for(let t in e.processes)this.addAll(e.processes[t]);else this.addAll(e)}onChange(e,t,r){for(let s of this.listeners)s(e,t,r)}addAll(e,t="backend"){for(var r in e)this.add(e[r],t,!1);this.onChange("addAll",e,t)}add(e,t="backend",r=!0){if(!s.isObject(e))throw new Error("Invalid process; not an object.");if("string"!=typeof e.id)throw new Error("Invalid process; no id specified.");if("string"!=typeof t)throw new Error("Invalid namespace; not a string.");this.processes[t]||(this.processes[t]={}),e=Object.assign(this.addNamespace?{namespace:t}:{},e),this.processes[t][e.id]=e,r&&this.onChange("add",e,t)}count(){return s.size(this.all())}all(){let e=[];for(let t in this.processes)e=e.concat(Object.values(this.processes[t]));return e}hasNamespace(e){return"string"==typeof e&&Boolean(this.processes[e])}namespaces(){return Object.keys(this.processes).sort()}namespace(e){if("string"!=typeof e)return[];let t=this.processes[e];return t?Object.values(t):[]}has(e,t=null){return Boolean(this.get(e,t))}get(e,t=null){return"string"!=typeof e?null:null===t?this.get(e,"user")||this.get(e,"backend"):this.processes[t]&&this.processes[t][e]||null}remove(e=null,t="user"){if("string"!=typeof t)return!1;if(this.processes[t]){if("string"!=typeof e)return delete this.processes[t],this.onChange("remove",null,t),!0;if(this.processes[t][e]){let r=this.processes[t][e];return delete this.processes[t][e],0===s.size(this.processes[t])&&delete this.processes[t],this.onChange("remove",r,t),!0}}return!1}}e.exports=i},779(e,t,r){const s=r(768);class i{static normalizeJsonSchema(e,t=!1){s.isObject(e)?e=[e]:Array.isArray(e)||(e=[]);let r=[];for(let t of e)if(Array.isArray(t.allOf))r.push(Object.assign({},...t.allOf));else if(Array.isArray(t.oneOf)||Array.isArray(t.anyOf)){let e=s.omitFromObject(t,["oneOf","anyOf"]),i=t.oneOf||t.anyOf;for(let t of i)r.push(Object.assign({},e,t))}else r.push(t);if(!t)return r;e=[];for(let t of r)Array.isArray(t.type)?e=e.concat(t.type.map(e=>Object.assign({},t,{type:e}))):e.push(t);return e}static getCallbackParameters(e,t=[]){if(!s.isObject(e)||!e.schema)return[];let r,n=i.normalizeJsonSchema(e.schema);for(;r=t.shift();)n=n.map(e=>i.normalizeJsonSchema(i.getElementJsonSchema(e,r))),n=n.concat(...n);let o=[];for(let e of n){let t=null;if(Array.isArray(e.parameters)?t=e.parameters:s.isObject(e.additionalProperties)&&Array.isArray(e.additionalProperties.parameters)&&(t=e.additionalProperties.parameters),Array.isArray(t)){if(o.length>0&&!s.equals(o,t))throw new Error("Multiple schemas with different callback parameters found.");o=t}}return o}static getCallbackParametersForProcess(e,t,r=[]){if(!s.isObject(e)||!Array.isArray(e.parameters))return[];let n=e.parameters.find(e=>e.name===t);return i.getCallbackParameters(n,r)}static getNativeTypesForJsonSchema(e,t=!1){if(s.isObject(e)&&Array.isArray(e.type)){let r=s.unique(e.type).filter(e=>i.JSON_SCHEMA_TYPES.includes(e));return r.length>0&&r.length<i.JSON_SCHEMA_TYPES.length?r:t?[]:i.JSON_SCHEMA_TYPES}return s.isObject(e)&&"string"==typeof e.type&&i.JSON_SCHEMA_TYPES.includes(e.type)?[e.type]:t?[]:i.JSON_SCHEMA_TYPES}static getElementJsonSchema(e,t=null){let r=i.getNativeTypesForJsonSchema(e);if(s.isObject(e)&&r.includes("array")&&"string"!=typeof t){if(s.isObject(e.items))return e.items;if(Array.isArray(e.items)){if(null!==t&&s.isObject(e.items[t]))return e.items[t];if(s.isObject(e.additionalItems))return e.additionalItems}}if(s.isObject(e)&&r.includes("object")){if(null!==t&&s.isObject(e.properties)&&s.isObject(e.properties[t]))return e.properties[t];if(s.isObject(e.additionalProperties))return e.additionalProperties}return{}}}i.JSON_SCHEMA_TYPES=["string","number","integer","boolean","array","object","null"],e.exports=i},768(e,t,r){var s=r(9252);class i{static isObject(e){return"object"==typeof e&&e===Object(e)&&!Array.isArray(e)}static hasText(e){return"string"==typeof e&&e.length>0}static equals(e,t){return s(e,t)}static pickFromObject(e,t){e=Object(e),"string"==typeof t&&(t=[t]);const r={};return t.forEach(t=>r[t]=e[t]),r}static omitFromObject(e,t){e=Object(e),"string"==typeof t&&(t=[t]);var r=Object.assign({},e);for(let e of t)delete r[e];return r}static mapObject(e,t){const r=Object.keys(e),s=new Array(r.length);return r.forEach((r,i)=>{s[i]=t(e[r],r,e)}),s}static mapObjectValues(e,t){e=Object(e);const r={};return Object.keys(e).forEach(s=>{r[s]=t(e[s],s,e)}),r}static unique(e,t=!1){return t?e.filter((e,t,r)=>r.findIndex(t=>i.equals(e,t))===t):[...new Set(e)]}static size(e){return"object"==typeof e&&null!==e?Array.isArray(e)?e.length:Object.keys(e).length:0}static isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}static deepClone(e){return JSON.parse(JSON.stringify(e))}static normalizeUrl(e,t=null){let r=e.replace(/\/$/,"");return"string"==typeof t&&("/"!==t.substr(0,1)&&(t="/"+t),r+=t.replace(/\/$/,"")),r}static replacePlaceholders(e,t={}){if("string"==typeof e&&i.isObject(t))for(var r in t){let s=t[r];e=e.replace("{"+r+"}",Array.isArray(s)?s.join("; "):s)}return e}static compareStringCaseInsensitive(e,t){return"string"!=typeof e&&(e=String(e)),"string"!=typeof t&&(t=String(t)),e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}static prettifyString(e,t="; "){return Array.isArray(e)||(e=[String(e)]),(e=e.map(e=>{if(e.length>=3){const t=(e,t,r)=>t+" "+r.toUpperCase();return(e=e.includes("_")?e.replace(/([a-zA-Z\d])_([a-zA-Z\d])/g,t):e.includes("-")?e.replace(/([a-zA-Z\d])-([a-zA-Z\d])/g,t):e.replace(/([a-z])([A-Z])/g,t)).charAt(0).toUpperCase()+e.substr(1)}return e})).join(t)}static friendlyLinks(e,t=!0,r=["self"]){let s=[];if(!Array.isArray(e))return s;for(let t of e)t=Object.assign({},t),"string"==typeof t.rel&&r.includes(t.rel.toLowerCase())||("string"==typeof t.title&&0!==t.title.length||("string"==typeof t.rel&&t.rel.length>1?t.title=i.prettifyString(t.rel):t.title=t.href.replace(/^https?:\/\/(www.)?/i,"").replace(/\/$/i,"")),s.push(t));return t&&s.sort((e,t)=>i.compareStringCaseInsensitive(e.title,t.title)),s}}e.exports=i},3304(e,t,r){const{compare:s,compareVersions:i,validate:n}=r(8385);class o{static compare(e,t,r=null){return null!==r?s(e,t,r):i(e,t)}static validate(e){return n(e)}static findCompatible(e,t=!0,r=null,s=null){if(!Array.isArray(e)||0===e.length)return[];let i=e.filter(e=>{if("string"==typeof e.url&&o.validate(e.api_version)){let t=o.validate(r),i=o.validate(s);return t&&i?o.compare(e.api_version,r,">=")&&o.compare(e.api_version,s,"<="):t?o.compare(e.api_version,r,">="):!i||o.compare(e.api_version,s,"<=")}return!1});return 0===i.length?[]:i.sort((e,r)=>{let s=!0===e.production,i=!0===r.production;return t&&s!==i?s?-1:1:-1*o.compare(e.api_version,r.api_version)})}static findLatest(e,t=!0,r=null,s=null){let i=o.findCompatible(e,t,r,s);return i.length>0?i[0]:null}}e.exports=o},1321(e,t,r){var s=r(9139);const i="1.0.0",n={classification:"https://stac-extensions.github.io/classification/v1.1.0/schema.json",datacube:"https://stac-extensions.github.io/datacube/v2.1.0/schema.json",eo:"https://stac-extensions.github.io/eo/v1.0.0/schema.json",file:"https://stac-extensions.github.io/file/v1.0.0/schema.json","item-assets":"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",label:"https://stac-extensions.github.io/label/v1.0.1/schema.json",pointcloud:"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",processing:"https://stac-extensions.github.io/processing/v1.1.0/schema.json",projection:"https://stac-extensions.github.io/projection/v1.0.0/schema.json",raster:"https://stac-extensions.github.io/raster/v1.1.0/schema.json",sar:"https://stac-extensions.github.io/sar/v1.0.0/schema.json",sat:"https://stac-extensions.github.io/sat/v1.0.0/schema.json",scientific:"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",table:"https://stac-extensions.github.io/table/v1.2.0/schema.json",timestamps:"https://stac-extensions.github.io/timestamps/v1.0.0/schema.json",version:"https://stac-extensions.github.io/version/v1.0.0/schema.json",view:"https://stac-extensions.github.io/view/v1.0.0/schema.json"},o={itemAndCollection:{"cube:":n.datacube,"eo:":n.eo,"file:":n.file,"label:":n.label,"pc:":n.pointcloud,"processing:":n.processing,"proj:":n.projection,"raster:":n.raster,"sar:":n.sar,"sat:":n.sat,"sci:":n.scientific,"view:":n.view,version:n.version,deprecated:n.version,published:n.timestamps,expires:n.timestamps,unpublished:n.timestamps},catalog:{},collection:{item_assets:n["item-assets"]},item:{}};o.collection=Object.assign(o.collection,o.itemAndCollection),o.item=Object.assign(o.item,o.itemAndCollection);var a={parseUrl(e){let t=e.match(/^https?:\/\/stac-extensions.github.io\/([^\/]+)\/v([^\/]+)\/[^.]+.json$/i);if(t)return{id:t[1],version:t[2]}}},l={version:i,extensions:{},set(e){if("string"!=typeof e.stac_version?l.version="0.6.0":l.version=e.stac_version,Array.isArray(e.stac_extensions))for(let t of e.stac_extensions){let e=a.parseUrl(t);e&&(l.extensions[e.id]=e.version)}},before(e,t=null){let r=t?l.extensions[t]:l.version;return void 0!==r&&s.compare(r,e,"<")}},c={type(e){let t=typeof e;if("object"===t){if(null===e)return"null";if(Array.isArray(e))return"array"}return t},is:(e,t)=>c.type(e)===t,isDefined:e=>void 0!==e,isObject:e=>"object"==typeof e&&e===Object(e)&&!Array.isArray(e),rename:(e,t,r)=>void 0!==e[t]&&void 0===e[r]&&(e[r]=e[t],delete e[t],!0),forAll(e,t,r){if(e[t]&&"object"==typeof e[t])for(let s in e[t])r(e[t][s])},toArray:(e,t)=>void 0!==e[t]&&!Array.isArray(e[t])&&(e[t]=[e[t]],!0),flattenArray(e,t,r,s=!1){if(Array.isArray(e[t])){for(let i in e[t])if("string"==typeof r[i]){let n=e[t][i];e[r[i]]=s?[n]:n}return delete e[t],!0}return!1},flattenOneElementArray:(e,t,r=!1)=>!(!r&&Array.isArray(e[t]))||1===e[t].length&&(e[t]=e[t][0],!0),removeFromArray(e,t,r){if(Array.isArray(e[t])){let s=e[t].indexOf(r);return s>-1&&e[t].splice(s,1),!0}return!1},ensure:(e,t,r)=>(c.type(r)!==c.type(e[t])&&(e[t]=r),!0),upgradeExtension(e,t){let{id:r,version:i}=a.parseUrl(t),n=e.stac_extensions.findIndex(e=>{let t=a.parseUrl(e);return t&&t.id===r&&s.compare(t.version,i,"<")});return-1!==n&&(e.stac_extensions[n]=t,!0)},addExtension(e,t){let{id:r,version:i}=a.parseUrl(t),n=e.stac_extensions.findIndex(e=>{if(e===t)return!0;let n=a.parseUrl(e);return!(!n||n.id!==r||!s.compare(n.version,i,"<"))});return-1===n?e.stac_extensions.push(t):e.stac_extensions[n]=t,e.stac_extensions.sort(),!0},removeExtension:(e,t)=>c.removeFromArray(e,"stac_extensions",t),migrateExtensionShortnames(e){let t=Object.keys(n),r=Object.values(n);return c.mapValues(e,"stac_extensions",t,r)},populateExtensions(e,t){let r=[];"catalog"!=t&&"collection"!=t||r.push(e),"item"!=t&&"collection"!=t||!c.isObject(e.assets)||(r=r.concat(Object.values(e.assets))),"collection"==t&&c.isObject(e.item_assets)&&(r=r.concat(Object.values(e.item_assets))),"collection"==t&&c.isObject(e.summaries)&&r.push(e.summaries),"item"==t&&c.isObject(e.properties)&&r.push(e.properties);for(let s of r)Object.keys(s).forEach(r=>{let s=r.match(/^(\w+:|[^:]+$)/i);if(Array.isArray(s)){let r=o[t][s[0]];c.is(r,"string")&&c.addExtension(e,r)}})},mapValues(e,t,r,s){let i=e=>{let t=r.indexOf(e);return t>=0?s[t]:e};return Array.isArray(e[t])?e[t]=e[t].map(i):void 0!==e[t]&&(e[t]=i(e[t])),!0},mapObject(e,t){for(let r in e)e[r]=t(e[r],r)},moveTo(e,t,r,s=!1,i=!1){let n;return n=s?i?e=>Array.isArray(e):e=>Array.isArray(e)&&1===e.length:c.isDefined,!!n(e[t])&&(r[t]=s&&!i?e[t][0]:e[t],delete e[t],!0)},runAll(e,t,r,s){for(let i in e)i.startsWith("migrate")||e[i](t,r,s)},toUTC(e,t){if("string"==typeof e[t])try{return e[t]=this.toISOString(e[t]),!0}catch(e){}return delete e[t],!1},toISOString:e=>(e instanceof Date||(e=new Date(e)),e.toISOString().replace(".000",""))},u={multihash:null,hexToUint8(e){if(0===e.length||e.length%2!=0)throw new Error(`The string "${e}" is not valid hex.`);return new Uint8Array(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},uint8ToHex:e=>e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),toMultihash(e,t,r){if(!u.multihash||!c.is(e[t],"string"))return!1;try{const s=u.multihash.encode(u.hexToUint8(e[t]),r);return e[t]=u.uint8ToHex(s),!0}catch(e){return console.warn(e),!1}}},p={migrate:(e,t=!0)=>(l.set(e),t&&(e.stac_version=i),e.type="Catalog",c.ensure(e,"stac_extensions",[]),l.before("1.0.0-rc.1")&&c.migrateExtensionShortnames(e),c.ensure(e,"id",""),c.ensure(e,"description",""),c.ensure(e,"links",[]),c.runAll(p,e,e),l.before("0.8.0")&&c.populateExtensions(e,"catalog"),e)},h={migrate:(e,t=!0)=>(p.migrate(e,t),e.type="Collection",l.before("1.0.0-rc.1")&&c.migrateExtensionShortnames(e),c.ensure(e,"license","proprietary"),c.ensure(e,"extent",{spatial:{bbox:[]},temporal:{interval:[]}}),c.runAll(h,e,e),c.isObject(e.properties)&&(c.removeFromArray(e,"stac_extensions","commons"),delete e.properties),l.before("0.8.0")&&c.populateExtensions(e,"collection"),l.before("1.0.0-beta.1")&&c.mapValues(e,"stac_extensions",["assets"],["item-assets"]),e),extent(e){if(c.ensure(e,"extent",{}),l.before("0.8.0")&&(Array.isArray(e.extent.spatial)&&(e.extent.spatial={bbox:[e.extent.spatial]}),Array.isArray(e.extent.temporal)&&(e.extent.temporal={interval:[e.extent.temporal]})),c.ensure(e.extent,"spatial",{}),c.ensure(e.extent.spatial,"bbox",[]),c.ensure(e.extent,"temporal",{}),c.ensure(e.extent.temporal,"interval",[]),l.before("1.0.0-rc.3")){if(e.extent.temporal.interval.length>1){let t,r;for(let s of e.extent.temporal.interval){if(null===s[0])t=null;else if("string"==typeof s[0]&&null!==t)try{let e=new Date(s[0]);(void 0===t||e<t)&&(t=e)}catch(e){}if(null===s[1])r=null;else if("string"==typeof s[1]&&null!==r)try{let e=new Date(s[1]);(void 0===r||e>r)&&(r=e)}catch(e){}}e.extent.temporal.interval.unshift([t?c.toISOString(t):null,r?c.toISOString(r):null])}if(e.extent.spatial.bbox.length>1){let t=e.extent.spatial.bbox.reduce((e,t)=>Array.isArray(t)?Math.max(t.length,e):e,4);if(t>=4){let r=new Array(t).fill(null),s=t/2;for(let t of e.extent.spatial.bbox){if(!Array.isArray(t)||t.length<4)break;for(let e in t){let i=t[e];null===r[e]?r[e]=i:r[e]=e<s?Math.min(i,r[e]):Math.max(i,r[e])}}-1===r.findIndex(e=>null===e)&&e.extent.spatial.bbox.unshift(r)}}}},collectionAssets(e){l.before("1.0.0-rc.1")&&c.removeExtension(e,"collection-assets"),g.migrateAll(e)},itemAsset(e){l.before("1.0.0-beta.2")&&c.rename(e,"item_assets","assets"),g.migrateAll(e,"item_assets")},summaries(e){if(c.ensure(e,"summaries",{}),l.before("0.8.0")&&c.isObject(e.other_properties)){for(let t in e.other_properties){let r=e.other_properties[t];Array.isArray(r.extent)&&2===r.extent.length?e.summaries[t]={minimum:r.extent[0],maximum:r.extent[1]}:Array.isArray(r.values)&&(r.values.filter(e=>Array.isArray(e)).length===r.values.length?e.summaries[t]=r.values.reduce((e,t)=>e.concat(t),[]):e.summaries[t]=r.values)}delete e.other_properties}if(l.before("1.0.0-beta.1")&&c.isObject(e.properties)&&!e.links.find(e=>["child","item"].includes(e.rel)))for(let t in e.properties){let r=e.properties[t];Array.isArray(r)||(r=[r]),e.summaries[t]=r}l.before("1.0.0-rc.1")&&c.mapObject(e.summaries,e=>(c.rename(e,"min","minimum"),c.rename(e,"max","maximum"),e)),m.migrate(e.summaries,e,!0),c.moveTo(e.summaries,"sci:doi",e,!0)&&c.addExtension(e,n.scientific),c.moveTo(e.summaries,"sci:publications",e,!0,!0)&&c.addExtension(e,n.scientific),c.moveTo(e.summaries,"sci:citation",e,!0)&&c.addExtension(e,n.scientific),c.moveTo(e.summaries,"cube:dimensions",e,!0)&&c.addExtension(e,n.datacube),0===Object.keys(e.summaries).length&&delete e.summaries}},d={migrate(e,t=null,r=!0){l.set(e),r&&(e.stac_version=i),c.ensure(e,"stac_extensions",[]),l.before("1.0.0-rc.1")&&c.migrateExtensionShortnames(e),c.ensure(e,"id",""),c.ensure(e,"type","Feature"),c.isObject(e.geometry)||(e.geometry=null),null!==e.geometry&&c.ensure(e,"bbox",[]),c.ensure(e,"properties",{}),c.ensure(e,"links",[]),c.ensure(e,"assets",{});let s=!1;return c.isObject(t)&&c.isObject(t.properties)&&(c.removeFromArray(e,"stac_extensions","commons"),e.properties=Object.assign({},t.properties,e.properties),s=!0),c.runAll(d,e,e),m.migrate(e.properties,e),g.migrateAll(e),(l.before("0.8.0")||s)&&c.populateExtensions(e,"item"),e}},f={migrate:(e,t=!0)=>(c.ensure(e,"collections",[]),c.ensure(e,"links",[]),c.runAll(f,e,e),e.collections=e.collections.map(e=>h.migrate(e,t)),e)},y={migrate:(e,t=!0)=>(c.ensure(e,"type","FeatureCollection"),c.ensure(e,"features",[]),c.ensure(e,"links",[]),c.runAll(y,e,e),e.features=e.features.map(e=>d.migrate(e,null,t)),e)},g={migrateAll(e,t="assets"){for(let r in e[t])g.migrate(e[t][r],e)},migrate:(e,t)=>(c.runAll(g,e,t),m.migrate(e,t),e),mediaTypes(e){c.is(e.type,"string")&&c.mapValues(e,"type",["image/vnd.stac.geotiff","image/vnd.stac.geotiff; cloud-optimized=true"],["image/tiff; application=geotiff","image/tiff; application=geotiff; profile=cloud-optimized"])},eo(e,t){let r=c.isObject(t.properties)&&Array.isArray(t.properties["eo:bands"])?t.properties["eo:bands"]:[];if(Array.isArray(e["eo:bands"]))for(let t in e["eo:bands"]){let s=e["eo:bands"][t];c.is(s,"number")&&c.isObject(r[s])?s=r[s]:c.isObject(s)||(s={}),e["eo:bands"][t]=s}}},m={migrate:(e,t,r=!1)=>(c.runAll(m,e,t,r),e),_commonMetadata(e){l.before("1.0.0-rc.3")&&(c.toUTC(e,"created"),c.toUTC(e,"updated"))},_timestamps(e,t){c.toUTC(e,"published"),c.toUTC(e,"expires"),c.toUTC(e,"unpublished"),c.upgradeExtension(t,n.timestamps)},_versioningIndicator(e,t){c.upgradeExtension(t,n.version)},checksum(e,t){l.before("0.9.0")&&u.multihash&&(c.rename(e,"checksum:md5","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","md5"),c.rename(e,"checksum:sha1","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","sha1"),c.rename(e,"checksum:sha2","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","sha2-256"),c.rename(e,"checksum:sha3","checksum:multihash")&&u.toMultihash(e,"checksum:multihash","sha3-256")),l.before("1.0.0-rc.1")&&c.rename(e,"checksum:multihash","file:checksum")&&c.addExtension(t,n.file),c.removeExtension(t,"checksum")},classification(e,t){l.before("1.1.0","classification")&&c.forAll(e,"classification:classes",e=>c.rename(e,"color-hint","color_hint")),c.upgradeExtension(t,n.classification)},cube(e,t){c.upgradeExtension(t,n.datacube)},dtr(e,t){l.before("0.9.0")&&(c.rename(e,"dtr:start_datetime","start_datetime"),c.rename(e,"dtr:end_datetime","end_datetime"),c.removeExtension(t,"datetime-range"))},eo(e,t){l.before("0.9.0")&&(c.rename(e,"eo:epsg","proj:epsg")&&c.addExtension(t,n.projection),c.rename(e,"eo:platform","platform"),c.rename(e,"eo:instrument","instruments")&&c.toArray(e,"instruments"),c.rename(e,"eo:constellation","constellation"),c.rename(e,"eo:off_nadir","view:off_nadir")&&c.addExtension(t,n.view),c.rename(e,"eo:azimuth","view:azimuth")&&c.addExtension(t,n.view),c.rename(e,"eo:incidence_angle","view:incidence_angle")&&c.addExtension(t,n.view),c.rename(e,"eo:sun_azimuth","view:sun_azimuth")&&c.addExtension(t,n.view),c.rename(e,"eo:sun_elevation","view:sun_elevation")&&c.addExtension(t,n.view)),l.before("1.0.0-beta.1")&&c.rename(e,"eo:gsd","gsd"),c.upgradeExtension(t,n.eo)},file(e,t){c.upgradeExtension(t,n.file)},label(e,t){l.before("0.8.0")&&(c.rename(e,"label:property","label:properties"),c.rename(e,"label:task","label:tasks"),c.rename(e,"label:overview","label:overviews")&&c.toArray(e,"label:overviews"),c.rename(e,"label:method","label:methods"),c.toArray(e,"label:classes")),c.upgradeExtension(t,n.label)},pc(e,t){l.before("0.8.0")&&c.rename(e,"pc:schema","pc:schemas"),c.upgradeExtension(t,n.pointcloud)},processing(e,t){c.upgradeExtension(t,n.processing)},proj(e,t){c.upgradeExtension(t,n.projection)},raster(e,t){c.upgradeExtension(t,n.raster)},sar(e,t,r){c.rename(e,"sar:incidence_angle","view:incidence_angle")&&c.addExtension(t,n.view),c.rename(e,"sar:pass_direction","sat:orbit_state")&&c.mapValues(e,"sat:orbit_state",[null],["geostationary"])&&c.addExtension(t,n.sat),l.before("0.7.0")&&(c.flattenArray(e,"sar:resolution",["sar:resolution_range","sar:resolution_azimuth"],r),c.flattenArray(e,"sar:pixel_spacing",["sar:pixel_spacing_range","sar:pixel_spacing_azimuth"],r),c.flattenArray(e,"sar:looks",["sar:looks_range","sar:looks_azimuth","sar:looks_equivalent_number"],r),c.rename(e,"sar:off_nadir","view:off_nadir")&&c.addExtension(t,n.view)),l.before("0.9.0")&&(c.rename(e,"sar:platform","platform"),c.rename(e,"sar:instrument","instruments")&&c.toArray(e,"instruments"),c.rename(e,"sar:constellation","constellation"),c.rename(e,"sar:type","sar:product_type"),c.rename(e,"sar:polarization","sar:polarizations"),c.flattenOneElementArray(e,"sar:absolute_orbit",r)&&c.rename(e,"sar:absolute_orbit","sat:absolute_orbit")&&c.addExtension(t,n.sat),c.flattenOneElementArray(e,"sar:relative_orbit",r)&&c.rename(e,"sar:relative_orbit","sat:relative_orbit")&&c.addExtension(t,n.sat)),c.upgradeExtension(t,n.sar)},sat(e,t){l.before("0.9.0")&&(c.rename(e,"sat:off_nadir_angle","sat:off_nadir"),c.rename(e,"sat:azimuth_angle","sat:azimuth"),c.rename(e,"sat:sun_azimuth_angle","sat:sun_azimuth"),c.rename(e,"sat:sun_elevation_angle","sat:sun_elevation")),c.upgradeExtension(t,n.sat)},sci(e,t){c.upgradeExtension(t,n.scientific)},item(e){l.before("0.8.0")&&(c.rename(e,"item:license","license"),c.rename(e,"item:providers","providers"))},table(e,t){c.upgradeExtension(t,n.table)},view(e,t){c.upgradeExtension(t,n.view)}},b={item:(e,t=null,r=!0)=>d.migrate(e,t,r),catalog:(e,t=!0)=>p.migrate(e,t),collection:(e,t=!0)=>h.migrate(e,t),collectionCollection:(e,t=!0)=>f.migrate(e,t),itemCollection:(e,t=!0)=>y.migrate(e,t),stac:(e,t=!0)=>"Feature"===e.type?b.item(e,null,t):"FeatureCollection"===e.type?b.itemCollection(e,t):"Collection"===e.type||!e.type&&c.isDefined(e.extent)&&c.isDefined(e.license)?b.collection(e,t):!e.type&&Array.isArray(e.collections)?b.collectionCollection(e,t):b.catalog(e,t),enableMultihash(e){u.multihash=e}};e.exports=b},9139(e,t){var r,s;void 0===(s="function"==typeof(r=function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(e){var t,r,s=e.replace(/^v/,"").replace(/\+.*$/,""),i=(r="-",-1===(t=s).indexOf(r)?t.length:t.indexOf(r)),n=s.substring(0,i).split(".");return n.push(s.substring(i+1)),n}function r(e){return isNaN(Number(e))?e:Number(e)}function s(t){if("string"!=typeof t)throw new TypeError("Invalid argument expected string");if(!e.test(t))throw new Error("Invalid argument not valid semver ('"+t+"' received)")}function i(e,i){[e,i].forEach(s);for(var n=t(e),o=t(i),a=0;a<Math.max(n.length-1,o.length-1);a++){var l=parseInt(n[a]||0,10),c=parseInt(o[a]||0,10);if(l>c)return 1;if(c>l)return-1}var u=n[n.length-1],p=o[o.length-1];if(u&&p){var h=u.split(".").map(r),d=p.split(".").map(r);for(a=0;a<Math.max(h.length,d.length);a++){if(void 0===h[a]||"string"==typeof d[a]&&"number"==typeof h[a])return-1;if(void 0===d[a]||"string"==typeof h[a]&&"number"==typeof d[a])return 1;if(h[a]>d[a])return 1;if(d[a]>h[a])return-1}}else if(u||p)return u?-1:1;return 0}var n=[">",">=","=","<","<="],o={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};return i.validate=function(t){return"string"==typeof t&&e.test(t)},i.compare=function(e,t,r){!function(e){if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===n.indexOf(e))throw new TypeError("Invalid operator, expected one of "+n.join("|"))}(r);var s=i(e,t);return o[r].indexOf(s)>-1},i})?r.apply(t,[]):r)||(e.exports=s)},6147(e){e.exports=class{constructor(e,t,r){this.id=r.id||null,this.title=r.title||"",this.description=r.description||"",this.type=e,this.connection=t,this.token=null}getId(){let e=this.getType();return this.getProviderId().length>0&&(e+="."+this.getProviderId()),e}getDisplayName(){return null}getType(){return this.type}getProviderId(){return"string"==typeof this.id?this.id:""}getTitle(){return this.title}getDescription(){return this.description}getToken(){const e=this.connection.capabilities().hasConformance("https://api.openeo.org/*/authentication/jwt");return"string"==typeof this.token?e?this.token:this.getType()+"/"+this.getProviderId()+"/"+this.token:null}setToken(e){this.token=e,this.connection.emit("tokenChanged",e),null!==this.token?this.connection.setAuthProvider(this):this.connection.setAuthProvider(null)}async resume(...e){return!1}async login(...e){throw new Error("Not implemented.",e)}async logout(){this.setToken(null)}}},3054(e){e.exports=class{constructor(e,t=[]){this.connection=e,this.apiToClientNames={},this.clientToApiNames={},this.lastRefreshTime=0,this.extra={};for(let e in t){let r,s;Array.isArray(t[e])?(r=t[e][0],s=t[e][1]):(r=t[e],s=t[e]),this.apiToClientNames[r]=s,this.clientToApiNames[s]=r}}toJSON(){let e={};for(let t in this.clientToApiNames){let r=this.clientToApiNames[t];void 0!==this[t]&&(e[r]=this[t])}return Object.assign(e,this.extra)}setAll(e){for(let t in e)void 0===this.apiToClientNames[t]?this.extra[t]=e[t]:this[this.apiToClientNames[t]]=e[t];return this.lastRefreshTime=Date.now(),this}getDataAge(){return(Date.now()-this.lastRefreshTime)/1e3}getAll(){let e={};for(let t in this.apiToClientNames){let r=this.apiToClientNames[t];void 0!==this[r]&&(e[r]=this[r])}return Object.assign(e,this.extra)}get(e){return void 0!==this.extra[e]?this.extra[e]:null}_convertToRequest(e){let t={};for(let r in e)void 0===this.clientToApiNames[r]?t[r]=e[r]:t[this.clientToApiNames[r]]=e[r];return t}_supports(e){return this.connection.capabilities().hasFeature(e)}}},933(e,t,r){const s=r(2458),i=r(768),n=r(6147);e.exports=class extends n{constructor(e){super("basic",e,{id:null,title:"HTTP Basic",description:"Login with username and password using the method HTTP Basic."}),this.username=null}async login(e,t){let r=await this.connection._send({method:"get",responseType:"json",url:"/credentials/basic",headers:{Authorization:"Basic "+s.base64encode(e+":"+t)}});if(!i.isObject(r.data)||"string"!=typeof r.data.access_token)throw new Error("No access_token returned.");this.username=e,this.setToken(r.data.access_token)}getDisplayName(){return this.username}async logout(){this.username=null,await super.logout()}}},2458(e){e.exports=class{static getName(){return"Browser"}static getUrl(){return window.location.toString()}static setUrl(e){throw new Error("setUrl is not supported in a browser environment.")}static handleErrorResponse(e){return new Promise((t,r)=>{let s=new FileReader;s.onerror=e=>{s.abort(),r(e.target.error)},s.onload=()=>{let e=s.result instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(s.result)):s.result,r="string"==typeof e?JSON.parse(e):e;t(r)},s.readAsText(e.response.data)})}static getResponseType(){return"blob"}static base64encode(e){return btoa(e)}static fileNameForUpload(e){return e.name.split(/(\\|\/)/g).pop()}static dataForUpload(e){return e}static async downloadResults(e,t,r){throw new Error("downloadResults is not supported in a browser environment.")}static saveToFile(e,t){return new Promise((r,s)=>{try{e instanceof Blob||(e=new Blob([e],{type:"application/octet-stream"}));let s=window.URL.createObjectURL(e),i=document.createElement("a");i.style.display="none",i.href=s,i.setAttribute("download",t||"download"),void 0===i.download&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(s),r()}catch(e){console.error(e),s(e)}})}}},1425(e,t,r){const s=r(2804),i=r(7897),n=r(2742),o=r(768),a=r(779),l=r(3659),c=["id","summary","description","categories","parameters","returns","deprecated","experimental","exceptions","examples","links"];class u{static async fromVersion(e=null){let t="https://processes.openeo.org/processes.json";return"string"==typeof e&&(t="https://processes.openeo.org/"+e+"/processes.json"),await u.fromURL(t)}static async fromURL(e){let t=await n(e);return new u(t.data)}constructor(e,t=null,r=void 0){if(this.id=r,this.parent=t,this.parentNode=null,this.parentParameter=null,this.nodes={},this.idCounter={},this.callbackParameterCache={},this.parameters=void 0,this.processes=null,e instanceof l)this.processes=e;else if(o.isObject(e)&&Array.isArray(e.processes))this.processes=new l(e.processes);else{if(!Array.isArray(e))throw new Error("Processes are invalid; must be array or object according to the API.");this.processes=new l(e)}this.processes.all().forEach(e=>this.createFunction(e))}createFunction(e){if(void 0!==this[e.id])throw new Error("Can't create function for process '"+e.id+"'. Already exists in Builder class.");this[e.id]=function(...t){return this.process(e.id,t)}}addProcessSpec(e,t=null){if(!o.isObject(e))throw new Error("Process '"+e.id+"' must be an object.");t||(t="backend"),this.processes.add(e,t),"backend"===t&&this.createFunction(e)}setParent(e,t){this.parentNode=e,this.parentParameter=t}createCallbackParameter(e){return this.callbackParameterCache[e]||(this.callbackParameterCache[e]=i.create(this,e)),this.callbackParameterCache[e]}getParentCallbackParameters(){let e=[];if(this.parentNode&&this.parentParameter)try{e=a.getCallbackParametersForProcess(this.parentNode.spec,this.parentParameter).map(e=>this.createCallbackParameter(e.name))}catch(e){console.warn(e)}return e}addParameter(e,t=!0){if(void 0!==this.getParentCallbackParameters().find(t=>t.name===e.name))return;let r=this;if(t)for(;r.parent;)r=r.parent;Array.isArray(r.parameters)||(r.parameters=[]);let s=r.parameters.findIndex(t=>t.name===e.name);-1!==s?Object.assign(r.parameters[s],e):r.parameters.push(e)}spec(e,t=null){return this.processes.get(e,t)}math(e){let t=new(r(2212))(e);return t.setBuilder(this),t.generate(!1)}supports(e,t=null){return Boolean(this.spec(e,t))}process(e,t={},r=null){let i=null;if(e.includes("@")){let t;[e,...t]=e.split("@"),i=t.join("@")}let n=new s(this,e,t,r,i);return this.nodes[n.id]=n,n}toJSON(){let e={process_graph:o.mapObjectValues(this.nodes,e=>e.toJSON())};return c.forEach(t=>{void 0!==this[t]&&(e[t]=this[t])}),e}generateId(e=""){return e=e.replace("_","").substr(0,6),this.idCounter[e]?this.idCounter[e]++:this.idCounter[e]=1,e+this.idCounter[e]}}e.exports=u},2212(e,t,r){const s=r(6462),i=r(7897),n=r(2804);class o{constructor(e){let t=new s.Parser;this.tree=t.parse(e),this.builder=null}setBuilder(e){this.builder=e}generate(e=!0){let t=this.parseTree(this.tree);if(!(t instanceof n))throw new Error("Invalid formula specified.");return e&&(t.result=!0),t}parseTree(e){let t=Object.keys(e)[0];switch(t){case"Number":return parseFloat(e.Number);case"Identifier":return this.getRef(e.Identifier);case"Expression":return this.parseTree(e.Expression);case"FunctionCall":{let t=[];for(let r in e.FunctionCall.args)t.push(this.parseTree(e.FunctionCall.args[r]));return this.builder.process(e.FunctionCall.name,t)}case"Binary":return this.addOperatorProcess(e.Binary.operator,this.parseTree(e.Binary.left),this.parseTree(e.Binary.right));case"Unary":{let t=this.parseTree(e.Unary.expression);return"-"===e.Unary.operator?"number"==typeof t?-t:this.addOperatorProcess("*",-1,t):t}default:throw new Error("Operation "+t+" not supported.")}}getRef(e){if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if("string"==typeof e&&e.startsWith("#")){let t=e.substring(1);if(t in this.builder.nodes)return{from_node:t}}let t=this.builder.getParentCallbackParameters();if("string"==typeof e&&t.length>0){let r=e.match(/^\$+/),s=r?r[0].length:0;if(s>0&&t.length>=s){let r=e.substring(s);return t[s-1][r]}}let r=new i(e);return this.builder.addParameter(r),r}addOperatorProcess(e,t,r){let s=o.operatorMapping[e],i=this.builder.spec(s);if(s&&i){let n={};if(!Array.isArray(i.parameters)||i.parameters.length<2)throw new Error("Process for operator "+e+" must have at least two parameters");return n[i.parameters[0].name||"x"]=t,n[i.parameters[1].name||"y"]=r,this.builder.process(s,n)}throw new Error("Operator "+e+" not supported")}}o.operatorMapping={"-":"subtract","+":"add","/":"divide","*":"multiply","^":"power"},e.exports=o},2804(e,t,r){const s=r(768),i=r(7897);class n{constructor(e,t,r={},s=null,i=null){if(this.parent=e,this.spec=this.parent.spec(t,i),!this.spec)throw new Error("Process doesn't exist: "+t);this.id=e.generateId(t),this.namespace=i,this.arguments=Array.isArray(r)?this.namedArguments(r):r,this._description=s,this.result=!1,this.addParametersToProcess(this.arguments)}namedArguments(e){if(e.length>(this.spec.parameters||[]).length)throw new Error("More arguments specified than parameters available.");let t={};if(Array.isArray(this.spec.parameters))for(let r=0;r<this.spec.parameters.length;r++)t[this.spec.parameters[r].name]=e[r];return t}addParametersToProcess(e){for(let t in e){let r=e[t];r instanceof i?s.isObject(r.spec.schema)&&this.parent.addParameter(r.spec):r instanceof n?this.addParametersToProcess(r.arguments):(Array.isArray(r)||s.isObject(r))&&this.addParametersToProcess(r)}}description(e){return void 0===e?this._description:(this._description=e,this)}exportArgument(e,t){const o=r(2212);if(s.isObject(e)){if(e instanceof n||e instanceof i)return e.ref();if(e instanceof o){let r=this.createBuilder(this,t);return e.setBuilder(r),e.generate(),r.toJSON()}if(e instanceof Date)return e.toISOString();if("function"==typeof e.toJSON)return e.toJSON();{let r={};for(let s in e)void 0!==e[s]&&(r[s]=this.exportArgument(e[s],t));return r}}return Array.isArray(e)?e.map(e=>this.exportArgument(e),t):"function"==typeof e?this.exportCallback(e,t):e}createBuilder(e=null,t=null){let s=new(r(1425))(this.parent.processes,this.parent);return null!==e&&null!==t&&s.setParent(e,t),s}exportCallback(e,t){let r=this.createBuilder(this,t),i=r.getParentCallbackParameters(),o=e.bind(r)(...i,r);if(Array.isArray(o)&&r.supports("array_create")?o=r.array_create(o):!s.isObject(o)&&r.supports("constant")&&(o=r.constant(o)),o instanceof n)return o.result=!0,r.toJSON();throw new Error("Callback must return BuilderNode")}toJSON(){let e={process_id:this.spec.id,arguments:{}};this.namespace&&(e.namespace=this.namespace);for(let t in this.arguments)void 0!==this.arguments[t]&&(e.arguments[t]=this.exportArgument(this.arguments[t],t));return"function"!=typeof this.description?e.description=this.description:"string"==typeof this._description&&(e.description=this._description),this.result&&(e.result=!0),e}ref(){return{from_node:this.id}}}e.exports=n},7897(e){"use strict";class t{static create(e,r){let s=new t(r,null);if("undefined"!=typeof Proxy)return new Proxy(s,{nodeCache:{},get(t,r,i){if(!Reflect.has(t,r)){if(!this.nodeCache[r]){let t={data:s};"string"==typeof r&&r.match(/^(0|[1-9]\d*)$/)?t.index=parseInt(r,10):t.label=r,this.nodeCache[r]=e.process("array_element",t)}return this.nodeCache[r]}return Reflect.get(t,r,i)},set(e,t,r,s){if(!Reflect.has(e,t))throw new Error("Simplified array access is read-only");return Reflect.set(e,t,r,s)}});throw new Error("Simplified array access not supported, use array_element directly")}constructor(e,t={},r="",s=void 0){this.name=e,this.spec={name:e,schema:"string"==typeof t?{type:t}:t,description:r},void 0!==s&&(this.spec.optional=!0,this.spec.default=s)}toJSON(){return this.spec}ref(){return{from_parameter:this.name}}}e.exports=t},6462(e){let t={Token:{Operator:"Operator",Identifier:"Identifier",Number:"Number"}};const r={"⁰":0,"¹":1,"²":2,"³":3,"⁴":4,"⁵":5,"⁶":6,"⁷":7,"⁸":8,"⁹":9},s=Object.keys(r).join("");t.Lexer=function(){let e="",r=0,i=0,n=0,o=t.Token;function a(){let t=i;return t<r?e.charAt(t):"\0"}function l(){let t="\0",s=i;return s<r&&(t=e.charAt(s),i+=1),t}function c(e){return"\t"===e||" "===e||" "===e}function u(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function p(e){return e>="0"&&e<="9"}function h(e,t){return{type:e,value:t,start:n,end:i-1}}function d(e,t=!1){return"_"===e||u(e)||p(e)||t&&function(e){return"-"===e||"."===e||"~"===e||"@"===e}(e)}function f(){let e;if(function(){let e;for(;i<r&&(e=a(),c(e));)l()}(),!(i>=r)){if(n=i,e=function(){let e,t;if(e=a(),p(e)||"."===e){if(t="","."!==e)for(t=l();e=a(),p(e);)t+=l();if("."===e)for(t+=l();e=a(),p(e);)t+=l();if("e"===e||"E"===e){if(t+=l(),e=a(),"+"!==e&&"-"!==e&&!p(e))throw e="character "+e,i>=r&&(e="<end>"),new SyntaxError("Unexpected "+e+" after the exponent sign");for(t+=l();e=a(),p(e);)t+=l()}if("."===t)throw new SyntaxError("Expecting decimal digits after the dot sign");return h(o.Number,t)}}(),void 0!==e)return e;if(e=function(){let e=a();if(("+-*/()^,"+s).indexOf(e)>=0)return h(o.Operator,l())}(),void 0!==e)return e;if(e=function(){let e=a();if("_"!==(t=e)&&"#"!==t&&"$"!==t&&!u(t))return;var t;let r=l(),s=!1;for(;;){let t=a();if("$"===e)"$"!==t&&(e="");else if("@"===t)s=!0;else if(!d(t,s))break;r+=l()}return h(o.Identifier,r)}(),void 0!==e)return e;throw new SyntaxError("Unknown token from character "+a())}}return{reset:function(t){e=t,r=t.length,i=0},next:f,peek:function(){let e,t=i;try{e=f(),delete e.start,delete e.end}catch(t){e=void 0}return i=t,e}}},t.Parser=function(){let e=new t.Lexer,i=t.Token;function n(e,t){return void 0!==e&&e.type===i.Operator&&t.includes(e.value)}function o(){let t,r=e.peek();return n(r,"-+")?(r=e.next(),t=o(),{Unary:{operator:r.value,expression:t}}):function(){let t,r=e.peek();if(void 0===r)throw new SyntaxError("Unexpected termination of expression");if(r.type===i.Identifier)return r=e.next(),n(e.peek(),"(")?function(t){let r=[],s=e.next();if(!n(s,"("))throw new SyntaxError('Expecting ( in a function call "'+t+'"');if(s=e.peek(),n(s,")")||(r=function(){let t,r,s=[];for(;r=u(),void 0!==r&&(s.push(r),t=e.peek(),n(t,","));)e.next();return s}()),s=e.next(),!n(s,")"))throw new SyntaxError('Expecting ) in a function call "'+t+'"');return{FunctionCall:{name:t,args:r}}}(r.value):{Identifier:r.value};if(r.type===i.Number)return r=e.next(),{Number:r.value};if(n(r,"(")){if(e.next(),t=u(),r=e.next(),!n(r,")"))throw new SyntaxError("Expecting )");return{Expression:t}}throw new SyntaxError("Parse error, can not process token "+r.value)}()}function a(e){return"number"==typeof r[e]?{Number:r[e]}:null}function l(){let t=o(),r=e.peek();for(;n(r,"^"+s);)r=e.next(),t={Binary:{operator:"^",left:t,right:"^"!==r.value?a(r.value):o()}},r=e.peek();return t}function c(){let t=l(),r=e.peek();for(;n(r,"*/");)r=e.next(),t={Binary:{operator:r.value,left:t,right:l()}},r=e.peek();return t}function u(){return function(){let t=c(),r=e.peek();for(;n(r,"+-");)r=e.next(),t={Binary:{operator:r.value,left:t,right:c()}},r=e.peek();return t}()}return{parse:function(t){e.reset(t);let r=u(),s=e.next();if(void 0!==s)throw new SyntaxError("Unexpected token "+s.value);return{Expression:r}}}},e.exports=t},4026(e,t,r){const s=r(768);"function"!=typeof RegExp.escape&&r(6117).shim();const i={capabilities:!0,listFileTypes:"get /file_formats",listServiceTypes:"get /service_types",listUdfRuntimes:"get /udf_runtimes",listProcessingParameters:"get /processing_parameters",listCollections:"get /collections",describeCollection:"get /collections/{}",listCollectionItems:"get /collections/{}/items",describeCollectionItem:"get /collections/{}/items/{}",describeCollectionQueryables:"get /collections/{}/queryables",listProcesses:"get /processes",describeProcess:"get /processes",listAuthProviders:!0,authenticateOIDC:"get /credentials/oidc",authenticateBasic:"get /credentials/basic",describeAccount:"get /me",listFiles:"get /files",getFile:"get /files",uploadFile:"put /files/{}",downloadFile:"get /files/{}",deleteFile:"delete /files/{}",validateProcess:"post /validation",listUserProcesses:"get /process_graphs",describeUserProcess:"get /process_graphs/{}",getUserProcess:"get /process_graphs/{}",setUserProcess:"put /process_graphs/{}",replaceUserProcess:"put /process_graphs/{}",deleteUserProcess:"delete /process_graphs/{}",computeResult:"post /result",listJobs:"get /jobs",createJob:"post /jobs",listServices:"get /services",createService:"post /services",getJob:"get /jobs/{}",describeJob:"get /jobs/{}",updateJob:"patch /jobs/{}",deleteJob:"delete /jobs/{}",estimateJob:"get /jobs/{}/estimate",debugJob:"get /jobs/{}/logs",startJob:"post /jobs/{}/results",stopJob:"delete /jobs/{}/results",listResults:"get /jobs/{}/results",downloadResults:"get /jobs/{}/results",describeService:"get /services/{}",getService:"get /services/{}",updateService:"patch /services/{}",deleteService:"delete /services/{}",debugService:"get /services/{}/logs"};class n{constructor(e){this.data=e,this.featureMap=i,this.features=[],this.validate(),this.init()}validate(){if(!s.isObject(this.data))throw new Error("No capabilities retrieved.");if(!this.data.api_version)throw new Error("Invalid capabilities: No API version retrieved");if(!Array.isArray(this.data.endpoints))throw new Error("Invalid capabilities: No endpoints retrieved")}init(){this.features=this.data.endpoints.map(e=>e.methods.map(t=>`${t} ${e.path.replace(/\{[^}]+\}/g,"{}")}`.toLowerCase())).reduce((e,t)=>e.concat(t),[])}toJSON(){return this.data}apiVersion(){return this.data.api_version}backendVersion(){return this.data.backend_version}title(){return"string"==typeof this.data.title?this.data.title:""}description(){return"string"==typeof this.data.description?this.data.description:""}isStable(){return!0===this.data.production}links(){return Array.isArray(this.data.links)?this.data.links:[]}listFederation(){let e=[];if(s.isObject(this.data.federation))for(const[t,r]of Object.entries(this.data.federation))e.push({id:t,...r});return e}getFederationBackend(e){return{id:e,...this.data.federation[e]}}getFederationBackends(e){return e.map(this.getFederationBackend,this)}listFeatures(){let e=[];for(let t in this.featureMap)(!0===this.featureMap[t]||this.features.includes(this.featureMap[t]))&&e.push(t);return e.sort()}hasFeature(e){let t=this.featureMap[e];return"string"==typeof t&&(t=t.toLowerCase()),!0===t||this.features.some(e=>e===t)}hasConformance(e){if("string"==typeof e&&(e=[e]),!Array.isArray(this.data.conformsTo)||!Array.isArray(e))return!1;const t=e.map(e=>RegExp.escape(e).replaceAll("\\*","[^/]+")).join("|"),r=new RegExp("^("+t+")$");return Boolean(this.data.conformsTo.find(e=>e.match(r)))}currency(){return s.isObject(this.data.billing)&&"string"==typeof this.data.billing.currency?this.data.billing.currency:null}listPlans(){if(s.isObject(this.data.billing)&&Array.isArray(this.data.billing.plans)){let e="string"==typeof this.data.billing.default_plan?this.data.billing.default_plan.toLowerCase():null;return this.data.billing.plans.map(t=>{let r={default:e===t.name.toLowerCase()};return Object.assign({},t,r)})}return[]}migrate(e){return e}}n.Conformance={openeo:"https://api.openeo.org/extensions/openeo/v1.*",stacCollections:["https://api.stacspec.org/v1.*/collections","https://api.stacspec.org/v1.*/ogcapi-features"],stacItems:"https://api.stacspec.org/v1.*/ogcapi-features",commercialData:"https://api.openeo.org/extensions/commercial-data/0.1.*",federation:"https://api.openeo.org/extensions/federation/0.1.*",processingParameters:"https://api.openeo.org/extensions/processing-parameters/0.1.*",remoteProcessDefinition:"https://api.openeo.org/extensions/remote-process-definition/0.1.*",workspaces:"https://api.openeo.org/extensions/workspaces/0.1.*"},e.exports=n},7704(e,t,r){const s=r(2458),i=r(768),n=r(3659),o=r(2742),a=r(1321),l=r(6147),c=r(933),u=r(3688),p=r(4026),h=r(9405),d=r(9649),f=r(4293),y=r(9806),g=r(5497),m=r(1425),b=r(2804),{CollectionPages:v,ItemPages:w,JobPages:x,ProcessPages:A,ServicePages:j,UserFilePages:_}=r(7226),O=["conformance","http://www.opengis.net/def/rel/ogc/1.0/conformance"];e.exports=class{constructor(e,t={},r=null){this.url=r,this.baseUrl=i.normalizeUrl(e),this.authProviderList=null,this.authProvider=null,this.capabilitiesObject=null,this.listeners={},this.options=t,this.processes=new n([],Boolean(t.addNamespaceToProcess)),this.processes.listeners.push((...e)=>this.emit("processesChanged",...e))}async init(){const e=await this._get("/"),t=Object.assign({},e.data);if(t.links=this.makeLinksAbsolute(t.links,e),!Array.isArray(t.conformsTo)&&Array.isArray(t.links)){const e=this._getLinkHref(t.links,O);if(e){const r=await this._get(e);i.isObject(r.data)&&Array.isArray(r.data.conformsTo)&&(t.conformsTo=r.data.conformsTo)}}return this.capabilitiesObject=new p(t),this.capabilitiesObject}async refreshProcessCache(){if(0===this.processes.count())return;const e=this.processes.namespaces().map(e=>{let t=()=>Promise.resolve();if("user"===e){const e=this.processes.namespace("user");this.isAuthenticated()?this.capabilities().hasFeature("listUserProcesses")&&(t=()=>this.listUserProcesses(e)):t=()=>this.processes.remove(null,"user")?Promise.resolve():Promise.reject(new Error("Can't clear user processes"))}else this.capabilities().hasFeature("listProcesses")&&(t=()=>this.listProcesses(e));return t().catch(t=>console.warn(`Could not update processes for namespace '${e}' due to an error: ${t.message}`))});return await Promise.all(e)}getBaseUrl(){return this.baseUrl}getUrl(){return this.url||this.baseUrl}capabilities(){return this.capabilitiesObject}async listFileTypes(){const e=await this._get("/file_formats");return new h(e.data)}async listProcessingParameters(){return(await this._get("/processing_parameters")).data}async listServiceTypes(){return(await this._get("/service_types")).data}async listUdfRuntimes(){return(await this._get("/udf_runtimes")).data}async listCollections(){const e=this.paginateCollections(null);return await e.nextPage([],!1)}paginateCollections(e=50){return new v(this,e)}async describeCollection(e){const t=await this._get("/collections/"+e);return t.data.stac_version?a.collection(t.data):t.data}listCollectionItems(e,t=null,r=null,s=null){let i={};return Array.isArray(t)&&(i.bbox=t.join(",")),Array.isArray(r)&&(i.datetime=r.map(e=>e instanceof Date?e.toISOString():"string"==typeof e?e:"..").join("/")),s>0&&(i.limit=s),new w(this,e,i,s)}normalizeNamespace(e){const t=e.match(/^https?:\/\/.*\/processes\/(@?[\w\-.~:]+)\/?/i);return t&&t.length>1?t[1]:e}async listProcesses(e=null){const t=this.paginateProcesses(e);return await t.nextPage([],!1)}paginateProcesses(e=null,t=50){return new A(this,t,e)}async describeProcess(e,t=null){if(t||(t="backend"),"backend"===t)await this.listProcesses();else{const r=await this._get(`/processes/${this.normalizeNamespace(t)}/${e}`);if(!i.isObject(r.data)||"string"!=typeof r.data.id)throw new Error("Invalid response received for process");this.processes.add(r.data,t)}return this.processes.get(e,t)}async buildProcess(e){return await this.listProcesses(),new m(this.processes,null,e)}async listAuthProviders(){if(null!==this.authProviderList)return this.authProviderList;this.authProviderList=[];const e=this.capabilities();if(e.hasFeature("authenticateOIDC")){const e=await this._get("/credentials/oidc"),t=this.getOidcProviderFactory();if(i.isObject(e.data)&&Array.isArray(e.data.providers)&&"function"==typeof t)for(let r in e.data.providers){const s=t(e.data.providers[r]);s instanceof l&&this.authProviderList.push(s)}}return e.hasFeature("authenticateBasic")&&this.authProviderList.push(new c(this)),this.authProviderList}setOidcProviderFactory(e){this.oidcProviderFactory=e}getOidcProviderFactory(){return"function"==typeof this.oidcProviderFactory?this.oidcProviderFactory:u.isSupported()?e=>new u(this,e):null}async authenticateBasic(e,t){const r=new c(this);await r.login(e,t)}isAuthenticated(){return null!==this.authProvider}emit(e,...t){"function"==typeof this.listeners[e]&&this.listeners[e](...t)}on(e,t){this.listeners[e]=t}off(e){delete this.listeners[e]}getAuthProvider(){return this.authProvider}setAuthProvider(e){e!==this.authProvider&&(this.authProvider=e instanceof l?e:null,this.emit("authProviderChanged",this.authProvider),this.refreshProcessCache())}setAuthToken(e,t,r){const s=new l(e,this,{id:t,title:"Custom",description:""});return s.setToken(r),this.setAuthProvider(s),s}async describeAccount(){return(await this._get("/me")).data}async listFiles(){const e=this.paginateFiles(null);return await e.nextPage()}paginateFiles(e=50){return new _(this,e)}async uploadFile(e,t=null,r=null,i=null){null===t&&(t=s.fileNameForUpload(e));const n=await this.getFile(t);return await n.uploadFile(e,r,i)}async getFile(e){return new d(this,e)}_normalizeUserProcess(e,t={}){return e instanceof y?e=e.toJSON():e instanceof b?(e.result=!0,e=e.parent.toJSON()):i.isObject(e)&&!i.isObject(e.process_graph)&&(e={process_graph:e}),Object.assign({},t,{process:e})}async validateProcess(e){const t=await this._post("/validation",this._normalizeUserProcess(e).process);if(Array.isArray(t.data.errors)){const e=t.data.errors;return e["federation:backends"]=Array.isArray(t.data["federation:backends"])?t.data["federation:backends"]:[],e}throw new Error("Invalid validation response received.")}async listUserProcesses(e=[]){const t=this.paginateUserProcesses(null);return await t.nextPage(e)}paginateUserProcesses(e=50){return this.paginateProcesses("user",e)}async setUserProcess(e,t){const r=new y(this,e);return await r.replaceUserProcess(t)}async getUserProcess(e){const t=new y(this,e);return await t.describeUserProcess()}async computeResult(e,t=null,r=null,n=null,o={}){const a=this._normalizeUserProcess(e,Object.assign({},o,{plan:t,budget:r})),l=await this._post("/result",a,s.getResponseType(),n),c={data:l.data,costs:null,type:null,logs:[]};"number"==typeof l.headers["openeo-costs"]&&(c.costs=l.headers["openeo-costs"]),"string"==typeof l.headers["content-type"]&&(c.type=l.headers["content-type"]);const u=Array.isArray(l.headers.link)?l.headers.link:[l.headers.link];for(let e of u){if("string"!=typeof e)continue;const t=e.match(/^<([^>]+)>;\s?rel="monitor"/i);if(Array.isArray(t)&&t.length>1)try{const e=await this._get(t[1]);i.isObject(e.data)&&Array.isArray(e.data.logs)&&(c.logs=e.data.logs)}catch(e){console.warn(e)}}return c}async downloadResult(e,t,r=null,i=null,n=null){const o=await this.computeResult(e,r,i,n);await s.saveToFile(o.data,t)}async listJobs(e=[]){const t=this.paginateJobs(null);return await t.nextPage(e)}paginateJobs(e=50){return new x(this,e)}async createJob(e,t=null,r=null,s=null,i=null,n={}){n=Object.assign({},n,{title:t,description:r,plan:s,budget:i});const o=this._normalizeUserProcess(e,n),a=await this._post("/jobs",o);if("string"!=typeof a.headers["openeo-identifier"])throw new Error("Response did not contain a Job ID. Job has likely been created, but may not show up yet.");const l=new f(this,a.headers["openeo-identifier"]).setAll(o);return this.capabilities().hasFeature("describeJob")?await l.describeJob():l}async getJob(e){const t=new f(this,e);return await t.describeJob()}async listServices(e=[]){const t=this.paginateServices(null);return await t.nextPage(e)}paginateServices(e=50){return new j(this,e)}async createService(e,t,r=null,s=null,i=!0,n={},o=null,a=null,l={}){const c=this._normalizeUserProcess(e,Object.assign({title:r,description:s,type:t,enabled:i,configuration:n,plan:o,budget:a},l)),u=await this._post("/services",c);if("string"!=typeof u.headers["openeo-identifier"])throw new Error("Response did not contain a Service ID. Service has likely been created, but may not show up yet.");const p=new g(this,u.headers["openeo-identifier"]).setAll(c);return this.capabilities().hasFeature("describeService")?p.describeService():p}async getService(e){const t=new g(this,e);return await t.describeService()}_getLinkHref(e,t){if(Array.isArray(t)||(t=[t]),Array.isArray(e)){const r=e.find(e=>i.isObject(e)&&t.includes(e.rel)&&"string"==typeof e.href);if(r)return r.href}return null}makeLinksAbsolute(e,t=null){if(!Array.isArray(e))return e;let r=null;return r=i.isObject(t)&&t.headers&&t.config&&t.request?t.config.baseURL+t.config.url:"string"!=typeof t?this._getLinkHref(e,"self"):t,r?e.map(e=>{if(!i.isObject(e)||"string"!=typeof e.href)return e;try{const t=new URL(e.href,r);return Object.assign({},e,{href:t.toString()})}catch(t){return e}}):e}async _get(e,t,r,s=null){return await this._send({method:"get",responseType:r,url:e,timeout:"/"===e?5e3:0,params:t},s)}async _post(e,t,r,s=null){const i={method:"post",responseType:r,url:e,data:t};return await this._send(i,s)}async _put(e,t){return await this._send({method:"put",url:e,data:t})}async _patch(e,t){return await this._send({method:"patch",url:e,data:t})}async _delete(e){return await this._send({method:"delete",url:e})}async download(e,t){return(await this._send({method:"get",responseType:s.getResponseType(),url:e,authorization:t})).data}_getAuthHeaders(){const e={};return this.isAuthenticated()&&(e.Authorization="Bearer "+this.authProvider.getToken()),e}async _send(e,t=null){e.baseURL=this.baseUrl,void 0!==e.authorization&&!0!==e.authorization||(e.headers||(e.headers={}),Object.assign(e.headers,this._getAuthHeaders())),e.responseType||(e.responseType="json"),t&&(e.signal=t.signal);try{let t=await o(e);const r=this.capabilities();return r&&(t=r.migrate(t)),t}catch(t){if(o.isCancel(t))throw t;const r=e=>"string"==typeof e&&-1!==e.indexOf("/json"),n=(e,t)=>("string"==typeof t.message&&(e.message=t.message),e.code="string"==typeof t.code?t.code:"",e.id=t.id,e.links=Array.isArray(t.links)?t.links:[],e);if(i.isObject(t.response)&&i.isObject(t.response.data)&&(r(t.response.data.type)||i.isObject(t.response.headers)&&r(t.response.headers["content-type"]))){if(e.responseType!==s.getResponseType())throw n(t,t.response.data);try{throw n(t,await s.handleErrorResponse(t))}catch(e){console.error(e)}}throw t}}}},9405(e,t,r){const s=r(768);e.exports=class{constructor(e){if(this.data={input:{},output:{}},s.isObject(e)){for(let t of["input","output"])for(let r in e[t])s.isObject(e[t])&&(this.data[t][r.toUpperCase()]=e[t][r]);this["federation:missing"]=e["federation:missing"]}}toJSON(){return this.data}getInputTypes(){return this.data.input}getOutputTypes(){return this.data.output}getInputType(e){return this._findType(e,"input")}getOutputType(e){return this._findType(e,"output")}_findType(e,t){return(e=e.toUpperCase())in this.data[t]?this.data[t][e]:null}}},4293(e,t,r){const s=r(2458),i=r(3054),n=r(2431),o=r(768),a=r(1321),l=["finished","canceled","error"];e.exports=class extends i{constructor(e,t){super(e,["id","title","description","process","status","progress","created","updated","plan","costs","budget","usage",["log_level","logLevel"],"links"]),this.id=t,this.title=void 0,this.description=void 0,this.process=void 0,this.status=void 0,this.progress=void 0,this.created=void 0,this.updated=void 0,this.plan=void 0,this.costs=void 0,this.budget=void 0}async describeJob(){let e=await this.connection._get("/jobs/"+this.id);return this.setAll(e.data)}async updateJob(e){return await this.connection._patch("/jobs/"+this.id,this._convertToRequest(e)),this._supports("describeJob")?await this.describeJob():this.setAll(e)}async deleteJob(){await this.connection._delete("/jobs/"+this.id)}async estimateJob(){return(await this.connection._get("/jobs/"+this.id+"/estimate")).data}debugJob(e=null){return new n(this.connection,"/jobs/"+this.id+"/logs",e)}monitorJob(e,t=60,r=!0){if("function"!=typeof e||t<1)return;let s=this.connection.capabilities();if(!s.hasFeature("describeJob"))throw new Error("Monitoring Jobs not supported by the back-end.");let i=this.status,n=null,o=null;s.hasFeature("debugJob")&&r&&(o=this.debugJob());let a=async()=>{this.getDataAge()>1&&await this.describeJob();let t=o?await o.nextLogs():[];(i!==this.status||t.length>0)&&e(this,t),i=this.status,l.includes(this.status)&&c()};setTimeout(a,0),n=setInterval(a,1e3*t);let c=()=>{n&&(clearInterval(n),n=null)};return c}async startJob(){return await this.connection._post("/jobs/"+this.id+"/results",{}),this._supports("describeJob")?await this.describeJob():this}async stopJob(){return await this.connection._delete("/jobs/"+this.id+"/results"),this._supports("describeJob")?await this.describeJob():this}async getResultsAsStac(){let e=await this.connection._get("/jobs/"+this.id+"/results");if(!o.isObject(e)||!o.isObject(e.data))throw new Error("Results received from the back-end are invalid");let t=a.stac(e.data);return o.isObject(t.assets)||(t.assets={}),"Feature"===t.type?"number"==typeof e.headers["openeo-costs"]&&(t.properties.costs=e.headers["openeo-costs"]):"number"==typeof e.headers["openeo-costs"]&&(t.costs=e.headers["openeo-costs"]),t}async listResults(){let e=await this.getResultsAsStac();return o.isObject(e.assets)?Object.values(e.assets):[]}async downloadResults(e){let t=await this.listResults();return await s.downloadResults(this.connection,t,e)}}},2431(e,t,r){const s=r(768);e.exports=class{constructor(e,t,r=null){this.connection=e,this.endpoint=t,this.lastId="",this.level=r,this.missing=new Set}async nextLogs(e=null){let t=await this.next(e);return Array.isArray(t.logs)?t.logs:[]}getMissingBackends(){return Array.from(this.missing)}async next(e=null){let t={offset:this.lastId};e>0&&(t.limit=e),this.level&&(t.level=this.level);let r=await this.connection._get(this.endpoint,t);return Array.isArray(r.data.logs)&&r.data.logs.length>0?(r.data.logs=r.data.logs.filter(e=>s.isObject(e)&&"string"==typeof e.id),this.lastId=r.data.logs[r.data.logs.length-1].id):r.data.logs=[],r.data.links=Array.isArray(r.data.links)?r.data.links:[],Array.isArray(r.data["federation:missing"])&&r.data["federation:missing"].forEach(e=>this.missing.add(e)),r.data}}},3688(e,t,r){const s=r(768),i=r(6147),n=r(2458),o=r(2117);class a extends i{static isSupported(){return s.isObject(o)&&Boolean(o.UserManager)}static async signinCallback(e=null,t={}){let r=n.getUrl();e||(e=new a(null,{})).setGrant(r.includes("?")?"authorization_code+pkce":"implicit");let s=e.getOptions(t),i=new o.UserManager(s);return await i.clearStaleState(),await i.signinCallback(r)}constructor(e,t){super("oidc",e,t),this.manager=null,this.listeners={},this.user=null,this.clientId=null,this.clientSecret=null,this.grant="authorization_code+pkce",this.issuer=t.issuer||"",this.scopes=Array.isArray(t.scopes)&&t.scopes.length>0?t.scopes:["openid"],this.refreshTokenScope="offline_access",this.links=Array.isArray(t.links)?t.links:[],this.defaultClients=Array.isArray(t.default_clients)?t.default_clients:[],this.authorizationParameters=s.isObject(t.authorization_parameters)?t.authorization_parameters:{},this.defaultClient=this.detectDefaultClient(),this.wellKnownDocument=null}addListener(e,t,r="default"){this.manager.events[`add${e}`](t),this.listeners[`${r}:${e}`]=t}removeListener(e,t="default"){this.manager.events[`remove${e}`](this.listeners[e]),delete this.listeners[`${t}:${e}`]}async login(e={},t=!1){if(!this.issuer||"string"!=typeof this.issuer)throw new Error("No Issuer URL available for OpenID Connect");if("client_credentials"===this.grant)return await this.loginClientCredentials();this.manager=new o.UserManager(this.getOptions(e,t)),this.addListener("UserLoaded",async()=>this.setUser(await this.manager.getUser()),"js-client"),this.addListener("AccessTokenExpired",()=>this.setUser(null),"js-client"),"popup"===a.uiMethod?await this.manager.signinPopup():await this.manager.signinRedirect()}async loginClientCredentials(){if(!this.clientId||!this.clientSecret)throw new Error("Client ID and Client Secret are required for the client credentials flow");let e=await this.getTokenEndpoint(),t=new URLSearchParams;t.append("grant_type","client_credentials"),t.append("client_id",this.clientId),t.append("client_secret",this.clientSecret),t.append("scope",this.scopes.join(" "));let r=(await n.axios.post(e,t.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data,s=new o.User({access_token:r.access_token,token_type:r.token_type||"Bearer",scope:r.scope||this.scopes.join(" "),expires_at:r.expires_in?Math.floor(Date.now()/1e3)+r.expires_in:void 0,profile:{}});this.setUser(s)}async getWellKnownDocument(){if(!this.issuer||"string"!=typeof this.issuer)return null;if(null===this.wellKnownDocument){const e=this.issuer.replace("/.well-known/openid-configuration","")+"/.well-known/openid-configuration",t=await n.axios.get(e);this.wellKnownDocument=t.data}return this.wellKnownDocument}async getTokenEndpoint(){const e=await this.getWellKnownDocument();if(!s.isObject(e)||!e.token_endpoint)throw new Error("Unable to discover token endpoint from issuer");return e.token_endpoint}async supportsClientCredentials(){try{const e=await this.getWellKnownDocument();return s.isObject(e)&&Array.isArray(e.grant_types_supported)?e.grant_types_supported.includes("client_credentials"):null}catch(e){return null}}async resume(e={}){if("client_credentials"===this.grant)return!1;this.manager=new o.UserManager(this.getOptions(e)),this.addListener("UserLoaded",async()=>this.setUser(await this.manager.getUser()),"js-client"),this.addListener("AccessTokenExpired",()=>this.setUser(null),"js-client");let t=await this.manager.getUser();return t&&t.expired&&t.refresh_token&&(t=await this.manager.signinSilent()),!(!t||t.expired||(this.setUser(t),0))}async logout(){if("client_credentials"===this.grant)return super.logout(),void this.setUser(null);if(null!==this.manager){try{"popup"===a.uiMethod?await this.manager.signoutPopup():await this.manager.signoutRedirect({post_logout_redirect_uri:n.getUrl()})}catch(e){console.warn(e)}super.logout(),this.removeListener("UserLoaded","js-client"),this.removeListener("AccessTokenExpired","js-client"),this.manager=null,this.setUser(null)}}getOptions(e={},t=!1){let r=this.getResponseType(),s=this.scopes.slice(0);return t&&!s.includes(this.refreshTokenScope)&&s.push(this.refreshTokenScope),Object.assign({client_id:this.clientId,redirect_uri:a.redirectUrl,authority:this.issuer.replace("/.well-known/openid-configuration",""),scope:s.join(" "),validateSubOnSilentRenew:!0,response_type:r,response_mode:r.includes("code")?"query":"fragment",extraQueryParams:this.authorizationParameters},e)}getResponseType(){switch(this.grant){case"authorization_code+pkce":return"code";case"implicit":return"token id_token";case"client_credentials":return null;default:throw new Error("Grant Type not supported")}}setGrant(e){switch(e){case"authorization_code+pkce":case"implicit":case"client_credentials":this.grant=e;break;default:throw new Error("Grant Type not supported")}}setClientId(e){this.clientId=e}setClientSecret(e){this.clientSecret=e}setUser(e){e?(this.user=e,this.setToken(e.access_token)):(this.user=null,this.setToken(null))}getDisplayName(){if(this.user&&s.isObject(this.user.profile))return this.user.profile.name||this.user.profile.preferred_username||this.user.profile.email||null;if("client_credentials"===this.grant&&this.clientId){let e=this.clientId;return e.length>15&&(e=e.slice(0,5)+"…"+e.slice(-5)),`Client ${e}`}return null}detectDefaultClient(){for(let e of a.grants){let t=this.defaultClients.find(t=>Boolean(t.grant_types.includes(e)&&Array.isArray(t.redirect_urls)&&t.redirect_urls.find(e=>e.startsWith(a.redirectUrl))));if(t)return this.setGrant(e),this.setClientId(t.id),this.defaultClient=t,t}return null}}a.uiMethod="redirect",a.redirectUrl=n.getUrl().split("#")[0].split("?")[0].replace(/\/$/,""),a.grants=["authorization_code+pkce","implicit","client_credentials"],e.exports=a},1224(e,t,r){const s=r(2742),i=r(768),n=r(3304),o=r(7704),a=r(4293),l=r(2431),c=r(9649),u=r(9806),p=r(5497),h=r(6147),d=r(933),f=r(3688),y=r(4026),g=r(9405),m=r(1425),b=r(2804),v=r(7897),w=r(2212),x="1.0.0-rc.2",A="1.x.x";class j{static async connect(e,t={}){let r=i.normalizeUrl(e,"/.well-known/openeo"),o=e,a=null;try{if(a=await s.get(r,{timeout:5e3}),!i.isObject(a.data)||!Array.isArray(a.data.versions))throw new Error("Well-Known Document doesn't list any versions.")}catch(e){console.warn("Can't read well-known document, connecting directly to the specified URL as fallback mechanism. Reason: "+e.message)}if(i.isObject(a)){let e=n.findLatest(a.data.versions,!0,x,A);if(null===e)throw new Error("Server not supported. Client only supports the API versions between "+x+" and "+A);o=e.url}let l=await j.connectDirect(o,t);return l.url=e,l}static async connectDirect(e,t={}){let r=new o(e,t),s=await r.init();if(n.compare(s.apiVersion(),x,"<")||n.compare(s.apiVersion(),A,">"))throw new Error("Client only supports the API versions between "+x+" and "+A);return r}static clientVersion(){return"2.11.0"}}j.Environment=r(2458),e.exports={AbortController,AuthProvider:h,BasicProvider:d,Capabilities:y,Connection:o,FileTypes:g,Job:a,Logs:l,OidcProvider:f,OpenEO:j,Service:p,UserFile:c,UserProcess:u,Builder:m,BuilderNode:b,Parameter:v,Formula:w}},7226(e,t,r){const s=r(4293),i=r(5497),n=r(9649),o=r(9806),a=r(768),l=r(1321),c="federation:missing";class u{constructor(e,t,r,s,i={},n="id"){this.connection=e,this.nextUrl=t,this.key=r,this.primaryKey=n,this.cls=s,i.limit>0||delete i.limit,this.params=i}hasNextPage(){return null!==this.nextUrl}async nextPage(e=[],t=!0){const r=await this.connection._get(this.nextUrl,this.params);let s=r.data;if(!a.isObject(s))throw new Error("Response is invalid, is not an object");if(!Array.isArray(s[this.key]))throw new Error(`Response is invalid, '${this.key}' property is not an array`);let i=s[this.key].map(t=>{let r=e.find(e=>e[this.primaryKey]===t[this.primaryKey]);return r?r.setAll(t):r=this._createObject(t),r});return i=this._cache(i),s.links=this._ensureArray(s.links),this.connection._getLinkHref(s.links,"self")||s.links.push({rel:"self",href:this.nextUrl}),this.nextUrl=this._getNextLink(r),this.params=null,t?(i.links=s.links,i[c]=this._ensureArray(s[c]),i):(s[this.key]=i,s)}_ensureArray(e){return Array.isArray(e)?e:[]}_createObject(e){if(this.cls){const t=new(0,this.cls)(this.connection,e[this.primaryKey]);return t.setAll(e),t}return e}_cache(e){return e}_getNextLink(e){const t=this.connection.makeLinksAbsolute(e.data.links,e);return this.connection._getLinkHref(t,"next")}[Symbol.asyncIterator](){return{self:this,async next(){const e=!this.self.hasNextPage();let t;return e||(t=await this.self.nextPage()),{done:e,value:t}}}}}e.exports={Pages:u,CollectionPages:class extends u{constructor(e,t=null){super(e,"/collections","collections",null,{limit:t})}_createObject(e){return e.stac_version?l.collection(e):e}},ItemPages:class extends u{constructor(e,t,r){super(e,`/collections/${t}/items`,"features",null,r)}_createObject(e){return e.stac_version?l.item(e):e}},JobPages:class extends u{constructor(e,t=null){super(e,"/jobs","jobs",s,{limit:t})}},ProcessPages:class extends u{constructor(e,t=null,r=null){let s;r||(r="backend");let i=null;"user"===r?(s="/process_graphs",i=o):(s="/processes","backend"!==r&&(s+=`/${e.normalizeNamespace(r)}`)),super(e,s,"processes",i,{limit:t}),this.namespace=r}_cache(e){const t=e.map(e=>"function"==typeof e.toJSON?e.toJSON():e);if(this.connection.processes.addAll(t,this.namespace),!this.cls)for(let t in e)e[t]=this.connection.processes.get(e[t].id,this.namespace);return e}},ServicePages:class extends u{constructor(e,t=null){super(e,"/services","services",i,{limit:t})}},UserFilePages:class extends u{constructor(e,t=null){super(e,"/files","files",n,{limit:t},"path")}}}},5497(e,t,r){const s=r(3054),i=r(2431);e.exports=class extends s{constructor(e,t){super(e,["id","title","description","process","url","type","enabled","configuration","attributes","created","plan","costs","budget","usage",["log_level","logLevel"],"links"]),this.id=t,this.title=void 0,this.description=void 0,this.process=void 0,this.url=void 0,this.type=void 0,this.enabled=void 0,this.configuration=void 0,this.attributes=void 0,this.created=void 0,this.plan=void 0,this.costs=void 0,this.budget=void 0}async describeService(){let e=await this.connection._get("/services/"+this.id);return this.setAll(e.data)}async updateService(e){return await this.connection._patch("/services/"+this.id,this._convertToRequest(e)),this._supports("describeService")?await this.describeService():this.setAll(e)}async deleteService(){await this.connection._delete("/services/"+this.id)}debugService(e=null){return new i(this.connection,"/services/"+this.id+"/logs",e)}monitorService(e,t=60,r=!0){if("function"!=typeof e||t<1)return;let s=this.connection.capabilities();if(!s.hasFeature("describeService"))throw new Error("Monitoring Services not supported by the back-end.");let i=this.enabled,n=null,o=null;s.hasFeature("debugService")&&r&&(o=this.debugService());let a=async()=>{this.getDataAge()>1&&await this.describeService();let t=o?await o.nextLogs():[];(i!==this.enabled||t.length>0)&&e(this,t),i=this.enabled};return setTimeout(a,0),n=setInterval(a,1e3*t),()=>{n&&(clearInterval(n),n=null)}}}},9649(e,t,r){const s=r(2458),i=r(3054);e.exports=class extends i{constructor(e,t){super(e,["path","size","modified"]),this.path=t,this.size=void 0,this.modified=void 0}async retrieveFile(){return await this.connection.download("/files/"+this.path,!0)}async downloadFile(e){let t=await this.connection.download("/files/"+this.path,!0);return await s.saveToFile(t,e)}async uploadFile(e,t=null,r=null){let i={method:"put",url:"/files/"+this.path,data:s.dataForUpload(e),headers:{"Content-Type":"application/octet-stream"}};"function"==typeof t&&(i.onUploadProgress=e=>{let r=Math.round(100*e.loaded/e.total);t(r,this)});let n=await this.connection._send(i,r);return this.setAll(n.data)}async deleteFile(){await this.connection._delete("/files/"+this.path)}}},9806(e,t,r){const s=r(3054),i=r(768);e.exports=class extends s{constructor(e,t){super(e,["id","summary","description","categories","parameters","returns","deprecated","experimental","exceptions","examples","links",["process_graph","processGraph"]]),this.id=t,this.summary=void 0,this.description=void 0,this.categories=void 0,this.parameters=void 0,this.returns=void 0,this.deprecated=void 0,this.experimental=void 0,this.exceptions=void 0,this.examples=void 0,this.links=void 0,this.processGraph=void 0}async describeUserProcess(){let e=await this.connection._get("/process_graphs/"+this.id);if(!i.isObject(e.data)||"string"!=typeof e.data.id)throw new Error("Invalid response received for user process");return this.connection.processes.add(e.data,"user"),this.setAll(e.data)}async replaceUserProcess(e){if(await this.connection._put("/process_graphs/"+this.id,this._convertToRequest(e)),this._supports("describeUserProcess"))return this.describeUserProcess();{let t=this.setAll(e);return this.connection.processes.add(t.toJSON(),"user"),t}}async deleteUserProcess(){await this.connection._delete("/process_graphs/"+this.id),this.connection.processes.remove(this.id,"user")}}},3144(e,t,r){"use strict";var s=r(6743),i=r(1002),n=r(76),o=r(7119);e.exports=o||s.call(n,i)},2205(e,t,r){"use strict";var s=r(6743),i=r(1002),n=r(3144);e.exports=function(){return n(s,i,arguments)}},1002(e){"use strict";e.exports=Function.prototype.apply},76(e){"use strict";e.exports=Function.prototype.call},3126(e,t,r){"use strict";var s=r(6743),i=r(9675),n=r(76),o=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return o(s,n,e)}},7119(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},8075(e,t,r){"use strict";var s=r(453),i=r(487),n=i(s("String.prototype.indexOf"));e.exports=function(e,t){var r=s(e,!!t);return"function"==typeof r&&n(e,".prototype.")>-1?i(r):r}},487(e,t,r){"use strict";var s=r(6897),i=r(655),n=r(3126),o=r(2205);e.exports=function(e){var t=n(arguments),r=e.length-(arguments.length-1);return s(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:o}):e.exports.apply=o},6556(e,t,r){"use strict";var s=r(453),i=r(3126),n=i([s("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=s(e,!!t);return"function"==typeof r&&n(e,".prototype.")>-1?i([r]):r}},8385(e,t,r){"use strict";r.r(t),r.d(t,{compare:()=>u,compareVersions:()=>c,satisfies:()=>f,validate:()=>y,validateStrict:()=>g});const s=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,i=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(s);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},n=e=>"*"===e||"x"===e||"X"===e,o=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},a=(e,t)=>{if(n(e)||n(t))return 0;const[r,s]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(o(e),o(t));return r>s?1:r<s?-1:0},l=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const s=a(e[r]||"0",t[r]||"0");if(0!==s)return s}return 0},c=(e,t)=>{const r=i(e),s=i(t),n=r.pop(),o=s.pop(),a=l(r,s);return 0!==a?a:n&&o?l(n.split("."),o.split(".")):n||o?n?-1:1:0},u=(e,t,r)=>{d(r);const s=c(e,t);return p[r].includes(s)},p={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},h=Object.keys(p),d=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===h.indexOf(e))throw new Error(`Invalid operator, expected one of ${h.join("|")}`)},f=(e,t)=>{if((t=t.replace(/([><=]+)\s+/g,"$1")).includes("||"))return t.split("||").some(t=>f(e,t));if(t.includes(" - ")){const[r,s]=t.split(" - ",2);return f(e,`>=${r} <=${s}`)}if(t.includes(" "))return t.trim().replace(/\s{2,}/g," ").split(" ").every(t=>f(e,t));const r=t.match(/^([<>=~^]+)/),s=r?r[1]:"=";if("^"!==s&&"~"!==s)return u(e,t,s);const[n,o,a,,c]=i(e),[p,h,d,,y]=i(t),g=[n,o,a],m=[p,null!=h?h:"x",null!=d?d:"x"];if(y){if(!c)return!1;if(0!==l(g,m))return!1;if(-1===l(c.split("."),y.split(".")))return!1}const b=m.findIndex(e=>"0"!==e)+1,v="~"===s?2:b>1?b:1;return 0===l(g.slice(0,v),m.slice(0,v))&&-1!==l(g.slice(v),m.slice(v))},y=e=>"string"==typeof e&&/^[v\d]/.test(e)&&s.test(e),g=e=>"string"==typeof e&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(e)},41(e,t,r){"use strict";var s=r(655),i=r(8068),n=r(9675),o=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new n("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new n("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],p=!!o&&o(e,t);if(s)s(e,t,{configurable:null===c&&p?p.configurable:!c,enumerable:null===a&&p?p.enumerable:!a,value:r,writable:null===l&&p?p.writable:!l});else{if(!u&&(a||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},8452(e,t,r){"use strict";var s=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),n=Object.prototype.toString,o=Array.prototype.concat,a=r(41),l=r(592)(),c=function(e,t,r,s){if(t in e)if(!0===s){if(e[t]===r)return}else if("function"!=typeof(i=s)||"[object Function]"!==n.call(i)||!s())return;var i;l?a(e,t,r,!0):a(e,t,r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},n=s(t);i&&(n=o.call(n,Object.getOwnPropertySymbols(t)));for(var a=0;a<n.length;a+=1)c(e,n[a],t[n[a]],r[n[a]])};u.supportsDescriptors=!!l,e.exports=u},7176(e,t,r){"use strict";var s,i=r(3126),n=r(5795);try{s=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!s&&n&&n(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},655(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1237(e){"use strict";e.exports=EvalError},9383(e){"use strict";e.exports=Error},9290(e){"use strict";e.exports=RangeError},9538(e){"use strict";e.exports=ReferenceError},8068(e){"use strict";e.exports=SyntaxError},9675(e){"use strict";e.exports=TypeError},5345(e){"use strict";e.exports=URIError},9612(e){"use strict";e.exports=Object},9252(e){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var s,i,n;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(i=s;0!==i--;)if(!e(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],r.get(i[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((s=t.length)!=r.length)return!1;for(i=s;0!==i--;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((s=(n=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=s;0!==i--;)if(!Object.prototype.hasOwnProperty.call(r,n[i]))return!1;for(i=s;0!==i--;){var o=n[i];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},2682(e,t,r){"use strict";var s=r(9600),i=Object.prototype.toString,n=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!s(t))throw new TypeError("iterator must be a function");var o,a;arguments.length>=3&&(o=r),a=e,"[object Array]"===i.call(a)?function(e,t,r){for(var s=0,i=e.length;s<i;s++)n.call(e,s)&&(null==r?t(e[s],s,e):t.call(r,e[s],s,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var s=0,i=e.length;s<i;s++)null==r?t(e.charAt(s),s,e):t.call(r,e.charAt(s),s,e)}(e,t,o):function(e,t,r){for(var s in e)n.call(e,s)&&(null==r?t(e[s],s,e):t.call(r,e[s],s,e))}(e,t,o)}},9353(e){"use strict";var t=Object.prototype.toString,r=Math.max,s=function(e,t){for(var r=[],s=0;s<e.length;s+=1)r[s]=e[s];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var n,o=function(e){for(var t=[],r=1,s=0;r<e.length;r+=1,s+=1)t[s]=e[r];return t}(arguments),a=r(0,i.length-o.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(n=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var t=i.apply(this,s(o,arguments));return Object(t)===t?t:this}return i.apply(e,s(o,arguments))}),i.prototype){var u=function(){};u.prototype=i.prototype,n.prototype=new u,u.prototype=null}return n}},6743(e,t,r){"use strict";var s=r(9353);e.exports=Function.prototype.bind||s},453(e,t,r){"use strict";var s,i=r(9612),n=r(9383),o=r(1237),a=r(9290),l=r(9538),c=r(8068),u=r(9675),p=r(5345),h=r(1514),d=r(8968),f=r(6188),y=r(8002),g=r(5880),m=r(414),b=r(3093),v=Function,w=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch(e){}},x=r(5795),A=r(655),j=function(){throw new u},_=x?function(){try{return j}catch(e){try{return x(arguments,"callee").get}catch(e){return j}}}():j,O=r(4039)(),P=r(3628),S=r(1064),k=r(8648),E=r(1002),C=r(76),U={},T="undefined"!=typeof Uint8Array&&P?P(Uint8Array):s,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?s:ArrayBuffer,"%ArrayIteratorPrototype%":O&&P?P([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":"undefined"==typeof Atomics?s:Atomics,"%BigInt%":"undefined"==typeof BigInt?s:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?s:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?s:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?s:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?s:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?s:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":U,"%Int8Array%":"undefined"==typeof Int8Array?s:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?s:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&P?P(P([][Symbol.iterator]())):s,"%JSON%":"object"==typeof JSON?JSON:s,"%Map%":"undefined"==typeof Map?s:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&P?P((new Map)[Symbol.iterator]()):s,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?s:Promise,"%Proxy%":"undefined"==typeof Proxy?s:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?s:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?s:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O&&P?P((new Set)[Symbol.iterator]()):s,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&P?P(""[Symbol.iterator]()):s,"%Symbol%":O?Symbol:s,"%SyntaxError%":c,"%ThrowTypeError%":_,"%TypedArray%":T,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?s:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?s:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?s:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?s:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?s:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?s:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?s:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":E,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":S,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":f,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":b,"%Reflect.getPrototypeOf%":k};if(P)try{null.error}catch(e){var F=P(P(e));I["%Error.prototype%"]=F}var R=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var s=e("%AsyncGeneratorFunction%");s&&(r=s.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&P&&(r=P(i.prototype))}return I[t]=r,r},N={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},J=r(6743),M=r(9957),z=J.call(C,Array.prototype.concat),$=J.call(E,Array.prototype.splice),B=J.call(C,String.prototype.replace),L=J.call(C,String.prototype.slice),D=J.call(C,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,H=function(e,t){var r,s=e;if(M(N,s)&&(s="%"+(r=N[s])[0]+"%"),M(I,s)){var i=I[s];if(i===U&&(i=R(s)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:s,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===D(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=L(e,0,1),r=L(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var s=[];return B(e,G,function(e,t,r,i){s[s.length]=r?B(i,V,"$1"):t||e}),s}(e),s=r.length>0?r[0]:"",i=H("%"+s+"%",t),n=i.name,o=i.value,a=!1,l=i.alias;l&&(s=l[0],$(r,z([0,1],l)));for(var p=1,h=!0;p<r.length;p+=1){var d=r[p],f=L(d,0,1),y=L(d,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new c("property names with quotes must have matching quotes");if("constructor"!==d&&h||(a=!0),M(I,n="%"+(s+="."+d)+"%"))o=I[n];else if(null!=o){if(!(d in o)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(x&&p+1>=r.length){var g=x(o,d);o=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[d]}else h=M(o,d),o=o[d];h&&!a&&(I[n]=o)}}return o}},1064(e,t,r){"use strict";var s=r(9612);e.exports=s.getPrototypeOf||null},8648(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},3628(e,t,r){"use strict";var s=r(8648),i=r(1064),n=r(7176);e.exports=s?function(e){return s(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:n?function(e){return n(e)}:null},6549(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},5795(e,t,r){"use strict";var s=r(6549);if(s)try{s([],"length")}catch(e){s=null}e.exports=s},592(e,t,r){"use strict";var s=r(655),i=function(){return!!s};i.hasArrayLengthDefineBug=function(){if(!s)return null;try{return 1!==s([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},4039(e,t,r){"use strict";var s="undefined"!=typeof Symbol&&Symbol,i=r(1333);e.exports=function(){return"function"==typeof s&&"function"==typeof Symbol&&"symbol"==typeof s("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var s in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(e,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},9092(e,t,r){"use strict";var s=r(1333);e.exports=function(){return s()&&!!Symbol.toStringTag}},9957(e,t,r){"use strict";var s=Function.prototype.call,i=Object.prototype.hasOwnProperty,n=r(6743);e.exports=n.call(s,i)},9600(e){"use strict";var t,r,s=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var n=/^\s*class\b/,o=function(e){try{var t=s.call(e);return n.test(t)}catch(e){return!1}},a=function(e){try{return!o(e)&&(s.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),p=function(){return!1};if("object"==typeof document){var h=document.all;l.call(h)===l.call(document.all)&&(p=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!o(e)&&a(e)}:function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(o(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},4035(e,t,r){"use strict";var s,i=r(6556),n=r(9092)(),o=r(9957),a=r(5795);if(n){var l=i("RegExp.prototype.exec"),c={},u=function(){throw c},p={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(p[Symbol.toPrimitive]=u),s=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!t||!o(t,"value"))return!1;try{l(e,p)}catch(e){return e===c}}}else{var h=i("Object.prototype.toString");s=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=s},1514(e){"use strict";e.exports=Math.abs},8968(e){"use strict";e.exports=Math.floor},3331(e,t,r){"use strict";var s=r(4459);e.exports=function(e){return("number"==typeof e||"bigint"==typeof e)&&!s(e)&&e!==1/0&&e!==-1/0}},7440(e,t,r){"use strict";var s=r(1514),i=r(8968),n=r(4459),o=r(3331);e.exports=function(e){if("number"!=typeof e||n(e)||!o(e))return!1;var t=s(e);return i(t)===t}},4459(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},6188(e){"use strict";e.exports=Math.max},8002(e){"use strict";e.exports=Math.min},1350(e,t,r){"use strict";var s=r(8968);e.exports=function(e,t){var r=e%t;return s(r>=0?r:r+t)}},5880(e){"use strict";e.exports=Math.pow},414(e){"use strict";e.exports=Math.round},3093(e,t,r){"use strict";var s=r(4459);e.exports=function(e){return s(e)||0===e?e:e<0?-1:1}},8875(e,t,r){"use strict";var s;if(!Object.keys){var i=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=r(1093),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();s=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===n.call(e),s=o(e),a=t&&"[object String]"===n.call(e),h=[];if(!t&&!r&&!s)throw new TypeError("Object.keys called on a non-object");var f=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)h.push(String(y));if(s&&e.length>0)for(var g=0;g<e.length;++g)h.push(String(g));else for(var m in e)f&&"prototype"===m||!i.call(e,m)||h.push(String(m));if(l)for(var b=function(e){if("undefined"==typeof window||!d)return p(e);try{return p(e)}catch(e){return!1}}(e),v=0;v<u.length;++v)b&&"constructor"===u[v]||!i.call(e,u[v])||h.push(u[v]);return h}}e.exports=s},1189(e,t,r){"use strict";var s=Array.prototype.slice,i=r(1093),n=Object.keys,o=n?function(e){return n(e)}:r(8875),a=Object.keys;o.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(s.call(e)):a(e)})}else Object.keys=o;return Object.keys||o},e.exports=o},1093(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),s="[object Arguments]"===r;return s||(s="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),s}},6460(e,t,r){"use strict";var s=r(4210),i=r(6698),n=r(2114),o=r(6156),a=r(3519),l=r(2161),c=r(3703),u=r(9675),p=r(2656),h=r(2682),d=r(9721),f=d(/^\s$/),y=d(/^[\n\r\u2028\u2029]$/),g={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r",__proto__:null};e.exports=function(e){if(!p(e))throw new u("Assertion failed: `c` must be a valid Unicode code point");var t=a(e);if(i("^$\\.*+?()[]{}|",t,0)>-1||"/"===t)return"\\"+t;if(t in g)return"\\"+g[t];if(i(",-=<>#&!%:;@~'`\"",t,0)>-1||f(t)||y(t)||l(e)||c(e)){if(e<255){var r=s(e,16);return"\\x"+n(r,2,"0","START")}var d="";return h(t,function(e){d+=o(e)}),d}return t}},3835(e,t,r){"use strict";var s=r(6460),i=r(4210),n=r(280),o=r(9721),a=r(2682),l=r(9675),c=o(/^[\da-zA-Z]$/),u=r(8075)("String.prototype.charCodeAt"),p=function(e){var t=u(e,0);if(t<55296||t>56319||1===e.length)return t;var r=u(e,1);return r<56320||r>57343?t:1024*(t-55296)+(r-56320)+65536};e.exports=function(e){if("string"!=typeof e)throw new l("`S` must be a String");var t="",r=n(e);return a(r,function(e){if(""===t&&c(e)){var r=i(p(e),16);t+="\\x"+r}else t+=s(p(e))}),t}},6117(e,t,r){"use strict";var s=r(8452),i=r(487),n=r(3835),o=r(1570),a=r(0),l=i(n,null);s(l,{getPolyfill:o,implementation:n,method:n,shim:a}),e.exports=l},1570(e,t,r){"use strict";var s=r(3835);e.exports=function(){return RegExp.escape||s}},0(e,t,r){"use strict";var s=r(8452),i=r(1570)();e.exports=function(){return s(RegExp,{escape:i}),RegExp.escape}},9721(e,t,r){"use strict";var s=r(6556),i=r(4035),n=s("RegExp.prototype.exec"),o=r(9675);e.exports=function(e){if(!i(e))throw new o("`regex` must be a RegExp");return function(t){return null!==n(e,t)}}},6897(e,t,r){"use strict";var s=r(453),i=r(41),n=r(592)(),o=r(5795),a=r(9675),l=s("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],s=!0,c=!0;if("length"in e&&o){var u=o(e,"length");u&&!u.configurable&&(s=!1),u&&!u.writable&&(c=!1)}return(s||c||!r)&&(n?i(e,"length",t,!0,!0):i(e,"length",t)),e}},2117(e){"use strict";e.exports=t},2742(t){"use strict";t.exports=e},7312(e,t,r){"use strict";var s=r(9675),i=r(6556),n=r(2161),o=r(3703),a=r(3254),l=i("String.prototype.charAt"),c=i("String.prototype.charCodeAt");e.exports=function(e,t){if("string"!=typeof e)throw new s("Assertion failed: `string` must be a String");var r=e.length;if(t<0||t>=r)throw new s("Assertion failed: `position` must be >= 0, and < the length of `string`");var i=c(e,t),u=l(e,t),p=n(i),h=o(i);if(!p&&!h)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(h||t+1===r)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=c(e,t+1);return o(d)?{"[[CodePoint]]":a(i,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4210(e,t,r){"use strict";var s=r(9675),i=r(6556),n=r(7440),o=i("Number.prototype.toString");e.exports=function(e,t){if("number"!=typeof e)throw new s("Assertion failed: `x` must be a Number");if(!n(t)||t<2||t>36)throw new s("Assertion failed: `radix` must be an integer >= 2 and <= 36");return o(e,t)}},6698(e,t,r){"use strict";var s=r(6556),i=r(9675),n=r(7440),o=s("String.prototype.slice");e.exports=function(e,t,r){if("string"!=typeof e)throw new i("Assertion failed: `string` must be a String");if("string"!=typeof t)throw new i("Assertion failed: `searchValue` must be a String");if(!n(r)||r<0)throw new i("Assertion failed: `fromIndex` must be a non-negative integer");var s=e.length;if(""===t&&r<=s)return r;for(var a=t.length,l=r;l<=s-a;l+=1)if(o(e,l,l+a)===t)return l;return-1}},2114(e,t,r){"use strict";var s=r(9675),i=r(6556),n=r(7440),o=i("String.prototype.slice");e.exports=function(e,t,r,i){if("string"!=typeof e)throw new s("Assertion failed: `S` must be a String");if(!n(t)||t<0)throw new s("Assertion failed: `maxLength` must be a non-negative integer");if("string"!=typeof r)throw new s("Assertion failed: `fillString` must be a String");if("start"!==i&&"end"!==i&&"START"!==i&&"END"!==i)throw new s("Assertion failed: `placement` must be ~START~ or ~END~");var a=e.length;if(t<=a)return e;if(""===r)return e;for(var l=t-a,c="";c.length<l;)c+=r;return c=o(c,0,l),"start"===i||"START"===i?c+e:e+c}},280(e,t,r){"use strict";var s=r(9675),i=r(7312);e.exports=function(e){if("string"!=typeof e)throw new s("Assertion failed: `string` must be a String");for(var t=[],r=e.length,n=0;n<r;){var o=i(e,n);t[t.length]=o["[[CodePoint]]"],n+=o["[[CodeUnitCount]]"]}return t}},3519(e,t,r){"use strict";var s=r(453),i=r(9675),n=s("%String.fromCharCode%"),o=r(5986),a=r(4224),l=r(2656);e.exports=function(e){if(!l(e))throw new i("Assertion failed: `cp` must be >= 0 and <= 0x10FFFF");return e<=65535?n(e):n(o((e-65536)/1024)+55296)+n(a(e-65536,1024)+56320)}},3254(e,t,r){"use strict";var s=r(453),i=r(9675),n=s("%String.fromCharCode%"),o=r(2161),a=r(3703);e.exports=function(e,t){if(!o(e)||!a(t))throw new i("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return n(e)+n(t)}},6156(e,t,r){"use strict";var s=r(9675),i=r(6556),n=i("String.prototype.charCodeAt"),o=i("Number.prototype.toString"),a=i("String.prototype.toLowerCase"),l=r(2114);e.exports=function(e){if("string"!=typeof e||1!==e.length)throw new s("Assertion failed: `C` must be a single code unit");var t=n(e,0);if(t>65535)throw new s("`Assertion failed: numeric value of `C` must be <= 0xFFFF");return"\\u"+l(a(o(t,16)),4,"0","start")}},5986(e,t,r){"use strict";var s=r(8968);e.exports=function(e){return"bigint"==typeof e?e:s(e)}},4224(e,t,r){"use strict";var s=r(113);e.exports=function(e,t){return s(e,t)}},2656(e){"use strict";e.exports=function(e){return"number"==typeof e&&e>=0&&e<=1114111&&(0|e)===e}},2161(e){"use strict";e.exports=function(e){return"number"==typeof e&&e>=55296&&e<=56319}},3703(e){"use strict";e.exports=function(e){return"number"==typeof e&&e>=56320&&e<=57343}},113(e,t,r){"use strict";e.exports=r(1350)}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return r[e].call(n.exports,n,n.exports,i),n.exports}return i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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(1224)})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openeo/js-client",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "author": "openEO Consortium",
5
5
  "contributors": [
6
6
  {
@@ -127,6 +127,16 @@ class AuthProvider {
127
127
  }
128
128
  }
129
129
 
130
+ /**
131
+ * Tries to resume an existing session.
132
+ *
133
+ * @param {...any} args
134
+ * @returns {boolean} `true` if the session could be resumed, `false` otherwise
135
+ */
136
+ async resume(...args) { // eslint-disable-line no-unused-vars
137
+ return false;
138
+ }
139
+
130
140
  /**
131
141
  * Abstract method that extending classes implement the login process with.
132
142
  *
@@ -53,6 +53,7 @@ class OidcProvider extends AuthProvider {
53
53
  }
54
54
  let providerOptions = provider.getOptions(options);
55
55
  let oidc = new Oidc.UserManager(providerOptions);
56
+ await oidc.clearStaleState();
56
57
  return await oidc.signinCallback(url);
57
58
  }
58
59
 
@@ -82,10 +83,19 @@ class OidcProvider extends AuthProvider {
82
83
  */
83
84
  this.clientId = null;
84
85
 
86
+ /**
87
+ * The client secret to use for authentication.
88
+ *
89
+ * Only used for the `client_credentials` grant type.
90
+ *
91
+ * @type {string | null}
92
+ */
93
+ this.clientSecret = null;
94
+
85
95
  /**
86
96
  * The grant type (flow) to use for this provider.
87
97
  *
88
- * Either "authorization_code+pkce" (default) or "implicit"
98
+ * Either "authorization_code+pkce" (default), "implicit" or "client_credentials"
89
99
  *
90
100
  * @type {string}
91
101
  */
@@ -143,6 +153,13 @@ class OidcProvider extends AuthProvider {
143
153
  * @type {OidcClient}
144
154
  */
145
155
  this.defaultClient = this.detectDefaultClient();
156
+
157
+ /**
158
+ * The cached OpenID Connect well-known configuration document.
159
+ *
160
+ * @type {object.<string, *> | null}
161
+ */
162
+ this.wellKnownDocument = null;
146
163
  }
147
164
 
148
165
  /**
@@ -176,7 +193,8 @@ class OidcProvider extends AuthProvider {
176
193
  /**
177
194
  * Authenticate with OpenID Connect (OIDC).
178
195
  *
179
- * Supported only in Browser environments.
196
+ * Supported in Browser environments for `authorization_code+pkce` and `implicit` grants.
197
+ * The `client_credentials` grant is supported in all environments.
180
198
  *
181
199
  * @async
182
200
  * @param {object.<string, *>} [options={}] - Object with authentication options.
@@ -191,6 +209,10 @@ class OidcProvider extends AuthProvider {
191
209
  throw new Error("No Issuer URL available for OpenID Connect");
192
210
  }
193
211
 
212
+ if (this.grant === 'client_credentials') {
213
+ return await this.loginClientCredentials();
214
+ }
215
+
194
216
  this.manager = new Oidc.UserManager(this.getOptions(options, requestRefreshToken));
195
217
  this.addListener('UserLoaded', async () => this.setUser(await this.manager.getUser()), 'js-client');
196
218
  this.addListener('AccessTokenExpired', () => this.setUser(null), 'js-client');
@@ -202,12 +224,143 @@ class OidcProvider extends AuthProvider {
202
224
  }
203
225
  }
204
226
 
227
+ /**
228
+ * Authenticate using the OIDC Client Credentials grant.
229
+ *
230
+ * Requires `clientId` and `clientSecret` to be set.
231
+ * This flow does not use the oidc-client library and works in all environments.
232
+ *
233
+ * @async
234
+ * @protected
235
+ * @returns {Promise<void>}
236
+ * @throws {Error}
237
+ */
238
+ async loginClientCredentials() {
239
+ if (!this.clientId || !this.clientSecret) {
240
+ throw new Error("Client ID and Client Secret are required for the client credentials flow");
241
+ }
242
+
243
+ let tokenEndpoint = await this.getTokenEndpoint();
244
+
245
+ let params = new URLSearchParams();
246
+ params.append('grant_type', 'client_credentials');
247
+ params.append('client_id', this.clientId);
248
+ params.append('client_secret', this.clientSecret);
249
+ params.append('scope', this.scopes.join(' '));
250
+
251
+ let response = await Environment.axios.post(tokenEndpoint, params.toString(), {
252
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
253
+ });
254
+
255
+ let data = response.data;
256
+ let user = new Oidc.User({
257
+ access_token: data.access_token,
258
+ token_type: data.token_type || 'Bearer',
259
+ scope: data.scope || this.scopes.join(' '),
260
+ expires_at: data.expires_in ? Math.floor(Date.now() / 1000) + data.expires_in : undefined,
261
+ profile: {}
262
+ });
263
+ this.setUser(user);
264
+ }
265
+
266
+ /**
267
+ * Retrieves the OpenID Connect well-known configuration document.
268
+ *
269
+ * @async
270
+ * @returns {Promise<object.<str, *>> | null} The well-known configuration document, or `null` if the issuer URL is not set.
271
+ */
272
+ async getWellKnownDocument() {
273
+ if (!this.issuer || typeof this.issuer !== 'string') {
274
+ return null;
275
+ }
276
+ if (this.wellKnownDocument === null) {
277
+ const authority = this.issuer.replace('/.well-known/openid-configuration', '');
278
+ const discoveryUrl = authority + '/.well-known/openid-configuration';
279
+ const response = await Environment.axios.get(discoveryUrl);
280
+ this.wellKnownDocument = response.data;
281
+ }
282
+ return this.wellKnownDocument;
283
+ }
284
+
285
+ /**
286
+ * Discovers the token endpoint from the OpenID Connect issuer.
287
+ *
288
+ * @async
289
+ * @protected
290
+ * @returns {Promise<string>} The token endpoint URL.
291
+ * @throws {Error}
292
+ */
293
+ async getTokenEndpoint() {
294
+ const wellKnown = await this.getWellKnownDocument();
295
+ if (!Utils.isObject(wellKnown) || !wellKnown.token_endpoint) {
296
+ throw new Error("Unable to discover token endpoint from issuer");
297
+ }
298
+ return wellKnown.token_endpoint;
299
+ }
300
+
301
+ /**
302
+ * Checks whether the OpenID Connect provider supports the Client Credentials grant.
303
+ *
304
+ * @async
305
+ * @returns {Promise<boolean|null>} `true` if the Client Credentials grant is supported, `false` otherwise. `null` if unknown.
306
+ */
307
+ async supportsClientCredentials() {
308
+ try {
309
+ const wellKnown = await this.getWellKnownDocument();
310
+ if (!Utils.isObject(wellKnown) || !Array.isArray(wellKnown.grant_types_supported)) {
311
+ return null;
312
+ }
313
+ return wellKnown.grant_types_supported.includes('client_credentials');
314
+ } catch (error) {
315
+ return null;
316
+ }
317
+ }
318
+
319
+ /**
320
+ * Restores a previously established OIDC session from storage.
321
+ *
322
+ * Not supported for the `client_credentials` grant as credentials
323
+ * are not persisted. Use `login()` to re-authenticate instead.
324
+ *
325
+ * @async
326
+ * @param {object.<string, *>} [options={}] - Additional options passed to the OIDC UserManager.
327
+ * @returns {Promise<boolean>} `true` if the session could be resumed, `false` otherwise.
328
+ * @see https://github.com/IdentityModel/oidc-client-js/wiki#usermanager
329
+ */
330
+ async resume(options = {}) {
331
+ if (this.grant === 'client_credentials') {
332
+ return false;
333
+ }
334
+
335
+ this.manager = new Oidc.UserManager(this.getOptions(options));
336
+ this.addListener('UserLoaded', async () => this.setUser(await this.manager.getUser()), 'js-client');
337
+ this.addListener('AccessTokenExpired', () => this.setUser(null), 'js-client');
338
+
339
+ let user = await this.manager.getUser();
340
+ if (user && user.expired && user.refresh_token) {
341
+ user = await this.manager.signinSilent();
342
+ }
343
+
344
+ if (user && !user.expired) {
345
+ this.setUser(user);
346
+ return true;
347
+ }
348
+
349
+ return false;
350
+ }
351
+
205
352
  /**
206
353
  * Logout from the established session.
207
354
  *
208
355
  * @async
209
356
  */
210
357
  async logout() {
358
+ if (this.grant === 'client_credentials') {
359
+ super.logout();
360
+ this.setUser(null);
361
+ return;
362
+ }
363
+
211
364
  if (this.manager !== null) {
212
365
  try {
213
366
  if (OidcProvider.uiMethod === 'popup') {
@@ -272,6 +425,8 @@ class OidcProvider extends AuthProvider {
272
425
  return 'code';
273
426
  case 'implicit':
274
427
  return 'token id_token';
428
+ case 'client_credentials':
429
+ return null;
275
430
  default:
276
431
  throw new Error('Grant Type not supported');
277
432
  }
@@ -287,6 +442,7 @@ class OidcProvider extends AuthProvider {
287
442
  switch(grant) {
288
443
  case 'authorization_code+pkce':
289
444
  case 'implicit':
445
+ case 'client_credentials':
290
446
  this.grant = grant;
291
447
  break;
292
448
  default:
@@ -305,6 +461,17 @@ class OidcProvider extends AuthProvider {
305
461
  this.clientId = clientId;
306
462
  }
307
463
 
464
+ /**
465
+ * Sets the Client Secret for OIDC authentication.
466
+ *
467
+ * Only used for the `client_credentials` grant type.
468
+ *
469
+ * @param {string | null} clientSecret
470
+ */
471
+ setClientSecret(clientSecret) {
472
+ this.clientSecret = clientSecret;
473
+ }
474
+
308
475
  /**
309
476
  * Sets the OIDC User.
310
477
  *
@@ -325,12 +492,21 @@ class OidcProvider extends AuthProvider {
325
492
  /**
326
493
  * Returns a display name for the authenticated user.
327
494
  *
495
+ * For the `client_credentials` grant, returns a name based on the client ID.
496
+ *
328
497
  * @returns {string?} Name of the user or `null`
329
498
  */
330
499
  getDisplayName() {
331
500
  if (this.user && Utils.isObject(this.user.profile)) {
332
501
  return this.user.profile.name || this.user.profile.preferred_username || this.user.profile.email || null;
333
502
  }
503
+ if (this.grant === 'client_credentials' && this.clientId) {
504
+ let id = this.clientId;
505
+ if (id.length > 15) {
506
+ id = id.slice(0, 5) + '\u2026' + id.slice(-5);
507
+ }
508
+ return `Client ${id}`;
509
+ }
334
510
  return null;
335
511
  }
336
512
 
@@ -392,7 +568,8 @@ OidcProvider.redirectUrl = Environment.getUrl().split('#')[0].split('?')[0].repl
392
568
  */
393
569
  OidcProvider.grants = [
394
570
  'authorization_code+pkce',
395
- 'implicit'
571
+ 'implicit',
572
+ 'client_credentials'
396
573
  ];
397
574
 
398
575
  module.exports = OidcProvider;
package/src/openeo.js CHANGED
@@ -109,7 +109,7 @@ class OpenEO {
109
109
  * @returns {string} Version number (according to SemVer).
110
110
  */
111
111
  static clientVersion() {
112
- return "2.10.0";
112
+ return "2.11.0";
113
113
  }
114
114
 
115
115
  }