{
  "version": 3,
  "sources": ["../../src/index.ts", "../../../ic-client/src/webauthn/aaguid.ts", "../../../ic-client/src/webauthn/agent-js/cose-utils.ts", "../../../ic-client/src/webauthn/agent-js/cose-key.ts", "../../../ic-client/src/webauthn/credential.ts", "../../../ic-client/src/webauthn/errors.ts", "../../../ic-client/src/webauthn/identity.ts", "../../../ic-client/src/webauthn/_constants.ts", "../../../ic-client/src/webauthn/_options.ts", "../../../ic-client/src/webauthn/_progress.ts", "../../../ic-client/src/webauthn/types/progress.ts", "../../../ic-client/src/webauthn/utils.ts", "../../src/auth/services/auth-timout.services.ts", "../../src/core/stores/_store.ts", "../../src/auth/stores/auth.store.ts", "../../src/auth/utils/events.utils.ts", "../../src/core/stores/actor.store.ts", "../../src/core/stores/agent.store.ts", "../../src/core/stores/_agent.factory.ts", "../../src/core/constants/container.constants.ts", "../../src/auth/stores/auth-client.store.ts", "../../src/auth/services/sign-out.services.ts", "../../src/auth/services/_auth-client.services.ts", "../../src/auth/services/_user.services.ts", "../../../errors/src/utils.ts", "../../../errors/src/constants/cdn.constants.ts", "../../../errors/src/constants/collections.constants.ts", "../../../errors/src/constants/satellite.constants.ts", "../../../errors/src/constants/shared.constants.ts", "../../src/core/constants/call-options.constants.ts", "../../src/core/services/any-identity.services.ts", "../../src/auth/services/identity.services.ts", "../../src/datastore/api/doc.api.ts", "../../src/core/api/actor.api.ts", "../../../ic-client/src/actor/api/actor.api.ts", "../../../ic-client/src/declarations/mission_control/mission_control.factory.did.js", "../../../ic-client/src/declarations/orbiter/orbiter.factory.did.js", "../../../ic-client/src/declarations/orbiter/orbiter.factory.certified.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated-no-scope.factory.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/orbiter-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/mission_control-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated.factory.did.js", "../../../ic-client/src/declarations/satellite/satellite.factory.did.js", "../../../ic-client/src/declarations/satellite/satellite.factory.certified.did.js", "../../../ic-client/src/declarations/console/console.factory.did.js", "../../../ic-client/src/declarations/console/console.factory.certified.did.js", "../../../ic-client/src/declarations/sputnik/sputnik.factory.did.js", "../../../ic-client/src/actor/api/agent.api.ts", "../../../ic-client/src/actor/utils/agent.utils.ts", "../../src/core/utils/env.utils.ts", "../../src/core/stores/env.store.ts", "../../src/core/utils/list.utils.ts", "../../src/auth/types/errors.ts", "../../../utils/src/utils/did.utils.ts", "../../../utils/src/utils/env.utils.ts", "../../src/datastore/utils/data.utils.ts", "../../src/datastore/utils/doc.utils.ts", "../../src/datastore/services/doc.services.ts", "../../src/auth/services/load.services.ts", "../../src/core/utils/window.env.utils.ts", "../../src/auth/providers/internet-identity.providers.ts", "../../src/auth/constants/auth.constants.ts", "../../src/auth/utils/window.utils.ts", "../../src/auth/providers/_auth-client.providers.ts", "../../src/auth/helpers/progress.helpers.ts", "../../src/auth/types/auth-client.ts", "../../src/auth/services/redirect.services.ts", "../../../auth/src/errors.ts", "../../../auth/src/_session.ts", "../../../auth/src/api/_actor.api.ts", "../../../auth/src/api/auth.api.ts", "../../../auth/src/utils/session.utils.ts", "../../../auth/src/_constants.ts", "../../../auth/src/_context.ts", "../../../auth/src/utils/auth.utils.ts", "../../../auth/src/utils/url.utils.ts", "../../../auth/src/utils/session-storage.utils.ts", "../../../auth/src/utils/state.utils.ts", "../../../auth/src/authenticate.ts", "../../../auth/src/_openid.ts", "../../../auth/src/request.ts", "../../src/auth/helpers/window.helpers.ts", "../../src/auth/providers/google.providers.ts", "../../src/auth/providers/webauthn.providers.ts", "../../src/auth/services/user-webauthn.services.ts", "../../src/auth/types/webauthn.ts", "../../src/auth/services/sign-in.services.ts", "../../src/auth/services/sign-up.services.ts", "../../src/auth/utils/user.utils.ts", "../../src/functions/services/functions.services.ts", "../../src/storage/services/storage.services.ts", "../../src/storage/api/storage.api.ts", "../../../storage/src/services/upload.services.ts", "../../src/storage/utils/crypto.utils.ts"],
  "sourcesContent": ["import {assertNonNullish} from '@dfinity/utils';\nimport {isWebAuthnAvailable} from '@junobuild/ic-client/webauthn';\nimport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage} from '@junobuild/storage';\nimport {initAuthTimeoutWorker} from './auth/services/auth-timout.services';\nimport {loadAuth} from './auth/services/load.services';\nimport {AuthStore} from './auth/stores/auth.store';\nimport type {User} from './auth/types/user';\nimport {EnvStore} from './core/stores/env.store';\nimport type {Environment, UserEnvironment} from './core/types/env';\nimport type {Unsubscribe} from './core/types/subscription';\nimport {envContainer, envSatelliteId} from './core/utils/window.env.utils';\nexport * from './auth/providers/internet-identity.providers';\nexport {getIdentityOnce, unsafeIdentity} from './auth/services/identity.services';\nexport {handleRedirectCallback} from './auth/services/redirect.services';\nexport {signIn} from './auth/services/sign-in.services';\nexport {signOut} from './auth/services/sign-out.services';\nexport {signUp} from './auth/services/sign-up.services';\nexport type * from './auth/types/auth';\nexport * from './auth/types/auth-client';\nexport * from './auth/types/errors';\nexport type * from './auth/types/progress';\nexport type * from './auth/types/provider';\nexport type * from './auth/types/user';\nexport * from './auth/types/webauthn';\nexport * from './auth/utils/user.utils';\nexport type * from './core/types/env';\nexport {ListOrder, ListPaginate, ListParams, ListResults} from './core/types/list';\nexport type * from './core/types/satellite';\nexport type * from './core/types/subscription';\nexport type * from './core/types/utility';\nexport * from './datastore/services/doc.services';\nexport type * from './datastore/types/doc';\nexport * from './functions/services/functions.services';\nexport * from './storage/services/storage.services';\nexport type * from './storage/types/storage';\nexport {isWebAuthnAvailable};\nexport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage};\n\nconst parseEnv = (userEnv?: UserEnvironment): Environment => {\n  const satelliteId = userEnv?.satelliteId ?? envSatelliteId();\n\n  assertNonNullish(satelliteId, 'Satellite ID is not configured. Juno cannot be initialized.');\n\n  const container = userEnv?.container ?? envContainer();\n\n  return {\n    satelliteId,\n    internetIdentityId: userEnv?.internetIdentityId,\n    workers: userEnv?.workers,\n    container\n  };\n};\n\n/**\n * @deprecated Use {@link initSatellite} instead.\n */\nexport const initJuno = (userEnv?: UserEnvironment): Promise<Unsubscribe[]> =>\n  initSatellite(userEnv);\n\n/**\n * Initializes a Satellite with the provided optional environment parameters.\n * If no environment is provided, the variables injected by the Vite or NextJS plugins will be used.\n * @param {UserEnvironment} [userEnv] - The optional user environment configuration.\n * @returns {Promise<Unsubscribe[]>} A promise that resolves to an array of unsubscribe functions.\n */\nexport const initSatellite = async (userEnv?: UserEnvironment): Promise<Unsubscribe[]> => {\n  const env = parseEnv(userEnv);\n\n  EnvStore.getInstance().set(env);\n\n  await loadAuth();\n\n  const authSubscribe =\n    env.workers?.auth !== undefined ? initAuthTimeoutWorker(env.workers.auth) : undefined;\n\n  return [...(authSubscribe ? [authSubscribe] : [])];\n};\n\n/**\n * Subscribes to authentication state changes. i.e. each time a user signs in or signs out, the callback will be triggered.\n * @param {function(User | null): void} callback - The callback function to execute when the authentication state changes.\n * @returns {Unsubscribe} A function to unsubscribe from the authentication state changes.\n */\nexport const onAuthStateChange = (callback: (authUser: User | null) => void): Unsubscribe =>\n  AuthStore.getInstance().subscribe(callback);\n\n/**\n * @deprecated Use {@link onAuthStateChange} instead.\n */\nexport const authSubscribe = onAuthStateChange;\nexport {InternetIdentityConfig, InternetIdentityDomain} from './auth/types/internet-identity';\n", "import {uint8ArrayToArrayOfNumber} from '@dfinity/utils';\n\n/**\n * Extracts the AAGUID (Authenticator Attestation GUID) from a WebAuthn data buffer.\n *\n * The AAGUID is a 16-byte value located at offsets 37..53 within `authenticatorData`\n * when **attested credential data** is present (i.e., during registration/attestation).\n *\n * For assertion (sign-in) responses, `authenticatorData` is typically 37 bytes and\n * does not include an AAGUID.\n *\n * If the extracted value is all zeros (`00000000-0000-0000-0000-000000000000`),\n * this function returns `{ unknownProvider: null }` since some passkey providers\n * intentionally use a zero AAGUID.\n *\n * @param {Object} params\n * @param {Uint8Array} params.authData - The WebAuthn `authenticatorData` bytes.\n * @returns {{aaguid: string; bytes: Uint8Array} | {invalidAuthData: null} | {unknownProvider: null}}\n * - { aaguidText, aaguidBytes } for valid AAGUID\n * - { unknownProvider: null } for all-zero AAGUID\n * - { invalidAuthData: null } if `authData` is invalid (too short, too long, etc.)\n *\n * @see https://web.dev/articles/webauthn-aaguid\n */\nexport const extractAAGUID = ({\n  authData\n}: {\n  authData: Uint8Array;\n}):\n  | {aaguidText: string; aaguidBytes: Uint8Array}\n  | {invalidAuthData: null}\n  | {unknownProvider: null} => {\n  if (authData.byteLength < 37) {\n    return {invalidAuthData: null};\n  }\n\n  if (authData.byteLength < 53) {\n    return {invalidAuthData: null};\n  }\n\n  const bytes = authData.slice(37, 53);\n\n  const result = bytesToAAGUID({bytes});\n\n  if ('aaguid' in result) {\n    return {aaguidBytes: bytes, aaguidText: result.aaguid};\n  }\n\n  return {unknownProvider: null};\n};\n\n/**\n * Convert 16 AAGUID bytes to canonical UUID string (lowercase, hyphenated).\n *\n * Returns:\n * - { aaguid } for non-zero AAGUIDs\n * - { unknownProvider: null } for all-zero AAGUID\n * - { invalidBytes: null } if length \u2260 16\n *\n * @param {{bytes: Uint8Array | number[]}} params\n * @returns {{aaguid: string} | {invalidBytes: null} | {unknownProvider: null}}\n */\nexport const bytesToAAGUID = ({\n  bytes\n}: {\n  bytes: Uint8Array | number[];\n}): {aaguid: string} | {invalidBytes: null} | {unknownProvider: null} => {\n  if (bytes.length !== 16) {\n    return {invalidBytes: null};\n  }\n\n  const hex = (bytes instanceof Uint8Array ? uint8ArrayToArrayOfNumber(bytes) : bytes)\n    .map((byte) => byte.toString(16).padStart(2, '0'))\n    .join('');\n\n  const aaguid = hex.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '$1-$2-$3-$4-$5');\n\n  // \"00000000-0000-0000-0000-0000000000000\" represents an unknown passkey provider. Some passkey providers use this AAGUID intentionally.\n  // Source: https://web.dev/articles/webauthn-aaguid\n  if (aaguid === '00000000-0000-0000-0000-000000000000') {\n    return {unknownProvider: null};\n  }\n\n  return {aaguid};\n};\n", "import {DER_COSE_OID, wrapDER, type DerEncodedPublicKey} from '@icp-sdk/core/agent';\n\n/**\n * \u26A0\uFE0F !!!WARNING!!! \u26A0\uFE0F\n * This module is a copy/paste of the webauthn functions not exposed by Agent-js.\n * It is therefore not covered by any tests (\u203C\uFE0F) in this library.\n *\n * @see https://github.com/dfinity/agent-js/blob/main/packages/identity/src/identity/webauthn.ts\n */\n\n/**\n * From the documentation;\n * The authData is a byte array described in the spec. Parsing it will involve slicing bytes from\n * the array and converting them into usable objects.\n *\n * See https://webauthn.guide/#registration (subsection \"Example: Parsing the authenticator data\").\n * @param authData The authData field of the attestation response.\n * @returns The COSE key of the authData.\n */\nexport function _authDataToCose(authData: Uint8Array): Uint8Array {\n  const dataView = new DataView(new ArrayBuffer(2));\n  const idLenBytes = authData.slice(53, 55);\n  [...new Uint8Array(idLenBytes)].forEach((v, i) => dataView.setUint8(i, v));\n  const credentialIdLength = dataView.getUint16(0);\n\n  // Get the public key object.\n  return authData.slice(55 + credentialIdLength);\n}\n\nexport function _coseToDerEncodedBlob(cose: Uint8Array): DerEncodedPublicKey {\n  return wrapDER(cose, DER_COSE_OID) as DerEncodedPublicKey;\n}\n", "import type {DerEncodedPublicKey} from '@icp-sdk/core/agent';\nimport type {PublicKeyWithToRaw} from '../types/identity';\nimport {_coseToDerEncodedBlob} from './cose-utils';\n\n/**\n * \u26A0\uFE0F !!!WARNING!!! \u26A0\uFE0F\n * This module is a copy/paste of the webauthn classes not exposed by Agent-js\n * extended with mandatory toRaw() and encodedKey made private.\n * It is therefore not covered by that many tests (\u203C\uFE0F) in this library.\n *\n * @see https://github.com/dfinity/agent-js/blob/main/packages/identity/src/identity/webauthn.ts\n */\n\n/**\n * COSE-encoded key (CBOR Object Signing and Encryption).\n * serialized as a Uint8Array.\n */\nexport type CoseEncodedKey = Uint8Array;\n\nexport class CosePublicKey implements PublicKeyWithToRaw {\n  readonly #encodedKey: DerEncodedPublicKey;\n\n  public constructor(protected _cose: CoseEncodedKey) {\n    this.#encodedKey = _coseToDerEncodedBlob(_cose);\n  }\n\n  public toDer(): DerEncodedPublicKey {\n    return this.#encodedKey;\n  }\n\n  public toRaw(): Uint8Array {\n    return new Uint8Array(this.#encodedKey); // Strip __derEncodedPublicKey__\n  }\n}\n", "import {uint8ArrayToBase64} from '@dfinity/utils';\nimport {extractAAGUID} from './aaguid';\nimport {type CoseEncodedKey, CosePublicKey} from './agent-js/cose-key';\nimport type {PublicKeyWithToRaw} from './types/identity';\n\n/**\n * Arguments to initialize a WebAuthn object.\n */\nexport interface InitWebAuthnCredentialArgs {\n  /**\n   * The credential ID (authenticator\u2019s `rawId`) as bytes.\n   */\n  rawId: Uint8Array;\n\n  /**\n   * COSE-encoded public key extracted from attestation/authData.\n   */\n  cose: CoseEncodedKey;\n}\n\nexport interface InitWebAuthnNewCredentialArgs extends InitWebAuthnCredentialArgs {\n  /**\n   * The authenticator data from the attestation.\n   */\n  authData: Uint8Array;\n}\n\n/**\n * A wrapper around a WebAuthn credential that provides various base information such as its ID or public key.\n */\nexport abstract class WebAuthnCredential {\n  readonly #credentialId: Uint8Array;\n  readonly #publicKey: CosePublicKey;\n\n  /**\n   * @param args - {@link InitWebAuthnCredentialArgs} used to initialize the credential.\n   * @param args.rawId - Credential ID (`rawId`) as bytes.\n   * @param args.cose - COSE-encoded public key.\n   */\n  constructor({rawId: credentialId, cose}: InitWebAuthnCredentialArgs) {\n    this.#credentialId = credentialId;\n    this.#publicKey = new CosePublicKey(cose);\n  }\n\n  /**\n   * Returns the public key for this credential.\n   */\n  getPublicKey(): PublicKeyWithToRaw {\n    return this.#publicKey;\n  }\n\n  /**\n   * Returns the credential ID as bytes.\n   */\n  getCredentialId(): Uint8Array {\n    return this.#credentialId;\n  }\n\n  /**\n   * Returns the credential ID as textual representation (a base64 string).\n   */\n  getCredentialIdText(): string {\n    return uint8ArrayToBase64(this.#credentialId);\n  }\n}\n\n/**\n * A wrapper around a newly created WebAuthn credential.\n * It is created using `navigator.credentials.create` which provides an attestation.\n */\nexport class WebAuthnNewCredential extends WebAuthnCredential {\n  readonly #aaguidText: string | undefined;\n  readonly #aaguidBytes: Uint8Array | undefined;\n\n  /**\n   * @param args - {@link InitWebAuthnNewCredentialArgs} used to initialize the credential.\n   * @param args.rawId - Credential ID (`rawId`) as bytes.\n   * @param args.cose - COSE-encoded public key.\n   * @params args.authData - Authenticator data from the attestation.\n   */\n  constructor({authData, ...rest}: InitWebAuthnNewCredentialArgs) {\n    super(rest);\n\n    const optionAaguid = extractAAGUID({authData});\n    this.#aaguidText = 'aaguidText' in optionAaguid ? optionAaguid.aaguidText : undefined;\n    this.#aaguidBytes = 'aaguidBytes' in optionAaguid ? optionAaguid.aaguidBytes : undefined;\n  }\n\n  /**\n   * Returns AAGUID (Authenticator Attestation GUID).\n   */\n  getAAGUID(): Uint8Array | undefined {\n    return this.#aaguidBytes;\n  }\n\n  /**\n   * Returns the textual representation of the AAGUID (Authenticator Attestation GUID).\n   */\n  getAAGUIDText(): string | undefined {\n    return this.#aaguidText;\n  }\n}\n\n/**\n * A wrapper around a retrieval of existing WebAuthn credential.\n * It is created using `navigator.credentials.get` which provides an assertion.\n */\nexport class WebAuthnExistingCredential extends WebAuthnCredential {}\n", "export class WebAuthnIdentityHostnameError extends Error {}\nexport class WebAuthnIdentityCredentialNotInitializedError extends Error {}\nexport class WebAuthnIdentityCreateCredentialOnTheDeviceError extends Error {}\nexport class WebAuthnIdentityCredentialNotPublicKeyError extends Error {}\nexport class WebAuthnIdentityNoAttestationError extends Error {}\nexport class WebAuthnIdentityInvalidCredentialIdError extends Error {}\nexport class WebAuthnIdentityEncodeCborSignatureError extends Error {}\n// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData\nexport class WebAuthnIdentityNoAuthenticatorDataError extends Error {}\n// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/signature\nexport class WebAuthnIdentityNoSignatureError extends Error {}\n", "import {arrayBufferToUint8Array, isNullish, uint8ArraysEqual} from '@dfinity/utils';\nimport {Cbor, type Signature, SignIdentity} from '@icp-sdk/core/agent';\nimport {AUTHENTICATOR_ABORT_TIMEOUT} from './_constants';\nimport {createPasskeyOptions, retrievePasskeyOptions} from './_options';\nimport {execute} from './_progress';\nimport {_authDataToCose} from './agent-js/cose-utils';\nimport {\n  type InitWebAuthnNewCredentialArgs,\n  type WebAuthnCredential,\n  WebAuthnExistingCredential,\n  WebAuthnNewCredential\n} from './credential';\nimport {\n  WebAuthnIdentityCreateCredentialOnTheDeviceError,\n  WebAuthnIdentityCredentialNotInitializedError,\n  WebAuthnIdentityCredentialNotPublicKeyError,\n  WebAuthnIdentityEncodeCborSignatureError,\n  WebAuthnIdentityInvalidCredentialIdError,\n  WebAuthnIdentityNoAttestationError,\n  WebAuthnIdentityNoAuthenticatorDataError\n} from './errors';\nimport type {\n  AuthenticatorOptions,\n  CreateWebAuthnIdentityWithExistingCredentialArgs,\n  CreateWebAuthnIdentityWithNewCredentialArgs,\n  PublicKeyWithToRaw,\n  RetrievePublicKeyFn\n} from './types/identity';\nimport type {PasskeyOptions} from './types/passkey';\nimport {\n  type WebAuthnSignProgressArgs,\n  type WebAuthnSignProgressFn,\n  WebAuthnSignProgressStep\n} from './types/progress';\n\ntype PublicKeyCredentialWithAttachment = Omit<PublicKeyCredential, 'response'> & {\n  response: AuthenticatorAssertionResponse & {\n    attestationObject?: ArrayBuffer;\n  };\n};\n\nconst createAbortSignal = ({\n  timeout\n}: Pick<AuthenticatorOptions<PasskeyOptions>, 'timeout'>): AbortSignal =>\n  AbortSignal.timeout(timeout ?? AUTHENTICATOR_ABORT_TIMEOUT);\n\nconst retrieveCredentials = async ({\n  challenge,\n  credentialIds,\n  passkeyOptions,\n  timeout\n}: {\n  challenge: Uint8Array;\n  credentialIds?: Uint8Array[];\n} & AuthenticatorOptions<PasskeyOptions>): Promise<Credential | null> =>\n  await navigator.credentials.get({\n    publicKey: {\n      ...retrievePasskeyOptions(passkeyOptions),\n      challenge: challenge.buffer as BufferSource,\n      allowCredentials: (credentialIds ?? []).map((id) => ({\n        id: id.buffer as BufferSource,\n        type: 'public-key'\n      }))\n    },\n    signal: createAbortSignal({timeout})\n  });\n\ntype WebAuthnState<T extends WebAuthnCredential> =\n  | {status: 'pending'; retrievePublicKey: RetrievePublicKeyFn}\n  | {status: 'initialized'; credential: T};\n\nconst assertWebAuthnStateInitialized: <T extends WebAuthnCredential>(\n  state: WebAuthnState<T>\n) => asserts state is {\n  status: 'initialized';\n  credential: T;\n} = <T extends WebAuthnCredential>(state: WebAuthnState<T>): void => {\n  if (state.status !== 'initialized') {\n    throw new WebAuthnIdentityCredentialNotInitializedError();\n  }\n};\n\nconst assertNonNullishCredential: (\n  credential: Credential | null\n) => asserts credential is Credential = (credential: Credential | null): void => {\n  if (isNullish(credential)) {\n    throw new WebAuthnIdentityCreateCredentialOnTheDeviceError();\n  }\n};\n\nconst assertCredentialPublicKey: (\n  credential: Credential\n) => asserts credential is PublicKeyCredentialWithAttachment = ({type}: Credential): void => {\n  if (type !== 'public-key') {\n    throw new WebAuthnIdentityCredentialNotPublicKeyError();\n  }\n};\n\n/**\n * A signing identity for the Internet Computer, backed by a WebAuthn credential.\n *\n * Use one of the factory methods to construct an instance:\n * - {@link WebAuthnIdentity.createWithNewCredential} to create a new passkey on the device.\n * - {@link WebAuthnIdentity.createWithExistingCredential} to use an existing passkey.\n *\n * @template T Concrete credential type for this identity\n * ({@link WebAuthnNewCredential} or {@link WebAuthnExistingCredential}).\n */\nexport class WebAuthnIdentity<T extends WebAuthnCredential> extends SignIdentity {\n  readonly #onSignProgress: WebAuthnSignProgressFn | undefined;\n  #state: WebAuthnState<T>;\n\n  /**\n   * @hidden Use the factory methods instead.\n   *\n   * Initializes the identity in either:\n   * - **pending** state (existing-credential path; public key not yet known), or\n   * - **initialized** state (new-credential path; public key known immediately).\n   *\n   * @private\n   */\n  private constructor({\n    onProgress,\n    ...args\n  }: WebAuthnSignProgressArgs &\n    (\n      | InitWebAuthnNewCredentialArgs\n      | Pick<CreateWebAuthnIdentityWithExistingCredentialArgs, 'retrievePublicKey'>\n    )) {\n    super();\n\n    this.#onSignProgress = onProgress;\n\n    if ('retrievePublicKey' in args) {\n      const {retrievePublicKey} = args;\n\n      this.#state = {\n        status: 'pending',\n        retrievePublicKey\n      };\n\n      return;\n    }\n\n    this.#state = WebAuthnIdentity.#createInitializedState({\n      credential: new WebAuthnNewCredential(args)\n    });\n  }\n\n  static #createInitializedState<T extends WebAuthnCredential>({\n    credential\n  }: {\n    credential: WebAuthnNewCredential | WebAuthnExistingCredential;\n  }): WebAuthnState<T> {\n    return {\n      status: 'initialized',\n      credential: credential as T\n    };\n  }\n\n  /**\n   * Creates a new passkey on the device and returns an initialized identity.\n   *\n   * If you chain `create` and `sign`, the user will be prompted twice to authenticate\n   * with their authenticator. You can track progress via the `onProgress` callback.\n   *\n   * @param args {@link CreateWebAuthnIdentityWithNewCredentialArgs} Options to create the passkey.\n   * @returns A {@link WebAuthnIdentity} parameterized with {@link WebAuthnNewCredential}.\n   */\n  static async createWithNewCredential({\n    passkeyOptions,\n    timeout,\n    ...restArgs\n  }: CreateWebAuthnIdentityWithNewCredentialArgs = {}): Promise<\n    WebAuthnIdentity<WebAuthnNewCredential>\n  > {\n    const credential = await navigator.credentials.create({\n      publicKey: createPasskeyOptions(passkeyOptions),\n      signal: createAbortSignal({timeout})\n    });\n\n    assertNonNullishCredential(credential);\n    assertCredentialPublicKey(credential);\n\n    const {\n      response: {attestationObject},\n      rawId\n    } = credential;\n\n    if (isNullish(attestationObject)) {\n      throw new WebAuthnIdentityNoAttestationError();\n    }\n\n    // We have to parse the attestationObject as CBOR to ultimately retrieve the public key.\n    // Similar as what's implemented in AgentJS.\n    const {authData} = Cbor.decode<{authData: Uint8Array}>(\n      arrayBufferToUint8Array(attestationObject)\n    );\n\n    const cose = _authDataToCose(authData);\n\n    return new WebAuthnIdentity<WebAuthnNewCredential>({\n      ...restArgs,\n      rawId: arrayBufferToUint8Array(rawId),\n      cose,\n      authData\n    });\n  }\n\n  /**\n   * Creates an identity for an existing passkey.\n   *\n   * @param args {@link CreateWebAuthnIdentityWithExistingCredentialArgs} Options to retrieve the passkey.\n   * @returns A {@link WebAuthnIdentity} parameterized with {@link WebAuthnExistingCredential}.\n   */\n  // We use async for consistency reason and because it might be future prone.\n  // eslint-disable-next-line require-await\n  static async createWithExistingCredential(\n    args: CreateWebAuthnIdentityWithExistingCredentialArgs\n  ): Promise<WebAuthnIdentity<WebAuthnExistingCredential>> {\n    return new WebAuthnIdentity<WebAuthnExistingCredential>(args);\n  }\n\n  /**\n   * Returns the credential\u2019s public key.\n   *\n   * @returns {PublicKey}\n   * @throws WebAuthnIdentityCredentialNotInitializedError if the identity has not signed\n   * any request yet.\n   */\n  override getPublicKey(): PublicKeyWithToRaw {\n    assertWebAuthnStateInitialized(this.#state);\n\n    const {credential} = this.#state;\n\n    return credential.getPublicKey();\n  }\n\n  /**\n   * Returns the concrete credential wrapper for this identity.\n   *\n   * For identities created with:\n   * - `createWithNewCredential` \u2192 {@link WebAuthnNewCredential}\n   * - `createWithExistingCredential` \u2192 {@link WebAuthnExistingCredential}\n   *\n   * @throws WebAuthnIdentityCredentialNotInitializedError if the identity has not signed\n   * any request yet.\n   */\n  getCredential(): T {\n    assertWebAuthnStateInitialized(this.#state);\n\n    const {credential} = this.#state;\n\n    return credential;\n  }\n\n  /**\n   * Signs an arbitrary blob using the platform authenticator.\n   *\n   * @param blob Bytes to sign (used as the WebAuthn challenge).\n   * @returns {Promise<Signature>} CBOR-encoded signature payload.\n   */\n  override async sign(blob: Uint8Array): Promise<Signature> {\n    // 1. Request user credential (navigator.credentials.get)\n    const requestCredential = async (): Promise<PublicKeyCredential> => {\n      const credential = await retrieveCredentials({\n        challenge: blob,\n        ...(this.#state.status === 'initialized' && {\n          credentialIds: [this.#state.credential.getCredentialId()]\n        })\n      });\n\n      assertNonNullishCredential(credential);\n      assertCredentialPublicKey(credential);\n\n      return credential;\n    };\n\n    const credential = await execute({\n      fn: requestCredential,\n      step: WebAuthnSignProgressStep.RequestingUserCredential,\n      onProgress: this.#onSignProgress\n    });\n\n    // 2. Assert credential ID if already initialized or load public key from backend and init state\n    const finalizingCredential = async () => {\n      const {rawId} = credential;\n\n      // If the state was already initialized - credentials.create - then we \"only\"\n      // assert that the rawId retrieved by credentials.get is equals to the one already known.\n      if (this.#state.status === 'initialized') {\n        if (\n          !uint8ArraysEqual({\n            a: this.#state.credential.getCredentialId(),\n            b: arrayBufferToUint8Array(rawId)\n          })\n        ) {\n          throw new WebAuthnIdentityInvalidCredentialIdError();\n        }\n\n        return;\n      }\n\n      // If the state was pending, we need to retrieve the public key for the credential\n      // that was saved during a previous sign-up\n      // because credentials.get does not provide an attestation.\n      const {retrievePublicKey} = this.#state;\n\n      const cose = await retrievePublicKey({\n        credentialId: arrayBufferToUint8Array(rawId)\n      });\n\n      this.#state = WebAuthnIdentity.#createInitializedState({\n        credential: new WebAuthnExistingCredential({\n          rawId: arrayBufferToUint8Array(rawId),\n          cose\n        })\n      });\n    };\n\n    await execute({\n      fn: finalizingCredential,\n      step: WebAuthnSignProgressStep.FinalizingCredential,\n      onProgress: this.#onSignProgress\n    });\n\n    // 3. Sign the request\n    // eslint-disable-next-line require-await\n    const encodeSignature = async (): Promise<Signature> => {\n      const {response} = credential;\n\n      const {clientDataJSON} = response;\n\n      // Only the response of type AuthenticatorAssertionResponse provides authenticatorData and signature\n      // which is the type of response we are expecting.\n      const {authenticatorData, signature} =\n        'authenticatorData' in response && 'signature' in response\n          ? (response as AuthenticatorAssertionResponse)\n          : {};\n\n      if (isNullish(authenticatorData)) {\n        throw new WebAuthnIdentityNoAuthenticatorDataError();\n      }\n\n      if (isNullish(signature)) {\n        throw new WebAuthnIdentityNoAuthenticatorDataError();\n      }\n\n      const encoded = Cbor.encode({\n        authenticator_data: authenticatorData,\n        client_data_json: new TextDecoder().decode(clientDataJSON),\n        signature: arrayBufferToUint8Array(signature)\n      });\n\n      if (isNullish(encoded)) {\n        throw new WebAuthnIdentityEncodeCborSignatureError();\n      }\n\n      // Similar as AgentJS code.\n      Object.assign(encoded, {\n        __signature__: undefined\n      });\n\n      return encoded as Signature;\n    };\n\n    return await execute({\n      fn: encodeSignature,\n      step: WebAuthnSignProgressStep.Signing,\n      onProgress: this.#onSignProgress\n    });\n  }\n}\n", "// See https://www.iana.org/assignments/cose/cose.xhtml#algorithms for a complete\n// list of these algorithms. We only list the ones we support here.\n//\n// According Google tutorial, https://web.dev/articles/passkey-registration, specifying\n// support for ECDSA with P-256 (-7) and RSA PKCS#1 (-257) gives complete coverage.\nexport const PUBLIC_KEY_COSE_ALGORITHMS = {\n  ECDSA_WITH_SHA256: -7,\n  RSA_WITH_SHA256: -257\n};\n\nexport const AUTHENTICATOR_ABORT_TIMEOUT = 60000;\n", "import {PUBLIC_KEY_COSE_ALGORITHMS} from './_constants';\nimport {WebAuthnIdentityHostnameError} from './errors';\nimport type {CreatePasskeyOptions, PasskeyOptions} from './types/passkey';\n\nconst randomValue = (): BufferSource => window.crypto.getRandomValues(new Uint8Array(16));\n\n/**\n * When creating a passkey, the challenge can simply be a random value.\n * Since the server doesn\u2019t need to verify the authenticity of the key,\n * it doesn\u2019t have to generate the challenge itself.\n *\n * In contrast, when signing a request with our credentials,\n * the request itself becomes the data (blob), the challenge, that must be signed.\n */\nconst createChallenge = (): BufferSource => randomValue();\n\n/**\n * The user ID is set to a random value, which holds little relevance\n * for the end user beyond being unique.\n *\n * Ultimately, once signed in, the user's actual identifier will be\n * the public key (principal) of the identity used to interact with the IC.\n */\nconst createUserId = (): BufferSource => randomValue();\n\nconst hostname = (): string => {\n  const {\n    location: {href}\n  } = window;\n\n  try {\n    const {hostname} = new URL(href);\n    return hostname;\n  } catch {\n    throw new WebAuthnIdentityHostnameError();\n  }\n};\n\nconst relyingPartyId = ({appId}: Pick<PasskeyOptions, 'appId'>): string => appId?.id ?? hostname();\n\nexport const createPasskeyOptions = ({\n  appId,\n  user: userOptions\n}: CreatePasskeyOptions = {}): PublicKeyCredentialCreationOptions => {\n  const {\n    document: {title: name}\n  } = window;\n\n  const relyingParty = (): Pick<PublicKeyCredentialCreationOptions, 'rp'> => ({\n    rp: {\n      // Note: deprecated in WebAuthn L3\n      name: appId?.name ?? name,\n      id: relyingPartyId({appId})\n    }\n  });\n\n  const user = (): Pick<PublicKeyCredentialCreationOptions, 'user'> => ({\n    user: {\n      id: createUserId(),\n      name: userOptions?.name ?? userOptions?.displayName ?? name,\n      displayName: userOptions?.displayName ?? name\n    }\n  });\n\n  return {\n    // We want to receive the attestation statement as generated by the authenticator\n    attestation: 'direct',\n    challenge: createChallenge(),\n    ...relyingParty(),\n    ...user(),\n    pubKeyCredParams: Object.values(PUBLIC_KEY_COSE_ALGORITHMS).map((algorithm) => ({\n      type: 'public-key',\n      alg: algorithm\n    })),\n    excludeCredentials: [],\n    authenticatorSelection: {\n      // At least for now, we want a simplified flow and therefore indicates that we want a\n      // platform authenticator ((an authenticator embedded to the platform device).\n      authenticatorAttachment: 'platform',\n      userVerification: 'preferred',\n      // Along with requireResidentKey, make passkey discoverable,\n      residentKey: 'required',\n      requireResidentKey: true\n    }\n  };\n};\n\nexport const retrievePasskeyOptions = (\n  options: PasskeyOptions = {}\n): Omit<PublicKeyCredentialRequestOptions, 'challenge'> => ({\n  rpId: relyingPartyId(options),\n  allowCredentials: [],\n  userVerification: 'required'\n});\n", "import type {WebAuthnSignProgress, WebAuthnSignProgressArgs} from './types/progress';\n\nexport const execute = async <T>({\n  fn,\n  step,\n  onProgress\n}: {\n  fn: () => Promise<T>;\n} & Pick<WebAuthnSignProgress, 'step'> &\n  WebAuthnSignProgressArgs): Promise<T> => {\n  onProgress?.({\n    step,\n    state: 'in_progress'\n  });\n\n  try {\n    const result = await fn();\n\n    onProgress?.({\n      step,\n      state: 'success'\n    });\n\n    return result;\n  } catch (err: unknown) {\n    onProgress?.({\n      step,\n      state: 'error'\n    });\n\n    throw err;\n  }\n};\n", "/**\n * Progress steps in the WebAuthn signing flow.\n */\nexport enum WebAuthnSignProgressStep {\n  /** Calling `navigator.credentials.get` to obtain an assertion. */\n  RequestingUserCredential,\n  /** Verifying/initializing the credential (e.g., ID match, loading public key). */\n  FinalizingCredential,\n  /** Producing the signature and encoding the result. */\n  Signing\n}\n\n/**\n * Status of the current step.\n */\nexport type WebAuthnSignProgressState = 'in_progress' | 'success' | 'error';\n\n/**\n * Payload emitted on progress updates.\n */\nexport interface WebAuthnSignProgress {\n  /** The step being executed. */\n  step: WebAuthnSignProgressStep;\n  /** State of that step. */\n  state: WebAuthnSignProgressState;\n}\n\n/**\n * Callback invoked on each progress update.\n */\nexport type WebAuthnSignProgressFn = (progress: WebAuthnSignProgress) => void;\n\n/**\n * Optional handler for progress updates.\n */\nexport interface WebAuthnSignProgressArgs {\n  onProgress?: WebAuthnSignProgressFn;\n}\n", "import {nonNullish} from '@dfinity/utils';\n\n/**\n * Checks if a user-verifying platform authenticator (passkeys) is available on this device / browser.\n *\n * Returns `true` when:\n * 1) `window.PublicKeyCredential` exists, and\n * 2) the browser reports a user-verifying **platform** authenticator is available\n *    (e.g., Touch ID, Windows Hello, Android biometrics/PIN).\n *\n * @returns {Promise<boolean>} `true` if an authenticator is available, otherwise `false`.\n */\nexport const isWebAuthnAvailable = async (): Promise<boolean> => {\n  if (\n    nonNullish(window.PublicKeyCredential) &&\n    'isUserVerifyingPlatformAuthenticatorAvailable' in PublicKeyCredential\n  ) {\n    return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();\n  }\n\n  return false;\n};\n", "import {isNullish} from '@dfinity/utils';\nimport type {EnvironmentWorker} from '../../core/types/env';\nimport type {Unsubscribe} from '../../core/types/subscription';\nimport {AuthStore} from '../stores/auth.store';\nimport type {PostMessage, PostMessageDataResponseAuth} from '../types/post-message';\nimport type {User} from '../types/user';\nimport {emit} from '../utils/events.utils';\nimport {signOut} from './sign-out.services';\n\nexport const initAuthTimeoutWorker = (auth: EnvironmentWorker): Unsubscribe => {\n  const workerUrl = auth === true ? './workers/auth.worker.js' : auth;\n  const worker = new Worker(workerUrl);\n\n  const timeoutSignOut = async () => {\n    emit({message: 'junoSignOutAuthTimer'});\n    await signOut();\n  };\n\n  worker.onmessage = async ({data}: MessageEvent<PostMessage<PostMessageDataResponseAuth>>) => {\n    const {msg, data: value} = data;\n\n    switch (msg) {\n      case 'junoSignOutAuthTimer':\n        await timeoutSignOut();\n        return;\n      case 'junoDelegationRemainingTime':\n        emit({message: 'junoDelegationRemainingTime', detail: value?.authRemainingTime});\n        return;\n    }\n  };\n\n  return AuthStore.getInstance().subscribe((user: User | null) => {\n    if (isNullish(user)) {\n      worker.postMessage({msg: 'junoStopAuthTimer'});\n      return;\n    }\n\n    worker.postMessage({msg: 'junoStartAuthTimer'});\n  });\n};\n", "export abstract class Store<T> {\n  private callbacks: {id: symbol; callback: (data: T | null) => void}[] = [];\n\n  protected populate(data: T | null) {\n    this.callbacks.forEach(({callback}: {id: symbol; callback: (data: T | null) => void}) =>\n      callback(data)\n    );\n  }\n\n  subscribe(callback: (data: T | null) => void): () => void {\n    const callbackId = Symbol();\n    this.callbacks.push({id: callbackId, callback});\n\n    return () =>\n      (this.callbacks = this.callbacks.filter(\n        ({id}: {id: symbol; callback: (data: T | null) => void}) => id !== callbackId\n      ));\n  }\n}\n", "import {Store} from '../../core/stores/_store';\nimport type {Unsubscribe} from '../../core/types/subscription';\n\nimport type {User} from '../types/user';\n\nexport class AuthStore extends Store<User | null> {\n  private static instance: AuthStore;\n\n  private authUser: User | null = null;\n\n  private constructor() {\n    super();\n  }\n\n  static getInstance() {\n    if (!AuthStore.instance) {\n      AuthStore.instance = new AuthStore();\n    }\n    return AuthStore.instance;\n  }\n\n  set(authUser: User | null) {\n    this.authUser = authUser;\n\n    this.populate(authUser);\n  }\n\n  get(): User | null {\n    return this.authUser;\n  }\n\n  override subscribe(callback: (data: User | null) => void): Unsubscribe {\n    const unsubscribe: () => void = super.subscribe(callback);\n\n    callback(this.authUser);\n\n    return unsubscribe;\n  }\n\n  reset() {\n    this.authUser = null;\n\n    this.populate(this.authUser);\n  }\n}\n", "export const emit = <T>({message, detail}: {message: string; detail?: T | undefined}) => {\n  const $event: CustomEvent<T> = new CustomEvent<T>(message, {detail, bubbles: true});\n  document.dispatchEvent($event);\n};\n", "import {isNullish} from '@dfinity/utils';\nimport {Actor, type ActorMethod, type ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport type {ActorKey} from '../types/actor';\nimport type {SatelliteContext} from '../types/satellite';\nimport {AgentStore} from './agent.store';\n\ntype ActorParams = {\n  idlFactory: IDL.InterfaceFactory;\n} & Required<Pick<SatelliteContext, 'satelliteId' | 'identity'>> &\n  Pick<SatelliteContext, 'container'>;\n\ntype ActorRecord = Record<string, ActorMethod>;\n\nexport class ActorStore {\n  private static instance: ActorStore;\n\n  #actors: Record<string, ActorSubclass<ActorRecord>> | undefined | null = undefined;\n\n  private constructor() {}\n\n  static getInstance() {\n    if (isNullish(ActorStore.instance)) {\n      ActorStore.instance = new ActorStore();\n    }\n    return ActorStore.instance;\n  }\n\n  async getActor<T = ActorRecord>({\n    satelliteId,\n    identity,\n    actorKey,\n    ...rest\n  }: ActorParams & {actorKey: ActorKey}): Promise<ActorSubclass<T>> {\n    const key = `${actorKey}#${identity.getPrincipal().toText()}#${satelliteId};`;\n\n    if (isNullish(this.#actors) || isNullish(this.#actors[key])) {\n      const actor = await this.createActor({satelliteId, identity, ...rest});\n\n      this.#actors = {\n        ...(this.#actors ?? {}),\n        [key]: actor\n      };\n\n      return actor as ActorSubclass<T>;\n    }\n\n    return this.#actors[key] as ActorSubclass<T>;\n  }\n\n  reset() {\n    this.#actors = null;\n  }\n\n  private async createActor<T = ActorRecord>({\n    idlFactory,\n    satelliteId: canisterId,\n    ...rest\n  }: ActorParams): Promise<ActorSubclass<T>> {\n    const agent = await AgentStore.getInstance().getAgent(rest);\n\n    return Actor.createActor(idlFactory, {\n      agent,\n      canisterId\n    });\n  }\n}\n", "import {isNullish} from '@dfinity/utils';\nimport type {Agent, HttpAgent} from '@icp-sdk/core/agent';\nimport {type CreateAgentParams, createAgent} from './_agent.factory';\n\nexport class AgentStore {\n  private static instance: AgentStore;\n\n  #agents: Record<string, HttpAgent> | undefined | null = undefined;\n\n  private constructor() {}\n\n  static getInstance() {\n    if (isNullish(AgentStore.instance)) {\n      AgentStore.instance = new AgentStore();\n    }\n    return AgentStore.instance;\n  }\n\n  async getAgent({identity, ...rest}: CreateAgentParams): Promise<Agent> {\n    const key = identity.getPrincipal().toText();\n\n    if (isNullish(this.#agents) || isNullish(this.#agents[key])) {\n      const agent = await createAgent({identity, ...rest});\n\n      this.#agents = {\n        ...(this.#agents ?? {}),\n        [key]: agent\n      };\n\n      return agent;\n    }\n\n    return this.#agents[key];\n  }\n\n  reset() {\n    this.#agents = null;\n  }\n}\n", "import {nonNullish} from '@dfinity/utils';\nimport {HttpAgent} from '@icp-sdk/core/agent';\nimport {DOCKER_CONTAINER_URL} from '../constants/container.constants';\nimport type {SatelliteContext} from '../types/satellite';\n\nexport type CreateAgentParams = Required<Pick<SatelliteContext, 'identity'>> &\n  Pick<SatelliteContext, 'container'>;\n\nexport const createAgent = async ({identity, container}: CreateAgentParams): Promise<HttpAgent> => {\n  const localActor = nonNullish(container) && container !== false;\n\n  const host = localActor\n    ? container === true\n      ? DOCKER_CONTAINER_URL\n      : container\n    : 'https://icp-api.io';\n\n  const shouldFetchRootKey = nonNullish(container);\n\n  return await HttpAgent.create({\n    identity,\n    shouldFetchRootKey,\n    host\n  });\n};\n", "export const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987';\nexport const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai';\n", "import {isNullish} from '@dfinity/utils';\nimport {\n  AuthClient,\n  IdbStorage,\n  KEY_STORAGE_DELEGATION,\n  KEY_STORAGE_KEY\n} from '@icp-sdk/auth/client';\nimport type {DelegationChain, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\n\nexport class AuthClientStore {\n  static #instance: AuthClientStore | undefined;\n\n  #authClient: AuthClient | undefined | null;\n\n  private constructor() {}\n\n  static getInstance(): AuthClientStore {\n    if (isNullish(this.#instance)) {\n      this.#instance = new AuthClientStore();\n    }\n\n    return this.#instance;\n  }\n\n  createAuthClient = async (): Promise<AuthClient> => {\n    this.#authClient = await AuthClient.create({\n      idleOptions: {\n        disableIdle: true,\n        disableDefaultIdleCallback: true\n      }\n    });\n\n    return this.#authClient;\n  };\n\n  safeCreateAuthClient = async (): Promise<AuthClient> => {\n    // Since AgentJS persists the identity key in IndexedDB by default,\n    // it can be tampered with and affect the next login with Internet Identity or NFID.\n    // To ensure each session starts clean and safe, we clear the stored keys before creating a new AuthClient\n    // in case the user is not authenticated.\n    const storage = new IdbStorage();\n    await storage.remove(KEY_STORAGE_KEY);\n\n    return await this.createAuthClient();\n  };\n\n  getAuthClient = (): AuthClient | undefined | null => this.#authClient;\n\n  logout = async (): Promise<void> => {\n    await this.#authClient?.logout();\n\n    // Reset local object otherwise next sign in (sign in - sign out - sign in) might not work out - i.e. agent-js might not recreate the delegation or identity if not resetted\n    // Technically we do not need this since we recreate the agent below. We just keep it to make the reset explicit.\n    this.#authClient = null;\n  };\n\n  setAuthClientStorage = async ({\n    delegationChain,\n    sessionKey\n  }: {\n    delegationChain: DelegationChain;\n    sessionKey: ECDSAKeyIdentity;\n  }) => {\n    const storage = new IdbStorage();\n\n    await Promise.all([\n      storage.set(KEY_STORAGE_KEY, sessionKey.getKeyPair()),\n      storage.set(KEY_STORAGE_DELEGATION, JSON.stringify(delegationChain.toJSON()))\n    ]);\n  };\n}\n", "import {ActorStore} from '../../core/stores/actor.store';\nimport {AgentStore} from '../../core/stores/agent.store';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\nimport type {SignOutOptions} from '../types/auth';\n\n/**\n * Signs out the current user.\n * @returns {Promise<void>} A promise that resolves when the sign-out process is complete.\n */\nexport const signOut = async (options?: SignOutOptions): Promise<void> => {\n  await resetAuth();\n\n  // Recreate an HttpClient immediately because next sign-in, if window is not reloaded, would fail if the agent is created within the process.\n  // For example, Safari blocks the Internet Identity (II) window if the agent is created during the interaction.\n  // Agent-js must be created either globally or at least before performing a sign-in.\n  // We proceed with this reset regardless of the window reloading. This way we ensure it is reset not matter what.\n  await AuthClientStore.getInstance().createAuthClient();\n\n  if (options?.windowReload === false) {\n    return;\n  }\n\n  window.location.reload();\n};\n\n/**\n * \u2139\uFE0F Exposed for testing purpose only. Should not be leaked to consumer or used by the library.\n */\nexport const resetAuth = async () => {\n  await AuthClientStore.getInstance().logout();\n\n  AuthStore.getInstance().reset();\n\n  ActorStore.getInstance().reset();\n  AgentStore.getInstance().reset();\n};\n", "import {AuthClientStore} from '../stores/auth-client.store';\n\n/**\n * Initializes a new `AuthClient`, checks authentication state,\n * and executes the provided function if already authenticated.\n *\n * - Always creates a fresh `AuthClient` using {@link createAuthClient}.\n * - If the client is **not authenticated**, it resets the client via {@link safeCreateAuthClient}\n *   to ensure a clean session.\n * - If authenticated, it runs the given async function `fn`.\n *\n * @param {Object} params\n * @param {() => Promise<void>} params.fn - The asynchronous function to execute when authenticated.\n *\n * @returns {Promise<void>} Resolves when authentication is handled and the provided function is executed (if applicable).\n */\nexport const authenticateWithAuthClient = async ({fn}: {fn: () => Promise<void>}) => {\n  const {createAuthClient, safeCreateAuthClient} = AuthClientStore.getInstance();\n\n  const authClient = await createAuthClient();\n\n  const isAuthenticated = await authClient.isAuthenticated();\n\n  if (!isAuthenticated) {\n    await safeCreateAuthClient();\n    return;\n  }\n\n  await fn();\n};\n", "import {isNullish, nonNullish} from '@dfinity/utils';\nimport {isSatelliteError, JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE} from '@junobuild/errors';\nimport {getDoc, setDoc} from '../../datastore/services/doc.services';\nimport {InitError} from '../types/errors';\nimport type {ProviderWithoutData} from '../types/provider';\nimport type {User, UserData, UserDataWithoutProviderData} from '../types/user';\n\nimport {getIdentity} from './identity.services';\n\ntype UserId = string;\n\nexport const initUser = async ({provider}: {provider: ProviderWithoutData}): Promise<User> => {\n  const {user, userId} = await loadUser();\n\n  // For returning users we do not need to create a user entry.\n  // Sign-in, sign-out, and sign-in again.\n  if (nonNullish(user)) {\n    return user;\n  }\n\n  try {\n    return await createUser({userId, provider});\n  } catch (error: unknown) {\n    // It's unlikely, but since updating a user is restricted to the controller,\n    // we want to guard against a rare race condition where a user attempts\n    // to create a user entry that already exists. In such a case, instead of\n    // throwing, we retry loading the user data. If that succeeds, it provides\n    // a more graceful UX.\n    //\n    // With the new flow introduced in core library v2, this scenario should\n    // never occur, but the handling remains given it was already implemented\n    // with the earlier flow where user creation could happen during init.\n    if (isSatelliteError({error, type: JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE})) {\n      const userOnCreateError = await getUser({userId});\n\n      if (nonNullish(userOnCreateError)) {\n        return userOnCreateError;\n      }\n    }\n\n    throw error;\n  }\n};\n\nexport const loadUser = async (): Promise<{userId: UserId; user: User | undefined}> => {\n  const identity = getIdentity();\n\n  if (isNullish(identity)) {\n    throw new InitError('No identity to initialize the user. Have you initialized Juno?');\n  }\n\n  const userId = identity.getPrincipal().toText();\n\n  const user = await getUser({userId});\n\n  return {\n    userId,\n    user\n  };\n};\n\nconst getUser = ({userId}: {userId: UserId}): Promise<User | undefined> =>\n  getDoc<UserData>({\n    collection: `#user`,\n    key: userId\n  });\n\nconst createUser = ({\n  userId,\n  ...rest\n}: {\n  userId: string;\n} & UserDataWithoutProviderData): Promise<User> =>\n  setDoc<UserData>({\n    collection: `#user`,\n    doc: {\n      key: userId,\n      data: rest\n    }\n  });\n", "export const isSatelliteError = ({error, type}: {error: unknown; type: string}): boolean => {\n  if (typeof error === 'string') {\n    return error.includes(type);\n  }\n\n  if (error instanceof Error) {\n    return error.message.includes(type);\n  }\n\n  return false;\n};\n", "export const JUNO_CDN_PROPOSALS_ERROR_CANNOT_SUBMIT = 'juno.cdn.proposals.error.cannot_submit';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_SUBMIT_INVALID_STATUS =\n  'juno.cdn.proposals.error.cannot_submit_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_REJECT = 'juno.cdn.proposals.error.cannot_reject';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_REJECT_INVALID_STATUS =\n  'juno.cdn.proposals.error.cannot_reject_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_COMMIT = 'juno.cdn.proposals.error.cannot_commit';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_COMMIT_INVALID_STATUS =\n  'juno.cdn.proposals.error.cannot_commit_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_INVALID_HASH = 'juno.cdn.proposals.error.invalid_hash';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_UNKNOWN_TYPE = 'juno.cdn.proposals.error.unknown_type';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_EMPTY_CONTENT_CHUNKS =\n  'juno.cdn.proposals.error.empty_content_chunks';\nexport const JUNO_CDN_PROPOSALS_ERROR_NOT_CONTENT_CHUNKS_AT_INDEX =\n  'juno.cdn.proposals.error.no_content_chunks_at_index';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_EMPTY_ASSETS = 'juno.cdn.proposals.error.empty_assets';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_DELETE_ASSETS =\n  'juno.cdn.proposals.error.cannot_delete_assets';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_DELETE_ASSETS_INVALID_STATUS =\n  'juno.cdn.proposals.error.cannot_delete_assets_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_NEXT_ID_CONVERT = 'juno.cdn.proposals.error.next_id_convert';\nexport const JUNO_CDN_PROPOSALS_ERROR_NEXT_ID_OVERFLOW =\n  'juno.cdn.proposals.error.next_id_overflow';\n\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_INSERT_ASSET_UNKNOWN_REFERENCE_ID =\n  'juno.cdn.storage.error.cannot_insert_asset_unknown_reference_id';\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_GET_ASSET_UNKNOWN_REFERENCE_ID =\n  'juno.cdn.storage.error.cannot_get_asset_unknown_reference_id';\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_INSERT_ASSET_ENCODING_UNKNOWN_REFERENCE_ID =\n  'juno.cdn.storage.error.cannot_insert_asset_encoding_unknown_reference_id';\n\nexport const JUNO_CDN_STORAGE_ERROR_NO_PROPOSAL_FOUND = 'juno.cdn.storage.error.no_proposal_found';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_RELEASES_PATH =\n  'juno.cdn.storage.error.invalid_releases_path';\n\nexport const JUNO_CDN_STORAGE_ERROR_MISSING_RELEASES_DESCRIPTION =\n  'juno.cdn.storage.error.missing_releases_description';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_RELEASES_DESCRIPTION =\n  'juno.cdn.storage.error.invalid_releases_description';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_COLLECTION =\n  'juno.cdn.storage.error.invalid_collection';\n", "export const JUNO_COLLECTIONS_ERROR_MODIFY_RESERVED_COLLECTION =\n  'juno.collections.error.modify_reserved_collection';\nexport const JUNO_COLLECTIONS_ERROR_RESERVED_NAME = 'juno.collections.error.reserved_name';\nexport const JUNO_COLLECTIONS_ERROR_RESERVED_COLLECTION =\n  'juno.collections.error.reserved_collection';\nexport const JUNO_COLLECTIONS_ERROR_RATE_CONFIG_ENABLED =\n  'juno.collections.error.rate_config_enabled';\nexport const JUNO_COLLECTIONS_ERROR_DELETE_PREFIX_RESERVED =\n  'juno.collections.error.prefix_deletion';\nexport const JUNO_COLLECTIONS_ERROR_COLLECTION_NOT_EMPTY = 'juno.collections.error.not_empty';\nexport const JUNO_COLLECTIONS_ERROR_COLLECTION_NOT_FOUND = 'juno.collections.error.not_found';\nexport const JUNO_COLLECTIONS_ERROR_PREFIX_RESERVED = 'juno.collections.error.prefix_reserved';\n", "export const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = 'juno.error.no_timestamp_provided';\nexport const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = 'juno.error.timestamp_outdated_or_future';\nexport const JUNO_ERROR_NO_VERSION_PROVIDED = 'juno.error.no_version_provided';\nexport const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = 'juno.error.version_outdated_or_future';\n\nexport const JUNO_DATASTORE_ERROR_CANNOT_WRITE = 'juno.datastore.error.cannot_write';\nexport const JUNO_DATASTORE_ERROR_CANNOT_READ = 'juno.datastore.error.cannot_read';\n\nexport const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = 'juno.storage.error.upload_not_allowed';\nexport const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = 'juno.storage.error.set_not_allowed';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_INVALID_COLLECTION =\n  'juno.storage.error.cannot_commit_invalid_collection';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = 'juno.storage.error.cannot_commit_batch';\nexport const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = 'juno.storage.error.asset_not_found';\nexport const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = 'juno.storage.error.cannot_read_asset';\nexport const JUNO_STORAGE_ERROR_UPLOAD_PATH_COLLECTION_PREFIX =\n  'juno.storage.error.upload_path_collection_prefix';\nexport const JUNO_STORAGE_ERROR_RESERVED_ASSET = 'juno.storage.error.reserved_asset';\nexport const JUNO_STORAGE_ERROR_BATCH_NOT_FOUND = 'juno.storage.error.batch_not_found';\nexport const JUNO_STORAGE_ERROR_CHUNK_NOT_FOUND = 'juno.storage.error.chunk_not_found';\nexport const JUNO_STORAGE_ERROR_CHUNK_NOT_INCLUDED_IN_BATCH =\n  'juno.storage.error.chunk_not_included_in_batch';\nexport const JUNO_STORAGE_ERROR_CHUNK_TO_COMMIT_NOT_FOUND =\n  'juno.storage.error.chunk_to_commit_not_found';\nexport const JUNO_STORAGE_ERROR_ASSET_MAX_ALLOWED_SIZE =\n  'juno.storage.error.asset_max_allowed_size';\n\nexport const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = 'juno.auth.error.not_admin_controller';\nexport const JUNO_AUTH_ERROR_INVALID_ORIGIN = 'juno.auth.error.invalid_origin';\nexport const JUNO_AUTH_ERROR_NOT_WRITE_CONTROLLER = 'juno.auth.error.not_write_controller';\nexport const JUNO_AUTH_ERROR_NOT_CONTROLLER = 'juno.auth.error.not_controller';\nexport const JUNO_AUTH_ERROR_CALLER_NOT_ALLOWED = 'juno.auth.error.caller.not_allowed';\nexport const JUNO_AUTH_ERROR_NOT_CONFIGURED = 'juno.auth.error.not_configured';\nexport const JUNO_AUTH_ERROR_OPENID_DISABLED = 'juno.auth.error.openid_disabled';\n\nexport const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = 'juno.datastore.error.user.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = 'juno.datastore.error.user.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = 'juno.datastore.error.user.caller_key';\nexport const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL =\n  'juno.datastore.error.user.key_no_principal';\nexport const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = 'juno.datastore.error.user.not_allowed';\nexport const JUNO_DATASTORE_ERROR_USER_AAGUID_INVALID_LENGTH =\n  'juno.datastore.error.user.webauthn.aaguid_invalid_length';\nexport const JUNO_DATASTORE_ERROR_USER_PROVIDER_INVALID_DATA =\n  'juno.datastore.error.user.webauthn.provider_invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_PROVIDER_WEBAUTHN_INVALID_DATA =\n  'juno.datastore.error.user.webauthn.provider_webauthn_invalid_data';\n\nexport const JUNO_DATASTORE_ERROR_USER_REGISTER_PROVIDER_INVALID_DATA =\n  'juno.datastore.error.user.register.provider_invalid_data';\n\nexport const JUNO_AUTH_ERROR_PROFILE_EMAIL_INVALID_LENGTH =\n  'juno.auth.error.profile.data.email_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_NAME_INVALID_LENGTH =\n  'juno.auth.error.profile.data.name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_GIVEN_NAME_INVALID_LENGTH =\n  'juno.auth.error.profile.data.given_name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_FAMILY_NAME_INVALID_LENGTH =\n  'juno.auth.error.profile.data.family_name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_LOCALE_INVALID_LENGTH =\n  'juno.auth.error.profile.data.locale_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_PICTURE_INVALID_URL =\n  'juno.auth.error.profile.data.picture_invalid_url';\nexport const JUNO_AUTH_ERROR_PROFILE_PICTURE_INVALID_SCHEME =\n  'juno.auth.error.profile.data.picture_invalid_scheme';\n\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED =\n  'juno.datastore.error.user.usage.change_limit_reached';\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA =\n  'juno.datastore.error.user.usage.invalid_data';\n\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_CANNOT_UPDATE =\n  'juno.datastore.error.user.webauthn.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_INVALID_DATA =\n  'juno.datastore.error.user.webauthn.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_CALLER_KEY =\n  'juno.datastore.error.user.webauthn.caller_key';\n", "export const JUNO_ERROR_CONTROLLERS_MAX_NUMBER = 'juno.error.controllers.max_number';\nexport const JUNO_ERROR_CONTROLLERS_ANONYMOUS_NOT_ALLOWED =\n  'juno.error.controllers.anonymous_not_allowed';\nexport const JUNO_ERROR_CONTROLLERS_REVOKED_NOT_ALLOWED =\n  'juno.error.controllers.revoked_not_allowed';\n\nexport const JUNO_ERROR_MEMORY_STABLE_EXCEEDED = 'juno.error.memory.stable_exceeded';\nexport const JUNO_ERROR_MEMORY_HEAP_EXCEEDED = 'juno.error.memory.heap_exceeded';\n\nexport const JUNO_ERROR_CYCLES_DEPOSIT_BALANCE_LOW = 'juno.error.cycles.deposit_balance_low';\nexport const JUNO_ERROR_CYCLES_DEPOSIT_FAILED = 'juno.error.cycles.deposit_failed';\n\nexport const JUNO_ERROR_CANISTER_CREATE_FAILED = 'juno.error.canister.create_failed';\nexport const JUNO_ERROR_CANISTER_INSTALL_CODE_FAILED = 'juno.error.canister.install_code_failed';\n\nexport const JUNO_ERROR_SEGMENT_STOP_FAILED = 'juno.error.segment.stop_failed';\nexport const JUNO_ERROR_SEGMENT_DELETE_FAILED = 'juno.error.segment.delete_failed';\n\nexport const JUNO_ERROR_CMC_CALL_LEDGER_FAILED = 'juno.error.cmc.call_ledger_failed';\nexport const JUNO_ERROR_CMC_LEDGER_TRANSFER_FAILED = 'juno.error.cmc.ledger_transfer_failed';\nexport const JUNO_ERROR_CMC_TOP_UP_FAILED = 'juno.error.cmc.top_up_failed';\nexport const JUNO_ERROR_CMC_CALL_CREATE_CANISTER_FAILED =\n  'juno.error.cmc.call_create_canister_failed';\nexport const JUNO_ERROR_CMC_CREATE_CANISTER_FAILED = 'juno.error.cmc.create_canister_failed';\nexport const JUNO_ERROR_CMC_INSTALL_CODE_FAILED = 'juno.error.cmc.install_code_failed';\n\nexport const JUNO_ERROR_INVALID_REGEX = 'juno.error.invalid_regex';\n", "import type {ReadOptions} from '../types/call-options';\n\n/**\n * Default options for read operations.\n *\n * For backwards compatibility and because most developers probably prioritize speed over\n * additional security when fetching read-only data from the Internet Computer,\n * read operations are performed in an uncertified way by default.\n */\nexport const DEFAULT_READ_OPTIONS: ReadOptions = {certified: false};\n", "import {nonNullish} from '@dfinity/utils';\nimport {AnonymousIdentity, type Identity} from '@icp-sdk/core/agent';\n\nimport {getIdentity as getAuthIdentity} from '../../auth/services/identity.services';\n\nexport const getAnyIdentity = (identity?: Identity): Identity => {\n  if (nonNullish(identity)) {\n    return identity;\n  }\n\n  return getAuthIdentity() ?? new AnonymousIdentity();\n};\n", "import {isNullish} from '@dfinity/utils';\nimport type {Identity} from '@icp-sdk/core/agent';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\n\nexport const getIdentity = (): Identity | undefined =>\n  AuthClientStore.getInstance().getAuthClient()?.getIdentity();\n\n/**\n * Returns the identity of a signed-in user or an anonymous identity.\n * This function is useful for loading an identity in web workers.\n * Used to imperatively get the identity. Please be certain before using it.\n * @returns {Promise<Identity>} A promise that resolves to the identity of the user or an anonymous identity.\n */\nexport const unsafeIdentity = async (): Promise<Identity> => {\n  const {getAuthClient, createAuthClient} = AuthClientStore.getInstance();\n\n  return (getAuthClient() ?? (await createAuthClient())).getIdentity();\n};\n\n/**\n * Returns the current identity if the user is authenticated.\n *\n * \u26A0\uFE0F Use this function imperatively only. Do **not** persist the identity in global state.\n * It is intended for short-lived or one-time operations.\n *\n * Typical use case is to enable developers to implement custom features for the Internet Computer:\n * - Passing the identity to temporarily create an actor or agent to call a canister\n * - Signing a message or making a one-time authenticated call\n *\n * @returns The authenticated identity, or null if unavailable.\n */\nexport const getIdentityOnce = async (): Promise<Identity | null> => {\n  const user = AuthStore.getInstance().get();\n\n  if (isNullish(user)) {\n    return null;\n  }\n\n  const authClient = AuthClientStore.getInstance().getAuthClient();\n\n  const authenticated = (await authClient?.isAuthenticated()) ?? false;\n\n  if (!authenticated) {\n    return null;\n  }\n\n  return authClient?.getIdentity() ?? null;\n};\n", "import {fromNullable, isNullish, nonNullish} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {getSatelliteActor} from '../../core/api/actor.api';\nimport type {ActorReadParams, ActorUpdateParams} from '../../core/types/actor';\nimport type {ListParams, ListResults} from '../../core/types/list';\nimport type {ExcludeDate} from '../../core/types/utility';\nimport {toListParams} from '../../core/utils/list.utils';\nimport type {Doc} from '../types/doc';\nimport {mapData} from '../utils/data.utils';\nimport {fromDoc, toDelDoc, toSetDoc} from '../utils/doc.utils';\n\nexport const getDoc = async <D>({\n  collection,\n  key,\n  ...rest\n}: {\n  collection: string;\n} & ActorReadParams &\n  Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n  const {get_doc} = await getSatelliteActor(rest);\n\n  const doc = fromNullable(await get_doc(collection, key));\n\n  if (isNullish(doc)) {\n    return undefined;\n  }\n\n  return fromDoc({doc, key});\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const getManyDocs = async ({\n  docs,\n  ...rest\n}: {\n  docs: ({collection: string} & Pick<Doc<any>, 'key'>)[];\n} & ActorReadParams): Promise<(Doc<any> | undefined)[]> => {\n  const {get_many_docs} = await getSatelliteActor(rest);\n\n  const payload: [string, string][] = docs.map(({collection, key}) => [collection, key]);\n\n  const resultsDocs = await get_many_docs(payload);\n\n  const results: (Doc<any> | undefined)[] = [];\n  for (const [key, resultDoc] of resultsDocs) {\n    const doc = fromNullable(resultDoc);\n    results.push(nonNullish(doc) ? await fromDoc({key, doc}) : undefined);\n  }\n\n  return results;\n};\n/* eslint-enable */\n\nexport const setDoc = async <D>({\n  collection,\n  doc,\n  ...rest\n}: {\n  collection: string;\n  doc: Doc<D>;\n} & ActorUpdateParams): Promise<Doc<D>> => {\n  const {set_doc} = await getSatelliteActor(rest);\n\n  const {key} = doc;\n\n  const setDoc = await toSetDoc(doc);\n\n  const updatedDoc = await set_doc(collection, key, setDoc);\n\n  return await fromDoc({key, doc: updatedDoc});\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const setManyDocs = async ({\n  docs,\n  ...rest\n}: {\n  docs: {collection: string; doc: Doc<any>}[];\n} & ActorUpdateParams): Promise<Doc<any>[]> => {\n  const {set_many_docs} = await getSatelliteActor(rest);\n\n  const payload: [string, string, SatelliteDid.SetDoc][] = [];\n  for (const {collection, doc} of docs) {\n    const {key} = doc;\n    payload.push([collection, key, await toSetDoc(doc)]);\n  }\n\n  const updatedDocs = await set_many_docs(payload);\n\n  const results: Doc<any>[] = [];\n  for (const [key, updatedDoc] of updatedDocs) {\n    results.push(await fromDoc({key, doc: updatedDoc}));\n  }\n\n  return results;\n};\n/* eslint-enable */\n\nexport const deleteDoc = async <D>({\n  collection,\n  doc,\n  ...rest\n}: {\n  collection: string;\n  doc: Doc<D>;\n} & ActorUpdateParams): Promise<void> => {\n  const {del_doc} = await getSatelliteActor(rest);\n\n  const {key} = doc;\n\n  return del_doc(collection, key, toDelDoc(doc));\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const deleteManyDocs = async ({\n  docs,\n  ...rest\n}: {\n  docs: {collection: string; doc: Doc<any>}[];\n} & ActorUpdateParams): Promise<void> => {\n  const {del_many_docs} = await getSatelliteActor(rest);\n\n  const payload: [string, string, SatelliteDid.DelDoc][] = docs.map(({collection, doc}) => [\n    collection,\n    doc.key,\n    toDelDoc(doc)\n  ]);\n\n  await del_many_docs(payload);\n};\n/* eslint-enable */\n\nexport const deleteFilteredDocs = async ({\n  collection,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter: ListParams;\n} & ActorUpdateParams): Promise<void> => {\n  const {del_filtered_docs} = await getSatelliteActor(rest);\n\n  return del_filtered_docs(collection, toListParams(filter));\n};\n\nexport const listDocs = async <D>({\n  collection,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter: ListParams;\n} & ActorReadParams): Promise<ListResults<Doc<D>>> => {\n  const {list_docs} = await getSatelliteActor(rest);\n\n  const {items, items_page, items_length, matches_length, matches_pages} = await list_docs(\n    collection,\n    toListParams(filter)\n  );\n\n  const docs: Doc<D>[] = [];\n\n  for (const [key, item] of items) {\n    const {data: dataArray, owner, description, version, ...rest} = item;\n\n    docs.push({\n      key,\n      description: fromNullable(description),\n      owner: owner.toText(),\n      data: await mapData<ExcludeDate<D>>({data: dataArray}),\n      version: fromNullable(version),\n      ...rest\n    });\n  }\n\n  return {\n    items: docs,\n    items_length,\n    items_page: fromNullable(items_page),\n    matches_length,\n    matches_pages: fromNullable(matches_pages)\n  };\n};\n\nexport const countDocs = async ({\n  collection,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter: ListParams;\n} & ActorReadParams): Promise<bigint> => {\n  const {count_docs} = await getSatelliteActor(rest);\n\n  return count_docs(collection, toListParams(filter));\n};\n", "import {assertNonNullish} from '@dfinity/utils';\nimport type {ActorMethod, ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {\n  idlCertifiedFactorySatellite,\n  idlFactorySatellite,\n  type SatelliteActor\n} from '@junobuild/ic-client/actor';\nimport {ActorStore} from '../stores/actor.store';\nimport type {ActorKey} from '../types/actor';\nimport type {CallOptions} from '../types/call-options';\nimport type {SatelliteContext} from '../types/satellite';\nimport {customOrEnvContainer, customOrEnvSatelliteId} from '../utils/env.utils';\n\nexport const getSatelliteActor = ({\n  satellite,\n  options: {certified}\n}: {\n  satellite: SatelliteContext;\n  options: CallOptions;\n}): Promise<SatelliteActor> =>\n  getActor({\n    idlFactory: certified ? idlCertifiedFactorySatellite : idlFactorySatellite,\n    actorKey: `stock#${certified ? 'update' : 'query'}`,\n    ...satellite\n  });\n\nexport const getSatelliteExtendedActor = <T = Record<string, ActorMethod>>({\n  idlFactory,\n  ...rest\n}: SatelliteContext & {idlFactory: IDL.InterfaceFactory}): Promise<ActorSubclass<T>> =>\n  getActor({\n    idlFactory,\n    actorKey: 'extended#query',\n    ...rest\n  });\n\nconst getActor = async <T = Record<string, ActorMethod>>({\n  satelliteId: customSatelliteId,\n  container: customContainer,\n  ...rest\n}: SatelliteContext & {idlFactory: IDL.InterfaceFactory; actorKey: ActorKey}): Promise<\n  ActorSubclass<T>\n> => {\n  const {satelliteId} = customOrEnvSatelliteId({satelliteId: customSatelliteId});\n\n  assertNonNullish(satelliteId, 'No satellite ID defined. Did you initialize Juno?');\n\n  const {container} = customOrEnvContainer({container: customContainer});\n\n  return await ActorStore.getInstance().getActor({\n    satelliteId,\n    container,\n    ...rest\n  });\n};\n", "import {isNullish} from '@dfinity/utils';\nimport {Actor, type ActorConfig, type ActorMethod, type ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport type {Principal} from '@icp-sdk/core/principal';\nimport type {\n  ActorParameters,\n  ConsoleParameters,\n  MissionControlParameters,\n  OrbiterParameters,\n  SatelliteParameters\n} from '../types/actor';\nimport {\n  idlCertifiedFactoryConsole,\n  idlCertifiedFactoryOrbiter,\n  idlCertifiedFactorySatellite,\n  idlDeprecatedFactoryMissionControlVersion,\n  idlDeprecatedFactoryOrbiterVersion,\n  idlDeprecatedFactorySatellite,\n  idlDeprecatedFactorySatelliteNoScope,\n  idlDeprecatedFactorySatelliteVersion,\n  idlFactoryConsole,\n  idlFactoryMissionControl,\n  idlFactoryOrbiter,\n  idlFactorySatellite,\n  type ConsoleActor,\n  type DeprecatedMissionControlVersionActor,\n  type DeprecatedOrbiterVersionActor,\n  type DeprecatedSatelliteActor,\n  type DeprecatedSatelliteNoScopeActor,\n  type DeprecatedSatelliteVersionActor,\n  type MissionControlActor,\n  type OrbiterActor,\n  type SatelliteActor\n} from './actor.factory';\nimport {useOrInitAgent} from './agent.api';\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedSatelliteActor = ({\n  satelliteId,\n  ...rest\n}: SatelliteParameters): Promise<DeprecatedSatelliteActor> =>\n  getActor({\n    canisterId: satelliteId,\n    ...rest,\n    idlFactory: idlDeprecatedFactorySatellite\n  });\n\nexport const getSatelliteActor = ({\n  satelliteId,\n  certified = false,\n  ...rest\n}: SatelliteParameters & {certified?: boolean}): Promise<SatelliteActor> =>\n  getActor({\n    canisterId: satelliteId,\n    ...rest,\n    idlFactory: certified ? idlCertifiedFactorySatellite : idlFactorySatellite\n  });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedSatelliteNoScopeActor = ({\n  satelliteId,\n  ...rest\n}: SatelliteParameters): Promise<DeprecatedSatelliteNoScopeActor> =>\n  getActor({\n    canisterId: satelliteId,\n    ...rest,\n    idlFactory: idlDeprecatedFactorySatelliteNoScope\n  });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedSatelliteVersionActor = ({\n  satelliteId,\n  ...rest\n}: SatelliteParameters): Promise<DeprecatedSatelliteVersionActor> =>\n  getActor({\n    canisterId: satelliteId,\n    ...rest,\n    idlFactory: idlDeprecatedFactorySatelliteVersion\n  });\n\nexport const getMissionControlActor = ({\n  missionControlId,\n  ...rest\n}: MissionControlParameters): Promise<MissionControlActor> =>\n  getActor({\n    canisterId: missionControlId,\n    ...rest,\n    idlFactory: idlFactoryMissionControl\n  });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedMissionControlVersionActor = ({\n  missionControlId,\n  ...rest\n}: MissionControlParameters): Promise<DeprecatedMissionControlVersionActor> =>\n  getActor({\n    canisterId: missionControlId,\n    ...rest,\n    idlFactory: idlDeprecatedFactoryMissionControlVersion\n  });\n\nexport const getOrbiterActor = ({\n  orbiterId,\n  certified = false,\n  ...rest\n}: OrbiterParameters & {certified?: boolean}): Promise<OrbiterActor> =>\n  getActor({\n    canisterId: orbiterId,\n    ...rest,\n    idlFactory: certified ? idlCertifiedFactoryOrbiter : idlFactoryOrbiter\n  });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedOrbiterVersionActor = ({\n  orbiterId,\n  ...rest\n}: OrbiterParameters): Promise<DeprecatedOrbiterVersionActor> =>\n  getActor({\n    canisterId: orbiterId,\n    ...rest,\n    idlFactory: idlDeprecatedFactoryOrbiterVersion\n  });\n\nexport const getConsoleActor = ({\n  consoleId,\n  certified = false,\n  ...rest\n}: ConsoleParameters & {certified?: boolean}): Promise<ConsoleActor> =>\n  getActor({\n    canisterId: consoleId,\n    ...rest,\n    idlFactory: certified ? idlCertifiedFactoryConsole : idlFactoryConsole\n  });\n\nexport const getActor = <T>({\n  canisterId,\n  idlFactory,\n  ...rest\n}: ActorParameters & {\n  canisterId: Principal | string | undefined;\n  idlFactory: IDL.InterfaceFactory;\n}): Promise<T> => {\n  if (isNullish(canisterId)) {\n    throw new Error('No canister ID provided.');\n  }\n\n  return createActor({\n    canisterId,\n    idlFactory,\n    ...rest\n  });\n};\n\nconst createActor = async <T = Record<string, ActorMethod>>({\n  canisterId,\n  idlFactory,\n  config,\n  ...rest\n}: {\n  idlFactory: IDL.InterfaceFactory;\n  canisterId: Principal | string;\n  config?: Pick<ActorConfig, 'callTransform' | 'queryTransform'>;\n} & ActorParameters): Promise<ActorSubclass<T>> => {\n  const agent = await useOrInitAgent(rest);\n\n  // Creates an actor with using the candid interface and the HttpAgent\n  return Actor.createActor(idlFactory, {\n    agent,\n    canisterId,\n    ...(config ?? {})\n  });\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const InitMissionControlArgs = IDL.Record({user: IDL.Principal});\n  const CyclesThreshold = IDL.Record({\n    fund_cycles: IDL.Nat,\n    min_cycles: IDL.Nat\n  });\n  const CyclesMonitoringStrategy = IDL.Variant({\n    BelowThreshold: CyclesThreshold\n  });\n  const CyclesMonitoring = IDL.Record({\n    strategy: IDL.Opt(CyclesMonitoringStrategy),\n    enabled: IDL.Bool\n  });\n  const Monitoring = IDL.Record({cycles: IDL.Opt(CyclesMonitoring)});\n  const Settings = IDL.Record({monitoring: IDL.Opt(Monitoring)});\n  const Orbiter = IDL.Record({\n    updated_at: IDL.Nat64,\n    orbiter_id: IDL.Principal,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    settings: IDL.Opt(Settings)\n  });\n  const CreateCanisterConfig = IDL.Record({\n    subnet_id: IDL.Opt(IDL.Principal),\n    name: IDL.Opt(IDL.Text)\n  });\n  const Satellite = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    settings: IDL.Opt(Settings)\n  });\n  const InitStorageMemory = IDL.Variant({\n    Heap: IDL.Null,\n    Stable: IDL.Null\n  });\n  const InitStorageArgs = IDL.Record({\n    system_memory: IDL.Opt(InitStorageMemory)\n  });\n  const CreateSatelliteConfig = IDL.Record({\n    subnet_id: IDL.Opt(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs),\n    name: IDL.Opt(IDL.Text)\n  });\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const DepositedCyclesEmailNotification = IDL.Record({\n    to: IDL.Opt(IDL.Text),\n    enabled: IDL.Bool\n  });\n  const CyclesMonitoringConfig = IDL.Record({\n    notification: IDL.Opt(DepositedCyclesEmailNotification),\n    default_strategy: IDL.Opt(CyclesMonitoringStrategy)\n  });\n  const MonitoringConfig = IDL.Record({\n    cycles: IDL.Opt(CyclesMonitoringConfig)\n  });\n  const Config = IDL.Record({monitoring: IDL.Opt(MonitoringConfig)});\n  const GetMonitoringHistory = IDL.Record({\n    to: IDL.Opt(IDL.Nat64),\n    from: IDL.Opt(IDL.Nat64),\n    segment_id: IDL.Principal\n  });\n  const MonitoringHistoryKey = IDL.Record({\n    segment_id: IDL.Principal,\n    created_at: IDL.Nat64,\n    nonce: IDL.Int32\n  });\n  const CyclesBalance = IDL.Record({\n    timestamp: IDL.Nat64,\n    amount: IDL.Nat\n  });\n  const FundingErrorCode = IDL.Variant({\n    BalanceCheckFailed: IDL.Null,\n    ObtainCyclesFailed: IDL.Null,\n    DepositFailed: IDL.Null,\n    InsufficientCycles: IDL.Null,\n    Other: IDL.Text\n  });\n  const FundingFailure = IDL.Record({\n    timestamp: IDL.Nat64,\n    error_code: FundingErrorCode\n  });\n  const MonitoringHistoryCycles = IDL.Record({\n    deposited_cycles: IDL.Opt(CyclesBalance),\n    cycles: CyclesBalance,\n    funding_failure: IDL.Opt(FundingFailure)\n  });\n  const MonitoringHistory = IDL.Record({\n    cycles: IDL.Opt(MonitoringHistoryCycles)\n  });\n  const CyclesMonitoringStatus = IDL.Record({\n    monitored_ids: IDL.Vec(IDL.Principal),\n    running: IDL.Bool\n  });\n  const MonitoringStatus = IDL.Record({\n    cycles: IDL.Opt(CyclesMonitoringStatus)\n  });\n  const MissionControlSettings = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    monitoring: IDL.Opt(Monitoring)\n  });\n  const User = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    user: IDL.Opt(IDL.Principal),\n    created_at: IDL.Nat64,\n    config: IDL.Opt(Config)\n  });\n  const Tokens = IDL.Record({e8s: IDL.Nat64});\n  const Timestamp = IDL.Record({timestamp_nanos: IDL.Nat64});\n  const TransferArgs = IDL.Record({\n    to: IDL.Vec(IDL.Nat8),\n    fee: Tokens,\n    memo: IDL.Nat64,\n    from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    created_at_time: IDL.Opt(Timestamp),\n    amount: Tokens\n  });\n  const TransferError = IDL.Variant({\n    TxTooOld: IDL.Record({allowed_window_nanos: IDL.Nat64}),\n    BadFee: IDL.Record({expected_fee: Tokens}),\n    TxDuplicate: IDL.Record({duplicate_of: IDL.Nat64}),\n    TxCreatedInFuture: IDL.Null,\n    InsufficientFunds: IDL.Record({balance: Tokens})\n  });\n  const Result = IDL.Variant({Ok: IDL.Nat64, Err: TransferError});\n  const Account = IDL.Record({\n    owner: IDL.Principal,\n    subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))\n  });\n  const TransferArg = IDL.Record({\n    to: Account,\n    fee: IDL.Opt(IDL.Nat),\n    memo: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    created_at_time: IDL.Opt(IDL.Nat64),\n    amount: IDL.Nat\n  });\n  const TransferError_1 = IDL.Variant({\n    GenericError: IDL.Record({\n      message: IDL.Text,\n      error_code: IDL.Nat\n    }),\n    TemporarilyUnavailable: IDL.Null,\n    BadBurn: IDL.Record({min_burn_amount: IDL.Nat}),\n    Duplicate: IDL.Record({duplicate_of: IDL.Nat}),\n    BadFee: IDL.Record({expected_fee: IDL.Nat}),\n    CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),\n    TooOld: IDL.Null,\n    InsufficientFunds: IDL.Record({balance: IDL.Nat})\n  });\n  const Result_1 = IDL.Variant({Ok: IDL.Nat, Err: TransferError_1});\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SegmentsMonitoringStrategy = IDL.Record({\n    ids: IDL.Vec(IDL.Principal),\n    strategy: CyclesMonitoringStrategy\n  });\n  const CyclesMonitoringStartConfig = IDL.Record({\n    orbiters_strategy: IDL.Opt(SegmentsMonitoringStrategy),\n    mission_control_strategy: IDL.Opt(CyclesMonitoringStrategy),\n    satellites_strategy: IDL.Opt(SegmentsMonitoringStrategy)\n  });\n  const MonitoringStartConfig = IDL.Record({\n    cycles_config: IDL.Opt(CyclesMonitoringStartConfig)\n  });\n  const CyclesMonitoringStopConfig = IDL.Record({\n    satellite_ids: IDL.Opt(IDL.Vec(IDL.Principal)),\n    try_mission_control: IDL.Opt(IDL.Bool),\n    orbiter_ids: IDL.Opt(IDL.Vec(IDL.Principal))\n  });\n  const MonitoringStopConfig = IDL.Record({\n    cycles_config: IDL.Opt(CyclesMonitoringStopConfig)\n  });\n  return IDL.Service({\n    add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n    add_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n    create_orbiter: IDL.Func([IDL.Opt(IDL.Text)], [Orbiter], []),\n    create_orbiter_with_config: IDL.Func([CreateCanisterConfig], [Orbiter], []),\n    create_satellite: IDL.Func([IDL.Text], [Satellite], []),\n    create_satellite_with_config: IDL.Func([CreateSatelliteConfig], [Satellite], []),\n    del_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n    del_orbiter: IDL.Func([IDL.Principal, IDL.Nat], [], []),\n    del_orbiters_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n    del_satellite: IDL.Func([IDL.Principal, IDL.Nat], [], []),\n    del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_config: IDL.Func([], [IDL.Opt(Config)], ['query']),\n    get_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], ['query']),\n    get_monitoring_history: IDL.Func(\n      [GetMonitoringHistory],\n      [IDL.Vec(IDL.Tuple(MonitoringHistoryKey, MonitoringHistory))],\n      ['query']\n    ),\n    get_monitoring_status: IDL.Func([], [MonitoringStatus], ['query']),\n    get_settings: IDL.Func([], [IDL.Opt(MissionControlSettings)], ['query']),\n    get_user: IDL.Func([], [IDL.Principal], ['query']),\n    get_user_data: IDL.Func([], [User], ['query']),\n    icp_transfer: IDL.Func([TransferArgs], [Result], []),\n    icrc_transfer: IDL.Func([IDL.Principal, TransferArg], [Result_1], []),\n    list_mission_control_controllers: IDL.Func(\n      [],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      ['query']\n    ),\n    list_orbiters: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Orbiter))], ['query']),\n    list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),\n    remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n    remove_satellites_controllers: IDL.Func(\n      [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)],\n      [],\n      []\n    ),\n    set_config: IDL.Func([IDL.Opt(Config)], [], []),\n    set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),\n    set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),\n    set_orbiter: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Orbiter], []),\n    set_orbiter_metadata: IDL.Func(\n      [IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [Orbiter],\n      []\n    ),\n    set_orbiters_controllers: IDL.Func(\n      [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],\n      [],\n      []\n    ),\n    set_satellite: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Satellite], []),\n    set_satellite_metadata: IDL.Func(\n      [IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [Satellite],\n      []\n    ),\n    set_satellites_controllers: IDL.Func(\n      [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],\n      [],\n      []\n    ),\n    start_monitoring: IDL.Func([], [], []),\n    stop_monitoring: IDL.Func([], [], []),\n    top_up: IDL.Func([IDL.Principal, Tokens], [], []),\n    unset_orbiter: IDL.Func([IDL.Principal], [], []),\n    unset_satellite: IDL.Func([IDL.Principal], [], []),\n    update_and_start_monitoring: IDL.Func([MonitoringStartConfig], [], []),\n    update_and_stop_monitoring: IDL.Func([MonitoringStopConfig], [], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  const InitMissionControlArgs = IDL.Record({user: IDL.Principal});\n  return [InitMissionControlArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const InitOrbiterArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelSatelliteConfig = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const GetAnalytics = IDL.Record({\n    to: IDL.Opt(IDL.Nat64),\n    from: IDL.Opt(IDL.Nat64),\n    satellite_id: IDL.Opt(IDL.Principal)\n  });\n  const AnalyticKey = IDL.Record({\n    key: IDL.Text,\n    collected_at: IDL.Nat64\n  });\n  const PageViewClient = IDL.Record({\n    os: IDL.Text,\n    device: IDL.Opt(IDL.Text),\n    browser: IDL.Text\n  });\n  const PageViewCampaign = IDL.Record({\n    utm_content: IDL.Opt(IDL.Text),\n    utm_medium: IDL.Opt(IDL.Text),\n    utm_source: IDL.Text,\n    utm_term: IDL.Opt(IDL.Text),\n    utm_campaign: IDL.Opt(IDL.Text)\n  });\n  const PageViewDevice = IDL.Record({\n    inner_height: IDL.Nat16,\n    screen_height: IDL.Opt(IDL.Nat16),\n    screen_width: IDL.Opt(IDL.Nat16),\n    inner_width: IDL.Nat16\n  });\n  const PageView = IDL.Record({\n    client: IDL.Opt(PageViewClient),\n    title: IDL.Text,\n    updated_at: IDL.Nat64,\n    referrer: IDL.Opt(IDL.Text),\n    time_zone: IDL.Text,\n    session_id: IDL.Text,\n    campaign: IDL.Opt(PageViewCampaign),\n    href: IDL.Text,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    device: PageViewDevice,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const AnalyticsBrowsersPageViews = IDL.Record({\n    safari: IDL.Float64,\n    opera: IDL.Float64,\n    others: IDL.Float64,\n    firefox: IDL.Float64,\n    chrome: IDL.Float64\n  });\n  const AnalyticsOperatingSystemsPageViews = IDL.Record({\n    ios: IDL.Float64,\n    macos: IDL.Float64,\n    others: IDL.Float64,\n    linux: IDL.Float64,\n    android: IDL.Float64,\n    windows: IDL.Float64\n  });\n  const AnalyticsDevicesPageViews = IDL.Record({\n    desktop: IDL.Float64,\n    laptop: IDL.Opt(IDL.Float64),\n    others: IDL.Float64,\n    tablet: IDL.Opt(IDL.Float64),\n    mobile: IDL.Float64\n  });\n  const AnalyticsClientsPageViews = IDL.Record({\n    browsers: AnalyticsBrowsersPageViews,\n    operating_systems: IDL.Opt(AnalyticsOperatingSystemsPageViews),\n    devices: AnalyticsDevicesPageViews\n  });\n  const CalendarDate = IDL.Record({\n    day: IDL.Nat8,\n    month: IDL.Nat8,\n    year: IDL.Int32\n  });\n  const AnalyticsMetricsPageViews = IDL.Record({\n    bounce_rate: IDL.Float64,\n    average_page_views_per_session: IDL.Float64,\n    daily_total_page_views: IDL.Vec(IDL.Tuple(CalendarDate, IDL.Nat32)),\n    total_page_views: IDL.Nat32,\n    unique_page_views: IDL.Nat64,\n    unique_sessions: IDL.Nat64\n  });\n  const AnalyticsTop10PageViews = IDL.Record({\n    referrers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),\n    pages: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),\n    utm_campaigns: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),\n    utm_sources: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),\n    time_zones: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)))\n  });\n  const NavigationType = IDL.Variant({\n    Navigate: IDL.Null,\n    Restore: IDL.Null,\n    Reload: IDL.Null,\n    BackForward: IDL.Null,\n    BackForwardCache: IDL.Null,\n    Prerender: IDL.Null\n  });\n  const WebVitalsMetric = IDL.Record({\n    id: IDL.Text,\n    value: IDL.Float64,\n    navigation_type: IDL.Opt(NavigationType),\n    delta: IDL.Float64\n  });\n  const PerformanceData = IDL.Variant({WebVitalsMetric: WebVitalsMetric});\n  const PerformanceMetricName = IDL.Variant({\n    CLS: IDL.Null,\n    FCP: IDL.Null,\n    INP: IDL.Null,\n    LCP: IDL.Null,\n    TTFB: IDL.Null\n  });\n  const PerformanceMetric = IDL.Record({\n    updated_at: IDL.Nat64,\n    session_id: IDL.Text,\n    data: PerformanceData,\n    href: IDL.Text,\n    metric_name: PerformanceMetricName,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const AnalyticsWebVitalsPageMetrics = IDL.Record({\n    cls: IDL.Opt(IDL.Float64),\n    fcp: IDL.Opt(IDL.Float64),\n    inp: IDL.Opt(IDL.Float64),\n    lcp: IDL.Opt(IDL.Float64),\n    ttfb: IDL.Opt(IDL.Float64)\n  });\n  const AnalyticsWebVitalsPerformanceMetrics = IDL.Record({\n    overall: AnalyticsWebVitalsPageMetrics,\n    pages: IDL.Vec(IDL.Tuple(IDL.Text, AnalyticsWebVitalsPageMetrics))\n  });\n  const TrackEvent = IDL.Record({\n    updated_at: IDL.Nat64,\n    session_id: IDL.Text,\n    metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n    name: IDL.Text,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const AnalyticsTrackEvents = IDL.Record({\n    total: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    upgrade: IDL.Opt(IDL.Bool),\n    status_code: IDL.Nat16\n  });\n  const OrbiterSatelliteFeatures = IDL.Record({\n    performance_metrics: IDL.Bool,\n    track_events: IDL.Bool,\n    page_views: IDL.Bool\n  });\n  const OrbiterSatelliteConfig = IDL.Record({\n    updated_at: IDL.Nat64,\n    features: IDL.Opt(OrbiterSatelliteFeatures),\n    restricted_origin: IDL.Opt(IDL.Text),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetPageView = IDL.Record({\n    client: IDL.Opt(PageViewClient),\n    title: IDL.Text,\n    updated_at: IDL.Opt(IDL.Nat64),\n    referrer: IDL.Opt(IDL.Text),\n    time_zone: IDL.Text,\n    session_id: IDL.Text,\n    campaign: IDL.Opt(PageViewCampaign),\n    href: IDL.Text,\n    satellite_id: IDL.Principal,\n    device: PageViewDevice,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result = IDL.Variant({Ok: PageView, Err: IDL.Text});\n  const Result_1 = IDL.Variant({\n    Ok: IDL.Null,\n    Err: IDL.Vec(IDL.Tuple(AnalyticKey, IDL.Text))\n  });\n  const SetPerformanceMetric = IDL.Record({\n    session_id: IDL.Text,\n    data: PerformanceData,\n    href: IDL.Text,\n    metric_name: PerformanceMetricName,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result_2 = IDL.Variant({Ok: PerformanceMetric, Err: IDL.Text});\n  const SetSatelliteConfig = IDL.Record({\n    features: IDL.Opt(OrbiterSatelliteFeatures),\n    restricted_origin: IDL.Opt(IDL.Text),\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const SetTrackEvent = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    session_id: IDL.Text,\n    metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n    name: IDL.Text,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result_3 = IDL.Variant({Ok: TrackEvent, Err: IDL.Text});\n  return IDL.Service({\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_satellite_config: IDL.Func([IDL.Principal, DelSatelliteConfig], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_page_views: IDL.Func(\n      [GetAnalytics],\n      [IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],\n      ['query']\n    ),\n    get_page_views_analytics_clients: IDL.Func(\n      [GetAnalytics],\n      [AnalyticsClientsPageViews],\n      ['query']\n    ),\n    get_page_views_analytics_metrics: IDL.Func(\n      [GetAnalytics],\n      [AnalyticsMetricsPageViews],\n      ['query']\n    ),\n    get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], ['query']),\n    get_performance_metrics: IDL.Func(\n      [GetAnalytics],\n      [IDL.Vec(IDL.Tuple(AnalyticKey, PerformanceMetric))],\n      ['query']\n    ),\n    get_performance_metrics_analytics_web_vitals: IDL.Func(\n      [GetAnalytics],\n      [AnalyticsWebVitalsPerformanceMetrics],\n      ['query']\n    ),\n    get_track_events: IDL.Func(\n      [GetAnalytics],\n      [IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))],\n      ['query']\n    ),\n    get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], ['query']),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n    http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n    list_satellite_configs: IDL.Func(\n      [],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n      ['query']\n    ),\n    memory_size: IDL.Func([], [MemorySize], ['query']),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_page_view: IDL.Func([AnalyticKey, SetPageView], [Result], []),\n    set_page_views: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetPageView))], [Result_1], []),\n    set_performance_metric: IDL.Func([AnalyticKey, SetPerformanceMetric], [Result_2], []),\n    set_performance_metrics: IDL.Func(\n      [IDL.Vec(IDL.Tuple(AnalyticKey, SetPerformanceMetric))],\n      [Result_1],\n      []\n    ),\n    set_satellite_configs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Principal, SetSatelliteConfig))],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n      []\n    ),\n    set_track_event: IDL.Func([AnalyticKey, SetTrackEvent], [Result_3], []),\n    set_track_events: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetTrackEvent))], [Result_1], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  const InitOrbiterArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  return [InitOrbiterArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const InitOrbiterArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelSatelliteConfig = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const GetAnalytics = IDL.Record({\n    to: IDL.Opt(IDL.Nat64),\n    from: IDL.Opt(IDL.Nat64),\n    satellite_id: IDL.Opt(IDL.Principal)\n  });\n  const AnalyticKey = IDL.Record({\n    key: IDL.Text,\n    collected_at: IDL.Nat64\n  });\n  const PageViewClient = IDL.Record({\n    os: IDL.Text,\n    device: IDL.Opt(IDL.Text),\n    browser: IDL.Text\n  });\n  const PageViewCampaign = IDL.Record({\n    utm_content: IDL.Opt(IDL.Text),\n    utm_medium: IDL.Opt(IDL.Text),\n    utm_source: IDL.Text,\n    utm_term: IDL.Opt(IDL.Text),\n    utm_campaign: IDL.Opt(IDL.Text)\n  });\n  const PageViewDevice = IDL.Record({\n    inner_height: IDL.Nat16,\n    screen_height: IDL.Opt(IDL.Nat16),\n    screen_width: IDL.Opt(IDL.Nat16),\n    inner_width: IDL.Nat16\n  });\n  const PageView = IDL.Record({\n    client: IDL.Opt(PageViewClient),\n    title: IDL.Text,\n    updated_at: IDL.Nat64,\n    referrer: IDL.Opt(IDL.Text),\n    time_zone: IDL.Text,\n    session_id: IDL.Text,\n    campaign: IDL.Opt(PageViewCampaign),\n    href: IDL.Text,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    device: PageViewDevice,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const AnalyticsBrowsersPageViews = IDL.Record({\n    safari: IDL.Float64,\n    opera: IDL.Float64,\n    others: IDL.Float64,\n    firefox: IDL.Float64,\n    chrome: IDL.Float64\n  });\n  const AnalyticsOperatingSystemsPageViews = IDL.Record({\n    ios: IDL.Float64,\n    macos: IDL.Float64,\n    others: IDL.Float64,\n    linux: IDL.Float64,\n    android: IDL.Float64,\n    windows: IDL.Float64\n  });\n  const AnalyticsDevicesPageViews = IDL.Record({\n    desktop: IDL.Float64,\n    laptop: IDL.Opt(IDL.Float64),\n    others: IDL.Float64,\n    tablet: IDL.Opt(IDL.Float64),\n    mobile: IDL.Float64\n  });\n  const AnalyticsClientsPageViews = IDL.Record({\n    browsers: AnalyticsBrowsersPageViews,\n    operating_systems: IDL.Opt(AnalyticsOperatingSystemsPageViews),\n    devices: AnalyticsDevicesPageViews\n  });\n  const CalendarDate = IDL.Record({\n    day: IDL.Nat8,\n    month: IDL.Nat8,\n    year: IDL.Int32\n  });\n  const AnalyticsMetricsPageViews = IDL.Record({\n    bounce_rate: IDL.Float64,\n    average_page_views_per_session: IDL.Float64,\n    daily_total_page_views: IDL.Vec(IDL.Tuple(CalendarDate, IDL.Nat32)),\n    total_page_views: IDL.Nat32,\n    unique_page_views: IDL.Nat64,\n    unique_sessions: IDL.Nat64\n  });\n  const AnalyticsTop10PageViews = IDL.Record({\n    referrers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),\n    pages: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),\n    utm_campaigns: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),\n    utm_sources: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),\n    time_zones: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)))\n  });\n  const NavigationType = IDL.Variant({\n    Navigate: IDL.Null,\n    Restore: IDL.Null,\n    Reload: IDL.Null,\n    BackForward: IDL.Null,\n    BackForwardCache: IDL.Null,\n    Prerender: IDL.Null\n  });\n  const WebVitalsMetric = IDL.Record({\n    id: IDL.Text,\n    value: IDL.Float64,\n    navigation_type: IDL.Opt(NavigationType),\n    delta: IDL.Float64\n  });\n  const PerformanceData = IDL.Variant({WebVitalsMetric: WebVitalsMetric});\n  const PerformanceMetricName = IDL.Variant({\n    CLS: IDL.Null,\n    FCP: IDL.Null,\n    INP: IDL.Null,\n    LCP: IDL.Null,\n    TTFB: IDL.Null\n  });\n  const PerformanceMetric = IDL.Record({\n    updated_at: IDL.Nat64,\n    session_id: IDL.Text,\n    data: PerformanceData,\n    href: IDL.Text,\n    metric_name: PerformanceMetricName,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const AnalyticsWebVitalsPageMetrics = IDL.Record({\n    cls: IDL.Opt(IDL.Float64),\n    fcp: IDL.Opt(IDL.Float64),\n    inp: IDL.Opt(IDL.Float64),\n    lcp: IDL.Opt(IDL.Float64),\n    ttfb: IDL.Opt(IDL.Float64)\n  });\n  const AnalyticsWebVitalsPerformanceMetrics = IDL.Record({\n    overall: AnalyticsWebVitalsPageMetrics,\n    pages: IDL.Vec(IDL.Tuple(IDL.Text, AnalyticsWebVitalsPageMetrics))\n  });\n  const TrackEvent = IDL.Record({\n    updated_at: IDL.Nat64,\n    session_id: IDL.Text,\n    metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n    name: IDL.Text,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const AnalyticsTrackEvents = IDL.Record({\n    total: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    upgrade: IDL.Opt(IDL.Bool),\n    status_code: IDL.Nat16\n  });\n  const OrbiterSatelliteFeatures = IDL.Record({\n    performance_metrics: IDL.Bool,\n    track_events: IDL.Bool,\n    page_views: IDL.Bool\n  });\n  const OrbiterSatelliteConfig = IDL.Record({\n    updated_at: IDL.Nat64,\n    features: IDL.Opt(OrbiterSatelliteFeatures),\n    restricted_origin: IDL.Opt(IDL.Text),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetPageView = IDL.Record({\n    client: IDL.Opt(PageViewClient),\n    title: IDL.Text,\n    updated_at: IDL.Opt(IDL.Nat64),\n    referrer: IDL.Opt(IDL.Text),\n    time_zone: IDL.Text,\n    session_id: IDL.Text,\n    campaign: IDL.Opt(PageViewCampaign),\n    href: IDL.Text,\n    satellite_id: IDL.Principal,\n    device: PageViewDevice,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result = IDL.Variant({Ok: PageView, Err: IDL.Text});\n  const Result_1 = IDL.Variant({\n    Ok: IDL.Null,\n    Err: IDL.Vec(IDL.Tuple(AnalyticKey, IDL.Text))\n  });\n  const SetPerformanceMetric = IDL.Record({\n    session_id: IDL.Text,\n    data: PerformanceData,\n    href: IDL.Text,\n    metric_name: PerformanceMetricName,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result_2 = IDL.Variant({Ok: PerformanceMetric, Err: IDL.Text});\n  const SetSatelliteConfig = IDL.Record({\n    features: IDL.Opt(OrbiterSatelliteFeatures),\n    restricted_origin: IDL.Opt(IDL.Text),\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const SetTrackEvent = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    session_id: IDL.Text,\n    metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n    name: IDL.Text,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result_3 = IDL.Variant({Ok: TrackEvent, Err: IDL.Text});\n  return IDL.Service({\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_satellite_config: IDL.Func([IDL.Principal, DelSatelliteConfig], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_page_views: IDL.Func([GetAnalytics], [IDL.Vec(IDL.Tuple(AnalyticKey, PageView))], []),\n    get_page_views_analytics_clients: IDL.Func([GetAnalytics], [AnalyticsClientsPageViews], []),\n    get_page_views_analytics_metrics: IDL.Func([GetAnalytics], [AnalyticsMetricsPageViews], []),\n    get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], []),\n    get_performance_metrics: IDL.Func(\n      [GetAnalytics],\n      [IDL.Vec(IDL.Tuple(AnalyticKey, PerformanceMetric))],\n      []\n    ),\n    get_performance_metrics_analytics_web_vitals: IDL.Func(\n      [GetAnalytics],\n      [AnalyticsWebVitalsPerformanceMetrics],\n      []\n    ),\n    get_track_events: IDL.Func([GetAnalytics], [IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))], []),\n    get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], []),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n    http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n    list_satellite_configs: IDL.Func(\n      [],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n      []\n    ),\n    memory_size: IDL.Func([], [MemorySize], []),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_page_view: IDL.Func([AnalyticKey, SetPageView], [Result], []),\n    set_page_views: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetPageView))], [Result_1], []),\n    set_performance_metric: IDL.Func([AnalyticKey, SetPerformanceMetric], [Result_2], []),\n    set_performance_metrics: IDL.Func(\n      [IDL.Vec(IDL.Tuple(AnalyticKey, SetPerformanceMetric))],\n      [Result_1],\n      []\n    ),\n    set_satellite_configs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Principal, SetSatelliteConfig))],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n      []\n    ),\n    set_track_event: IDL.Func([AnalyticKey, SetTrackEvent], [Result_3], []),\n    set_track_events: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetTrackEvent))], [Result_1], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  const InitOrbiterArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  return [InitOrbiterArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});\n  const StorageConfig = IDL.Record({\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))\n  });\n  const Config = IDL.Record({storage: StorageConfig});\n  const Doc = IDL.Record({\n    updated_at: IDL.Nat64,\n    owner: IDL.Principal,\n    data: IDL.Vec(IDL.Nat8),\n    created_at: IDL.Nat64\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))\n  });\n  const StreamingCallbackToken = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], [])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    owner: IDL.Opt(IDL.Principal),\n    matcher: IDL.Opt(IDL.Text),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64\n  });\n  const ListResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent))\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const ListResults_1 = IDL.Record({\n    matches_length: IDL.Nat64,\n    length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Doc))\n  });\n  const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n  const Permission = IDL.Variant({\n    Controllers: IDL.Null,\n    Private: IDL.Null,\n    Public: IDL.Null,\n    Managed: IDL.Null\n  });\n  const Rule = IDL.Record({\n    updated_at: IDL.Nat64,\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    created_at: IDL.Nat64,\n    write: Permission\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetDoc = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    data: IDL.Vec(IDL.Nat8)\n  });\n  const SetRule = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    write: Permission\n  });\n  const Chunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat\n  });\n  const UploadChunk = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    commit_asset_upload: IDL.Func([CommitBatch], [], []),\n    del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n    del_assets: IDL.Func([IDL.Opt(IDL.Text)], [], []),\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n    get_config: IDL.Func([], [Config], []),\n    get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      ['query']\n    ),\n    init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n    list_assets: IDL.Func([IDL.Opt(IDL.Text), ListParams], [ListResults], ['query']),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n    list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),\n    list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),\n    set_config: IDL.Func([Config], [], []),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n    set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),\n    upload_asset_chunk: IDL.Func([Chunk], [UploadChunk], []),\n    version: IDL.Func([], [IDL.Text], ['query'])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const TimestampMatcher = IDL.Variant({\n    Equal: IDL.Nat64,\n    Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),\n    GreaterThan: IDL.Nat64,\n    LessThan: IDL.Nat64\n  });\n  const ListMatcher = IDL.Record({\n    key: IDL.Opt(IDL.Text),\n    updated_at: IDL.Opt(TimestampMatcher),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Opt(TimestampMatcher)\n  });\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    owner: IDL.Opt(IDL.Principal),\n    matcher: IDL.Opt(ListMatcher),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelDoc = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const CollectionType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n  const DelRule = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const AuthenticationConfigInternetIdentity = IDL.Record({\n    derivation_origin: IDL.Opt(IDL.Text),\n    external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))\n  });\n  const AuthenticationConfig = IDL.Record({\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity)\n  });\n  const ConfigMaxMemorySize = IDL.Record({\n    stable: IDL.Opt(IDL.Nat64),\n    heap: IDL.Opt(IDL.Nat64)\n  });\n  const DbConfig = IDL.Record({\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n  });\n  const StorageConfigIFrame = IDL.Variant({\n    Deny: IDL.Null,\n    AllowAny: IDL.Null,\n    SameOrigin: IDL.Null\n  });\n  const StorageConfigRawAccess = IDL.Variant({\n    Deny: IDL.Null,\n    Allow: IDL.Null\n  });\n  const StorageConfigRedirect = IDL.Record({\n    status_code: IDL.Nat16,\n    location: IDL.Text\n  });\n  const StorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const Config = IDL.Record({\n    db: IDL.Opt(DbConfig),\n    authentication: IDL.Opt(AuthenticationConfig),\n    storage: StorageConfig\n  });\n  const Doc = IDL.Record({\n    updated_at: IDL.Nat64,\n    owner: IDL.Principal,\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const Permission = IDL.Variant({\n    Controllers: IDL.Null,\n    Private: IDL.Null,\n    Public: IDL.Null,\n    Managed: IDL.Null\n  });\n  const RateConfig = IDL.Record({\n    max_tokens: IDL.Nat64,\n    time_per_token_ns: IDL.Nat64\n  });\n  const Rule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    updated_at: IDL.Nat64,\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const StreamingCallbackToken = IDL.Record({\n    memory: Memory,\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], ['query'])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListResults = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n    items_length: IDL.Nat64\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const ListResults_1 = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),\n    items_length: IDL.Nat64\n  });\n  const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetDoc = IDL.Record({\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const SetRule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const UploadChunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat,\n    order_id: IDL.Opt(IDL.Nat)\n  });\n  const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    build_version: IDL.Func([], [IDL.Text], ['query']),\n    commit_asset_upload: IDL.Func([CommitBatch], [], []),\n    count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n    count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n    count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n    count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n    del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n    del_assets: IDL.Func([IDL.Text], [], []),\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n    del_docs: IDL.Func([IDL.Text], [], []),\n    del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),\n    del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),\n    del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),\n    del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n    del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n    get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n    get_config: IDL.Func([], [Config], []),\n    get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n    get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n    get_many_assets: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n      ['query']\n    ),\n    get_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n      ['query']\n    ),\n    get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n    get_storage_config: IDL.Func([], [StorageConfig], ['query']),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      ['query']\n    ),\n    init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n    list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n    list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),\n    list_rules: IDL.Func([CollectionType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),\n    memory_size: IDL.Func([], [MemorySize], ['query']),\n    set_auth_config: IDL.Func([AuthenticationConfig], [], []),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_db_config: IDL.Func([DbConfig], [], []),\n    set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n    set_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n      []\n    ),\n    set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n    set_storage_config: IDL.Func([StorageConfig], [], []),\n    upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n    version: IDL.Func([], [IDL.Text], ['query'])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelSatelliteConfig = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const GetAnalytics = IDL.Record({\n    to: IDL.Opt(IDL.Nat64),\n    from: IDL.Opt(IDL.Nat64),\n    satellite_id: IDL.Opt(IDL.Principal)\n  });\n  const AnalyticKey = IDL.Record({\n    key: IDL.Text,\n    collected_at: IDL.Nat64\n  });\n  const PageViewDevice = IDL.Record({\n    inner_height: IDL.Nat16,\n    inner_width: IDL.Nat16\n  });\n  const PageView = IDL.Record({\n    title: IDL.Text,\n    updated_at: IDL.Nat64,\n    referrer: IDL.Opt(IDL.Text),\n    time_zone: IDL.Text,\n    session_id: IDL.Text,\n    href: IDL.Text,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    device: PageViewDevice,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const AnalyticsBrowsersPageViews = IDL.Record({\n    safari: IDL.Float64,\n    opera: IDL.Float64,\n    others: IDL.Float64,\n    firefox: IDL.Float64,\n    chrome: IDL.Float64\n  });\n  const AnalyticsDevicesPageViews = IDL.Record({\n    desktop: IDL.Float64,\n    others: IDL.Float64,\n    mobile: IDL.Float64\n  });\n  const AnalyticsClientsPageViews = IDL.Record({\n    browsers: AnalyticsBrowsersPageViews,\n    devices: AnalyticsDevicesPageViews\n  });\n  const CalendarDate = IDL.Record({\n    day: IDL.Nat8,\n    month: IDL.Nat8,\n    year: IDL.Int32\n  });\n  const AnalyticsMetricsPageViews = IDL.Record({\n    bounce_rate: IDL.Float64,\n    average_page_views_per_session: IDL.Float64,\n    daily_total_page_views: IDL.Vec(IDL.Tuple(CalendarDate, IDL.Nat32)),\n    total_page_views: IDL.Nat32,\n    unique_page_views: IDL.Nat64,\n    unique_sessions: IDL.Nat64\n  });\n  const AnalyticsTop10PageViews = IDL.Record({\n    referrers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),\n    pages: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))\n  });\n  const NavigationType = IDL.Variant({\n    Navigate: IDL.Null,\n    Restore: IDL.Null,\n    Reload: IDL.Null,\n    BackForward: IDL.Null,\n    BackForwardCache: IDL.Null,\n    Prerender: IDL.Null\n  });\n  const WebVitalsMetric = IDL.Record({\n    id: IDL.Text,\n    value: IDL.Float64,\n    navigation_type: IDL.Opt(NavigationType),\n    delta: IDL.Float64\n  });\n  const PerformanceData = IDL.Variant({WebVitalsMetric: WebVitalsMetric});\n  const PerformanceMetricName = IDL.Variant({\n    CLS: IDL.Null,\n    FCP: IDL.Null,\n    INP: IDL.Null,\n    LCP: IDL.Null,\n    TTFB: IDL.Null\n  });\n  const PerformanceMetric = IDL.Record({\n    updated_at: IDL.Nat64,\n    session_id: IDL.Text,\n    data: PerformanceData,\n    href: IDL.Text,\n    metric_name: PerformanceMetricName,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const AnalyticsWebVitalsPageMetrics = IDL.Record({\n    cls: IDL.Opt(IDL.Float64),\n    fcp: IDL.Opt(IDL.Float64),\n    inp: IDL.Opt(IDL.Float64),\n    lcp: IDL.Opt(IDL.Float64),\n    ttfb: IDL.Opt(IDL.Float64)\n  });\n  const AnalyticsWebVitalsPerformanceMetrics = IDL.Record({\n    overall: AnalyticsWebVitalsPageMetrics,\n    pages: IDL.Vec(IDL.Tuple(IDL.Text, AnalyticsWebVitalsPageMetrics))\n  });\n  const TrackEvent = IDL.Record({\n    updated_at: IDL.Nat64,\n    session_id: IDL.Text,\n    metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n    name: IDL.Text,\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const AnalyticsTrackEvents = IDL.Record({\n    total: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))\n  });\n  const OrbiterSatelliteFeatures = IDL.Record({\n    performance_metrics: IDL.Bool,\n    track_events: IDL.Bool,\n    page_views: IDL.Bool\n  });\n  const OrbiterSatelliteConfig = IDL.Record({\n    updated_at: IDL.Nat64,\n    features: IDL.Opt(OrbiterSatelliteFeatures),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetPageView = IDL.Record({\n    title: IDL.Text,\n    updated_at: IDL.Opt(IDL.Nat64),\n    referrer: IDL.Opt(IDL.Text),\n    time_zone: IDL.Text,\n    session_id: IDL.Text,\n    href: IDL.Text,\n    satellite_id: IDL.Principal,\n    device: PageViewDevice,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result = IDL.Variant({Ok: PageView, Err: IDL.Text});\n  const Result_1 = IDL.Variant({\n    Ok: IDL.Null,\n    Err: IDL.Vec(IDL.Tuple(AnalyticKey, IDL.Text))\n  });\n  const SetPerformanceMetric = IDL.Record({\n    session_id: IDL.Text,\n    data: PerformanceData,\n    href: IDL.Text,\n    metric_name: PerformanceMetricName,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result_2 = IDL.Variant({Ok: PerformanceMetric, Err: IDL.Text});\n  const SetSatelliteConfig = IDL.Record({\n    features: IDL.Opt(OrbiterSatelliteFeatures),\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const SetTrackEvent = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    session_id: IDL.Text,\n    metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n    name: IDL.Text,\n    satellite_id: IDL.Principal,\n    version: IDL.Opt(IDL.Nat64),\n    user_agent: IDL.Opt(IDL.Text)\n  });\n  const Result_3 = IDL.Variant({Ok: TrackEvent, Err: IDL.Text});\n  return IDL.Service({\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_satellite_config: IDL.Func([IDL.Principal, DelSatelliteConfig], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_page_views: IDL.Func(\n      [GetAnalytics],\n      [IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],\n      ['query']\n    ),\n    get_page_views_analytics_clients: IDL.Func(\n      [GetAnalytics],\n      [AnalyticsClientsPageViews],\n      ['query']\n    ),\n    get_page_views_analytics_metrics: IDL.Func(\n      [GetAnalytics],\n      [AnalyticsMetricsPageViews],\n      ['query']\n    ),\n    get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], ['query']),\n    get_performance_metrics: IDL.Func(\n      [GetAnalytics],\n      [IDL.Vec(IDL.Tuple(AnalyticKey, PerformanceMetric))],\n      ['query']\n    ),\n    get_performance_metrics_analytics_web_vitals: IDL.Func(\n      [GetAnalytics],\n      [AnalyticsWebVitalsPerformanceMetrics],\n      ['query']\n    ),\n    get_track_events: IDL.Func(\n      [GetAnalytics],\n      [IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))],\n      ['query']\n    ),\n    get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], ['query']),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n    list_satellite_configs: IDL.Func(\n      [],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n      ['query']\n    ),\n    memory_size: IDL.Func([], [MemorySize], ['query']),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_page_view: IDL.Func([AnalyticKey, SetPageView], [Result], []),\n    set_page_views: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetPageView))], [Result_1], []),\n    set_performance_metric: IDL.Func([AnalyticKey, SetPerformanceMetric], [Result_2], []),\n    set_performance_metrics: IDL.Func(\n      [IDL.Vec(IDL.Tuple(AnalyticKey, SetPerformanceMetric))],\n      [Result_1],\n      []\n    ),\n    set_satellite_configs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Principal, SetSatelliteConfig))],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n      []\n    ),\n    set_track_event: IDL.Func([AnalyticKey, SetTrackEvent], [Result_3], []),\n    set_track_events: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetTrackEvent))], [Result_1], []),\n    version: IDL.Func([], [IDL.Text], ['query'])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const CyclesThreshold = IDL.Record({\n    fund_cycles: IDL.Nat,\n    min_cycles: IDL.Nat\n  });\n  const CyclesMonitoringStrategy = IDL.Variant({\n    BelowThreshold: CyclesThreshold\n  });\n  const CyclesMonitoring = IDL.Record({\n    strategy: IDL.Opt(CyclesMonitoringStrategy),\n    enabled: IDL.Bool\n  });\n  const Monitoring = IDL.Record({cycles: IDL.Opt(CyclesMonitoring)});\n  const Settings = IDL.Record({monitoring: IDL.Opt(Monitoring)});\n  const Orbiter = IDL.Record({\n    updated_at: IDL.Nat64,\n    orbiter_id: IDL.Principal,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    settings: IDL.Opt(Settings)\n  });\n  const CreateCanisterConfig = IDL.Record({\n    subnet_id: IDL.Opt(IDL.Principal),\n    name: IDL.Opt(IDL.Text)\n  });\n  const Satellite = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    satellite_id: IDL.Principal,\n    settings: IDL.Opt(Settings)\n  });\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const DepositedCyclesEmailNotification = IDL.Record({\n    to: IDL.Opt(IDL.Text),\n    enabled: IDL.Bool\n  });\n  const CyclesMonitoringConfig = IDL.Record({\n    notification: IDL.Opt(DepositedCyclesEmailNotification),\n    default_strategy: IDL.Opt(CyclesMonitoringStrategy)\n  });\n  const MonitoringConfig = IDL.Record({\n    cycles: IDL.Opt(CyclesMonitoringConfig)\n  });\n  const Config = IDL.Record({monitoring: IDL.Opt(MonitoringConfig)});\n  const GetMonitoringHistory = IDL.Record({\n    to: IDL.Opt(IDL.Nat64),\n    from: IDL.Opt(IDL.Nat64),\n    segment_id: IDL.Principal\n  });\n  const MonitoringHistoryKey = IDL.Record({\n    segment_id: IDL.Principal,\n    created_at: IDL.Nat64,\n    nonce: IDL.Int32\n  });\n  const CyclesBalance = IDL.Record({\n    timestamp: IDL.Nat64,\n    amount: IDL.Nat\n  });\n  const MonitoringHistoryCycles = IDL.Record({\n    deposited_cycles: IDL.Opt(CyclesBalance),\n    cycles: CyclesBalance\n  });\n  const MonitoringHistory = IDL.Record({\n    cycles: IDL.Opt(MonitoringHistoryCycles)\n  });\n  const CyclesMonitoringStatus = IDL.Record({\n    monitored_ids: IDL.Vec(IDL.Principal),\n    running: IDL.Bool\n  });\n  const MonitoringStatus = IDL.Record({\n    cycles: IDL.Opt(CyclesMonitoringStatus)\n  });\n  const MissionControlSettings = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    monitoring: IDL.Opt(Monitoring)\n  });\n  const User = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    user: IDL.Opt(IDL.Principal),\n    created_at: IDL.Nat64,\n    config: IDL.Opt(Config)\n  });\n  const Tokens = IDL.Record({e8s: IDL.Nat64});\n  const Timestamp = IDL.Record({timestamp_nanos: IDL.Nat64});\n  const TransferArgs = IDL.Record({\n    to: IDL.Vec(IDL.Nat8),\n    fee: Tokens,\n    memo: IDL.Nat64,\n    from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    created_at_time: IDL.Opt(Timestamp),\n    amount: Tokens\n  });\n  const TransferError = IDL.Variant({\n    TxTooOld: IDL.Record({allowed_window_nanos: IDL.Nat64}),\n    BadFee: IDL.Record({expected_fee: Tokens}),\n    TxDuplicate: IDL.Record({duplicate_of: IDL.Nat64}),\n    TxCreatedInFuture: IDL.Null,\n    InsufficientFunds: IDL.Record({balance: Tokens})\n  });\n  const Result = IDL.Variant({Ok: IDL.Nat64, Err: TransferError});\n  const Account = IDL.Record({\n    owner: IDL.Principal,\n    subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))\n  });\n  const TransferArg = IDL.Record({\n    to: Account,\n    fee: IDL.Opt(IDL.Nat),\n    memo: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    created_at_time: IDL.Opt(IDL.Nat64),\n    amount: IDL.Nat\n  });\n  const TransferError_1 = IDL.Variant({\n    GenericError: IDL.Record({\n      message: IDL.Text,\n      error_code: IDL.Nat\n    }),\n    TemporarilyUnavailable: IDL.Null,\n    BadBurn: IDL.Record({min_burn_amount: IDL.Nat}),\n    Duplicate: IDL.Record({duplicate_of: IDL.Nat}),\n    BadFee: IDL.Record({expected_fee: IDL.Nat}),\n    CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),\n    TooOld: IDL.Null,\n    InsufficientFunds: IDL.Record({balance: IDL.Nat})\n  });\n  const Result_1 = IDL.Variant({Ok: IDL.Nat, Err: TransferError_1});\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SegmentsMonitoringStrategy = IDL.Record({\n    ids: IDL.Vec(IDL.Principal),\n    strategy: CyclesMonitoringStrategy\n  });\n  const CyclesMonitoringStartConfig = IDL.Record({\n    orbiters_strategy: IDL.Opt(SegmentsMonitoringStrategy),\n    mission_control_strategy: IDL.Opt(CyclesMonitoringStrategy),\n    satellites_strategy: IDL.Opt(SegmentsMonitoringStrategy)\n  });\n  const MonitoringStartConfig = IDL.Record({\n    cycles_config: IDL.Opt(CyclesMonitoringStartConfig)\n  });\n  const CyclesMonitoringStopConfig = IDL.Record({\n    satellite_ids: IDL.Opt(IDL.Vec(IDL.Principal)),\n    try_mission_control: IDL.Opt(IDL.Bool),\n    orbiter_ids: IDL.Opt(IDL.Vec(IDL.Principal))\n  });\n  const MonitoringStopConfig = IDL.Record({\n    cycles_config: IDL.Opt(CyclesMonitoringStopConfig)\n  });\n  return IDL.Service({\n    add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n    add_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n    create_orbiter: IDL.Func([IDL.Opt(IDL.Text)], [Orbiter], []),\n    create_orbiter_with_config: IDL.Func([CreateCanisterConfig], [Orbiter], []),\n    create_satellite: IDL.Func([IDL.Text], [Satellite], []),\n    create_satellite_with_config: IDL.Func([CreateCanisterConfig], [Satellite], []),\n    del_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n    del_orbiter: IDL.Func([IDL.Principal, IDL.Nat], [], []),\n    del_orbiters_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n    del_satellite: IDL.Func([IDL.Principal, IDL.Nat], [], []),\n    del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_config: IDL.Func([], [IDL.Opt(Config)], ['query']),\n    get_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], ['query']),\n    get_monitoring_history: IDL.Func(\n      [GetMonitoringHistory],\n      [IDL.Vec(IDL.Tuple(MonitoringHistoryKey, MonitoringHistory))],\n      ['query']\n    ),\n    get_monitoring_status: IDL.Func([], [MonitoringStatus], ['query']),\n    get_settings: IDL.Func([], [IDL.Opt(MissionControlSettings)], ['query']),\n    get_user: IDL.Func([], [IDL.Principal], ['query']),\n    get_user_data: IDL.Func([], [User], ['query']),\n    icp_transfer: IDL.Func([TransferArgs], [Result], []),\n    icrc_transfer: IDL.Func([IDL.Principal, TransferArg], [Result_1], []),\n    list_mission_control_controllers: IDL.Func(\n      [],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      ['query']\n    ),\n    list_orbiters: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Orbiter))], ['query']),\n    list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),\n    remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n    remove_satellites_controllers: IDL.Func(\n      [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)],\n      [],\n      []\n    ),\n    set_config: IDL.Func([IDL.Opt(Config)], [], []),\n    set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),\n    set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),\n    set_orbiter: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Orbiter], []),\n    set_orbiter_metadata: IDL.Func(\n      [IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [Orbiter],\n      []\n    ),\n    set_orbiters_controllers: IDL.Func(\n      [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],\n      [],\n      []\n    ),\n    set_satellite: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Satellite], []),\n    set_satellite_metadata: IDL.Func(\n      [IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [Satellite],\n      []\n    ),\n    set_satellites_controllers: IDL.Func(\n      [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],\n      [],\n      []\n    ),\n    start_monitoring: IDL.Func([], [], []),\n    stop_monitoring: IDL.Func([], [], []),\n    top_up: IDL.Func([IDL.Principal, Tokens], [], []),\n    unset_orbiter: IDL.Func([IDL.Principal], [], []),\n    unset_satellite: IDL.Func([IDL.Principal], [], []),\n    update_and_start_monitoring: IDL.Func([MonitoringStartConfig], [], []),\n    update_and_stop_monitoring: IDL.Func([MonitoringStopConfig], [], []),\n    version: IDL.Func([], [IDL.Text], ['query'])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  return [];\n};\n", "export const idlFactory = ({IDL}) => {\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});\n  const StorageConfig = IDL.Record({\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))\n  });\n  const Config = IDL.Record({storage: StorageConfig});\n  const Doc = IDL.Record({\n    updated_at: IDL.Nat64,\n    owner: IDL.Principal,\n    data: IDL.Vec(IDL.Nat8),\n    created_at: IDL.Nat64\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))\n  });\n  const StreamingCallbackToken = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], [])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    matcher: IDL.Opt(IDL.Text),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64\n  });\n  const ListResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent))\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const ListResults_1 = IDL.Record({\n    matches_length: IDL.Nat64,\n    length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Doc))\n  });\n  const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n  const Permission = IDL.Variant({\n    Controllers: IDL.Null,\n    Private: IDL.Null,\n    Public: IDL.Null,\n    Managed: IDL.Null\n  });\n  const Rule = IDL.Record({\n    updated_at: IDL.Nat64,\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    created_at: IDL.Nat64,\n    write: Permission\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetDoc = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    data: IDL.Vec(IDL.Nat8)\n  });\n  const SetRule = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    write: Permission\n  });\n  const Chunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat\n  });\n  const UploadChunk = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    commit_asset_upload: IDL.Func([CommitBatch], [], []),\n    del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n    del_assets: IDL.Func([IDL.Opt(IDL.Text)], [], []),\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n    get_config: IDL.Func([], [Config], []),\n    get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      ['query']\n    ),\n    init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n    list_assets: IDL.Func([IDL.Opt(IDL.Text), ListParams], [ListResults], ['query']),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n    list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),\n    list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),\n    set_config: IDL.Func([Config], [], []),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n    set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),\n    upload_asset_chunk: IDL.Func([Chunk], [UploadChunk], []),\n    version: IDL.Func([], [IDL.Text], ['query'])\n  });\n};\nexport const init = ({IDL}) => {\n  return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n  const InitSatelliteArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs)\n  });\n  const OpenIdPrepareDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8)\n  });\n  const AuthenticationArgs = IDL.Variant({\n    OpenId: OpenIdPrepareDelegationArgs\n  });\n  const Doc = IDL.Record({\n    updated_at: IDL.Nat64,\n    owner: IDL.Principal,\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const PreparedDelegation = IDL.Record({\n    user_key: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const Authentication = IDL.Record({\n    doc: Doc,\n    delegation: PreparedDelegation\n  });\n  const JwtFindProviderError = IDL.Variant({\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoMatchingProvider: IDL.Null\n  });\n  const JwtVerifyError = IDL.Variant({\n    WrongKeyType: IDL.Null,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoKeyForKid: IDL.Null\n  });\n  const GetOrRefreshJwksError = IDL.Variant({\n    InvalidConfig: IDL.Text,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    KeyNotFoundCooldown: IDL.Null,\n    CertificateNotFound: IDL.Null,\n    BadSig: IDL.Text,\n    MissingLastAttempt: IDL.Text,\n    KeyNotFound: IDL.Null,\n    FetchFailed: IDL.Text\n  });\n  const PrepareDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const AuthenticationError = IDL.Variant({\n    PrepareDelegation: PrepareDelegationError,\n    RegisterUser: IDL.Text\n  });\n  const AuthenticateResultResponse = IDL.Variant({\n    Ok: Authentication,\n    Err: AuthenticationError\n  });\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const CommitProposal = IDL.Record({\n    sha256: IDL.Vec(IDL.Nat8),\n    proposal_id: IDL.Nat\n  });\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const TimestampMatcher = IDL.Variant({\n    Equal: IDL.Nat64,\n    Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),\n    GreaterThan: IDL.Nat64,\n    LessThan: IDL.Nat64\n  });\n  const ListMatcher = IDL.Record({\n    key: IDL.Opt(IDL.Text),\n    updated_at: IDL.Opt(TimestampMatcher),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Opt(TimestampMatcher)\n  });\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    owner: IDL.Opt(IDL.Principal),\n    matcher: IDL.Opt(ListMatcher),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelDoc = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const CollectionType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n  const DelRule = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const DeleteProposalAssets = IDL.Record({\n    proposal_ids: IDL.Vec(IDL.Nat)\n  });\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProvider = IDL.Variant({Google: IDL.Null});\n  const OpenIdProviderDelegationConfig = IDL.Record({\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    max_time_to_live: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProviderConfig = IDL.Record({\n    delegation: IDL.Opt(OpenIdProviderDelegationConfig),\n    client_id: IDL.Text\n  });\n  const AuthenticationConfigOpenId = IDL.Record({\n    observatory_id: IDL.Opt(IDL.Principal),\n    providers: IDL.Vec(IDL.Tuple(OpenIdProvider, OpenIdProviderConfig))\n  });\n  const AuthenticationConfigInternetIdentity = IDL.Record({\n    derivation_origin: IDL.Opt(IDL.Text),\n    external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))\n  });\n  const AuthenticationRules = IDL.Record({\n    allowed_callers: IDL.Vec(IDL.Principal)\n  });\n  const AuthenticationConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const ConfigMaxMemorySize = IDL.Record({\n    stable: IDL.Opt(IDL.Nat64),\n    heap: IDL.Opt(IDL.Nat64)\n  });\n  const DbConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n  });\n  const StorageConfigIFrame = IDL.Variant({\n    Deny: IDL.Null,\n    AllowAny: IDL.Null,\n    SameOrigin: IDL.Null\n  });\n  const StorageConfigRawAccess = IDL.Variant({\n    Deny: IDL.Null,\n    Allow: IDL.Null\n  });\n  const StorageConfigRedirect = IDL.Record({\n    status_code: IDL.Nat16,\n    location: IDL.Text\n  });\n  const StorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    updated_at: IDL.Opt(IDL.Nat64),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const Config = IDL.Record({\n    db: IDL.Opt(DbConfig),\n    authentication: IDL.Opt(AuthenticationConfig),\n    storage: StorageConfig\n  });\n  const OpenIdGetDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n  const Delegation = IDL.Record({\n    pubkey: IDL.Vec(IDL.Nat8),\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    expiration: IDL.Nat64\n  });\n  const SignedDelegation = IDL.Record({\n    signature: IDL.Vec(IDL.Nat8),\n    delegation: Delegation\n  });\n  const GetDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    NoSuchDelegation: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const GetDelegationResultResponse = IDL.Variant({\n    Ok: SignedDelegation,\n    Err: GetDelegationError\n  });\n  const ProposalStatus = IDL.Variant({\n    Initialized: IDL.Null,\n    Failed: IDL.Null,\n    Open: IDL.Null,\n    Rejected: IDL.Null,\n    Executed: IDL.Null,\n    Accepted: IDL.Null\n  });\n  const AssetsUpgradeOptions = IDL.Record({\n    clear_existing_assets: IDL.Opt(IDL.Bool)\n  });\n  const SegmentsDeploymentOptions = IDL.Record({\n    orbiter: IDL.Opt(IDL.Text),\n    mission_control_version: IDL.Opt(IDL.Text),\n    satellite_version: IDL.Opt(IDL.Text)\n  });\n  const ProposalType = IDL.Variant({\n    AssetsUpgrade: AssetsUpgradeOptions,\n    SegmentsDeployment: SegmentsDeploymentOptions\n  });\n  const Proposal = IDL.Record({\n    status: ProposalStatus,\n    updated_at: IDL.Nat64,\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    executed_at: IDL.Opt(IDL.Nat64),\n    owner: IDL.Principal,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    proposal_type: ProposalType\n  });\n  const Permission = IDL.Variant({\n    Controllers: IDL.Null,\n    Private: IDL.Null,\n    Public: IDL.Null,\n    Managed: IDL.Null\n  });\n  const RateConfig = IDL.Record({\n    max_tokens: IDL.Nat64,\n    time_per_token_ns: IDL.Nat64\n  });\n  const Rule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    updated_at: IDL.Nat64,\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const StreamingCallbackToken = IDL.Record({\n    memory: Memory,\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], ['query'])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListResults = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n    items_length: IDL.Nat64\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const ListResults_1 = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),\n    items_length: IDL.Nat64\n  });\n  const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n  const ListProposalsPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Nat),\n    limit: IDL.Opt(IDL.Nat)\n  });\n  const ListProposalsParams = IDL.Record({\n    order: IDL.Opt(ListProposalsOrder),\n    paginate: IDL.Opt(ListProposalsPaginate)\n  });\n  const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n  const ListProposalResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n    items_length: IDL.Nat64\n  });\n  const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n  const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n  const ListRulesResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n    items_length: IDL.Nat64\n  });\n  const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n  const SetAuthenticationConfig = IDL.Record({\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetDbConfig = IDL.Record({\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n  });\n  const SetDoc = IDL.Record({\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const SetRule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const SetStorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const UploadChunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat,\n    order_id: IDL.Opt(IDL.Nat)\n  });\n  const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n    commit_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n    count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n    count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n    count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n    count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n    count_proposals: IDL.Func([], [IDL.Nat64], ['query']),\n    del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n    del_assets: IDL.Func([IDL.Text], [], []),\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n    del_docs: IDL.Func([IDL.Text], [], []),\n    del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),\n    del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),\n    del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),\n    del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n    del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n    delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n    get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n    get_config: IDL.Func([], [Config], []),\n    get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n    get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], ['query']),\n    get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n    get_many_assets: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n      ['query']\n    ),\n    get_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n      ['query']\n    ),\n    get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n    get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n    get_storage_config: IDL.Func([], [StorageConfig], ['query']),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      ['query']\n    ),\n    init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n    init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n    init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n    init_proposal_many_assets_upload: IDL.Func(\n      [IDL.Vec(InitAssetKey), IDL.Nat],\n      [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n      []\n    ),\n    list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n    list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),\n    list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n    list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),\n    memory_size: IDL.Func([], [MemorySize], ['query']),\n    reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n    set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n    set_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n      []\n    ),\n    set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n    set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n    submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n    switch_storage_system_memory: IDL.Func([], [], []),\n    upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n    upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n  const InitSatelliteArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs)\n  });\n  return [InitSatelliteArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n  const InitSatelliteArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs)\n  });\n  const OpenIdPrepareDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8)\n  });\n  const AuthenticationArgs = IDL.Variant({\n    OpenId: OpenIdPrepareDelegationArgs\n  });\n  const Doc = IDL.Record({\n    updated_at: IDL.Nat64,\n    owner: IDL.Principal,\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const PreparedDelegation = IDL.Record({\n    user_key: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const Authentication = IDL.Record({\n    doc: Doc,\n    delegation: PreparedDelegation\n  });\n  const JwtFindProviderError = IDL.Variant({\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoMatchingProvider: IDL.Null\n  });\n  const JwtVerifyError = IDL.Variant({\n    WrongKeyType: IDL.Null,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoKeyForKid: IDL.Null\n  });\n  const GetOrRefreshJwksError = IDL.Variant({\n    InvalidConfig: IDL.Text,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    KeyNotFoundCooldown: IDL.Null,\n    CertificateNotFound: IDL.Null,\n    BadSig: IDL.Text,\n    MissingLastAttempt: IDL.Text,\n    KeyNotFound: IDL.Null,\n    FetchFailed: IDL.Text\n  });\n  const PrepareDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const AuthenticationError = IDL.Variant({\n    PrepareDelegation: PrepareDelegationError,\n    RegisterUser: IDL.Text\n  });\n  const AuthenticateResultResponse = IDL.Variant({\n    Ok: Authentication,\n    Err: AuthenticationError\n  });\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const CommitProposal = IDL.Record({\n    sha256: IDL.Vec(IDL.Nat8),\n    proposal_id: IDL.Nat\n  });\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const TimestampMatcher = IDL.Variant({\n    Equal: IDL.Nat64,\n    Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),\n    GreaterThan: IDL.Nat64,\n    LessThan: IDL.Nat64\n  });\n  const ListMatcher = IDL.Record({\n    key: IDL.Opt(IDL.Text),\n    updated_at: IDL.Opt(TimestampMatcher),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Opt(TimestampMatcher)\n  });\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    owner: IDL.Opt(IDL.Principal),\n    matcher: IDL.Opt(ListMatcher),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelDoc = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const CollectionType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n  const DelRule = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const DeleteProposalAssets = IDL.Record({\n    proposal_ids: IDL.Vec(IDL.Nat)\n  });\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProvider = IDL.Variant({Google: IDL.Null});\n  const OpenIdProviderDelegationConfig = IDL.Record({\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    max_time_to_live: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProviderConfig = IDL.Record({\n    delegation: IDL.Opt(OpenIdProviderDelegationConfig),\n    client_id: IDL.Text\n  });\n  const AuthenticationConfigOpenId = IDL.Record({\n    observatory_id: IDL.Opt(IDL.Principal),\n    providers: IDL.Vec(IDL.Tuple(OpenIdProvider, OpenIdProviderConfig))\n  });\n  const AuthenticationConfigInternetIdentity = IDL.Record({\n    derivation_origin: IDL.Opt(IDL.Text),\n    external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))\n  });\n  const AuthenticationRules = IDL.Record({\n    allowed_callers: IDL.Vec(IDL.Principal)\n  });\n  const AuthenticationConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const ConfigMaxMemorySize = IDL.Record({\n    stable: IDL.Opt(IDL.Nat64),\n    heap: IDL.Opt(IDL.Nat64)\n  });\n  const DbConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n  });\n  const StorageConfigIFrame = IDL.Variant({\n    Deny: IDL.Null,\n    AllowAny: IDL.Null,\n    SameOrigin: IDL.Null\n  });\n  const StorageConfigRawAccess = IDL.Variant({\n    Deny: IDL.Null,\n    Allow: IDL.Null\n  });\n  const StorageConfigRedirect = IDL.Record({\n    status_code: IDL.Nat16,\n    location: IDL.Text\n  });\n  const StorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    updated_at: IDL.Opt(IDL.Nat64),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const Config = IDL.Record({\n    db: IDL.Opt(DbConfig),\n    authentication: IDL.Opt(AuthenticationConfig),\n    storage: StorageConfig\n  });\n  const OpenIdGetDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n  const Delegation = IDL.Record({\n    pubkey: IDL.Vec(IDL.Nat8),\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    expiration: IDL.Nat64\n  });\n  const SignedDelegation = IDL.Record({\n    signature: IDL.Vec(IDL.Nat8),\n    delegation: Delegation\n  });\n  const GetDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    NoSuchDelegation: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const GetDelegationResultResponse = IDL.Variant({\n    Ok: SignedDelegation,\n    Err: GetDelegationError\n  });\n  const ProposalStatus = IDL.Variant({\n    Initialized: IDL.Null,\n    Failed: IDL.Null,\n    Open: IDL.Null,\n    Rejected: IDL.Null,\n    Executed: IDL.Null,\n    Accepted: IDL.Null\n  });\n  const AssetsUpgradeOptions = IDL.Record({\n    clear_existing_assets: IDL.Opt(IDL.Bool)\n  });\n  const SegmentsDeploymentOptions = IDL.Record({\n    orbiter: IDL.Opt(IDL.Text),\n    mission_control_version: IDL.Opt(IDL.Text),\n    satellite_version: IDL.Opt(IDL.Text)\n  });\n  const ProposalType = IDL.Variant({\n    AssetsUpgrade: AssetsUpgradeOptions,\n    SegmentsDeployment: SegmentsDeploymentOptions\n  });\n  const Proposal = IDL.Record({\n    status: ProposalStatus,\n    updated_at: IDL.Nat64,\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    executed_at: IDL.Opt(IDL.Nat64),\n    owner: IDL.Principal,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    proposal_type: ProposalType\n  });\n  const Permission = IDL.Variant({\n    Controllers: IDL.Null,\n    Private: IDL.Null,\n    Public: IDL.Null,\n    Managed: IDL.Null\n  });\n  const RateConfig = IDL.Record({\n    max_tokens: IDL.Nat64,\n    time_per_token_ns: IDL.Nat64\n  });\n  const Rule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    updated_at: IDL.Nat64,\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const StreamingCallbackToken = IDL.Record({\n    memory: Memory,\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], [])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListResults = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n    items_length: IDL.Nat64\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const ListResults_1 = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),\n    items_length: IDL.Nat64\n  });\n  const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n  const ListProposalsPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Nat),\n    limit: IDL.Opt(IDL.Nat)\n  });\n  const ListProposalsParams = IDL.Record({\n    order: IDL.Opt(ListProposalsOrder),\n    paginate: IDL.Opt(ListProposalsPaginate)\n  });\n  const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n  const ListProposalResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n    items_length: IDL.Nat64\n  });\n  const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n  const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n  const ListRulesResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n    items_length: IDL.Nat64\n  });\n  const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n  const SetAuthenticationConfig = IDL.Record({\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetDbConfig = IDL.Record({\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n  });\n  const SetDoc = IDL.Record({\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const SetRule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const SetStorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const UploadChunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat,\n    order_id: IDL.Opt(IDL.Nat)\n  });\n  const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n    commit_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n    count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),\n    count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], []),\n    count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], []),\n    count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),\n    count_proposals: IDL.Func([], [IDL.Nat64], []),\n    del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n    del_assets: IDL.Func([IDL.Text], [], []),\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n    del_docs: IDL.Func([IDL.Text], [], []),\n    del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),\n    del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),\n    del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),\n    del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n    del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n    delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], []),\n    get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),\n    get_config: IDL.Func([], [Config], []),\n    get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], []),\n    get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], []),\n    get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], []),\n    get_many_assets: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n      []\n    ),\n    get_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n      []\n    ),\n    get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n    get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], []),\n    get_storage_config: IDL.Func([], [StorageConfig], []),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      []\n    ),\n    init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n    init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n    init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n    init_proposal_many_assets_upload: IDL.Func(\n      [IDL.Vec(InitAssetKey), IDL.Nat],\n      [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n      []\n    ),\n    list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n    list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], []),\n    list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n    list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], []),\n    memory_size: IDL.Func([], [MemorySize], []),\n    reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n    set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n    set_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n      []\n    ),\n    set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n    set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n    submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n    switch_storage_system_memory: IDL.Func([], [], []),\n    upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n    upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n  const InitSatelliteArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs)\n  });\n  return [InitSatelliteArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const Tokens = IDL.Record({e8s: IDL.Nat64});\n  const AssertMissionControlCenterArgs = IDL.Record({\n    mission_control_id: IDL.Principal,\n    user: IDL.Principal\n  });\n  const OpenIdPrepareDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8)\n  });\n  const AuthenticationArgs = IDL.Variant({\n    OpenId: OpenIdPrepareDelegationArgs\n  });\n  const PreparedDelegation = IDL.Record({\n    user_key: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const OpenIdProvider = IDL.Variant({Google: IDL.Null});\n  const OpenIdData = IDL.Record({\n    name: IDL.Opt(IDL.Text),\n    locale: IDL.Opt(IDL.Text),\n    family_name: IDL.Opt(IDL.Text),\n    email: IDL.Opt(IDL.Text),\n    picture: IDL.Opt(IDL.Text),\n    given_name: IDL.Opt(IDL.Text)\n  });\n  const OpenId = IDL.Record({\n    provider: OpenIdProvider,\n    data: OpenIdData\n  });\n  const Provider = IDL.Variant({\n    InternetIdentity: IDL.Null,\n    OpenId: OpenId\n  });\n  const MissionControl = IDL.Record({\n    updated_at: IDL.Nat64,\n    credits: Tokens,\n    mission_control_id: IDL.Opt(IDL.Principal),\n    provider: IDL.Opt(Provider),\n    owner: IDL.Principal,\n    created_at: IDL.Nat64\n  });\n  const Authentication = IDL.Record({\n    delegation: PreparedDelegation,\n    mission_control: MissionControl\n  });\n  const JwtFindProviderError = IDL.Variant({\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoMatchingProvider: IDL.Null\n  });\n  const JwtVerifyError = IDL.Variant({\n    WrongKeyType: IDL.Null,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoKeyForKid: IDL.Null\n  });\n  const GetOrRefreshJwksError = IDL.Variant({\n    InvalidConfig: IDL.Text,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    KeyNotFoundCooldown: IDL.Null,\n    CertificateNotFound: IDL.Null,\n    BadSig: IDL.Text,\n    MissingLastAttempt: IDL.Text,\n    KeyNotFound: IDL.Null,\n    FetchFailed: IDL.Text\n  });\n  const PrepareDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const AuthenticationError = IDL.Variant({\n    PrepareDelegation: PrepareDelegationError,\n    RegisterUser: IDL.Text\n  });\n  const Result = IDL.Variant({\n    Ok: Authentication,\n    Err: AuthenticationError\n  });\n  const CommitProposal = IDL.Record({\n    sha256: IDL.Vec(IDL.Nat8),\n    proposal_id: IDL.Nat\n  });\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const CreateCanisterArgs = IDL.Record({\n    block_index: IDL.Opt(IDL.Nat64),\n    subnet_id: IDL.Opt(IDL.Principal),\n    user: IDL.Principal\n  });\n  const InitStorageMemory = IDL.Variant({\n    Heap: IDL.Null,\n    Stable: IDL.Null\n  });\n  const InitStorageArgs = IDL.Record({\n    system_memory: IDL.Opt(InitStorageMemory)\n  });\n  const CreateSatelliteArgs = IDL.Record({\n    block_index: IDL.Opt(IDL.Nat64),\n    subnet_id: IDL.Opt(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs),\n    user: IDL.Principal\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const DeleteProposalAssets = IDL.Record({\n    proposal_ids: IDL.Vec(IDL.Nat)\n  });\n  const OpenIdProviderDelegationConfig = IDL.Record({\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    max_time_to_live: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProviderConfig = IDL.Record({\n    delegation: IDL.Opt(OpenIdProviderDelegationConfig),\n    client_id: IDL.Text\n  });\n  const AuthenticationConfigOpenId = IDL.Record({\n    observatory_id: IDL.Opt(IDL.Principal),\n    providers: IDL.Vec(IDL.Tuple(OpenIdProvider, OpenIdProviderConfig))\n  });\n  const AuthenticationConfigInternetIdentity = IDL.Record({\n    derivation_origin: IDL.Opt(IDL.Text),\n    external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))\n  });\n  const AuthenticationRules = IDL.Record({\n    allowed_callers: IDL.Vec(IDL.Principal)\n  });\n  const AuthenticationConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const StorageConfigIFrame = IDL.Variant({\n    Deny: IDL.Null,\n    AllowAny: IDL.Null,\n    SameOrigin: IDL.Null\n  });\n  const ConfigMaxMemorySize = IDL.Record({\n    stable: IDL.Opt(IDL.Nat64),\n    heap: IDL.Opt(IDL.Nat64)\n  });\n  const StorageConfigRawAccess = IDL.Variant({\n    Deny: IDL.Null,\n    Allow: IDL.Null\n  });\n  const StorageConfigRedirect = IDL.Record({\n    status_code: IDL.Nat16,\n    location: IDL.Text\n  });\n  const StorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    updated_at: IDL.Opt(IDL.Nat64),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const Config = IDL.Record({\n    authentication: IDL.Opt(AuthenticationConfig),\n    storage: StorageConfig\n  });\n  const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n  const OpenIdGetDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n  const Delegation = IDL.Record({\n    pubkey: IDL.Vec(IDL.Nat8),\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    expiration: IDL.Nat64\n  });\n  const SignedDelegation = IDL.Record({\n    signature: IDL.Vec(IDL.Nat8),\n    delegation: Delegation\n  });\n  const GetDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    NoSuchDelegation: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const Result_1 = IDL.Variant({\n    Ok: SignedDelegation,\n    Err: GetDelegationError\n  });\n  const ProposalStatus = IDL.Variant({\n    Initialized: IDL.Null,\n    Failed: IDL.Null,\n    Open: IDL.Null,\n    Rejected: IDL.Null,\n    Executed: IDL.Null,\n    Accepted: IDL.Null\n  });\n  const AssetsUpgradeOptions = IDL.Record({\n    clear_existing_assets: IDL.Opt(IDL.Bool)\n  });\n  const SegmentsDeploymentOptions = IDL.Record({\n    orbiter: IDL.Opt(IDL.Text),\n    mission_control_version: IDL.Opt(IDL.Text),\n    satellite_version: IDL.Opt(IDL.Text)\n  });\n  const ProposalType = IDL.Variant({\n    AssetsUpgrade: AssetsUpgradeOptions,\n    SegmentsDeployment: SegmentsDeploymentOptions\n  });\n  const Proposal = IDL.Record({\n    status: ProposalStatus,\n    updated_at: IDL.Nat64,\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    executed_at: IDL.Opt(IDL.Nat64),\n    owner: IDL.Principal,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    proposal_type: ProposalType\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const StreamingCallbackToken = IDL.Record({\n    memory: Memory,\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], ['query'])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const TimestampMatcher = IDL.Variant({\n    Equal: IDL.Nat64,\n    Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),\n    GreaterThan: IDL.Nat64,\n    LessThan: IDL.Nat64\n  });\n  const ListMatcher = IDL.Record({\n    key: IDL.Opt(IDL.Text),\n    updated_at: IDL.Opt(TimestampMatcher),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Opt(TimestampMatcher)\n  });\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    owner: IDL.Opt(IDL.Principal),\n    matcher: IDL.Opt(ListMatcher),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const ListResults = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n    items_length: IDL.Nat64\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const PaymentStatus = IDL.Variant({\n    Refunded: IDL.Null,\n    Acknowledged: IDL.Null,\n    Completed: IDL.Null\n  });\n  const Payment = IDL.Record({\n    status: PaymentStatus,\n    updated_at: IDL.Nat64,\n    block_index_payment: IDL.Nat64,\n    mission_control_id: IDL.Opt(IDL.Principal),\n    created_at: IDL.Nat64,\n    block_index_refunded: IDL.Opt(IDL.Nat64)\n  });\n  const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n  const ListProposalsPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Nat),\n    limit: IDL.Opt(IDL.Nat)\n  });\n  const ListProposalsParams = IDL.Record({\n    order: IDL.Opt(ListProposalsOrder),\n    paginate: IDL.Opt(ListProposalsPaginate)\n  });\n  const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n  const ListProposalResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n    items_length: IDL.Nat64\n  });\n  const SetAuthenticationConfig = IDL.Record({\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SegmentKind = IDL.Variant({\n    Orbiter: IDL.Null,\n    MissionControl: IDL.Null,\n    Satellite: IDL.Null\n  });\n  const SetStorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const RateConfig = IDL.Record({\n    max_tokens: IDL.Nat64,\n    time_per_token_ns: IDL.Nat64\n  });\n  const UploadChunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat,\n    order_id: IDL.Opt(IDL.Nat)\n  });\n  const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    add_credits: IDL.Func([IDL.Principal, Tokens], [], []),\n    add_invitation_code: IDL.Func([IDL.Text], [], []),\n    assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),\n    authenticate: IDL.Func([AuthenticationArgs], [Result], []),\n    commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n    count_proposals: IDL.Func([], [IDL.Nat64], ['query']),\n    create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n    create_satellite: IDL.Func([CreateSatelliteArgs], [IDL.Principal], []),\n    del_controllers: IDL.Func([DeleteControllersArgs], [], []),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n    get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n    get_config: IDL.Func([], [Config], ['query']),\n    get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),\n    get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),\n    get_credits: IDL.Func([], [Tokens], ['query']),\n    get_delegation: IDL.Func([GetDelegationArgs], [Result_1], ['query']),\n    get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n    get_storage_config: IDL.Func([], [StorageConfig], ['query']),\n    get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      ['query']\n    ),\n    init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n    init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n    init_proposal_many_assets_upload: IDL.Func(\n      [IDL.Vec(InitAssetKey), IDL.Nat],\n      [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n      []\n    ),\n    init_user_mission_control_center: IDL.Func([], [MissionControl], []),\n    list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n    list_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], ['query']),\n    list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n    list_user_mission_control_centers: IDL.Func(\n      [],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],\n      ['query']\n    ),\n    reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n    set_controllers: IDL.Func([SetControllersArgs], [], []),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_fee: IDL.Func([SegmentKind, Tokens], [], []),\n    set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n    submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n    update_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n    upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const Tokens = IDL.Record({e8s: IDL.Nat64});\n  const AssertMissionControlCenterArgs = IDL.Record({\n    mission_control_id: IDL.Principal,\n    user: IDL.Principal\n  });\n  const OpenIdPrepareDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8)\n  });\n  const AuthenticationArgs = IDL.Variant({\n    OpenId: OpenIdPrepareDelegationArgs\n  });\n  const PreparedDelegation = IDL.Record({\n    user_key: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const OpenIdProvider = IDL.Variant({Google: IDL.Null});\n  const OpenIdData = IDL.Record({\n    name: IDL.Opt(IDL.Text),\n    locale: IDL.Opt(IDL.Text),\n    family_name: IDL.Opt(IDL.Text),\n    email: IDL.Opt(IDL.Text),\n    picture: IDL.Opt(IDL.Text),\n    given_name: IDL.Opt(IDL.Text)\n  });\n  const OpenId = IDL.Record({\n    provider: OpenIdProvider,\n    data: OpenIdData\n  });\n  const Provider = IDL.Variant({\n    InternetIdentity: IDL.Null,\n    OpenId: OpenId\n  });\n  const MissionControl = IDL.Record({\n    updated_at: IDL.Nat64,\n    credits: Tokens,\n    mission_control_id: IDL.Opt(IDL.Principal),\n    provider: IDL.Opt(Provider),\n    owner: IDL.Principal,\n    created_at: IDL.Nat64\n  });\n  const Authentication = IDL.Record({\n    delegation: PreparedDelegation,\n    mission_control: MissionControl\n  });\n  const JwtFindProviderError = IDL.Variant({\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoMatchingProvider: IDL.Null\n  });\n  const JwtVerifyError = IDL.Variant({\n    WrongKeyType: IDL.Null,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoKeyForKid: IDL.Null\n  });\n  const GetOrRefreshJwksError = IDL.Variant({\n    InvalidConfig: IDL.Text,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    KeyNotFoundCooldown: IDL.Null,\n    CertificateNotFound: IDL.Null,\n    BadSig: IDL.Text,\n    MissingLastAttempt: IDL.Text,\n    KeyNotFound: IDL.Null,\n    FetchFailed: IDL.Text\n  });\n  const PrepareDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const AuthenticationError = IDL.Variant({\n    PrepareDelegation: PrepareDelegationError,\n    RegisterUser: IDL.Text\n  });\n  const Result = IDL.Variant({\n    Ok: Authentication,\n    Err: AuthenticationError\n  });\n  const CommitProposal = IDL.Record({\n    sha256: IDL.Vec(IDL.Nat8),\n    proposal_id: IDL.Nat\n  });\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const CreateCanisterArgs = IDL.Record({\n    block_index: IDL.Opt(IDL.Nat64),\n    subnet_id: IDL.Opt(IDL.Principal),\n    user: IDL.Principal\n  });\n  const InitStorageMemory = IDL.Variant({\n    Heap: IDL.Null,\n    Stable: IDL.Null\n  });\n  const InitStorageArgs = IDL.Record({\n    system_memory: IDL.Opt(InitStorageMemory)\n  });\n  const CreateSatelliteArgs = IDL.Record({\n    block_index: IDL.Opt(IDL.Nat64),\n    subnet_id: IDL.Opt(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs),\n    user: IDL.Principal\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const DeleteProposalAssets = IDL.Record({\n    proposal_ids: IDL.Vec(IDL.Nat)\n  });\n  const OpenIdProviderDelegationConfig = IDL.Record({\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    max_time_to_live: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProviderConfig = IDL.Record({\n    delegation: IDL.Opt(OpenIdProviderDelegationConfig),\n    client_id: IDL.Text\n  });\n  const AuthenticationConfigOpenId = IDL.Record({\n    observatory_id: IDL.Opt(IDL.Principal),\n    providers: IDL.Vec(IDL.Tuple(OpenIdProvider, OpenIdProviderConfig))\n  });\n  const AuthenticationConfigInternetIdentity = IDL.Record({\n    derivation_origin: IDL.Opt(IDL.Text),\n    external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))\n  });\n  const AuthenticationRules = IDL.Record({\n    allowed_callers: IDL.Vec(IDL.Principal)\n  });\n  const AuthenticationConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const StorageConfigIFrame = IDL.Variant({\n    Deny: IDL.Null,\n    AllowAny: IDL.Null,\n    SameOrigin: IDL.Null\n  });\n  const ConfigMaxMemorySize = IDL.Record({\n    stable: IDL.Opt(IDL.Nat64),\n    heap: IDL.Opt(IDL.Nat64)\n  });\n  const StorageConfigRawAccess = IDL.Variant({\n    Deny: IDL.Null,\n    Allow: IDL.Null\n  });\n  const StorageConfigRedirect = IDL.Record({\n    status_code: IDL.Nat16,\n    location: IDL.Text\n  });\n  const StorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    updated_at: IDL.Opt(IDL.Nat64),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const Config = IDL.Record({\n    authentication: IDL.Opt(AuthenticationConfig),\n    storage: StorageConfig\n  });\n  const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n  const OpenIdGetDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n  const Delegation = IDL.Record({\n    pubkey: IDL.Vec(IDL.Nat8),\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    expiration: IDL.Nat64\n  });\n  const SignedDelegation = IDL.Record({\n    signature: IDL.Vec(IDL.Nat8),\n    delegation: Delegation\n  });\n  const GetDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    NoSuchDelegation: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const Result_1 = IDL.Variant({\n    Ok: SignedDelegation,\n    Err: GetDelegationError\n  });\n  const ProposalStatus = IDL.Variant({\n    Initialized: IDL.Null,\n    Failed: IDL.Null,\n    Open: IDL.Null,\n    Rejected: IDL.Null,\n    Executed: IDL.Null,\n    Accepted: IDL.Null\n  });\n  const AssetsUpgradeOptions = IDL.Record({\n    clear_existing_assets: IDL.Opt(IDL.Bool)\n  });\n  const SegmentsDeploymentOptions = IDL.Record({\n    orbiter: IDL.Opt(IDL.Text),\n    mission_control_version: IDL.Opt(IDL.Text),\n    satellite_version: IDL.Opt(IDL.Text)\n  });\n  const ProposalType = IDL.Variant({\n    AssetsUpgrade: AssetsUpgradeOptions,\n    SegmentsDeployment: SegmentsDeploymentOptions\n  });\n  const Proposal = IDL.Record({\n    status: ProposalStatus,\n    updated_at: IDL.Nat64,\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    executed_at: IDL.Opt(IDL.Nat64),\n    owner: IDL.Principal,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    proposal_type: ProposalType\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const StreamingCallbackToken = IDL.Record({\n    memory: Memory,\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], [])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const TimestampMatcher = IDL.Variant({\n    Equal: IDL.Nat64,\n    Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),\n    GreaterThan: IDL.Nat64,\n    LessThan: IDL.Nat64\n  });\n  const ListMatcher = IDL.Record({\n    key: IDL.Opt(IDL.Text),\n    updated_at: IDL.Opt(TimestampMatcher),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Opt(TimestampMatcher)\n  });\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    owner: IDL.Opt(IDL.Principal),\n    matcher: IDL.Opt(ListMatcher),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const ListResults = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n    items_length: IDL.Nat64\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const PaymentStatus = IDL.Variant({\n    Refunded: IDL.Null,\n    Acknowledged: IDL.Null,\n    Completed: IDL.Null\n  });\n  const Payment = IDL.Record({\n    status: PaymentStatus,\n    updated_at: IDL.Nat64,\n    block_index_payment: IDL.Nat64,\n    mission_control_id: IDL.Opt(IDL.Principal),\n    created_at: IDL.Nat64,\n    block_index_refunded: IDL.Opt(IDL.Nat64)\n  });\n  const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n  const ListProposalsPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Nat),\n    limit: IDL.Opt(IDL.Nat)\n  });\n  const ListProposalsParams = IDL.Record({\n    order: IDL.Opt(ListProposalsOrder),\n    paginate: IDL.Opt(ListProposalsPaginate)\n  });\n  const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n  const ListProposalResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n    items_length: IDL.Nat64\n  });\n  const SetAuthenticationConfig = IDL.Record({\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SegmentKind = IDL.Variant({\n    Orbiter: IDL.Null,\n    MissionControl: IDL.Null,\n    Satellite: IDL.Null\n  });\n  const SetStorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const RateConfig = IDL.Record({\n    max_tokens: IDL.Nat64,\n    time_per_token_ns: IDL.Nat64\n  });\n  const UploadChunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat,\n    order_id: IDL.Opt(IDL.Nat)\n  });\n  const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    add_credits: IDL.Func([IDL.Principal, Tokens], [], []),\n    add_invitation_code: IDL.Func([IDL.Text], [], []),\n    assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], []),\n    authenticate: IDL.Func([AuthenticationArgs], [Result], []),\n    commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n    count_proposals: IDL.Func([], [IDL.Nat64], []),\n    create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n    create_satellite: IDL.Func([CreateSatelliteArgs], [IDL.Principal], []),\n    del_controllers: IDL.Func([DeleteControllersArgs], [], []),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n    get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),\n    get_config: IDL.Func([], [Config], []),\n    get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),\n    get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),\n    get_credits: IDL.Func([], [Tokens], []),\n    get_delegation: IDL.Func([GetDelegationArgs], [Result_1], []),\n    get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n    get_storage_config: IDL.Func([], [StorageConfig], []),\n    get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], []),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      []\n    ),\n    init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n    init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n    init_proposal_many_assets_upload: IDL.Func(\n      [IDL.Vec(InitAssetKey), IDL.Nat],\n      [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n      []\n    ),\n    init_user_mission_control_center: IDL.Func([], [MissionControl], []),\n    list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n    list_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], []),\n    list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n    list_user_mission_control_centers: IDL.Func(\n      [],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],\n      []\n    ),\n    reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n    set_controllers: IDL.Func([SetControllersArgs], [], []),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_fee: IDL.Func([SegmentKind, Tokens], [], []),\n    set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n    submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n    update_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n    upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n  const InitSatelliteArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs)\n  });\n  const OpenIdPrepareDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8)\n  });\n  const AuthenticationArgs = IDL.Variant({\n    OpenId: OpenIdPrepareDelegationArgs\n  });\n  const Doc = IDL.Record({\n    updated_at: IDL.Nat64,\n    owner: IDL.Principal,\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const PreparedDelegation = IDL.Record({\n    user_key: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const Authentication = IDL.Record({\n    doc: Doc,\n    delegation: PreparedDelegation\n  });\n  const JwtFindProviderError = IDL.Variant({\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoMatchingProvider: IDL.Null\n  });\n  const JwtVerifyError = IDL.Variant({\n    WrongKeyType: IDL.Null,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    BadSig: IDL.Text,\n    NoKeyForKid: IDL.Null\n  });\n  const GetOrRefreshJwksError = IDL.Variant({\n    InvalidConfig: IDL.Text,\n    MissingKid: IDL.Null,\n    BadClaim: IDL.Text,\n    KeyNotFoundCooldown: IDL.Null,\n    CertificateNotFound: IDL.Null,\n    BadSig: IDL.Text,\n    MissingLastAttempt: IDL.Text,\n    KeyNotFound: IDL.Null,\n    FetchFailed: IDL.Text\n  });\n  const PrepareDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const AuthenticationError = IDL.Variant({\n    PrepareDelegation: PrepareDelegationError,\n    RegisterUser: IDL.Text\n  });\n  const AuthenticateResultResponse = IDL.Variant({\n    Ok: Authentication,\n    Err: AuthenticationError\n  });\n  const CommitBatch = IDL.Record({\n    batch_id: IDL.Nat,\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    chunk_ids: IDL.Vec(IDL.Nat)\n  });\n  const CommitProposal = IDL.Record({\n    sha256: IDL.Vec(IDL.Nat8),\n    proposal_id: IDL.Nat\n  });\n  const ListOrderField = IDL.Variant({\n    UpdatedAt: IDL.Null,\n    Keys: IDL.Null,\n    CreatedAt: IDL.Null\n  });\n  const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n  const TimestampMatcher = IDL.Variant({\n    Equal: IDL.Nat64,\n    Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),\n    GreaterThan: IDL.Nat64,\n    LessThan: IDL.Nat64\n  });\n  const ListMatcher = IDL.Record({\n    key: IDL.Opt(IDL.Text),\n    updated_at: IDL.Opt(TimestampMatcher),\n    description: IDL.Opt(IDL.Text),\n    created_at: IDL.Opt(TimestampMatcher)\n  });\n  const ListPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Text),\n    limit: IDL.Opt(IDL.Nat64)\n  });\n  const ListParams = IDL.Record({\n    order: IDL.Opt(ListOrder),\n    owner: IDL.Opt(IDL.Principal),\n    matcher: IDL.Opt(ListMatcher),\n    paginate: IDL.Opt(ListPaginate)\n  });\n  const DeleteControllersArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const ControllerScope = IDL.Variant({\n    Write: IDL.Null,\n    Admin: IDL.Null,\n    Submit: IDL.Null\n  });\n  const Controller = IDL.Record({\n    updated_at: IDL.Nat64,\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const DelDoc = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const CollectionType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n  const DelRule = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n  const DeleteProposalAssets = IDL.Record({\n    proposal_ids: IDL.Vec(IDL.Nat)\n  });\n  const DepositCyclesArgs = IDL.Record({\n    cycles: IDL.Nat,\n    destination_id: IDL.Principal\n  });\n  const AssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    owner: IDL.Principal,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const AssetEncodingNoContent = IDL.Record({\n    modified: IDL.Nat64,\n    sha256: IDL.Vec(IDL.Nat8),\n    total_length: IDL.Nat\n  });\n  const AssetNoContent = IDL.Record({\n    key: AssetKey,\n    updated_at: IDL.Nat64,\n    encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProvider = IDL.Variant({Google: IDL.Null});\n  const OpenIdProviderDelegationConfig = IDL.Record({\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    max_time_to_live: IDL.Opt(IDL.Nat64)\n  });\n  const OpenIdProviderConfig = IDL.Record({\n    delegation: IDL.Opt(OpenIdProviderDelegationConfig),\n    client_id: IDL.Text\n  });\n  const AuthenticationConfigOpenId = IDL.Record({\n    observatory_id: IDL.Opt(IDL.Principal),\n    providers: IDL.Vec(IDL.Tuple(OpenIdProvider, OpenIdProviderConfig))\n  });\n  const AuthenticationConfigInternetIdentity = IDL.Record({\n    derivation_origin: IDL.Opt(IDL.Text),\n    external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))\n  });\n  const AuthenticationRules = IDL.Record({\n    allowed_callers: IDL.Vec(IDL.Principal)\n  });\n  const AuthenticationConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const ConfigMaxMemorySize = IDL.Record({\n    stable: IDL.Opt(IDL.Nat64),\n    heap: IDL.Opt(IDL.Nat64)\n  });\n  const DbConfig = IDL.Record({\n    updated_at: IDL.Opt(IDL.Nat64),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n  });\n  const StorageConfigIFrame = IDL.Variant({\n    Deny: IDL.Null,\n    AllowAny: IDL.Null,\n    SameOrigin: IDL.Null\n  });\n  const StorageConfigRawAccess = IDL.Variant({\n    Deny: IDL.Null,\n    Allow: IDL.Null\n  });\n  const StorageConfigRedirect = IDL.Record({\n    status_code: IDL.Nat16,\n    location: IDL.Text\n  });\n  const StorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    updated_at: IDL.Opt(IDL.Nat64),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    created_at: IDL.Opt(IDL.Nat64),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const Config = IDL.Record({\n    db: IDL.Opt(DbConfig),\n    authentication: IDL.Opt(AuthenticationConfig),\n    storage: StorageConfig\n  });\n  const OpenIdGetDelegationArgs = IDL.Record({\n    jwt: IDL.Text,\n    session_key: IDL.Vec(IDL.Nat8),\n    salt: IDL.Vec(IDL.Nat8),\n    expiration: IDL.Nat64\n  });\n  const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n  const Delegation = IDL.Record({\n    pubkey: IDL.Vec(IDL.Nat8),\n    targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n    expiration: IDL.Nat64\n  });\n  const SignedDelegation = IDL.Record({\n    signature: IDL.Vec(IDL.Nat8),\n    delegation: Delegation\n  });\n  const GetDelegationError = IDL.Variant({\n    JwtFindProvider: JwtFindProviderError,\n    GetCachedJwks: IDL.Null,\n    NoSuchDelegation: IDL.Null,\n    JwtVerify: JwtVerifyError,\n    GetOrFetchJwks: GetOrRefreshJwksError,\n    DeriveSeedFailed: IDL.Text\n  });\n  const GetDelegationResultResponse = IDL.Variant({\n    Ok: SignedDelegation,\n    Err: GetDelegationError\n  });\n  const ProposalStatus = IDL.Variant({\n    Initialized: IDL.Null,\n    Failed: IDL.Null,\n    Open: IDL.Null,\n    Rejected: IDL.Null,\n    Executed: IDL.Null,\n    Accepted: IDL.Null\n  });\n  const AssetsUpgradeOptions = IDL.Record({\n    clear_existing_assets: IDL.Opt(IDL.Bool)\n  });\n  const SegmentsDeploymentOptions = IDL.Record({\n    orbiter: IDL.Opt(IDL.Text),\n    mission_control_version: IDL.Opt(IDL.Text),\n    satellite_version: IDL.Opt(IDL.Text)\n  });\n  const ProposalType = IDL.Variant({\n    AssetsUpgrade: AssetsUpgradeOptions,\n    SegmentsDeployment: SegmentsDeploymentOptions\n  });\n  const Proposal = IDL.Record({\n    status: ProposalStatus,\n    updated_at: IDL.Nat64,\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    executed_at: IDL.Opt(IDL.Nat64),\n    owner: IDL.Principal,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    proposal_type: ProposalType\n  });\n  const Permission = IDL.Variant({\n    Controllers: IDL.Null,\n    Private: IDL.Null,\n    Public: IDL.Null,\n    Managed: IDL.Null\n  });\n  const RateConfig = IDL.Record({\n    max_tokens: IDL.Nat64,\n    time_per_token_ns: IDL.Nat64\n  });\n  const Rule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    updated_at: IDL.Nat64,\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const HttpRequest = IDL.Record({\n    url: IDL.Text,\n    method: IDL.Text,\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    certificate_version: IDL.Opt(IDL.Nat16)\n  });\n  const StreamingCallbackToken = IDL.Record({\n    memory: Memory,\n    token: IDL.Opt(IDL.Text),\n    sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    index: IDL.Nat64,\n    encoding_type: IDL.Text,\n    full_path: IDL.Text\n  });\n  const StreamingStrategy = IDL.Variant({\n    Callback: IDL.Record({\n      token: StreamingCallbackToken,\n      callback: IDL.Func([], [], ['query'])\n    })\n  });\n  const HttpResponse = IDL.Record({\n    body: IDL.Vec(IDL.Nat8),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    streaming_strategy: IDL.Opt(StreamingStrategy),\n    status_code: IDL.Nat16\n  });\n  const StreamingCallbackHttpResponse = IDL.Record({\n    token: IDL.Opt(StreamingCallbackToken),\n    body: IDL.Vec(IDL.Nat8)\n  });\n  const InitAssetKey = IDL.Record({\n    token: IDL.Opt(IDL.Text),\n    collection: IDL.Text,\n    name: IDL.Text,\n    description: IDL.Opt(IDL.Text),\n    encoding_type: IDL.Opt(IDL.Text),\n    full_path: IDL.Text\n  });\n  const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n  const ListResults = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n    items_length: IDL.Nat64\n  });\n  const CustomDomain = IDL.Record({\n    updated_at: IDL.Nat64,\n    created_at: IDL.Nat64,\n    version: IDL.Opt(IDL.Nat64),\n    bn_id: IDL.Opt(IDL.Text)\n  });\n  const ListResults_1 = IDL.Record({\n    matches_pages: IDL.Opt(IDL.Nat64),\n    matches_length: IDL.Nat64,\n    items_page: IDL.Opt(IDL.Nat64),\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),\n    items_length: IDL.Nat64\n  });\n  const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n  const ListProposalsPaginate = IDL.Record({\n    start_after: IDL.Opt(IDL.Nat),\n    limit: IDL.Opt(IDL.Nat)\n  });\n  const ListProposalsParams = IDL.Record({\n    order: IDL.Opt(ListProposalsOrder),\n    paginate: IDL.Opt(ListProposalsPaginate)\n  });\n  const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n  const ListProposalResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n    items_length: IDL.Nat64\n  });\n  const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n  const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n  const ListRulesResults = IDL.Record({\n    matches_length: IDL.Nat64,\n    items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n    items_length: IDL.Nat64\n  });\n  const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n  const SetAuthenticationConfig = IDL.Record({\n    openid: IDL.Opt(AuthenticationConfigOpenId),\n    version: IDL.Opt(IDL.Nat64),\n    internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n    rules: IDL.Opt(AuthenticationRules)\n  });\n  const SetController = IDL.Record({\n    metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    scope: ControllerScope,\n    expires_at: IDL.Opt(IDL.Nat64)\n  });\n  const SetControllersArgs = IDL.Record({\n    controller: SetController,\n    controllers: IDL.Vec(IDL.Principal)\n  });\n  const SetDbConfig = IDL.Record({\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n  });\n  const SetDoc = IDL.Record({\n    data: IDL.Vec(IDL.Nat8),\n    description: IDL.Opt(IDL.Text),\n    version: IDL.Opt(IDL.Nat64)\n  });\n  const SetRule = IDL.Record({\n    max_capacity: IDL.Opt(IDL.Nat32),\n    memory: IDL.Opt(Memory),\n    max_size: IDL.Opt(IDL.Nat),\n    read: Permission,\n    version: IDL.Opt(IDL.Nat64),\n    mutable_permissions: IDL.Opt(IDL.Bool),\n    rate_config: IDL.Opt(RateConfig),\n    write: Permission,\n    max_changes_per_user: IDL.Opt(IDL.Nat32)\n  });\n  const SetStorageConfig = IDL.Record({\n    iframe: IDL.Opt(StorageConfigIFrame),\n    rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n    headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n    version: IDL.Opt(IDL.Nat64),\n    max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n    raw_access: IDL.Opt(StorageConfigRawAccess),\n    redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n  });\n  const UploadChunk = IDL.Record({\n    content: IDL.Vec(IDL.Nat8),\n    batch_id: IDL.Nat,\n    order_id: IDL.Opt(IDL.Nat)\n  });\n  const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n  return IDL.Service({\n    authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n    commit_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n    commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n    count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n    count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n    count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n    count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n    count_proposals: IDL.Func([], [IDL.Nat64], ['query']),\n    del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n    del_assets: IDL.Func([IDL.Text], [], []),\n    del_controllers: IDL.Func(\n      [DeleteControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    del_custom_domain: IDL.Func([IDL.Text], [], []),\n    del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n    del_docs: IDL.Func([IDL.Text], [], []),\n    del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),\n    del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),\n    del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),\n    del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n    del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n    delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n    deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n    get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n    get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n    get_config: IDL.Func([], [Config], []),\n    get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n    get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], ['query']),\n    get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n    get_many_assets: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n      ['query']\n    ),\n    get_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n      ['query']\n    ),\n    get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n    get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n    get_storage_config: IDL.Func([], [StorageConfig], ['query']),\n    http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n    http_request_streaming_callback: IDL.Func(\n      [StreamingCallbackToken],\n      [StreamingCallbackHttpResponse],\n      ['query']\n    ),\n    init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n    init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n    init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n    init_proposal_many_assets_upload: IDL.Func(\n      [IDL.Vec(InitAssetKey), IDL.Nat],\n      [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n      []\n    ),\n    list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),\n    list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n    list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n    list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),\n    list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n    list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),\n    memory_size: IDL.Func([], [MemorySize], ['query']),\n    reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n    set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n    set_controllers: IDL.Func(\n      [SetControllersArgs],\n      [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n      []\n    ),\n    set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n    set_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n    set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n    set_many_docs: IDL.Func(\n      [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n      [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n      []\n    ),\n    set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n    set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n    submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n    switch_storage_system_memory: IDL.Func([], [], []),\n    upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n    upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n  });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n  const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n  const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n  const InitSatelliteArgs = IDL.Record({\n    controllers: IDL.Vec(IDL.Principal),\n    storage: IDL.Opt(InitStorageArgs)\n  });\n  return [InitSatelliteArgs];\n};\n", "import {nonNullish} from '@dfinity/utils';\nimport type {HttpAgent} from '@icp-sdk/core/agent';\nimport type {ActorParameters} from '../types/actor';\nimport {createAgent} from '../utils/agent.utils';\n\nexport const useOrInitAgent = async ({agent, ...rest}: ActorParameters): Promise<HttpAgent> =>\n  agent ?? (await initAgent(rest));\n\nconst initAgent = async ({\n  identity,\n  container\n}: Omit<ActorParameters, 'agent'>): Promise<HttpAgent> => {\n  const localActor = nonNullish(container) && container !== false;\n\n  const host = localActor\n    ? container === true\n      ? 'http://127.0.0.1:5987'\n      : container\n    : 'https://icp-api.io';\n\n  return await createAgent({\n    identity,\n    host,\n    localActor\n  });\n};\n", "import {HttpAgent} from '@icp-sdk/core/agent';\nimport type {ActorParameters} from '../types/actor';\n\n// We have this in a utils because we want to mock it for test purposes.\n// Not really happy with that, I welcome better ideas!\nexport const createAgent = async ({\n  identity,\n  host,\n  localActor\n}: Pick<ActorParameters, 'identity'> & {host: string; localActor: boolean}) =>\n  await HttpAgent.create({\n    identity,\n    host,\n    retryTimes: 10,\n    shouldFetchRootKey: localActor\n  });\n", "import {nonNullish} from '@dfinity/utils';\nimport {DOCKER_CONTAINER_URL} from '../constants/container.constants';\nimport {EnvStore} from '../stores/env.store';\nimport type {SatelliteContext} from '../types/satellite';\n\nexport const satelliteUrl = ({\n  satelliteId: customSatelliteId,\n  container: customContainer\n}: SatelliteContext): string => {\n  const {satelliteId} = customOrEnvSatelliteId({satelliteId: customSatelliteId});\n  const {container} = customOrEnvContainer({container: customContainer});\n\n  if (nonNullish(container) && container !== false) {\n    const {host: containerHost, protocol} = new URL(\n      container === true ? DOCKER_CONTAINER_URL : container\n    );\n    return `${protocol}//${satelliteId ?? 'unknown'}.${containerHost.replace('127.0.0.1', 'localhost')}`;\n  }\n\n  return `https://${satelliteId ?? 'unknown'}.icp0.io`;\n};\n\nexport const customOrEnvSatelliteId = ({\n  satelliteId\n}: Pick<SatelliteContext, 'satelliteId'>): Pick<SatelliteContext, 'satelliteId'> =>\n  nonNullish(satelliteId)\n    ? {satelliteId}\n    : (EnvStore.getInstance().get() ?? {satelliteId: undefined});\n\nexport const customOrEnvContainer = ({\n  container: customContainer\n}: Pick<SatelliteContext, 'container'>): Pick<SatelliteContext, 'container'> =>\n  nonNullish(customContainer)\n    ? {container: customContainer}\n    : (EnvStore.getInstance().get() ?? {container: undefined});\n", "import type {Environment} from '../types/env';\nimport {Store} from './_store';\n\nexport class EnvStore extends Store<Environment | undefined> {\n  private static instance: EnvStore;\n\n  private env: Environment | undefined | null;\n\n  private constructor() {\n    super();\n  }\n\n  static getInstance() {\n    if (!EnvStore.instance) {\n      EnvStore.instance = new EnvStore();\n    }\n    return EnvStore.instance;\n  }\n\n  set(env: Environment | undefined) {\n    this.env = env;\n\n    this.populate(env);\n  }\n\n  get(): Environment | undefined | null {\n    return this.env;\n  }\n\n  reset() {\n    this.env = null;\n  }\n\n  override subscribe(callback: (data: Environment | null | undefined) => void): () => void {\n    const unsubscribe: () => void = super.subscribe(callback);\n\n    callback(this.env);\n\n    return unsubscribe;\n  }\n}\n", "import {isNullish, toNullable} from '@dfinity/utils';\nimport {Principal} from '@icp-sdk/core/principal';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {ListError} from '../../auth/types/errors';\nimport type {ListParams, ListTimestampMatcher} from '../types/list';\n\nconst toListMatcherTimestamp = (\n  matcher?: ListTimestampMatcher\n): [] | [SatelliteDid.TimestampMatcher] => {\n  if (isNullish(matcher)) {\n    return toNullable();\n  }\n\n  switch (matcher.matcher) {\n    case 'equal':\n      return toNullable({Equal: matcher.timestamp});\n    case 'greaterThan':\n      return toNullable({GreaterThan: matcher.timestamp});\n    case 'lessThan':\n      return toNullable({LessThan: matcher.timestamp});\n    case 'between':\n      return toNullable({Between: [matcher.timestamps.start, matcher.timestamps.end]});\n    default:\n      throw new ListError('Invalid list matcher for timestamp', matcher);\n  }\n};\n\nexport const toListParams = ({\n  matcher,\n  paginate,\n  order,\n  owner\n}: ListParams): SatelliteDid.ListParams => ({\n  matcher: isNullish(matcher)\n    ? []\n    : [\n        {\n          key: toNullable(matcher.key),\n          description: toNullable(matcher.description),\n          created_at: toListMatcherTimestamp(matcher.createdAt),\n          updated_at: toListMatcherTimestamp(matcher.updatedAt)\n        }\n      ],\n  paginate: toNullable(\n    isNullish(paginate)\n      ? undefined\n      : {\n          start_after: toNullable(paginate.startAfter),\n          limit: toNullable(isNullish(paginate.limit) ? undefined : BigInt(paginate.limit))\n        }\n  ),\n  order: toNullable(\n    isNullish(order)\n      ? undefined\n      : {\n          desc: order.desc,\n          field:\n            order.field === 'created_at'\n              ? {CreatedAt: null}\n              : order.field === 'updated_at'\n                ? {UpdatedAt: null}\n                : {Keys: null}\n        }\n  ),\n  owner: toNullable(\n    isNullish(owner) ? undefined : typeof owner === 'string' ? Principal.fromText(owner) : owner\n  )\n});\n", "export class SignInError extends Error {}\nexport class SignInInitError extends Error {}\nexport class SignInUserInterruptError extends Error {}\nexport class SignInProviderNotSupportedError extends Error {}\nexport class SignInMissingClientIdError extends Error {}\n\nexport class WebAuthnSignInRetrievePublicKeyError extends Error {}\n\nexport class SignUpProviderNotSupportedError extends Error {}\n\nexport class InitError extends Error {}\n\nexport class ListError extends Error {}\n", "import {jsonReplacer, jsonReviver} from '@dfinity/utils';\n\n/**\n * Converts data to a Uint8Array for transmission or storage.\n * @template T\n * @param {T} data - The data to convert.\n * @returns {Promise<Uint8Array>} A promise that resolves to a Uint8Array representation of the data.\n */\nexport const toArray = async <T>(data: T): Promise<Uint8Array> => {\n  const blob: Blob = new Blob([JSON.stringify(data, jsonReplacer)], {\n    type: 'application/json; charset=utf-8'\n  });\n  return new Uint8Array(await blob.arrayBuffer());\n};\n\n/**\n * Converts a Uint8Array or number array back to the original data type.\n * @template T\n * @param {(Uint8Array | number[])} data - The array to convert.\n * @returns {Promise<T>} A promise that resolves to the original data.\n */\nexport const fromArray = async <T>(data: Uint8Array | number[]): Promise<T> => {\n  const blob: Blob = new Blob([data instanceof Uint8Array ? data : new Uint8Array(data)], {\n    type: 'application/json; charset=utf-8'\n  });\n  return JSON.parse(await blob.text(), jsonReviver);\n};\n", "/**\n * Checks if the current environment is a browser.\n * @returns {boolean} True if the current environment is a browser, false otherwise.\n */\nexport const isBrowser = (): boolean => typeof window !== `undefined`;\n", "import type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray} from '@junobuild/utils';\n\nexport const mapData = async <D>({data}: Pick<SatelliteDid.Doc, 'data'>): Promise<D> => {\n  try {\n    return await fromArray<D>(data);\n  } catch (err: unknown) {\n    console.error('The data parsing has failed, mapping to undefined as a fallback.', err);\n    return undefined as D;\n  }\n};\n", "import {fromNullable, toNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray, toArray} from '@junobuild/utils';\nimport type {ExcludeDate} from '../../core/types/utility';\nimport type {Doc} from '../types/doc';\n\nexport const toSetDoc = async <D>(doc: Doc<D>): Promise<SatelliteDid.SetDoc> => {\n  const {data, version, description} = doc;\n\n  return {\n    description: toNullable(description),\n    data: await toArray<ExcludeDate<D>>(data),\n    version: toNullable(version)\n  };\n};\n\nexport const toDelDoc = <D>(doc: Doc<D>): SatelliteDid.DelDoc => {\n  const {version} = doc;\n\n  return {\n    version: toNullable(version)\n  };\n};\n\nexport const fromDoc = async <D>({\n  doc,\n  key\n}: {\n  doc: SatelliteDid.Doc;\n  key: string;\n}): Promise<Doc<D>> => {\n  const {owner, version, description: docDescription, data, ...rest} = doc;\n\n  return {\n    key,\n    description: fromNullable(docDescription),\n    owner: owner.toText(),\n    data: await fromArray<ExcludeDate<D>>(data),\n    version: fromNullable(version),\n    ...rest\n  };\n};\n", "import {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/any-identity.services';\nimport type {ReadOptions} from '../../core/types/call-options';\nimport type {ListParams, ListResults} from '../../core/types/list';\nimport type {SatelliteOptions} from '../../core/types/satellite';\nimport {\n  countDocs as countDocsApi,\n  deleteDoc as deleteDocApi,\n  deleteFilteredDocs as deleteFilteredDocsApi,\n  deleteManyDocs as deleteManyDocsApi,\n  getDoc as getDocApi,\n  getManyDocs as getManyDocsApi,\n  listDocs as listDocsApi,\n  setDoc as setDocApi,\n  setManyDocs as setManyDocsApi\n} from '../api/doc.api';\nimport type {Doc} from '../types/doc';\n\n/**\n * Retrieves a single document from a collection.\n *\n * @template D\n * @param {Object} params - The parameters for retrieving the document.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.key - The key of the document to retrieve.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Doc<D> | undefined>} A promise that resolves to the document or undefined if not found.\n */\nexport const getDoc = async <D>({\n  satellite,\n  options,\n  ...rest\n}: {\n  collection: string;\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n} & Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await getDocApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n};\n\n/**\n * Retrieves multiple documents from a single or different collections in a single call.\n *\n * @param {Object} params - The parameters for retrieving the documents.\n * @param {Array} params.docs - The list of documents with their collections and keys.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<Doc<any> | undefined>>} A promise that resolves to an array of documents or undefined if not found.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const getManyDocs = async ({\n  satellite,\n  options,\n  ...rest\n}: {\n  docs: ({collection: string} & Pick<Doc<any>, 'key'>)[];\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n}): Promise<(Doc<any> | undefined)[]> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await getManyDocsApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n};\n/* eslint-enable */\n\n/**\n * Adds or updates a single document in a collection.\n *\n * @template D\n * @param {Object} params - The parameters for adding or updating the document.\n * @param {string} params.collection - The name of the collection.\n * @param {Doc<D>} params.doc - The document to add or update.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Doc<D>>} A promise that resolves to the added or updated document.\n */\nexport const setDoc = async <D>({\n  satellite,\n  ...rest\n}: {\n  collection: string;\n  doc: Doc<D>;\n  satellite?: SatelliteOptions;\n}): Promise<Doc<D>> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await setDocApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: {certified: true}\n  });\n};\n\n/**\n * Adds or updates multiple documents in a or different collections.\n *\n * @param {Object} params - The parameters for adding or updating the documents.\n * @param {Array} params.docs - The list of documents with their collections and data.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<Doc<any>>>} A promise that resolves to an array of added or updated documents.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const setManyDocs = async ({\n  satellite,\n  ...rest\n}: {\n  docs: {collection: string; doc: Doc<any>}[];\n  satellite?: SatelliteOptions;\n}): Promise<Doc<any>[]> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await setManyDocsApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: {certified: true}\n  });\n};\n/* eslint-enable */\n\n/**\n * Deletes a single document from a collection.\n *\n * @template D\n * @param {Object} params - The parameters for deleting the document.\n * @param {string} params.collection - The name of the collection.\n * @param {Doc<D>} params.doc - The document to delete.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the document is deleted.\n */\nexport const deleteDoc = async <D>({\n  satellite,\n  ...rest\n}: {\n  collection: string;\n  doc: Doc<D>;\n  satellite?: SatelliteOptions;\n}): Promise<void> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await deleteDocApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: {certified: true}\n  });\n};\n\n/**\n * Deletes multiple documents from a or different collections.\n *\n * @param {Object} params - The parameters for deleting the documents.\n * @param {Array} params.docs - The list of documents with their collections and data.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the documents are deleted.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const deleteManyDocs = async ({\n  satellite,\n  ...rest\n}: {\n  docs: {collection: string; doc: Doc<any>}[];\n  satellite?: SatelliteOptions;\n}): Promise<void> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await deleteManyDocsApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: {certified: true}\n  });\n};\n/* eslint-enable */\n\n/**\n * Deletes documents from a collection with optional filtering.\n *\n * @param {Object} params - The parameters for deleting documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter criteria to match documents for deletion.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the documents are deleted.\n */\nexport const deleteFilteredDocs = async ({\n  satellite,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter?: ListParams;\n  satellite?: SatelliteOptions;\n}): Promise<void> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await deleteFilteredDocsApi({\n    ...rest,\n    filter: filter ?? {},\n    satellite: {...satellite, identity},\n    options: {certified: true}\n  });\n};\n\n/**\n * Lists documents in a collection with optional filtering.\n *\n * @template D\n * @param {Object} params - The parameters for listing the documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - Optional filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<ListResults<Doc<D>>>} A promise that resolves to the list of documents.\n */\nexport const listDocs = async <D>({\n  satellite,\n  options,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter?: ListParams;\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n}): Promise<ListResults<Doc<D>>> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await listDocsApi<D>({\n    ...rest,\n    filter: filter ?? {},\n    satellite: {...satellite, identity},\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n};\n\n/**\n * Counts documents in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for counting the documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - Optional filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<bigint>} A promise that resolves to the count of documents as a bigint.\n */\nexport const countDocs = async ({\n  satellite,\n  options,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter?: ListParams;\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n}): Promise<bigint> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await countDocsApi({\n    ...rest,\n    filter: filter ?? {},\n    satellite: {...satellite, identity},\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n};\n", "import {AuthStore} from '../stores/auth.store';\nimport type {User} from '../types/user';\nimport {authenticateWithAuthClient} from './_auth-client.services';\nimport {loadUser} from './_user.services';\n\n/**\n * Initialize the authClient and load the existing user.\n * Executed when the library is initialized through initSatellite.\n */\nexport const loadAuth = async () => {\n  const init = async () => {\n    const {user} = await loadUser();\n    AuthStore.getInstance().set(user ?? null);\n  };\n\n  await authenticateWithAuthClient({fn: init});\n};\n\n/**\n * Initialize the authClient, load the user passed as parameter.\n * Executed on sign-up.\n */\nexport const loadAuthWithUser = async ({user}: {user: User}) => {\n  // eslint-disable-next-line require-await\n  const init = async () => {\n    AuthStore.getInstance().set(user);\n  };\n\n  await authenticateWithAuthClient({fn: init});\n};\n", "// TODO: duplicated because those should not be bundled in web worker. We can avoid this by transforming utils into a library of modules.\ninterface ImportMeta {\n  env: Record<string, string> | undefined;\n}\n\nexport const envSatelliteId = (): string | undefined => {\n  const viteEnvSatelliteId = (): string | undefined =>\n    typeof import.meta !== 'undefined' &&\n    typeof (import.meta as unknown as ImportMeta).env !== 'undefined'\n      ? ((import.meta as unknown as ImportMeta).env?.VITE_SATELLITE_ID ??\n        (import.meta as unknown as ImportMeta).env?.PUBLIC_SATELLITE_ID)\n      : undefined;\n\n  return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n    ? (process.env.NEXT_PUBLIC_SATELLITE_ID ?? viteEnvSatelliteId())\n    : viteEnvSatelliteId();\n};\n\nexport const envContainer = (): string | undefined => {\n  const viteEnvContainer = (): string | undefined =>\n    typeof import.meta !== 'undefined' &&\n    typeof (import.meta as unknown as ImportMeta).env !== 'undefined'\n      ? ((import.meta as unknown as ImportMeta).env?.VITE_CONTAINER ??\n        (import.meta as unknown as ImportMeta).env?.PUBLIC_CONTAINER)\n      : undefined;\n\n  return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n    ? (process.env.NEXT_PUBLIC_CONTAINER ?? viteEnvContainer())\n    : viteEnvContainer();\n};\n\nexport const envGoogleClientId = (): string | undefined => {\n  const viteEnvGoogleClientId = (): string | undefined =>\n    typeof import.meta !== 'undefined' &&\n    typeof (import.meta as unknown as ImportMeta).env !== 'undefined'\n      ? ((import.meta as unknown as ImportMeta).env?.VITE_GOOGLE_CLIENT_ID ??\n        (import.meta as unknown as ImportMeta).env?.PUBLIC_GOOGLE_CLIENT_ID)\n      : undefined;\n\n  return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n    ? (process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID ?? viteEnvGoogleClientId())\n    : viteEnvGoogleClientId();\n};\n", "import {isEmptyString, isNullish, nonNullish} from '@dfinity/utils';\nimport {\n  DOCKER_CONTAINER_URL,\n  DOCKER_INTERNET_IDENTITY_ID\n} from '../../core/constants/container.constants';\nimport {EnvStore} from '../../core/stores/env.store';\nimport {\n  IC0_APP,\n  ID_AI,\n  II_DESIGN_V1_POPUP,\n  II_DESIGN_V2_POPUP,\n  INTERNET_COMPUTER_ORG\n} from '../constants/auth.constants';\nimport type {AuthClientSignInOptions} from '../types/auth-client';\nimport type {InternetIdentityConfig, InternetIdentityDomain} from '../types/internet-identity';\nimport type {ProviderWithoutData} from '../types/provider';\nimport {popupCenter} from '../utils/window.utils';\nimport {AuthClientProvider, type AuthProviderSignInOptions} from './_auth-client.providers';\n\n/**\n * Internet Identity authentication provider.\n * @class InternetIdentityProvider\n */\nexport class InternetIdentityProvider extends AuthClientProvider {\n  #domain?: InternetIdentityDomain;\n\n  /**\n   * Creates an instance of InternetIdentityProvider.\n   * @param {InternetIdentityConfig} config - The configuration for Internet Identity.\n   */\n  constructor({domain}: InternetIdentityConfig) {\n    super();\n\n    this.#domain = domain;\n  }\n\n  /**\n   * Gets the identifier of the provider.\n   * @returns {Provider} The identifier of the provider - `internet_identity`.\n   */\n  override get id(): ProviderWithoutData {\n    return 'internet_identity';\n  }\n\n  /**\n   * Gets the sign-in options for Internet Identity.\n   * @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.\n   * @returns {AuthProviderSignInOptions} The sign-in options for Internet Identity.\n   */\n  override signInOptions({\n    windowed\n  }: Pick<AuthClientSignInOptions, 'windowed'>): AuthProviderSignInOptions {\n    const identityProviderUrl = (): string => {\n      const container = EnvStore.getInstance().get()?.container;\n\n      // Production\n      if (isNullish(container) || container === false) {\n        const identityV1Domain = [INTERNET_COMPUTER_ORG, IC0_APP].includes(\n          this.#domain ?? INTERNET_COMPUTER_ORG\n        );\n\n        if (isEmptyString(this.#domain)) {\n          return `https://identity.${INTERNET_COMPUTER_ORG}`;\n        }\n\n        if (identityV1Domain) {\n          return `https://identity.${this.#domain ?? INTERNET_COMPUTER_ORG}`;\n        }\n\n        return `https://${this.#domain}`;\n      }\n\n      const env = EnvStore.getInstance().get();\n\n      const internetIdentityId =\n        nonNullish(env) && nonNullish(env?.internetIdentityId)\n          ? env.internetIdentityId\n          : DOCKER_INTERNET_IDENTITY_ID;\n\n      const {host: containerHost, protocol} = new URL(\n        container === true ? DOCKER_CONTAINER_URL : container\n      );\n\n      return /apple/i.test(navigator?.vendor)\n        ? `${protocol}//${containerHost}?canisterId=${internetIdentityId}`\n        : `${protocol}//${internetIdentityId}.${containerHost.replace('127.0.0.1', 'localhost')}`;\n    };\n\n    const identityProvider = identityProviderUrl();\n\n    const iiDesignV2 = (): boolean => {\n      try {\n        const {hostname} = new URL(identityProvider);\n        return hostname.includes(ID_AI);\n      } catch {\n        return false;\n      }\n    };\n\n    return {\n      ...(windowed !== false && {\n        windowOpenerFeatures: popupCenter(iiDesignV2() ? II_DESIGN_V2_POPUP : II_DESIGN_V1_POPUP)\n      }),\n      identityProvider\n    };\n  }\n}\n", "// How long the delegation identity should remain valid?\n// e.g. BigInt(7 * 24 * 60 * 60 * 1000 * 1000 * 1000) = 7 days in nanoseconds\n// For Juno: 4 hours\nexport const DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS = 4 * 60 * 60 * 1000;\nexport const DELEGATION_IDENTITY_EXPIRATION = BigInt(\n  DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS * 1000 * 1000\n);\n\n// We consider PIN authentication as \"insecure\" because users can easily lose their PIN if they do not register a passphrase, especially since Safari clears the browser cache every two weeks in cases of inactivity.\n// That's why we disable it by default.\nexport const ALLOW_PIN_AUTHENTICATION = false;\n\ninterface PopupSize {\n  width: number;\n  height: number;\n}\n\nexport const II_DESIGN_V1_POPUP: PopupSize = {width: 576, height: 576};\nexport const II_DESIGN_V2_POPUP: PopupSize = {width: 424, height: 576};\nexport const NFID_POPUP: PopupSize = {width: 505, height: 705};\n\nexport const INTERNET_COMPUTER_ORG = 'internetcomputer.org';\nexport const IC0_APP = 'ic0.app';\nexport const ID_AI = 'id.ai';\n\n// Worker\nexport const AUTH_TIMER_INTERVAL = 1000;\n", "import {isNullish} from '@dfinity/utils';\nimport {isBrowser} from '@junobuild/utils';\n\nexport const popupCenter = ({\n  width,\n  height\n}: {\n  width: number;\n  height: number;\n}): string | undefined => {\n  if (!isBrowser()) {\n    return undefined;\n  }\n\n  if (isNullish(window) || isNullish(window.top)) {\n    return undefined;\n  }\n\n  const {\n    top: {innerWidth, innerHeight}\n  } = window;\n\n  const y = innerHeight / 2 + screenY - height / 2;\n  const x = innerWidth / 2 + screenX - width / 2;\n\n  return `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=${width}, height=${height}, top=${y}, left=${x}`;\n};\n", "import {isNullish} from '@dfinity/utils';\nimport {type AuthClient, ERROR_USER_INTERRUPT} from '@icp-sdk/auth/client';\nimport {\n  ALLOW_PIN_AUTHENTICATION,\n  DELEGATION_IDENTITY_EXPIRATION\n} from '../constants/auth.constants';\nimport {execute} from '../helpers/progress.helpers';\nimport {type AuthClientSignInOptions, AuthClientSignInProgressStep} from '../types/auth-client';\nimport {SignInError, SignInInitError, SignInUserInterruptError} from '../types/errors';\nimport type {ProviderWithoutData} from '../types/provider';\n\n/**\n * Options for signing in with an authentication provider.\n * @interface AuthProviderSignInOptions\n */\nexport interface AuthProviderSignInOptions {\n  /**\n   * The URL of the identity provider - commonly Internet Identity.\n   */\n  identityProvider: string;\n  /**\n   * Optional features for the window opener.\n   */\n  windowOpenerFeatures?: string;\n}\n\n/**\n * Abstract base class for all authentication providers that integrate with the `@icp-sdk/auth/client`.\n *\n * @abstract\n * @class AuthClientProvider\n */\nexport abstract class AuthClientProvider {\n  /**\n   * The unique identifier of the provider.\n   *\n   * @abstract\n   * @type {Provider}\n   */\n  abstract get id(): ProviderWithoutData;\n\n  /**\n   * Returns the sign-in options for the provider.\n   *\n   * Note: set as public instead of protected for testing purposes.\n   *\n   * @abstract\n   * @param {Pick<SignInOptions, 'windowed'>} options - Options controlling window behavior.\n   * @returns {AuthProviderSignInOptions} Provider-specific sign-in options.\n   */\n  abstract signInOptions(\n    options: Pick<AuthClientSignInOptions, 'windowed'>\n  ): AuthProviderSignInOptions;\n\n  /**\n   * Signs in a user with the given authentication provider.\n   *\n   * @param {Object} params - The sign-in parameters.\n   * @param {AuthClientSignInOptions} [params.options] - Optional configuration for the login request.\n   * @param {AuthClient | undefined | null} params.authClient - The AuthClient instance in its current state.\n   * @param {initAuth} params.initAuth - The function to load or initialize the user. Provided as a callback to avoid recursive import.\n   *\n   * @returns {Promise<void>} Resolves if the sign-in is successful. Rejects with:\n   * - {@link SignInInitError} if no AuthClient is available.\n   * - {@link SignInUserInterruptError} if the user cancels the login.\n   * - {@link SignInError} for other errors during sign-in.\n   */\n  async signIn({\n    options,\n    authClient,\n    initAuth\n  }: {\n    options?: AuthClientSignInOptions;\n    authClient: AuthClient | undefined | null;\n    initAuth: (params: {provider: ProviderWithoutData}) => Promise<void>;\n  }): Promise<void> {\n    // 1. Sign-in or sign-up with third party provider\n    const login = async () => await this.#loginWithAuthClient({options, authClient});\n\n    await execute({\n      fn: login,\n      step: AuthClientSignInProgressStep.AuthorizingWithProvider,\n      onProgress: options?.onProgress\n    });\n\n    // 2. Create or load the user for the authentication\n    const runAuth = async () => await initAuth({provider: this.id});\n\n    await execute({\n      fn: runAuth,\n      step: AuthClientSignInProgressStep.CreatingOrRetrievingUser,\n      onProgress: options?.onProgress\n    });\n  }\n\n  #loginWithAuthClient({\n    options,\n    authClient\n  }: {\n    options?: Omit<AuthClientSignInOptions, 'onProgress'>;\n    authClient: AuthClient | undefined | null;\n  }): Promise<void> {\n    /* eslint-disable no-async-promise-executor */\n    return new Promise<void>(async (resolve, reject) => {\n      if (isNullish(authClient)) {\n        reject(\n          new SignInInitError(\n            'No client is ready to perform a sign-in. Have you initialized the Satellite?'\n          )\n        );\n        return;\n      }\n\n      await authClient.login({\n        onSuccess: resolve,\n        onError: (error?: string) => {\n          if (error === ERROR_USER_INTERRUPT) {\n            reject(new SignInUserInterruptError(error));\n            return;\n          }\n\n          reject(new SignInError(error));\n        },\n        maxTimeToLive: options?.maxTimeToLiveInNanoseconds ?? DELEGATION_IDENTITY_EXPIRATION,\n        allowPinAuthentication: options?.allowPin ?? ALLOW_PIN_AUTHENTICATION,\n        ...(options?.derivationOrigin !== undefined && {\n          derivationOrigin: options.derivationOrigin\n        }),\n        ...this.signInOptions({\n          windowed: options?.windowed\n        })\n      });\n    });\n  }\n}\n", "import type {SignProgressFn} from '../types/progress';\n\nexport const execute = async <T, Step>({\n  fn,\n  step,\n  onProgress\n}: {\n  fn: () => Promise<T>;\n  step: Step;\n  onProgress?: SignProgressFn<Step>;\n}): Promise<T> => {\n  onProgress?.({\n    step,\n    state: 'in_progress'\n  });\n\n  try {\n    const result = await fn();\n\n    onProgress?.({\n      step,\n      state: 'success'\n    });\n\n    return result;\n  } catch (err: unknown) {\n    onProgress?.({\n      step,\n      state: 'error'\n    });\n\n    throw err;\n  }\n};\n", "import type {SignProgressFn} from './progress';\n\n/**\n * Enum representing the different steps of the sign-in flow with Internet Identity or NFID.\n */\nexport enum AuthClientSignInProgressStep {\n  /** User is authenticating with the identity provider (II / NFID). */\n  AuthorizingWithProvider,\n  /** App is creating a new user or retrieving an existing one after authorization. */\n  CreatingOrRetrievingUser\n}\n\n/**\n * Interface representing sign-in options when using an AuthClient based provider.\n * @interface AuthClientSignInOptions\n */\nexport interface AuthClientSignInOptions {\n  /**\n   * Maximum time to live for the session in nanoseconds. Cannot be extended.\n   * @type {bigint}\n   */\n  maxTimeToLiveInNanoseconds?: bigint;\n\n  /**\n   * Origin for derivation. Useful when sign-in using the same domain - e.g. sign-in on www.hello.com for hello.com.\n   * @type {(string | URL)}\n   */\n  derivationOrigin?: string | URL;\n\n  /**\n   * Whether to open the sign-in window.\n   * @default true\n   * @type {boolean}\n   */\n  windowed?: boolean;\n\n  /**\n   * Whether to allow the infamous PIN authentication.\n   * @default false\n   * @type {boolean}\n   */\n  allowPin?: boolean;\n\n  /**\n   * Optional callback to receive progress updates about the sign-in flow.\n   * Useful for showing UI feedback such as loading indicators or status messages.\n   */\n  onProgress?: SignProgressFn<AuthClientSignInProgressStep>;\n}\n", "import {isNullish} from '@dfinity/utils';\nimport {authenticate} from '@junobuild/auth';\nimport {EnvStore} from '../../core/stores/env.store';\nimport {fromDoc} from '../../datastore/utils/doc.utils';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {SignInInitError} from '../types/errors';\nimport type {UserData} from '../types/user';\nimport {loadAuthWithUser} from './load.services';\n\nexport const handleRedirectCallback = async () => {\n  const {satelliteId} = EnvStore.getInstance().get() ?? {satelliteId: undefined};\n\n  if (isNullish(satelliteId)) {\n    throw new SignInInitError('Satellite ID not set. Have you initialized the Satellite?');\n  }\n\n  const container = EnvStore.getInstance().get()?.container;\n\n  const {\n    identity: {delegationChain, sessionKey, identity},\n    data: {doc}\n  } = await authenticate({\n    redirect: null,\n    auth: {\n      satellite: {\n        satelliteId,\n        container\n      }\n    }\n  });\n\n  // Set up the delegation and session key for the AuthClient\n  await AuthClientStore.getInstance().setAuthClientStorage({\n    delegationChain,\n    sessionKey\n  });\n\n  // Create the AuthClient, load the identity and set the user in store\n  const user = await fromDoc<UserData>({doc, key: identity.getPrincipal().toText()});\n  await loadAuthWithUser({user});\n};\n", "export class InvalidUrlError extends Error {}\nexport class ContextUndefinedError extends Error {}\n\nexport class FedCMIdentityCredentialUndefinedError extends Error {}\nexport class FedCMIdentityCredentialInvalidError extends Error {}\n\nexport class AuthenticationError extends Error {}\nexport class AuthenticationUrlHashError extends Error {}\nexport class AuthenticationInvalidStateError extends Error {}\nexport class AuthenticationUndefinedJwtError extends Error {}\n\nexport class GetDelegationError extends Error {}\nexport class GetDelegationRetryError extends Error {}\n", "import {fromNullable} from '@dfinity/utils';\nimport type {Signature} from '@icp-sdk/core/agent';\nimport {Delegation, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport {authenticate as authenticateApi, getDelegation as getDelegationApi} from './api/auth.api';\nimport {AuthenticationError, GetDelegationError, GetDelegationRetryError} from './errors';\nimport type {AuthenticationData, GetDelegationArgs, SignedDelegation} from './types/actor';\nimport type {AuthenticatedSession, AuthParameters} from './types/authenticate';\nimport type {OpenIdAuthContext} from './types/context';\nimport type {Delegations} from './types/session';\nimport {generateIdentity} from './utils/session.utils';\n\ninterface AuthContext {\n  context: Omit<OpenIdAuthContext, 'state'>;\n  auth: AuthParameters;\n}\ntype AuthenticationArgs = {jwt: string} & AuthContext;\n\nexport const authenticateSession = async <T extends AuthParameters>({\n  jwt,\n  context,\n  auth\n}: AuthenticationArgs): Promise<AuthenticatedSession<T>> => {\n  const sessionKey = await ECDSAKeyIdentity.generate({extractable: false});\n\n  const publicKey = new Uint8Array(sessionKey.getPublicKey().toDer());\n\n  const {delegations, data} = await authenticate<T>({\n    jwt,\n    publicKey,\n    context,\n    auth\n  });\n\n  const identity = generateIdentity({\n    sessionKey,\n    delegations\n  });\n\n  return {identity, data};\n};\n\nconst authenticate = async <T extends AuthParameters>({\n  jwt,\n  publicKey,\n  context: {caller, salt},\n  auth\n}: {\n  publicKey: Uint8Array;\n} & AuthenticationArgs): Promise<{delegations: Delegations; data: AuthenticationData<T>}> => {\n  const result = await authenticateApi({\n    args: {\n      OpenId: {\n        jwt,\n        session_key: publicKey,\n        salt\n      }\n    },\n    actorParams: {\n      auth,\n      identity: caller\n    }\n  });\n\n  if ('Err' in result) {\n    throw new AuthenticationError('Authentication failed', {cause: result});\n  }\n\n  const {\n    delegation: {user_key: userKey, expiration},\n    ...rest\n  } = result.Ok;\n\n  const signedDelegation = await retryGetDelegation({\n    jwt,\n    context: {caller, salt},\n    auth,\n    publicKey,\n    expiration\n  });\n\n  const {delegation, signature} = signedDelegation;\n  const {pubkey, expiration: signedExpiration, targets} = delegation;\n\n  const delegations: Delegations = [\n    userKey,\n    [\n      {\n        delegation: new Delegation(\n          Uint8Array.from(pubkey),\n          signedExpiration,\n          fromNullable(targets)\n        ),\n        signature: Uint8Array.from(signature) as unknown as Signature\n      }\n    ]\n  ];\n\n  return {delegations, data: rest as AuthenticationData<T>};\n};\n\nconst retryGetDelegation = async ({\n  jwt,\n  publicKey,\n  context: {salt, caller},\n  auth,\n  expiration,\n  maxRetries = 5\n}: {\n  publicKey: Uint8Array;\n  expiration: bigint;\n  maxRetries?: number;\n} & AuthenticationArgs): Promise<SignedDelegation> => {\n  for (let i = 0; i < maxRetries; i++) {\n    // Linear backoff\n    await new Promise((resolve) => {\n      setInterval(resolve, 1000 * i);\n    });\n\n    const args: GetDelegationArgs = {\n      OpenId: {\n        jwt,\n        session_key: publicKey,\n        salt,\n        expiration\n      }\n    };\n\n    const result = await getDelegationApi({\n      args,\n      actorParams: {\n        auth,\n        identity: caller\n      }\n    });\n\n    if ('Err' in result) {\n      const {Err} = result;\n\n      if ('NoSuchDelegation' in Err) {\n        // eslint-disable-next-line no-continue\n        continue;\n      }\n\n      if ('GetCachedJwks' in Err) {\n        // eslint-disable-next-line no-continue\n        continue;\n      }\n\n      throw new GetDelegationError('Getting delegation failed', {cause: result});\n    }\n\n    return result.Ok;\n  }\n\n  throw new GetDelegationRetryError();\n};\n", "import {\n  type ConsoleActor,\n  type SatelliteActor,\n  getConsoleActor,\n  getSatelliteActor\n} from '@junobuild/ic-client/actor';\nimport type {ActorParameters} from '../types/actor';\n\nexport const getAuthActor = ({\n  auth,\n  identity\n}: ActorParameters): Promise<ConsoleActor | SatelliteActor> =>\n  'satellite' in auth\n    ? getSatelliteActor({...auth.satellite, identity})\n    : getConsoleActor({...auth.console, identity});\n", "import type {\n  ActorParameters,\n  AuthenticationArgs,\n  AuthenticationResult,\n  GetDelegationArgs,\n  GetDelegationResult\n} from '../types/actor';\nimport {getAuthActor} from './_actor.api';\n\nexport const authenticate = async ({\n  actorParams,\n  args\n}: {\n  args: AuthenticationArgs;\n  actorParams: ActorParameters;\n}): Promise<AuthenticationResult> => {\n  const {authenticate} = await getAuthActor(actorParams);\n  return await authenticate(args);\n};\n\nexport const getDelegation = async ({\n  actorParams,\n  args\n}: {\n  args: GetDelegationArgs;\n  actorParams: ActorParameters;\n}): Promise<GetDelegationResult> => {\n  const {get_delegation} = await getAuthActor(actorParams);\n  return await get_delegation(args);\n};\n", "import {DelegationChain, DelegationIdentity, type ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport type {AuthenticatedIdentity} from '../types/authenticate';\nimport type {Delegations} from '../types/session';\n\nexport const generateIdentity = ({\n  delegations,\n  sessionKey\n}: {\n  delegations: Delegations;\n  sessionKey: ECDSAKeyIdentity;\n}): AuthenticatedIdentity => {\n  const [userKey, signedDelegations] = delegations;\n\n  const delegationChain = DelegationChain.fromDelegations(\n    signedDelegations,\n    Uint8Array.from(userKey)\n  );\n\n  const identity = DelegationIdentity.fromDelegation(sessionKey, delegationChain);\n\n  return {identity, delegationChain, sessionKey};\n};\n", "import type {OpenIdProvider} from './types/provider';\n\nexport const CONTEXT_KEY = 'juno:auth:openid';\n\n// Create client_id: https://developers.google.com/identity/openid-connect/openid-connect#authenticationuriparameters\nexport const GOOGLE_PROVIDER: Omit<OpenIdProvider, 'clientId' | 'redirectUrl'> = {\n  authUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n  authScopes: ['openid', 'profile', 'email'],\n  configUrl: 'https://accounts.google.com/gsi/fedcm.json'\n};\n", "import {isNullish} from '@dfinity/utils';\nimport {Ed25519KeyIdentity} from '@icp-sdk/core/identity';\nimport {CONTEXT_KEY} from './_constants';\nimport {ContextUndefinedError} from './errors';\nimport type {OpenIdAuthContext} from './types/context';\nimport type {Nonce} from './types/nonce';\nimport {generateNonce} from './utils/auth.utils';\nimport {parseContext, stringifyContext} from './utils/session-storage.utils';\nimport {generateRandomState} from './utils/state.utils';\n\nexport const initContext = async (): Promise<{nonce: Nonce} & Pick<OpenIdAuthContext, 'state'>> => {\n  const caller = Ed25519KeyIdentity.generate();\n  const {nonce, salt} = await generateNonce({caller});\n  const state = generateRandomState();\n\n  const storedData = stringifyContext({\n    caller,\n    salt,\n    state\n  });\n\n  sessionStorage.setItem(CONTEXT_KEY, storedData);\n\n  return {\n    nonce,\n    state\n  };\n};\n\nexport const loadContext = (): OpenIdAuthContext => {\n  const storedContext = sessionStorage.getItem(CONTEXT_KEY);\n\n  if (isNullish(storedContext)) {\n    throw new ContextUndefinedError();\n  }\n\n  return parseContext(storedContext);\n};\n", "import {arrayBufferToUint8Array} from '@dfinity/utils';\nimport type {Ed25519KeyIdentity} from '@icp-sdk/core/identity';\nimport type {Nonce, Salt} from '../types/nonce';\nimport {toBase64URL} from './url.utils';\n\nconst generateSalt = (): Salt => window.crypto.getRandomValues(new Uint8Array(32));\n\nconst buildNonce = async ({salt, caller}: {salt: Salt; caller: Ed25519KeyIdentity}) => {\n  const principal = caller.getPrincipal().toUint8Array();\n\n  const bytes = new Uint8Array(salt.length + principal.byteLength);\n  bytes.set(salt);\n  bytes.set(principal, salt.length);\n\n  const hash = await window.crypto.subtle.digest('SHA-256', bytes);\n\n  return toBase64URL(arrayBufferToUint8Array(hash));\n};\n\nexport const generateNonce = async ({\n  caller\n}: {\n  caller: Ed25519KeyIdentity;\n}): Promise<{nonce: Nonce; salt: Salt}> => {\n  const salt = generateSalt();\n  const nonce = await buildNonce({salt, caller});\n\n  return {nonce, salt};\n};\n", "import {uint8ArrayToBase64} from '@dfinity/utils';\n\n// In the future: uint8Array.toBase64({ alphabet: \"base64url\" })\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64\nexport const toBase64URL = (uint8Array: Uint8Array): string =>\n  uint8ArrayToBase64(uint8Array).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n", "import {base64ToUint8Array, uint8ArrayToBase64} from '@dfinity/utils';\nimport {Ed25519KeyIdentity, type JsonnableEd25519KeyIdentity} from '@icp-sdk/core/identity';\nimport type {OpenIdAuthContext} from '../types/context';\n\nconst JSON_KEY_CALLER = '__caller__';\nconst JSON_KEY_SALT = '__salt__';\nconst JSON_KEY_STATE = '__state__';\n\ninterface StoredContext {\n  [JSON_KEY_CALLER]: JsonnableEd25519KeyIdentity;\n  [JSON_KEY_SALT]: string;\n  [JSON_KEY_STATE]: string;\n}\n\nexport const stringifyContext = ({caller, state, salt}: OpenIdAuthContext): string => {\n  const data: StoredContext = {\n    [JSON_KEY_CALLER]: caller.toJSON(),\n    [JSON_KEY_SALT]: uint8ArrayToBase64(salt),\n    [JSON_KEY_STATE]: state\n  };\n\n  return JSON.stringify(data);\n};\n\nexport const parseContext = (jsonData: string): OpenIdAuthContext => {\n  const {\n    [JSON_KEY_CALLER]: jsonCaller,\n    [JSON_KEY_SALT]: jsonSalt,\n    [JSON_KEY_STATE]: state\n  }: StoredContext = JSON.parse(jsonData);\n\n  return {\n    caller: Ed25519KeyIdentity.fromParsedJson(jsonCaller),\n    salt: base64ToUint8Array(jsonSalt),\n    state\n  };\n};\n", "import {toBase64URL} from './url.utils';\n\nexport const generateRandomState = (): string =>\n  toBase64URL(window.crypto.getRandomValues(new Uint8Array(12)));\n", "import {isEmptyString} from '@dfinity/utils';\nimport {loadContext} from './_context';\nimport {authenticateSession} from './_session';\nimport {\n  AuthenticationInvalidStateError,\n  AuthenticationUndefinedJwtError,\n  AuthenticationUrlHashError\n} from './errors';\nimport type {\n  AuthenticatedSession,\n  AuthenticationParams,\n  AuthParameters\n} from './types/authenticate';\nimport type {OpenIdAuthContext} from './types/context';\n\nexport const authenticate = async <T extends AuthParameters>(\n  params: AuthenticationParams<T>\n): Promise<AuthenticatedSession<T>> => {\n  const context = loadContext();\n\n  if ('credentials' in params) {\n    const {\n      credentials: {jwt},\n      auth\n    } = params;\n\n    return await authenticateSession({\n      jwt,\n      context,\n      auth\n    });\n  }\n\n  return await authenticateWithRedirect<T>({...params, context});\n};\n\nconst authenticateWithRedirect = async <T extends AuthParameters>({\n  auth,\n  context\n}: {\n  auth: AuthParameters;\n  context: OpenIdAuthContext;\n}): Promise<AuthenticatedSession<T>> => {\n  const {\n    location: {hash}\n  } = window;\n\n  if (isEmptyString(hash) || !hash.startsWith('#')) {\n    throw new AuthenticationUrlHashError('No hash found in the current location URL');\n  }\n\n  const params = new URLSearchParams(hash.slice(1));\n  const state = params.get('state');\n  const idToken = params.get('id_token');\n\n  const {state: savedState} = context;\n\n  if (isEmptyString(savedState) || state !== savedState) {\n    throw new AuthenticationInvalidStateError('The provided state is invalid', {cause: state});\n  }\n\n  // id_token === jwt\n  if (isEmptyString(idToken)) {\n    throw new AuthenticationUndefinedJwtError();\n  }\n\n  return await authenticateSession({\n    jwt: idToken,\n    auth,\n    context\n  });\n};\n", "import {isNullish, notEmptyString} from '@dfinity/utils';\nimport {\n  FedCMIdentityCredentialInvalidError,\n  FedCMIdentityCredentialUndefinedError,\n  InvalidUrlError\n} from './errors';\nimport type {RequestJwtWithCredentials, RequestJwtWithRedirect} from './types/openid';\n\n/**\n * Initiates an OpenID Connect authorization request by redirecting the browser.\n *\n *  References:\n *  - OAuth 2.0 (Google): https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow\n *  - OpenID Connect: https://developers.google.com/identity/openid-connect/openid-connect\n */\nexport const requestJwtWithRedirect = ({\n  authUrl,\n  clientId,\n  nonce,\n  loginHint,\n  authScopes,\n  state,\n  redirectUrl\n}: RequestJwtWithRedirect) => {\n  const parseAuthUrl = (): URL => {\n    try {\n      // Use the URL constructor, for backwards compatibility with older Android/WebView.\n      return new URL(authUrl);\n    } catch (_error: unknown) {\n      throw new InvalidUrlError('Cannot parse authURL', {cause: authUrl});\n    }\n  };\n\n  const requestUrl = parseAuthUrl();\n\n  requestUrl.searchParams.set('client_id', clientId);\n\n  const {\n    location: {origin: currentUrl}\n  } = window;\n\n  requestUrl.searchParams.set('redirect_uri', redirectUrl ?? currentUrl);\n\n  // We do not request \"token\" because we use the ID token (JWT).\n  // \"code\" is required according to II's codebase as Apple ID throws an error otherwise.\n  requestUrl.searchParams.set('response_type', 'code id_token');\n\n  requestUrl.searchParams.set('scope', authScopes.join(' '));\n\n  // Used for security reasons. When the provider redirects to the application,\n  // the state will be compared with the session storage value.\n  requestUrl.searchParams.set('state', state);\n\n  // Used to validate the JSON Web Token (JWT) in the backend \u2014 i.e. we pass the nonce\n  // to the provider and make the request to the backend with its salt.\n  requestUrl.searchParams.set('nonce', nonce);\n\n  if (notEmptyString(loginHint)) {\n    requestUrl.searchParams.set('login_hint', loginHint);\n  } else {\n    requestUrl.searchParams.set('prompt', 'select_account');\n  }\n\n  window.location.href = requestUrl.toString();\n};\n\n/**\n * References:\n * - identity spec: https://www.w3.org/TR/fedcm/#browser-api-credential-request-options\n * - https://privacysandbox.google.com/cookies/fedcm/implement/identity-provider\n * - https://privacysandbox.google.com/cookies/fedcm/why\n */\nexport const requestWithCredentials = async ({\n  configUrl: configURL,\n  clientId,\n  nonce,\n  loginHint,\n  domainHint\n}: RequestJwtWithCredentials): Promise<{jwt: string}> => {\n  const identityCredential = await navigator.credentials.get({\n    // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n    // @ts-ignore\n    identity: {\n      context: 'use',\n      providers: [\n        {\n          configURL,\n          clientId,\n          nonce,\n          loginHint,\n          domainHint\n        }\n      ],\n      mode: 'active'\n    },\n    // https://privacysandbox.google.com/cookies/fedcm/implement/relying-party#auto-reauthn\n    mediation: 'required'\n  });\n\n  if (isNullish(identityCredential)) {\n    throw new FedCMIdentityCredentialUndefinedError();\n  }\n\n  const {type} = identityCredential;\n\n  if (\n    type !== 'identity' ||\n    !('token' in identityCredential) ||\n    typeof identityCredential.token !== 'string'\n  ) {\n    // This should be unreachable in FedCM spec-compliant browsers.\n    throw new FedCMIdentityCredentialInvalidError('Invalid credential received from FedCM API', {\n      cause: identityCredential\n    });\n  }\n\n  const {token: jwt} = identityCredential;\n  return {jwt};\n};\n", "import {GOOGLE_PROVIDER} from './_constants';\nimport {initContext} from './_context';\nimport {requestJwtWithRedirect, requestWithCredentials} from './_openid';\nimport type {\n  RequestJwtCredentialsParams,\n  RequestJwtCredentialsResult,\n  RequestJwtParams,\n  RequestJwtRedirectParams\n} from './types/request';\n\nexport function requestJwt(args: {\n  google: RequestJwtCredentialsParams;\n}): Promise<RequestJwtCredentialsResult>;\n\nexport function requestJwt(args: {google: RequestJwtRedirectParams}): Promise<void>;\n\nexport async function requestJwt({\n  google\n}: {\n  google: RequestJwtParams;\n}): Promise<RequestJwtCredentialsResult | void> {\n  const context = await initContext();\n\n  if ('credentials' in google) {\n    const {credentials} = google;\n    const {configUrl} = GOOGLE_PROVIDER;\n\n    return await requestWithCredentials({\n      ...credentials,\n      ...context,\n      configUrl\n    });\n  }\n\n  const {redirect} = google;\n  const {authUrl, authScopes} = GOOGLE_PROVIDER;\n\n  requestJwtWithRedirect({\n    ...redirect,\n    ...context,\n    authUrl,\n    authScopes\n  });\n}\n", "const onBeforeUnload = ($event: BeforeUnloadEvent) => {\n  $event.preventDefault();\n  return ($event.returnValue = 'Are you sure you want to exit?');\n};\n\nconst addBeforeUnload = () => {\n  window.addEventListener('beforeunload', onBeforeUnload, {capture: true});\n};\n\nconst removeBeforeUnload = () => {\n  window.removeEventListener('beforeunload', onBeforeUnload, {capture: true});\n};\n\nexport const executeWithWindowGuard = async <T>({fn}: {fn: () => Promise<T>}): Promise<T> => {\n  try {\n    addBeforeUnload();\n\n    return await fn();\n  } finally {\n    removeBeforeUnload();\n  }\n};\n", "import {isNullish} from '@dfinity/utils';\nimport {requestJwt} from '@junobuild/auth';\nimport {envGoogleClientId} from '../../core/utils/window.env.utils';\nimport {SignInMissingClientIdError} from '../types/errors';\nimport type {GoogleSignInRedirectOptions} from '../types/google';\n\nexport class GoogleProvider {\n  /**\n   * Initiates a Google sign-in flow.\n   *\n   * Depending on the environment or configuration, this may redirect the user\n   * to Google's authentication screen or trigger a browser-native sign-in flow\n   * (such as FedCM in the future).\n   *\n   * @param {Object} params - Parameters for the sign-in request.\n   * @param {GoogleSignInRedirectOptions} [params.options] - Optional configuration for the sign-in request.\n   *\n   * @returns {Promise<void>} Resolves once the sign-in flow has been initiated.\n   */\n  async signIn({options = {}}: {options?: GoogleSignInRedirectOptions}) {\n    const clientId = options?.redirect?.clientId ?? envGoogleClientId();\n\n    if (isNullish(clientId)) {\n      throw new SignInMissingClientIdError();\n    }\n\n    const {redirect} = options;\n\n    await requestJwt({\n      google: {\n        redirect: {\n          ...(redirect ?? {}),\n          clientId\n        }\n      }\n    });\n  }\n}\n", "import {isNullish, uint8ArrayToBase64} from '@dfinity/utils';\nimport {IdbStorage, KEY_STORAGE_DELEGATION, KEY_STORAGE_KEY} from '@icp-sdk/auth/client';\nimport {type SignIdentity, AnonymousIdentity} from '@icp-sdk/core/agent';\nimport {\n  DelegationChain,\n  DelegationIdentity,\n  DER_COSE_OID,\n  ECDSAKeyIdentity,\n  unwrapDER\n} from '@icp-sdk/core/identity';\nimport {\n  type RetrievePublicKeyFn,\n  type WebAuthnNewCredential,\n  type WebAuthnSignProgressFn,\n  WebAuthnIdentity,\n  WebAuthnSignProgressStep\n} from '@junobuild/ic-client/webauthn';\nimport {EnvStore} from '../../core/stores/env.store';\nimport {getDoc} from '../../datastore/services/doc.services';\nimport {DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS} from '../constants/auth.constants';\nimport {execute} from '../helpers/progress.helpers';\nimport {createWebAuthnUser} from '../services/user-webauthn.services';\nimport {SignInInitError, WebAuthnSignInRetrievePublicKeyError} from '../types/errors';\nimport type {User} from '../types/user';\nimport {\n  type WebAuthnSignInOptions,\n  type WebAuthnSignUpOptions,\n  WebAuthnSignInProgressStep,\n  WebAuthnSignUpProgressStep\n} from '../types/webauthn';\n\ninterface SessionDelegationIdentity {\n  delegationIdentity: DelegationIdentity;\n  sessionKey: ECDSAKeyIdentity;\n}\n\nexport class WebAuthnProvider {\n  /**\n   * Signs up a user by creating a new passkey.\n   *\n   * @param {Object} params - The sign-up parameters.\n   * @param {WebAuthnSignUpOptions} [params.options] - Optional configuration for the login request.\n   * @param {loadAuth} params.loadAuthWithUser - The function to load the authentication with the user. Provided as a callback to avoid recursive import.\n   *\n   * @returns {Promise<void>} Resolves if the sign-up is successful.\n   */\n  async signUp({\n    options: {onProgress, maxTimeToLiveInMilliseconds, passkey: passkeyOptions} = {},\n    loadAuthWithUser\n  }: {\n    options?: WebAuthnSignUpOptions;\n    loadAuthWithUser: (params: {user: User}) => Promise<void>;\n  }) {\n    const {satelliteId} = EnvStore.getInstance().get() ?? {satelliteId: undefined};\n\n    if (isNullish(satelliteId)) {\n      throw new SignInInitError('Satellite ID not set. Have you initialized the Satellite?');\n    }\n\n    const onSignProgress: WebAuthnSignProgressFn = ({step, state}) => {\n      switch (step) {\n        case WebAuthnSignProgressStep.RequestingUserCredential:\n          onProgress?.({\n            step: WebAuthnSignUpProgressStep.ValidatingUserCredential,\n            state\n          });\n          break;\n        case WebAuthnSignProgressStep.FinalizingCredential:\n          onProgress?.({\n            step: WebAuthnSignUpProgressStep.FinalizingCredential,\n            state\n          });\n          break;\n        case WebAuthnSignProgressStep.Signing:\n          onProgress?.({\n            step: WebAuthnSignUpProgressStep.Signing,\n            state\n          });\n          break;\n      }\n    };\n\n    // 1. Create passkey\n    const createPasskey = async (): Promise<WebAuthnIdentity<WebAuthnNewCredential>> =>\n      await WebAuthnIdentity.createWithNewCredential({\n        onProgress: onSignProgress,\n        passkeyOptions\n      });\n\n    const passkeyIdentity = await execute({\n      fn: createPasskey,\n      step: WebAuthnSignUpProgressStep.CreatingUserCredential,\n      onProgress\n    });\n\n    // 2. Create session delegation. This will require the user the sign the session using their authenticator.\n    // i.e. they will have to use their authenticator a second time after create.\n    const {delegationIdentity, sessionKey} = await this.#createSessionDelegation({\n      identity: passkeyIdentity,\n      maxTimeToLiveInMilliseconds\n    });\n\n    // 3. Make update calls to create user and save public key.\n    // Note: We create the user before saving the session identity to avoid\n    // a race condition where the user would reload the window and the lib\n    // would try to retrieve and undefined user for the delegation saved in indexeddb.\n    const register = async () =>\n      await createWebAuthnUser({\n        delegationIdentity,\n        passkeyIdentity,\n        satelliteId\n      });\n\n    const user = await execute({\n      fn: register,\n      step: WebAuthnSignUpProgressStep.RegisteringUser,\n      onProgress\n    });\n\n    // 4. Save session identity for loading it with auth client\n    const saveSession = async () =>\n      await this.#saveSessionIdentityForAuthClient({delegationIdentity, sessionKey});\n\n    await execute({\n      fn: saveSession,\n      step: WebAuthnSignUpProgressStep.FinalizingSession,\n      onProgress\n    });\n\n    // 5. Load the user for the authentication\n    const loadAuth = async () => await loadAuthWithUser({user});\n\n    await execute({\n      fn: loadAuth,\n      step: WebAuthnSignUpProgressStep.RegisteringUser,\n      onProgress\n    });\n  }\n\n  /**\n   * Signs in a user with an existing passkey.\n   *\n   * @param {Object} params - The sign-in parameters.\n   * @param {WebAuthnSignInOptions} [params.options] - Optional configuration for the login request.\n   * @param {loadAuth} params.loadAuth - The function to load the user. Provided as a callback to avoid recursive import.\n   *\n   * @returns {Promise<void>} Resolves if the sign-in is successful.\n   */\n  async signIn({\n    options: {onProgress, maxTimeToLiveInMilliseconds} = {},\n    loadAuth\n  }: {\n    options?: WebAuthnSignInOptions;\n    loadAuth: () => Promise<void>;\n  }) {\n    const {satelliteId} = EnvStore.getInstance().get() ?? {satelliteId: undefined};\n\n    if (isNullish(satelliteId)) {\n      throw new SignInInitError('Satellite ID not set. Have you initialized the Satellite?');\n    }\n\n    const retrievePublicKey: RetrievePublicKeyFn = async ({credentialId}) => {\n      const doc = await getDoc({\n        collection: '#user-webauthn',\n        key: uint8ArrayToBase64(credentialId),\n        options: {\n          certified: true\n        },\n        satellite: {\n          identity: new AnonymousIdentity(),\n          satelliteId\n        }\n      });\n\n      if (isNullish(doc)) {\n        throw new WebAuthnSignInRetrievePublicKeyError(\n          'No public key found for the selected passkey.'\n        );\n      }\n\n      const {data} = doc;\n\n      const {publicKey} = data as {publicKey: Uint8Array};\n\n      return unwrapDER(publicKey, DER_COSE_OID);\n    };\n\n    const onSignProgress: WebAuthnSignProgressFn = ({step, state}) => {\n      switch (step) {\n        case WebAuthnSignProgressStep.RequestingUserCredential:\n          onProgress?.({\n            step: WebAuthnSignInProgressStep.RequestingUserCredential,\n            state\n          });\n          break;\n        case WebAuthnSignProgressStep.FinalizingCredential:\n          onProgress?.({\n            step: WebAuthnSignInProgressStep.FinalizingCredential,\n            state\n          });\n          break;\n        case WebAuthnSignProgressStep.Signing:\n          onProgress?.({\n            step: WebAuthnSignInProgressStep.Signing,\n            state\n          });\n          break;\n      }\n    };\n\n    const passkeyIdentity = await WebAuthnIdentity.createWithExistingCredential({\n      retrievePublicKey,\n      onProgress: onSignProgress\n    });\n\n    // When the signing of the session occurs, the Identity.sign is triggered\n    // which in turns lead to:\n    // 1. Get passkey (navigator.credentials.get)\n    // 2. Retrieve the public key from the backend\n    // 3. Create signature\n    const {delegationIdentity, sessionKey} = await this.#createSessionDelegation({\n      identity: passkeyIdentity,\n      maxTimeToLiveInMilliseconds\n    });\n\n    // 4. Save session identity for loading it with auth client\n    const saveSession = async () =>\n      await this.#saveSessionIdentityForAuthClient({delegationIdentity, sessionKey});\n\n    await execute({\n      fn: saveSession,\n      step: WebAuthnSignInProgressStep.FinalizingSession,\n      onProgress\n    });\n\n    // 5. Load the user\n    await execute({\n      fn: loadAuth,\n      step: WebAuthnSignInProgressStep.RetrievingUser,\n      onProgress\n    });\n  }\n\n  async #createSessionDelegation({\n    identity,\n    maxTimeToLiveInMilliseconds\n  }: {identity: SignIdentity} & Pick<\n    WebAuthnSignInOptions,\n    'maxTimeToLiveInMilliseconds'\n  >): Promise<SessionDelegationIdentity> {\n    const sessionKey = await ECDSAKeyIdentity.generate({extractable: false});\n\n    const sessionLengthInMilliseconds =\n      maxTimeToLiveInMilliseconds ?? DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS;\n\n    // We do not provide any particular targets. This delegation is meant to work\n    // on the Internet Computer with any canister.\n    const chain = await DelegationChain.create(\n      identity,\n      sessionKey.getPublicKey(),\n      new Date(Date.now() + sessionLengthInMilliseconds)\n    );\n\n    const delegationIdentity = DelegationIdentity.fromDelegation(sessionKey, chain);\n\n    return {delegationIdentity, sessionKey};\n  }\n\n  async #saveSessionIdentityForAuthClient({\n    sessionKey,\n    delegationIdentity\n  }: SessionDelegationIdentity) {\n    const storage = new IdbStorage();\n\n    await Promise.all([\n      storage.set(KEY_STORAGE_KEY, sessionKey.getKeyPair()),\n      storage.set(\n        KEY_STORAGE_DELEGATION,\n        JSON.stringify(delegationIdentity.getDelegation().toJSON())\n      )\n    ]);\n  }\n}\n", "import {nonNullish, uint8ArrayToArrayOfNumber} from '@dfinity/utils';\nimport type {Identity} from '@icp-sdk/core/agent';\nimport type {WebAuthnIdentity, WebAuthnNewCredential} from '@junobuild/ic-client/webauthn';\nimport type {Environment} from '../../core/types/env';\nimport {setManyDocs} from '../../datastore/services/doc.services';\nimport type {User} from '../types/user';\n\nexport const createWebAuthnUser = async ({\n  delegationIdentity,\n  passkeyIdentity,\n  satelliteId\n}: {\n  delegationIdentity: Identity;\n  passkeyIdentity: WebAuthnIdentity<WebAuthnNewCredential>;\n} & Pick<Environment, 'satelliteId'>): Promise<User> => {\n  // We serialize the AAGUID as number[] instead of Uint8Array because\n  // it results in slightly smaller JSON output with the stringifier.\n  // When reading the data, we support both formats.\n  const aaguid = passkeyIdentity.getCredential().getAAGUID();\n\n  const [user, _] = await setManyDocs({\n    docs: [\n      {\n        collection: '#user',\n        doc: {\n          key: delegationIdentity.getPrincipal().toText(),\n          data: {\n            provider: 'webauthn',\n            providerData: {\n              webauthn: {\n                ...(nonNullish(aaguid) && {aaguid: uint8ArrayToArrayOfNumber(aaguid)})\n              }\n            }\n          }\n        }\n      },\n      {\n        collection: '#user-webauthn',\n        doc: {\n          key: passkeyIdentity.getCredential().getCredentialIdText(),\n          data: {\n            publicKey: passkeyIdentity.getPublicKey().toRaw()\n          }\n        }\n      }\n    ],\n    satellite: {\n      identity: delegationIdentity,\n      satelliteId\n    }\n  });\n\n  return user;\n};\n", "import type {CreatePasskeyOptions} from '@junobuild/ic-client/webauthn';\nimport type {SignProgressFn} from './progress';\n\n/**\n * Enum representing the different steps of the WebAuthn sign-in flow.\n */\nexport enum WebAuthnSignInProgressStep {\n  /** Requesting a passkey (credential) from the user */\n  RequestingUserCredential,\n  /** Validating and finalizing the credential provided by the user */\n  FinalizingCredential,\n  /** Signing the authentication challenge with the user's credential */\n  Signing,\n  /** Completing the session setup after signing */\n  FinalizingSession,\n  /** Retrieving the authenticated user information */\n  RetrievingUser\n}\n\n/**\n * Enum representing the different steps of the WebAuthn sign-up (registration) flow.\n */\nexport enum WebAuthnSignUpProgressStep {\n  /** Creating a new passkey (credential) for the user */\n  CreatingUserCredential,\n  /** Validating the created credential */\n  ValidatingUserCredential,\n  /** Finalizing the credential for use */\n  FinalizingCredential,\n  /** Signing the registration challenge. Requires the user to interact again with the authenticator for confirmation. */\n  Signing,\n  /** Completing the session setup after signing */\n  FinalizingSession,\n  /** Registering the new user in the system */\n  RegisteringUser\n}\n\n/**\n * Interface representing common sign-in and sing-up options when using a WebAuthn (passkey) based provider.\n * @interface WebAuthnSignOptions\n */\nexport interface WebAuthnSignOptions {\n  /**\n   * Maximum time to live for the session in milliseconds. Cannot be extended.\n   * @type {number}\n   */\n  maxTimeToLiveInMilliseconds?: number;\n}\n\n/**\n * Interface representing sign-in options when using a WebAuthn (passkey) based provider.\n * @interface WebAuthnSignInOptions\n */\nexport interface WebAuthnSignInOptions extends WebAuthnSignOptions {\n  /**\n   * Optional callback to receive progress updates about the sign-in flow.\n   * Useful for showing UI feedback such as loading indicators or status messages.\n   */\n  onProgress?: SignProgressFn<WebAuthnSignInProgressStep>;\n}\n\n/**\n * Interface representing sign-up options when using a WebAuthn (passkey) based provider.\n * @interface WebAuthnSignUpSessionOptions\n */\nexport interface WebAuthnSignUpOptions extends WebAuthnSignOptions {\n  /**\n   * Optional callback to receive progress updates about the sign-up flow.\n   * Useful for showing UI feedback such as loading indicators or status messages.\n   */\n  onProgress?: SignProgressFn<WebAuthnSignUpProgressStep>;\n\n  /**\n   * Options for creating the passkey credential.\n   *\n   * For example, you can provide a user-friendly display name so the passkey\n   * is easier to recognize later.\n   */\n  passkey?: CreatePasskeyOptions;\n}\n", "import {executeWithWindowGuard} from '../helpers/window.helpers';\nimport {GoogleProvider} from '../providers/google.providers';\nimport {InternetIdentityProvider} from '../providers/internet-identity.providers';\nimport {WebAuthnProvider} from '../providers/webauthn.providers';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\nimport type {SignInContext, SignInOptions} from '../types/auth';\nimport {SignInProviderNotSupportedError} from '../types/errors';\nimport type {ProviderWithoutData} from '../types/provider';\nimport {authenticateWithAuthClient} from './_auth-client.services';\nimport {initUser} from './_user.services';\nimport {loadAuth} from './load.services';\n\n/**\n * Initialize the authClient, load or create a new user.\n * Executed on sign-in.\n *\n * \u2139\uFE0F Exposed for testing purpose only.\n */\nexport const createAuth = async ({provider}: {provider: ProviderWithoutData}) => {\n  const init = async () => {\n    const user = await initUser({provider});\n    AuthStore.getInstance().set(user);\n  };\n\n  await authenticateWithAuthClient({fn: init});\n};\n\n/**\n * Signs in a user with the specified options.\n *\n * @default Signs in by default with Internet Identity\n * @param {SignInOptions} [options] - The options for signing in including the provider to use for the process.\n * @returns {Promise<void>} A promise that resolves when the sign-in process is complete and the authenticated user is initialized.\n */\nexport const signIn = async (options: SignInOptions): Promise<void> => {\n  if ('google' in options) {\n    const {\n      google: {options: signInOptions}\n    } = options;\n\n    const fn = (): Promise<void> =>\n      new GoogleProvider().signIn({\n        options: signInOptions\n      });\n\n    await signInWithContext({\n      fn,\n      context: {windowGuard: false}\n    });\n\n    return;\n  }\n\n  if ('webauthn' in options) {\n    const {\n      webauthn: {options: signInOptions, context}\n    } = options;\n\n    const fn = (): Promise<void> =>\n      new WebAuthnProvider().signIn({\n        options: signInOptions,\n        loadAuth\n      });\n\n    await signInWithContext({fn, context});\n\n    return;\n  }\n\n  if ('internet_identity' in options) {\n    const {\n      internet_identity: {options: iiOptions, context}\n    } = options;\n\n    const {domain, ...signInOptions} = iiOptions ?? {};\n\n    const fn = (): Promise<void> =>\n      new InternetIdentityProvider({domain}).signIn({\n        options: signInOptions,\n        authClient: AuthClientStore.getInstance().getAuthClient(),\n        initAuth: createAuth\n      });\n\n    await signInWithContext({fn, context});\n\n    return;\n  }\n\n  throw new SignInProviderNotSupportedError(\n    'An unknown or unsupported provider was provided for sign-in.'\n  );\n};\n\nconst signInWithContext = async ({\n  fn,\n  context\n}: {\n  fn: () => Promise<void>;\n  context?: SignInContext;\n}): Promise<void> => {\n  const disableWindowGuard = context?.windowGuard === false;\n\n  if (disableWindowGuard) {\n    await fn();\n    return;\n  }\n\n  await executeWithWindowGuard({fn});\n};\n", "import {executeWithWindowGuard} from '../helpers/window.helpers';\nimport {WebAuthnProvider} from '../providers/webauthn.providers';\nimport type {SignUpOptions} from '../types/auth';\nimport {SignUpProviderNotSupportedError} from '../types/errors';\nimport {loadAuthWithUser} from './load.services';\n\n/**\n * Signs up to create a new user with the specified options.\n *\n * @param {SignUpOptions} [options] - The options for signing up including the provider to use for the process.\n * @returns {Promise<void>} A promise that resolves when the sign-up process is complete and the user is authenticated.\n */\nexport const signUp = async (options: SignUpOptions): Promise<void> => {\n  const fn = async () => await signUpWithProvider(options);\n\n  const disableWindowGuard = Object.values(options)?.[0].context?.windowGuard === false;\n\n  if (disableWindowGuard) {\n    await fn();\n    return;\n  }\n\n  await executeWithWindowGuard({fn});\n};\n\nconst signUpWithProvider = async (options: SignUpOptions): Promise<void> => {\n  if ('webauthn' in options) {\n    const {\n      webauthn: {options: signUpOptions}\n    } = options;\n\n    await new WebAuthnProvider().signUp({\n      options: signUpOptions,\n      loadAuthWithUser\n    });\n    return;\n  }\n\n  throw new SignUpProviderNotSupportedError(\n    'An unknown or unsupported provider was provided for sign-up.'\n  );\n};\n", "import type {User} from '../types/user';\n\n/**\n * Checks whether a user signed in using WebAuthn.\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'webauthn'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via WebAuthn.\n */\nexport const isWebAuthnUser = (user: User): user is User<'webauthn'> =>\n  user?.data?.provider === 'webauthn';\n\n/**\n * Checks whether a user signed in using Google (OpenID).\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'google'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via Google.\n */\nexport const isGoogleUser = (user: User): user is User<'google'> =>\n  user?.data?.provider === 'google';\n", "import type {ActorMethod, ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {getSatelliteExtendedActor as getSatelliteExtendedActorApi} from '../../core/api/actor.api';\nimport {getAnyIdentity} from '../../core/services/any-identity.services';\nimport type {SatelliteOptions} from '../../core/types/satellite';\n\n/**\n * Returns an extended satellite actor instance using the provided IDL factory and satellite options.\n *\n * This function is intended for advanced use cases where developers have implemented\n * custom endpoints in their serverless functions using the extended build type.\n *\n * In most cases, developers should not need to call this directly.\n * Extended actors are typically mapped and handled automatically.\n *\n * @template T - The actor interface type.\n *\n * @param {Object} params - The parameters for creating the actor.\n * @param {IDL.InterfaceFactory} params.idlFactory - The IDL factory defining the custom actor interface.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only.\n * In browser environments, configuration is automatically inherited from `initSatellite()`.\n *\n * @returns {Promise<ActorSubclass<T>>} A promise that resolves to the extended actor instance.\n */\nexport const getSatelliteExtendedActor = async <T = Record<string, ActorMethod>>({\n  idlFactory,\n  satellite\n}: {\n  idlFactory: IDL.InterfaceFactory;\n  satellite?: SatelliteOptions;\n}): Promise<ActorSubclass<T>> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await getSatelliteExtendedActorApi({\n    idlFactory,\n    ...satellite,\n    identity\n  });\n};\n", "import {fromNullable, nonNullish} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport type {Asset, AssetEncoding, AssetKey, Storage} from '@junobuild/storage';\nimport {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/any-identity.services';\nimport type {ReadOptions} from '../../core/types/call-options';\nimport type {ListParams} from '../../core/types/list';\nimport type {SatelliteOptions} from '../../core/types/satellite';\nimport {satelliteUrl} from '../../core/utils/env.utils';\nimport {\n  countAssets as countAssetsApi,\n  deleteAsset as deleteAssetApi,\n  deleteFilteredAssets as deleteFilteredAssetsApi,\n  deleteManyAssets as deleteManyAssetsApi,\n  getAsset as getAssetApi,\n  getManyAssets as getManyAssetsApi,\n  listAssets as listAssetsApi,\n  uploadAsset as uploadAssetApi\n} from '../api/storage.api';\nimport type {Assets} from '../types/storage';\nimport {sha256ToBase64String} from '../utils/crypto.utils';\n\n/**\n * Uploads a blob to the storage.\n *\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetKey>} A promise that resolves to the asset key.\n */\nexport const uploadBlob = (params: Storage & {satellite?: SatelliteOptions}): Promise<AssetKey> =>\n  uploadAssetIC(params);\n\n/**\n * Uploads a file to the storage.\n *\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetKey>} A promise that resolves to the asset key.\n */\nexport const uploadFile = (\n  params: Partial<Pick<Storage, 'filename'>> &\n    Omit<Storage, 'filename' | 'data'> & {data: File} & {satellite?: SatelliteOptions}\n): Promise<AssetKey> =>\n  uploadAssetIC({\n    filename: params.data.name,\n    ...params\n  });\n\nconst uploadAssetIC = async ({\n  filename: storageFilename,\n  data,\n  collection,\n  headers = [],\n  fullPath: storagePath,\n  token,\n  satellite: satelliteOptions,\n  encoding,\n  description\n}: Storage & {satellite?: SatelliteOptions}): Promise<AssetKey> => {\n  const identity = getAnyIdentity(satelliteOptions?.identity);\n\n  // The IC certification does not currently support encoding\n  const filename: string = decodeURI(storageFilename);\n  const fullPath: string = storagePath ?? `/${collection}/${filename}`;\n\n  const satellite = {...satelliteOptions, identity};\n\n  await uploadAssetApi({\n    asset: {\n      data,\n      filename,\n      collection,\n      token,\n      headers,\n      fullPath,\n      encoding,\n      description\n    },\n    satellite,\n    options: {certified: true}\n  });\n\n  return {\n    downloadUrl: downloadUrl({\n      satellite,\n      assetKey: {\n        fullPath,\n        token\n      }\n    }),\n    fullPath,\n    name: filename\n  };\n};\n\n/**\n * Lists assets in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for listing the assets.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Assets>} A promise that resolves to the list of assets.\n */\nexport const listAssets = async ({\n  collection,\n  filter,\n  satellite: satelliteOptions,\n  options\n}: {\n  collection: string;\n  filter?: ListParams;\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n}): Promise<Assets> => {\n  const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n  const {items, ...rest} = await listAssetsApi({\n    collection,\n    filter: filter ?? {},\n    satellite,\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n\n  const assets = items.map(\n    ({\n      key: {full_path: fullPath, token: t, name, owner, description},\n      headers,\n      encodings,\n      created_at,\n      updated_at\n    }: SatelliteDid.AssetNoContent) => {\n      const token = fromNullable(t);\n\n      return {\n        fullPath,\n        description: fromNullable(description),\n        name,\n        downloadUrl: downloadUrl({\n          satellite,\n          assetKey: {fullPath, token}\n        }),\n        token,\n        headers,\n        encodings: encodings.reduce<Record<string, AssetEncoding>>(\n          (acc, [type, {modified, sha256, total_length}]) => ({\n            ...acc,\n            [type]: {\n              modified,\n              sha256: sha256ToBase64String(sha256),\n              total_length\n            }\n          }),\n          {}\n        ),\n        owner: owner.toText(),\n        created_at,\n        updated_at\n      } as Asset;\n    }\n  );\n\n  return {\n    items: assets,\n    assets,\n    ...rest\n  };\n};\n\n/**\n * Counts assets in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for counting the assets.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter parameters for narrowing down the count.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<bigint>} A promise that resolves to the count of assets as a bigint.\n */\nexport const countAssets = async ({\n  collection,\n  filter,\n  satellite: satelliteOptions,\n  options\n}: {\n  collection: string;\n  filter?: ListParams;\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n}): Promise<bigint> => {\n  const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n  return await countAssetsApi({\n    collection,\n    satellite,\n    filter: filter ?? {},\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n};\n\n/**\n * Deletes an asset from the storage.\n *\n * @param {Object} params - The parameters for deleting the asset.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the asset is deleted.\n */\nexport const deleteAsset = ({\n  collection,\n  fullPath,\n  satellite\n}: {\n  collection: string;\n  satellite?: SatelliteOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<void> =>\n  deleteAssetApi({\n    collection,\n    fullPath,\n    satellite: {...satellite, identity: getAnyIdentity(satellite?.identity)},\n    options: {certified: true}\n  });\n\n/**\n * Deletes multiple assets from the storage.\n *\n * @param {Object} params - The parameters for deleting the assets.\n * @param {Array} params.assets - The list of assets with their collections and full paths.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the assets are deleted.\n */\nexport const deleteManyAssets = ({\n  assets,\n  satellite\n}: {\n  assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n  satellite?: SatelliteOptions;\n}): Promise<void> =>\n  deleteManyAssetsApi({\n    assets,\n    satellite: {...satellite, identity: getAnyIdentity(satellite?.identity)},\n    options: {certified: true}\n  });\n\n/**\n * Deletes multiple assets from a collection based on filtering criteria.\n *\n * @param {Object} params - The parameters for deleting the assets.\n * @param {string} params.collection - The name of the collection from which to delete assets.\n * @param {ListParams} [params.filter] - The filter criteria to match assets for deletion.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the assets matching the filter criteria are deleted.\n */\nexport const deleteFilteredAssets = async ({\n  collection,\n  satellite: satelliteOptions,\n  filter\n}: {\n  collection: string;\n  satellite?: SatelliteOptions;\n  filter?: ListParams;\n}): Promise<void> => {\n  const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n  return await deleteFilteredAssetsApi({\n    collection,\n    satellite,\n    filter: filter ?? {},\n    options: {certified: true}\n  });\n};\n\n/**\n * Retrieves an asset from the storage.\n *\n * @param {Object} params - The parameters for retrieving the asset.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetNoContent | undefined>} A promise that resolves to the asset or undefined if not found.\n */\nexport const getAsset = async ({\n  satellite,\n  options,\n  ...rest\n}: {\n  collection: string;\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<SatelliteDid.AssetNoContent | undefined> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await getAssetApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n};\n\n/**\n * Retrieves multiple assets from the storage.\n *\n * @param {Object} params - The parameters for retrieving the assets.\n * @param {Array} params.assets - The list of assets with their collections and full paths.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<AssetNoContent | undefined>>} A promise that resolves to an array of assets or undefined if not found.\n */\nexport const getManyAssets = async ({\n  satellite,\n  options,\n  ...rest\n}: {\n  assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n  satellite?: SatelliteOptions;\n  options?: ReadOptions;\n}): Promise<(SatelliteDid.AssetNoContent | undefined)[]> => {\n  const identity = getAnyIdentity(satellite?.identity);\n\n  return await getManyAssetsApi({\n    ...rest,\n    satellite: {...satellite, identity},\n    options: options ?? DEFAULT_READ_OPTIONS\n  });\n};\n\n/**\n * Returns a public URL for accessing a specific asset stored on a Satellite.\n *\n * This URL can be used to:\n * - Open the file directly in a browser\n * - Embed the asset in HTML elements like `<img src=\"...\">`, `<video src=\"...\">`, or `<a href=\"...\">`\n * - Programmatically download or display the asset in your application\n *\n * ### Example\n * ```ts\n * const url = downloadUrl({\n *   assetKey: {\n *     fullPath: '/images/logo.png',\n *   }\n * });\n *\n * // Usage in an <img> tag\n * <img src={url} alt=\"Logo\" />\n * ```\n *\n * @param {Object} params - Parameters for generating the URL.\n * @param {Object} params.assetKey - Identifies the asset to generate the URL for.\n * @param {string} params.assetKey.fullPath - The full path of the asset (e.g., `/folder/file.jpg`).\n * @param {string} [params.assetKey.token] - Optional access token for accessing protected assets.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {string} A full URL pointing to the asset.\n */\nexport const downloadUrl = ({\n  assetKey: {fullPath, token},\n  satellite: satelliteOptions\n}: {\n  assetKey: Pick<Asset, 'fullPath' | 'token'>;\n} & {satellite?: SatelliteOptions}): string => {\n  const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n  return `${satelliteUrl(satellite)}${fullPath}${nonNullish(token) ? `?token=${token}` : ''}`;\n};\n", "import {fromNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {\n  uploadAsset as uploadAssetStorage,\n  type AssetKey,\n  type UploadAsset\n} from '@junobuild/storage';\nimport {getSatelliteActor} from '../../core/api/actor.api';\nimport type {ActorReadParams, ActorUpdateParams} from '../../core/types/actor';\nimport type {ListParams, ListResults} from '../../core/types/list';\nimport {toListParams} from '../../core/utils/list.utils';\n\nexport const uploadAsset = async ({\n  asset,\n  ...rest\n}: {asset: UploadAsset} & ActorUpdateParams): Promise<void> => {\n  const actor = await getSatelliteActor(rest);\n\n  await uploadAssetStorage({\n    actor,\n    asset\n  });\n};\n\nexport const listAssets = async ({\n  collection,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter: ListParams;\n} & ActorReadParams): Promise<ListResults<SatelliteDid.AssetNoContent>> => {\n  const {list_assets} = await getSatelliteActor(rest);\n\n  const {\n    items: assets,\n    items_length,\n    items_page,\n    matches_length,\n    matches_pages\n  } = await list_assets(collection, toListParams(filter));\n\n  return {\n    items: assets.map(([_, asset]) => asset),\n    items_length,\n    items_page: fromNullable(items_page),\n    matches_length,\n    matches_pages: fromNullable(matches_pages)\n  };\n};\n\nexport const countAssets = async ({\n  collection,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter: ListParams;\n} & ActorReadParams): Promise<bigint> => {\n  const {count_assets} = await getSatelliteActor(rest);\n\n  return count_assets(collection, toListParams(filter));\n};\n\nexport const deleteAsset = async ({\n  collection,\n  fullPath,\n  ...rest\n}: {\n  collection: string;\n} & ActorUpdateParams &\n  Pick<AssetKey, 'fullPath'>): Promise<void> => {\n  const actor = await getSatelliteActor(rest);\n\n  return actor.del_asset(collection, fullPath);\n};\n\nexport const deleteManyAssets = async ({\n  assets,\n  satellite\n}: {\n  assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n} & ActorUpdateParams): Promise<void> => {\n  const {del_many_assets} = await getSatelliteActor({satellite, options: {certified: true}});\n\n  const payload: [string, string][] = assets.map(({collection, fullPath}) => [\n    collection,\n    fullPath\n  ]);\n\n  await del_many_assets(payload);\n};\n\nexport const deleteFilteredAssets = async ({\n  collection,\n  filter,\n  ...rest\n}: {\n  collection: string;\n  filter: ListParams;\n} & ActorUpdateParams): Promise<void> => {\n  const {del_filtered_assets} = await getSatelliteActor(rest);\n\n  return del_filtered_assets(collection, toListParams(filter));\n};\n\nexport const getAsset = async ({\n  collection,\n  fullPath,\n  ...rest\n}: {\n  collection: string;\n} & ActorReadParams &\n  Pick<AssetKey, 'fullPath'>): Promise<SatelliteDid.AssetNoContent | undefined> => {\n  const {get_asset} = await getSatelliteActor(rest);\n  return fromNullable(await get_asset(collection, fullPath));\n};\n\nexport const getManyAssets = async ({\n  assets,\n  ...rest\n}: {\n  assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n} & ActorReadParams): Promise<(SatelliteDid.AssetNoContent | undefined)[]> => {\n  const {get_many_assets} = await getSatelliteActor(rest);\n\n  const payload: [string, string][] = assets.map(({collection, fullPath}) => [\n    collection,\n    fullPath\n  ]);\n\n  const resultsAssets = await get_many_assets(payload);\n\n  return resultsAssets.map(([_, resultAsset]) => fromNullable(resultAsset));\n};\n", "import {assertNonNullish, toNullable} from '@dfinity/utils';\nimport type {ConsoleDid, SatelliteDid} from '@junobuild/ic-client/actor';\nimport {isBrowser} from '@junobuild/utils';\nimport {UPLOAD_CHUNK_SIZE} from '../constants/upload.constants';\nimport type {EncodingType} from '../types/storage';\nimport type {UploadAsset, UploadParams, UploadWithProposalParams} from '../types/upload';\n\ntype InitAssetKey = SatelliteDid.InitAssetKey | ConsoleDid.InitAssetKey;\ntype UploadChunk = SatelliteDid.UploadChunk | ConsoleDid.UploadChunk;\ntype CommitBatch = SatelliteDid.CommitBatch | ConsoleDid.CommitBatch;\n\nexport const uploadAsset = async ({\n  asset: {data, headers, ...restAsset},\n  actor,\n  progress\n}: {\n  asset: UploadAsset;\n} & UploadParams): Promise<void> => {\n  const {init_asset_upload, upload_asset_chunk, commit_asset_upload} = actor;\n\n  const {batch_id: batchId} = await init_asset_upload(mapInitAssetUploadParams(restAsset));\n\n  progress?.onInitiatedBatch();\n\n  const {chunkIds} = await uploadChunks({data, uploadFn: upload_asset_chunk, batchId});\n\n  progress?.onUploadedFileChunks(restAsset.fullPath);\n\n  await commitAsset({\n    commitFn: commit_asset_upload,\n    batchId,\n    data,\n    headers,\n    chunkIds\n  });\n\n  progress?.onCommittedBatch();\n};\n\nexport const uploadAssetWithProposal = async ({\n  asset: {data, headers, ...restAsset},\n  proposalId,\n  actor,\n  progress\n}: {\n  asset: UploadAsset;\n} & UploadWithProposalParams): Promise<void> => {\n  const {init_proposal_asset_upload, upload_proposal_asset_chunk, commit_proposal_asset_upload} =\n    actor;\n\n  progress?.onInitiatedBatch();\n\n  const {batch_id: batchId} = await init_proposal_asset_upload(\n    mapInitAssetUploadParams(restAsset),\n    proposalId\n  );\n\n  const {chunkIds} = await uploadChunks({data, uploadFn: upload_proposal_asset_chunk, batchId});\n\n  progress?.onUploadedFileChunks(restAsset.fullPath);\n\n  await commitAsset({\n    commitFn: commit_proposal_asset_upload,\n    batchId,\n    data,\n    headers,\n    chunkIds\n  });\n\n  progress?.onCommittedBatch();\n};\n\nexport const uploadAssetsWithProposal = async ({\n  assets,\n  proposalId,\n  actor,\n  progress\n}: {\n  assets: UploadAsset[];\n} & UploadWithProposalParams): Promise<void> => {\n  const {\n    init_proposal_many_assets_upload,\n    upload_proposal_asset_chunk,\n    commit_proposal_many_assets_upload\n  } = actor;\n\n  const batchIds = await init_proposal_many_assets_upload(\n    assets.map(mapInitAssetUploadParams),\n    proposalId\n  );\n\n  progress?.onInitiatedBatch();\n\n  const uploadAssetChunk = async ({\n    fullPath,\n    data,\n    headers\n  }: UploadAsset): Promise<BatchToCommit> => {\n    const initializedBatch = batchIds.find(([batchIdFullPath]) => batchIdFullPath === fullPath);\n\n    assertNonNullish(initializedBatch);\n\n    const [_, initUpload] = initializedBatch;\n    const {batch_id: batchId} = initUpload;\n\n    const {chunkIds} = await uploadChunks({data, uploadFn: upload_proposal_asset_chunk, batchId});\n\n    progress?.onUploadedFileChunks(fullPath);\n\n    return {\n      batchId,\n      headers,\n      chunkIds,\n      data\n    };\n  };\n\n  const batchAndChunkIdsToCommit = await Promise.all(assets.map(uploadAssetChunk));\n\n  await commit_proposal_many_assets_upload(batchAndChunkIdsToCommit.map(mapCommitBatch));\n\n  progress?.onCommittedBatch();\n};\n\nconst mapInitAssetUploadParams = ({\n  filename,\n  collection,\n  token,\n  fullPath,\n  encoding,\n  description\n}: Omit<UploadAsset, 'headers' | 'data'>): InitAssetKey => ({\n  collection,\n  full_path: fullPath,\n  name: filename,\n  token: toNullable<string>(token),\n  encoding_type: toNullable<EncodingType>(encoding),\n  description: toNullable(description)\n});\n\ntype BatchToCommit = {\n  batchId: bigint;\n  chunkIds: UploadChunkResult[];\n} & Pick<UploadAsset, 'headers' | 'data'>;\n\nconst mapCommitBatch = ({batchId, chunkIds, headers, data}: BatchToCommit): CommitBatch => {\n  const contentType: [[string, string]] | undefined =\n    headers.find(([type, _]) => type.toLowerCase() === 'content-type') === undefined &&\n    data.type !== undefined &&\n    data.type !== ''\n      ? [['Content-Type', data.type]]\n      : undefined;\n\n  return {\n    batch_id: batchId,\n    chunk_ids: chunkIds.map(({chunk_id}: UploadChunkResult) => chunk_id),\n    headers: [...headers, ...(contentType ?? [])]\n  };\n};\n\nconst commitAsset = async ({\n  commitFn,\n  ...rest\n}: {\n  commitFn: (commitBatch: CommitBatch) => Promise<void>;\n  batchId: bigint;\n  chunkIds: UploadChunkResult[];\n} & Pick<UploadAsset, 'headers' | 'data'>) => {\n  const commitBatch = mapCommitBatch(rest);\n  await commitFn(commitBatch);\n};\n\nconst uploadChunks = async ({\n  data,\n  uploadFn,\n  batchId\n}: {\n  batchId: bigint;\n} & Pick<UploadAsset, 'data'> &\n  Pick<UploadChunkParams, 'uploadFn'>): Promise<{chunkIds: UploadChunkResult[]}> => {\n  const uploadChunks: UploadChunkParams[] = [];\n\n  // Prevent transforming chunk to arrayBuffer error: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.\n  const clone: Blob = isBrowser() ? new Blob([await data.arrayBuffer()]) : data;\n\n  // Split data into chunks\n  let orderId = 0n;\n  for (let start = 0; start < clone.size; start += UPLOAD_CHUNK_SIZE) {\n    const chunk: Blob = clone.slice(start, start + UPLOAD_CHUNK_SIZE);\n\n    uploadChunks.push({\n      batchId,\n      chunk,\n      uploadFn,\n      orderId\n    });\n\n    orderId++;\n  }\n\n  // Upload chunks to the IC in batch - i.e. 12 chunks uploaded at a time.\n  let chunkIds: UploadChunkResult[] = [];\n  for await (const results of batchUploadChunks({uploadChunks})) {\n    chunkIds = [...chunkIds, ...results];\n  }\n\n  return {chunkIds};\n};\n\nasync function* batchUploadChunks({\n  uploadChunks,\n  limit = 12\n}: {\n  uploadChunks: UploadChunkParams[];\n  limit?: number;\n}): AsyncGenerator<UploadChunkResult[], void> {\n  for (let i = 0; i < uploadChunks.length; i = i + limit) {\n    const batch = uploadChunks.slice(i, i + limit);\n    const result = await Promise.all(batch.map((params) => uploadChunk(params)));\n    yield result;\n  }\n}\n\ninterface UploadChunkResult {\n  chunk_id: bigint;\n}\n\ninterface UploadChunkParams {\n  batchId: bigint;\n  chunk: Blob;\n  uploadFn: (uploadChunk: UploadChunk) => Promise<UploadChunkResult>;\n  orderId: bigint;\n}\n\nconst uploadChunk = async ({\n  batchId,\n  chunk,\n  uploadFn,\n  orderId\n}: UploadChunkParams): Promise<UploadChunkResult> =>\n  uploadFn({\n    batch_id: batchId,\n    content: new Uint8Array(await chunk.arrayBuffer()),\n    order_id: toNullable(orderId)\n  });\n", "export const sha256ToBase64String = (sha256: Iterable<number>): string =>\n  btoa([...sha256].map((c) => String.fromCharCode(c)).join(''));\n"],
  "mappings": ";;AAAA,OAAQ,oBAAAA,OAAuB,iBCA/B,OAAQ,6BAAAC,OAAgC,iBCAxC,OAAQ,gBAAAC,GAAc,WAAAC,OAAwC,sBEA9D,OAAQ,sBAAAC,OAAyB,iBEAjC,OAAQ,2BAAAC,GAAyB,aAAAC,GAAW,oBAAAC,OAAuB,iBACnE,OAAQ,QAAAC,GAAsB,gBAAAC,OAAmB,sBKDjD,OAAQ,cAAAC,OAAiB,iBVwBlB,IAAMC,GAAgB,CAAC,CAC5B,SAAAC,CACF,IAK+B,CAC7B,GAAIA,EAAS,WAAa,GACxB,MAAO,CAAC,gBAAiB,IAAI,EAG/B,GAAIA,EAAS,WAAa,GACxB,MAAO,CAAC,gBAAiB,IAAI,EAG/B,IAAMC,EAAQD,EAAS,MAAM,GAAI,EAAE,EAE7BE,EAASC,GAAc,CAAC,MAAAF,CAA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,UAAWC,CACb,IAE+C,CAC7C,IAAMO,EAAY,CAAC,GAAGP,EAAkB,SAAUI,EAAeJ,GAAkB,QAAQ,CAAC,EAE5F,MAAO,GAAGoC,GAAa7B,CAAS,CAAC,GAAGD,CAAQ,GAAG+B,GAAWtC,CAAK,EAAI,UAAUA,CAAK,GAAK,EAAE,EAC3F,E3FrUA,IAAMuC,GAAYC,GAA2C,CAC3D,IAAMC,EAAcD,GAAS,aAAeE,GAAe,EAE3DC,GAAiBF,EAAa,6DAA6D,EAE3F,IAAMG,EAAYJ,GAAS,WAAaK,GAAa,EAErD,MAAO,CACL,YAAAJ,EACA,mBAAoBD,GAAS,mBAC7B,QAASA,GAAS,QAClB,UAAAI,CACF,CACF,EAKaE,GAAYN,GACvBO,GAAcP,CAAO,EAQVO,GAAgB,MAAOP,GAAsD,CACxF,IAAMQ,EAAMT,GAASC,CAAO,EAE5BS,EAAS,YAAY,EAAE,IAAID,CAAG,EAE9B,MAAME,GAAS,EAEf,IAAMC,EACJH,EAAI,SAAS,OAAS,OAAYI,GAAsBJ,EAAI,QAAQ,IAAI,EAAI,OAE9E,MAAO,CAAC,GAAIG,EAAgB,CAACA,CAAa,EAAI,CAAC,CAAE,CACnD,EAOaE,GAAqBC,GAChCC,EAAU,YAAY,EAAE,UAAUD,CAAQ,EAK/BH,GAAgBE",
  "names": ["assertNonNullish", "uint8ArrayToArrayOfNumber", "DER_COSE_OID", "wrapDER", "uint8ArrayToBase64", "arrayBufferToUint8Array", "isNullish", "uint8ArraysEqual", "Cbor", "SignIdentity", "nonNullish", "extractAAGUID", "authData", "bytes", "result", "bytesToAAGUID", "aaguid", "byte", "_authDataToCose", "dataView", "idLenBytes", "v", "i", "credentialIdLength", "_coseToDerEncodedBlob", "cose", "CosePublicKey", "_cose", "#encodedKey", "WebAuthnCredential", "#credentialId", "#publicKey", "credentialId", "WebAuthnNewCredential", "#aaguidText", "#aaguidBytes", "rest", "optionAaguid", "WebAuthnExistingCredential", "WebAuthnIdentityHostnameError", "WebAuthnIdentityCredentialNotInitializedError", "WebAuthnIdentityCreateCredentialOnTheDeviceError", "WebAuthnIdentityCredentialNotPublicKeyError", "WebAuthnIdentityNoAttestationError", "WebAuthnIdentityInvalidCredentialIdError", "WebAuthnIdentityEncodeCborSignatureError", "WebAuthnIdentityNoAuthenticatorDataError", "PUBLIC_KEY_COSE_ALGORITHMS", "AUTHENTICATOR_ABORT_TIMEOUT", "randomValue", "createChallenge", "createUserId", "hostname", "href", "WebAuthnIdentityHostnameError", "relyingPartyId", "appId", "createPasskeyOptions", "userOptions", "name", "relyingParty", "user", "algorithm", "retrievePasskeyOptions", "options", "execute", "fn", "step", "onProgress", "result", "err", "WebAuthnSignProgressStep", "createAbortSignal", "timeout", "retrieveCredentials", "challenge", "credentialIds", "passkeyOptions", "id", "assertWebAuthnStateInitialized", "state", "WebAuthnIdentityCredentialNotInitializedError", "assertNonNullishCredential", "credential", "isNullish", "WebAuthnIdentityCreateCredentialOnTheDeviceError", "assertCredentialPublicKey", "type", "WebAuthnIdentityCredentialNotPublicKeyError", "WebAuthnIdentity", "_WebAuthnIdentity", "SignIdentity", "#onSignProgress", "#state", "args", "retrievePublicKey", "#createInitializedState", "WebAuthnNewCredential", "restArgs", "attestationObject", "rawId", "WebAuthnIdentityNoAttestationError", "authData", "Cbor", "arrayBufferToUint8Array", "cose", "_authDataToCose", "blob", "uint8ArraysEqual", "WebAuthnIdentityInvalidCredentialIdError", "WebAuthnExistingCredential", "response", "clientDataJSON", "authenticatorData", "signature", "WebAuthnIdentityNoAuthenticatorDataError", "encoded", "WebAuthnIdentityEncodeCborSignatureError", "isWebAuthnAvailable", "nonNullish", "isNullish", "Store", "data", "callback", "callbackId", "id", "AuthStore", "_AuthStore", "Store", "authUser", "callback", "unsubscribe", "emit", "message", "detail", "$event", "isNullish", "Actor", "isNullish", "nonNullish", "HttpAgent", "DOCKER_CONTAINER_URL", "DOCKER_INTERNET_IDENTITY_ID", "createAgent", "identity", "container", "host", "nonNullish", "DOCKER_CONTAINER_URL", "shouldFetchRootKey", "HttpAgent", "AgentStore", "_AgentStore", "#agents", "isNullish", "identity", "rest", "key", "agent", "createAgent", "ActorStore", "_ActorStore", "#actors", "isNullish", "satelliteId", "identity", "actorKey", "rest", "key", "actor", "idlFactory", "canisterId", "agent", "AgentStore", "Actor", "isNullish", "AuthClient", "IdbStorage", "KEY_STORAGE_DELEGATION", "KEY_STORAGE_KEY", "AuthClientStore", "_AuthClientStore", "#instance", "#authClient", "delegationChain", "sessionKey", "storage", "signOut", "options", "resetAuth", "AuthClientStore", "AuthStore", "ActorStore", "AgentStore", "initAuthTimeoutWorker", "auth", "workerUrl", "worker", "timeoutSignOut", "emit", "signOut", "data", "msg", "value", "AuthStore", "user", "isNullish", "authenticateWithAuthClient", "fn", "createAuthClient", "safeCreateAuthClient", "AuthClientStore", "isNullish", "nonNullish", "isSatelliteError", "error", "type", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "DEFAULT_READ_OPTIONS", "nonNullish", "AnonymousIdentity", "isNullish", "getIdentity", "AuthClientStore", "unsafeIdentity", "getAuthClient", "createAuthClient", "getIdentityOnce", "user", "AuthStore", "isNullish", "authClient", "getAnyIdentity", "identity", "nonNullish", "getIdentity", "AnonymousIdentity", "fromNullable", "isNullish", "nonNullish", "assertNonNullish", "isNullish", "Actor", "nonNullish", "HttpAgent", "idlFactory", "IDL", "Memory", "InitStorageArgs", "InitSatelliteArgs", "OpenIdPrepareDelegationArgs", "AuthenticationArgs", "Doc", "PreparedDelegation", "Authentication", "JwtFindProviderError", "JwtVerifyError", "GetOrRefreshJwksError", "PrepareDelegationError", "AuthenticationError", "AuthenticateResultResponse", "CommitBatch", "CommitProposal", "ListOrderField", "ListOrder", "TimestampMatcher", "ListMatcher", "ListPaginate", "ListParams", "DeleteControllersArgs", "ControllerScope", "Controller", "DelDoc", "CollectionType", "DelRule", "DeleteProposalAssets", "DepositCyclesArgs", "AssetKey", "AssetEncodingNoContent", "AssetNoContent", "OpenIdProvider", "OpenIdProviderDelegationConfig", "OpenIdProviderConfig", "AuthenticationConfigOpenId", "AuthenticationConfigInternetIdentity", "AuthenticationRules", "AuthenticationConfig", "ConfigMaxMemorySize", "DbConfig", "StorageConfigIFrame", "StorageConfigRawAccess", "StorageConfigRedirect", "StorageConfig", "Config", "OpenIdGetDelegationArgs", "GetDelegationArgs", "Delegation", "SignedDelegation", "GetDelegationError", "GetDelegationResultResponse", "ProposalStatus", "AssetsUpgradeOptions", "SegmentsDeploymentOptions", "ProposalType", "Proposal", "Permission", "RateConfig", "Rule", "HttpRequest", "StreamingCallbackToken", "StreamingStrategy", "HttpResponse", "StreamingCallbackHttpResponse", "InitAssetKey", "InitUploadResult", "ListResults", "CustomDomain", "ListResults_1", "ListProposalsOrder", "ListProposalsPaginate", "ListProposalsParams", "ProposalKey", "ListProposalResults", "ListRulesMatcher", "ListRulesParams", "ListRulesResults", "MemorySize", "SetAuthenticationConfig", "SetController", "SetControllersArgs", "SetDbConfig", "SetDoc", "SetRule", "SetStorageConfig", "UploadChunk", "UploadChunkResult", "Tokens", "AssertMissionControlCenterArgs", "OpenIdData", "OpenId", "Provider", "MissionControl", "Result", "CreateCanisterArgs", "InitStorageMemory", "CreateSatelliteArgs", "GetCreateCanisterFeeArgs", "Result_1", "PaymentStatus", "Payment", "SegmentKind", "createAgent", "identity", "host", "localActor", "HttpAgent", "useOrInitAgent", "agent", "rest", "initAgent", "container", "nonNullish", "getSatelliteActor", "satelliteId", "certified", "rest", "getActor", "idlFactory", "getConsoleActor", "consoleId", "certified", "rest", "getActor", "idlFactory", "canisterId", "isNullish", "createActor", "config", "agent", "useOrInitAgent", "Actor", "nonNullish", "EnvStore", "_EnvStore", "Store", "env", "callback", "unsubscribe", "satelliteUrl", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "container", "customOrEnvContainer", "nonNullish", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "EnvStore", "getSatelliteActor", "satellite", "certified", "getActor", "Qt", "jt", "getSatelliteExtendedActor", "idlFactory", "rest", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "assertNonNullish", "container", "customOrEnvContainer", "ActorStore", "isNullish", "toNullable", "Principal", "SignInError", "SignInInitError", "SignInUserInterruptError", "SignInProviderNotSupportedError", "SignInMissingClientIdError", "WebAuthnSignInRetrievePublicKeyError", "SignUpProviderNotSupportedError", "InitError", "ListError", "toListMatcherTimestamp", "matcher", "isNullish", "toNullable", "ListError", "toListParams", "paginate", "order", "owner", "Principal", "jsonReplacer", "jsonReviver", "toArray", "data", "blob", "fromArray", "isBrowser", "mapData", "data", "i", "err", "fromNullable", "toNullable", "toSetDoc", "doc", "data", "version", "description", "toNullable", "a", "toDelDoc", "fromDoc", "key", "owner", "docDescription", "rest", "fromNullable", "i", "getDoc", "collection", "key", "rest", "get_doc", "getSatelliteActor", "doc", "fromNullable", "isNullish", "fromDoc", "getManyDocs", "docs", "get_many_docs", "payload", "resultsDocs", "results", "resultDoc", "nonNullish", "setDoc", "set_doc", "toSetDoc", "updatedDoc", "setManyDocs", "set_many_docs", "updatedDocs", "deleteDoc", "del_doc", "toDelDoc", "deleteManyDocs", "del_many_docs", "deleteFilteredDocs", "filter", "del_filtered_docs", "toListParams", "listDocs", "list_docs", "items", "items_page", "items_length", "matches_length", "matches_pages", "item", "dataArray", "owner", "description", "version", "mapData", "countDocs", "count_docs", "getDoc", "satellite", "options", "rest", "identity", "getAnyIdentity", "DEFAULT_READ_OPTIONS", "getManyDocs", "setDoc", "setManyDocs", "deleteDoc", "deleteManyDocs", "deleteFilteredDocs", "filter", "listDocs", "countDocs", "initUser", "provider", "user", "userId", "loadUser", "nonNullish", "createUser", "error", "t", "O_", "userOnCreateError", "getUser", "identity", "getIdentity", "isNullish", "InitError", "getDoc", "rest", "setDoc", "loadAuth", "authenticateWithAuthClient", "user", "loadUser", "AuthStore", "loadAuthWithUser", "envSatelliteId", "viteEnvSatelliteId", "envContainer", "viteEnvContainer", "envGoogleClientId", "viteEnvGoogleClientId", "isEmptyString", "isNullish", "nonNullish", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "II_DESIGN_V1_POPUP", "II_DESIGN_V2_POPUP", "INTERNET_COMPUTER_ORG", "IC0_APP", "ID_AI", "isNullish", "popupCenter", "width", "height", "p", "isNullish", "innerWidth", "innerHeight", "y", "x", "isNullish", "ERROR_USER_INTERRUPT", "execute", "fn", "step", "onProgress", "result", "err", "AuthClientSignInProgressStep", "AuthClientProvider", "options", "authClient", "initAuth", "execute", "#loginWithAuthClient", "resolve", "reject", "isNullish", "SignInInitError", "error", "ERROR_USER_INTERRUPT", "SignInUserInterruptError", "SignInError", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "InternetIdentityProvider", "AuthClientProvider", "#domain", "domain", "windowed", "identityProvider", "container", "EnvStore", "isNullish", "identityV1Domain", "INTERNET_COMPUTER_ORG", "IC0_APP", "isEmptyString", "env", "internetIdentityId", "nonNullish", "DOCKER_INTERNET_IDENTITY_ID", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "popupCenter", "hostname", "ID_AI", "II_DESIGN_V2_POPUP", "II_DESIGN_V1_POPUP", "isNullish", "InvalidUrlError", "ContextUndefinedError", "FedCMIdentityCredentialUndefinedError", "FedCMIdentityCredentialInvalidError", "AuthenticationError", "AuthenticationUrlHashError", "AuthenticationInvalidStateError", "AuthenticationUndefinedJwtError", "GetDelegationError", "GetDelegationRetryError", "fromNullable", "Delegation", "ECDSAKeyIdentity", "DelegationChain", "DelegationIdentity", "getAuthActor", "auth", "identity", "getSatelliteActor", "getConsoleActor", "authenticate", "actorParams", "args", "getDelegation", "get_delegation", "generateIdentity", "delegations", "sessionKey", "userKey", "signedDelegations", "delegationChain", "authenticateSession", "jwt", "context", "ECDSAKeyIdentity", "publicKey", "data", "caller", "salt", "result", "AuthenticationError", "expiration", "rest", "signedDelegation", "retryGetDelegation", "delegation", "signature", "pubkey", "signedExpiration", "targets", "Delegation", "fromNullable", "maxRetries", "i", "resolve", "Err", "GetDelegationError", "GetDelegationRetryError", "CONTEXT_KEY", "GOOGLE_PROVIDER", "isNullish", "Ed25519KeyIdentity", "arrayBufferToUint8Array", "uint8ArrayToBase64", "base64ToUint8Array", "toBase64URL", "uint8Array", "generateSalt", "buildNonce", "salt", "caller", "principal", "bytes", "hash", "generateNonce", "JSON_KEY_CALLER", "JSON_KEY_SALT", "JSON_KEY_STATE", "stringifyContext", "state", "data", "parseContext", "jsonData", "jsonCaller", "jsonSalt", "generateRandomState", "initContext", "nonce", "storedData", "CONTEXT_KEY", "loadContext", "storedContext", "ContextUndefinedError", "isEmptyString", "authenticate", "params", "context", "loadContext", "jwt", "auth", "authenticateSession", "authenticateWithRedirect", "hash", "AuthenticationUrlHashError", "state", "idToken", "savedState", "AuthenticationInvalidStateError", "AuthenticationUndefinedJwtError", "isNullish", "notEmptyString", "requestJwtWithRedirect", "authUrl", "clientId", "nonce", "loginHint", "authScopes", "state", "redirectUrl", "requestUrl", "InvalidUrlError", "currentUrl", "requestWithCredentials", "configURL", "domainHint", "identityCredential", "FedCMIdentityCredentialUndefinedError", "type", "FedCMIdentityCredentialInvalidError", "jwt", "requestJwt", "google", "context", "initContext", "credentials", "configUrl", "GOOGLE_PROVIDER", "requestWithCredentials", "redirect", "authUrl", "authScopes", "requestJwtWithRedirect", "handleRedirectCallback", "satelliteId", "EnvStore", "isNullish", "SignInInitError", "container", "delegationChain", "sessionKey", "identity", "doc", "P", "AuthClientStore", "user", "fromDoc", "loadAuthWithUser", "onBeforeUnload", "$event", "addBeforeUnload", "removeBeforeUnload", "executeWithWindowGuard", "fn", "isNullish", "GoogleProvider", "options", "clientId", "envGoogleClientId", "isNullish", "SignInMissingClientIdError", "redirect", "d", "isNullish", "uint8ArrayToBase64", "IdbStorage", "KEY_STORAGE_DELEGATION", "KEY_STORAGE_KEY", "AnonymousIdentity", "DelegationChain", "DelegationIdentity", "DER_COSE_OID", "ECDSAKeyIdentity", "unwrapDER", "nonNullish", "uint8ArrayToArrayOfNumber", "createWebAuthnUser", "delegationIdentity", "passkeyIdentity", "satelliteId", "aaguid", "user", "_", "setManyDocs", "nonNullish", "uint8ArrayToArrayOfNumber", "WebAuthnSignInProgressStep", "WebAuthnSignUpProgressStep", "WebAuthnProvider", "onProgress", "maxTimeToLiveInMilliseconds", "passkeyOptions", "loadAuthWithUser", "satelliteId", "EnvStore", "isNullish", "SignInInitError", "onSignProgress", "step", "state", "B", "passkeyIdentity", "execute", "F", "delegationIdentity", "sessionKey", "#createSessionDelegation", "user", "createWebAuthnUser", "#saveSessionIdentityForAuthClient", "loadAuth", "retrievePublicKey", "credentialId", "doc", "getDoc", "uint8ArrayToBase64", "AnonymousIdentity", "WebAuthnSignInRetrievePublicKeyError", "data", "publicKey", "unwrapDER", "DER_COSE_OID", "identity", "ECDSAKeyIdentity", "sessionLengthInMilliseconds", "chain", "DelegationChain", "DelegationIdentity", "storage", "IdbStorage", "KEY_STORAGE_KEY", "KEY_STORAGE_DELEGATION", "createAuth", "provider", "authenticateWithAuthClient", "user", "initUser", "AuthStore", "signIn", "options", "signInOptions", "signInWithContext", "GoogleProvider", "context", "WebAuthnProvider", "loadAuth", "iiOptions", "domain", "InternetIdentityProvider", "AuthClientStore", "SignInProviderNotSupportedError", "fn", "executeWithWindowGuard", "signUp", "options", "fn", "signUpWithProvider", "executeWithWindowGuard", "signUpOptions", "WebAuthnProvider", "loadAuthWithUser", "SignUpProviderNotSupportedError", "isWebAuthnUser", "user", "isGoogleUser", "getSatelliteExtendedActor", "idlFactory", "satellite", "identity", "getAnyIdentity", "fromNullable", "nonNullish", "fromNullable", "assertNonNullish", "toNullable", "uploadAsset", "data", "headers", "restAsset", "actor", "progress", "init_asset_upload", "upload_asset_chunk", "commit_asset_upload", "batchId", "mapInitAssetUploadParams", "chunkIds", "uploadChunks", "commitAsset", "mapInitAssetUploadParams", "filename", "collection", "token", "fullPath", "encoding", "description", "toNullable", "mapCommitBatch", "batchId", "chunkIds", "headers", "data", "contentType", "type", "_", "chunk_id", "commitAsset", "commitFn", "rest", "commitBatch", "uploadChunks", "uploadFn", "clone", "isBrowser", "orderId", "start", "chunk", "results", "batchUploadChunks", "limit", "i", "batch", "params", "uploadChunk", "uploadAsset", "asset", "rest", "actor", "getSatelliteActor", "K", "listAssets", "collection", "filter", "list_assets", "assets", "items_length", "items_page", "matches_length", "matches_pages", "toListParams", "_", "fromNullable", "countAssets", "count_assets", "deleteAsset", "fullPath", "deleteManyAssets", "satellite", "del_many_assets", "payload", "deleteFilteredAssets", "del_filtered_assets", "getAsset", "get_asset", "getManyAssets", "get_many_assets", "resultAsset", "sha256ToBase64String", "sha256", "c", "uploadBlob", "params", "uploadAssetIC", "uploadFile", "storageFilename", "data", "collection", "headers", "storagePath", "token", "satelliteOptions", "encoding", "description", "identity", "getAnyIdentity", "filename", "fullPath", "satellite", "uploadAsset", "downloadUrl", "listAssets", "filter", "options", "items", "rest", "DEFAULT_READ_OPTIONS", "assets", "t", "name", "owner", "encodings", "created_at", "updated_at", "fromNullable", "acc", "type", "modified", "sha256", "total_length", "sha256ToBase64String", "countAssets", "deleteAsset", "deleteManyAssets", "deleteFilteredAssets", "getAsset", "getManyAssets", "satelliteUrl", "nonNullish", "parseEnv", "userEnv", "satelliteId", "envSatelliteId", "assertNonNullish", "container", "envContainer", "initJuno", "initSatellite", "env", "EnvStore", "loadAuth", "authSubscribe", "initAuthTimeoutWorker", "onAuthStateChange", "callback", "AuthStore"]
}
