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AG,mBAAqB,IAAM,iBAE3B,KAAAC,cAAgB,IAAiB,cAPpC1G,KAAKsG,YAAcA,GAkBpBK,eAAeC,EAAyBC,EAAgCC,GAC3E,OAAOC,EAAAA,EAAAA,yBAAwB,CAC3BC,cAAeF,EACfG,oBAAqBC,EAAAA,yBAAyBC,qCAAqCL,KAIpF,MAAMM,GAAqCC,EAAAA,EAAAA,IAA2B,CACzEtG,GAAI,0DACJuG,OAAmCV,EACnCC,MAdiBU,GACV,IAAIlB,EAAwBkB,EAAUC,eAAelB,eAgBhE,WC1DAmB,EAAOC,QAAU9H,cCAjB6H,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/order-confirmation-block/order-confirmation-block.tsx?c29c","webpack://Msdyn365.Commerce.Online/./src/modules/order-confirmation-block/order-confirmation-block.view.tsx?f213","webpack://Msdyn365.Commerce.Online/./lib/order-confirmation-block/module-registration.js?fc78","webpack://Msdyn365.Commerce.Online/./src/actions/get-address-purposes.ts?6b90","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["import * as React from 'react';\nimport { IOrderConfirmationBlockData } from './order-confirmation-block.data';\nimport { IOrderConfirmationBlockProps } from './order-confirmation-block.props.autogenerated';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport reactLogo from '../../../public/lotties/order-success-icon.json';\nimport { Player } from '@lottiefiles/react-lottie-player';\n\nexport interface IOrderConfirmationBlockViewProps extends IOrderConfirmationBlockProps {\n addressPurposes: string;\n}\n\nexport interface IOrderConfirmationBlockState {\n orderData: any;\n}\n\nclass OrderConfirmationBlock extends React.PureComponent<\n IOrderConfirmationBlockProps,\n IOrderConfirmationBlockState\n> {\n public constructor(props: IOrderConfirmationBlockProps) {\n super(props);\n this.state = {\n orderData: { showBlock: false }\n };\n }\n public componentDidMount(): void {\n const orderDetails = localStorage.getItem('order-confirmation-data');\n if (orderDetails) {\n const item = JSON.parse(orderDetails);\n const now = new Date();\n\n // compare the expiry time of the item with the current time\n if (item?.expiry && now.getTime() < item.expiry && item?.id) {\n let formattedDate = '';\n const dateAttribute = item && item?.result?.AttributeValues.filter((attr: any) => attr.Name === 'DeliveryDate');\n const timeAttribute = item && item?.result?.AttributeValues.filter((attr: any) => attr.Name === 'DeliveryTimeSlot');\n\n if (dateAttribute && dateAttribute?.length > 0 && dateAttribute && timeAttribute && timeAttribute?.length > 0) {\n const selectedDate = dateAttribute && dateAttribute?.length > 0 ? dateAttribute[0]['TextValue'] : '';\n const selectedTime = timeAttribute && timeAttribute?.length > 0 ? timeAttribute[0]['TextValue'] : '';\n formattedDate = `${selectedDate}, ${selectedTime}`;\n } else {\n const date = new Date(item?.deliveryAt);\n const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n const dayName = date?.getDay() && days[date?.getDay()] === days[now?.getDay()] ? 'Today' : days[date?.getDay()];\n const hours = date.getHours();\n let timeSlot = '5pm-8pm';\n if (hours < 8 || hours >= 16) {\n timeSlot = '9am-12pm';\n } else if (hours >= 8 && hours < 12) {\n timeSlot = '1pm-4pm';\n // } else if (hours > 12 && hours < 16) {\n // timeSlot = '5pm-8pm';\n }\n formattedDate = `${dayName}, ${date?.getDate()} ${date?.toLocaleString('default', {\n month: 'short'\n })} ${timeSlot}`;\n }\n this.setState({ orderData: { ...item, showBlock: true, deliveryAt: formattedDate } });\n localStorage.removeItem('order-confirmation-data');\n } else {\n localStorage.removeItem('order-confirmation-data');\n this.setState({ orderData: { showBlock: false } });\n }\n }\n }\n public render(): JSX.Element | null {\n const details = this.state.orderData;\n const addressType =\n this.props?.data?.addressPurposes?.result &&\n this.props?.data?.addressPurposes?.result.filter(\n (addressTypeValue: { AddressType: any }) => addressTypeValue?.AddressType === details?.ShippingAddress?.AddressTypeValue\n );\n const addressTypeValue = addressType ? addressType[0]?.Description : '';\n\n return details.showBlock ? (\n <>\n
\n
\n
\n
\n \n
\n
\n

Yayy! Order placed

\n

Status: Processing

\n
\n
\n
\n

Delivering order at {addressTypeValue}

\n

\n {details?.ShippingAddress?.Street}\n {details?.ShippingAddress?.StreetNumber && `, ${details?.ShippingAddress?.StreetNumber}`}\n {details?.ShippingAddress?.City && `, ${details?.ShippingAddress?.City}`}\n

\n
\n
\n

Expected delivery

\n

{details?.deliveryAt}

\n
\n
\n \n
\n
\n
\n \n ) : (\n <>\n );\n }\n}\n\nexport default OrderConfirmationBlock;\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 { IOrderConfirmationBlockViewProps } from './order-confirmation-block';\n// import { Button } from '@msdyn365-commerce-modules/utilities';\n\nexport default (props: IOrderConfirmationBlockViewProps) => {\n const { data } = props;\n\n return
{data}
;\n};\n","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['order-confirmation-block'] = {\n c: () => require('partner/modules/order-confirmation-block/order-confirmation-block.tsx'),\n $type: 'contentModule',\n da: [{name:'addressPurposes', path:'@msdyn365-commerce-modules/address/dist/lib/actions/get-address-purposes', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'order-confirmation-block',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/order-confirmation-block'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/address/dist/lib/actions/get-address-purposes';\n let dataAction = require('@msdyn365-commerce-modules/address/dist/lib/actions/get-address-purposes');\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|order-confirmation-block|order-confirmation-block'] = {\n c: () => require('partner/modules/order-confirmation-block/order-confirmation-block.view.tsx'),\n cn: '__local__-__local__-order-confirmation-block'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { getAddressPurposesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { buildCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for get Address Purposes data action.\n */\nexport class GetAddressPurposesInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('AddressPurpose', this.apiSettings);\n\n public getCacheObjectType = () => 'AddressPurpose';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): GetAddressPurposesInput => {\n return new GetAddressPurposesInput(inputData.requestContext.apiSettings);\n};\n\nexport async function getAddressPurposesAction(input: GetAddressPurposesInput, ctx: IActionContext): Promise {\n return getAddressPurposesAsync({\n callerContext: ctx,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\n });\n}\n\nexport const getAddressPurposesActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/address/get-address-purposes',\n action: >getAddressPurposesAction,\n input: createInput\n});\n\nexport default getAddressPurposesActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["OrderConfirmationBlock","React","constructor","props","super","this","state","orderData","showBlock","componentDidMount","orderDetails","localStorage","getItem","item","JSON","parse","now","Date","expiry","getTime","id","_item$result","_item$result2","formattedDate","dateAttribute","result","AttributeValues","filter","attr","Name","timeAttribute","length","date","deliveryAt","days","dayName","getDay","hours","getHours","timeSlot","getDate","toLocaleString","month","setState","_objectSpread","removeItem","render","_this$props","_this$props2","_addressType$","_details$ShippingAddr2","_details$ShippingAddr3","_details$ShippingAddr4","_details$ShippingAddr5","_details$ShippingAddr6","details","addressType","data","addressPurposes","addressTypeValue","_details$ShippingAddr","AddressType","ShippingAddress","AddressTypeValue","Description","className","Player","src","reactLogo","loop","autoplay","style","height","width","Street","StreetNumber","City","Button","href","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","viewDictionary","cn","GetAddressPurposesInput","apiSettings","getCacheKey","buildCacheKey","getCacheObjectType","dataCacheType","async","getAddressPurposesAction","input","ctx","getAddressPurposesAsync","callerContext","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","getAddressPurposesActionDataAction","createObservableDataAction","action","inputData","requestContext","module","exports","ReactDOM"],"sourceRoot":""}