{"version":3,"file":"_randomFormatEmail.mjs","names":[],"sources":["../../src/internal/_randomFormatEmail.ts"],"sourcesContent":["import { _randomString } from \"./_randomString\";\nimport { _ILengthProps, _randomSegmentLength } from \"./_randomStringLength\";\n\n/**\n * Generate an email address at a length the bounds allow.\n *\n * @evidence contracts/common.md#principled-implementation An unconstrained draw is a local part, a domain and a top-level label of random letters; a constrained one lets the local part absorb the length beside a fixed `@x.y` shape, and throws when the window is below that shape.\n * @evidence contracts/common.md#clear-and-simple-design One function over the segment-length helper.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts The shape is the generator's and its limits are reported.\n * @evidence contracts/common.md#meaningful-documentation An inline comment explains the fixed overhead.\n */\nexport const _randomFormatEmail = (props?: _ILengthProps): string => {\n  if (props?.minLength === undefined && props?.maxLength === undefined)\n    return `${random(10)}@${random(10)}.${random(3)}`;\n  // `<local>@<domain>.<tld>`: the local part absorbs the requested length while\n  // a one-character domain and tld keep the fixed overhead (`@`, `.`) minimal.\n  return `${_randomSegmentLength(props, 4, 10, 1)}@${random(1)}.${random(1)}`;\n};\n\nconst random = (length: number) =>\n  _randomString({\n    type: \"string\",\n    minLength: length,\n    maxLength: length,\n  });\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,sBAAsB,UAAkC;CACnE,IAAI,OAAO,cAAc,KAAA,KAAa,OAAO,cAAc,KAAA,GACzD,OAAO,GAAG,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,GAAG,OAAO,CAAC;CAGhD,OAAO,GAAG,qBAAqB,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC;AAC1E;AAEA,MAAM,UAAU,WACd,cAAc;CACZ,MAAM;CACN,WAAW;CACX,WAAW;AACb,CAAC"}