{"version":3,"file":"prisma.cjs","names":["Prisma","createFraciCache","FraciError","fraciBinary","fraciString"],"sources":["../../src/prisma/common.ts","../../src/prisma/constants.ts","../../src/prisma/extension.ts","../../src/prisma/schema.ts"],"sourcesContent":["/**\n * The Prisma conflict error code.\n */\nconst PRISMA_CONFLICT_CODE = \"P2002\";\n\n/**\n * {@link PrismaClientKnownRequestError} of the conflict error.\n */\nexport type PrismaClientConflictError = {\n  name: \"PrismaClientKnownRequestError\";\n  code: typeof PRISMA_CONFLICT_CODE;\n  meta: {\n    modelName?: string;\n    target?: string[];\n    driverAdapterError?: {\n      cause?: {\n        constraint?: {\n          fields?: string[];\n        };\n      };\n    };\n  };\n};\n\n/**\n * Checks if the error is a conflict error for the fractional index.\n *\n * This is important for handling unique constraint violations when inserting items\n * with the same fractional index, which can happen in concurrent environments.\n *\n * @param error - The error object to check.\n * @param modelName - The model name.\n * @param field - The field name of the fractional index.\n * @returns `true` if the error is a conflict error for the fractional index, or `false` otherwise.\n */\nexport function isIndexConflictError(\n  error: unknown,\n  modelName: string,\n  field: string,\n): error is PrismaClientConflictError {\n  const meta = (error as any)?.meta;\n  const target =\n    meta?.target ?? meta?.driverAdapterError?.cause?.constraint?.fields;\n\n  return (\n    error instanceof Error &&\n    error.name === \"PrismaClientKnownRequestError\" &&\n    (error as any).code === PRISMA_CONFLICT_CODE && // P2002 is the Prisma code for unique constraint violations\n    // Prisma 5.0 does not include modelName in P2002 metadata.\n    (meta?.modelName === undefined || meta.modelName === modelName) &&\n    Array.isArray(target) && // Check if the target field is specified\n    target.includes(field) // Check if the target includes our fractional index field\n  );\n}\n","/**\n * The extension name for the Prisma fractional indexing extension.\n */\nexport const EXTENSION_NAME = \"fraci\";\n","import { Prisma } from \"@prisma/client/extension.js\";\nimport {\n  createFraciCache,\n  DEFAULT_MAX_LENGTH,\n  DEFAULT_MAX_RETRIES,\n  fraciBinary,\n  fraciString,\n  type AnyFraci,\n  type Fraci,\n} from \"../factory.js\";\nimport { FraciError } from \"../lib/errors.js\";\nimport type { AnyFractionalIndex, FractionalIndex } from \"../lib/types.js\";\nimport type { FraciOf } from \"../types.js\";\nimport {\n  isIndexConflictError,\n  type PrismaClientConflictError,\n} from \"./common.js\";\nimport { EXTENSION_NAME } from \"./constants.js\";\nimport type {\n  AllModelFieldName,\n  BinaryModelFieldName,\n  ModelKey,\n  ModelScalarPayload,\n  QueryArgs,\n  StringModelFieldName,\n} from \"./prisma-types.js\";\nimport type { PrismaFraciFieldOptions, PrismaFraciOptions } from \"./schema.js\";\n\ntype AnyPrismaClient = any;\n\n/**\n * A brand for Prisma models and fields.\n *\n * @template Model - The model name\n * @template Field - The field name\n */\ntype PrismaBrand<Model extends string, Field extends string> = {\n  readonly __prisma__: { model: Model; field: Field };\n};\n\n/**\n * A tuple of two fractional indices, used for generating a new index between them.\n *\n * @template FI - The fractional index type\n */\ntype Indices<FI extends AnyFractionalIndex> = [a: FI | null, b: FI | null];\n\n/**\n * The subset of a Prisma client needed to query a configured model. Both a\n * full Prisma client and an interactive transaction client satisfy this type.\n */\ntype PrismaQueryClient<Client, Model extends ModelKey<Client>> =\n  Client extends Record<Model, object> ? Record<Model, object> : never;\n\n/**\n * Type representing the enhanced fractional indexing utility for Prisma ORM.\n * This type extends the base fractional indexing utility with additional methods for retrieving indices.\n *\n * This is an internal type used to define the methods for the Prisma extension.\n *\n * @template Client - The Prisma client type\n * @template Model - The model name\n * @template Where - The type of the required fields for the `where` argument of the `findMany` method\n * @template FI - The fractional index type\n *\n * @see {@link Fraci} - The base fractional indexing utility type\n */\ntype FraciForPrismaInternal<\n  Client,\n  Model extends ModelKey<Client>,\n  Where,\n  FI extends AnyFractionalIndex,\n> = FraciOf<FI> & {\n  /**\n   * Checks if the error is a conflict error for the fractional index.\n   *\n   * @param error - The error to check.\n   * @returns `true` if the error is a conflict error for the fractional index, or `false` otherwise.\n   */\n  isIndexConflictError(error: unknown): error is PrismaClientConflictError;\n  /**\n   * Retrieves the existing indices to generate a new fractional index for the item after the specified item.\n   *\n   * @param where - The `where` argument of the `findMany` method. Must have the fields specified in the {@link PrismaFraciFieldOptions.group group} property of the field options.\n   * @param cursor - The cursor (selector) of the item. If `null`, this method returns the indices to generate a new fractional index for the first item.\n   * @param client - The Prisma client to use. Should be specified when using transactions. If not specified, the client used to create the extension is used.\n   * @returns The indices to generate a new fractional index for the item after the specified item, or `undefined` if the item specified by the `cursor` does not exist.\n   */\n  indicesForAfter: {\n    (\n      where: Where & QueryArgs<Client, Model>[\"where\"],\n      cursor: QueryArgs<Client, Model>[\"cursor\"],\n      client?: PrismaQueryClient<Client, Model>,\n    ): Promise<Indices<FI> | undefined>;\n    (\n      where: Where & QueryArgs<Client, Model>[\"where\"],\n      cursor: null,\n      client?: PrismaQueryClient<Client, Model>,\n    ): Promise<Indices<FI>>;\n  };\n  /**\n   * Retrieves the existing indices to generate a new fractional index for the item before the specified item.\n   *\n   * @param where - The `where` argument of the `findMany` method. Must have the fields specified in the {@link PrismaFraciFieldOptions.group group} property of the field options.\n   * @param cursor - The cursor (selector) of the item. If `null`, this method returns the indices to generate a new fractional index for the last item.\n   * @param client - The Prisma client to use. Should be specified when using transactions. If not specified, the client used to create the extension is used.\n   * @returns The indices to generate a new fractional index for the item before the specified item, or `undefined` if the item specified by the `cursor` does not exist.\n   */\n  indicesForBefore: {\n    (\n      where: Where & QueryArgs<Client, Model>[\"where\"],\n      cursor: QueryArgs<Client, Model>[\"cursor\"],\n      client?: PrismaQueryClient<Client, Model>,\n    ): Promise<Indices<FI> | undefined>;\n    (\n      where: Where & QueryArgs<Client, Model>[\"where\"],\n      cursor: null,\n      client?: PrismaQueryClient<Client, Model>,\n    ): Promise<Indices<FI>>;\n  };\n  /**\n   * Retrieves the existing indices to generate a new fractional index for the first item.\n   * Equivalent to {@link FraciForPrismaInternal.indicesForAfter `indicesForAfter(where, null, client)`}.\n   *\n   * @param where - The `where` argument of the `findMany` method. Must have the fields specified in the {@link PrismaFraciOptions.group group} property of the field options.\n   * @param client - The Prisma client to use. Should be specified when using transactions. If not specified, the client used to create the extension is used.\n   * @returns The indices to generate a new fractional index for the first item.\n   */\n  indicesForFirst(\n    where: Where & QueryArgs<Client, Model>[\"where\"],\n    client?: PrismaQueryClient<Client, Model>,\n  ): Promise<Indices<FI>>;\n  /**\n   * Retrieves the existing indices to generate a new fractional index for the last item.\n   * Equivalent to {@link FraciForPrismaInternal.indicesForBefore `indicesForBefore(where, null, client)`}.\n   *\n   * @param where - The `where` argument of the `findMany` method. Must have the fields specified in the {@link PrismaFraciOptions.group group} property of the field options.\n   * @param client - The Prisma client to use. Should be specified when using transactions. If not specified, the client used to create the extension is used.\n   * @returns The indices to generate a new fractional index for the last item.\n   */\n  indicesForLast(\n    where: Where & QueryArgs<Client, Model>[\"where\"],\n    client?: PrismaQueryClient<Client, Model>,\n  ): Promise<Indices<FI>>;\n};\n\n/**\n * Type representing the enhanced fractional indexing utility for Prisma ORM.\n * This type extends the base fractional indexing utility with additional methods for retrieving indices.\n *\n * @template Client - The Prisma client type\n * @template Options - The field options type\n * @template Model - The model name\n * @template Field - The field name\n *\n * @see {@link Fraci} - The main fractional indexing utility type\n */\ntype FraciForPrismaByFieldOptions<\n  Client,\n  Options extends PrismaFraciFieldOptions,\n  Model extends ModelKey<Client>,\n  Field extends\n    | BinaryModelFieldName<Client, Model>\n    | StringModelFieldName<Client, Model>,\n> = FraciForPrismaInternal<\n  Client,\n  Model,\n  Pick<\n    ModelScalarPayload<Client, Model>,\n    Extract<Options[\"group\"][number], AllModelFieldName<Client, Model>>\n  >,\n  Field extends BinaryModelFieldName<Client, Model>\n    ? Options extends { readonly type: \"binary\" }\n      ? FractionalIndex<Options, PrismaBrand<Model, Field>>\n      : never\n    : Options extends {\n          readonly lengthBase: string;\n          readonly digitBase: string;\n        }\n      ? FractionalIndex<\n          {\n            readonly type: \"string\";\n            readonly lengthBase: Options[\"lengthBase\"];\n            readonly digitBase: Options[\"digitBase\"];\n          },\n          PrismaBrand<Model, Field>\n        >\n      : never\n>;\n\n/**\n * Type representing the enhanced fractional indexing utility for Prisma ORM.\n * This type extends the base fractional indexing utility with additional methods for retrieving indices.\n *\n * @template Client - The Prisma client type\n * @template Options - The options type\n * @template QualifiedField - The qualified field name\n *\n * @see {@link Fraci} - The main fractional indexing utility type\n */\nexport type FraciForPrisma<\n  Client,\n  Options extends PrismaFraciOptions<Client>,\n  QualifiedField extends keyof Options[\"fields\"],\n> = Options[\"fields\"][QualifiedField] extends PrismaFraciFieldOptions\n  ? QualifiedField extends `${infer M extends ModelKey<Client>}.${infer F}`\n    ? F extends BinaryModelFieldName<Client, M>\n      ? FraciForPrismaByFieldOptions<\n          Client,\n          Options[\"fields\"][QualifiedField],\n          M,\n          F\n        >\n      : F extends StringModelFieldName<Client, M>\n        ? FraciForPrismaByFieldOptions<\n            Client,\n            Options[\"fields\"][QualifiedField],\n            M,\n            F\n          >\n        : never\n    : never\n  : never;\n\n/**\n * A union of the pairs of the key and value of the {@link PrismaFraciOptions.fields fields} property of the options.\n *\n * @template Client - The Prisma client type\n * @template Options - The options type\n *\n * @example [\"article.fi\", { group: [\"userId\"], lengthBase: \"0123456789\", digitBase: \"0123456789\" }] | [\"photo.fi\", { group: [\"userId\"], lengthBase: \"0123456789\", digitBase: \"0123456789\" }] | ...\n */\ntype FieldsUnion<Client, Options extends PrismaFraciOptions<Client>> = {\n  [K in keyof Options[\"fields\"]]: [K, Options[\"fields\"][K]];\n}[keyof Options[\"fields\"]];\n\n/**\n * The field information for each model.\n *\n * @template Client - The Prisma client type\n * @template Options - The options type\n */\ntype PerModelFieldInfo<Client, Options extends PrismaFraciOptions<Client>> = {\n  [M in ModelKey<Client>]: {\n    [F in\n      | BinaryModelFieldName<Client, M>\n      | StringModelFieldName<Client, M> as `${M}.${F}` extends FieldsUnion<\n      Client,\n      Options\n    >[0]\n      ? F\n      : never]: {\n      readonly helper: Options[\"fields\"][`${M}.${F}`] extends PrismaFraciFieldOptions\n        ? FraciForPrismaByFieldOptions<\n            Client,\n            Options[\"fields\"][`${M}.${F}`],\n            M,\n            F\n          >\n        : never;\n    };\n  };\n};\n\n/**\n * [model component](https://www.prisma.io/docs/orm/prisma-client/client-extensions/model) of the Prisma extension.\n *\n * @template Client - The Prisma client type\n * @template Options - The options type\n */\ntype PrismaFraciExtensionModel<\n  Client,\n  Options extends PrismaFraciOptions<Client>,\n> = {\n  [M in keyof PerModelFieldInfo<Client, Options>]: {\n    fraci<F extends keyof PerModelFieldInfo<Client, Options>[M]>(\n      field: F,\n    ): PerModelFieldInfo<Client, Options>[M][F][\"helper\"];\n  };\n};\n\n/**\n * The type of our Prisma extension.\n *\n * @template Client - The Prisma client type\n * @template Options - The options type\n */\nexport type PrismaFraciExtension<\n  Client,\n  Options extends PrismaFraciOptions<Client>,\n> = {\n  name: typeof EXTENSION_NAME;\n  model: PrismaFraciExtensionModel<Client, Options>;\n};\n\n/**\n * {@link AnyFraci} for Prisma.\n */\ntype AnyFraciForPrisma = FraciForPrismaInternal<\n  any,\n  string,\n  any,\n  AnyFractionalIndex\n>;\n\n/**\n * Creates a Prisma extension for fractional indexing.\n *\n * @template Client - The Prisma client type\n * @template Options - The options type\n *\n * @param _clientOrConstructor - The Prisma client or constructor. Only used for type inference and not used at runtime.\n * @param options - The options for the fractional indexing extension\n * @returns The Prisma extension.\n * @throws {FraciError} Throws a {@link FraciError} when field information for a specified model.field cannot be retrieved\n * @throws {FraciError} Throws a {@link FraciError} when the digit or length base strings are invalid\n *\n * @see {@link FraciForPrisma} - The enhanced fractional indexing utility for Prisma ORM\n * @see {@link FraciError} - The custom error class for the Fraci library\n */\nexport function prismaFraci<\n  Client,\n  const Options extends PrismaFraciOptions<Client>,\n>(\n  _clientOrConstructor:\n    | (new (...args: any) => Client)\n    | ((...args: any) => Client)\n    | Client,\n  {\n    fields,\n    maxLength = DEFAULT_MAX_LENGTH,\n    maxRetries = DEFAULT_MAX_RETRIES,\n  }: Options,\n) {\n  return Prisma.defineExtension((client) => {\n    // Create a shared cache for better performance across multiple fields\n    const cache = createFraciCache();\n\n    // Map to store helper instances for each model.field combination\n    const helperMap = new Map<string, AnyFraciForPrisma>();\n\n    // Process each field configuration from the options\n    for (const [modelAndField, config] of Object.entries(fields) as [\n      string,\n      PrismaFraciFieldOptions,\n    ][]) {\n      // Split the \"model.field\" string into separate parts\n      const [model, field] = modelAndField.split(\".\", 2) as [\n        ModelKey<Client>,\n        string,\n      ];\n\n      // Get the actual model name from Prisma metadata\n      const { modelName } = (client as any)[model]?.fields?.[field] ?? {};\n      if (!modelName) {\n        if (globalThis.__DEV__) {\n          console.error(`FraciError: [INITIALIZATION_FAILED] Could not get field information for ${model}.${field}.\nMake sure that\n- The model and field names are correct and exist in the Prisma schema\n- The Prisma client is generated with the correct schema\n- The Prisma version is compatible with the extension`);\n        }\n\n        throw new FraciError(\n          \"INITIALIZATION_FAILED\",\n          `Could not get field information for ${model}.${field}`,\n        );\n      }\n\n      // Create the base fractional indexing helper\n      const helper =\n        config.type === \"binary\"\n          ? fraciBinary({\n              maxLength,\n              maxRetries,\n            })\n          : fraciString(\n              {\n                ...config,\n                maxLength,\n                maxRetries,\n              },\n              cache,\n            );\n\n      /**\n       * Internal function to retrieve indices for positioning items.\n       * This function queries the database to find the appropriate indices\n       * for inserting an item before or after a specified cursor position.\n       *\n       * @param where - The where clause to filter items by group\n       * @param cursor - The cursor position, or null for first/last position\n       * @param direction - The direction to search for indices (asc/desc)\n       * @param tuple - A function to create a tuple from two indices\n       * @param pClient - The Prisma client to use\n       * @returns A tuple of indices, or undefined if the cursor doesn't exist\n       */\n      const indicesFor = async (\n        where: any,\n        cursor: any,\n        direction: \"asc\" | \"desc\",\n        tuple: <T>(a: T, b: T) => [T, T],\n        pClient: AnyPrismaClient = client,\n      ): Promise<any> => {\n        // Case 1: No cursor provided - get the first/last item in the group\n        if (!cursor) {\n          const item = await pClient[model].findFirst({\n            where, // Filter by group conditions\n            select: { [field]: true }, // Only select the fractional index field\n            orderBy: { [field]: direction }, // Order by the fractional index in appropriate direction\n          });\n\n          // We should always return a tuple of two indices if `cursor` is `null`.\n          // For after: [null, firstItem]\n          // For before: [lastItem, null]\n          return tuple(null, item?.[field] ?? null);\n        }\n\n        // Case 2: Cursor provided - find items adjacent to the cursor\n        const items = await pClient[model].findMany({\n          cursor, // Start from the cursor position\n          where, // Filter by group conditions\n          select: { [field]: true }, // Only select the fractional index field\n          orderBy: { [field]: direction }, // Order by the fractional index in appropriate direction\n          take: 2, // Get the cursor item and the adjacent item\n        });\n\n        return items.length < 1\n          ? // Return undefined if cursor not found\n            undefined\n          : // Return the indices in the appropriate order based on direction\n            tuple(items[0][field], items[1]?.[field] ?? null);\n      };\n\n      // Function to find indices for inserting an item after a specified cursor\n      const indicesForAfter = (\n        where: any,\n        cursor: any,\n        pClient?: AnyPrismaClient,\n      ): Promise<any> =>\n        indicesFor(where, cursor, \"asc\", (a, b) => [a, b], pClient);\n\n      // Function to find indices for inserting an item before a specified cursor\n      const indicesForBefore = (\n        where: any,\n        cursor: any,\n        pClient?: AnyPrismaClient,\n      ): Promise<any> =>\n        indicesFor(where, cursor, \"desc\", (a, b) => [b, a], pClient);\n\n      // Create an enhanced helper with Prisma-specific methods\n      const helperEx: AnyFraciForPrisma = {\n        ...(helper as AnyFraci), // Include all methods from the base fraci helper\n        isIndexConflictError: (\n          error: unknown,\n        ): error is PrismaClientConflictError =>\n          isIndexConflictError(error, modelName, field),\n        indicesForAfter,\n        indicesForBefore,\n        indicesForFirst: (where: any, pClient?: AnyPrismaClient) =>\n          indicesForAfter(where, null, pClient),\n        indicesForLast: (where: any, pClient?: AnyPrismaClient) =>\n          indicesForBefore(where, null, pClient),\n      };\n\n      // Store the helper in the map with a unique key combining model and field\n      helperMap.set(`${model}\\0${field}`, helperEx);\n    }\n\n    // Create the extension model object that will be attached to each Prisma model\n    const extensionModel = Object.create(null) as Record<\n      ModelKey<Client>,\n      unknown\n    >;\n\n    // Iterate through all models in the Prisma client\n    for (const model of Object.keys(client) as ModelKey<Client>[]) {\n      // Skip internal Prisma properties that start with $ or _\n      if (model.startsWith(\"$\") || model.startsWith(\"_\")) {\n        continue;\n      }\n\n      // Add the fraci method to each model\n      extensionModel[model] = {\n        // This method retrieves the appropriate helper for the specified field\n        fraci(field: string) {\n          return helperMap.get(`${model}\\0${field}`)!;\n        },\n      };\n    }\n\n    // Register the extension with Prisma\n    return client.$extends({\n      name: EXTENSION_NAME,\n      model: extensionModel,\n    } as unknown as PrismaFraciExtension<Client, Options>);\n  });\n}\n","import type { QualifiedFields } from \"./prisma-types.js\";\n\n/**\n * The options for the binary fractional index fields.\n *\n * @template Group - The type of the name of the group fields\n *\n * @example { type: \"binary\", group: [\"userId\"] }\n *\n * @see {@link PrismaFraciFieldOptions} - The unified type for fractional index field options\n * @see {@link PrismaFraciFieldOptionsString} - The string fractional index field options\n * @see {@link PrismaFraciOptions} - The options for the fractional indexing extension\n */\nexport interface PrismaFraciFieldOptionsBinary<Group extends string = string> {\n  /**\n   * The type of the fractional index.\n   * Must be \"binary\" for binary fractional indices.\n   */\n  readonly type: \"binary\";\n\n  /**\n   * The fields that define the grouping context for the fractional index.\n   * This is an array of field names.\n   */\n  readonly group: readonly Group[];\n}\n\n/**\n * The options for the string fractional index fields.\n *\n * @template Group - The type of the name of the group fields\n *\n * @example { group: [\"userId\"], lengthBase: \"0123456789\", digitBase: \"0123456789\" }\n *\n * @see {@link PrismaFraciFieldOptions} - The unified type for fractional index field options\n * @see {@link PrismaFraciFieldOptionsBinary} - The binary fractional index field options\n * @see {@link PrismaFraciOptions} - The options for the fractional indexing extension\n */\nexport interface PrismaFraciFieldOptionsString<Group extends string = string> {\n  /**\n   * The type of the fractional index.\n   * Must be \"string\" or `undefined` for string fractional indices.\n   */\n  readonly type?: \"string\" | undefined;\n\n  /**\n   * The fields that define the grouping context for the fractional index.\n   * This is an array of field names.\n   */\n  readonly group: readonly Group[];\n\n  /**\n   * The character set used for encoding the length of the integer part.\n   */\n  readonly lengthBase: string;\n\n  /**\n   * The character set used for representing digits in the fractional index.\n   */\n  readonly digitBase: string;\n}\n\n/**\n * The options for the fractional index fields.\n *\n * @template Group - The type of the name of the group fields\n *\n * @example { group: [\"userId\", \"title\"], lengthBase: \"0123456789\", digitBase: \"0123456789\" }\n *\n * @see {@link PrismaFraciFieldOptionsBinary} - The binary fractional index field options\n * @see {@link PrismaFraciFieldOptionsString} - The string fractional index field options\n * @see {@link PrismaFraciOptions} - The options for the fractional indexing extension\n */\nexport type PrismaFraciFieldOptions<\n  Group extends string = string,\n  Mode extends \"binary\" | \"string\" = \"binary\" | \"string\",\n> = {\n  readonly binary: PrismaFraciFieldOptionsBinary<Group>;\n  readonly string: PrismaFraciFieldOptionsString<Group>;\n}[Mode];\n\n/**\n * The record of the fractional index fields.\n *\n * @template Client - The Prisma client type\n *\n * @example { \"article.fi\": { group: [\"userId\"], lengthBase: \"0123456789\", digitBase: \"0123456789\" } }\n *\n * @see {@link PrismaFraciFieldOptions} - The unified type for fractional index field options\n * @see {@link PrismaFraciOptions} - The options for the fractional indexing extension\n */\nexport type PrismaFraciFieldOptionsRecord<Client> = {\n  readonly [Q in QualifiedFields<Client>[0]]?:\n    | PrismaFraciFieldOptions<\n        Extract<QualifiedFields<Client>, [Q, any, any]>[1],\n        Extract<QualifiedFields<Client>, [Q, any, any]>[2]\n      >\n    | undefined;\n};\n\n/**\n * The options for the fractional indexing extension.\n *\n * @template Client - The Prisma client type\n *\n * @example { fields: { \"article.fi\": { group: [\"userId\"], lengthBase: \"0123456789\", digitBase: \"0123456789\" } } }\n *\n * @see {@link PrismaFraciFieldOptions} - The unified type for fractional index field options\n * @see {@link PrismaFraciFieldOptionsRecord} - The record of the fractional index fields\n */\nexport interface PrismaFraciOptions<Client> {\n  /**\n   * The maximum number of retries to generate a fractional index.\n   *\n   * @default 5\n   */\n  readonly maxRetries?: number | undefined;\n\n  /**\n   * The maximum length of the fractional index.\n   *\n   * @default 50\n   */\n  readonly maxLength?: number | undefined;\n\n  /**\n   * The fractional index fields.\n   */\n  readonly fields: PrismaFraciFieldOptionsRecord<Client>;\n}\n\n/**\n * Creates a Prisma extension for fractional indexing.\n * This function defines the options for integrating fractional indexing\n * into a Prisma schema, including field configurations and performance settings.\n *\n * @template Client - The Prisma client type\n * @template Options - The options type\n *\n * @param _clientOrConstructor - The Prisma client or constructor. Only used for type inference and not used at runtime.\n * @param options - The options for the fractional indexing extension\n * @returns The options object with default values applied\n */\nexport function definePrismaFraci<\n  Client,\n  const Options extends PrismaFraciOptions<Client>,\n>(\n  _clientOrConstructor:\n    | (new (...args: any) => Client)\n    | ((...args: any) => Client)\n    | Client,\n  options: Options,\n): Options {\n  return options;\n}\n"],"mappings":"0JAmCA,SAAgB,EACd,EACA,EACA,EACoC,CACpC,IAAM,EAAQ,GAAe,KACvB,EACJ,GAAM,QAAU,GAAM,oBAAoB,OAAO,YAAY,OAE/D,OACE,aAAiB,OACjB,EAAM,OAAS,iCACd,EAAc,OAAS,UAEvB,GAAM,YAAc,IAAA,IAAa,EAAK,YAAc,IACrD,MAAM,QAAQ,CAAM,GACpB,EAAO,SAAS,CAAK,CAEzB,CE2QA,SAAgB,EAId,EAIA,CACE,SACA,YAAA,GACA,aAAA,GAEF,CACA,OAAOA,EAAAA,OAAO,gBAAiB,GAAW,CAExC,IAAM,EAAQC,EAAAA,EAAiB,EAGzB,EAAY,IAAI,IAGtB,IAAK,GAAM,CAAC,EAAe,KAAW,OAAO,QAAQ,CAAM,EAGtD,CAEH,GAAM,CAAC,EAAO,GAAS,EAAc,MAAM,IAAK,CAAC,EAM3C,CAAE,aAAe,EAAe,EAAM,EAAE,SAAS,IAAU,CAAC,EAClE,GAAI,CAAC,EASH,MAPE,QAAQ,MAAM,2EAA2E,EAAM,GAAG,EAAM;;;;sDAI5D,EAGxC,IAAIC,EAAAA,EACR,wBACA,uCAAuC,EAAM,GAAG,GAClD,EAIF,IAAM,EACJ,EAAO,OAAS,SACZC,EAAAA,EAAY,CACV,YACA,YACF,CAAC,EACDC,EAAAA,EACE,CACE,GAAG,EACH,YACA,YACF,EACA,CACF,EAcA,EAAa,MACjB,EACA,EACA,EACA,EACA,EAA2B,IACV,CAEjB,GAAI,CAAC,EAUH,OAAO,EAAM,MAAM,MATA,EAAQ,EAAM,CAAC,UAAU,CAC1C,QACA,OAAQ,EAAG,GAAQ,EAAK,EACxB,QAAS,EAAG,GAAQ,CAAU,CAChC,CAAC,EAAA,GAKyB,IAAU,IAAI,EAI1C,IAAM,EAAQ,MAAM,EAAQ,EAAM,CAAC,SAAS,CAC1C,SACA,QACA,OAAQ,EAAG,GAAQ,EAAK,EACxB,QAAS,EAAG,GAAQ,CAAU,EAC9B,KAAM,CACR,CAAC,EAED,OAAO,EAAM,OAAS,EAElB,IAAA,GAEA,EAAM,EAAM,EAAE,CAAC,GAAQ,EAAM,EAAE,GAAG,IAAU,IAAI,CACtD,EAGM,GACJ,EACA,EACA,IAEA,EAAW,EAAO,EAAQ,OAAQ,EAAG,IAAM,CAAC,EAAG,CAAC,EAAG,CAAO,EAGtD,GACJ,EACA,EACA,IAEA,EAAW,EAAO,EAAQ,QAAS,EAAG,IAAM,CAAC,EAAG,CAAC,EAAG,CAAO,EAGvD,EAA8B,CAClC,GAAI,EACJ,qBACE,GAEA,EAAqB,EAAO,EAAW,CAAK,EAC9C,kBACA,mBACA,iBAAkB,EAAY,IAC5B,EAAgB,EAAO,KAAM,CAAO,EACtC,gBAAiB,EAAY,IAC3B,EAAiB,EAAO,KAAM,CAAO,CACzC,EAGA,EAAU,IAAI,GAAG,EAAM,IAAI,IAAS,CAAQ,CAC9C,CAGA,IAAM,EAAiB,OAAO,OAAO,IAAI,EAMzC,IAAK,IAAM,KAAS,OAAO,KAAK,CAAM,EAEhC,EAAM,WAAW,GAAG,GAAK,EAAM,WAAW,GAAG,IAKjD,EAAe,GAAS,CAEtB,MAAM,EAAe,CACnB,OAAO,EAAU,IAAI,GAAG,EAAM,IAAI,GAAO,CAC3C,CACF,GAIF,OAAO,EAAO,SAAS,CACrB,KAAM,QACN,MAAO,CACT,CAAqD,CACvD,CAAC,CACH,CClWA,SAAgB,EAId,EAIA,EACS,CACT,OAAO,CACT"}