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CC,MAAO,GAAG,CAACF,KAAK,UAAYC,KAAK,0EAA2EC,MAAO,IAEhNC,KAAK,EACLC,GAAI,YACJC,EAAG,yBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,sCAOAlB,EAF4B,0EACXO,EAAQ,KAQzBP,EAF4B,yCACXO,EAAQ,MAMjCY,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAatB,QAAO7D,EAAAA,EAAA,GACpBkF,OAAOC,aAAatB,SAAW,IAC/BD,EAAQC,SAGXqB,OAAOC,aAAarB,YAAW9D,EAAAA,EAAA,GAC5BkF,OAAOC,aAAarB,aAAe,IACnCF,EAAQE,aAEY,MAAMsB,EAAiB,GAC9BA,EAAe,6EAA+E,CACtGf,EAAGA,IAAMC,EAAQ,MACjBe,GAAI,8CAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAcpF,EAAAA,EAAA,GACPkF,OAAOC,aAAaC,gBAAkB,IACtCA,UC1F3BE,EAAOC,QAAU/H,cCAjB8H,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/get-custom-product-spec.action.ts?9abd","webpack://Msdyn365.Commerce.Online/./src/actions/getProductSpecificationDetails.ts?0057","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-details/genera-product-details.props.autogenerated.ts?975d","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-details/components/product-custom-specification-table-stucture.tsx?0c02","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-details/genera-product-details.tsx?cacf","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-details/genera-product-details.view.tsx?4d13","webpack://Msdyn365.Commerce.Online/./lib/genera-product-details/module-registration.js?7a00","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\n// import { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n import {getProductSpecificationDetailsAsync} from './getProductSpecificationDetails';\n\n/**\n * GetCustomProductSpec Input Action\n */\nexport class GetCustomProductSpecficiationInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `GetCustomProductSpecification${this.productId}`;\n public getCacheObjectType = () => 'Spec';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\n// export interface IGetCustomProductSpecData {\n// text: string;\n// }\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new GetCustomProductSpecficiationInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nasync function action(input: GetCustomProductSpecficiationInput, ctx: Msdyn365.IActionContext): Promise {\n const prodAttr:AttributeValue[] = new Array();\n const response = await getProductSpecificationDetailsAsync({callerContext: ctx},input.productId);\n if(response && response.length > 0)\n {\n // response = response.sort((x,y) => x.Interchange_Part_Number!.localeCompare(y.Interchange_Part_Number!));\n response.forEach(element =>{\n const attr:AttributeValue={AttributeValueId:element.Specification_Id?+element.Specification_Id:0,\n KeyName:element.Public_Display_Name,\n Name:element.Public_Display_Name,\n TextValue:element.Product_Attirbute_Value\n ,DataTypeValue: 5 };\n prodAttr.push(attr);\n });\n }\n return prodAttr;\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n id: 'GetCustomProductSpecifications',\n input: createInput\n});\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nexport function getProductSpecificationDetailsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\nfunction getProductSpecificationDetailsInput (\r\n queryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\n const query = getProductSpecificationDetailsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductSpecificationDetails',\r\n true,\r\n DataServiceEntities.ProductSpecificationsEntityExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductSpecificationsEntity' },\r\n {\r\n ProductId: productId\r\n }\r\n );\r\n}\r\n\r\nexport function getProductSpecificationDetailsAsync (\r\n context: IContext, productId:\r\n number\r\n ): AsyncResult {\r\n const request = getProductSpecificationDetailsInput(\r\n context.queryResultSettings || {}, productId);\r\n return callActionOrExecute(request, context.callerContext);\r\n }","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IGeneraProductDetails contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum displayStyle {\r\n accordion = 'accordion',\r\n table = 'table'\r\n}\r\n\r\nexport const enum collectionType {\r\n fitment = 'fitment',\r\n interchange = 'interchange'\r\n}\r\n\r\nexport interface IGeneraProductDetailsConfig extends Msdyn365.IModuleConfig {\r\n heading?: IHeadingData;\r\n displayStyle?: displayStyle;\r\n collectionType: collectionType;\r\n className?: string;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IGeneraProductDetailsResources {\r\n trueValueText: string;\r\n falseValueText: string;\r\n}\r\n\r\nexport const enum HeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IHeadingData {\r\n text: string;\r\n tag?: HeadingTag;\r\n}\r\n\r\nexport interface IGeneraProductDetailsProps extends Msdyn365.IModule {\r\n resources: IGeneraProductDetailsResources;\r\n config: IGeneraProductDetailsConfig;\r\n}\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\n/**\n * Product specification table row.\n */\nexport interface IProductSpecificationTableRow {\n productName?: string;\n cellData?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Product specification table row component.\n * @param props - For product specification table row.\n * @param props.productName - Product name.\n * @param props.cellData - Cell data.\n * @param props.className - Class name.\n * @returns - Returns JSX element.\n */\nexport const ProductSpecificationTableRow: React.FC = ({ productName, cellData, className }) => (\n \n \n \n \n \n { cellData }\n \n \n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\n// import { observer } from 'mobx-react';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Drawer, IModuleProps, INodeProps, Module } from '@msdyn365-commerce-modules/utilities';\nimport { IGeneraProductDetailsData } from './genera-product-details.data';\nimport { displayStyle, IGeneraProductDetailsProps } from './genera-product-details.props.autogenerated';\nimport { ProductSpecificationTableRow } from './components/product-custom-specification-table-stucture';\n import {getProductSpecificationDetailsAsync} from '../../actions/getProductSpecificationDetails';\nexport interface IProductSpecificationState {\n isDrawerOpen: boolean;\n drawerListId: number | undefined;\n}\n\nexport interface IGeneraProductDetailsViewProps extends IGeneraProductDetailsProps {\n ProductSpecification: IModuleProps;\n ProductSpecificationTableProps: INodeProps;\n ProductSpecificationTableBodyProps: INodeProps;\n productSpecificationResult?: (JSX.Element | null)[];\n title?: React.ReactNode;\n isAccrodion?: boolean;\n handleText?(event: Msdyn365.ContentEditableEvent): void;\n}\n\nexport interface IGeneraProductDetailsExtentedProps extends IGeneraProductDetailsProps {\n displayStyle?: displayStyle;\n}\n\n/**\n *\n * GeneraProductDetails component\n * @extends {React.PureComponent>}\n */\nclass GeneraProductDetails extends React.PureComponent {\n public constructor(props: IGeneraProductDetailsExtentedProps) {\n super(props);\n this.state = {\n isDrawerOpen: false,\n drawerListId: undefined\n };\n }\n\n public async componentDidMount(): Promise {\n const { context, data } = this.props;\n // const catalogId = Msdyn365.getCatalogId(this.props.context.request);\n reaction(\n () => (data.product && data.product.result ? data.product.result.RecordId : null),\n () => {\n if (context && data.product.result && (this.props.data.generaProductSpecificationData === undefined ||(this.props.data.generaProductSpecificationData && this.props.data.generaProductSpecificationData.result === undefined)) ) {\n this.getProductSpecificationDatas();\n }\n }\n );\n }\n\n public async getProductSpecificationDatas(): Promise{\n getProductSpecificationDetailsAsync({callerContext: this.props.context.actionContext},this.props.data.product?.result!.RecordId).then(data=>{\n this.props.data.generaProductSpecificationData.result = data;\n }).catch((error: Error) => {\n });\n }\n\n public shouldComponentUpdate(nextProps: IGeneraProductDetailsExtentedProps,\n nextState: IProductSpecificationState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n let data: IGeneraProductDetailsData;\n try {\n data = this.props.data;\n } catch (error) {\n this.props.telemetry.error(`Something went wrong ------${error}`);\n return (
\n {error}\n
);\n }\n\n if (!data.generaProductSpecificationData || (!data.generaProductSpecificationData.result || data.generaProductSpecificationData.result.length <= 0)) {\n this.props.telemetry.error('Product specification content is empty, module wont render.');\n return null;\n }\n\n const { heading, className } = this.props.config;\n const { generaProductSpecificationData } = this.props.data;\n const isAccrodion = this.props.config.displayStyle === displayStyle.accordion;\n const viewProps = {\n ...this.props,\n handleText: this.handleHeadingChange,\n ProductSpecification: {\n moduleProps: this.props,\n className: classnames('ms-product-specification', className)\n },\n ProductSpecificationTableProps: isAccrodion ? {\n moduleProps: this.props,\n className: classnames('ms-product-specification__accordion', className)\n } : {\n className: classnames('ms-product-specification__table table-striped table-bordered'),\n tag: 'table'\n },\n isAccrodion,\n ProductSpecificationTableBodyProps: isAccrodion ? {} : {\n className: '',\n tag: 'tbody'\n },\n title: heading?.text && (\n ),\n\n productSpecificationResult: isAccrodion ? generaProductSpecificationData.result && this._createDrawerBody(data) : generaProductSpecificationData.result && this._createTableBody(data)\n } as IGeneraProductDetailsViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n\n /**\n * Handle Heading Text Change.\n * @param event - Current event.\n */\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n private _createTableBody(content: IGeneraProductDetailsData): (JSX.Element | null)[] {\n return content.generaProductSpecificationData && content.generaProductSpecificationData.result && content.generaProductSpecificationData.result.length > 0 ?content.generaProductSpecificationData.result.map((product, index) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n\n if (!cellData) {\n return null;\n }\n\n return (\n \n );\n }) : [];\n }\n\n private _createDrawerBody(content: IGeneraProductDetailsData): (JSX.Element | null)[] {\n const accordionItemContainer: IModuleProps = {\n moduleProps: this.props,\n className: 'ms-product-specification-title'\n };\n return content.generaProductSpecificationData.result!.map((product) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n if (!cellData) {\n return null;\n }\n return (\n \n \n
\n {cellData}\n
\n \n
\n );\n });\n }\n\n private readonly _toggle = (drawerListId: number | undefined) => (): void => {\n if (this.state.drawerListId !== drawerListId) {\n this.setState({ drawerListId, isDrawerOpen: true });\n } else {\n this.setState({ drawerListId: undefined, isDrawerOpen: false });\n }\n };\n\n private _renderProductCell(product: AttributeValue): JSX.Element | null {\n switch (product.DataTypeValue) {\n case 0: // None\n // Return span here instead of null so the row still shows\n return ;\n case 1: // Currency\n return this._renderCurrencyCell(product);\n case 2: // DateTime\n return this._renderDateTimeCell(product);\n case 3: // Decimal\n return this._renderDecimalCell(product);\n case 4: // Integer\n return this._renderIntegerCell(product);\n case 5: // Text\n return this._renderTextCell(product);\n case 6: // TrueFalse\n return this._renderTrueFalseCell(product);\n case 40: // Video\n this.props.telemetry.warning('Got video specification type, not supported yet so skipping line');\n return null;\n case 41: // Image\n this.props.telemetry.warning('Got image specification type, not supported yet so skipping line');\n return null;\n default:\n this.props.telemetry.warning(`Got unknown specification type ${product.DataTypeValue} so skipping line`);\n return null;\n }\n }\n\n private _renderCurrencyCell(product: AttributeValue): JSX.Element | null {\n if (product.CurrencyValue !== null && product.CurrencyValue !== undefined) {\n return (\n \n {product.CurrencyCode}\n {product.CurrencyValue}\n \n );\n }\n\n return null;\n }\n\n private _renderDateTimeCell(product: AttributeValue): JSX.Element | null {\n if (product.DateTimeOffsetValue?.toUTCString) {\n return (\n {product.DateTimeOffsetValue.toUTCString()}\n );\n }\n\n return null;\n }\n\n private _renderIntegerCell(product: AttributeValue): JSX.Element | null {\n if (product.IntegerValue !== null && product.IntegerValue !== undefined) {\n return (\n {product.IntegerValue}\n );\n }\n\n return null;\n }\n\n private _renderDecimalCell(product: AttributeValue): JSX.Element | null {\n if (product.FloatValue !== null && product.FloatValue !== undefined) {\n return (\n {product.FloatValue}\n );\n }\n\n return null;\n }\n\n private _renderTextCell(product: AttributeValue): JSX.Element | null {\n if (product.TextValue !== null && product.TextValue !== undefined) {\n return ;\n }\n\n return null;\n }\n\n private _renderTrueFalseCell(product: AttributeValue): JSX.Element | null {\n // TODO 20369885 setting to default value is needed to work around a platform bug where\n // config string value does not get its default value.\n if (product.BooleanValue) {\n return (\n {this.props.resources.trueValueText ? this.props.resources.trueValueText : 'Yes'}\n );\n }\n return (\n {this.props.resources.falseValueText ? this.props.resources.falseValueText : 'No'}\n );\n\n }\n}\n\nexport default GeneraProductDetails;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IGeneraProductDetailsViewProps } from './genera-product-details';\n\nconst ProductDetailsView: React.FC = props => {\n const { ProductSpecification, ProductSpecificationTableProps, ProductSpecificationTableBodyProps, productSpecificationResult } = props;\n const rowdata = productSpecificationResult &&\n ArrayExtensions.hasElements(productSpecificationResult) &&\n productSpecificationResult.filter((row) => !ObjectExtensions.isNullOrUndefined(row));\n\n return (\n rowdata && ArrayExtensions.hasElements(rowdata) ? (\n \n {props.title}\n \n \n { rowdata }\n \n \n ) : null\n );\n};\n\nexport default ProductDetailsView;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['genera-product-details'] = {\n c: () => require('partner/modules/genera-product-details/genera-product-details.tsx'),\n $type: 'contentModule',\n da: [{name:'generaProductSpecificationData', path:'actions/get-custom-product-spec.action', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'genera-product-details',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/genera-product-details'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-custom-product-spec.action';\n let dataAction = require('partner/actions/get-custom-product-spec.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|genera-product-details|genera-product-details'] = {\n c: () => require('partner/modules/genera-product-details/genera-product-details.view.tsx'),\n cn: '__local__-__local__-genera-product-details'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["GetCustomProductSpecficiationInput","constructor","productId","channelId","config","getCacheKey","this","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","prodAttr","Array","response","getProductSpecificationDetailsAsync","callerContext","length","forEach","element","attr","AttributeValueId","Specification_Id","KeyName","Public_Display_Name","Name","TextValue","Product_Attirbute_Value","DataTypeValue","push","id","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","getProductSpecificationDetailsInput","queryResultSettings","DataServiceQuery","resultSettings","createDataServiceRequestForOperation","DataServiceEntities","bypassCache","returnEntity","ProductId","context","request","callActionOrExecute","displayStyle","collectionType","HeadingTag","ProductSpecificationTableRow","_ref","productName","cellData","className","React","scope","dangerouslySetInnerHTML","getRichTextHtml","GeneraProductDetails","props","super","handleHeadingChange","event","heading","text","target","value","_toggle","drawerListId","state","setState","isDrawerOpen","undefined","data","reaction","product","result","RecordId","generaProductSpecificationData","getProductSpecificationDatas","_this$props$data$prod","actionContext","then","catch","error","shouldComponentUpdate","nextProps","nextState","render","_heading$tag","telemetry","isAccrodion","accordion","viewProps","_objectSpread","handleText","ProductSpecification","moduleProps","classnames","ProductSpecificationTableProps","tag","ProductSpecificationTableBodyProps","title","editProps","onEdit","productSpecificationResult","_createDrawerBody","_createTableBody","renderView","content","map","index","_renderProductCell","key","accordionItemContainer","_product$Name","Module","Object","assign","Drawer","collapseProps","timeout","isOpen","openGlyph","closeGlyph","glyphPlacement","toggleButtonText","onToggle","_renderCurrencyCell","_renderDateTimeCell","_renderDecimalCell","_renderIntegerCell","_renderTextCell","_renderTrueFalseCell","warning","CurrencyValue","CurrencyCode","_product$DateTimeOffs","DateTimeOffsetValue","toUTCString","IntegerValue","FloatValue","BooleanValue","resources","trueValueText","falseValueText","rowdata","ArrayExtensions","hasElements","filter","row","ObjectExtensions","isNullOrUndefined","Node","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}