@gisatcz/ptr-be-core 0.0.1-dev.6 → 0.0.1-dev.8
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/dist/globals/arrows/models.arrows.d.ts +2 -2
- package/dist/globals/coding/code.dates.d.ts +36 -0
- package/dist/globals/coding/formats.csv.d.ts +14 -0
- package/dist/globals/panther/enums.panther.d.ts +13 -1
- package/dist/globals/panther/models.edges.d.ts +2 -2
- package/dist/globals/panther/models.edges.properties.d.ts +1 -1
- package/dist/globals/panther/models.nodes.d.ts +24 -17
- package/dist/globals/panther/models.nodes.properties.datasources.d.ts +50 -0
- package/dist/globals/panther/models.nodes.properties.general.d.ts +35 -0
- package/dist/globals/panther/utils.panther.d.ts +77 -0
- package/dist/index.browser.d.ts +8 -4
- package/dist/index.browser.js +208 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +751 -22
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +4 -0
- package/dist/index.node.js +733 -23
- package/dist/index.node.js.map +1 -1
- package/dist/node/api/parse.arrows.json.d.ts +13 -0
- package/dist/node/api/parse.changeNodes.d.ts +13 -0
- package/dist/node/api/parse.changesEdges.d.ts +8 -0
- package/dist/node/api/validations.shared.d.ts +28 -0
- package/package.json +13 -5
- package/dist/globals/panther/models.nodes.properties.d.ts +0 -67
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.js","sources":["../src/globals/coding/code.formating.ts","../src/globals/panther/enums.panther.ts"],"sourcesContent":["/**\n * Check if the value in included in enum posibilities.\n * @param value Value we need to check\n * @param enumEntity Enum type we check againts the value\n * @returns Is the value in this enum?\n */\nexport const isInEnum = (value: any, enumEntity: any) => {\n const allEnumValues = Object.values(enumEntity) as string[]\n return allEnumValues.includes(value)\n }\n\n/**\n * Sort array of string elements\n * @param rawArray Raw unsorted array of elements\n * @returns Sorted string array\n */\nexport const sortStringArray = (rawArray: string[]) => rawArray.sort()\n\n/**\n * Remove all duplicity string items from an array\n * @param arr Original array with duplicities\n * @returns Array of original values\n */\nexport const removeDuplicitiesFromArray = (arr: any[]) => [...new Set(arr)]\n\n\n/**\n * Check if the string value is not ` \"\" `\n * @param value Value to check\n * @returns Boolean result about the truth\n */\nexport const notEmptyString = (value: string) => value !== \"\"\n\n\n/**\n * Return enum values as array of string\n * @param enumType Type of the enum from code\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumValuesToString = (enumType: any, separator = \", \") => Object.values(enumType).join(separator)\n\n/**\n * Return enum values as array of string\n * @param enumTypes Combination of enum types\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumCombineValuesToString = (enumTypes: any[], separator = \", \") => enumTypes.map(enumType => enumValuesToString(enumType, separator)).join(separator)\n\n/**\n * Return all enum values as array\n * @param enumType What array we want to work with\n * @returns Array of enum values\n */\nexport const enumValuesToArray = (enumType: any) => Object.values(enumType) as string[]\n\n/**\n * Return random number (integer) between two values\n * @param min \n * @param max \n * @returns \n */\nexport const randomNumberBetween = (min: number, max: number) => {\n const minAr = Math.ceil(min)\n const maxAr = Math.floor(max)\n return Math.floor(Math.random()*(maxAr - minAr + 1) + min)\n}\n\n/**\n * Recursively flattens a nested object. The keys of the resulting object\n * will be the paths to the original values in the nested object, joined by dots.\n *\n * @param obj - The object to flatten.\n * @param prefix - The prefix to use for the keys in the flattened object. Defaults to an empty string.\n * @returns A new object with flattened keys.\n *\n * @example\n * ```typescript\n * const nestedObj = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: 2\n * };\n * const flatObj = flattenObject(nestedObj);\n * console.log(flatObj);\n * // Output: { 'a.b.c': 1, 'a.b.d': 2 }\n * ```\n */\nexport const flattenObject = (obj: any, prefix = ''): Record<string, any> => {\n return Object.keys(obj).reduce((acc: Record<string, any>, key: string) => {\n const propName = prefix ? `${prefix}.${key}` : key\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n Object.assign(acc, flattenObject(obj[key], propName))\n } else {\n acc[propName] = obj[key]\n }\n return acc\n }, {})\n}","/**\n * What types of graph nodes we use in metadata model\n */\nexport enum UsedNodeLabels {\n Application = \"application\", // Application node (the root of the FE app)\n Datasource = \"datasource\", // Datasource node for data including GIS information\n Place = \"place\", // Place node for geographical information\n Period = \"period\", // Period node for time information\n AreaTree = \"areaTree\", // Area tree node for administrative division\n AreaTreeLevel = \"areaTreeLevel\", // Area tree level node for administrative division\n Layer = \"layer\", // Layer node for map layer (layer have a style and a datasource)\n Style = \"style\", // Style node for map layer or a feature\n Feature = \"feature\", // Feature node for map layer,\n Attribute = \"attribute\" // Attribute node for properties of entities, like \"temperature\", \"population\", etc.\n}\n\n/**\n * What datasources we use in the system\n */\nexport enum UsedDatasourceLabels {\n Attribute = \"attributeSource\", // Column(s) with attribute values\n Geojson = \"geojson\", // Geojson for web map\n WMS = \"wms\", // WMS online source\n COG = \"cloudOptimizedGeotiff\", // COG online source\n MVT = \"mvt\", // MVT (Mapbox Vector Tiles) source\n XYZ = \"xyz\", // XYZ tile source\n CSV = \"csv\", // CSV data source\n GeoTIFF = \"geotiff\", // GeoTIFF raster data\n Shapefile = \"shapefile\", // ESRI Shapefile format\n PostGIS = \"postgis\", // PostGIS database source\n WMTS = \"wmts\", // Web Map Tile Service\n WFS = \"wfs\", // Web Feature Service\n GeoPackage = \"geopackage\" // OGC GeoPackage format\n}\n\n/**\n * What types of edges we use in metadata model\n */\nexport enum UsedEdgeLabels {\n RelatedTo = \"RELATED\", // Generic edge for any relation\n Has = \"HAS\", // Edge for ownership relation\n InPostgisLocation = \"IN_POSTGIS_LOCATION\" // Edge to connect datasource with PostGIS location (schema, table, geometry column)\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKG;MACU,QAAQ,GAAG,CAAC,KAAU,EAAE,UAAe,KAAI;IACpD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAa;AAC3D,IAAA,OAAO,aAAa,CAAC,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GAAA,iBAA6B;AAC7B,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,oBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,oBAAA,CAAA,KAAA,CAAA,GAAA,uBAA6B;AAC7B,IAAA,oBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,oBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,oBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,oBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;IACX,oBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB,CAAA;AAC7B,CAAC,EAdW,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;AAgBhC;;AAEG;IACS;AAAZ,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,WAAA,CAAA,GAAA,SAAqB;AACrB,IAAA,cAAA,CAAA,KAAA,CAAA,GAAA,KAAW;IACX,cAAA,CAAA,mBAAA,CAAA,GAAA,qBAAyC,CAAA;AAC7C,CAAC,EAJW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.browser.js","sources":["../src/globals/coding/code.formating.ts","../src/node/api/errors.api.ts","../src/globals/coding/code.dates.ts","../src/globals/coding/formats.csv.ts","../src/globals/panther/utils.panther.ts","../src/globals/panther/enums.panther.ts"],"sourcesContent":["/**\n * Check if the value in included in enum posibilities.\n * @param value Value we need to check\n * @param enumEntity Enum type we check againts the value\n * @returns Is the value in this enum?\n */\nexport const isInEnum = (value: any, enumEntity: any) => {\n const allEnumValues = Object.values(enumEntity) as string[]\n return allEnumValues.includes(value)\n }\n\n/**\n * Sort array of string elements\n * @param rawArray Raw unsorted array of elements\n * @returns Sorted string array\n */\nexport const sortStringArray = (rawArray: string[]) => rawArray.sort()\n\n/**\n * Remove all duplicity string items from an array\n * @param arr Original array with duplicities\n * @returns Array of original values\n */\nexport const removeDuplicitiesFromArray = (arr: any[]) => [...new Set(arr)]\n\n\n/**\n * Check if the string value is not ` \"\" `\n * @param value Value to check\n * @returns Boolean result about the truth\n */\nexport const notEmptyString = (value: string) => value !== \"\"\n\n\n/**\n * Return enum values as array of string\n * @param enumType Type of the enum from code\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumValuesToString = (enumType: any, separator = \", \") => Object.values(enumType).join(separator)\n\n/**\n * Return enum values as array of string\n * @param enumTypes Combination of enum types\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumCombineValuesToString = (enumTypes: any[], separator = \", \") => enumTypes.map(enumType => enumValuesToString(enumType, separator)).join(separator)\n\n/**\n * Return all enum values as array\n * @param enumType What array we want to work with\n * @returns Array of enum values\n */\nexport const enumValuesToArray = (enumType: any) => Object.values(enumType) as string[]\n\n/**\n * Return random number (integer) between two values\n * @param min \n * @param max \n * @returns \n */\nexport const randomNumberBetween = (min: number, max: number) => {\n const minAr = Math.ceil(min)\n const maxAr = Math.floor(max)\n return Math.floor(Math.random()*(maxAr - minAr + 1) + min)\n}\n\n/**\n * Recursively flattens a nested object. The keys of the resulting object\n * will be the paths to the original values in the nested object, joined by dots.\n *\n * @param obj - The object to flatten.\n * @param prefix - The prefix to use for the keys in the flattened object. Defaults to an empty string.\n * @returns A new object with flattened keys.\n *\n * @example\n * ```typescript\n * const nestedObj = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: 2\n * };\n * const flatObj = flattenObject(nestedObj);\n * console.log(flatObj);\n * // Output: { 'a.b.c': 1, 'a.b.d': 2 }\n * ```\n */\nexport const flattenObject = (obj: any, prefix = ''): Record<string, any> => {\n return Object.keys(obj).reduce((acc: Record<string, any>, key: string) => {\n const propName = prefix ? `${prefix}.${key}` : key\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n Object.assign(acc, flattenObject(obj[key], propName))\n } else {\n acc[propName] = obj[key]\n }\n return acc\n }, {})\n}","/**\n * Extract message from exception error (try-catch)\n * @param error error from catch block as any\n * @returns \n */\n export const messageFromError = (error: any) => error[\"message\"] as string\n\n/**\n * We miss a API parameter needed to process action\n */\nexport class InvalidRequestError extends Error{\n constructor(message: string){\n super(`Invalid Request: ${message}`)\n }\n}\n\n/**\n * Where client has general authorization issue\n */\nexport class AuthorizationError extends Error{\n constructor(){\n super(`Authorization has failed.`)\n }\n}","import { DateTime } from \"luxon\"\nimport { InvalidRequestError } from \"../../node/api/errors.api\"\n\n/**\n * Return epoch timestamp\n * @param regime Set if you want milisecond format or second format\n * @returns \n */\nexport const nowTimestamp = (regime: \"milisecond\" | \"second\" = \"milisecond\"): number => {\n const timestamp = DateTime.now().toMillis()\n return regime === \"second\" ? Math.round((timestamp / 1000)) : timestamp\n}\n\n/**\n * Convert epoch time value into ISO format\n * @param epochValue Epoch value of the timestamp\n * @returns ISO format of the date\n */\nexport const epochToIsoFormat = (epochValue: number) => DateTime.fromMillis(epochValue).toISO() as string\n\n/**\n * Return epoch timestamp\n * @param regime Set if you want milisecond format or second format\n * @returns \n */\nexport const nowTimestampIso = () => {\n const timestamp = DateTime.now().toISO()\n return timestamp as string\n}\n\n/**\n * Check if input date is valid for ISO format\n * @param dateToCheck \n * @returns \n */\n export const hasIsoFormat = (dateToCheck: string) => {\n try{\n const toDate = new Date(Date.parse(dateToCheck))\n const isoCheck = toDate.toISOString().includes(dateToCheck) \n return isoCheck\n }\n catch{\n return false\n }\n}\n\n/**\n * Convert date in ISO formtat to milisecond timestamp\n * @param isoDate Date in ISO 8601 format\n * @returns Timestamp representing the date in miliseconds\n */\nexport const isoDateToTimestamp = (isoDate: string) => DateTime.fromISO(isoDate).toMillis()\n\n/**\n * Format ISO 8601 interval to from-to values\n * @param interval Defined inteval in ISO format (from/to) of the UTC\n * @returns Tuple - from timestamp and to timestamp\n */\nexport const isoIntervalToTimestamps = (interval: string): [number, number] => {\n\n // Split the interval into two parts\n const intervals = interval.split(\"/\")\n\n // interval as a single year has just one part\n if (intervals.length == 1) {\n const newIso = `${interval}-01-01/${interval}-12-31`\n return isoIntervalToTimestamps(newIso)\n }\n\n // interval with two parts or less than one\n else if (intervals.length > 2 || intervals.length < 1)\n throw new InvalidRequestError(\"Interval can have only two parameters\")\n\n // valid interval with two parts\n else {\n if (!intervals.every(interval => hasIsoFormat(interval)))\n throw new InvalidRequestError(\"Parameter utcIntervalIso is not ISO 8601 time interval (date01/date02) or year\");\n\n const [int1, int2] = intervals.map(intervalIso => {\n const cleared = intervalIso.replace(\" \", \"\")\n return isoDateToTimestamp(cleared)\n })\n\n return [int1, int2]\n }\n}\n","// TODO: Cover by tests\n// TODO: mode to ptr-be-core as general CSV methods\n\n\n/**\n * Parses a single line of CSV-formatted strings into an array of trimmed string values.\n *\n * @param csvStingsLine - A string representing a single line of comma-separated values.\n * @returns An array of strings, each representing a trimmed value from the CSV line.\n */\nexport const csvParseStrings = (csvStingsLine: string): string[] => {\n return csvStingsLine.split(\",\").map((value: string) => value.trim());\n}\n\n/**\n * Parses a comma-separated string of numbers into an array of numbers.\n *\n * @param csvNumbersLine - A string containing numbers separated by commas (e.g., \"1, 2, 3.5\").\n * @returns An array of numbers parsed from the input string.\n */\nexport const csvParseNumbers = (csvNumbersLine: string): number[] => {\n return csvNumbersLine.split(\",\").map((value: string) => parseFloat(value.trim()));\n}","import { UsedDatasourceLabels, UsedEdgeLabels, UsedNodeLabels } from \"./enums.panther\"\nimport { GraphEdge } from \"./models.edges\"\nimport { FullPantherEntity } from \"./models.nodes\"\n\n/**\n * Finds the first node in the provided list that contains the specified label.\n *\n * Searches the given array of FullPantherEntity objects and returns the first entity\n * whose `labels` array includes the provided label.\n *\n * @param nodes - Array of FullPantherEntity objects to search through.\n * @param label - Label to match; may be a UsedDatasourceLabels or UsedNodeLabels.\n * @returns The first FullPantherEntity whose `labels` includes `label`, or `undefined`\n * if no such entity is found.\n *\n * @remarks\n * - The search stops at the first match (uses `Array.prototype.find`).\n * - Label comparison is exact (uses `Array.prototype.includes`), so it is case-sensitive\n * and requires the same string instance/value.\n *\n * @example\n * const result = findNodeByLabel(nodes, 'datasource-main');\n * if (result) {\n * // found a node that has the 'datasource-main' label\n * }\n */\nexport const findNodeByLabel = (\n nodes: FullPantherEntity[],\n label: UsedDatasourceLabels | UsedNodeLabels): FullPantherEntity | undefined => {\n return nodes.find(n => n.labels.includes(label))\n}\n\n/**\n * Filters an array of FullPantherEntity objects, returning only those that contain the specified label.\n *\n * The function performs a shallow, non-mutating filter: it returns a new array and does not modify the input.\n * Matching is done using Array.prototype.includes on each entity's `labels` array (strict equality).\n *\n * @param nodes - The array of entities to filter.\n * @param label - The label to match; can be a UsedDatasourceLabels or UsedNodeLabels value.\n * @returns A new array containing only the entities whose `labels` array includes the provided label.\n *\n * @remarks\n * Time complexity is O(n * m) where n is the number of entities and m is the average number of labels per entity.\n *\n * @example\n * ```ts\n * const matched = filterNodeByLabel(entities, 'MY_LABEL');\n * ```\n */\nexport const filterNodeByLabel = (\n nodes: FullPantherEntity[],\n label: UsedDatasourceLabels | UsedNodeLabels): FullPantherEntity[] => {\n return nodes.filter(n => n.labels.includes(label))\n}\n\n/**\n * Finds the first edge in the provided array whose label strictly equals the given label.\n *\n * @param edges - Array of GraphEdge objects to search.\n * @param label - The UsedEdgeLabels value to match against each edge's `label` property.\n * @returns The first matching GraphEdge if found; otherwise `undefined`.\n *\n * @example\n * const edge = findEdgeByLabel(edges, 'dependency');\n * if (edge) {\n * // handle found edge\n * }\n */\nexport const findEdgeByLabel = (\n edges: GraphEdge[],\n label: UsedEdgeLabels): GraphEdge | undefined => {\n return edges.find(e => e.label === label)\n}\n\n/**\n * Filters a list of GraphEdge objects by a specific edge label.\n *\n * Returns a new array containing only those edges whose `label` property\n * strictly equals the provided `label` argument. The original `edges`\n * array is not mutated.\n *\n * @param edges - Array of GraphEdge objects to filter.\n * @param label - The label to match; comparison is performed using strict (`===`) equality.\n * @returns A new array of GraphEdge objects whose `label` matches the provided label. Returns an empty array if no edges match.\n *\n * @remarks\n * Time complexity: O(n), where n is the number of edges.\n *\n * @example\n * // const result = filterEdgeByLabel(edges, 'CONNECTS');\n */\nexport const filterEdgeByLabel = (\n edges: GraphEdge[],\n label: UsedEdgeLabels): GraphEdge[] => {\n return edges.filter(e => e.label === label)\n}","/**\n * What types of graph nodes we use in metadata model\n */\nexport enum UsedNodeLabels {\n Application = \"application\", // Application node (the root of the FE app)\n Datasource = \"datasource\", // Datasource node for data including GIS information\n Place = \"place\", // Place node for geographical information\n Period = \"period\", // Period node for time information\n AreaTree = \"areaTree\", // Area tree node for administrative division\n AreaTreeLevel = \"areaTreeLevel\", // Area tree level node for administrative division\n Layer = \"layer\", // Layer node for map layer (layer have a style and a datasource)\n Style = \"style\", // Style node for map layer or a feature\n Feature = \"feature\", // Feature node for map layer,\n Attribute = \"attribute\" // Attribute node for properties of entities, like \"temperature\", \"population\", etc.\n}\n\n/**\n * What datasources we use in the system\n */\nexport enum UsedDatasourceLabels {\n Attribute = \"attributeSource\", // Column(s) with attribute values\n Geojson = \"geojson\", // Geojson for web map\n WMS = \"wms\", // WMS online source\n COG = \"cloudOptimizedGeotiff\", // COG online source\n MVT = \"mvt\", // MVT (Mapbox Vector Tiles) source\n XYZ = \"xyz\", // XYZ tile source\n CSV = \"csv\", // CSV data source\n GeoTIFF = \"geotiff\", // GeoTIFF raster data\n Shapefile = \"shapefile\", // ESRI Shapefile format\n PostGIS = \"postgis\", // PostGIS database source\n WMTS = \"wmts\", // Web Map Tile Service\n WFS = \"wfs\", // Web Feature Service\n GeoPackage = \"geopackage\", // OGC GeoPackage format\n MapStyle = \"mapStyle\", // Map style datasource\n Timeseries = \"timeseries\" // Timeseries datasource (with from-to and step)\n}\n\n/**\n * What types of edges we use in metadata model\n */\nexport enum UsedEdgeLabels {\n RelatedTo = \"RELATED\", // Generic edge for any relation\n Has = \"HAS\", // Edge for ownership relation\n InPostgisLocation = \"IN_POSTGIS_LOCATION\" // Edge to connect datasource with PostGIS location (schema, table, geometry column)\n}\n\n/**\n * What time steps are used in timeseries data\n */\nexport enum UsedTimeseriesSteps{\n Year = \"year\",\n Quarter = \"quarter\",\n Month = \"month\",\n Week = \"week\",\n Day = \"day\"\n}"],"names":[],"mappings":";;AAAA;;;;;AAKG;MACU,QAAQ,GAAG,CAAC,KAAU,EAAE,UAAe,KAAI;IACpD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAa;AAC3D,IAAA,OAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC;AACtC;AAEF;;;;AAIG;AACI,MAAM,eAAe,GAAG,CAAC,QAAkB,KAAK,QAAQ,CAAC,IAAI;AAEpE;;;;AAIG;AACI,MAAM,0BAA0B,GAAG,CAAC,GAAU,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC;AAG1E;;;;AAIG;AACI,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,KAAK,KAAK;AAG3D;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,QAAa,EAAE,SAAS,GAAG,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS;AAE7G;;;;;AAKG;AACI,MAAM,yBAAyB,GAAG,CAAC,SAAgB,EAAE,SAAS,GAAG,IAAI,KAAK,SAAS,CAAC,GAAG,CAAC,QAAQ,IAAI,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;AAElK;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,QAAa,KAAK,MAAM,CAAC,MAAM,CAAC,QAAQ;AAE1E;;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