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,OAAOwC,aAAexC,OAAOwC,cAAgB,GAC7CxC,OAAOwC,aAAaE,eAAcD,EAAAA,EAAA,GACPzC,OAAOwC,aAAaE,gBAAkB,IACtCA,yNC9HpB,MAAME,EAAb/X,cACW,KAAAI,YAAc,IAAM,yBAEpB,KAAAC,mBAAqB,IAAM,yBAE3B,KAAAC,cAAgB,IAAiB,WAQrC,MAAM0X,EAAyCC,GAC3C,IAAIF,EASRvX,eAAe0X,EAClBxX,EACAR,GASA,aAP+BiY,EAAAA,EAAAA,6BAC3B,CACI1W,cAAevB,GAEnB,IAMD,MAAMkY,GAAyBzW,EAAAA,EAAAA,IAA2B,CAC7DkJ,GAAI,sEACJjJ,OAAoCsW,EACpCxX,MAAOsX,IAGX,WChEAK,EAAOC,QAAUhU,cCAjB+T,EAAOC,QAAUzR","sources":["webpack://Dobbies.Commerce/./src/themes/dobbies/actions/search-by-criteria.ts?6a4e","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/post-code-restriction/get-restricted-products.tsx?5e6d","webpack://Dobbies.Commerce/./src/themes/dobbies/views/components/checkout/guided-card.tsx?ede6","webpack://Dobbies.Commerce/./src/themes/dobbies/views/components/checkout/guided-form.tsx?cd86","webpack://Dobbies.Commerce/./src/themes/dobbies/views/checkout.view.tsx?8fda","webpack://Dobbies.Commerce/./src/themes/dobbiesclub/views/checkout.view.tsx?4d52","webpack://Dobbies.Commerce/./src/themes/dobbiesclub/views/components/checkout/guided-card.tsx?8213","webpack://Dobbies.Commerce/./src/themes/dobbiesclub/views/components/checkout/guided-form.tsx?f282","webpack://Dobbies.Commerce/./lib/checkout/module-registration.js?9188","webpack://Dobbies.Commerce/../../src/search-org-unit-locations.ts?d18d","webpack://Dobbies.Commerce/external var \"React\"?0d3b","webpack://Dobbies.Commerce/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { createObservableDataAction, IAction, IActionContext, IActionInput, ICreateActionContext } from '@msdyn365-commerce/core';\r\nimport { AsyncResult, ProductSearchCriteria, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * GetSearchByCriteria Input Action\r\n */\r\n\r\nexport class GetSearchByCriteriaInput implements IActionInput {\r\n public productIds?: number[];\r\n public pageType?: string;\r\n public context?: IActionContext;\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n constructor(productIds?: number[], context?: IActionContext, pageType?: string) {\r\n // super({ shouldCacheOutput: true, cacheObjectType: 'postCodeRestriction', cacheKey: 'postCodeRestriction' });\r\n this.productIds = productIds;\r\n this.context = context;\r\n this.pageType = pageType;\r\n }\r\n\r\n public getCacheKey = () => `postCodeRestriction`;\r\n public getCacheObjectType = () => 'postCodeRestriction';\r\n public dataCacheType = () => {\r\n if (this.pageType !== 'checkout') {\r\n return 'request';\r\n } else {\r\n return 'application';\r\n }\r\n };\r\n}\r\n\r\n// Response of the action\r\nexport interface IGetSearchByCriteria {\r\n productsSearchResult: AsyncResult;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: ICreateActionContext): IActionInput => {\r\n return new GetSearchByCriteriaInput();\r\n};\r\n/**\r\n * Action function to fetch products complete details along with attributes\r\n */\r\nexport async function getSearchByCriteriaAsync(input: GetSearchByCriteriaInput, ctx: IActionContext): Promise {\r\n let productSearchResults: ProductSearchResult[];\r\n let promise: AsyncResult;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = {\r\n ChannelId: ctx.requestContext.apiSettings.channelId,\r\n CatalogId: ctx.requestContext.apiSettings.catalogId\r\n };\r\n\r\n searchCriteriaInput.Ids = input.productIds;\r\n searchCriteriaInput.IncludeAttributes = true;\r\n\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: ctx,\r\n queryResultSettings: {}\r\n },\r\n searchCriteriaInput\r\n );\r\n\r\n productSearchResults = await promise;\r\n return productSearchResults;\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getSearchByCriteriaAsync,\r\n input: createInput\r\n});\r\n","import { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nvar axios = require('axios');\r\n\r\nexport const getRestrictedProducts = async (productsData: ProductSearchResult[], attributesBaseUrl?: string): Promise => {\r\n const restrictedProducts: number[] = [];\r\n for (const product of productsData) {\r\n const attributes = await _getRestrictedPostCodes(product.RecordId, attributesBaseUrl);\r\n attributes &&\r\n attributes.map((attr: any) => {\r\n if (attr?.Name && attr.Name === 'RestrictedPostCode' && attr.TextValue) {\r\n // @ts-ignore\r\n const postcodesTemp = JSON.parse(attr?.TextValue).RestrictedPostCode;\r\n if (postcodesTemp.length > 0) {\r\n restrictedProducts.push(product.RecordId);\r\n }\r\n }\r\n });\r\n }\r\n\r\n return restrictedProducts;\r\n};\r\n\r\nexport const _getRestrictedPostCodes = async (productId: number, attributesBaseUrl?: string): Promise => {\r\n let url = attributesBaseUrl ? `${attributesBaseUrl}Commerce/Products(${productId})/GetAttributeValues(channelId=5637147577,catalogId=0)?$top=1000&api-version=7.3`: `https://scu40oznal298244666-rs.su.retail.dynamics.com/Commerce/Products(${productId})/GetAttributeValues(channelId=5637147577,catalogId=0)?$top=1000&api-version=7.3`;\r\n var config = {\r\n method: 'get',\r\n url: url,\r\n headers: {\r\n authority: attributesBaseUrl ? attributesBaseUrl.split('://')[1] : 'scu40oznal298244666-rs.su.retail.dynamics.com',\r\n accept: 'application/json',\r\n 'accept-language': 'en-GB',\r\n appsessionid: 'OtVVxv4TZOd4WbCSDTkvYH',\r\n 'cache-control': 'no-cache',\r\n 'content-type': 'application/json',\r\n contenttype: 'application/json',\r\n 'from-keystone': 'true',\r\n 'odata-maxversion': '4.0',\r\n 'odata-version': '4.0',\r\n oun: 'Y100',\r\n pragma: 'no-cache',\r\n prefer: 'return=representation',\r\n requestid: 'e42018722d257bb82e53ad56d5d963fc/2',\r\n usersessionid: 'ADCehL+M8YWP9iwro4TOSA'\r\n }\r\n };\r\n\r\n try {\r\n const response = await axios(config);\r\n return response.data.value;\r\n } catch (error) {\r\n console.log('err', error);\r\n throw error; // rethrow the error if needed\r\n }\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/ //\r\nimport { Heading as HeadingType } from '@msdyn365-commerce-modules/data-types';\r\nimport { Button, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport classname from 'classnames';\r\nimport * as React from 'react';\r\nimport ReactDOM from 'react-dom';\r\n\r\nexport interface ICheckoutGuidedCardProps {\r\n step: number;\r\n title?: HeadingType;\r\n disabled?: boolean; // module is not available\r\n isActive?: boolean; // step === currentStep\r\n isVisted?: boolean; // step < currentStep\r\n isExpanded?: boolean;\r\n isReady?: boolean;\r\n isPending?: boolean;\r\n isUpdating?: boolean;\r\n isSubmitting?: boolean;\r\n isCancelAllowed?: boolean;\r\n isMobile?: boolean;\r\n hasInitialized?: boolean;\r\n hasControlGroup?: boolean;\r\n children: React.ReactNode;\r\n /* VSI Customization - START - 16/04/21 - Post code restriction */\r\n notBtPostCodeForPlants?: boolean;\r\n invalidAddressForCartProducts?: boolean;\r\n InvalidAddressMsg?: string;\r\n loggedInUserNewAddress?: boolean;\r\n isFirstAddress?: boolean;\r\n /* VSI Customization - END */\r\n resource: {\r\n checkoutStepTitleFormat: string;\r\n saveBtnLabel: string;\r\n changeBtnLabel: string;\r\n cancelBtnLabel: string;\r\n saveAndContinueBtnLabel: string;\r\n };\r\n onEdit?(): void;\r\n onCancel?(): void;\r\n onSubmit?(): void;\r\n onNext(): void;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuidedCard component\r\n * @extends {React.Component}\r\n */\r\nclass CheckoutGuidedCard extends React.PureComponent {\r\n private editButtonRef: React.RefObject = React.createRef();\r\n private formCardRef: React.RefObject = React.createRef();\r\n\r\n public componentDidUpdate(prevProps: ICheckoutGuidedCardProps): void {\r\n /**\r\n * Move to next step when current step is ready\r\n */\r\n const { isActive, isReady, onNext, isVisted, onEdit } = this.props;\r\n\r\n // Move to next step after completing the current step\r\n if (isActive && isReady) {\r\n onNext();\r\n }\r\n\r\n // Set the focus to Edit button once edit button appear\r\n // (It happens when current step switch to isReady status)\r\n const prevCanEdit = prevProps.isReady && prevProps.isVisted && !!prevProps.onEdit;\r\n const canEdit = isReady && isVisted && !!onEdit;\r\n if (!prevCanEdit && canEdit) {\r\n this.focusOnEditButton();\r\n this.scrollToTitle();\r\n }\r\n\r\n // Set the focus to the first focusable element\r\n // (It happens when current step switch to isUpdating status)\r\n if (prevProps.isReady && !isReady) {\r\n this.focusOnFirstFocusableElement();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n title,\r\n disabled,\r\n isExpanded,\r\n isActive,\r\n isVisted,\r\n children,\r\n isReady,\r\n isPending,\r\n isUpdating,\r\n hasInitialized,\r\n hasControlGroup,\r\n onEdit,\r\n resource\r\n } = this.props;\r\n const { changeBtnLabel } = resource;\r\n\r\n const canEdit = hasControlGroup && isReady && isVisted && onEdit;\r\n\r\n return (\r\n \r\n
\r\n {this.getTitle()}\r\n\r\n {canEdit && (\r\n \r\n {changeBtnLabel}\r\n \r\n )}\r\n
\r\n\r\n \r\n
{children}
\r\n\r\n {this.renderFooder()}\r\n \r\n \r\n );\r\n }\r\n\r\n private renderFooder = (): JSX.Element | null => {\r\n const {\r\n title,\r\n isVisted,\r\n isReady,\r\n isSubmitting,\r\n invalidAddressForCartProducts,\r\n loggedInUserNewAddress,\r\n isFirstAddress,\r\n InvalidAddressMsg,\r\n notBtPostCodeForPlants,\r\n isCancelAllowed,\r\n hasControlGroup,\r\n onCancel,\r\n onSubmit,\r\n resource\r\n } = this.props;\r\n const { saveBtnLabel, cancelBtnLabel, saveAndContinueBtnLabel } = resource;\r\n\r\n const canSubmit = !isReady && onSubmit;\r\n const canCancel = !isReady && isVisted && isCancelAllowed && onCancel;\r\n if (!hasControlGroup || (!canSubmit && !canCancel)) {\r\n return null;\r\n }\r\n /* VSI Customization - START - 08/02/21\r\n Hide Confirm button payment section */\r\n const isPaymentSection = title && title.text.toLowerCase().indexOf('payment') > -1;\r\n // Disable confirm & proceed for post code restriction case\r\n let postCodeRestricted = !isFirstAddress && (invalidAddressForCartProducts || notBtPostCodeForPlants); // Button will be enabled if user enters address for first time or it is guest user (But error will be shown)\r\n if (loggedInUserNewAddress) {\r\n // Button will be enabled if loggedIn user enters NEW/Another address (But error will be shown)\r\n // In this case, as both shipping address & delivery options sections are opened so we'll not enable delivery options button but only shipping address\r\n postCodeRestricted = invalidAddressForCartProducts;\r\n }\r\n /* VSI Customization - END */\r\n return (\r\n
\r\n {notBtPostCodeForPlants && (\r\n \r\n {InvalidAddressMsg}\r\n \r\n )}\r\n
\r\n {canSubmit && !isPaymentSection && (\r\n \r\n {/* isVisted && isCancelAllowed ? saveBtnLabel : */ saveAndContinueBtnLabel}\r\n \r\n )}\r\n {canCancel && (\r\n \r\n )}\r\n
\r\n
\r\n );\r\n };\r\n\r\n private focusOnFirstFocusableElement = (): void => {\r\n const node = ReactDOM.findDOMNode(this) as HTMLElement;\r\n const focussableElements = `\r\n a:not([disabled]),\r\n button:not([disabled]),\r\n input[type=submit]:not([disabled]),\r\n input[type=checkbox]:not([disabled]),\r\n input[type=text]:not([disabled]),\r\n input[type=radio]:not([disabled]),\r\n input[type=password]:not([disabled]),\r\n select:not([disabled]),\r\n textarea:not([disabled]),\r\n [tabindex]:not([disabled]):not([tabindex=\"-1\"])\r\n `;\r\n\r\n const child = node && node.querySelector && (node.querySelector(focussableElements) as HTMLElement);\r\n child && child.focus && child.focus();\r\n };\r\n\r\n private focusOnEditButton = (): void => {\r\n // Focus on edit button\r\n const editButton =\r\n this.editButtonRef &&\r\n this.editButtonRef.current &&\r\n this.editButtonRef.current.focus &&\r\n (this.editButtonRef.current as HTMLElement);\r\n editButton && editButton.focus();\r\n };\r\n\r\n private scrollToTitle = (): void => {\r\n // scroll window to the title of the step that was just completed only in mobile viewport\r\n const formCard = this.props.isMobile && this.formCardRef && this.formCardRef.current && (this.formCardRef.current as HTMLElement);\r\n formCard && formCard.scrollIntoView();\r\n };\r\n\r\n private getTitle = (): JSX.Element => {\r\n const { title } = this.props;\r\n const { headingTag: Tag = 'h2', text = '' } = title || {};\r\n return (\r\n \r\n {/* VSI Customization - START - 19/11/20\r\n Display heading of just 1st & 3rd step */}\r\n {text && {text}}\r\n {/* VSI Customization - END */}\r\n \r\n );\r\n };\r\n}\r\n\r\nexport default CheckoutGuidedCard;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/ //\r\nimport { IModuleStateManager } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { Heading } from '@msdyn365-commerce-modules/data-types';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport get from 'lodash/get';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IBreadCrumbsRootData } from '../../../definition-extensions/checkout.ext.props.autogenerated';\r\nimport GuidedCard from './guided-card';\r\n\r\nexport interface ICheckoutGuidedFormProps {\r\n items: React.ReactNode[];\r\n moduleState: IModuleStateManager;\r\n disableGuidedCheckoutFlow?: boolean;\r\n\r\n /* VSI Customization - START */\r\n isMobile?: boolean;\r\n isEditor?: boolean;\r\n rootLink?: IBreadCrumbsRootData;\r\n breadCrumbsText?: string[];\r\n placeOrderBtn?: React.ReactElement;\r\n invalidAddressForCartProducts?: boolean;\r\n notBtPostCodeForPlants?: boolean;\r\n postCodeRestrictionMsg?: string;\r\n isFirstAddress?: boolean;\r\n loggedInUserNewAddress?: boolean;\r\n /* VSI Customization - END */\r\n\r\n resource: {\r\n checkoutStepTitleFormat: string;\r\n saveBtnLabel: string;\r\n changeBtnLabel: string;\r\n cancelBtnLabel: string;\r\n saveAndContinueBtnLabel: string;\r\n };\r\n}\r\n\r\ninterface ICheckoutGuidedFormState {\r\n currentStep: number;\r\n /* VSI Customization - START */\r\n activeView: number;\r\n currentCheckoutView: number;\r\n checkoutModulesCount: number;\r\n isClickCollectOnly: boolean;\r\n saveClicked: boolean;\r\n openedStep: number;\r\n count: number;\r\n addressSavedAlready: boolean;\r\n /* VSI Customization - END */\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuidedForm component\r\n * @extends {React.Component}\r\n */\r\n@observer\r\nclass CheckoutGuidedForm extends React.Component {\r\n public state: ICheckoutGuidedFormState = {\r\n currentStep: 0,\r\n activeView: 0,\r\n currentCheckoutView: 1,\r\n checkoutModulesCount: 0,\r\n isClickCollectOnly: false,\r\n saveClicked: false,\r\n count: 0,\r\n openedStep: 0,\r\n addressSavedAlready: false\r\n };\r\n public stepsToSkip: number = 0;\r\n\r\n public componentDidMount(): void {\r\n /**\r\n * Append child modules\r\n */\r\n const childIds = this.props.items.map((item: React.ReactNode) => get(item, 'props.id'));\r\n this.props.moduleState.init({ childIds });\r\n /* VSI Customization - START */\r\n const { items } = this.props;\r\n let checkoutItems = 0;\r\n let isClickCollect = false;\r\n items.map((item: React.ReactNode, index: number) => {\r\n const childId = this.getId(item);\r\n const state = this.props.moduleState.getModule(childId);\r\n const { isDisabled } = state || ({} as IModuleStateManager);\r\n if (isDisabled) {\r\n this.stepsToSkip += 1;\r\n isClickCollect = true;\r\n } else {\r\n if (childId.includes('text-block')) {\r\n checkoutItems = checkoutItems;\r\n } else {\r\n checkoutItems++;\r\n }\r\n }\r\n });\r\n /* As in case of click & collect we must skip 2 steps or not have to skip any step in case of hybrid or only shipping items. So, stepsToSkip must be equal to either 2 or 0 */\r\n if (this.stepsToSkip === 1) {\r\n this.stepsToSkip++;\r\n checkoutItems--;\r\n }\r\n this.setState({\r\n currentStep: this.stepsToSkip,\r\n activeView: this.stepsToSkip,\r\n currentCheckoutView: this.stepsToSkip < 2 ? 1 : 2,\r\n checkoutModulesCount: checkoutItems,\r\n isClickCollectOnly: isClickCollect\r\n });\r\n /* VSI Customization - END */\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n moduleState,\r\n items,\r\n placeOrderBtn,\r\n resource,\r\n isFirstAddress,\r\n loggedInUserNewAddress,\r\n invalidAddressForCartProducts,\r\n notBtPostCodeForPlants,\r\n postCodeRestrictionMsg\r\n } = this.props;\r\n const { currentCheckoutView, isClickCollectOnly } = this.state;\r\n if (!items || !moduleState) {\r\n return null;\r\n }\r\n return (\r\n <>\r\n {/* VSI Customization - START */}\r\n {this._displayBreadCrumbs()}\r\n \r\n {items &&\r\n items.map((item: React.ReactNode, index: number) => {\r\n const childId = this.getId(item);\r\n const step = this.getStep(childId);\r\n const title = this.getHeading(item);\r\n const state = this.props.moduleState.getModule(childId);\r\n const {\r\n isReady,\r\n isPending,\r\n isUpdating,\r\n isDisabled,\r\n isCancelAllowed,\r\n onEdit,\r\n onCancel,\r\n onSubmit,\r\n hasModuleState,\r\n hasInitialized\r\n } = state || ({} as IModuleStateManager);\r\n\r\n /* VSI Customization - START */\r\n // Check if its delivery options modules & isPostCodeRestricted true, disable its confirm & proceed button\r\n const disableDeliveryOptionsBtn =\r\n invalidAddressForCartProducts && index === 1 && !isClickCollectOnly ? true : false;\r\n // Check if it is shipping address section and user added other than BT postcode for plants (if any), disable confirm & proceed button\r\n const disableShippingAddressBtn = notBtPostCodeForPlants && index === 0 && !isClickCollectOnly ? true : false;\r\n\r\n const _hidden = (currentCheckoutView === 1 && index < 2) || (currentCheckoutView === 2 && index >= 2);\r\n const addressConfirmed = step === 1 && isUpdating ? true : false; // Updated address again and delivery section is opened\r\n const onNextFunction = this.onNext(addressConfirmed, this.state.saveClicked);\r\n /* VSI Customization - END */\r\n\r\n return (\r\n <>\r\n \r\n \r\n );\r\n })}\r\n \r\n {/* VSI Customization - START - 27/11/20 */}\r\n {this.isLastStep() && placeOrderBtn}\r\n {/* VSI Customization - END */}\r\n \r\n );\r\n }\r\n\r\n /* VSI Customization - START */\r\n private _onSubmit = (onSubmit: (() => void) | undefined, step: number) => () => {\r\n onSubmit && onSubmit();\r\n const { openedStep, addressSavedAlready } = this.state;\r\n if (!this.state.isClickCollectOnly) {\r\n if (step === 0 && addressSavedAlready) {\r\n this.setState({\r\n currentStep: 1,\r\n activeView: 1,\r\n currentCheckoutView: 1,\r\n saveClicked: true,\r\n openedStep: openedStep + 1\r\n });\r\n } else if (step === 1) {\r\n this.setState({\r\n saveClicked: false,\r\n addressSavedAlready: true\r\n });\r\n }\r\n }\r\n };\r\n private _displayBreadCrumbs = (): React.ReactElement => {\r\n const { items, rootLink, breadCrumbsText } = this.props;\r\n const { activeView, checkoutModulesCount, isClickCollectOnly } = this.state;\r\n const rootLinkData: Msdyn365.ILinksData = {\r\n ariaLabel: rootLink && rootLink.ariaLabel,\r\n className: 'ms-breadcrumb_link-root',\r\n linkText: rootLink && rootLink.linkText,\r\n linkUrl: rootLink && rootLink.linkUrl.destinationUrl,\r\n openInNewTab: rootLink && rootLink.openInNewTab,\r\n role: 'link'\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {rootLink && }\r\n \r\n {breadCrumbsText &&\r\n items.map((item: React.ReactNode, index: number) => {\r\n const childId = this.getId(item);\r\n const state = this.props.moduleState.getModule(childId);\r\n const { isDisabled } = state || ({} as IModuleStateManager);\r\n\r\n const breadCrumbText = breadCrumbsText[index];\r\n const breadCrumbLink: Msdyn365.ILinksData = {\r\n className: 'ms-breadcrumb_link',\r\n linkText: breadCrumbText,\r\n role: 'link',\r\n onClick: this.gotoSelectedModule(item, isClickCollectOnly)\r\n };\r\n // isDisbaled = true for hidden items in case of click and collect only\r\n // const lastIndex = isClickCollectOnly ? checkoutModulesCount + 1 : checkoutModulesCount - 1;\r\n const lastIndex = isClickCollectOnly ? checkoutModulesCount + 2 : checkoutModulesCount;\r\n if (index <= activeView && (isClickCollectOnly && index === 0 ? false : isDisabled === false)) {\r\n return index === activeView || index === lastIndex ? (\r\n \r\n {breadCrumbText}\r\n \r\n ) : (\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n })}\r\n \r\n \r\n );\r\n };\r\n\r\n private gotoSelectedModule = (item: React.ReactNode, isClickCollectOnly: boolean) => {\r\n return () => {\r\n const childId = this.getId(item);\r\n let selectedModuleStep = this.getStep(childId);\r\n selectedModuleStep = isClickCollectOnly === true ? selectedModuleStep + 2 : selectedModuleStep;\r\n const state = this.props.moduleState.getModule(childId);\r\n const { onEdit } = state || ({} as IModuleStateManager);\r\n onEdit ? onEdit() : null;\r\n this.setState({\r\n currentStep: selectedModuleStep,\r\n activeView: selectedModuleStep,\r\n currentCheckoutView: selectedModuleStep < 2 ? 1 : 2,\r\n count: 0\r\n });\r\n };\r\n };\r\n /* VSI Customization - END */\r\n private getEnabledModules = (): string[] => {\r\n const {\r\n moduleState: { childIds, getModule }\r\n } = this.props;\r\n return childIds.filter((childId: string) => {\r\n const state = getModule(childId);\r\n return !!state && !state.isDisabled;\r\n });\r\n };\r\n\r\n private getStep = (id: string): number => {\r\n return this.getEnabledModules().indexOf(id);\r\n };\r\n\r\n private getId = (item: React.ReactNode): string => {\r\n return get(item, 'props.id') || '';\r\n };\r\n\r\n private getHeading = (item: React.ReactNode): Heading => {\r\n return get(item, 'props.config.heading') || '';\r\n };\r\n\r\n private isExpanded = (step: number): boolean => {\r\n if (this.props.isEditor) {\r\n return true;\r\n }\r\n if (this.state.isClickCollectOnly) {\r\n // As first 2 modules will not be shown in case of click and collect\r\n return step > -1 && step <= this.state.currentStep - 2;\r\n }\r\n return step > -1 && step <= this.state.currentStep;\r\n };\r\n\r\n private isActive = (step: number): boolean => {\r\n return step + this.stepsToSkip === this.state.activeView;\r\n };\r\n\r\n private isVisted = (step: number): boolean => {\r\n return step > -1 && step < this.state.openedStep;\r\n };\r\n\r\n private isLastStep = (): boolean => {\r\n const { activeView, checkoutModulesCount } = this.state;\r\n const secondStep = checkoutModulesCount - 2;\r\n return activeView >= secondStep;\r\n };\r\n\r\n private onNext = (addressConfirmed: boolean, saveClicked: boolean) => () => {\r\n /* VSI Customization - START */\r\n !saveClicked &&\r\n this.setState((prevState: ICheckoutGuidedFormState) => {\r\n return {\r\n openedStep: prevState.openedStep < 4 ? prevState.openedStep + 1 : prevState.openedStep,\r\n currentStep: addressConfirmed ? 1 : this.state.currentStep + 1,\r\n activeView: addressConfirmed ? 1 : this.state.activeView + 1,\r\n currentCheckoutView: addressConfirmed ? 1 : this.state.currentStep < 1 ? 1 : 2,\r\n count: prevState.count + 1\r\n };\r\n });\r\n /* VSI Customization - END */\r\n };\r\n}\r\n\r\nexport default CheckoutGuidedForm;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n// tslint:disable:max-func-body-length\r\nimport {\r\n ICheckoutViewProps,\r\n ILineItem,\r\n ILineItemDeliveryGroup,\r\n ILineItems,\r\n IOrderSummary,\r\n IPickUpAtStore\r\n} from '@msdyn365-commerce-modules/checkout/src/modules/checkout/./checkout';\r\n\r\nimport { Alert, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CartLine, ProductSearchCriteria, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport get from 'lodash/get';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { ICheckoutModulesSharedState } from '../../../actions/checkout-modules-state-share';\r\nimport { getSearchByCriteriaAsync, GetSearchByCriteriaInput } from '../../dobbies/actions/search-by-criteria';\r\nimport { ICheckoutProps } from '../definition-extensions/checkout.ext.props.autogenerated';\r\nimport { getRestrictedProducts } from '../utilities/post-code-restriction/get-restricted-products';\r\nimport { ICheckoutData } from './checkout.data';\r\nimport GuidedFormComponent, { ICheckoutGuidedFormProps } from './components/checkout/guided-form';\r\n/* VSI Customization - START - 19/04/21\r\n * Following interface is used to pass product related info to LineItem component\r\n * to display error message for post code restriction */\r\ninterface IProductsDeliveryDetails {\r\n postCodeValidation?: ICheckoutModulesSharedState;\r\n cartLines?: CartLine[];\r\n plantProductsIds?: number[];\r\n postCodeErrorMsg?: string;\r\n}\r\ninterface IProductDeliveryInfo {\r\n plantPostCodeInfo?: IProductsDeliveryDetails;\r\n}\r\n/* VSI Customization - END */\r\n\r\nexport const PickUpAtStoreComponent: React.FC = ({ PickUpAtStore, label, location }) => (\r\n \r\n {label}\r\n {location}\r\n \r\n);\r\n\r\nexport const LineItemComponent: React.FC = ({\r\n LineItem,\r\n item,\r\n LineId,\r\n pickUpAtStore,\r\n cartLines,\r\n plantProductsIds,\r\n postCodeErrorMsg,\r\n postCodeValidation\r\n}) => {\r\n /* VSI Customization - START - 19/04/21 - Display error msg against cartlines incase of post code retriction error */\r\n let postCodeError = <>;\r\n\r\n if (!pickUpAtStore && (postCodeValidation?.invalidAddressForCartProducts || postCodeValidation?.notBtPostCode)) {\r\n // First find this cartLine Id in cartLines to get its product Id\r\n const cartLine = cartLines?.find(cartLineItem => {\r\n return cartLineItem.LineId === LineId;\r\n });\r\n const cartLineProductId = cartLine?.ProductId;\r\n // Now check if it is plant then show the message\r\n const isPlantProduct = plantProductsIds?.find(productId => productId === cartLineProductId);\r\n postCodeError = isPlantProduct ? (\r\n 0)} color='danger' assertive={true}>\r\n {postCodeErrorMsg}\r\n \r\n ) : (\r\n postCodeError\r\n );\r\n }\r\n /* VSI Customization - END */\r\n return (\r\n <>\r\n \r\n {item}\r\n \r\n {postCodeError}\r\n \r\n {pickUpAtStore && }\r\n \r\n \r\n );\r\n};\r\n\r\nexport const LineItemGroupComponent: React.FC = ({\r\n LineItemDeliveryGroup,\r\n LineItemList,\r\n heading,\r\n lineItems,\r\n cartLines,\r\n plantProductsIds,\r\n postCodeValidation,\r\n postCodeErrorMsg\r\n}) => (\r\n \r\n {heading}\r\n \r\n {lineItems.map(lineItem => (\r\n \r\n ))}\r\n \r\n \r\n);\r\n\r\nexport const LineItemsComponent: React.FC = ({\r\n LineItems,\r\n Header,\r\n heading,\r\n editLink,\r\n itemsForPickup,\r\n itemsForShip,\r\n plantPostCodeInfo\r\n}) => (\r\n \r\n \r\n {heading}\r\n {editLink}\r\n \r\n {itemsForPickup && }\r\n {itemsForShip && }\r\n \r\n);\r\n\r\n//Customization removed because its now available out of the box in .29 version\r\n// // const OrderSummaryComponent: React.FC = ({ heading, lines}, {_checkoutCart}) => (\r\n// export const _renderOrderSummarylines = (orderSummary: IOrderSummary, props: ICheckoutProps<{}>): JSX.Element | null => {\r\n// // let a = _cart;\r\n// // const taxAmount = props.cart && props.cart.cart.TaxAmount || 0;\\\r\n// // @ts-ignore\r\n// const shippingAmount = props.data && props.data.checkout.result._checkoutCart._cart.ShippingChargeAmount;\r\n// // @ts-ignore\r\n// const subtotalAmount = props.data && props.data.checkout.result._checkoutCart._cart.SubtotalAmount;\r\n// // @ts-ignore\r\n// const subtotalSalesAmount = props.data && props.data.checkout.result._checkoutCart._cart.SubtotalSalesAmount;\r\n\r\n// const modifiedSubtoalAmount: number = Number(shippingAmount) + (Number(subtotalAmount) - subtotalSalesAmount);\r\n\r\n// /* VSI Customization - START*/\r\n// // @ts-ignore\r\n// const shippingDefaultText = props.data.checkout.result._checkoutCart._cart.DeliveryMode !== '' ? '£0.00' : 'To Be calculated';\r\n// const shippingText = shippingAmount > 0 ? `£${modifiedSubtoalAmount.toFixed(2)}` : shippingDefaultText;\r\n// /* VSI Customization - END*/\r\n\r\n// return (\r\n//
\r\n// {orderSummary.heading}\r\n//
\r\n// {orderSummary.lines && (\r\n// /* VSI Customization - START*/\r\n// // TODO: need to fix harcoded values\r\n// // Customization Reason: Subtotal amount is adding shipping charges\r\n// <>\r\n//

\r\n// {'Sub Total'}\r\n// \r\n// {`£${subtotalSalesAmount.toFixed(2)}`}\r\n// \r\n//

\r\n//

\r\n// {'Home Delivery'}\r\n// \r\n// {shippingText}\r\n// \r\n//

\r\n// {orderSummary.lines.otherCharge}\r\n// {orderSummary.lines.loyalty}\r\n// {orderSummary.lines.giftCard}\r\n// {orderSummary.lines.orderTotal}\r\n// \r\n// /* VSI Customization - END */\r\n// )}\r\n//
\r\n//
\r\n// );\r\n// };\r\n/* VSI Customization - START - 18/11/20 */\r\nconst getSlotItems = (key: string, props: ICheckoutViewProps): React.ReactNode[] => {\r\n const { slots } = props;\r\n return slots && slots[key] && slots[key].length ? slots[key] : [];\r\n};\r\n\r\nconst getId = (item: React.ReactNode): string => {\r\n return get(item, 'props.id') || '';\r\n};\r\n\r\n// Following function gets product attributes and set in state\r\nconst _getProductAttributes = async (\r\n ctx: IActionContext,\r\n products: SimpleProduct[],\r\n setPlantProducts: React.Dispatch>\r\n) => {\r\n // Filter plants products and send it to LineItems Component to display error msg against it incase postcode is not valid\r\n const productIds: number[] = [];\r\n products.map(product => productIds.push(product.RecordId));\r\n\r\n const callerContext = ctx;\r\n const {\r\n requestContext: {\r\n apiSettings: { channelId, catalogId }\r\n }\r\n } = ctx;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = { ChannelId: channelId, CatalogId: catalogId };\r\n searchCriteriaInput.Ids = productIds;\r\n searchCriteriaInput.IncludeAttributes = true;\r\n\r\n const actionInput: GetSearchByCriteriaInput = {\r\n productIds: productIds,\r\n context: callerContext,\r\n pageType: 'checkout',\r\n dataCacheType: () => 'application' || 'request',\r\n getCacheKey: () => 'postCodeRestriction',\r\n getCacheObjectType: () => 'postCodeRestriction'\r\n };\r\n const productsSearchResult = await getSearchByCriteriaAsync(actionInput, callerContext);\r\n\r\n const plantsProducts: number[] = await getRestrictedProducts(productsSearchResult, ctx.requestContext.apiSettings.baseUrl);\r\n\r\n // Store plant product RecordIds in state\r\n setPlantProducts(plantsProducts);\r\n};\r\n/* VSI Customization - END */\r\nconst OrderSummaryComponent: React.FC = ({ heading, lines }) => (\r\n
\r\n {heading}\r\n
\r\n {lines && (\r\n <>\r\n {lines.subtotal}\r\n {lines.shipping}\r\n {lines.otherCharge}\r\n {lines.tax}\r\n {lines.loyalty}\r\n {lines.giftCard}\r\n {lines.orderTotal}\r\n \r\n )}\r\n
\r\n
\r\n);\r\nconst CheckoutView: React.FC & ICheckoutGuidedFormProps> = props => {\r\n const {\r\n config: { breadCrumbsRoot, breadCrumbs, postCodeErrorMsgForShippingAddress, postCodeErrorMsgForCartLines },\r\n context: { actionContext },\r\n canShow,\r\n checkoutProps,\r\n headerProps,\r\n hasSalesOrder,\r\n bodyProps,\r\n mainProps,\r\n sideProps,\r\n orderConfirmation,\r\n loading,\r\n alert,\r\n title,\r\n orderSummary,\r\n lineItems,\r\n resources,\r\n placeOrderButton,\r\n data: {\r\n checkoutModulesSharedState: { result: checkoutModulesSharedState }\r\n }\r\n } = props;\r\n\r\n const checkout = props.data.checkout?.result;\r\n /* VSI Customization - START - 18/11/20 */\r\n const [plantProducts, setPlantProducts] = useState();\r\n useEffect(() => {\r\n if (!plantProducts) {\r\n props.data.products.then(productss => {\r\n _getProductAttributes(actionContext, productss, setPlantProducts).catch(error => props.telemetry.trace(error));\r\n });\r\n }\r\n });\r\n const items = getSlotItems('checkoutInformation', props);\r\n let creditBannerFound = false;\r\n let creditBanner: React.ReactNode = <>;\r\n const checkoutItems = items;\r\n // store text block in credit-banner\r\n items &&\r\n items.map(item => {\r\n if (creditBannerFound === false) {\r\n const childId = getId(item);\r\n if (childId.includes('text-block')) {\r\n creditBanner = item;\r\n creditBannerFound = true;\r\n }\r\n }\r\n });\r\n const creditBannerSection = creditBanner && React.cloneElement(creditBanner as React.ReactElement);\r\n\r\n // Customization for Post code restriction to display msg against cartLine\r\n const cartLines = checkout && checkout.checkoutCart.cart.CartLines;\r\n\r\n const plantPostCodeInfoObject: IProductDeliveryInfo | undefined = {\r\n plantPostCodeInfo: {\r\n postCodeValidation: {\r\n invalidAddressForCartProducts: checkoutModulesSharedState?.invalidAddressForCartProducts,\r\n notBtPostCode: checkoutModulesSharedState?.notBtPostCode\r\n },\r\n cartLines: cartLines,\r\n plantProductsIds: plantProducts,\r\n postCodeErrorMsg: postCodeErrorMsgForCartLines\r\n }\r\n };\r\n\r\n const { isAuthenticated } = props.context.request.user;\r\n /* VSI Customization - END - 30/11/20 */\r\n return (\r\n \r\n {!hasSalesOrder && {title}}\r\n {!hasSalesOrder && (\r\n \r\n {loading}\r\n {alert}\r\n {canShow && (\r\n <>\r\n \r\n {/* VSI Customization - START - 18/11/20 */}\r\n \r\n {/* VSI Customization - END */}\r\n \r\n \r\n {orderSummary && }\r\n {/* {orderSummary && _renderOrderSummarylines(orderSummary, props)} */}\r\n
\r\n

Do you need help with this order?

\r\n

You can contact Customer Service here

\r\n
\r\n {!isAuthenticated && creditBannerSection && (\r\n \r\n {creditBannerSection}\r\n \r\n )}\r\n {lineItems && }\r\n
\r\n \r\n )}\r\n
\r\n )}\r\n {placeOrderButton}\r\n {hasSalesOrder && orderConfirmation}\r\n
\r\n );\r\n};\r\n\r\nexport default CheckoutView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n// tslint:disable: max-func-body-length\r\n\r\nimport {\r\n ICheckoutViewProps,\r\n ILineItem,\r\n ILineItemDeliveryGroup,\r\n ILineItems,\r\n IOrderSummary,\r\n IPickUpAtStore\r\n} from '@msdyn365-commerce-modules/checkout/src/modules/checkout/./checkout';\r\nimport { updateCustomerAttributes, updateCustomerAttributesInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ITelemetryContent, Module, Node, Waiting } from '@msdyn365-commerce-modules/utilities';\r\nimport { AttributeDefinition, CartLine, Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport get from 'lodash/get';\r\nimport * as React from 'react';\r\nimport { ICheckoutProps } from '../definition-extensions/checkout.ext.props.autogenerated';\r\nimport { ICheckoutData } from './checkout.data';\r\nimport GuidedFormComponent, { ICheckoutGuidedFormProps } from './components/checkout/guided-form';\r\n\r\nexport interface IOrderSummaryCartLineItems {\r\n cartLines: CartLine[] | undefined;\r\n formattedPrice: string | undefined;\r\n clubPlusText: string;\r\n clubPlusTrialText: string;\r\n}\r\n\r\nexport const PickUpAtStoreComponent: React.FC = ({ PickUpAtStore, label, location }) => (\r\n \r\n {label}\r\n {location}\r\n \r\n);\r\n\r\nexport const LineItemComponent: React.FC = ({ LineItem, item, pickUpAtStore }) => {\r\n return (\r\n \r\n {item}\r\n {pickUpAtStore && }\r\n \r\n );\r\n};\r\n\r\nexport interface ICheckoutPlaceOrderButtonProps {\r\n canPlaceOrder: boolean;\r\n checkoutBtnText: string;\r\n telemetryContent?: ITelemetryContent;\r\n placeOrder(): Promise;\r\n}\r\n\r\nexport const LineItemGroupComponent: React.FC = ({ LineItemDeliveryGroup, LineItemList, heading, lineItems }) => (\r\n \r\n {heading}\r\n \r\n {lineItems.map(lineItem => (\r\n \r\n ))}\r\n \r\n \r\n);\r\n\r\nexport const LineItemsComponent: React.FC = ({ LineItems, Header, heading, editLink, itemsForPickup, itemsForShip }) => (\r\n \r\n \r\n {heading}\r\n {editLink}\r\n \r\n {itemsForPickup && }\r\n {itemsForShip && }\r\n \r\n);\r\n\r\nconst OrderSummaryComponent: React.FC = props => {\r\n const { heading, lines, formattedPrice, clubPlusText, clubPlusTrialText } = props;\r\n\r\n // const cartLine = cartLines && cartLines[0];\r\n return (\r\n
\r\n {heading}\r\n
\r\n {lines && (\r\n <>\r\n
\r\n {/* Display Club Plus Trial Text if Total Price is 0 */}\r\n {formattedPrice === '£0.00' || formattedPrice === '£0.01' ? clubPlusTrialText : clubPlusText}\r\n {formattedPrice}\r\n
\r\n {lines.subtotal}\r\n {lines.shipping}\r\n {lines.otherCharge}\r\n {lines.loyalty}\r\n {lines.giftCard}\r\n {lines.orderTotal}\r\n \r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\n/* VSI Customization - START - 18/11/20 */\r\nconst getSlotItems = (key: string, props: ICheckoutViewProps): React.ReactNode[] => {\r\n const { slots } = props;\r\n return slots && slots[key] && slots[key].length ? slots[key] : [];\r\n};\r\n\r\nconst getId = (item: React.ReactNode): string => {\r\n return get(item, 'props.id') || '';\r\n};\r\n/* VSI Customization - END */\r\n// tslint:disable-next-line: max-func-body-length\r\n\r\nconst CheckoutView: React.FC & ICheckoutGuidedFormProps> = props => {\r\n const {\r\n canShow,\r\n checkoutProps,\r\n headerProps,\r\n hasSalesOrder,\r\n bodyProps,\r\n mainProps,\r\n sideProps,\r\n termsAndConditionsProps,\r\n orderConfirmation,\r\n loading,\r\n alert,\r\n title,\r\n orderSummary,\r\n placeOrderButton,\r\n termsAndConditions,\r\n resources,\r\n mainControlProps,\r\n resources: { clubPlusText, clubPlusTrialText },\r\n config: { breadCrumbsRoot, breadCrumbs }\r\n } = props;\r\n\r\n const [attributes, setAttributes] = React.useState();\r\n const [customer, setCustomer] = React.useState();\r\n\r\n const [isDDRP, setIsDDRP] = React.useState(true);\r\n const cartLines: CartLine[] | undefined = props.data.checkout?.result?.checkoutCart.cart.CartLines;\r\n const price = cartLines && cartLines[0] && cartLines[0].Price;\r\n\r\n const handleUpdateAttributes = async () => {\r\n const newAttributes = customer!.Attributes!.map(attr => {\r\n let newAttrValue = { ...attr.AttributeValue };\r\n if (attr.Name === 'Direct Debit') {\r\n newAttrValue = { ...attr.AttributeValue, StringValue: isDDRP ? 'DDRP' : 'None' };\r\n }\r\n\r\n return { ...attr, AttributeValue: newAttrValue };\r\n });\r\n const input = new updateCustomerAttributesInput(\r\n customer!.AccountNumber,\r\n newAttributes || [],\r\n props.context.request.apiSettings,\r\n customer!.Phone,\r\n customer!.VatNumber\r\n );\r\n await updateCustomerAttributes(input, props.context.actionContext);\r\n };\r\n\r\n let formattedPrice: number | string | undefined;\r\n /* VSI Customization - START - 24/08/21 */\r\n\r\n if (price === 0) {\r\n formattedPrice = '£0.00';\r\n } else {\r\n formattedPrice = price && props.context.cultureFormatter.formatCurrency(price, props.context.request.channel?.Currency);\r\n }\r\n\r\n /* VSI Customization - END - 24/08/21 */\r\n\r\n /* VSI Customization - START - 18/11/20 */\r\n const items = getSlotItems('checkoutInformation', props);\r\n let creditBannerFound = false;\r\n let creditBanner: React.ReactNode = <>;\r\n const checkoutItems = items;\r\n // store text block in credit-banner\r\n\r\n React.useEffect(() => {\r\n setAttributes(props.data.attributeDefinitions.result!);\r\n setCustomer(props.data.customerInformation.result!);\r\n }, []);\r\n\r\n items &&\r\n items.map(item => {\r\n if (creditBannerFound === false) {\r\n const childId = getId(item);\r\n if (childId.includes('text-block')) {\r\n creditBanner = item;\r\n creditBannerFound = true;\r\n }\r\n }\r\n });\r\n const creditBannerSection = creditBanner && React.cloneElement(creditBanner as React.ReactElement);\r\n // @ts-ignore\r\n const termsAndPlaceOrder: React.ReactElement = (\r\n <>\r\n
\r\n {termsAndConditions}\r\n {placeOrderButton}\r\n
\r\n \r\n );\r\n /* VSI Customization - END - 30/11/20 */\r\n if (!props.context.request.user.isAuthenticated) {\r\n const signinURL = props.context.request.user.signInUrl;\r\n window.location.assign(signinURL!);\r\n }\r\n if (!props.context.request.user.isAuthenticated) {\r\n return (\r\n
\r\n
\r\n \r\n {props.resources.authenticationMessage}\r\n
\r\n
\r\n );\r\n } else {\r\n return (\r\n \r\n {!hasSalesOrder && {title}}\r\n {!hasSalesOrder && (\r\n \r\n {loading}\r\n {alert}\r\n {canShow && (\r\n <>\r\n \r\n {/* VSI Customization - START - 18/11/20 */}\r\n {\r\n , // Removing place order button for single payment\r\n attributes: attributes,\r\n setIsDDRP: setIsDDRP,\r\n isDDRP: isDDRP,\r\n customer: customer!,\r\n context: props.context\r\n }}\r\n />\r\n }\r\n {/* VSI Customization - END */}\r\n \r\n \r\n {orderSummary && (\r\n \r\n )}\r\n\r\n {creditBannerSection && (\r\n \r\n {creditBannerSection}\r\n \r\n )}\r\n {/* VSI-Customization -- START Don't need LineItems ATM */}\r\n {/* {lineItems && } */}\r\n {/* VSI-Customization -- END */}\r\n \r\n \r\n )}\r\n \r\n )}\r\n {placeOrderButton}\r\n {hasSalesOrder && orderConfirmation}\r\n \r\n );\r\n }\r\n};\r\n\r\nexport default CheckoutView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/ //\r\nimport { Heading as HeadingType } from '@msdyn365-commerce-modules/data-types';\r\nimport { Button } from '@msdyn365-commerce-modules/utilities';\r\nimport { AttributeDefinition, Customer } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { IDictionary } from '@msdyn365-commerce/retail-proxy';\r\nimport ReactDOM from 'react-dom';\r\n\r\nexport interface ICheckoutGuidedCardProps {\r\n step: number;\r\n title?: HeadingType;\r\n disabled?: boolean; // module is not available\r\n isActive?: boolean; // step === currentStep\r\n isVisted?: boolean; // step < currentStep\r\n isExpanded?: boolean;\r\n isReady?: boolean;\r\n isPending?: boolean;\r\n isUpdating?: boolean;\r\n isSubmitting?: boolean;\r\n isCancelAllowed?: boolean;\r\n isMobile?: boolean;\r\n hasInitialized?: boolean;\r\n hasControlGroup?: boolean;\r\n attributeDefinitions: AttributeDefinition[] | undefined;\r\n setIsDDRP: React.Dispatch>;\r\n isDDRP: boolean;\r\n customer: Customer;\r\n children: React.ReactNode;\r\n resource: {\r\n checkoutStepTitleFormat: string;\r\n saveBtnLabel: string;\r\n changeBtnLabel: string;\r\n cancelBtnLabel: string;\r\n saveAndContinueBtnLabel: string;\r\n reoccuringPaymentAttribute: string;\r\n };\r\n onEdit?(): void;\r\n onCancel?(): void;\r\n onSubmit?(): void;\r\n onNext(): void;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuidedCard component\r\n * @extends {React.Component}\r\n */\r\n\r\nexport interface ICheckoutGuidedCardState extends React.ComponentState {\r\n editAttributes: boolean;\r\n attributes: AttributeDefinition[];\r\n attributeError: IDictionary;\r\n customerHasAttributes: boolean;\r\n defaultRender: boolean;\r\n}\r\n\r\nexport interface IReccurentPaymentAttributeData {\r\n attributeName: string;\r\n attributeLabel: string;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuidedCard component\r\n * @extends {React.Component}\r\n */\r\nclass CheckoutGuidedCard extends React.PureComponent {\r\n private editButtonRef: React.RefObject = React.createRef();\r\n private formCardRef: React.RefObject = React.createRef();\r\n\r\n constructor(props: ICheckoutGuidedCardProps) {\r\n super(props);\r\n this.state = {\r\n editAttributes: false,\r\n attributes: [],\r\n attributeError: {},\r\n customerHasAttributes: false,\r\n defaultRender: true\r\n };\r\n }\r\n\r\n public _onAttributeCheck = (value: string) => (event: React.MouseEvent) => {\r\n if (value === 'DDRP') {\r\n this.props.setIsDDRP(true);\r\n } else {\r\n this.props.setIsDDRP(false);\r\n }\r\n };\r\n\r\n public componentDidMount(): void {\r\n this.setState({\r\n attributes: this.props.attributeDefinitions!\r\n });\r\n }\r\n\r\n public componentDidUpdate(prevProps: ICheckoutGuidedCardProps): void {\r\n /**\r\n * Move to next step when current step is ready\r\n */\r\n const { isActive, isReady, onNext, isVisted, onEdit } = this.props;\r\n\r\n // Move to next step after completing the current step\r\n\r\n if (isActive && isReady) {\r\n onNext();\r\n }\r\n\r\n // Set the focus to Edit button once edit button appear\r\n // (It happens when current step switch to isReady status)\r\n const prevCanEdit = prevProps.isReady && prevProps.isVisted && !!prevProps.onEdit;\r\n const canEdit = isReady && isVisted && !!onEdit;\r\n if (!prevCanEdit && canEdit) {\r\n this.focusOnEditButton();\r\n this.scrollToTitle();\r\n }\r\n\r\n // Set the focus to the first focusable element\r\n // (It happens when current step switch to isUpdating status)\r\n if (prevProps.isReady && !isReady) {\r\n this.focusOnFirstFocusableElement();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n title,\r\n disabled,\r\n isExpanded,\r\n isActive,\r\n isVisted,\r\n children,\r\n isReady,\r\n isPending,\r\n isUpdating,\r\n hasInitialized,\r\n hasControlGroup,\r\n onEdit,\r\n resource\r\n } = this.props;\r\n const { changeBtnLabel } = resource;\r\n\r\n const canEdit = hasControlGroup && isReady && isVisted && onEdit;\r\n\r\n return (\r\n \r\n
\r\n {this.getTitle()}\r\n\r\n {canEdit && (\r\n \r\n {changeBtnLabel}\r\n \r\n )}\r\n
\r\n\r\n \r\n {/* VSI CUSTOMIZATION - START */}\r\n {/* Uncomment this for checkbox on checkout dobbiesclub */}\r\n {title && title.text && title.text === 'Payment method' && false && this._renderRecurrentPaymentSection()}\r\n\r\n {/* VSI CUSTOMIZATION - END */}\r\n\r\n
{children}
\r\n\r\n {this.renderFooder()}\r\n \r\n \r\n );\r\n }\r\n\r\n private _renderBoolean = (): JSX.Element | null | undefined => {\r\n return (\r\n
\r\n
\r\n \r\n \r\n I authorize dobbies to charge my card £12 annually\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n private _renderRecurrentPaymentSection = (): JSX.Element | null => {\r\n // props attributeCollection: IReccurentPaymentAttributeData\r\n return (\r\n
\r\n

Recurrent Payments

\r\n\r\n

We'd love for you to continue your Club Plus benefits each year. Make this easy by paying automatically each year.

\r\n\r\n {this._renderBoolean()}\r\n
\r\n );\r\n };\r\n\r\n private renderFooder = (): JSX.Element | null => {\r\n const { step, isVisted, isReady, isSubmitting, isCancelAllowed, hasControlGroup, onCancel, onSubmit, resource } = this.props;\r\n const { saveBtnLabel, cancelBtnLabel, saveAndContinueBtnLabel } = resource;\r\n\r\n const canSubmit = !isReady && onSubmit;\r\n const canCancel = !isReady && isVisted && isCancelAllowed && onCancel;\r\n\r\n if (!hasControlGroup || (!canSubmit && !canCancel)) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {canSubmit && step !== 1 && (\r\n \r\n {/* isVisted && isCancelAllowed ? saveBtnLabel : */ saveAndContinueBtnLabel}\r\n \r\n )}\r\n {canCancel && (\r\n \r\n )}\r\n
\r\n );\r\n };\r\n\r\n private focusOnFirstFocusableElement = (): void => {\r\n const node = ReactDOM.findDOMNode(this) as HTMLElement;\r\n const focussableElements = `\r\n a:not([disabled]),\r\n button:not([disabled]),\r\n input[type=submit]:not([disabled]),\r\n input[type=checkbox]:not([disabled]),\r\n input[type=text]:not([disabled]),\r\n input[type=radio]:not([disabled]),\r\n input[type=password]:not([disabled]),\r\n select:not([disabled]),\r\n textarea:not([disabled]),\r\n [tabindex]:not([disabled]):not([tabindex=\"-1\"])\r\n `;\r\n\r\n const child = node && node.querySelector && (node.querySelector(focussableElements) as HTMLElement);\r\n child && child.focus && child.focus();\r\n };\r\n\r\n private focusOnEditButton = (): void => {\r\n // Focus on edit button\r\n const editButton =\r\n this.editButtonRef &&\r\n this.editButtonRef.current &&\r\n this.editButtonRef.current.focus &&\r\n (this.editButtonRef.current as HTMLElement);\r\n editButton && editButton.focus();\r\n };\r\n\r\n private scrollToTitle = (): void => {\r\n // scroll window to the title of the step that was just completed only in mobile viewport\r\n const formCard = this.props.isMobile && this.formCardRef && this.formCardRef.current && (this.formCardRef.current as HTMLElement);\r\n formCard && formCard.scrollIntoView();\r\n };\r\n\r\n private getTitle = (): JSX.Element => {\r\n const { title } = this.props;\r\n const { headingTag: Tag = 'h2', text = '' } = title || {};\r\n return (\r\n \r\n {/* VSI Customization - START - 19/11/20\r\n Display heading of just 1st & 3rd step */}\r\n {text && {text}}\r\n {/* VSI Customization - END */}\r\n \r\n );\r\n };\r\n}\r\n\r\nexport default CheckoutGuidedCard;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/ //\r\nimport { IModuleStateManager } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { Heading } from '@msdyn365-commerce-modules/data-types';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AttributeDefinition, Customer, IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport get from 'lodash/get';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IBreadCrumbsRootData } from '../../../definition-extensions/checkout.ext.props.autogenerated';\r\nimport GuidedCard from './guided-card';\r\n\r\nexport interface ICheckoutGuidedFormProps {\r\n items: React.ReactNode[];\r\n moduleState: IModuleStateManager;\r\n disableGuidedCheckoutFlow?: boolean;\r\n isMobile?: boolean;\r\n isEditor?: boolean;\r\n rootLink?: IBreadCrumbsRootData;\r\n breadCrumbsText?: string[];\r\n placeOrderBtn?: React.ReactElement;\r\n attributes: AttributeDefinition[] | undefined;\r\n setIsDDRP: React.Dispatch>;\r\n isDDRP: boolean;\r\n customer: Customer;\r\n context: IContext;\r\n resource: {\r\n checkoutStepTitleFormat: string;\r\n saveBtnLabel: string;\r\n changeBtnLabel: string;\r\n cancelBtnLabel: string;\r\n saveAndContinueBtnLabel: string;\r\n reoccuringPaymentAttribute: string;\r\n };\r\n}\r\n\r\ninterface ICheckoutGuidedFormState {\r\n currentStep: number;\r\n /* VSI Customization - START */\r\n activeView: number;\r\n currentCheckoutView: number;\r\n deliveryStepLink: React.ReactNode;\r\n checkoutModulesCount: number;\r\n isClickCollectOnly: boolean;\r\n /* VSI Customization - END */\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuidedForm component\r\n * @extends {React.Component}\r\n */\r\n@observer\r\nclass CheckoutGuidedForm extends React.Component {\r\n public state: ICheckoutGuidedFormState = {\r\n currentStep: 0,\r\n activeView: 0,\r\n currentCheckoutView: 1,\r\n deliveryStepLink: <>,\r\n checkoutModulesCount: 0,\r\n isClickCollectOnly: false\r\n };\r\n public stepsToSkip: number = 0;\r\n\r\n public componentDidMount(): void {\r\n /**\r\n * Append child modules\r\n */\r\n const childIds = this.props.items.map((item: React.ReactNode) => get(item, 'props.id'));\r\n this.props.moduleState.init({ childIds });\r\n /* VSI Customization - START */\r\n const { items } = this.props;\r\n let checkoutItems = 0;\r\n let isClickCollect = false;\r\n items.map(item => {\r\n const childId = this.getId(item);\r\n const state = this.props.moduleState.getModule(childId);\r\n const { isDisabled, onSubmit } = state || ({} as IModuleStateManager);\r\n if (isDisabled) {\r\n this.stepsToSkip += 1;\r\n isClickCollect = true;\r\n }\r\n checkoutItems = onSubmit ? checkoutItems + 1 : checkoutItems;\r\n });\r\n this.setState({\r\n currentStep: this.stepsToSkip,\r\n activeView: this.stepsToSkip,\r\n currentCheckoutView: this.stepsToSkip < 2 ? 1 : 2,\r\n checkoutModulesCount: checkoutItems,\r\n isClickCollectOnly: isClickCollect\r\n });\r\n /* VSI Customization - END */\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { moduleState, items, placeOrderBtn, resource, attributes, customer, isDDRP } = this.props;\r\n\r\n if (!items || !moduleState) {\r\n return null;\r\n }\r\n\r\n return (\r\n <>\r\n {/* VSI Customization - START */}\r\n {this._displayBreadCrumbs()}\r\n \r\n {items &&\r\n items.map((item: React.ReactNode, index: number) => {\r\n const childId = this.getId(item);\r\n const step = this.getStep(childId);\r\n const title = this.getHeading(item);\r\n const state = this.props.moduleState.getModule(childId);\r\n const {\r\n isReady,\r\n isPending,\r\n isUpdating,\r\n isDisabled,\r\n isCancelAllowed,\r\n onEdit,\r\n onCancel,\r\n onSubmit,\r\n hasModuleState,\r\n hasInitialized\r\n } = state || ({} as IModuleStateManager);\r\n /* VSI Customization - START */\r\n // const _hidden = ((currentCheckoutView === 1 && index < 2) ||\r\n // (currentCheckoutView === 2 && index >= 2));\r\n /* VSI Customization - END */\r\n return (\r\n <>\r\n \r\n \r\n {React.cloneElement(item as React.ReactElement, { enableControl: true })}\r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n {/* VSI Customization - START - 27/11/20 */}\r\n\r\n {this.isLastStep() && placeOrderBtn}\r\n\r\n {/* VSI Customization - END */}\r\n \r\n );\r\n }\r\n /* VSI Customization - START */\r\n private _displayBreadCrumbs = (): React.ReactElement => {\r\n const { items, rootLink, breadCrumbsText } = this.props;\r\n const { activeView, checkoutModulesCount, isClickCollectOnly } = this.state;\r\n const rootLinkData: Msdyn365.ILinksData = {\r\n ariaLabel: rootLink && rootLink.ariaLabel,\r\n className: 'ms-breadcrumb_link-root',\r\n linkText: rootLink && rootLink.linkText,\r\n linkUrl: rootLink && rootLink.linkUrl.destinationUrl,\r\n openInNewTab: rootLink && rootLink.openInNewTab,\r\n role: 'link'\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {rootLink && }\r\n \r\n {breadCrumbsText &&\r\n items.map((item: React.ReactNode, index: number) => {\r\n const childId = this.getId(item);\r\n const state = this.props.moduleState.getModule(childId);\r\n const { isDisabled } = state || ({} as IModuleStateManager);\r\n\r\n const breadCrumbText = breadCrumbsText[index];\r\n const breadCrumbLink: Msdyn365.ILinksData = {\r\n className: 'ms-breadcrumb_link',\r\n linkText: breadCrumbText,\r\n role: 'link',\r\n onClick: this.gotoSelectedModule(item, isClickCollectOnly)\r\n };\r\n // isDisbaled = true for hidden items in case of click and collect only\r\n if (index <= activeView && isDisabled === false) {\r\n return index === activeView || index === checkoutModulesCount - 1 ? (\r\n \r\n {breadCrumbText}\r\n \r\n ) : (\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n })}\r\n \r\n \r\n );\r\n };\r\n\r\n private gotoSelectedModule = (item: React.ReactNode, isClickCollectOnly: boolean) => {\r\n return () => {\r\n const childId = this.getId(item);\r\n let selectedModuleStep = this.getStep(childId);\r\n selectedModuleStep = isClickCollectOnly === true ? selectedModuleStep + 2 : selectedModuleStep;\r\n const state = this.props.moduleState.getModule(childId);\r\n const { onEdit } = state || ({} as IModuleStateManager);\r\n onEdit ? onEdit() : null;\r\n this.setState({\r\n currentStep: selectedModuleStep,\r\n activeView: selectedModuleStep,\r\n currentCheckoutView: selectedModuleStep < 2 ? 1 : 2\r\n });\r\n };\r\n };\r\n /* VSI Customization - END */\r\n private getEnabledModules = (): string[] => {\r\n const {\r\n moduleState: { childIds, getModule }\r\n } = this.props;\r\n return childIds.filter((childId: string) => {\r\n const state = getModule(childId);\r\n return !!state && !state.isDisabled;\r\n });\r\n };\r\n\r\n private getStep = (id: string): number => {\r\n return this.getEnabledModules().indexOf(id);\r\n };\r\n\r\n private getId = (item: React.ReactNode): string => {\r\n return get(item, 'props.id') || '';\r\n };\r\n\r\n private getHeading = (item: React.ReactNode): Heading => {\r\n return get(item, 'props.config.heading') || '';\r\n };\r\n\r\n private isExpanded = (step: number): boolean => {\r\n if (this.props.isEditor) {\r\n return true;\r\n }\r\n return step > -1 && step <= this.state.currentStep;\r\n };\r\n\r\n private isActive = (step: number): boolean => {\r\n return step + this.stepsToSkip === this.state.activeView;\r\n };\r\n\r\n private isVisted = (step: number): boolean => {\r\n return step > -1 && step < this.state.currentStep;\r\n };\r\n\r\n private isLastStep = (): boolean => {\r\n const { activeView, checkoutModulesCount } = this.state;\r\n const secondStep = checkoutModulesCount - 2;\r\n return activeView >= secondStep;\r\n };\r\n\r\n private onNext = (): void => {\r\n /* VSI Customization - START */\r\n this.setState({\r\n currentStep: this.state.currentStep + 1,\r\n activeView: this.state.activeView + 1,\r\n currentCheckoutView: this.state.currentStep < 1 ? 1 : 2\r\n });\r\n /* VSI Customization - END */\r\n };\r\n}\r\n\r\nexport default CheckoutGuidedForm;\r\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['checkout'] = {\n c: () => require('@msdyn365-commerce-modules/checkout/dist/lib/modules/checkout/checkout'),\n $type: 'containerModule',\n da: [{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'checkout', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/checkout-state-data-action', runOn: 1},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines', runOn: 1},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 1},{name:'products', path:'@msdyn365-commerce-modules/checkout/dist/lib/modules/checkout/actions/get-products-in-active-checkout-cart', runOn: 1}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'checkout',\n p: 'checkout',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/checkout/dist/lib/modules/checkout'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/checkout/dist/lib/modules/checkout/actions/get-products-in-active-checkout-cart';\n let dataAction = require('@msdyn365-commerce-modules/checkout/dist/lib/modules/checkout/actions/get-products-in-active-checkout-cart');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/checkout-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/checkout-state-data-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__|themes|dobbies|views|checkout'] = {\n c: () => require('partner/themes/dobbies/views/checkout.view.tsx'),\n cn: '__local__-__local__-checkout'\n };\nviewDictionary['__local__|__local__|themes|dobbiesclub|views|checkout'] = {\n c: () => require('partner/themes/dobbiesclub/views/checkout.view.tsx'),\n cn: '__local__-__local__-checkout'\n };\nviewDictionary['@msdyn365-commerce-modules|checkout|modules|checkout|checkout'] = {\n c: () => require('@msdyn365-commerce-modules/checkout/dist/lib/modules/checkout/checkout.view.js'),\n cn: '@msdyn365-commerce-modules-checkout-checkout'\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 IAny,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport { searchOrgUnitLocationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\n\n/**\n * Input for search-org-unit-locations data action.\n */\nexport class SearchOrgUnitLocationsInput implements IActionInput {\n public getCacheKey = () => 'SearchOrgUnitLocations';\n\n public getCacheObjectType = () => 'SearchOrgUnitLocations';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- Input data.\n * @returns -- IActionInput.\n */\nexport const createSearchOrgUnitLocationsInputFunc = (inputData: ICreateActionContext>): IActionInput => {\n return new SearchOrgUnitLocationsInput();\n};\n\n/**\n * Calls the Retail API and returns all the orgUnitLocations as array.\n * @param input - Input.\n * @param ctx - Context.\n * @returns - orgUnitLocations.\n */\nexport async function getSearchOrgUnitLocationsAction(\n input: SearchOrgUnitLocationsInput,\n context: IActionContext\n): Promise {\n const OrgUnitLocations = await searchOrgUnitLocationsAsync(\n {\n callerContext: context\n },\n {}\n );\n\n return OrgUnitLocations;\n}\n\nexport const retailActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/search-org-unit-locations',\n action: >getSearchOrgUnitLocationsAction,\n input: createSearchOrgUnitLocationsInputFunc\n});\n\nexport default retailActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["GetSearchByCriteriaInput","constructor","productIds","context","pageType","getCacheKey","getCacheObjectType","dataCacheType","this","async","getSearchByCriteriaAsync","input","ctx","productSearchResults","promise","searchCriteriaInput","Context","ChannelId","requestContext","apiSettings","channelId","CatalogId","catalogId","Ids","IncludeAttributes","searchByCriteriaAsync","callerContext","queryResultSettings","createObservableDataAction","action","args","axios","require","getRestrictedProducts","productsData","attributesBaseUrl","restrictedProducts","product","attributes","_getRestrictedPostCodes","RecordId","map","attr","Name","TextValue","JSON","parse","RestrictedPostCode","length","push","productId","config","method","url","headers","authority","split","accept","appsessionid","contenttype","oun","pragma","prefer","requestid","usersessionid","data","value","error","console","log","CheckoutGuidedCard","React","editButtonRef","formCardRef","renderFooder","title","isVisted","isReady","isSubmitting","invalidAddressForCartProducts","loggedInUserNewAddress","isFirstAddress","InvalidAddressMsg","notBtPostCodeForPlants","isCancelAllowed","hasControlGroup","onCancel","onSubmit","resource","props","saveBtnLabel","cancelBtnLabel","saveAndContinueBtnLabel","canSubmit","canCancel","isPaymentSection","text","toLowerCase","indexOf","postCodeRestricted","className","Node","tag","Button","classname","color","disabled","onClick","focusOnFirstFocusableElement","node","ReactDOM","child","querySelector","focus","focusOnEditButton","editButton","current","scrollToTitle","formCard","isMobile","scrollIntoView","getTitle","headingTag","Tag","componentDidUpdate","prevProps","isActive","onNext","onEdit","render","isExpanded","children","isPending","isUpdating","hasInitialized","changeBtnLabel","canEdit","active","expanded","closed","visted","hidden","initialized","ready","pending","updating","ref","innerRef","CheckoutGuidedForm","state","currentStep","activeView","currentCheckoutView","checkoutModulesCount","isClickCollectOnly","saveClicked","count","openedStep","addressSavedAlready","stepsToSkip","_onSubmit","step","setState","_displayBreadCrumbs","items","rootLink","breadCrumbsText","rootLinkData","ariaLabel","linkText","linkUrl","destinationUrl","openInNewTab","role","id","Msdyn365","link","item","index","childId","getId","moduleState","getModule","isDisabled","breadCrumbText","breadCrumbLink","gotoSelectedModule","selectedModuleStep","getStep","getEnabledModules","childIds","filter","get","getHeading","isEditor","isLastStep","addressConfirmed","prevState","componentDidMount","init","checkoutItems","isClickCollect","includes","placeOrderBtn","postCodeRestrictionMsg","hasModuleState","disableDeliveryOptionsBtn","disableShippingAddressBtn","_hidden","onNextFunction","key","GuidedCard","disableGuidedCheckoutFlow","enableControl","__decorate","observer","PickUpAtStoreComponent","_ref","PickUpAtStore","label","location","Object","assign","LineItemComponent","_ref2","LineItem","LineId","pickUpAtStore","cartLines","plantProductsIds","postCodeErrorMsg","postCodeValidation","postCodeError","notBtPostCode","cartLine","find","cartLineItem","cartLineProductId","ProductId","Alert","isOpen","assertive","LineItemGroupComponent","_ref3","LineItemDeliveryGroup","LineItemList","heading","lineItems","lineItem","LineItemsComponent","_ref4","LineItems","Header","editLink","itemsForPickup","itemsForShip","plantPostCodeInfo","OrderSummaryComponent","_ref5","lines","subtotal","shipping","otherCharge","tax","loyalty","giftCard","orderTotal","_props$data$checkout","breadCrumbsRoot","breadCrumbs","postCodeErrorMsgForShippingAddress","postCodeErrorMsgForCartLines","actionContext","canShow","checkoutProps","headerProps","hasSalesOrder","bodyProps","mainProps","sideProps","orderConfirmation","loading","alert","orderSummary","resources","placeOrderButton","checkoutModulesSharedState","result","checkout","plantProducts","setPlantProducts","useState","useEffect","products","then","productss","actionInput","productsSearchResult","baseUrl","_getProductAttributes","catch","telemetry","trace","getSlotItems","slots","creditBannerFound","creditBanner","creditBannerSection","checkoutCart","cart","CartLines","plantPostCodeInfoObject","isAuthenticated","request","user","Module","GuidedFormComponent","href","formattedPrice","clubPlusText","clubPlusTrialText","termsAndConditionsProps","termsAndConditions","mainControlProps","setAttributes","customer","setCustomer","isDDRP","setIsDDRP","price","Price","_props$context$reques","cultureFormatter","formatCurrency","channel","Currency","attributeDefinitions","customerInformation","signinURL","signInUrl","window","_formattedPrice","toString","Waiting","authenticationMessage","super","_onAttributeCheck","event","_renderBoolean","classnames","type","checked","_renderRecurrentPaymentSection","editAttributes","attributeError","customerHasAttributes","defaultRender","deliveryStepLink","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","_objectSpread","viewDictionary","cn","SearchOrgUnitLocationsInput","createSearchOrgUnitLocationsInputFunc","inputData","getSearchOrgUnitLocationsAction","searchOrgUnitLocationsAsync","retailActionDataAction","module","exports"],"sourceRoot":""}