@payloadcms/richtext-lexical 3.59.0-internal.d8b427e → 3.59.0-internal.ee5f42c

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.
Files changed (120) hide show
  1. package/dist/exports/client/{Field-2MCIQXRP.js → Field-EHRBYNHO.js} +2 -2
  2. package/dist/exports/client/bundled.css +1 -1
  3. package/dist/exports/client/{chunk-TLQLXR6Q.js → chunk-2Y72RT72.js} +2 -2
  4. package/dist/exports/client/chunk-3BY5IZJD.js +2 -0
  5. package/dist/exports/client/chunk-3BY5IZJD.js.map +7 -0
  6. package/dist/exports/client/componentInline-7TPI7ZBC.js +2 -0
  7. package/dist/exports/client/index.d.ts +0 -3
  8. package/dist/exports/client/index.d.ts.map +1 -1
  9. package/dist/exports/client/index.js +10 -35
  10. package/dist/exports/client/index.js.map +4 -4
  11. package/dist/features/blocks/client/component/BlockContent.d.ts +27 -52
  12. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  13. package/dist/features/blocks/client/component/BlockContent.js +51 -45
  14. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  15. package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts +9 -2
  16. package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts.map +1 -1
  17. package/dist/features/blocks/client/component/components/BlockCollapsible.js +25 -7
  18. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  19. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  20. package/dist/features/blocks/client/component/index.js +50 -62
  21. package/dist/features/blocks/client/component/index.js.map +1 -1
  22. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  23. package/dist/features/blocks/client/componentInline/index.js +1 -0
  24. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  25. package/dist/features/blocks/client/index.d.ts.map +1 -1
  26. package/dist/features/blocks/client/index.js +0 -5
  27. package/dist/features/blocks/client/index.js.map +1 -1
  28. package/dist/features/blocks/client/markdownTransformer.d.ts +17 -0
  29. package/dist/features/blocks/client/markdownTransformer.d.ts.map +1 -0
  30. package/dist/features/blocks/client/markdownTransformer.js +144 -0
  31. package/dist/features/blocks/client/markdownTransformer.js.map +1 -0
  32. package/dist/features/blocks/server/i18n.js +38 -38
  33. package/dist/features/blocks/server/i18n.js.map +1 -1
  34. package/dist/features/blocks/server/index.js +1 -1
  35. package/dist/features/blocks/server/index.js.map +1 -1
  36. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts.map +1 -0
  37. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -0
  38. package/dist/features/blocks/server/markdownTransformer.d.ts +22 -0
  39. package/dist/features/blocks/server/markdownTransformer.d.ts.map +1 -0
  40. package/dist/features/blocks/server/{markdown/markdownTransformer.js → markdownTransformer.js} +48 -6
  41. package/dist/features/blocks/server/markdownTransformer.js.map +1 -0
  42. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  43. package/dist/field/RenderLexical/index.js +1 -0
  44. package/dist/field/RenderLexical/index.js.map +1 -1
  45. package/dist/field/bundled.css +1 -1
  46. package/dist/index.d.ts +0 -1
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +0 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
  51. package/dist/lexical/ui/icons/CodeBlock/index.js +15 -10
  52. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  53. package/dist/utilities/jsx/collectTopLevelJSXInLines.js +2 -2
  54. package/dist/utilities/jsx/collectTopLevelJSXInLines.js.map +1 -1
  55. package/package.json +6 -6
  56. package/dist/exports/client/chunk-K47TNP5J.js +0 -2
  57. package/dist/exports/client/chunk-K47TNP5J.js.map +0 -7
  58. package/dist/exports/client/componentInline-AGFSKAY4.js +0 -2
  59. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +0 -6
  60. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +0 -1
  61. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +0 -24
  62. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +0 -1
  63. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +0 -6
  64. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +0 -1
  65. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +0 -20
  66. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +0 -1
  67. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +0 -12
  68. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +0 -1
  69. package/dist/features/blocks/client/markdown/markdownTransformer.js +0 -348
  70. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +0 -1
  71. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +0 -5
  72. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +0 -1
  73. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +0 -151
  74. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +0 -1
  75. package/dist/features/blocks/premade/CodeBlock/Component/Code.d.ts +0 -61
  76. package/dist/features/blocks/premade/CodeBlock/Component/Code.d.ts.map +0 -1
  77. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +0 -89
  78. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +0 -1
  79. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +0 -4
  80. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +0 -1
  81. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +0 -17
  82. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +0 -1
  83. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +0 -4
  84. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +0 -1
  85. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +0 -26
  86. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +0 -1
  87. package/dist/features/blocks/premade/CodeBlock/converter.d.ts +0 -7
  88. package/dist/features/blocks/premade/CodeBlock/converter.d.ts.map +0 -1
  89. package/dist/features/blocks/premade/CodeBlock/converter.js +0 -46
  90. package/dist/features/blocks/premade/CodeBlock/converter.js.map +0 -1
  91. package/dist/features/blocks/premade/CodeBlock/converterClient.d.ts +0 -2
  92. package/dist/features/blocks/premade/CodeBlock/converterClient.d.ts.map +0 -1
  93. package/dist/features/blocks/premade/CodeBlock/converterClient.js +0 -4
  94. package/dist/features/blocks/premade/CodeBlock/converterClient.js.map +0 -1
  95. package/dist/features/blocks/premade/CodeBlock/index.d.ts +0 -7
  96. package/dist/features/blocks/premade/CodeBlock/index.d.ts.map +0 -1
  97. package/dist/features/blocks/premade/CodeBlock/index.js +0 -52
  98. package/dist/features/blocks/premade/CodeBlock/index.js.map +0 -1
  99. package/dist/features/blocks/server/markdown/getLexicalToMarkdown.d.ts +0 -6
  100. package/dist/features/blocks/server/markdown/getLexicalToMarkdown.d.ts.map +0 -1
  101. package/dist/features/blocks/server/markdown/getLexicalToMarkdown.js +0 -27
  102. package/dist/features/blocks/server/markdown/getLexicalToMarkdown.js.map +0 -1
  103. package/dist/features/blocks/server/markdown/getMarkdownToLexical.d.ts +0 -7
  104. package/dist/features/blocks/server/markdown/getMarkdownToLexical.d.ts.map +0 -1
  105. package/dist/features/blocks/server/markdown/getMarkdownToLexical.js +0 -22
  106. package/dist/features/blocks/server/markdown/getMarkdownToLexical.js.map +0 -1
  107. package/dist/features/blocks/server/markdown/linesFromMatchToContentAndPropsString.d.ts.map +0 -1
  108. package/dist/features/blocks/server/markdown/linesFromMatchToContentAndPropsString.js.map +0 -1
  109. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +0 -15
  110. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +0 -1
  111. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +0 -1
  112. package/dist/lexical/ui/icons/Collapse/index.d.ts +0 -3
  113. package/dist/lexical/ui/icons/Collapse/index.d.ts.map +0 -1
  114. package/dist/lexical/ui/icons/Collapse/index.js +0 -18
  115. package/dist/lexical/ui/icons/Collapse/index.js.map +0 -1
  116. /package/dist/exports/client/{Field-2MCIQXRP.js.map → Field-EHRBYNHO.js.map} +0 -0
  117. /package/dist/exports/client/{chunk-TLQLXR6Q.js.map → chunk-2Y72RT72.js.map} +0 -0
  118. /package/dist/exports/client/{componentInline-AGFSKAY4.js.map → componentInline-7TPI7ZBC.js.map} +0 -0
  119. /package/dist/features/blocks/server/{markdown/linesFromMatchToContentAndPropsString.d.ts → linesFromMatchToContentAndPropsString.d.ts} +0 -0
  120. /package/dist/features/blocks/server/{markdown/linesFromMatchToContentAndPropsString.js → linesFromMatchToContentAndPropsString.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","FieldContext","FieldPathContext","ServerFunctionsContext","ShimmerEffect","useServerFunctions","React","useCallback","useEffect","useRef","RenderLexical","args","$","field","initialValue","Loading","path","schemaPath","setValue","value","Component","setComponent","useState","serverFunctionContext","_internal_renderField","entityType","entitySlug","split","fieldPath","name","t0","render","Field","type","admin","hidden","undefined","renderLexical","mounted","t1","t2","current","_jsx","adjustedServerFunctionContext","getFormState","getFormStateArgs","collectionSlug","globalSlug","children","fieldValue","disabled","formInitializing","formProcessing","formSubmitted","_temp","showError"],"sources":["../../../src/field/RenderLexical/index.tsx"],"sourcesContent":["'use client'\nimport type { RichTextField } from 'payload'\n\nimport {\n FieldContext,\n FieldPathContext,\n type FieldType,\n type RenderFieldServerFnArgs,\n ServerFunctionsContext,\n type ServerFunctionsContextType,\n ShimmerEffect,\n useServerFunctions,\n} from '@payloadcms/ui'\nimport React, { useCallback, useEffect, useRef } from 'react'\n\nimport type { DefaultTypedEditorState } from '../../nodeTypes.js'\n\n/**\n * Utility to render a lexical editor on the client.\n *\n * @experimental - may break in minor releases\n * @todo - replace this with a general utility that works for all fields. Maybe merge with packages/ui/src/forms/RenderFields/RenderField.tsx\n */\nexport const RenderLexical: React.FC<\n /**\n * If value or setValue, or both, is provided, this component will manage its own value.\n * If neither is passed, it will rely on the parent form to manage the value.\n */\n {\n /**\n * Override the loading state while the field component is being fetched and rendered.\n */\n Loading?: React.ReactElement\n\n setValue?: FieldType<DefaultTypedEditorState | undefined>['setValue']\n value?: FieldType<DefaultTypedEditorState | undefined>['value']\n } & RenderFieldServerFnArgs\n> = (args) => {\n const { field, initialValue, Loading, path, schemaPath, setValue, value } = args\n const [Component, setComponent] = React.useState<null | React.ReactNode>(null)\n const serverFunctionContext = useServerFunctions()\n const { _internal_renderField } = serverFunctionContext\n\n const [entityType, entitySlug] = schemaPath.split('.')\n\n const fieldPath = path ?? (field && 'name' in field ? field?.name : '') ?? ''\n\n const renderLexical = useCallback(() => {\n async function render() {\n const { Field } = await _internal_renderField({\n field: {\n ...((field as RichTextField) || {}),\n type: 'richText',\n admin: {\n hidden: false,\n },\n },\n initialValue: initialValue ?? undefined,\n path,\n schemaPath,\n })\n\n setComponent(Field)\n }\n void render()\n }, [_internal_renderField, schemaPath, path, field, initialValue])\n\n const mounted = useRef(false)\n\n useEffect(() => {\n if (mounted.current) {\n return\n }\n mounted.current = true\n void renderLexical()\n }, [renderLexical])\n\n if (!Component) {\n return typeof Loading !== 'undefined' ? Loading : <ShimmerEffect />\n }\n\n /**\n * By default, the lexical will make form state requests (e.g. to get drawer fields), passing in the arguments\n * of the current field. However, we need to override those arguments to get it to make requests based on the\n * *target* field. The server only knows the schema map of the target field.\n */\n const adjustedServerFunctionContext: ServerFunctionsContextType = {\n ...serverFunctionContext,\n getFormState: async (getFormStateArgs) => {\n return serverFunctionContext.getFormState({\n ...getFormStateArgs,\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n })\n },\n }\n\n if (typeof value === 'undefined' && !setValue) {\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n {Component}\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n }\n\n const fieldValue: FieldType<DefaultTypedEditorState | undefined> = {\n disabled: false,\n formInitializing: false,\n formProcessing: false,\n formSubmitted: false,\n initialValue: value,\n path: fieldPath,\n setValue: setValue ?? (() => undefined),\n showError: false,\n value,\n }\n\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n <FieldContext value={fieldValue}>{Component}</FieldContext>\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SACEC,YAAY,EACZC,gBAAgB,EAGhBC,sBAAsB,EAEtBC,aAAa,EACbC,kBAAkB,QACb;AACP,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ;AAItD;;;;;;AAMA,OAAO,MAAMC,aAAA,GAcTC,IAAA;EAAA,MAAAC,CAAA,GAAAZ,EAAA;EACF;IAAAa,KAAA;IAAAC,YAAA;IAAAC,OAAA;IAAAC,IAAA;IAAAC,UAAA;IAAAC,QAAA;IAAAC;EAAA,IAA4ER,IAAA;EAC5E,OAAAS,SAAA,EAAAC,YAAA,IAAkCf,KAAA,CAAAgB,QAAA,KAAuC;EACzE,MAAAC,qBAAA,GAA8BlB,kBAAA;EAC9B;IAAAmB;EAAA,IAAkCD,qBAAA;EAElC,OAAAE,UAAA,EAAAC,UAAA,IAAiCT,UAAA,CAAAU,KAAA,CAAiB;EAElD,MAAAC,SAAA,GAAkBZ,IAAA,KAASH,KAAA,IAAS,UAAUA,KAAA,GAAQA,KAAA,EAAAgB,IAAA,GAAc,EAAC,KAAM;EAAA,IAAAC,EAAA;EAAA,IAAAlB,CAAA,QAAAY,qBAAA,IAAAZ,CAAA,QAAAC,KAAA,IAAAD,CAAA,QAAAE,Y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qB,YAAA,QAAAC,gBAAA,IAEftB,qBAAA,CAAAqB,YAAA;MAAA,GACFC,gBAAgB;MAAAC,cAAA,EACHrB,UAAA,KAAe,eAAeC,UAAA,GAAAU,SAAa;MAAAW,UAAA,EAC/CtB,UAAA,KAAe,WAAWC,UAAA,GAAAU;IAAa,CACrD;EAAA;EAEJ,IAEI,OAAOjB,KAAA,KAAU,gBAAgBD,QAAA;IAAA,OAEjCwB,IAAA,CAAAvC,sBAAA;MAAAgB,KAAA;QAAA,GAAoCwB;MAA6B;MAAAK,QAAA,EAC/DN,IAAA,CAAAxC,gBAAA;QAAAiB,KAAA,EAAyCS,SAAA;QAAAoB,QAAA,EACtC5B;MAAA,GADoBQ,SAAA;IAAA,C;;EAO7B,MAAAqB,UAAA;IAAAC,QAAA;IAAAC,gBAAA;IAAAC,cAAA;IAAAC,aAAA;IAAAvC,YAAA,EAKgBK,KAAA;IAAAH,IAAA,EACRY,SAAA;IAAAV,QAAA,EACIA,QAAA,IAAAoC,KAA2B;IAAAC,SAAA;IAAApC;EAAA;EAGvC,OAGEuB,IAAA,CAAAvC,sBAAA;IAAAgB,KAAA;MAAA,GAAoCwB;IAA6B;IAAAK,QAAA,EAC/DN,IAAA,CAAAxC,gBAAA;MAAAiB,KAAA,EAAyCS,SAAA;MAAAoB,QAAA,EACvCN,IAAA,CAAAzC,YAAA;QAAAkB,KAAA,EAAqB8B,UAAA;QAAAD,QAAA,EAAa5B;MAAA,C;OADbQ,SAAA;EAAA,C;CAK7B;AAzFI,SAAA0B,MAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","FieldContext","FieldPathContext","ServerFunctionsContext","ShimmerEffect","useServerFunctions","React","useCallback","useEffect","useRef","RenderLexical","args","$","field","initialValue","Loading","path","schemaPath","setValue","value","Component","setComponent","useState","serverFunctionContext","_internal_renderField","entityType","entitySlug","split","fieldPath","name","t0","render","Field","type","admin","hidden","undefined","renderLexical","mounted","t1","t2","current","_jsx","adjustedServerFunctionContext","getFormState","getFormStateArgs","collectionSlug","globalSlug","children","fieldValue","disabled","formInitializing","formProcessing","formSubmitted","_temp","showError"],"sources":["../../../src/field/RenderLexical/index.tsx"],"sourcesContent":["'use client'\nimport type { RichTextField } from 'payload'\n\nimport {\n FieldContext,\n FieldPathContext,\n type FieldType,\n type RenderFieldServerFnArgs,\n ServerFunctionsContext,\n type ServerFunctionsContextType,\n ShimmerEffect,\n useServerFunctions,\n} from '@payloadcms/ui'\nimport React, { useCallback, useEffect, useRef } from 'react'\n\nimport type { DefaultTypedEditorState } from '../../nodeTypes.js'\n\n/**\n * Utility to render a lexical editor on the client.\n *\n * @experimental - may break in minor releases\n * @todo - replace this with a general utility that works for all fields. Maybe merge with packages/ui/src/forms/RenderFields/RenderField.tsx\n */\nexport const RenderLexical: React.FC<\n /**\n * If value or setValue, or both, is provided, this component will manage its own value.\n * If neither is passed, it will rely on the parent form to manage the value.\n */\n {\n /**\n * Override the loading state while the field component is being fetched and rendered.\n */\n Loading?: React.ReactElement\n\n setValue?: FieldType<DefaultTypedEditorState | undefined>['setValue']\n value?: FieldType<DefaultTypedEditorState | undefined>['value']\n } & RenderFieldServerFnArgs\n> = (args) => {\n const { field, initialValue, Loading, path, schemaPath, setValue, value } = args\n const [Component, setComponent] = React.useState<null | React.ReactNode>(null)\n const serverFunctionContext = useServerFunctions()\n const { _internal_renderField } = serverFunctionContext\n\n const [entityType, entitySlug] = schemaPath.split('.')\n\n const fieldPath = path ?? (field && 'name' in field ? field?.name : '') ?? ''\n\n const renderLexical = useCallback(() => {\n async function render() {\n const { Field } = await _internal_renderField({\n field: {\n ...((field as RichTextField) || {}),\n type: 'richText',\n admin: {\n ...((field as RichTextField)?.admin || {}),\n // When using \"fake\" anchor fields, hidden is often set to true. We need to override that here to ensure the field is rendered.\n hidden: false,\n },\n },\n initialValue: initialValue ?? undefined,\n path,\n schemaPath,\n })\n\n setComponent(Field)\n }\n void render()\n }, [_internal_renderField, schemaPath, path, field, initialValue])\n\n const mounted = useRef(false)\n\n useEffect(() => {\n if (mounted.current) {\n return\n }\n mounted.current = true\n void renderLexical()\n }, [renderLexical])\n\n if (!Component) {\n return typeof Loading !== 'undefined' ? Loading : <ShimmerEffect />\n }\n\n /**\n * By default, the lexical will make form state requests (e.g. to get drawer fields), passing in the arguments\n * of the current field. However, we need to override those arguments to get it to make requests based on the\n * *target* field. The server only knows the schema map of the target field.\n */\n const adjustedServerFunctionContext: ServerFunctionsContextType = {\n ...serverFunctionContext,\n getFormState: async (getFormStateArgs) => {\n return serverFunctionContext.getFormState({\n ...getFormStateArgs,\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n })\n },\n }\n\n if (typeof value === 'undefined' && !setValue) {\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n {Component}\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n }\n\n const fieldValue: FieldType<DefaultTypedEditorState | undefined> = {\n disabled: false,\n formInitializing: false,\n formProcessing: false,\n formSubmitted: false,\n initialValue: value,\n path: fieldPath,\n setValue: setValue ?? (() => undefined),\n showError: false,\n value,\n }\n\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n <FieldContext value={fieldValue}>{Component}</FieldContext>\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SACEC,YAAY,EACZC,gBAAgB,EAGhBC,sBAAsB,EAEtBC,aAAa,EACbC,kBAAkB,QACb;AACP,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ;AAItD;;;;;;AAMA,OAAO,MAAMC,aAAA,GAcTC,IAAA;EAAA,MAAAC,CAAA,GAAAZ,EAAA;EACF;IAAAa,KAAA;IAAAC,YAAA;IAAAC,OAAA;IAAAC,IA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