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ACF,GAAID,EAAME,KAAM,CACrB,IAAMC,EAAUH,EAAME,KACtB,SAASE,EAAAA,EAAAA,MAAKD,GAAS,SAAA7N,GAAM,OAAIA,EAAO2N,wBAAwB,GAClE,CACF,CACA,OAAO,CACT,GAAC,CAAAtc,IAAA,SAAAC,MAqBD,WACE,OACEmB,EAAAA,EAAAA,KAACgX,GAAgB9V,EAAAA,EAAAA,IAAAA,EAAAA,EAAAA,GAAA,GACXsB,KAAKjB,OAAK,IACdqY,yBAA0BpX,KAAKoX,yBAC/BF,sBAAuBlX,KAAKkX,sBAC5BK,eAAgBvX,KAAKuX,iBAG3B,IAAC,CAxFgB,CAAS7V,EAAAA,eA2F5B,OAAOK,EAAAA,EAAAA,YAAU+W,EAAAA,EAAAA,qBAAoB7B,GACvC,C","sources":["../../tree-menu/src/styles/icon-class-name-map.js","../../tree-menu/src/utils/router-utility.js","../../tree-menu/src/utils/node-renderer.js","../../tree-menu/src/tree-menu.js","../../tree-menu/src/styles/tree-view-styles.js","../../update-date-range/src/update-date-range.js","../../url-filter/src/index.js","../../version-check/src/index.js","../../webview-context/src/schema-validation.js","../../webview-context/src/instrumentation-schema.js","../../webview-context/src/use-messaging-channel.js","../../webview-context/src/webview-context-provider.js","../../with-campaign-legacy/index.js","../../with-default-landing-page/src/with-default-landing-page.js","../../with-last-url/src/smart-last-url.js","../../with-last-url/src/with-last-url.js","../../with-opportunity-id/src/with-opportunity-id.js"],"sourcesContent":["export const getIconsClassNameMap = classes => ({\r\n expanded: `${classes.nodeIcon} iconba iconba-ChevronDownSmall`,\r\n collapsed: `${classes.nodeIcon} iconba iconba-ChevronRightSmall`,\r\n});\r\n","import _ from 'underscore';\r\n\r\nexport class RouterUtility {\r\n static isActive(node) {\r\n return !!(node.selected && !_.findWhere(node.children, { selected: true }));\r\n }\r\n}\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\nimport { Link as RouterLink } from '@bingads-webui-campaign-react/router';\r\nimport { ExpandableNode, Renderer } from '@bingads-webui-react/tree-view';\r\nimport { getRoutePathById } from '@bingads-webui-campaign-react/with-site-map';\r\nimport { RouterUtility } from './router-utility';\r\n\r\nexport function NodeRenderer(classes, scope, sitemap, shouldRenderParentNodeAsLink) {\r\n const isActiveNode = node => RouterUtility.isActive(node);\r\n const isParentNode = node => node.children && node.children.length !== 0;\r\n const shouldRenderDiv = node => (shouldRenderParentNodeAsLink ? (!!node.noNavigation) : isParentNode(node));\r\n const queryString = scope.stringify();\r\n\r\n const renderLinkOrDiv = (node, args) => {\r\n if (shouldRenderDiv(node)) {\r\n return (\r\n
\r\n {node.name}\r\n
\r\n );\r\n }\r\n\r\n return (\r\n isActiveNode(node) ?\r\n \r\n {node.name}\r\n \r\n :\r\n \r\n {args.nodeChildRenderer(node)}\r\n \r\n );\r\n };\r\n\r\n return (node, args) => (\r\n \r\n \r\n {isActiveNode(node) &&
}\r\n {\r\n renderLinkOrDiv(node, args)\r\n }\r\n \r\n
\r\n );\r\n}\r\n\r\nNodeRenderer.propTypes = Renderer;\r\n","import React from 'react';\r\nimport _ from 'underscore';\r\nimport { withRouter } from '@bingads-webui-campaign-react/router';\r\nimport PropTypes from 'prop-types';\r\nimport { TreeView } from '@bingads-webui-react/tree-view';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { withScope, QueryParam } from '@bingads-webui-react/scope-service';\r\nimport { withI18nConsumer } from '@bingads-webui-react/i18n-context';\r\nimport { siteMapPropType } from '@bingads-webui-campaign-react/with-site-map';\r\nimport { getTreeStyle } from './styles/tree-view-styles';\r\nimport { getIconsClassNameMap } from './styles/icon-class-name-map';\r\nimport { NodeRenderer } from './utils/node-renderer';\r\nimport { RouterUtility } from './utils/router-utility';\r\n\r\nclass TreeMenu extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n nodes: props.siteMap,\r\n };\r\n this.RouterNode = NodeRenderer(props.classes, props.scope, props.siteMap, props.shouldRenderParentNodeAsLink);\r\n }\r\n\r\n static getDerivedStateFromProps(nextProps, prevState) {\r\n const flattenedStatefulMap = {};\r\n\r\n function flattenPreviousNodes(siteMap) {\r\n _.forEach(siteMap, (node) => {\r\n flattenedStatefulMap[node.id] = node;\r\n if (node.children) {\r\n flattenPreviousNodes(node.children);\r\n }\r\n });\r\n }\r\n function mergeNodeState(siteMap) {\r\n return _.map(siteMap, (node) => {\r\n const previousMatch = flattenedStatefulMap[node.id];\r\n const output = _.clone(node);\r\n if (previousMatch && previousMatch.state) {\r\n output.state = previousMatch.state;\r\n }\r\n if (output.children) {\r\n output.children = mergeNodeState(output.children);\r\n }\r\n output.name = nextProps.i18n.getString(output.name);\r\n if (output.title) {\r\n output.title = nextProps.i18n.getString(output.title);\r\n }\r\n return output;\r\n });\r\n }\r\n flattenPreviousNodes(prevState.nodes);\r\n\r\n return {\r\n nodes: mergeNodeState(nextProps.siteMap),\r\n };\r\n }\r\n\r\n onChange = (nodes) => {\r\n this.setState({ nodes });\r\n };\r\n\r\n getClassNames = node => [`${this.props.classes.nodeStyle} hyperlink-node-${node.id}`];\r\n\r\n expandSelectedParentNodes(node) {\r\n const childMatch =\r\n _.isArray(node.children) ?\r\n !!_.find(\r\n node.children,\r\n childNode => this.expandSelectedParentNodes(childNode)\r\n ) :\r\n false;\r\n\r\n if (childMatch) {\r\n const updatedNode = node;\r\n updatedNode.state = node.state ?\r\n _.extend(node.state, { expanded: true }) :\r\n { expanded: true };\r\n return true;\r\n }\r\n\r\n return node.route ? RouterUtility.isActive(node) : false;\r\n }\r\n\r\n render() {\r\n const { nodes } = this.state;\r\n const {\r\n classes, scope, siteMap, shouldRenderParentNodeAsLink, expandIconAriaLabel, i18n,\r\n } = this.props;\r\n const RouterNode = NodeRenderer(classes, scope, siteMap, shouldRenderParentNodeAsLink);\r\n\r\n if (this.currentPath !== this.props.location.pathname) {\r\n this.currentPath = this.props.location.pathname;\r\n _.each(nodes, node => (this.expandSelectedParentNodes(node)));\r\n }\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nTreeMenu.propTypes = {\r\n classes: PropTypes.objectOf(PropTypes.string).isRequired,\r\n location: PropTypes.shape({\r\n pathname: PropTypes.string,\r\n }).isRequired,\r\n siteMap: siteMapPropType.isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n scope: PropTypes.instanceOf(QueryParam).isRequired,\r\n shouldRenderParentNodeAsLink: PropTypes.bool,\r\n expandIconAriaLabel: PropTypes.string,\r\n};\r\n\r\nTreeMenu.defaultProps = {\r\n shouldRenderParentNodeAsLink: false,\r\n expandIconAriaLabel: undefined,\r\n};\r\n\r\nexport const StyledTreeMenu = withI18nConsumer(withScope(withRouter(withDefaultStyles(TreeMenu, getTreeStyle))));\r\n","export const getTreeStyle = (treeMenu, { palette = {} }) => ({\r\n placeholder: {\r\n display: 'inline-block',\r\n height: '1em',\r\n width: '200px',\r\n backgroundColor: '#DDD',\r\n marginLeft: '20px',\r\n },\r\n nodeIcon: {\r\n display: 'inline-block',\r\n verticalAlign: 'top',\r\n height: 12,\r\n width: 12,\r\n padding: 8,\r\n fontSize: '11px',\r\n cursor: 'pointer',\r\n },\r\n runningIcon: {\r\n display: 'inline-block',\r\n margin: '0px 0px 0px 3px',\r\n fontSize: '11px',\r\n },\r\n nodeStyle: {\r\n display: 'inline-block',\r\n whiteSpace: 'nowrap',\r\n height: 36,\r\n width: 164,\r\n cursor: 'pointer',\r\n '&:focus': {\r\n outlineOffset: -1,\r\n outline: `1px solid ${palette.neutralSecondary}`,\r\n },\r\n },\r\n nodeNonActive: {\r\n '&:hover': {\r\n backgroundColor: palette.neutralLight,\r\n textDecoration: 'none',\r\n color: palette.themePrimary,\r\n },\r\n },\r\n nodeActive: {\r\n backgroundColor: palette.themeLighter,\r\n '&:hover': {\r\n backgroundColor: `${palette.themeLight} !important`,\r\n textDecoration: 'none',\r\n color: palette.themePrimary,\r\n },\r\n },\r\n nodeHyperlink: {\r\n width: '100%',\r\n display: 'inline-block',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n maxWidth: '100%',\r\n whiteSpace: 'nowrap',\r\n textDecoration: 'none',\r\n verticalAlign: 'top',\r\n color: 'black',\r\n padding: 8,\r\n fontSize: '14px',\r\n '&:hover': {\r\n color: 'black',\r\n textDecoration: 'none',\r\n },\r\n },\r\n nodeHyperLinkParent: {\r\n\r\n },\r\n nodeHyperLinkNonParent: {\r\n marginLeft: 15,\r\n },\r\n nodeHyperlinkActive: {\r\n fontWeight: '600',\r\n },\r\n treeViewContainer: {\r\n fontFamily: 'Arial,sans-serif',\r\n fontSize: '12px',\r\n lineHeight: '14px',\r\n flex: '1 1 auto',\r\n height: '100%',\r\n backgroundColor: palette.neutralLighter,\r\n '& .ReactVirtualized__Grid': {\r\n '&:focus': {\r\n outline: 'none',\r\n },\r\n },\r\n },\r\n beforeIcon: {\r\n borderLeft: `4px solid ${palette.themePrimary}`,\r\n padding: 0,\r\n marginRight: -4,\r\n alignSelf: 'stretch',\r\n height: '100%',\r\n float: 'left',\r\n },\r\n});\r\n\r\n","import _ from 'underscore';\r\nimport { WaterfallFilterStorage, WaterfallFilterType, waterfallDateFilterProcessor } from '@bingads-webui-campaign/filter-storage';\r\nimport { getCivilDateToday, compareCivilDate, DefaultSpecificRanges, ComparedOptions,\r\n generateDateData, getRangesFromData, translateLegacyToIANATimezone, RANGES } from '@bingads-webui-universal/temporal-utitlities';\r\nimport { getNthPeriodWithRangeType, getRangeIndexWithDefaultType } from '@bingads-webui-react/quick-date-left-right-picker';\r\nimport state from '@bingads-webui-component-legacy/state/index';\r\nimport { I18nModel } from '@bingads-webui-universal/i18n-model';\r\nimport { stringifySync } from '@bingads-webui/safe-json';\r\n\r\nfunction log(appActivity, msg) {\r\n try {\r\n appActivity.trace(msg, 'updateDateRange');\r\n } catch (e) {\r\n // Do nothing, this logging is not critical.\r\n }\r\n}\r\n\r\nfunction patchLegacyState(waterfallFilterStorage, serverContext, preferenceService) {\r\n // this part also exists in init-legacy-components.js, move to here to execute it earlier to let earlier operation to use the new date range\r\n if (!state.attributes.$daterange) {\r\n Object.defineProperty(state.attributes, '$daterange', {\r\n get: () => {\r\n if (_.isUndefined(waterfallFilterStorage)) {\r\n // eslint-disable-next-line no-param-reassign\r\n waterfallFilterStorage = new WaterfallFilterStorage({\r\n preferenceService,\r\n });\r\n }\r\n const dateRange = waterfallDateFilterProcessor(\r\n waterfallFilterStorage.getFilters([WaterfallFilterType.DateFilter]),\r\n serverContext\r\n );\r\n return _.extend({\r\n formatedEnd: dateRange.RangeEndDate,\r\n formatedStart: dateRange.RangeStartDate,\r\n }, dateRange);\r\n },\r\n });\r\n }\r\n}\r\n\r\nexport function updateDateRange(preferenceService, serverContext, appActivity) {\r\n const waterfallFilterStorage = new WaterfallFilterStorage({ preferenceService });\r\n const dateFilter = waterfallDateFilterProcessor(\r\n waterfallFilterStorage.getFilters([WaterfallFilterType.DateFilter]),\r\n serverContext\r\n );\r\n patchLegacyState(waterfallFilterStorage, serverContext, preferenceService);\r\n const {\r\n CurrentUser: {\r\n CultureDateTimeFormat: {\r\n ShortDatePattern,\r\n },\r\n LocaleID,\r\n },\r\n CurrentAccount: {\r\n TimeZone,\r\n },\r\n } = serverContext;\r\n\r\n const isImprovedDateRangePickerEnabled = serverContext.DynamicPermissions && serverContext.DynamicPermissions.ImprovedDateFilter;\r\n\r\n const i18nFormat = new I18nModel({\r\n loadTranslationData: (/* locale */) => ({}),\r\n loadCLDRData: currentLocale => currentLocale,\r\n failFast: true,\r\n });\r\n\r\n log(appActivity, `dateFilter: ${JSON.stringify(dateFilter)}`);\r\n if (!dateFilter || dateFilter.Rangelcid !== LocaleID\r\n || !dateFilter.start || !dateFilter.end || !dateFilter.RangeEndDate || !dateFilter.RangeStartDate\r\n || (dateFilter.compared && (!dateFilter.compared.start || !dateFilter.compared.end ||\r\n !dateFilter.compared.formattedStart || !dateFilter.compared.formattedEnd))) {\r\n // if the date filter is invalid, fallback to yesterday\r\n const yesterday = getCivilDateToday().plus({ days: -1 });\r\n const fallbackDate = `${i18nFormat.formatCivilDate(yesterday, { raw: ShortDatePattern })}`;\r\n\r\n log(appActivity, `Fallback to yesterday. dateFilter: ${JSON.stringify(dateFilter)}`);\r\n\r\n waterfallFilterStorage.save(WaterfallFilterType.DateFilter, {\r\n RangeStartDate: fallbackDate,\r\n RangeEndDate: fallbackDate,\r\n RangeId: RANGES.Yesterday,\r\n Rangelcid: LocaleID,\r\n compared: null,\r\n RangeIndex: getRangeIndexWithDefaultType({ rangeId: RANGES.Yesterday }),\r\n });\r\n } else if (dateFilter.RangeId !== RANGES.Custom) {\r\n // if the date filter is valid and not custom, update the date filter\r\n const timeZone = translateLegacyToIANATimezone(TimeZone);\r\n const specificRanges = DefaultSpecificRanges(i18nFormat, timeZone);\r\n const { selectedRange, selectedComparedRange } = getRangesFromData(i18nFormat, dateFilter, ShortDatePattern, dateFilter.Rangelcid);\r\n let newSelectedRange = null;\r\n let RangeIndex = dateFilter.RangeIndex || getRangeIndexWithDefaultType({ rangeId: dateFilter.RangeId });\r\n const { RangeDays } = dateFilter;\r\n\r\n if (isImprovedDateRangePickerEnabled && dateFilter.RangeIndex) {\r\n const EntireTime = _.find(specificRanges, range => range.rangeId === RANGES.EntireTime);\r\n const rangeWithIndex = getNthPeriodWithRangeType({ rangeId: dateFilter.RangeId }, RangeIndex, EntireTime.range.start, EntireTime.range.end, RangeDays);\r\n const { rangeIndex: cRangeIndex, range } = rangeWithIndex;\r\n RangeIndex = cRangeIndex;\r\n newSelectedRange = range;\r\n log(appActivity, `UseNthDate - newSelectedRange: ${stringifySync(newSelectedRange)}, RangeIndex: ${cRangeIndex}, EntireTime: ${stringifySync(EntireTime)}`);\r\n } else {\r\n const selectedSpecificRange = _.find(specificRanges, range => range.rangeId === dateFilter.RangeId);\r\n newSelectedRange = selectedSpecificRange ? selectedSpecificRange.range : selectedRange;\r\n log(appActivity, `UseNormalDate - newSelectedRange: ${stringifySync(newSelectedRange)}`);\r\n }\r\n\r\n if (!selectedRange.start || !selectedRange.end) {\r\n const today = getCivilDateToday();\r\n\r\n log(appActivity, 'Formatted date invalid fallback to today');\r\n selectedRange.start = today;\r\n selectedRange.end = today;\r\n }\r\n\r\n if (compareCivilDate(selectedRange.start, newSelectedRange.start) === 0 &&\r\n compareCivilDate(selectedRange.end, newSelectedRange.end) === 0) {\r\n log(appActivity, 'No change. Use the same date range');\r\n return;\r\n }\r\n\r\n // To update the date range, we also need to update the compared range and check if the compared range is valid\r\n let newSelectedComparedRange = null;\r\n let comparedOption = null;\r\n if (dateFilter && dateFilter.compared) {\r\n comparedOption =\r\n _.find(ComparedOptions, option => option.keyToExport === dateFilter.compared.key);\r\n newSelectedComparedRange = comparedOption && comparedOption.keyToExport !== 'customPeriod' ?\r\n comparedOption.get(newSelectedRange, dateFilter.RangeId) : selectedComparedRange;\r\n }\r\n\r\n const data = generateDateData(\r\n i18nFormat,\r\n {\r\n selectedRange: newSelectedRange,\r\n selectedComparedRange: newSelectedComparedRange,\r\n comparedOption,\r\n rangeType: { rangeId: dateFilter.RangeId },\r\n rangeIndex: RangeIndex,\r\n rangeDays: RangeDays,\r\n },\r\n ShortDatePattern,\r\n dateFilter.Rangelcid,\r\n timeZone\r\n );\r\n\r\n log(appActivity, `DateFilter: ${JSON.stringify(dateFilter)}. Change: ${JSON.stringify(selectedRange)} -> ${stringifySync(newSelectedRange)}`);\r\n waterfallFilterStorage.save(WaterfallFilterType.DateFilter, data);\r\n } else {\r\n const { selectedRange, selectedComparedRange } = getRangesFromData(i18nFormat, dateFilter, ShortDatePattern, dateFilter.Rangelcid);\r\n\r\n if (!selectedRange.start || !selectedRange.end ||\r\n (!selectedComparedRange.start && selectedComparedRange.end) || (selectedComparedRange.start && !selectedComparedRange.end)) {\r\n const yesterday = getCivilDateToday().plus({ days: -1 });\r\n const fallbackDate = `${i18nFormat.formatCivilDate(yesterday, { raw: ShortDatePattern })}`;\r\n\r\n log(appActivity, `Fallback to yesterday for custom dateFilter: ${JSON.stringify(dateFilter)}. Change: ${JSON.stringify(selectedRange)}`);\r\n\r\n waterfallFilterStorage.save(WaterfallFilterType.DateFilter, {\r\n RangeStartDate: fallbackDate,\r\n RangeEndDate: fallbackDate,\r\n RangeId: RANGES.Yesterday,\r\n Rangelcid: LocaleID,\r\n compared: null,\r\n RangeIndex: getRangeIndexWithDefaultType({ rangeId: RANGES.Yesterday }),\r\n });\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withGlobalFilter } from '@bingads-webui-campaign-react/global-filter-context';\r\nimport { withI18nConsumer } from '@bingads-webui-react/i18n-context';\r\nimport { QueryParam, withScope } from '@bingads-webui-react/scope-service';\r\nimport { withSiteMap, findSiteMap } from '@bingads-webui-campaign-react/with-site-map';\r\nimport { featureIdToFilterAlias, sitemapIdToFeatureName, featureNameToUrlFilter, allowedUrlFilterKeys } from '@bingads-webui-campaign/url-filter-metadata';\r\n\r\nclass URLFilterInternal extends React.PureComponent {\r\n componentDidMount() {\r\n this.checkUrlFilter();\r\n }\r\n\r\n componentDidUpdate() {\r\n this.checkUrlFilter();\r\n }\r\n\r\n onUrlFilterChange = (filterExpressions, featureName) => {\r\n this.props.updateUrlFilter({\r\n filterType: featureNameToUrlFilter[featureName],\r\n filter: filterExpressions,\r\n });\r\n }\r\n\r\n getFilterExpressionsFromFilterAlias = (filterAlias, filterArguments) => {\r\n let formatAlias = filterAlias;\r\n\r\n if (_.isFunction(filterAlias)) {\r\n formatAlias = filterArguments ? filterAlias(filterArguments, this.props.i18n, this.props.permissions) : filterAlias(this.props.i18n, this.props.permissions);\r\n }\r\n\r\n if (_.isObject(formatAlias)) {\r\n return JSON.stringify(formatAlias);\r\n }\r\n\r\n return formatAlias;\r\n }\r\n\r\n checkUrlFilter = () => {\r\n const { scope, siteMap } = this.props;\r\n const { values, location } = scope;\r\n const currentRoute = location.pathname.replace('/campaign/vnext/', '');\r\n // find the child router feature id\r\n const currentSiteMap = this.props.findSiteMap(siteMap, s => s.route === currentRoute && (!s.children || s.children.length === 0));\r\n const siteMapId = currentSiteMap ? currentSiteMap.id : null;\r\n const filterKeys = _.intersection(_.keys(values), allowedUrlFilterKeys);\r\n const supportFeatureNames = siteMapId && sitemapIdToFeatureName[siteMapId];\r\n\r\n if (_.isEmpty(filterKeys) || !supportFeatureNames) {\r\n return;\r\n }\r\n\r\n _.each(supportFeatureNames, (featureName) => {\r\n const allowedFilterAlias = featureIdToFilterAlias[featureName];\r\n let filterExpressions = '';\r\n if (_.indexOf(filterKeys, 'filterAlias') !== -1 && allowedFilterAlias) {\r\n const { filterAlias, filterArguments = '' } = values;\r\n filterExpressions = allowedFilterAlias[filterAlias] ?\r\n this.getFilterExpressionsFromFilterAlias(allowedFilterAlias[filterAlias], filterArguments) :\r\n '';\r\n } else if (_.indexOf(filterKeys, 'filterExpressions') !== -1) {\r\n // eslint-disable-next-line prefer-destructuring\r\n filterExpressions = values.filterExpressions;\r\n }\r\n\r\n if (filterExpressions) {\r\n this.onUrlFilterChange(filterExpressions, featureName);\r\n }\r\n });\r\n }\r\n\r\n render() {\r\n return null;\r\n }\r\n}\r\n\r\nURLFilterInternal.defaultProps = {\r\n findSiteMap,\r\n};\r\n\r\nURLFilterInternal.propTypes = {\r\n scope: PropTypes.instanceOf(QueryParam).isRequired,\r\n siteMap: PropTypes.arrayOf(PropTypes.shape({\r\n name: PropTypes.string.isRequired,\r\n })).isRequired,\r\n updateUrlFilter: PropTypes.func.isRequired,\r\n findSiteMap: PropTypes.func,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.object,\r\n }).isRequired,\r\n};\r\n\r\nexport const URLFilter = withSiteMap(withScope(withGlobalFilter(withI18nConsumer(URLFilterInternal))));\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { http } from '@bingads-webui/http-util';\r\nimport { versionStore, scopeStore } from '@bingads-webui-campaign/global-context-store';\r\nimport eventDispatcher from '@bingads-webui-component-legacy/event-dispatcher/index';\r\n\r\nexport class VersionCheck {\r\n /**\r\n * initialize Version Check Class\r\n * @param {object} [deps] - provide dep injection for version check\r\n * @returns {void}\r\n */\r\n constructor({\r\n deps = {\r\n httpUtil: http,\r\n },\r\n version = '',\r\n }) {\r\n this.version = version;\r\n this.deps = deps;\r\n this.task = null;\r\n this.checkFrequency = 5 * 1000 * 60;\r\n }\r\n\r\n checkVersion() {\r\n const {\r\n aid,\r\n cid,\r\n uid,\r\n } = _.chain(scopeStore.state).result('scope').result('values', {}).value();\r\n this.url = `/campaign/API/Updates/get?__adcenterAJAX=true&aid=${aid}&cid=${cid}&uid=${uid}`;\r\n\r\n return this.deps.httpUtil.get(this.url).then(data =>\r\n _.chain(data).result('Messages').result('Version', '').value()).catch(() => this.version).then((version) => {\r\n if (this.version !== version) {\r\n this.version = version;\r\n versionStore.setState({ newVersion: version });\r\n eventDispatcher.trigger('new-version-available');\r\n }\r\n });\r\n }\r\n\r\n start() {\r\n this.stop();\r\n this.task = setInterval(() => {\r\n try {\r\n this.checkVersion();\r\n // eslint-disable-next-line no-empty\r\n } catch (e) {}\r\n }, this.checkFrequency);\r\n\r\n $(window).on('unload', () => this.stop());\r\n }\r\n\r\n stop() {\r\n if (this.task !== null) {\r\n clearInterval(this.task);\r\n this.task = null;\r\n }\r\n }\r\n}\r\n\r\nexport const versionCheckInstance = new VersionCheck({});\r\n","import Ajv from 'ajv';\r\n\r\nexport const WebViewMessageType = {\r\n onLoaded: 'onLoaded',\r\n onError: 'onError',\r\n onGlobalFilterDateChange: 'onGlobalFilterDateChange',\r\n};\r\n\r\nconst outgoingMessage = {\r\n type: 'object',\r\n properties: {\r\n messageType: {\r\n enum: [WebViewMessageType.onLoaded, WebViewMessageType.onError],\r\n },\r\n data: { type: ['object', 'string', 'null'] },\r\n },\r\n required: ['messageType'],\r\n};\r\n\r\nconst incomingMessage = {\r\n type: 'object',\r\n properties: {\r\n messageType: {\r\n type: 'string',\r\n enum: [WebViewMessageType.onGlobalFilterDateChange],\r\n },\r\n data: {\r\n type: ['object'],\r\n required: ['RangeStartDate', 'RangeEndDate', 'RangeId'],\r\n properties: {\r\n RangeStartDate: { type: 'string' },\r\n RangeEndDate: { type: 'string' },\r\n RangeId: { type: 'number' },\r\n },\r\n additionalProperties: true,\r\n },\r\n },\r\n required: ['messageType'],\r\n};\r\n\r\nexport function getValidators() {\r\n const ajv = new Ajv({ allErrors: true, strict: false });\r\n\r\n const validateOutgoingMessage = ajv.compile(outgoingMessage);\r\n const validateIncomingMessage = ajv.compile(incomingMessage);\r\n\r\n return { validateOutgoingMessage, validateIncomingMessage };\r\n}\r\n","export const instrumentationSchema = {\r\n scenario: [\r\n {\r\n name: 'webView',\r\n value: 'webView',\r\n activity: [\r\n {\r\n name: 'message',\r\n value: 'message',\r\n },\r\n ],\r\n },\r\n ],\r\n};\r\n","import { useCallback, useEffect, useMemo, useRef } from 'react';\r\nimport { getValidators, WebViewMessageType } from './schema-validation';\r\n\r\nexport const useMessagingChannel = (activity) => {\r\n const eventListenersRef = useRef([]);\r\n const getHost = useCallback(() => window.ReactNativeWebView, []);\r\n\r\n const { validateIncomingMessage, validateOutgoingMessage } = useMemo(() => getValidators(), []);\r\n\r\n const postMessage = useCallback((payload) => {\r\n const messagePayload = JSON.stringify(payload);\r\n\r\n const host = getHost();\r\n if (!host) {\r\n activity.error('[error][postMessage] Host not found, cannot post message, aborting');\r\n return;\r\n }\r\n\r\n if (!validateOutgoingMessage(payload)) {\r\n activity.error('[error][postMessage] Invalid outgoing message, cannot process, aborting');\r\n return;\r\n }\r\n\r\n host.postMessage(messagePayload);\r\n }, [activity, getHost, validateOutgoingMessage]);\r\n\r\n const onMessage = useCallback((message) => {\r\n const { data: payload, origin } = message || {};\r\n\r\n activity.trace(`[trace][onMessage] Incoming message non-validated: ${JSON.stringify(payload)}`);\r\n\r\n if (origin !== window.location.origin) {\r\n activity.error('[error][onMessage] Invalid origin, cannot process, aborting');\r\n return;\r\n }\r\n\r\n if (payload === undefined || payload === null || payload === '') {\r\n activity.trace('[trace][onMessage] Incoming message payload is empty, cannot process, aborting');\r\n return;\r\n }\r\n\r\n if (!validateIncomingMessage(payload)) {\r\n activity.error('[error][onMessage] Invalid incoming message, cannot process, aborting');\r\n return;\r\n }\r\n\r\n eventListenersRef.current.forEach((listener) => {\r\n try {\r\n listener(payload);\r\n } catch (e) {\r\n activity.error(`[error][onMessage] Failed to handle incoming message: ${JSON.stringify(e.message)}`);\r\n }\r\n });\r\n\r\n activity.trace(`[trace][onMessage] Incoming message validated: ${JSON.stringify(payload)}`);\r\n }, [activity, validateIncomingMessage]);\r\n\r\n useEffect(() => {\r\n window.addEventListener('message', onMessage);\r\n return () => window.removeEventListener('message', onMessage);\r\n }, [onMessage]);\r\n\r\n useEffect(() => {\r\n postMessage({ messageType: WebViewMessageType.onLoaded, data: null });\r\n }, [postMessage]);\r\n\r\n const addEventListener = useCallback((listener) => {\r\n eventListenersRef.current.push(listener);\r\n return () => {\r\n eventListenersRef.current = eventListenersRef.current.filter(l => l !== listener);\r\n };\r\n }, []);\r\n\r\n return { addEventListener, getHost, postMessage };\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useEffect, useMemo, useContext, createContext, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { useGlobalFilterContext } from '@bingads-webui-react/global-filter-context';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { I18nModel } from '@bingads-webui-universal/i18n-model';\r\nimport { WaterfallFilterType } from '@bingads-webui-campaign/filter-storage';\r\nimport { generateDateData, translateLegacyToIANATimezone, parseCivilDate, getDaysOfARange } from '@bingads-webui-universal/temporal-utitlities';\r\nimport { WebViewMessageType } from './schema-validation';\r\nimport { instrumentationSchema } from './instrumentation-schema';\r\nimport { useMessagingChannel } from './use-messaging-channel';\r\n\r\nexport const WebViewContext = createContext();\r\n\r\nexport function useWebViewContext() {\r\n return useContext(WebViewContext);\r\n}\r\n\r\nexport const dateChangeListener = (i18n, serverContext, message, activity, updateWaterfallFilter, postMessage) => {\r\n if (message.messageType === WebViewMessageType.onGlobalFilterDateChange) {\r\n activity.trace(`[trace][onGlobalFilterDateChange] incoming message payload: ${JSON.stringify(message.data)}`);\r\n\r\n try {\r\n const selectedRange = {\r\n start: parseCivilDate({ i18n, dateString: message.data.RangeStartDate }),\r\n end: parseCivilDate({ i18n, dateString: message.data.RangeEndDate }),\r\n };\r\n const rangeDays = getDaysOfARange(selectedRange);\r\n const filterData = generateDateData(\r\n i18n,\r\n {\r\n selectedComparedRange: null,\r\n comparedOption: null,\r\n selectedRange,\r\n rangeType: {\r\n rangeId: message.data.RangeId,\r\n },\r\n rangeIndex: 0,\r\n rangeDays,\r\n },\r\n serverContext.CurrentUser.CultureDateTimeFormat.ShortDatePattern,\r\n serverContext.CurrentUser.LocaleID,\r\n translateLegacyToIANATimezone(serverContext.CurrentAccount.TimeZone)\r\n );\r\n\r\n activity.trace(`[trace][onGlobalFilterDateChange] updateWaterfallFilter payload: ${JSON.stringify(filterData)}`);\r\n\r\n updateWaterfallFilter({\r\n filterType: WaterfallFilterType.DateFilter,\r\n filter: filterData,\r\n });\r\n\r\n activity.trace(`[trace][onGlobalFilterDateChange] updateWaterfallFilter success: ${JSON.stringify(filterData)}`);\r\n } catch (error) {\r\n activity.error(`[error][onGlobalFilterDateChange] updateWaterfallFilter failed: ${JSON.stringify(error)}`);\r\n postMessage({ messageType: WebViewMessageType.onError, data: error });\r\n }\r\n }\r\n};\r\n\r\nexport const WebViewContextProvider = ({ children }) => {\r\n const instrumentation = useContext(InstrumentationContext);\r\n const serverContext = useContext(ServerContext);\r\n const { updateWaterfallFilter } = useGlobalFilterContext();\r\n\r\n const i18nFormat = useMemo(() => new I18nModel({\r\n loadTranslationData: (/* locale */) => ({}),\r\n loadCLDRData: currentLocale => currentLocale,\r\n failFast: true,\r\n }), []);\r\n\r\n const activity = useMemo(() => {\r\n if (instrumentation && !instrumentation.webView) {\r\n instrumentation.addScenario(instrumentationSchema);\r\n }\r\n if (instrumentation && instrumentation.webView) {\r\n const scenario = instrumentation.webView.create();\r\n return scenario.message.create();\r\n }\r\n return { trace: _.noop, error: _.noop };\r\n }, [instrumentation]);\r\n\r\n const { getHost, postMessage, addEventListener } = useMessagingChannel(activity);\r\n\r\n const dateChangeListenerCallback = useCallback((message) => {\r\n dateChangeListener(i18nFormat, serverContext, message, activity, updateWaterfallFilter, postMessage);\r\n }, [i18nFormat, serverContext, activity, updateWaterfallFilter, postMessage]);\r\n\r\n useEffect(() => {\r\n if (!addEventListener) {\r\n return _.noop;\r\n }\r\n\r\n const removeListener = addEventListener(dateChangeListenerCallback);\r\n return () => removeListener();\r\n }, [addEventListener, dateChangeListenerCallback]);\r\n\r\n const value = useMemo(() => ({\r\n addEventListener,\r\n getHost,\r\n postMessage,\r\n }), [addEventListener, getHost, postMessage]);\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n\r\nWebViewContextProvider.propTypes = {\r\n children: PropTypes.node,\r\n instrumentation: PropTypes.shape({\r\n webView: PropTypes.shape({\r\n create: PropTypes.func,\r\n }),\r\n addScenario: PropTypes.func,\r\n }),\r\n};\r\n\r\nWebViewContextProvider.defaultProps = {\r\n children: undefined,\r\n instrumentation: undefined,\r\n};\r\n\r\n","import _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport React from 'react';\r\nimport { CampaignOData } from '@bingads-webui-react/campaign-odata';\r\nimport { withScope, QueryParam } from '@bingads-webui-react/scope-service';\r\nimport { getRoutePathById, withSiteMap } from '@bingads-webui-campaign-react/with-site-map';\r\nimport { CampaignSubTypeMapping } from '@bingads-webui-campaign-react/constants';\r\nimport { withPermissions } from '@bingads-webui-react/hoc-with-permissions';\r\n\r\nexport function withCampaign(Component) {\r\n const AdGroupCreationHoC = (props) => {\r\n const { scope: { values: { campaignId } } } = props;\r\n if (_.isUndefined(campaignId)) {\r\n props.scope.history.push({\r\n pathname: getRoutePathById(props.siteMap, 'adgroups'),\r\n search: props.scope.history.location.search,\r\n });\r\n return null;\r\n }\r\n\r\n /**\r\n * Get all data instead of partial data to avoid duplicate fetches\r\n * select is required to control the response data\r\n */\r\n const $select = _.compact([\r\n 'Budget',\r\n ]);\r\n\r\n return (\r\n currentCampaign.get({ select: $select })}\r\n >\r\n {(campaign) => {\r\n const currentCampaign = { ...campaign, CampaignSubType: CampaignSubTypeMapping[campaign.CampaignSubType], _IsAllData: true };\r\n\r\n return (\r\n \r\n );\r\n }}\r\n \r\n );\r\n };\r\n\r\n AdGroupCreationHoC.propTypes = {\r\n permissions: PropTypes.shape({\r\n IsPersonalizedOffersEnabled: PropTypes.bool.isRequired,\r\n }).isRequired,\r\n scope: PropTypes.instanceOf(QueryParam).isRequired,\r\n siteMap: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\r\n };\r\n\r\n return withScope(withSiteMap(withPermissions(AdGroupCreationHoC)));\r\n}\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Scope, getCurrentScope } from '@bingads-webui-campaign-react/shell-ui-common';\r\nimport { QueryParam, withScope } from '@bingads-webui-react/scope-service';\r\nimport { withPreference } from '@bingads-webui-react/preference-context';\r\nimport { withPermissions } from '@bingads-webui-react/hoc-with-permissions';\r\n\r\nconst LANDING_PAGE_PREFERENCE = 'OverviewAsDefaultTab';\r\nconst ACCOUNTS_LANDING_PAGE_PREFERENCE = 'AccountsOverviewAsDefaultTab';\r\nconst OVERVIEW = 'overview';\r\nconst CAMPAIGNS = 'campaigns';\r\nconst ACCOUNTS_SUMMARY = 'accounts-summary';\r\nconst ACCOUNTS_OVERVIEW = 'accounts-overview';\r\n\r\nfunction getLandingPageAndScopeState(scope, permissions, preferenceService) {\r\n const { values: { aid, campaignId, adGroupId } } = scope;\r\n const currentScope = getCurrentScope(campaignId, adGroupId, aid);\r\n const isCustomerScope = Scope.Customer === currentScope;\r\n const preferenceData = isCustomerScope ? preferenceService.findByNameAtUserLevel(ACCOUNTS_LANDING_PAGE_PREFERENCE) :\r\n preferenceService.findByName(LANDING_PAGE_PREFERENCE);\r\n\r\n if (!preferenceData || preferenceData.Data === true) {\r\n if (isCustomerScope) {\r\n return {\r\n defaultLandingPage: ACCOUNTS_OVERVIEW,\r\n isCustomerScope,\r\n };\r\n }\r\n return {\r\n defaultLandingPage: OVERVIEW,\r\n isCustomerScope,\r\n };\r\n }\r\n\r\n return {\r\n defaultLandingPage: isCustomerScope ? ACCOUNTS_SUMMARY : CAMPAIGNS,\r\n isCustomerScope,\r\n };\r\n}\r\n\r\nexport const withDefaultLandingPage = (WrappedComponent) => {\r\n class DefaultLandingPage extends React.PureComponent {\r\n static getDerivedStateFromProps({ scope, permissions, preferenceService }) {\r\n return _.extend({ scope }, getLandingPageAndScopeState(scope, permissions, preferenceService));\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = getLandingPageAndScopeState(this.props.scope, this.props.permissions, this.props.preferenceService);\r\n }\r\n\r\n setLandingPage = (pageId, e) => {\r\n e.stopPropagation(); // To prevent the entire row clicking.\r\n\r\n const {\r\n preferenceService,\r\n } = this.props;\r\n\r\n if (this.state.isCustomerScope) {\r\n preferenceService.setAtUserLevel({\r\n Name: ACCOUNTS_LANDING_PAGE_PREFERENCE,\r\n Data: pageId === ACCOUNTS_OVERVIEW,\r\n });\r\n } else {\r\n preferenceService.set({\r\n Name: LANDING_PAGE_PREFERENCE,\r\n Data: pageId === OVERVIEW,\r\n });\r\n }\r\n\r\n this.setState({\r\n defaultLandingPage: pageId,\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n\r\n DefaultLandingPage.propTypes = {\r\n preferenceService: PropTypes.shape({\r\n setAtUserLevel: PropTypes.func,\r\n findByNameAtUserLevel: PropTypes.func,\r\n }).isRequired,\r\n permissions: PropTypes.shape({\r\n }).isRequired,\r\n scope: PropTypes.instanceOf(QueryParam).isRequired,\r\n };\r\n\r\n return withScope(withPermissions(withPreference(DefaultLandingPage)));\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n findSiteMap,\r\n siteMapPropType,\r\n} from '@bingads-webui-campaign-react/with-site-map';\r\nimport { QueryParam } from '@bingads-webui-react/scope-service';\r\nimport { withServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { ACCOUNT_MODE } from '@bingads-webui-campaign/campaign-ui-common';\r\n\r\nexport class SmartLastURLInternal extends React.PureComponent {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n lastUrl: this.formatUrl('', props.scope, false),\r\n };\r\n }\r\n\r\n componentDidUpdate() {\r\n this.updateLastUrl();\r\n }\r\n\r\n leafCondition = item => item.children.length === 0 && item.selected === true;\r\n\r\n formatUrl = (url, scope, backToSmartCampaign = false) => {\r\n if (backToSmartCampaign && scope.values.aid) { // back to smart campaign\r\n return `/campaign/smart?uid=${scope.values.uid}&cid=${scope.values.cid}&aid=${scope.values.aid}`;\r\n }\r\n if (scope.values.aid) { // when we have aid, we can fallback to campaign pages and it will go to default landing apge.\r\n return `/campaign/vnext/${url}?uid=${scope.values.uid}&cid=${scope.values.cid}&aid=${scope.values.aid}`;\r\n } else if (url === '') { // If no aid or url (means user directely landed here) we go to account summary pages.\r\n return `/campaign/vnext/accounts?uid=${scope.values.uid}&cid=${scope.values.cid}`;\r\n }\r\n return `/campaign/vnext/${url}?uid=${scope.values.uid}&cid=${scope.values.cid}`; // the last url the user visited, works for both campaign and accounts\r\n }\r\n\r\n updateLastUrl = () => {\r\n const {\r\n siteMap, scope, serverContext, allowBackToSmartCampaign,\r\n } = this.props;\r\n const { CurrentAccount } = serverContext;\r\n if (CurrentAccount && CurrentAccount.AccountMode === ACCOUNT_MODE.SMART && allowBackToSmartCampaign) {\r\n this.setState({\r\n lastUrl: this.formatUrl('', scope, true),\r\n });\r\n } else {\r\n const selectedChildItem = findSiteMap(siteMap, this.leafCondition);\r\n if (selectedChildItem) {\r\n this.setState({\r\n lastUrl: this.formatUrl(selectedChildItem.route, scope, false),\r\n });\r\n }\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n {this.props.render(this.state)}\r\n \r\n );\r\n }\r\n}\r\n\r\nSmartLastURLInternal.propTypes = {\r\n siteMap: siteMapPropType.isRequired,\r\n render: PropTypes.func.isRequired,\r\n scope: PropTypes.instanceOf(QueryParam).isRequired,\r\n serverContext: PropTypes.shape({\r\n }).isRequired,\r\n allowBackToSmartCampaign: PropTypes.bool,\r\n};\r\n\r\nSmartLastURLInternal.defaultProps = {\r\n allowBackToSmartCampaign: false,\r\n};\r\n\r\nexport const SmartLastURL = withServerContext(SmartLastURLInternal);\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport _ from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n processor,\r\n withCampaignSiteMap,\r\n withAccountsSiteMap,\r\n} from '@bingads-webui-campaign-react/with-site-map';\r\nimport { withScope, QueryParam } from '@bingads-webui-react/scope-service';\r\nimport { withI18nConsumer } from '@bingads-webui-react/i18n-context';\r\nimport { SmartLastURL } from './smart-last-url';\r\n\r\nexport const withLastURL = (WrappedComponent) => {\r\n const LastCampaignURL = withCampaignSiteMap(SmartLastURL, [processor.processPath]);\r\n const LastAccountsURL = withAccountsSiteMap(SmartLastURL, [processor.processPath]);\r\n class LastUrl extends React.PureComponent {\r\n renderWrappedComponent = (buttonText, lastUrl) => {\r\n const {\r\n backButtonUrl,\r\n backButtonText,\r\n i18n,\r\n ...others\r\n } = this.props;\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n render() {\r\n const {\r\n scope,\r\n allowBackToSmartCampaign,\r\n } = this.props;\r\n\r\n if (_.has(scope.values, 'aid')) {\r\n return (\r\n this.renderWrappedComponent('Back to campaigns', lastUrlState.lastUrl)} allowBackToSmartCampaign={allowBackToSmartCampaign} />\r\n );\r\n }\r\n\r\n return (\r\n this.renderWrappedComponent('Back to accounts', lastUrlState.lastUrl)} allowBackToSmartCampaign={allowBackToSmartCampaign} />\r\n );\r\n }\r\n }\r\n\r\n LastUrl.propTypes = {\r\n backButtonUrl: PropTypes.string,\r\n backButtonText: PropTypes.string,\r\n scope: PropTypes.instanceOf(QueryParam).isRequired,\r\n i18n: PropTypes.shape({}).isRequired,\r\n allowBackToSmartCampaign: PropTypes.bool,\r\n };\r\n\r\n LastUrl.defaultProps = {\r\n backButtonUrl: '',\r\n backButtonText: '',\r\n allowBackToSmartCampaign: false,\r\n };\r\n\r\n return withI18nConsumer(withScope(LastUrl));\r\n};\r\n","import PropTypes from 'prop-types';\r\nimport React from 'react';\r\nimport { find } from 'underscore';\r\nimport { QueryParam, withScope } from '@bingads-webui-react/scope-service';\r\nimport { withInstrumentation } from '@bingads-webui-react/hoc-with-instrumentation';\r\n\r\nexport function withOpportunityId(WrappedComponent) {\r\n class OpportunityId extends React.PureComponent {\r\n static propTypes = {\r\n scope: PropTypes.instanceOf(QueryParam).isRequired,\r\n instrumentation: PropTypes.shape().isRequired,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n this.currentScenario = null;\r\n this.currentActivity = null;\r\n this.opportunityId = null;\r\n this.recommendationType = null;\r\n }\r\n\r\n componentDidMount() {\r\n const { scope, instrumentation } = this.props;\r\n if (scope.values.opportunityId) {\r\n this.opportunityId = scope.values.opportunityId;\r\n this.recommendationType = scope.values.recommendationType;\r\n\r\n if (this.recommendationType) {\r\n if (instrumentation[`load${this.recommendationType}`]) {\r\n this.currentScenario = instrumentation[`load${this.recommendationType}`].create();\r\n this.currentActivity = this.currentScenario.apply.create();\r\n }\r\n }\r\n\r\n delete scope.values.opportunityId;\r\n delete scope.values.recommendationType;\r\n this.props.scope.history.replace({\r\n pathname: scope.history.location.pathname,\r\n search: scope.stringify(),\r\n });\r\n }\r\n }\r\n\r\n onFilterServiceLoaded = ({ filterService }) => {\r\n this.filterService = filterService;\r\n }\r\n\r\n isOpportunityIdValid() {\r\n const isValid = this.opportunityId != null && this.recommendationType != null;\r\n return isValid;\r\n }\r\n\r\n // When user comes from recommendation page for fix ad content type, it will bring editorial rejection reason filter\r\n // The function is used to check if the filter condition still contains editorial rejection reason\r\n isFilterConditionValid() {\r\n if (this.filterService && this.filterService.editableFilter) {\r\n const { query } = this.filterService.editableFilter;\r\n if (query.EditorialRejectionFlagId) {\r\n return true;\r\n } else if (query.$and) {\r\n const filters = query.$and;\r\n return !!find(filters, filter => filter.EditorialRejectionFlagId);\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n shouldSendOpportunityLog = () => this.isOpportunityIdValid() && this.isFilterConditionValid()\r\n\r\n logOpportunity= ({ context }) => {\r\n if (this.currentActivity) {\r\n this.currentActivity.trace({\r\n Campaign: {\r\n CampaignId: context.campaignId,\r\n AdGroupId: context.adGroupId,\r\n AdId: context.adId,\r\n KeywordIds: context.keywordIds,\r\n },\r\n AdInsight: {\r\n OpportunityType: this.recommendationType,\r\n OpportunityId: this.opportunityId,\r\n },\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n\r\n return withScope(withInstrumentation(OpportunityId));\r\n}\r\n"],"names":["getIconsClassNameMap","classes","expanded","concat","nodeIcon","collapsed","RouterUtility","_createClass","_classCallCheck","key","value","node","selected","_","children","NodeRenderer","scope","sitemap","shouldRenderParentNodeAsLink","isActiveNode","isActive","isParentNode","length","queryString","stringify","renderLinkOrDiv","args","noNavigation","shouldRenderDiv","_jsx","className","classNames","nodeHyperlink","nodeHyperLinkParent","name","nodeHyperLinkNonParent","nodeHyperlinkActive","title","RouterLink","id","to","getRoutePathById","nodeChildRenderer","nodeActive","nodeNonActive","_jsxs","ExpandableNode","_objectSpread","singleClickExpansion","beforeIcon","TreeMenu","_React$PureComponent","props","_this","_callSuper","onChange","nodes","setState","getClassNames","nodeStyle","state","siteMap","RouterNode","_inherits","_this2","childNode","expandSelectedParentNodes","route","_this3","this","_this$props","expandIconAriaLabel","i18n","currentPath","location","pathname","style","display","height","TreeView","nodeRenderer","iconsClassNameMap","treeViewClassNames","treeViewContainer","nodePaddingLeft","cellHeight","getString","_TL_","nextProps","prevState","flattenedStatefulMap","flattenPreviousNodes","mergeNodeState","previousMatch","output","React","defaultProps","undefined","StyledTreeMenu","withI18nConsumer","withScope","withRouter","withDefaultStyles","treeMenu","_ref","_ref$palette","palette","placeholder","width","backgroundColor","marginLeft","verticalAlign","padding","fontSize","cursor","runningIcon","margin","whiteSpace","outlineOffset","outline","neutralSecondary","neutralLight","textDecoration","color","themePrimary","themeLighter","themeLight","overflow","textOverflow","maxWidth","fontWeight","fontFamily","lineHeight","flex","neutralLighter","borderLeft","marginRight","alignSelf","float","log","appActivity","msg","trace","e","updateDateRange","preferenceService","serverContext","waterfallFilterStorage","WaterfallFilterStorage","dateFilter","waterfallDateFilterProcessor","getFilters","WaterfallFilterType","DateFilter","attributes","$daterange","Object","defineProperty","get","dateRange","formatedEnd","RangeEndDate","formatedStart","RangeStartDate","patchLegacyState","_serverContext$Curren","CurrentUser","ShortDatePattern","CultureDateTimeFormat","LocaleID","TimeZone","CurrentAccount","isImprovedDateRangePickerEnabled","DynamicPermissions","ImprovedDateFilter","i18nFormat","I18nModel","loadTranslationData","loadCLDRData","currentLocale","failFast","JSON","Rangelcid","start","end","compared","formattedStart","formattedEnd","RangeId","RANGES","Custom","timeZone","translateLegacyToIANATimezone","specificRanges","DefaultSpecificRanges","_getRangesFromData","getRangesFromData","selectedRange","selectedComparedRange","newSelectedRange","RangeIndex","getRangeIndexWithDefaultType","rangeId","RangeDays","EntireTime","range","rangeWithIndex","getNthPeriodWithRangeType","cRangeIndex","rangeIndex","stringifySync","selectedSpecificRange","today","getCivilDateToday","compareCivilDate","newSelectedComparedRange","comparedOption","ComparedOptions","option","keyToExport","data","generateDateData","rangeType","rangeDays","save","_getRangesFromData2","yesterday","plus","days","fallbackDate","formatCivilDate","raw","Yesterday","URLFilterInternal","_len","arguments","Array","_key","onUrlFilterChange","filterExpressions","featureName","updateUrlFilter","filterType","featureNameToUrlFilter","filter","getFilterExpressionsFromFilterAlias","filterAlias","filterArguments","formatAlias","permissions","checkUrlFilter","values","currentRoute","replace","currentSiteMap","findSiteMap","s","siteMapId","filterKeys","allowedUrlFilterKeys","supportFeatureNames","sitemapIdToFeatureName","allowedFilterAlias","featureIdToFilterAlias","_values$filterArgumen","URLFilter","withSiteMap","withGlobalFilter","versionCheckInstance","VersionCheck","_ref$deps","deps","httpUtil","http","_ref$version","version","task","checkFrequency","_$chain$result$result","scopeStore","result","aid","cid","uid","url","then","catch","versionStore","newVersion","eventDispatcher","trigger","stop","setInterval","checkVersion","$","window","on","clearInterval","WebViewMessageType","outgoingMessage","type","properties","messageType","enum","required","incomingMessage","additionalProperties","instrumentationSchema","scenario","activity","useMessagingChannel","eventListenersRef","useRef","getHost","useCallback","ReactNativeWebView","_useMemo","useMemo","ajv","Ajv","allErrors","strict","validateOutgoingMessage","compile","validateIncomingMessage","getValidators","postMessage","payload","messagePayload","host","error","onMessage","message","origin","current","forEach","listener","useEffect","addEventListener","removeEventListener","push","l","WebViewContext","createContext","WebViewContextProvider","instrumentation","useContext","InstrumentationContext","ServerContext","updateWaterfallFilter","useGlobalFilterContext","webView","addScenario","create","_useMessagingChannel","dateChangeListenerCallback","parseCivilDate","dateString","getDaysOfARange","filterData","dateChangeListener","removeListener","Provider","withCampaign","Component","withPermissions","campaignId","history","search","$select","CampaignOData","call","currentCampaign","select","campaign","CampaignSubType","CampaignSubTypeMapping","_IsAllData","campaignContext","LANDING_PAGE_PREFERENCE","ACCOUNTS_LANDING_PAGE_PREFERENCE","OVERVIEW","ACCOUNTS_OVERVIEW","getLandingPageAndScopeState","_scope$values","adGroupId","currentScope","getCurrentScope","isCustomerScope","Scope","Customer","preferenceData","findByNameAtUserLevel","findByName","Data","defaultLandingPage","withDefaultLandingPage","WrappedComponent","DefaultLandingPage","setLandingPage","pageId","stopPropagation","setAtUserLevel","Name","set","withPreference","SmartLastURLInternal","leafCondition","item","formatUrl","updateLastUrl","allowBackToSmartCampaign","AccountMode","ACCOUNT_MODE","SMART","lastUrl","selectedChildItem","render","SmartLastURL","withServerContext","withLastURL","LastCampaignURL","withCampaignSiteMap","processor","processPath","LastAccountsURL","withAccountsSiteMap","LastUrl","renderWrappedComponent","buttonText","backButtonUrl","backButtonText","others","_objectWithoutProperties","_excluded","_this$props2","lastUrlState","withOpportunityId","OpportunityId","onFilterServiceLoaded","filterService","shouldSendOpportunityLog","isOpportunityIdValid","isFilterConditionValid","logOpportunity","_ref2","context","currentActivity","Campaign","CampaignId","AdGroupId","AdId","adId","KeywordIds","keywordIds","AdInsight","OpportunityType","recommendationType","opportunityId","currentScenario","apply","editableFilter","query","EditorialRejectionFlagId","$and","filters","find","withInstrumentation"],"sourceRoot":""}