{"version":3,"sources":["webpack:///./lib/szf-plp-content-banner/module-registration.js?fa98","webpack:///external \"React\"?c481","webpack:///./src/modules/szf-plp-content-banner/szf-plp-content-banner.view.tsx?00b9","webpack:///./src/actions/get-categories.action.ts?cf7e","webpack:///external \"ReactDOM\"?4b2d","webpack:///./src/modules/szf-plp-content-banner/szf-plp-content-banner.tsx?3139"],"names":["binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","id","window","__bindings__","_objectSpread","viewDictionary","cn","module","exports","React","props","contentBanner","GetCategoriesInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","recId","Number","requestContext","urlTokens","recordId","getCategories","getCategoriesAsync","callerContext","apiSettings","channelId","filteredCategories","filter","item","ParentCategory","parentCategory","find","RecordId","args","ReactDOM","SzfPlpContentBanner","renderContentBanner","_categories$result","_alWathbaNightsfestiv","_categories$result2","_this$props$data$cate","_festivalActivityCate","_translatedText$Text","config","links","alWathbaNightsfestivalAttraction","context","request","baseImageUrl","data","categories","this","categoryRecordId","result","filterCategoryID","categoryID","redirectionLink","parentCategoryRecordId","app","hideButtonsOnClpAndCdp","parentCategoryId","festivalActivityCategory","imageBaseURL","substring","length","currentLocale","locale","translatedText","NameTranslations","_item$Language","Language","toLowerCase","includes","RegisterButtonSlots","slots","tefanRegistrationButton","className","src","Text","tag","text","toUpperCase","RichTextComponent","LocalizedDescription","map","link","index","entrtTicketLink","linkUrl","destinationUrl","key","href","linkText","RegisterButtonSlot","i","render","contentBlockViewProps","renderView"],"mappings":";wvBAAA,MAAMA,EAAU,CAAEC,QAAS,GAAIC,YAAa,IAwCvCF,EAAQC,QAAQ,0BAA4B,CACzCE,EAAGA,IAAMC,EAAQ,QACjBC,MAAO,kBACPC,GAAI,CAAC,CAACC,KAAK,aAAeC,KAAK,gCAAiCC,MAAO,IAEvEC,KAAK,EACLC,GAAI,YAC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sE,OAASvB,KAAK/C,MAAMsE,MAAMC,yBAA2BxB,KAAK/C,MAAMsE,MAAMC,wBAAwBX,OAAS,EAAIb,KAAK/C,MAAMsE,MAAMC,wBAA0B,GAU7L,OACIxE,gBAAA,OAAKyE,UAAU,6BACXzE,gBAAA,OAAKyE,UAAU,yBACXzE,gBAAA,OAAK0E,IAAK,GAAGf,IAAeD,aAAwB,EAAxBA,EAA0B7B,0BAG1D7B,gBAAA,OAAKyE,UAAU,2BACXzE,gBAAA,OAAKR,GAAG,UAAUiF,UAAU,2BACxBzE,gBAAC2E,IAAI,CAACC,IAAI,KAAKC,KAAMb,SAAoB,QAANzB,EAAdyB,EAAgBW,YAAI,IAAApC,OAAA,EAApBA,EAAsBuC,iBAE/C9E,gBAAA,OAAKR,GAAG,cAAciF,UAAU,+BAC5BzE,gBAAC+E,IAAiB,CAACF,KAAMnB,aAAwB,EAAxBA,EAA0BsB,wBAErDvB,EAQG,GAPLhB,aAAK,EAALA,EAAOwC,IAAI,CAACC,EAAMC,KACd,MAAMC,EAAkBjC,GAAoB+B,EAAKG,QAAQC,eACzD,OACItF,gBAAA,OAAKuF,IAAKJ,EAAOV,UAAU,iCACvBzE,gBAAA,KAAGwF,KAAMJ,GAAkBF,EAAKO,aAI3ChC,GACGzD,gBAAA,OAAKyE,UAAU,iDA/BpBH,EAAoBW,IAAI,CAACS,EAAmBC,IAE3C3F,gBAAA,OAAKuF,IAAK,kCAAkCI,GACvCD,OAqCdE,SACH,MAAMC,EAAqBlG,IAAA,GACpBqD,KAAK/C,OAAK,IACbC,cAAe8C,KAAKf,wBAGxB,OAAOe,KAAK/C,MAAM6F,WAAWD,IAItB7D,c","file":"static/js/154.70cecb04719e9f050368.chunk.js","sourcesContent":["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['szf-plp-content-banner'] = {\n c: () => require('partner/modules/szf-plp-content-banner/szf-plp-content-banner.tsx'),\n $type: 'containerModule',\n da: [{name:'categories', path:'actions/get-categories.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'szf-plp-content-banner',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/szf-plp-content-banner'\n });\n \n\n {\n const sanitizedActionPath = 'actions/get-categories.action';\n let dataAction = require('partner/actions/get-categories.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|szf-plp-content-banner|szf-plp-content-banner'] = {\n c: () => require('partner/modules/szf-plp-content-banner/szf-plp-content-banner.view.tsx'),\n cn: '__local__-__local__-szf-plp-content-banner'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { ISzfPlpContentBannerViewProps } from './szf-plp-content-banner';\r\n\r\nexport default (props: ISzfPlpContentBannerViewProps) => {\r\n\r\n return (\r\n <>\r\n {\r\n props.contentBanner\r\n }\r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getCategoriesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CategoriesDataActions.g';\r\nimport { Category } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport class GetCategoriesInput implements Msdyn365.IActionInput {\r\n constructor() {}\r\n public getCacheKey = () => `Get-Categories`;\r\n public getCacheObjectType = () => 'Get-Categories';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nexport interface IGetCategoriesData {\r\n filteredCategories: Category[];\r\n parentCategory?: Category | undefined;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetCategoriesInput();\r\n};\r\n\r\nasync function action(input: GetCategoriesInput, ctx: Msdyn365.IActionContext): Promise {\r\n const recId = Number(ctx.requestContext.urlTokens.recordId);\r\n const getCategories: Category[] = await getCategoriesAsync(\r\n { callerContext: ctx },\r\n ctx.requestContext.apiSettings.channelId\r\n );\r\n\r\n const filteredCategories = recId ? getCategories.filter((item: Category) => item.ParentCategory === recId) : getCategories;\r\n const category = getCategories.find((item: Category) => item.RecordId === recId);\r\n\r\n return { filteredCategories: filteredCategories, parentCategory: category };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetCategories',\r\n input: createInput\r\n});\r\n","module.exports = ReactDOM;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { ISzfPlpContentBannerData } from './szf-plp-content-banner.data';\r\nimport { ISzfPlpContentBannerProps } from './szf-plp-content-banner.props.autogenerated';\r\nimport { Text, RichTextComponent, RichText } from '@msdyn365-commerce/core';\r\nimport { Category, TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface ISzfPlpContentBannerViewProps extends ISzfPlpContentBannerProps {\r\n contentBanner: React.ReactNode;\r\n}\r\nexport interface IFestivalActivities {\r\n categoryId: number;\r\n categoryName: string;\r\n categoryDescription: RichText;\r\n categorySubText: RichText;\r\n}\r\n\r\n/**\r\n *\r\n * SzfPlpContentBanner component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass SzfPlpContentBanner extends React.PureComponent> {\r\n public renderContentBanner(): React.ReactNode {\r\n const {\r\n config: { links, alWathbaNightsfestivalAttraction },\r\n context: {\r\n request: {\r\n apiSettings: { baseImageUrl },\r\n },\r\n },\r\n data : {categories}\r\n } = this.props;\r\n const categoryRecordId = categories.result?.parentCategory?.RecordId\r\n \r\n const filterCategoryID = alWathbaNightsfestivalAttraction?.find(id => {\r\n if (id && id.categoryID) {\r\n return id.categoryID === categoryRecordId;\r\n } else {\r\n return false;\r\n }\r\n })?.redirectionLink;\r\n const parentCategoryRecordId = this.props.context.app.config.hideButtonsOnClpAndCdp\r\n const parentCategoryId = categories.result?.parentCategory?.RecordId === parentCategoryRecordId\r\n const festivalActivityCategory: Category | undefined = this.props.data.categories.result?.parentCategory;\r\n const imageBaseURL = baseImageUrl?.substring(0, baseImageUrl?.length - 1);\r\n const currentLocale = this.props.context.request.locale;\r\n const translatedText = festivalActivityCategory?.NameTranslations?.find((item: TextValueTranslation) =>\r\n item.Language?.toLowerCase().includes(currentLocale.toLowerCase())\r\n );\r\n const RegisterButtonSlots = this.props.slots && this.props.slots.tefanRegistrationButton && this.props.slots.tefanRegistrationButton.length > 0 ? this.props.slots.tefanRegistrationButton : [];\r\n const renderRegistrationButtonSlots = ()=>{\r\n return RegisterButtonSlots.map((RegisterButtonSlot,i)=>{\r\n return(\r\n
\r\n {RegisterButtonSlot}\r\n
\r\n )\r\n })\r\n }\r\n return (\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n {!parentCategoryId ?\r\n links?.map((link, index) => {\r\n const entrtTicketLink = filterCategoryID || link.linkUrl.destinationUrl\r\n return (\r\n
\r\n {link.linkText}\r\n
\r\n );\r\n }) : ''}\r\n {parentCategoryId && \r\n
\r\n {renderRegistrationButtonSlots()}\r\n
\r\n }\r\n
\r\n
\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const contentBlockViewProps = {\r\n ...this.props,\r\n contentBanner: this.renderContentBanner(),\r\n };\r\n\r\n return this.props.renderView(contentBlockViewProps) as React.ReactElement;\r\n }\r\n}\r\n\r\nexport default SzfPlpContentBanner;\r\n"],"sourceRoot":""}