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AAA,SAAIO,2mBCdpB,MAAM0D,EAAU,CAAEC,QAAS,GAAIC,YAAa,IAwCvCF,EAAQC,QAAQ,gBAAkB,CAC/BE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,CAAC,CAACzD,KAAK,aAAe0D,KAAK,8EAA+EC,MAAO,IAErHC,KAAK,EACLC,GAAI,YACJC,EAAG,eACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,4BAlC4BC,EAACC,EAAqBC,KAUlD,GADAjB,EAAQE,YAAYc,GAAuBC,GACtCjB,EAAQE,YAAYc,GAAqBE,QAC1C,MAAM,IAAIC,MAAM,oBAAsBH,EAAsB,mCAEhEhB,EAAQE,YAAYc,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEhB,EAAQE,YAAYc,GAAqBE,QAAQE,UAAUE,KAC3DtB,EAAQE,YAAYF,EAAQE,YAAYc,GAAqBE,QAAQE,UAAUE,IAAMN,IA0BzFD,CAF4B,8EACXX,EAAQ,MAMjCmB,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAavB,QAAOwB,EAAAA,EAAA,GACpBF,OAAOC,aAAavB,SAAW,IAC/BD,EAAQC,SAGXsB,OAAOC,aAAatB,YAAWuB,EAAAA,EAAA,GAC5BF,OAAOC,aAAatB,aAAe,IACnCF,EAAQE,aAEY,MAAMwB,EAAiB,GAC9BA,EAAe,yDAA2D,CAClFvB,EAAGA,IAAMC,EAAQ,MACjBuB,GAAI,oCAEpBJ,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaE,eAAcD,EAAAA,EAAA,GACPF,OAAOC,aAAaE,gBAAkB,IACtCA,UCnF3BE,EAAOC,QAAU9F,cCAjB6F,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/api-category/api-category.tsx?88a8","webpack://Msdyn365.Commerce.Online/./src/modules/api-category/api-category.view.tsx?4e73","webpack://Msdyn365.Commerce.Online/./lib/api-category/module-registration.js?fc1c","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["import * as React from 'react';\nimport { IApiCategoryData } from './api-category.data';\nimport { IApiCategoryProps } from './api-category.props.autogenerated';\n// @ts-ignore\nimport Slider from 'react-slick';\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface IApiTestViewProps extends IApiCategoryProps {\n categories: string;\n isMobileView: boolean;\n}\n\nexport interface IApiCategoryState {\n isMobile: boolean;\n}\n\nclass ApiTest extends React.PureComponent, IApiCategoryState> {\n private readonly localyOnlineRecordId = 5637144702;\n\n constructor(props: IApiCategoryProps) {\n super(props);\n }\n public render(): JSX.Element | null {\n var settings = {\n dots: false,\n infinite: false,\n speed: 500,\n slidesToShow: 6,\n slidesToScroll: 1,\n arrows: true,\n swipeToSlide: true,\n responsive: [\n {\n breakpoint: 1400,\n settings: {\n slidesToShow: 6\n }\n },\n {\n breakpoint: 1200,\n settings: {\n slidesToShow: 6\n }\n },\n {\n breakpoint: 1024,\n settings: {\n infinite: true,\n slidesToShow: 4\n }\n },\n {\n breakpoint: 600,\n settings: {\n slidesToShow: 2,\n infinite: true,\n centerPadding: '60px'\n }\n },\n {\n breakpoint: 480,\n settings: {\n slidesToShow: 2,\n infinite: true,\n centerPadding: '60px'\n }\n }\n // You can unslick at a given breakpoint now by adding:\n // settings: \"unslick\"\n // instead of a settings object\n ]\n };\n const {\n data: { categories }\n } = this.props;\n var categoriesList = [];\n if (categories && categories.result) {\n //remove this to remove from category carousel\n const ramadanOfferCategory = {\n image_url: 'https://images-eu-prod.cms.commerce.dynamics.com/cms/api/vnnhvggtsx/imageFileData/MD3jwG?pubver=6',\n link: '/localy-deals/5637160326.c',\n name: 'Localy Deals'\n };\n categoriesList.push(ramadanOfferCategory);\n //remove this to remove from category carousel\n const parentCategory = categories.result.find(category => category.RecordId === this.localyOnlineRecordId);\n if (parentCategory && parentCategory.Children.length > 0) {\n const base_image_url = 'https://images-eu-prod.cms.commerce.dynamics.com/cms/api/vnnhvggtsx/imageFileData/'; //process.env.MSDyn365Commerce_CMSIMAGEBASEURL;\n // const base_url = process.env.MSDyn365Commerce_LOCALYBASEURL;\n for (let i = 0; i < parentCategory.Children.length; i++) {\n if (parentCategory.Children[i].ParentCategory === this.localyOnlineRecordId) {\n // @ts-ignore\n const image = parentCategory.Children[i].Images[0].Uri;\n const url = image\n ? `${base_image_url}search?fileName=/${image}&w=230&h=180&m=6&cropfocalregion=true`\n : `${base_image_url}MDfBO?pubver=1`;\n let name = `${parentCategory.Children[i].Name}`;\n name = name.toLowerCase();\n\n const link = `/${name.replace(/\\s+/g, '-').toLowerCase()}/${parentCategory.Children[i].RecordId}.c`;\n // parentCategory.Children[i].Children.length > 0\n // ? `/${parentCategory.Children[i].Children[0].Name}/${parentCategory.Children[i].Children[0].RecordId}.c`\n // : `/${parentCategory.Children[i].Name}/${parentCategory.Children[i].RecordId}.c`;\n var obj = {\n image_url: url,\n name: name,\n link: link\n };\n categoriesList.push(obj);\n }\n }\n }\n }\n\n // @ts-ignore\n const chunk = (arr, size) => Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));\n categoriesList = chunk(categoriesList, 2);\n return (\n <>\n
\n

Shop by category

\n
\n \n {categoriesList.map((card, index) => (\n
\n \n {card.length <= 1 ? null : (\n
\n

{card[1].name}

\n \n \n \n
\n )}\n
\n ))}\n
\n \n );\n }\n}\n\nexport default ApiTest;\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 { IApiTestViewProps } from './api-category';\n\nexport default (props: IApiTestViewProps) => {\n const { categories } = props;\n\n return (\n
\n
\n

{categories}

\n
\n
\n );\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['api-category'] = {\n c: () => require('partner/modules/api-category/api-category.tsx'),\n $type: 'contentModule',\n da: [{name:'categories', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'api-category',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/api-category'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy');\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|api-category|api-category'] = {\n c: () => require('partner/modules/api-category/api-category.view.tsx'),\n cn: '__local__-__local__-api-category'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["ApiTest","React","constructor","props","super","localyOnlineRecordId","render","data","categories","this","categoriesList","result","ramadanOfferCategory","image_url","link","name","push","parentCategory","find","category","RecordId","Children","length","base_image_url","i","ParentCategory","image","Images","Uri","url","Name","toLowerCase","replace","obj","chunk","arr","size","Array","from","Math","ceil","v","slice","className","Slider","Object","assign","dots","infinite","speed","slidesToShow","slidesToScroll","arrows","swipeToSlide","responsive","breakpoint","settings","centerPadding","map","card","index","key","href","src","width","height","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","id","window","__bindings__","_objectSpread","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}