{"version":3,"file":"property.context-DEHLdJ8S.js","sources":["../../../src/packages/core/property/property-dataset/property-dataset-context.token.ts","../../../src/packages/core/property/property-dataset/nameable-property-dataset-context.token.ts","../../../src/packages/core/property/property-dataset/property-dataset-base-context.ts","../../../src/packages/core/property/property-dataset/property-dataset.element.ts","../../../src/packages/core/property/property/property.context.ts"],"sourcesContent":["import type { UmbPropertyDatasetContext } from './property-dataset-context.interface.js';\nimport { UmbContextToken } from '@umbraco-cms/backoffice/context-api';\n\nexport const UMB_PROPERTY_DATASET_CONTEXT = new UmbContextToken('UmbPropertyDatasetContext');\n","import type { UmbPropertyDatasetContext } from './property-dataset-context.interface.js';\nimport type { UmbNameablePropertyDatasetContext } from './nameable-property-dataset-context.interface.js';\nimport { UMB_PROPERTY_DATASET_CONTEXT } from './property-dataset-context.token.js';\nimport { UmbContextToken } from '@umbraco-cms/backoffice/context-api';\n\nexport const isNameablePropertyDatasetContext = (\n\tcontext: UmbPropertyDatasetContext,\n): context is UmbNameablePropertyDatasetContext => 'setName' in context;\n\nexport const UMB_NAMEABLE_PROPERTY_DATASET_CONTEXT = new UmbContextToken<\n\tUmbPropertyDatasetContext,\n\tUmbNameablePropertyDatasetContext\n>(UMB_PROPERTY_DATASET_CONTEXT.toString(), undefined, isNameablePropertyDatasetContext);\n","import type { UmbPropertyValueData } from '../types/property-value-data.type.js';\nimport { UMB_PROPERTY_DATASET_CONTEXT } from './property-dataset-context.token.js';\nimport type { UmbPropertyDatasetContext } from './property-dataset-context.interface.js';\nimport type { UmbNameablePropertyDatasetContext } from './nameable-property-dataset-context.interface.js';\nimport type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';\nimport { UmbContextBase } from '@umbraco-cms/backoffice/class-api';\nimport { UmbArrayState, UmbBooleanState, UmbStringState } from '@umbraco-cms/backoffice/observable-api';\nimport { UmbVariantId } from '@umbraco-cms/backoffice/variant';\n\n/**\n * A base property dataset context implementation.\n * @class UmbPropertyDatasetContextBase\n * @augments {UmbContextBase}\n */\nexport class UmbPropertyDatasetContextBase\n\textends UmbContextBase\n\timplements UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext\n{\n\t#name = new UmbStringState(undefined);\n\tname = this.#name.asObservable();\n\n\t#values = new UmbArrayState([], (x) => x.alias);\n\tpublic readonly values = this.#values.asObservable();\n\tprivate _entityType!: string;\n\tprivate _unique!: string;\n\n\t#readOnly = new UmbBooleanState(false);\n\tpublic readOnly = this.#readOnly.asObservable();\n\n\tgetEntityType() {\n\t\treturn this._entityType;\n\t}\n\tgetUnique() {\n\t\treturn this._unique;\n\t}\n\tgetName() {\n\t\treturn this.#name.getValue();\n\t}\n\tsetName(name: string | undefined) {\n\t\tthis.#name.setValue(name);\n\t}\n\tgetVariantId() {\n\t\treturn UmbVariantId.CreateInvariant();\n\t}\n\t// variant id for a specific property?\n\n\tconstructor(host: UmbControllerHost) {\n\t\t// The controller alias, is a very generic name cause we want only one of these for this controller host.\n\t\tsuper(host, UMB_PROPERTY_DATASET_CONTEXT);\n\t}\n\n\t/**\n\t * @function propertyValueByAlias\n\t * @param {string} propertyAlias\n\t * @returns {Promise | undefined>}\n\t * @description Get an Observable for the value of this property.\n\t */\n\tasync propertyValueByAlias(propertyAlias: string) {\n\t\treturn this.#values.asObservablePart((values) => {\n\t\t\tconst valueObj = values.find((x) => x.alias === propertyAlias);\n\t\t\treturn valueObj ? (valueObj.value as ReturnType) : undefined;\n\t\t});\n\t}\n\n\t/**\n\t * @function setPropertyValue\n\t * @param {string} alias\n\t * @param {PromiseLike} value - value can be a promise resolving into the actual value or the raw value it self.\n\t * @returns {Promise}\n\t * @description Set the value of this property.\n\t */\n\tsetPropertyValue(alias: string, value: unknown) {\n\t\tthis.#values.appendOne({ alias, value });\n\t}\n\n\tgetValues() {\n\t\treturn this.#values.getValue();\n\t}\n\tsetValues(map: Array) {\n\t\tthis.#values.setValue(map);\n\t}\n\n\t/**\n\t * Gets the read-only state of the current variant culture.\n\t * @return {*} {boolean}\n\t * @memberof UmbBlockGridInlinePropertyDatasetContext\n\t */\n\tgetReadOnly(): boolean {\n\t\treturn this.#readOnly.getValue();\n\t}\n}\n","import type { UmbPropertyValueData } from '../types/property-value-data.type.js';\nimport { UmbPropertyDatasetContextBase } from './property-dataset-base-context.js';\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\nimport { customElement, html, property } from '@umbraco-cms/backoffice/external/lit';\nimport { UmbChangeEvent } from '@umbraco-cms/backoffice/event';\n\n/**\n * @element umb-property-dataset\n * @description - Element for hosting a property dataset. This is needed for umb-property to work.\n * @slot default - Slot for rendering content within.\n */\n@customElement('umb-property-dataset')\nexport class UmbPropertyDatasetElement extends UmbLitElement {\n\t// Determine wether state change should fire an event when the value is changed.\n\t#allowChangeEvent = false;\n\n\tpublic readonly context: UmbPropertyDatasetContextBase;\n\n\t@property({ attribute: false })\n\t/**\n\t * The value of the dataset.\n\t * @returns {Array} - The value of the dataset\n\t * @example\n\t * ```ts\n\t * const dataSet = [\n\t * \t{\n\t * \t\talias: 'testAlias',\n\t * \t\tvalue: 'value as a string',\n\t * \t},\n\t * {\n\t * \t\talias: 'anotherAlias',\n\t * \t\tvalue: 123,\n\t * \t}\n\t * ]\n\t *\n\t * html`\n\t * \n\t * \t\n\t * \t\n\t * \n\t * `\n\t * ```\n\t */\n\tpublic set value(value: Array) {\n\t\tthis.#allowChangeEvent = false;\n\t\tthis.context.setValues(value);\n\t\t// Above might not trigger a observer callback (if no change), so set the allow change event to true:\n\t\tthis.#allowChangeEvent = true;\n\t}\n\tpublic get value(): Array {\n\t\treturn this.context.getValues();\n\t}\n\n\t@property({ attribute: false })\n\t/**\n\t * The name of the dataset, this name varies depending on the use-case. But this is either\n\t * @property name\n\t * @type {string}\n\t * @returns {string}\n\t * @example\n\t * ```ts\n\t * html`\n\t * \n\t * \t...\n\t * \n\t * `\n\t */\n\tpublic set name(value: string | undefined) {\n\t\tthis.#allowChangeEvent = false;\n\t\tthis.context.setName(value);\n\t\t// Above might not trigger a observer callback (if no change), so set the allow change event to true:\n\t\tthis.#allowChangeEvent = true;\n\t}\n\tpublic get name(): string | undefined {\n\t\treturn this.context.getName();\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Prevent any child events escaping this element.\n\t\tthis.addEventListener('change', (e) => {\n\t\t\tif (e.target !== this) {\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t}\n\t\t});\n\n\t\tthis.context = new UmbPropertyDatasetContextBase(this);\n\t\t// prevent the first change event from firing:\n\t\tthis.#allowChangeEvent = false;\n\t\tthis.observe(this.context.name, this.#observerCallback);\n\t\t// prevent the first change event from firing:\n\t\tthis.#allowChangeEvent = false;\n\t\tthis.observe(this.context.values, this.#observerCallback);\n\t}\n\n\t#observerCallback = () => {\n\t\tif (this.#allowChangeEvent) {\n\t\t\tthis.dispatchEvent(new UmbChangeEvent());\n\t\t} else {\n\t\t\t// Set allow change event to true.\n\t\t\tthis.#allowChangeEvent = true;\n\t\t}\n\t};\n\n\toverride render() {\n\t\treturn html``;\n\t}\n}\n\nexport default UmbPropertyDatasetElement;\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'umb-property-dataset': UmbPropertyDatasetElement;\n\t}\n}\n","import { UMB_PROPERTY_DATASET_CONTEXT } from '../property-dataset/index.js';\nimport type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';\nimport { UmbContextBase } from '@umbraco-cms/backoffice/class-api';\nimport {\n\tUmbArrayState,\n\tUmbBasicState,\n\tUmbBooleanState,\n\tUmbClassState,\n\tUmbDeepState,\n\tUmbObjectState,\n\tUmbStringState,\n} from '@umbraco-cms/backoffice/observable-api';\nimport { UmbContextToken } from '@umbraco-cms/backoffice/context-api';\nimport type { UmbVariantId } from '@umbraco-cms/backoffice/variant';\nimport type { UmbPropertyEditorConfigProperty } from '@umbraco-cms/backoffice/property-editor';\nimport { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';\nimport type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';\nimport type {\n\tUmbPropertyTypeAppearanceModel,\n\tUmbPropertyTypeValidationModel,\n} from '@umbraco-cms/backoffice/content-type';\n\nexport class UmbPropertyContext extends UmbContextBase> {\n\t#alias = new UmbStringState(undefined);\n\tpublic readonly alias = this.#alias.asObservable();\n\n\t#label = new UmbStringState(undefined);\n\tpublic readonly label = this.#label.asObservable();\n\n\t#description = new UmbStringState(undefined);\n\tpublic readonly description = this.#description.asObservable();\n\n\t#appearance = new UmbObjectState(undefined);\n\tpublic readonly appearance = this.#appearance.asObservable();\n\n\t#value = new UmbDeepState(undefined);\n\tpublic readonly value = this.#value.asObservable();\n\n\t#configValues = new UmbArrayState([], (x) => x.alias);\n\tpublic readonly configValues = this.#configValues.asObservable();\n\n\t#config = new UmbClassState(undefined);\n\tpublic readonly config = this.#config.asObservable();\n\n\t#validation = new UmbObjectState(undefined);\n\tpublic readonly validation = this.#validation.asObservable();\n\n\tpublic readonly validationMandatory = this.#validation.asObservablePart((x) => x?.mandatory);\n\tpublic readonly validationMandatoryMessage = this.#validation.asObservablePart((x) => x?.mandatoryMessage);\n\n\t#dataPath = new UmbStringState(undefined);\n\tpublic readonly dataPath = this.#dataPath.asObservable();\n\n\t#editor = new UmbBasicState(undefined);\n\tpublic readonly editor = this.#editor.asObservable();\n\n\t#isReadOnly = new UmbBooleanState(false);\n\tpublic readonly isReadOnly = this.#isReadOnly.asObservable();\n\n\tsetEditor(editor: UmbPropertyEditorUiElement | undefined) {\n\t\tthis.#editor.setValue(editor ?? undefined);\n\t}\n\tgetEditor() {\n\t\treturn this.#editor.getValue();\n\t}\n\n\t// property variant ID:\n\t#variantId = new UmbClassState(undefined);\n\tpublic readonly variantId = this.#variantId.asObservable();\n\n\t#variantDifference = new UmbStringState(undefined);\n\tpublic readonly variantDifference = this.#variantDifference.asObservable();\n\n\t#datasetContext?: typeof UMB_PROPERTY_DATASET_CONTEXT.TYPE;\n\n\tconstructor(host: UmbControllerHost) {\n\t\tsuper(host, UMB_PROPERTY_CONTEXT);\n\n\t\tthis.consumeContext(UMB_PROPERTY_DATASET_CONTEXT, (variantContext) => {\n\t\t\tthis.#datasetContext = variantContext;\n\t\t\tthis.setVariantId(variantContext.getVariantId?.());\n\t\t\tthis._generateVariantDifferenceString();\n\t\t\tthis._observeProperty();\n\t\t});\n\n\t\tthis.observe(\n\t\t\tthis.alias,\n\t\t\t() => {\n\t\t\t\tthis._observeProperty();\n\t\t\t},\n\t\t\tnull,\n\t\t);\n\n\t\tthis.observe(\n\t\t\tthis.configValues,\n\t\t\t(configValues) => {\n\t\t\t\tthis.#config.setValue(configValues ? new UmbPropertyEditorConfigCollection(configValues) : undefined);\n\t\t\t},\n\t\t\tnull,\n\t\t);\n\n\t\tthis.observe(\n\t\t\tthis.variantId,\n\t\t\t() => {\n\t\t\t\tthis._generateVariantDifferenceString();\n\t\t\t},\n\t\t\tnull,\n\t\t);\n\t}\n\n\tprivate async _observeProperty(): Promise {\n\t\tconst alias = this.#alias.getValue();\n\t\tif (!this.#datasetContext || !alias) return;\n\n\t\tthis.observe(\n\t\t\tawait this.#datasetContext.propertyVariantId?.(alias),\n\t\t\t(variantId) => {\n\t\t\t\tthis.#variantId.setValue(variantId);\n\t\t\t},\n\t\t\t'observeVariantId',\n\t\t);\n\n\t\tthis.observe(\n\t\t\tawait this.#datasetContext.propertyValueByAlias(alias),\n\t\t\t(value) => {\n\t\t\t\tthis.#value.setValue(value);\n\t\t\t},\n\t\t\t'observeValue',\n\t\t);\n\n\t\tthis.observe(this.#datasetContext.readOnly, (value) => {\n\t\t\tthis.#isReadOnly.setValue(value);\n\t\t});\n\t}\n\n\tprivate _generateVariantDifferenceString() {\n\t\tif (!this.#datasetContext) return;\n\t\tconst contextVariantId = this.#datasetContext.getVariantId?.() ?? undefined;\n\t\tconst propertyVariantId = this.#variantId.getValue();\n\n\t\tlet shareMessage;\n\t\tif (contextVariantId && propertyVariantId) {\n\t\t\tif (contextVariantId.segment !== propertyVariantId.segment) {\n\t\t\t\t// TODO: Translate this, ideally the actual culture is mentioned in the message:\n\t\t\t\tshareMessage = 'Shared across culture';\n\t\t\t}\n\t\t\tif (contextVariantId.culture !== propertyVariantId.culture) {\n\t\t\t\t// TODO: Translate this:\n\t\t\t\tshareMessage = 'Shared';\n\t\t\t}\n\t\t}\n\t\tthis.#variantDifference.setValue(shareMessage);\n\t}\n\n\t/**\n\t * Set the alias of this property.\n\t * @param {(string | undefined)} alias\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic setAlias(alias: string | undefined): void {\n\t\tthis.#alias.setValue(alias);\n\t}\n\n\t/**\n\t * Get the alias of this property.\n\t * @returns {*} {(string | undefined)}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getAlias(): string | undefined {\n\t\treturn this.#alias.getValue();\n\t}\n\n\t/**\n\t * Set the label of this property.\n\t * @param {(string | undefined)} label\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic setLabel(label: string | undefined): void {\n\t\tthis.#label.setValue(label);\n\t}\n\n\t/**\n\t * Get the label of this property.\n\t * @returns {*} {(string | undefined)}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getLabel(): string | undefined {\n\t\treturn this.#label.getValue();\n\t}\n\n\t/**\n\t * Set the description of this property.\n\t * @param {(string | undefined)} description\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic setDescription(description: string | undefined): void {\n\t\tthis.#description.setValue(description);\n\t}\n\n\t/**\n\t * Get the description of this property.\n\t * @returns {*} {(string | undefined)}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getDescription(): string | undefined {\n\t\treturn this.#description.getValue();\n\t}\n\n\t/**\n\t * Set the appearance of this property.\n\t * @param {(UmbPropertyTypeAppearanceModel | undefined)} appearance\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic setAppearance(appearance: UmbPropertyTypeAppearanceModel | undefined): void {\n\t\tthis.#appearance.setValue(appearance);\n\t}\n\n\t/**\n\t * Get the appearance of this property.\n\t * @returns {*} {(UmbPropertyTypeAppearanceModel | undefined)}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getAppearance(): UmbPropertyTypeAppearanceModel | undefined {\n\t\treturn this.#appearance.getValue();\n\t}\n\n\t/**\n\t * Set the value of this property.\n\t * @param value {ValueType} the whole value to be set\n\t */\n\tpublic setValue(value: ValueType | undefined): void {\n\t\tconst alias = this.#alias.getValue();\n\t\tif (!this.#datasetContext || !alias) return;\n\t\tthis.#datasetContext?.setPropertyValue(alias, value);\n\t}\n\n\t/**\n\t * Gets the current value of this property.\n\t * Notice this is not reactive, you should us the `value` observable for that.\n\t * @returns {ValueType}\n\t */\n\tpublic getValue(): ValueType | undefined {\n\t\treturn this.#value.getValue();\n\t}\n\n\t/**\n\t * Set the config of this property.\n\t * @param {(Array | undefined)} config\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic setConfig(config: Array | undefined): void {\n\t\tthis.#configValues.setValue(config ?? []);\n\t}\n\n\t/**\n\t * Get the config of this property.\n\t * @returns {*} {(Array | undefined)}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getConfig(): Array | undefined {\n\t\treturn this.#configValues.getValue();\n\t}\n\n\t/**\n\t * Set the variant ID of this property.\n\t * @param {(UmbVariantId | undefined)} variantId\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic setVariantId(variantId: UmbVariantId | undefined): void {\n\t\tthis.#variantId.setValue(variantId);\n\t}\n\n\t/**\n\t * Get the variant ID of this property.\n\t * @returns {*} {(UmbVariantId | undefined)}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getVariantId(): UmbVariantId | undefined {\n\t\treturn this.#variantId.getValue();\n\t}\n\n\t/**\n\t * Set the validation of this property.\n\t * @param {(UmbPropertyTypeValidationModel | undefined)} validation\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic setValidation(validation: UmbPropertyTypeValidationModel | undefined): void {\n\t\tthis.#validation.setValue(validation);\n\t}\n\n\t/**\n\t * Get the validation of this property.\n\t * @returns {*} {(UmbPropertyTypeValidationModel | undefined)}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getValidation(): UmbPropertyTypeValidationModel | undefined {\n\t\treturn this.#validation.getValue();\n\t}\n\n\t/**\n\t * Get the read only state of this property\n\t * @returns {*} {boolean}\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic getIsReadOnly(): boolean {\n\t\treturn this.#isReadOnly.getValue();\n\t}\n\n\tpublic setDataPath(dataPath: string | undefined): void {\n\t\tthis.#dataPath.setValue(dataPath);\n\t}\n\n\tpublic getDataPath(): string | undefined {\n\t\treturn this.#dataPath.getValue();\n\t}\n\n\t/**\n\t * Reset the value of this property.\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic resetValue(): void {\n\t\tthis.setValue(undefined); // TODO: We should get the value from the server aka. the value from the persisted data. (Most workspaces holds this data, via dataset) [NL]\n\t}\n\n\t/**\n\t * Clear the value of this property.\n\t * @memberof UmbPropertyContext\n\t */\n\tpublic clearValue(): void {\n\t\tthis.setValue(undefined); // TODO: We should get the default value from Property Editor maybe even later the DocumentType, as that would hold the default value for the property. (Get it via the dataset) [NL]\n\t}\n\n\tpublic override destroy(): void {\n\t\tsuper.destroy();\n\t\tthis.#alias.destroy();\n\t\tthis.#label.destroy();\n\t\tthis.#description.destroy();\n\t\tthis.#appearance.destroy();\n\t\tthis.#configValues.destroy();\n\t\tthis.#value.destroy();\n\t\tthis.#config.destroy();\n\t\tthis.#isReadOnly.destroy();\n\t\tthis.#datasetContext = undefined;\n\t}\n}\n\nexport const UMB_PROPERTY_CONTEXT = new UmbContextToken('UmbPropertyContext');\n"],"names":["UMB_PROPERTY_DATASET_CONTEXT","UmbContextToken","isNameablePropertyDatasetContext","context","UMB_NAMEABLE_PROPERTY_DATASET_CONTEXT","UmbPropertyDatasetContextBase","UmbContextBase","host","#name","UmbStringState","#values","UmbArrayState","x","#readOnly","UmbBooleanState","name","UmbVariantId","propertyAlias","values","valueObj","alias","value","map","_allowChangeEvent","_observerCallback","UmbPropertyDatasetElement","UmbLitElement","__privateAdd","__privateGet","UmbChangeEvent","__privateSet","e","html","__decorateClass","property","customElement","UmbPropertyContext","UMB_PROPERTY_CONTEXT","#alias","#label","#description","#appearance","UmbObjectState","#value","UmbDeepState","#configValues","#config","UmbClassState","#validation","#dataPath","#editor","UmbBasicState","#isReadOnly","#variantId","#variantDifference","variantContext","#datasetContext","configValues","UmbPropertyEditorConfigCollection","editor","variantId","contextVariantId","propertyVariantId","shareMessage","label","description","appearance","config","validation","dataPath"],"mappings":";;;;;;;;AAGa,MAAAA,IAA+B,IAAIC,EAA2C,2BAA2B,GCEzGC,IAAmC,CAC/CC,MACkD,aAAaA,GAEnDC,IAAwC,IAAIH,EAGvDD,EAA6B,SAAS,GAAG,QAAWE,CAAgC;ACE/E,MAAMG,UACJC,EAET;AAAA;AAAA,EA6BC,YAAYC,GAAyB;AAEpC,UAAMA,GAAMP,CAA4B,GA9BjC,KAAAQ,KAAA,IAAIC,EAAe,MAAS,GAC7B,KAAA,OAAA,KAAKD,GAAM,aAAa,GAE/B,KAAAE,KAAU,IAAIC,EAAoC,CAAA,GAAI,CAACC,MAAMA,EAAE,KAAK,GACpD,KAAA,SAAS,KAAKF,GAAQ,aAAa,GAIvC,KAAAG,KAAA,IAAIC,EAAgB,EAAK,GAC9B,KAAA,WAAW,KAAKD,GAAU,aAAa;AAAA,EAsB9C;AAAA,EA/BAL;AAAA,EAGAE;AAAA,EAKAG;AAAA,EAGA,gBAAgB;AACf,WAAO,KAAK;AAAA,EACb;AAAA,EACA,YAAY;AACX,WAAO,KAAK;AAAA,EACb;AAAA,EACA,UAAU;AACF,WAAA,KAAKL,GAAM;EACnB;AAAA,EACA,QAAQO,GAA0B;AAC5B,SAAAP,GAAM,SAASO,CAAI;AAAA,EACzB;AAAA,EACA,eAAe;AACd,WAAOC,EAAa;EACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAM,qBAA2CC,GAAuB;AACvE,WAAO,KAAKP,GAAQ,iBAAiB,CAACQ,M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