libphonenumber-js 1.13.4 → 1.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +22 -4
- package/CHANGELOG.md +28 -15
- package/build/helpers/checkNumberLength.test.js.map +1 -1
- package/bundle/libphonenumber-js.min.js +1 -1
- package/bundle/libphonenumber-js.min.js.map +1 -1
- package/bundle/libphonenumber-max.js +1 -1
- package/bundle/libphonenumber-max.js.map +1 -1
- package/bundle/libphonenumber-min.js +1 -1
- package/bundle/libphonenumber-min.js.map +1 -1
- package/bundle/libphonenumber-mobile.js +1 -1
- package/bundle/libphonenumber-mobile.js.map +1 -1
- package/es6/helpers/checkNumberLength.test.js.map +1 -1
- package/es6-modern/helpers/checkNumberLength.test.js.map +1 -1
- package/max/metadata/metadata.max.json +1 -1
- package/max/metadata/metadata.max.json.js +1 -1
- package/metadata.full.json +1 -1
- package/metadata.full.json.js +1 -1
- package/metadata.max.json +1 -1
- package/metadata.max.json.js +1 -1
- package/metadata.min.json +1 -1
- package/metadata.min.json.js +1 -1
- package/metadata.mobile.json +1 -1
- package/metadata.mobile.json.js +1 -1
- package/min/metadata/metadata.min.json +1 -1
- package/min/metadata/metadata.min.json.js +1 -1
- package/mobile/metadata/metadata.mobile.json +1 -1
- package/mobile/metadata/metadata.mobile.json.js +1 -1
- package/package.json +1 -1
- package/types.d.cts +5 -34
- package/types.d.ts +5 -34
package/.gitlab-ci.yml
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# Node 24+ ensures that npm 11.5+ is natively available.
|
|
2
|
+
# The `npm` version must meet the minimum requirements for "trusted publishing".
|
|
3
|
+
image: node:24
|
|
2
4
|
|
|
3
5
|
pages:
|
|
4
6
|
script:
|
|
@@ -12,20 +14,36 @@ pages:
|
|
|
12
14
|
paths:
|
|
13
15
|
- public
|
|
14
16
|
|
|
15
|
-
# Does not run on schedule
|
|
17
|
+
# Does not run on schedule.
|
|
16
18
|
rules:
|
|
17
19
|
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH != "master"
|
|
18
20
|
when: never # Excludes this job from scheduled pipeline types
|
|
19
21
|
- when: on_success
|
|
20
22
|
|
|
21
23
|
update-metadata:
|
|
24
|
+
# OIDC ID token that is used for "trusted publishing".
|
|
25
|
+
id_tokens:
|
|
26
|
+
NPM_ID_TOKEN:
|
|
27
|
+
aud: "npm:registry.npmjs.org"
|
|
28
|
+
|
|
29
|
+
# (security) Restrict publishing to tagged releases only.
|
|
30
|
+
# But it did output an error: "jobs:update-metadata config key may not be used with `rules`: only".
|
|
31
|
+
# only:
|
|
32
|
+
# - tags
|
|
33
|
+
|
|
34
|
+
before_script:
|
|
35
|
+
- git config --global user.email "metadata-updater@gay.com"
|
|
36
|
+
- git config --global user.name "Metadata Updater"
|
|
37
|
+
|
|
22
38
|
script:
|
|
39
|
+
# Verify that `npm` version meets the minimum requirements for "trusted publishing".
|
|
40
|
+
- npm --version
|
|
23
41
|
- git checkout master
|
|
24
42
|
- npm install
|
|
25
43
|
- npm run metadata:update:job
|
|
26
44
|
|
|
27
|
-
# Only runs on schedule
|
|
45
|
+
# Only runs on schedule.
|
|
28
46
|
rules:
|
|
29
47
|
- if: $CI_PIPELINE_SOURCE == "schedule" && $TASK_TYPE == "metadata-update"
|
|
30
48
|
when: always
|
|
31
|
-
- when: never # Excludes this job from non-scheduled pipeline types
|
|
49
|
+
- when: never # Excludes this job from non-scheduled pipeline types.
|
package/CHANGELOG.md
CHANGED
|
@@ -67,21 +67,34 @@ And edit the README:
|
|
|
67
67
|
|
|
68
68
|
<!-- This changelog [only](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/16#note_594165443) mentions the changes in the code. See [Google's changelog](https://github.com/google/libphonenumber/blob/master/release_notes.txt) for metadata changes. -->
|
|
69
69
|
|
|
70
|
-
<!-- CHANGELOG START -->
|
|
71
|
-
|
|
72
|
-
1.13.
|
|
73
|
-
===================
|
|
74
|
-
|
|
75
|
-
* Updated metadata to version 9.0.
|
|
76
|
-
- Updated
|
|
77
|
-
- Updated
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
<!-- CHANGELOG START -->
|
|
71
|
+
|
|
72
|
+
1.13.6 / 5.6.2026
|
|
73
|
+
===================
|
|
74
|
+
|
|
75
|
+
* Updated metadata to version 9.0.32:
|
|
76
|
+
- Updated phone metadata for region code(s): DZ, JP, NO, SJ, SO, UG
|
|
77
|
+
- Updated carrier data for country calling code(s):
|
|
78
|
+
33 (en), 47 (en), 233 (en), 252 (en), 256 (en)
|
|
79
|
+
|
|
80
|
+
1.13.5 / 03.06.2026
|
|
81
|
+
===================
|
|
82
|
+
|
|
83
|
+
* Converted any "tagged" types [back](https://gitlab.com/catamphetamine/libphonenumber-js/-/work_items/144#note_3415397139) to simple strings. Originally, some developers lobbied the use of so-called ["tagged"](https://medium.com/@ethanresnick/advanced-typescript-tagged-types-for-fewer-bugs-and-better-security-24db681d5721) types in this package in order to return more "strict" values. My knowledge of TypeScript at that time was limited to just its title, so I naturally succumbed to that influence and merged whatever changes seemed to be consensual between the participants in the issue discussions. Now though I can see how the concept of "tagged" types is redundant and adds nothing, so I decided to revert any "tagged" types back to simple strings.
|
|
84
|
+
|
|
85
|
+
1.13.3 / 22.5.2026
|
|
86
|
+
===================
|
|
87
|
+
|
|
88
|
+
* Updated metadata to version 9.0.31:
|
|
89
|
+
- Updated alternate formatting data for country calling code(s): 84
|
|
90
|
+
- Updated phone metadata for region code(s):
|
|
91
|
+
AI, BO, DZ, ET, GE, GM, IN, TR, UG, VN
|
|
92
|
+
- Updated short number metadata for region code(s): IT
|
|
93
|
+
- Updated geocoding data for country calling code(s): 213 (en)
|
|
94
|
+
- Updated carrier data for country calling code(s):
|
|
95
|
+
34 (en), 43 (en), 84 (en), 90 (en), 220 (en), 251 (en), 256 (en), 354 (en),
|
|
96
|
+
591 (en), 1264 (en)
|
|
97
|
+
|
|
85
98
|
1.13.0 / 08.05.2026
|
|
86
99
|
===================
|
|
87
100
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkNumberLength.test.js","names":["_mocha","require","_chai","_metadata","_interopRequireWildcard","_metadataMax","_interopRequireDefault","_metadataMin","_checkNumberLength","e","__esModule","t","WeakMap","r","n","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","describe","it","expect","checkNumberLengthWithCountry","to","equal","undefined","metadataInstance","Metadata","metadata","selectNumberingPlan","checkNumberLengthForType","oldMetadataInstance","oldMetadata","checkNumberLength","number","country","type"],"sources":["../../source/helpers/checkNumberLength.test.js"],"sourcesContent":["import { describe, it } from 'mocha'\r\nimport { expect } from 'chai'\r\n\r\nimport Metadata, { getCountryCallingCode } from '../metadata.js'\r\nimport metadata from '../../metadata.max.json' with { type: 'json' }\r\nimport oldMetadata from '../../test/metadata/1.0.0/metadata.min.json' with { type: 'json' }\r\n\r\nimport checkNumberLength, { checkNumberLengthForType } from './checkNumberLength.js'\r\n\r\ndescribe('checkNumberLength', () => {\r\n\tit('should check phone number length (`country` is pre-selected in metadata instance)', () => {\r\n\t\t// Too short.\r\n\t\texpect(checkNumberLengthWithCountry('800555353', 'RU', 'FIXED_LINE')).to.equal('TOO_SHORT')\r\n\t\t// Normal.\r\n\t\texpect(checkNumberLengthWithCountry('8005553535', 'RU', 'FIXED_LINE')).to.equal('IS_POSSIBLE')\r\n\t\t// Too long.\r\n\t\texpect(checkNumberLengthWithCountry('80055535355', 'RU', 'FIXED_LINE')).to.equal('TOO_LONG')\r\n\r\n\t\t// No such type.\r\n\t\texpect(checkNumberLengthWithCountry('169454850', 'AC', 'VOIP')).to.equal('INVALID_LENGTH')\r\n\t\t// No such possible length.\r\n\t\texpect(checkNumberLengthWithCountry('1694548', 'AD', undefined)).to.equal('INVALID_LENGTH')\r\n\r\n\t\t// FIXED_LINE_OR_MOBILE\r\n\t\texpect(checkNumberLengthWithCountry('1694548', 'AD', 'FIXED_LINE_OR_MOBILE')).to.equal('INVALID_LENGTH')\r\n\t\t// No mobile phones.\r\n\t\texpect(checkNumberLengthWithCountry('8123', 'TA', 'FIXED_LINE_OR_MOBILE')).to.equal('IS_POSSIBLE')\r\n\t\t// No \"possible lengths\" for \"mobile\".\r\n\t\texpect(checkNumberLengthWithCountry('81234567', 'SZ', 'FIXED_LINE_OR_MOBILE')).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should check phone number length (`country` override)', () => {\r\n\t\tconst metadataInstance = new Metadata(metadata)\r\n\t\tmetadataInstance.selectNumberingPlan('US')\r\n\t\t// \"UAN\" phone number type doesn't exist in \"US\".\r\n\t\t// Hence, it returns \"INVALID_LENGTH\".\r\n\t\texpect(checkNumberLengthForType('2133734253', 'UAN', undefined, metadataInstance)).to.equal('INVALID_LENGTH')\r\n\t\texpect(checkNumberLengthForType('2133734253', 'UAN', 'CA', metadataInstance)).to.equal('TOO_LONG')\r\n\t\t// \"UAN\" phone number type doesn't exist in \"US\".\r\n\t\t// Hence, it returns \"INVALID_LENGTH\".\r\n\t\texpect(checkNumberLengthForType('2133734', 'UAN', undefined, metadataInstance)).to.equal('INVALID_LENGTH')\r\n\t\texpect(checkNumberLengthForType('2133734', 'UAN', 'CA', metadataInstance)).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should work for old metadata (`country` specified)', function() {\r\n\t\tconst oldMetadataInstance = new Metadata(oldMetadata)\r\n\t\toldMetadataInstance.selectNumberingPlan('KZ')\r\n\t\texpect(checkNumberLengthForType('8005553535', 'FIXED_LINE', 'RU', oldMetadataInstance)).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should work for old metadata (no `country` specified)', function() {\r\n\t\tconst oldMetadataInstance = new Metadata(oldMetadata)\r\n\t\toldMetadataInstance.selectNumberingPlan('RU')\r\n\t\texpect(checkNumberLengthForType('8005553535', 'FIXED_LINE', undefined, oldMetadataInstance)).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should handle the cases when multiple countries share the same country calling code and a phone number is possible in non-\"main\" country and is not possible in the \"main\" country', () => {\r\n\t\tconst metadataInstance = new Metadata(metadata)\r\n\t\tmetadataInstance.selectNumberingPlan('1')\r\n\t\texpect(checkNumberLength('3100000', undefined, metadataInstance)).to.equal('TOO_SHORT');\r\n\t\texpect(checkNumberLength('3100000', 'US', metadataInstance)).to.equal('TOO_SHORT');\r\n\t\texpect(checkNumberLength('3100000', 'CA', metadataInstance)).to.equal('IS_POSSIBLE');\r\n\t})\r\n})\r\n\r\nfunction checkNumberLengthWithCountry(number, country, type) {\r\n\tconst metadataInstance = new Metadata(metadata)\r\n\tmetadataInstance.selectNumberingPlan(country)\r\n\treturn checkNumberLengthForType(number, type, undefined, metadataInstance)\r\n}"],"mappings":";;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,YAAA,GAAAD,sBAAA,CAAAL,OAAA;AAEA,IAAAO,kBAAA,GAAAJ,uBAAA,CAAAH,OAAA;AAAoF,SAAAK,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAA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,gBAAgB,CAAC;IAC1F;IACA,IAAAH,YAAM,EAACC,4BAA4B,CAAC,SAAS,EAAE,IAAI,EAAEG,SAAS,CAAC,CAAC,CAACF,EAAE,CAACC,KAAK,CAAC,gBAAgB,CAAC;;IAE3F;IACA,IAAAH,YAAM,EAACC,4BAA4B,CAAC,SAAS,EAAE,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,gBAAgB,CAAC;IACxG;IACA,IAAAH,YAAM,EAACC,4BAA4B,CAAC,MAAM,EAAE,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,aAAa,CAAC;IAClG;IACA,IAAAH,YAAM,EAACC,4BAA4B,CAAC,UAAU,EAAE,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,aAAa,CAAC;EACvG,CAAC,CAAC;EAEF,IAAAJ,SAAE,EAAC,uDAAuD,EAAE,YAAM;IACjE,IAAMM,gBAAgB,GAAG,IAAIC,oBAAQ,CAACC,uBAAQ,CAAC;IAC/CF,gBAAgB,CAACG,mBAAmB,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"checkNumberLength.test.js","names":["_mocha","require","_chai","_metadata","_interopRequireWildcard","_metadataMax","_interopRequireDefault","_metadataMin","_checkNumberLength","e","__esModule","t","WeakMap","r","n","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","describe","it","expect","checkNumberLengthWithCountry","to","equal","undefined","metadataInstance","Metadata","metadata","selectNumberingPlan","checkNumberLengthForType","oldMetadataInstance","oldMetadata","checkNumberLength","number","country","type"],"sources":["../../source/helpers/checkNumberLength.test.js"],"sourcesContent":["import { describe, it } from 'mocha'\r\nimport { expect } from 'chai'\r\n\r\nimport Metadata, { getCountryCallingCode } from '../metadata.js'\r\nimport metadata from '../../metadata.max.json' with { type: 'json' }\r\nimport oldMetadata from '../../test/metadata/1.0.0/metadata.min.json' with { type: 'json' }\r\n\r\nimport checkNumberLength, { checkNumberLengthForType } from './checkNumberLength.js'\r\n\r\ndescribe('checkNumberLength', () => {\r\n\tit('should check phone number length (`country` is pre-selected in metadata instance)', () => {\r\n\t\t// Too short.\r\n\t\texpect(checkNumberLengthWithCountry('800555353', 'RU', 'FIXED_LINE')).to.equal('TOO_SHORT')\r\n\t\t// Normal.\r\n\t\texpect(checkNumberLengthWithCountry('8005553535', 'RU', 'FIXED_LINE')).to.equal('IS_POSSIBLE')\r\n\t\t// Too long.\r\n\t\texpect(checkNumberLengthWithCountry('80055535355', 'RU', 'FIXED_LINE')).to.equal('TOO_LONG')\r\n\r\n\t\t// No such type.\r\n\t\texpect(checkNumberLengthWithCountry('169454850', 'AC', 'VOIP')).to.equal('INVALID_LENGTH')\r\n\t\t// No such possible length.\r\n\t\texpect(checkNumberLengthWithCountry('1694548', 'AD', undefined)).to.equal('INVALID_LENGTH')\r\n\r\n\t\t// FIXED_LINE_OR_MOBILE\r\n\t\texpect(checkNumberLengthWithCountry('1694548', 'AD', 'FIXED_LINE_OR_MOBILE')).to.equal('INVALID_LENGTH')\r\n\t\t// No mobile phones.\r\n\t\texpect(checkNumberLengthWithCountry('8123', 'TA', 'FIXED_LINE_OR_MOBILE')).to.equal('IS_POSSIBLE')\r\n\t\t// No \"possible lengths\" for \"mobile\".\r\n\t\texpect(checkNumberLengthWithCountry('81234567', 'SZ', 'FIXED_LINE_OR_MOBILE')).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should check phone number length (`country` override)', () => {\r\n\t\tconst metadataInstance = new Metadata(metadata)\r\n\t\tmetadataInstance.selectNumberingPlan('US')\r\n\r\n\t\t// The country code \"US\" will be overridden with \"CA\".\r\n\t\t//\r\n\t\t// How to find a suitable override for tests:\r\n\t\t//\r\n\t\t// for (const callingCode of Object.keys(metadata.country_calling_codes)) {\r\n\t\t// \tconst countries = metadata.country_calling_codes[callingCode]\r\n\t\t// \tif (countries.length > 1) {\r\n\t\t// \t\tconst mainCountry = countries.shift()\r\n\t\t// \t\tfor (const country of countries) {\r\n\t\t// \t\t\tif (JSON.stringify(metadata.countries[country].possible_lengths) !== JSON.stringify(metadata.countries[mainCountry].possible_lengths)) {\r\n\t\t// \t\t\t\tconsole.log(country, 'has different possible lengths from the default country', mainCountry)\r\n\t\t// \t\t\t}\r\n\t\t// \t\t}\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\t// \"UAN\" phone number type doesn't exist in \"US\".\r\n\t\t// Hence, it returns \"INVALID_LENGTH\".\r\n\t\texpect(checkNumberLengthForType('2133734253', 'UAN', undefined, metadataInstance)).to.equal('INVALID_LENGTH')\r\n\t\texpect(checkNumberLengthForType('2133734253', 'UAN', 'CA', metadataInstance)).to.equal('TOO_LONG')\r\n\t\t// \"UAN\" phone number type doesn't exist in \"US\".\r\n\t\t// Hence, it returns \"INVALID_LENGTH\".\r\n\t\texpect(checkNumberLengthForType('2133734', 'UAN', undefined, metadataInstance)).to.equal('INVALID_LENGTH')\r\n\t\texpect(checkNumberLengthForType('2133734', 'UAN', 'CA', metadataInstance)).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should work for old metadata (`country` specified)', function() {\r\n\t\tconst oldMetadataInstance = new Metadata(oldMetadata)\r\n\t\toldMetadataInstance.selectNumberingPlan('KZ')\r\n\t\texpect(checkNumberLengthForType('8005553535', 'FIXED_LINE', 'RU', oldMetadataInstance)).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should work for old metadata (no `country` specified)', function() {\r\n\t\tconst oldMetadataInstance = new Metadata(oldMetadata)\r\n\t\toldMetadataInstance.selectNumberingPlan('RU')\r\n\t\texpect(checkNumberLengthForType('8005553535', 'FIXED_LINE', undefined, oldMetadataInstance)).to.equal('IS_POSSIBLE')\r\n\t})\r\n\r\n\tit('should handle the cases when multiple countries share the same country calling code and a phone number is possible in non-\"main\" country and is not possible in the \"main\" country', () => {\r\n\t\tconst metadataInstance = new Metadata(metadata)\r\n\t\tmetadataInstance.selectNumberingPlan('1')\r\n\t\texpect(checkNumberLength('3100000', undefined, metadataInstance)).to.equal('TOO_SHORT');\r\n\t\texpect(checkNumberLength('3100000', 'US', metadataInstance)).to.equal('TOO_SHORT');\r\n\t\texpect(checkNumberLength('3100000', 'CA', metadataInstance)).to.equal('IS_POSSIBLE');\r\n\t})\r\n})\r\n\r\nfunction checkNumberLengthWithCountry(number, country, type) {\r\n\tconst metadataInstance = new Metadata(metadata)\r\n\tmetadataInstance.selectNumberingPlan(country)\r\n\treturn checkNumberLengthForType(number, type, undefined, metadataInstance)\r\n}"],"mappings":";;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,YAAA,GAAAD,sBAAA,CAAAL,OAAA;AAEA,IAAAO,kBAAA,GAAAJ,uBAAA,CAAAH,OAAA;AAAoF,SAAAK,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,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