UNPKG

alepha

Version:

Easy-to-use modern TypeScript framework for building many kind of applications.

2,242 lines 492 kB
import { $module, z } from "alepha"; //#region ../../../../node_modules/@faker-js/faker/dist/base-DzmKJ9Qc.js var e$1 = class extends Error {}; const t = Symbol(`FakerLocaleProxy`); const n = () => { throw new e$1(`You cannot edit the locale data on the faker instance`); }; function r$1(e) { return typeof e == `object` && !!e && e?.[t] === !0; } function i(e) { if (r$1(e)) return e; let i = { raw: e }; return new Proxy(e, { has() { return !0; }, get(e, n) { return typeof n == `symbol` ? n === t ? !0 : e[n] : n === `nodeType` ? e[n] : i[n] ??= o(n, e[n]); }, set: n, deleteProperty: n }); } function a(t, ...n) { if (t === null) throw new e$1(`The locale data for '${n.join(`.`)}' aren't applicable to this locale. If you think this is a bug, please report it at: https://github.com/faker-js/faker`); if (t === void 0) throw new e$1(`The locale data for '${n.join(`.`)}' are missing in this locale. If this is a custom Faker instance, please make sure all required locales are used e.g. '[de_AT, de, en, base]'. Please contribute the missing data to the project or use a locale/Faker instance that has these data. For more information see https://fakerjs.dev/guide/localization.html`); } function o(e, t = {}) { return new Proxy(t, { has(e, t) { return e[t] != null; }, get(t, n) { let r = t[n]; return typeof n == `symbol` || n === `nodeType` || a(r, e, n.toString()), r; }, set: n, deleteProperty: n }); } function s(e) { let t = {}; for (let n of e) for (let e in n) { let r = n[e]; t[e] === void 0 ? t[e] = { ...r } : t[e] = { ...r, ...t[e] }; } return t; } const c = 2567483615, l = 2 ** 31 - 1, u = 2 ** 31, { imul: d, trunc: f } = Math; function p(e) { return typeof e == `number` ? m(e) : h(e); } function m(e) { let t = Array.from({ length: 624 }); t[0] = e; for (let e = 1; e !== 624; ++e) t[e] = f(d(1812433253, t[e - 1] ^ t[e - 1] >>> 30) + e); return t; } function h(e) { let t = m(19650218), n = 1, r = 0; for (let i = Math.max(624, e.length); i !== 0; --i) { let i = t[n - 1] ^ t[n - 1] >>> 30; t[n] = f((t[n] ^ d(i, 1664525)) + e[r] + r), n++, r++, n >= 624 && (t[0] = t[623], n = 1), r >= e.length && (r = 0); } for (let e = 623; e !== 0; e--) t[n] = f((t[n] ^ d(t[n - 1] ^ t[n - 1] >>> 30, 1566083941)) - n), n++, n >= 624 && (t[0] = t[623], n = 1); return t[0] = 2147483648, t; } function g(e) { for (let t = 0; t !== 227; ++t) { let n = (e[t] & u) + (e[t + 1] & l); e[t] = e[t + 397] ^ n >>> 1 ^ -(n & 1) & c; } for (let t = 227; t !== 623; ++t) { let n = (e[t] & u) + (e[t + 1] & l); e[t] = e[t + 397 - 624] ^ n >>> 1 ^ -(n & 1) & c; } let t = (e[623] & u) + (e[0] & l); return e[623] = e[396] ^ t >>> 1 ^ -(t & 1) & c, e; } var _ = class { states; index; constructor(e = Math.random() * (2 ** 53 - 1), t = g(p(e)), n = 0) { this.states = t, this.index = n; } nextU32() { let e = this.states[this.index]; return e ^= this.states[this.index] >>> 11, e ^= e << 7 & 2636928640, e ^= e << 15 & 4022730752, e ^= e >>> 18, ++this.index >= 624 && (this.states = g(this.states), this.index = 0), e >>> 0; } nextF32() { return this.nextU32() * 23283064365386963e-26; } nextU53() { let e = this.nextU32() >>> 5, t = this.nextU32() >>> 6; return e * 67108864 + t; } nextF53() { return this.nextU53() * 11102230246251565e-32; } seed(e) { this.states = g(p(e)), this.index = 0; } }; function v() { return Math.ceil(Math.random() * (2 ** 53 - 1)); } function y(e = v()) { let t = new _(e); return { next() { return t.nextF53(); }, seed(e) { t.seed(e); } }; } function te(e = {}) { let { locale: t = {}, randomizer: n = y(), config: r = {}, seed: a } = e; return n != null && a != null && n.seed(a), { locale: i(Array.isArray(t) ? s(t) : t), randomizer: n, config: r }; } function b() { return ne; } const ne = ({ next: e }) => e(); function re(e) { let t = Object.getPrototypeOf(e); do { for (let n of Object.getOwnPropertyNames(t)) typeof e[n] == `function` && n !== `constructor` && (e[n] = e[n].bind(e)); t = Object.getPrototypeOf(t); } while (t !== Object.prototype); } var x = class { faker; constructor(e) { this.faker = e, re(this); } }; var S = class extends x { faker; constructor(e) { super(e), this.faker = e; } }; let C = function(e) { return e.Narrowbody = `narrowbody`, e.Regional = `regional`, e.Widebody = `widebody`, e; }({}); const ie = [ `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9` ]; const ae = [ `0`, `O`, `1`, `I`, `L` ]; const oe = { regional: 20, narrowbody: 35, widebody: 60 }; const se = { regional: [ `A`, `B`, `C`, `D` ], narrowbody: [ `A`, `B`, `C`, `D`, `E`, `F` ], widebody: [ `A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `J`, `K` ] }; var ce = class extends S { airport() { return this.faker.helpers.arrayElement(this.faker.definitions.airline.airport); } airline() { return this.faker.helpers.arrayElement(this.faker.definitions.airline.airline); } airplane() { return this.faker.helpers.arrayElement(this.faker.definitions.airline.airplane); } recordLocator(e = {}) { let { allowNumerics: t = !1, allowVisuallySimilarCharacters: n = !1 } = e, r = []; return t || r.push(...ie), n || r.push(...ae), this.faker.string.alphanumeric({ length: 6, casing: `upper`, exclude: r }); } seat(e = {}) { let { aircraftType: t = `narrowbody` } = e, n = oe[t], r = se[t]; return `${this.faker.number.int({ min: 1, max: n })}${this.faker.helpers.arrayElement(r)}`; } aircraftType() { return this.faker.helpers.enumValue(C); } flightNumber(e = {}) { let { length: t = { min: 1, max: 4 }, addLeadingZeros: n = !1 } = e, r = this.faker.string.numeric({ length: t, allowLeadingZeros: !1 }); return n ? r.padStart(4, `0`) : r; } }; var le = class extends S { dog() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.dog); } cat() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.cat); } snake() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.snake); } bear() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.bear); } lion() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.lion); } cetacean() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.cetacean); } horse() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.horse); } bird() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.bird); } cow() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.cow); } fish() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.fish); } crocodilia() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.crocodilia); } insect() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.insect); } rabbit() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.rabbit); } rodent() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.rodent); } type() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.type); } petName() { return this.faker.helpers.arrayElement(this.faker.definitions.animal.pet_name); } }; var ue = class extends S { author() { return this.faker.helpers.arrayElement(this.faker.definitions.book.author); } format() { return this.faker.helpers.arrayElement(this.faker.definitions.book.format); } genre() { return this.faker.helpers.arrayElement(this.faker.definitions.book.genre); } publisher() { return this.faker.helpers.arrayElement(this.faker.definitions.book.publisher); } series() { return this.faker.helpers.arrayElement(this.faker.definitions.book.series); } title() { return this.faker.helpers.arrayElement(this.faker.definitions.book.title); } }; let w = function(e) { return e.SRGB = `sRGB`, e.DisplayP3 = `display-p3`, e.REC2020 = `rec2020`, e.A98RGB = `a98-rgb`, e.ProphotoRGB = `prophoto-rgb`, e; }({}); let T = function(e) { return e.RGB = `rgb`, e.RGBA = `rgba`, e.HSL = `hsl`, e.HSLA = `hsla`, e.HWB = `hwb`, e.CMYK = `cmyk`, e.LAB = `lab`, e.LCH = `lch`, e.COLOR = `color`, e; }({}); function de(e, t) { let { prefix: n, casing: r } = t; switch (r) { case `upper`: e = e.toUpperCase(); break; case `lower`: e = e.toLowerCase(); break; case `mixed`: } return n && (e = n + e), e; } function E(e) { return e.map((e) => { if (e % 1 != 0) { let t = /* @__PURE__ */ new ArrayBuffer(4); return new DataView(t).setFloat32(0, e), E([...new Uint8Array(t)]).replaceAll(` `, ``); } return (e >>> 0).toString(2).padStart(8, `0`); }).join(` `); } function D(e) { return Math.round(e * 100); } function fe(e, t = `rgb`, n = `sRGB`) { switch (t) { case `rgba`: return `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]})`; case `color`: return `color(${n} ${e[0]} ${e[1]} ${e[2]})`; case `cmyk`: return `cmyk(${D(e[0])}%, ${D(e[1])}%, ${D(e[2])}%, ${D(e[3])}%)`; case `hsl`: return `hsl(${e[0]}deg ${D(e[1])}% ${D(e[2])}%)`; case `hsla`: return `hsl(${e[0]}deg ${D(e[1])}% ${D(e[2])}% / ${D(e[3])})`; case `hwb`: return `hwb(${e[0]} ${D(e[1])}% ${D(e[2])}%)`; case `lab`: return `lab(${D(e[0])}% ${e[1]} ${e[2]})`; case `lch`: return `lch(${D(e[0])}% ${e[1]} ${e[2]})`; case `rgb`: return `rgb(${e[0]}, ${e[1]}, ${e[2]})`; } } function O(e, t, n = `rgb`, r = `sRGB`) { switch (t) { case `css`: return fe(e, n, r); case `binary`: return E(e); case `decimal`: return e; } } var pe = class extends S { human() { return this.faker.helpers.arrayElement(this.faker.definitions.color.human); } space() { return this.faker.helpers.arrayElement(this.faker.definitions.color.space); } cssSupportedFunction() { return this.faker.helpers.enumValue(T); } cssSupportedSpace() { return this.faker.helpers.enumValue(w); } rgb(e = {}) { let { format: t = `hex`, includeAlpha: n = !1, prefix: r = `#`, casing: i = `lower` } = e, a, o = `rgb`; return t === `hex` ? (a = this.faker.string.hexadecimal({ length: n ? 8 : 6, prefix: `` }), a = de(a, { prefix: r, casing: i }), a) : (a = Array.from({ length: 3 }, () => this.faker.number.int(255)), n && (a.push(this.faker.number.float({ multipleOf: .01 })), o = `rgba`), O(a, t, o)); } cmyk(e = {}) { let { format: t = `decimal` } = e; return O(Array.from({ length: 4 }, () => this.faker.number.float({ multipleOf: .01 })), t, `cmyk`); } hsl(e = {}) { let { format: t = `decimal`, includeAlpha: n = !1 } = e, r = [this.faker.number.int(360)]; for (let t = 0; t < (e?.includeAlpha ? 3 : 2); t++) r.push(this.faker.number.float({ multipleOf: .01 })); return O(r, t, n ? `hsla` : `hsl`); } hwb(e = {}) { let { format: t = `decimal` } = e, n = [this.faker.number.int(360)]; for (let e = 0; e < 2; e++) n.push(this.faker.number.float({ multipleOf: .01 })); return O(n, t, `hwb`); } lab(e = {}) { let { format: t = `decimal` } = e, n = [this.faker.number.float({ multipleOf: 1e-6 })]; for (let e = 0; e < 2; e++) n.push(this.faker.number.float({ min: -100, max: 100, multipleOf: 1e-4 })); return O(n, t, `lab`); } lch(e = {}) { let { format: t = `decimal` } = e, n = [this.faker.number.float({ multipleOf: 1e-6 })]; for (let e = 0; e < 2; e++) n.push(this.faker.number.float({ max: 230, multipleOf: .1 })); return O(n, t, `lch`); } colorByCSSColorSpace(e = {}) { let { format: t = `decimal`, space: n = `sRGB` } = e; return O(Array.from({ length: 3 }, () => this.faker.number.float({ multipleOf: 1e-4 })), t, `color`, n); } }; function me(t) { if (!/^\d{11}$/.test(t)) throw new e$1(`calculateUPCCheckDigit expects exactly 11 numeric digits`); let n = 0, r = 0; for (let e of t) n += Number.parseInt(e, 10) * (r % 2 == 0 ? 3 : 1), r++; return (10 - n % 10) % 10; } const he = { 0: [ [1999999, 2], [2279999, 3], [2289999, 4], [3689999, 3], [3699999, 4], [6389999, 3], [6397999, 4], [6399999, 7], [6449999, 3], [6459999, 7], [6479999, 3], [6489999, 7], [6549999, 3], [6559999, 4], [6999999, 3], [8499999, 4], [8999999, 5], [9499999, 6], [9999999, 7] ], 1: [ [99999, 3], [299999, 2], [349999, 3], [399999, 4], [499999, 3], [699999, 2], [999999, 4], [3979999, 3], [5499999, 4], [6499999, 5], [6799999, 4], [6859999, 5], [7139999, 4], [7169999, 3], [7319999, 4], [7399999, 7], [7749999, 5], [7753999, 7], [7763999, 5], [7764999, 7], [7769999, 5], [7782999, 7], [7899999, 5], [7999999, 4], [8004999, 5], [8049999, 5], [8379999, 5], [8384999, 7], [8671999, 5], [8675999, 4], [8697999, 5], [9159999, 6], [9165059, 7], [9168699, 6], [9169079, 7], [9195999, 6], [9196549, 7], [9729999, 6], [9877999, 4], [9911499, 6], [9911999, 7], [9989899, 6], [9999999, 7] ] }; var ge = class extends S { department() { return this.faker.helpers.arrayElement(this.faker.definitions.commerce.department); } productName() { let e = this.faker.definitions.commerce.product_name.pattern; return this.faker.helpers.fake(e); } price(e = {}) { let { dec: t = 2, max: n = 1e3, min: r = 1, symbol: i = `` } = e; if (r < 0 || n < 0) return `${i}0`; if (r === n) return `${i}${r.toFixed(t)}`; let a = this.faker.number.float({ min: r, max: n, fractionDigits: t }); if (t === 0) return `${i}${a.toFixed(t)}`; let o = a * 10 ** t % 10, s = this.faker.helpers.weightedArrayElement([ { weight: 5, value: 9 }, { weight: 3, value: 5 }, { weight: 1, value: 0 }, { weight: 1, value: this.faker.number.int({ min: 0, max: 9 }) } ]), c = (1 / 10) ** t, l = o * c, u = s * c, d = a - l + u; return r <= d && d <= n ? `${i}${d.toFixed(t)}` : `${i}${a.toFixed(t)}`; } productAdjective() { return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.adjective); } productMaterial() { return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.material); } product() { return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.product); } productDescription() { return this.faker.helpers.fake(this.faker.definitions.commerce.product_description); } isbn(t = {}) { typeof t == `number` && (t = { variant: t }); let { variant: n = 13, separator: r = `-` } = t, [i, a] = this.faker.helpers.objectEntry(he), o = this.faker.string.numeric(8), s = Number.parseInt(o.slice(0, -1)), c = a.find(([e]) => s <= e)?.[1]; if (!c) throw new e$1(`Unable to find a registrant length for the group ${i}`); let l = [ `978`, i, o.slice(0, c), o.slice(c) ]; n === 10 && l.shift(); let u = l.join(``), d = 0; for (let e = 0; e < n - 1; e++) { let t = n === 10 ? e + 1 : e % 2 ? 3 : 1; d += t * Number.parseInt(u[e]); } return d = n === 10 ? d % 11 : (10 - d % 10) % 10, l.push(d === 10 ? `X` : d.toString()), l.join(r); } upc(t = {}) { let { prefix: n = `` } = t; if (n && /\D/.test(n)) throw new e$1(`Prefix must contain only numeric digits`); if (n.length > 11) throw new e$1(`Prefix must be at most 11 numeric digits`); let r = 11 - n.length, i = `${n}${this.faker.string.numeric({ length: r, allowLeadingZeros: !0 })}`; return `${i}${me(i)}`; } }; var _e = class extends S { name() { return this.faker.helpers.fake(this.faker.definitions.company.name_pattern); } catchPhrase() { return [ this.catchPhraseAdjective(), this.catchPhraseDescriptor(), this.catchPhraseNoun() ].join(` `); } buzzPhrase() { return [ this.buzzVerb(), this.buzzAdjective(), this.buzzNoun() ].join(` `); } catchPhraseAdjective() { return this.faker.helpers.arrayElement(this.faker.definitions.company.adjective); } catchPhraseDescriptor() { return this.faker.helpers.arrayElement(this.faker.definitions.company.descriptor); } catchPhraseNoun() { return this.faker.helpers.arrayElement(this.faker.definitions.company.noun); } buzzAdjective() { return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_adjective); } buzzVerb() { return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_verb); } buzzNoun() { return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_noun); } }; var ve = class extends S { column() { return this.faker.helpers.arrayElement(this.faker.definitions.database.column); } type() { return this.faker.helpers.arrayElement(this.faker.definitions.database.type); } collation() { return this.faker.helpers.arrayElement(this.faker.definitions.database.collation); } engine() { return this.faker.helpers.arrayElement(this.faker.definitions.database.engine); } mongodbObjectId() { return this.faker.string.hexadecimal({ length: 24, casing: `lower`, prefix: `` }); } }; function k(t, n = `refDate`) { let r = new Date(t); if (Number.isNaN(r.valueOf())) throw new e$1(`Invalid ${n} date: ${t.toString()}`); return r; } var A = class extends x { anytime(e = {}) { let { refDate: t = this.faker.defaultRefDate() } = e, n = k(t).getTime(); return this.between({ from: n - 1e3 * 60 * 60 * 24 * 365, to: n + 1e3 * 60 * 60 * 24 * 365 }); } past(t = {}) { let { refDate: n = this.faker.defaultRefDate() } = t, { years: r = 1 } = t; if (typeof r == `number` && (r = { min: 0, max: r }), r.max <= 0) throw new e$1(`Years must be greater than 0.`); if (r.min >= r.max) throw new e$1(`The maximum amount of years must be greater than the minimum amount of years.`); let i = k(n), a = new Date(i); a.setUTCFullYear(a.getUTCFullYear() - r.max); let o = new Date(i); return o.setUTCFullYear(o.getUTCFullYear() - r.min), this.between({ from: a, to: o.getTime() - 1e3 }); } future(t = {}) { let { refDate: n = this.faker.defaultRefDate() } = t, { years: r = 1 } = t; if (typeof r == `number` && (r = { min: 0, max: r }), r.max <= 0) throw new e$1(`Years must be greater than 0.`); if (r.min >= r.max) throw new e$1(`The maximum amount of years must be greater than the minimum amount of years.`); let i = k(n), a = new Date(i); a.setUTCFullYear(a.getUTCFullYear() + r.min); let o = new Date(i); return o.setUTCFullYear(o.getUTCFullYear() + r.max), this.between({ from: a.getTime() + 1e3, to: o }); } between(t) { let { from: n, to: r } = t, i = k(n, `from`).getTime(), a = k(r, `to`).getTime(); if (i > a) throw new e$1("`from` date must be before `to` date."); return new Date(this.faker.number.int({ min: i, max: a })); } betweens(e) { let { from: t, to: n, count: r = 3 } = e; return this.faker.helpers.multiple(() => this.between({ from: t, to: n }), { count: r }).toSorted((e, t) => e.getTime() - t.getTime()); } recent(t = {}) { let { refDate: n = this.faker.defaultRefDate() } = t, { days: r = 1 } = t; if (typeof r == `number` && (r = { min: 0, max: r }), r.max <= 0) throw new e$1(`Days must be greater than 0.`); if (r.min >= r.max) throw new e$1(`The maximum amount of days must be greater than the minimum amount of days.`); let i = k(n), a = new Date(i); a.setUTCDate(a.getUTCDate() - r.max); let o = new Date(i); return o.setUTCDate(o.getUTCDate() - r.min), this.between({ from: a, to: o.getTime() - 1e3 }); } soon(t = {}) { let { refDate: n = this.faker.defaultRefDate() } = t, { days: r = 1 } = t; if (typeof r == `number` && (r = { min: 0, max: r }), r.max <= 0) throw new e$1(`Days must be greater than 0.`); if (r.min >= r.max) throw new e$1(`The maximum amount of days must be greater than the minimum amount of days.`); let i = k(n), a = new Date(i); a.setUTCDate(a.getUTCDate() + r.min); let o = new Date(i); return o.setUTCDate(o.getUTCDate() + r.max), this.between({ from: a.getTime() + 1e3, to: o }); } birthdate(t = {}) { let { mode: n = `age`, min: r = 18, max: i = 80, refDate: a = this.faker.defaultRefDate() } = t, o = k(a), s = o.getUTCFullYear(); switch (n) { case `age`: { let t = new Date(o).setUTCFullYear(s - i - 1) + 1440 * 60 * 1e3, n = new Date(o).setUTCFullYear(s - r); if (t > n) throw new e$1(`Max age ${i} should be greater than or equal to min age ${r}.`); return this.between({ from: t, to: n }); } case `year`: { let t = new Date(Date.UTC(0, 0, 2)).setUTCFullYear(r), n = new Date(Date.UTC(0, 11, 30)).setUTCFullYear(i); if (t > n) throw new e$1(`Max year ${i} should be greater than or equal to min year ${r}.`); return this.between({ from: t, to: n }); } } } }; var ye = class extends A { faker; constructor(e) { super(e), this.faker = e; } month(e = {}) { let { abbreviated: t = !1, context: n = !1 } = e, r = this.faker.definitions.date.month, i; i = t ? n && r.abbr_context != null ? `abbr_context` : `abbr` : n && r.wide_context != null ? `wide_context` : `wide`; let o = r[i]; return a(o, `date.month`, i), this.faker.helpers.arrayElement(o); } weekday(e = {}) { let { abbreviated: t = !1, context: n = !1 } = e, r = this.faker.definitions.date.weekday, i; i = t ? n && r.abbr_context != null ? `abbr_context` : `abbr` : n && r.wide_context != null ? `wide_context` : `wide`; let o = r[i]; return a(o, `date.weekday`, i), this.faker.helpers.arrayElement(o); } timeZone() { return this.faker.helpers.arrayElement(this.faker.definitions.date.time_zone); } }; let j = function(e) { return e.Legacy = `legacy`, e.Segwit = `segwit`, e.Bech32 = `bech32`, e.Taproot = `taproot`, e; }({}); (function(e) { return e.Mainnet = `mainnet`, e.Testnet = `testnet`, e; })({}); const xe = { legacy: { prefix: { mainnet: `1`, testnet: `m` }, length: { min: 26, max: 34 }, casing: `mixed`, exclude: `0OIl` }, segwit: { prefix: { mainnet: `3`, testnet: `2` }, length: { min: 26, max: 34 }, casing: `mixed`, exclude: `0OIl` }, bech32: { prefix: { mainnet: `bc1`, testnet: `tb1` }, length: { min: 42, max: 42 }, casing: `lower`, exclude: `1bBiIoO` }, taproot: { prefix: { mainnet: `bc1p`, testnet: `tb1p` }, length: { min: 62, max: 62 }, casing: `lower`, exclude: `1bBiIoO` } }; const M = { alpha: `ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``), formats: [ { country: `AL`, total: 28, bban: [{ type: `n`, count: 8 }, { type: `c`, count: 16 }], format: `ALkk bbbs sssx cccc cccc cccc cccc` }, { country: `AD`, total: 24, bban: [{ type: `n`, count: 8 }, { type: `c`, count: 12 }], format: `ADkk bbbb ssss cccc cccc cccc` }, { country: `AT`, total: 20, bban: [{ type: `n`, count: 5 }, { type: `n`, count: 11 }], format: `ATkk bbbb bccc cccc cccc` }, { country: `AZ`, total: 28, bban: [{ type: `a`, count: 4 }, { type: `n`, count: 20 }], format: `AZkk bbbb cccc cccc cccc cccc cccc` }, { country: `BH`, total: 22, bban: [{ type: `a`, count: 4 }, { type: `c`, count: 14 }], format: `BHkk bbbb cccc cccc cccc cc` }, { country: `BE`, total: 16, bban: [{ type: `n`, count: 3 }, { type: `n`, count: 9 }], format: `BEkk bbbc cccc ccxx` }, { country: `BA`, total: 20, bban: [{ type: `n`, count: 6 }, { type: `n`, count: 10 }], format: `BAkk bbbs sscc cccc ccxx` }, { country: `BR`, total: 29, bban: [ { type: `n`, count: 13 }, { type: `n`, count: 10 }, { type: `a`, count: 1 }, { type: `c`, count: 1 } ], format: `BRkk bbbb bbbb ssss sccc cccc ccct n` }, { country: `BG`, total: 22, bban: [ { type: `a`, count: 4 }, { type: `n`, count: 6 }, { type: `c`, count: 8 } ], format: `BGkk bbbb ssss ddcc cccc cc` }, { country: `CR`, total: 22, bban: [ { type: `n`, count: 1 }, { type: `n`, count: 3 }, { type: `n`, count: 14 } ], format: `CRkk xbbb cccc cccc cccc cc` }, { country: `HR`, total: 21, bban: [{ type: `n`, count: 7 }, { type: `n`, count: 10 }], format: `HRkk bbbb bbbc cccc cccc c` }, { country: `CY`, total: 28, bban: [{ type: `n`, count: 8 }, { type: `c`, count: 16 }], format: `CYkk bbbs ssss cccc cccc cccc cccc` }, { country: `CZ`, total: 24, bban: [{ type: `n`, count: 10 }, { type: `n`, count: 10 }], format: `CZkk bbbb ssss sscc cccc cccc` }, { country: `DK`, total: 18, bban: [{ type: `n`, count: 4 }, { type: `n`, count: 10 }], format: `DKkk bbbb cccc cccc cc` }, { country: `DO`, total: 28, bban: [{ type: `a`, count: 4 }, { type: `n`, count: 20 }], format: `DOkk bbbb cccc cccc cccc cccc cccc` }, { country: `TL`, total: 23, bban: [{ type: `n`, count: 3 }, { type: `n`, count: 16 }], format: `TLkk bbbc cccc cccc cccc cxx` }, { country: `EE`, total: 20, bban: [{ type: `n`, count: 4 }, { type: `n`, count: 12 }], format: `EEkk bbss cccc cccc cccx` }, { country: `FO`, total: 18, bban: [{ type: `n`, count: 4 }, { type: `n`, count: 10 }], format: `FOkk bbbb cccc cccc cx` }, { country: `FI`, total: 18, bban: [{ type: `n`, count: 6 }, { type: `n`, count: 8 }], format: `FIkk bbbb bbcc cccc cx` }, { country: `FR`, total: 27, bban: [ { type: `n`, count: 10 }, { type: `c`, count: 11 }, { type: `n`, count: 2 } ], format: `FRkk bbbb bggg ggcc cccc cccc cxx` }, { country: `GE`, total: 22, bban: [{ type: `a`, count: 2 }, { type: `n`, count: 16 }], format: `GEkk bbcc cccc cccc cccc cc` }, { country: `DE`, total: 22, bban: [{ type: `n`, count: 8 }, { type: `n`, count: 10 }], format: `DEkk bbbb bbbb cccc cccc cc` }, { country: `GI`, total: 23, bban: [{ type: `a`, count: 4 }, { type: `c`, count: 15 }], format: `GIkk bbbb cccc cccc cccc ccc` }, { country: `GR`, total: 27, bban: [{ type: `n`, count: 7 }, { type: `c`, count: 16 }], format: `GRkk bbbs sssc cccc cccc cccc ccc` }, { country: `GL`, total: 18, bban: [{ type: `n`, count: 4 }, { type: `n`, count: 10 }], format: `GLkk bbbb cccc cccc cc` }, { country: `GT`, total: 28, bban: [ { type: `c`, count: 4 }, { type: `c`, count: 4 }, { type: `c`, count: 16 } ], format: `GTkk bbbb mmtt cccc cccc cccc cccc` }, { country: `HU`, total: 28, bban: [{ type: `n`, count: 8 }, { type: `n`, count: 16 }], format: `HUkk bbbs sssk cccc cccc cccc cccx` }, { country: `IS`, total: 26, bban: [{ type: `n`, count: 6 }, { type: `n`, count: 16 }], format: `ISkk bbbb sscc cccc iiii iiii ii` }, { country: `IE`, total: 22, bban: [ { type: `a`, count: 4 }, { type: `n`, count: 6 }, { type: `n`, count: 8 } ], format: `IEkk aaaa bbbb bbcc cccc cc` }, { country: `IL`, total: 23, bban: [{ type: `n`, count: 6 }, { type: `n`, count: 13 }], format: `ILkk bbbn nncc cccc cccc ccc` }, { country: `IR`, total: 26, bban: [{ type: `n`, count: 22 }], format: `IRkk bbbb cccc cccc cccc cccc cc` }, { country: `IT`, total: 27, bban: [ { type: `a`, count: 1 }, { type: `n`, count: 10 }, { type: `c`, count: 12 } ], format: `ITkk xaaa aabb bbbc cccc cccc ccc` }, { country: `JO`, total: 30, bban: [ { type: `a`, count: 4 }, { type: `n`, count: 4 }, { type: `n`, count: 18 } ], format: `JOkk bbbb nnnn cccc cccc cccc cccc cc` }, { country: `KZ`, total: 20, bban: [{ type: `n`, count: 3 }, { type: `c`, count: 13 }], format: `KZkk bbbc cccc cccc cccc` }, { country: `XK`, total: 20, bban: [{ type: `n`, count: 4 }, { type: `n`, count: 12 }], format: `XKkk bbbb cccc cccc cccc` }, { country: `KW`, total: 30, bban: [{ type: `a`, count: 4 }, { type: `c`, count: 22 }], format: `KWkk bbbb cccc cccc cccc cccc cccc cc` }, { country: `LV`, total: 21, bban: [{ type: `a`, count: 4 }, { type: `c`, count: 13 }], format: `LVkk bbbb cccc cccc cccc c` }, { country: `LB`, total: 28, bban: [{ type: `n`, count: 4 }, { type: `c`, count: 20 }], format: `LBkk bbbb cccc cccc cccc cccc cccc` }, { country: `LI`, total: 21, bban: [{ type: `n`, count: 5 }, { type: `c`, count: 12 }], format: `LIkk bbbb bccc cccc cccc c` }, { country: `LT`, total: 20, bban: [{ type: `n`, count: 5 }, { type: `n`, count: 11 }], format: `LTkk bbbb bccc cccc cccc` }, { country: `LU`, total: 20, bban: [{ type: `n`, count: 3 }, { type: `c`, count: 13 }], format: `LUkk bbbc cccc cccc cccc` }, { country: `MK`, total: 19, bban: [ { type: `n`, count: 3 }, { type: `c`, count: 10 }, { type: `n`, count: 2 } ], format: `MKkk bbbc cccc cccc cxx` }, { country: `MT`, total: 31, bban: [ { type: `a`, count: 4 }, { type: `n`, count: 5 }, { type: `c`, count: 18 } ], format: `MTkk bbbb ssss sccc cccc cccc cccc ccc` }, { country: `MR`, total: 27, bban: [{ type: `n`, count: 10 }, { type: `n`, count: 13 }], format: `MRkk bbbb bsss sscc cccc cccc cxx` }, { country: `MU`, total: 30, bban: [ { type: `a`, count: 4 }, { type: `n`, count: 4 }, { type: `n`, count: 15 }, { type: `a`, count: 3 } ], format: `MUkk bbbb bbss cccc cccc cccc 000d dd` }, { country: `MC`, total: 27, bban: [ { type: `n`, count: 10 }, { type: `c`, count: 11 }, { type: `n`, count: 2 } ], format: `MCkk bbbb bsss sscc cccc cccc cxx` }, { country: `MD`, total: 24, bban: [{ type: `c`, count: 2 }, { type: `c`, count: 18 }], format: `MDkk bbcc cccc cccc cccc cccc` }, { country: `ME`, total: 22, bban: [{ type: `n`, count: 3 }, { type: `n`, count: 15 }], format: `MEkk bbbc cccc cccc cccc xx` }, { country: `NL`, total: 18, bban: [{ type: `a`, count: 4 }, { type: `n`, count: 10 }], format: `NLkk bbbb cccc cccc cc` }, { country: `NO`, total: 15, bban: [{ type: `n`, count: 4 }, { type: `n`, count: 7 }], format: `NOkk bbbb cccc ccx` }, { country: `PK`, total: 24, bban: [{ type: `a`, count: 4 }, { type: `n`, count: 16 }], format: `PKkk bbbb cccc cccc cccc cccc` }, { country: `PS`, total: 29, bban: [ { type: `a`, count: 4 }, { type: `n`, count: 9 }, { type: `n`, count: 12 } ], format: `PSkk bbbb xxxx xxxx xccc cccc cccc c` }, { country: `PL`, total: 28, bban: [{ type: `n`, count: 8 }, { type: `n`, count: 16 }], format: `PLkk bbbs sssx cccc cccc cccc cccc` }, { country: `PT`, total: 25, bban: [{ type: `n`, count: 8 }, { type: `n`, count: 13 }], format: `PTkk bbbb ssss cccc cccc cccx x` }, { country: `QA`, total: 29, bban: [{ type: `a`, count: 4 }, { type: `c`, count: 21 }], format: `QAkk bbbb cccc cccc cccc cccc cccc c` }, { country: `RO`, total: 24, bban: [{ type: `a`, count: 4 }, { type: `c`, count: 16 }], format: `ROkk bbbb cccc cccc cccc cccc` }, { country: `SM`, total: 27, bban: [ { type: `a`, count: 1 }, { type: `n`, count: 10 }, { type: `c`, count: 12 } ], format: `SMkk xaaa aabb bbbc cccc cccc ccc` }, { country: `SA`, total: 24, bban: [{ type: `n`, count: 2 }, { type: `c`, count: 18 }], format: `SAkk bbcc cccc cccc cccc cccc` }, { country: `RS`, total: 22, bban: [{ type: `n`, count: 3 }, { type: `n`, count: 15 }], format: `RSkk bbbc cccc cccc cccc xx` }, { country: `SK`, total: 24, bban: [{ type: `n`, count: 10 }, { type: `n`, count: 10 }], format: `SKkk bbbb ssss sscc cccc cccc` }, { country: `SI`, total: 19, bban: [{ type: `n`, count: 5 }, { type: `n`, count: 10 }], format: `SIkk bbss sccc cccc cxx` }, { country: `ES`, total: 24, bban: [{ type: `n`, count: 10 }, { type: `n`, count: 10 }], format: `ESkk bbbb gggg xxcc cccc cccc` }, { country: `SE`, total: 24, bban: [{ type: `n`, count: 3 }, { type: `n`, count: 17 }], format: `SEkk bbbc cccc cccc cccc cccc` }, { country: `CH`, total: 21, bban: [{ type: `n`, count: 5 }, { type: `c`, count: 12 }], format: `CHkk bbbb bccc cccc cccc c` }, { country: `TN`, total: 24, bban: [{ type: `n`, count: 5 }, { type: `n`, count: 15 }], format: `TNkk bbss sccc cccc cccc cccc` }, { country: `TR`, total: 26, bban: [ { type: `n`, count: 5 }, { type: `n`, count: 1 }, { type: `n`, count: 16 } ], format: `TRkk bbbb bxcc cccc cccc cccc cc` }, { country: `AE`, total: 23, bban: [{ type: `n`, count: 3 }, { type: `n`, count: 16 }], format: `AEkk bbbc cccc cccc cccc ccc` }, { country: `GB`, total: 22, bban: [ { type: `a`, count: 4 }, { type: `n`, count: 6 }, { type: `n`, count: 8 } ], format: `GBkk bbbb ssss sscc cccc cc` }, { country: `VG`, total: 24, bban: [{ type: `a`, count: 4 }, { type: `n`, count: 16 }], format: `VGkk bbbb cccc cccc cccc cccc` } ], iso3166: `AD.AE.AF.AG.AI.AL.AM.AO.AQ.AR.AS.AT.AU.AW.AX.AZ.BA.BB.BD.BE.BF.BG.BH.BI.BJ.BL.BM.BN.BO.BQ.BR.BS.BT.BV.BW.BY.BZ.CA.CC.CD.CF.CG.CH.CI.CK.CL.CM.CN.CO.CR.CU.CV.CW.CX.CY.CZ.DE.DJ.DK.DM.DO.DZ.EC.EE.EG.EH.ER.ES.ET.FI.FJ.FK.FM.FO.FR.GA.GB.GD.GE.GF.GG.GH.GI.GL.GM.GN.GP.GQ.GR.GS.GT.GU.GW.GY.HK.HM.HN.HR.HT.HU.ID.IE.IL.IM.IN.IO.IQ.IR.IS.IT.JE.JM.JO.JP.KE.KG.KH.KI.KM.KN.KP.KR.KW.KY.KZ.LA.LB.LC.LI.LK.LR.LS.LT.LU.LV.LY.MA.MC.MD.ME.MF.MG.MH.MK.ML.MM.MN.MO.MP.MQ.MR.MS.MT.MU.MV.MW.MX.MY.MZ.NA.NC.NE.NF.NG.NI.NL.NO.NP.NR.NU.NZ.OM.PA.PE.PF.PG.PH.PK.PL.PM.PN.PR.PS.PT.PW.PY.QA.RE.RO.RS.RU.RW.SA.SB.SC.SD.SE.SG.SH.SI.SJ.SK.SL.SM.SN.SO.SR.SS.ST.SV.SX.SY.SZ.TC.TD.TF.TG.TH.TJ.TK.TL.TM.TN.TO.TR.TT.TV.TW.TZ.UA.UG.UM.US.UY.UZ.VA.VC.VE.VG.VI.VN.VU.WF.WS.XK.YE.YT.ZA.ZM.ZW`.split(`.`), mod97: (e) => { let t = 0; for (let n of e) t = (t * 10 + +n) % 97; return t; }, pattern10: [ `01`, `02`, `03`, `04`, `05`, `06`, `07`, `08`, `09` ], pattern100: [ `001`, `002`, `003`, `004`, `005`, `006`, `007`, `008`, `009` ], toDigitString: (e) => e.replaceAll(/[A-Z]/gi, (e) => String((e.toUpperCase().codePointAt(0) ?? NaN) - 55)) }; function Se(e) { let t = ``; for (let n = 0; n < e.length; n += 4) t += `${e.substring(n, n + 4)} `; return t.trimEnd(); } var Ce = class extends S { accountNumber(e = {}) { typeof e == `number` && (e = { length: e }); let { length: t = 8 } = e; return this.faker.string.numeric({ length: t, allowLeadingZeros: !0 }); } accountName() { return [this.faker.helpers.arrayElement(this.faker.definitions.finance.account_type), `Account`].join(` `); } routingNumber() { let e = this.faker.helpers.arrayElement(this.faker.definitions.finance.federal_reserve_routing_symbol) + this.faker.string.numeric({ length: 4, allowLeadingZeros: !0 }), t = 0; for (let n = 0; n < e.length; n += 3) t += Number(e[n]) * 3, t += Number(e[n + 1]) * 7, t += Number(e[n + 2]) || 0; return `${e}${Math.ceil(t / 10) * 10 - t}`; } amount(e = {}) { let { autoFormat: t = !1, dec: n = 2, max: r = 1e3, min: i = 0, symbol: a = `` } = e, o = this.faker.number.float({ max: r, min: i, fractionDigits: n }); return a + (t ? o.toLocaleString(void 0, { minimumFractionDigits: n }) : o.toFixed(n)); } transactionType() { return this.faker.helpers.arrayElement(this.faker.definitions.finance.transaction_type); } currency() { return this.faker.helpers.arrayElement(this.faker.definitions.finance.currency); } currencyCode() { return this.currency().code; } currencyName() { return this.currency().name; } currencySymbol() { let e; do e = this.currency().symbol; while (e.length === 0); return e; } currencyNumericCode() { return this.currency().numericCode; } bitcoinAddress(e = {}) { let { type: t = this.faker.helpers.enumValue(j), network: n = `mainnet` } = e, r = xe[t], i = r.prefix[n], a = this.faker.number.int(r.length); return i + this.faker.string.alphanumeric({ length: a - i.length, casing: r.casing, exclude: r.exclude }); } litecoinAddress() { let e = this.faker.number.int({ min: 26, max: 33 }); return this.faker.string.fromCharacters(`LM3`) + this.faker.string.fromCharacters(`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`, e - 1); } creditCardNumber(e = {}) { typeof e == `string` && (e = { issuer: e }); let { issuer: t = `` } = e, n, r = this.faker.definitions.finance.credit_card, i = t.toLowerCase(); if (i in r) n = this.faker.helpers.arrayElement(r[i]); else if (t.includes(`#`)) n = t; else { let e = this.faker.helpers.objectValue(r); n = this.faker.helpers.arrayElement(e); } return n = n.replaceAll(`/`, ``), this.faker.helpers.replaceCreditCardSymbols(n); } creditCardCVV() { return this.faker.string.numeric({ length: 3, allowLeadingZeros: !0 }); } creditCardIssuer() { return this.faker.helpers.objectKey(this.faker.definitions.finance.credit_card); } pin(t = {}) { typeof t == `number` && (t = { length: t }); let { length: n = 4 } = t; if (n < 1) throw new e$1(`minimum length is 1`); return this.faker.string.numeric({ length: n, allowLeadingZeros: !0 }); } ethereumAddress() { return this.faker.string.hexadecimal({ length: 40, casing: `lower` }); } iban(t = {}) { let { countryCode: n, formatted: r = !1 } = t, i = n ? M.formats.find((e) => e.country === n) : this.faker.helpers.arrayElement(M.formats); if (!i) throw new e$1(`Country code ${n} not supported.`); let a = ``, o = 0; for (let e of i.bban) { let t = e.count; for (o += e.count; t > 0;) e.type === `a` ? a += this.faker.helpers.arrayElement(M.alpha) : e.type === `c` ? this.faker.datatype.boolean(.8) ? a += this.faker.number.int(9) : a += this.faker.helpers.arrayElement(M.alpha) : t >= 3 && this.faker.datatype.boolean(.3) ? this.faker.datatype.boolean() ? (a += this.faker.helpers.arrayElement(M.pattern100), t -= 2) : (a += this.faker.helpers.arrayElement(M.pattern10), t--) : a += this.faker.number.int(9), t--; a = a.substring(0, o); } let s = 98 - M.mod97(M.toDigitString(`${a}${i.country}00`)); s < 10 && (s = `0${s}`); let c = `${i.country}${s}${a}`; return r ? Se(c) : c; } bic(e = {}) { let { includeBranchCode: t = this.faker.datatype.boolean() } = e; return `${this.faker.string.alpha({ length: 4, casing: `upper` })}${this.faker.helpers.arrayElement(M.iso3166)}${this.faker.string.alphanumeric({ length: 2, casing: `upper` })}${t ? this.faker.datatype.boolean() ? this.faker.string.alphanumeric({ length: 3, casing: `upper` }) : `XXX` : ``}`; } transactionDescription() { return this.faker.helpers.fake(this.faker.definitions.finance.transaction_description_pattern); } }; function N(e) { return e.split(` `).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(` `); } var we = class extends S { adjective() { return this.faker.helpers.arrayElement(this.faker.definitions.food.adjective); } description() { return this.faker.helpers.fake(this.faker.definitions.food.description_pattern); } dish() { return this.faker.datatype.boolean() ? N(this.faker.helpers.fake(this.faker.definitions.food.dish_pattern)) : N(this.faker.helpers.arrayElement(this.faker.definitions.food.dish)); } ethnicCategory() { return this.faker.helpers.arrayElement(this.faker.definitions.food.ethnic_category); } fruit() { return this.faker.helpers.arrayElement(this.faker.definitions.food.fruit); } ingredient() { return this.faker.helpers.arrayElement(this.faker.definitions.food.ingredient); } meat() { return this.faker.helpers.arrayElement(this.faker.definitions.food.meat); } spice() { return this.faker.helpers.arrayElement(this.faker.definitions.food.spice); } vegetable() { return this.faker.helpers.arrayElement(this.faker.definitions.food.vegetable); } }; var Te = class extends S { branch() { return `${this.faker.hacker.noun().replace(` `, `-`)}-${this.faker.hacker.verb().replace(` `, `-`)}`; } commitEntry(e = {}) { let { merge: t = this.faker.datatype.boolean({ probability: .2 }), eol: n = `CRLF`, refDate: r } = e, i = [`commit ${this.faker.git.commitSha()}`]; t && i.push(`Merge: ${this.commitSha({ length: 7 })} ${this.commitSha({ length: 7 })}`); let a = this.faker.person.firstName(), o = this.faker.person.lastName(), s = this.faker.person.fullName({ firstName: a, lastName: o }), c = this.faker.internet.username({ firstName: a, lastName: o }), l = this.faker.helpers.arrayElement([s, c]), u = this.faker.internet.email({ firstName: a, lastName: o }); l = l.replaceAll(/^[.,:;"\\']|[<>\n]|[.,:;"\\']$/g, ``), i.push(`Author: ${l} <${u}>`, `Date: ${this.commitDate({ refDate: r })}`, ``, `${`\xA0`.repeat(4)}${this.commitMessage()}`, ``); let d = n === `CRLF` ? `\r ` : ` `; return i.join(d); } commitMessage() { return `${this.faker.hacker.verb()} ${this.faker.hacker.adjective()} ${this.faker.hacker.noun()}`; } commitDate(e = {}) { let { refDate: t = this.faker.defaultRefDate() } = e, n = [ `Sun`, `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` ], r = [ `Jan`, `Feb`, `Mar`, `Apr`, `May`, `Jun`, `Jul`, `Aug`, `Sep`, `Oct`, `Nov`, `Dec` ], i = this.faker.date.recent({ days: 1, refDate: t }), a = n[i.getUTCDay()], o = r[i.getUTCMonth()], s = i.getUTCDate(), c = i.getUTCHours().toString().padStart(2, `0`), l = i.getUTCMinutes().toString().padStart(2, `0`), u = i.getUTCSeconds().toString().padStart(2, `0`), d = i.getUTCFullYear(), f = this.faker.number.int({ min: -11, max: 12 }), p = Math.abs(f).toString().padStart(2, `0`); return `${a} ${o} ${s} ${c}:${l}:${u} ${d} ${f >= 0 ? `+` : `-`}${p}00`; } commitSha(e = {}) { let { length: t = 40 } = e; return this.faker.string.hexadecimal({ length: t, casing: `lower`, prefix: `` }); } }; var Ee = class extends S { abbreviation() { return this.faker.helpers.arrayElement(this.faker.definitions.hacker.abbreviation); } adjective() { return this.faker.helpers.arrayElement(this.faker.definitions.hacker.adjective); } noun() { return this.faker.helpers.arrayElement(this.faker.definitions.hacker.noun); } verb() { return this.faker.helpers.arrayElement(this.faker.definitions.hacker.verb); } ingverb() { return this.faker.helpers.arrayElement(this.faker.definitions.hacker.ingverb); } phrase() { return this.faker.helpers.fake(this.faker.definitions.hacker.phrase); } }; const De = /\.|\(/; function Oe(t, n, r = [n, n.definitions.raw]) { if (t.length === 0) throw new e$1(`Eval expression cannot be empty.`); if (r.length === 0) throw new e$1(`Eval entrypoints cannot be empty.`); let i = r, a = t; do { let e; a.startsWith(`(`) ? [e, i] = ke(a, i) : [e, i] = je(a, i), a = a.substring(e), i = i.filter((e) => e != null).map((e) => Array.isArray(e) ? n.helpers.arrayElement(e) : e); } while (a.length > 0 && i.length > 0); if (i.length === 0) throw new e$1(`Cannot resolve expression '${t}'`); let o = i[0]; return typeof o == `function` ? o() : o; } function ke(t, n) { let [r, i] = Ae(t), a = t[r + 1]; switch (a) { case `.`: case `(`: case void 0: break; default: throw new e$1(`Expected dot ('.'), open parenthesis ('('), or nothing after function call but got '${a}'`); } return [r + (a === `.` ? 2 : 1), n.map((e) => typeof e == `function` ? e(...i) : void 0)]; } function Ae(t) { let n = t.indexOf(`)`, 1); if (n === -1) throw new e$1(`Missing closing parenthesis in '${t}'`); for (; n !== -1;) { let e = t.substring(1, n); try { return [n, JSON.parse(`[${e}]`)]; } catch { if (!e.includes(`'`) && !e.includes(`"`)) try { return [n, JSON.parse(`["${e}"]`)]; } catch {} } n = t.indexOf(`)`, n + 1); } n = t.lastIndexOf(`)`); let r = t.substring(1, n); return [n, [r]]; } function je(t, n) { let r = De.exec(t), i = (r?.[0] ?? ``) === `.`, a = r?.index ?? t.length, o = t.substring(0, a); if (o.length === 0) throw new e$1(`Expression parts cannot be empty in '${t}'`); let s = t[a + 1]; if (i && (s == null || s === `.` || s === `(`)) throw new e$1(`Found dot without property name in '${t}'`); return [a + +!!i, n.map((e) => P(e, o))]; } function P(e, t) { switch (typeof e) { case `function`: try { e = e(); } catch { return; } return P(e, t); case `object`: return e?.[t]; default: return; } } function Me(e) { let t = Ne(e.replace(/L?$/, `0`)); return t === 0 ? 0 : 10 - t; } function Ne(e) { e = e.replaceAll(/[\s-]/g, ``); let t = 0, n = !1; for (let r = e.length - 1; r >= 0; r--) { let i = Number.parseInt(e[r]); n && (i *= 2, i > 9 && (i = i % 10 + 1)), t += i, n = !n; } return t % 10; } function F(t, n, r, i) { let a = 1; if (n) switch (n) { case `?`: a = +!t.datatype.boolean(); break; case `*`: { let e = 1; for (; t.datatype.boolean();) e *= 2; a = t.number.int({ min: 0, max: e }); break; } case `+`: { let e = 1; for (; t.datatype.boolean();) e *= 2; a = t.number.int({ min: 1, max: e }); break; } default: throw new e$1(`Unknown quantifier symbol provided.`); } else r != null && i != null ? a = t.number.int({ min: Number.parseInt(r), max: Number.parseInt(i) }) : r != null && i == null && (a = Number.parseInt(r)); return a; } function Pe(e, t = ``) { let n = /(.)\{(\d+),(\d+)\}/, r = /(.)\{(\d+)\}/, i = /\[(\d+)-(\d+)\]/, a, o, s, c, l = n.exec(t); for (; l != null;) a = Number.parseInt(l[2]), o = Number.parseInt(l[3]), a > o && (s = o, o = a, a = s), c = e.number.int({ min: a, max: o }), t = t.slice(0, l.index) + l[1].repeat(c) + t.slice(l.index + l[0].length), l = n.exec(t); for (l = r.exec(t); l != null;) c = Number.parseInt(l[2]), t = t.slice(0, l.index) + l[1].repeat(c) + t.slice(l.index + l[0].length), l = r.exec(t); for (l = i.exec(t); l != null;) a = Number.parseInt(l[1]), o = Number.parseInt(l[2]), a > o && (s = o, o = a, a = s), t = t.slice(0, l.index) + e.number.int({ min: a, max: o }).toString() + t.slice(l.index + l[0].length), l = i.exec(t); return t; } function Fe(e, t, n) { let r = ``, i = !1; for (let a = 0; a < t.length; a++) { let o = t[a]; if (o === `\\`) { r += o, a + 1 < t.length && (r += t[++a]); continue; } if (o === `[`) { i = !0, r += o; continue; } if (o === `]`) { i = !1, r += o; continue; } let s = t[a + 1], c = [ `?`, `*`, `+`, `{` ].includes(s); if (!i && !c && o === `.`) { r += e.string.alphanumeric(); continue; } if (!i && !c && n && /^[a-z]$/i.test(o)) { r += e.string.fromCharacters([o.toLowerCase(), o.toUpperCase()]); continue; } r += o; } return r; } function I(e, t = ``, n = `#`) { let r = ``; for (let i = 0; i < t.length; i++) t.charAt(i) === n ? r += e.number.int(9) : t.charAt(i) === `!` ? r += e.number.int({ min: 2, max: 9 }) : r += t.charAt(i); return r; } var L = class extends x { slugify(e = ``) { return e.normalize(`NFKD`).replaceAll(/[\u0300-\u036F]/g, ``).replaceAll(` `, `-`).replaceAll(/[^\w.-]+/g, ``); } replaceSymbols(e = ``) { let t = `ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``), n = ``; for (let r = 0; r < e.length; r++) e.charAt(r) === `#` ? n += this.faker.number.int(9) : e.charAt(r) === `?` ? n += this.arrayElement(t) : e.charAt(r) === `*` ? n += this.faker.datatype.boolean() ? this.arrayElement(t) : this.faker.number.int(9) : n += e.charAt(r); return n; } replaceCreditCardSymbols(e = `6453-####-####-####-###L`, t = `#`) { e = Pe(this.faker, e), e = I(this.faker, e, t); let n = Me(e); return e.replace(`L`, String(n)); } fromRegExp(t) { let n = !1; if (t instanceof RegExp && (n = t.flags.includes(`i`), t = t.source.replace(/^\^+/, ``).replace(/\$+$/, ``)), t === `.`) return this.faker.string.a