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AyB,IAAAp+D,UAAQ,KAAM,CAC3Cq+D,WAAY,GACZlB,mBACE,CAACA,IAEL,OACE,gBAACmB,EAAA,EAAS,CACRp3D,KAAMk3D,EACNG,oBAAqB,iBACrB/9D,WAAW,OAAa,eAAgB8E,EAAQ03D,aAChDwB,8BAA4B,GAE/B,E,gBClEUC,EAAoB,SAACp5D,GAChC,IACEwkC,EAKExkC,EALFwkC,QACA60B,EAIEr5D,EAJFq5D,UACAC,EAGEt5D,EAHFs5D,YACA5X,EAEE1hD,EAFF0hD,cACA8I,EACExqD,EADFwqD,UAGF,OACEtvD,EAAAA,EAAAA,KAAA,OAAKC,UAAU,sBAAsB+tC,MAAOshB,EAAUpvD,SACnD3C,IAAAA,IAAM6gE,GAAa,SAAA3iE,EAAesrC,GAAK,IAAjB7hB,EAAQzpB,EAARypB,SAAQ,OAC7BllB,EAAAA,EAAAA,KAAA,OAEEC,WAAWmoC,EAAAA,EAAAA,GAAa,oBAAqBrB,IAAUyf,EAAgB,WAAa,IACpFld,QAAS,WAAF,OAAQA,EAAQvC,EAAM,EAC7B0I,KAAK,SACLumB,SAAU,EACVmI,UAAW,SAAAvpC,GAAC,OAAIupC,EAAUp3B,EAAOnS,EAAE,EAAC10B,UAEpCF,EAAAA,EAAAA,KAAA,OAAKC,UAAU,eAAcC,UAC3BF,EAAAA,EAAAA,KAAA,OAAKq+D,IAAKn5C,EAAUo5C,IAAI,0BACpB,GAAAzvD,OATEk4B,GAUJ,KAId,EC/BO,MAAMw3B,EAAc,gBAAoB,CAAC,GAEnCxd,EAAe,EAAG7gD,eAC7B,MAAOs+D,EAAaC,IAAkB,IAAAxhE,UAAS,OACxC0J,EAAM+3D,IAAW,IAAAzhE,UAAS,MAEjC,OACE,gBAACshE,EAAYjE,SAAQ,CAACtgE,MAAO,CAC3BwkE,cACAC,iBACA93D,OACA+3D,YAGCx+D,EAEJ,C","sources":["../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/styles/custom-landing-page-styles.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/adapters/get-i18n.ts","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/adapters/get-server-context.ts","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/inline-chart-wrapper/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/hooks/use-inline-chart.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/inline-download-wrapper/use-date-default.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/inline-download-wrapper/styles.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/inline-download-wrapper/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/hooks/use-inline-download.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/date-picker/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/hooks/use-toolbar-container.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/adapters/get-notification.ts","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/service-utils.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/create-display-template-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/edit-display-template-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/adapters/get-logger.ts","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/logger/custom-logger.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/constants.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/preferences/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/odata-service/folder-odata-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/odata-service/image-bulk-edit-odata-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/odata-service/aigc-odata-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/odata-service/video-odata-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/odata-service/background-change-odata-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/asset-response-transformers/image-response-transformer.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/image-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/asset-response-transformers/video-response-transformer.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/asset-response-transformers/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/request-transformers/request-transformer-util.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/request-transformers/add-asset-request-transformer.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/request-transformers/delete-asset-request-transformer.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/request-transformers/update-asset-request-transformer.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/error-handling/odata-error/ads-studio-odata-error.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/folder-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/aigc-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/background-change-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/stock-image-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/basic-assets-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/with-ads-studio-services-provider.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/video-creative-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/odata-config.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/with-assets-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/with-edit-image-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/edit-image-respository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/with-brand-kit-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/with-display-templates-service.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/perf-marker/with-page-perf-marker.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/library-page/target-folder-picker/target-folder-picker-style.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/library-page/target-folder-picker/target-folder-picker-view.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/library-page/target-folder-picker/target-folder-picker-modal.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/library-page/target-folder-picker/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/edit-video-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/upload-files-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/upload-folder-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/asset-details-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/background-removal-modal-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/hooks/use-ad-filter.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/hooks/use-date-picker.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/hooks/use-common-columns.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/performance-page/hooks/use-detail-list.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/basic-folders-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/home-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/images-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/display-templates-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/video-templates-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/videos-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/brand-kit-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/library-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/website-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/stock-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/invest-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/invest-video-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/add-video-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/services/repository/library-and-stock-image-repository.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/search-result-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/edit-image-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/generate-image-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/mixed-image-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/pages/mixed-video-panel-page/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/routes/index.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/routes/use-navigation.js","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/adapters/index.ts","../../../../ads-studio/packages/ads-studio-app-shell-cmui/src/styles/index.js","../../../../advisor/packages/recommendation-in-context-card/src/in-context-card.js","../../../../advisor/packages/recommendation-in-context-card/src/card-style.js","../../../../advisor/packages/recommendation-modal/src/modal.js","../../../../advisor/packages/recommendation-modal/src/show-modal.js","../../../../advisor/packages/recommendation-modal/src/forms/confirm-form.js","../../../../advisor/packages/recommendation-modal/src/show-confirm-form-modal.js","../../../../advisor/packages/recommendation-modal/src/forms/async-apply-form.js","../../../../advisor/packages/recommendation-modal/src/show-async-apply-form-modal.js","../../../../advisor/packages/recommendation-modal/src/show-apply-form-modal.js","../../../../advisor/packages/recommendation-modal/src/forms/async-bulk-aar-confirm-form.js","../../../../advisor/packages/recommendation-shared-styles/src/apply-form-style.js","../../../../advisor/packages/recommendation-shared-styles/src/feedback-modal-style.js","../../../../advisor/packages/recommendation-shared-styles/src/header-style.js","../../../../advisor/packages/recommendation-shared-styles/src/icon-style.js","../../../../advisor/packages/with-recommendation-services/src/with-services.js","../../../../advisor/packages/recommendation-modal/src/template.pug","../../../../ads-studio/packages/ads-studio-shared-components/src/grid/itemLayout.ts","../../../../ads-studio/packages/ads-studio-shared-components/src/grid/itemBox.ts","../../../../ads-studio/packages/ads-studio-shared-components/src/grid/view.tsx","../../../../ads-studio/packages/ads-studio-shared-components/src/component-styles-provider/component-styles-provider.tsx","../../../../ads-studio/packages/ads-studio-shared-components/src/component-styles-provider/with-component-styles.tsx","../../../../ads-studio/packages/ads-studio-shared-components/src/local-navigation/local-navigation-provider.tsx","../../../../ads-studio/packages/ads-studio-shared-components/src/toggle-buttons/toggle-buttons.tsx","../../../../ads-studio/packages/ads-studio-shared-components/src/inline-chart/index.tsx","../../../../ads-studio/packages/ads-studio-shared-components/src/history-list-images/index.js","../../../../ads-studio/packages/ads-studio-shared-components/src/data-provider/data-provider.tsx"],"sourcesContent":["import {\r\n // tokens,\r\n makeStyles,\r\n // makeResetStyles,\r\n shorthands,\r\n} from '@fluentui/react-components';\r\n\r\n// override default styles for landing pages\r\nexport const useCustomLandingPageStyles = makeStyles({\r\n landingPageComponentRoot: {\r\n backgroundColor: 'darkred',\r\n width: '100%',\r\n height: '200px',\r\n ...shorthands.margin('50px'),\r\n },\r\n landingPageComponentTitle: {\r\n backgroundColor: 'lightyellow',\r\n },\r\n});\r\n","import { II18n } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nexport function getI18n(i18n: II18n): II18n {\r\n return {\r\n p$data: i18n.p$data,\r\n getLocale: () => i18n.getLocale(),\r\n getString: (name: string, param?: any) => i18n.getString(name, param),\r\n getToday: (param: { timeZone?: string }) => i18n.getToday(param),\r\n getFirstDayOfWeek: () => i18n.getFirstDayOfWeek(),\r\n getDayOfWeek: (value: number, param?: any) => i18n.getDayOfWeek(value, param),\r\n formatCivilDate: (date: string, param: { timeZone: string | null, raw: string }) => i18n.formatCivilDate(date, param),\r\n formatDate: (date: string, param: { timeZone: string | null, raw: string }) => i18n.formatDate(date, param),\r\n formatDecimal: (value: number, param?: any) => i18n.formatDecimal(value, param),\r\n formatPercentToFixed: (value: number, param: any) => i18n.formatPercentToFixed(value, param),\r\n parseCivilDate: (date: string, param: { timeZone: string | null, raw: string }) => i18n.parseCivilDate(date, param),\r\n parseDate: (date: string, param: { timeZone: string | null, raw: string }) => i18n.parseDate(date, param),\r\n formatDecimalToFixed: (value: number, param?: any) => i18n.formatDecimalToFixed(value, param),\r\n };\r\n}\r\n","import { IServerContext } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nexport function getServerContext(serverContext: IServerContext): IServerContext {\r\n return {\r\n CurrentCustomer: {\r\n Id: serverContext.CurrentCustomer?.Id,\r\n },\r\n CurrentAccount: {\r\n Id: serverContext.CurrentAccount?.Id,\r\n TimeZone: serverContext.CurrentAccount?.TimeZone,\r\n Name: serverContext.CurrentAccount?.Name,\r\n },\r\n CurrentUser: {\r\n LocaleID: serverContext.CurrentUser?.LocaleID,\r\n CultureDateTimeFormat: {\r\n ShortDatePattern: serverContext.CurrentUser?.CultureDateTimeFormat?.ShortDatePattern,\r\n },\r\n },\r\n CurrentAccountInActive: serverContext.CurrentAccountInActive,\r\n ServicesEndpoints: serverContext.ServicesEndpoints,\r\n Token: serverContext.Token,\r\n IsAADUser: serverContext.IsAADUser,\r\n };\r\n}\r\n","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\n\r\nimport { InlineChart } from '@bingads-webui-campaign-react/inline-chart';\r\nimport { waterfallDateFilterProcessor } from '@bingads-webui-campaign/filter-storage';\r\nimport appConfig from '@bingads-webui-component-legacy/config/index';\r\nimport Constants from '@bingads-webui-static-legacy/constants';\r\nimport { withInstrumentation } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { ThemeFluent } from '@bingads-webui-theme-2018/theme-fluent';\r\n\r\nconst AdStudioInlineChartWrapperInner = ({\r\n loadPerfTimeSeriesData,\r\n isShowChart,\r\n dateFilter,\r\n perfMarker,\r\n serverContext,\r\n instrumentation,\r\n chartPreference,\r\n i18nInlineChart,\r\n filters,\r\n appState,\r\n pageContext,\r\n forceToResizeChart,\r\n}) => {\r\n const { palette } = ThemeFluent;\r\n\r\n const resizeWidth = useCallback(() => {\r\n const chartContainer = document.getElementsByClassName('asset-library-performance-inline-chart');\r\n\r\n if (chartContainer.length > 0) {\r\n const chartWidth = chartContainer[0].offsetWidth;\r\n\r\n return chartWidth;\r\n }\r\n return 0;\r\n }, []);\r\n\r\n const resizeChart = useRef();\r\n\r\n const [dateRange, setDateRange] = useState({});\r\n\r\n const onWindowResize = useCallback(_.debounce(() => {\r\n const resizeChartHandler = resizeChart.current;\r\n resizeChartHandler(resizeWidth());\r\n }, 50), []);\r\n\r\n const resizeChartListener = useCallback((handler) => {\r\n resizeChart.current = handler;\r\n }, []);\r\n\r\n useEffect(() => {\r\n window.addEventListener('resize', onWindowResize, false);\r\n\r\n onWindowResize();\r\n\r\n return () => {\r\n window.removeEventListener('resize', onWindowResize);\r\n };\r\n }, [onWindowResize]);\r\n\r\n const getDataSource = useCallback(() => {\r\n const dataSourceInner = {\r\n findAll: timeSeriesParams => loadPerfTimeSeriesData(timeSeriesParams, filters),\r\n };\r\n\r\n return dataSourceInner;\r\n }, [filters, loadPerfTimeSeriesData]);\r\n\r\n const getOptions = useCallback(() => {\r\n const optionsInner = {\r\n entityType: 'Asset',\r\n token: appConfig.get('odata.token'),\r\n imagePath: Constants.imagePath, // can be removed?\r\n instrumentation,\r\n pageContext,\r\n pageState: appState,\r\n preference: chartPreference,\r\n hideChartPanel: !isShowChart,\r\n customMetricNameList: ['Clicks', 'ClickThruRate', 'Impressions', 'Spent'],\r\n seriesColors: {\r\n primary: {\r\n original: palette.themePrimary,\r\n comparative: palette.themePrimary,\r\n },\r\n secondary: {\r\n original: '#022F22',\r\n comparative: '#022F22',\r\n },\r\n },\r\n lowestSupportedGranularity: 'Day',\r\n disableMovingAverage: true,\r\n addDateChangeListener: () => { },\r\n resizeChartListener,\r\n resizeEventHandler: () => { },\r\n };\r\n\r\n return optionsInner;\r\n }, [appState, chartPreference, instrumentation, isShowChart, pageContext, palette.themePrimary, resizeChartListener]);\r\n\r\n const dataSource = useMemo(() => getDataSource(), [getDataSource]);\r\n\r\n const options = useMemo(() => getOptions(), [getOptions]);\r\n\r\n const getNewDateRange = useCallback(() => {\r\n const newDateRange = waterfallDateFilterProcessor(\r\n [\r\n {\r\n filter: dateFilter,\r\n },\r\n ],\r\n serverContext\r\n );\r\n\r\n return newDateRange;\r\n }, [dateFilter, serverContext]);\r\n\r\n useEffect(() => {\r\n const newDateRange = getNewDateRange();\r\n if (!_.isEqual(dateRange, newDateRange)) {\r\n setDateRange(newDateRange);\r\n }\r\n }, [dateFilter, dateRange, getNewDateRange]);\r\n\r\n useEffect(() => {\r\n const resizeChartHandler = resizeChart.current;\r\n if (resizeChartHandler && isShowChart && forceToResizeChart) {\r\n const newWidth = resizeWidth();\r\n if (newWidth > 0) {\r\n resizeChartHandler(newWidth);\r\n }\r\n }\r\n }, [resizeWidth, isShowChart, forceToResizeChart]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nAdStudioInlineChartWrapperInner.propTypes = {\r\n isShowChart: PropTypes.bool.isRequired,\r\n loadPerfTimeSeriesData: PropTypes.func.isRequired,\r\n dateFilter: PropTypes.shape({}),\r\n perfMarker: PropTypes.shape({}),\r\n serverContext: PropTypes.shape({\r\n DynamicPermissions: PropTypes.shape({\r\n InlineChartColumnMerticsEnabled: PropTypes.bool,\r\n CampaignsCombineGridAndChartOdataCallEnabled: PropTypes.bool,\r\n }),\r\n }),\r\n instrumentation: PropTypes.shape({}),\r\n chartPreference: PropTypes.shape({}),\r\n pageContext: PropTypes.shape({}),\r\n i18nInlineChart: PropTypes.shape({}).isRequired,\r\n filters: PropTypes.shape({}),\r\n appState: PropTypes.shape({}),\r\n forceToResizeChart: PropTypes.string,\r\n};\r\n\r\nAdStudioInlineChartWrapperInner.defaultProps = {\r\n dateFilter: null,\r\n perfMarker: null,\r\n serverContext: null,\r\n instrumentation: null,\r\n chartPreference: undefined,\r\n pageContext: null,\r\n filters: {},\r\n appState: null,\r\n forceToResizeChart: null,\r\n};\r\n\r\nexport const AdStudioInlineChartWrapper = withInstrumentation(AdStudioInlineChartWrapperInner);\r\n\r\n","import Promise from 'bluebird';\r\nimport React, { useCallback, useMemo } from 'react';\r\n\r\nimport { ChartDataAdapter } from '@bingads-webui-campaign-react/inline-chart';\r\nimport appConfig from '@bingads-webui-component-legacy/config/index';\r\nimport { InlineChartPreferences } from '@bingads-webui-campaign/inline-chart-preferences';\r\nimport { store, adapter } from '@bingads-webui-component-legacy/bingads-grid/service/grid-preferences';\r\nimport preferenceServiceLegacy from '@bingads-webui-component-legacy/preference/service/index';\r\nimport globalPageContext from '@bingads-webui-static-legacy/page-context';\r\nimport appState from '@bingads-webui-component-legacy/state/index';\r\nimport { AdStudioInlineChartWrapper } from '../inline-chart-wrapper';\r\n\r\nexport const useAdStudioInlineChart = ({\r\n serverContext, globalLegacyI18n, getPageContext, forceToResizeChart,\r\n}) => {\r\n const pageContext = useMemo(() => (getPageContext ? getPageContext() : globalPageContext), [getPageContext]);\r\n const i18nInlineChart = useMemo(() => globalLegacyI18n && globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!@bingads-webui-campaign-react/inline-chart'), [globalLegacyI18n]);\r\n\r\n const chartPreference = useMemo(() => {\r\n const preferencePromise = preferenceServiceLegacy.initialize().then(() => Promise.promisifyAll(preferenceServiceLegacy));\r\n return new InlineChartPreferences(\r\n store,\r\n appConfig,\r\n adapter,\r\n preferencePromise\r\n );\r\n }, []);\r\n\r\n const chartDataAdapter = useMemo(() => new ChartDataAdapter({\r\n i18n: i18nInlineChart,\r\n permissions: pageContext.Permissions,\r\n gridName: pageContext.CurrentGridName,\r\n lowestSupportedGranularity: 'Day',\r\n }), [i18nInlineChart, pageContext]);\r\n\r\n const getChartPreference = useCallback(() => chartDataAdapter.getPreferencesAndDefaults(\r\n chartPreference,\r\n pageContext\r\n ), [chartDataAdapter, chartPreference, pageContext]);\r\n pageContext.CurrentTabId = 'Asset';\r\n\r\n const renderInlineChart = ({\r\n isChartShown, filters, loadPerfTimeSeriesData, perfMetricDateRange, perfMarker,\r\n }) => (\r\n \r\n );\r\n\r\n const getGranularityEnum = useCallback(perfMetricDateRange => getChartPreference().then(({ granularityId }) => {\r\n const dateRange = { ...perfMetricDateRange, start: new Date(perfMetricDateRange.RangeStartDate), end: new Date(perfMetricDateRange.RangeEndDate) };\r\n if (chartDataAdapter.reevaluateGranularity && chartDataAdapter.getGranularityEnum) {\r\n const newGranularityId = chartDataAdapter.reevaluateGranularity(dateRange, granularityId);\r\n return chartDataAdapter.getGranularityEnum(newGranularityId);\r\n }\r\n return 'Day';\r\n }), [chartDataAdapter, getChartPreference]);\r\n\r\n return { renderInlineChart, getChartPreference, getGranularityEnum };\r\n};\r\n","// copied from @bingads-webui-campaign-react/wizard-shared-components/utils/p$dadeRange to avoid depending on bing-maps\r\nimport Promise from 'bluebird';\r\nimport { WaterfallFilterStorage, WaterfallFilterType, waterfallDateFilterProcessor } from '@bingads-webui-campaign/filter-storage';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { PreferenceContext } from '@bingads-webui-react/preference-context';\r\nimport { useContext } from 'react';\r\n\r\nfunction useDateRangeDefault() {\r\n const preferenceService = useContext(PreferenceContext);\r\n const serverContext = useContext(ServerContext);\r\n const waterfallFilterStorage = new WaterfallFilterStorage({\r\n preferenceService,\r\n });\r\n const waterFallDateFilters = waterfallFilterStorage.getFilters([WaterfallFilterType.DateFilter]);\r\n const dateFilter = waterfallDateFilterProcessor(waterFallDateFilters, serverContext);\r\n return dateFilter;\r\n}\r\n\r\nexport function useP$DaterangeDefault() {\r\n const dateFilter = useDateRangeDefault();\r\n return Promise.resolve(dateFilter);\r\n}\r\n","import { shorthands } from '@fluentui/react-components';\r\nimport { getInlineDownloadStyle, helpbuttonStyle, datePickerStyle } from '@bingads-webui-campaign-react/common-styles';\r\n\r\nexport const inlineDownloadStyle = (_, theme) => ({\r\n '@global': {\r\n ...datePickerStyle(theme),\r\n },\r\n InlineDownloadWrapper: {\r\n marginTop: '24px',\r\n position: 'relative',\r\n zIndex: '11',\r\n ...getInlineDownloadStyle({}),\r\n '& button.btn': {\r\n marginRight: '8px',\r\n },\r\n \"& input[type='checkbox']\": {\r\n bottom: '0',\r\n },\r\n '& .helpbutton': helpbuttonStyle({})['.helpbutton'],\r\n '& .helpbutton::before': {\r\n ...helpbuttonStyle({})['.helpbutton::before'],\r\n position: 'static',\r\n top: 'unset',\r\n },\r\n '& .helpbutton:after': {\r\n content: 'none',\r\n },\r\n '& .glyphicon-remove': {\r\n // color: `${theme.palette.themePrimary}`,\r\n },\r\n '& .form-horizontal .form-group': {\r\n marginLeft: '0',\r\n marginRight: '0',\r\n },\r\n '& .panel': {\r\n boxShadow: 'none',\r\n '& .panel-heading ': {\r\n ...shorthands.padding('0px'),\r\n fontWeight: '600',\r\n '& .panel-title': {\r\n fontSize: '20px',\r\n fontWeight: '600',\r\n lineHeight: '27px',\r\n },\r\n },\r\n '& .panel-body': {\r\n lineHeight: '19px',\r\n paddingLeft: '0px',\r\n marginBottom: '18px',\r\n paddingBottom: '0px',\r\n\r\n '& .helpbutton': {\r\n marginLeft: '7px',\r\n },\r\n },\r\n },\r\n },\r\n});\r\n","import React, { useContext, useMemo, useRef, useEffect } from 'react';\r\nimport _ from 'underscore';\r\nimport classNames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport Promise from 'bluebird';\r\nimport $ from 'jquery';\r\nimport { withServerContext, ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getTabbableNodes } from '@bingads-webui-react/focus-lock';\r\nimport { useP$DaterangeDefault } from './use-date-default';\r\nimport { inlineDownloadStyle } from './styles';\r\n\r\n// TODO: support segments for inline download\r\nexport function useInlineDownload({\r\n processReportRule = _.identity,\r\n customDownloadService = undefined,\r\n downloadFormats = undefined,\r\n entity,\r\n totalRecordCount,\r\n validateSegmentType = () => true,\r\n isFeedbackEnabled = undefined,\r\n data = { SegmentationTypes: [] },\r\n InlineDownloadCampaignODataRepository,\r\n isForVNext = true,\r\n p$daterange = undefined,\r\n localizedHeaders,\r\n odataColumnNames,\r\n serverContext,\r\n filterUrlParam,\r\n serializedFilter,\r\n}) {\r\n const p$daterangeDefaultValue = useP$DaterangeDefault();\r\n\r\n const p$daterangeDefault = () => p$daterangeDefaultValue;\r\n\r\n const segmentationTypes = [];\r\n\r\n if (serverContext && serverContext.Permissions && serverContext.Permissions.IsCustomerHierarchyEnabled) {\r\n _.extend(data, { IsCustomerHierachyRequest: true });\r\n }\r\n\r\n const repository = _.isFunction(customDownloadService) ? {\r\n download({\r\n Format,\r\n SegmentationTypes,\r\n }) {\r\n customDownloadService(Format, SegmentationTypes[0]);\r\n return Promise.resolve();\r\n },\r\n } : new InlineDownloadCampaignODataRepository({\r\n odataColumnNames,\r\n localizedHeaders,\r\n entity,\r\n filterUrlParam,\r\n serializedFilter,\r\n processReportRule,\r\n isForVNext,\r\n p$daterange: p$daterange || p$daterangeDefault,\r\n });\r\n\r\n return {\r\n isForVNext,\r\n totalRecordCount,\r\n repository,\r\n downloadFormats,\r\n segmentationTypes,\r\n validateSegmentType,\r\n isFeedbackEnabled,\r\n data,\r\n allUsersType: entity === 'Account' ? 'Customer' : 'Account',\r\n };\r\n}\r\n\r\n// Generate a inline download react from with default props and propTypes\r\nconst InlineDownloadWrapperInternal = React.memo((props) => {\r\n const serverContext = useContext(ServerContext);\r\n const classes = useDefaultStyles(inlineDownloadStyle);\r\n const inlineDownloadRef = useRef();\r\n const {\r\n setDownloadShown,\r\n getInlineDownloadColumns,\r\n getInlineDownloadFilter,\r\n ReportEmailRule,\r\n InlineDownloadReactForm,\r\n InlineDownloadCampaignODataRepository,\r\n totalAssetCount,\r\n } = props;\r\n\r\n const {\r\n localizedHeaders,\r\n odataColumnNames,\r\n } = useMemo(getInlineDownloadColumns, []);\r\n\r\n const {\r\n filterUrlParam,\r\n serializedFilter,\r\n } = useMemo(getInlineDownloadFilter, []);\r\n\r\n const inlineDownloadConfigs = useInlineDownload({\r\n serverContext,\r\n entity: 'Folder',\r\n totalRecordCount: totalAssetCount,\r\n downloadFormats: [\r\n 'Csv',\r\n 'Tsv',\r\n 'Xlsx',\r\n 'Csvzip',\r\n ],\r\n InlineDownloadCampaignODataRepository,\r\n validateSegmentType: () => true,\r\n isFeedbackEnabled: false,\r\n data: ReportEmailRule || ({ SegmentationTypes: [] }),\r\n isForVNext: true,\r\n p$daterange: undefined,\r\n localizedHeaders,\r\n odataColumnNames,\r\n filterUrlParam,\r\n serializedFilter,\r\n });\r\n\r\n useEffect(() => {\r\n if (inlineDownloadRef && inlineDownloadRef.current) {\r\n // filter the not visible element out which may due to parent display property\r\n const tabbableNode = _.filter(getTabbableNodes(inlineDownloadRef.current), item => $(item).is(':visible'));\r\n if (tabbableNode && tabbableNode.length > 0) {\r\n tabbableNode[0].focus({\r\n preventScroll: true,\r\n });\r\n }\r\n }\r\n });\r\n\r\n useEffect(() => () => {\r\n // focus on the download button after the inline download form closed\r\n const downloadButton = document.querySelector('#button-download');\r\n // wait for the download button rendered\r\n if (downloadButton && downloadButton.focus) {\r\n setTimeout(() => {\r\n downloadButton.focus();\r\n });\r\n }\r\n }, []);\r\n\r\n return (\r\n
\r\n setDownloadShown(false)}\r\n totalRecordCount={totalAssetCount}\r\n downloadFormats={inlineDownloadConfigs.downloadFormats}\r\n segmentationTypes={[]}\r\n validateSegmentType={() => true} // if we don't have segment type, we don't need to validate it\r\n isFeedbackEnabled={false}\r\n data={inlineDownloadConfigs.data}\r\n allUsersType={inlineDownloadConfigs.allUsersType}\r\n repository={inlineDownloadConfigs.repository}\r\n clearAfterDownloadCall={false}\r\n isForVNext\r\n downloadBoxRole=\"listbox\"\r\n downloadFormatsRole=\"option\"\r\n />\r\n
\r\n );\r\n});\r\n\r\nInlineDownloadWrapperInternal.propTypes = {\r\n setDownloadShown: PropTypes.func,\r\n totalAssetCount: PropTypes.number.isRequired,\r\n ReportEmailRule: PropTypes.shape({}),\r\n getInlineDownloadColumns: PropTypes.func.isRequired,\r\n getInlineDownloadFilter: PropTypes.func.isRequired,\r\n InlineDownloadReactForm: PropTypes.element.isRequired,\r\n InlineDownloadCampaignODataRepository: PropTypes.func.isRequired,\r\n};\r\n\r\nInlineDownloadWrapperInternal.defaultProps = {\r\n setDownloadShown: () => {},\r\n ReportEmailRule: undefined,\r\n};\r\n\r\nconst DelayedInlineDownloadWrapperInternal = React.lazy(() =>\r\n import(/* webpackMode: 'eager' */ '@bingads-webui-campaign-legacy/griddownload/view/loader')\r\n .then(({ InlineDownloadReactForm, InlineDownloadCampaignODataRepository }) => ({\r\n default: React.memo(props => ()),\r\n })));\r\n\r\nexport const InlineDownloadWrapper = withServerContext(DelayedInlineDownloadWrapperInternal);\r\n","import React, { useMemo, useState, useEffect } from 'react';\r\nimport appState from '@bingads-webui-component-legacy/state/index';\r\nimport { parseSync } from '@bingads-webui/safe-json';\r\nimport { InlineDownloadWrapper } from '../inline-download-wrapper';\r\n\r\nconst getReportEmailRule = () => {\r\n const rule = appState.get('$ReportEmailRule');\r\n appState.unset('$ReportEmailRule');\r\n return rule;\r\n};\r\n\r\nexport const useInlineDownload = ({ overwriteFilters }) => {\r\n // ReportEmailRule state from appState is for the filter, columns and date range from the task\r\n // items of the report grid. We need to get it from appState and then remove it from appState\r\n // so that it doesn't get used in next show of the inline download.\r\n const ReportEmailRule = getReportEmailRule();\r\n const [isDownloadShown, setDownloadShown] = useState(!!ReportEmailRule);\r\n const ReportEmailRuleSnapshot = useMemo(() => ReportEmailRule, [isDownloadShown]);\r\n\r\n // Ensure not rerendering root after mount\r\n const renderInlineDownload = useMemo(\r\n () => props => (),\r\n [ReportEmailRuleSnapshot]\r\n );\r\n\r\n useEffect(() => {\r\n if (ReportEmailRuleSnapshot && ReportEmailRuleSnapshot.Filter && overwriteFilters) {\r\n // Filter is a stringified JSON object in the serializedFilter of the inline download API call.\r\n // We need to parse it and then overwrite the filters in the grid with the parsed filters.\r\n const filters = parseSync(ReportEmailRuleSnapshot.Filter);\r\n overwriteFilters(filters);\r\n }\r\n }, [overwriteFilters]);\r\n\r\n return {\r\n renderInlineDownload,\r\n ReportEmailRule,\r\n isDownloadShown,\r\n setDownloadShown,\r\n };\r\n};\r\n","/* eslint-disable react-hooks/rules-of-hooks */\r\nimport React from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { CivilDate } from 'tc39-proposal-temporal';\r\nimport { ComparedDateRangePicker, RANGES } from '@bingads-webui-react/compared-date-range-picker';\r\nimport { withScope } from '@bingads-webui-react/scope-service';\r\nimport { setClarityTag } from '@bingads-webui-universal/clarity';\r\nimport { withInstrumentation } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { generateDateData, getRangesFromData, translateLegacyToIANATimezone } from '@bingads-webui-universal/temporal-utitlities';\r\n\r\nconst updateToWaterfallFilter = (props, dateFromDatePicker) => {\r\n const data = generateDateData(\r\n props.i18n,\r\n dateFromDatePicker,\r\n props.dateFormat,\r\n props.lcid,\r\n translateLegacyToIANATimezone(props.timeZone)\r\n );\r\n const isDateRangeChange = data.RangeId !== props.dateFilter.RangeId || data.RangeId === RANGES.Custom;\r\n let isComparedDateChange = false;\r\n if ((data.compared && !props.dateFilter.compared) || (props.dateFilter.compared && !data.compared)) {\r\n isComparedDateChange = true;\r\n } else if (data.compared && props.dateFilter.compared) {\r\n if (data.compared.key !== props.dateFilter.compared.key) {\r\n isComparedDateChange = true;\r\n } else if (data.compared.formattedEnd !== props.dateFilter.compared.formattedEnd || data.compared.formattedStart !== props.dateFilter.compared.formattedStart) {\r\n isComparedDateChange = true;\r\n }\r\n }\r\n if (isDateRangeChange || isComparedDateChange) {\r\n console.log('updated data:', data, 'original data:', props.dateFilter);\r\n props.updateWaterfallFilter(data);\r\n }\r\n};\r\n\r\nconst DatePicker = React.memo((props) => {\r\n const {\r\n i18n,\r\n dateFilter,\r\n dateFormat,\r\n lcid,\r\n timeZone,\r\n onSwitchCompare,\r\n instrumentation,\r\n disableCompare,\r\n minDate,\r\n serverContext,\r\n rangeIds,\r\n } = props;\r\n const { selectedRange, selectedComparedRange } =\r\n getRangesFromData(i18n, dateFilter, dateFormat, lcid);\r\n\r\n const dateRangePickedLogger = React.useMemo(() => {\r\n if (instrumentation.datePicker && instrumentation.datePicker.create) {\r\n return instrumentation.datePicker.create().dateRangePicked.create();\r\n }\r\n return null;\r\n }, [instrumentation]);\r\n\r\n const dateRangeLogger = (dateRange) => {\r\n if (dateRangePickedLogger) {\r\n dateRangePickedLogger.trace({\r\n dateRange,\r\n });\r\n }\r\n if (dateRange != null && dateRange.method === 'onApply') {\r\n setClarityTag({ DatePickerOnApply: 'true' });\r\n }\r\n if (dateRange != null && dateRange.method === 'onQuickApply') {\r\n setClarityTag({ DatePickerOnQuickApply: 'true' });\r\n }\r\n };\r\n\r\n const isImprovedDateRangePickerEnabled = serverContext.DynamicPermissions && serverContext.DynamicPermissions.ImprovedDateFilter;\r\n\r\n return (\r\n updateToWaterfallFilter(props, dateFromDatePicker)}\r\n onSwitchCompare={onSwitchCompare}\r\n dateRangeLogger={dateRangeLogger}\r\n disableCompare={disableCompare}\r\n rangeIds={rangeIds}\r\n minDate={minDate}\r\n />);\r\n});\r\n\r\nDatePicker.propTypes = {\r\n dateFilter: PropTypes.shape({\r\n RangeStartDate: PropTypes.string,\r\n RangeEndDate: PropTypes.string,\r\n RangeId: PropTypes.number,\r\n Rangelcid: PropTypes.number,\r\n RangeIndex: PropTypes.number,\r\n RangeDays: PropTypes.number,\r\n compared: PropTypes.shape({\r\n start: PropTypes.instanceOf(Date),\r\n end: PropTypes.instanceOf(Date),\r\n formattedStart: PropTypes.string,\r\n formattedEnd: PropTypes.string,\r\n key: PropTypes.string,\r\n text: PropTypes.string,\r\n }),\r\n }),\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n // eslint-disable-next-line\r\n lcid: PropTypes.number.isRequired,\r\n timeZone: PropTypes.number.isRequired,\r\n dateFormat: PropTypes.string.isRequired,\r\n onSwitchCompare: PropTypes.func,\r\n // eslint-disable-next-line react/forbid-prop-types\r\n instrumentation: PropTypes.object.isRequired,\r\n disableCompare: PropTypes.bool,\r\n serverContext: PropTypes.shape({\r\n DynamicPermissions: PropTypes.shape({\r\n ImprovedDateFilter: PropTypes.bool,\r\n }),\r\n }),\r\n minDate: PropTypes.instanceOf(CivilDate),\r\n};\r\n\r\nDatePicker.defaultProps = {\r\n dateFilter: {},\r\n disableCompare: false,\r\n minDate: null,\r\n serverContext: {},\r\n onSwitchCompare: _.noop,\r\n};\r\n\r\nexport const DatePickerWithScope = withInstrumentation(withScope(DatePicker));\r\n","import React, { useMemo } from 'react';\r\nimport _ from 'underscore';\r\nimport { makeStyles, shorthands } from '@fluentui/react-components';\r\nimport { ToolbarContainer } from '@bingads-webui-campaign-react/toolbar-container';\r\n\r\nconst usePerfPageToolbarStyle = makeStyles({\r\n toolbarFilterContainer: {\r\n flexGrow: '1 !important',\r\n ...shorthands.padding('hidden'),\r\n\r\n '& .filter-list': {\r\n paddingTop: '10px',\r\n '& .asset-library-search': {\r\n display: 'inline-block',\r\n position: 'relative',\r\n top: '2px',\r\n },\r\n },\r\n\r\n '& .filter-list-editing': {\r\n '& .dropdown-filter-container': {\r\n display: 'inline-block',\r\n paddingTop: '12px',\r\n },\r\n\r\n '& .asset-library-search': {\r\n display: 'inline-block',\r\n paddingTop: '12px',\r\n },\r\n\r\n '& .top-rated-performance-filter': {\r\n alignSelf: 'center',\r\n },\r\n },\r\n },\r\n});\r\n\r\nexport const useToolbarContainer = ({ isHideShowGraphButton }) => {\r\n const classes = usePerfPageToolbarStyle();\r\n\r\n const toolbarSelectedConfig = useMemo(() => new Map(), []);\r\n\r\n const renderToolbarContainer = ({\r\n i18n, filterBar, setDownloadShown, isChartShown, setChartShown, isEditingFilter,\r\n }) => {\r\n const toolbarUnselectedConfigList = [\r\n ['filter-bar', {\r\n id: 'filter-bar',\r\n type: 'custom',\r\n classes: classes.toolbarFilterContainer,\r\n content: filterBar,\r\n }],\r\n ['button-download', {\r\n type: 'nav-item',\r\n text: i18n.getString(_TL_('Download')),\r\n description: i18n.getString(_TL_('The download form is currently hidden. Select \"Download\" to display it')),\r\n id: 'button-download',\r\n iconLeftGlyphName: 'ba-Download',\r\n onClick: () => {\r\n setDownloadShown(true);\r\n },\r\n classes: 'button-download-form',\r\n }],\r\n ['expand-table', { type: 'expand-table' }],\r\n ];\r\n\r\n if (!isHideShowGraphButton) {\r\n toolbarUnselectedConfigList.push(['button-chart-toggle', {\r\n type: 'nav-item',\r\n text: isChartShown ? i18n.getString(_TL_('Hide graph')) : i18n.getString(_TL_('Show graph')),\r\n description: isChartShown\r\n ? i18n.getString(_TL_('The performance graph is currently displayed. Select \"Hide graph\" to hide it.'))\r\n : i18n.getString(_TL_('The performance graph is currently hidden. Select \"Show graph\" to display it.')),\r\n id: 'button-chart-toggle',\r\n iconLeftGlyphName: isChartShown ? 'ba-Hide3' : 'ba-View',\r\n expanded: isChartShown,\r\n onClick: () => {\r\n setChartShown(!isChartShown);\r\n },\r\n classes: isChartShown ? 'button-hide-graph' : 'button-show-graph',\r\n }]);\r\n }\r\n\r\n const toolbarUnselectedConfig = new Map(toolbarUnselectedConfigList);\r\n\r\n const toolbarConfigInEditingFilterMode = new Map([\r\n ['filter-bar', {\r\n id: 'filter-bar',\r\n type: 'custom',\r\n classes: classes.toolbarFilterContainer,\r\n content: filterBar,\r\n }],\r\n ]);\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n return { renderToolbarContainer };\r\n};\r\n","import { notificationApi as originNotificationApi } from '@bingads-webui-campaign/notification-center';\r\nimport { INotificationApi, INotificationExtraOptions } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nexport const notificationApi: INotificationApi = {\r\n showWarning: (message: string, extraOptions?: INotificationExtraOptions): void | string => originNotificationApi.showWarning(message, extraOptions),\r\n showInfo: (message: string, extraOptions?: INotificationExtraOptions): void | string => originNotificationApi.showInfo(message, extraOptions),\r\n dismiss: (id: string): void => {\r\n originNotificationApi.dismiss(id);\r\n },\r\n};\r\n","import _ from 'underscore';\r\nimport { getRangesFromData } from '@bingads-webui-universal/temporal-utitlities';\r\nimport { odataErrorCodes } from '@bingads-webui-campaign/instrumentation';\r\nimport { CSMLSortBy, getErrorString } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nexport const createFolderFilterQuery = ({\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n isVideoDurationBoundaryIncluded = false,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n assetType,\r\n sourceType,\r\n assetSources,\r\n folderId,\r\n hasPerfData,\r\n topRated,\r\n}) => {\r\n const filterPredicates = [];\r\n\r\n if (assetType) {\r\n filterPredicates.push(`FolderAssetType eq '${assetType}'`);\r\n }\r\n if (minWidth) {\r\n filterPredicates.push(`Width gt ${minWidth}`);\r\n }\r\n if (minHeight) {\r\n filterPredicates.push(`Height gt ${minHeight}`);\r\n }\r\n\r\n if (minVideoDuration) {\r\n if (isVideoDurationBoundaryIncluded) {\r\n filterPredicates.push(`VideoDuration ge ${minVideoDuration}`);\r\n } else {\r\n filterPredicates.push(`VideoDuration gt ${minVideoDuration}`);\r\n }\r\n }\r\n if (maxVideoDuration) {\r\n if (isVideoDurationBoundaryIncluded) {\r\n filterPredicates.push(`VideoDuration le ${maxVideoDuration}`);\r\n } else {\r\n filterPredicates.push(`VideoDuration lt ${maxVideoDuration}`);\r\n }\r\n }\r\n\r\n if (dateAddedStart && dateAddedEnd && dateAddedStart === dateAddedEnd) {\r\n filterPredicates.push(`CreatedTime eq ${dateAddedStart}`);\r\n } else {\r\n if (dateAddedStart) {\r\n filterPredicates.push(`CreatedTime ge ${dateAddedStart}`);\r\n }\r\n if (dateAddedEnd) {\r\n filterPredicates.push(`CreatedTime le ${dateAddedEnd}`);\r\n }\r\n }\r\n if (sourceType) {\r\n filterPredicates.push(`SourceType eq '${sourceType}'`);\r\n }\r\n if (!_.isEmpty(assetSources)) {\r\n filterPredicates.push(`AssetSourceType in (${assetSources.map(s => `'${s}'`).join(',')})`);\r\n }\r\n if (searchTerm) {\r\n filterPredicates.push(`contains(BroadSearchFields, '${searchTerm}')`);\r\n }\r\n\r\n if (folderId) {\r\n filterPredicates.push(`FolderId eq ${folderId}`);\r\n }\r\n\r\n if (hasPerfData) {\r\n filterPredicates.push('PerformanceMetrics/Impressions gt 0');\r\n }\r\n\r\n if (topRated) {\r\n filterPredicates.push(\"AssetPerformanceRating eq 'Best'\");\r\n }\r\n\r\n const filterQuery = filterPredicates.length > 0 ?\r\n `${filterPredicates.join(' and ')}` : '';\r\n\r\n return filterQuery ? `$filter=${filterQuery}` : '';\r\n};\r\n\r\nconst formatCivilDateString = (civilDate) => {\r\n if (!civilDate) return '';\r\n\r\n const { year, month, day } = civilDate;\r\n if (!year || !month || !day) return '';\r\n\r\n return `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}`;\r\n};\r\n\r\nexport const getDateRangeParams = (i18n, dateData, dateFormat, lcid) => {\r\n const { selectedRange, selectedComparedRange } = getRangesFromData(i18n, dateData, dateFormat, lcid) || {};\r\n if (selectedRange) {\r\n const startParamStr = formatCivilDateString(selectedRange.start);\r\n const endParamStr = formatCivilDateString(selectedRange.end);\r\n const comparisonStartDateStr = selectedComparedRange ? formatCivilDateString(selectedComparedRange.start) : null;\r\n const comparisonEndDateStr = selectedComparedRange ? formatCivilDateString(selectedComparedRange.end) : null;\r\n\r\n return {\r\n startDate: startParamStr,\r\n endDate: endParamStr,\r\n comparisonStartDate: comparisonStartDateStr,\r\n comparisonEndDate: comparisonEndDateStr,\r\n };\r\n }\r\n return {};\r\n};\r\n\r\n// dateStr: string in format like 2022-06-21T08:55:59.807-07:00\r\nexport const parseMTDateString = (i18n, dateStr) => {\r\n if (!dateStr) {\r\n return null;\r\n }\r\n // remove the millisecs part to avoid parsing fail (the length of millisecs part is variable)\r\n const str = dateStr.replace(/\\.\\d+/, '');\r\n const options = {\r\n raw: 'yyyy-MM-ddTHH:mm:ssZZZZZ',\r\n timeZone: null,\r\n };\r\n const date = i18n.parseDate(str, options);\r\n return date;\r\n};\r\n\r\nexport const CSMLSortingRequestParams = {\r\n [CSMLSortBy.MostRecentAsc]: { sortBy: 'ModifiedTime', sortDirection: 'asc' },\r\n [CSMLSortBy.MostRecent]: { sortBy: 'ModifiedTime', sortDirection: 'desc' },\r\n\r\n [CSMLSortBy.ImageName]: { sortBy: 'Text', sortDirection: 'asc' },\r\n [CSMLSortBy.ImageNameDesc]: { sortBy: 'Text', sortDirection: 'desc' },\r\n [CSMLSortBy.LastCreated]: { sortBy: 'CreatedTime', sortDirection: 'desc' },\r\n [CSMLSortBy.LastCreatedAsc]: { sortBy: 'CreatedTime', sortDirection: 'asc' },\r\n\r\n [CSMLSortBy.AssetIdAsc]: { sortBy: 'AssetId', sortDirection: 'asc' },\r\n [CSMLSortBy.AssetIdDesc]: { sortBy: 'AssetId', sortDirection: 'desc' },\r\n\r\n [CSMLSortBy.ClickAsc]: { sortBy: 'PerformanceMetrics/Clicks', sortDirection: 'asc' },\r\n [CSMLSortBy.ClickDesc]: { sortBy: 'PerformanceMetrics/Clicks', sortDirection: 'desc' },\r\n [CSMLSortBy.ClickPeriodAsc]: { sortBy: 'PoPPerformanceMetrics/Clicks', sortDirection: 'asc' },\r\n [CSMLSortBy.ClickPeriodDesc]: { sortBy: 'PoPPerformanceMetrics/Clicks', sortDirection: 'desc' },\r\n [CSMLSortBy.ClickChangeAsc]: { sortBy: 'PoPPerformanceMetricsChange/Clicks', sortDirection: 'asc' },\r\n [CSMLSortBy.ClickChangeDesc]: { sortBy: 'PoPPerformanceMetricsChange/Clicks', sortDirection: 'desc' },\r\n [CSMLSortBy.ClickChangePercentAsc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/Clicks', sortDirection: 'asc' },\r\n [CSMLSortBy.ClickChangePercentDesc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/Clicks', sortDirection: 'desc' },\r\n\r\n [CSMLSortBy.CTRAsc]: { sortBy: 'PerformanceMetrics/CTR', sortDirection: 'asc' },\r\n [CSMLSortBy.CTRDesc]: { sortBy: 'PerformanceMetrics/CTR', sortDirection: 'desc' },\r\n [CSMLSortBy.CTRPeriodAsc]: { sortBy: 'PoPPerformanceMetrics/CTR', sortDirection: 'asc' },\r\n [CSMLSortBy.CTRPeriodDesc]: { sortBy: 'PoPPerformanceMetrics/CTR', sortDirection: 'desc' },\r\n [CSMLSortBy.CTRChangeAsc]: { sortBy: 'PoPPerformanceMetricsChange/CTR', sortDirection: 'asc' },\r\n [CSMLSortBy.CTRChangeDesc]: { sortBy: 'PoPPerformanceMetricsChange/CTR', sortDirection: 'desc' },\r\n [CSMLSortBy.CTRChangePercentAsc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/CTR', sortDirection: 'asc' },\r\n [CSMLSortBy.CTRChangePercentDesc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/CTR', sortDirection: 'desc' },\r\n\r\n [CSMLSortBy.ImpressionAsc]: { sortBy: 'PerformanceMetrics/Impressions', sortDirection: 'asc' },\r\n [CSMLSortBy.ImpressionDesc]: { sortBy: 'PerformanceMetrics/Impressions', sortDirection: 'desc' },\r\n [CSMLSortBy.ImpressionPeriodAsc]: { sortBy: 'PoPPerformanceMetrics/Impressions', sortDirection: 'asc' },\r\n [CSMLSortBy.ImpressionPeriodDesc]: { sortBy: 'PoPPerformanceMetrics/Impressions', sortDirection: 'desc' },\r\n [CSMLSortBy.ImpressionChangeAsc]: { sortBy: 'PoPPerformanceMetricsChange/Impressions', sortDirection: 'asc' },\r\n [CSMLSortBy.ImpressionChangeDesc]: { sortBy: 'PoPPerformanceMetricsChange/Impressions', sortDirection: 'desc' },\r\n [CSMLSortBy.ImpressionChangePercentAsc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/Impressions', sortDirection: 'asc' },\r\n [CSMLSortBy.ImpressionChangePercentDesc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/Impressions', sortDirection: 'desc' },\r\n\r\n [CSMLSortBy.SpendAsc]: { sortBy: 'PerformanceMetrics/Spend', sortDirection: 'asc' },\r\n [CSMLSortBy.SpendDesc]: { sortBy: 'PerformanceMetrics/Spend', sortDirection: 'desc' },\r\n [CSMLSortBy.SpendPeriodAsc]: { sortBy: 'PoPPerformanceMetrics/Spend', sortDirection: 'asc' },\r\n [CSMLSortBy.SpendPeriodDesc]: { sortBy: 'PoPPerformanceMetrics/Spend', sortDirection: 'desc' },\r\n [CSMLSortBy.SpendChangeAsc]: { sortBy: 'PoPPerformanceMetricsChange/Spend', sortDirection: 'asc' },\r\n [CSMLSortBy.SpendChangeDesc]: { sortBy: 'PoPPerformanceMetricsChange/Spend', sortDirection: 'desc' },\r\n [CSMLSortBy.SpendChangePercentAsc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/Spend', sortDirection: 'asc' },\r\n [CSMLSortBy.SpendChangePercentDesc]: { sortBy: 'PoPPerformanceMetricsChangePercentage/Spend', sortDirection: 'desc' },\r\n};\r\n\r\n// get date string with offset, such as: '2022-01-01+08:00'\r\nexport const formatCivilDate = (i18n, civilDate, timeZone, utcOffset, timeStr) => {\r\n const rawFormat = timeStr ? `yyyy-MM-ddT${timeStr}` : 'yyyy-MM-dd';\r\n const dateStr = i18n.formatCivilDate(civilDate, { raw: rawFormat, timeZone });\r\n // encode '+' char\r\n const offset = utcOffset ? utcOffset.replace('+', '%2B') : '';\r\n return `${dateStr}${offset}`;\r\n};\r\n\r\nexport const isErrorWhitelisted = (error = {}) => {\r\n if (error.errors && error.errors.length === 1) {\r\n const errorCode = error.errors[0].Code;\r\n\r\n if (_.isString(errorCode)) {\r\n return _.contains(odataErrorCodes, errorCode.toUpperCase());\r\n }\r\n }\r\n return false;\r\n};\r\n\r\nexport const handleErrorLogging = (err, api, logger) => {\r\n if (isErrorWhitelisted(err)) {\r\n logger.logTrace(`[IgnoredDataServiceError] ${getErrorString(err)}`, { api });\r\n } else {\r\n logger.logError(err, null, api);\r\n }\r\n};\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nexport const removeNullUndefined = (obj) => {\r\n const newObj = {};\r\n _.keys(obj).forEach((key) => {\r\n if (_.isObject(obj[key])) {\r\n newObj[key] = removeNullUndefined(obj[key]);\r\n } else if (obj[key] !== null && obj[key] !== undefined) {\r\n newObj[key] = obj[key];\r\n }\r\n });\r\n return newObj;\r\n};\r\n","import React from 'react';\r\nimport { PerformancePageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { useAdStudioInlineChart } from './hooks/use-inline-chart';\r\nimport { useInlineDownload } from './hooks/use-inline-download';\r\nimport { useDatePicker } from './hooks/use-date-picker';\r\nimport { useCommonColumn } from './hooks/use-common-columns';\r\nimport { useDetailList } from './hooks/use-detail-list';\r\nimport { useToolbarContainer } from './hooks/use-toolbar-container';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\nimport { createFolderFilterQuery } from '../../services/service-utils';\r\n\r\nconst globalLegacyI18n = window && window.globalLegacyI18n;\r\n\r\nexport const PerformancePage = (props) => {\r\n const {\r\n serverContext, navigation, minDate, i18n, disableCompare, perfMetricDateRange, updateGlobalWaterfallFilter, outRenderInlineChart, isHideShowGraphButton,\r\n } = props;\r\n\r\n const { renderDatePicker } = useDatePicker({\r\n serverContext, minDate, i18n, disableCompare, perfMetricDateRange, updateWaterfallFilter: updateGlobalWaterfallFilter,\r\n });\r\n\r\n const { renderInlineChart, getChartPreference } = useAdStudioInlineChart({\r\n serverContext,\r\n globalLegacyI18n,\r\n // forceToResizeChart,\r\n });\r\n\r\n const { renderHeaderWithPopup } = useCommonColumn();\r\n const { renderDetailsList } = useDetailList();\r\n const { renderToolbarContainer } = useToolbarContainer({ isHideShowGraphButton });\r\n\r\n const onClick = () => {\r\n navigation.gotoHomePage();\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { withInstrumentation } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { CreateDisplayTemplatePageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { withFullScreenWithSummaryBar } from '@bingads-webui-react/app-layout-container';\r\n\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nconst CreateDisplayTemplatePage = props => ();\r\n\r\nconst CreateDisplayTemplatePageWithLayout = withFullScreenWithSummaryBar(withInstrumentation(CreateDisplayTemplatePage));\r\n\r\nexport { CreateDisplayTemplatePageWithLayout as CreateDisplayTemplatePage };\r\n","import React from 'react';\r\nimport { useParams } from 'react-router-dom';\r\nimport { withInstrumentation } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { EditDisplayTemplatePageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { withFullScreenWithSummaryBar } from '@bingads-webui-react/app-layout-container';\r\n\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nconst EditDisplayTemplatePage = (props) => {\r\n const { displayTemplateId: imageId } = useParams();\r\n\r\n return ();\r\n};\r\n\r\nconst PageWithInstrumentation = withFullScreenWithSummaryBar(withInstrumentation(EditDisplayTemplatePage));\r\n\r\nexport { PageWithInstrumentation as EditDisplayTemplatePage };\r\n","import Promise from 'bluebird';\r\nimport { ILogger, getErrorString } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nexport const getLogger = (activity, page = '', version = '', tag = 'Asset Library') : ILogger => {\r\n const {\r\n trace, error, withSignalAsync, // perf, ajax,\r\n } = activity || {};\r\n\r\n const pageName = page;\r\n\r\n const logTrace = (...args) => {\r\n const [msg, params, ...rest] = args;\r\n if (trace) {\r\n const paramsJson = params ? ` $params: ${JSON.stringify(params)}` : '';\r\n trace(`[${tag}]${version ? `[${version}]` : ''}${page ? `[${page}]` : ''} ${msg}${paramsJson}`, ...rest);\r\n }\r\n };\r\n\r\n const logError = (...args) => {\r\n const [err, params, ...rest] = args;\r\n if (error) {\r\n const paramsJson = params ? ` $params: ${JSON.stringify(params)}` : '';\r\n const errMsg = getErrorString(err);\r\n error(`[${tag}] ${errMsg}${paramsJson}`, ...rest);\r\n }\r\n };\r\n\r\n const traceWithoutParams = (...args) => {\r\n const [msg, ...rest] = args;\r\n if (trace) {\r\n trace(`[${tag}] ${msg}`, ...rest);\r\n }\r\n };\r\n\r\n const monitorPromise = ({\r\n promise = undefined,\r\n msg = '',\r\n api = '',\r\n } = {}) => {\r\n if (withSignalAsync && promise) {\r\n withSignalAsync(new Promise((resolve) => {\r\n promise.then(() => { // we only record the success case\r\n resolve({\r\n message: `[${tag}] ${msg}`,\r\n api,\r\n });\r\n }).catch(() => { // tag the failed case with failed\r\n resolve({\r\n message: `[${tag}] ${msg}`,\r\n api: `${api}_failed`,\r\n });\r\n });\r\n }));\r\n }\r\n return promise;\r\n };\r\n\r\n return {\r\n pageName,\r\n logTrace,\r\n logError,\r\n traceWithoutParams,\r\n monitorPromise,\r\n };\r\n};\r\n","import React, { useMemo } from 'react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\nimport { getLogger } from '../../adapters/get-logger';\r\n\r\n// important! do not change the name for each page since they are used in our report\r\nexport const PageNameForLog = {\r\n Landing: 'LandingPage',\r\n Performance: 'PerformancePage',\r\n Images: 'ImagesPage',\r\n DisplayTemplates: 'DisplayTemplatesPage',\r\n Videos: 'VideosPage',\r\n EditVideoPage: 'EditVideosPage',\r\n VideoTemplates: 'VideoTemplatesPage',\r\n BrandKit: 'BrandKitPage',\r\n Library: 'LibraryPage',\r\n CreateDisplayTemplate: 'CreateDisplayTemplatePage',\r\n EditDisplayTemplate: 'EditDisplayTemplatePage',\r\n WebsiteImagePanel: 'WebsiteImagePanel',\r\n StockImagePanel: 'StockImagePanel',\r\n InvestImagePanel: 'InvestImagePanel',\r\n InvestVideoPanel: 'InvestVideoPanel',\r\n AddVideoPanel: 'AddVideoPanel',\r\n SearchResultPage: 'SearchResultPage',\r\n GenerateImagePage: 'GenerateImagePage',\r\n UploadFilesPanelPage: 'UploadFilesPanelPage',\r\n UploadFolderPanelPage: 'UploadFolderPanelPage',\r\n MixedImagePanelPage: 'MixedImagePanelPage',\r\n MixedVideoPanelPage: 'MixedVideoPanelPage',\r\n EditImagePage: 'EditImagePage',\r\n AssetDetailsPage: 'AssetDetailsPage',\r\n BackgroundRemovalModalPage: 'BackgroundRemovalModalPage',\r\n};\r\n\r\nexport const VersionForLog = {\r\n AdsStudioMVP: 'ads-studio-mvp',\r\n};\r\n\r\nexport function withCustomLogForPage(WrappedComponent, { pageName, tag = 'Ads studio' }) {\r\n const Wrapper = (props) => {\r\n const { activity } = props || {};\r\n const version = VersionForLog.AdsStudioMVP; // todo: get version from permissions\r\n\r\n const logger = useMemo(() => getLogger(activity, pageName, version, tag), [activity, version]);\r\n\r\n return ;\r\n };\r\n\r\n Wrapper.displayName = `withCustomLog(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n}\r\n\r\nexport const getLoggerWithoutPageInfo = (activity, version, tag = 'Ads studio') => getLogger(activity, '', version, tag);\r\n\r\n// need update this function before starting new pilot\r\nexport const getLogVersion = () => VersionForLog.AdsStudioMVP;\r\n","export const AdsStudioAppNameODataHeader = {\r\n key: 'x-ms-applicationname',\r\n value: 'bingadsweb-assetlibrary',\r\n};\r\n\r\n","import _ from 'underscore';\r\nimport Promise from 'bluebird';\r\nimport { useEffect, useMemo, useState, useCallback } from 'react';\r\n\r\nconst PREFERENCE_NAME = 'AdsStudioPreference';\r\n\r\nconst usePerference = ({ preferenceService, getterName, setterName }) => {\r\n const [preferenceValue, setPreferenceValue] = useState(null);\r\n\r\n useEffect(() => {\r\n // wait until preferenceService is initialized\r\n if (preferenceService && _.isFunction(preferenceService[getterName])) {\r\n const pref = preferenceService[getterName](PREFERENCE_NAME);\r\n const curValue = pref && !_.isUndefined(pref.Data) ? pref.Data : null;\r\n setPreferenceValue(curValue || {});\r\n }\r\n }, [getterName, preferenceService]);\r\n\r\n const updatePreference = useCallback((newPreferenceValue) => {\r\n if (preferenceService && _.isFunction(preferenceService[setterName])) {\r\n if (!_.isMatch(preferenceValue, newPreferenceValue)) {\r\n const data = { ...preferenceValue || {}, ...newPreferenceValue };\r\n setPreferenceValue(data);\r\n return preferenceService[setterName]({\r\n Name: PREFERENCE_NAME,\r\n Data: data,\r\n });\r\n }\r\n return Promise.resolve(preferenceValue);\r\n }\r\n return Promise.reject(new Error('preference service is not ready.'));\r\n }, [preferenceService, setterName, preferenceValue]);\r\n\r\n const preferences = useMemo(() => {\r\n if (!preferenceValue) {\r\n return null;\r\n }\r\n\r\n // sort by\r\n const { sortBy } = preferenceValue || {};\r\n const setSortBy = (newSortBy) => {\r\n updatePreference({ sortBy: newSortBy });\r\n };\r\n\r\n // add assets teaching bubble\r\n // show at most 3 times, if users clicked any button, only shown once\r\n let { addFoldersTeachingBubbleAllowedShowCount } = preferenceValue || {};\r\n if (!_.isNumber(addFoldersTeachingBubbleAllowedShowCount)) {\r\n addFoldersTeachingBubbleAllowedShowCount = 3;\r\n }\r\n const hideAddFoldersTeachingBubble = () => {\r\n if (addFoldersTeachingBubbleAllowedShowCount > 0) {\r\n addFoldersTeachingBubbleAllowedShowCount -= 1;\r\n updatePreference({ addFoldersTeachingBubbleAllowedShowCount });\r\n }\r\n };\r\n const dismissAddFoldersTeachingBubble = () => {\r\n updatePreference({ addFoldersTeachingBubbleAllowedShowCount: 0 });\r\n };\r\n\r\n // real user for asset library app\r\n const { realUsedFlagInAdsStudioApp } = preferenceValue || {};\r\n const setRealUsedFlagInAdsStudioApp = () => {\r\n const realUsedFlag = {\r\n haveUsed: true,\r\n timestamp: new Date().getTime(),\r\n };\r\n updatePreference({ realUsedFlagInAdsStudioApp: realUsedFlag });\r\n };\r\n\r\n // real user for asset library picker\r\n const { realUsedFlagInAdsStudioPicker } = preferenceValue || {};\r\n const setRealUsedFlagInAdsStudioPicker = () => {\r\n const realUsedFlag = {\r\n haveUsed: true,\r\n timestamp: new Date().getTime(),\r\n };\r\n updatePreference({ realUsedFlagInAdsStudioPicker: realUsedFlag });\r\n };\r\n\r\n // real user for asset library picker\r\n const { realUsedFlagInAdsStudioAIGCMVPView } = preferenceValue || {};\r\n const setRealUsedFlagInAdsStudioAIGCMVPView = () => {\r\n const realUsedFlag = {\r\n haveUsed: true,\r\n timestamp: new Date().getTime(),\r\n };\r\n updatePreference({ realUsedFlagInAdsStudioAIGCMVPView: realUsedFlag });\r\n };\r\n\r\n // performance table view preferences\r\n const { perfTablePageSize } = preferenceValue || {};\r\n const setPerfTablePageSize = (newValue) => {\r\n updatePreference({ perfTablePageSize: newValue });\r\n };\r\n\r\n const { perfTableSortBy } = preferenceValue || {};\r\n const setPerfTableSortBy = (newValue) => {\r\n updatePreference({ perfTableSortBy: newValue });\r\n };\r\n\r\n // left navigation collapsed/expanded\r\n const { pageMenuMode } = preferenceValue || {};\r\n const setPageMenuMode = (newValue) => {\r\n updatePreference({ pageMenuMode: newValue });\r\n };\r\n\r\n return ({\r\n sortBy,\r\n setSortBy,\r\n // add folder teaching bubble\r\n addFoldersTeachingBubbleAllowedShowCount,\r\n dismissAddFoldersTeachingBubble,\r\n hideAddFoldersTeachingBubble,\r\n // real user for asset library\r\n realUsedFlagInAdsStudioApp,\r\n setRealUsedFlagInAdsStudioApp,\r\n realUsedFlagInAdsStudioPicker,\r\n setRealUsedFlagInAdsStudioPicker,\r\n realUsedFlagInAdsStudioAIGCMVPView,\r\n setRealUsedFlagInAdsStudioAIGCMVPView,\r\n perfTablePageSize,\r\n setPerfTablePageSize,\r\n perfTableSortBy,\r\n setPerfTableSortBy,\r\n pageMenuMode,\r\n setPageMenuMode,\r\n });\r\n }, [preferenceValue, updatePreference]);\r\n\r\n return preferences;\r\n};\r\n\r\nexport const useAdsStudioAccountPreference = ({ preferenceService }) => usePerference({\r\n preferenceService,\r\n getterName: 'findByNameAtAccountLevel',\r\n setterName: 'setAtAccountLevel',\r\n});\r\n\r\nexport const useAdsStudioUserPreference = ({ preferenceService }) => usePerference({\r\n preferenceService,\r\n getterName: 'findByNameAtUserLevel',\r\n setterName: 'setAtUserLevel',\r\n});\r\n\r\nexport const useAdsStudioPreference = ({ preferenceService }) => {\r\n const userPreference = useAdsStudioUserPreference({ preferenceService });\r\n const accountPreference = useAdsStudioAccountPreference({ preferenceService });\r\n return {\r\n user: userPreference,\r\n account: accountPreference,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { getDateRangeParams, createFolderFilterQuery } from '../service-utils';\r\n\r\nexport const createFolderExpandQuery = ({\r\n includeAssets,\r\n includeSubfolders,\r\n includeParentHierarchy,\r\n}) => {\r\n const expandItems = [];\r\n const expandItemsInSubfolders = [];\r\n\r\n if (includeAssets) {\r\n expandItems.push('Assets');\r\n expandItemsInSubfolders.push('Assets');\r\n }\r\n\r\n if (includeParentHierarchy) {\r\n expandItems.push('ParentHierarchy');\r\n expandItemsInSubfolders.push('ParentHierarchy');\r\n }\r\n\r\n if (includeSubfolders) {\r\n expandItems.push(`SubFolders${expandItemsInSubfolders.length > 0 ? `($expand=${expandItemsInSubfolders.join(',')})` : ''}`);\r\n }\r\n\r\n const expandQuery = expandItems.length > 0 ? `$expand=${expandItems.join(',')}` : '';\r\n\r\n return expandQuery;\r\n};\r\n\r\nconst createDateRangeQuery = ({\r\n startDate, endDate, comparisonStartDate, comparisonEndDate,\r\n}) => {\r\n if (startDate && endDate) {\r\n const startDateParam = `startDate=${startDate}`;\r\n const endDateParam = `endDate=${endDate}`;\r\n const comparisonStartDateParam = `comparisonStartDate=${comparisonStartDate || null}`;\r\n const comparisonEndDateParam = `comparisonEndDate=${comparisonEndDate || null}`;\r\n return [startDateParam, endDateParam, comparisonStartDateParam, comparisonEndDateParam];\r\n }\r\n return [];\r\n};\r\n\r\nexport const createFolderQuery = ({\r\n filterArgs,\r\n expandArgs,\r\n sortBy,\r\n sortDirection,\r\n assetsToLoadForSubfolders,\r\n isGlobalSearch = false,\r\n isAssetPickerScenario = false,\r\n folderId, // used for TimeSeries API, not for GetFolder API\r\n isSemanticSearch = false,\r\n isRecentSorting = false,\r\n}) => {\r\n let sortQuery = sortBy ? `$orderby=${sortBy}` : '';\r\n if (sortQuery && sortDirection) {\r\n sortQuery += ` ${sortDirection}`;\r\n }\r\n\r\n const filterQuery = createFolderFilterQuery({ ...filterArgs, folderId });\r\n\r\n const selectQuery = '$select=Id,ParentFolderId,Name,ItemsCount';\r\n\r\n const expandQuery = createFolderExpandQuery(expandArgs);\r\n\r\n let assetSubfolderQuery = '';\r\n if (assetsToLoadForSubfolders) {\r\n assetSubfolderQuery = `maxsubfolderassetscount=${assetsToLoadForSubfolders}`;\r\n }\r\n\r\n let globalSearchQuery = '';\r\n if (isGlobalSearch) {\r\n globalSearchQuery = 'isglobalsearch=true';\r\n }\r\n\r\n let assetPickerQuery = '';\r\n if (isAssetPickerScenario) {\r\n assetPickerQuery = 'isassetpickerscenario=true';\r\n }\r\n\r\n let semanticSearchQuery = '';\r\n if (isSemanticSearch) {\r\n semanticSearchQuery = 'issemanticsearch=true';\r\n }\r\n\r\n let recentSortingQuery = '';\r\n if (isRecentSorting) {\r\n recentSortingQuery = 'isrecentsorting=true';\r\n }\r\n\r\n const params = _.compact([sortQuery, filterQuery, selectQuery, expandQuery, assetSubfolderQuery, globalSearchQuery, assetPickerQuery, semanticSearchQuery, recentSortingQuery]);\r\n\r\n return params.join('&');\r\n};\r\n\r\nexport const getFolderODataService = ({\r\n odata, legacyOdata, oDataConfig, aid, cid, i18n, dateFormat,\r\n}) => {\r\n const getRequestUrl = ({ folderId, funcPath, query } = {}) => {\r\n let resourceRootUrl = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Folders`;\r\n\r\n if (folderId) {\r\n resourceRootUrl += `(${folderId})`;\r\n }\r\n\r\n if (funcPath) {\r\n resourceRootUrl += `/${funcPath}`;\r\n }\r\n\r\n return query ? `${resourceRootUrl}?${query}` : resourceRootUrl;\r\n };\r\n\r\n const getFolderData = ({\r\n skip,\r\n count,\r\n folderId,\r\n expandArgs,\r\n filterArgs,\r\n sortBy,\r\n sortDirection,\r\n assetsToLoadForSubfolders,\r\n isGlobalSearch = false,\r\n isAssetPickerScenario = false,\r\n isSemanticSearch = false,\r\n isRecentSorting = false,\r\n }) => {\r\n const folderQuery = createFolderQuery({\r\n filterArgs,\r\n expandArgs,\r\n sortBy,\r\n sortDirection,\r\n assetsToLoadForSubfolders,\r\n isGlobalSearch,\r\n isAssetPickerScenario,\r\n isSemanticSearch,\r\n isRecentSorting,\r\n });\r\n\r\n const url = getRequestUrl({\r\n folderId,\r\n funcPath: folderId ? '' : 'Default.GetRootFolder',\r\n query: folderQuery,\r\n });\r\n\r\n return odata.get(url, _.extend({\r\n data: {\r\n $top: count,\r\n $skip: skip,\r\n count: true,\r\n },\r\n }, oDataConfig));\r\n };\r\n\r\n const getFolderDataWithBIData = ({\r\n perfMetricDateRange,\r\n skip,\r\n count,\r\n folderId,\r\n expandArgs,\r\n filterArgs,\r\n sortBy,\r\n sortDirection,\r\n assetsToLoadForSubfolders,\r\n isGlobalSearch = false,\r\n isAssetPickerScenario = false,\r\n isSemanticSearch = false,\r\n isRecentSorting = false,\r\n }) => {\r\n const folderQuery = createFolderQuery({\r\n filterArgs,\r\n expandArgs,\r\n sortBy,\r\n sortDirection,\r\n assetsToLoadForSubfolders,\r\n isGlobalSearch,\r\n isAssetPickerScenario,\r\n isSemanticSearch,\r\n isRecentSorting,\r\n });\r\n\r\n const url = getRequestUrl({\r\n folderId,\r\n funcPath: folderId ? 'Default.GetFolderWithBIData' : 'Default.GetRootFolderWithBIData',\r\n query: folderQuery,\r\n });\r\n\r\n const {\r\n startDate, endDate, comparisonStartDate, comparisonEndDate,\r\n } = getDateRangeParams(i18n, perfMetricDateRange, dateFormat, perfMetricDateRange && perfMetricDateRange.Rangelcid);\r\n // compose request body\r\n // const { Granularity, Metrics, MovingAverage } = perfTimeSeriesParams || {};\r\n const requestBody = {\r\n gridDataParameters: {\r\n DateRange: { StartDate: startDate || null, EndDate: endDate || null },\r\n ComparisonDateRange: comparisonStartDate ? { StartDate: comparisonStartDate, EndDate: comparisonEndDate } : undefined,\r\n CurrentCustomerId: cid,\r\n },\r\n // performanceTimeSeriesParameters: {\r\n // Granularity, // 'Hour',\r\n // Metrics, // \"Impressions,Clicks\",\r\n // MovingAverage, // true\r\n // },\r\n };\r\n\r\n return odata.post(url, _.extend({\r\n data: requestBody,\r\n urlParameters: {\r\n $top: count,\r\n $skip: skip,\r\n count: true,\r\n },\r\n }, oDataConfig));\r\n };\r\n\r\n const getPerfTimeSeriesData = ({\r\n perfMetricDateRange,\r\n perfTimeSeriesParams,\r\n folderId,\r\n filterArgs,\r\n isGlobalSearch = false,\r\n }) => {\r\n const {\r\n granularity, metric: metrics, isMovingAverageOn: movingAverage,\r\n } = perfTimeSeriesParams || {};\r\n const funcParams = [\r\n ...createDateRangeQuery(getDateRangeParams(i18n, perfMetricDateRange, dateFormat, perfMetricDateRange && perfMetricDateRange.Rangelcid)),\r\n `granularity=Enum.Granularity'${granularity}'`,\r\n `metrics='${metrics}'`,\r\n `movingAverage=${movingAverage || false}`,\r\n ].join(',');\r\n\r\n // no filter id means global search\r\n let filterQuery = createFolderFilterQuery(isGlobalSearch ? filterArgs : { ...filterArgs, folderId });\r\n if (filterQuery) {\r\n filterQuery = `?${filterQuery}`;\r\n }\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images/Default.PerformanceTimeSeries(${funcParams})${filterQuery}`;\r\n\r\n return odata.get(url, _.extend({\r\n data: {\r\n $top: 20, // top is required in the API call\r\n count: true,\r\n },\r\n }, oDataConfig));\r\n };\r\n\r\n const createFolder = ({ folderName, parentFolderId, folderType }) => {\r\n const url = getRequestUrl();\r\n const requestBody = {\r\n Name: folderName,\r\n ParentFolderId: parentFolderId,\r\n FolderType: folderType,\r\n };\r\n\r\n return odata.post(url, _.extend({ data: requestBody }, oDataConfig))\r\n .then(res => res.value);\r\n };\r\n\r\n const renameFolder = ({ folderId, newFolderName }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Folders(${folderId})`;\r\n const requestBody = {\r\n Name: newFolderName,\r\n Id: folderId,\r\n };\r\n return odata.patch(url, _.extend({ data: requestBody }, oDataConfig))\r\n .then(res => res && res.value);\r\n };\r\n\r\n const deleteFolder = ({ folderId }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Folders(${folderId})`;\r\n return odata.delete(url, _.extend({}, oDataConfig))\r\n .then(res => res && res.value);\r\n };\r\n\r\n const batchMove = ({\r\n destFolderId, assets, folders,\r\n }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Folders/Default.PutResources`;\r\n const requestBody = {\r\n DestFolderId: destFolderId || null,\r\n Assets: assets,\r\n FolderIds: folders,\r\n };\r\n const dataJson = JSON.stringifyWithBigInt(requestBody);\r\n return odata.post(url, _.extend({ data: dataJson }, oDataConfig));\r\n };\r\n\r\n const addAssets = ({\r\n folderId,\r\n asset,\r\n inProgress = null,\r\n supportUpscale,\r\n }) => {\r\n const url = getRequestUrl({ funcPath: 'Default.AddAsset' });\r\n const requestBody = {\r\n FolderId: folderId,\r\n Asset: asset,\r\n SupportUpscale: supportUpscale,\r\n };\r\n\r\n return odata.post(url, _.extend({ data: requestBody, progress: inProgress }, oDataConfig))\r\n .then(res => res.value);\r\n };\r\n\r\n const deleteAsset = (asset) => {\r\n const url = getRequestUrl({ funcPath: 'Default.DeleteAsset' });\r\n const dataJson = JSON.stringifyWithBigInt(asset);\r\n return odata.post(url, _.extend({ data: dataJson }, oDataConfig))\r\n .then(res => res.value);\r\n };\r\n\r\n const bulkDeleteAssets = (assets) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Default.BulkUpsert`;\r\n const csvHeader = 'Type,Name,Id,Parent Id,Status';\r\n const csvForamt = 'Format Version,6,,,';\r\n const csvRows = _.map(assets, ({ assetId, folderAssetType }) => `${folderAssetType},,${assetId},${aid},Deleted`);\r\n return odata.post(url, _.extend({\r\n data: {\r\n CsvRows: [\r\n csvHeader, csvForamt, ...csvRows,\r\n ],\r\n },\r\n }, oDataConfig)).then((res) => {\r\n if (_.isEmpty(res)) {\r\n return [];\r\n }\r\n // skip header and format rows, and only keep error rows\r\n const errors = _.chain(res.slice(2))\r\n .filter(([type]) => type.indexOf('Error') >= 0)\r\n // eslint-disable-next-line no-unused-vars\r\n .map(([type, colStatus, Id, colAID, colName, ErrorCode, ErrorNumber]) => ({ Id, Code: ErrorCode, ErrorNumber }))\r\n .value();\r\n return errors;\r\n });\r\n };\r\n\r\n const updateAsset = (asset) => {\r\n const url = getRequestUrl({ funcPath: 'Default.UpdateAsset' });\r\n const dataJson = JSON.stringifyWithBigInt(asset);\r\n return odata.post(url, _.extend({ data: dataJson }, oDataConfig))\r\n .then(res => res.value);\r\n };\r\n\r\n // fileExtension: e.g. .mp4\r\n const getBlobUploadUrl = ({ fileExtension }) => {\r\n const url = getRequestUrl({ funcPath: `Default.GetVideoUploadUrl(fileExtension='${fileExtension}')` });\r\n\r\n return odata.get(url, oDataConfig);\r\n };\r\n\r\n const getVideo = ({ id }) => {\r\n const baseURL = `${oDataConfig.odataPath}/Customers(${cid})/Accounts(${aid})`;\r\n return odata.get(`${baseURL}/Videos/${id}`, oDataConfig);\r\n };\r\n\r\n const getVideosByIdsAsync = (videoTasks) => {\r\n const reqs = _.map(videoTasks, (id) => {\r\n const baseURL = `/Customers(${cid})/Accounts(${aid})`;\r\n return {\r\n type: 'GET',\r\n url: `${baseURL}/Videos/${id}`,\r\n };\r\n });\r\n // use batch function of legacyOdata instead of odata to avoid some hard code\r\n return legacyOdata.batch({\r\n reqs,\r\n needContentType: true,\r\n }).then(response => response.map(item => item.data));\r\n };\r\n\r\n return {\r\n getFolderData,\r\n getFolderDataWithBIData,\r\n getPerfTimeSeriesData,\r\n createFolder,\r\n renameFolder,\r\n deleteFolder,\r\n addAssets,\r\n deleteAsset,\r\n bulkDeleteAssets,\r\n updateAsset,\r\n getBlobUploadUrl,\r\n batchMove,\r\n getVideosByIdsAsync,\r\n getVideo,\r\n };\r\n};\r\n","import _ from 'underscore';\r\n\r\nexport const getImageBulkEditODataService = ({\r\n odata, oDataConfig, aid, cid, // logger,\r\n}) => {\r\n //\r\n const getImageCroppingTaskStatus = (imageId) => {\r\n let url;\r\n if (imageId) {\r\n url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images(${imageId})/Default.ImageCroppingTaskStatus`;\r\n } else {\r\n url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images/Default.ImageCroppingTaskStatus`;\r\n }\r\n return odata.get(url, oDataConfig);\r\n };\r\n\r\n // crop an image and related placements\r\n const cropImage = ({ imageId, cropSettings = null, placementSettings = [] }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images(${imageId})/Default.Crop`;\r\n\r\n const cropData = {\r\n CropSettingOnOriginal: cropSettings,\r\n PlacementSettings: placementSettings,\r\n };\r\n\r\n const requestBody = _.extend({\r\n data: cropData,\r\n }, oDataConfig);\r\n\r\n return odata.post(url, requestBody);\r\n };\r\n\r\n const generateImageWithSmartEffect = ({ options }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Default.MediaGeneration`;\r\n const requestBody = _.extend({\r\n data: options,\r\n }, oDataConfig);\r\n\r\n return odata.post(url, requestBody);\r\n };\r\n\r\n return {\r\n getImageCroppingTaskStatus,\r\n cropImage,\r\n generateImageWithSmartEffect,\r\n };\r\n};\r\n","import _ from 'underscore';\r\n\r\nexport const getAIGCODataService = ({\r\n odata, oDataConfig, aid, cid,\r\n}) => {\r\n const generateImagesWithAIAsync = (userPrompt, skipBrandDetection = true) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images/Default.GenerateImagesWithAI`;\r\n const requestBody = {\r\n UserPrompt: userPrompt,\r\n SkipBrandDetection: skipBrandDetection,\r\n };\r\n return odata.post(url, _.extend({ data: requestBody }, oDataConfig));\r\n };\r\n\r\n const getAIGeneratedImageTaskStatus = (taskId) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images/Default.AIGenerateImagesTaskStatus(TaskId='${taskId}')`;\r\n return odata.get(url, oDataConfig);\r\n };\r\n\r\n return {\r\n generateImagesWithAIAsync,\r\n getAIGeneratedImageTaskStatus,\r\n };\r\n};\r\n\r\n","import _ from 'underscore';\r\nimport { stringifySync } from '@bingads-webui/safe-json';\r\n\r\nexport const getVideoODataService = ({\r\n odata, oDataConfig, aid, cid,\r\n}) => {\r\n const addVideoCreative = ({ videoCreative, sourceType }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Videos/Default.CreateVideo`;\r\n\r\n const requestBody = {\r\n videoUrl: videoCreative.url,\r\n description: '',\r\n metadata: stringifySync(videoCreative),\r\n ...(sourceType && { sourceType }),\r\n };\r\n\r\n return odata.post(url, _.extend({ data: requestBody }, oDataConfig));\r\n };\r\n\r\n const getVideo = ({ id, fetchMetadata = false }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Videos(${id})?fetchMetadata=${fetchMetadata}`;\r\n\r\n return odata.get(url, oDataConfig);\r\n };\r\n\r\n return {\r\n addVideoCreative,\r\n getVideo,\r\n };\r\n};\r\n","import _ from 'underscore';\r\n\r\nexport const getBackgroundChangeODataService = ({\r\n odata, oDataConfig, aid, cid,\r\n}) => {\r\n const removeImageBackground = (imageUrl) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images/Default.RemoveBackground`;\r\n const requestBody = {\r\n Url: imageUrl,\r\n };\r\n return odata.post(url, _.extend({ data: requestBody }, oDataConfig));\r\n };\r\n\r\n const getImageSegmentations = (imageUrl) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images/Default.GetImageSegmentation`;\r\n const requestBody = {\r\n ImageUrl: imageUrl,\r\n };\r\n return odata.post(url, _.extend({ data: requestBody }, oDataConfig));\r\n };\r\n\r\n const generateImageBackground = ({\r\n prompt,\r\n // it could be original image url, in such case, the selectedMasks contains the mask ids user selected\r\n // if it's the url returned from 'removeImageBackground', the selectedMasks should be null\r\n imageUrl,\r\n // array of mask ids, if it's empty [], it means no mask is selected\r\n // if it's null, it means no masks are applied\r\n maskSetsBase64,\r\n selectedMasks,\r\n outputImageWidth,\r\n outputImageHeight,\r\n }) => {\r\n const url = `${oDataConfig.oDataPath}/Customers(${cid})/Accounts(${aid})/Images/Default.GenerateImageBackground`;\r\n const requestBody = {\r\n ImageUrl: imageUrl,\r\n Prompt: prompt,\r\n MaskSets: maskSetsBase64,\r\n SelectedMasks: selectedMasks,\r\n Width: outputImageWidth,\r\n Height: outputImageHeight,\r\n };\r\n return odata.post(url, _.extend({ data: requestBody }, oDataConfig));\r\n };\r\n\r\n return {\r\n removeImageBackground,\r\n getImageSegmentations,\r\n generateImageBackground,\r\n };\r\n};\r\n\r\n","import { parseSync } from '@bingads-webui/safe-json';\r\nimport { parseMTDateString } from '../../service-utils';\r\n\r\n// perf related fields\r\nconst transformPerfMetricsResponse = (img, i18n) => {\r\n const res = {\r\n usedByCount: img.UsedByCount,\r\n };\r\n\r\n if (i18n.formatDecimal && i18n.formatDecimalToFixed && i18n.formatPercentToFixed) {\r\n // # performance rating\r\n const performanceRating = img.PerformanceRating || {};\r\n res.performanceLabel = '-';\r\n if (performanceRating.Rating === 'Best' || performanceRating.Rating === 'Good' || performanceRating.Rating === 'Low') {\r\n res.performanceLabel = performanceRating.Rating;\r\n }\r\n res.performanceLabelBestPercentage = i18n.formatPercentToFixed((performanceRating.PerformanceLabelBestPercentage || 0) / 100, { digits: 2 });\r\n res.performanceLabelGoodPercentage = i18n.formatPercentToFixed((performanceRating.PerformanceLabelGoodPercentage || 0) / 100, { digits: 2 });\r\n res.performanceLabelLowPercentage = i18n.formatPercentToFixed((performanceRating.PerformanceLabelLowPercentage || 0) / 100, { digits: 2 });\r\n res.performanceLabelLearningPercentage = i18n.formatPercentToFixed((performanceRating.PerformanceLabelLearningPercentage || 0) / 100, { digits: 2 });\r\n res.performanceLabelUnratedPercentage = i18n.formatPercentToFixed((performanceRating.PerformanceLabelUnratedPercentage || 0) / 100, { digits: 2 });\r\n\r\n // # performanceMetrics\r\n const performanceMetrics = img.PerformanceMetrics || {};\r\n res.impressions = i18n.formatDecimal(performanceMetrics.Impressions || 0);\r\n res.clicks = i18n.formatDecimal(performanceMetrics.Clicks || 0);\r\n res.CTR = i18n.formatPercentToFixed((performanceMetrics.CTR || 0) / 100, { digits: 2 });\r\n res.spend = i18n.formatDecimalToFixed(performanceMetrics.Spend || 0);\r\n\r\n // # periodPerformanceMetrics\r\n const periodPerformanceMetrics = img.PeriodPerformanceMetrics || {};\r\n res.periodImpressions = i18n.formatDecimal(periodPerformanceMetrics.Impressions || 0);\r\n res.periodClicks = i18n.formatDecimal(periodPerformanceMetrics.Clicks || 0);\r\n res.periodCTR = i18n.formatPercentToFixed((periodPerformanceMetrics.CTR || 0) / 100, { digits: 2 });\r\n res.periodSpend = i18n.formatDecimalToFixed(periodPerformanceMetrics.Spend || 0);\r\n\r\n // # performanceMetricsChange\r\n const performanceMetricsChange = img.PerformanceMetricsChange || {};\r\n res.impressionsChange = i18n.formatDecimal(performanceMetricsChange.Impressions || 0);\r\n res.clicksChange = i18n.formatDecimal(performanceMetricsChange.Clicks || 0);\r\n res.CTRChange = i18n.formatPercentToFixed((performanceMetricsChange.CTR || 0) / 100, { digits: 2 });\r\n res.spendChange = i18n.formatDecimalToFixed(performanceMetricsChange.Spend || 0);\r\n\r\n // # performanceMetricsChangePercentage\r\n const performanceMetricsChangePercentage = img.PerformanceMetricsChangePercentage || {};\r\n res.impressionsChangePercentage = i18n.formatPercentToFixed((performanceMetricsChangePercentage.Impressions || 0) / 100, { digits: 2 });\r\n res.clicksChangePercentage = i18n.formatPercentToFixed((performanceMetricsChangePercentage.Clicks || 0) / 100, { digits: 2 });\r\n res.CTRChangePercentage = i18n.formatPercentToFixed((performanceMetricsChangePercentage.CTR || 0) / 100, { digits: 2 });\r\n res.spendChangePercentage = i18n.formatPercentToFixed((performanceMetricsChangePercentage.Spend || 0) / 100, { digits: 2 });\r\n }\r\n\r\n return res;\r\n};\r\n\r\nexport const transformImageResponse = (img, i18n) => {\r\n const asset = {\r\n folderAssetType: img.FolderAssetType,\r\n\r\n id: img.IdString,\r\n name: img.Text,\r\n url: img.Url,\r\n width: img.Width,\r\n height: img.Height,\r\n createdTime: parseMTDateString(i18n, img.UploadedTime),\r\n modifiedTime: parseMTDateString(i18n, img.ModifiedTime),\r\n originalHeight: img.OriginalHeight,\r\n originalWidth: img.OriginalWidth,\r\n originalUrl: img.OriginalUrl,\r\n\r\n cropSettings: img.CropSettings,\r\n cropSettingOnOriginal: img.CropSettingOnOriginal,\r\n placementSettings: img.PlacementSettings,\r\n\r\n type: img.Type,\r\n sourceType: img.SourceType,\r\n metadata: parseSync((img.Metadata || '').replaceAll(encodeURIComponent(','), ',')),\r\n baseId: img.BaseIdString,\r\n roiInfo: img.ROIInfo,\r\n };\r\n\r\n const metrics = transformPerfMetricsResponse(img, i18n);\r\n\r\n const isSceneKeyFrame = asset.metadata && asset.metadata.keyFrame;\r\n\r\n return { ...asset, ...metrics, isSceneKeyFrame };\r\n};\r\n","\r\nimport {\r\n CSMLSortBy,\r\n CSMLImportSource,\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\nimport { stringifySync } from '@bingads-webui/safe-json';\r\nimport { Promise } from 'bluebird';\r\nimport _ from 'underscore';\r\n\r\nimport { formatCivilDate, removeNullUndefined } from '../service-utils';\r\nimport { transformImageResponse } from './asset-response-transformers/image-response-transformer';\r\n\r\nconst MAX_TIMEOUT = 5 * 60 * 1000; // set timeout to be 5 minutes\r\nconst POLL_INTERVAL = 1000; // set to 1000ms for now\r\nconst MediaRepositoryTimeoutError = 'MediaRepositoryTimeoutError';\r\n\r\nexport const getRepository = ({\r\n imageBulkEditODataService,\r\n imageODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n}) => {\r\n const getImages = ({\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n importSource,\r\n sortBy,\r\n skip,\r\n count,\r\n }) => {\r\n //\r\n const args = {\r\n searchTerm: encodeURIComponent(searchTerm),\r\n minWidth,\r\n minHeight,\r\n dateAddedStart: dateAddedStart && formatCivilDate(i18n, dateAddedStart, ianaTimeZone, timezoneUTCOffset, '00:00:00'),\r\n dateAddedEnd: dateAddedEnd && formatCivilDate(i18n, dateAddedEnd, ianaTimeZone, timezoneUTCOffset, '23:59:59'),\r\n skip,\r\n count,\r\n };\r\n\r\n if (importSource === CSMLImportSource.Google) {\r\n args.sourceType = 'GoogleImported';\r\n } else if (importSource === CSMLImportSource.Facebook) {\r\n args.sourceType = 'FacebookImported';\r\n }\r\n\r\n if (sortBy === CSMLSortBy.ImageName) {\r\n args.sortBy = 'Text';\r\n args.sortDirection = 'asc';\r\n } else if (sortBy === CSMLSortBy.MostRecent) {\r\n args.sortBy = 'ModifiedTime';\r\n args.sortDirection = 'desc';\r\n }\r\n return imageODataService.getImages(args).then((res) => {\r\n const totalCount = res['@odata.count'] || 0;\r\n const images = (res.value || []).map(img => transformImageResponse(img, i18n));\r\n\r\n return { images, totalCount };\r\n });\r\n };\r\n\r\n const getImage = (imageId, isImageFittingEnabled) =>\r\n imageODataService.getImageByIdAsync(imageId, isImageFittingEnabled).then(res => transformImageResponse(res, i18n));\r\n\r\n const getImageCroppingTaskStatus = (imageId) => {\r\n const promise = imageBulkEditODataService.getImageCroppingTaskStatus(imageId).then((res) => {\r\n const totalCount = res['@odata.count'] || 0;\r\n const tasks = (res.value || []).map(tsk => ({\r\n id: `${tsk.AssetId}`,\r\n name: tsk.ImageText,\r\n url: tsk.ImageUrl,\r\n createdTime: tsk.CreatedTime,\r\n modifiedTime: tsk.ModifiedTime,\r\n stage: tsk.Stage,\r\n hasError: tsk.HasError,\r\n failureMessage: tsk.Checkpoint && tsk.Checkpoint.FailureMessage,\r\n percentComplete: tsk.Checkpoint && tsk.Checkpoint.PercentComplete,\r\n imageCroppingTaskStatusId: tsk.ImageCroppingTaskStatusId,\r\n isFinished: tsk.Stage === 'Completed' || tsk.Stage === 'CompletedWithErrors' || tsk.Stage === 'Failed',\r\n }));\r\n return { tasks, totalCount };\r\n });\r\n return promise;\r\n };\r\n\r\n const updateImageData = ({ imageId, imageData, type }) => {\r\n const promise = imageODataService.updateImageAsync({\r\n Id: imageId,\r\n Data: imageData,\r\n Type: type,\r\n });\r\n return promise;\r\n };\r\n\r\n const renameImage = ({ imageId, name }) => {\r\n const promise = imageODataService.updateImageAsync({ Id: imageId, Text: name });\r\n return promise;\r\n };\r\n\r\n const deleteImage = (imageId) => {\r\n const promise = imageODataService.deleteImageAsync({ IdString: `${imageId}` });\r\n return promise;\r\n };\r\n\r\n const cropImage = ({ imageId, cropSettings, placementSettings }) => {\r\n const promise = imageBulkEditODataService.cropImage({ imageId, cropSettings, placementSettings })\r\n .then(res => res.value);\r\n return promise;\r\n };\r\n\r\n const uploadImagesByUrl = ({ imageUrls }) => {\r\n const promise = imageODataService.bulkSaveImagesByUrl(imageUrls);\r\n return promise;\r\n };\r\n\r\n const uploadImage = ({\r\n imageData,\r\n activityLogger = null,\r\n updateCurrentProgress = null,\r\n imageOption = 'Image',\r\n name = '',\r\n }) => {\r\n const isLogo = imageOption === 'Logo';\r\n\r\n const promise = imageODataService.uploadImageAsync(imageData, activityLogger, updateCurrentProgress, isLogo, name);\r\n return promise;\r\n };\r\n\r\n const addCreative = ({ creativeData, baseId }) => {\r\n const serialized = stringifySync(removeNullUndefined(creativeData));\r\n // todo: save original image and save original image url inside metadata\r\n const args = [{\r\n url: creativeData.url,\r\n metadata: serialized.replace(/,/g, encodeURIComponent(',')),\r\n baseId,\r\n }];\r\n const promise = imageODataService.bulkSaveImagesByUrl(args);\r\n return promise;\r\n };\r\n\r\n const saveImageWithBaseId = ({ image, baseId, folderId }) => {\r\n const { url, metaData } = image;\r\n const serialized = stringifySync(removeNullUndefined(metaData));\r\n const args = [{\r\n url,\r\n metadata: serialized.replace(/,/g, encodeURIComponent(',')),\r\n baseId,\r\n folderId,\r\n }];\r\n const promise = imageODataService.bulkSaveImagesByUrl(args);\r\n return promise;\r\n };\r\n\r\n const createGenerateRequestWithPolling = ({ effectOptions }) => {\r\n const timerIds = {};\r\n const resetTimers = () => {\r\n if (timerIds.intervalId) {\r\n clearInterval(timerIds.intervalId);\r\n }\r\n if (timerIds.timeoutId) {\r\n clearTimeout(timerIds.timeoutId);\r\n }\r\n };\r\n\r\n return imageBulkEditODataService.generateImageWithSmartEffect({ options: effectOptions }).then((response = {}) => {\r\n if (!response.wip) {\r\n return response.Assets;\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n timerIds.intervalId = setInterval(() => {\r\n imageBulkEditODataService.generateImageWithSmartEffect({ options: { JobId: response.JobId } })\r\n .then((newResponse = {}) => {\r\n if (!newResponse.wip) {\r\n resetTimers();\r\n resolve(newResponse.Assets);\r\n }\r\n }).catch((error) => {\r\n resetTimers();\r\n reject(error);\r\n });\r\n }, POLL_INTERVAL);\r\n\r\n timerIds.timeoutId = setTimeout(() => {\r\n resetTimers();\r\n reject(new Error(MediaRepositoryTimeoutError));\r\n }, MAX_TIMEOUT);\r\n });\r\n });\r\n };\r\n\r\n const generateImageWithSmartEffect = ({ imageUrl, smartEffects }) => {\r\n const effectOptions = {\r\n Image: {\r\n BaseImageUrl: imageUrl,\r\n Filters: _.map(smartEffects, ({ smartEffectName, smartEffectOptions }) => ({\r\n Name: smartEffectName,\r\n Param: smartEffectOptions,\r\n })),\r\n },\r\n Output: {\r\n MediaType: 'image',\r\n Image: {\r\n Type: 'jpg',\r\n },\r\n },\r\n };\r\n return createGenerateRequestWithPolling({ effectOptions });\r\n };\r\n\r\n const imageFit = ({ imageUrl, placements, skipOutpainting }) => {\r\n const ret = imageODataService.imageFit({ imageUrl, placements, skipOutpainting });\r\n return ret;\r\n };\r\n\r\n return {\r\n getImages,\r\n getImage,\r\n getImageCroppingTaskStatus,\r\n updateImageData,\r\n renameImage,\r\n deleteImage,\r\n cropImage,\r\n uploadImagesByUrl,\r\n uploadImage,\r\n addCreative,\r\n generateImageWithSmartEffect,\r\n saveImageWithBaseId,\r\n imageFit,\r\n };\r\n};\r\n","import { parseMTDateString } from '../../service-utils';\r\n\r\nexport const getVideoPlaySrc = (serializedResolutions) => {\r\n if (serializedResolutions) {\r\n const resolutionConfig = JSON.parse(serializedResolutions);\r\n const resolutions = Object.keys(resolutionConfig).map(h => parseInt(h, 10));\r\n const largestResolution = Math.max(...resolutions);\r\n\r\n return resolutionConfig[largestResolution];\r\n }\r\n\r\n return null;\r\n};\r\n\r\n// for now, we don't support play stream URL yet, so here use DownloadUrl instead of Url.\r\nexport const transformVideoResponse = (video, i18n) => ({\r\n folderAssetType: video.FolderAssetType,\r\n\r\n id: video.IdString,\r\n createdTime: parseMTDateString(i18n, video.UploadedTime),\r\n modifiedTime: parseMTDateString(i18n, video.ModifiedTime),\r\n name: video.Description,\r\n thumbnailUrl: video.ThumbnailUrl,\r\n url: getVideoPlaySrc(video.DownloadUrl),\r\n width: video.Width,\r\n height: video.Height,\r\n durationInMS: video.DurationInMS,\r\n status: video.Status,\r\n metaData: video.Metadata,\r\n fileSize: video.SourceVideoLength,\r\n quality: video.Quality,\r\n});\r\n","import {\r\n FolderAssetType,\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport { transformImageResponse } from './image-response-transformer';\r\nimport { transformVideoResponse } from './video-response-transformer';\r\n\r\nexport const getAssetTransformer = (folderAssetType) => {\r\n if (folderAssetType === FolderAssetType.Video) {\r\n return transformVideoResponse;\r\n }\r\n\r\n if (folderAssetType === FolderAssetType.Image) {\r\n return transformImageResponse;\r\n }\r\n\r\n if (folderAssetType) {\r\n throw new Error(`No transfomers configed for FolderAssetType - ${folderAssetType}`);\r\n }\r\n\r\n return transformImageResponse;\r\n};\r\n\r\nexport const transformAssetResponse = (asset, folderAssetType, i18n) => {\r\n const transformerFunc = getAssetTransformer(folderAssetType);\r\n\r\n return transformerFunc(asset, i18n);\r\n};\r\n\r\nexport * from './video-response-transformer';\r\n","import _ from 'underscore';\r\nimport { FolderAssetType } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nJSON.stringifyWithBigInt = (data) => {\r\n // add markers to BigInt values in the string\r\n let str = JSON.stringify(data, (key, value) => (typeof value === 'bigint' ? `BIGINT<<${value}>>TNIGIB` : value));\r\n // serialize a BigInt as number instead of string\r\n str = str.replace(/\"BIGINT<<[0-9]+>>TNIGIB\"/g, s => s.slice(9, -9));\r\n return str;\r\n};\r\n\r\nexport const oDataTypeConfig = {\r\n [FolderAssetType.Image]: '#Model.Image',\r\n [FolderAssetType.Video]: '#Model.Video',\r\n};\r\n\r\nexport const namePropertyConfig = {\r\n [FolderAssetType.Image]: 'Text',\r\n [FolderAssetType.Video]: 'Description',\r\n};\r\n\r\n// UI is using IdString internally\r\n// When passing to MT, need to convert to int type\r\n// Theoretically there should not be overflow issue, but here we still do a guard.\r\n// If overflow happens, pass a string so MT will fail and then will be caught\r\nexport const transformAssetId = (value) => {\r\n if (_.isNumber(value)) {\r\n return value;\r\n }\r\n\r\n const pattern = /^[0-9]+$/g;\r\n const SAFE_INTEGER = Number.MAX_SAFE_INTEGER;\r\n if (value.match(pattern)) {\r\n const intValue = parseInt(value, 10);\r\n if (intValue.toString() === value && intValue <= SAFE_INTEGER) {\r\n return intValue;\r\n }\r\n\r\n // use BigInt if the value is bigger than SAFE_INTEGER\r\n // eslint-disable-next-line no-undef\r\n const bigIntValue = BigInt(value);\r\n if (bigIntValue.toString() === value) {\r\n return bigIntValue;\r\n }\r\n }\r\n\r\n return value;\r\n};\r\n","import { constants } from '@bingads-webui-campaign-react/image-experience-model';\r\nimport { FolderAssetType } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport {\r\n oDataTypeConfig,\r\n namePropertyConfig,\r\n} from './request-transformer-util';\r\n\r\nconst removeEncodingPrefix = (fileData) => {\r\n const base64 = 'base64,';\r\n const base64Index = fileData.indexOf(base64);\r\n\r\n return base64Index > -1\r\n ? fileData.substr(base64Index + base64.length)\r\n : fileData;\r\n};\r\n\r\nexport const transformAddUploadAssetRequest = ({\r\n blobName, // for video\r\n data, // for image\r\n name,\r\n}, folderAssetType) => {\r\n const model = {\r\n '@odata.type': oDataTypeConfig[folderAssetType],\r\n [namePropertyConfig[folderAssetType]]: name,\r\n SourceType: constants.sourceTypes.UserUploaded,\r\n };\r\n\r\n if (folderAssetType === FolderAssetType.Video) {\r\n model.OriginalIdentifier = blobName;\r\n } else {\r\n model.Data = removeEncodingPrefix(data);\r\n model.Type = 'GenericImage';\r\n }\r\n\r\n return model;\r\n};\r\n\r\nexport const transformAddStockImageRequest = ({ stockImageId, imageType = 'GenericImage' }) => ({\r\n '@odata.type': oDataTypeConfig[FolderAssetType.Image],\r\n StockImageId: stockImageId,\r\n StockImageVendor: 'ShutterStock',\r\n Type: imageType,\r\n});\r\n\r\nexport const transformAddInvestImageRequest = ({ investImageId, imageSrc, imageType = 'GenericImage' }) => ({\r\n '@odata.type': oDataTypeConfig[FolderAssetType.Image],\r\n XandrAssetId: investImageId,\r\n Url: imageSrc,\r\n SourceType: 'XandrImported',\r\n Type: imageType,\r\n});\r\n\r\nexport const transformAddInvestVideoRequest = ({\r\n investVideoId, videoSrc, description,\r\n}) => ({\r\n '@odata.type': oDataTypeConfig[FolderAssetType.Video],\r\n XandrAssetId: investVideoId,\r\n Url: videoSrc,\r\n Description: description,\r\n SourceType: 'XandrImported',\r\n});\r\n\r\nexport const transformAddUrlImageRequest = ({ imageSrc, imageType = 'GenericImage', sourceType }) => ({\r\n '@odata.type': oDataTypeConfig[FolderAssetType.Image],\r\n Url: imageSrc,\r\n Type: imageType,\r\n SourceType: sourceType,\r\n});\r\n\r\nexport const transformAddImageWithBaseIdRequest = ({\r\n imageSrc, metaData, baseId, sourceType,\r\n}) => ({\r\n '@odata.type': oDataTypeConfig[FolderAssetType.Image],\r\n Url: imageSrc,\r\n Type: 'GenericImage',\r\n BaseId: baseId,\r\n Metadata: metaData,\r\n ...(sourceType ? { sourceType } : {}),\r\n});\r\n\r\nexport const transformAddUrlVideoRequest = ({ videoUrl, name }) => ({\r\n '@odata.type': oDataTypeConfig[FolderAssetType.Video],\r\n Url: videoUrl,\r\n Description: name,\r\n SourceType: constants.sourceTypes.WebsiteImported,\r\n});\r\n","import {\r\n oDataTypeConfig,\r\n transformAssetId,\r\n} from './request-transformer-util';\r\n\r\nexport const transformDeleteAssetRequest = ({ folderAssetType, assetId }) => ({\r\n Asset: {\r\n '@odata.type': oDataTypeConfig[folderAssetType],\r\n Id: transformAssetId(assetId),\r\n },\r\n});\r\n","import Promise from 'bluebird';\r\nimport {\r\n oDataTypeConfig,\r\n transformAssetId,\r\n namePropertyConfig,\r\n} from './request-transformer-util';\r\n\r\nexport const transformRenameRequest = ({ assetId, folderAssetType, name }) => ({\r\n Asset: {\r\n '@odata.type': oDataTypeConfig[folderAssetType],\r\n Id: transformAssetId(assetId),\r\n [namePropertyConfig[folderAssetType]]: name,\r\n },\r\n});\r\n\r\nexport const transformAltTextRequest = ({ assetId, folderAssetType, text }) => ({\r\n Asset: {\r\n '@odata.type': oDataTypeConfig[folderAssetType],\r\n Id: transformAssetId(assetId),\r\n AltText: text,\r\n },\r\n});\r\n\r\nconst readAsDataUrlAsync = url => (\r\n fetch(url)\r\n .then(response => response.blob()) // Convert response to Blob\r\n .then(blob => new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n\r\n reader.onload = e => resolve(e.target.result);\r\n reader.onerror = e => reject(reader.error, e);\r\n\r\n // Scheduling the reading of the blob\r\n reader.readAsDataURL(blob);\r\n }))\r\n);\r\n\r\nconst removeEncodingPrefix = (data) => {\r\n const base64 = 'base64,';\r\n const base64Index = data.indexOf(base64);\r\n\r\n return base64Index > -1\r\n ? data.substr(base64Index + base64.length)\r\n : data;\r\n};\r\n\r\nexport const transformImageUrlToImageDataAsync = (imageUrl) => {\r\n const promise = readAsDataUrlAsync(imageUrl)\r\n .then(data => removeEncodingPrefix(data));\r\n return promise;\r\n};\r\n","import _ from 'underscore';\r\nimport { AdsStudioErrorBase } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nexport class AdsStudioODataError extends AdsStudioErrorBase {\r\n constructor({\r\n message, originError, originErrors, bulkupsertErrors,\r\n errorProcessor, // use processor to extend the error object with anything needed\r\n ...rest // additional data passed to processor\r\n }) {\r\n let errors = [];\r\n let status = '';\r\n if (originError) {\r\n errors = originError.errors || [];\r\n status = originError.status || '';\r\n } else if (originErrors) {\r\n errors = originErrors;\r\n } else if (bulkupsertErrors) {\r\n errors = bulkupsertErrors;\r\n }\r\n\r\n const { Code, Message, Property } = _.first(errors) || {};\r\n const errorCode = Code || 'Unknown';\r\n\r\n const params = { ...rest, errorMessage: Message || undefined, errorProperty: Property || undefined };\r\n super({\r\n message, originError, errorCode, errorProcessor, ...params,\r\n });\r\n\r\n this.errors = errors;\r\n this.status = status;\r\n }\r\n}\r\n","/* eslint-disable max-len */\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\n\r\nimport { parseFileName } from '@bingads-webui-campaign-react/upload-file-picker';\r\nimport { FilePayload } from '@bingads-webui/azure-upload';\r\n\r\nimport {\r\n CSMLImportSource,\r\n isRootFolderId,\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport { CSMLSortingRequestParams, parseMTDateString, formatCivilDate } from '../service-utils';\r\nimport { transformAssetResponse, transformVideoResponse } from './asset-response-transformers';\r\n\r\nimport {\r\n transformAddUploadAssetRequest,\r\n transformAddStockImageRequest,\r\n transformAddInvestImageRequest,\r\n transformAddInvestVideoRequest,\r\n transformAddUrlImageRequest,\r\n transformAddImageWithBaseIdRequest,\r\n transformDeleteAssetRequest,\r\n transformRenameRequest,\r\n transformAddUrlVideoRequest,\r\n} from './request-transformers';\r\n\r\nimport {\r\n AdsStudioODataError,\r\n renameFolderApiErrorProcessor,\r\n bulkMoveApiErrorProcessor,\r\n bulkMoveApiItemErrorProcessor,\r\n deleteFolderApiErrorProcessor,\r\n createFolderApiErrorProcessor,\r\n bulkDeleteAssetsApiItemErrorProcessor,\r\n bulkDeleteAssetsApiErrorProcessor\r\n} from '../../error-handling';\r\n\r\nconst transformParentHierarchy = folder => ({\r\n folderId: folder.Id,\r\n folderName: folder.Name,\r\n parentFolderId: folder.ParentFolderId,\r\n});\r\n\r\nconst transformFolderResponse = (folder, i18n) => {\r\n const response = {\r\n folderId: folder.Id,\r\n folderName: folder.Name,\r\n itemCount: folder.ItemsCount,\r\n createdTime: parseMTDateString(i18n, folder.CreatedTime),\r\n modifiedTime: parseMTDateString(i18n, folder.ModifiedTime),\r\n parentFolderId: folder.ParentFolderId,\r\n assets: _.map(folder.Assets || [], asset => transformAssetResponse(asset, asset.FolderAssetType, i18n)),\r\n subfolders: _.map(folder.SubFolders || [], subfolder => transformFolderResponse(subfolder, i18n)),\r\n parentHierarchy: _.map(folder.ParentHierarchy || [], parent => transformParentHierarchy(parent)),\r\n };\r\n const perfTimeSeriesData = folder['@ns.performancetimeseries'];\r\n if (!_.isEmpty(perfTimeSeriesData)) {\r\n response.perfTimeSeriesData = perfTimeSeriesData;\r\n }\r\n return response;\r\n};\r\n\r\nconst IMPORT_SOURCE_MAP = {\r\n [CSMLImportSource.Google]: 'GoogleImported',\r\n [CSMLImportSource.Facebook]: 'FacebookImported',\r\n};\r\n\r\nexport const getFolderRepository = ({\r\n folderODataService,\r\n azureUploader,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n logger,\r\n}) => {\r\n const getFolderArgs = ({\r\n perfMetricDateRange,\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n isVideoDurationBoundaryIncluded = false,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n importSource,\r\n assetSources,\r\n sortBy,\r\n skip,\r\n count,\r\n folderId,\r\n assetType,\r\n includeAssets,\r\n includeSubfolders,\r\n includeParentHierarchy,\r\n assetsToLoadForSubfolders = 1,\r\n isGlobalSearch = false,\r\n isAssetPickerScenario = false,\r\n hasPerfData = false,\r\n topRated,\r\n isSemanticSearch = false,\r\n isRecentSorting = false,\r\n }) => {\r\n //\r\n const filterArgs = {\r\n searchTerm: searchTerm ? encodeURIComponent(searchTerm.replace(/'/g, \"''\")) : '',\r\n minWidth,\r\n minHeight,\r\n isVideoDurationBoundaryIncluded,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart: dateAddedStart && formatCivilDate(i18n, dateAddedStart, ianaTimeZone, timezoneUTCOffset, '00:00:00'),\r\n dateAddedEnd: dateAddedEnd && formatCivilDate(i18n, dateAddedEnd, ianaTimeZone, timezoneUTCOffset, '23:59:59'),\r\n assetType,\r\n sourceType: IMPORT_SOURCE_MAP[importSource],\r\n hasPerfData,\r\n topRated,\r\n assetSources,\r\n };\r\n\r\n const expandArgs = {\r\n includeAssets,\r\n includeSubfolders,\r\n includeParentHierarchy,\r\n };\r\n\r\n const args = {\r\n skip,\r\n count,\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n expandArgs,\r\n filterArgs,\r\n assetsToLoadForSubfolders,\r\n isGlobalSearch,\r\n isAssetPickerScenario,\r\n perfMetricDateRange,\r\n isSemanticSearch,\r\n isRecentSorting,\r\n ...CSMLSortingRequestParams[sortBy],\r\n };\r\n return args;\r\n };\r\n\r\n const getFolderData = ({\r\n perfMetricDateRange,\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n isVideoDurationBoundaryIncluded = false,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n importSource,\r\n assetSources,\r\n sortBy,\r\n skip,\r\n count,\r\n folderId,\r\n assetType,\r\n includeAssets,\r\n includeSubfolders,\r\n includeParentHierarchy,\r\n assetsToLoadForSubfolders = 1,\r\n isGlobalSearch = false,\r\n isAssetPickerScenario = false,\r\n withBIData = false,\r\n hasPerfData = false,\r\n topRated = false,\r\n isSemanticSearch = false,\r\n isRecentSorting = false,\r\n perfMarker,\r\n }) => {\r\n //\r\n\r\n const args = getFolderArgs({\r\n perfMetricDateRange,\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n isVideoDurationBoundaryIncluded,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n importSource,\r\n assetSources,\r\n sortBy,\r\n skip,\r\n count,\r\n folderId,\r\n assetType,\r\n includeAssets,\r\n includeSubfolders,\r\n includeParentHierarchy,\r\n assetsToLoadForSubfolders,\r\n isGlobalSearch,\r\n isAssetPickerScenario,\r\n hasPerfData,\r\n topRated,\r\n isSemanticSearch,\r\n isRecentSorting,\r\n });\r\n if (perfMarker) {\r\n perfMarker.willInit();\r\n }\r\n if (withBIData) {\r\n return folderODataService.getFolderDataWithBIData(args).then((res) => {\r\n const folder = transformFolderResponse(res || {}, i18n);\r\n if (perfMarker) {\r\n perfMarker.done();\r\n }\r\n return { folder };\r\n });\r\n }\r\n\r\n return folderODataService.getFolderData(args).then((res) => {\r\n const folder = transformFolderResponse(res || {}, i18n);\r\n if (perfMarker) {\r\n perfMarker.done();\r\n }\r\n return { folder };\r\n });\r\n };\r\n\r\n const getPerfTimeSeriesData = ({\r\n perfMetricDateRange,\r\n perfTimeSeriesParams,\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n importSource,\r\n assetSources,\r\n assetType,\r\n isGlobalSearch,\r\n hasPerfData,\r\n folderId,\r\n topRated,\r\n }) => {\r\n const filterArgs = {\r\n searchTerm: searchTerm ? encodeURIComponent(searchTerm.replace(/'/g, \"''\")) : '',\r\n minWidth,\r\n minHeight,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart: dateAddedStart && formatCivilDate(i18n, dateAddedStart, ianaTimeZone, timezoneUTCOffset, '00:00:00'),\r\n dateAddedEnd: dateAddedEnd && formatCivilDate(i18n, dateAddedEnd, ianaTimeZone, timezoneUTCOffset, '23:59:59'),\r\n assetType,\r\n sourceType: IMPORT_SOURCE_MAP[importSource],\r\n hasPerfData,\r\n topRated,\r\n assetSources,\r\n };\r\n\r\n return folderODataService.getPerfTimeSeriesData({\r\n perfMetricDateRange, perfTimeSeriesParams, filterArgs, folderId, isGlobalSearch,\r\n }).then((res) => {\r\n const { value } = res || {};\r\n const perfTimeSeriesData = value || [];\r\n return { perfTimeSeriesData };\r\n });\r\n };\r\n\r\n const createFolder = ({\r\n folderName,\r\n parentFolderId,\r\n }) => {\r\n const args = {\r\n folderName,\r\n folderType: 'Image',\r\n parentFolderId: isRootFolderId(parentFolderId) ? null : parentFolderId,\r\n };\r\n\r\n const promise = folderODataService.createFolder(args)\r\n .catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `create folder api failed, status: ${err.status}`,\r\n originError: err,\r\n errorProcessor: createFolderApiErrorProcessor,\r\n });\r\n });\r\n\r\n return promise;\r\n };\r\n\r\n const uploadVideoToAzureBlobWithCancellation = ({\r\n fileObject,\r\n onProgress,\r\n }) => {\r\n const promise = new Promise((resolve, reject) => {\r\n const { ext: fileExtension } = parseFileName(fileObject.name);\r\n\r\n folderODataService.getBlobUploadUrl({ fileExtension })\r\n .then((blob) => {\r\n const { BlobName } = blob;\r\n const token = azureUploader.uploadPayloadToBlobWithCancellation({\r\n blob,\r\n payload: new FilePayload({ file: fileObject }),\r\n onProgress,\r\n });\r\n\r\n resolve({ token, blobName: BlobName });\r\n })\r\n .catch(reject);\r\n });\r\n return promise;\r\n };\r\n\r\n const deleteFolder = ({ folderId, folderName }) => {\r\n const promise = folderODataService.deleteFolder({ folderId }).catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `delete folder api failed, status: ${err.status}`,\r\n originError: err,\r\n errorProcessor: deleteFolderApiErrorProcessor,\r\n folderId,\r\n folderName,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n const renameFolder = ({ folderId, newFolderName }) => {\r\n const promise = folderODataService.renameFolder({ folderId, newFolderName })\r\n .catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `rename folder api failed, status: ${err.status}`,\r\n originError: err,\r\n errorProcessor: renameFolderApiErrorProcessor,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n const addFolderUploadAsset = ({\r\n folderId,\r\n asset,\r\n folderAssetType,\r\n inProgress,\r\n supportUpscale,\r\n }) => {\r\n const args = {\r\n asset: transformAddUploadAssetRequest(asset, folderAssetType),\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n inProgress,\r\n supportUpscale,\r\n };\r\n\r\n const promise = folderODataService.addAssets(args);\r\n\r\n return promise;\r\n };\r\n\r\n const addStockImageToFolder = ({\r\n folderId,\r\n stockImageId,\r\n }) => {\r\n const args = {\r\n asset: transformAddStockImageRequest({ stockImageId }),\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n };\r\n\r\n const promise = folderODataService.addAssets(args);\r\n\r\n return promise;\r\n };\r\n\r\n const addInvestImageToFolder = ({\r\n folderId,\r\n investImageId,\r\n imageSrc,\r\n }) => {\r\n const args = {\r\n asset: transformAddInvestImageRequest({ investImageId, imageSrc }),\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n };\r\n\r\n const promise = folderODataService.addAssets(args);\r\n\r\n return promise;\r\n };\r\n\r\n const addInvestVideoToFolder = ({\r\n folderId,\r\n investVideoId,\r\n videoSrc,\r\n description,\r\n }) => {\r\n const args = {\r\n asset: transformAddInvestVideoRequest({ investVideoId, videoSrc, description }),\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n };\r\n\r\n const promise = folderODataService.addAssets(args);\r\n\r\n return promise;\r\n };\r\n\r\n const addUrlImageToFolder = ({\r\n folderId,\r\n imageSrc,\r\n sourceType,\r\n }) => {\r\n const args = {\r\n asset: transformAddUrlImageRequest({ imageSrc, sourceType }),\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n };\r\n\r\n const promise = folderODataService.addAssets(args);\r\n\r\n return promise;\r\n };\r\n\r\n const addImageWithBaseIdToFolder = ({\r\n folderId,\r\n imageSrc,\r\n metaData,\r\n baseId,\r\n sourceType,\r\n }) => {\r\n const args = {\r\n asset: transformAddImageWithBaseIdRequest({\r\n imageSrc, metaData, baseId, sourceType,\r\n }),\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n };\r\n\r\n const promise = folderODataService.addAssets(args);\r\n\r\n return promise;\r\n };\r\n\r\n const postVideoByUrl = ({\r\n videoUrl,\r\n name,\r\n folderId,\r\n }) => {\r\n const args = {\r\n asset: transformAddUrlVideoRequest({ videoUrl, name }),\r\n folderId: isRootFolderId(folderId) ? null : folderId,\r\n };\r\n\r\n const promise = folderODataService.addAssets(args);\r\n\r\n return promise;\r\n };\r\n\r\n const updateVideoStatusByIds = (videoTasks) => {\r\n logger.logTrace('Update video status task length', { taskLength: videoTasks.length });\r\n return folderODataService.getVideosByIdsAsync(videoTasks).then((response) => {\r\n if (response && response.length > 0) {\r\n const transformedRes = response.map(item => transformVideoResponse(item, i18n));\r\n return transformedRes;\r\n }\r\n return [];\r\n });\r\n };\r\n\r\n const deleteAsset = ({\r\n assetId,\r\n folderAssetType,\r\n }) => {\r\n const asset = transformDeleteAssetRequest({ assetId, folderAssetType });\r\n const promise = folderODataService.deleteAsset(asset);\r\n\r\n return promise;\r\n };\r\n\r\n const renameAsset = ({\r\n assetId,\r\n folderAssetType,\r\n name,\r\n }) => {\r\n const asset = transformRenameRequest({ assetId, folderAssetType, name });\r\n const promise = folderODataService.updateAsset(asset);\r\n\r\n return promise;\r\n };\r\n\r\n const batchMove = ({\r\n destFolderId, assets, folders,\r\n }) => {\r\n const assetIds = _.map(assets, ({ folderAssetType, id: assetId }) => transformDeleteAssetRequest({ folderAssetType, assetId }).Asset);\r\n const folderIds = _.map(folders, ({ folderId }) => folderId);\r\n const promise = folderODataService.batchMove({\r\n destFolderId: isRootFolderId(destFolderId) ? null : destFolderId,\r\n assets: assetIds,\r\n folders: folderIds,\r\n }).then((res) => {\r\n // res only contains items with errors\r\n const assetsSummary = _.map(assets, (ast) => {\r\n // eslint-disable-next-line eqeqeq\r\n const { Success, Errors } = _.find(res.assets, ({ Id }) => Id == ast.id) || { Success: true };\r\n const ret = { ...ast };\r\n if (!Success) {\r\n ret.err = new AdsStudioODataError({ originErrors: Errors, errorProcessor: bulkMoveApiItemErrorProcessor });\r\n }\r\n return ret;\r\n }) || [];\r\n const foldersSummary = _.map(folders, (fdr) => {\r\n const { Success, Errors } = _.find(res.folders, ({ Id }) => Id === fdr.folderId) || { Success: true };\r\n const ret = { ...fdr };\r\n if (!Success) {\r\n ret.err = new AdsStudioODataError({ originErrors: Errors, errorProcessor: bulkMoveApiItemErrorProcessor });\r\n }\r\n return ret;\r\n }) || [];\r\n return { assetsSummary, foldersSummary, hasError: !_.isEmpty(res.assets) || !_.isEmpty(res.folders) };\r\n }).catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `batch move api failed, status: ${err.status}`,\r\n originError: err,\r\n errorProcessor: bulkMoveApiErrorProcessor,\r\n folderCount: folders ? folders.length : 0,\r\n assetCount: assets ? assets.length : 0,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n const bulkDeleteAssets = (assets) => {\r\n const assetsToDelete = _.map(assets, ({ folderAssetType, id: assetId }) => {\r\n const id = transformDeleteAssetRequest({ folderAssetType, assetId }).Asset.Id;\r\n return { assetId: id, folderAssetType };\r\n });\r\n const promise = folderODataService.bulkDeleteAssets(assetsToDelete).then((res) => {\r\n // res only contains itmes with errors\r\n const resultSummary = _.map(assets, (ast) => {\r\n const bulkupsertErrors = _.filter(res, ({ Id }) => Id === ast.id);\r\n const ret = { ...ast };\r\n if (!_.isEmpty(bulkupsertErrors)) {\r\n ret.err = new AdsStudioODataError({ bulkupsertErrors, errorProcessor: bulkDeleteAssetsApiItemErrorProcessor, assetType: ast.folderAssetType });\r\n }\r\n return ret;\r\n });\r\n return { resultSummary, hasError: !_.isEmpty(res) };\r\n }).catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `batch delete api failed, status: ${err.status}`,\r\n originError: err,\r\n errorProcessor: bulkDeleteAssetsApiErrorProcessor,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n return {\r\n getFolderData,\r\n getFolderArgs,\r\n getPerfTimeSeriesData,\r\n createFolder,\r\n uploadVideoToAzureBlobWithCancellation,\r\n deleteFolder,\r\n renameFolder,\r\n addFolderUploadAsset,\r\n addStockImageToFolder,\r\n addInvestImageToFolder,\r\n addInvestVideoToFolder,\r\n addUrlImageToFolder,\r\n addImageWithBaseIdToFolder,\r\n deleteAsset,\r\n bulkDeleteAssets,\r\n renameAsset,\r\n batchMove,\r\n postVideoByUrl,\r\n updateVideoStatusByIds,\r\n };\r\n};\r\n","import _ from 'underscore';\r\n\r\nimport {\r\n AdsStudioODataError,\r\n generateImagesWithAIAPIErrorProcessor,\r\n getAIGeneratedImageAPIErrorProcessor,\r\n} from '../../error-handling';\r\n\r\nexport const getAIGCRepository = ({ aigcODataService }) => {\r\n const generateImagesWithAIAsync = (userPrompt, skipBrandDetection = true) => {\r\n const promise = aigcODataService.generateImagesWithAIAsync(userPrompt, skipBrandDetection).then((res) => {\r\n const { TaskId } = res || {};\r\n return { taskId: TaskId };\r\n }).catch((err) => {\r\n const alError = new AdsStudioODataError({\r\n message: `GenerateImagesWithAI api failed, status: ${err.status}, prompt: ${userPrompt}`,\r\n originError: err,\r\n errorProcessor: generateImagesWithAIAPIErrorProcessor,\r\n });\r\n // brand name detected, return the brand names\r\n if (alError.brandNameDetected) {\r\n return { taskId: null, brandNameDetected: true, brandNames: alError.brandNames };\r\n }\r\n throw alError;\r\n });\r\n return promise;\r\n };\r\n\r\n const getAIGeneratedImageTaskStatus = (taskId) => {\r\n const promise = aigcODataService.getAIGeneratedImageTaskStatus(taskId).then((res) => {\r\n const {\r\n Status: status, // InProgress, Failed, Completed\r\n Progress: progress,\r\n // TaskId: tid,\r\n RecommendedImages,\r\n } = res || {};\r\n const images = _.map(RecommendedImages, ({\r\n Id, Source, Url, Theme, ModelSource,\r\n }) => ({\r\n id: Id, source: Source, url: Url, theme: Theme, modelSource: ModelSource,\r\n }));\r\n\r\n if (status === 'Failed') {\r\n // throw an error with a UI predefined error code\r\n const error = new Error(`AIGenerateImagesTaskStatus api failed, taskId: ${taskId}`);\r\n error.errors = [{\r\n Code: 'AI_Generation_Failed',\r\n }];\r\n throw error;\r\n }\r\n\r\n const isTaskDone = progress >= 100 || status === 'Completed';\r\n\r\n return {\r\n taskId, status, progress, images, isTaskDone,\r\n };\r\n }).catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `AIGenerateImagesTaskStatus api failed, status: ${err.status}, taskId: ${taskId}`,\r\n originError: err,\r\n errorProcessor: getAIGeneratedImageAPIErrorProcessor,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n return {\r\n generateImagesWithAIAsync,\r\n getAIGeneratedImageTaskStatus,\r\n };\r\n};\r\n","import {\r\n AdsStudioODataError,\r\n getRemoveImageBackgroundAPIErrorProcessor,\r\n} from '../../error-handling';\r\n\r\nexport const getBackgroundChangeRepository = (oDataService) => {\r\n const removeImageBackground = (imageUrl) => {\r\n const promise = oDataService.removeImageBackground(imageUrl).then((res) => {\r\n const { imageUrl: returnedImageUrl, roi } = res || {};\r\n return { imageUrl: returnedImageUrl, roi };\r\n }).catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `RemoveImageBackground api failed, status: ${err.status}, imageUrl: ${imageUrl}`,\r\n originError: err,\r\n errorProcessor: getRemoveImageBackgroundAPIErrorProcessor,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n const getImageSegmentations = (imageUrl) => {\r\n const promise = oDataService.getImageSegmentations(imageUrl).then((res) => {\r\n // base64 encoded mask\r\n const { MaskSets: rawMaskSetsBase64String, SelectedMasks: selectedMasksArray } = res || {};\r\n return { rawMaskSetsBase64String, selectedMasksArray };\r\n }).catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `GetImageSegmentation api failed, status: ${err.status}, imageUrl: ${imageUrl}`,\r\n originError: err,\r\n errorProcessor: getRemoveImageBackgroundAPIErrorProcessor,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n const generateImageBackground = ({\r\n prompt,\r\n // it could be original image url, in such case, the selectedMasks contains the mask ids user selected\r\n // if it's the url returned from 'removeImageBackground', the selectedMasks should be null\r\n imageUrl,\r\n // array of mask ids, if it's empty [], it means no mask is selected\r\n // if it's null, it means no masks are applied\r\n maskSetsBase64,\r\n selectedMasks,\r\n outputImageWidth,\r\n outputImageHeight,\r\n }) => {\r\n const promise = oDataService.generateImageBackground({\r\n prompt, imageUrl, selectedMasks, outputImageWidth, outputImageHeight, maskSetsBase64,\r\n }).then((res) => {\r\n const { ImageUrl } = res || {};\r\n return { imageUrl: ImageUrl };\r\n }).catch((err) => {\r\n throw new AdsStudioODataError({\r\n message: `GenerateImageBackground api failed, status: ${err.status}, imageUrl: ${imageUrl}, selectedMasks: ${JSON.stringify(selectedMasks)}, outputImageWidth: ${outputImageWidth}, outputImageHeight: ${outputImageHeight}`,\r\n originError: err,\r\n errorProcessor: getRemoveImageBackgroundAPIErrorProcessor,\r\n });\r\n });\r\n return promise;\r\n };\r\n\r\n const repository = {\r\n removeImageBackground,\r\n getImageSegmentations,\r\n generateImageBackground,\r\n };\r\n return repository;\r\n};\r\n","import { StockImageDataService } from '@bingads-webui-campaign/stock-image-data-service';\r\n\r\nexport const getStockImageRepository = ({\r\n aid, cid, oDataConfig, // logger,\r\n}) => {\r\n //\r\n const stockImageService = new StockImageDataService({\r\n cid, aid, oDataConfig, controller: 'StockImages',\r\n });\r\n\r\n const loadAssets = ({\r\n windowIndex, windowSize, searchText, filter, perfMarker,\r\n }) => {\r\n const customQueries = {\r\n appName: 'CampaignUI',\r\n $search: searchText,\r\n $skip: windowIndex * windowSize,\r\n $top: windowSize,\r\n language: 'en',\r\n includevertical: true,\r\n $query: filter, // stock filters\r\n };\r\n if (perfMarker) {\r\n perfMarker.willInit();\r\n }\r\n const $ret = stockImageService.getStockImages({ customQueries }).then((data) => {\r\n if (perfMarker) {\r\n perfMarker.done();\r\n }\r\n const totalItemCount = data && data['@odata.count'];\r\n const assets = data && data.value;\r\n return { assets, totalItemCount };\r\n });\r\n return $ret;\r\n };\r\n\r\n return {\r\n loadAssets,\r\n };\r\n};\r\n","import { FolderAssetType } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\nimport { ROOT_FOLDER_ID } from '../../../../ads-studio-app-shared-components/src/model';\r\nimport { getFolderRepository } from './folder-repository';\r\n\r\n// simplified version of asset library image repository\r\nexport const getBasicAssetsRepository = ({\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n assetType,\r\n logger,\r\n}) => {\r\n const folderRepository = getFolderRepository({\r\n logger,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n });\r\n\r\n const uploadImageToFolder = ({\r\n imageData,\r\n updateCurrentProgress,\r\n imageName,\r\n supportUpscale,\r\n }) => folderRepository.addFolderUploadAsset({\r\n folderId: ROOT_FOLDER_ID,\r\n asset: { data: imageData, name: imageName },\r\n folderAssetType: FolderAssetType.Image,\r\n inProgress: updateCurrentProgress,\r\n supportUpscale,\r\n });\r\n\r\n const loadAssets = ({\r\n windowIndex, windowSize, searchText, sortBy, minVideoDuration, maxVideoDuration, isSemanticSearch = false, isVideoDurationBoundaryIncluded = false, perfMarker,\r\n }) => {\r\n const top = windowSize;\r\n const skip = windowIndex * windowSize;\r\n if (perfMarker) {\r\n perfMarker.willInit();\r\n }\r\n const $ret = folderRepository.getFolderData({\r\n searchTerm: searchText,\r\n sortBy,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n isVideoDurationBoundaryIncluded,\r\n skip,\r\n count: top,\r\n assetType,\r\n includeAssets: true,\r\n includeSubfolder: false,\r\n includeParentHierarchy: true,\r\n isGlobalSearch: true,\r\n withBIData: false,\r\n isSemanticSearch,\r\n }).then((response) => {\r\n if (perfMarker) {\r\n perfMarker.done();\r\n }\r\n const { folder } = response || {};\r\n const {\r\n assets,\r\n itemCount,\r\n // folderId,\r\n // folderName,\r\n // parentFolderId,\r\n // subfolders,\r\n // parentHierarchy,\r\n } = folder || {};\r\n\r\n if (isSemanticSearch && searchText && searchText.length > 0) {\r\n if (logger && logger.logTrace) {\r\n logger.logTrace('Embedded Search in Basic Assets Repository: load assets', {\r\n searchText,\r\n assets,\r\n totalItemCount: (itemCount && itemCount.TotalCount) || 0,\r\n });\r\n }\r\n }\r\n\r\n return {\r\n assets,\r\n totalItemCount: (itemCount && itemCount.TotalCount) || 0,\r\n };\r\n });\r\n return $ret;\r\n };\r\n\r\n const renameAsset = ({\r\n assetId,\r\n folderAssetType,\r\n name,\r\n }) => {\r\n const $ret = folderRepository.renameAsset({\r\n assetId,\r\n folderAssetType,\r\n name,\r\n });\r\n return $ret;\r\n };\r\n\r\n return {\r\n loadAssets,\r\n renameAsset,\r\n uploadImageToFolder,\r\n updateVideoStatusByIds: folderRepository.updateVideoStatusByIds,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useMemo } from 'react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\n\r\nimport { odata } from '@bingads-webui/http-util';\r\nimport legacyOdata from '@bingads-webui-component-legacy/http/channel/odata';\r\nimport { ImageOData } from '@bingads-webui-campaign/image-odata';\r\nimport { AzureUploader } from '@bingads-webui/azure-upload';\r\nimport { fromLegacyTimeZone, getUTCOffsetWithoutDST } from '@bingads-webui-universal/time-zone-converter';\r\nimport { translateLegacyToIANATimezone } from '@bingads-webui-universal/temporal-utitlities';\r\nimport { getODataErrors as getODataErrorsImpl } from '@bingads-webui-campaign/api-errors';\r\n\r\nimport {\r\n getDefaultMetricDateRange,\r\n AssetWithFoldersDataServiceProvider,\r\n withAdsStudioServicesConsumer\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport { AdsStudioAppNameODataHeader } from '../constants';\r\nimport { getLoggerWithoutPageInfo, getLogVersion } from './logger/custom-logger';\r\n\r\nimport { useAdsStudioUserPreference, useAdsStudioAccountPreference } from './preferences';\r\n\r\nimport {\r\n getFolderODataService,\r\n getImageBulkEditODataService,\r\n getAIGCODataService,\r\n getVideoODataService,\r\n} from './odata-service';\r\nimport {\r\n getRepository,\r\n getFolderRepository,\r\n getAIGCRepository,\r\n getVideoRepository,\r\n} from './repository';\r\n\r\nexport const prepareODataConfig = (accountTimeZone, oDataConfig) => {\r\n const tz = fromLegacyTimeZone(accountTimeZone);\r\n const timezoneUTCOffset = getUTCOffsetWithoutDST(tz);\r\n const ianaTimeZone = translateLegacyToIANATimezone(accountTimeZone);\r\n\r\n const oDataConfigObj = {\r\n odataToken: oDataConfig.odataToken || oDataConfig.oDataToken,\r\n oDataToken: oDataConfig.odataToken || oDataConfig.oDataToken,\r\n odataPath: oDataConfig.odataPath || oDataConfig.oDataPath,\r\n oDataPath: oDataConfig.odataPath || oDataConfig.oDataPath,\r\n odataTokenType: oDataConfig.oDataTokenType || oDataConfig.odataTokenType,\r\n oDataTokenType: oDataConfig.oDataTokenType || oDataConfig.odataTokenType,\r\n applicationName: AdsStudioAppNameODataHeader.value,\r\n beforeSend: xhr => ({\r\n onBeforeSendDone: () => {\r\n xhr.setRequestHeader(AdsStudioAppNameODataHeader.key, AdsStudioAppNameODataHeader.value);\r\n },\r\n }),\r\n };\r\n\r\n return {\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n oDataConfig: oDataConfigObj,\r\n };\r\n};\r\n\r\nexport function withAdsStudioServicesProvider(WrappedComponent, { loggerTag } = {}) {\r\n const Wrapper = (props) => {\r\n const {\r\n aid,\r\n cid,\r\n accountTimeZone,\r\n oDataConfig,\r\n preferenceService,\r\n activity,\r\n i18n,\r\n allowedAssetType,\r\n permissions,\r\n perfMetricDateRange,\r\n dateFormat,\r\n } = props;\r\n\r\n const {\r\n timezoneUTCOffset,\r\n ianaTimeZone,\r\n oDataConfig: oDataConfigObj,\r\n } = useMemo(() => prepareODataConfig(accountTimeZone, oDataConfig), [accountTimeZone, oDataConfig]);\r\n\r\n // get preference service\r\n const adsStudioUserPreferences = useAdsStudioUserPreference({ preferenceService });\r\n const adsStudioAccountPreferences = useAdsStudioAccountPreference({ preferenceService });\r\n\r\n const versionForLog = useMemo(() => (getLogVersion(permissions)), [permissions]);\r\n const logger = useMemo(() => getLoggerWithoutPageInfo(activity, versionForLog, loggerTag), [activity, versionForLog]);\r\n\r\n const imageODataService = useMemo(\r\n () => new ImageOData(cid, aid, oDataConfigObj),\r\n [oDataConfigObj, aid, cid]\r\n );\r\n\r\n const imageBulkEditODataService = useMemo(\r\n () => getImageBulkEditODataService({\r\n odata, oDataConfig: oDataConfigObj, aid, cid, logger,\r\n }),\r\n [logger, oDataConfigObj, aid, cid]\r\n );\r\n\r\n const folderODataService = useMemo(\r\n () => getFolderODataService({\r\n odata,\r\n legacyOdata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n i18n,\r\n dateFormat,\r\n }),\r\n [aid, cid, dateFormat, i18n, oDataConfigObj]\r\n );\r\n\r\n const aigcODataService = useMemo(() => getAIGCODataService({\r\n odata, oDataConfig: oDataConfigObj, aid, cid,\r\n }), [aid, cid, oDataConfigObj]);\r\n\r\n const videoODataService = useMemo(() => getVideoODataService({\r\n odata, oDataConfig: oDataConfigObj, aid, cid,\r\n }), [aid, cid, oDataConfigObj]);\r\n\r\n const getODataErrors = useCallback((errs, defaultMessage) => {\r\n const errors = getODataErrorsImpl(errs, i18n, activity);\r\n if (!errors || _.isEmpty(errors)) {\r\n return defaultMessage;\r\n }\r\n return errors;\r\n }, [activity, i18n]);\r\n\r\n const repository = useMemo(\r\n () => getRepository({\r\n imageBulkEditODataService,\r\n imageODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n getODataErrors,\r\n }),\r\n [\r\n imageBulkEditODataService,\r\n imageODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n getODataErrors,\r\n ]\r\n );\r\n\r\n const azureUploader = useMemo(() => new AzureUploader({\r\n logger: {\r\n trace: logger.traceWithoutParams,\r\n },\r\n }), [logger]);\r\n\r\n const folderRepository = useMemo(\r\n () => getFolderRepository({\r\n azureUploader,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n logger,\r\n }),\r\n [azureUploader, folderODataService, i18n, ianaTimeZone, timezoneUTCOffset, logger]\r\n );\r\n\r\n const aigcRepository = useMemo(\r\n () => getAIGCRepository({ aigcODataService }),\r\n [aigcODataService]\r\n );\r\n\r\n const videoRepository = useMemo(\r\n () => getVideoRepository({\r\n videoODataService,\r\n }),\r\n [videoODataService]\r\n );\r\n\r\n const defaultPerfMetricDateRange = useMemo(() => getDefaultMetricDateRange(\r\n i18n, dateFormat,\r\n ianaTimeZone,\r\n perfMetricDateRange && perfMetricDateRange.Rangelcid\r\n ), [dateFormat, i18n, ianaTimeZone, perfMetricDateRange]);\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withAdsStudioServicesProvider(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n}\r\n\r\nexport function withAdsStudioServicesLoaded(WrappedComponent, options) {\r\n const Wrapper = withAdsStudioServicesProvider(withAdsStudioServicesConsumer(WrappedComponent), options);\r\n\r\n Wrapper.displayName = `withAdsStudioServicesLoaded(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n}\r\n","export const getVideoRepository = ({\r\n videoODataService,\r\n}) => {\r\n const addVideoCreative = ({ videoCreative, sourceType }) => {\r\n const res = videoODataService.addVideoCreative({ videoCreative, sourceType }).then(result => result.value);\r\n return res;\r\n };\r\n\r\n const getVideo = ({ id, fetchMetadata }) => videoODataService.getVideo({ id, fetchMetadata });\r\n\r\n return {\r\n addVideoCreative,\r\n getVideo,\r\n };\r\n};\r\n","import { AdsStudioAppNameODataHeader } from '../constants';\r\n\r\n//\r\nexport const getODataConfig = (serverContext) => {\r\n // todo: [4183527] move this odataPath value to serverContext and remove dup code from app init\r\n const isLocal = () => {\r\n const hostname = document.location.hostname.toLowerCase();\r\n return hostname.indexOf('ads.microsoft.com') === -1 &&\r\n hostname.indexOf('ads-int.microsoft.com') === -1;\r\n };\r\n\r\n const odataPath = isLocal() ? 'Advertiser/V2' : 'Campaign/V2';\r\n\r\n const oDataConfig = {\r\n odataToken: serverContext.Token,\r\n oDataToken: serverContext.Token,\r\n odataPath: `${serverContext.ServicesEndpoints.CampaignAPI}${odataPath}`,\r\n oDataPath: `${serverContext.ServicesEndpoints.CampaignAPI}${odataPath}`,\r\n applicationName: AdsStudioAppNameODataHeader.value,\r\n beforeSend: xhr => ({\r\n onBeforeSendDone: () => {\r\n xhr.setRequestHeader(AdsStudioAppNameODataHeader.key, AdsStudioAppNameODataHeader.value);\r\n },\r\n }),\r\n };\r\n return oDataConfig;\r\n};\r\n","import React, { useMemo, useCallback, useRef } from 'react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport _ from 'underscore';\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\n\r\nimport { odata } from '@bingads-webui/http-util';\r\nimport legacyOdata from '@bingads-webui-component-legacy/http/channel/odata';\r\nimport { AzureUploader } from '@bingads-webui/azure-upload';\r\n\r\nimport {\r\n useBasicAssetsService,\r\n useAIGeneratedImages,\r\n useMultiSourceAssetsService,\r\n useVideoTaskPoller,\r\n FolderAssetType,\r\n ROOT_FOLDER_ID,\r\n AIModelSource,\r\n CSMLAssetSource,\r\n getDefaultMetricDateRange,\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport {\r\n getStockImageRepository,\r\n} from './repository/stock-image-repository';\r\n\r\nimport {\r\n getAIGCODataService,\r\n getVideoODataService,\r\n getFolderODataService,\r\n} from './odata-service';\r\n\r\nimport {\r\n getBasicAssetsRepository,\r\n getBasicFoldersRepository,\r\n getLibraryAndStockImageRepository,\r\n getAIGCRepository,\r\n getFolderRepository,\r\n} from './repository';\r\n\r\nimport { prepareODataConfig } from './with-ads-studio-services-provider';\r\n\r\nexport const withLibraryAndStockImagesService = (WrappedComponent) => {\r\n const Wrapper = (props) => {\r\n const {\r\n aid, cid, accountTimeZone, oDataConfig, dateFormat, i18n, logger,\r\n } = props;\r\n\r\n const {\r\n timezoneUTCOffset,\r\n ianaTimeZone,\r\n oDataConfig: oDataConfigObj,\r\n } = useMemo(() => prepareODataConfig(accountTimeZone, oDataConfig), [accountTimeZone, oDataConfig]);\r\n\r\n const folderODataService = useMemo(\r\n () => getFolderODataService({\r\n odata,\r\n legacyOdata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n i18n,\r\n dateFormat,\r\n }),\r\n [aid, cid, dateFormat, i18n, oDataConfigObj]\r\n );\r\n\r\n const repository = useMemo(() => getLibraryAndStockImageRepository({\r\n aid,\r\n cid,\r\n oDataConfig,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n assetType: FolderAssetType.Image,\r\n logger,\r\n }), [aid, cid, folderODataService, i18n, ianaTimeZone, oDataConfig, timezoneUTCOffset, logger]);\r\n\r\n const {\r\n assets,\r\n loadAssets: loadData,\r\n loadMoreAssets: loadMoreData,\r\n renameAsset,\r\n totalAssetCount,\r\n getAssetCountBySource,\r\n // reloadAssets,\r\n // isLoading,\r\n // isCompleted,\r\n } = useMultiSourceAssetsService({ repository, dataSourceNames: repository.sourceNames });\r\n\r\n const totalAssetCountBySource = getAssetCountBySource();\r\n\r\n const dataService = useMemo(() => ({\r\n assets,\r\n loadData,\r\n loadMoreData,\r\n renameAsset,\r\n totalAssetCount,\r\n totalLibraryAssetCount: totalAssetCountBySource[repository.sourceNames[0]],\r\n totalStockAssetCount: totalAssetCountBySource[repository.sourceNames[1]],\r\n }), [assets, loadData, loadMoreData, renameAsset, repository.sourceNames, totalAssetCount, totalAssetCountBySource]);\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withLibraryAndStockImagesService(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n\r\nexport const withLibraryFoldersService = (WrappedComponent) => {\r\n const Wrapper = (props) => {\r\n const {\r\n aid, cid, accountTimeZone, oDataConfig, dateFormat, i18n, perfMetricDateRange, dataService: libraryDataService, logger,\r\n } = props;\r\n\r\n const {\r\n timezoneUTCOffset,\r\n ianaTimeZone,\r\n oDataConfig: oDataConfigObj,\r\n } = useMemo(() => prepareODataConfig(accountTimeZone, oDataConfig), [accountTimeZone, oDataConfig]);\r\n\r\n const defaultPerfMetricDateRange = useMemo(() => getDefaultMetricDateRange(\r\n i18n, dateFormat,\r\n ianaTimeZone,\r\n perfMetricDateRange && perfMetricDateRange.Rangelcid\r\n ), [dateFormat, i18n, ianaTimeZone, perfMetricDateRange]);\r\n\r\n const folderODataService = useMemo(\r\n () => getFolderODataService({\r\n odata,\r\n legacyOdata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n i18n,\r\n dateFormat,\r\n }),\r\n [aid, cid, dateFormat, i18n, oDataConfigObj]\r\n );\r\n\r\n const repository = useMemo(() => getBasicFoldersRepository({\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n perfMetricDateRange: defaultPerfMetricDateRange,\r\n logger,\r\n }), [defaultPerfMetricDateRange, folderODataService, i18n, ianaTimeZone, logger, timezoneUTCOffset]);\r\n\r\n const {\r\n assets,\r\n loadAssets: loadData,\r\n loadMoreAssets: loadMoreData,\r\n renameAsset,\r\n totalAssetCount,\r\n uploadImage,\r\n // reloadAssets,\r\n // isLoading,\r\n // isCompleted,\r\n } = useBasicAssetsService({ repository });\r\n\r\n const {\r\n videoUpdated,\r\n } = useVideoTaskPoller({\r\n assets, repository, logger, interval: 10000,\r\n });\r\n\r\n const mergedAssets = useMemo(() => {\r\n if (!_.isEmpty(videoUpdated)) {\r\n return assets.map((asset) => {\r\n const newUpdates = videoUpdated[asset.id];\r\n if (asset.folderAssetType === FolderAssetType.Video && newUpdates && newUpdates.status !== asset.status) {\r\n return {\r\n ...asset,\r\n ...newUpdates,\r\n };\r\n }\r\n\r\n return asset;\r\n });\r\n }\r\n return assets;\r\n }, [assets, videoUpdated]);\r\n\r\n const dataService = useMemo(() => ({\r\n assets: mergedAssets,\r\n loadData,\r\n loadMoreData,\r\n renameAsset,\r\n totalAssetCount,\r\n uploadImage,\r\n }), [loadData, loadMoreData, mergedAssets, renameAsset, totalAssetCount, uploadImage]);\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withLibraryFoldersService(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nconst noOpHook = (i18n, logger) => null;\r\n\r\nexport const withLibraryAssetsService = (WrappedComponent, { assetType, useVideoNotify = noOpHook }) => {\r\n const Wrapper = (props) => {\r\n const {\r\n aid, cid, accountTimeZone, oDataConfig, dateFormat, i18n, logger,\r\n } = props;\r\n\r\n const {\r\n timezoneUTCOffset,\r\n ianaTimeZone,\r\n oDataConfig: oDataConfigObj,\r\n } = useMemo(() => prepareODataConfig(accountTimeZone, oDataConfig), [accountTimeZone, oDataConfig]);\r\n\r\n const folderODataService = useMemo(\r\n () => getFolderODataService({\r\n odata,\r\n legacyOdata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n i18n,\r\n dateFormat,\r\n }),\r\n [aid, cid, dateFormat, i18n, oDataConfigObj]\r\n );\r\n\r\n const videoODataService = useMemo(() => getVideoODataService({\r\n odata, oDataConfig: oDataConfigObj, aid, cid,\r\n }), [aid, cid, oDataConfigObj]);\r\n\r\n const { getVideo } = videoODataService;\r\n\r\n const repository = useMemo(() => getBasicAssetsRepository({\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n assetType,\r\n logger,\r\n }), [folderODataService, i18n, ianaTimeZone, logger, timezoneUTCOffset]);\r\n\r\n\r\n const {\r\n assets,\r\n loadAssets: loadData,\r\n loadMoreAssets: loadMoreData,\r\n renameAsset,\r\n totalAssetCount,\r\n uploadImage,\r\n // reloadAssets,\r\n // isLoading,\r\n // isCompleted,\r\n } = useBasicAssetsService({ repository });\r\n\r\n const {\r\n videoUpdated,\r\n } = useVideoTaskPoller({\r\n assets, repository, logger, interval: 10000,\r\n });\r\n\r\n const notify = useVideoNotify({ i18n, logger });\r\n const updatedAssetsRef = useRef({});\r\n\r\n const mergedAssets = useMemo(() => {\r\n if (!_.isEmpty(videoUpdated) && assetType === FolderAssetType.Video) {\r\n return assets.map((asset) => {\r\n const newUpdates = videoUpdated[asset.id];\r\n if (newUpdates && newUpdates.status !== asset.status) {\r\n if (newUpdates.status === 'Failed' && notify && updatedAssetsRef.current[asset.id] !== newUpdates.status) {\r\n updatedAssetsRef.current[asset.id] = newUpdates.status;\r\n notify(false);\r\n }\r\n if (newUpdates.status === 'Active' && notify && updatedAssetsRef.current[asset.id] !== newUpdates.status) {\r\n updatedAssetsRef.current[asset.id] = newUpdates.status;\r\n notify(true);\r\n }\r\n return {\r\n ...asset,\r\n ...newUpdates,\r\n };\r\n }\r\n\r\n return asset;\r\n });\r\n }\r\n return assets;\r\n }, [assets, videoUpdated]);\r\n\r\n const dataService = useMemo(() => ({\r\n assets: mergedAssets,\r\n loadData,\r\n loadMoreData,\r\n renameAsset,\r\n totalAssetCount,\r\n uploadImage,\r\n getVideo,\r\n }), [loadData, loadMoreData, mergedAssets, renameAsset, totalAssetCount, uploadImage, getVideo]);\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withLibraryAssetsService(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n\r\nexport const withAIGCStockService = (WrappedComponent) => {\r\n const Wrapper = (props) => {\r\n const {\r\n aid, cid, accountTimeZone, oDataConfig, logger, i18n, dateFormat,\r\n } = props;\r\n\r\n const {\r\n timezoneUTCOffset,\r\n ianaTimeZone,\r\n oDataConfig: oDataConfigObj,\r\n } = useMemo(() => prepareODataConfig(accountTimeZone, oDataConfig), [accountTimeZone, oDataConfig]);\r\n\r\n const aigcODataService = useMemo(() => getAIGCODataService({\r\n odata, oDataConfig: oDataConfigObj, aid, cid,\r\n }), [aid, cid, oDataConfigObj]);\r\n\r\n const aigcRepository = useMemo(\r\n () => getAIGCRepository({ aigcODataService }),\r\n [aigcODataService]\r\n );\r\n\r\n const stockImageRepository = getStockImageRepository({\r\n aid, cid, oDataConfig: oDataConfigObj,\r\n });\r\n\r\n const {\r\n assets,\r\n loadAssets: loadData,\r\n loadMoreAssets: loadMoreData,\r\n totalAssetCount,\r\n // reloadAssets,\r\n // isLoading,\r\n // isCompleted,\r\n } = useBasicAssetsService({ repository: stockImageRepository });\r\n\r\n const {\r\n generateImagesByAI,\r\n } = useAIGeneratedImages({ repository: aigcRepository, logger });\r\n\r\n const folderODataService = useMemo(\r\n () => getFolderODataService({\r\n odata,\r\n legacyOdata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n i18n,\r\n dateFormat,\r\n }),\r\n [aid, cid, dateFormat, i18n, oDataConfigObj]\r\n );\r\n\r\n const azureUploader = useMemo(() => new AzureUploader({\r\n logger: {\r\n trace: logger.traceWithoutParams,\r\n },\r\n }), [logger]);\r\n\r\n const folderRepository = useMemo(\r\n () => getFolderRepository({\r\n azureUploader,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n logger,\r\n }),\r\n [azureUploader, folderODataService, i18n, ianaTimeZone, timezoneUTCOffset, logger]\r\n );\r\n\r\n const addStockImage = useCallback((stockImageId, folderId = ROOT_FOLDER_ID) => folderRepository.addStockImageToFolder({\r\n stockImageId,\r\n folderId,\r\n }), [folderRepository]);\r\n\r\n const addAIGCImage = useCallback((imageSrc, folderId = ROOT_FOLDER_ID, modelSource) => folderRepository.addUrlImageToFolder({\r\n imageSrc,\r\n folderId,\r\n sourceType: modelSource === AIModelSource.Recraft ? CSMLAssetSource.AIGeneratedByRecraft : CSMLAssetSource.AIGenerated,\r\n }), [folderRepository]);\r\n\r\n const dataService = useMemo(() => ({\r\n assets,\r\n loadData,\r\n loadMoreData,\r\n totalAssetCount,\r\n generateImagesByAI,\r\n addAIGCImage,\r\n addStockImage,\r\n }), [assets, loadData, loadMoreData, totalAssetCount, generateImagesByAI, addAIGCImage, addStockImage]);\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withLibraryAssetsService(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n","import React, { useMemo } from 'react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\n\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\nimport { odata } from '@bingads-webui/http-util';\r\nimport legacyOdata from '@bingads-webui-component-legacy/http/channel/odata';\r\nimport { ImageOData } from '@bingads-webui-campaign/image-odata';\r\nimport { useEditImageService } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\nimport { getAssetEnhancementSettings } from '@bingads-webui-campaign/image-experience-utils';\r\n\r\nimport { getImageBulkEditODataService, getFolderODataService, getBackgroundChangeODataService } from './odata-service';\r\nimport { getEditImageRepository } from './repository';\r\nimport { prepareODataConfig } from './with-ads-studio-services-provider';\r\nimport { getLoggerWithoutPageInfo, getLogVersion } from './logger/custom-logger';\r\n\r\nexport const withEditImageService = (WrappedComponent, propName = 'dataService') => {\r\n const Wrapper = (props) => {\r\n const {\r\n aid, cid, accountTimeZone, oDataConfig, i18n, dateFormat, permissions, activity,\r\n } = props;\r\n\r\n const {\r\n timezoneUTCOffset,\r\n ianaTimeZone,\r\n oDataConfig: oDataConfigObj,\r\n } = useMemo(() => prepareODataConfig(accountTimeZone, oDataConfig), [accountTimeZone, oDataConfig]);\r\n\r\n const versionForLog = useMemo(() => (getLogVersion(permissions)), [permissions]);\r\n const logger = useMemo(() => getLoggerWithoutPageInfo(activity, versionForLog), [activity, versionForLog]);\r\n\r\n const imageODataService = useMemo(\r\n () => new ImageOData(cid, aid, oDataConfigObj),\r\n [oDataConfigObj, aid, cid]\r\n );\r\n\r\n const imageBulkEditODataService = useMemo(\r\n () => getImageBulkEditODataService({\r\n odata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n }),\r\n [oDataConfigObj, aid, cid]\r\n );\r\n\r\n const folderODataService = useMemo(\r\n () => getFolderODataService({\r\n odata,\r\n legacyOdata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n i18n,\r\n dateFormat,\r\n }),\r\n [oDataConfigObj, aid, cid, i18n, dateFormat]\r\n );\r\n\r\n const backgroundChangeODataService = useMemo(\r\n () => getBackgroundChangeODataService({\r\n odata,\r\n oDataConfig: oDataConfigObj,\r\n aid,\r\n cid,\r\n }),\r\n [oDataConfigObj, aid, cid]\r\n );\r\n\r\n const repository = useMemo(() => getEditImageRepository({\r\n imageODataService,\r\n imageBulkEditODataService,\r\n backgroundChangeODataService,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n }), [imageODataService, imageBulkEditODataService, backgroundChangeODataService, folderODataService, i18n, ianaTimeZone, timezoneUTCOffset]);\r\n\r\n const {\r\n getImagesWithFilter,\r\n getImagesWithBlur,\r\n getImagesWithFilterAndBlur,\r\n imagesWithFilter,\r\n imagesWithFilterAndBlur,\r\n removeImageBackground,\r\n generateImageBackground,\r\n getImageSegmentations,\r\n saveImage,\r\n saveImageCopy,\r\n cropImage,\r\n getImageById,\r\n uploadImageToFolder,\r\n saveImageWithBaseId,\r\n uploadStockImage,\r\n moveImageToFolder,\r\n imageFit,\r\n addImageWithBaseIdToFolder,\r\n } = useEditImageService({\r\n repository,\r\n logger,\r\n });\r\n\r\n const dataService = useMemo(() => ({\r\n getImagesWithFilter,\r\n getImagesWithBlur,\r\n getImagesWithFilterAndBlur,\r\n imagesWithFilter,\r\n imagesWithFilterAndBlur,\r\n removeImageBackground,\r\n generateImageBackground,\r\n getImageSegmentations,\r\n saveImage,\r\n saveImageCopy,\r\n cropImage,\r\n getImageById,\r\n uploadStockImage,\r\n uploadImageToFolder,\r\n saveImageWithBaseId,\r\n moveImageToFolder,\r\n imageFit,\r\n addImageWithBaseIdToFolder,\r\n }), [getImagesWithFilter, getImagesWithBlur, getImagesWithFilterAndBlur, imagesWithFilter, imagesWithFilterAndBlur, removeImageBackground, generateImageBackground, getImageSegmentations, saveImage, saveImageCopy, cropImage, getImageById, uploadStockImage, uploadImageToFolder, saveImageWithBaseId, moveImageToFolder, imageFit, addImageWithBaseIdToFolder]);\r\n\r\n const getAssetEnhancementSettingsService = useMemo(() => () => getAssetEnhancementSettings({\r\n aid,\r\n cid,\r\n oDataConfig: oDataConfigObj,\r\n }), [aid, cid, oDataConfigObj]);\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withEditImageService(${getDisplayName(WrappedComponent)})`;\r\n\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n","import { ROOT_FOLDER_ID, FolderAssetType } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport { getRepository } from './image-repository';\r\nimport { getFolderRepository } from './folder-repository';\r\nimport { getBackgroundChangeRepository } from './background-change-repository';\r\nimport { transformImageUrlToImageDataAsync } from './request-transformers';\r\n\r\nexport const getEditImageRepository = ({\r\n imageODataService,\r\n imageBulkEditODataService,\r\n backgroundChangeODataService,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n}) => {\r\n const repository = getRepository({\r\n imageODataService,\r\n imageBulkEditODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n });\r\n\r\n const folderRepository = getFolderRepository({\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n });\r\n\r\n const backgroundChangeRepository = getBackgroundChangeRepository(backgroundChangeODataService);\r\n\r\n const cropImage = ({ imageId, cropSettings, placementSettings }) => {\r\n const promise = repository.cropImage({ imageId, cropSettings, placementSettings });\r\n return promise;\r\n };\r\n\r\n const generateImageWithSmartEffect = ({ imageUrl, smartEffects }) => {\r\n const promise = repository.generateImageWithSmartEffect({ imageUrl, smartEffects });\r\n return promise;\r\n };\r\n\r\n const saveImageCopy = ({ imageUrl, folderId, sourceType }) => {\r\n const promise = folderRepository.addUrlImageToFolder({\r\n imageSrc: imageUrl,\r\n folderId,\r\n sourceType,\r\n });\r\n return promise;\r\n };\r\n\r\n const saveImage = ({ imageUrl, imageId, type }) => {\r\n const promise = transformImageUrlToImageDataAsync(imageUrl)\r\n .then(imageData => repository.updateImageData({\r\n imageId,\r\n imageData,\r\n type,\r\n }));\r\n return promise;\r\n };\r\n\r\n const getImageById = ({ imageId, isImageFittingEnabled }) => {\r\n const promise = repository.getImage(imageId, isImageFittingEnabled);\r\n return promise;\r\n };\r\n\r\n const uploadImageToFolder = ({\r\n imageData,\r\n folderId,\r\n }) => {\r\n const promise = folderRepository.addFolderUploadAsset({\r\n folderId,\r\n asset: { data: imageData },\r\n folderAssetType: FolderAssetType.Image,\r\n });\r\n return promise;\r\n };\r\n\r\n const saveImageWithBaseId = ({ image, baseId, folderId }) => {\r\n const promise = repository.saveImageWithBaseId({ image, baseId, folderId });\r\n return promise;\r\n };\r\n\r\n const removeImageBackground = (imageUrl) => {\r\n const promise = backgroundChangeRepository.removeImageBackground(imageUrl);\r\n return promise;\r\n };\r\n\r\n const getImageSegmentations = (imageUrl) => {\r\n const promise = backgroundChangeRepository.getImageSegmentations(imageUrl);\r\n return promise;\r\n };\r\n\r\n const generateImageBackground = ({\r\n prompt,\r\n // it could be original image url, in such case, the selectedMasks contains the mask ids user selected\r\n // if it's the url returned from 'removeImageBackground', the selectedMasks should be null\r\n imageUrl,\r\n // array of mask ids, if it's empty [], it means no mask is selected\r\n // if it's null, it means no masks are applied\r\n maskSetsBase64,\r\n selectedMasks,\r\n outputImageWidth,\r\n outputImageHeight,\r\n }) => {\r\n const promise = backgroundChangeRepository.generateImageBackground({\r\n prompt,\r\n imageUrl,\r\n maskSetsBase64,\r\n selectedMasks,\r\n outputImageWidth,\r\n outputImageHeight,\r\n });\r\n return promise;\r\n };\r\n\r\n const uploadStockImageToFolder = ({\r\n stockImageId,\r\n folderId = ROOT_FOLDER_ID,\r\n }) => {\r\n const promise = folderRepository.addStockImageToFolder({\r\n folderId,\r\n stockImageId,\r\n });\r\n return promise;\r\n };\r\n\r\n const moveImageToFolder = ({ image, destFolderId }) => {\r\n const promise = folderRepository.batchMove({\r\n assets: [image],\r\n destFolderId,\r\n });\r\n return promise;\r\n };\r\n\r\n const imageFit = ({ imageUrl, placements, skipOutpainting }) => {\r\n const promise = repository.imageFit({\r\n imageUrl,\r\n placements,\r\n skipOutpainting,\r\n });\r\n return promise;\r\n };\r\n\r\n const addImageWithBaseIdToFolder = ({\r\n imageSrc, baseId, folderId, metaData,\r\n }) => {\r\n const promise = folderRepository.addImageWithBaseIdToFolder({\r\n imageSrc,\r\n baseId,\r\n folderId,\r\n metaData,\r\n });\r\n return promise;\r\n };\r\n\r\n return {\r\n cropImage,\r\n generateImageWithSmartEffect,\r\n saveImage,\r\n saveImageCopy,\r\n getImageById,\r\n uploadImageToFolder,\r\n saveImageWithBaseId,\r\n removeImageBackground,\r\n getImageSegmentations,\r\n generateImageBackground,\r\n uploadStockImageToFolder,\r\n moveImageToFolder,\r\n imageFit,\r\n addImageWithBaseIdToFolder,\r\n };\r\n};\r\n","import React, { useMemo } from 'react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\nimport { useBrandKitRepository } from '@bingads-webui-campaign-react/brandkit-data-service';\r\n// TODO: MOVE THIS FILE TO BRANDKIT-DATA-SERVICE PACKAGE\r\nexport const withBrandKitService = (WrappedComponent) => {\r\n const Wrapper = (props) => {\r\n const dataService = useBrandKitRepository();\r\n const {\r\n getBrandKits,\r\n updateBrandKit,\r\n createBrandKits,\r\n brandkitResp,\r\n brandkitError,\r\n cache,\r\n brandkitLoading,\r\n } = dataService;\r\n const brandKitDataService = useMemo(() => ({\r\n getBrandKits,\r\n updateBrandKit,\r\n createBrandKits,\r\n }), [createBrandKits, getBrandKits, updateBrandKit]);\r\n const brandkitApiState = useMemo(() => ({\r\n brandkitResp,\r\n brandkitError,\r\n cache,\r\n brandkitLoading,\r\n }), [brandkitError, brandkitLoading, brandkitResp, cache]);\r\n return (\r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withBrandKitService(${getDisplayName(WrappedComponent)})`;\r\n\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n","import React from 'react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport { CopilotRepositoryProvider, useCopilotRepositoryContext } from '@bingads-webui/inline-copilot';\r\n\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\n\r\nconst witDataService = (WrappedComponent) => {\r\n const Wrapper = (props) => {\r\n const repository = useCopilotRepositoryContext();\r\n const {\r\n fetchDisplayAdsTemplateGroups,\r\n fetchDisplayAdsTemplateGroupDetails,\r\n editDisplayAdsAssetRecommendations,\r\n fetchDisplayAdsTemplateDefinition,\r\n } = repository;\r\n\r\n return (\r\n );\r\n };\r\n\r\n Wrapper.displayName = `withCopilotDataService(${getDisplayName(WrappedComponent)})`;\r\n\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n\r\nconst withCopilotDataServiceProvider = (WrappedComponent) => {\r\n const Wrapper = (props) => {\r\n const {\r\n perfMarker,\r\n serverContext,\r\n } = props;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n Wrapper.displayName = `withCopilotRepositoryProvider(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n};\r\n\r\nexport const withDisplayTemplatesService = (WrappedComponent) => {\r\n const WithDataService = witDataService(WrappedComponent);\r\n const WithCopilotProvider = withCopilotDataServiceProvider(WithDataService);\r\n\r\n return WithCopilotProvider;\r\n};\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\n\r\nexport function withPagePerfMarker(WrappedComponent, perfMarkerName) {\r\n const Wrapper = (props) => {\r\n const { perfMarker } = props || {};\r\n const [dataLoadedOnce, setDataLoadedOnce] = useState(false);\r\n const [pagePerfMarker] = useState(() => {\r\n const marker = perfMarker.createChild(perfMarkerName);\r\n marker.willInit();\r\n return marker;\r\n });\r\n\r\n const setDataLoaded = useCallback(() => {\r\n setDataLoadedOnce(true);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (dataLoadedOnce && pagePerfMarker) {\r\n pagePerfMarker.done();\r\n }\r\n }, [dataLoadedOnce]);\r\n\r\n return ;\r\n };\r\n\r\n Wrapper.displayName = `withPagePerfMarker(${getDisplayName(WrappedComponent)})`;\r\n hoistNonReactStatics(Wrapper, WrappedComponent);\r\n\r\n return Wrapper;\r\n}\r\n","import { makeStyles, makeResetStyles, shorthands } from '@fluentui/react-components';\r\n\r\nexport const useBaseTargetFolderPickerStyles = makeResetStyles({\r\n marginLeft: '0px',\r\n marginRight: '0px',\r\n});\r\n\r\nexport const useTargetFolderPickerStyle = makeStyles({\r\n targetFolderPickerViewContainer: {\r\n '& .target-folder-picker-asset-cell': {\r\n opacity: 0.5,\r\n },\r\n },\r\n dialog: {\r\n '&.fui-DialogSurface': {\r\n ...shorthands.overflow('hidden'),\r\n maxWidth: '890px',\r\n },\r\n '& .fui-DialogContent': {\r\n maxHeight: '500px',\r\n minHeight: '500px',\r\n overflowX: 'hidden',\r\n overflowY: 'auto',\r\n },\r\n '& .fui-DialogActions': {\r\n marginTop: '16px',\r\n },\r\n },\r\n filterContainer: {\r\n ...shorthands.padding('8px', '0'),\r\n },\r\n folderPathContainer: {\r\n marginLeft: '-4px',\r\n marginBottom: '-8px',\r\n },\r\n});\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { mergeClasses } from '@fluentui/react-components';\r\nimport {\r\n AdsStudioLibraryPageContent,\r\n AdsStudioFoldersGridCell,\r\n GridSectionName,\r\n ImagesFilterBar,\r\n FolderPathBreadcrumb,\r\n GridCellFactory,\r\n LibraryEmptyView,\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport { useBaseTargetFolderPickerStyles, useTargetFolderPickerStyle } from './target-folder-picker-style';\r\n\r\nexport const AdsStudioTargetFolderPicker = ({\r\n selectedFolder,\r\n setSelectedFolder,\r\n dataService,\r\n i18n,\r\n dateFormat,\r\n ianaTimeZone,\r\n assetLibraryUserPreferences,\r\n logger,\r\n notificationApi,\r\n permissions,\r\n}) => {\r\n const classes = useTargetFolderPickerStyle();\r\n const baseClassName = useBaseTargetFolderPickerStyles();\r\n const resetSelectionState = useCallback(() => {\r\n setSelectedFolder(null);\r\n }, [setSelectedFolder]);\r\n\r\n const {\r\n folders, navigateIntoFolder, folderPath, navigateToFolderInPath,\r\n } = dataService;\r\n\r\n useEffect(() => {\r\n if (selectedFolder && !_.find(folders, f => f === selectedFolder)) {\r\n resetSelectionState();\r\n }\r\n }, [folders, resetSelectionState, selectedFolder]);\r\n\r\n const renderTilesGridCell = useCallback(({\r\n item, index, searchText, sectionName,\r\n }) => {\r\n const onFolderClick = () => {\r\n const { folderId } = item || {};\r\n if (folderId) {\r\n navigateIntoFolder({ id: folderId });\r\n resetSelectionState();\r\n logger.logTrace('Navigate into folder in target folder picker', { folderId });\r\n }\r\n };\r\n\r\n // folder cell\r\n if (sectionName === GridSectionName.Folder) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n // image cell\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }, [navigateIntoFolder, resetSelectionState, logger, classes.targetFolderPickerFolderCell, i18n]);\r\n\r\n const onFailedToLoadData = useCallback(() => {\r\n notificationApi.showWarning(i18n.getString(_TL_('Failed to load assets. Please refresh the page and try again.')));\r\n }, [i18n, notificationApi]);\r\n\r\n const onFolderPathClicked = useCallback((item) => {\r\n navigateToFolderInPath({ id: item.key });\r\n }, [navigateToFolderInPath]);\r\n\r\n const onRenderHeader = useCallback(() => (\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n ), [classes, folderPath, i18n, onFolderPathClicked]);\r\n\r\n const onRenderEmptyView = useCallback(() => (\r\n \r\n ), [i18n]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nAdsStudioTargetFolderPicker.propTypes = {\r\n selectedFolder: PropTypes.shape({}),\r\n setSelectedFolder: PropTypes.func.isRequired,\r\n dataService: PropTypes.shape({\r\n folders: PropTypes.arrayOf(PropTypes.shape({})),\r\n navigateIntoFolder: PropTypes.func,\r\n folderPath: PropTypes.arrayOf(PropTypes.shape({})),\r\n navigateToFolderInPath: PropTypes.func,\r\n }).isRequired,\r\n logger: PropTypes.shape({\r\n logTrace: PropTypes.func,\r\n logError: PropTypes.func,\r\n }).isRequired,\r\n ianaTimeZone: PropTypes.string.isRequired,\r\n dateFormat: PropTypes.string.isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n assetLibraryUserPreferences: PropTypes.shape({}),\r\n notificationApi: PropTypes.shape({\r\n showWarning: PropTypes.func,\r\n }).isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({}),\r\n }),\r\n};\r\n\r\nAdsStudioTargetFolderPicker.defaultProps = {\r\n selectedFolder: null,\r\n assetLibraryUserPreferences: null,\r\n permissions: { dynamic: {} },\r\n};\r\n\r\n","import React, { useState, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogBody,\r\n DialogSurface,\r\n DialogTitle,\r\n Button,\r\n mergeClasses,\r\n} from '@fluentui/react-components';\r\nimport { Dismiss20Regular } from '@fluentui/react-icons';\r\n\r\nimport { AdsStudioTargetFolderPicker } from './target-folder-picker-view';\r\nimport { useTargetFolderPickerStyle } from './target-folder-picker-style';\r\n\r\n// const modalWidth = 940;\r\n\r\nexport const TargetFolderPickerModal = ({\r\n dataService, isGlobalSearch, sourceFolderId, show, onMoveHereClick, onCancel, i18n, ...rest\r\n}) => {\r\n const [selectedFolder, setSelectedFolder] = useState(null);\r\n\r\n const { currentFolderId } = dataService;\r\n\r\n const onMoveClickButtonClick = () => {\r\n onMoveHereClick(currentFolderId);\r\n };\r\n\r\n const moveHereButtonDisabled = !isGlobalSearch && (currentFolderId === sourceFolderId);\r\n\r\n const DismissIcon = useMemo(() => , [onCancel]);\r\n\r\n const classes = useTargetFolderPickerStyle();\r\n\r\n return (\r\n \r\n \r\n \r\n {i18n.getString(_TL_('Select folder'))}\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\r\nTargetFolderPickerModal.propTypes = {\r\n dataService: PropTypes.shape({\r\n currentFolderId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\r\n }).isRequired,\r\n isGlobalSearch: PropTypes.bool.isRequired,\r\n sourceFolderId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n show: PropTypes.bool.isRequired,\r\n onMoveHereClick: PropTypes.func.isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n notificationApi: PropTypes.shape({\r\n showWarning: PropTypes.func,\r\n }).isRequired,\r\n};\r\n","import React, { useState, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport {\r\n withFilterContext,\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport { withAdsStudioServicesLoaded } from '../../../services';\r\nimport { TargetFolderPickerModal } from './target-folder-picker-modal';\r\n\r\nconst Modal = ({\r\n isGlobalSearch,\r\n sourceFolderId,\r\n isModalVisible,\r\n setModalVisible,\r\n batchMoveAsync,\r\n onSuccess,\r\n onError,\r\n i18n,\r\n logger,\r\n ...rest\r\n}) => {\r\n const onCancel = useCallback(() => {\r\n setModalVisible(false);\r\n logger.logTrace('Cancel to batch move');\r\n }, [logger, setModalVisible]);\r\n\r\n const onMoveHereClick = useCallback((selectedFolderId) => {\r\n logger.logTrace('Confirm to batch move');\r\n batchMoveAsync({\r\n destFolderId: selectedFolderId,\r\n }).then((result) => {\r\n setModalVisible(false);\r\n onSuccess(result);\r\n\r\n const { hasError } = result || {};\r\n if (hasError) {\r\n logger.logTrace('Batch move is done with some errors');\r\n } else {\r\n logger.logTrace('Batch move successfully');\r\n }\r\n }).catch((alODataErr) => {\r\n const { getUXMessage } = alODataErr;\r\n // close modal, and show message to user\r\n setModalVisible(false);\r\n logger.logError(alODataErr);\r\n onError(getUXMessage(i18n));\r\n });\r\n }, [logger, batchMoveAsync, setModalVisible, onSuccess, onError, i18n]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nModal.propTypes = {\r\n isGlobalSearch: PropTypes.bool.isRequired,\r\n sourceFolderId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\r\n isModalVisible: PropTypes.bool.isRequired,\r\n setModalVisible: PropTypes.func.isRequired,\r\n batchMoveAsync: PropTypes.func.isRequired,\r\n onSuccess: PropTypes.func.isRequired,\r\n onError: PropTypes.func.isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n logger: PropTypes.shape({\r\n logTrace: PropTypes.func,\r\n logError: PropTypes.func,\r\n }).isRequired,\r\n notificationApi: PropTypes.shape({\r\n showWarning: PropTypes.func,\r\n }).isRequired,\r\n};\r\n\r\nconst ModalWithActivityAndDataService = withFilterContext(withActivityContext(withAdsStudioServicesLoaded(Modal)));\r\n\r\n// rest:\r\n// aid, cid, dateFormat, accountTimeZone, oDataConfig, preferenceService, activity, allowedAssetType\r\nconst getUseBatchMoveModalHook = ModalComponent => ({ i18n, logger, ...rest }) => {\r\n const [isModalVisible, setModalVisible] = useState(false);\r\n\r\n const openModal = () => {\r\n setModalVisible(true);\r\n };\r\n\r\n const render = useCallback((isGlobalSearch, sourceFolderId, batchMoveAsync, onSuccess, onError) => (\r\n isModalVisible ?\r\n : null\r\n ), [i18n, isModalVisible, logger, rest]);\r\n\r\n return {\r\n open: openModal,\r\n render,\r\n };\r\n};\r\n\r\nexport const useBatchMoveModal = getUseBatchMoveModalHook(ModalWithActivityAndDataService);\r\n\r\n// for test\r\nexport const useBatchMoveModalWithoutServices = getUseBatchMoveModalHook(Modal);\r\n","import React from 'react';\r\nimport { useParams } from 'react-router-dom';\r\nimport { withFullScreenWithSummaryBar } from '@bingads-webui-react/app-layout-container';\r\nimport { EditVideoPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\n\r\nexport const EditVideoPageImpl = (props) => {\r\n const { videoId } = useParams();\r\n\r\n return ();\r\n};\r\n\r\nexport const EditVideoPage = withFullScreenWithSummaryBar(EditVideoPageImpl);\r\n","import React from 'react';\r\n\r\nimport { UploadFilesPanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nconst globalLegacyI18n = window && window.globalLegacyI18n;\r\n\r\nexport const UploadFilesPanelPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { UploadFolderPanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nconst globalLegacyI18n = window && window.globalLegacyI18n;\r\n\r\nexport const UploadFolderPanelPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { AssetDetailsPage as AssetDetailsPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\nimport { useAdStudioInlineChart } from '../performance-page/hooks/use-inline-chart';\r\n\r\nconst globalLegacyI18n = window && window.globalLegacyI18n;\r\n\r\nexport const AssetDetailsPage = (props) => {\r\n const { getGranularityEnum } = useAdStudioInlineChart({\r\n serverContext: props.serverContext,\r\n globalLegacyI18n,\r\n // forceToResizeChart,\r\n });\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\n\r\nimport { BackgroundRemovalModalComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nconst globalLegacyI18n = window && window.globalLegacyI18n;\r\n\r\nexport const BackgroundRemovalModalPage = props => (\r\n \r\n);\r\n","import Promise from 'bluebird';\r\nimport { useMemo, useCallback } from 'react';\r\nimport { FilterStorageFactory } from '@bingads-webui-campaign/filter-storage';\r\nimport { useGlobalFilterContext } from '@bingads-webui-react/global-filter-context';\r\n\r\nfunction getAdFilterStore(preferenceService) {\r\n const adFilterFactory = new FilterStorageFactory({\r\n preferenceService,\r\n featureName: 'AdGrid',\r\n entityName: 'Ad',\r\n });\r\n const adFilterStore = adFilterFactory.create('editableFilter', {\r\n filterEntityOptions: {\r\n entitySchema: { name: 'Ad' },\r\n },\r\n });\r\n return adFilterStore;\r\n}\r\n\r\nexport const useAdFilter = ({ preferenceService }) => {\r\n const { updateWaterfallFilter } = useGlobalFilterContext();\r\n\r\n const adFilterStore = useMemo(\r\n () => (preferenceService ? getAdFilterStore(preferenceService) : null),\r\n [preferenceService]\r\n );\r\n\r\n // wrap save method to wait remote preference updating done\r\n const saveFilter = useCallback((filter, waitRemote) => {\r\n // delete first and then create\r\n let deletePromise = adFilterStore.clean() || Promise.resolve();\r\n if (waitRemote) {\r\n const remoteSyncTasks = preferenceService.onRemoteSyncDone(1);\r\n // eslint-disable-next-line no-unused-vars\r\n deletePromise = deletePromise.then(() => remoteSyncTasks).catch((err) => { /* ignore */ });\r\n }\r\n\r\n let savePromise = adFilterStore.save(filter);\r\n if (waitRemote) {\r\n const remoteSyncTasks = preferenceService.onRemoteSyncDone(1);\r\n savePromise = savePromise.then(() => remoteSyncTasks);\r\n }\r\n\r\n return deletePromise.then(() => savePromise);\r\n }, [adFilterStore, preferenceService]);\r\n\r\n const adFilterStoreWrapper = useMemo(() => ({ ...adFilterStore, save: saveFilter }), [adFilterStore, saveFilter]);\r\n\r\n return {\r\n updateWaterfallFilter,\r\n adFilterStore: adFilterStoreWrapper,\r\n };\r\n};\r\n","/* eslint-disable no-param-reassign */\r\n/* eslint-disable max-len */\r\nimport _ from 'underscore';\r\nimport React, { useEffect, useMemo, useState } from 'react';\r\nimport { CampaignFetchProvider } from '@bingads-webui-campaign-react/campaign-http';\r\nimport PropTypes from 'prop-types';\r\nimport { useRouteMatch } from 'react-router-dom';\r\nimport { useTheme } from 'react-jss';\r\n\r\nimport { QueryParam } from '@bingads-webui-react/scope-service';\r\nimport { Scenario, Activity, withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { WaterfallFilterType } from '@bingads-webui-campaign/filter-storage';\r\nimport { isCopilotRegionRestricted } from '@bingads-webui-react/copilot-utils';\r\n\r\nimport {\r\n ComponentStylesProvider,\r\n LocalNavigationProvider,\r\n DataProvider,\r\n} from '@bingads-webui-campaign-react/ads-studio-shared-components';\r\nimport {\r\n AdsStudioThemeProvider,\r\n withFilterContext,\r\n FolderAssetType,\r\n withGenerateImageContext,\r\n withAssetTaskStatusPoller,\r\n removeAdStudioSurveyTriggerFlag,\r\n AdStudioSurveyTriggerFlag,\r\n withCcJsDataContextProvider,\r\n} from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\n\r\nimport { useVideoNotify, withAdStudioNavigation } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { useCustomStyles } from './styles';\r\nimport { getAppRoutes } from './routes';\r\nimport { propsAdapter } from './adapters';\r\nimport {\r\n PerformancePage,\r\n HomePage,\r\n ImagesPage,\r\n VideosPage,\r\n VideoTemplatesPage,\r\n EditVideoPage,\r\n DisplayTemplatesPage,\r\n CreateDisplayTemplatePage,\r\n EditDisplayTemplatePage,\r\n BrandKitPage,\r\n LibraryPage,\r\n WebsiteImagePanelPage,\r\n StockImagePanelPage,\r\n InvestImagePanelPage,\r\n InvestVideoPanelPage,\r\n AddVideoPanelPage,\r\n SearchResultPage,\r\n GenerateImagePage,\r\n UploadFilesPanelPage,\r\n UploadFolderPanelPage,\r\n MixedImagePanelPage,\r\n MixedVideoPanelPage,\r\n EditImagePage,\r\n AssetDetailsPage,\r\n BackgroundRemovalModalPage,\r\n} from './pages';\r\nimport {\r\n withCustomLogForPage,\r\n PageNameForLog,\r\n getLoggerWithoutPageInfo,\r\n getLogVersion,\r\n withAdsStudioServicesConsumer,\r\n withAdsStudioServicesProvider,\r\n withLibraryAssetsService,\r\n withLibraryFoldersService,\r\n getODataConfig,\r\n withLibraryAndStockImagesService,\r\n withEditImageService,\r\n withDisplayTemplatesService,\r\n withBrandKitService,\r\n withAIGCStockService,\r\n withCopilotDomainDataService,\r\n withPagePerfMarker\r\n} from './services';\r\nimport { useAdFilter } from './hooks/use-ad-filter';\r\n\r\nconst pages = {\r\n PerformancePage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n PerformancePage,\r\n [\r\n 'navigation', 'logger', 'i18n', 'dateFormat', 'ianaTimeZone',\r\n 'adsStudioUserPreferences', 'reload', 'isReadonly', 'pagePerfMarker',\r\n 'cid', 'aid', 'oDataConfig', 'preferenceService', 'accountTimeZone',\r\n 'changeLayout', 'perfMetricDateRange', 'getPerfTimeSeriesParams',\r\n 'isAdsStudioAIGCMVPEnabled', 'layoutConfig', 'serverContext', 'useInlineDownload',\r\n 'renderDatePicker', 'updateGlobalWaterfallFilter', 'renderDetailsList', 'renderToolbarContainer', 'renderHeaderWithPopup', 'createFolderFilterQuery', 'isAIGCRegionRestricted', 'setDataLoaded',\r\n ]\r\n ), { pageName: PageNameForLog.Performance }), 'performancePage'),\r\n HomePage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withLibraryFoldersService(withFilterContext(HomePage)),\r\n ['perfMetricDateRange', 'isAdsStudioAIGCMVPEnabled', 'navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'reload', 'globalLegacyI18n', 'dateFormat', 'pagePerfMarker', 'isAIGCRegionRestricted', 'permissions', 'adsStudioUserPreferences', 'adsStudioAccountPreferences', 'setDataLoaded']\r\n ), { pageName: PageNameForLog.Home }), 'homePage'),\r\n ImagesPage: withPagePerfMarker(withCustomLogForPage(withLibraryAssetsService(\r\n withFilterContext(ImagesPage),\r\n { assetType: FolderAssetType.Image }\r\n ), { pageName: PageNameForLog.Images }), 'imagePage'),\r\n DisplayTemplatesPage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withDisplayTemplatesService(DisplayTemplatesPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'pagePerfMarker', 'permissions', 'preferenceService', 'serverContext', 'setDataLoaded']\r\n ), { pageName: PageNameForLog.DisplayTemplates }), 'displayTemplatePage'),\r\n CreateVideoPage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n EditVideoPage,\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'permissions', 'preferenceService', 'serverContext', 'loadClipchampPlayer', 'pagePerfMarker', 'setDataLoaded']\r\n ), { pageName: PageNameForLog.EditVideoPage }), 'videoCreatePage'),\r\n EditVideoPage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n EditVideoPage,\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'permissions', 'preferenceService', 'serverContext', 'loadClipchampPlayer', 'pagePerfMarker', 'setDataLoaded']\r\n ), { pageName: PageNameForLog.EditVideoPage }), 'videoEditPage'),\r\n VideoTemplatesPage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withCopilotDomainDataService(VideoTemplatesPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'permissions', 'preferenceService', 'serverContext', 'pagePerfMarker', 'setDataLoaded', 'loadClipchampPlayer']\r\n ), { pageName: PageNameForLog.VideoTemplates }), 'videoTemplatePage'),\r\n VideosPage: withPagePerfMarker(withCustomLogForPage(withLibraryAssetsService(\r\n withFilterContext(VideosPage),\r\n { assetType: FolderAssetType.Video, useVideoNotify }\r\n ), { pageName: PageNameForLog.Videos }), 'videoPage'),\r\n BrandKitPage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withBrandKitService(withEditImageService(BrandKitPage, 'imageEditService')),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'serverContext', 'preferenceService', 'permissions', 'pagePerfMarker', 'setDataLoaded']\r\n ), { pageName: PageNameForLog.BrandKit }), 'brandKitPage'),\r\n LibraryPage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(LibraryPage),\r\n ['navigation', 'logger', 'i18n', 'dateFormat', 'ianaTimeZone', 'cid', 'aid', 'oDataConfig', 'notificationApi', 'isAdsStudioAIGCMVPEnabled', 'adsStudioUserPreferences', 'reload', 'targetDropFolder', 'resetTargetDropFolder', 'pagePerfMarker', 'isAIGCRegionRestricted', 'setDataLoaded', 'permissions']\r\n ), { pageName: PageNameForLog.Library }), 'libraryPage'),\r\n WebsiteImagePanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(WebsiteImagePanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker']\r\n ), { pageName: PageNameForLog.WebsiteImagePanel }),\r\n StockImagePanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(StockImagePanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker']\r\n ), { pageName: PageNameForLog.StockImagePanel }),\r\n InvestImagePanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(InvestImagePanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker']\r\n ), { pageName: PageNameForLog.InvestImagePanel }),\r\n InvestVideoPanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(InvestVideoPanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker']\r\n ), { pageName: PageNameForLog.InvestVideoPanel }),\r\n AddVideoPanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(AddVideoPanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open']\r\n ), { pageName: PageNameForLog.AddVideoPanel }),\r\n SearchResultPage: withPagePerfMarker(withCustomLogForPage(withLibraryAndStockImagesService(withFilterContext(SearchResultPage)), { pageName: PageNameForLog.SearchResultPage }), 'searchResultPage'),\r\n // SearchResultPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n // withFilterContext(SearchResultPage),\r\n // ['navigation', 'logger', 'i18n', 'notificationApi', 'search']\r\n // ), { pageName: PageNameForLog.SearchResultPage }),\r\n EditImagePage: withPagePerfMarker(withCustomLogForPage(\r\n withEditImageService(EditImagePage),\r\n { pageName: PageNameForLog.EditImagePage }\r\n ), 'editPage'),\r\n EditDisplayTemplatePage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withDisplayTemplatesService(withBrandKitService(EditDisplayTemplatePage)),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'pagePerfMarker', 'permissions', 'preferenceService', 'serverContext', 'search', 'setDataLoaded']\r\n ), { pageName: PageNameForLog.EditDisplayTemplate }), 'displayTemplateEditPage'),\r\n CreateDisplayTemplatePage: withPagePerfMarker(withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withDisplayTemplatesService(withBrandKitService(CreateDisplayTemplatePage)),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'pagePerfMarker', 'permissions', 'preferenceService', 'serverContext', 'search', 'setDataLoaded']\r\n ), { pageName: PageNameForLog.DisplayTemplates }), 'displayTemplateCreatePage'),\r\n GenerateImagePage: withPagePerfMarker(withCustomLogForPage(withAIGCStockService(GenerateImagePage), { pageName: PageNameForLog.GenerateImagePage }), 'generateImagePage'),\r\n UploadFilesPanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(UploadFilesPanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'mode', 'openSystemUpload', 'globalLegacyI18n', 'perfMarker', 'isUploadImageUpscaleEnabled']\r\n ), { pageName: PageNameForLog.UploadFilesPanelPage }),\r\n UploadFolderPanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(UploadFolderPanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'mode', 'openSystemUpload', 'globalLegacyI18n', 'perfMarker', 'isUploadImageUpscaleEnabled']\r\n ), { pageName: PageNameForLog.UploadFolderPanelPage }),\r\n MixedImagePanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(MixedImagePanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'permissions']\r\n ), { pageName: PageNameForLog.UploadFolderPanelPage }),\r\n MixedVideoPanelPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(MixedVideoPanelPage),\r\n ['navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'perfMarker', 'permissions']\r\n ), { pageName: PageNameForLog.UploadFolderPanelPage }),\r\n AssetDetailsPage: withCustomLogForPage(withAdsStudioServicesConsumer(\r\n withFilterContext(AssetDetailsPage),\r\n ['serverContext', 'navigation', 'logger', 'i18n', 'notificationApi', 'cid', 'aid', 'oDataConfig', 'open', 'assetId', 'assets', 'totalAssetCount', 'folderAssetType', 'loadMoreData', 'renameAsset', 'getGranularityEnum', 'perfMetricDateRange', 'onClose', 'permissions']\r\n ), { pageName: PageNameForLog.AssetDetailsPage }),\r\n BackgroundRemovalModalPage: withCustomLogForPage(withLibraryAssetsService(\r\n withFilterContext(BackgroundRemovalModalPage),\r\n { assetType: FolderAssetType.Image }\r\n ), { pageName: PageNameForLog.BackgroundRemovalModalPage }),\r\n};\r\n\r\nconst AppRoutes = _.compose(\r\n // withLayoutContext,\r\n withActivityContext,\r\n withGenerateImageContext,\r\n withCcJsDataContextProvider,\r\n withAdsStudioServicesProvider,\r\n withAdStudioNavigation,\r\n withAssetTaskStatusPoller\r\n)(getAppRoutes(pages));\r\n\r\nexport const AdsStudioAppShellCMUI = (props) => {\r\n const adsstudioAppShellCMUIProps = _.extend({}, props); // clone the props\r\n props = _.extend(adsstudioAppShellCMUIProps, propsAdapter(adsstudioAppShellCMUIProps)); // adapt props to the expected format\r\n\r\n const { path: ROOT_ROUTE } = useRouteMatch();\r\n const {\r\n serverContext, scope, permissions, activity, preferenceService, updateWaterfallFilter: updateGlobalWaterfallFilter,\r\n } = props;\r\n\r\n const { aid, cid } = scope.values || {};\r\n\r\n const [isAIGCRegionRestricted, setIsAIGCRegionRestricted] = useState(false);\r\n\r\n useEffect(() => {\r\n isCopilotRegionRestricted({\r\n feature: 'AdsStudio',\r\n permissions,\r\n serverContext,\r\n }).then((isRestricted) => {\r\n setIsAIGCRegionRestricted(isRestricted);\r\n });\r\n }, [permissions, serverContext]);\r\n\r\n useEffect(() => () => {\r\n removeAdStudioSurveyTriggerFlag(AdStudioSurveyTriggerFlag.App);\r\n }, []);\r\n\r\n const isAllUploadFlowImageUpscaleEnabled = useMemo(() => (\r\n _.get(permissions, ['dynamic', 'AllUploadFlowImageUpscale']) && !isAIGCRegionRestricted\r\n ), [isAIGCRegionRestricted, permissions]);\r\n\r\n // readonly users\r\n const isReadonly = useMemo(\r\n () => (permissions && permissions.IsReadOnlyUser)\r\n || (serverContext && serverContext.CurrentAccountInActive),\r\n [permissions, serverContext]\r\n );\r\n\r\n const {\r\n updateWaterfallFilter,\r\n adFilterStore,\r\n } = useAdFilter({ preferenceService });\r\n\r\n const perfMetricDateRange = props[WaterfallFilterType.DateFilter];\r\n\r\n const oDataConfig = useMemo(() => getODataConfig(serverContext), [serverContext]);\r\n\r\n const { CurrentAccount, CurrentUser, IsAADUser } = serverContext || {};\r\n const {\r\n LocaleID: lcid,\r\n CultureDateTimeFormat: { ShortDatePattern: dateFormat },\r\n } = CurrentUser || {};\r\n const { TimeZone: accountTimeZone } = CurrentAccount;\r\n\r\n // todo: don't pilot AAD uers for now, remove the AAD check when the feature is GAed\r\n const isAdsStudioAIGCMVPEnabled = !IsAADUser;\r\n\r\n const loggerWithoutPageInfo = useMemo(() => getLoggerWithoutPageInfo(activity, getLogVersion()), [activity]);\r\n\r\n const moreProps = useMemo(() => ({\r\n ROOT_ROUTE,\r\n // adFilterStore={adFilterStore}\r\n // updateWaterfallFilter={updateWaterfallFilter}\r\n // allowedAssetType={null}\r\n aid,\r\n cid,\r\n accountTimeZone,\r\n oDataConfig,\r\n isReadonly,\r\n lcid,\r\n dateFormat,\r\n perfMetricDateRange,\r\n isAdsStudioAIGCMVPEnabled,\r\n isAIGCRegionRestricted,\r\n isUploadImageUpscaleEnabled: isAllUploadFlowImageUpscaleEnabled,\r\n logger: loggerWithoutPageInfo,\r\n adFilterStore,\r\n updateWaterfallFilter,\r\n updateGlobalWaterfallFilter,\r\n }), [ROOT_ROUTE, accountTimeZone, adFilterStore, aid, cid, dateFormat, isAIGCRegionRestricted, isAdsStudioAIGCMVPEnabled, isAllUploadFlowImageUpscaleEnabled, isReadonly, lcid, loggerWithoutPageInfo, oDataConfig, perfMetricDateRange, updateGlobalWaterfallFilter, updateWaterfallFilter]);\r\n\r\n // get cmui theme\r\n const theme = useTheme();\r\n\r\n // customm styles will override the default styles\r\n const customComponentStyles = useCustomStyles();\r\n\r\n // only show it in account level\r\n if (!aid) {\r\n // todo: redirect to somewhere else?\r\n return null;\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 \r\n \r\n \r\n );\r\n};\r\n\r\nAdsStudioAppShellCMUI.propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n getToday: PropTypes.func,\r\n formatCivilDate: PropTypes.func,\r\n }).isRequired,\r\n permissions: PropTypes.shape({\r\n IsMediaLibraryDetailGridEnabled: PropTypes.bool,\r\n IsReadOnlyUser: PropTypes.bool,\r\n dynamic: PropTypes.shape({\r\n CreativeStudioMediaLibrary: PropTypes.bool,\r\n AdsStudioVideo: PropTypes.bool,\r\n AdsStudioAIGCMVP: PropTypes.bool,\r\n }).isRequired,\r\n }).isRequired,\r\n preferenceService: PropTypes.shape({}).isRequired,\r\n serverContext: PropTypes.shape({\r\n CurrentAccountInActive: PropTypes.bool.isRequired,\r\n CurrentAccount: PropTypes.shape({}).isRequired,\r\n CurrentUser: PropTypes.shape({}).isRequired,\r\n }).isRequired,\r\n scope: PropTypes.oneOfType([PropTypes.instanceOf(QueryParam), PropTypes.shape({})]).isRequired,\r\n perfMarker: PropTypes.shape({}).isRequired,\r\n changeLayout: PropTypes.func,\r\n};\r\n\r\nAdsStudioAppShellCMUI.defaultProps = {\r\n changeLayout: undefined,\r\n};\r\n","import React from 'react';\r\nimport { CivilDate } from 'tc39-proposal-temporal';\r\nimport { WaterfallFilterType } from '@bingads-webui-campaign/filter-storage';\r\nimport { DatePickerWithScope } from '../date-picker/index';\r\n\r\nexport const useDatePicker = (props) => {\r\n const {\r\n minDate, i18n, serverContext, disableCompare, perfMetricDateRange, updateWaterfallFilter,\r\n } = props;\r\n const renderDatePicker = () => {\r\n const civilMinDate = minDate ? new CivilDate(minDate.year, minDate.month, minDate.day) : minDate;\r\n const DatePickerWithPageReady = () => (\r\n
\r\n updateWaterfallFilter({\r\n filterType: WaterfallFilterType.DateFilter,\r\n filter: data,\r\n })}\r\n serverContext={serverContext}\r\n minDate={civilMinDate}\r\n />\r\n
\r\n );\r\n\r\n return ();\r\n };\r\n\r\n return { renderDatePicker };\r\n};\r\n","/* eslint-disable object-curly-newline */\r\nimport React from 'react';\r\nimport { CommonColumn } from '@bingads-webui-grid/campaign-details-list';\r\n\r\nexport const useCommonColumn = () => {\r\n const renderHeaderWithPopup = (props) => {\r\n // for the elements which are sortable and have help-icon, they can cause the a11y bug \"Ensures interactive controls are not nested\"\r\n // to solve this bug, we should remove the \"role = button\" attribute for the header elements\r\n const { column, columnIndex } = props;\r\n const { helpId, sortable } = column;\r\n if (sortable && helpId) {\r\n const headerCell = document.querySelectorAll('.ms-DetailsHeader-cellTitle')[columnIndex - 1];\r\n if (headerCell) {\r\n headerCell.removeAttribute('role');\r\n headerCell.style.cursor = 'pointer';\r\n }\r\n }\r\n return (\r\n \r\n );\r\n };\r\n\r\n return {\r\n renderHeaderWithPopup,\r\n };\r\n};\r\n","import React from 'react';\r\nimport { CampaignDetailsList, ParentColumnPlacement } from '@bingads-webui-grid/campaign-details-list';\r\n\r\nexport const useDetailList = () => {\r\n const renderDetailsList = ({\r\n pagedItems, onSort, toolbar, pager, columns, sortByColumn, expandColumns,\r\n }) => (\r\n {\r\n expandColumns(newColumns);\r\n }}\r\n />\r\n );\r\n\r\n return { renderDetailsList };\r\n};\r\n","import { FolderAssetType } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\nimport { ROOT_FOLDER_ID } from '../../../../ads-studio-app-shared-components/src/model';\r\nimport { getFolderRepository } from './folder-repository';\r\n\r\n// simplified version of asset library folder repository for home page\r\nexport const getBasicFoldersRepository = ({\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n perfMetricDateRange,\r\n logger,\r\n}) => {\r\n const folderRepository = getFolderRepository({\r\n logger,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n });\r\n\r\n const uploadImageToFolder = ({\r\n imageData,\r\n updateCurrentProgress,\r\n imageName,\r\n }) => folderRepository.addFolderUploadAsset({\r\n folderId: ROOT_FOLDER_ID,\r\n asset: { data: imageData, name: imageName },\r\n folderAssetType: FolderAssetType.Image,\r\n inProgress: updateCurrentProgress,\r\n });\r\n\r\n const loadAssets = ({\r\n windowIndex, windowSize,\r\n withBIData = false,\r\n assetsToLoadForSubfolders,\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n importSource,\r\n assetSources,\r\n sortBy,\r\n folderId = ROOT_FOLDER_ID,\r\n assetType = null,\r\n includeAssets = true,\r\n includeSubfolders = true,\r\n includeParentHierarchy = false,\r\n isGlobalSearch = false,\r\n isAssetPickerScenario = false,\r\n hasPerfData = false,\r\n topRated = false,\r\n isSemanticSearch = false,\r\n isRecentSorting = false,\r\n }) => {\r\n const top = windowSize;\r\n const skip = windowIndex * windowSize;\r\n const $ret = folderRepository.getFolderData({\r\n skip,\r\n count: top,\r\n withBIData,\r\n assetsToLoadForSubfolders,\r\n perfMetricDateRange,\r\n sortBy,\r\n folderId,\r\n assetType,\r\n includeAssets,\r\n includeSubfolders,\r\n includeParentHierarchy,\r\n isAssetPickerScenario,\r\n // filter settings\r\n assetSources,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n hasPerfData,\r\n importSource,\r\n isGlobalSearch,\r\n minWidth,\r\n minHeight,\r\n minVideoDuration,\r\n maxVideoDuration,\r\n searchTerm,\r\n topRated,\r\n isSemanticSearch,\r\n isRecentSorting,\r\n }).then((response) => {\r\n const { folder } = response || {};\r\n const {\r\n assets,\r\n itemCount,\r\n // folderId,\r\n // folderName,\r\n // parentFolderId,\r\n subfolders,\r\n // parentHierarchy,\r\n } = folder || {};\r\n\r\n const folders = subfolders.map(subfolder =>\r\n ({\r\n folderAssetType: 'Folder',\r\n ...subfolder,\r\n }));\r\n\r\n return {\r\n assets: [...assets, ...folders],\r\n totalItemCount: (itemCount && itemCount.TotalCount) || 0,\r\n };\r\n });\r\n return $ret;\r\n };\r\n\r\n const renameAsset = ({\r\n assetId,\r\n folderAssetType,\r\n name,\r\n }) => {\r\n const $ret = folderRepository.renameAsset({\r\n assetId,\r\n folderAssetType,\r\n name,\r\n });\r\n return $ret;\r\n };\r\n\r\n return {\r\n loadAssets,\r\n renameAsset,\r\n uploadImageToFolder,\r\n updateVideoStatusByIds: folderRepository.updateVideoStatusByIds,\r\n };\r\n};\r\n","import React from 'react';\r\n\r\nimport { HomePageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const HomePage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { ImagesPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const ImagesPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\nimport { DisplayTemplatesPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const DisplayTemplatesPage = props => ;\r\n","import React from 'react';\r\nimport { VideoTemplatesPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\n\r\nexport const VideoTemplatesPage = props => ;\r\n","import React from 'react';\r\n\r\nimport { VideosPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\n\r\nexport const VideosPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\nimport { BrandKitPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\n\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const BrandKitPage = props => ;\r\n","import React, { useCallback } from 'react';\r\n\r\nimport { LibraryPageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { HelpPopupInline } from '@bingads-webui-react/help-popup';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\nimport { useBatchMoveModal } from './target-folder-picker';\r\n\r\nexport const LibraryPage = (props) => {\r\n const renderHelpPopup = useCallback(popupId => (\r\n \r\n ), []);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\n\r\nimport { WebsiteImagePanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const WebsiteImagePanelPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { StockImagePanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const StockImagePanelPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { InvestImagePanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const InvestImagePanelPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { InvestVideoPanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const InvestVideoPanelPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { AddVideoPanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const AddVideoPanelPage = props => (\r\n \r\n);\r\n","import { getStockImageRepository } from './stock-image-repository';\r\nimport { getBasicAssetsRepository } from './basic-assets-repository';\r\n\r\nexport const getLibraryAndStockImageRepository = ({\r\n aid,\r\n cid,\r\n oDataConfig,\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n assetType,\r\n logger,\r\n}) => {\r\n const sourceNames = ['library', 'stockImage'];\r\n //\r\n const libraryRepository = getBasicAssetsRepository({\r\n folderODataService,\r\n i18n,\r\n ianaTimeZone,\r\n timezoneUTCOffset,\r\n assetType,\r\n logger,\r\n });\r\n\r\n const stockImageRepository = getStockImageRepository({\r\n aid, cid, oDataConfig,\r\n });\r\n\r\n const loadAssets = ({\r\n windowIndex, windowSize, sourceName, ...rest\r\n }) => {\r\n let $ret = null;\r\n if (sourceName === 'stockImage') {\r\n $ret = stockImageRepository.loadAssets({ windowIndex, windowSize, ...rest });\r\n } else {\r\n $ret = libraryRepository.loadAssets({\r\n windowIndex,\r\n windowSize,\r\n isSemanticSearch: true,\r\n ...rest,\r\n });\r\n }\r\n return $ret;\r\n };\r\n\r\n return {\r\n loadAssets,\r\n renameAsset: libraryRepository.renameAsset,\r\n sourceNames,\r\n };\r\n};\r\n","import React from 'react';\r\n\r\nimport { SearchResultView } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const SearchResultPage = props => (\r\n \r\n);\r\n","import React, { useMemo } from 'react';\r\nimport _ from 'underscore';\r\nimport { useParams } from 'react-router-dom';\r\n\r\nimport { EditImagePageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { MediaRepository } from '@bingads-webui-campaign/media-repository';\r\nimport { getSmartCropSettingsFactory } from '@bingads-webui-campaign-react/unified-ad-preview-library-cmui';\r\nimport { MultiLineEllipsisText } from '@bingads-webui-react/multiline-ellipsis';\r\n\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const EditImagePage = (props) => {\r\n const {\r\n aid, cid, oDataConfig, logger,\r\n } = props;\r\n const { imageId } = useParams();\r\n const mediaRepository = useMemo(() => new MediaRepository({\r\n cid, aid, oDataConfig,\r\n }), [aid, cid, oDataConfig]);\r\n\r\n const getSmartCroppings = useMemo(\r\n () => getSmartCropSettingsFactory(mediaRepository, { trace: logger ? logger.traceWithoutParams : _.noop }),\r\n [logger, mediaRepository]\r\n );\r\n return ;\r\n};\r\n","import React, { useCallback } from 'react';\r\n\r\nimport { GenerateImagePageComponent } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { HelpButton } from '@bingads-webui-react/help-popup';\r\nimport { MultiLineEllipsisText } from '@bingads-webui-react/multiline-ellipsis';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const GenerateImagePage = (props) => {\r\n const renderHelpButton = useCallback(popupId => (\r\n \r\n ), []);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\n\r\nimport { MixedImagePanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const MixedImagePanelPage = props => (\r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport { MixedVideoPanel } from '@bingads-webui-campaign-react/ads-studio-app-components';\r\nimport { notificationApi } from '../../adapters/get-notification';\r\n\r\nexport const MixedVideoPanelPage = props => (\r\n \r\n);\r\n","import React, { useCallback, useMemo, useRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Route, Switch } from 'react-router-dom';\r\nimport { useJsData } from '@bingads-webui-cc-react/js-data-rest';\r\nimport { LocalNavigationRoute } from '@bingads-webui-campaign-react/ads-studio-shared-components';\r\nimport { AdsStudioPageName, isValidXandrAccount } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\nimport { useNavigation } from './use-navigation';\r\n\r\nexport const getAppRoutes = ({\r\n // decouple with pages to make it easy to UT\r\n PerformancePage,\r\n HomePage,\r\n ImagesPage,\r\n VideosPage,\r\n VideoTemplatesPage,\r\n CreateVideoPage,\r\n EditVideoPage,\r\n BrandKitPage,\r\n CreateDisplayTemplatePage,\r\n DisplayTemplatesPage,\r\n EditDisplayTemplatePage,\r\n LibraryPage,\r\n WebsiteImagePanelPage,\r\n StockImagePanelPage,\r\n InvestImagePanelPage,\r\n InvestVideoPanelPage,\r\n AddVideoPanelPage,\r\n SearchResultPage,\r\n GenerateImagePage,\r\n UploadFilesPanelPage,\r\n UploadFolderPanelPage,\r\n MixedImagePanelPage,\r\n MixedVideoPanelPage,\r\n EditImagePage,\r\n AssetDetailsPage,\r\n BackgroundRemovalModalPage,\r\n}) => {\r\n const Routes = ({\r\n ROOT_ROUTE,\r\n history,\r\n location,\r\n adFilterStore,\r\n updateWaterfallFilter,\r\n permissions,\r\n ...rest\r\n }) => {\r\n const { search } = location || {};\r\n\r\n const isXandrIntEnabled = useMemo(() => permissions.dynamic.XandrIntegrationEnabled, [permissions]);\r\n // eslint-disable-next-line no-restricted-globals\r\n const { data: account } = useJsData(jsData => (isXandrIntEnabled && rest.aid ? jsData.Account.find(rest.aid) : Promise.resolve()), [rest.aid, isXandrIntEnabled]);\r\n const isXandrIntegrationEnabled = useMemo(() => (isXandrIntEnabled ? isValidXandrAccount(account) : false), [account, isXandrIntEnabled]);\r\n\r\n // use this value as prop to pages and when it's changed it will trigger pages re-rendering\r\n const forceToReloadRef = useRef(null);\r\n const forceToReload = useCallback(() => {\r\n forceToReloadRef.current = {};\r\n }, []);\r\n\r\n //\r\n const navigation = useNavigation({\r\n rootRoute: ROOT_ROUTE,\r\n history,\r\n search,\r\n forceToReload,\r\n // goBack: historyStackRef.current.goBack,\r\n adFilterStore,\r\n updateWaterfallFilter,\r\n });\r\n\r\n // add additional props to pages related to navigation\r\n const pageProps = useMemo(() => ({\r\n navigation, // provide methods navigate among different pages\r\n reload: forceToReloadRef.current, // used to trigger pages re-rendering\r\n permissions,\r\n ...rest,\r\n }), [navigation, rest, permissions]);\r\n\r\n const renderSearchResultPage = useCallback(() => , [pageProps, search]);\r\n\r\n const renderPerformancePage = useCallback(() => , [pageProps]);\r\n\r\n const renderHomePage = useCallback(() => , [pageProps]);\r\n\r\n const renderImagesPage = useCallback(() => , [pageProps]);\r\n\r\n const renderDisplayTemplatesPage = useCallback(() => , [pageProps]);\r\n\r\n const renderVideosPage = useCallback(() => , [pageProps]);\r\n\r\n const renderVideoTemplatesPage = useCallback(() => , [pageProps]);\r\n\r\n const renderEditVideoPage = useCallback(() => , [pageProps]);\r\n\r\n const renderCreateVideoPage = useCallback(() => , [pageProps]);\r\n\r\n const renderBrandKitPage = useCallback(() => , [pageProps]);\r\n\r\n const renderLibraryPage = useCallback(() => , [pageProps]);\r\n\r\n const renderGenerateImagePage = useCallback(() => , [pageProps, search]);\r\n\r\n const renderEditImagePage = useCallback(() => , [pageProps, search]);\r\n\r\n const renderCreateDisplayTemplatePage = useCallback(() => , [pageProps, search]);\r\n\r\n const renderEditDisplayTemplatePage = useCallback(() => , [pageProps, search]);\r\n\r\n return (\r\n <>\r\n \r\n {/* performance page */}\r\n \r\n {/* edit image page */}\r\n \r\n {/* images page */}\r\n \r\n {/* create display template page */}\r\n \r\n {/* edit display template page */}\r\n \r\n {/* display templates page */}\r\n \r\n {/* videos page */}\r\n \r\n {/* video templates page */}\r\n \r\n {/* create video page */}\r\n \r\n {/* edit video page */}\r\n \r\n {/* brand kit page */}\r\n \r\n {/* library page */}\r\n \r\n {/* search result page */}\r\n \r\n {/* render generate image page */}\r\n {rest.isAdsStudioAIGCMVPEnabled && !rest.isAIGCRegionRestricted && }\r\n {/* landing page */}\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 {isXandrIntegrationEnabled && } />}\r\n {isXandrIntegrationEnabled && } />}\r\n \r\n );\r\n };\r\n\r\n Routes.propTypes = {\r\n history: PropTypes.shape({\r\n push: PropTypes.func.isRequired,\r\n goBack: PropTypes.func.isRequired,\r\n }).isRequired,\r\n location: PropTypes.shape({\r\n search: PropTypes.string,\r\n }).isRequired,\r\n ROOT_ROUTE: PropTypes.string.isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({}),\r\n }),\r\n };\r\n\r\n Routes.defaultProps = {\r\n permissions: { dynamic: {} },\r\n };\r\n\r\n return Routes;\r\n};\r\n","import { useCallback, useEffect } from 'react';\r\nimport Promise from 'bluebird';\r\n\r\nimport { WaterfallFilterType } from '@bingads-webui-campaign/filter-storage';\r\nimport { FolderAssetType, AdsStudioPageName, getSearchQuery, AdditionalQueries } from '@bingads-webui-campaign-react/ads-studio-app-shared-components';\r\nimport { useLocalNavigation } from '@bingads-webui-campaign-react/ads-studio-shared-components';\r\n\r\n// this hook is used to navigate between different pages in the app\r\nexport const useNavigation = ({\r\n rootRoute,\r\n history,\r\n search,\r\n forceToReload,\r\n adFilterStore,\r\n updateWaterfallFilter,\r\n}) => {\r\n const localNavigation = useLocalNavigation();\r\n\r\n const gotoCampaignUIPage = useCallback(({ subpath }, openInNewTab) => {\r\n const url = `/campaign/vnext/${subpath}${search}`;\r\n if (openInNewTab && window && window.open) {\r\n window.open(url, '_blank');\r\n } else {\r\n history.push(url);\r\n }\r\n }, [history, search]);\r\n\r\n // home page\r\n const gotoHomePage = useCallback(({ redirect = true, reload = false, removeSearchQuery = [] } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search, removeSearchQuery });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/home${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/home${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoSearchResultPage = useCallback(({ redirect = false, reload = false, query = '' } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const additionalQueries = {\r\n [AdditionalQueries.Query]: query,\r\n };\r\n const currentSearch = getSearchQuery({ search, additionalQueries });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/home/search${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/home/search${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n // performance page\r\n const gotoPerformancePage = useCallback(({ redirect = false, reload = false } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/performance${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/performance${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoImagesPage = useCallback(({ redirect = false, reload = false, removeSearchQuery = [] } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search, removeSearchQuery });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/images${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/images${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoVideosPage = useCallback(({ redirect = false, reload = false } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/videos${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/videos${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoLibraryPage = useCallback(({ redirect = false, reload = false } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/library${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/library${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoEditImagePage = useCallback(({\r\n imageId, folderId, editImageUrl, redirect = false, reload = false, initialCurrentView = '', query,\r\n } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const additionalQueries = {\r\n [AdditionalQueries.FolderId]: folderId,\r\n [AdditionalQueries.EditImageUrl]: editImageUrl,\r\n };\r\n if (initialCurrentView) {\r\n additionalQueries[AdditionalQueries.InitialCurrentView] = initialCurrentView;\r\n }\r\n if (query) {\r\n additionalQueries[AdditionalQueries.Query] = query;\r\n }\r\n const currentSearch = getSearchQuery({ search, additionalQueries });\r\n const url = `${rootRoute}/images/${imageId}/edit${currentSearch}`;\r\n if (redirect) {\r\n history.replace(url);\r\n } else {\r\n history.push(url);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoEditDisplayImagePage = useCallback(({\r\n imageId, folderId, templateId, redirect = true, reload = false, query,\r\n } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n\r\n const additionalQueries = {\r\n [AdditionalQueries.FolderId]: folderId,\r\n [AdditionalQueries.TemplateId]: templateId,\r\n };\r\n if (query) {\r\n additionalQueries[AdditionalQueries.Query] = query;\r\n }\r\n const currentSearch = getSearchQuery({ search, additionalQueries });\r\n const url = `${rootRoute}/displaytemplates/${imageId}/edit${currentSearch}`;\r\n if (redirect) {\r\n history.replace(url);\r\n } else {\r\n history.push(url);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n // goback\r\n const goBack = useCallback(({ reload } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n // pop up local views first\r\n if (localNavigation.getTopView()) {\r\n localNavigation.popLocalView();\r\n return;\r\n }\r\n history.goBack();\r\n }, [forceToReload, history, localNavigation]);\r\n\r\n const gotoWebsiteImagePanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.WebsiteImagePanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoStockImagePanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.StockImagePanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoInvestImagePanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.InvestImagePanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoInvestVideoPanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.InvestVideoPanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoAIGenerationPanelPage = useCallback(({ folderId, redirect = false, reload = false } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const additionalQueries = {\r\n [AdditionalQueries.FolderId]: folderId,\r\n };\r\n const currentSearch = getSearchQuery({ search, additionalQueries });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/generateimage${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/generateimage${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoDisplayTemplatesCreationPage = useCallback(({ redirect, templateGroupId } = {}) => {\r\n const additionalQueries = {\r\n [AdditionalQueries.TemplateGroupId]: templateGroupId,\r\n };\r\n const currentSearch = getSearchQuery({ search, additionalQueries });\r\n\r\n if (redirect) {\r\n history.replace(`${rootRoute}/displaytemplates/create${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/displaytemplates/create${currentSearch}`);\r\n }\r\n }, [history, rootRoute, search]);\r\n\r\n const gotoDisplayTemplatesPage = useCallback(({ redirect, removeSearchQuery = [] } = {}) => {\r\n const currentSearch = getSearchQuery({ search, removeSearchQuery });\r\n\r\n if (redirect) {\r\n history.replace(`${rootRoute}/displaytemplates${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/displaytemplates${currentSearch}`);\r\n }\r\n }, [history, rootRoute, search]);\r\n\r\n const gotoVideoTemplatePage = useCallback(({ redirect = false, reload = false } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search });\r\n if (redirect) {\r\n history.replace(`${rootRoute}/videotemplates${currentSearch}`);\r\n } else {\r\n history.push(`${rootRoute}/videotemplates${currentSearch}`);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoCreateVideoPage = useCallback(({ redirect = false, reload = false } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search });\r\n const url = `${rootRoute}/video/create${currentSearch}`;\r\n if (redirect) {\r\n history.replace(url);\r\n } else {\r\n history.push(url);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoEditVideoPage = useCallback(({ videoId, redirect = false, reload = false } = {}) => {\r\n if (reload) {\r\n forceToReload();\r\n }\r\n const currentSearch = getSearchQuery({ search });\r\n const url = `${rootRoute}/video/${videoId}/edit${currentSearch}`;\r\n if (redirect) {\r\n history.replace(url);\r\n } else {\r\n history.push(url);\r\n }\r\n }, [forceToReload, history, rootRoute, search]);\r\n\r\n const gotoAddVideoPanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.AddVideoPanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoUploadFilesPanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.UploadFilesPanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoUploadFolderPanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.UploadFolderPanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoMixedImagePanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.MixedImagePanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoMixedVideoPanelPage = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.MixedVideoPanelPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoAssetDetails = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.AssetDetailsPage, params);\r\n }, [localNavigation]);\r\n\r\n const gotoBackgroundRemovalModal = useCallback((params) => {\r\n localNavigation.pushLocalView(AdsStudioPageName.BackgroundRemovalModalPage, params);\r\n }, [localNavigation]);\r\n\r\n const updateAssetDetailsParams = useCallback((params) => {\r\n const oldParams = localNavigation.getViewParams(AdsStudioPageName.AssetDetailsPage);\r\n const newParams = { ...oldParams, ...params };\r\n const oldParamsStr = JSON.stringify(oldParams);\r\n const newParamsStr = JSON.stringify(newParams);\r\n if (newParams && oldParamsStr !== newParamsStr) {\r\n localNavigation.setViewParams(AdsStudioPageName.AssetDetailsPage, newParams);\r\n }\r\n }, [localNavigation]);\r\n\r\n const gotoAdsPageWithFilter = useCallback(({ filterProperty, filterValue }, openInNewTab) => {\r\n // set ad grid filter\r\n const filter = {\r\n [filterProperty]: { $contains: filterValue },\r\n };\r\n const savingPromise = adFilterStore.save({ query: filter }, true);\r\n\r\n // set campaign type filter to All Campaigns\r\n updateWaterfallFilter({\r\n filterType: WaterfallFilterType.CampaignType,\r\n filter: { key: WaterfallFilterType.CampaignType, value: { query: null } },\r\n });\r\n\r\n // navigate to ads page once filter is saved\r\n const timeoutPromise = Promise.delay(3000);\r\n return Promise.any([savingPromise, timeoutPromise]).then(() => {\r\n gotoCampaignUIPage({ subpath: 'ads' }, openInNewTab);\r\n });\r\n }, [adFilterStore, gotoCampaignUIPage, updateWaterfallFilter]);\r\n\r\n const gotoAdsPageWithAssetIdFilter = useCallback(({ folderAssetType, assetId }, openInNewTab) => {\r\n const AssetIdFilterPropertyConfig = {\r\n [FolderAssetType.Image]: 'ResponsiveAdImageId',\r\n [FolderAssetType.Video]: 'ResponsiveAdVideoId',\r\n };\r\n const filterProperty = AssetIdFilterPropertyConfig[folderAssetType];\r\n const filterValue = assetId;\r\n return gotoAdsPageWithFilter({ filterProperty, filterValue }, openInNewTab);\r\n }, [gotoAdsPageWithFilter]);\r\n\r\n useEffect(() => {\r\n // pop up local views first when switch page\r\n if (localNavigation && localNavigation.getTopView && localNavigation.getTopView()) {\r\n localNavigation.popLocalView();\r\n }\r\n // localNavigation can not be included in the dependencies\r\n }, [history.location.pathname]);\r\n\r\n return {\r\n gotoHomePage,\r\n gotoPerformancePage,\r\n gotoImagesPage,\r\n gotoVideosPage,\r\n gotoLibraryPage,\r\n gotoEditImagePage,\r\n gotoEditDisplayImagePage,\r\n goBack,\r\n gotoCampaignUIPage,\r\n gotoAdsPageWithAssetIdFilter,\r\n gotoWebsiteImagePanelPage,\r\n gotoStockImagePanelPage,\r\n gotoInvestImagePanelPage,\r\n gotoInvestVideoPanelPage,\r\n gotoAIGenerationPanelPage,\r\n gotoDisplayTemplatesCreationPage,\r\n gotoDisplayTemplatesPage,\r\n gotoAddVideoPanelPage,\r\n gotoSearchResultPage,\r\n gotoUploadFilesPanelPage,\r\n gotoUploadFolderPanelPage,\r\n gotoMixedImagePanelPage,\r\n gotoMixedVideoPanelPage,\r\n gotoAssetDetails,\r\n updateAssetDetailsParams,\r\n gotoBackgroundRemovalModal,\r\n gotoVideoTemplatePage,\r\n gotoCreateVideoPage,\r\n gotoEditVideoPage,\r\n };\r\n};\r\n","import { getI18n } from './get-i18n';\r\nimport { getServerContext } from './get-server-context';\r\n\r\n\r\nexport const propsAdapter = (props) => {\r\n const { i18n, serverContext } = props;\r\n return {\r\n i18n: getI18n(i18n),\r\n serverContext: getServerContext(serverContext),\r\n };\r\n};\r\n","import { useCustomLandingPageStyles } from './custom-landing-page-styles';\r\n\r\n// define custom styles for specific components in a specific platform\r\nexport const useCustomStyles = () => {\r\n const customLandingPageStyles = useCustomLandingPageStyles();\r\n return {\r\n AdsStudioLandingPageComponent: customLandingPageStyles,\r\n };\r\n};\r\n","import React, { useEffect, useState, useMemo, useContext, useCallback, useRef } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { Carousel, Glyphicon } from '@bingads-webui-react/primitive-unthemed';\r\nimport { TooltipHost, DirectionalHint } from '@bingads-webui-react/fabric-control';\r\nimport { curlyTemplate, generateGuid } from '@bingads-webui-universal/primitive-utilities';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport {\r\n withTrack,\r\n withGetSummary,\r\n getSummaryCardModel,\r\n isReadOnly,\r\n ADINSIGHT_LOG_API_NAME,\r\n RECOMMENDATION_IDS,\r\n ADINSIGHT_LOG_ACTION_TYPE,\r\n NOT_SUPPORT_DOWNLOAD_TYPES,\r\n DOWNLOAD_SCOPE,\r\n APPLY_ACTION_TYPES,\r\n AUTO_APPLY_TYPES,\r\n SUPPORT_ADINSIGHT_AUTO_APPLY_TYPES,\r\n} from '@bingads-webui-campaign/recommendation-core';\r\nimport { SummaryFooter, SummaryHeader } from '@bingads-webui-campaign-react/recommendation-summary-view';\r\nimport { ApplyFormModal } from '@bingads-webui-campaign-react/recommendation-modal';\r\nimport { perfMarkerPropTypes } from '@bingads-webui/performance-marker';\r\n\r\nimport { getStyles } from './card-style';\r\n\r\nconst SummaryFooterWrapper = withTrack(/* withAll */ true)(SummaryFooter);\r\n\r\nconst getPathNamePrefix = (isMCC) => {\r\n const pathNamePrefix = '/campaign/vnext/recommendations/';\r\n const pathNamePrefixMCC = '/campaign/vnext/accounts/recommendations/';\r\n\r\n return isMCC ? pathNamePrefixMCC : pathNamePrefix;\r\n};\r\n\r\nfunction usePrevious(value) {\r\n const ref = useRef();\r\n useEffect(() => {\r\n ref.current = value;\r\n });\r\n return ref.current;\r\n}\r\n\r\nexport function InContextCardBase(props) {\r\n const {\r\n isMCC,\r\n guid,\r\n setInContextRecommendationContent,\r\n classes,\r\n data,\r\n deps,\r\n scope,\r\n currentActivity,\r\n adDisplayUrlService,\r\n dataService,\r\n newI18n,\r\n campaignType,\r\n filterService,\r\n channel,\r\n hideCard,\r\n entityType,\r\n reload,\r\n applyAllCallback,\r\n campaignAdGroups,\r\n haveEnoughSpace,\r\n overallOptimizationScoreBar,\r\n perfMarker,\r\n } = props;\r\n const scopeService = useContext(ScopeContext);\r\n const dataFiltered = useMemo(() => {\r\n const filtered = _.map(data, item => item);\r\n return filtered;\r\n }, [data]);\r\n\r\n const [index, setIndex] = useState(0);\r\n const [direction, setDirection] = useState(null);\r\n const [isAsyncApplyModalOpen, setIsAsyncApplyModalOpen] = useState(false);\r\n const [isApplyConfirmModalOpen, setIsApplyConfirmModalOpen] = useState(false);\r\n const [recommendationCount, setRecommendationCount] = useState(0);\r\n const [pollTask, setPollTask] = useState(null);\r\n const [onApplyConfirm, setOnApplyConfirm] = useState(() => _.noop);\r\n const [onApplyReject, setOnApplyReject] = useState(() => _.noop);\r\n\r\n const readOnly = isReadOnly && isReadOnly(deps.appConfig, isMCC);\r\n const shouldRenderInContextRecommendationCard = !_.isEmpty(dataFiltered) && haveEnoughSpace;\r\n\r\n const cardContext = useMemo(() => ({\r\n Source: null,\r\n Level: scope.levelAt,\r\n Category: null,\r\n entityType,\r\n CampaignIds: scope.campaignId ? [Number(scope.campaignId)] : [],\r\n AdGroupIds: scope.adGroupId ? [Number(scope.adGroupId)] : [],\r\n }), [entityType, scope.adGroupId, scope.campaignId, scope.levelAt]);\r\n\r\n const logOpportunityEvent = useCallback(({\r\n type = null,\r\n action,\r\n context = null,\r\n }) => {\r\n const api = ADINSIGHT_LOG_API_NAME.INCONTEXTCARD;\r\n\r\n currentActivity.trace({\r\n type: type || '',\r\n typeId: RECOMMENDATION_IDS[type],\r\n action,\r\n campaignId: scope.campaignId,\r\n channel,\r\n position: index + 1,\r\n guid: guid || '',\r\n context: JSON.stringify(context),\r\n entityType,\r\n }, api);\r\n }, [channel, currentActivity, entityType, guid, index, scope.campaignId]);\r\n\r\n useEffect(() => {\r\n setInContextRecommendationContent(!_.isEmpty(dataFiltered));\r\n }, [dataFiltered, setInContextRecommendationContent]);\r\n\r\n const previousIndex = usePrevious(index);\r\n const previousType = usePrevious(_.size(dataFiltered) > index ? dataFiltered[index].type : '');\r\n\r\n useEffect(() => {\r\n if (_.size(dataFiltered) > index &&\r\n previousIndex !== index &&\r\n previousType !== dataFiltered[index].type) {\r\n logOpportunityEvent({\r\n type: dataFiltered[index].type,\r\n action: ADINSIGHT_LOG_ACTION_TYPE.IMPRESSION,\r\n context: cardContext,\r\n });\r\n }\r\n }, [cardContext, dataFiltered, index, logOpportunityEvent, previousIndex, previousType]);\r\n\r\n const showAsyncApplyModal = (poll) => {\r\n setPollTask(poll);\r\n setIsAsyncApplyModalOpen(true);\r\n };\r\n\r\n const closeAsyncApplyModal = useCallback(() => {\r\n if (pollTask) {\r\n pollTask.stop();\r\n }\r\n setIsAsyncApplyModalOpen(false);\r\n }, [pollTask]);\r\n\r\n const showApplyConfirmModal = ({ onApply, countRecommendation, onReject = _.noop }) => {\r\n _.defer(() => {\r\n setIsApplyConfirmModalOpen(true);\r\n setRecommendationCount(countRecommendation);\r\n });\r\n setOnApplyConfirm(() => onApply);\r\n setOnApplyReject(() => onReject);\r\n };\r\n\r\n const closeApplyConfirmModal = () => {\r\n setIsApplyConfirmModalOpen(false);\r\n };\r\n\r\n const confirmApplyConfirmModal = useCallback(() => {\r\n if (_.isFunction(onApplyConfirm)) {\r\n onApplyConfirm();\r\n }\r\n closeApplyConfirmModal();\r\n }, [onApplyConfirm]);\r\n\r\n const rejectApplyConfirmModal = useCallback(() => {\r\n if (_.isFunction(onApplyReject)) {\r\n onApplyReject();\r\n }\r\n closeApplyConfirmModal();\r\n }, [onApplyReject]);\r\n\r\n const handleSelect = useCallback((selectedIndex, e) => {\r\n if ((selectedIndex === dataFiltered.length && e.direction === 'next')) {\r\n return;\r\n }\r\n\r\n setIndex(selectedIndex % dataFiltered.length);\r\n setDirection(e.direction);\r\n }, [dataFiltered.length]);\r\n\r\n const handleDownload = useCallback((type, version) => {\r\n dataService.download({\r\n channel,\r\n campaignType,\r\n filterService,\r\n recommendationType: type,\r\n }).then(() => {\r\n logOpportunityEvent({\r\n type,\r\n action: ADINSIGHT_LOG_ACTION_TYPE.DOWNLOAD,\r\n context: _.extend({\r\n Version: version,\r\n DownloadScope: DOWNLOAD_SCOPE.INDIVIDUAL,\r\n }, cardContext),\r\n });\r\n });\r\n }, [campaignType, cardContext, channel, dataService, filterService, logOpportunityEvent]);\r\n\r\n const renderPitch = useCallback(pitching => (\r\n pitching ? (\r\n \r\n
{newI18n.getString(_TL_('See why this is recommended for you'))}
\r\n ) : null\r\n ), [classes.tooTip, newI18n]);\r\n\r\n const renderPagination = useMemo(() => (\r\n _.size(dataFiltered) > 1 &&\r\n
\r\n {curlyTemplate(newI18n.getString(_TL_('{{pageNumber}} of {{pageCount}}')))({\r\n pageNumber: index + 1,\r\n pageCount: _.size(dataFiltered),\r\n })}\r\n
\r\n ), [classes.carouselIndex, dataFiltered, index, newI18n]);\r\n\r\n const renderPrevIcon = useMemo(() => (\r\n _.size(dataFiltered) > 1 &&\r\n \r\n ), [dataFiltered, index]);\r\n\r\n const renderNextIcon = useMemo(() => (\r\n _.size(dataFiltered) > 1 &&\r\n \r\n ), [dataFiltered, index]);\r\n\r\n const viewDetails = useCallback(type => () => {\r\n scopeService.scope.set({\r\n ...scopeService.scope.values,\r\n recommendationType: type,\r\n recsrc: channel,\r\n });\r\n scopeService.scope.save(`${getPathNamePrefix(isMCC)}All`);\r\n }, [channel, isMCC, scopeService.scope]);\r\n\r\n const viewHistory = useCallback(() => {\r\n const url = `${getPathNamePrefix(isMCC)}history?${\r\n scopeService.scope.stringify(scopeService.scope.values)}`;\r\n window.open(url);\r\n }, [isMCC, scopeService.scope]);\r\n\r\n const getAutoApplyToolTipText = useCallback((type) => {\r\n let recommendationName = '';\r\n if (type === 'MultiMediaAdsOpportunity') {\r\n recommendationName = newI18n.getString(_TL_('Multimedia ads'));\r\n } else if (type === 'ResponsiveSearchAdsOpportunity') {\r\n recommendationName = newI18n.getString(_TL_('responsive search ads'));\r\n }\r\n\r\n return curlyTemplate(newI18n.getString(_TL_('New {{recommendationName}} recommendations will auto apply soon.')))({\r\n recommendationName,\r\n });\r\n }, [newI18n]);\r\n\r\n const carousel = useMemo(() => (\r\n dataFiltered.length - 1 ? 0 : index}\r\n direction={dataFiltered.length === 1 ? null : direction}\r\n onSelect={handleSelect}\r\n controls={false}\r\n indicators={false}\r\n prevIcon={renderPrevIcon}\r\n nextIcon={renderNextIcon}\r\n showPrevNextControls={dataFiltered.length > 1}\r\n > { _.map(dataFiltered, (recommendation) => {\r\n const model = getSummaryCardModel(_.extend({}, recommendation, {\r\n i18n: deps.i18n,\r\n newI18n,\r\n currency: deps.pageContext.AccountCurrencyCode,\r\n scope: scope.levelAt,\r\n permissions: deps.pageContext.Permissions,\r\n adDisplayUrlService,\r\n combineText: deps.combineText,\r\n currentActivity,\r\n }));\r\n\r\n const headerMenuItems = _.compact([\r\n _.contains(NOT_SUPPORT_DOWNLOAD_TYPES, model.type) ? null :\r\n {\r\n name: newI18n.getString(_TL_('Download this recommendation')),\r\n func: () => handleDownload(model.type, recommendation.version),\r\n }, {\r\n name: newI18n.getString(_TL_('Hide this tile')),\r\n func: () => {\r\n logOpportunityEvent({\r\n action: ADINSIGHT_LOG_ACTION_TYPE.HIDE,\r\n channel,\r\n campaignId: scope.campaignId,\r\n context: cardContext,\r\n });\r\n hideCard();\r\n },\r\n }]);\r\n\r\n const isOptimizationScoreOn = !isMCC && _.result(deps.pageContext.Permissions.dynamic, 'OptimizationScore');\r\n const isAutoApplyRecommendationEnabled = !isMCC && _.result(deps.pageContext.Permissions, 'IsAutoApplyRecommendationEnabled');\r\n const showAutoApply = isAutoApplyRecommendationEnabled\r\n && _.contains(\r\n _.keys(AUTO_APPLY_TYPES).concat(SUPPORT_ADINSIGHT_AUTO_APPLY_TYPES),\r\n model.type\r\n )\r\n && recommendation.isAutoApplyOptIn;\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n {model.summary.description}\r\n
\r\n {renderPitch(model.summary.pitching)}\r\n
\r\n {renderPagination}\r\n {\r\n reload({\r\n isFromApplyOrDismiss: op.userAction !== APPLY_ACTION_TYPES.UNDISMISS,\r\n });\r\n if (op.userAction === APPLY_ACTION_TYPES.ACCEPT) {\r\n applyAllCallback();\r\n }\r\n }}\r\n newI18n={newI18n}\r\n />\r\n
\r\n );\r\n })}\r\n \r\n \r\n ), [\r\n dataFiltered, index, direction, handleSelect,\r\n renderPrevIcon, renderNextIcon, deps, viewHistory,\r\n isApplyConfirmModalOpen, isAsyncApplyModalOpen, recommendationCount,\r\n confirmApplyConfirmModal, rejectApplyConfirmModal, closeAsyncApplyModal,\r\n scope, adDisplayUrlService, currentActivity, newI18n, isMCC,\r\n readOnly, getAutoApplyToolTipText, overallOptimizationScoreBar,\r\n classes.cardContent, classes.description, renderPitch, renderPagination,\r\n guid, cardContext, campaignAdGroups, logOpportunityEvent, viewDetails,\r\n dataService, handleDownload, channel, hideCard, reload, applyAllCallback]);\r\n\r\n useEffect(() => {\r\n if (shouldRenderInContextRecommendationCard && perfMarker && !perfMarker.isDone) {\r\n perfMarker.done();\r\n }\r\n }, [shouldRenderInContextRecommendationCard, perfMarker]);\r\n\r\n return shouldRenderInContextRecommendationCard && (\r\n
\r\n {carousel}\r\n
);\r\n}\r\n\r\nInContextCardBase.propTypes = {\r\n setInContextRecommendationContent: PropTypes.func.isRequired,\r\n classes: PropTypes.shape({}).isRequired,\r\n isMCC: PropTypes.bool.isRequired,\r\n guid: PropTypes.string,\r\n data: PropTypes.shape().isRequired,\r\n deps: PropTypes.shape().isRequired,\r\n scope: PropTypes.shape({\r\n campaignId: PropTypes.number,\r\n adGroupId: PropTypes.number,\r\n }).isRequired,\r\n adDisplayUrlService: PropTypes.shape().isRequired,\r\n dataService: PropTypes.shape({\r\n track: PropTypes.func,\r\n }).isRequired,\r\n currentActivity: PropTypes.shape({\r\n trace: PropTypes.func,\r\n }).isRequired,\r\n newI18n: PropTypes.shape({}).isRequired,\r\n downloadService: PropTypes.shape({}).isRequired,\r\n campaignType: PropTypes.number,\r\n filterService: PropTypes.shape({}),\r\n channel: PropTypes.string.isRequired,\r\n hideCard: PropTypes.func.isRequired,\r\n entityType: PropTypes.string.isRequired,\r\n reload: PropTypes.func.isRequired,\r\n applyAllCallback: PropTypes.func,\r\n campaignAdGroups: PropTypes.arrayOf(PropTypes.shape({\r\n Key: PropTypes.number,\r\n Value: PropTypes.arrayOf(PropTypes.number),\r\n })).isRequired,\r\n haveEnoughSpace: PropTypes.bool,\r\n overallOptimizationScoreBar: PropTypes.shape({\r\n Gained: PropTypes.number,\r\n Dismissed: PropTypes.number,\r\n Available: PropTypes.number,\r\n }),\r\n perfMarker: perfMarkerPropTypes,\r\n};\r\n\r\nInContextCardBase.defaultProps = {\r\n guid: generateGuid(),\r\n campaignType: null,\r\n filterService: null,\r\n applyAllCallback: _.noop,\r\n haveEnoughSpace: true,\r\n overallOptimizationScoreBar: null,\r\n perfMarker: null,\r\n};\r\n\r\nexport const InContextCard = withGetSummary(\r\n false, // withDetails\r\n false // needExamples\r\n)(withDefaultStyles(InContextCardBase, getStyles));\r\n","import { extend } from 'underscore';\r\nimport { getHeaderStyles, getApplyFormStyles, getIconStyles, getFeedbackModalStyles } from '@bingads-webui-campaign-react/recommendation-shared-styles';\r\n\r\nconst cardWidth = 447;\r\n\r\nexport const getStyles = ({\r\n palette = {\r\n white: '#FFFFFF',\r\n themePrimary: '#0078D4',\r\n },\r\n}) => ({\r\n '@global': extend(\r\n Object.assign(getApplyFormStyles({ palette })),\r\n Object.assign(getFeedbackModalStyles({ palette }))\r\n ),\r\n carouselContainer: {\r\n width: cardWidth,\r\n height: 193,\r\n marginTop: 23,\r\n marginRight: 16,\r\n flexShrink: 0,\r\n flexGrow: 0,\r\n display: 'flex',\r\n boxShadow: '0px 1.6px 3.6px rgba(0, 0, 0, 0.132), 0px 0.3px 0.9px rgba(0, 0, 0, 0.108)',\r\n\r\n '& .carousel-wrapper': {\r\n display: 'flex',\r\n '& .carousel .item': {\r\n width: cardWidth,\r\n\r\n '& .recommendation-summary-header': {\r\n padding: '8px 13px 8px 16px',\r\n borderBottom: '1px solid #F3F2F1',\r\n\r\n ...getHeaderStyles({ palette }),\r\n ...getIconStyles(),\r\n },\r\n '& .recommendation-summary-footer': {\r\n paddingLeft: '16px',\r\n '& button.btn-primary': {\r\n marginRight: '8px',\r\n },\r\n '& button.btn': {\r\n paddingLeft: '12px',\r\n paddingRight: '12px',\r\n fontSize: '12px',\r\n },\r\n },\r\n },\r\n '& .carousel-control': {\r\n textShadow: 'none',\r\n background: 'none',\r\n cursor: 'default',\r\n top: 'auto',\r\n bottom: '10px',\r\n '&:focus:after': {\r\n border: 'none',\r\n },\r\n '&.left': {\r\n color: palette.themePrimary,\r\n right: '36px',\r\n left: 'auto',\r\n },\r\n '&.right': {\r\n color: palette.themePrimary,\r\n right: '13px',\r\n },\r\n '& .iconba': {\r\n cursor: 'pointer',\r\n\r\n '&.disabled': {\r\n cursor: 'default',\r\n color: '#C8C6C4',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n cardContent: {\r\n padding: '0px 16px',\r\n height: '106px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'space-evenly',\r\n },\r\n description: {\r\n fontSize: '16px',\r\n lineHeight: '20px',\r\n fontWeight: 600,\r\n },\r\n tooTip: {\r\n borderBottom: `1px dashed ${palette.themePrimary}`,\r\n cursor: 'default',\r\n display: 'inline-block',\r\n color: '#666666',\r\n },\r\n carouselIndex: {\r\n position: 'absolute',\r\n right: '60px',\r\n bottom: '3px',\r\n },\r\n});\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport ReactModal from 'react-modal';\r\n\r\nexport class RecommendationModal extends React.PureComponent {\r\n static propTypes = {\r\n isOpen: PropTypes.bool.isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n children: PropTypes.node.isRequired,\r\n closeOnOverlayClick: PropTypes.bool,\r\n };\r\n\r\n static defaultProps = {\r\n closeOnOverlayClick: true,\r\n };\r\n\r\n componentDidMount() {\r\n ReactModal.setAppElement(document.body);\r\n }\r\n\r\n render() {\r\n const {\r\n isOpen,\r\n onCancel,\r\n closeOnOverlayClick,\r\n } = this.props;\r\n\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { RecommendationModal } from './modal';\r\nimport template from './template.pug';\r\n\r\nclass ModalContainer extends React.PureComponent {\r\n static propTypes = {\r\n el: PropTypes.string.isRequired,\r\n Form: PropTypes.shape({\r\n render: PropTypes.func.isRequired,\r\n }).isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n isOpen: true,\r\n };\r\n }\r\n\r\n onAction = () => {\r\n this.setState({ isOpen: false });\r\n }\r\n\r\n render() {\r\n const { isOpen } = this.state;\r\n const { Form, onCancel } = this.props;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport function showRecommendationModal(options) {\r\n const container = document.querySelector('.recommendation-modal-container');\r\n if (container !== null) {\r\n ReactDOM.unmountComponentAtNode(container);\r\n } else {\r\n $(document.body).append(template());\r\n }\r\n ReactDOM.render(\r\n (\r\n \r\n ), document.querySelector('.recommendation-modal-container')\r\n );\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\n\r\nexport class ConfirmForm extends React.PureComponent {\r\n static propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n title: PropTypes.string.isRequired,\r\n content: PropTypes.string.isRequired,\r\n confirmString: PropTypes.string.isRequired,\r\n cancelString: PropTypes.string.isRequired,\r\n onConfirm: PropTypes.func.isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n // extraAction is close modal action, used in no-react environment\r\n extraAction: PropTypes.func,\r\n };\r\n\r\n static defaultProps = {\r\n extraAction: () => {},\r\n };\r\n\r\n onConfirm = () => {\r\n this.props.onConfirm();\r\n this.props.extraAction();\r\n };\r\n\r\n onCancel = () => {\r\n this.props.onCancel();\r\n this.props.extraAction();\r\n };\r\n\r\n render() {\r\n const {\r\n title,\r\n content,\r\n confirmString,\r\n cancelString,\r\n i18n,\r\n } = this.props;\r\n\r\n return (\r\n \r\n \r\n

{title}

\r\n
{content}
\r\n \r\n {confirmString}\r\n \r\n \r\n {cancelString}\r\n \r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { RecommendationModal } from './modal';\r\nimport { ConfirmForm } from './forms/confirm-form';\r\n\r\nexport class ConfirmFormModal extends React.PureComponent {\r\n static propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n isApplyConfirmModalOpen: PropTypes.bool.isRequired,\r\n countRecommendation: PropTypes.number.isRequired,\r\n confirmApplyConfirmModal: PropTypes.func.isRequired,\r\n rejectApplyConfirmModal: PropTypes.func.isRequired,\r\n };\r\n\r\n render() {\r\n const {\r\n i18n,\r\n isApplyConfirmModalOpen,\r\n countRecommendation,\r\n confirmApplyConfirmModal,\r\n rejectApplyConfirmModal,\r\n } = this.props;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\n\r\nexport class AsyncApplyForm extends React.PureComponent {\r\n static propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n routeApplyHistory: PropTypes.func.isRequired,\r\n runInBackground: PropTypes.func.isRequired,\r\n // extraAction is close modal action, used in no-react environment\r\n extraAction: PropTypes.func,\r\n };\r\n\r\n static defaultProps = {\r\n extraAction: () => {},\r\n };\r\n\r\n routeApplyHistory = () => {\r\n this.props.routeApplyHistory();\r\n this.props.extraAction();\r\n };\r\n\r\n runInBackground = () => {\r\n this.props.runInBackground();\r\n this.props.extraAction();\r\n };\r\n\r\n render() {\r\n const {\r\n i18n,\r\n } = this.props;\r\n const applyHistoryLink = (\r\n \r\n {i18n.getString('Recommendation_Async_Route_To_History')}\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 {i18n.getString('Recommendation_Async_Apply_Title')}\r\n

\r\n
\r\n {i18n.getString('Recommendation_Async_Apply_Choices_Prefix')}\r\n
\r\n
\r\n {applyHistoryLink}\r\n
\r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { RecommendationModal } from './modal';\r\nimport { AsyncApplyForm } from './forms/async-apply-form';\r\n\r\nexport class AsyncApplyFormModal extends React.PureComponent {\r\n static propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n isAsyncApplyModalOpen: PropTypes.bool.isRequired,\r\n closeAsyncApplyModal: PropTypes.func.isRequired,\r\n viewHistory: PropTypes.func.isRequired,\r\n };\r\n\r\n render() {\r\n const {\r\n i18n,\r\n isAsyncApplyModalOpen,\r\n closeAsyncApplyModal,\r\n viewHistory,\r\n } = this.props;\r\n\r\n return (\r\n \r\n {\r\n closeAsyncApplyModal();\r\n viewHistory();\r\n }}\r\n />\r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { ConfirmFormModal } from './show-confirm-form-modal';\r\nimport { AsyncApplyFormModal } from './show-async-apply-form-modal';\r\n\r\nexport class ApplyFormModal extends React.PureComponent {\r\n static propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n isApplyConfirmModalOpen: PropTypes.bool.isRequired,\r\n isAsyncApplyModalOpen: PropTypes.bool.isRequired,\r\n countRecommendation: PropTypes.number.isRequired,\r\n confirmApplyConfirmModal: PropTypes.func.isRequired,\r\n rejectApplyConfirmModal: PropTypes.func.isRequired,\r\n closeAsyncApplyModal: PropTypes.func.isRequired,\r\n viewHistory: PropTypes.func.isRequired,\r\n };\r\n\r\n render() {\r\n const {\r\n i18n,\r\n isApplyConfirmModalOpen,\r\n isAsyncApplyModalOpen,\r\n countRecommendation,\r\n confirmApplyConfirmModal,\r\n rejectApplyConfirmModal,\r\n closeAsyncApplyModal,\r\n viewHistory,\r\n } = this.props;\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\n\r\nexport class AsyncBulkAarConfirmForm extends React.PureComponent {\r\n static propTypes = {\r\n newI18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n title: PropTypes.string.isRequired,\r\n content: PropTypes.string.isRequired,\r\n confirmString: PropTypes.string.isRequired,\r\n cancelString: PropTypes.string.isRequired,\r\n onConfirm: PropTypes.func.isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n loading: PropTypes.bool.isRequired,\r\n stage: PropTypes.number.isRequired,\r\n // extraAction is close modal action, used in no-react environment\r\n extraAction: PropTypes.func,\r\n };\r\n\r\n static defaultProps = {\r\n extraAction: () => {},\r\n };\r\n\r\n onConfirm = () => {\r\n this.props.onConfirm();\r\n this.props.extraAction();\r\n };\r\n\r\n onCancel = () => {\r\n this.props.onCancel();\r\n this.props.extraAction();\r\n };\r\n\r\n render() {\r\n const {\r\n title,\r\n content,\r\n confirmString,\r\n cancelString,\r\n loading,\r\n stage,\r\n i18n,\r\n newI18n,\r\n } = this.props;\r\n\r\n const stageString = [\r\n _TL_('Uploading file ...'),\r\n _TL_('Validating your access to make updates ...'),\r\n _TL_('Applying changes ...'),\r\n ];\r\n\r\n return (\r\n
\r\n {\r\n !loading &&\r\n \r\n }\r\n
{title}
\r\n
\r\n {\r\n loading ?\r\n \r\n \r\n \r\n \r\n {newI18n.getString(stageString[stage])}\r\n \r\n \r\n \r\n : content\r\n }\r\n
\r\n {\r\n !loading &&\r\n \r\n {confirmString}\r\n \r\n }\r\n {\r\n !loading &&\r\n \r\n {cancelString}\r\n \r\n }\r\n
\r\n );\r\n }\r\n}\r\n","export const getApplyFormStyles = ({ palette = {}, iconFontFamily = 'MsAds MDL2 Assets' }) => (\r\n {\r\n '.recommendation-modal-overlay': {\r\n position: 'fixed',\r\n top: '0',\r\n left: '0',\r\n right: '0',\r\n bottom: '0',\r\n backgroundColor: 'rgba(51,51,51,0.3)',\r\n zIndex: '1061',\r\n '& .recommendation-modal': {\r\n position: 'absolute',\r\n top: '50%',\r\n left: '50%',\r\n overflow: 'auto',\r\n outline: 'none',\r\n transform: 'translate(-50%,-50%)',\r\n marginRight: '-50%',\r\n padding: 24,\r\n border: '1px solid #d9d9d9',\r\n color: '#333',\r\n backgroundColor: palette.white,\r\n boxShadow: '0px 4.8px 14.4px rgba(0, 0, 0, 0.18), 0px 25.6px 57.6px rgba(0, 0, 0, 0.22)',\r\n borderRadius: '2px',\r\n\r\n '& .recommendation-confirm-form': {\r\n width: 402,\r\n\r\n '& .close.close-image': {\r\n fontStyle: 'normal',\r\n fontWeight: 'normal',\r\n fontSize: 12,\r\n lineHeight: '12px',\r\n },\r\n\r\n '& .recommendation-confirm-title': {\r\n fontFamily: 'Segoe UI',\r\n fontStyle: 'normal',\r\n fontWeight: 600,\r\n fontSize: 20,\r\n lineHeight: '27px',\r\n marginBottom: 26,\r\n marginTop: 0,\r\n },\r\n\r\n '& .recommendation-confirm-content': {\r\n fontFamily: 'Segoe UI',\r\n fontSize: 14,\r\n lineHeight: '20px',\r\n marginBottom: 19,\r\n },\r\n\r\n '& .btn-confirm': {\r\n backgroundColor: palette.themePrimary,\r\n fontSize: 14,\r\n fontWeight: 600,\r\n marginRight: 8,\r\n lineHeight: '19px',\r\n color: palette.white,\r\n },\r\n\r\n '& .btn-cancel': {\r\n backgroundColor: palette.white,\r\n border: '1px solid #8A8886',\r\n fontSize: 14,\r\n fontWeight: 600,\r\n lineHeight: '19px',\r\n },\r\n },\r\n '& .recommendation-async-bulk-aar-confirm-form': {\r\n width: 402,\r\n\r\n '& .close.close-image': {\r\n fontStyle: 'normal',\r\n fontWeight: 'normal',\r\n fontSize: 12,\r\n lineHeight: '12px',\r\n },\r\n\r\n '& .recommendation-aysnc-confirm-title': {\r\n fontFamily: 'Segoe UI',\r\n fontStyle: 'normal',\r\n fontWeight: 600,\r\n fontSize: 20,\r\n lineHeight: '27px',\r\n marginBottom: 26,\r\n marginTop: 0,\r\n },\r\n\r\n '& .recommendation-async-confirm-content': {\r\n fontFamily: 'Segoe UI',\r\n fontSize: 14,\r\n lineHeight: '20px',\r\n marginBottom: 19,\r\n '& .blocker': {\r\n display: 'inline-block',\r\n\r\n '& .blocker-indicator': {\r\n position: 'relative',\r\n padding: 0,\r\n top: 2,\r\n left: 0,\r\n\r\n '& .blocker-image': {\r\n height: 24,\r\n width: 24,\r\n },\r\n },\r\n },\r\n },\r\n\r\n '& .btn-confirm': {\r\n backgroundColor: palette.themePrimary,\r\n fontSize: 14,\r\n fontWeight: 600,\r\n marginRight: 8,\r\n lineHeight: '19px',\r\n color: palette.white,\r\n },\r\n\r\n '& .btn-cancel': {\r\n backgroundColor: palette.white,\r\n border: '1px solid #8A8886',\r\n fontSize: 14,\r\n fontWeight: 600,\r\n lineHeight: '19px',\r\n },\r\n },\r\n '& .recommendation-async-apply-form': {\r\n width: 482,\r\n\r\n '& .closeimage': {\r\n fontSize: 16,\r\n position: 'relative',\r\n top: '-8px',\r\n right: '-8px',\r\n fontFamily: iconFontFamily,\r\n },\r\n\r\n '& .closeimage:before': {\r\n content: '\"\\\\E711\"',\r\n },\r\n\r\n '& .recommendation-async-apply-title': {\r\n fontFamily: 'Segoe UI',\r\n fontStyle: 'normal',\r\n fontWeight: 600,\r\n fontSize: '14px',\r\n lineHeight: '19px',\r\n color: palette.black,\r\n marginBottom: 12,\r\n marginTop: 0,\r\n\r\n '& .blocker': {\r\n display: 'inline-block',\r\n\r\n '& .blocker-indicator': {\r\n position: 'relative',\r\n padding: 0,\r\n top: 2,\r\n left: 0,\r\n\r\n '& .blocker-image': {\r\n marginRight: 9,\r\n height: 14,\r\n width: 14,\r\n },\r\n },\r\n },\r\n },\r\n\r\n '& .recommendation-async-apply-actions': {\r\n fontFamily: 'Segoe UI',\r\n fontSize: 12,\r\n lineHeight: '16px',\r\n color: palette.black,\r\n marginBottom: 8,\r\n },\r\n\r\n '& .recommendation-apply-history': {\r\n fontFamily: 'Segoe UI',\r\n fontSize: 12,\r\n lineHeight: '16px',\r\n border: 'unset',\r\n padding: 'unset',\r\n color: '#337ABC',\r\n },\r\n },\r\n },\r\n },\r\n });\r\n","export const getFeedbackModalStyles = () => ({\r\n // recommendations-feedback-modal\r\n '.recommendation-feedback-overlay': {\r\n position: 'fixed',\r\n top: '0',\r\n left: '0',\r\n right: '0',\r\n bottom: '0',\r\n backgroundColor: 'rgba(51,51,51,0.3)',\r\n zIndex: '1061',\r\n '& .recommendation-feedback-modal': {\r\n position: 'absolute',\r\n top: '50%',\r\n left: '50%',\r\n overflow: 'auto',\r\n outline: 'none',\r\n transform: 'translate(-50%,-50%)',\r\n marginRight: '-50%',\r\n width: 605,\r\n padding: 20,\r\n border: '1px solid #d9d9d9',\r\n background: '#fff',\r\n color: '#333',\r\n\r\n '& .form-inline': {\r\n '& .btn': {\r\n marginRight: 8,\r\n },\r\n },\r\n '& button.close': {\r\n marginTop: 3,\r\n },\r\n '& button:disabled': {\r\n color: '#666',\r\n backgroundColor: '#F4F4F4',\r\n border: '1px solid #CCC',\r\n },\r\n '& h3': {\r\n fontWeight: '600',\r\n marginTop: 0,\r\n marginBottom: 30,\r\n },\r\n '& p, & .radio': {\r\n paddingLeft: 10,\r\n fontFamily: '\\'Segoe UI\\', Arial, sans-serif',\r\n\r\n '&[data-checked=true]': {\r\n backgroundColor: '#DEECF9',\r\n },\r\n },\r\n '& div.reasons': {\r\n margin: '20px 0',\r\n },\r\n '& div.comments': {\r\n margin: '20px 0',\r\n '& textarea': {\r\n height: 75,\r\n width: 330,\r\n border: '1px #bbb solid',\r\n background: '#fff',\r\n marginBottom: 5,\r\n },\r\n },\r\n },\r\n },\r\n\r\n // recommendations-dismiss-feedback\r\n '.recommendation-dismiss-feedback-popup': {\r\n position: 'fixed',\r\n right: 10,\r\n bottom: 70,\r\n zIndex: '2000',\r\n '& .close': {\r\n right: 5,\r\n top: 5,\r\n position: 'relative',\r\n },\r\n },\r\n '.recommendation-dismiss-feedback-form': {\r\n width: 400,\r\n padding: 20,\r\n boxShadow: '0 0 5px #ccc',\r\n backgroundColor: '#fff',\r\n '& h3': {\r\n fontWeight: 'bold',\r\n },\r\n '& .checkbox.preference': {\r\n color: '#bbb',\r\n },\r\n '& button:disabled': {\r\n background: '#f3f2f1',\r\n borderColor: 'transparent',\r\n color: '#a19f9d',\r\n cursor: 'default',\r\n },\r\n },\r\n});\r\n","export const getHeaderStyles = ({ palette }) => (\r\n {\r\n display: 'grid',\r\n gridTemplateColumns: '24px minmax(0, min-content) min-content auto max-content 24px',\r\n gridTemplateRows: 24,\r\n alignItems: 'center',\r\n '& .summary-header-icon': {\r\n gridColumn: '1',\r\n justifySelf: 'stretch',\r\n alignSelf: 'center',\r\n position: 'relative',\r\n borderRadius: '50%',\r\n width: 24,\r\n height: 24,\r\n '& span': {\r\n color: palette.white,\r\n position: 'absolute',\r\n fontSize: 13,\r\n left: '25%',\r\n right: '25%',\r\n top: '25%',\r\n bottom: '25%',\r\n },\r\n },\r\n '& .summary-header-title': {\r\n padding: '0 0 0 10px',\r\n gridColumn: '2',\r\n fontSize: 14,\r\n color: '#323130',\r\n fontWeight: '500',\r\n whiteSpace: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n },\r\n '& .summary-header-label': {\r\n alignSelf: 'center',\r\n marginLeft: 8,\r\n gridColumn: '3',\r\n fontSize: 12,\r\n background: '#EFF6FC',\r\n border: '1px solid #FFFFFF',\r\n boxSizing: 'border-box',\r\n borderRadius: 12,\r\n width: 48,\r\n padding: '0 10px 0 10px',\r\n },\r\n '& .summary-card-os-tag-container': {\r\n gridColumn: '5',\r\n '& .not-available-line': {\r\n paddingLeft: 10,\r\n paddingRight: 10,\r\n },\r\n '& .iconba.iconba-Trending12': {\r\n paddingLeft: 8,\r\n paddingRight: 8,\r\n paddingBottom: 3,\r\n },\r\n },\r\n '& .summary-header-auto-apply': {\r\n marginLeft: 8,\r\n gridColumn: '3',\r\n height: 20,\r\n fontSize: '11px',\r\n lineHeight: '16px',\r\n borderRadius: '12px',\r\n backgroundColor: '#F7F7F7',\r\n padding: '0px 10px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n\r\n '& .iconba.iconba-FlashAuto': {\r\n top: '2px',\r\n },\r\n },\r\n '& .summary-header-menu': {\r\n gridColumn: '6',\r\n justifySelf: 'right',\r\n '& .toggle-context-menu': {\r\n cursor: 'pointer',\r\n '& button': {\r\n background: 'none',\r\n border: 'none',\r\n margin: 0,\r\n padding: 0,\r\n },\r\n },\r\n '& .bingads-popover': {\r\n right: 5,\r\n },\r\n },\r\n '& .summary-context-menu': {\r\n '& .bingads-popover': {\r\n background: '#fff',\r\n border: '1px solid #ddd',\r\n boxShadow: '3px 3px 4px #ddd',\r\n top: 'inherit !important',\r\n left: 'inherit !important',\r\n '& >ul': {\r\n minWidth: 170,\r\n listStyle: 'none',\r\n margin: '0',\r\n padding: '0',\r\n '& button': {\r\n margin: '0',\r\n padding: '7px 10px',\r\n color: '#333',\r\n fontWeight: 'normal',\r\n textAlign: 'left',\r\n '&[disabled]': {\r\n opacity: 0.5,\r\n },\r\n '&:hover': {\r\n textDecoration: 'none',\r\n background: '#e5e5e5',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n '& .new-badge-container': {\r\n gridColumn: 4,\r\n justifySelf: 'right',\r\n marginRight: 8,\r\n },\r\n }\r\n);\r\n","export const getIconStyles = () => ({\r\n '& .recommendation-keyword-icon': {\r\n backgroundColor: '#00AD56',\r\n },\r\n '& .recommendation-repair-icon': {\r\n backgroundColor: '#A80000',\r\n },\r\n '& .recommendation-ads-icon': {\r\n backgroundColor: '#0078D4',\r\n },\r\n '& .recommendation-bid-icon': {\r\n backgroundColor: '#00B7C3',\r\n },\r\n '& .recommendation-shopping-cart-icon': {\r\n backgroundColor: '#CA5010',\r\n },\r\n '& .recommendation-extension-icon': {\r\n backgroundColor: '#4F6BED',\r\n },\r\n '& .recommendation-seasonal-icon': {\r\n backgroundColor: '#E3008C',\r\n },\r\n '& .recommendation-targeting-icon': {\r\n backgroundColor: '#881798',\r\n },\r\n '& .recommendation-budget-icon': {\r\n backgroundColor: '#8378DE',\r\n },\r\n '& .recommendation-auto-apply-icon': {\r\n backgroundColor: '#373277',\r\n },\r\n '& .recommendation-p-max-icon': {\r\n backgroundColor: '#038387',\r\n },\r\n '& .recommendation-syndication-icon': {\r\n backgroundColor: '#4F6BED',\r\n },\r\n});\r\n","/* eslint-disable jsx-a11y/anchor-is-valid, no-script-url */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\nimport * as urlUtil from '@bingads-webui/url-util';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\nimport { ClientCenterCustomerService } from '@bingads-webui/clientcenter-customer-service';\r\nimport { oldAlertCenterAdapter } from '@bingads-webui-campaign/notification-center';\r\nimport asyncScheduler from '@bingads-webui-static-legacy/async-scheduler';\r\nimport * as errI18n from '@bingads-webui-component-legacy/api-errors-campaign/index';\r\n\r\nimport {\r\n RecommendationService,\r\n RecommendationDownloadService,\r\n setRecommendationCache,\r\n getRecommendationCache,\r\n MCC_ACCOUNTS_CAPPING,\r\n} from '@bingads-webui-campaign/recommendation-core';\r\n\r\nconst flatten = entities => _.chain(entities)\r\n .map((entity) => {\r\n if (entity.isCustomer) {\r\n if (entity.unAuthorized) {\r\n return [];\r\n }\r\n return flatten(entity.children);\r\n }\r\n return entity;\r\n })\r\n .flatten()\r\n .value();\r\n\r\nexport const withRecommendationServices = ({\r\n currentScenario,\r\n currentActivity,\r\n odataPath,\r\n}) => (WrappedComponent) => {\r\n const HoC = (props) => {\r\n const {\r\n appConfig,\r\n permissions,\r\n pageContext,\r\n i18n,\r\n odata,\r\n cacheManager,\r\n } = props.deps;\r\n\r\n const { getODataErrors } = errI18n;\r\n\r\n const customerService = new ClientCenterCustomerService({ ccBaseUrl: appConfig.get('CCBaseUrl') });\r\n let accountIdsPromise = null;\r\n if (props.isMCC) {\r\n const AccountIdListCache = getRecommendationCache('account-id-list');\r\n accountIdsPromise = _.isUndefined(AccountIdListCache) ? customerService.getCustomerHierarchy({\r\n cid: props.scope.customerId,\r\n uid: props.scope.userId,\r\n returnOnlyDirectlyLinkedEntities: false,\r\n limit: MCC_ACCOUNTS_CAPPING,\r\n }).then((data) => {\r\n const { customerHierarchyEntities } = data;\r\n const flattenedAccounts = flatten(_.first(customerHierarchyEntities).children);\r\n const result = _.chain(flattenedAccounts).map(account => account.id).value();\r\n setRecommendationCache('account-id-list', result);\r\n return result;\r\n }) : Promise.resolve(AccountIdListCache);\r\n } else {\r\n accountIdsPromise = Promise.resolve([]);\r\n }\r\n\r\n const source = urlUtil.getParameter('recsrc') || appConfig.get('recsrc');\r\n\r\n // don't initialize if scope is not set\r\n let dataService = null;\r\n let downloadService = null;\r\n if (props.scope != null) {\r\n dataService = new RecommendationService({\r\n scope: props.scope,\r\n showAlertHandler: oldAlertCenterAdapter.show.bind(oldAlertCenterAdapter),\r\n i18n,\r\n currentScenario,\r\n currentActivity,\r\n odataPath,\r\n permissions,\r\n lcid: pageContext.CultureLcid,\r\n pageContext,\r\n ccJsData: props.ccJsData,\r\n accountIdsPromise,\r\n isMCC: props.isMCC,\r\n asyncScheduler,\r\n alertCenter: oldAlertCenterAdapter,\r\n odata,\r\n newI18n: props.vnextDeps.newI18n || props.newI18n,\r\n cacheManager,\r\n channel: props.channel,\r\n });\r\n downloadService = new RecommendationDownloadService({\r\n scope: props.scope,\r\n alertCenter: oldAlertCenterAdapter,\r\n asyncScheduler,\r\n cacheManager,\r\n getODataErrors,\r\n i18n,\r\n odata,\r\n pageContext,\r\n permissions,\r\n isMCC: props.isMCC,\r\n recommendationService: dataService,\r\n });\r\n }\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n HoC.displayName = `withService(${getDisplayName(WrappedComponent)})`;\r\n HoC.propTypes = {\r\n deps: PropTypes.shape({\r\n appConfig: PropTypes.objectOf(PropTypes.any).isRequired,\r\n instrumentation: PropTypes.object,\r\n permissions: PropTypes.object.isRequired,\r\n pageContext: PropTypes.object.isRequired,\r\n i18n: PropTypes.object.isRequired,\r\n }).isRequired,\r\n scope: PropTypes.shape({\r\n accountId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\r\n adGroupId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\r\n campaignId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\r\n customerId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\r\n userId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\r\n token: PropTypes.string,\r\n }),\r\n ccJsData: PropTypes.objectOf(PropTypes.object),\r\n isMCC: PropTypes.bool,\r\n vnextDeps: PropTypes.shape({\r\n newI18n: PropTypes.object,\r\n }),\r\n channel: PropTypes.string,\r\n };\r\n HoC.defaultProps = {\r\n scope: null,\r\n isMCC: false,\r\n ccJsData: undefined,\r\n vnextDeps: {},\r\n channel: null,\r\n };\r\n\r\n hoistNonReactStatics(HoC, WrappedComponent);\r\n\r\n return HoC;\r\n};\r\n","var pug = require(\"!../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"recommendation-modal-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","import { ItemBox } from './itemBox';\r\n\r\n// with the top, left information, we could place the item with absolute position\r\ninterface ItemPosition {\r\n top: number;\r\n left: number;\r\n}\r\n\r\nexport class ItemLayout {\r\n columnCount: number;\r\n columnWidth: number;\r\n columnPadding: number;\r\n rowPadding: number;\r\n itemCount: number;\r\n columnHeights: number [][];\r\n itemPositions: ItemPosition | null [];\r\n itemBox: ItemBox;\r\n maxHeight: number | null;\r\n\r\n constructor({\r\n columnCount,\r\n columnWidth,\r\n columnPadding,\r\n rowPadding,\r\n itemBox,\r\n itemCount,\r\n }) {\r\n this.columnCount = columnCount;\r\n this.columnWidth = columnWidth;\r\n this.columnPadding = columnPadding;\r\n this.rowPadding = rowPadding;\r\n\r\n this.columnHeights = [];\r\n this.itemPositions = [];\r\n this.columnHeights[0] = Array.from({ length: columnCount }).map(x => 0);\r\n this.itemBox = itemBox;\r\n this.itemCount = itemCount;\r\n }\r\n\r\n getItemPosition(index) {\r\n const { positionChecked } = this.itemBox.getBox(index);\r\n // if we are too slow to get the position, recalculate all the items at this time\r\n if (positionChecked === false) {\r\n for (let i = 0; i < index; i++) {\r\n this.setItemPosition(i);\r\n }\r\n }\r\n if (this.itemPositions[index]) {\r\n return this.itemPositions[index];\r\n }\r\n return null;\r\n }\r\n\r\n setItemPosition(index) {\r\n const { height: itemHeight, width: itemWidth } = this.itemBox.getBox(index);\r\n\r\n if (this.columnHeights[index] == null || itemHeight == null) {\r\n this.itemPositions[index] = null;\r\n return;\r\n }\r\n\r\n const columnHeights = this.columnHeights[index];\r\n\r\n const minIndex = this.minHeightColumn(columnHeights);\r\n\r\n const top = columnHeights[minIndex];\r\n\r\n const left = minIndex * (this.columnWidth + this.columnPadding);\r\n\r\n const nextColumnHeights = [...columnHeights];\r\n\r\n const targetItemHeight = itemWidth > 0 ? this.columnWidth * (itemHeight / itemWidth) : itemHeight;\r\n\r\n nextColumnHeights[minIndex] = top + targetItemHeight + this.rowPadding;\r\n\r\n this.columnHeights[index + 1] = [...nextColumnHeights];\r\n\r\n this.itemPositions[index] = {\r\n top,\r\n left,\r\n };\r\n\r\n this.itemBox.checked(index);\r\n }\r\n\r\n updateLayout({\r\n columnCount,\r\n columnWidth,\r\n columnPadding,\r\n rowPadding,\r\n itemBox,\r\n itemCount,\r\n }) {\r\n this.columnCount = columnCount;\r\n this.columnWidth = columnWidth;\r\n this.columnPadding = columnPadding;\r\n this.rowPadding = rowPadding;\r\n\r\n this.columnHeights = [];\r\n this.itemPositions = [];\r\n this.columnHeights[0] = Array.from({ length: columnCount }).map(x => 0);\r\n this.itemBox = itemBox;\r\n this.itemCount = itemCount;\r\n this.maxHeight = null;\r\n\r\n // recalculate all the items\r\n for (let i = 0; i < this.itemCount; i++) {\r\n this.setItemPosition(i);\r\n }\r\n }\r\n\r\n placeItems() {\r\n if (this.itemBox.lastUpdateIndex == null) {\r\n return;\r\n }\r\n\r\n // recalculate all the items after the one updated\r\n let i = this.itemBox.lastUpdateIndex;\r\n while (i < this.itemCount) {\r\n this.setItemPosition(i);\r\n i += 1;\r\n }\r\n\r\n this.itemBox.lastUpdateIndex = null;\r\n }\r\n\r\n getMaxHeight() {\r\n if (this.columnHeights[this.itemCount]) {\r\n const heights = this.columnHeights[this.itemCount];\r\n let maxHeight = heights[0];\r\n for (let i = 1; i < heights.length; i++) {\r\n if (heights[i] > maxHeight) {\r\n maxHeight = heights[i];\r\n }\r\n }\r\n return maxHeight;\r\n }\r\n // guessed height\r\n return (this.itemCount / this.columnCount) * 240;\r\n }\r\n\r\n setItemCount(count) {\r\n this.itemCount = count;\r\n }\r\n\r\n minHeightColumn(columnHeights) : number {\r\n let smallest = 0;\r\n for (let i = 1; i < columnHeights.length; i++) {\r\n if (columnHeights[i] < columnHeights[smallest]) {\r\n smallest = i;\r\n }\r\n }\r\n return smallest;\r\n }\r\n}\r\n","interface Box {\r\n height: number,\r\n width: number,\r\n positionChecked: boolean,\r\n}\r\n\r\nexport class ItemBox {\r\n itemBoxes: Box [];\r\n lastUpdateIndex: number | undefined | null;\r\n\r\n constructor() {\r\n this.itemBoxes = [];\r\n }\r\n\r\n setBox(index, height, width) {\r\n this.itemBoxes[index] = { height, width, positionChecked: false };\r\n if (this.lastUpdateIndex == null || index <= this.lastUpdateIndex) {\r\n this.lastUpdateIndex = index;\r\n }\r\n }\r\n\r\n checked(index) {\r\n this.itemBoxes[index].positionChecked = true;\r\n }\r\n\r\n getBox(index) {\r\n if (this.itemBoxes[index]) return this.itemBoxes[index];\r\n return ({ height: null, width: null, positionChecked: false });\r\n }\r\n}\r\n","/*\r\n 1. To layout the items, we need to know the height of items => Use ItemMeasurer with ResizeObserver to track the height of items\r\n 2. With the height of items, itemLayout will calculate the positions of items with the height, width and columns\r\n 3. With the positions of items, we could place the items with absolute style\r\n 4. With the absolute positions, we could do the virtualization by showing only the visible item via the scrollTop and offset.\r\n*/\r\n\r\nimport React, { useState, useRef, useCallback, useLayoutEffect, useMemo, useEffect } from 'react';\r\nimport { List, ListItem } from '@fluentui/react-list-preview';\r\nimport { ResizeObserver as ResizeObserverPollyFill } from '@juggle/resize-observer';\r\nimport { debounce } from 'underscore';\r\n\r\nimport { ItemLayout } from './itemLayout';\r\nimport { ItemBox } from './itemBox';\r\n\r\n\r\nconst COLUMN_WIDTH = 240.5;\r\nconst ROW_HEIGHT = 200;\r\nconst PADDING = 24;\r\n\r\n/*\r\nThe Masonry or Pinterest layout\r\n*/\r\n\r\nconst layouts = {\r\n Mansory: 'Mansory',\r\n Grid: 'Grid',\r\n};\r\n\r\ninterface itemProps {\r\n item: any,\r\n}\r\n\r\ninterface GridProps {\r\n items: any,\r\n // layout?: string, // TODO: support GRID\r\n rowPadding?: number,\r\n columnPadding?: number,\r\n renderItem: () => JSX.Element,\r\n columnWidth?: number,\r\n rowHeight?: number,\r\n scrollContainer?: any,\r\n minItemHeight?: number,\r\n gridMode?: boolean,\r\n maxColumns?: number,\r\n}\r\n\r\ninterface GridInternalProps {\r\n items: any [],\r\n columnWidth: number,\r\n rowHeight?: number,\r\n renderItem: (props: itemProps) => JSX.Element,\r\n itemLayout: ItemLayout,\r\n itemBox: ItemBox,\r\n itemBoxChanged: (cancel: any) => void,\r\n isItemBoxChanged: any,\r\n offset: any,\r\n scrollTop: any,\r\n windowRect: any,\r\n minItemHeight?: number,\r\n gridMode: boolean,\r\n}\r\n\r\ninterface WrappedItemProps {\r\n item: any,\r\n columnWidth: number,\r\n rowHeight?: number,\r\n renderItem: (props: itemProps) => JSX.Element,\r\n itemLayout: ItemLayout,\r\n itemBox: ItemBox,\r\n itemBoxChanged: (cancel: any) => void,\r\n minItemHeight?: number,\r\n gridMode: boolean,\r\n}\r\n\r\ninterface ItemMeasurerProps {\r\n item: any,\r\n itemBoxChanged: (cancel: any) => void,\r\n itemBox: ItemBox,\r\n renderItem: (props: itemProps) => JSX.Element,\r\n gridMode: boolean,\r\n}\r\n\r\nconst ItemMeasurer = (props: ItemMeasurerProps) => {\r\n const {\r\n item,\r\n itemBoxChanged,\r\n itemBox,\r\n renderItem,\r\n gridMode,\r\n } = props;\r\n\r\n const [itemRef, setItemRef] = useState(null);\r\n const {\r\n _index: index,\r\n } = item;\r\n\r\n useEffect(() => {\r\n if (itemRef) {\r\n const cancel = { canceled: false };\r\n const box = itemRef.getBoundingClientRect();\r\n const { height: oldHeight, width: oldWidth } = itemBox.getBox(index);\r\n if (oldHeight !== box.height || oldWidth !== box.width) {\r\n if (box.height > 0 && box.width > 0) {\r\n itemBox.setBox(index, box.height, box.width);\r\n itemBoxChanged(cancel);\r\n }\r\n }\r\n return () => {\r\n cancel.canceled = true;\r\n };\r\n }\r\n return () => {};\r\n }, [itemBoxChanged, index, itemBox, itemRef]);\r\n\r\n useEffect(() => {\r\n if (itemRef) {\r\n // TODO: Batch the updates\r\n // TODO: Add a stop callback when the image is loaded\r\n // Use the Resize Observer to track the height changes of elements\r\n const cancel = { canceled: false };\r\n const updateViewPort = debounce((entries) => {\r\n if (cancel.canceled) { return; }\r\n if (entries[0] && entries[0].target === itemRef) {\r\n const {\r\n borderBoxSize,\r\n } = entries[0];\r\n\r\n const {\r\n blockSize,\r\n inlineSize,\r\n } = borderBoxSize[0];\r\n\r\n const { height: oldHeight, width: oldWidth } = itemBox.getBox(index);\r\n if (oldHeight !== blockSize || oldWidth !== inlineSize) {\r\n if (blockSize > 0 && inlineSize > 0) {\r\n itemBox.setBox(index, blockSize, inlineSize);\r\n itemBoxChanged(cancel);\r\n }\r\n }\r\n }\r\n }, 250);\r\n const resizeObserver = window.ResizeObserver ? new ResizeObserver(updateViewPort) : new ResizeObserverPollyFill(updateViewPort);\r\n resizeObserver.observe(itemRef);\r\n return () => {\r\n cancel.canceled = true;\r\n resizeObserver.unobserve(itemRef);\r\n resizeObserver.disconnect();\r\n };\r\n }\r\n return () => {};\r\n }, [itemBoxChanged, index, itemRef, itemBox]);\r\n\r\n return (\r\n setItemRef(ref)}\r\n style={{ width: '100%', height: (gridMode ? '100%' : undefined) }}\r\n >\r\n {renderItem({\r\n item,\r\n })}\r\n );\r\n};\r\n\r\nconst WrappedItem = (props: WrappedItemProps) => {\r\n // Get the positions and render the element absolutely\r\n // To get the positions, we need the height of the rendered elements\r\n const {\r\n item,\r\n columnWidth,\r\n rowHeight,\r\n gridMode,\r\n renderItem,\r\n itemBox,\r\n itemLayout,\r\n minItemHeight,\r\n itemBoxChanged,\r\n } = props;\r\n\r\n const { _index: index, tabIndex, ariaLabel } = item;\r\n const itemPosition = itemLayout.getItemPosition(index);\r\n const { height, width } = itemBox.getBox(index);\r\n const largerThanMinItemHeight = minItemHeight && height ? height > minItemHeight : true;\r\n\r\n // First, we will hide the element and get the height of rendered element.\r\n // After that, we could calculate the positions of all the elements\r\n return (\r\n (item.onAction ? item.onAction(event) : null)}\r\n >\r\n \r\n \r\n );\r\n};\r\n\r\nWrappedItem.defaultProps = {\r\n minItemHeight: undefined,\r\n rowHeight: undefined,\r\n};\r\n\r\nconst GridInternal = (props: GridInternalProps) => {\r\n const {\r\n items,\r\n renderItem,\r\n columnWidth,\r\n rowHeight,\r\n gridMode,\r\n itemBoxChanged,\r\n itemBox,\r\n itemLayout,\r\n scrollTop,\r\n offset,\r\n windowRect,\r\n isItemBoxChanged,\r\n minItemHeight,\r\n } = props;\r\n\r\n // Filter out the elements that is not visible\r\n // TODO: use interval tree, if the performance is not acceptable, from now O(N) to O(logN)\r\n // TODO: use more specific height of the container but the windowHeight\r\n const visibleItems = items.filter((item) => {\r\n const { _index: index } = item;\r\n const itemPosition = itemLayout.getItemPosition(index);\r\n let isVisible = true;\r\n if (itemPosition) {\r\n const { height } = itemBox.getBox(index);\r\n if (height) {\r\n const { top: itemTop } = itemPosition;\r\n const itemBottom = itemPosition.top + height;\r\n const {\r\n height: windowHeight,\r\n } = windowRect;\r\n const bufferHeight = windowHeight / 2;\r\n const topBorder = Math.max(0, scrollTop - offset - bufferHeight);\r\n const bottomBorder = (scrollTop - offset) + windowHeight + windowHeight;\r\n\r\n isVisible = !(itemTop > bottomBorder || itemBottom < topBorder);\r\n }\r\n }\r\n return isVisible;\r\n });\r\n\r\n const [render, forceRender] = useState(isItemBoxChanged);\r\n\r\n useEffect(() => {\r\n forceRender(isItemBoxChanged);\r\n }, [isItemBoxChanged]);\r\n\r\n return (\r\n
\r\n \r\n {\r\n visibleItems.map((item) => {\r\n const {\r\n _index: index,\r\n } = item;\r\n\r\n return (\r\n );\r\n })\r\n }\r\n \r\n
\r\n );\r\n};\r\n\r\nGridInternal.defaultProps = {\r\n minItemHeight: undefined,\r\n rowHeight: undefined,\r\n};\r\n\r\n\r\nconst useWindow = () => {\r\n const getSize = useCallback(() => {\r\n const {\r\n clientWidth,\r\n clientHeight,\r\n } = document.documentElement;\r\n\r\n return {\r\n width: clientWidth,\r\n height: clientHeight,\r\n };\r\n }, []);\r\n\r\n const [windowRect, setWindowRect] = useState(getSize());\r\n\r\n const [update, setUpdate] = useState({\r\n ...windowRect,\r\n });\r\n\r\n useLayoutEffect(() => {\r\n const updateSize = () => {\r\n setUpdate(getSize());\r\n };\r\n window.addEventListener('resize', updateSize);\r\n return () => window.removeEventListener('resize', updateSize);\r\n }, [getSize]);\r\n\r\n useLayoutEffect(() => {\r\n // TODO_opt: if this updates are too frequently, we could do optimization\r\n // TODO: debounce\r\n setWindowRect(update);\r\n }, [update]);\r\n\r\n return [windowRect];\r\n};\r\n\r\nconst useTopDivMetaData = (topDiv, topDivRect) => {\r\n const [offset, setOffset] =\r\n useState(0);\r\n\r\n useLayoutEffect(() => {\r\n if (topDiv) {\r\n let target = topDiv;\r\n let newOffset = 0;\r\n do {\r\n newOffset += target.offsetTop;\r\n target = target.offsetParent;\r\n } while (target);\r\n\r\n if (newOffset !== offset) {\r\n setOffset(newOffset);\r\n }\r\n }\r\n }, [offset, topDiv, topDivRect]);\r\n\r\n return [offset];\r\n};\r\n\r\nconst useScroll = (scrollContainer) => {\r\n const [scrollTop, setScrollTop] = useState(0);\r\n const [update, setUpdate] = useState({\r\n scrollY: scrollTop,\r\n });\r\n\r\n useLayoutEffect(() => {\r\n const scrollHandler = (e) => {\r\n const scrollTop = e && e.target.scrollTop;\r\n setUpdate({\r\n scrollY: scrollTop,\r\n });\r\n };\r\n const windowScrollHandler = () => {\r\n const {\r\n scrollY,\r\n } = window;\r\n setUpdate({\r\n scrollY,\r\n });\r\n };\r\n if (scrollContainer) {\r\n const element = (typeof (scrollContainer)) === 'string' ? document.querySelector(scrollContainer) : scrollContainer;\r\n if (element) {\r\n element.addEventListener('scroll', scrollHandler);\r\n }\r\n } else {\r\n window.addEventListener('scroll', windowScrollHandler);\r\n }\r\n return () => {\r\n if (scrollContainer) {\r\n const element = (typeof (scrollContainer)) === 'string' ? document.querySelector(scrollContainer) : scrollContainer;\r\n if (element) {\r\n element.removeEventListener('scroll', scrollHandler);\r\n }\r\n } else {\r\n window.removeEventListener('scroll', windowScrollHandler);\r\n }\r\n };\r\n }, [scrollContainer]);\r\n\r\n useLayoutEffect(() => {\r\n // TODO_opt: if this updates are too frequently, we could do optimization\r\n const {\r\n scrollY,\r\n } = update;\r\n setScrollTop(scrollY);\r\n }, [update]);\r\n\r\n return [scrollTop];\r\n};\r\n\r\nexport const Grid = (props: GridProps) => {\r\n const {\r\n items,\r\n renderItem,\r\n rowPadding,\r\n columnPadding,\r\n columnWidth: columnWidthProp,\r\n rowHeight: rowHeightProp,\r\n scrollContainer,\r\n minItemHeight,\r\n gridMode,\r\n maxColumns,\r\n } = props;\r\n\r\n const [topDiv, setTopDiv] = useState(null);\r\n const [topDivRect, setTopDivRect] = useState({\r\n clientHeight: 0,\r\n clientWidth: 0,\r\n });\r\n const [columnWidth] = useState(columnWidthProp || COLUMN_WIDTH);\r\n const [rowHeight] = useState(rowHeightProp || ROW_HEIGHT);\r\n const [columnCount, setColumnCount] = useState(1);\r\n const [isItemBoxChanged, setItemBoxChanged] = useState(0);\r\n const [isItemLengthChanged, setItemLengthChanged] = useState(0);\r\n const count = useRef(0);\r\n\r\n // Two components, itemBox and itemLayout.\r\n // The itemBox track the height, width of each item\r\n // With the heights of each item, the itemLayout computes the positions of the items\r\n const itemBox = useRef(new ItemBox());\r\n const itemLayout = useRef(new ItemLayout({\r\n columnCount,\r\n columnWidth,\r\n columnPadding,\r\n rowPadding,\r\n itemBox: itemBox.current,\r\n itemCount: items.length,\r\n }));\r\n\r\n // The distance of the top offset\r\n const [offset] = useTopDivMetaData(topDiv, topDivRect);\r\n\r\n const wrappedScrollContainer = useMemo(() => {\r\n if ((typeof (scrollContainer)) === 'string') {\r\n return scrollContainer;\r\n }\r\n if (scrollContainer && scrollContainer.current) {\r\n return scrollContainer.current;\r\n }\r\n return null;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [scrollContainer, scrollContainer.current]);\r\n\r\n // The distance of the global scroll top\r\n const [scrollTop] = useScroll(wrappedScrollContainer);\r\n // The window view\r\n const [windowRect] = useWindow();\r\n\r\n const itemBoxChanged = useCallback(debounce((cancel) => {\r\n // React will accumulate the update\r\n if (cancel && cancel.canceled) {\r\n return;\r\n }\r\n\r\n setItemBoxChanged(isItemBoxChanged => isItemBoxChanged + 1);\r\n }, 250), [setItemBoxChanged]);\r\n\r\n const itemLengthChanged = useCallback(() => {\r\n // React will accumulate the update\r\n setItemLengthChanged(isItemLengthChanged => isItemLengthChanged + 1);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (topDiv) {\r\n const {\r\n clientHeight,\r\n clientWidth,\r\n } = topDiv;\r\n\r\n setTopDivRect({\r\n clientHeight,\r\n clientWidth,\r\n });\r\n }\r\n }, [topDiv]);\r\n\r\n useEffect(() => {\r\n if (topDiv) {\r\n const cancel = { canceled: false };\r\n const updateTopDivRect = debounce((entries) => {\r\n if (entries[0] && cancel.canceled === false) {\r\n const {\r\n clientHeight,\r\n clientWidth,\r\n } = entries[0].target;\r\n\r\n setTopDivRect({\r\n clientHeight,\r\n clientWidth,\r\n });\r\n }\r\n }, 250);\r\n const resizeObserver = window.ResizeObserver ? new ResizeObserver(updateTopDivRect) : new ResizeObserverPollyFill(updateTopDivRect);\r\n resizeObserver.observe(topDiv);\r\n return () => {\r\n cancel.canceled = true;\r\n resizeObserver.unobserve(topDiv);\r\n resizeObserver.disconnect();\r\n };\r\n }\r\n return () => {};\r\n }, [topDiv]);\r\n\r\n const calculatedColumnWidth = useCallback((availableColumn, items) => {\r\n const {\r\n clientWidth,\r\n } = topDivRect;\r\n const extendedColumnWidth = (clientWidth - ((columnPadding || PADDING) * (availableColumn - 1))) / availableColumn;\r\n return (items.length >= availableColumn ? extendedColumnWidth : columnWidth);\r\n }, [columnPadding, columnWidth, topDivRect]);\r\n\r\n const calculatedRowHeight = useCallback((availableColumn, items) => {\r\n const targetColumnWidth = calculatedColumnWidth(availableColumn, items);\r\n const targetRowHeight = (targetColumnWidth / columnWidth) * rowHeight;\r\n return targetRowHeight;\r\n }, [calculatedColumnWidth, columnWidth, rowHeight]);\r\n\r\n useEffect(() => {\r\n if (topDivRect) {\r\n const {\r\n clientWidth,\r\n } = topDivRect;\r\n const columnWithPadding = columnWidth + (columnPadding || PADDING);\r\n let availableColumn;\r\n if (clientWidth > 0) {\r\n if (clientWidth <= columnWidth) {\r\n availableColumn = 1;\r\n } else {\r\n availableColumn = 1 + Math.floor((clientWidth - columnWidth) / columnWithPadding);\r\n }\r\n if (maxColumns) {\r\n availableColumn = Math.min(availableColumn, maxColumns);\r\n }\r\n const targetColumnWidth = calculatedColumnWidth(availableColumn, items);\r\n if (availableColumn !== columnCount) {\r\n setColumnCount(availableColumn);\r\n }\r\n if (availableColumn !== columnCount\r\n || targetColumnWidth !== itemLayout.current.columnWidth) {\r\n // for new layout, we would need to place all the items\r\n itemLayout.current.updateLayout({\r\n columnCount: availableColumn,\r\n columnWidth: targetColumnWidth,\r\n columnPadding,\r\n rowPadding,\r\n itemBox: itemBox.current,\r\n itemCount: items.length,\r\n });\r\n }\r\n }\r\n }\r\n }, [calculatedColumnWidth, columnCount, columnPadding, columnWidth, items, items.length, maxColumns, rowPadding, topDivRect]);\r\n\r\n useEffect(() => {\r\n itemLayout.current.setItemCount(items.length);\r\n itemLengthChanged();\r\n }, [itemLengthChanged, items.length]);\r\n\r\n useEffect(() => {\r\n // for force update, we would only need to update the changed items\r\n count.current += 1;\r\n itemLayout.current.placeItems();\r\n }, [isItemBoxChanged]);\r\n\r\n const indexedItems = useMemo(() => items.map((item, index) => ({\r\n ...item,\r\n _index: index,\r\n })), [items]);\r\n\r\n return (\r\n setTopDiv(ref)}\r\n >\r\n \r\n \r\n );\r\n};\r\n\r\nGrid.defaultProps = {\r\n columnPadding: 24,\r\n rowPadding: 16,\r\n columnWidth: COLUMN_WIDTH,\r\n rowHeight: ROW_HEIGHT,\r\n scrollContainer: {},\r\n minItemHeight: undefined,\r\n gridMode: false,\r\n maxColumns: undefined,\r\n};\r\n","import React from 'react';\r\n\r\nconst ComponentStylesContext = React.createContext({});\r\n\r\n// componentStyles is an object, keys are component names, values are functions that return styles\r\n// the functions are passed the theme as its only argument\r\nexport const ComponentStylesProvider = ({ children, componentStyles }) => (\r\n \r\n {children}\r\n \r\n);\r\n\r\n// get the getStyles function for a component by name\r\n// returns null if the component has no styles\r\nexport const useComponentStylesContext = (componentName) => {\r\n const componentStyles = React.useContext(ComponentStylesContext);\r\n if (componentStyles && componentStyles[componentName]) {\r\n return componentStyles[componentName];\r\n }\r\n return null;\r\n};\r\n","import _ from 'underscore';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport React from 'react';\r\n\r\nimport { useComponentStylesContext } from './component-styles-provider';\r\n\r\nconst useNoBaseStyles = () => null;\r\n\r\nexport function withOverridableStyles(WrappedComponent, useDefaultStyles, useBaseStyles = useNoBaseStyles, options) {\r\n const {\r\n componentName,\r\n baseClassName,\r\n } = options || {};\r\n\r\n const HOC = (props) => {\r\n // get the custom styles for the component, which are provided by setting up the ComponentStylesProvider\r\n const overridenClasses = useComponentStylesContext(componentName);\r\n\r\n const defaultClasses = useDefaultStyles();\r\n const baseClass = useBaseStyles();\r\n\r\n // shallow merge the default classes with the overriden classes\r\n const finalBaseClassName = baseClassName || 'baseClassName';\r\n const finalClasses = { ...defaultClasses, [finalBaseClassName]: baseClass, ...overridenClasses };\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n const componentDisplayName = componentName || WrappedComponent.displayName || WrappedComponent.name || 'Component';\r\n\r\n HOC.displayName = `withComponentStyles(${componentDisplayName})`;\r\n\r\n hoistNonReactStatics(HOC, WrappedComponent);\r\n\r\n return HOC;\r\n}\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useContext, useMemo, useRef, useState } from 'react';\r\n\r\ntype NavigationViewType = {\r\n name: string,\r\n params: any,\r\n};\r\n\r\ntype NavigationContextType = {\r\n getTopView: () => NavigationViewType | undefined,\r\n getViewParams: (viewName: string) => any,\r\n setViewParams: (viewName: string, params: any) => void,\r\n pushLocalView: (viewName: string, params: any) => void,\r\n popLocalView: () => NavigationViewType | undefined,\r\n // replaceLocalView: (viewName: string, params: any) => void,\r\n updated: any,\r\n};\r\n\r\nconst LocalNavigationContext = React.createContext(null);\r\n\r\nexport const LocalNavigationProvider = ({ children }) => {\r\n // use a ref to store the vew stack to eunsure for all context value instances (even\r\n // for the ones captured in closures) can access the latest view stack\r\n // and to trigger re-render when the view stack is updated, we use a state to store a dummy object\r\n const localViewStackRef = useRef>([]);\r\n const activeElementRef = useRef();\r\n const [updated, setUpdated] = useState({});\r\n // const [localViewStack, setLocalViewStack] = useState>([]);\r\n\r\n const getTopView = useCallback(() => _.last(localViewStackRef.current), []);\r\n\r\n const pushLocalView = useCallback((viewName, params) => {\r\n const { name } = _.last(localViewStackRef.current) || {};\r\n if (name !== viewName) {\r\n activeElementRef.current = document.activeElement;\r\n localViewStackRef.current.push({ name: viewName, params });\r\n } else {\r\n localViewStackRef.current = localViewStackRef.current.slice(0, -1).concat({ name: viewName, params });\r\n }\r\n setUpdated({}); // force re-render\r\n }, []);\r\n\r\n const popLocalView = useCallback(() => {\r\n if (activeElementRef.current && activeElementRef.current instanceof HTMLElement) {\r\n activeElementRef.current.focus();\r\n }\r\n const topView = _.last(localViewStackRef.current);\r\n localViewStackRef.current = localViewStackRef.current.slice(0, -1);\r\n setUpdated({}); // force re-render\r\n return topView;\r\n }, []);\r\n\r\n // const replaceLocalView = useCallback((viewName, params) => {\r\n // }, []);\r\n\r\n const getViewParams = useCallback((viewName) => {\r\n const viewIndex = _.findLastIndex(localViewStackRef.current, { name: viewName });\r\n if (viewIndex >= 0) {\r\n return localViewStackRef.current[viewIndex].params || {};\r\n }\r\n return null;\r\n }, []);\r\n\r\n const setViewParams = useCallback((viewName, params) => {\r\n const viewIndex = _.findLastIndex(localViewStackRef.current, { name: viewName });\r\n if (viewIndex >= 0) {\r\n localViewStackRef.current[viewIndex].params = params;\r\n setUpdated({}); // force re-render\r\n }\r\n }, []);\r\n\r\n const value: NavigationContextType = {\r\n getTopView,\r\n getViewParams,\r\n setViewParams,\r\n pushLocalView,\r\n popLocalView,\r\n // replaceLocalView,\r\n updated,\r\n };\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n\r\nexport const useLocalNavigation = () => {\r\n const navigation = useContext(LocalNavigationContext);\r\n return navigation;\r\n};\r\n/* istanbul ignore next */\r\n// has not been used in ads studio so skipped\r\n// TODO: add test for withLocalNavigation\r\nexport const withLocalNavigation = (Component, viewName) => {\r\n const HOC = (props) => {\r\n const { getTopView, getViewParams, updated } = useContext(LocalNavigationContext) || {};\r\n const topView = getTopView && getTopView();\r\n const params = getViewParams && getViewParams(viewName);\r\n return (\r\n \r\n );\r\n };\r\n return HOC;\r\n};\r\n\r\nexport const LocalNavigationRoute = ({ viewName, render, ...rest }) => {\r\n const { getTopView, getViewParams, updated } = useContext(LocalNavigationContext) || {};\r\n const topView = getTopView && getTopView();\r\n const params = getViewParams && getViewParams(viewName);\r\n const Comp = useMemo(() => {\r\n const ret = render({\r\n open: !!params,\r\n isTopView: topView && topView.name === viewName,\r\n localRouteUpdated: updated, // force re-render\r\n ...params,\r\n ...rest,\r\n });\r\n return ret;\r\n }, [render, params, topView, viewName, updated, rest]);\r\n return Comp;\r\n};\r\n","import React, { useMemo } from 'react';\r\nimport {\r\n mergeClasses,\r\n ToggleButton,\r\n} from '@fluentui/react-components';\r\n\r\nexport const ToggleButtons = ({\r\n options,\r\n optionsState,\r\n toggleSelectedOption,\r\n classes,\r\n}) => {\r\n const selectedButtonClasses = classes && classes.selectedButton ? classes.selectedButton : '';\r\n const initialClasses = classes && classes.toggleButton ? classes.toggleButton : '';\r\n\r\n const buttons = useMemo(() => options.map(option => (\r\n {\r\n if (toggleSelectedOption) {\r\n toggleSelectedOption(option.key);\r\n }\r\n }}\r\n >\r\n {option.text}\r\n \r\n )), [initialClasses, options, optionsState, selectedButtonClasses, toggleSelectedOption]);\r\n\r\n return (buttons);\r\n};\r\n","import React, { useCallback, useMemo } from 'react';\r\nimport { makeStyles, mergeClasses } from '@fluentui/react-components';\r\nimport { LineChart, IChartProps } from '@fluentui/react-charting';\r\n\r\nconst useStyles = makeStyles({\r\n inlineChart: {\r\n height: '290px',\r\n },\r\n});\r\n\r\nexport const InlineChart = (props) => {\r\n const { data } = props;\r\n const classes = useStyles();\r\n const getColor = useCallback((metricName) => {\r\n if (metricName === 'Clicks') {\r\n return 'rgba(227, 0, 140, 1)';\r\n } else if (metricName === 'CTR') {\r\n return 'rgba(99, 124, 239, 1)';\r\n } else if (metricName === 'Impressions') {\r\n return 'rgba(42, 160, 164, 1)';\r\n }\r\n return 'gray';\r\n }, []);\r\n\r\n const lineChartData = useMemo(() => {\r\n if (!data || !Array.isArray(data)) {\r\n return [];\r\n }\r\n const result: { legend: string; data: { x: Date; y: number; }[]; color: string }[] = [];\r\n data.forEach(({ MetricName, PrimaryDataPoints, ComparisonDataPoints }) => {\r\n const lineData = {\r\n legend: MetricName,\r\n data: Array.isArray(PrimaryDataPoints) ? PrimaryDataPoints.map(({ DateTime, Value }) => ({ x: new Date(DateTime), y: Value })) : [],\r\n color: getColor(MetricName),\r\n lineOptions: {\r\n strokeWidth: '2px',\r\n },\r\n };\r\n const comparisonData = {\r\n legend: `Average ${MetricName} in your library`,\r\n legendShape: 'dottedLine',\r\n data: Array.isArray(ComparisonDataPoints) ? ComparisonDataPoints.map(({ DateTime, Value }) => ({ x: new Date(DateTime), y: Value })) : [],\r\n color: 'gray',\r\n lineOptions: {\r\n strokeDasharray: '2px',\r\n strokeDashoffset: '-1',\r\n strokeLinecap: 'butt',\r\n strokeWidth: '2px',\r\n },\r\n };\r\n if (lineData.data.length) {\r\n result.push(lineData);\r\n }\r\n if (comparisonData.data.length) {\r\n result.push(comparisonData);\r\n }\r\n });\r\n return result;\r\n }, [data, getColor]);\r\n\r\n const chartData: IChartProps = useMemo(() => ({\r\n chartTitle: '',\r\n lineChartData,\r\n }), [lineChartData]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport {\r\n mergeClasses,\r\n} from '@fluentui/react-components';\r\n\r\nexport const HistoryListImages = (props) => {\r\n const {\r\n onClick,\r\n onKeyDown,\r\n historyList,\r\n selectedIndex,\r\n listStyle,\r\n } = props;\r\n\r\n return (\r\n
\r\n {_.map(historyList, ({ imageUrl }, index) => (\r\n onClick(index)}\r\n role=\"button\"\r\n tabIndex={0}\r\n onKeyDown={e => onKeyDown(index, e)}\r\n >\r\n
\r\n \"generation\r\n
\r\n
\r\n ))}\r\n \r\n );\r\n};\r\n\r\n","import React, { useState } from 'react';\r\n\r\nexport const DataContext = React.createContext({});\r\n\r\nexport const DataProvider = ({ children }) => {\r\n const [dataPromise, setDataPromise] = useState(null);\r\n const [data, setData] = useState(null);\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n"],"names":["useCustomLandingPageStyles","makeStyles","landingPageComponentRoot","_objectSpread","backgroundColor","width","height","shorthands","margin","landingPageComponentTitle","getI18n","i18n","p$data","getLocale","getString","name","param","getToday","getFirstDayOfWeek","getDayOfWeek","value","formatCivilDate","date","formatDate","formatDecimal","formatPercentToFixed","parseCivilDate","parseDate","formatDecimalToFixed","getServerContext","serverContext","CurrentCustomer","Id","CurrentAccount","TimeZone","Name","CurrentUser","LocaleID","CultureDateTimeFormat","ShortDatePattern","CurrentAccountInActive","ServicesEndpoints","Token","IsAADUser","AdStudioInlineChartWrapperInner","_ref","loadPerfTimeSeriesData","isShowChart","dateFilter","perfMarker","instrumentation","chartPreference","i18nInlineChart","filters","appState","pageContext","forceToResizeChart","palette","ThemeFluent","resizeWidth","useCallback","chartContainer","document","getElementsByClassName","length","offsetWidth","resizeChart","useRef","_useState","useState","_useState2","_slicedToArray","dateRange","setDateRange","onWindowResize","_","resizeChartHandler","current","resizeChartListener","handler","useEffect","window","addEventListener","removeEventListener","getDataSource","findAll","timeSeriesParams","getOptions","entityType","token","appConfig","get","imagePath","Constants","pageState","preference","hideChartPanel","customMetricNameList","seriesColors","primary","original","themePrimary","comparative","secondary","lowestSupportedGranularity","disableMovingAverage","addDateChangeListener","resizeEventHandler","dataSource","useMemo","options","getNewDateRange","waterfallDateFilterProcessor","filter","newDateRange","newWidth","_jsx","className","children","InlineChart","customFilter","defaultProps","undefined","AdStudioInlineChartWrapper","withInstrumentation","useAdStudioInlineChart","globalLegacyI18n","getPageContext","globalPageContext","preferencePromise","preferenceServiceLegacy","then","Promise","InlineChartPreferences","store","adapter","chartDataAdapter","ChartDataAdapter","permissions","Permissions","gridName","CurrentGridName","getChartPreference","getPreferencesAndDefaults","CurrentTabId","getGranularityEnum","perfMetricDateRange","_ref3","granularityId","start","Date","RangeStartDate","end","RangeEndDate","reevaluateGranularity","newGranularityId","renderInlineChart","_ref2","isChartShown","useP$DaterangeDefault","preferenceService","useContext","PreferenceContext","ServerContext","waterFallDateFilters","WaterfallFilterStorage","getFilters","WaterfallFilterType","DateFilter","useDateRangeDefault","inlineDownloadStyle","theme","datePickerStyle","InlineDownloadWrapper","marginTop","position","zIndex","getInlineDownloadStyle","marginRight","bottom","helpbuttonStyle","top","content","marginLeft","boxShadow","padding","fontWeight","fontSize","lineHeight","paddingLeft","marginBottom","paddingBottom","InlineDownloadWrapperInternal","React","props","classes","useDefaultStyles","inlineDownloadRef","setDownloadShown","getInlineDownloadColumns","getInlineDownloadFilter","ReportEmailRule","InlineDownloadReactForm","InlineDownloadCampaignODataRepository","totalAssetCount","_useMemo","localizedHeaders","odataColumnNames","_useMemo2","inlineDownloadConfigs","_ref$processReportRul","processReportRule","_ref$customDownloadSe","customDownloadService","_ref$downloadFormats","downloadFormats","entity","totalRecordCount","_ref$validateSegmentT","validateSegmentType","_ref$isFeedbackEnable","isFeedbackEnabled","_ref$data","data","SegmentationTypes","_ref$isForVNext","isForVNext","_ref$p$daterange","p$daterange","filterUrlParam","serializedFilter","p$daterangeDefaultValue","IsCustomerHierarchyEnabled","IsCustomerHierachyRequest","repository","download","Format","segmentationTypes","allUsersType","useInlineDownload","tabbableNode","getTabbableNodes","item","$","is","focus","preventScroll","downloadButton","querySelector","setTimeout","classNames","ref","gridId","toggleToolbarVisibility","clearAfterDownloadCall","downloadBoxRole","downloadFormatsRole","DelayedInlineDownloadWrapperInternal","default","withServerContext","overwriteFilters","rule","unset","getReportEmailRule","isDownloadShown","ReportEmailRuleSnapshot","renderInlineDownload","Filter","parseSync","DatePicker","dateFormat","lcid","timeZone","onSwitchCompare","disableCompare","minDate","rangeIds","_getRangesFromData","getRangesFromData","selectedRange","selectedComparedRange","dateRangePickedLogger","datePicker","create","dateRangePicked","isImprovedDateRangePickerEnabled","DynamicPermissions","ImprovedDateFilter","ComparedDateRangePicker","isMainDatePicker","shouldShowQuickLeftRightPicker","translateLegacyToIANATimezone","rangeId","RangeId","rangeIndex","RangeIndex","rangeDays","RangeDays","comparedTypeKey","compared","key","onPickDateRanges","dateFromDatePicker","generateDateData","isDateRangeChange","RANGES","Custom","isComparedDateChange","formattedEnd","formattedStart","console","log","updateWaterfallFilter","updateToWaterfallFilter","dateRangeLogger","trace","method","setClarityTag","DatePickerOnApply","DatePickerOnQuickApply","DatePickerWithScope","withScope","usePerfPageToolbarStyle","toolbarFilterContainer","flexGrow","paddingTop","display","alignSelf","notificationApi","showWarning","message","extraOptions","showInfo","dismiss","id","createFolderFilterQuery","searchTerm","minWidth","minHeight","_ref$isVideoDurationB","isVideoDurationBoundaryIncluded","minVideoDuration","maxVideoDuration","dateAddedStart","dateAddedEnd","assetType","sourceType","assetSources","folderId","hasPerfData","topRated","filterPredicates","push","concat","map","s","join","filterQuery","formatCivilDateString","civilDate","year","month","day","getDateRangeParams","dateData","startDate","endDate","comparisonStartDate","comparisonEndDate","parseMTDateString","dateStr","str","replace","raw","CSMLSortingRequestParams","_CSMLSortingRequestPa","_defineProperty","CSMLSortBy","MostRecentAsc","sortBy","sortDirection","MostRecent","ImageName","ImageNameDesc","LastCreated","LastCreatedAsc","AssetIdAsc","AssetIdDesc","ClickAsc","ClickDesc","ClickPeriodAsc","ClickPeriodDesc","ClickChangeAsc","ClickChangeDesc","ClickChangePercentAsc","ClickChangePercentDesc","CTRAsc","CTRDesc","CTRPeriodAsc","CTRPeriodDesc","CTRChangeAsc","CTRChangeDesc","CTRChangePercentAsc","CTRChangePercentDesc","ImpressionAsc","ImpressionDesc","ImpressionPeriodAsc","ImpressionPeriodDesc","ImpressionChangeAsc","ImpressionChangeDesc","ImpressionChangePercentAsc","ImpressionChangePercentDesc","SpendAsc","SpendDesc","SpendPeriodAsc","SpendPeriodDesc","SpendChangeAsc","SpendChangeDesc","SpendChangePercentAsc","SpendChangePercentDesc","utcOffset","timeStr","rawFormat","offset","removeNullUndefined","obj","newObj","forEach","CreateDisplayTemplatePageWithLayout","withFullScreenWithSummaryBar","CreateDisplayTemplatePageComponent","PageWithInstrumentation","imageId","useParams","displayTemplateId","EditDisplayTemplatePageComponent","getLogger","activity","page","version","tag","error","withSignalAsync","pageName","logTrace","args","msg","params","rest","paramsJson","JSON","stringify","logError","err","errMsg","traceWithoutParams","monitorPromise","promise","api","resolve","catch","PageNameForLog","Landing","Performance","Images","DisplayTemplates","Videos","EditVideoPage","VideoTemplates","BrandKit","Library","CreateDisplayTemplate","EditDisplayTemplate","WebsiteImagePanel","StockImagePanel","InvestImagePanel","InvestVideoPanel","AddVideoPanel","SearchResultPage","GenerateImagePage","UploadFilesPanelPage","UploadFolderPanelPage","MixedImagePanelPage","MixedVideoPanelPage","EditImagePage","AssetDetailsPage","BackgroundRemovalModalPage","VersionForLog","withCustomLogForPage","WrappedComponent","_ref$tag","Wrapper","logger","displayName","getDisplayName","hoistNonReactStatics","getLoggerWithoutPageInfo","arguments","getLogVersion","AdsStudioAppNameODataHeader","PREFERENCE_NAME","usePerference","getterName","setterName","preferenceValue","setPreferenceValue","pref","curValue","Data","updatePreference","newPreferenceValue","Error","addFoldersTeachingBubbleAllowedShowCount","realUsedFlagInAdsStudioApp","realUsedFlagInAdsStudioPicker","realUsedFlagInAdsStudioAIGCMVPView","perfTablePageSize","perfTableSortBy","pageMenuMode","setSortBy","newSortBy","dismissAddFoldersTeachingBubble","hideAddFoldersTeachingBubble","setRealUsedFlagInAdsStudioApp","realUsedFlag","haveUsed","timestamp","getTime","setRealUsedFlagInAdsStudioPicker","setRealUsedFlagInAdsStudioAIGCMVPView","setPerfTablePageSize","newValue","setPerfTableSortBy","setPageMenuMode","useAdsStudioAccountPreference","_ref10","useAdsStudioUserPreference","_ref11","createFolderQuery","filterArgs","expandArgs","assetsToLoadForSubfolders","_ref3$isGlobalSearch","isGlobalSearch","_ref3$isAssetPickerSc","isAssetPickerScenario","_ref3$isSemanticSearc","isSemanticSearch","_ref3$isRecentSorting","isRecentSorting","sortQuery","expandQuery","includeAssets","includeSubfolders","includeParentHierarchy","expandItems","expandItemsInSubfolders","createFolderExpandQuery","assetSubfolderQuery","globalSearchQuery","assetPickerQuery","semanticSearchQuery","recentSortingQuery","getFolderODataService","_ref4","odata","legacyOdata","oDataConfig","aid","cid","getRequestUrl","_ref5","funcPath","query","resourceRootUrl","oDataPath","getFolderData","_ref6","skip","count","_ref6$isGlobalSearch","_ref6$isAssetPickerSc","_ref6$isSemanticSearc","_ref6$isRecentSorting","folderQuery","url","$top","$skip","getFolderDataWithBIData","_ref7","_ref7$isGlobalSearch","_ref7$isAssetPickerSc","_ref7$isSemanticSearc","_ref7$isRecentSorting","_getDateRangeParams","Rangelcid","requestBody","gridDataParameters","DateRange","StartDate","EndDate","ComparisonDateRange","CurrentCustomerId","post","urlParameters","getPerfTimeSeriesData","_ref8","perfTimeSeriesParams","_ref8$isGlobalSearch","_ref9","granularity","metrics","metric","movingAverage","isMovingAverageOn","funcParams","_toConsumableArray","createDateRangeQuery","createFolder","folderName","parentFolderId","folderType","ParentFolderId","FolderType","res","renameFolder","newFolderName","patch","deleteFolder","_ref12","delete","addAssets","_ref14","asset","_ref14$inProgress","inProgress","supportUpscale","FolderId","Asset","SupportUpscale","progress","deleteAsset","dataJson","stringifyWithBigInt","bulkDeleteAssets","assets","csvRows","_ref15","assetId","folderAssetType","CsvRows","slice","_ref16","indexOf","_ref18","_ref19","Code","ErrorNumber","updateAsset","getBlobUploadUrl","_ref20","fileExtension","batchMove","_ref13","destFolderId","folders","DestFolderId","Assets","FolderIds","getVideosByIdsAsync","videoTasks","reqs","baseURL","type","batch","needContentType","response","getVideo","_ref21","odataPath","getImageBulkEditODataService","getImageCroppingTaskStatus","cropImage","_ref2$cropSettings","cropSettings","_ref2$placementSettin","placementSettings","cropData","CropSettingOnOriginal","PlacementSettings","generateImageWithSmartEffect","getAIGCODataService","generateImagesWithAIAsync","userPrompt","skipBrandDetection","UserPrompt","SkipBrandDetection","getAIGeneratedImageTaskStatus","taskId","getVideoODataService","addVideoCreative","videoCreative","videoUrl","description","metadata","stringifySync","_ref3$fetchMetadata","fetchMetadata","getBackgroundChangeODataService","removeImageBackground","imageUrl","Url","getImageSegmentations","ImageUrl","generateImageBackground","prompt","maskSetsBase64","selectedMasks","outputImageWidth","outputImageHeight","Prompt","MaskSets","SelectedMasks","Width","Height","transformImageResponse","img","FolderAssetType","IdString","Text","createdTime","UploadedTime","modifiedTime","ModifiedTime","originalHeight","OriginalHeight","originalWidth","OriginalWidth","originalUrl","OriginalUrl","CropSettings","cropSettingOnOriginal","Type","SourceType","Metadata","replaceAll","encodeURIComponent","baseId","BaseIdString","roiInfo","ROIInfo","usedByCount","UsedByCount","performanceRating","PerformanceRating","performanceLabel","Rating","performanceLabelBestPercentage","PerformanceLabelBestPercentage","digits","performanceLabelGoodPercentage","PerformanceLabelGoodPercentage","performanceLabelLowPercentage","PerformanceLabelLowPercentage","performanceLabelLearningPercentage","PerformanceLabelLearningPercentage","performanceLabelUnratedPercentage","PerformanceLabelUnratedPercentage","performanceMetrics","PerformanceMetrics","impressions","Impressions","clicks","Clicks","CTR","spend","Spend","periodPerformanceMetrics","PeriodPerformanceMetrics","periodImpressions","periodClicks","periodCTR","periodSpend","performanceMetricsChange","PerformanceMetricsChange","impressionsChange","clicksChange","CTRChange","spendChange","performanceMetricsChangePercentage","PerformanceMetricsChangePercentage","impressionsChangePercentage","clicksChangePercentage","CTRChangePercentage","spendChangePercentage","transformPerfMetricsResponse","isSceneKeyFrame","keyFrame","getRepository","imageBulkEditODataService","imageODataService","ianaTimeZone","timezoneUTCOffset","getImages","importSource","CSMLImportSource","Google","Facebook","totalCount","images","getImage","isImageFittingEnabled","getImageByIdAsync","tasks","tsk","AssetId","ImageText","CreatedTime","stage","Stage","hasError","HasError","failureMessage","Checkpoint","FailureMessage","percentComplete","PercentComplete","imageCroppingTaskStatusId","ImageCroppingTaskStatusId","isFinished","updateImageData","imageData","updateImageAsync","renameImage","deleteImage","deleteImageAsync","uploadImagesByUrl","imageUrls","bulkSaveImagesByUrl","uploadImage","_ref7$activityLogger","activityLogger","_ref7$updateCurrentPr","updateCurrentProgress","_ref7$imageOption","imageOption","_ref7$name","isLogo","uploadImageAsync","addCreative","creativeData","serialized","smartEffects","effectOptions","timerIds","resetTimers","intervalId","clearInterval","timeoutId","clearTimeout","wip","reject","setInterval","JobId","newResponse","createGenerateRequestWithPolling","Image","BaseImageUrl","Filters","smartEffectName","Param","smartEffectOptions","Output","MediaType","saveImageWithBaseId","image","metaData","imageFit","placements","skipOutpainting","getVideoPlaySrc","serializedResolutions","resolutionConfig","parse","resolutions","Object","keys","h","parseInt","Math","max","apply","transformVideoResponse","video","Description","thumbnailUrl","ThumbnailUrl","DownloadUrl","durationInMS","DurationInMS","status","Status","fileSize","SourceVideoLength","quality","Quality","transformAssetResponse","transformerFunc","Video","getAssetTransformer","oDataTypeConfig","namePropertyConfig","transformAssetId","SAFE_INTEGER","Number","MAX_SAFE_INTEGER","match","intValue","toString","bigIntValue","BigInt","transformAddUploadAssetRequest","blobName","model","constants","sourceTypes","UserUploaded","OriginalIdentifier","fileData","base64","base64Index","substr","removeEncodingPrefix","transformAddStockImageRequest","stockImageId","_ref2$imageType","imageType","StockImageId","StockImageVendor","transformAddInvestImageRequest","investImageId","imageSrc","_ref3$imageType","XandrAssetId","transformAddInvestVideoRequest","investVideoId","videoSrc","transformAddUrlImageRequest","_ref5$imageType","transformAddImageWithBaseIdRequest","BaseId","transformAddUrlVideoRequest","WebsiteImported","transformDeleteAssetRequest","transformImageUrlToImageDataAsync","fetch","blob","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","AdsStudioODataError","_AdsStudioErrorBase","_this","originError","originErrors","bulkupsertErrors","errorProcessor","_objectWithoutProperties","_excluded","_classCallCheck","errors","Message","Property","errorCode","errorMessage","errorProperty","_callSuper","_inherits","_createClass","AdsStudioErrorBase","transformFolderResponse","folder","itemCount","ItemsCount","subfolders","SubFolders","subfolder","parentHierarchy","ParentHierarchy","parent","transformParentHierarchy","perfTimeSeriesData","IMPORT_SOURCE_MAP","getFolderRepository","folderODataService","azureUploader","getFolderArgs","_ref2$isVideoDuration","_ref2$assetsToLoadFor","_ref2$isGlobalSearch","_ref2$isAssetPickerSc","_ref2$hasPerfData","_ref2$isSemanticSearc","_ref2$isRecentSorting","isRootFolderId","_ref3$isVideoDuration","_ref3$assetsToLoadFor","_ref3$withBIData","withBIData","_ref3$hasPerfData","_ref3$topRated","willInit","done","createFolderApiErrorProcessor","uploadVideoToAzureBlobWithCancellation","fileObject","onProgress","parseFileName","ext","BlobName","uploadPayloadToBlobWithCancellation","payload","FilePayload","file","deleteFolderApiErrorProcessor","renameFolderApiErrorProcessor","addFolderUploadAsset","addStockImageToFolder","addInvestImageToFolder","addInvestVideoToFolder","addUrlImageToFolder","addImageWithBaseIdToFolder","_ref17","assetsToDelete","_ref26","resultSummary","ast","_ref27","ret","bulkDeleteAssetsApiItemErrorProcessor","bulkDeleteAssetsApiErrorProcessor","renameAsset","transformRenameRequest","assetIds","folderIds","assetsSummary","_ref22","_ref23","Success","Errors","bulkMoveApiItemErrorProcessor","foldersSummary","fdr","_ref24","_ref25","bulkMoveApiErrorProcessor","folderCount","assetCount","postVideoByUrl","updateVideoStatusByIds","taskLength","getAIGCRepository","aigcODataService","TaskId","alError","generateImagesWithAIAPIErrorProcessor","brandNameDetected","brandNames","Progress","RecommendedImages","source","Source","Theme","modelSource","ModelSource","isTaskDone","getAIGeneratedImageAPIErrorProcessor","getBackgroundChangeRepository","oDataService","roi","getRemoveImageBackgroundAPIErrorProcessor","rawMaskSetsBase64String","selectedMasksArray","getStockImageRepository","stockImageService","StockImageDataService","controller","loadAssets","windowIndex","windowSize","searchText","customQueries","appName","$search","language","includevertical","$query","getStockImages","totalItemCount","getBasicAssetsRepository","folderRepository","includeSubfolder","TotalCount","uploadImageToFolder","imageName","ROOT_FOLDER_ID","prepareODataConfig","accountTimeZone","tz","fromLegacyTimeZone","getUTCOffsetWithoutDST","odataToken","oDataToken","odataTokenType","oDataTokenType","applicationName","beforeSend","xhr","onBeforeSendDone","setRequestHeader","withAdsStudioServicesProvider","loggerTag","allowedAssetType","oDataConfigObj","adsStudioUserPreferences","adsStudioAccountPreferences","versionForLog","ImageOData","videoODataService","getODataErrors","errs","defaultMessage","getODataErrorsImpl","AzureUploader","aigcRepository","videoRepository","getVideoRepository","defaultPerfMetricDateRange","getDefaultMetricDateRange","AssetWithFoldersDataServiceProvider","imageRepository","getODataConfig","hostname","location","toLowerCase","isLocal","CampaignAPI","noOpHook","withLibraryAssetsService","_ref$useVideoNotify","useVideoNotify","_useMemo3","_useBasicAssetsServic2","useBasicAssetsService","loadData","loadMoreData","loadMoreAssets","videoUpdated","useVideoTaskPoller","interval","notify","updatedAssetsRef","mergedAssets","newUpdates","dataService","withEditImageService","propName","backgroundChangeODataService","backgroundChangeRepository","saveImage","saveImageCopy","getImageById","uploadStockImageToFolder","_ref10$folderId","moveImageToFolder","getEditImageRepository","_useEditImageService","useEditImageService","getImagesWithFilter","getImagesWithBlur","getImagesWithFilterAndBlur","imagesWithFilter","imagesWithFilterAndBlur","uploadStockImage","getAssetEnhancementSettingsService","getAssetEnhancementSettings","withBrandKitService","useBrandKitRepository","getBrandKits","updateBrandKit","createBrandKits","brandkitResp","brandkitError","cache","brandkitLoading","brandKitDataService","brandkitApiState","withDisplayTemplatesService","WithDataService","useCopilotRepositoryContext","fetchDisplayAdsTemplateGroups","fetchDisplayAdsTemplateGroupDetails","editDisplayAdsAssetRecommendations","fetchDisplayAdsTemplateDefinition","displayTemplatesDataService","witDataService","WithCopilotProvider","CopilotRepositoryProvider","campaignId","locale","CurrentLocale","recommendationType","withCopilotDataServiceProvider","withPagePerfMarker","perfMarkerName","dataLoadedOnce","setDataLoadedOnce","_useState3","marker","createChild","pagePerfMarker","setDataLoaded","useBaseTargetFolderPickerStyles","makeResetStyles","useTargetFolderPickerStyle","targetFolderPickerViewContainer","opacity","dialog","overflow","maxWidth","maxHeight","overflowX","overflowY","filterContainer","folderPathContainer","AdsStudioTargetFolderPicker","selectedFolder","setSelectedFolder","assetLibraryUserPreferences","baseClassName","resetSelectionState","navigateIntoFolder","folderPath","navigateToFolderInPath","f","renderTilesGridCell","index","sectionName","GridSectionName","Folder","targetFolderPickerFolderCell","AdsStudioFoldersGridCell","highlightedText","onFolderClick","GridCellFactory","onFailedToLoadData","_TL_","onFolderPathClicked","onRenderHeader","_jsxs","ImagesFilterBar","FolderPathBreadcrumb","onItemClick","visibleForRootFolder","onRenderEmptyView","LibraryEmptyView","hideAddAssetCards","mergeClasses","AdsStudioLibraryPageContent","renderGridCell","displayFolderPath","onFolderNavigationChange","renderHeader","gridScrollContainer","renderEmptyView","dynamic","TargetFolderPickerModal","sourceFolderId","show","onMoveHereClick","onCancel","currentFolderId","moveHereButtonDisabled","DismissIcon","Dismiss20Regular","onClick","Dialog","open","onDismiss","DialogSurface","DialogBody","DialogTitle","action","DialogContent","DialogActions","Button","disabled","appearance","Modal","isModalVisible","setModalVisible","batchMoveAsync","onSuccess","onError","selectedFolderId","alODataErr","getUXMessage","getUseBatchMoveModalHook","ModalComponent","_excluded2","render","isFoldersEnabled","useBatchMoveModal","withFilterContext","withActivityContext","withAdsStudioServicesConsumer","withAdsStudioServicesLoaded","videoId","EditVideoPageComponent","useAdFilter","useGlobalFilterContext","adFilterStore","FilterStorageFactory","featureName","entityName","filterEntityOptions","entitySchema","getAdFilterStore","saveFilter","waitRemote","deletePromise","clean","remoteSyncTasks","onRemoteSyncDone","savePromise","save","pages","PerformancePage","navigation","updateGlobalWaterfallFilter","outRenderInlineChart","isHideShowGraphButton","_useDatePicker","renderDatePicker","civilMinDate","CivilDate","DatePickerWithPageReady","filterType","useDatePicker","_useAdStudioInlineCha","_useCommonColumn","renderHeaderWithPopup","column","columnIndex","helpId","sortable","headerCell","querySelectorAll","removeAttribute","style","cursor","CommonColumn","alignWithCampaignUI","withCustomizedSortIcon","renderDetailsList","pagedItems","onSort","toolbar","pager","columns","sortByColumn","expandColumns","CampaignDetailsList","skipViewportMeasures","items","sortedColumn","stickyHeader","subColumnProps","showSubColumns","parentColumnPlacement","ParentColumnPlacement","Left","expandIconName","collapseIconName","role","onUpdateColumns","newColumns","_useToolbarContainer","toolbarSelectedConfig","Map","renderToolbarContainer","filterBar","setChartShown","isEditingFilter","toolbarUnselectedConfigList","text","iconLeftGlyphName","expanded","toolbarUnselectedConfig","toolbarConfigInEditingFilterMode","ToolbarContainer","forceHideToolbar","showToolbarSelected","showToolbarUnselected","onClear","useToolbarContainer","PerformancePageComponent","onGotoLandingPage","gotoHomePage","onGoBack","goBack","HomePage","libraryDataService","_ref3$folderId","_ref3$assetType","_ref3$includeAssets","_ref3$includeSubfolde","_ref3$includeParentHi","getBasicFoldersRepository","_useBasicAssetsServic","withLibraryFoldersService","HomePageComponent","Home","ImagesPage","ImagesPageComponent","DisplayTemplatesPage","DisplayTemplatesPageComponent","CreateVideoPage","VideoTemplatesPage","withCopilotDomainDataService","VideoTemplatesPageComponent","VideosPage","VideosPageComponent","BrandKitPage","BrandKitPageComponent","LibraryPage","renderHelpPopup","popupId","HelpPopupInline","topic","LibraryPageComponent","useBatchMoveModalHook","WebsiteImagePanelPage","StockImagePanelPage","InvestImagePanelPage","InvestVideoPanelPage","AddVideoPanelPage","libraryRepository","stockImageRepository","sourceName","sourceNames","getLibraryAndStockImageRepository","_useMultiSourceAssets","useMultiSourceAssetsService","dataSourceNames","totalAssetCountBySource","getAssetCountBySource","totalLibraryAssetCount","totalStockAssetCount","withLibraryAndStockImagesService","SearchResultView","mediaRepository","MediaRepository","getSmartCroppings","getSmartCropSettingsFactory","EditImagePageComponent","MultiLineEllipsisText","EditDisplayTemplatePage","CreateDisplayTemplatePage","_useMemo4","_useBasicAssetsServic3","generateImagesByAI","useAIGeneratedImages","addStockImage","addAIGCImage","AIModelSource","Recraft","CSMLAssetSource","AIGeneratedByRecraft","AIGenerated","withAIGCStockService","renderHelpButton","HelpButton","GenerateImagePageComponent","UploadFilesPanel","UploadFolderPanel","MixedImagePanel","MixedVideoPanel","AssetDetailsPageComponent","BackgroundRemovalModalComponent","AppRoutes","withGenerateImageContext","withCcJsDataContextProvider","withAdStudioNavigation","withAssetTaskStatusPoller","Routes","ROOT_ROUTE","history","search","isXandrIntEnabled","XandrIntegrationEnabled","account","useJsData","jsData","Account","find","isXandrIntegrationEnabled","isValidXandrAccount","forceToReloadRef","forceToReload","rootRoute","localNavigation","useLocalNavigation","gotoCampaignUIPage","openInNewTab","subpath","_ref3$redirect","redirect","_ref3$reload","reload","_ref3$removeSearchQue","removeSearchQuery","currentSearch","getSearchQuery","gotoSearchResultPage","_ref4$redirect","_ref4$reload","_ref4$query","additionalQueries","AdditionalQueries","Query","gotoPerformancePage","_ref5$redirect","_ref5$reload","gotoImagesPage","_ref6$redirect","_ref6$reload","_ref6$removeSearchQue","gotoVideosPage","_ref7$redirect","_ref7$reload","gotoLibraryPage","_ref8$redirect","_ref8$reload","gotoEditImagePage","editImageUrl","_ref9$redirect","_ref9$reload","_ref9$initialCurrentV","initialCurrentView","EditImageUrl","InitialCurrentView","gotoEditDisplayImagePage","templateId","_ref10$redirect","_ref10$reload","TemplateId","getTopView","popLocalView","gotoWebsiteImagePanelPage","pushLocalView","AdsStudioPageName","gotoStockImagePanelPage","gotoInvestImagePanelPage","gotoInvestVideoPanelPage","gotoAIGenerationPanelPage","_ref12$redirect","_ref12$reload","gotoDisplayTemplatesCreationPage","templateGroupId","TemplateGroupId","gotoDisplayTemplatesPage","_ref14$removeSearchQu","gotoVideoTemplatePage","_ref15$redirect","_ref15$reload","gotoCreateVideoPage","_ref16$redirect","_ref16$reload","gotoEditVideoPage","_ref17$redirect","_ref17$reload","gotoAddVideoPanelPage","gotoUploadFilesPanelPage","gotoUploadFolderPanelPage","gotoMixedImagePanelPage","gotoMixedVideoPanelPage","gotoAssetDetails","gotoBackgroundRemovalModal","updateAssetDetailsParams","oldParams","getViewParams","newParams","oldParamsStr","newParamsStr","setViewParams","gotoAdsPageWithFilter","filterProperty","filterValue","$contains","savingPromise","CampaignType","timeoutPromise","gotoAdsPageWithAssetIdFilter","pathname","useNavigation","pageProps","renderSearchResultPage","renderPerformancePage","renderHomePage","renderImagesPage","renderDisplayTemplatesPage","renderVideosPage","renderVideoTemplatesPage","renderEditVideoPage","renderCreateVideoPage","renderBrandKitPage","renderLibraryPage","renderGenerateImagePage","renderEditImagePage","renderCreateDisplayTemplatePage","renderEditDisplayTemplatePage","_Fragment","Switch","Route","path","isAdsStudioAIGCMVPEnabled","isAIGCRegionRestricted","LocalNavigationRoute","viewName","getAppRoutes","AdsStudioAppShellCMUI","adsstudioAppShellCMUIProps","propsAdapter","useRouteMatch","_props","scope","values","setIsAIGCRegionRestricted","isCopilotRegionRestricted","feature","isRestricted","removeAdStudioSurveyTriggerFlag","AdStudioSurveyTriggerFlag","App","isAllUploadFlowImageUpscaleEnabled","isReadonly","IsReadOnlyUser","_useAdFilter","loggerWithoutPageInfo","moreProps","isUploadImageUpscaleEnabled","useTheme","customComponentStyles","AdsStudioLandingPageComponent","Scenario","Activity","LocalNavigationProvider","AdsStudioThemeProvider","ComponentStylesProvider","componentStyles","CampaignFetchProvider","DataProvider","changeLayout","SummaryFooterWrapper","withTrack","SummaryFooter","getPathNamePrefix","isMCC","usePrevious","InContextCardBase","guid","setInContextRecommendationContent","deps","currentActivity","adDisplayUrlService","newI18n","campaignType","filterService","channel","hideCard","applyAllCallback","campaignAdGroups","haveEnoughSpace","overallOptimizationScoreBar","scopeService","ScopeContext","dataFiltered","setIndex","_useState4","direction","setDirection","_useState5","_useState6","isAsyncApplyModalOpen","setIsAsyncApplyModalOpen","_useState7","_useState8","isApplyConfirmModalOpen","setIsApplyConfirmModalOpen","_useState9","_useState10","recommendationCount","setRecommendationCount","_useState11","_useState12","pollTask","setPollTask","_useState13","_useState14","onApplyConfirm","setOnApplyConfirm","_useState15","_useState16","onApplyReject","setOnApplyReject","readOnly","isReadOnly","shouldRenderInContextRecommendationCard","cardContext","Level","levelAt","Category","CampaignIds","AdGroupIds","adGroupId","logOpportunityEvent","_ref$type","_ref$context","context","ADINSIGHT_LOG_API_NAME","INCONTEXTCARD","typeId","RECOMMENDATION_IDS","previousIndex","previousType","ADINSIGHT_LOG_ACTION_TYPE","IMPRESSION","showAsyncApplyModal","poll","closeAsyncApplyModal","stop","showApplyConfirmModal","onApply","countRecommendation","_ref2$onReject","onReject","closeApplyConfirmModal","confirmApplyConfirmModal","rejectApplyConfirmModal","handleSelect","selectedIndex","handleDownload","DOWNLOAD","Version","DownloadScope","DOWNLOAD_SCOPE","INDIVIDUAL","renderPitch","pitching","TooltipHost","directionalHint","DirectionalHint","rightCenter","calloutProps","calloutMaxWidth","tooTip","renderPagination","carouselIndex","curlyTemplate","pageNumber","pageCount","renderPrevIcon","Glyphicon","glyph","renderNextIcon","viewDetails","set","recsrc","viewHistory","getAutoApplyToolTipText","recommendationName","carousel","Carousel","activeIndex","onSelect","controls","indicators","prevIcon","nextIcon","showPrevNextControls","recommendation","getSummaryCardModel","currency","AccountCurrencyCode","combineText","headerMenuItems","NOT_SUPPORT_DOWNLOAD_TYPES","func","HIDE","isOptimizationScoreOn","showAutoApply","AUTO_APPLY_TYPES","SUPPORT_ADINSIGHT_AUTO_APPLY_TYPES","isAutoApplyOptIn","Item","SummaryHeader","summary","autoApplyToolTipText","inContextCard","customerId","accountId","showIntermediateView","optimizationScore","cardContent","callback","op","isFromApplyOrDismiss","userAction","APPLY_ACTION_TYPES","UNDISMISS","ACCEPT","ApplyFormModal","isDone","carouselContainer","generateGuid","InContextCard","withGetSummary","withDefaultStyles","_ref$palette","white","extend","assign","getApplyFormStyles","getFeedbackModalStyles","flexShrink","borderBottom","getHeaderStyles","getIconStyles","paddingRight","textShadow","background","border","color","right","left","flexDirection","justifyContent","RecommendationModal","_React$PureComponent","ReactModal","body","_this$props","this","isOpen","closeOnOverlayClick","onRequestClose","shouldCloseOnOverlayClick","overlayClassName","ConfirmForm","_len","Array","_key","onConfirm","extraAction","title","confirmString","cancelString","ConfirmFormModal","AsyncApplyForm","routeApplyHistory","runInBackground","applyHistoryLink","AsyncApplyFormModal","AsyncBulkAarConfirmForm","loading","_ref$iconFontFamily","iconFontFamily","outline","transform","borderRadius","fontStyle","fontFamily","black","borderColor","gridTemplateColumns","gridTemplateRows","alignItems","gridColumn","justifySelf","whiteSpace","textOverflow","boxSizing","listStyle","textAlign","textDecoration","flatten","entities","isCustomer","unAuthorized","withRecommendationServices","currentScenario","HoC","_props$deps","cacheManager","errI18n","customerService","ClientCenterCustomerService","ccBaseUrl","accountIdsPromise","AccountIdListCache","getRecommendationCache","getCustomerHierarchy","uid","userId","returnOnlyDirectlyLinkedEntities","limit","MCC_ACCOUNTS_CAPPING","customerHierarchyEntities","flattenedAccounts","setRecommendationCache","urlUtil","downloadService","RecommendationService","showAlertHandler","oldAlertCenterAdapter","bind","CultureLcid","ccJsData","asyncScheduler","alertCenter","vnextDeps","RecommendationDownloadService","recommendationService","module","exports","locals","pug_html","ItemLayout","constructor","columnCount","columnWidth","columnPadding","rowPadding","itemBox","columnHeights","itemPositions","from","x","getItemPosition","positionChecked","getBox","i","setItemPosition","itemHeight","itemWidth","minIndex","minHeightColumn","nextColumnHeights","targetItemHeight","checked","updateLayout","placeItems","lastUpdateIndex","getMaxHeight","heights","setItemCount","smallest","ItemBox","itemBoxes","setBox","ItemMeasurer","itemBoxChanged","renderItem","gridMode","itemRef","setItemRef","_index","cancel","canceled","box","getBoundingClientRect","oldHeight","oldWidth","updateViewPort","debounce","entries","borderBoxSize","blockSize","inlineSize","resizeObserver","ResizeObserver","observe","unobserve","disconnect","WrappedItem","rowHeight","itemLayout","minItemHeight","tabIndex","ariaLabel","itemPosition","largerThanMinItemHeight","ListItem","writingMode","visibility","onAction","event","GridInternal","scrollTop","windowRect","isItemBoxChanged","visibleItems","isVisible","itemTop","itemBottom","windowHeight","bufferHeight","topBorder","forceRender","List","navigationMode","Grid","columnWidthProp","rowHeightProp","scrollContainer","maxColumns","topDiv","setTopDiv","topDivRect","setTopDivRect","clientHeight","clientWidth","setColumnCount","setItemBoxChanged","isItemLengthChanged","setItemLengthChanged","setOffset","useLayoutEffect","newOffset","offsetTop","offsetParent","useTopDivMetaData","wrappedScrollContainer","setScrollTop","update","setUpdate","scrollY","scrollHandler","windowScrollHandler","element","useScroll","getSize","documentElement","setWindowRect","updateSize","useWindow","itemLengthChanged","updateTopDivRect","calculatedColumnWidth","availableColumn","extendedColumnWidth","calculatedRowHeight","columnWithPadding","floor","min","targetColumnWidth","indexedItems","ComponentStylesContext","Provider","useComponentStylesContext","componentName","useNoBaseStyles","withOverridableStyles","useBaseStyles","HOC","overridenClasses","defaultClasses","baseClass","finalBaseClassName","finalClasses","componentDisplayName","LocalNavigationContext","localViewStackRef","activeElementRef","updated","setUpdated","activeElement","HTMLElement","topView","viewIndex","isTopView","localRouteUpdated","ToggleButtons","optionsState","toggleSelectedOption","selectedButtonClasses","selectedButton","initialClasses","toggleButton","option","ToggleButton","icon","useStyles","inlineChart","getColor","metricName","lineChartData","isArray","MetricName","PrimaryDataPoints","ComparisonDataPoints","lineData","legend","DateTime","Value","y","lineOptions","strokeWidth","comparisonData","legendShape","strokeDasharray","strokeDashoffset","strokeLinecap","chartData","chartTitle","LineChart","legendsOverflowText","allowMultipleShapesForPoints","HistoryListImages","onKeyDown","historyList","src","alt","DataContext","dataPromise","setDataPromise","setData"],"sourceRoot":""}