{"version":3,"sources":["../src/common/common.ts","../src/reduce/reduce.ts","../src/units/units.ts","../src/convertMap/convertMap.ts","../src/formatParts/formatParts.ts","../src/formatMap/formatMap.ts","../src/getValueAndType/getValueAndType.ts","../src/msToMap/msToMap.ts","../src/format/format.ts","../src/parseToMs/parseToMs.ts","../src/formatListMap/formatListMap.ts","../src/formatList/formatList.ts","../src/ObjectToUnitMap/OtUm.ts","../src/formatObject/formatObject.ts","../src/formatListObject/formatListObject.ts"],"sourcesContent":["/**\n * `Style` & `LocaleMatcher` from Intl.RelativeTimeFormatOptions\n *\n * [mdn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#options)\n */\nexport type RelativeOptions = Pick<Intl.RelativeTimeFormatOptions, \"style\" | \"localeMatcher\">;\n\n/**\n * create an RelativeTimeFormat object\n * @param locale the wanted locale\n * @param options the style and in which way you want the locale to match (defaults are set by runtime), numeric with will always be set to \"always\"\n * @returns a new RelativeTimeFormat object\n * @link [mdn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat)\n */\nexport function createRelativeTimeFormat(locale?: string, options?: RelativeOptions): Intl.RelativeTimeFormat {\n\treturn new Intl.RelativeTimeFormat(locale, {\n\t\tnumeric: \"always\",\n\t\t...options,\n\t});\n}\n","/**\n * reduce a RelativeTimeFormat.format to the number and unit for a locale with 3 parts\n * @param from to reduce from\n * @param comparison to compare with (should be quarter or month as these aren't being used)\n * @returns string with number and unit (for example: `1 day` or `1d`)\n */\nexport function reducePartsOf3(from: Intl.RelativeTimeFormatPart[], comparison: Intl.RelativeTimeFormatPart[], includeValue: boolean = true): string[] {\n\treturn from.reduce((acc, value, index) => {\n\t\tif (\"unit\" in value) {\n\t\t\tif (includeValue) {\n\t\t\t\tacc.push(value.value);\n\t\t\t}\n\t\t\treturn acc;\n\t\t}\n\t\tif (value.value != comparison[index].value) {\n\t\t\tacc.push(value.value);\n\t\t}\n\n\t\treturn acc;\n\t}, [] as string[]);\n}\n\nconst space = \" \";\n\n/**\n * reduce a RelativeTimeFormat.format to the number and unit for a locale with 2 parts\n * @param from to reduce from\n * @param comparison to compare with (should be quarter or month as these aren't being used)\n * @returns string with number and unit (for example: `1 day` or `1d`)\n */\n// js runtimes are kinda lazy in a good way with how they do month & 'over'/'ago' with the latter not changing\nexport function reducePartsOf2(from: Intl.RelativeTimeFormatPart[], comparison: Intl.RelativeTimeFormatPart[], includeValue: boolean = true): string[] {\n\treturn from.reduce((acc, value, index) => {\n\t\tif (\"unit\" in value) {\n\t\t\tif (includeValue) {\n\t\t\t\tacc.push(value.value);\n\t\t\t}\n\t\t\treturn acc;\n\t\t}\n\t\tif (value.value.trim().includes(space)) {\n\t\t\t// has spaces\n\t\t\tconst split = value.value.split(space);\n\t\t\tconst cSplit = comparison[index].value.split(space);\n\n\t\t\tacc.push(split.filter((v, i) => v !== cSplit[i] || v == space).join(\"\"));\n\t\t\treturn acc;\n\t\t}\n\n\t\tconst split = new Set(value.value.split(\"\"));\n\t\tconst cSplit = comparison[index].value.split(\"\");\n\n\t\tcSplit.forEach(v => {\n\t\t\tif (v == space) return;\n\t\t\tsplit.delete(v);\n\t\t});\n\n\t\tacc.push([...split].join(\"\"));\n\n\t\treturn acc;\n\t}, [] as string[]);\n}\n","/**\n * all unit types used by msToMap & msToObject\n\n */\nexport const unitTypes: Record<UnitType, UnitType> = {\n\tyear: \"year\",\n\tweek: \"week\",\n\tday: \"day\",\n\thour: \"hour\",\n\tminute: \"minute\",\n\tsecond: \"second\",\n\tmonth: \"month\",\n} satisfies Record<UnitType, UnitType>;\n\n/**\n * used as keys for msToMap & msToObject\n */\nexport type UnitType = Exclude<Intl.RelativeTimeFormatUnitSingular, \"quarter\">; //(typeof unitTypes)[keyof typeof unitTypes];\n\n/**\n * amount of ms in a second\n */\nexport const second = /* @__PURE__ */ 1000;\n/**\n * amount of ms in a minute\n */\nexport const minute = /* @__PURE__ */ second * 60;\n/**\n * amount of ms in an hour\n */\nexport const hour = /* @__PURE__ */ minute * 60;\n/**\n * amount of ms in a day\n */\nexport const day = /* @__PURE__ */ hour * 60;\n/**\n * amount of ms in a week\n */\nexport const week = /* @__PURE__ */ day * 7;\n/**\n * amount of ms in a year\n */\nexport const year = /* @__PURE__ */ day * 365.25;\n","import { reducePartsOf2, reducePartsOf3 } from \"../reduce/reduce\";\nimport { day, hour, minute, second, unitTypes, week, year, type UnitType } from \"../units/units\";\n\n/**\n * A map to be used for createConvertMap\n */\n//@ts-ignore\nconst convertMap: Record<UnitType, number> = {\n\t[unitTypes.year]: year,\n\t[unitTypes.week]: week,\n\t[unitTypes.day]: day,\n\t[unitTypes.hour]: hour,\n\t[unitTypes.minute]: minute,\n\t[unitTypes.second]: second,\n};\n\n/**\n * create a Map with unitType in the chosen locale and the ms in unit value\n * @param rl RelativeTimeFormat object\n * @returns a Map with unitType in the chosen locale and the ms in unit value\n */\nexport function createConvertMap(rl: Intl.RelativeTimeFormat): Map<string, number> {\n\tconst quarterSingular = rl.formatToParts(1, \"quarter\");\n\tconst quartersPlural = rl.formatToParts(2, \"quarters\");\n\n\tconst map = new Map<string, number>();\n\n\tfor (const [key, value] of Object.entries(convertMap)) {\n\t\tconst singleParts = rl.formatToParts(1, key as UnitType);\n\t\tconst pluralParts = rl.formatToParts(2, key as UnitType);\n\n\t\tconst single = (singleParts.length == 3 ? reducePartsOf3 : reducePartsOf2)(singleParts, quarterSingular, false)[0].trim().replace(\".\", \"\");\n\t\tmap.set(single, value);\n\t\tconst plural = (pluralParts.length == 3 ? reducePartsOf3 : reducePartsOf2)(pluralParts, quartersPlural, false)[0].trim().replace(\".\", \"\");\n\t\tmap.set(plural, value);\n\t}\n\treturn map;\n}\n","import type { UnitValueMap } from \"../msToMap/msToMap\";\nimport { reducePartsOf2, reducePartsOf3 } from \"../reduce/reduce\";\nimport type { UnitType } from \"../units/units\";\n\n/**\n * format all values & units into relative format parts\n * @param map map with value & unitTypes\n * @param rltf Intl.RelativeTimeFormat\n * @returns parts as a string[]\n */\nexport function formatParts(map: UnitValueMap, rltf: Intl.RelativeTimeFormat): string[] {\n\treturn [...map].map(([unitType, value], index) => {\n\t\tconst part = formatPart(Math.abs(value), unitType, rltf);\n\t\tif (value < 0 && index < 1) {\n\t\t\treturn `-${part}`;\n\t\t}\n\t\treturn part;\n\t});\n}\n\n/**\n * format a single value & unit type to a formatted part\n * @param value the value of the part\n * @param unitType the unit type this part is for\n * @param rltf Intl.RelativeTimeFormat\n * @returns a single part as a string\n */\nexport function formatPart(value: number, unitType: UnitType, rltf: Intl.RelativeTimeFormat): string {\n\tconst parts = rltf.formatToParts(value, unitType);\n\tconst comparison = rltf.formatToParts(value, \"quarter\");\n\t// parts only exist out of 3 or 2 parts, not more\n\tif (parts.length == 3) {\n\t\treturn reducePartsOf3(parts, comparison).join(\"\");\n\t}\n\treturn reducePartsOf2(parts, comparison).join(\"\");\n}\n","import { createRelativeTimeFormat, type RelativeOptions } from \"../common/common\";\nimport { formatParts } from \"../formatParts/formatParts\";\nimport type { UnitValueMap } from \"../msToMap/msToMap\";\n\n/**\n * formats a map to a relative time string in the order of the map\n * @param unitMap a Map with the key as the units and the values the amount of each unit\n * @param options options you want for the formatting\n * @returns a formatted string based on the given map\n */\nexport function formatMap(unitMap: UnitValueMap, options: RelativeOptions & { locale?: string } = {}): string {\n\tconst { locale } = options;\n\n\tconst rl = createRelativeTimeFormat(locale, options);\n\n\treturn formatParts(unitMap, rl).join(\" \");\n}\n\n// tests are covered by format\n","import { unitTypes, day, hour, minute, second, week, year, type UnitType } from \"../units/units\";\n\n/**\n * return type for getBiggestValueAndType\n */\nexport interface ValueAndType {\n\t/**\n\t * the unit type of the value\n\t */\n\ttype: UnitType;\n\t/**\n\t * the amount of the specific unit type\n\t */\n\tvalue: number;\n\t/**\n\t * time left over after subtracting the unit type * amount from the given time\n\t */\n\tleftOverTime: number;\n}\n\n/**\n * get the biggest value & unit type that can be extracted from the given time in milliseconds\n * @param time time in milliseconds\n * @returns an object containing the type, value & leftOverTime\n */\nexport function getBiggestValueAndType(time: number): ValueAndType {\n\tswitch (true) {\n\t\tcase time > year: {\n\t\t\treturn createValueAndType(time, year, unitTypes.year);\n\t\t}\n\t\tcase time > week: {\n\t\t\treturn createValueAndType(time, week, unitTypes.week);\n\t\t}\n\t\tcase time > day: {\n\t\t\treturn createValueAndType(time, day, unitTypes.day);\n\t\t}\n\t\tcase time > hour: {\n\t\t\treturn createValueAndType(time, hour, unitTypes.hour);\n\t\t}\n\t\tcase time > minute: {\n\t\t\treturn createValueAndType(time, minute, unitTypes.minute);\n\t\t}\n\t\tcase time > second: {\n\t\t\treturn createValueAndType(time, second, unitTypes.second);\n\t\t}\n\t\tdefault: {\n\t\t\treturn {\n\t\t\t\tleftOverTime: 0,\n\t\t\t\tvalue: time / second,\n\t\t\t\ttype: unitTypes.second,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * creates the object that returns the value, type & leftOverTime\n * @param time time in milleseconds\n * @param unitValue the amount of milliseconds the given unit contains\n * @param type the type of unit\n * @returns an object containing the type, value & leftOverTime\n */\nfunction createValueAndType(time: number, unitValue: number, type: UnitType): ValueAndType {\n\tconst value = Math.floor(time / unitValue);\n\tconst leftOverTime = time - unitValue * value;\n\n\treturn {\n\t\tleftOverTime,\n\t\tvalue,\n\t\ttype,\n\t};\n}\n","import type { UnitType } from \"../units/units\";\nimport { getBiggestValueAndType } from \"../getValueAndType/getValueAndType\";\n\n/**\n * Options for msToMap & functions it's being used by\n */\nexport interface msToMapOptions {\n\t/**\n\t * max amount of units to display\n\t */\n\tmax?: number;\n}\n\n/**\n * a Map from msToMap that has the units as keys and the amount of time as values\n */\nexport type UnitValueMap = Map<UnitType, number>;\n\n/**\n * make a map from the time given in ms seconds\n * @param time time in ms seconds\n * @param options.max max amount of values that should be saved in the map\n * @returns an map with the key being the unitTypes and the value the amount of it gotten from the time\n */\nexport function msToMap(time: number, options: msToMapOptions = {}): UnitValueMap {\n\tlet { max = 7 } = options;\n\tconst negative = time < 0;\n\ttime = Math.abs(time);\n\tconst map = new Map<UnitType, number>();\n\tdo {\n\t\tconst r = getBiggestValueAndType(time);\n\t\ttime = r.leftOverTime;\n\t\tif (r.value > 0) {\n\t\t\tmap.set(r.type, negative ? -r.value : r.value);\n\t\t}\n\t\tmax--;\n\t} while (time > 999 && max > 0);\n\n\treturn map;\n}\n\n/**\n * make an object from the time given in ms seconds\n * @param time  time in ms seconds\n * @param options.max max amount of values that should be saved in the object\n * @returns an object with the key being the unitTypes and the value the amount of it gotten from the time\n */\nexport function msToObject(time: number, options: msToMapOptions = {}): Partial<Record<UnitType, number>> {\n\treturn Object.fromEntries(msToMap(time, options));\n}\n","import { type RelativeOptions } from \"../common/common\";\nimport { formatMap } from \"../formatMap/formatMap\";\nimport { msToMap, type msToMapOptions } from \"../msToMap/msToMap\";\n\n/**\n * Options for `format`\n */\nexport type FormatOptions = msToMapOptions &\n\tRelativeOptions & {\n\t\t/**\n\t\t * the locale you want to use\n\t\t */\n\t\tlocale?: string;\n\t};\n\n/**\n * format time in ms to a string based on your options\n * @param time time is milliseconds\n * @param options options you want\n * @returns a formatted string based on your options\n *\n * @example ```ts\n * format(1080003000, { style: \"long\", locale:  \"en-US\"}) => \"5 days 3 seconds\"\n * ```\n * @example ```ts\n * format(489348005000, { style: \"short\", max: 2, locale: \"en-US\") => \"6 yr. 10 wk.\"\n * ```\n */\nexport function format(time: number, options: FormatOptions = {}): string {\n\tconst { max, locale } = options;\n\tconst unitMap = msToMap(time, { max });\n\n\t// const rl = createRelativeTimeFormat(locale, options);\n\n\t// return formatParts(unitMap, rl).join(\" \");\n\n\treturn formatMap(unitMap, options);\n}\n","import { createRelativeTimeFormat } from \"../common/common\";\nimport { createConvertMap } from \"../convertMap/convertMap\";\n\n/**\n * check if a string value is a number\n * @param value a value to check\n */\nfunction isNumber(value: string): value is `${number}` {\n\t// @ts-ignore, we use js casting to check if the value is only a number\n\treturn value == parseFloat(value);\n}\n\n/**\n * check if a string value begins with a number\n * @param value value to check\n */\nfunction hasNumber(value: string): value is `${number}${string}` {\n\treturn /^\\d/g.test(value);\n}\n\n/**\n * Options for parseToMs\n */\nexport interface toMsOptions {\n\t/**\n\t * the style of the string you're giving `required`\n\t */\n\tstyle: Intl.RelativeTimeFormatStyle;\n\t/**\n\t * the locale the string is in\n\t */\n\tlocale?: string;\n\t/**\n\t * locale matching algorithm you want to use\n\t */\n\tlocaleMatcher?: Intl.RelativeTimeFormatLocaleMatcher;\n}\n\n/**\n * parse a string to ms\n * @param value a formatted string, for example `year 5 days 10minutes`\n * @param style the style you've formatted the value (required)\n * @param locale the locale used\n * @param localeMatcher how to match the locale (in general can be ignored)\n * @returns the time in ms based on the given value (if not valid, it'll give null)`\n * @example ```js\n * parseToMs(\"year 5 days 10 minutes\", { locale: \"en-US\", style: \"long\" }) => 79_974_600_000\n * ```\n */\nexport function parseToMs(value: string, { locale, style, localeMatcher }: toMsOptions): number | null {\n\tvalue = value.trim().toLowerCase();\n\tif (isNumber(value)) {\n\t\treturn parseFloat(value);\n\t}\n\tconst rl = createRelativeTimeFormat(locale, {\n\t\tstyle,\n\t\tlocaleMatcher,\n\t});\n\tconst convertMap = createConvertMap(rl);\n\t// splitting by every space\n\tconst values = value.replaceAll(\".\", \"\").split(/ +/g);\n\tlet ms = 0;\n\tms: for (let entry: string | undefined; (entry = values.shift()); ) {\n\t\tentry = entry.trim();\n\t\tif (isNumber(entry)) {\n\t\t\t// just a number\n\t\t\tconst nr = Math.abs(parseFloat(entry));\n\t\t\tconst next = values.at(0);\n\n\t\t\tif (!next) {\n\t\t\t\t// current is ms and there is nothing more\n\t\t\t\tms += nr;\n\t\t\t\tbreak ms;\n\t\t\t}\n\n\t\t\tif (hasNumber(next)) {\n\t\t\t\t// current is ms, next can be for example be \"10hours\"\n\t\t\t\tms += nr;\n\t\t\t\tcontinue ms;\n\t\t\t}\n\n\t\t\tvalues.shift(); // removing unit from values;\n\t\t\tconst time = convertMap.get(next);\n\n\t\t\tif (!time) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tms += time * nr;\n\t\t\tcontinue ms;\n\t\t\t// \t// here we will need to parse the unit\n\t\t}\n\n\t\tif (hasNumber(entry)) {\n\t\t\tconst nr = Math.abs(parseFloat(entry));\n\t\t\tconst unit = entry.substring(nr.toString().length);\n\t\t\tconst time = convertMap.get(unit);\n\t\t\tif (!time) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tms += nr * time;\n\t\t\tcontinue ms;\n\t\t}\n\t\t// just the unit now\n\t\tconst time = convertMap.get(entry);\n\t\tif (!time) {\n\t\t\treturn null;\n\t\t}\n\t\tms += time;\n\n\t\t// while ((let entry = values.shift())) {\n\t}\n\treturn ms;\n}\n","import { createRelativeTimeFormat } from \"../common/common\";\nimport type { FormatListOptions } from \"../formatList/formatList\";\nimport { formatParts } from \"../formatParts/formatParts\";\nimport type { UnitValueMap } from \"../msToMap/msToMap\";\n\n/**\n * format a map to string with Intl.listFormat\n * @param unitMap a Map with the key as the units and the values the amount of each unit\n * @param options options you wants\n * @returns a formatted list string based on the given map\n */\nexport function formatListMap(unitMap: UnitValueMap, options: Omit<FormatListOptions, \"max\">): string {\n\tconst { locale, localeMatcher, listType: type, listStyle, relativeStyle } = options;\n\n\tconst rl = createRelativeTimeFormat(locale, { localeMatcher, style: relativeStyle });\n\n\tconst lf = new Intl.ListFormat(locale, {\n\t\tlocaleMatcher,\n\t\tstyle: listStyle,\n\t\ttype,\n\t});\n\n\treturn lf.format(formatParts(unitMap, rl));\n}\n\n// tests is via formatList\n","import { createRelativeTimeFormat } from \"../common/common\";\nimport { formatListMap } from \"../formatListMap/formatListMap\";\nimport { formatParts } from \"../formatParts/formatParts\";\nimport { msToMap, type msToMapOptions } from \"../msToMap/msToMap\";\n\n/**\n * options for FormatList function\n */\nexport interface FormatListOptions extends msToMapOptions {\n\t/**\n\t * the locale you want to use\n\t */\n\tlocale?: string;\n\t/**\n\t * the style to use with Intl.relativeFormat\n\t */\n\trelativeStyle?: Intl.RelativeTimeFormatStyle;\n\t/**\n\t * the list style for Intl.ListFormat\n\t */\n\tlistStyle?: Intl.ListFormatStyle;\n\t/**\n\t * the list style you want to use\n\t * @default \"conjunction\"\n\t */\n\tlistType?: Intl.ListFormatType;\n\t/**\n\t * how to match the given locale\n\t */\n\tlocaleMatcher?: Intl.RelativeTimeFormatLocaleMatcher;\n}\n\n/**\n * format time in ms to string with Intl.listFormat\n * @param time time is milliseconds\n * @param options options you wants\n * @returns a formatted list string based on your options\n * @example ```ts\n * formatList(1080003000, { relativeStyle: \"long\", listStyle: \"long\", locale:  \"en-US\"}) => \"5 days and 3 seconds\"\n * ```\n * @example ```ts\n * formatList(489348005000, { relativeStyle: \"short\", listStyle: \"short\", listType: \"unit\", max: 2, locale: \"en-US\") => \"6 yr., 10 wk.\"\n * ```\n */\nexport function formatList(time: number, options: FormatListOptions = {}): string {\n\tconst { max } = options;\n\tconst unitMap = msToMap(time, { max });\n\n\treturn formatListMap(unitMap, options);\n}\n","import type { UnitValueMap } from \"../msToMap/msToMap\";\nimport type { UnitType } from \"../units/units\";\n\n/**\n * transforms a object to a map\n * @param obj a object with the keys being units and values the duration\n * @returns a unit map\n */\nexport function objectToUnitMap(obj: Partial<Record<UnitType, number>>) {\n\tconst map: UnitValueMap = new Map();\n\tif (obj.year) {\n\t\tmap.set(\"year\", obj.year);\n\t}\n\tif (obj.month) {\n\t\tmap.set(\"month\", obj.month);\n\t}\n\tif (obj.week) {\n\t\tmap.set(\"week\", obj.week);\n\t}\n\tif (obj.day) {\n\t\tmap.set(\"day\", obj.day);\n\t}\n\tif (obj.hour) {\n\t\tmap.set(\"hour\", obj.hour);\n\t}\n\tif (obj.minute) {\n\t\tmap.set(\"minute\", obj.minute);\n\t}\n\tif (obj.second) {\n\t\tmap.set(\"second\", obj.second);\n\t}\n\treturn map;\n}\n","import type { RelativeOptions } from \"../common/common\";\nimport { formatMap } from \"../formatMap/formatMap\";\nimport { objectToUnitMap } from \"../ObjectToUnitMap/OtUm\";\nimport type { UnitType } from \"../units/units\";\n\n/**\n * formats an object to a relative time string\n * @param obj an object with the key as the units and the values the amount of each unit\n * @param options options you want for the formatting\n * @returns a formatted string based on the given map\n */\nexport function formatObject(obj: Partial<Record<UnitType, number>>, options: RelativeOptions & { locale?: string } = {}): string {\n\treturn formatMap(objectToUnitMap(obj), options);\n}\n","import type { FormatListOptions } from \"../formatList/formatList\";\nimport { formatListMap } from \"../formatListMap/formatListMap\";\nimport { objectToUnitMap } from \"../ObjectToUnitMap/OtUm\";\nimport type { UnitType } from \"../units/units\";\n\n/**\n * formats an object to string with Intl.listFormat\n * @param obj an object with the key as the units and the values the amount of each unit\n * @param options options you want for the formatting\n * @returns a formatted string based on the given map\n */\nexport function formatListObject(obj: Partial<Record<UnitType, number>>, options: Omit<FormatListOptions, \"max\">): string {\n\treturn formatListMap(objectToUnitMap(obj), options);\n}\n"],"mappings":";AAcO,SAAS,yBAAyB,QAAiB,SAAoD;AAC7G,SAAO,IAAI,KAAK,mBAAmB,QAAQ;AAAA,IAC1C,SAAS;AAAA,IACT,GAAG;AAAA,EACJ,CAAC;AACF;;;ACbO,SAAS,eAAe,MAAqC,YAA2C,eAAwB,MAAgB;AACtJ,SAAO,KAAK,OAAO,CAAC,KAAK,OAAO,UAAU;AACzC,QAAI,UAAU,OAAO;AACpB,UAAI,cAAc;AACjB,YAAI,KAAK,MAAM,KAAK;AAAA,MACrB;AACA,aAAO;AAAA,IACR;AACA,QAAI,MAAM,SAAS,WAAW,KAAK,EAAE,OAAO;AAC3C,UAAI,KAAK,MAAM,KAAK;AAAA,IACrB;AAEA,WAAO;AAAA,EACR,GAAG,CAAC,CAAa;AAClB;AAEA,IAAM,QAAQ;AASP,SAAS,eAAe,MAAqC,YAA2C,eAAwB,MAAgB;AACtJ,SAAO,KAAK,OAAO,CAAC,KAAK,OAAO,UAAU;AACzC,QAAI,UAAU,OAAO;AACpB,UAAI,cAAc;AAC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