{
  "version": 3,
  "sources": ["../../../src/internal/Format/types.ts", "../../../src/internal/Format/date.ts", "../../../src/internal/Format/number.ts", "../../../src/internal/Format/object.ts", "../../../src/internal/Format/string.ts", "../../../src/internal/Format/format.ts", "../../../src/internal/Format/select.ts"],
  "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Function from 'effect/Function';\nimport type * as JSONSchema from 'effect/JSONSchema';\nimport * as Option from 'effect/Option';\nimport * as SchemaAST from 'effect/SchemaAST';\n\nimport { createAnnotationHelper } from '../Annotation/util';\nimport { type JsonSchemaType } from '../JsonSchema';\n\n// TODO(burdon): Rename PropertyType.\nexport type ScalarType =\n  | JSONSchema.JsonSchema7Object\n  | JSONSchema.JsonSchema7String\n  | JSONSchema.JsonSchema7Number\n  | JSONSchema.JsonSchema7Boolean\n  | JSONSchema.JsonSchema7Ref;\n\n// TODO(burdon): Rename ValueType and change to disciminated union.\n// export type ValueType = 'array' | 'object' | 'string' | 'number' | 'boolean' | 'ref';\nexport enum TypeEnum {\n  Array = 'array', // TODO(burdon): Remove?\n  Object = 'object',\n  String = 'string',\n  Number = 'number',\n  Boolean = 'boolean',\n  Ref = 'ref',\n}\n\n// TODO(burdon): Ref?\nexport const getTypeEnum = (property: JsonSchemaType): TypeEnum | undefined => {\n  switch (property.type) {\n    case 'array':\n      return TypeEnum.Array;\n    case 'object':\n      return TypeEnum.Object;\n    case 'string':\n      return TypeEnum.String;\n    case 'number':\n      return TypeEnum.Number;\n    case 'boolean':\n      return TypeEnum.Boolean;\n    default:\n      return undefined;\n  }\n};\n\n/**\n * https://json-schema.org/understanding-json-schema/reference/schema\n * https://json-schema.org/understanding-json-schema/reference/string#built-in-formats\n */\nexport const FormatAnnotationId = Symbol.for('@dxos/schema/annotation/Format');\n\nexport const FormatAnnotation = createAnnotationHelper<TypeFormat>(FormatAnnotationId);\n\n/** @deprecated */\nexport const getFormatAnnotation = (node: SchemaAST.AST): TypeFormat | undefined =>\n  Function.pipe(SchemaAST.getAnnotation<TypeFormat>(FormatAnnotationId)(node), Option.getOrUndefined);\n\n// TODO(burdon): Rename Format; Change to discriminated union?\nexport enum TypeFormat {\n  None = 'none',\n\n  //\n  // Scalar\n  //\n\n  String = 'string',\n  Number = 'number',\n  Boolean = 'boolean',\n  Ref = 'ref',\n\n  //\n  // { type: 'string' }\n  //\n\n  DID = 'did', // Users, etc.\n  DXN = 'dxn',\n  Email = 'email',\n  Formula = 'formula', // Spreadsheet formula.\n  Hostname = 'hostname',\n  JSON = 'json',\n  Markdown = 'markdown',\n  Regex = 'regex',\n  SingleSelect = 'single-select',\n  Text = 'text',\n  MultiSelect = 'multi-select',\n  URL = 'url',\n  UUID = 'uuid',\n\n  //\n  // { type: 'number' }\n  //\n\n  Currency = 'currency',\n  Integer = 'integer',\n  Percent = 'percent',\n  Timestamp = 'timestamp',\n\n  //\n  // { type: 'date' }\n  //\n\n  DateTime = 'date-time',\n  Date = 'date',\n  Time = 'time',\n  Duration = 'duration',\n\n  //\n  // { type: 'object' }\n  //\n\n  GeoPoint = 'lnglat',\n}\n\nexport const FormatEnums = Object.values(TypeFormat).sort();\n\nexport const PropertyKind = {\n  type: TypeEnum,\n  format: TypeFormat,\n};\n\n/**\n * Default formats\n */\nexport const typeToFormat: Partial<Record<TypeEnum, TypeFormat>> = {\n  [TypeEnum.String]: TypeFormat.String,\n  [TypeEnum.Number]: TypeFormat.Number,\n  [TypeEnum.Boolean]: TypeFormat.Boolean,\n};\n\n/**\n * Map of format to type.\n */\nexport const formatToType: Record<TypeFormat, TypeEnum> = {\n  [TypeFormat.None]: TypeEnum.String,\n  [TypeFormat.String]: TypeEnum.String,\n  [TypeFormat.Number]: TypeEnum.Number,\n  [TypeFormat.Boolean]: TypeEnum.Boolean,\n  [TypeFormat.Ref]: TypeEnum.Ref,\n\n  // Strings\n  [TypeFormat.DID]: TypeEnum.String,\n  [TypeFormat.DXN]: TypeEnum.String,\n  [TypeFormat.Email]: TypeEnum.String,\n  [TypeFormat.Formula]: TypeEnum.String,\n  [TypeFormat.Hostname]: TypeEnum.String,\n  [TypeFormat.JSON]: TypeEnum.String,\n  [TypeFormat.Markdown]: TypeEnum.String,\n  [TypeFormat.Regex]: TypeEnum.String,\n  [TypeFormat.URL]: TypeEnum.String,\n  [TypeFormat.UUID]: TypeEnum.String,\n  [TypeFormat.SingleSelect]: TypeEnum.String,\n  [TypeFormat.Text]: TypeEnum.String,\n  [TypeFormat.MultiSelect]: TypeEnum.Object,\n\n  // Dates\n  [TypeFormat.Date]: TypeEnum.String,\n  [TypeFormat.DateTime]: TypeEnum.String,\n  [TypeFormat.Duration]: TypeEnum.String,\n  [TypeFormat.Time]: TypeEnum.String,\n\n  // Numbers\n  [TypeFormat.Currency]: TypeEnum.Number,\n  [TypeFormat.Integer]: TypeEnum.Number,\n  [TypeFormat.Percent]: TypeEnum.Number,\n  [TypeFormat.Timestamp]: TypeEnum.Number,\n\n  // Objects\n  [TypeFormat.GeoPoint]: TypeEnum.Array,\n};\n\n/**\n * Allowed value options for select.\n */\nexport const OptionsAnnotationId = Symbol.for('@dxos/schema/annotation/Options');\n\n// TODO(wittjosiah): Reconcile with `SelectOption`.\nexport type Options = string | number;\nexport const OptionsAnnotation = createAnnotationHelper<Options[]>(OptionsAnnotationId);\n\n/** @deprecated */\nexport const getOptionsAnnotation = (node: SchemaAST.AST): Options[] | undefined =>\n  Function.pipe(SchemaAST.getAnnotation<Options[]>(OptionsAnnotationId)(node), Option.getOrUndefined);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as SchemaAST from 'effect/SchemaAST';\n\nimport { FormatAnnotation, TypeFormat } from './types';\n\n/**\n * Datetime values should be stored as ISO strings or unix numbers (ms) in UTC.\n *\n * NOTE: HyperFormula uses Excel's time format (null date 1900/01/01)\n * It can be configured to use a different parser via `parseDateTime`.\n * https://hyperformula.handsontable.com/guide/date-and-time-handling.html#date-and-time-handling\n * https://github.com/handsontable/hyperformula/blob/master/src/DateTimeHelper.ts\n */\n\n// TODO(burdon): Annotations not present in JSON.\n// TODO(burdon): Timezone.\n// TODO(burdon): Format for timestamp (Unix UTC or ISO 8601)?\n// TODO(burdon): Refs\n//  - https://www.npmjs.com/package/numfmt\n//  - https://date-fns.org/docs/Getting-Started\n//  - https://github.com/date-fns/tz\n\n/**\n * Simple date compatible with HF.\n */\nexport const SimpleDate = Schema.Struct({\n  year: Schema.Number.pipe(Schema.between(1900, 9999)),\n  month: Schema.Number.pipe(Schema.between(1, 12)),\n  day: Schema.Number.pipe(Schema.between(1, 31)),\n});\n\nexport type SimpleDate = Schema.Schema.Type<typeof SimpleDate>;\n\nexport const toSimpleDate = (date: Date): SimpleDate => ({\n  year: date.getUTCFullYear(),\n  month: date.getUTCMonth() + 1,\n  day: date.getUTCDate(),\n});\n\n/**\n * Simple time compatible with HF.\n */\nexport const SimpleTime = Schema.Struct({\n  hours: Schema.Number.pipe(Schema.between(0, 23)),\n  minutes: Schema.Number.pipe(Schema.between(0, 59)),\n  seconds: Schema.Number.pipe(Schema.between(0, 59)),\n});\n\nexport type SimpleTime = Schema.Schema.Type<typeof SimpleTime>;\n\nexport const toSimpleTime = (date: Date): SimpleTime => ({\n  hours: date.getUTCHours(),\n  minutes: date.getUTCSeconds(),\n  seconds: date.getUTCSeconds(),\n});\n\n/**\n * Simple date-time compatible with HF.\n */\nexport const SimpleDateTime = Schema.extend(SimpleDate, SimpleTime);\n\nexport type SimpleDateTime = Schema.Schema.Type<typeof SimpleDateTime>;\n\nexport const toSimpleDateTime = (date: Date): SimpleDateTime => ({\n  ...toSimpleDate(date),\n  ...toSimpleTime(date),\n});\n\n/**\n * https://effect.website/docs/guides/schema/transformations#date-transformations\n */\n\n// TODO(burdon): Consider if transformations should be supported with Automerge.\n\n/**\n * Format: 2018-11-13\n */\nexport const DateOnly = /* Schema.transformOrFail(Schema.String, SimpleDate, {\n  strict: true,\n  decode: (str, _, ast) => {\n    if (!isValidDateFormat(str)) {\n      return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected YYYY-MM-DD format'));\n    }\n    if (!isValidDate(str)) {\n      return ParseResult.fail(new ParseResult.Type(ast, str, 'Invalid date'));\n    }\n\n    const [year, month, day] = str.split('-').map(Number);\n    return ParseResult.succeed({ year, month, day });\n  },\n  encode: (date) => {\n    return ParseResult.succeed(\n      [\n        date.year.toString().padStart(4, '0'),\n        date.month.toString().padStart(2, '0'),\n        date.day.toString().padStart(2, '0'),\n      ].join('-'),\n    );\n  },\n}) */ Schema.String.pipe(\n  FormatAnnotation.set(TypeFormat.Date),\n  Schema.annotations({\n    description: 'Valid date in ISO format',\n  }),\n);\n\n/**\n * Format: 20:20:39+00:00\n */\nexport const TimeOnly = /* Schema.transformOrFail(Schema.String, SimpleTime, {\n  strict: true,\n  decode: (str, _, ast) => {\n    if (!isValidTimeFormat(str)) {\n      return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));\n    }\n\n    const [hours, minutes, seconds] = str.split(':').map(Number);\n    return ParseResult.succeed({ hours, minutes, seconds });\n  },\n  encode: (time) => {\n    return ParseResult.succeed(\n      [\n        time.hours.toString().padStart(2, '0'),\n        time.minutes.toString().padStart(2, '0'),\n        time.seconds.toString().padStart(2, '0'),\n      ].join(':'),\n    );\n  },\n}) */ Schema.String.pipe(\n  FormatAnnotation.set(TypeFormat.Time),\n  Schema.annotations({\n    description: 'Valid time in ISO format',\n  }),\n);\n\n/**\n * Format: 2018-11-13T20:20:39+00:00\n */\nexport const DateTime = /* Schema.transformOrFail(Schema.String, SimpleDateTime, {\n  strict: false,\n  decode: (str, _, ast) => {\n    const [date, time] = str.split('T');\n    if (!isValidDateFormat(date)) {\n      return ParseResult.fail(new ParseResult.Type(ast, date, 'Expected YYYY-MM-DD format'));\n    }\n    if (!isValidDate(date)) {\n      return ParseResult.fail(new ParseResult.Type(ast, date, 'Invalid date'));\n    }\n    if (!isValidTimeFormat(time)) {\n      return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));\n    }\n\n    const [year, month, day] = date.split('-').map(Number);\n    const [hours, minutes, seconds] = time.split(':').map(Number);\n    return ParseResult.succeed({ year, month, day, hours, minutes, seconds });\n  },\n  encode: (datetime) => {\n    return ParseResult.succeed(\n      [\n        [\n          datetime.year.toString().padStart(4, '0'),\n          datetime.month.toString().padStart(2, '0'),\n          datetime.day.toString().padStart(2, '0'),\n        ].join('-'),\n        [\n          datetime.hours.toString().padStart(2, '0'),\n          datetime.minutes.toString().padStart(2, '0'),\n          datetime.seconds.toString().padStart(2, '0'),\n        ].join(':'),\n      ].join('T'),\n    );\n  },\n}) */ Schema.String.pipe(\n  FormatAnnotation.set(TypeFormat.DateTime),\n  Schema.annotations({\n    description: 'Valid date and time in ISO format',\n  }),\n);\n\n/**\n * https://datatracker.ietf.org/doc/html/rfc3339#appendix-A\n */\n// TODO(burdon): Define duration type.\nexport const Duration = Schema.String.pipe(\n  FormatAnnotation.set(TypeFormat.Duration),\n  Schema.annotations({\n    description: 'Duration in ISO 8601 format',\n    [SchemaAST.ExamplesAnnotationId]: ['1h', '3D'],\n  }),\n);\n\n//\n// Utils\n//\n\n// YYYY-MM-DD\nconst DATE_REGEX = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst _isValidDateFormat = (str: string) => DATE_REGEX.test(str);\n\nconst _isValidDate = (str: string) => {\n  const date = new Date(str);\n  return !isNaN(date.getTime()) && date.toISOString().startsWith(str);\n};\n\n// HH:mm:ss\nconst TIME_REGEX = /^([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d)$/;\n\nconst _isValidTimeFormat = (str: string) => TIME_REGEX.test(str);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { FormatAnnotation, TypeFormat } from './types';\n\nconst encodeMultipleOf = (divisor: number) => 1 / Math.pow(10, divisor);\n\nconst encodeMultiple =\n  <A extends number>(divisor?: number) =>\n  <I, R>(self: Schema.Schema<A, I, R>) =>\n    divisor === undefined || divisor === 0 ? self : self.pipe(Schema.multipleOf(encodeMultipleOf(divisor)));\n\n/**\n * Convert number of digits to multipleOf annotation.\n */\nexport const DecimalPrecision = Schema.transform(Schema.Number, Schema.Number, {\n  strict: true,\n  encode: (value) => encodeMultipleOf(value),\n  decode: (value) => Math.log10(1 / value),\n}).annotations({\n  title: 'Number of digits',\n});\n\nexport const CurrencyAnnotationId = Symbol.for('@dxos/schema/annotation/Currency');\n\nexport type CurrencyAnnotation = {\n  decimals?: number;\n  code?: string;\n};\n\n/**\n * ISO 4217 currency code.\n */\nexport const Currency = ({ decimals, code }: CurrencyAnnotation = { decimals: 2 }) =>\n  Schema.Number.pipe(\n    encodeMultiple(decimals),\n    FormatAnnotation.set(TypeFormat.Currency),\n    Schema.annotations({\n      title: 'Currency',\n      description: 'Currency value',\n      ...(code ? { [CurrencyAnnotationId]: code.toUpperCase() } : {}),\n    }),\n  );\n\nexport type PercentAnnotation = {\n  decimals?: number;\n};\n\n/**\n * Integer.\n */\nexport const Integer = () =>\n  Schema.Number.pipe(\n    Schema.int(),\n    FormatAnnotation.set(TypeFormat.Integer),\n    Schema.annotations({\n      title: 'Integer',\n      description: 'Integer value',\n    }),\n  );\n\n/**\n * Percent.\n */\n// TODO(burdon): Define min/max (e.g., 0, 1).\nexport const Percent = ({ decimals }: PercentAnnotation = { decimals: 2 }) =>\n  Schema.Number.pipe(\n    encodeMultiple(decimals),\n    FormatAnnotation.set(TypeFormat.Percent),\n    Schema.annotations({\n      title: 'Percent',\n      description: 'Percentage value',\n    }),\n  );\n\n/**\n * Unix timestamp.\n * https://en.wikipedia.org/wiki/Unix_time\n */\nexport const Timestamp = Schema.Number.pipe(\n  FormatAnnotation.set(TypeFormat.Timestamp),\n  Schema.annotations({\n    title: 'Timestamp',\n    description: 'Unix timestamp',\n  }),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { clamp } from '@dxos/util';\n\nimport { FormatAnnotation, TypeFormat } from './types';\n\n/**\n * GeoJSON Format\n * https://datatracker.ietf.org/doc/html/rfc7946\n * https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1\n * https://en.wikipedia.org/wiki/Geographic_coordinate_system\n * https://geojson.org\n * {\n *   \"type\": \"Point\",\n *   \"coordinates\": [0, 51.47] // [longitude, latitude]\n * }\n * Note: optional third element for altitude.\n */\n/** Decimal places retained for stored coordinates (~1.1cm at the equator). */\nexport const GEO_PRECISION = 7;\n\nconst roundCoordinate = (value: number): number => {\n  const factor = 10 ** GEO_PRECISION;\n  return Math.round(value * factor) / factor;\n};\n\n/** Longitude/latitude clamped to range and rounded to {@link GEO_PRECISION} decimal places. */\nconst Coordinate = (min: number, max: number, title: string) =>\n  Schema.transform(Schema.Number.pipe(Schema.clamp(min, max)), Schema.Number, {\n    strict: true,\n    decode: roundCoordinate,\n    encode: roundCoordinate,\n  }).annotations({ title });\n\nexport const GeoPoint = Schema.Tuple(\n  Coordinate(-180, 180, 'Longitude'),\n  Coordinate(-90, 90, 'Latitude'),\n  Schema.optionalElement(Schema.Number).annotations({\n    title: 'Height ASL (m)',\n  }),\n).pipe(\n  FormatAnnotation.set(TypeFormat.GeoPoint),\n  Schema.annotations({\n    title: 'GeoPoint',\n    description: 'GeoJSON Position',\n  }),\n);\n\nexport type GeoPoint = Schema.Schema.Type<typeof GeoPoint>;\n\nexport type GeoLocation = {\n  longitude: number;\n  latitude: number;\n  height?: number;\n};\n\n/**\n * Geolocation utilities for working with GeoPoint format.\n */\nexport namespace GeoLocation {\n  /**\n   * Convert latitude and longitude to GeoPoint (GeoJSON format [longitude, latitude, height?]).\n   * Clamps values to valid ranges: latitude [-90, 90], longitude [-180, 180].\n   */\n  export const toGeoPoint = ({ longitude, latitude, height }: GeoLocation): GeoPoint => {\n    // TODO(ZaymonFC): Use schema validation instead of doing this manually.\n    // Clamp + round to match the `Format.GeoPoint` decode/encode path so both produce identical tuples.\n    const clampedLongitude = roundCoordinate(clamp(longitude, -180, 180));\n    const clampedLatitude = roundCoordinate(clamp(latitude, -90, 90));\n    return height !== undefined ? [clampedLongitude, clampedLatitude, height] : [clampedLongitude, clampedLatitude];\n  };\n\n  /**\n   * Extract latitude and longitude from GeoPoint (GeoJSON format [longitude, latitude, height?]).\n   */\n  export const fromGeoPoint = (geoPoint: GeoPoint | undefined): GeoLocation => {\n    if (!geoPoint) {\n      return { longitude: 0, latitude: 0 };\n    }\n\n    const result: GeoLocation = {\n      longitude: geoPoint[0],\n      latitude: geoPoint[1],\n    };\n\n    // Add height if defined.\n    if (geoPoint[2] !== undefined) {\n      result.height = geoPoint[2];\n    }\n\n    return result;\n  };\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as SchemaAST from 'effect/SchemaAST';\n\nimport { FormatAnnotation, TypeFormat } from './types';\n\n/**\n * Email address (RFC 5321)\n * https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.2\n */\nexport const Email = Schema.String.pipe(\n  Schema.pattern(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/),\n  FormatAnnotation.set(TypeFormat.Email),\n  Schema.annotations({\n    title: 'Email',\n    description: 'Email address',\n  }),\n);\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const Formula = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Formula));\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const Hostname = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Hostname));\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const JSON = Schema.String.pipe(FormatAnnotation.set(TypeFormat.JSON));\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const Markdown = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Markdown));\n\n/**\n * Regex\n * https://json-schema.org/understanding-json-schema/reference/regular_expressions\n * https://ecma-international.org/publications-and-standards/standards/ecma-262\n */\n// TODO(burdon): Implement.\nexport const Regex = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Regex));\n\n/**\n * Multi-line text.\n */\nexport const Text = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Text));\n\n/**\n * https://datatracker.ietf.org/doc/html/rfc3986#section-1.1.3\n */\nexport const URL = Schema.String.pipe(\n  Schema.pattern(/^(\\w+?:\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,6})([/\\w .-]*)*\\/?$/i),\n  FormatAnnotation.set(TypeFormat.URL),\n  Schema.annotations({\n    title: 'URL',\n    description: 'URL',\n  }),\n);\n\n/**\n * UUID (RFC 4122)\n * https://datatracker.ietf.org/doc/html/rfc4122\n */\nexport const UUID = Schema.UUID.pipe(\n  FormatAnnotation.set(TypeFormat.UUID),\n  Schema.annotations({\n    [SchemaAST.ExamplesAnnotationId]: ['3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a'],\n  }),\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Keys from '@dxos/keys';\n\nimport * as DateUtil from './date';\nimport * as NumberUtil from './number';\nimport * as ObjectUtil from './object';\nimport * as StringUtil from './string';\nimport { TypeFormat as TypeFormat$ } from './types';\n\n// TODO(burdon): Media encoding.\n// - https://json-schema.org/understanding-json-schema/reference/non_json_data\n\n/**\n * Formats.\n * https://json-schema.org/understanding-json-schema/reference/string#built-in-formats\n * NOTE: A JSON Schema validator will ignore any format type that it does not understand.\n */\n// TODO(burdon): Add fields for `examples`, `message`, etc.\nexport namespace Format {\n  export import TypeFormat = TypeFormat$;\n\n  // String\n  export const DXN = Keys.DXN.Schema;\n  export const Email = StringUtil.Email;\n  export const Formula = StringUtil.Formula;\n  export const Hostname = StringUtil.Hostname;\n  export const JSON = StringUtil.JSON;\n  export const Markdown = StringUtil.Markdown;\n  export const Regex = StringUtil.Regex;\n  export const URL = StringUtil.URL;\n  export const UUID = Schema.UUID;\n\n  // Numbers\n  // TODO(burdon): BigInt.\n  export const Currency = NumberUtil.Currency;\n  export const Integer = NumberUtil.Integer;\n  export const Percent = NumberUtil.Percent;\n  export const Timestamp = NumberUtil.Timestamp;\n\n  // Dates and times\n  export const Date = DateUtil.DateOnly;\n  export const DateTime = DateUtil.DateTime;\n  export const Duration = DateUtil.Duration;\n  export const Time = DateUtil.TimeOnly;\n\n  // Objects\n  export const GeoPoint = ObjectUtil.GeoPoint;\n  export type GeoPoint = ObjectUtil.GeoPoint; // TODO(burdon): Export types.\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\n/**\n * Schema for a single select option. Used to define choices in a {single|multi}-select field.\n */\nexport const SelectOption = Schema.Struct({\n  /** Stable identifier for the option. */\n  id: Schema.NonEmptyString,\n  title: Schema.String,\n  /** Color palette used for visual styling. */\n  color: Schema.String,\n});\n\nexport type SelectOption = Schema.Schema.Type<typeof SelectOption>;\n"],
  "mappings": ";;;;;AAIA,YAAYA,cAAc;AAE1B,YAAYC,YAAY;AACxB,YAAYC,eAAe;AAepB,IAAKC,WAAAA,0BAAAA,WAAAA;;;;;;;SAAAA;;AAUL,IAAMC,cAAc,CAACC,aAAAA;AAC1B,UAAQA,SAASC,MAAI;IACnB,KAAK;AACH,aAAA;IACF,KAAK;AACH,aAAA;IACF,KAAK;AACH,aAAA;IACF,KAAK;AACH,aAAA;IACF,KAAK;AACH,aAAA;IACF;AACE,aAAOC;EACX;AACF;AAMO,IAAMC,qBAAqBC,uBAAOC,IAAI,gCAAA;AAEtC,IAAMC,mBAAmBC,uBAAmCJ,kBAAAA;AAG5D,IAAMK,sBAAsB,CAACC,SACzBC,cAAeC,wBAA0BR,kBAAAA,EAAoBM,IAAAA,GAAcG,qBAAc;AAG7F,IAAKC,aAAAA,0BAAAA,aAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAAA;;AAuDL,IAAMC,cAAcC,OAAOC,OAAOH,UAAAA,EAAYI,KAAI;AAElD,IAAMC,eAAe;EAC1BjB,MAAMH;EACNqB,QAAQN;AACV;AAKO,IAAMO,eAAsD;EACj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OAAgBC;UAGhBC,WAAsBA;AAErC,GA9BiBtB,WAAAA,SAAAA,CAAAA,EAAAA;;;;ACnBjB,YAAYuB,aAAY;AAKjB,IAAMC,eAAsBC,eAAO;;EAExCC,IAAWC;EACXC,OAAcC;;EAEdC,OAAcD;AAChB,CAAA;",
  "names": ["Function", "Option", "SchemaAST", "TypeEnum", "getTypeEnum", "property", "type", "undefined", "FormatAnnotationId", "Symbol", "for", "FormatAnnotation", "createAnnotationHelper", "getFormatAnnotation", "node", "pipe", "getAnnotation", "getOrUndefined", "TypeFormat", "FormatEnums", "Object", "values", "sort", "PropertyKind", "format", "typeToFormat", "formatToType", "OptionsAnnotationId", "OptionsAnnotation", "getOptionsAnnotation", "Schema", "SchemaAST", "SimpleDate", "Struct", "year", "Number", "pipe", "between", "month", "day", "toSimpleDate", "date", "getUTCFullYear", "getUTCMonth", "getUTCDate", "SimpleTime", "hours", "minutes", "seconds", "toSimpleTime", "getUTCHours", "getUTCSeconds", "SimpleDateTime", "extend", "toSimpleDateTime", "DateOnly", "String", "FormatAnnotation", "set", "TypeFormat", "Date", "annotations", "description", "TimeOnly", "Time", "DateTime", "Duration", "ExamplesAnnotationId", "Schema", "encodeMultipleOf", "divisor", "Math", "pow", "encodeMultiple", "self", "undefined", "pipe", "multipleOf", "DecimalPrecision", "transform", "Number", "strict", "encode", "value", "decode", "log10", "annotations", "title", "CurrencyAnnotationId", "Symbol", "for", "Currency", "decimals", "code", "FormatAnnotation", "set", "TypeFormat", "description", "toUpperCase", "Integer", "int", "Percent", "Timestamp", "Schema", "clamp", "GEO_PRECISION", "roundCoordinate", "value", "factor", "Math", "round", "Coordinate", "min", "max", "title", "transform", "Number", "pipe", "clamp", "strict", "decode", "encode", "annotations", "GeoPoint", "Tuple", "optionalElement", "FormatAnnotation", "set", "TypeFormat", "description", "GeoLocation", "toGeoPoint", "longitude", "latitude", "height", "clampedLongitude", "clampedLatitude", "undefined", "fromGeoPoint", "geoPoint", "result", "Schema", "SchemaAST", "Email", "String", "pipe", "pattern", "FormatAnnotation", "set", "TypeFormat", "annotations", "title", "description", "Formula", "Hostname", "JSON", "Markdown", "Regex", "Text", "URL", "UUID", "ExamplesAnnotationId", "Schema", "Keys", "Format", "TypeFormat", "DXN", "Schema", "Email", "Formula", "Hostname", "JSON", "Markdown", "Regex", "URL", "UUID", "Currency", "Integer", "Percent", "Timestamp", "Date", "DateOnly", "DateTime", "Duration", "Time", "TimeOnly", "GeoPoint", "Schema", "SelectOption", "Struct", "id", "NonEmptyString", "title", "String", "color"]
}
