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OAAO,OAASD,EAAatmE,EAAKW,UAAU,iCAAmC,GAAK2lE,GAAe,qTAC/bn0D,EACJi0D,EAAWA,0EAAqGJ,EAAIxtB,KAAK,aAAcx4C,EAAKW,UAAU,oCAAoC,GAAM,GAArLylE,sCAGXA,GAAsB,sEAEtBA,EAAWA,2GAAsIJ,EAAIxtB,KAAK,QAASx4C,EAAKW,UAAU,oCAAoC,GAAM,GAAjNylE,6BAAgS,EAAEz4C,KAAK9iB,KAAK,SAAUw7D,EAAgBA,EAAgBrmE,KAAmB,qBAAPA,KAAmBA,UAAK3D,EAAU,eAAgBgqE,EAAgBA,EAAgBl0D,WAA+B,qBAAbA,WAAyBA,gBAAW9V,GAAoB+pE,CAAS,C","sources":["../../../../components/packages/ad-distribution/src/ad-distribution.js","../../../../components/packages/ad-distribution/src/use-backbone-view.js","../../../../components/packages/ad-distribution/src/validated-ad-distribution.js","../../../../components/packages/ad-schedule/src/legacy-ad-schedule.js","../../../../components/packages/ad-schedule/src/validated-ad-schedule.js","../../../../components/packages/ad-schedule/src/utils.js","../../../../components/packages/automated-rules/src/cron-selection/options.js","../../../../components/packages/automated-rules/src/cron-selection/viewmodel.js","../../../../components/packages/automated-rules/src/cron-selection/view.js","../../../../components/packages/automated-rules/src/options.js","../../../../components/packages/automated-rules/src/viewmodel.js","../../../../components/packages/automated-rules/src/grid-helper.js","../../../../components/packages/automated-rules/src/entity-settings/base.js","../../../../components/packages/automated-rules/src/action-view/constants.js","../../../../components/packages/automated-rules/src/action-view/util.js","../../../../components/packages/automated-rules/src/action-view/campaign/viewmodel.js","../../../../components/packages/automated-rules/src/action-view/campaign/view.js","../../../../components/packages/automated-rules/src/entity-settings/campaign.js","../../../../components/packages/automated-rules/src/action-view/adgroup/viewmodel.js","../../../../components/packages/automated-rules/src/action-view/adgroup/view.js","../../../../components/packages/automated-rules/src/entity-settings/adgroup.js","../../../../components/packages/automated-rules/src/action-view/keyword/viewmodel.js","../../../../components/packages/automated-rules/src/action-view/keyword/view.js","../../../../components/packages/automated-rules/src/entity-settings/keyword.js","../../../../components/packages/automated-rules/src/entity-settings/assetgroup.js","../../../../components/packages/automated-rules/src/helper.js","../../../../components/packages/automated-rules/src/predicate-list-backbone-view.js","../../../../components/packages/automated-rules/src/view.js","../../../../components/packages/automated-rules/src/entity-settings/get-entity-setting.js","../../../../components/packages/automated-rules/src/model.js","../../../../components/packages/bid-strategy/src/legacy-bid-strategy.js","../../../../components/packages/bid-strategy/src/validated-bid-strategy.js","../../../../components/packages/bulk-operation-base/src/bulk-edit-job-model.js","../../../../components/packages/bulk-operation-base/src/grid-filter-serializer.js","../../../../components/packages/bulk-operation-base/src/numberic-action-type.js","../../../../components/packages/bulk-operation-base/src/preview/viewmodel.js","../../../../components/packages/bulk-operation-base/src/preview/view.js","../../../../components/packages/bulk-operation-base/src/preview/ad-preview-helper.js","../../../../components/packages/bulk-operation-base/src/preview/format-preview-from-response.js","../../../../components/packages/campaign-bulk-edit/src/audience-decoration.js","../../../../components/packages/campaign-bulk-edit/src/plugin.js","../../../../components/packages/date-range-utilities/src/util/date-range-preset.js","../../../../components/packages/date-range-utilities/src/util/selection-date.js","../../../../components/packages/date-range-utilities/src/util/get-state-date-range.js","../../../../components/packages/date-range-utilities/src/util/comparison-date-range-option.js","../../../../components/packages/date-range-utilities/src/util/get-state-compared-date-range.js","../../../../components/packages/date-range-utilities/src/selection-date-range-to-state.js","../../../../components/packages/date-range-utilities/src/state-date-range-to-selection.js","../../../../components/packages/date-range-utilities/src/lock-down-selection-date-range.js","../../../../components/packages/date-range-utilities/src/date-range-format.js","../../../../components/packages/date-setting/src/legacy-date-setting.js","../../../../components/packages/date-setting/src/utils.js","../../../../components/packages/date-setting/src/validated-legacy-date-setting.js","../../../../components/packages/image-odata/src/bulkify.js","../../../../components/packages/image-odata/src/image-odata.js","../../../../components/packages/ko-stop-binding/src/ko-stop-binding.js","../../../../components/packages/multi-language-selector/src/viewmodel.js","../../../../components/packages/multi-language-selector/src/view.js","../../../../components/packages/observe-in-dom/src/observe-in-dom.js","../../../../components/packages/projection-grid-auction-insight/src/navigate-to-competition-tab.js","../../../../components/packages/projection-grid-auction-insight/src/navigate-to-legacy-auction-insights.js","../../../../components/packages/projection-grid-auction-insight/src/get-dropdown-menu-items.js","../../../../components/packages/projection-grid-auction-insight/src/plugin.js","../../../../components/packages/projection-grid-automated-rules/src/automated-rules-menu.js","../../../../components/packages/projection-grid-automated-rules/src/plugin.js","../../../../components/packages/projection-grid-bid-strategy/src/bidding-strategy-type.js","../../../../components/packages/projection-grid-bid-strategy/src/menu-items.js","../../../../components/packages/projection-grid-bid-strategy/src/plugin.js","../../../../components/packages/projection-grid-bulk-edit/src/plugin.js","../../../../components/packages/projection-grid-column-resize-helper/src/local-preference-service.js","../../../../components/packages/projection-grid-column-resize-helper/src/plugins.js","../../../../components/packages/projection-grid-column-resize-helper/src/get-pgrid-column-resize-plugin.js","../../../../components/packages/projection-grid-editable/src/plugin.js","../../../../components/packages/projection-grid-flex-column-resize/src/plugin.js","../../../../components/packages/projection-grid-paste/src/plugin.js","../../../../components/packages/projection-grid-popup/src/plugin.js","../../../../components/packages/projection-grid-scope-navigator/src/plugin.js","../../../../components/packages/projection-grid-scrollbar/src/plugin.js","../../../../components/packages/shared-budget/src/legacy-shared-budget.js","../../../../components/packages/shared-budget/src/validated-shared-budget.js","../../../../components/packages/shared-budget/src/utils.js","../../../../components/packages/upgrade-url-string-map/index.js","../../../../components/packages/upgrade-url/src/tracking-template/viewmodel.js","../../../../components/packages/upgrade-url/src/tracking-template/view.js","../../../../components/packages/upgrade-url/src/shared/inline-edit/viewmodel.js","../../../../components/packages/upgrade-url/src/tracking-template/inline-edit-view.js","../../../../components/packages/upgrade-url/src/final-url-suffix/viewmodel.js","../../../../components/packages/upgrade-url/src/final-url-suffix/view.js","../../../../components/packages/upgrade-url/src/final-url-suffix/inline-edit-view.js","../../../../components/packages/upgrade-url/src/custom-params/viewmodel.js","../../../../components/packages/upgrade-url/src/custom-params/view.js","../../../../components/packages/upgrade-url/src/custom-params/inline-edit-view.js","../../../../components/packages/upgrade-url/src/upgraded-url/final-url-viewmodel.js","../../../../components/packages/upgrade-url/src/upgraded-url/final-url-view.js","../../../../components/packages/upgrade-url/src/upgraded-url/url-input/url-input-viewmodel.js","../../../../components/packages/upgrade-url/src/upgraded-url/url-input/url-input-view.js","../../../../components/packages/upgrade-url/src/upgraded-url/upgraded-url-viewmodel.js","../../../../components/packages/upgrade-url/src/upgraded-url/upgraded-url-view.js","../../../../components/packages/upgrade-url/src/upgraded-url/inline-edit-view.js","../../../../components/packages/popup/view/index.js","../../../../components/packages/url-test-tool/viewmodel.js","../../../../components/packages/url-test-tool/view.js","../../../../components/packages/user-voice/src/user-voice.js","../../../../components/packages/video-odata/src/constants.js","../../../../components/packages/video-odata/src/video-odata.js","../../../../components/packages/automated-rules/src/action-view/adgroup/changebid.pug","../../../../components/packages/automated-rules/src/action-view/campaign/changebudget.pug","../../../../components/packages/automated-rules/src/action-view/keyword/changebid.pug","../../../../components/packages/automated-rules/src/cron-selection/template.pug","../../../../components/packages/automated-rules/src/template.pug","../../../../components/packages/bulk-operation-base/src/preview/template.pug","../../../../components/packages/campaign-bulk-edit/src/audience-decoration.pug","../../../../components/packages/multi-language-selector/src/template.pug","../../../../components/packages/popup/template/popup.pug","../../../../components/packages/projection-grid-column-resize-helper/src/header.pug","../../../../components/packages/projection-grid-editable/src/editable-template.pug","../../../../components/packages/projection-grid-flex-column-resize/src/header.pug","../../../../components/packages/projection-grid-scrollbar/src/template.pug","../../../../components/packages/upgrade-url/src/custom-params/template.pug","../../../../components/packages/upgrade-url/src/final-url-suffix/template.pug","../../../../components/packages/upgrade-url/src/shared/inline-edit/template.pug","../../../../components/packages/upgrade-url/src/tracking-template/template.pug","../../../../components/packages/upgrade-url/src/upgraded-url/final-url-template.pug","../../../../components/packages/upgrade-url/src/upgraded-url/upgraded-url.pug","../../../../components/packages/upgrade-url/src/upgraded-url/url-input/url-input-core.pug","../../../../components/packages/upgrade-url/src/upgraded-url/url-input/url-input.pug","../../../../components/packages/url-test-tool/template/urlTestResult.pug","../../../../components/packages/url-test-tool/template/urlTestResultListSummaryV2.pug","../../../../components/packages/url-test-tool/template/urlTestResultSummaryV2.pug","../../../../components/packages/url-test-tool/template/urlTestTool.pug","../../../../components/packages/url-test-tool/template/urlTestToolStatus.pug"],"sourcesContent":["/* eslint-disable no-script-url */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport AdDistributionView from '@bingads-webui-campaign-legacy/advanced-settings/view/ad-distribution';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useCallback } from 'react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { useBackboneView } from './use-backbone-view';\r\n\r\nconst getStyles = (_, { palette = {} }) => ({\r\n adDistributionContainer: {\r\n marginBottom: '16px',\r\n backgroundColor: `${palette.white}`,\r\n '& .infomark': {\r\n display: 'none',\r\n },\r\n '& .radio a.HelpTopic': {\r\n textDecoration: 'underline',\r\n },\r\n '& .radio > div': {\r\n marginLeft: '28px',\r\n },\r\n '& .expandedImage:before, .expanderImage:before': {\r\n marginRight: '4px',\r\n },\r\n '& .icon-marker': { // private/ui-next/packages/common-styles/src/advanced-settings-section-style.js\r\n textDecoration: 'none',\r\n outline: 'none',\r\n border: 'none',\r\n color: palette.themePrimary,\r\n lineHeight: '24px',\r\n fontSize: 14,\r\n borderBottom: '1px transparent',\r\n\r\n '&:hover': {\r\n color: palette.themeDarker,\r\n borderBottom: `1px solid ${palette.neutralSecondary}`,\r\n },\r\n\r\n '&:focus': {\r\n color: palette.themeDarker,\r\n border: `1px solid ${palette.neutralSecondary}`,\r\n },\r\n },\r\n },\r\n});\r\n\r\n// reference: private/campaign-legacy/packages/advanced-settings/view/advancedSettings.js\r\nexport const AdDistribution = React.memo((props) => {\r\n const { setAdDistributionView, options } = props;\r\n const adDistributionReactWrapper = useBackboneView(useCallback(() => new AdDistributionView({\r\n ...options,\r\n }).render(), [options]), setAdDistributionView);\r\n\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n return (\r\n
\r\n {adDistributionReactWrapper}\r\n
\r\n );\r\n});\r\n\r\nAdDistribution.propTypes = {\r\n setAdDistributionView: PropTypes.func.isRequired,\r\n options: PropTypes.shape({}),\r\n};\r\n\r\nAdDistribution.defaultProps = {\r\n options: {\r\n },\r\n};\r\n","import React, { useState, useEffect } from 'react';\r\nimport { BackboneInstanceWrapper } from '@bingads-webui-react/backbone-instance-wrapper';\r\n\r\nexport function useBackboneView(viewFactory, onViewCreated, { managed = false, onViewRemoved, getCreatedView } = {}) {\r\n const [backboneView, setBackboneView] = useState(null);\r\n\r\n useEffect(() => {\r\n let view = getCreatedView != null ? getCreatedView() : undefined;\r\n if (view == null) {\r\n view = viewFactory();\r\n onViewCreated(view);\r\n }\r\n setBackboneView(view);\r\n return () => {\r\n if (onViewRemoved != null) {\r\n onViewRemoved();\r\n }\r\n };\r\n }, [onViewCreated, viewFactory, onViewRemoved, getCreatedView]);\r\n\r\n if (backboneView) {\r\n return ();\r\n }\r\n\r\n return null;\r\n}\r\n","import React, { useCallback, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport classnames from 'classnames';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { andComp, entityIs, propertyIs } from '@bingads-webui-campaign-react/form-error';\r\nimport { withControlErrorHandling, withUnvalidatedControlErrors } from '@bingads-webui-campaign-react/error-handling';\r\nimport { syndEnum } from '@bingads-webui-campaign-react/constants';\r\nimport { TextTitle, ValidatedPanel, getPanelErrorProps } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { AdGroup } from '@bingads-webui/campaign-odata-schemas';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { AdDistribution } from './ad-distribution';\r\n\r\nconst getExtraStyles = () => ({\r\n adDistribution: {\r\n '& [role=\"radiogroup\"] .radio label': {\r\n fontWeight: 600,\r\n outline: 'none !important',\r\n '& input[type=\"radio\"]': {\r\n outline: 'none !important',\r\n },\r\n },\r\n },\r\n});\r\n\r\nconst LegacyAdDistributionWithValidation = (props) => {\r\n const {\r\n setAdDistributionView, options, getStyles, updateValidation,\r\n } = props;\r\n const classes = useDefaultStyles(getStyles);\r\n const activity = useContext(ActivityContext);\r\n const onChange = useCallback((newData) => {\r\n updateValidation([], { AdDistribution: newData });\r\n\r\n if (activity) {\r\n // signal activity to parent\r\n activity.signal(`onLegacyAdDistributionChange - ${JSON.stringify(newData)}`);\r\n }\r\n }, [activity, updateValidation]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nLegacyAdDistributionWithValidation.propTypes = {\r\n updateValidation: PropTypes.func.isRequired,\r\n setAdDistributionView: PropTypes.func,\r\n options: PropTypes.shape({}).isRequired,\r\n getStyles: PropTypes.func,\r\n};\r\n\r\nLegacyAdDistributionWithValidation.defaultProps = {\r\n setAdDistributionView: _.noop,\r\n getStyles: getExtraStyles,\r\n};\r\n\r\nexport const ValidatedAdDistribution = withCustomValidation(LegacyAdDistributionWithValidation);\r\n\r\nconst entityIsAdGroup = entityIs('adGroup');\r\nexport const ServerValidatedAdDistribution = withControlErrorHandling(withUnvalidatedControlErrors(withError(ValidatedAdDistribution, { filter: andComp(entityIsAdGroup, propertyIs('adDistribution')) })));\r\n\r\nconst getLocalizationMapping = (adDistribution) => {\r\n switch (adDistribution) {\r\n case syndEnum.BingYahooOnly:\r\n return _TL_('Microsoft sites and select traffic');\r\n case syndEnum.SearchPartnersOnly:\r\n return _TL_('Only partner traffic');\r\n case syndEnum.BingYahooAndSearchPartners:\r\n default:\r\n return _TL_('The entire Microsoft Advertising Network (recommended)');\r\n }\r\n};\r\n\r\nexport const AdDistributionWithValidationSection = ({\r\n data, onValidate, i18n, icon, ...rest\r\n}) => (\r\n }\r\n attentionBeaconProps={{ getExtraProps: getPanelErrorProps }}\r\n {...rest}\r\n >\r\n \r\n \r\n);\r\n\r\nAdDistributionWithValidationSection.propTypes = {\r\n onValidate: PropTypes.func.isRequired,\r\n data: PropTypes.shape({\r\n AdDistribution: PropTypes.string,\r\n Medium: PropTypes.string,\r\n }).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n icon: PropTypes.string,\r\n};\r\n\r\nAdDistributionWithValidationSection.defaultProps = {\r\n icon: null,\r\n};\r\n","/* eslint-disable no-param-reassign */\r\nimport { each } from 'underscore';\r\nimport React, { useEffect, useRef, useMemo, useCallback, useContext } from 'react';\r\nimport classnames from 'classnames';\r\nimport AdScheduleView from '@bingads-webui-campaign-legacy/ad-schedule/view/index';\r\nimport PropTypes from 'prop-types';\r\nimport { advancedSettingsSectionStyle, toggleButtonStyle, datePickerStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport {\r\n creationCommonStyle\r\n} from '@bingads-webui-campaign-react/campaign-adgroup-settings-shared-styles';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nconst getStyles = (__, core) =>\r\n ({\r\n '@global': {\r\n ...datePickerStyle(core),\r\n },\r\n adScheduleContainer: {\r\n '& .advanced-scheduling-grid': {\r\n width: '918px',\r\n },\r\n ...creationCommonStyle(core),\r\n ...advancedSettingsSectionStyle(core),\r\n '& .radio-inline': {\r\n display: 'block',\r\n },\r\n '& .adschedule-targets-container': {\r\n borderTop: 'unset',\r\n paddingTop: '0px',\r\n },\r\n '& .toggle-campaign-settings-switch.form-control-static[data-bind]': {\r\n display: 'inline-block',\r\n textDecoration: 'none',\r\n paddingRight: '8px',\r\n float: 'left',\r\n },\r\n ...toggleButtonStyle(core),\r\n '& .date-settings-intro': {\r\n paddingLeft: 0,\r\n },\r\n '& .date-settings': {\r\n '& .col-sm-12': {\r\n paddingLeft: 0,\r\n },\r\n '& table': {\r\n width: '500px',\r\n '& td': {\r\n width: '100%',\r\n display: 'block',\r\n },\r\n },\r\n },\r\n '& .alert-danger': {\r\n backgroundColor: 'unset',\r\n color: '#A80000',\r\n },\r\n '& table tbody .col-sm-9': {\r\n width: 'unset',\r\n paddingLeft: 'unset',\r\n },\r\n '& table tbody .item-label.schedule-item-label.form-control-static': {\r\n fontWeight: '600',\r\n color: '#323130',\r\n paddingTop: '10px',\r\n display: 'block',\r\n },\r\n '& table tbody .form-control:focus': {\r\n outline: '1px solid #0078d4',\r\n },\r\n '& .adschedule-targets-container .advanced-scheduling-grid .ad-scheduling-panel table tr:nth-child(3) td .radio-inline:nth-child(2)': {\r\n top: 'unset',\r\n },\r\n '& .alert-info': {\r\n '& .alert-info-inline': {\r\n '& a:focus': {\r\n outline: '1px solid #605e5c',\r\n },\r\n },\r\n },\r\n },\r\n });\r\n\r\nexport const LegacyAdSchedule = React.memo((props) => {\r\n const {\r\n entity,\r\n data,\r\n campaignDayTimeRanges,\r\n onChange,\r\n setAdScheduleView,\r\n level,\r\n hideUseCampaignSetting,\r\n hideMinuteOptions,\r\n showDateSettings,\r\n showBidAdjustmentColumn,\r\n i18nKeys,\r\n campaignAdScheduleUseSearcherTimeZone,\r\n } = props;\r\n const view = useRef();\r\n\r\n const activity = useContext(ActivityContext);\r\n\r\n let container;\r\n const classes = useDefaultStyles(getStyles);\r\n const deletedDayTimeCb = useCallback((deletedDayTimeCriterions) => {\r\n each(deletedDayTimeCriterions, (criterion) => {\r\n criterion.Criterion.BidAdjustment = 0;\r\n criterion.Status = 'Deleted';\r\n criterion.Campaign = {\r\n Id: entity.data.Id,\r\n };\r\n });\r\n }, [entity.data.Id]);\r\n\r\n const adScheduleOption = useMemo(\r\n () => {\r\n const model = {\r\n dayTimeRanges: data.dayTimeRanges,\r\n timeZone: entity.data.TimeZone,\r\n adScheduleUseSearcherTimeZone: entity.data.AdScheduleUseSearcherTimeZone,\r\n };\r\n return {\r\n model,\r\n i18nKeys,\r\n level,\r\n hideMinuteOptions,\r\n showDateSettings,\r\n hideAdScheduleBidAdjustments: false,\r\n showBidAdjustmentColumn,\r\n hideUseCampaignSetting,\r\n campaignDayTimeRanges,\r\n campaignAdScheduleUseSearcherTimeZone,\r\n activityLogger: activity,\r\n onChange: (newData, isValid) => {\r\n const updatedData = {\r\n adSchedulesBulkUpsert: newData,\r\n AdScheduleUseSearcherTimeZone: view.current.getAdScheduleUseSearcherTimeZone(),\r\n };\r\n\r\n if (showDateSettings) {\r\n updatedData.adScheduleDateSettings = view.current.getDateSettings();\r\n }\r\n\r\n onChange(updatedData, isValid);\r\n },\r\n deleteCb: deletedDayTimeCb,\r\n };\r\n },\r\n [data.dayTimeRanges, entity.data.TimeZone, entity.data.AdScheduleUseSearcherTimeZone, i18nKeys, level, hideMinuteOptions, showDateSettings, showBidAdjustmentColumn, hideUseCampaignSetting, campaignDayTimeRanges, activity, deletedDayTimeCb, onChange]\r\n );\r\n\r\n useEffect(() => {\r\n view.current = new AdScheduleView({\r\n ...adScheduleOption,\r\n });\r\n\r\n view.current.render();\r\n view.current.$el.appendTo(container);\r\n setAdScheduleView(view);\r\n onChange(view.current.getValues(deletedDayTimeCb), true, false);\r\n\r\n return () => {\r\n view.current.remove();\r\n };\r\n // We will refresh the view if data changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [data.dayTimeRanges]);\r\n\r\n return (\r\n \r\n
\r\n
{ container = ref; }} />\r\n
\r\n
\r\n );\r\n});\r\n\r\nLegacyAdSchedule.propTypes = {\r\n entity: PropTypes.shape({\r\n data: PropTypes.shape({\r\n Id: PropTypes.number,\r\n TimeZone: PropTypes.shape({}),\r\n AdScheduleUseSearcherTimeZone: PropTypes.shape({}),\r\n }),\r\n }),\r\n data: PropTypes.shape({\r\n dayTimeRanges: PropTypes.shape({}),\r\n }).isRequired,\r\n onChange: PropTypes.func.isRequired,\r\n setAdScheduleView: PropTypes.func,\r\n level: PropTypes.string,\r\n hideUseCampaignSetting: PropTypes.bool,\r\n hideMinuteOptions: PropTypes.bool,\r\n showDateSettings: PropTypes.bool,\r\n showBidAdjustmentColumn: PropTypes.bool,\r\n campaignDayTimeRanges: PropTypes.shape({}),\r\n i18nKeys: PropTypes.shape({}),\r\n campaignAdScheduleUseSearcherTimeZone: PropTypes.bool,\r\n};\r\n\r\nLegacyAdSchedule.defaultProps = {\r\n entity: {},\r\n level: 'campaign',\r\n setAdScheduleView: () => {},\r\n hideUseCampaignSetting: false,\r\n hideMinuteOptions: false,\r\n showDateSettings: false,\r\n showBidAdjustmentColumn: false,\r\n campaignDayTimeRanges: {},\r\n i18nKeys: {\r\n Warning: 'TargetingSettings_AdSchedule_Warning_PMax',\r\n },\r\n campaignAdScheduleUseSearcherTimeZone: false,\r\n};\r\n","import React, { useCallback, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { LegacyAdSchedule } from './legacy-ad-schedule';\r\n\r\nconst LegacyAdScheduleWithCustomValidation = ({\r\n validationProps, updateValidation, ...restProps\r\n}) => {\r\n const { data: adSchedules } = validationProps;\r\n\r\n const i18n = useContext(I18nContext);\r\n const activity = useContext(ActivityContext);\r\n\r\n const onChange = useCallback((newData, newIsValid, shouldDirty = true) => {\r\n updateValidation(newIsValid ? [] : [i18n.getString(_TL_('Ad schedule has validation errors'))], newData, shouldDirty);\r\n // onChange will triggered every time data changed. We only want to trace the manually change.\r\n // Please refer ./legacy-ad-schedule.js line: 150.\r\n if (activity && shouldDirty !== false) {\r\n activity.signal(`onLegacyAdScheduleChange - ${JSON.stringify(newData)}`);\r\n }\r\n }, [updateValidation, i18n, activity]);\r\n\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nLegacyAdScheduleWithCustomValidation.propTypes = {\r\n validationProps: PropTypes.shape({\r\n data: PropTypes.shape({}),\r\n }).isRequired,\r\n updateValidation: PropTypes.func.isRequired,\r\n activity: PropTypes.shape({\r\n signal: PropTypes.func,\r\n }),\r\n};\r\n\r\nLegacyAdScheduleWithCustomValidation.defaultProps = {\r\n activity: null,\r\n};\r\n\r\nexport const ValidatedLegacyAdSchedule = withCustomValidation(LegacyAdScheduleWithCustomValidation);\r\n","import _ from 'underscore';\r\n\r\nexport const minuteToSaveMap = {\r\n ZERO: 0,\r\n FIFTEEN: 15,\r\n THIRTY: 30,\r\n FORTY_FIVE: 45,\r\n};\r\n\r\nexport const minuteMap = {\r\n 0: 'ZERO',\r\n 15: 'FIFTEEN',\r\n 30: 'THIRTY',\r\n 45: 'FORTY_FIVE',\r\n};\r\n\r\nexport const getDay = (day) => {\r\n switch (day) {\r\n case 'Alldays':\r\n return _TL_('All days');\r\n case 'Monday':\r\n return _TL_('Monday');\r\n case 'Tuesday':\r\n return _TL_('Tuesday');\r\n case 'Wednesday':\r\n return _TL_('Wednesday');\r\n case 'Thursday':\r\n return _TL_('Thursday');\r\n case 'Friday':\r\n return _TL_('Friday');\r\n case 'Saturday':\r\n return _TL_('Saturday');\r\n case 'Sunday':\r\n return _TL_('Sunday');\r\n case 'MondayToFriday':\r\n return _TL_('Monday - Friday');\r\n default:\r\n return _TL_('All days');\r\n }\r\n};\r\n\r\nexport const getMin = (min) => {\r\n switch (min) {\r\n case 0:\r\n return '00';\r\n case 15:\r\n return '15';\r\n case 30:\r\n return '30';\r\n case 45:\r\n return '45';\r\n default:\r\n return '00';\r\n }\r\n};\r\n\r\nexport const getTime = (hour, is12) => {\r\n switch (hour) {\r\n case 0:\r\n return is12 ? _TL_('12:{{min}} AM') : _TL_('00:{{min}}');\r\n case 1:\r\n return is12 ? _TL_('01:{{min}} AM') : _TL_('01:{{min}}');\r\n case 2:\r\n return is12 ? _TL_('02:{{min}} AM') : _TL_('02:{{min}}');\r\n case 3:\r\n return is12 ? _TL_('03:{{min}} AM') : _TL_('03:{{min}}');\r\n case 4:\r\n return is12 ? _TL_('04:{{min}} AM') : _TL_('04:{{min}}');\r\n case 5:\r\n return is12 ? _TL_('05:{{min}} AM') : _TL_('05:{{min}}');\r\n case 6:\r\n return is12 ? _TL_('06:{{min}} AM') : _TL_('06:{{min}}');\r\n case 7:\r\n return is12 ? _TL_('07:{{min}} AM') : _TL_('07:{{min}}');\r\n case 8:\r\n return is12 ? _TL_('08:{{min}} AM') : _TL_('08:{{min}}');\r\n case 9:\r\n return is12 ? _TL_('09:{{min}} AM') : _TL_('09:{{min}}');\r\n case 10:\r\n return is12 ? _TL_('10:{{min}} AM') : _TL_('10:{{min}}');\r\n case 11:\r\n return is12 ? _TL_('11:{{min}} AM') : _TL_('11:{{min}}');\r\n case 12:\r\n return is12 ? _TL_('12:{{min}} PM') : _TL_('12:{{min}}');\r\n case 13:\r\n return is12 ? _TL_('01:{{min}} PM') : _TL_('13:{{min}}');\r\n case 14:\r\n return is12 ? _TL_('02:{{min}} PM') : _TL_('14:{{min}}');\r\n case 15:\r\n return is12 ? _TL_('03:{{min}} PM') : _TL_('15:{{min}}');\r\n case 16:\r\n return is12 ? _TL_('04:{{min}} PM') : _TL_('16:{{min}}');\r\n case 17:\r\n return is12 ? _TL_('05:{{min}} PM') : _TL_('17:{{min}}');\r\n case 18:\r\n return is12 ? _TL_('06:{{min}} PM') : _TL_('18:{{min}}');\r\n case 19:\r\n return is12 ? _TL_('07:{{min}} PM') : _TL_('19:{{min}}');\r\n case 20:\r\n return is12 ? _TL_('08:{{min}} PM') : _TL_('20:{{min}}');\r\n case 21:\r\n return is12 ? _TL_('09:{{min}} PM') : _TL_('21:{{min}}');\r\n case 22:\r\n return is12 ? _TL_('10:{{min}} PM') : _TL_('22:{{min}}');\r\n case 23:\r\n return is12 ? _TL_('11:{{min}} PM') : _TL_('23:{{min}}');\r\n case 24:\r\n return is12 ? _TL_('12:{{min}} AM') : _TL_('24:{{min}}');\r\n default:\r\n return is12 ? _TL_('00:{{min}} AM') : _TL_('00:{{min}}');\r\n }\r\n};\r\n\r\n\r\nexport const getDayTimeDetails = (i18n, dayTime, is12, hideBidAdjustment = false) => {\r\n const startHour = dayTime().StartHour();\r\n const endHour = dayTime().EndHour();\r\n const startMin = getMin(minuteToSaveMap[dayTime().StartMinute()]);\r\n const endMin = getMin(minuteToSaveMap[dayTime().EndMinute()]);\r\n const dateTimePart = `${i18n.getString(getDay(dayTime().Day()))} ${i18n.getString(_TL_('from {{from}} to {{to}}'), {\r\n from: i18n.getString(getTime(startHour, is12), { min: startMin }),\r\n to: i18n.getString(getTime(endHour, is12), { min: endMin }),\r\n })}`;\r\n\r\n if (hideBidAdjustment) {\r\n return dateTimePart;\r\n }\r\n return `${dateTimePart}: ${(_.isUndefined(dayTime().BidAdjustmentType()) || dayTime().BidAdjustmentType() > 0) ? i18n.getString(_TL_('Increase By')) : i18n.getString(_TL_('Decrease By'))}\r\n ${_.isUndefined(dayTime().BidAdjustmentAmount()) ? 0 : dayTime().BidAdjustmentAmount()}%`;\r\n};\r\n\r\nexport const getAdScheduleDetails = (i18n, adScheduleView, hideBidAdjustment = false) => {\r\n if (adScheduleView) {\r\n const useCampaignSettings = adScheduleView.koModel.useCampaignSettings();\r\n const schedules = useCampaignSettings ? adScheduleView.koModel.campaignDayTimeRanges() : adScheduleView.koModel.dayTimeRanges();\r\n let details = '';\r\n const dateSettings = adScheduleView.getDateSettings();\r\n if (!_.isEmpty(dateSettings) && dateSettings.EndDate !== '1/1/3000') {\r\n details = i18n.getString(_TL_('Scheduled from {{from}} to {{to}}: '), { from: dateSettings.StartDate, to: dateSettings.EndDate });\r\n }\r\n\r\n const hideAdScheduleBidAdjustments = adScheduleView.koModel.hideAdScheduleBidAdjustments();\r\n if (!hideAdScheduleBidAdjustments) {\r\n const is12 = adScheduleView.koModel.timeDisplayType() === '12-hour';\r\n const len = schedules.length;\r\n schedules.forEach((schedule, index) => {\r\n details += getDayTimeDetails(i18n, schedule, is12, hideBidAdjustment);\r\n if (details && index < len - 1) {\r\n details += ', ';\r\n }\r\n });\r\n }\r\n const adScheduleUseSearcherTimeZone = adScheduleView.getAdScheduleUseSearcherTimeZone();\r\n if (adScheduleUseSearcherTimeZone) {\r\n details += ` ${i18n.getString(_TL_('In Ad viewer\\'s time zone'))}`;\r\n } else {\r\n details += ` ${i18n.getString(_TL_('In Your account\\'s time zone'))}`;\r\n }\r\n return details;\r\n }\r\n return '';\r\n};\r\n","export const dataDateRanges = {\r\n Today: 'Today',\r\n Yesterday: 'Yesterday',\r\n ThisWeekFromSun: 'ThisWeekFromSun',\r\n ThisWeekFromMon: 'ThisWeekFromMon',\r\n Last7Days: 'LastSevenDays',\r\n LastWeekStartingSun: 'LastWeekStartingSun',\r\n LastWeekStartingMon: 'LastWeekStartingMon',\r\n LastBusinessWeek: 'LastBusinessWeek',\r\n Last14Days: 'LastFourteenDays',\r\n ThisMonth: 'ThisMonth',\r\n Last30Days: 'LastThirtyDays',\r\n LastMonth: 'LastMonth',\r\n Last3Month: 'LastThreeMonths',\r\n Last6Month: 'LastSixMonths',\r\n ThisYear: 'ThisYear',\r\n LastYear: 'LastYear',\r\n AllTime: 'AllTime',\r\n};\r\n\r\nexport const frequencyGrains = {\r\n Hourly: 4,\r\n Daily: 0,\r\n Weekly: 1,\r\n Monthly: 2,\r\n Once: 3,\r\n};\r\n\r\nexport const weeklyOptions = {\r\n Monday: 1,\r\n Tuesday: 2,\r\n Wednesday: 3,\r\n Thursday: 4,\r\n Friday: 5,\r\n Saturday: 6,\r\n Sunday: 0,\r\n};\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport { CronFormatter } from '@bingads-webui/cron-formatter';\r\nimport { fromLegacyTimeZone, toIANATimeZone } from '@bingads-webui-universal/time-zone-converter';\r\nimport { dataDateRanges, frequencyGrains, weeklyOptions } from './options';\r\n\r\nconst setupOptions = (locKey, key, value, i18n) => ({\r\n Value: key,\r\n Text: i18n.getString(locKey + value),\r\n});\r\n\r\nconst getDefaultTimeZone = accountTimeZone => (accountTimeZone > 0 ? accountTimeZone : 71);\r\n\r\nconst isHourlyNotifyMeRuleAllowed = (entity, permissions) => permissions.IsHourlyNotifyMeRuleAllowed === true && entity === 'Campaign';\r\n\r\nclass CustomDateSerializer {\r\n constructor({ date, hour, timeZone }) {\r\n this.year = date.getFullYear();\r\n this.month = date.getMonth() + 1;\r\n this.date = date.getDate();\r\n this.hour = hour;\r\n this.timeZone = timeZone;\r\n }\r\n\r\n toString() {\r\n return `${this.year}-${this.month}-${this.date} ${this.hour}`;\r\n }\r\n\r\n get format() {\r\n return 'yyyy-MM-dd H';\r\n }\r\n}\r\n\r\nfunction getUTCNowCustomDateSerializer() {\r\n const currentTime = new Date();\r\n const utcYear = currentTime.getUTCFullYear();\r\n const utcMonth = currentTime.getUTCMonth();\r\n const utcDate = currentTime.getUTCDate();\r\n const utcHours = currentTime.getUTCHours();\r\n\r\n currentTime.setFullYear(utcYear);\r\n currentTime.setMonth(utcMonth);\r\n currentTime.setDate(utcDate);\r\n\r\n return new CustomDateSerializer({\r\n date: currentTime,\r\n hour: utcHours,\r\n timeZone: 'UTC',\r\n });\r\n}\r\n\r\nexport class RuleCronSelectionviewModel {\r\n constructor({\r\n i18n,\r\n permissions,\r\n accountTimeZone,\r\n selectedRule,\r\n stateMgr,\r\n preferenceSvc,\r\n appCfg,\r\n entity,\r\n isEmailOption,\r\n instrumentation,\r\n }) {\r\n const {\r\n frequencyGrain,\r\n dateRangePreset,\r\n monthlyOption,\r\n weeklyOption,\r\n dailyOption,\r\n timeZoneOption,\r\n runOnceDate,\r\n } = selectedRule || {};\r\n\r\n const scenario = instrumentation[`authorRule${entity}`].create();\r\n this.activity = scenario.createRule.create();\r\n\r\n this.cronFormatter = new CronFormatter({ i18n });\r\n this.i18n = i18n;\r\n this.frequencyGrains = _.map(\r\n frequencyGrains,\r\n (key, value) => setupOptions('FrequencyGrain_', key, value, i18n)\r\n );\r\n this.dataDateRangeOptions = _.map(\r\n dataDateRanges,\r\n (key, value) => setupOptions('DataDateRangeOptions_', key, value, i18n)\r\n );\r\n this.monthlyOptions = _.map(_.range(1, 29), i => ({ Value: i, Text: i }));\r\n this.weeklyOptions = _.map(\r\n weeklyOptions,\r\n (key, value) => setupOptions('WeeklyOptions_', key, value, i18n)\r\n );\r\n this.dailyOptions = _.map(_.range(0, 24), hour => ({\r\n Value: hour,\r\n twelveHourDisplay: this.cronFormatter.formatHourOfDay(hour),\r\n twentyFourHourDisplay: `0${hour}`.slice(-2),\r\n }));\r\n\r\n this.isTwelveHourDisplay = ko.observable('true');\r\n if (permissions.IsUsePreferencesServiceEnabled === true) {\r\n preferenceSvc.initialize().then(() => {\r\n const prefix = appCfg.get('StateManagerKeyPrefix');\r\n const isTwelveHourDisplayPreference = preferenceSvc.findByName(`${prefix}isTwelveHourDisplay`);\r\n\r\n if (isTwelveHourDisplayPreference) {\r\n // unless it is set to 'false', by default it's 'true'\r\n const result = isTwelveHourDisplayPreference.Data === 'false' ? 'false' : 'true';\r\n this.isTwelveHourDisplay(result);\r\n }\r\n });\r\n } else {\r\n stateMgr.getItem('isTwelveHourDisplay', (err, state) => {\r\n if (!err && state) {\r\n this.isTwelveHourDisplay(_.isUndefined(state.permanent) ? 'true' : state.permanent);\r\n }\r\n });\r\n }\r\n this.timeZoneOptions = _.map(_.range(75, 0, -1), zone => ({ Value: zone, Text: i18n.getString(`TimeZoneId_${zone}`) }));\r\n this.selectedDataDateRangeOption = ko.observable(dateRangePreset);\r\n this.selectedMonthOption = ko.observable(monthlyOption);\r\n this.selectedWeekOption = ko.observable(weeklyOption);\r\n this.selectedDailyOption = ko.observable(dailyOption);\r\n this.selectedTimeZoneOption = ko.observable(timeZoneOption > 0 ?\r\n timeZoneOption :\r\n getDefaultTimeZone(accountTimeZone));\r\n this.selectedFrequencyGrain = ko.observable(frequencyGrain);\r\n this.selectedFrequencyGrain.subscribe((newValue) => {\r\n switch (newValue) {\r\n case frequencyGrains.Monthly:\r\n this.selectedDataDateRangeOption(dataDateRanges.Last30Days);\r\n break;\r\n case frequencyGrains.Weekly:\r\n this.selectedDataDateRangeOption(dataDateRanges.Last7Days);\r\n break;\r\n case frequencyGrains.Once:\r\n this.selectedDataDateRangeOption(dataDateRanges.Today);\r\n break;\r\n default:\r\n this.selectedDataDateRangeOption(dataDateRanges.Yesterday);\r\n }\r\n });\r\n\r\n this.isTwelveHourDisplayFormat = ko.computed({\r\n read() {\r\n return this.isTwelveHourDisplay();\r\n },\r\n write(v) {\r\n this.isTwelveHourDisplay(v);\r\n if (permissions.IsUsePreferencesServiceEnabled === true) {\r\n const prefix = appCfg.get('StateManagerKeyPrefix');\r\n const data = { Name: `${prefix}isTwelveHourDisplay`, Data: v };\r\n preferenceSvc.setAtUserLevel(data);\r\n } else {\r\n stateMgr.setItem('permanent', 'isTwelveHourDisplay', v);\r\n }\r\n },\r\n }, this);\r\n\r\n this.runOnceDate = ko.observable(runOnceDate);\r\n this.isMonthOption = ko.computed(() =>\r\n this.selectedFrequencyGrain() === frequencyGrains.Monthly, this, {\r\n pure: true,\r\n });\r\n this.isWeekOption = ko.computed(() =>\r\n this.selectedFrequencyGrain() === frequencyGrains.Weekly, this, {\r\n pure: true,\r\n });\r\n this.isOnceOption = ko.computed(() =>\r\n this.selectedFrequencyGrain() === frequencyGrains.Once, this, {\r\n pure: true,\r\n });\r\n this.isHourlyOption = ko.computed(() =>\r\n this.selectedFrequencyGrain() === frequencyGrains.Hourly, this, {\r\n pure: true,\r\n });\r\n this.frequencyErrorMessage = ko.observable('');\r\n this.selectedFrequencyGrain.subscribe(() => {\r\n this.frequencyErrorMessage('');\r\n });\r\n this.frequencyErrorRole = ko.computed(() => (this.frequencyErrorMessage() === '' ? 'none' : 'alert'), this);\r\n this.startInput = ko.computed({\r\n read: () => (this.runOnceDate() ? i18n.formatDate(this.runOnceDate(), { timeZone: null }) : ''),\r\n write: (value) => {\r\n this.frequencyErrorMessage('');\r\n\r\n if (!_.isNull(value) &&\r\n !_.isEmpty(value.trim()) &&\r\n !_.isNull(i18n.parseDate(value.trim(), { timeZone: null }))) {\r\n this.runOnceDate(i18n.parseDate(value.trim(), { timeZone: null }));\r\n } else {\r\n this.frequencyErrorMessage(i18n.getString('Validate_ScheduleTimeInvalid'));\r\n }\r\n },\r\n }, this, {\r\n pure: true,\r\n });\r\n\r\n // add Hourly notify-me rule for users under pilot\r\n if (!isHourlyNotifyMeRuleAllowed(entity, permissions) || isEmailOption) {\r\n this.frequencyGrains = _.reject(\r\n this.frequencyGrains,\r\n item => item.Value === frequencyGrains.Hourly\r\n );\r\n }\r\n }\r\n\r\n validate() {\r\n const date = this.runOnceDate();\r\n\r\n if (date && this.isOnceOption()) {\r\n const selectedTimeZone = toIANATimeZone(fromLegacyTimeZone(this.selectedTimeZoneOption()));\r\n const selectedTime = new CustomDateSerializer({\r\n date,\r\n hour: this.selectedDailyOption(),\r\n timeZone: selectedTimeZone,\r\n });\r\n const convertedSelectedTime = this.i18n.parseDate(\r\n selectedTime.toString(),\r\n {\r\n timeZone: selectedTime.timeZone,\r\n raw: selectedTime.format,\r\n }\r\n ); // convert to account timezone\r\n\r\n const currentTime = getUTCNowCustomDateSerializer();\r\n const convertedCurrentTime = this.i18n.parseDate(\r\n currentTime.toString(),\r\n {\r\n raw: currentTime.format,\r\n timeZone: currentTime.timeZone,\r\n }\r\n ); // convert now to account timezone\r\n\r\n this.activity.trace(`[TestingClientSideValidation] Validating selected run once time. Selected time zone: ${selectedTimeZone}. Selected time: ${selectedTime.toString()}. Converted rule run time: ${convertedSelectedTime.toString()}. Converted current time: ${convertedCurrentTime.toString()}. Is run time in future? ${convertedCurrentTime < convertedSelectedTime}`);\r\n }\r\n return true;\r\n }\r\n\r\n getCron() {\r\n let cron = '* 23 * * *'; // some default value until we integrate run once.\r\n switch (this.selectedFrequencyGrain()) {\r\n case frequencyGrains.Hourly:\r\n cron = this.cronFormatter.toCronString({\r\n min: 0,\r\n });\r\n break;\r\n case frequencyGrains.Weekly:\r\n cron = this.cronFormatter.toCronString({\r\n hour: this.selectedDailyOption(),\r\n dayOfWeek: this.selectedWeekOption(),\r\n });\r\n break;\r\n case frequencyGrains.Monthly:\r\n cron = this.cronFormatter.toCronString({\r\n hour: this.selectedDailyOption(),\r\n dayOfMonth: this.selectedMonthOption(),\r\n });\r\n break;\r\n case frequencyGrains.Once:\r\n cron = this.cronFormatter.toCronString({\r\n hour: this.selectedDailyOption(),\r\n dayOfMonth: this.runOnceDate().getDate(),\r\n month: this.runOnceDate().getMonth() + 1,\r\n year: this.runOnceDate().getFullYear(),\r\n });\r\n break;\r\n case frequencyGrains.Daily:\r\n default:\r\n cron = this.cronFormatter.toCronString({\r\n hour: this.selectedDailyOption(),\r\n });\r\n break;\r\n }\r\n\r\n return cron;\r\n }\r\n}\r\n","import { todayNYearsAgo, lastNDate } from '@bingads-webui-universal/primitive-utilities';\r\nimport { DatePicker } from '@bingads-webui/date-picker';\r\nimport { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './template.pug';\r\nimport { RuleCronSelectionviewModel } from './viewmodel';\r\n\r\nexport class RuleCronSelectionview extends PureKnockoutView {\r\n initialize({\r\n i18n,\r\n permissions,\r\n accountTimeZone,\r\n selectedRule,\r\n stateMgr,\r\n preferenceSvc,\r\n appCfg,\r\n entity,\r\n isEmailOption,\r\n instrumentation,\r\n isForVNext = false,\r\n }) {\r\n this.options = {\r\n i18n,\r\n permissions,\r\n accountTimeZone,\r\n selectedRule,\r\n stateMgr,\r\n preferenceSvc,\r\n appCfg,\r\n entity,\r\n isEmailOption,\r\n instrumentation,\r\n };\r\n super.initialize(this.options);\r\n this.i18n = i18n;\r\n this.isForVNext = isForVNext;\r\n this.renderRunOnceDatePicker();\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get ViewModel() {\r\n return RuleCronSelectionviewModel;\r\n }\r\n\r\n renderRunOnceDatePicker() {\r\n const today = lastNDate(new Date());\r\n const end = todayNYearsAgo(today, -10);\r\n const needToUpdateDate = this.options.selectedRule.runOnceDate < today;\r\n const selectedDate = needToUpdateDate ?\r\n today :\r\n this.options.selectedRule.runOnceDate;\r\n\r\n this.runOnceDatePicker = new DatePicker({\r\n selectedDate,\r\n minDate: today,\r\n maxDate: end,\r\n });\r\n\r\n this.runOnceDatePicker.on('dateChanged', (newDate) => {\r\n if (newDate) {\r\n this.viewModel.startInput(this.i18n.formatDate(newDate, { timeZone: null }));\r\n }\r\n });\r\n\r\n if (needToUpdateDate) {\r\n this.runOnceDatePicker.trigger('dateChanged');\r\n }\r\n\r\n this.setChild('date-picker', this.runOnceDatePicker);\r\n }\r\n\r\n getCron() {\r\n return this.viewModel.getCron();\r\n }\r\n\r\n getSelectedDataDateRangeOption() {\r\n return this.viewModel.selectedDataDateRangeOption();\r\n }\r\n\r\n validate() {\r\n return this.viewModel.validate();\r\n }\r\n}\r\n","export const emailOptions = {\r\n Always: 'Always',\r\n OnChangeOrError: 'OnChange, OnError',\r\n OnError: 'OnError',\r\n None: 'None',\r\n};\r\n\r\nexport const scopeOptions = {\r\n Selected: 0,\r\n AllEnabled: 1,\r\n AllButRemoved: 2,\r\n};\r\n\r\nexport const entityRelatedOptions = {\r\n EnabledStatusFilterValue: {\r\n Campaign: ['121', '126'],\r\n Ad: ['1'],\r\n AdGroup: ['141', '126'],\r\n Keyword: ['161'],\r\n AssetGroup: ['141'],\r\n },\r\n EnabledStatusFilterQueryOdata: {\r\n AdGroup: \"Status eq Enum.AdGroupStatus'Active' or Status eq Enum.AdGroupStatus'CampaignBudgetPaused'\",\r\n Ad: \"Status eq Enum.AdStatus'Active'\",\r\n Campaign: \"Status eq Enum.CampaignStatus'Active' or Status eq Enum.CampaignStatus'BudgetPaused'\",\r\n Keyword: \"Status eq Enum.OrderItemStatus'Active'\",\r\n AssetGroup: \"Status eq Enum.AssetGroupStatus'Active'\",\r\n },\r\n EnabledStatusFilterColumn: {\r\n Campaign: 'CampaignStatus',\r\n Ad: 'AdUiDisplayStatus',\r\n AdGroup: 'AdGroupStatus',\r\n Keyword: 'KeywordStatus',\r\n AssetGroup: 'AssetGroupStatus',\r\n },\r\n};\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport { scopeOptions, emailOptions } from './options';\r\n\r\nexport class RuleAuthoringViewModel {\r\n constructor({\r\n selectedRule,\r\n i18n,\r\n isActionText,\r\n currentUserId,\r\n }) {\r\n this.i18n = i18n;\r\n this.maxRuleNameLength = 255;\r\n this.inPreviewMode = ko.observable(false);\r\n this.emailOptions = _.map(emailOptions, (key, value) => ({\r\n Value: key,\r\n Text: i18n.getString(`NotificationType_${value}`),\r\n }));\r\n this.selectedRule = selectedRule;\r\n this.entity = this.selectedRule.entity;\r\n this.menuAction = this.selectedRule.action;\r\n this.isEditRule = this.selectedRule.id != null;\r\n this.isEditRuleWithDifferentUser = this.selectedRule.id != null &&\r\n this.selectedRule.modifiedBy.id !== currentUserId;\r\n this.editRuleId = this.selectedRule.id != null ? this.selectedRule.id : null;\r\n this.editRuleWarningMessage = this.selectedRule.id != null ?\r\n i18n.getString('RulesManagement_EditRuleWarningMessage')\r\n .replace(/\\{0\\}/g, this.selectedRule.modifiedBy.name) :\r\n '';\r\n const actionName = i18n.getString(`RuleAction_${this.entity}_${this.menuAction}`);\r\n const ruleName = this.selectedRule.id == null ? actionName : this.selectedRule.name;\r\n let titleName = this.selectedRule.id == null ?\r\n i18n.getString('RuleAuthoring_Title') :\r\n i18n.getString('RuleAuthoring_Title_EditRule');\r\n titleName += ruleName;\r\n this.titleName = ko.observable(titleName);\r\n this.ruleName = ko.observable(ruleName);\r\n this.isActionText = ko.observable(isActionText);\r\n this.actionText = ko.observable(actionName);\r\n this.titleDescription = ko.observable((i18n.getString('RuleAuthoring_Description') || '').replace('LearnHowAriaLabel', i18n.getString('RuleAuthoring_Description_LearnHowAriaLabel')).replace('ExamplesAriaLabel', i18n.getString('RuleAuthoring_Description_ExamplesAriaLabel')));\r\n this.showCampaigns = this.entity === 'Campaign';\r\n this.showAdGroups = this.entity === 'AdGroup';\r\n this.showCampaignAdGroupSelector = ko.observable(false);\r\n this.isSelectorOpen = ko.observable(false);\r\n this.setupScopeOption();\r\n\r\n // Common setting shared accross all entities.\r\n this.selectedScopeInfo = this.selectedRule.scopeInfo;\r\n this.selectedEmailOption = ko.observable(this.selectedRule.emailOption);\r\n this.isEmailOption = ko.computed(() => this.menuAction !== 'SendEmail', this, {\r\n pure: true,\r\n });\r\n\r\n // validate related properties.\r\n this.scopeErrorMessage = ko.observable('');\r\n this.ruleNameErrorMessage = ko.observable('');\r\n this.selectedScopeOption.subscribe(() => {\r\n this.scopeErrorMessage('');\r\n }, this);\r\n this.ruleName.subscribe(() => {\r\n this.ruleNameErrorMessage('');\r\n }, this);\r\n\r\n this.ruleNameErrorRole = ko.computed(() => (this.ruleNameErrorMessage() === '' ? 'none' : 'alert'), this);\r\n this.scopeErrorRole = ko.computed(() => (this.scopeErrorMessage() === '' ? 'none' : 'alert'), this);\r\n\r\n this.validate = () => {\r\n this.scopeErrorMessage('');\r\n this.ruleNameErrorMessage('');\r\n let isResultValid = true;\r\n const scopeInfo = this.selectedScopeInfo;\r\n if (this.selectedScopeOption() === scopeOptions.Selected &&\r\n (_.isNull(scopeInfo) ||\r\n _.isNull(scopeInfo.selectedRowIds) ||\r\n _.isNull(scopeInfo.selectedRowIds.length) ||\r\n scopeInfo.selectedRowIds.length <= 0)) {\r\n this.scopeErrorMessage(i18n.getString('Validate_RowSelectionRequire'));\r\n isResultValid = false;\r\n }\r\n\r\n if (this.ruleName() == null || this.ruleName().length === 0 ||\r\n this.ruleName().length > this.maxRuleNameLength) {\r\n this.ruleNameErrorMessage(i18n.getString('Validate_InvalidRuleName'));\r\n isResultValid = false;\r\n }\r\n return isResultValid;\r\n };\r\n }\r\n\r\n setupScopeOption() {\r\n const { scopeInfo } = this.selectedRule;\r\n let level = 'Account';\r\n\r\n if (_.isNumber(this.selectedRule.scopeInfo.adGroupId)) {\r\n level = 'AdGroup';\r\n } else if (_.isNumber(this.selectedRule.scopeInfo.campaignId)) {\r\n level = 'Campaign';\r\n }\r\n\r\n const options = [];\r\n\r\n _.each(scopeOptions, (key, value) => {\r\n if (this.menuAction === 'Enable' && key === scopeOptions.AllEnabled) {\r\n return;\r\n }\r\n\r\n if (!(this.isEditRule && (this.showCampaigns || this.showAdGroups))\r\n && scopeInfo.allPages && key === scopeOptions.Selected) {\r\n return;\r\n }\r\n\r\n options.push({\r\n Value: key,\r\n Text: this.i18n.getString(`RuleScope_${this.entity}_${value}_${level}`),\r\n });\r\n });\r\n\r\n this.defaultSelectedScopeOptionText = options[0].Text;\r\n this.selectedScopeOption = ko.observable(this.selectedRule.scopeOption);\r\n\r\n options[0].Text = this.defaultSelectedScopeOptionText;\r\n const len = scopeInfo.selectedRowCount;\r\n if (scopeInfo.allPages === false && !_.isNull(len) && len > 0) {\r\n this.selectedScopeOption = ko.observable(scopeOptions.Selected);\r\n }\r\n\r\n this.scopeOptions = ko.observable(options);\r\n }\r\n\r\n updateSelectedEntityCount(info) {\r\n this.selectedScopeInfo = info;\r\n let selectedScopeOption = this.selectedScopeOption();\r\n\r\n const { allPages, selectedRowCount } = info || {};\r\n const updatedScopeOptions = _.clone(this.scopeOptions());\r\n\r\n // currently for selected, we only show 'selected' without numbers\r\n updatedScopeOptions[0].Text = this.defaultSelectedScopeOptionText;\r\n if (allPages) {\r\n selectedScopeOption = scopeOptions.AllButRemoved;\r\n } else if (selectedRowCount > 0) {\r\n selectedScopeOption = scopeOptions.Selected;\r\n }\r\n\r\n // trigger the ko binding update\r\n this.scopeOptions([]);\r\n this.scopeOptions(updatedScopeOptions);\r\n if (selectedScopeOption !== this.selectedScopeOption()) {\r\n this.selectedScopeOption(selectedScopeOption);\r\n }\r\n }\r\n}\r\n","export function refresh(grid) {\r\n grid.gridView.refresh(true);\r\n}\r\n\r\nexport function getSortInfo(grid) {\r\n const { name, directionIndex } = grid.gridView.get('sortableHeader') || {};\r\n\r\n if (name) {\r\n const column = grid.gridView.columnWithName(name);\r\n\r\n // The sortable column in preference might not be selected in the current grid view.\r\n if (column) {\r\n const sortedKey = column.sortable.key;\r\n\r\n return directionIndex < 0 ? `${sortedKey} desc` : sortedKey;\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport function isCrossPageAllSelected(grid) {\r\n return grid.pgridPlugins.crossPageSelectAll.isAllSelected;\r\n}\r\n\r\nexport function getSelectedRowIds(grid) {\r\n if (grid) {\r\n return grid.gridView.selectedKeys();\r\n }\r\n return [];\r\n}\r\n\r\nexport function getSelectedRowsCount(grid) {\r\n return isCrossPageAllSelected(grid) ?\r\n grid.gridView.totalCountRows :\r\n getSelectedRowIds(grid).length;\r\n}\r\n","import { formatStatus, formatBidBudget, formatEmail } from '@bingads-webui-campaign/bulk-operation-base';\r\n\r\nconst PauseActionValue = {\r\n Campaign: 'UserPaused',\r\n Ad: 'Paused',\r\n AdGroup: 'Paused',\r\n Keyword: 'Paused',\r\n AssetGroup: 'Paused',\r\n};\r\n\r\nexport class EntitySettingBase {\r\n constructor({\r\n entity,\r\n i18n,\r\n selectedRule,\r\n accountCurrencyCode,\r\n bidBudgetRange,\r\n }) {\r\n this.i18n = i18n;\r\n this.menuAction = selectedRule.action;\r\n this.selectedRule = selectedRule;\r\n this.bidBudgetRange = bidBudgetRange;\r\n this.accountCurrencyCode = accountCurrencyCode;\r\n this.entity = entity;\r\n\r\n if (this.isActionNoneText()) {\r\n this.actionView = this.createActionView();\r\n } else {\r\n this.actionView = null;\r\n }\r\n\r\n if (this.isActionNoneText()) {\r\n this.setPreviewErrorHeaders();\r\n } else {\r\n this.previewOldHeader = i18n.getString('BulkEdit_OldStatusHeader');\r\n this.previewNewHeader = i18n.getString('BulkEdit_NewStatusHeader');\r\n this.previewAttempedHeader = i18n.getString('BulkEdit_AttemptedStatusHeader');\r\n }\r\n\r\n this.setUpPreviewEntityNameAndEntityKey();\r\n }\r\n\r\n getActionView() {\r\n return this.actionView;\r\n }\r\n\r\n isActionText() {\r\n return !this.isActionNoneText();\r\n }\r\n\r\n isActionNoneText() {\r\n return false;\r\n }\r\n\r\n setUpPreviewEntityNameAndEntityKey() {\r\n this.previewEntityName = this.i18n.getString('BulkEdit_Ad_EntityNameHeader');\r\n this.previewEntityKeys = ['AdTitle', 'AdHeadline'];\r\n this.defaultEntityValue = `{${this.i18n.getString('Ad_DSA_Title')}}`;\r\n }\r\n\r\n formatPreviewResults(results) {\r\n if (this.isActionNoneText()) {\r\n return formatBidBudget(results, this.previewEntityKeys, this.i18n);\r\n } else if (this.menuAction === 'Enable' || this.menuAction === 'Pause') {\r\n return formatStatus(\r\n results,\r\n this.previewEntityKeys,\r\n this.i18n,\r\n this.defaultEntityValue,\r\n this.entity\r\n );\r\n }\r\n return formatEmail(results, this.previewEntityKeys, this.defaultEntityValue);\r\n }\r\n\r\n setPreviewErrorHeaders() {\r\n }\r\n\r\n getPreviewHeaders() {\r\n return this.menuAction === 'SendEmail' ?\r\n [this.previewEntityName] :\r\n [this.previewEntityName, this.previewOldHeader, this.previewNewHeader];\r\n }\r\n\r\n isActionValidate() {\r\n return !this.isActionNoneText() || this.actionView.validate();\r\n }\r\n\r\n getAction() {\r\n if (this.isActionNoneText()) {\r\n return this.actionView.getUserAction();\r\n }\r\n\r\n switch (this.menuAction) {\r\n case 'Enable':\r\n return {\r\n Actions: [{\r\n '@odata.type': '#Model.TextAction',\r\n Property: 'Status',\r\n ActionType: 'Set',\r\n Value: 'Active',\r\n }],\r\n };\r\n case 'Pause':\r\n return {\r\n Actions: [{\r\n '@odata.type': '#Model.TextAction',\r\n Property: 'Status',\r\n ActionType: 'Set',\r\n Value: PauseActionValue[this.entity],\r\n }],\r\n };\r\n case 'SendEmail':\r\n return {\r\n Actions: [{\r\n '@odata.type': '#Model.QueryOnlyAction',\r\n }],\r\n };\r\n default:\r\n return null;\r\n }\r\n }\r\n}\r\n","export const changeBudgetActions = {\r\n Set: 'SetAmount',\r\n Increase: 'IncreaseBudget',\r\n Decrease: 'DecreaseBudget',\r\n};\r\n\r\nexport const changeBidActions = {\r\n SetAmount: 'SetAmount',\r\n IncreaseBid: 'IncreaseBid',\r\n DecreaseBid: 'DecreaseBid',\r\n BestBid: 'BestBid',\r\n FirstPageBid: 'FirstPageBid',\r\n};\r\n\r\nexport const PauseActionValue = {\r\n Campaign: 'UserPaused',\r\n Ad: 'Paused',\r\n AdGroup: 'Paused',\r\n Keyword: 'Paused',\r\n AssetGroup: 'Paused',\r\n};\r\n\r\nexport const nonTextActionsForKeyword = {\r\n RaiseToTopOfPage: 'RaiseToTopOfPage',\r\n RaiseToFirstPage: 'RaiseToFirstPage',\r\n ChangeBid: 'ChangeBid',\r\n};\r\n","import _ from 'underscore';\r\n\r\nfunction validateBidBudgetInput(i18n, usePercentValidation, value, valueRange, localizedErrors) {\r\n const decimalValue = i18n.parseDecimal(value);\r\n if (_.isNaN(decimalValue)) {\r\n if (usePercentValidation) {\r\n return localizedErrors.invalidPercentageError;\r\n }\r\n return localizedErrors.invalidValueError;\r\n }\r\n\r\n const minValue = usePercentValidation ? 0 : valueRange.FloorValue;\r\n const maxValue = usePercentValidation ? Number.MAX_VALUE : valueRange.CeilingValue;\r\n\r\n if ((decimalValue < minValue && !usePercentValidation) ||\r\n (decimalValue <= minValue && usePercentValidation) ||\r\n decimalValue > maxValue) {\r\n return localizedErrors.outOfRangError;\r\n }\r\n\r\n return '';\r\n}\r\n\r\nexport function validateBidInput(value, i18n, usePercentValidation, keywordBidRange) {\r\n return validateBidBudgetInput(\r\n i18n,\r\n usePercentValidation,\r\n value,\r\n keywordBidRange,\r\n {\r\n invalidPercentageError: i18n.getString('BulkEdit_Keyword_InvalidPercentageError'),\r\n invalidValueError: i18n.getString('BulkEdit_Keyword_InvalidBidError'),\r\n outOfRangError: i18n.getString('BulkEdit_Keyword_BidOutOfRangeError'),\r\n }\r\n );\r\n}\r\n\r\nexport function validateBudgetInput(value, i18n, usePercentValidation, budgetRange) {\r\n return validateBidBudgetInput(\r\n i18n,\r\n usePercentValidation,\r\n value,\r\n budgetRange,\r\n {\r\n invalidPercentageError: i18n.getString('BulkEdit_Keyword_InvalidPercentageError'),\r\n invalidValueError: i18n.getString('BulkEdit_Campaign_InvalidBudgetError'),\r\n outOfRangError: i18n.getString('BulkEdit_Campaign_BudgetOutOfRangeError'),\r\n }\r\n );\r\n}\r\n","import ko from 'knockout';\r\nimport { numericActionTypes } from '@bingads-webui-campaign/bulk-operation-base';\r\nimport { changeBudgetActions } from '../constants';\r\nimport { validateBudgetInput } from '../util';\r\n\r\nconst defaultAction = {\r\n action: changeBudgetActions.Increase,\r\n budgetValue: null,\r\n unit: 'percentage',\r\n useLimitValue: true,\r\n limitValue: null,\r\n isDailyBudget: true,\r\n};\r\n\r\nexport class ChangeBudgetActionViewModel {\r\n constructor({\r\n i18n,\r\n accountCurrencyCode,\r\n budgetRange,\r\n selectedRule,\r\n }) {\r\n let nonTextActionInfo = defaultAction;\r\n if (selectedRule && selectedRule.id > 0) {\r\n nonTextActionInfo = selectedRule.nonTextAction;\r\n }\r\n this.accountCurrencyCode = accountCurrencyCode;\r\n this.actions = [{\r\n Value: changeBudgetActions.Increase,\r\n Text: i18n.getString('BulkEdit_Campaign_IncreaseBudgetOption'),\r\n }, {\r\n Value: changeBudgetActions.Decrease,\r\n Text: i18n.getString('BulkEdit_Campaign_DecreaseBudgetOption'),\r\n }];\r\n this.selectedAction = ko.observable(nonTextActionInfo.action);\r\n this.budgetErrorMessage = ko.observable('');\r\n this.budgetLimitErrorMessage = ko.observable('');\r\n\r\n this.selectedAction.subscribe(() => {\r\n this.budgetErrorMessage('');\r\n }, this);\r\n\r\n this.isIncreaseBudgetHelp = ko.computed(() =>\r\n this.selectedAction() === changeBudgetActions.Increase, this);\r\n this.units = [{\r\n Value: 'percentage',\r\n Text: '%',\r\n }, {\r\n Value: 'absolute',\r\n Text: accountCurrencyCode,\r\n }];\r\n this.selectedUnit = ko.observable(nonTextActionInfo.unit);\r\n\r\n this.budgetValue = ko.observable(nonTextActionInfo.budgetValue);\r\n this.budgetValue.subscribe(() => {\r\n this.budgetErrorMessage('');\r\n }, this);\r\n\r\n this.limitValue = ko.observable(nonTextActionInfo.limitValue);\r\n this.limitValue.subscribe(() => {\r\n this.budgetLimitErrorMessage('');\r\n }, this);\r\n\r\n this.useLimitValue = ko.observable(nonTextActionInfo.useLimitValue);\r\n this.useLimitValue.subscribe(() => {\r\n this.budgetLimitErrorMessage('');\r\n }, this);\r\n\r\n this.limitBudgetLabelText = ko.computed(() => {\r\n if (this.selectedAction() === changeBudgetActions.Increase) {\r\n return i18n.getString('BulkEdit_Campaign_UpperBudgetLimit');\r\n }\r\n\r\n return i18n.getString('BulKEdit_Campaign_LowerBudgetLimit');\r\n }, this);\r\n\r\n this.validate = () => {\r\n this.budgetErrorMessage('');\r\n this.budgetLimitErrorMessage('');\r\n\r\n const usePercentValidation = this.selectedUnit() === 'percentage';\r\n if (!this.budgetValue()) {\r\n this.budgetErrorMessage(usePercentValidation ?\r\n i18n.getString('BulkEdit_Keyword_MissingPercentageError') :\r\n i18n.getString('BulkEdit_Campaign_MissingBudgetError'));\r\n return false;\r\n }\r\n\r\n this.budgetErrorMessage(validateBudgetInput(\r\n this.budgetValue(),\r\n i18n, usePercentValidation, budgetRange\r\n ));\r\n if (this.budgetErrorMessage() !== '') {\r\n return false;\r\n }\r\n\r\n if (this.useLimitValue()) {\r\n if (!this.limitValue()) {\r\n this.budgetLimitErrorMessage(this.selectedAction() === changeBudgetActions.Increase ?\r\n i18n.getString('BulkEdit_Campaign_MissingUpperBudgetLimitError') :\r\n i18n.getString('BulkEdit_Campaign_MissingLowerBudgetLimitError'));\r\n return false;\r\n }\r\n\r\n this.budgetLimitErrorMessage(validateBudgetInput(\r\n this.limitValue(),\r\n i18n,\r\n false,\r\n budgetRange\r\n ));\r\n return this.budgetLimitErrorMessage() === '';\r\n }\r\n\r\n return true;\r\n };\r\n\r\n this.getUserAction = () => {\r\n const limitValue = this.useLimitValue() && this.limitValue() ?\r\n i18n.parseDecimal(this.limitValue()) :\r\n null;\r\n let budgetAmount = this.budgetValue() ? i18n.parseDecimal(this.budgetValue()) : null;\r\n if (this.selectedAction() === changeBudgetActions.Decrease) {\r\n budgetAmount *= -1;\r\n }\r\n const actionType = this.selectedUnit() === 'percentage' ?\r\n numericActionTypes.changeByPercent :\r\n numericActionTypes.changeByAmount;\r\n\r\n return {\r\n Actions: [{\r\n '@odata.type': '#Model.NumericAction',\r\n Property: 'Budget/Amount',\r\n ActionType: actionType,\r\n Value: budgetAmount,\r\n Limit: limitValue,\r\n }],\r\n };\r\n };\r\n }\r\n}\r\n","import { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './changebudget.pug';\r\nimport { ChangeBudgetActionViewModel } from './viewmodel';\r\n\r\n\r\nexport class ChangeBudgetActionView extends PureKnockoutView {\r\n initialize({\r\n i18n,\r\n accountCurrencyCode,\r\n budgetRange,\r\n selectedRule,\r\n }) {\r\n this.options = {\r\n i18n,\r\n accountCurrencyCode,\r\n budgetRange,\r\n selectedRule,\r\n };\r\n super.initialize(this.options);\r\n this.i18n = i18n;\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get ViewModel() {\r\n return ChangeBudgetActionViewModel;\r\n }\r\n\r\n validate() {\r\n return this.viewModel.validate();\r\n }\r\n\r\n getUserAction() {\r\n return this.viewModel.getUserAction();\r\n }\r\n}\r\n","import { ChangeBudgetActionView } from '../action-view/campaign/view';\r\nimport { EntitySettingBase } from './base';\r\n\r\nexport class CampaignSetting extends EntitySettingBase {\r\n isActionNoneText() {\r\n return this.menuAction === 'ChangeBudget';\r\n }\r\n\r\n createActionView() {\r\n return new ChangeBudgetActionView({\r\n i18n: this.i18n,\r\n accountCurrencyCode: this.accountCurrencyCode,\r\n selectedRule: this.selectedRule,\r\n budgetRange: this.bidBudgetRange,\r\n });\r\n }\r\n\r\n setUpPreviewEntityNameAndEntityKey() {\r\n this.previewEntityName = this.i18n.getString('BulkEdit_Campaign_EntityNameHeader');\r\n this.previewEntityKeys = ['CampaignName'];\r\n this.defaultEntityValue = '';\r\n }\r\n\r\n setPreviewErrorHeaders() {\r\n this.previewOldHeader = this.i18n.getString('BulkEdit_Campaign_OldBudgetHeader');\r\n this.previewNewHeader = this.i18n.getString('BulkEdit_Campaign_NewBudgetHeader');\r\n this.previewAttempedHeader = this.i18n.getString('BulkEdit_Campaign_AttemptedBudgetHeader');\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport { numericActionTypes } from '@bingads-webui-campaign/bulk-operation-base';\r\nimport { changeBidActions } from '../constants';\r\nimport { validateBidInput } from '../util';\r\n\r\nconst bidType = {\r\n search: 'Search',\r\n content: 'Content',\r\n};\r\n\r\nconst defaultAction = {\r\n action: changeBidActions.IncreaseBid,\r\n bidValue: null,\r\n bidType: bidType.search,\r\n unit: 'percentage',\r\n useLimitValue: true,\r\n limitValue: null,\r\n};\r\n\r\nexport class ChangeAdgroupBidActionViewModel {\r\n constructor({\r\n i18n,\r\n accountCurrencyCode,\r\n keywordBidRange,\r\n selectedRule,\r\n }) {\r\n this.i18n = i18n;\r\n this.keywordBidRange = keywordBidRange;\r\n let nonTextActionInfo = defaultAction;\r\n if (selectedRule && selectedRule.id > 0) {\r\n nonTextActionInfo = selectedRule.nonTextAction;\r\n }\r\n\r\n this.actions = [{\r\n Value: changeBidActions.IncreaseBid,\r\n Text: i18n.getString('BulkEdit_AdGroup_IncreaseBidOption'),\r\n }, {\r\n Value: changeBidActions.DecreaseBid,\r\n Text: i18n.getString('BulkEdit_AdGroup_DecreaseBidOption'),\r\n }];\r\n this.accountCurrencyCode = accountCurrencyCode;\r\n this.selectedAction = ko.observable(nonTextActionInfo.action);\r\n this.bidErrorMessage = ko.observable('');\r\n this.bidLimitErrorMessage = ko.observable('');\r\n\r\n this.selectedAction.subscribe(() => {\r\n this.bidErrorMessage('');\r\n }, this);\r\n\r\n this.bidTypes = [{\r\n Value: bidType.search,\r\n Text: i18n.getString('BulkEdit_AdGroup_SearchBid'),\r\n }];\r\n this.selectedBidType = ko.observable(nonTextActionInfo.bidType);\r\n\r\n this.selectedBidType.subscribe(() => {\r\n this.bidErrorMessage('');\r\n }, this);\r\n\r\n this.units = [{\r\n Value: 'percentage',\r\n Text: '%',\r\n }, {\r\n Value: 'absolute',\r\n Text: accountCurrencyCode,\r\n }];\r\n this.selectedUnit = ko.observable(nonTextActionInfo.unit);\r\n\r\n this.bidValue = ko.observable(nonTextActionInfo.bidValue);\r\n this.bidValue.subscribe(() => {\r\n this.bidErrorMessage('');\r\n }, this);\r\n\r\n this.limitValue = ko.observable(nonTextActionInfo.limitValue);\r\n this.limitValue.subscribe(() => {\r\n this.bidLimitErrorMessage('');\r\n }, this);\r\n\r\n this.useLimitValue = ko.observable(nonTextActionInfo.useLimitValue);\r\n\r\n this.useLimitValue.subscribe(() => {\r\n this.bidLimitErrorMessage('');\r\n }, this);\r\n\r\n this.limitBidLabelText = ko.computed(() => {\r\n if (this.selectedAction() === changeBidActions.IncreaseBid) {\r\n return i18n.getString('BulkEdit_AdGroup_UpperBidLimit');\r\n }\r\n return i18n.getString('BulkEdit_AdGroup_LowerBidLimit');\r\n }, this);\r\n\r\n this.validate = () => {\r\n this.bidErrorMessage('');\r\n this.bidLimitErrorMessage('');\r\n\r\n const usePercentValidation = this.selectedUnit() === 'percentage';\r\n if (!this.bidValue()) {\r\n this.bidErrorMessage(usePercentValidation ?\r\n i18n.getString('BulkEdit_Keyword_MissingPercentageError') :\r\n i18n.getString('BulkEdit_Keyword_MissingBidError'));\r\n return false;\r\n }\r\n\r\n this.bidErrorMessage(validateBidInput(\r\n this.bidValue(),\r\n i18n, usePercentValidation, keywordBidRange\r\n ));\r\n if (this.bidErrorMessage() !== '') {\r\n return false;\r\n }\r\n\r\n if (this.useLimitValue()) {\r\n if (!this.limitValue()) {\r\n if (this.selectedAction() === changeBidActions.IncreaseBid) {\r\n this.bidLimitErrorMessage(i18n.getString('BulkEdit_MissingUpperBidLimitError'));\r\n } else if (this.selectedAction() === changeBidActions.DecreaseBid) {\r\n this.bidLimitErrorMessage(i18n.getString('BulkEdit_MissingLowerBidLimitError'));\r\n }\r\n return false;\r\n }\r\n this.bidLimitErrorMessage(validateBidInput(\r\n this.limitValue(),\r\n i18n,\r\n false,\r\n keywordBidRange\r\n ));\r\n return this.bidLimitErrorMessage() === '';\r\n }\r\n\r\n return true;\r\n };\r\n\r\n this.getUserAction = () => {\r\n const selectedAction = this.selectedAction();\r\n const limitValue = this.useLimitValue() && this.limitValue() ?\r\n i18n.parseDecimal(this.limitValue()) :\r\n null;\r\n let bidAmount = this.bidValue() ? i18n.parseDecimal(this.bidValue()) : null;\r\n if (selectedAction === changeBidActions.DecreaseBid) {\r\n bidAmount *= -1;\r\n }\r\n const actionType = this.selectedUnit() === 'percentage' ?\r\n numericActionTypes.changeByPercent :\r\n numericActionTypes.changeByAmount;\r\n\r\n return {\r\n Actions: [{\r\n '@odata.type': '#Model.NumericAction',\r\n Property: 'SearchBid',\r\n ActionType: actionType,\r\n Value: bidAmount,\r\n Limit: limitValue,\r\n }],\r\n };\r\n };\r\n }\r\n}\r\n","import { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './changebid.pug';\r\nimport { ChangeAdgroupBidActionViewModel } from './viewmodel';\r\n\r\nexport class ChangeAdgroupBidActionView extends PureKnockoutView {\r\n initialize({\r\n i18n,\r\n accountCurrencyCode,\r\n keywordBidRange,\r\n selectedRule,\r\n }) {\r\n this.options = {\r\n i18n,\r\n accountCurrencyCode,\r\n keywordBidRange,\r\n selectedRule,\r\n };\r\n super.initialize(this.options);\r\n this.i18n = i18n;\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get ViewModel() {\r\n return ChangeAdgroupBidActionViewModel;\r\n }\r\n\r\n validate() {\r\n return this.viewModel.validate();\r\n }\r\n\r\n getUserAction() {\r\n return this.viewModel.getUserAction();\r\n }\r\n}\r\n","import { EntitySettingBase } from './base';\r\nimport { ChangeAdgroupBidActionView } from '../action-view/adgroup/view';\r\n\r\nexport class AdGroupSetting extends EntitySettingBase {\r\n isActionNoneText() {\r\n return this.menuAction === 'ChangeBid';\r\n }\r\n\r\n createActionView() {\r\n return new ChangeAdgroupBidActionView({\r\n i18n: this.i18n,\r\n accountCurrencyCode: this.accountCurrencyCode,\r\n selectedRule: this.selectedRule,\r\n keywordBidRange: this.bidBudgetRange,\r\n });\r\n }\r\n\r\n setUpPreviewEntityNameAndEntityKey() {\r\n this.previewEntityName = this.i18n.getString('BulkEdit_AdGroup_EntityNameHeader');\r\n this.previewEntityKeys = ['AdgroupName'];\r\n this.defaultEntityValue = '';\r\n }\r\n\r\n setPreviewErrorHeaders() {\r\n this.previewOldHeader = this.i18n.getString('BulkEdit_AdGroup_OldBidHeader');\r\n this.previewNewHeader = this.i18n.getString('BulkEdit_AdGroup_NewBidHeader');\r\n this.previewAttempedHeader = this.i18n.getString('BulkEdit_AdGroup_AttemptedBidHeader');\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport { numericActionTypes } from '@bingads-webui-campaign/bulk-operation-base';\r\nimport { changeBidActions, nonTextActionsForKeyword } from '../constants';\r\nimport { validateBidInput } from '../util';\r\n\r\nconst defaultAction = {\r\n action: changeBidActions.IncreaseBid,\r\n bidValue: null,\r\n unit: 'percentage',\r\n useLimitValue: true,\r\n limitValue: null,\r\n};\r\n\r\nexport class ChangeKeywordBidActionViewModel {\r\n constructor({\r\n i18n,\r\n accountCurrencyCode,\r\n keywordBidRange,\r\n selectedRule,\r\n }) {\r\n let nonTextActionInfo = defaultAction;\r\n\r\n this.isChangeByBid = true;\r\n if (selectedRule && selectedRule.id > 0) {\r\n nonTextActionInfo = selectedRule.nonTextAction;\r\n }\r\n\r\n if (selectedRule.action === nonTextActionsForKeyword.RaiseToTopOfPage) {\r\n nonTextActionInfo.action = changeBidActions.BestBid;\r\n this.isChangeByBid = false;\r\n } else if (selectedRule.action === nonTextActionsForKeyword.RaiseToFirstPage) {\r\n nonTextActionInfo.action = changeBidActions.FirstPageBid;\r\n this.isChangeByBid = false;\r\n }\r\n\r\n this.actions = [{\r\n Value: changeBidActions.IncreaseBid,\r\n Text: i18n.getString('BulkEdit_Keyword_IncreaseBidOption'),\r\n },\r\n {\r\n Value: changeBidActions.DecreaseBid,\r\n Text: i18n.getString('BulkEdit_Keyword_DecreaseBidOption'),\r\n }];\r\n this.selectedAction = ko.observable(this.isChangeByBid ? nonTextActionInfo.action : '');\r\n this.bidErrorMessage = ko.observable('');\r\n this.bidLimitErrorMessage = ko.observable('');\r\n const actionName = i18n.getString(`RuleAction_Keyword_${selectedRule.action}`);\r\n this.actionText = ko.observable(actionName);\r\n\r\n this.selectedAction.subscribe(() => {\r\n this.bidErrorMessage('');\r\n }, this);\r\n\r\n this.units = [{\r\n Value: 'percentage',\r\n Text: '%',\r\n },\r\n {\r\n Value: 'absolute',\r\n Text: accountCurrencyCode,\r\n }];\r\n this.selectedUnit = ko.observable(nonTextActionInfo.unit);\r\n\r\n this.bidValue = ko.observable(nonTextActionInfo.bidValue);\r\n this.bidValue.subscribe(() => {\r\n this.bidErrorMessage('');\r\n }, this);\r\n\r\n this.limitValue = ko.observable(nonTextActionInfo.limitValue);\r\n this.limitValue.subscribe(() => {\r\n this.bidLimitErrorMessage('');\r\n }, this);\r\n\r\n this.useLimitValue = ko.observable(nonTextActionInfo.useLimitValue);\r\n\r\n this.useLimitValue.subscribe(() => {\r\n this.bidLimitErrorMessage('');\r\n }, this);\r\n\r\n this.limitBidLabelText = ko.computed(() => {\r\n if (this.selectedAction() === changeBidActions.DecreaseBid) {\r\n return i18n.getString('BulKEdit_Keyword_LowerBidLimit');\r\n }\r\n return i18n.getString('BulkEdit_Keyword_UpperBidLimit');\r\n }, this);\r\n this.accountCurrencyCode = accountCurrencyCode;\r\n\r\n this.validate = () => {\r\n this.bidErrorMessage('');\r\n this.bidLimitErrorMessage('');\r\n\r\n const usePercentValidation = this.selectedUnit() === 'percentage';\r\n if (this.isChangeByBid && !this.bidValue()) {\r\n if (this.selectedUnit() === 'percentage') {\r\n this.bidErrorMessage(i18n.getString('BulkEdit_Keyword_MissingPercentageError'));\r\n } else {\r\n this.bidErrorMessage(i18n.getString('BulkEdit_Keyword_MissingBidError'));\r\n }\r\n return false;\r\n }\r\n\r\n if (this.isChangeByBid) {\r\n if (this.bidValue()) {\r\n this.bidErrorMessage(validateBidInput(\r\n this.bidValue(),\r\n i18n, usePercentValidation, keywordBidRange\r\n ));\r\n if (this.bidErrorMessage() !== '') {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n if (this.useLimitValue()) {\r\n if (!this.limitValue()) {\r\n if (this.selectedAction() === changeBidActions.IncreaseBid) {\r\n this.bidLimitErrorMessage(i18n.getString('BulkEdit_MissingUpperBidLimitError'));\r\n } else if (this.selectedAction() === changeBidActions.DecreaseBid) {\r\n this.bidLimitErrorMessage(i18n.getString('BulkEdit_MissingLowerBidLimitError'));\r\n }\r\n return false;\r\n }\r\n this.bidLimitErrorMessage(validateBidInput(\r\n this.limitValue(),\r\n i18n, false, keywordBidRange\r\n ));\r\n\r\n return this.bidLimitErrorMessage() === '';\r\n }\r\n\r\n return true;\r\n };\r\n\r\n this.getUserAction = () => {\r\n const limitValue = this.useLimitValue() && this.limitValue() ?\r\n i18n.parseDecimal(this.limitValue()) : null;\r\n\r\n const menuAction = selectedRule.action;\r\n if (menuAction === 'ChangeBid') {\r\n const selectedAction = this.selectedAction();\r\n let bidAmount = this.bidValue() ? i18n.parseDecimal(this.bidValue()) : null;\r\n if (selectedAction === changeBidActions.DecreaseBid) {\r\n bidAmount *= -1;\r\n }\r\n const actionType = this.selectedUnit() === 'percentage' ?\r\n numericActionTypes.changeByPercent :\r\n numericActionTypes.changeByAmount;\r\n return {\r\n Actions: [{\r\n '@odata.type': '#Model.NumericAction',\r\n Property: 'Bid/Amount',\r\n ActionType: actionType,\r\n Value: bidAmount,\r\n Limit: limitValue,\r\n }],\r\n };\r\n } return {\r\n Actions: [{\r\n '@odata.type': '#Model.BidEstimateAction',\r\n Property: 'Bid/Amount',\r\n ActionType: menuAction,\r\n Limit: limitValue,\r\n }],\r\n };\r\n };\r\n }\r\n}\r\n","import { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './changebid.pug';\r\nimport { ChangeKeywordBidActionViewModel } from './viewmodel';\r\n\r\nexport class ChangKeywordBidActionView extends PureKnockoutView {\r\n initialize({\r\n i18n,\r\n accountCurrencyCode,\r\n keywordBidRange,\r\n selectedRule,\r\n }) {\r\n this.options = {\r\n i18n,\r\n accountCurrencyCode,\r\n keywordBidRange,\r\n selectedRule,\r\n };\r\n super.initialize(this.options);\r\n this.i18n = i18n;\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get ViewModel() {\r\n return ChangeKeywordBidActionViewModel;\r\n }\r\n\r\n validate() {\r\n return this.viewModel.validate();\r\n }\r\n\r\n getUserAction() {\r\n return this.viewModel.getUserAction();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { EntitySettingBase } from './base';\r\nimport { ChangKeywordBidActionView } from '../action-view/keyword/view';\r\nimport { nonTextActionsForKeyword } from '../action-view/constants';\r\n\r\nexport class KeywordSetting extends EntitySettingBase {\r\n isActionNoneText() {\r\n return !_.isUndefined(nonTextActionsForKeyword[this.menuAction]);\r\n }\r\n\r\n setUpPreviewEntityNameAndEntityKey() {\r\n this.previewEntityName = this.i18n.getString('BulkEdit_Keyword_EntityNameHeader');\r\n this.previewEntityKeys = ['Keyword'];\r\n this.defaultEntityValue = '';\r\n }\r\n\r\n createActionView() {\r\n return new ChangKeywordBidActionView({\r\n i18n: this.i18n,\r\n accountCurrencyCode: this.accountCurrencyCode,\r\n selectedRule: this.selectedRule,\r\n keywordBidRange: this.bidBudgetRange,\r\n });\r\n }\r\n\r\n setPreviewErrorHeaders() {\r\n this.previewOldHeader = this.i18n.getString('BulkEdit_Keyword_OldBidHeader');\r\n this.previewNewHeader = this.i18n.getString('BulkEdit_Keyword_NewBidHeader');\r\n this.previewAttempedHeader = this.i18n.getString('BulkEdit_Keyword_AttemptedBidHeader');\r\n }\r\n}\r\n","import { EntitySettingBase } from './base';\r\n\r\nexport class AssetGroupSetting extends EntitySettingBase {\r\n setUpPreviewEntityNameAndEntityKey() {\r\n this.previewEntityName = this.i18n.getString(_TL_('Asset group'));\r\n this.previewEntityKeys = ['AssetGroupName'];\r\n this.defaultEntityValue = '';\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { toRuleDescription } from '@bingads-webui-campaign/bulk-operation-base';\r\nimport { legacyDeliveryStatus } from '@bingads-webui/filter-entity';\r\nimport { fromFilterEntityToLegacyFilter } from '@bingads-webui-campaign/filter-converter';\r\nimport { scopeOptions, entityRelatedOptions } from './options';\r\nimport * as gridHelper from './grid-helper';\r\n\r\nfunction replaceAtom(atom, oldKey, newKey) {\r\n if (oldKey in atom) {\r\n const newAtom = {\r\n ...atom,\r\n [newKey]: atom[oldKey],\r\n };\r\n delete newAtom[oldKey];\r\n return newAtom;\r\n }\r\n return atom;\r\n}\r\n\r\nfunction replaceKeyOfQuery(query, oldKey, newKey) {\r\n if (!query) return query;\r\n let finalQuery = { ...query };\r\n if (oldKey in finalQuery) {\r\n finalQuery = replaceAtom(finalQuery, oldKey, newKey);\r\n } else if ('$and' in finalQuery) {\r\n finalQuery.$and.forEach((value, index, array) => {\r\n // eslint-disable-next-line no-param-reassign\r\n array[index] = replaceAtom(value, oldKey, newKey);\r\n });\r\n }\r\n return finalQuery;\r\n}\r\n\r\nexport class RuleAuthoringHelper {\r\n constructor({\r\n i18n,\r\n permissions,\r\n }) {\r\n this.i18n = i18n;\r\n this.permissions = permissions;\r\n }\r\n\r\n setSelectionAndDescription(view, model, grid, isSimulation) {\r\n const filter = this.getCurrentFilter(view, model);\r\n let selectAll = false;\r\n let selectedCounts = 0;\r\n\r\n // only need to know selectall & selectedCounts in idbased senario\r\n // when filter[0].values is empty\r\n if (filter.idBased &&\r\n filter.FilterExpressions &&\r\n filter.FilterExpressions[0] &&\r\n _.isEmpty(filter.FilterExpressions[0].Values)) {\r\n selectAll = gridHelper.isCrossPageAllSelected(grid);\r\n selectedCounts = gridHelper.getSelectedRowsCount(grid);\r\n }\r\n\r\n model.set('Selection', this.getCurrentSelection(view, model, grid, isSimulation, filter));\r\n model.set('Description', toRuleDescription(filter, selectAll, selectedCounts));\r\n }\r\n\r\n getCurrentSelection(view, model, grid, isSimulation, currentFilter) {\r\n let query = '';\r\n const { filterEntity, selectionRangeFilterQuery } = currentFilter;\r\n\r\n const selection = {\r\n CampaignId: view.viewModel.selectedScopeInfo.campaignId,\r\n AdGroupId: view.viewModel.selectedScopeInfo.adGroupId,\r\n };\r\n\r\n if (isSimulation) {\r\n const { pageSize, pageNumber } = grid.pgridPlugins.pagination;\r\n const sortInfo = gridHelper.getSortInfo(grid);\r\n let sortStr = '';\r\n\r\n if (sortInfo && !view.viewModel.isEditRule) {\r\n sortStr = `&$orderby=${sortInfo}`;\r\n }\r\n query = `$top=${pageSize}&$skip=${pageNumber * pageSize}${sortStr}`;\r\n query += `&daterangepreset=${view.cronselectionView.getSelectedDataDateRangeOption()}`;\r\n } else {\r\n selection.DateRange = {\r\n DateRangePreset:\r\n view.cronselectionView.getSelectedDataDateRangeOption(),\r\n };\r\n }\r\n\r\n let filterQueryUrl = filterEntity ? filterEntity.odataV4() : null;\r\n // merge filter url from user filter selection with range selection\r\n if (filterQueryUrl && selectionRangeFilterQuery) {\r\n filterQueryUrl += ` and (${selectionRangeFilterQuery})`;\r\n } else if (selectionRangeFilterQuery) {\r\n filterQueryUrl = selectionRangeFilterQuery;\r\n }\r\n const filterEncodedUrl = filterQueryUrl ? encodeURIComponent(filterQueryUrl) : null;\r\n const filterURLParam = filterEncodedUrl ? `$filter=(${filterEncodedUrl})` : '';\r\n\r\n if (filterURLParam) {\r\n query = query === '' ? filterURLParam : `${query}&${filterURLParam}`;\r\n }\r\n\r\n selection.QueryString = query;\r\n\r\n return selection;\r\n }\r\n\r\n getCurrentFilter(view, model) {\r\n const entity = model.get('Entity');\r\n const { viewModel, predicateListView } = view;\r\n let filters = null;\r\n let idBased = false;\r\n let selectionRangeFilterQuery = null;\r\n\r\n if (viewModel.selectedScopeOption() === scopeOptions.Selected) {\r\n idBased = true;\r\n const ids = viewModel.selectedScopeInfo.selectedRowIds;\r\n filters = {\r\n FilterExpressions: [{\r\n SelectedColumn: `${entity}Id`, // 'CampaignId', 'AdgroupId'.\r\n SelectedOperator: 'Equal',\r\n Values: ids,\r\n }],\r\n };\r\n\r\n if (ids && ids.length > 0) {\r\n selectionRangeFilterQuery = _.map(ids, id => `Id eq ${id}`).join(' or ');\r\n }\r\n } else if (viewModel.selectedScopeOption() === scopeOptions.AllEnabled) {\r\n filters = {\r\n FilterExpressions: [{\r\n SelectedColumn: entityRelatedOptions.EnabledStatusFilterColumn[entity],\r\n SelectedOperator: 'EnumSelection',\r\n Values: entityRelatedOptions.EnabledStatusFilterValue[entity],\r\n }],\r\n };\r\n selectionRangeFilterQuery = entityRelatedOptions.EnabledStatusFilterQueryOdata[entity];\r\n }\r\n\r\n const selectedFilter = {};\r\n const predicateListFilter = view.isForVNext ?\r\n predicateListView.editableFilter : predicateListView.getFilterEntity();\r\n\r\n // ToDO: apjia,remove this after the automated rules tab support new filter\r\n // (currently we need use same format for that tab)\r\n selectedFilter.FilterExpressions =\r\n fromFilterEntityToLegacyFilter(predicateListFilter, this.i18n);\r\n\r\n let expr = null;\r\n if (selectedFilter && selectedFilter.FilterExpressions) {\r\n expr = _.map(selectedFilter.FilterExpressions, (item) => {\r\n const mappedResult = {\r\n SelectedColumn: item.SelectedColumn,\r\n SelectedOperator: item.SelectedOperator,\r\n Values: item.Values,\r\n };\r\n\r\n if (!_.isEmpty(item.SelectedNames)) {\r\n mappedResult.SelectedNames = item.SelectedNames;\r\n }\r\n return mappedResult;\r\n });\r\n\r\n // LSR[1392134]: if user set filter \"DeliveryStasus contains Eligible\" in campaign grid\r\n // actually it's mapped to eligible and inlineOpportunity, we need pass it to MT\r\n if (entity === 'Campaign') {\r\n _.each(expr, (filter) => {\r\n if (filter.SelectedColumn === 'DeliveryStatus' &&\r\n _.contains(filter.Values, legacyDeliveryStatus.Eligible.toString()) &&\r\n !_.contains(filter.Values, legacyDeliveryStatus.InlineOpportunity.toString())) {\r\n filter.Values.push(legacyDeliveryStatus.InlineOpportunity.toString());\r\n }\r\n });\r\n }\r\n }\r\n if (filters && filters.FilterExpressions) {\r\n filters.FilterExpressions = _.union(filters.FilterExpressions, expr);\r\n } else {\r\n filters = {\r\n FilterExpressions: expr,\r\n };\r\n }\r\n\r\n // 'DataExclusionId' is an alias of 'SeasonalityAdjustmentId'\r\n // Convert it before sending request to make back-end happy.\r\n if (predicateListFilter && predicateListFilter.query) {\r\n const finalQuery = replaceKeyOfQuery(predicateListFilter.query, 'DataExclusionId', 'SeasonalityAdjustmentId');\r\n predicateListFilter.query = finalQuery;\r\n }\r\n\r\n return {\r\n FilterExpressions: (filters && filters.FilterExpressions) || [],\r\n filterEntity: predicateListFilter,\r\n idBased,\r\n selectionRangeFilterQuery,\r\n };\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport PropTypes from 'prop-types';\r\nimport { MaximumPredicateLimit } from '@bingads-webui/filter-commons';\r\nimport { seasonalityPredicateValueNameGetter } from '@bingads-webui-campaign/seasonality-id-name-utils';\r\n\r\nclass PredicateListContainer extends React.PureComponent {\r\n render() {\r\n const { PredicateList, getPredicateIconClassName } = this.props;\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nPredicateListContainer.propTypes = {\r\n PredicateList: PropTypes.element.isRequired,\r\n entitySchema: PropTypes.shape({\r\n name: PropTypes.string,\r\n type: PropTypes.string,\r\n }).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n onEditableFilterUpdate: PropTypes.func.isRequired,\r\n classes: PropTypes.shape({\r\n predicateList: PropTypes.string.isRequired,\r\n }).isRequired,\r\n editableFilter: PropTypes.shape({\r\n query: PropTypes.object,// eslint-disable-line\r\n }),\r\n readOnlyProperties: PropTypes.arrayOf(PropTypes.string),\r\n getPredicateIconClassName: PropTypes.func,\r\n};\r\n\r\nPredicateListContainer.defaultProps = {\r\n editableFilter: null,\r\n readOnlyProperties: [],\r\n getPredicateIconClassName: undefined,\r\n};\r\n\r\n\r\nexport class PredicateListBackboneView extends Backbone.View {\r\n initialize({\r\n PredicateList,\r\n entitySchema,\r\n i18n,\r\n popoverContainer,\r\n onEditableFilterUpdate,\r\n selectableFilter = null,\r\n editableFilter = null,\r\n isPoPEnabled = false,\r\n savedFilters = [],\r\n recentFilters = [],\r\n openedPredicateIndex = null,\r\n selector = [],\r\n updateWaterfallFilter = null,\r\n onApplySavedFilter = null,\r\n onApplyRecentFilter = null,\r\n maximumPredicateLimit = MaximumPredicateLimit,\r\n readOnlyProperties = [],\r\n instrumentation = null,\r\n hideAddFilterButton = false,\r\n getPredicateIconClassName = undefined,\r\n }) {\r\n this.entitySchema = entitySchema;\r\n this.i18n = i18n;\r\n this.onEditableFilterUpdate = onEditableFilterUpdate;\r\n this.popoverContainer = popoverContainer;\r\n this.selectableFilter = selectableFilter;\r\n this.editableFilter = editableFilter;\r\n this.isPoPEnabled = isPoPEnabled;\r\n this.savedFilters = savedFilters;\r\n this.recentFilters = recentFilters;\r\n this.openedPredicateIndex = openedPredicateIndex;\r\n this.selector = selector;\r\n this.updateWaterfallFilter = updateWaterfallFilter;\r\n this.onApplySavedFilter = onApplySavedFilter;\r\n this.onApplyRecentFilter = onApplyRecentFilter;\r\n this.maximumPredicateLimit = maximumPredicateLimit;\r\n this.readOnlyProperties = readOnlyProperties;\r\n this.instrumentation = instrumentation;\r\n this.hideAddFilterButton = hideAddFilterButton;\r\n this.PredicateList = PredicateList;\r\n this.getPredicateIconClassName = getPredicateIconClassName;\r\n }\r\n\r\n render() {\r\n ReactDOM.render(\r\n (\r\n \r\n ), this.el\r\n );\r\n return this;\r\n }\r\n\r\n remove() {\r\n ReactDOM.unmountComponentAtNode(this.el);\r\n return super.remove();\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\nimport { DeterministicViewForBackBoneView } from '@bingads-webui/deterministic-wrapper-view';\r\nimport { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport { PredicateList } from '@bingads-webui/predicate-list';\r\nimport { parseSync } from '@bingads-webui/safe-json';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { Router } from '@bingads-webui/router';\r\nimport { AlertHelper } from '@bingads-webui-campaign/alert-helper';\r\nimport { PreviewResultView } from '@bingads-webui-campaign/bulk-operation-base';\r\nimport { localize, convertFilterEntityToPredicates } from '@bingads-webui/filter-commons';\r\nimport { SchemaI18n } from '@bingads-webui-universal/schema-i18n';\r\n\r\nimport { RuleCronSelectionview } from './cron-selection/view';\r\nimport { RuleAuthoringViewModel } from './viewmodel';\r\nimport template from './template.pug';\r\nimport { refresh } from './grid-helper';\r\nimport { getEntitySetting } from './entity-settings/get-entity-setting';\r\nimport { RuleAuthoringHelper } from './helper';\r\nimport { scopeOptions } from './options';\r\nimport { PredicateListBackboneView } from './predicate-list-backbone-view';\r\n\r\nexport class RuleAuthoringView extends PureKnockoutView {\r\n /**\r\n * Initialize automated rules settings\r\n * @param {Object} param - An object containing these default options for model\r\n * @param {Object} param.grid - the new grid object\r\n * @param {Object} param.i18n - localization object\r\n * @param {Object} param.instrumentation - instrumentation object\r\n * @param {Object} param.permissions - permissions for the user\r\n * @param {String} param.accountTimeZone - accountTimeZone\r\n * @param {String} param.accountCurrencyCode - accountCurrencyCode\r\n * @param {Object} param.stateMgr - the state manager which contains {getItem, setItem}\r\n * @param {Object} param.preferenceSvc - preference service to store user preferences\r\n * @param {Object} param.appCfg - global app config\r\n * @param {Object} param.bidBudgetRange - {FloorValue, CeilingValue} for selected rule\r\n * @param {String} param.currentUserId - currentUserId\r\n *\r\n * @returns {void} void\r\n */\r\n initialize({\r\n koModel,\r\n grid,\r\n i18n,\r\n instrumentation,\r\n permissions,\r\n accountTimeZone,\r\n accountCurrencyCode,\r\n stateMgr,\r\n preferenceSvc,\r\n appCfg,\r\n bidBudgetRange,\r\n currentUserId,\r\n isForVNext = false,\r\n scope,\r\n newI18n,\r\n CampaignAdgroupSelectorEdmView,\r\n currentEntity,\r\n PredicateListReact,\r\n getPredicateIconClassName,\r\n }) {\r\n this.model = koModel;\r\n this.isForVNext = isForVNext;\r\n this.currentEntity = currentEntity;\r\n this.CampaignAdgroupSelectorEdmView = CampaignAdgroupSelectorEdmView;\r\n this.appCfg = appCfg;\r\n const selectedRule = koModel.get('SelectedRule');\r\n const { entity, action } = selectedRule;\r\n\r\n if (selectedRule.id != null && (entity === 'Campaign' || entity === 'AdGroup')) {\r\n scopeOptions.SelectCampaignOrAdGroup = 3;\r\n } else {\r\n delete scopeOptions.SelectCampaignOrAdGroup;\r\n }\r\n\r\n this.entitySetting = getEntitySetting(\r\n entity,\r\n i18n,\r\n selectedRule,\r\n accountCurrencyCode,\r\n bidBudgetRange\r\n );\r\n this.options = {\r\n i18n,\r\n grid,\r\n instrumentation,\r\n entity,\r\n menuAction: action,\r\n selectedRule,\r\n currentUserId,\r\n isActionText: this.entitySetting.isActionText(),\r\n };\r\n\r\n super.initialize(this.options);\r\n\r\n this.koModel = koModel;\r\n this.i18n = i18n;\r\n this.newI18n = newI18n;\r\n this.scope = scope;\r\n this.helper = new RuleAuthoringHelper({ i18n, permissions });\r\n this.alertHelper = new AlertHelper({ i18n });\r\n this.initializeInstrumentation();\r\n this.viewModel.selectedScopeOption.subscribe(() => {\r\n this.onScopeSelectionChange();\r\n }, this);\r\n\r\n this.once('rendered', () => {\r\n // set cron selection view\r\n this.cronselectionView = new RuleCronSelectionview({\r\n i18n,\r\n entity,\r\n selectedRule,\r\n permissions,\r\n accountTimeZone,\r\n stateMgr,\r\n preferenceSvc,\r\n appCfg,\r\n isEmailOption: this.viewModel.isEmailOption(),\r\n instrumentation,\r\n isForVNext,\r\n });\r\n this.setChild('cron-selection', this.cronselectionView);\r\n\r\n // set action selected view (for specific rule types)\r\n const actionView = this.entitySetting.getActionView();\r\n if (actionView) {\r\n this.setChild('action', actionView);\r\n }\r\n\r\n if (isForVNext) {\r\n this.options.grid.pgridPlugins.filterService.entitySchema = localize(\r\n this.options.grid.pgridPlugins.filterService.entitySchema,\r\n new SchemaI18n({ i18n }),\r\n i18n\r\n );\r\n\r\n // update schema for editorial reasons for ads/keywords\r\n const { entitySchema } = this.options.grid.pgridPlugins.filterService;\r\n this.predicateListView = new PredicateListBackboneView({\r\n PredicateList: PredicateListReact,\r\n entitySchema,\r\n i18n: newI18n,\r\n readOnlyProperties: ['EditorialRejectionFlagId', 'EditorialRejectionDate', 'IsAppealPending', 'EditorialStatus', 'HeadlinesAssetId', 'DescriptionsAssetId', 'SeasonalityAdjustmentId', 'DataExclusionId'],\r\n editableFilter: this.options.grid.pgridPlugins.filterService.getEditableFilter(),\r\n getPredicateIconClassName,\r\n onEditableFilterUpdate: _.bind((query) => {\r\n this.predicateListView.editableFilter =\r\n this.options.grid.pgridPlugins.filterService.createFilterEntity(query);\r\n this.predicateListView.render();\r\n }, this),\r\n });\r\n } else {\r\n this.predicateListView = new PredicateList(_.extend({\r\n entitySchema: this.options.grid.pgridPlugins.filterService.entitySchema,\r\n selected: this.options.grid.pgridPlugins.filterService.getEditableFilter(),\r\n isComparingEnabled: false,\r\n i18n,\r\n }, this.options.grid.pgridPlugins.filterService.filterEntityOptions));\r\n }\r\n\r\n const predicateListViewWrapper = new DeterministicViewForBackBoneView({\r\n view:\r\n this.predicateListView,\r\n });\r\n this.setChild('filter', predicateListViewWrapper);\r\n\r\n const view = new PreviewResultView({\r\n columns: this.entitySetting.getPreviewHeaders(),\r\n i18n,\r\n results: [],\r\n totalCount: 0,\r\n });\r\n this.setChild('preview-result', view);\r\n });\r\n }\r\n\r\n initializeInstrumentation() {\r\n const scenario = this.options.instrumentation[`authorRule${this.viewModel.entity}`].create();\r\n\r\n scenario.createRule.create().monitor('saveRule', this);\r\n scenario.previewRuleResults.create().monitor('previewRule', this);\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .btn-ruleAuth-save': 'saveRule',\r\n 'click .btn-ruleAuth-preview': 'previewRule',\r\n 'click .btn-ruleAuth-cancel': 'hideView',\r\n };\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get ViewModel() {\r\n return RuleAuthoringViewModel;\r\n }\r\n\r\n setupCampaignAdGroupSelector(value) {\r\n this.selectorView = new this.CampaignAdgroupSelectorEdmView({\r\n el: this.$('.campaignAdgroupSelector'),\r\n i18n: this.newI18n,\r\n scope: this.scope,\r\n isCampaignMode: this.viewModel.showCampaigns,\r\n value,\r\n });\r\n this.selectorView.render();\r\n this.selectorView.on('on-apply', (selectedItems) => {\r\n const info = this.viewModel.selectedScopeInfo;\r\n\r\n info.selectedRowCount = selectedItems.length;\r\n info.selectedRowIds = _.map(selectedItems, item => JSON.parse(item).Id);\r\n\r\n this.updateSelectedEntityCount(info);\r\n this.viewModel.selectedScopeOption(scopeOptions.Selected);\r\n });\r\n }\r\n\r\n onScopeSelectionChange() {\r\n if (this.viewModel.isEditRule\r\n && (this.viewModel.showCampaigns || this.viewModel.showAdGroups)\r\n && this.viewModel.selectedScopeOption() === scopeOptions.SelectCampaignOrAdGroup) {\r\n this.viewModel.showCampaignAdGroupSelector(true);\r\n\r\n if (!_.isEmpty(this.viewModel.selectedScopeInfo.selectedRowIds)\r\n && this.viewModel.selectedScopeInfo.selectedRowIds.length < 100) {\r\n const filterString = _.reduce(\r\n this.viewModel.selectedScopeInfo.selectedRowIds,\r\n (filter, id, index, list) => filter.concat(`Id eq ${id}${(index === list.length - 1) ? '' : ' or '}`), ''\r\n );\r\n const uiblocker = withUiBlock();\r\n if (this.viewModel.showCampaigns) {\r\n this.currentEntity.Campaigns.get({\r\n select: ['Id', 'Name', 'Status'],\r\n filter: {\r\n where: filterString,\r\n },\r\n limit: 1000,\r\n }).fetch().then((data) => {\r\n const entitySelection = _.map(data.value, item => ({\r\n Id: item.Id,\r\n name: item.Name,\r\n status: item.Status,\r\n }));\r\n this.setupCampaignAdGroupSelector(entitySelection);\r\n uiblocker();\r\n });\r\n } else {\r\n this.currentEntity.AdGroups.get({\r\n filter: {\r\n where: filterString,\r\n },\r\n limit: 1000,\r\n select: ['Id', 'Name', 'Status', 'Campaign'],\r\n }).fetch().then((data) => {\r\n const entitySelection = _.map(data.value, item => ({\r\n Id: item.Id,\r\n name: item.Name,\r\n status: item.Status,\r\n campaignName: item.Campaign ? item.Campaign.Name : null,\r\n CampaignId: item.Campaign ? item.Campaign.Id : null,\r\n }));\r\n this.setupCampaignAdGroupSelector(entitySelection);\r\n uiblocker();\r\n });\r\n }\r\n } else {\r\n this.setupCampaignAdGroupSelector();\r\n }\r\n } else {\r\n this.viewModel.showCampaignAdGroupSelector(false);\r\n }\r\n }\r\n\r\n // set actions based on the view model value\r\n setAction() {\r\n return this.koModel.set('BatchAction', this.entitySetting.getAction(this.viewModel));\r\n }\r\n\r\n onSaveOrPreviewRuleError(xhr, response, uiblocker) {\r\n uiblocker();\r\n const errors = _.isArray(response) ? response : _.result(parseSync(response.responseText), 'value');\r\n const isUnauthorized = _.find(errors, item => item.Code === 'TokenExpired');\r\n\r\n if (isUnauthorized) {\r\n return Router.navigate('/default.aspx?reason=1&msg=sessionexpired');\r\n }\r\n\r\n const isScheduleInvalid = _.find(errors, item => item.Code === 'TaskSchedulingInvalid');\r\n const { i18n } = this.options;\r\n if (isScheduleInvalid) {\r\n const scheduleInvalidMsg = i18n.getString('Validate_ScheduleTimeInvalid');\r\n this.cronselectionView.viewModel.frequencyErrorMessage(scheduleInvalidMsg);\r\n return; // eslint-disable-line consistent-return\r\n }\r\n\r\n const isThrottlingError = _.find(errors, item => item.Code === 'ThrottlingLimitReached');\r\n\r\n if (isThrottlingError) {\r\n const throttLimitMsg = i18n.getString('Error_Campaign_API_ThrottlingLimitReached');\r\n return this.alertHelper.showError(throttLimitMsg);\r\n }\r\n\r\n const isCustomerMigrationError = _.find(errors, item => item.Code === 'CustomerUnderMigration');\r\n\r\n if (isCustomerMigrationError) {\r\n const migrationMsg = i18n.getString('Error_Campaign_API_CustomerUnderMigration');\r\n return this.alertHelper.showError(migrationMsg);\r\n }\r\n\r\n return this.alertHelper.showError(i18n.getString('GenericErrorMessage'));\r\n }\r\n\r\n saveRule() {\r\n if (!this.validate() || !this.cronselectionView.validate()) {\r\n return;\r\n }\r\n\r\n if (this.viewModel.isEditRule) {\r\n const ruleUrlTmpl = _.template('Advertiser/Customers()/Accounts()/TaskItems({{ruleId}})?');\r\n this.koModel.url = ruleUrlTmpl({\r\n ruleId: this.viewModel.editRuleId,\r\n });\r\n } else {\r\n this.koModel.url = 'Advertiser/Customers()/Accounts()/TaskItems?';\r\n }\r\n this.koModel.isEditRule = this.viewModel.isEditRule;\r\n this.koModel.isSimulation = false;\r\n this.koModel.set({\r\n Entity: this.viewModel.entity,\r\n Name: this.viewModel.ruleName(),\r\n NotificationType: this.viewModel.selectedEmailOption(),\r\n TimeZoneId: this.cronselectionView.viewModel.selectedTimeZoneOption(),\r\n });\r\n this.setAction();\r\n this.koModel.set('Cron', this.cronselectionView.getCron());\r\n const currentCustomerId = this.appCfg && this.appCfg.get && this.appCfg.get('CurrentCustomer') ? this.appCfg.get('CurrentCustomer').Id : undefined;\r\n if (currentCustomerId) {\r\n this.koModel.set('CurrentCustomerId', currentCustomerId);\r\n }\r\n this.helper.setSelectionAndDescription(\r\n this,\r\n this.model,\r\n this.options.grid,\r\n false,\r\n this.options.i18n\r\n );\r\n\r\n const uiblocker = withUiBlock();\r\n this.koModel.save({}, {\r\n success: () => {\r\n this.hideView();\r\n\r\n if (this.viewModel.isEditRule) {\r\n refresh(this.options.grid);\r\n }\r\n\r\n this.alertHelper.showSuccess(this.options.i18n.getString('RuleAuthoring_StatusMessage'));\r\n uiblocker();\r\n },\r\n error: (xhr, errors) => {\r\n this.onSaveOrPreviewRuleError(xhr, errors, uiblocker);\r\n },\r\n });\r\n }\r\n\r\n previewRule() {\r\n if (!this.validate()) {\r\n return;\r\n }\r\n\r\n this.koModel.url = 'Advertiser/Customers()/Accounts()/BulkEditSessions?$expand=BulkEditResults&preview=true';\r\n this.koModel.isSimulation = true;\r\n this.koModel.set('Entity', this.viewModel.entity);\r\n this.koModel.unset('PreviewEntityIds');\r\n\r\n if (this.options.grid.pgridPlugins.crossPageSelectAll.isAllSelected) {\r\n this.koModel.set('PreviewEntityIds', _.map(this.options.grid.gridView.selectedKeys(), Number));\r\n }\r\n\r\n const currentCustomerId = this.appCfg && this.appCfg.get && this.appCfg.get('CurrentCustomer') ? this.appCfg.get('CurrentCustomer').Id : undefined;\r\n if (currentCustomerId) {\r\n this.koModel.set('CurrentCustomerId', currentCustomerId);\r\n }\r\n\r\n this.setAction();\r\n this.helper.setSelectionAndDescription(\r\n this,\r\n this.model,\r\n this.options.grid,\r\n true,\r\n this.options.i18n\r\n );\r\n\r\n const uiblocker = withUiBlock();\r\n this.koModel.save({}, {\r\n success: (model) => {\r\n uiblocker();\r\n const results = model.get('BulkEditResults');\r\n\r\n // create or update preview view\r\n this.getChild('preview-result').update(\r\n this.entitySetting.formatPreviewResults(results),\r\n model.get('TotalRowCount')\r\n );\r\n this.viewModel.inPreviewMode(true);\r\n },\r\n error: (xhr, errors) => {\r\n this.onSaveOrPreviewRuleError(xhr, errors, uiblocker);\r\n },\r\n });\r\n }\r\n\r\n hideView() {\r\n this.trigger('hide');\r\n ko.cleanNode(this.el);\r\n if (this.selectorView) {\r\n this.selectorView.remove();\r\n }\r\n this.remove();\r\n return this;\r\n }\r\n\r\n validate() {\r\n let isResultValid = true;\r\n\r\n if (_.isFunction(this.viewModel.validate)) {\r\n isResultValid = this.viewModel.validate();\r\n }\r\n\r\n isResultValid = isResultValid && this.entitySetting.isActionValidate();\r\n\r\n if (!this.isForVNext) {\r\n // user can create automated rules without any when condition\r\n if (this.predicateListView.ko_model.items().length > 0) {\r\n _.each(this.predicateListView.ko_model.items(), (filterItem) => {\r\n filterItem.onValueChange(); // trigger value checking so that error message can be shown\r\n });\r\n isResultValid = isResultValid && this.predicateListView.ko_model.canApply();\r\n }\r\n } else {\r\n const editablePredicates = convertFilterEntityToPredicates(this.predicateListView.editableFilter); // eslint-disable-line max-len\r\n const hasInvalidProperties = editablePredicates.some(editablePredicate =>\r\n editablePredicate.isDeletedProperty || editablePredicate.isInvalidProperty);\r\n isResultValid = isResultValid && !hasInvalidProperties;\r\n }\r\n\r\n if (!isResultValid) {\r\n this.$el.find('input.error:visible').first().focus();\r\n }\r\n\r\n return isResultValid;\r\n }\r\n\r\n /**\r\n * update selected entity count\r\n * @param {Object} info - An object containing the new selection info\r\n *\r\n * @returns {void} void\r\n */\r\n updateSelectedEntityCount(info) {\r\n return this.viewModel.updateSelectedEntityCount(info);\r\n }\r\n\r\n addWalkme({\r\n directive,\r\n walkMe,\r\n walkMeLink,\r\n walkThrus,\r\n }) {\r\n const selectedRule = this.model.get('SelectedRule');\r\n\r\n // right now we only want to show this for change bid rule\r\n if (selectedRule && selectedRule.action === 'ChangeBid') {\r\n const Walkme = walkMe.default;\r\n const WalkmeLink = walkMeLink.default;\r\n\r\n directive.whenLoaded().then(() => {\r\n const walkme = new Walkme();\r\n\r\n walkme.setType(WalkmeLink)\r\n .setWalkthrus(walkThrus.keyword.link.changeBid)\r\n .render();\r\n\r\n walkme.$el.addClass('walkme__link--panel-title');\r\n this.$el.find('.panel-heading').append(walkme.$el);\r\n });\r\n }\r\n }\r\n}\r\n","import { EntitySettingBase } from './base';\r\nimport { CampaignSetting } from './campaign';\r\nimport { AdGroupSetting } from './adgroup';\r\nimport { KeywordSetting } from './keyword';\r\nimport { AssetGroupSetting } from './assetgroup';\r\n\r\nexport function getEntitySetting(entity, i18n, selectedRule, accountCurrencyCode, bidBudgetRange) {\r\n const entitySettingMapping = {\r\n campaign: CampaignSetting,\r\n keyword: KeywordSetting,\r\n adgroup: AdGroupSetting,\r\n assetgroup: AssetGroupSetting,\r\n };\r\n\r\n const keyToUse = entity.toLowerCase();\r\n const ClassToUse = entitySettingMapping[keyToUse] ?\r\n entitySettingMapping[keyToUse] :\r\n EntitySettingBase;\r\n\r\n return new ClassToUse({\r\n entity,\r\n selectedRule,\r\n i18n,\r\n accountCurrencyCode,\r\n bidBudgetRange,\r\n });\r\n}\r\n","import backbone from 'backbone';\r\nimport { lastNDate } from '@bingads-webui-universal/primitive-utilities';\r\nimport { scopeOptions, emailOptions } from './options';\r\nimport { dataDateRanges, frequencyGrains } from './cron-selection/options';\r\n\r\nexport class RuleAuthoringModel extends backbone.Model {\r\n /**\r\n * Initialize model settings\r\n * @param {Object} param - An object containing these default options for model\r\n * @param {Object} param.odata - odata module\r\n * @param {string} param.odata.jq_ajax_adapter - the function for ajax action\r\n *\r\n * @returns {void} void\r\n */\r\n initialize({ odata }) {\r\n this.options = { odata };\r\n\r\n super.initialize(this.options);\r\n this.idAttribute = 'id';\r\n }\r\n\r\n\r\n /**\r\n * Default settings for the model\r\n *\r\n * @returns {void} void\r\n */\r\n defaults() {\r\n return {\r\n Id: null,\r\n Selection: '',\r\n Description: '',\r\n PreviewEntityIds: [],\r\n selectedEntityCount: 0,\r\n TotalRowCount: 0,\r\n BulkEditResults: [],\r\n SelectedRule: {\r\n id: null,\r\n entity: null,\r\n action: null,\r\n name: null,\r\n modifiedBy: {\r\n id: 0,\r\n name: '',\r\n },\r\n frequencyGrain: frequencyGrains.Daily,\r\n monthlyOption: '1',\r\n weeklyOption: '1',\r\n dailyOption: new Date().getHours(),\r\n runOnceDate: lastNDate(new Date(), -1),\r\n timeZoneOption: 0,\r\n dateRangePreset: dataDateRanges.Yesterday,\r\n emailOption: emailOptions.EveryTimeThisRuleRuns,\r\n scopeInfo: {\r\n allPages: false,\r\n selectedRowCount: 0,\r\n selectedRowIds: null,\r\n campaignId: null,\r\n adGroupId: null,\r\n },\r\n scopeOption: scopeOptions.AllButRemoved,\r\n filter: {\r\n Name: '',\r\n Id: '',\r\n FilterExpressions: [],\r\n },\r\n nonTextAction: {},\r\n },\r\n };\r\n }\r\n\r\n parse(response) {\r\n if (response) {\r\n return {\r\n Id: response.value,\r\n TotalRowCount: response.TotalRowCount,\r\n BulkEditResults: response.BulkEditResults,\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n sync(method, model, options) {\r\n if (model.isSimulation) {\r\n options.type = 'Post'; // eslint-disable-line no-param-reassign\r\n options.data = JSON.stringify({ // eslint-disable-line no-param-reassign\r\n Entity: model.get('Entity'),\r\n BatchAction: model.get('BatchAction'),\r\n Selection: model.get('Selection'),\r\n Description: model.get('Description'),\r\n PreviewEntityIds: model.get('PreviewEntityIds'),\r\n CurrentCustomerId: model.get('CurrentCustomerId'),\r\n });\r\n } else if (method === 'create') {\r\n if (model.isEditRule === true) {\r\n options.type = 'Patch'; // eslint-disable-line no-param-reassign\r\n } else {\r\n options.type = 'Post'; // eslint-disable-line no-param-reassign\r\n }\r\n options.data = JSON.stringify({ // eslint-disable-line no-param-reassign\r\n '@odata.type': '#Model.AdvertiserRule',\r\n Type: 'AdvertiserSearch',\r\n NotificationMedium: 'Email',\r\n Entity: model.get('Entity'),\r\n BatchAction: model.get('BatchAction'),\r\n Selection: model.get('Selection'),\r\n Description: model.get('Description'),\r\n Name: model.get('Name'),\r\n NotificationType: model.get('NotificationType'),\r\n TimeZoneId: model.get('TimeZoneId'),\r\n Cron: model.get('Cron'),\r\n CurrentCustomerId: model.get('CurrentCustomerId'),\r\n });\r\n } else {\r\n options.type = 'Get'; // eslint-disable-line no-param-reassign\r\n }\r\n return this.options.odata.jq_ajax_adapter.call(this, this.url, options);\r\n }\r\n}\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useEffect, useRef, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { clone } from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport BiddingStrategyView from '@bingads-webui-campaign-legacy/bidding-strategy/view/setting';\r\nimport '@bingads-webui-campaign/ko-stop-binding';\r\nimport { mergeStyles } from '@bingads-webui-campaign-react/common-styles';\r\n\r\nconst getStyles = (theme, palette = {}) => ({\r\n bidStrategyContainer: {\r\n ...mergeStyles(\r\n { theme },\r\n {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n\r\n '& .bid-strategy-container': {\r\n marginTop: 12,\r\n\r\n '& select': {\r\n margin: '5px 0',\r\n width: 460,\r\n },\r\n '& div[data-bind=\"visible: checkCPC\"]': {\r\n paddingTop: 8,\r\n },\r\n '& input[type=\"checkbox\"]': {\r\n float: 'left',\r\n },\r\n '& .custom-param__key-field': {\r\n display: 'inline-block',\r\n width: 85,\r\n marginLeft: 5,\r\n marginRight: 5,\r\n },\r\n '& #currencyLabelTargetCpa': {\r\n display: 'inline-block',\r\n 'vertical-align': 'initial',\r\n marginTop: 0,\r\n width: '200px',\r\n },\r\n '& #currencyLabelTargetRoas': {\r\n display: 'inline-block',\r\n 'vertical-align': 'initial',\r\n marginTop: 0,\r\n width: '200px',\r\n },\r\n '& .alert.alert-info': {\r\n marginTop: 8,\r\n },\r\n '& .alert-image': {\r\n paddingTop: 3,\r\n },\r\n '& a.helpbutton': {\r\n 'margin-left': '5px',\r\n },\r\n },\r\n 'bid-strategy-details-container form-group': {\r\n width: '460px',\r\n },\r\n '& .target-cpc-container': {\r\n whiteSpace: 'nowrap',\r\n },\r\n '& .helpbutton': {\r\n display: 'inline-block',\r\n marginLeft: 5,\r\n },\r\n\r\n '& label': {\r\n display: 'inline-block',\r\n },\r\n\r\n '& span': {\r\n verticalAlign: 'middle',\r\n },\r\n\r\n '& .display-inline-block': {\r\n display: 'inline-block !important',\r\n },\r\n\r\n '& .help-block, .remaining-chars-hint-container': {\r\n textAlign: 'right',\r\n fontSize: 14,\r\n margin: 0,\r\n color: palette.neutralPrimary,\r\n lineHeight: '24px',\r\n },\r\n\r\n '& .help-block.error': {\r\n textAlign: 'left',\r\n },\r\n\r\n '& ol, ul': {\r\n listStyle: 'none',\r\n paddingLeft: 0,\r\n },\r\n\r\n '& .validation-error': {\r\n border: '1px solid #A80000 !important',\r\n backgroundColor: palette.white,\r\n margin: 0,\r\n },\r\n\r\n '& .error': {\r\n color: '#A80000',\r\n },\r\n\r\n '& div.error': {\r\n fontSize: 12,\r\n },\r\n\r\n '& input.error, select.error, textarea.error, input.campaign-error-row, select.campaign-error-row, textarea.campaign-error-row': {\r\n border: '1px solid #A80000 !important',\r\n },\r\n\r\n '& .form-group': {\r\n padding: 0,\r\n marginBottom: 0,\r\n },\r\n\r\n '& .form-control': {\r\n height: 32,\r\n border: `1px solid ${palette.neutralSecondary}`,\r\n boxSizing: 'border-box',\r\n borderRadius: 2,\r\n },\r\n\r\n '& .form-control:focus': {\r\n border: `1px solid ${palette.neutralSecondary}`,\r\n },\r\n\r\n '& .form-control-static': {\r\n paddingTop: 0,\r\n paddingBottom: 0,\r\n margin: 0,\r\n height: 'auto',\r\n color: palette.neutralSecondary,\r\n\r\n '&.copy-settings': {\r\n marginTop: 4,\r\n },\r\n '& .max-cpc-input-row': {\r\n marginLeft: 0,\r\n },\r\n },\r\n\r\n '& .control-label, .form-label-container': {\r\n textAlign: 'left',\r\n width: '760px',\r\n marginTop: 33,\r\n fontSize: 14,\r\n color: palette.neutralPrimary,\r\n padding: 0,\r\n display: 'block',\r\n },\r\n\r\n '& .form-label-container': {\r\n '&>label>span': {\r\n padding: '5px 0px',\r\n display: 'inline-block',\r\n },\r\n },\r\n\r\n '& .control-label .col-sm-4': {\r\n width: 'auto',\r\n },\r\n\r\n '& .col-sm-6': {\r\n paddingLeft: 0,\r\n },\r\n\r\n '& .displayNone': {\r\n display: 'none',\r\n },\r\n\r\n '& select': {\r\n appearance: 'none',\r\n '-webkit-appearance': 'none',\r\n },\r\n\r\n '& textarea': {\r\n resize: 'none',\r\n },\r\n\r\n '& .input-group-addon': {\r\n backgroundColor: palette.white,\r\n border: 0,\r\n },\r\n }\r\n ),\r\n },\r\n});\r\n\r\nexport const LegacyBidStrategy = React.memo(({\r\n id, className, BiddingScheme, CampaignSettings, campaignType, campaignLanguage, campaignSubType,\r\n onChange, entityType, hideHeader, popupIds, budgetAmount, validateWithBudget,\r\n ...restProps\r\n}) => {\r\n const view = useRef();\r\n const viewListener = useMemo(() => clone(Backbone.Events), []);\r\n\r\n let container;\r\n\r\n useEffect(() => {\r\n view.current = new BiddingStrategyView({\r\n biddingStrategyType: BiddingScheme && BiddingScheme.Type,\r\n biddingStrategyId: BiddingScheme && BiddingScheme.BidStrategyId,\r\n targetCpa: BiddingScheme && BiddingScheme.TargetCpa,\r\n targetRoas: BiddingScheme && BiddingScheme.TargetRoas,\r\n costPerSale: BiddingScheme && (BiddingScheme.CostPerSale || BiddingScheme.TargetCostPerSale),\r\n maxCpc: BiddingScheme && BiddingScheme.MaxCpc && BiddingScheme.MaxCpc.Amount,\r\n targetAdPosition: BiddingScheme && BiddingScheme.TargetAdPosition,\r\n targetImpressionShare: BiddingScheme && BiddingScheme.TargetImpressionShare,\r\n entityType,\r\n campaignSettings: CampaignSettings,\r\n campaignType,\r\n campaignLanguage,\r\n campaignSubType,\r\n withRealTimeUpdates: true,\r\n isAfterSave: false,\r\n hideHeader,\r\n popupIds,\r\n budgetAmount,\r\n validateWithBudget,\r\n isRenderedInReact: true,\r\n ...restProps,\r\n });\r\n\r\n viewListener.listenTo(view.current, 'change', onChange);\r\n view.current.render();\r\n view.current.$el.appendTo(container);\r\n\r\n return () => {\r\n view.current.remove();\r\n };\r\n }, [budgetAmount]);\r\n\r\n useEffect(() => {\r\n viewListener.stopListening(view.current);\r\n viewListener.listenTo(view.current, 'change', onChange);\r\n\r\n return () => viewListener.stopListening(view.current);\r\n }, [onChange, viewListener]);\r\n\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n return (\r\n \r\n
{ container = ref; }} />\r\n
\r\n );\r\n});\r\n\r\nLegacyBidStrategy.propTypes = {\r\n id: PropTypes.string,\r\n className: PropTypes.string,\r\n BiddingScheme: PropTypes.shape({\r\n BidStrategyId: PropTypes.number,\r\n Type: PropTypes.string,\r\n TargetCpa: PropTypes.string,\r\n TargetRoas: PropTypes.string,\r\n TargetCostPerSale: PropTypes.string,\r\n CostPerSale: PropTypes.string,\r\n MaxCpc: PropTypes.shape({\r\n Amount: PropTypes.number,\r\n }),\r\n TargetAdPosition: PropTypes.string,\r\n TargetImpressionShare: PropTypes.number,\r\n }),\r\n CampaignSettings: PropTypes.arrayOf(PropTypes.shape({})),\r\n entityType: PropTypes.string,\r\n campaignType: PropTypes.string,\r\n campaignLanguage: PropTypes.string,\r\n campaignSubType: PropTypes.string,\r\n onChange: PropTypes.func.isRequired,\r\n hideHeader: PropTypes.bool,\r\n popupIds: PropTypes.shape({\r\n BidStrategy: PropTypes.string,\r\n }),\r\n budgetAmount: PropTypes.number,\r\n validateWithBudget: PropTypes.bool,\r\n};\r\n\r\nLegacyBidStrategy.defaultProps = {\r\n id: undefined,\r\n className: undefined,\r\n CampaignSettings: [],\r\n budgetAmount: undefined,\r\n validateWithBudget: false,\r\n BiddingScheme: undefined,\r\n campaignType: undefined,\r\n campaignLanguage: 'English',\r\n campaignSubType: undefined,\r\n entityType: undefined,\r\n hideHeader: false,\r\n popupIds: {\r\n BidStrategy: 'pop_BA_CampaignGrids_BidStrategy',\r\n },\r\n};\r\n","import { isEqual } from 'underscore';\r\nimport React, { useCallback, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { LegacyBidStrategy } from './legacy-bid-strategy';\r\n\r\nconst LegacyBidStrategyWithCustomValidation = ({\r\n validationProps, updateValidation, ...restProps\r\n}) => {\r\n const { data } = validationProps;\r\n const i18n = useContext(I18nContext);\r\n const popupIds = {\r\n BidStrategy: 'pop_BA_PMAX_BidStrategy',\r\n };\r\n\r\n const activity = useContext(ActivityContext);\r\n\r\n const onChange = useCallback((newData, newIsValid, isFromInitialization) => {\r\n const newBiddingScheme = { BiddingScheme: newData };\r\n updateValidation(\r\n newIsValid ? [] : [i18n.getString(_TL_('Bid Strategy has validation errors'))],\r\n isEqual(newBiddingScheme, data) ? data : newBiddingScheme,\r\n !isFromInitialization\r\n );\r\n\r\n if (activity) {\r\n activity.signal(`onLegacyBidStrategyChange - ${JSON.stringify(newBiddingScheme)} - isValid: ${newIsValid}}`);\r\n }\r\n }, [i18n, updateValidation, data, activity]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nLegacyBidStrategyWithCustomValidation.propTypes = {\r\n validationProps: PropTypes.shape({\r\n data: PropTypes.shape({\r\n BiddingScheme: PropTypes.shape({\r\n Type: PropTypes.string,\r\n }),\r\n CampaignSettings: PropTypes.arrayOf(PropTypes.shape({})),\r\n }),\r\n }).isRequired,\r\n updateValidation: PropTypes.func.isRequired,\r\n};\r\n\r\nexport const ValidatedLegacyBidStrategy = withCustomValidation(LegacyBidStrategyWithCustomValidation);\r\n\r\n","import backbone from 'backbone';\r\nimport _ from 'underscore';\r\n\r\n/**\r\n * BulkEditJobModel, provides base model for bulk edit job\r\n * Can be used (extended for override purpose) for bulk actions like automated rules & bulk edit\r\n */\r\nexport class BulkEditJobModel extends backbone.Model {\r\n /**\r\n * Initialize model settings\r\n * @param {Object} param - An object containing these default options for model\r\n * @param {Object} param.odata - odata module\r\n * @param {string} param.odata.jq_ajax_adapter - the function for ajax action\r\n *\r\n * @returns {void} void\r\n */\r\n initialize({ odata }) {\r\n this.options = { odata };\r\n\r\n super.initialize(this.options);\r\n this.idAttribute = 'id';\r\n }\r\n\r\n /**\r\n * Default settings for the model\r\n *\r\n * @returns {void} void\r\n */\r\n defaults() {\r\n return {\r\n Id: null,\r\n Selection: '',\r\n TotalRowCount: 0,\r\n SuccessRowCount: 0,\r\n ErrorRowCount: 0,\r\n Status: '',\r\n CreationTime: '',\r\n ExecutionStartTime: '',\r\n CompletionTime: '',\r\n CreatedBy: '',\r\n Description: '',\r\n BulkEditResults: [],\r\n selectedEntityCount: 0,\r\n PreviewEntityIds: [],\r\n };\r\n }\r\n\r\n /**\r\n * parse response and convert it into model content\r\n * @param {Object} response - response object\r\n *\r\n * @returns {Object} prased object\r\n */\r\n parse(response) {\r\n if (response) {\r\n const result = _.pick(\r\n response,\r\n 'Selection',\r\n 'Description',\r\n 'TotalRowCount',\r\n 'SuccessRowCount',\r\n 'ErrorRowCount',\r\n 'Status',\r\n 'CreationTime',\r\n 'ExecutionStartTime',\r\n 'CompletionTime',\r\n 'CreatedBy',\r\n 'BulkEditResults'\r\n );\r\n\r\n result.Id = response.Id && response.Id.length > 0 ? response.Id : null;\r\n\r\n return result;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * model sync settings, have different setting for different type of operation\r\n * @param {String} method - operation name\r\n * @param {String} model - model\r\n * @param {Object} options - addtional options\r\n *\r\n * @returns {void} void\r\n */\r\n sync(method, model, options) {\r\n const url = _.template(this.url)({\r\n jobId: this.get('Id'),\r\n });\r\n\r\n if (method === 'create') {\r\n options.type = 'Post'; // eslint-disable-line no-param-reassign\r\n options.data = JSON.stringify({ // eslint-disable-line no-param-reassign\r\n Entity: model.get('Entity'),\r\n BatchAction: model.get('BatchAction'),\r\n Selection: model.get('Selection'),\r\n Description: model.get('Description'),\r\n PreviewEntityIds: model.get('PreviewEntityIds'),\r\n });\r\n } else {\r\n options.type = 'Get'; // eslint-disable-line no-param-reassign\r\n }\r\n\r\n // TODO: apjia, track usage of jq_ajax_adapter and see whether we can repace it\r\n // with Assets/component/http/js/channel/core\r\n return this.options.odata.jq_ajax_adapter.call(this, url, options);\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\n// only leave the top 100 string\r\nfunction capValue(value) {\r\n const maxLength = 100;\r\n if (!_.isString(value) || value.length < maxLength) {\r\n return value;\r\n }\r\n return value.substring(0, maxLength);\r\n}\r\n\r\n/**\r\n * Generate description string for filter\r\n * @param {Object} filter - filter\r\n * @param {Object[]} filter.FilterExpressions - required\r\n * should in format of [{SelectedColumn, SelectedOperator, Values}]\r\n * @param {Object[]} filter.idBased - optinal, true for the id based filter\r\n *\r\n * @returns {String} generated description string\r\n */\r\nexport function toDescription(filter) {\r\n if (!filter || !filter.FilterExpressions) {\r\n return null;\r\n }\r\n\r\n const expressions = filter.FilterExpressions;\r\n\r\n if (!_.isArray(expressions) || expressions.length === 0) {\r\n return null;\r\n }\r\n\r\n if (filter.idBased) {\r\n return JSON.stringify({ idsCount: expressions[0].Values.length });\r\n }\r\n\r\n const compact = _.map(\r\n expressions,\r\n expr => [expr.SelectedColumn, expr.SelectedOperator, _.map(expr.Values, capValue)]\r\n );\r\n\r\n return JSON.stringify(compact);\r\n}\r\n\r\n/**\r\n * Generate filter from description string\r\n * @param {String} description - the description string\r\n *\r\n * @returns {Object} generated filter\r\n */\r\nexport function fromDescription(description) {\r\n if (!description) {\r\n return null;\r\n }\r\n\r\n let compactFilter = JSON.parse(description);\r\n\r\n if (compactFilter.idsCount) {\r\n return {\r\n idBased: true,\r\n idsCount: compactFilter.idsCount,\r\n };\r\n }\r\n\r\n compactFilter = compactFilter && compactFilter.Filter ? compactFilter.Filter : compactFilter;\r\n const filter = _.map(\r\n compactFilter,\r\n _.bind(_.object, _, ['SelectedColumn', 'SelectedOperator', 'Values'])\r\n );\r\n\r\n return {\r\n FilterExpressions: filter,\r\n };\r\n}\r\n\r\n/**\r\n * Generate rule description string for filter\r\n * @param {Object} filter - filter\r\n * @param {Object[]} filter.FilterExpressions - required\r\n * should in format of [{SelectedColumn, SelectedOperator, Values}]\r\n * @param {Object[]} filter.idBased - optinal, true for the id based filter\r\n * @param {boolean} acrossAllPages - whether selection is across all pages\r\n * @param {integer} idsCount - count for id, required when filter.idBased is true\r\n *\r\n * @returns {String} generated rule description string\r\n */\r\nexport function toRuleDescription(filter, acrossAllPages, idsCount) {\r\n if (!filter || !filter.FilterExpressions ||\r\n !_.isArray(filter.FilterExpressions) ||\r\n filter.FilterExpressions.length === 0) {\r\n return null;\r\n }\r\n\r\n const expressions = filter.FilterExpressions;\r\n const result = {};\r\n\r\n if (filter.idBased) {\r\n result.idsCount = acrossAllPages ? idsCount : expressions[0].Values.length;\r\n }\r\n\r\n // in acrossallpages senario, the values for first expression is always empty\r\n // which is useless and may cause confusion in description, so we remove it\r\n const expressionsToMap = acrossAllPages ? _.without(expressions, expressions[0]) : expressions;\r\n const resultFilter = _.map(expressionsToMap, (expr) => {\r\n const mappedResult = [expr.SelectedColumn, expr.SelectedOperator, _.map(expr.Values, capValue)];\r\n\r\n if (!_.isEmpty(expr.SelectedNames)) {\r\n mappedResult.push(_.map(expr.SelectedNames, capValue));\r\n }\r\n\r\n return mappedResult;\r\n });\r\n\r\n result.Filter = resultFilter;\r\n return JSON.stringify(result);\r\n}\r\n\r\n/**\r\n * Generate filter from rule description string\r\n * @param {String} description - the rule description string\r\n *\r\n * @returns {Object} generated filter\r\n */\r\nexport function fromRuleDescription(description) {\r\n if (!description) {\r\n return null;\r\n }\r\n\r\n const compact = JSON.parse(description);\r\n const compactFilter = compact.Filter ? compact.Filter : compact;\r\n const FilterExpressions = _.map(compactFilter, (element) => {\r\n const mapped = {\r\n SelectedColumn: element[0],\r\n SelectedOperator: element[1],\r\n Values: element[2],\r\n };\r\n\r\n if (element[0] === 'Labels' && element.length > 3) {\r\n mapped.SelectedNames = element[3]; // eslint-disable-line\r\n }\r\n\r\n return mapped;\r\n });\r\n\r\n return compact.idsCount ?\r\n {\r\n idBased: true,\r\n idsCount: compact.idsCount,\r\n FilterExpressions,\r\n } :\r\n {\r\n FilterExpressions,\r\n };\r\n}\r\n\r\n/**\r\n * Generate legacy query string from filterExpressions\r\n * @param {Object[]} filterExpressions - the filter expressions\r\n *\r\n * @returns {String} filter expression part\r\n */\r\nexport function toLegacyQueryString(filterExpressions) {\r\n const expressionStrings = _.map(\r\n filterExpressions,\r\n (expression, index) => _.map(expression, (value, key) => {\r\n const template = `filter[${index}].${key}=`;\r\n\r\n return _.isArray(value) ?\r\n _.map(value, val => template + val).join('&') :\r\n template + value;\r\n }).join('&')\r\n );\r\n\r\n return expressionStrings.join('&');\r\n}\r\n\r\n","export const numericActionTypes = {\r\n changeByPercent: 'ChangeByPercent',\r\n changeByAmount: 'ChangeByAmount',\r\n setAmount: 'SetToAmount',\r\n};\r\n","import ko from 'knockout';\r\n\r\nexport default class ViewModel {\r\n constructor({\r\n results = [],\r\n columns = [],\r\n totalCount,\r\n i18n,\r\n }) {\r\n this.results = ko.observable([]);\r\n\r\n this.totalCount = ko.observable(0);\r\n\r\n this.columns = columns;\r\n\r\n this.currentPageChangeCount = ko.computed(() => this.results().length);\r\n\r\n this.changeText = ko.observable('');\r\n\r\n this.changeText = ko.computed(() => {\r\n if (this.totalCount() === 0) {\r\n return i18n.getString('BulkEdit_Preview_NoChange');\r\n } else if (this.currentPageChangeCount() > 0) {\r\n return i18n.getString('BulkEdit_Preview_SomeChanges').replace('{0}', this.totalCount());\r\n }\r\n\r\n return i18n.getString('BulkEdit_Preview_NoCurrentPageChange').replace('{0}', this.totalCount());\r\n });\r\n\r\n this.updateResult = (resultsToUse, totalResultCount) => {\r\n this.results(resultsToUse);\r\n this.totalCount(totalResultCount || resultsToUse.length);\r\n };\r\n\r\n this.updateResult(results, totalCount);\r\n }\r\n}\r\n","import { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './template.pug';\r\nimport ViewModel from './viewmodel';\r\n\r\n/**\r\n * Provide display for bulk edit preview result\r\n */\r\nexport class PreviewResultView extends PureKnockoutView {\r\n /**\r\n * Initialize view settings\r\n * @param {Object} param - An object containing these default options for model\r\n * @param {String[]} param.columns - localized headers\r\n * @param {Object[]} param.results - results to display, one per row\r\n * the format should be the result of any (similar) function from format-preview-from-response\r\n * @param {number} param.totalCount - total results count, by default to be results.length\r\n * @param {Object} param.i18n - localization functions\r\n *\r\n * @returns {void} void\r\n */\r\n initialize({\r\n columns,\r\n results = [],\r\n totalCount,\r\n i18n,\r\n }) {\r\n this.options = {\r\n results, columns, i18n, totalCount,\r\n };\r\n super.initialize(this.options);\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n /**\r\n * Update the preview results, view will be updated\r\n * @param {Object[]} results - new results\r\n * the format should be the result of any (similar) function from format-preview-from-response\r\n * @param {number} totalCount - total results count, by default to be results.length\r\n *\r\n * @returns {void} void\r\n */\r\n update(results, totalCount) {\r\n this.viewModel.updateResult(results, totalCount);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { parseSync } from '@bingads-webui/safe-json';\r\nimport { getTitlePreview } from '@bingads-webui-campaign/summary-grid-helper';\r\nimport {\r\n responsiveAdPreviewTemplate,\r\n dynamicSearchAdPreviewTemplate\r\n} from '@bingads-webui-campaign/ad-previews';\r\n\r\nconst adTypes = {\r\n textAds: 'TextAd',\r\n expandedTextAds: 'ExpandedTextAd',\r\n appInstallAds: 'AppInstallAd',\r\n dynamicSearchAds: 'DynamicSearchAd',\r\n responsiveAds: 'ResponsiveAd',\r\n responsiveSearchAds: 'ResponsiveSearchAd',\r\n};\r\n\r\nconst getAdType = function (entityValues) {\r\n if (entityValues.AdTitle2) {\r\n return adTypes.expandedTextAds;\r\n } else if (entityValues.AdHeadline && entityValues.AdBusinessName) {\r\n return adTypes.responsiveAds;\r\n } else if (_.has(entityValues, 'AdHeadlines')) {\r\n return adTypes.responsiveSearchAds;\r\n } else if (\r\n _.has(entityValues, 'AdPath1') &&\r\n _.has(entityValues, 'AdPath2') &&\r\n !_.has(entityValues, 'AdTitle')\r\n ) {\r\n return adTypes.dynamicSearchAds;\r\n }\r\n return adTypes.textAds;\r\n};\r\n\r\nconst getGenericAdPreview = function (entityValues) {\r\n let previewValue = '';\r\n\r\n // if AdTitle is there, use it\r\n previewValue = entityValues.AdTitle;\r\n\r\n return previewValue;\r\n};\r\n\r\nconst getResponsiveSearchAdPreview = function (entityValues) {\r\n let previewValue = '';\r\n\r\n let values = parseSync(entityValues.AdHeadlines);\r\n if (!_.isEmpty(values)) {\r\n values = _.map(values, value => parseSync(value));\r\n\r\n previewValue = getTitlePreview(values);\r\n }\r\n\r\n return previewValue;\r\n};\r\n\r\nconst getResponsiveAdPreview = function (entityValues, i18n) {\r\n return responsiveAdPreviewTemplate({\r\n itemViewModel: {\r\n LandscapeImageMediaUrl: entityValues.OriginalImageMediaUrl || entityValues.LandscapeImageMediaUrl,\r\n Headline: entityValues.AdHeadline,\r\n LongHeadline: entityValues.AdLongHeadline,\r\n Text: entityValues.AdText,\r\n BusinessName: entityValues.AdBusinessName,\r\n convertedDisplayUrl: entityValues.AdDisplayUrl,\r\n },\r\n i18n,\r\n withContainer: true,\r\n });\r\n};\r\n\r\nconst getDynamicSearchAdPreview = function (entityValues, i18n) {\r\n return dynamicSearchAdPreviewTemplate({\r\n itemViewModel: {\r\n DisplayUrl: entityValues.AdDisplayUrl,\r\n Path1: entityValues.AdPath1,\r\n Path2: entityValues.AdPath2,\r\n Text: entityValues.AdText,\r\n },\r\n i18n,\r\n });\r\n};\r\n\r\nconst getAdEntityPreviewCell = function (entityValues, i18n) {\r\n const adType = getAdType(entityValues);\r\n\r\n switch (adType) {\r\n case adTypes.responsiveSearchAds:\r\n return { value: getResponsiveSearchAdPreview(entityValues), isHtml: false };\r\n\r\n case adTypes.responsiveAds:\r\n return { value: getResponsiveAdPreview(entityValues, i18n), isHtml: true };\r\n\r\n case adTypes.dynamicSearchAds:\r\n return { value: getDynamicSearchAdPreview(entityValues, i18n), isHtml: true };\r\n\r\n case adTypes.expandedTextAds:\r\n default:\r\n return { value: getGenericAdPreview(entityValues), isHtml: false };\r\n }\r\n};\r\n\r\nexport { getAdEntityPreviewCell };\r\n","import _ from 'underscore';\r\nimport { getAdEntityPreviewCell } from './ad-preview-helper';\r\n\r\n// format returned value into two decimal strings\r\nfunction formatValueToFixed(i18n, value) {\r\n return i18n.formatDecimalToFixed(parseFloat(value));\r\n}\r\n\r\nfunction formatEntityValue(item, entityKeys, defaultEntityValue) {\r\n const entity = _.find(item.EntityKey, it => entityKeys.indexOf(it.Key) >= 0);\r\n\r\n return { value: entity && entity.Value ? entity.Value : defaultEntityValue, isHtml: false };\r\n}\r\n\r\n/**\r\n * Format the status results of bulk edit response to formats used by PreviewResultView\r\n * @param {Object[]} rows - raw result rows from bulk edit result\r\n * @param {String[]} entityKeys - the entity keys, using it to find entityname from response\r\n * @param {Object} i18n - localization setting\r\n * @param {String} defaultEntityValue - default entity value, used when missing from result,\r\n * optional\r\n * @param {String} entity - entity type, ex) ad, adGroup\r\n *\r\n * @returns {Object} formated result, [{data: {value, isHtml}}]\r\n */\r\nexport function formatStatus(rows, entityKeys, i18n, defaultEntityValue, entity) {\r\n const result = [];\r\n if (rows && rows.length) {\r\n _.each(rows, (item) => {\r\n const data = [];\r\n\r\n if (entity === 'Ad') {\r\n const entityValues = {};\r\n _.each(item.EntityKey, (entityItem) => {\r\n entityValues[entityItem.Key] = entityItem.Value;\r\n });\r\n\r\n data.push(getAdEntityPreviewCell(entityValues, i18n));\r\n } else {\r\n data.push(formatEntityValue(item, entityKeys, defaultEntityValue));\r\n }\r\n\r\n if (item.Changes && item.Changes.length) {\r\n data.push({ value: i18n.getString(`EntityStatus_${item.Changes[0].OriginalValue}`), isHtml: false });\r\n data.push({ value: i18n.getString(`EntityStatus_${item.Changes[0].NewValue}`), isHtml: false });\r\n } else {\r\n data.push({ value: '', isHtml: false });\r\n data.push({ value: '', isHtml: false });\r\n }\r\n result.push({ data });\r\n });\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Format the bid/budget results of bulk edit response to formats used by PreviewResultView\r\n * @param {Object[]} rows - raw result rows from bulk edit result\r\n * @param {String[]} entityKeys - the entity keys, using it to find entityname from response\r\n * @param {Object} i18n - localization setting\r\n *\r\n * @returns {Object} formated result, [{data: {value, isHtml}}]\r\n */\r\nexport function formatBidBudget(rows, entityKeys, i18n) {\r\n const result = [];\r\n if (rows && rows.length) {\r\n _.each(rows, (value) => {\r\n const data = [formatEntityValue(value, entityKeys)];\r\n\r\n if (value.Changes && value.Changes.length) {\r\n // for changeBudget we can only have one element in value.Changes array\r\n data.push({\r\n value: formatValueToFixed(i18n, value.Changes[0].OriginalValue),\r\n isHtml: false,\r\n });\r\n data.push({\r\n value: formatValueToFixed(i18n, value.Changes[0].NewValue),\r\n isHtml: false,\r\n });\r\n } else {\r\n data.push({ value: '', isHtml: false });\r\n data.push({ value: '', isHtml: false });\r\n }\r\n result.push({ data });\r\n });\r\n }\r\n return result;\r\n}\r\n\r\n\r\n/**\r\n * Format the email results of bulk edit response to formats used by PreviewResultView\r\n * @param {Object[]} rows - raw result rows from bulk edit result\r\n * @param {String[]} entityKeys - the entity keys, using it to find entityname from response\r\n * @param {String} defaultEntityValue - default entity value, used when missing from result,\r\n * optional\r\n *\r\n * @returns {Object} formated result, [{data: {value, isHtml}}]\r\n */\r\nexport function formatEmail(rows, entityKeys, defaultEntityValue) {\r\n const result = [];\r\n if (rows && rows.length) {\r\n _.each(rows, (item) => {\r\n result.push({ data: [formatEntityValue(item, entityKeys, defaultEntityValue)] });\r\n });\r\n }\r\n return result;\r\n}\r\n","import _ from 'underscore';\r\nimport template from './audience-decoration.pug';\r\n\r\nfunction getEl(gridView) {\r\n const gridContainer = gridView.$el.closest('.bingadsgrid');\r\n\r\n return gridContainer.find('.editor__container');\r\n}\r\n\r\nexport const onSuccess = ({ i18n, isCustomInMarketEnabled, audiencesPath }) => {\r\n const audienceLink = `${i18n.getString('Remarketing_Tutorial_Step3_Desc_AudienceTabLink')}`;\r\n const info = isCustomInMarketEnabled ?\r\n i18n.getString('Audiences_AssociationSuccess_Message_CustomInMarket_Campaign').replace('{0}', audienceLink) :\r\n i18n.getString('Audiences_AssociationSuccess_Message_Campaign').replace('{0}', audienceLink);\r\n window.App.views.alertCenter.toastInfo(info);\r\n};\r\n\r\nexport function campaignAudienceAssociationDecoration(gridView, {\r\n i18n,\r\n isCustomInMarketEnabled,\r\n}) {\r\n _.defer(() => {\r\n const stateData = window.App.state.get('$data');\r\n\r\n if (stateData && stateData.fromAudienceLibrary) {\r\n // Show the message on top of the grid view\r\n getEl(gridView).html(template({\r\n fromAudienceLibrary: true,\r\n isCustomInMarketEnabled,\r\n i18n,\r\n })).show();\r\n }\r\n\r\n // Setup handler of association success\r\n window.App.on('campaignRemarketingAssociated', (/* isBSCAdGroupFiltered, not used */) => {\r\n // Show the return link to audience tab\r\n const container = getEl(gridView);\r\n\r\n container.html(template({\r\n campaignRemarketingAssociated: true,\r\n isCustomInMarketEnabled,\r\n i18n,\r\n })).show();\r\n\r\n container.find('.aud-tab-link').click(() => {\r\n window.App.navigate('customer/:customer_id/account/:account_id/audiences');\r\n });\r\n });\r\n });\r\n}\r\n","import _ from 'underscore';\r\nimport { CampaignType } from '@bingads-webui-campaign/campaign-ui-common';\r\nimport { projectionGridBulkEdit } from '@bingads-webui-campaign/projection-grid-bulk-edit';\r\nimport { campaignAudienceAssociationDecoration, onSuccess as onAudienceAssociationSuccess } from './audience-decoration';\r\n\r\n/**\r\n * @typedef { Object } campaignBulkEditOptions\r\n * @property { Object } status campaign status schema.\r\n * @property { Object } ChangeStatusView campaign change status view.\r\n * @property { Object } ChangeStatusModel campaign change status model.\r\n * @property { Object } ChangeBudgetView campaign change budget view.\r\n * @property { Object } ChangeBudgetModel campaign change budget model.\r\n * @property { Object } ChangeCashbackBudgetView campaign change cash budget view.\r\n * @property { Object } ChangeCashbackBudgetModel campaign change cash budget model.\r\n * @property { Object } ChangeCashbackPercentView campaign change cash percent view.\r\n * @property { Object } ChangeCashbackPercentModel campaign change cash percent model.\r\n * @property { Object } ChangeBidStrategyModel campaign change bid strategy model.\r\n * @property { Object } ChangeBidStrategyView campaign change bid strategy model.\r\n * @property { Object } BulkCampaignExclusionsView campaign bulk add exclusion view.\r\n * @property { Object } ChangeLanguageView campaign change language view.\r\n * @property { Object } ChangeLanguageModel campaign change language model.\r\n * @property { Object } AudienceAssociationView campaign association exclusion view.\r\n * @property { Object } AudienceAssociationModel campaign association exclusion model.\r\n * @property { Object } ChangeRsaAutoAssetsView campaign change RSA auto assets view.\r\n * @property { Object } ChangeRsaAutoAssetsModel campaign change RSA auto assets model.\r\n * @property { Object } CopyPaste campaign copy paste\r\n * @property { Object } config config.\r\n * @property { Object } i18n i18n.\r\n * @property { Object } scope scope.\r\n * @property { Object } isForVNext isForVNext.\r\n * @property { String } bulkEditUrl BulkEditUrl.\r\n * @property { Object } disableDeselectAll flag to disable deselect all after bulk edit success.\r\n */\r\n\r\n/**\r\n * campaignBulkEdit\r\n * @param { campaignBulkEditOptions } options campaign bulk edit options\r\n * @returns { Object } campaignBulkEditPlugin campaign bulk edit plugin\r\n */\r\nfunction campaignBulkEdit(options) {\r\n const {\r\n status,\r\n ChangeStatusView,\r\n ChangeStatusModel,\r\n ChangeBudgetView,\r\n ChangeBudgetModel,\r\n ChangeCashbackBudgetView,\r\n ChangeCashbackBudgetModel,\r\n ChangeCashbackPercentView,\r\n ChangeCashbackPercentModel,\r\n ChangeBidStrategyModel,\r\n ChangeBidStrategyView,\r\n ChangeLanguageView,\r\n ChangeLanguageModel,\r\n BulkCampaignExclusionsView,\r\n AudienceAssociationView,\r\n AudienceAssociationModel,\r\n ChangeRsaAutoAssetsView,\r\n ChangeRsaAutoAssetsModel,\r\n CopyPaste,\r\n config,\r\n filterService,\r\n i18n,\r\n i18nNewDesign,\r\n router,\r\n scope,\r\n isForVNext,\r\n bulkEditUrl,\r\n qualtricsSurveyCallback,\r\n importNotificationCallback,\r\n importBudgetBidNotificationCallback,\r\n disableDeselectAll = false,\r\n getCampaignTypeGlobalFilter,\r\n perfMarker,\r\n campaignUpgradeProps,\r\n } = options;\r\n\r\n function isFilterByPerformanceMaxCampaigns() {\r\n return getCampaignTypeGlobalFilter() === CampaignType.PerformanceMax;\r\n }\r\n\r\n function isFilterByAppAdsCampaigns() {\r\n return getCampaignTypeGlobalFilter() === CampaignType.App;\r\n }\r\n\r\n function isFilterByAllCampaigns() {\r\n return getCampaignTypeGlobalFilter() === CampaignType.All;\r\n }\r\n\r\n function isFilterBySearchCampaigns() {\r\n return getCampaignTypeGlobalFilter() === CampaignType.Default;\r\n }\r\n\r\n function isFilterByShoppingCampaigns() {\r\n return getCampaignTypeGlobalFilter() === CampaignType.Shopping;\r\n }\r\n\r\n function getChangeBudgetView({ viewConfig, selectedRowCount }) {\r\n return new ChangeBudgetView(_.defaults({\r\n model: new ChangeBudgetModel({\r\n selectedEntityCount: selectedRowCount,\r\n scope,\r\n budgetType: 'Daily',\r\n }),\r\n isForVNext,\r\n }, viewConfig));\r\n }\r\n\r\n function getChangeLifetimeBudgetView({ viewConfig, selectedRowCount }) {\r\n return new ChangeBudgetView(_.defaults({\r\n model: new ChangeBudgetModel({\r\n selectedEntityCount: selectedRowCount,\r\n scope,\r\n budgetType: 'LifetimeBudgetStandard',\r\n }),\r\n isForVNext,\r\n }, viewConfig));\r\n }\r\n\r\n function getChangeCashbackPercentView({ viewConfig, selectedRowCount }) {\r\n return new ChangeCashbackPercentView(_.defaults({\r\n model: new ChangeCashbackPercentModel({\r\n selectedEntityCount: selectedRowCount,\r\n scope,\r\n }),\r\n isForVNext,\r\n }, viewConfig));\r\n }\r\n\r\n function getChangeCashbackBudgetView({ viewConfig, selectedRowCount }) {\r\n return new ChangeCashbackBudgetView(_.defaults({\r\n model: new ChangeCashbackBudgetModel({\r\n selectedEntityCount: selectedRowCount,\r\n scope,\r\n }),\r\n isForVNext,\r\n }, viewConfig));\r\n }\r\n\r\n function getChangeBidStrategyView({ viewConfig, selectedRowCount }) {\r\n return new ChangeBidStrategyView(_.defaults({\r\n model: new ChangeBidStrategyModel({\r\n Entity: 'Campaign',\r\n selectedEntityCount: selectedRowCount,\r\n scope,\r\n }),\r\n isForVNext,\r\n entityType: 'Campaign',\r\n biddingStrategyType: 'EnhancedCpc',\r\n i18nNewDesign,\r\n getCampaignTypeGlobalFilter,\r\n }, viewConfig));\r\n }\r\n\r\n function getChangeLanguageView({ viewConfig, selectedRowCount }) {\r\n return new ChangeLanguageView(_.defaults({\r\n model: new ChangeLanguageModel({\r\n selectedEntityCount: selectedRowCount,\r\n scope,\r\n }),\r\n isForVNext,\r\n }, viewConfig));\r\n }\r\n\r\n function getaddExclusionsView({ viewConfig }) {\r\n if (viewConfig.grid.pgridPlugins.crossPageSelectAll.isAllSelected && !confirm(i18n.getString('CampaignSummaryPage_MultiplePageSelectionNotAllowed'))) {// eslint-disable-line\r\n return undefined;\r\n }\r\n\r\n const { gridView } = viewConfig.grid;\r\n const { inlineError } = viewConfig;\r\n\r\n return new BulkCampaignExclusionsView({\r\n gridView,\r\n inlineError,\r\n isForVNext,\r\n grid: viewConfig.grid,\r\n campaignType: getCampaignTypeGlobalFilter(),\r\n });\r\n }\r\n\r\n function getCampaignAudienceView({ viewConfig, selectedRowCount }) {\r\n const { IsCustomAudienceAllowed, IsInMarketAudienceAllowed } = config.get('Permissions');\r\n let audienceAssociationPerfMarker;\r\n if (perfMarker) {\r\n audienceAssociationPerfMarker = perfMarker.createChild('Association_With_Audiences');\r\n audienceAssociationPerfMarker.willInit();\r\n const { gridView } = viewConfig.grid;\r\n const listener = () => {\r\n audienceAssociationPerfMarker.done();\r\n gridView.off('didUpdate', listener);\r\n };\r\n gridView.on('didUpdate', listener);\r\n }\r\n return new AudienceAssociationView(_.defaults(\r\n {\r\n isForVNext,\r\n model: new AudienceAssociationModel({ selectedEntityCount: selectedRowCount }),\r\n router,\r\n perfMarker: audienceAssociationPerfMarker,\r\n newI18n: i18nNewDesign,\r\n },\r\n viewConfig,\r\n isForVNext ? {\r\n onSuccessCallback: () => onAudienceAssociationSuccess({\r\n i18n,\r\n isCustomInMarketEnabled: IsCustomAudienceAllowed || IsInMarketAudienceAllowed,\r\n audiencesPath: `${router.getRoutePathById('audiences')}${window.location.search}`,\r\n }),\r\n } : {}\r\n ));\r\n }\r\n\r\n function getChangeRsaAutoAssetsView({ viewConfig, selectedRowCount }) {\r\n return new ChangeRsaAutoAssetsView(_.defaults({\r\n model: new ChangeRsaAutoAssetsModel({\r\n selectedEntityCount: selectedRowCount,\r\n scope,\r\n }),\r\n }, viewConfig));\r\n }\r\n\r\n function onCopyClicked({ viewConfig }) {\r\n CopyPaste.copy('campaign', Object.assign({}, viewConfig.grid, { perfMarker }));\r\n }\r\n\r\n function onPasteClicked({ viewConfig }) {\r\n CopyPaste.paste(Object.assign({}, viewConfig.grid, { perfMarker }));\r\n }\r\n\r\n const permissions = config.get('Permissions');\r\n\r\n const items = [{\r\n text: permissions.dynamic.CampaignLifetimeBudget ? i18n.getString('Grid_ChangeDailyBudgets') : i18n.getString('Grid_ChangeBudgets'),\r\n classes: ['bulk-edit-change-budget'],\r\n createView: getChangeBudgetView,\r\n },\r\n permissions.dynamic.CampaignLifetimeBudget && {\r\n text: i18n.getString('Grid_ChangeLifetimeBudgets'),\r\n classes: ['bulk-edit-change-lifetime-budget'],\r\n createView: getChangeLifetimeBudgetView,\r\n },\r\n permissions.IsPersonalizedOffersEnabled &&\r\n !permissions.IsPersonalizedOffersV4Enabled &&\r\n !(permissions.IsPersonalizedOffersV2Enabled ||\r\n permissions.IsPersonalizedOffersV3Enabled) &&\r\n isForVNext ? {\r\n text: i18n.getString('Grid_ChangeCashbackBudgets'),\r\n classes: ['bulk-edit-change-cashback-budget'],\r\n createView: getChangeCashbackBudgetView,\r\n } : null,\r\n permissions.IsPersonalizedOffersEnabled &&\r\n !permissions.IsPersonalizedOffersV4Enabled &&\r\n isForVNext ? {\r\n text: i18n.getString('Grid_ChangeCashbackPercent'),\r\n classes: ['bulk-edit-change-cashback-percent'],\r\n createView: getChangeCashbackPercentView,\r\n } : null,\r\n isForVNext ? {\r\n text: i18n.getString('Grid_BidStrategy'),\r\n classes: ['bulk-edit-change-bid-strategy-type'],\r\n createView: getChangeBidStrategyView,\r\n isValid: () => !isFilterByAppAdsCampaigns(),\r\n } : null,\r\n {\r\n text: i18n.getString('EditCampaignLanguage'),\r\n classes: ['bulk-edit-campaign-language'],\r\n createView: getChangeLanguageView,\r\n },\r\n {\r\n text: i18n.getString('Grid_BulkChanges'),\r\n classes: ['bulk-edit-exclusions'],\r\n createView: getaddExclusionsView,\r\n },\r\n ];\r\n\r\n const decorationCallback = (gridView) => {\r\n const localData = {\r\n i18n,\r\n isCustomInMarketEnabled:\r\n permissions.IsCustomAudienceAllowed || permissions.IsInMarketAudienceAllowed,\r\n };\r\n\r\n campaignAudienceAssociationDecoration(gridView, localData);\r\n };\r\n\r\n items.push({\r\n text: permissions.IsCustomAudienceAllowed || permissions.IsInMarketAudienceAllowed ?\r\n i18n.getString('AudiencesAssociation_BulkEditAssociation_Audience_Title') : i18n.getString('AudiencesAssociation_BulkEditAssociation_Title'),\r\n classes: ['bulk-edit-campaign-audience'],\r\n createView: getCampaignAudienceView,\r\n isFallbackEnabled: false,\r\n isValid: () => !isFilterByPerformanceMaxCampaigns() && !isFilterByAppAdsCampaigns(),\r\n });\r\n\r\n const showUpgradeTool = scope && scope.location\r\n && scope.location.pathname === '/campaign/vnext/campaigns';\r\n\r\n const campaignUpgradeItem = showUpgradeTool ? {\r\n text: _.result(campaignUpgradeProps, 'toolbarDropdownText'),\r\n classes: ['pmax-campaign-upgrade'],\r\n repos: campaignUpgradeProps,\r\n isValid: () => isFilterByAllCampaigns() || isFilterByShoppingCampaigns(),\r\n } : {\r\n isValid: false,\r\n };\r\n\r\n let frontItems = [];\r\n if (permissions.IsCampaignAdGroupCopyPasteEnabled && CopyPaste) {\r\n if (isForVNext) {\r\n frontItems = [{\r\n text: i18n.getString('BulkEdit_CopyMenu'),\r\n classes: ['bulk-edit-campaigns-copy'],\r\n createView: onCopyClicked,\r\n hotkeys: {\r\n win: 'Ctrl-C',\r\n mac: '\\u2318C',\r\n },\r\n isValid: () => {\r\n if (isFilterByPerformanceMaxCampaigns()) {\r\n return _.get(permissions, ['dynamic', 'PmaxCopyPasteEnabled'], false);\r\n }\r\n if (isFilterByAppAdsCampaigns()) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n }];\r\n } else {\r\n items.push(\r\n {\r\n text: i18n.getString('BulkEdit_CopyMenu'),\r\n classes: ['bulk-edit-campaigns-copy'],\r\n createView: onCopyClicked,\r\n },\r\n {\r\n text: i18n.getString('BulkEdit_PasteMenu'),\r\n classes: ['bulk-edit-campaigns-paste'],\r\n createView: onPasteClicked,\r\n noSelectionRequired: true,\r\n }\r\n );\r\n }\r\n }\r\n\r\n // Since the campaignBulkEdit is used in multi grids,\r\n // add extra View & Model check to avoid impacting other unneeded grids.\r\n if (ChangeRsaAutoAssetsView && ChangeRsaAutoAssetsModel) {\r\n items.push({\r\n text: i18n.getString('Grid_ChangeRsaAutoAssets'),\r\n classes: ['bulk-edit-rsa-auto-assets'],\r\n createView: getChangeRsaAutoAssetsView,\r\n isValid: () => isFilterByAllCampaigns() || isFilterBySearchCampaigns(),\r\n });\r\n }\r\n\r\n return projectionGridBulkEdit({\r\n status,\r\n ChangeStatusView,\r\n ChangeStatusModel,\r\n DeleteConfirmation: i18n.getString('Campaigns_DeleteConfirmation'),\r\n config,\r\n i18n,\r\n entityType: 'campaign',\r\n items: _.compact(items),\r\n frontItems,\r\n campaignUpgradeItem,\r\n filterService,\r\n scope,\r\n gridDecorationCallback: decorationCallback,\r\n isForVNext,\r\n bulkEditUrl,\r\n qualtricsSurveyCallback,\r\n importNotificationCallback,\r\n importBudgetBidNotificationCallback,\r\n disableDeselectAll,\r\n });\r\n}\r\n\r\nexport { campaignBulkEdit };\r\n","import _ from 'underscore';\r\nimport { RANGES, getDateRanges } from '@bingads-webui/date-ranges';\r\n\r\nconst dateRangeMapping = {\r\n Yesterday: RANGES.YESTERDAY,\r\n LastSevenDays: RANGES.LAST_SEVEN_DAYS,\r\n Today: RANGES.TODAY,\r\n LastThirtyDays: RANGES.LAST_THIRTY_DAYS,\r\n LastFourteenDays: RANGES.LAST_FOURTEEN_DAYS,\r\n ThisMonth: RANGES.THIS_MONTH,\r\n LastMonth: RANGES.LAST_MONTH,\r\n LastThreeMonths: RANGES.LAST_THREE_MONTHS,\r\n LastSixMonths: RANGES.LAST_SIX_MONTHS,\r\n ThisYear: RANGES.THIS_YEAR,\r\n LastYear: RANGES.LAST_YEAR,\r\n AllTime: RANGES.ALL_TIME,\r\n ThisWeekFromSun: RANGES.THIS_WEEK_SUNDAY,\r\n ThisWeekFromMon: RANGES.THIS_WEEK_MONDAY,\r\n LastWeekStartingSun: RANGES.LAST_WEEK_SUNDAY,\r\n LastWeekStartingMon: RANGES.LAST_WEEK_MONDAY,\r\n LastBusinessWeek: null,\r\n LastFourWeeksStartingSun: null,\r\n};\r\n\r\nexport function getStateDateRangePreset(DateRangePreset) {\r\n return DateRangePreset ? dateRangeMapping[DateRangePreset] : RANGES.CUSTOM;\r\n}\r\n\r\nconst getRanges = _.once(() =>\r\n getDateRanges({\r\n today: new Date(),\r\n i18n: {\r\n getString: _.identity,\r\n },\r\n }));\r\n\r\nexport function convertDateRangePresetToRangeId(DateRangePreset) {\r\n const ranges = getRanges();\r\n const rangeKey = getStateDateRangePreset(DateRangePreset);\r\n\r\n return _.result(ranges[rangeKey], 'grain');\r\n}\r\n\r\n\r\nexport const grains = {\r\n Yesterday: 1,\r\n LastSevenDays: 2,\r\n Today: 3,\r\n Custom: 4,\r\n LastThirtyDays: 5,\r\n LastFourteenDays: 6,\r\n ThisWeekFromSun: 7,\r\n ThisWeekFromMon: 8,\r\n LastWeekStartingSun: 9,\r\n ThisMonth: 10,\r\n LastMonth: 11,\r\n LastThreeMonths: 12,\r\n LastSixMonths: 13,\r\n LastWeekStartingMon: 14,\r\n LastBusinessWeek: 15,\r\n ThisYear: 20,\r\n LastYear: 21,\r\n AllTime: 22,\r\n};\r\n\r\nexport function getSelectionDateRangePreset(statePreset, grain) {\r\n // For LastSevenDays, it's last7Days in CampaignUI, but lastSevenDays in HotelCenter\r\n // For LastFourteenDays, it's last14Days in CampaignUI, but lastFourteenDays in HotelCenter\r\n // The magic grain is same in both pages\r\n let preset;\r\n\r\n if (!_.isUndefined(statePreset)) {\r\n preset = _.findKey(dateRangeMapping, value => value === statePreset);\r\n }\r\n if (!preset) {\r\n preset = _.findKey(grains, value => value === grain);\r\n }\r\n return preset;\r\n}\r\n","import _ from 'underscore';\r\n\r\nconst options = {\r\n raw: 'yyyy-MM-dd',\r\n timeZone: null,\r\n};\r\n\r\nexport function getSelectionDateFormatter(i18n) {\r\n return i18n.dateFormatter(options);\r\n}\r\n\r\nexport function getSelectionDateParser(i18n) {\r\n const parser = i18n.dateParser(options);\r\n\r\n return date => (_.isString(date) ? parser(date.substr(0, 10)) : undefined);\r\n}\r\n","import { getDateRanges } from '@bingads-webui/date-ranges';\r\nimport { getStateDateRangePreset } from './date-range-preset';\r\nimport { getSelectionDateParser } from './selection-date';\r\n\r\nexport default function getStateDateRange({\r\n today,\r\n i18n,\r\n DateRange,\r\n}) {\r\n const parser = getSelectionDateParser(i18n);\r\n\r\n return getDateRanges({\r\n today,\r\n i18n,\r\n customStart: parser(DateRange.StartDate),\r\n customEnd: parser(DateRange.EndDate),\r\n })[getStateDateRangePreset(DateRange.DateRangePreset)];\r\n}\r\n","import _ from 'underscore';\r\nimport { COMPARISON_RANGES } from '@bingads-webui/date-ranges';\r\n\r\nconst comparisonOptionMapping = {\r\n PreviousPeriod: COMPARISON_RANGES.PREVIOUS_PERIOD,\r\n SamePeriodLastYear: COMPARISON_RANGES.SAME_PERIOD_LAST_YEAR,\r\n LastMonth: COMPARISON_RANGES.LAST_MONTH, // new ui has this\r\n};\r\n\r\nexport function getStateComparisonDateRangeOption(ComparisonDateRangeOption) {\r\n return ComparisonDateRangeOption ?\r\n comparisonOptionMapping[ComparisonDateRangeOption] :\r\n COMPARISON_RANGES.CUSTOM;\r\n}\r\n\r\nexport function getSelectionComparisonDateRangeOption(stateOption) {\r\n return _.findKey(comparisonOptionMapping, value => value === stateOption);\r\n}\r\n","import {\r\n getComparedDateRanges\r\n} from '@bingads-webui/date-ranges';\r\nimport { getStateComparisonDateRangeOption } from './comparison-date-range-option';\r\nimport { getSelectionDateParser } from './selection-date';\r\n\r\nexport default function getStateComparedDateRange({\r\n today,\r\n i18n,\r\n primaryRange,\r\n ComparisonDateRange,\r\n}) {\r\n const parser = getSelectionDateParser(i18n);\r\n\r\n return ComparisonDateRange ? getComparedDateRanges({\r\n today,\r\n i18n,\r\n primaryRange,\r\n comparedCustomStart: parser(ComparisonDateRange.StartDate),\r\n comparedCustomEnd: parser(ComparisonDateRange.EndDate),\r\n })[getStateComparisonDateRangeOption(ComparisonDateRange.ComparisonDateRangeOption)] : null;\r\n}\r\n","import { withoutTime } from '@bingads-webui-universal/primitive-utilities';\r\nimport _ from 'underscore';\r\nimport getStateDateRange from './util/get-state-date-range';\r\nimport getStateComparedDateRange from './util/get-state-compared-date-range';\r\n\r\nexport default function convertSelectionDateRangeToState({\r\n Selection: {\r\n DateRange,\r\n ComparisonDateRange,\r\n },\r\n i18n,\r\n}) {\r\n const primaryRange = getStateDateRange({\r\n today: withoutTime(new Date()),\r\n i18n,\r\n DateRange,\r\n });\r\n\r\n return _.extend({}, primaryRange, {\r\n compared: getStateComparedDateRange({\r\n today: withoutTime(new Date()),\r\n i18n,\r\n primaryRange,\r\n ComparisonDateRange,\r\n }),\r\n });\r\n}\r\n","import { RANGES, COMPARISON_RANGES } from '@bingads-webui/date-ranges';\r\nimport { getSelectionDateRangePreset, grains } from './util/date-range-preset';\r\nimport { getSelectionComparisonDateRangeOption } from './util/comparison-date-range-option';\r\nimport { getSelectionDateFormatter } from './util/selection-date';\r\n\r\nfunction isRangeNotPreset($daterange) {\r\n const {\r\n grain,\r\n RangeIndex,\r\n } = $daterange;\r\n // Only if we have this RangeIndex, we can tell if it is a preset or not.\r\n if (RangeIndex == null) {\r\n return false;\r\n }\r\n switch (grain) {\r\n case grains.Today:\r\n case grains.ThisWeekFromSun:\r\n case grains.ThisWeekFromMon:\r\n case grains.LastSevenDays:\r\n case grains.LastFourteenDays:\r\n case grains.ThisMonth:\r\n case grains.LastThirtyDays:\r\n case grains.AllTime:\r\n if (RangeIndex === 0) {\r\n return false; // is preset\r\n }\r\n return true;\r\n case grains.Yesterday:\r\n case grains.LastWeekStartingSun:\r\n case grains.LastWeekStartingMon:\r\n case grains.LastMonth:\r\n if (RangeIndex === 1) {\r\n return false; // is preset\r\n }\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\nexport default function convertStateDateRangeToSelection({\r\n $daterange,\r\n i18n,\r\n}) {\r\n if (!$daterange) {\r\n return {\r\n DateRange: null,\r\n ComparisonDateRange: null,\r\n };\r\n }\r\n\r\n const formatAPIDate = getSelectionDateFormatter(i18n);\r\n\r\n const {\r\n start,\r\n end,\r\n key,\r\n grain,\r\n compared,\r\n } = $daterange;\r\n\r\n const startdate = formatAPIDate(start);\r\n const enddate = formatAPIDate(end);\r\n\r\n // use grain when there is no key, such as in new ui.\r\n const DateRange = (key === RANGES.CUSTOM || grain === grains.Custom\r\n || isRangeNotPreset($daterange)) ?\r\n {\r\n StartDate: startdate,\r\n EndDate: enddate,\r\n } : {\r\n DateRangePreset: getSelectionDateRangePreset(key, grain),\r\n };\r\n\r\n if (!compared) {\r\n return {\r\n DateRange,\r\n ComparisonDateRange: null,\r\n };\r\n }\r\n\r\n const ComparisonDateRange = compared.key === COMPARISON_RANGES.CUSTOM ? {\r\n StartDate: formatAPIDate(compared.start),\r\n EndDate: formatAPIDate(compared.end),\r\n } : {\r\n ComparisonDateRangeOption: getSelectionComparisonDateRangeOption(compared.key),\r\n };\r\n\r\n return {\r\n DateRange,\r\n ComparisonDateRange,\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport getStateDateRange from './util/get-state-date-range';\r\nimport getStateComparedDateRange from './util/get-state-compared-date-range';\r\nimport { getSelectionDateFormatter } from './util/selection-date';\r\n\r\nexport default function lockDownSelectionDateRange({\r\n Selection,\r\n today,\r\n i18n,\r\n}) {\r\n const {\r\n DateRange,\r\n ComparisonDateRange,\r\n } = Selection;\r\n\r\n const primaryDateRange = getStateDateRange({\r\n today,\r\n i18n,\r\n DateRange,\r\n });\r\n\r\n const comparedDateRange = getStateComparedDateRange({\r\n today,\r\n i18n,\r\n primaryRange: primaryDateRange,\r\n ComparisonDateRange,\r\n });\r\n\r\n const selectionDateFormatter = getSelectionDateFormatter(i18n);\r\n\r\n return _.defaults({\r\n DateRange: {\r\n StartDate: selectionDateFormatter(primaryDateRange.start),\r\n EndDate: selectionDateFormatter(primaryDateRange.end),\r\n },\r\n ComparisonDateRange: comparedDateRange ? {\r\n StartDate: selectionDateFormatter(comparedDateRange.start),\r\n EndDate: selectionDateFormatter(comparedDateRange.end),\r\n } : null,\r\n }, Selection);\r\n}\r\n","import _ from 'underscore';\r\nimport { SchemaI18n } from '@bingads-webui-universal/schema-i18n';\r\n\r\nfunction customDateRangeFormatter(i18n) {\r\n const formatter = i18n.dateFormatter({ skeleton: 'yMd' });\r\n const parser = i18n.dateParser({ raw: 'yyyy-MM-dd' });\r\n\r\n const formatDate = _.compose(formatter, parser, str => str.substr(0, 10));\r\n return (start, end) => `${formatDate(start)} - ${formatDate(end)}`;\r\n}\r\n\r\nexport class DateRangeFormat {\r\n constructor({\r\n i18n,\r\n }) {\r\n this.s$i18n = new SchemaI18n({ i18n });\r\n this.i18n = i18n;\r\n this.formatCustomDateRange = customDateRangeFormatter(i18n);\r\n }\r\n\r\n format(dateRange) {\r\n if (!dateRange) {\r\n return this.i18n.getString('None');\r\n }\r\n\r\n const {\r\n DateRangePreset,\r\n StartDate,\r\n EndDate,\r\n } = dateRange;\r\n\r\n if (DateRangePreset) {\r\n return this.formatPreset(DateRangePreset);\r\n }\r\n\r\n return this.formatCustomDateRange(StartDate, EndDate);\r\n }\r\n\r\n formatPreset(preset) {\r\n return preset ?\r\n this.s$i18n.enum('DateRangePreset', preset) :\r\n this.i18n.getString('Custom');\r\n }\r\n}\r\n\r\nexport class ComparisonDateRangeFormat {\r\n constructor({\r\n i18n,\r\n noneStringKey = 'None',\r\n }) {\r\n this.s$i18n = new SchemaI18n({ i18n });\r\n this.i18n = i18n;\r\n this.formatCustomDateRange = customDateRangeFormatter(i18n);\r\n this.noneStringKey = noneStringKey;\r\n }\r\n\r\n format(comparisonDateRange) {\r\n if (!comparisonDateRange) {\r\n return this.i18n.getString(this.noneStringKey);\r\n }\r\n\r\n const {\r\n ComparisonDateRangeOption,\r\n StartDate,\r\n EndDate,\r\n } = comparisonDateRange;\r\n\r\n if (ComparisonDateRangeOption) {\r\n return this.s$i18n.enum('ComparisonDateRangeOption', ComparisonDateRangeOption);\r\n }\r\n\r\n return this.formatCustomDateRange(StartDate, EndDate);\r\n }\r\n\r\n formatPreset(preset) {\r\n if (preset) {\r\n if (preset === 'None') {\r\n return this.i18n.getString(this.noneStringKey);\r\n }\r\n return this.s$i18n.enum('ComparisonDateRangeOption', preset);\r\n }\r\n return this.i18n.getString('Custom');\r\n }\r\n}\r\n","/* eslint-disable no-param-reassign */\r\nimport { extend } from 'underscore';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport DateSettings from '@bingads-webui-campaign-legacy/ad-schedule/view/date-settings';\r\nimport { datePickerStyle, advancedSettingsSectionStyle, toggleButtonStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport { creationCommonStyle } from '@bingads-webui-campaign-react/campaign-adgroup-settings-shared-styles';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nconst globalLegacyI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/campaign-creation-advanced');\r\n\r\nconst getStyles = (__, core) =>\r\n ({\r\n '@global': {\r\n ...datePickerStyle(core),\r\n },\r\n dateSettingContainer: {\r\n '& .advanced-scheduling-grid': {\r\n width: '918px',\r\n },\r\n ...creationCommonStyle(core),\r\n ...advancedSettingsSectionStyle(core),\r\n '& .radio-inline': {\r\n display: 'block',\r\n },\r\n '& .adschedule-targets-container': {\r\n borderTop: 'unset',\r\n paddingTop: '0px',\r\n },\r\n '& .toggle-campaign-settings-switch.form-control-static[data-bind]': {\r\n display: 'inline-block',\r\n textDecoration: 'none',\r\n paddingRight: '8px',\r\n float: 'left',\r\n },\r\n ...toggleButtonStyle(core),\r\n '& .date-settings-intro': {\r\n paddingLeft: 0,\r\n },\r\n '& .date-settings': {\r\n '& .col-sm-12': {\r\n paddingLeft: 0,\r\n },\r\n '& table': {\r\n width: '500px',\r\n '& td': {\r\n width: '100%',\r\n display: 'block',\r\n },\r\n },\r\n },\r\n '& .alert-danger': {\r\n backgroundColor: 'unset',\r\n color: '#A80000',\r\n },\r\n '& table tbody .col-sm-9': {\r\n width: 'unset',\r\n },\r\n '& table tbody .item-label.schedule-item-label.form-control-static': {\r\n fontWeight: '600',\r\n color: '#323130',\r\n paddingTop: '10px',\r\n display: 'block',\r\n },\r\n '& .adschedule-targets-container .advanced-scheduling-grid .ad-scheduling-panel table tr:nth-child(3) td .radio-inline:nth-child(2)': {\r\n top: 'unset',\r\n },\r\n '& .form-control-static': {\r\n margin: '3px 0',\r\n padding: 0,\r\n minHeight: 'fit-content',\r\n color: core.palette.neutralSecondary,\r\n marginBottom: '3px !important',\r\n width: 'unset',\r\n },\r\n '& td>.col-sm-9': {\r\n padding: 0,\r\n },\r\n },\r\n });\r\n\r\n// reference: private/campaign-legacy/packages/campaign-targeting/view/campaign-targeting.js\r\nexport const LegacyDateSetting = React.memo((props) => {\r\n const {\r\n data,\r\n onChange,\r\n activityLogger,\r\n allowNoEndDateSelection,\r\n allowStartDateSelection,\r\n allowEndDateSelection,\r\n } = props;\r\n const view = useRef();\r\n let container;\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n useEffect(() => {\r\n view.current = new DateSettings(extend(\r\n {\r\n callOnChangeCb: onChange,\r\n },\r\n {\r\n startDate: data.StartDate ? globalLegacyI18n.formatDate(data.StartDate, {\r\n raw: 'yyyy-MM-dd',\r\n }) : null,\r\n endDate: data.EndDate ? globalLegacyI18n.formatDate(data.EndDate, {\r\n raw: 'yyyy-MM-dd',\r\n }) : null,\r\n timeZone: data.TimeZone,\r\n isCreate: data.isCreate,\r\n activityLogger,\r\n allowNoEndDateSelection,\r\n allowStartDateSelection,\r\n allowEndDateSelection,\r\n }\r\n ));\r\n\r\n view.current.render();\r\n view.current.$el.appendTo(container);\r\n\r\n return () => {\r\n view.current.remove();\r\n };\r\n // We will refresh the view if data changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [data]);\r\n\r\n useEffect(() => {\r\n if (view.current) {\r\n // Populate default value. If user did not specify StartDate, it will be set to current date.\r\n if (!data.StartDate) {\r\n onChange(view.current.viewModel.getRawValues());\r\n }\r\n }\r\n });\r\n\r\n return (\r\n \r\n
\r\n
{ container = ref; }} />\r\n
\r\n
\r\n );\r\n});\r\n\r\nLegacyDateSetting.propTypes = {\r\n data: PropTypes.shape({\r\n StartDate: PropTypes.string,\r\n EndDate: PropTypes.string,\r\n TimeZone: PropTypes.string,\r\n isCreate: PropTypes.bool,\r\n }).isRequired,\r\n onChange: PropTypes.func.isRequired,\r\n activityLogger: PropTypes.shape({\r\n signal: PropTypes.func,\r\n }),\r\n allowNoEndDateSelection: PropTypes.bool,\r\n allowStartDateSelection: PropTypes.bool,\r\n allowEndDateSelection: PropTypes.bool,\r\n};\r\n\r\nLegacyDateSetting.defaultProps = {\r\n activityLogger: null,\r\n allowNoEndDateSelection: true,\r\n allowStartDateSelection: true,\r\n allowEndDateSelection: true,\r\n};\r\n","import _ from 'underscore';\r\n\r\nconst globalLegacyI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/campaign-creation-advanced');\r\n\r\nexport const getDateSettingDetails = (i18n, startDate, endDate, isUseCampaignLevelDates = false, isDateLevelDisplayed = false) => {\r\n const start = startDate ? i18n.getString(_TL_('Starting from {{startDate}}'), { startDate: i18n.dateFormatter({ skeleton: 'yMd' })(startDate) }) : '';\r\n\r\n const end = endDate ? i18n.getString(_TL_('to {{endDate}}'), { endDate: i18n.dateFormatter({ skeleton: 'yMd' })(endDate) }) : '';\r\n\r\n if (isDateLevelDisplayed) {\r\n const managementLevel = isUseCampaignLevelDates ? _TL_('managed at campaign level') : _TL_('managed at ad group level');\r\n const dateRange = endDate\r\n ? i18n.getString(_TL_('{{startFromDate}} {{endToDate}}'), { startFromDate: start, endToDate: end })\r\n : i18n.getString(_TL_('{{startFromDate}}'), { startFromDate: start });\r\n\r\n return i18n.getString(_TL_('{{dateRange}}, {{managementLevel}}'), { dateRange, managementLevel });\r\n }\r\n\r\n return i18n.getString(_TL_('{{startFromDate}} {{endToDate}}'), { startFromDate: start, endToDate: end });\r\n};\r\n\r\nexport const convertDateBetweenTimeZones = (date, {\r\n from,\r\n to,\r\n} = {}) => {\r\n const dateString = globalLegacyI18n.formatDate(date, {\r\n timeZone: from,\r\n raw: 'yyyy-MM-dd',\r\n });\r\n\r\n return globalLegacyI18n.parseDate(dateString, {\r\n timeZone: to,\r\n raw: 'yyyy-MM-dd',\r\n });\r\n};\r\n\r\nexport const getCurrentDate = () => convertDateBetweenTimeZones(new Date());\r\n\r\nexport const validateDate = ({\r\n StartDate,\r\n EndDate,\r\n hasFixedStartDate = false,\r\n}, i18n) => {\r\n const validationErrors = [];\r\n\r\n const currentDate = getCurrentDate();\r\n\r\n // check wether date is valid\r\n if (_.isNull(StartDate) && !hasFixedStartDate) {\r\n validationErrors.push(i18n.getString(_TL_('Invalid start date')));\r\n } else if (StartDate < currentDate && !hasFixedStartDate) {\r\n validationErrors.push(i18n.getString(_TL_(\"Your start date must be after today. Today's date is calculated using your campaign time zone setting, not your actual local time.\")));\r\n } else if (!_.isNull(EndDate) && StartDate > EndDate) {\r\n validationErrors.push(StartDate > EndDate ? i18n.getString(_TL_('End date must be later than start date')) : '');\r\n }\r\n return validationErrors;\r\n};\r\n\r\nexport const numberOfDaysBetweenDates = (startDate, endDate) => {\r\n const ONE_DAY = 24 * 60 * 60 * 1000;\r\n\r\n const startDateUTC = Date.UTC(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());\r\n const endDateUTC = Date.UTC(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());\r\n\r\n return Math.floor(Math.abs((endDateUTC - startDateUTC) / ONE_DAY));\r\n};\r\n\r\nexport const getLaterDate = (startDate, numberOfDaysLater) =>\r\n convertDateBetweenTimeZones(new Date(new Date().setDate(startDate.getDate() + numberOfDaysLater)));\r\n","import _ from 'underscore';\r\nimport React, { useState, useCallback, useContext, useMemo, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { LegacyDateSetting } from './legacy-date-setting';\r\nimport { getCurrentDate, validateDate as validateDateUtil } from './utils';\r\n\r\nconst LegacyDateSettingWithCustomValidation = ({\r\n validationProps, updateValidation, ...restProps\r\n}) => {\r\n const { data: dataSettings } = validationProps;\r\n const i18n = useContext(I18nContext);\r\n const activity = useContext(ActivityContext);\r\n const currentDate = getCurrentDate();\r\n\r\n const [updatedDateSettings, setUpdatedDateSettings] = useState(dataSettings);\r\n\r\n const validateDate = useCallback(data => validateDateUtil(data, i18n), [i18n]);\r\n\r\n const onChange = useCallback((newData) => {\r\n const validationError = validateDate(newData);\r\n updateValidation(validationError, newData);\r\n\r\n if (activity) {\r\n activity.signal(`onLegacyDateSettingChange - ${JSON.stringify(newData)}`);\r\n }\r\n }, [validateDate, updateValidation, activity]);\r\n\r\n const dateSettingWithDefaultStartDate = useMemo(() => _.defaults(dataSettings, {\r\n StartDate: currentDate,\r\n }), [currentDate, dataSettings]);\r\n\r\n useEffect(() => {\r\n setUpdatedDateSettings(_.clone(dateSettingWithDefaultStartDate));\r\n }, [dateSettingWithDefaultStartDate]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nLegacyDateSettingWithCustomValidation.propTypes = {\r\n validationProps: PropTypes.shape({\r\n data: PropTypes.shape({}),\r\n }).isRequired,\r\n updateValidation: PropTypes.func.isRequired,\r\n activity: PropTypes.shape({\r\n signal: PropTypes.func,\r\n }),\r\n};\r\n\r\nLegacyDateSettingWithCustomValidation.defaultProps = {\r\n activity: null,\r\n};\r\n\r\nexport const ValidatedLegacyDateSetting = withError(withCustomValidation(LegacyDateSettingWithCustomValidation));\r\n","import _ from 'underscore';\r\n\r\nconst serializecsvRow = (imageInfo, aid) => {\r\n let url;\r\n let metadata;\r\n let baseId;\r\n let sourceType;\r\n\r\n if (_.isString(imageInfo)) {\r\n url = imageInfo;\r\n } else {\r\n ({\r\n url, metadata, baseId, sourceType,\r\n } = imageInfo);\r\n }\r\n\r\n // some image urls have commas, which will\r\n // interfere with bulk upsert operation\r\n const encodedUrl = url.replace(/,/g, encodeURIComponent(','));\r\n\r\n return `Image,Active,GenericImage,,,${aid},${encodedUrl},${baseId || ''},${metadata || ''},${sourceType || ''}`;\r\n};\r\n\r\nexport const serializeCSV = (imageInfos, aid) => {\r\n if (_.isEmpty(imageInfos)) {\r\n return [];\r\n }\r\n\r\n const csvHeader = 'Type,Status,Sub Type,Id, Name,Parent Id,Url,Base id,Metadata,Source Type';\r\n const csvFormat = 'Format Version,,,,6,,,,';\r\n const csvRows = _.map(imageInfos, imageInfo => serializecsvRow(imageInfo, aid));\r\n const csv = _.flatten([csvHeader, csvFormat, csvRows]);\r\n\r\n return csv;\r\n};\r\n\r\n\r\nexport const extractIds = (csvData) => {\r\n let errorColIndex = -1;\r\n let imageIdColIndex = -1;\r\n const headers = csvData[0];\r\n\r\n _.each(headers, (col, index) => {\r\n if (col === 'Id') {\r\n imageIdColIndex = index;\r\n }\r\n if (col === 'Error') {\r\n errorColIndex = index;\r\n }\r\n });\r\n\r\n if (imageIdColIndex < 0 && errorColIndex < 0) {\r\n return [];\r\n }\r\n\r\n const ids = [];\r\n // first line is header, second line is format version. needs to be skipped.\r\n const data = csvData.slice(2);\r\n _.each(data, (row) => {\r\n if (errorColIndex !== -1 && row[errorColIndex]) {\r\n ids.push({ code: row[errorColIndex] });\r\n } else if (imageIdColIndex !== -1) {\r\n ids.push(row[imageIdColIndex]);\r\n }\r\n });\r\n\r\n return ids;\r\n};\r\n","import _ from 'underscore';\r\nimport Promise from 'bluebird';\r\nimport { odata } from '@bingads-webui/http-util';\r\nimport { serializeCSV, extractIds } from './bulkify';\r\n\r\nconst MAX_RECOMEND_TIMEOUT = 60 * 1000; // set recommend timeout to 60 seconds\r\n\r\nexport const parseImageFitResponse = (res) => {\r\n const ret = {\r\n expandedImageUrl: res.ImageUrl,\r\n imageExpansionType: res.ImageExpansionType, // None/WhitePadding/SingleColorPadding/Outpainting\r\n\r\n // [{aspectRatio:double, cropSetting: {sourceHeight, sourceWidth, sourceX, sourceY}}]\r\n originalImageCropSettings: _.map(res.OriginalImageCropSetting, crop => ({\r\n AspectRatio: crop.aspectRatio,\r\n CropSetting: {\r\n SourceHeight: crop.cropSetting && crop.cropSetting.sourceHeight,\r\n SourceWidth: crop.cropSetting && crop.cropSetting.sourceWidth,\r\n SourceX: crop.cropSetting && crop.cropSetting.sourceX,\r\n SourceY: crop.cropSetting && crop.cropSetting.sourceY,\r\n },\r\n })),\r\n // [{aspectRatio:double, cropSetting: {sourceHeight, sourceWidth, sourceX, sourceY}}]\r\n expandedImageCropSettings: _.map(res.ImageCropSetting, crop => ({\r\n AspectRatio: crop.aspectRatio,\r\n CropSetting: {\r\n SourceHeight: crop.cropSetting && crop.cropSetting.sourceHeight,\r\n SourceWidth: crop.cropSetting && crop.cropSetting.sourceWidth,\r\n SourceX: crop.cropSetting && crop.cropSetting.sourceX,\r\n SourceY: crop.cropSetting && crop.cropSetting.sourceY,\r\n },\r\n })),\r\n expandedImageWidth: res.ImageDimension && res.ImageDimension.w,\r\n expandedImageHeight: res.ImageDimension && res.ImageDimension.h,\r\n paddingColor: res.PaddingColor,\r\n };\r\n return ret;\r\n};\r\n\r\nexport class ImageOData {\r\n constructor(cid, aid, oDataConfig, timeout) {\r\n this.cid = cid;\r\n this.aid = aid;\r\n this.baseURL = `${oDataConfig.odataPath}/Customers(${this.cid})/Accounts(${this.aid})/`;\r\n this.orderByDefault = 'UploadedTime';\r\n this.orderDefault = 'desc';\r\n this.oDataConfig = {\r\n oDataToken: oDataConfig.odataToken,\r\n oDataTokenType: oDataConfig.oDataTokenType,\r\n applicationName: oDataConfig.applicationName,\r\n beforeSend: oDataConfig.beforeSend,\r\n };\r\n this.maxTimeout = timeout || MAX_RECOMEND_TIMEOUT;\r\n }\r\n\r\n /**\r\n * Gets previously uploaded images (20).\r\n * @param {number} sortById - id for the sort criteria\r\n * @param {string} searchTerm - search term for query\r\n * @return {Promise} Response from the oData call.\r\n */\r\n getExistingImages({\r\n sortQuery,\r\n searchTerm,\r\n pageNumber,\r\n pageSize,\r\n filterTerm = '',\r\n }) {\r\n const top = pageSize;\r\n const skip = pageNumber * pageSize;\r\n\r\n const filterArray = [];\r\n\r\n if (searchTerm && searchTerm.length > 0) {\r\n filterArray.push(`contains(Text, '${searchTerm}')`);\r\n }\r\n\r\n if (filterTerm && filterTerm.length > 0) {\r\n filterArray.push(filterTerm);\r\n }\r\n\r\n const filterQuery = filterArray.length > 0 ? `&$filter=${filterArray.join(' and ')}` : '';\r\n\r\n const url = `${this.baseURL}/Images?mediaenabledentityfilter=ResponsiveAd&${sortQuery}${filterQuery}`;\r\n\r\n const query = {\r\n $top: top,\r\n $skip: skip,\r\n count: true,\r\n };\r\n\r\n return odata.get(url, _.extend({ data: query }, this.oDataConfig));\r\n }\r\n\r\n /**\r\n * Gets previously uploaded images\r\n * @param {string} sortBy - sort by\r\n * @param {string} sortDirection - 'asc'/'desc',\r\n * @param {string} searchTerm - search term for query\r\n * @param {number} minWidth - filter by min-width\r\n * @param {number} minHeight - filter by min-height\r\n * @param {string} dateAddedStart - filter by UploadedTime\r\n * @param {string} dateAddedEnd - filter by UploadedTime\r\n * @param {string} sourceType - 'Unknown', 'UserUploaded', 'GoogleImported',\r\n * @param {number} skip,\r\n * @param {number} count,\r\n * @return {Promise} Response from the oData call.\r\n */\r\n getImages({\r\n sortBy,\r\n sortDirection,\r\n searchTerm,\r\n minWidth,\r\n minHeight,\r\n dateAddedStart,\r\n dateAddedEnd,\r\n sourceType,\r\n skip,\r\n count,\r\n }) {\r\n // compose sort query\r\n let sortQuery = sortBy ? `$orderby=${sortBy}` : '';\r\n if (sortQuery && sortDirection) {\r\n sortQuery += ` ${sortDirection}`;\r\n }\r\n\r\n // $filter\r\n const filters = [];\r\n if (searchTerm) {\r\n // use BroadSearchFields to search both image name and image id\r\n filters.push(`contains(BroadSearchFields, '${searchTerm}')`);\r\n }\r\n if (minWidth) {\r\n filters.push(`Width gt ${minWidth}`);\r\n }\r\n if (minHeight) {\r\n filters.push(`Height gt ${minHeight}`);\r\n }\r\n if (dateAddedStart && dateAddedEnd && dateAddedStart === dateAddedEnd) {\r\n filters.push(`UploadedTime eq ${dateAddedStart}`);\r\n } else {\r\n if (dateAddedStart) {\r\n filters.push(`UploadedTime ge ${dateAddedStart}`);\r\n }\r\n if (dateAddedEnd) {\r\n filters.push(`UploadedTime le ${dateAddedEnd}`);\r\n }\r\n }\r\n if (sourceType) {\r\n filters.push(`SourceType eq '${sourceType}'`);\r\n }\r\n let searchQuery = filters.join(' and ');\r\n if (searchQuery) {\r\n searchQuery = `$filter=${searchQuery}`;\r\n }\r\n\r\n const params = sortQuery && searchQuery ? `${sortQuery}&${searchQuery}` : (sortQuery || searchQuery);\r\n const url = `${this.baseURL}Images?mediaenabledentityfilter=ResponsiveAd&${params}`;\r\n\r\n const query = {\r\n $top: count,\r\n $skip: skip,\r\n count: true,\r\n };\r\n\r\n return odata.get(url, _.extend({ data: query }, this.oDataConfig));\r\n }\r\n\r\n /**\r\n * Gets image specified by the id.\r\n * @param {number} imageId Id of the image to be requested.\r\n * @param {boolean} isImageFittingEnabled - if the image fitting is enabled or not\r\n * @param {string} adType - for different adType, MT returns image fittings with different assets ratios\r\n * @return {Promise} Response from the oData call.\r\n */\r\n getImageByIdAsync(imageId, isImageFittingEnabled, adType = 'Audience') {\r\n let url = `${this.baseURL}Images(${imageId})`;\r\n if (isImageFittingEnabled) {\r\n url = `${url}?AdType=${adType}`;\r\n }\r\n\r\n return odata.get(url, this.oDataConfig);\r\n }\r\n\r\n uploadImageAsync(imageData, activityLogger = null, inProgress = null, isLogo = false, name = '') { // eslint-disable-line max-len\r\n if (activityLogger) {\r\n // Log upload image data\r\n const dataToLog = JSON.stringify(imageData).substr(0, 100);\r\n\r\n activityLogger.trace(JSON.stringify(dataToLog));\r\n }\r\n\r\n let processedImageData = imageData;\r\n\r\n const base64 = 'base64,';\r\n const base64Index = imageData.indexOf(base64);\r\n\r\n processedImageData = base64Index > -1\r\n ? imageData.substr(base64Index + base64.length)\r\n : imageData;\r\n\r\n const url = `${this.baseURL}Images`;\r\n\r\n const requestBody = {\r\n Data: processedImageData,\r\n Type: isLogo ? 'Logo' : 'GenericImage',\r\n };\r\n\r\n if (name) {\r\n requestBody.Text = name;\r\n }\r\n\r\n return odata.post(url, _.extend({ data: requestBody, progress: inProgress }, this.oDataConfig))\r\n .then(\r\n image => ({ imageId: image.value, errors: [] }),\r\n error => this.processUploadSingleImageRejection(error, activityLogger)\r\n );\r\n }\r\n\r\n updateImageAsync(imageData) {\r\n const url = `${this.baseURL}Images(${imageData.Id})`;\r\n\r\n const requestBody = {\r\n Text: imageData.Text,\r\n Type: imageData.Type,\r\n Url: imageData.Url,\r\n Data: imageData.Data,\r\n };\r\n\r\n return odata.patch(url, _.extend({ data: requestBody }, this.oDataConfig));\r\n }\r\n\r\n deleteImageAsync(imageData) {\r\n const url = `${this.baseURL}Images(${imageData.IdString})`;\r\n\r\n return odata.delete(url, this.oDataConfig);\r\n }\r\n\r\n /**\r\n * Cleans the error response object and sets error messages into an array.\r\n * @param {object} error Object with errors returned by the oData call.\r\n * @param {Object} activityLogger - logger object for activity\r\n *\r\n * @return {array} Array of error messages.\r\n */\r\n processUploadSingleImageRejection(error, activityLogger) {\r\n // const errMsg = this.i18nErrors.getODataErrors(error.body.value);\r\n // _.each(errMsg, (err) => {\r\n // errors.push(err.message);\r\n // });\r\n\r\n if (activityLogger) {\r\n activityLogger.error(JSON.stringify(error));\r\n }\r\n\r\n return error && error.body && error.body.value;\r\n }\r\n\r\n /**\r\n * Save image asset by url and meta data,\r\n * @param {array} imageInfos Array of image info including url and metaData\r\n *\r\n * @return {Promise} Array of image ids. Different metaData will generate different image id.\r\n */\r\n bulkSaveImagesByUrl = (imageInfos) => {\r\n const url = `${this.baseURL}/Default.BulkUpsert`;\r\n const csvRows = serializeCSV(imageInfos, this.aid);\r\n\r\n if (_.isEmpty(csvRows)) {\r\n return Promise.resolve([]);\r\n }\r\n\r\n return odata.post(url, _.defaults({\r\n data: { CsvRows: csvRows },\r\n }, this.oDataConfig)).timeout(this.maxTimeout)\r\n .then((res) => {\r\n if (_.isEmpty(res)) {\r\n return [];\r\n }\r\n\r\n return extractIds(res);\r\n });\r\n };\r\n\r\n addAsset = ({\r\n url,\r\n sourceType,\r\n }) => {\r\n const requestUrl = `${this.baseURL}Folders/Default.AddAsset`;\r\n const requestBody = {\r\n FolderId: null,\r\n Asset: {\r\n '@odata.type': '#Model.Image',\r\n Url: url,\r\n Type: 'GenericImage',\r\n SourceType: sourceType,\r\n },\r\n };\r\n\r\n return odata.post(requestUrl, _.extend({ data: requestBody }, this.oDataConfig))\r\n .then(res => res.value);\r\n };\r\n\r\n imageFit = ({\r\n imageUrl,\r\n placements, // [{ aspectRatio: doulbe, minHeight: int }]\r\n skipOutpainting = false,\r\n }) => {\r\n const url = `${this.baseURL}Images/Default.FitImageWithCustomCrop?enableOutpainting=${!skipOutpainting}`;\r\n const requestBody = {\r\n ImageUrl: imageUrl,\r\n Placements: placements,\r\n };\r\n\r\n const ret = odata.post(url, _.extend({ data: requestBody }, this.oDataConfig)).then((res) => {\r\n // map the property names of response data\r\n const value = parseImageFitResponse(res);\r\n return value;\r\n });\r\n return ret;\r\n };\r\n}\r\n","import ko from 'knockout';\r\n\r\n// Knockout: Control descendant bindings.\r\nko.bindingHandlers.stopBinding = {\r\n init: () => ({\r\n controlsDescendantBindings: true,\r\n }),\r\n};\r\n\r\nko.virtualElements.allowedBindings.stopBinding = true;\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\n\r\nfunction translateLanguageName(i18n, language) {\r\n return i18n.getString(`Language_${language}`);\r\n}\r\n\r\nexport default class ViewModel {\r\n constructor({\r\n selectedLanguages,\r\n suggestedLanguages,\r\n i18n,\r\n allLanguageExclusive,\r\n inEditMode,\r\n languages,\r\n }) {\r\n this.ALL_LANGUAGES = 'All';\r\n this.i18n = i18n;\r\n\r\n // make 'All' the first language\r\n let languagesSet = languages || [];\r\n\r\n if (_.contains(languagesSet, this.ALL_LANGUAGES)) {\r\n languagesSet = _.without(languagesSet, this.ALL_LANGUAGES);\r\n languagesSet.unshift(this.ALL_LANGUAGES);\r\n }\r\n\r\n this.allLanguageExclusive = ko.observable(allLanguageExclusive);\r\n\r\n this.inEditMode = ko.observable(inEditMode);\r\n\r\n this.languageOptions = _.map(languagesSet, language => (\r\n {\r\n Text: translateLanguageName(i18n, language),\r\n Value: language,\r\n }\r\n ));\r\n\r\n this.selectedLanguages = ko.observableArray(_.intersection(languagesSet, selectedLanguages));\r\n\r\n this.selectedLanguagesName = ko.computed(() =>\r\n _.map(this.selectedLanguages() || [], x => translateLanguageName(this.i18n, x)));\r\n\r\n this.suggestedLanguages = ko.observableArray(suggestedLanguages);\r\n\r\n this.suggestedLanguagesName = ko.computed(() =>\r\n _.map(this.suggestedLanguages(), x => translateLanguageName(this.i18n, x)));\r\n\r\n this.allLanguageSelected = ko.computed(() =>\r\n _.contains(this.selectedLanguages(), this.ALL_LANGUAGES));\r\n\r\n this.targetSuggestedLanguages = () => {\r\n this.inEditMode(true);\r\n this.selectedLanguages(this.suggestedLanguages() || []);\r\n this.suggestedLanguages([]);\r\n return true;\r\n };\r\n\r\n this.updateSuggestedLanguages = (newSuggestedLanguages) => {\r\n this.suggestedLanguages(_.intersection(newSuggestedLanguages, languagesSet));\r\n };\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport ko from 'knockout';\r\nimport template from './template.pug';\r\nimport ViewModel from './viewmodel';\r\n\r\n/**\r\n* Provide languages display & edit functions\r\n*\r\n*
It enabled functions:\r\n* update the selector from display mode to edit modevs,\r\n* select from the provided languges,\r\n* update suggested languages,\r\n* adopt the suggested languages\r\n*\r\n*
Triggered event selectedLanguages:changed when user selection changes\r\n*/\r\nexport class MultiLanguageSelector extends Backbone.View {\r\n /**\r\n * Initilize view settings\r\n *\r\n * @param {Object} param - An object containing these default options for view:\r\n * @param {Object} param.i18nStrings - view customized description settings\r\n * @param {string} param.i18nStrings.Description - the customized string for view description\r\n * @param {string} param.i18nStrings.SuggestedLanguagesDescription -\r\n * the customized string for suggested languages description\r\n * @param {Object[]} param.languages - the languages set to choose from, default empty\r\n * @param {Object[]} param.suggestedLanguages - languages sugguested to choose, default empty\r\n * @param {boolean} param.inEditMode - whether the selector is in edit mode, default true\r\n * @param {boolean} param.allLanguageExclusive - whether 'all' language is exclusive\r\n * when true, select 'all' will disable all other selections\r\n * default true\r\n * @param {boolean} param.inSingleColumnVersion - whether to one language per row\r\n * (by default will be three)\r\n * @param {Object} param.i18n - the localization settings, by default return the provided key\r\n *\r\n * @returns {void} void\r\n */\r\n initialize({\r\n i18nStrings,\r\n languages,\r\n suggestedLanguages = [],\r\n selectedLanguages = [],\r\n inEditMode = true,\r\n allLanguageExclusive = true,\r\n inSingleColumnVersion = false,\r\n i18n = { getString: key => key },\r\n activityLogger,\r\n scenario,\r\n }) {\r\n this.options = _.defaults({\r\n i18nStrings,\r\n languages,\r\n suggestedLanguages,\r\n selectedLanguages,\r\n inEditMode,\r\n allLanguageExclusive,\r\n i18n,\r\n activityLogger,\r\n scenario,\r\n }, {\r\n i18nStrings: {\r\n Description: i18n.getString('MultiLanguageSelector_Description'),\r\n SuggestedLanguagesDescription: i18n.getString('MultiLanguageSelector_SuggestedLanguageDescription'),\r\n },\r\n });\r\n\r\n this.inSingleColumnVersion = inSingleColumnVersion;\r\n this.koModel = new ViewModel(this.options);\r\n this.koModel.selectedLanguages.subscribe((selectedLangauges) => {\r\n if (this.koModel.allLanguageExclusive() &&\r\n this.koModel.allLanguageSelected() &&\r\n selectedLangauges.length > 1) {\r\n this.koModel.selectedLanguages([this.koModel.ALL_LANGUAGES]);\r\n } else {\r\n this.trigger('selectedLanguages:changed', this.getSelectedLanguages());\r\n }\r\n }, this);\r\n\r\n this.logInteraction = _.once(() => {\r\n if (this.options.activityLogger) {\r\n this.options.activityLogger.signal(\r\n 'multi language selector language change',\r\n this.options.scenario\r\n );\r\n }\r\n });\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click label.checkbox-inline': 'logInteraction',\r\n };\r\n }\r\n\r\n render() {\r\n this.$el.empty().append(template(_.extend(\r\n {\r\n i18n: this.options.i18n,\r\n SelectedLanguages: this.koModel.selectedLanguagesName().join(','),\r\n languageOptions: this.koModel.languageOptions,\r\n inSingleColumnVersion: this.inSingleColumnVersion,\r\n },\r\n this.options.i18nStrings\r\n )));\r\n ko.applyBindings(this.koModel, this.el);\r\n return this;\r\n }\r\n\r\n /**\r\n * Get suggested languages\r\n *\r\n * @returns {Object[]} selected languages\r\n */\r\n getSelectedLanguages() {\r\n return this.koModel.selectedLanguages();\r\n }\r\n\r\n /**\r\n * Get suggested languages names\r\n *\r\n * @returns {Object[]} selected language names\r\n */\r\n getSelectedLanguageNames() {\r\n return this.koModel.selectedLanguagesName();\r\n }\r\n\r\n /**\r\n * Update suggested languages\r\n *\r\n * @param {Object[]} languages - new suggested languages\r\n *\r\n * @returns {void} void\r\n */\r\n updateSuggestedLanguages(languages) {\r\n this.koModel.updateSuggestedLanguages(languages);\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\n\r\nconst observeInDOM = (el, onAttached, onDetached) => {\r\n const onAttachedToDOM = _.isFunction(onAttached) ? onAttached : _.noop;\r\n const onDetachedFromDOM = _.isFunction(onDetached) ? onDetached : _.noop;\r\n\r\n const getEl = () => {\r\n const $el = _.isString(el) ? $(el) : el;\r\n return $el.get(0);\r\n };\r\n\r\n let wasInDOM = $.contains(document.body, getEl());\r\n\r\n const observer = new MutationObserver(() => {\r\n const inDOM = $.contains(document.body, getEl());\r\n\r\n if (inDOM) {\r\n if (!wasInDOM) {\r\n wasInDOM = true;\r\n onAttachedToDOM();\r\n }\r\n } else if (wasInDOM) {\r\n wasInDOM = false;\r\n observer.disconnect();\r\n\r\n onDetachedFromDOM();\r\n }\r\n });\r\n\r\n observer.observe(document.body, { childList: true, subtree: true });\r\n};\r\n\r\nexport { observeInDOM };\r\n","import _ from 'underscore';\r\nimport { FilterStorageFactory } from '@bingads-webui-campaign/filter-storage';\r\nimport {\r\n saveGeneralInsightsPreferences,\r\n FEATURE_NAME_GENERAL_INSIGHTS,\r\n FEATURE_NAME_GENERAL_INSIGHTS_SHOPPING,\r\n CAMPAIGN_TYPES,\r\n} from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\n\r\nfunction getRouteforScope(scope, prefix = '') {\r\n let suffix;\r\n\r\n if (scope.adGroupId) {\r\n suffix = 'adgroup_competition';\r\n } else if (scope.campaignId) {\r\n suffix = 'campaign_competition';\r\n } else {\r\n suffix = 'competition';\r\n }\r\n\r\n return prefix + suffix;\r\n}\r\n\r\nfunction getRoute(scope, isForVNext, pageName) {\r\n let route;\r\n\r\n if (isForVNext) {\r\n if (pageName === 'campaigns') {\r\n route = getRouteforScope(scope, 'campaigns_');\r\n } else if (pageName === 'adgroups') {\r\n route = getRouteforScope(scope, 'adgroups_');\r\n } else if (pageName === 'keywords') {\r\n route = getRouteforScope(scope, 'keywords_');\r\n } else {\r\n // Unknown page, go to competition page\r\n route = getRouteforScope(scope);\r\n }\r\n } else {\r\n route = getRouteforScope(scope);\r\n }\r\n\r\n return route;\r\n}\r\n\r\nfunction getEntityType(item) {\r\n if (item.AdGroup) {\r\n return 'Keyword';\r\n }\r\n if (item.Campaign) {\r\n return 'AdGroup';\r\n }\r\n return 'Campaign';\r\n}\r\n\r\nconst AUCTION_INSIGHT_ENTITY_NAME = 'AuctionInsight';\r\n\r\nfunction getEditableFilter(preferenceService, featureName) {\r\n const factory = new FilterStorageFactory({\r\n preferenceService,\r\n featureName,\r\n });\r\n\r\n return factory.create('editableFilter', {\r\n filterEntityOptions: {\r\n entitySchema: { name: AUCTION_INSIGHT_ENTITY_NAME },\r\n },\r\n });\r\n}\r\n\r\nfunction getAuctionInsightEditableFilter(preferenceService, enableBSCAuctionInsights) {\r\n const storageArr = [getEditableFilter(preferenceService, FEATURE_NAME_GENERAL_INSIGHTS)];\r\n\r\n if (enableBSCAuctionInsights) {\r\n storageArr.push(getEditableFilter(preferenceService, FEATURE_NAME_GENERAL_INSIGHTS_SHOPPING));\r\n }\r\n return storageArr;\r\n}\r\n\r\n/**\r\n * Writes the editable filter for the Auction Insights grid, overwriting any existing filter.\r\n * This allows the grid to be filtered to only the selected grid rows.\r\n * @param {Object} preferenceService - Session store used by filter storage.\r\n * @param {Object} query - Query to be used when the auction insights grid fetches data.\r\n * @param {bool} enableBSCAuctionInsights - if campaign type dropdown is enabled in auction insights\r\n * @returns {void}\r\n */\r\nfunction writeAuctionInsightEditableFilter(preferenceService, query, enableBSCAuctionInsights) {\r\n const storageArr = getAuctionInsightEditableFilter(preferenceService, enableBSCAuctionInsights);\r\n\r\n const filter = {\r\n query,\r\n name: '',\r\n id: null,\r\n };\r\n\r\n _.each(storageArr, (storage) => {\r\n storage.save(filter);\r\n });\r\n}\r\n\r\n/**\r\n * Deletes any existing editable filter for the Auction Insights grid.\r\n * @param {Object} preferenceService - Session store used by filter storage.\r\n * @param {bool} enableBSCAuctionInsights - if campaign type dropdown is enabled in auction insights\r\n * @returns {void}\r\n */\r\nfunction cleanAuctionInsightEditableFilter(preferenceService, enableBSCAuctionInsights) {\r\n const storageArr = getAuctionInsightEditableFilter(preferenceService, enableBSCAuctionInsights);\r\n\r\n _.each(storageArr, (storage) => {\r\n storage.clean();\r\n });\r\n}\r\n\r\n/**\r\n * Navigates to the Auction Insights section of the Competition Tab.\r\n * @param {Object} pluginConfig - Plugin config.\r\n * @param {Object[]} [selectedItems=null] - List of grid rows that are currently selected.\r\n * @returns {void}\r\n */\r\nexport function navigateToCompetitionTab(pluginConfig, selectedItems = null) {\r\n const {\r\n scope, legacyRouter, preferenceService, permissions, isForVNext, pageName,\r\n } = pluginConfig;\r\n const enableBSCAuctionInsights = permissions.IsBAACompetitionBSCAuctionInsightsEnabled;\r\n\r\n if (_.isArray(selectedItems) && selectedItems.length > 0) {\r\n const entityType = getEntityType(selectedItems[0]);\r\n\r\n // $contains is an array of strings that specifies the id\r\n const $contains = _.map(selectedItems, (item) => {\r\n // convert each item into a basic object for filter\r\n const filterObject = _.pick(item, 'Id', 'Name');\r\n\r\n // special logic to handle new keyword\r\n if (_.isUndefined(filterObject.Name)) {\r\n filterObject.Name = item.Text;\r\n } else {\r\n if (item.Campaign) {\r\n filterObject.CampaignName = item.Campaign.Name;\r\n filterObject.CampaignId = item.Campaign.Id;\r\n }\r\n if (item.AdGroup) {\r\n filterObject.AdGroupName = item.AdGroup.Name;\r\n filterObject.AdGroupId = item.AdGroup.Id;\r\n }\r\n }\r\n\r\n // filter $contains expects a string\r\n return JSON.stringify(filterObject);\r\n });\r\n\r\n const query = {\r\n [entityType]: { $contains },\r\n };\r\n\r\n // write stringified version to session storage\r\n writeAuctionInsightEditableFilter(preferenceService, query, enableBSCAuctionInsights);\r\n\r\n if (enableBSCAuctionInsights) {\r\n if (_.find(selectedItems, (item) => {\r\n if (item.Campaign) {\r\n return item.Campaign.CampaignType !== CAMPAIGN_TYPES.Shopping;\r\n }\r\n return item.CampaignType !== CAMPAIGN_TYPES.Shopping;\r\n })) {\r\n saveGeneralInsightsPreferences(preferenceService, { selectShoppingCampaignType: false });\r\n } else {\r\n saveGeneralInsightsPreferences(preferenceService, { selectShoppingCampaignType: true });\r\n }\r\n }\r\n } else {\r\n // remove any existing filter so that all entities are displayed in auction insights grid\r\n cleanAuctionInsightEditableFilter(preferenceService, enableBSCAuctionInsights);\r\n }\r\n\r\n const route = getRoute(scope, isForVNext, pageName);\r\n\r\n if (isForVNext) {\r\n legacyRouter.navigateToRoute(route, {\r\n campaign_id: scope.campaignId,\r\n adgroup_id: scope.adGroupId,\r\n });\r\n } else {\r\n legacyRouter.navigateToRoute(route);\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nconst selectedIdKey = 'auction-insight-ids';\r\n\r\nexport function navigateToLegacyAuctionInsights(pluginConfig, selectedItems = null) {\r\n const { state, legacyRouter, route } = pluginConfig;\r\n\r\n if (_.isArray(selectedItems)) {\r\n const selectedIds = _.pluck(selectedItems, 'Id');\r\n state.set(selectedIdKey, selectedIds);\r\n }\r\n\r\n legacyRouter.navigateToRoute(route);\r\n}\r\n","import { navigateToCompetitionTab } from './navigate-to-competition-tab';\r\nimport { navigateToLegacyAuctionInsights } from './navigate-to-legacy-auction-insights';\r\n\r\nfunction getNavigate(pluginConfig) {\r\n const {\r\n shouldNavigateToCompetitionTab,\r\n } = pluginConfig;\r\n\r\n const navigate = shouldNavigateToCompetitionTab ?\r\n navigateToCompetitionTab : navigateToLegacyAuctionInsights;\r\n\r\n return navigate;\r\n}\r\n\r\nexport function onClickSelected(pluginConfig, gridView, crossPageSelectAll) {\r\n const { crossPageSelectNotAllowedI18nKey, i18n } = pluginConfig;\r\n const selectedItems = gridView.selectedItems();\r\n\r\n // must have at least 1 selected item\r\n if (selectedItems.length < 1) {\r\n alert(i18n.getString('Grid_RowSelectionRequired')); // eslint-disable-line no-alert\r\n return;\r\n }\r\n\r\n // cross-page select not supported\r\n // prompt user if they want to continue with just visible selected items\r\n if (crossPageSelectAll.isAllSelected) {\r\n // eslint-disable-next-line no-alert,no-restricted-globals\r\n if (!confirm(i18n.getString(crossPageSelectNotAllowedI18nKey))) {\r\n return;\r\n }\r\n }\r\n\r\n const navigate = getNavigate(pluginConfig);\r\n\r\n navigate(pluginConfig, selectedItems);\r\n}\r\n\r\n/**\r\n * Gets the menu items for Auction Insight.\r\n * @param {Object} pluginConfig - Configuration object.\r\n * @param {Object} gridView - Projection grid view.\r\n * @param {Object} crossPageSelectAll - Cross-page select all grid plugin.\r\n * @returns {Object[]} Array of dropdown menu items: header and two buttons with click handlers.\r\n */\r\nexport function getDropdownMenuItems(pluginConfig, gridView, crossPageSelectAll) {\r\n const {\r\n i18n,\r\n state,\r\n legacyRouter,\r\n scope,\r\n shouldNavigateToCompetitionTab,\r\n preferenceService,\r\n permissions,\r\n } = pluginConfig;\r\n\r\n // validate pluginConfig\r\n let isPluginConfigValid = true;\r\n if (shouldNavigateToCompetitionTab) {\r\n isPluginConfigValid =\r\n i18n && legacyRouter && scope && preferenceService && permissions;\r\n } else {\r\n isPluginConfigValid = i18n && legacyRouter && state;\r\n }\r\n\r\n if (!isPluginConfigValid) {\r\n throw new Error('auction insight plugin config does not meet the requirement');\r\n }\r\n\r\n const navigate = getNavigate(pluginConfig);\r\n\r\n return [{\r\n type: 'dropdown-header',\r\n text: i18n.getString('Grid_AuctionInsightsButtonText'),\r\n }, {\r\n text: i18n.getString('Grid_AuctionInsightsSelectedButtonText'),\r\n onClick: () => onClickSelected(pluginConfig, gridView, crossPageSelectAll),\r\n classes: ['auction-insight-selected'],\r\n }, {\r\n text: i18n.getString('Grid_AuctionInsightsAllButtonText'),\r\n onClick: () => navigate(pluginConfig),\r\n classes: ['auction-insight-all'],\r\n }];\r\n}\r\n","import { size } from 'underscore';\r\nimport { CampaignType } from '@bingads-webui-campaign/campaign-ui-common';\r\nimport { getDropdownMenuItems, onClickSelected } from './get-dropdown-menu-items';\r\n\r\nexport const auctionInsightPlugin = definePlugin => definePlugin('auctionInsight', [\r\n 'config',\r\n 'gridView',\r\n 'toolbar',\r\n 'crossPageSelectAll',\r\n], (config, gridView, toolbar, crossPageSelectAll) => {\r\n const pluginConfig = config.plugins.auctionInsight;\r\n const menuId = pluginConfig.isForVNext ? 'button-auction-insights' : 'dropdown-details';\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n const items = getDropdownMenuItems(pluginConfig, gridView, crossPageSelectAll);\r\n\r\n gridView.on('didSelect', () => {\r\n if (pluginConfig.isForVNext) {\r\n if (size(gridView.selectedItems()) === 0) return;\r\n\r\n const campaignType = pluginConfig.getCampaignTypeGlobalFilter();\r\n if (campaignType === CampaignType.Default ||\r\n campaignType === CampaignType.Shopping ||\r\n campaignType === CampaignType.All\r\n ) {\r\n toolbarEditor.update({\r\n id: menuId,\r\n type: 'button',\r\n iconLeftGlyphName: 'ba-Articles',\r\n text: pluginConfig.i18n.getString('Grid_AuctionInsightsButtonText'),\r\n classes: ['btn-link'],\r\n onClick: () => onClickSelected(pluginConfig, gridView, crossPageSelectAll),\r\n });\r\n } else {\r\n toolbarEditor.update({\r\n id: menuId,\r\n classes: ['hide'],\r\n });\r\n }\r\n } else {\r\n toolbarEditor.update({\r\n type: 'dropdown',\r\n id: menuId,\r\n button: {\r\n text: pluginConfig.i18n.getString('Grid_DetailsButtonText'),\r\n classes: ['btn', 'btn-secondary'],\r\n },\r\n menu: {\r\n items,\r\n },\r\n });\r\n }\r\n });\r\n});\r\n","import _ from 'underscore';\r\n\r\nconst iconRight = ['glyphicon', 'toolbar-icon', 'grid-expand-icon', 'pull-right'];\r\n\r\nexport const supportedEntities = {\r\n Campaign: 'Campaign',\r\n AdGroup: 'AdGroup',\r\n Keyword: 'Keyword',\r\n Ad: 'Ad',\r\n};\r\n\r\nfunction getMetadata(i18n) {\r\n const metadata = {\r\n Campaign: {\r\n header: i18n.getString('AutomatedRules_RuleTemplatesButton_Campaign_Header'),\r\n body: [\r\n {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Campaign_ChangeBudget'),\r\n value: 'CampaignsGrid_automateRule_Campaign_ChangeBudget',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Campaign_PauseCampaign'),\r\n value: 'CampaignsGrid_automateRule_Campaign_Pause',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Campaign_EnableCampaign'),\r\n value: 'CampaignsGrid_automateRule_Campaign_Enable',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Campaign_SendEmail'),\r\n value: 'CampaignsGrid_automateRule_Campaign_SendEmail',\r\n },\r\n ],\r\n switchMenuOrder: [supportedEntities.AdGroup, supportedEntities.Keyword, supportedEntities.Ad],\r\n },\r\n AdGroup: {\r\n header: i18n.getString('AutomatedRules_RuleTemplatesButton_AdGroup_Header'),\r\n body: [\r\n {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_AdGroup_ChangeBid'),\r\n value: 'AdGroupGrid_automateRule_AdGroup_ChangeBid',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_AdGroup_PauseAdGroup'),\r\n value: 'AdGroupGrid_automateRule_AdGroup_Pause',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_AdGroup_EnableAdGroup'),\r\n value: 'AdGroupGrid_automateRule_AdGroup_Enable',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_AdGroup_SendEmail'),\r\n value: 'AdGroupGrid_automateRule_AdGroup_SendEmail',\r\n },\r\n ],\r\n switchMenuOrder: [supportedEntities.Keyword,\r\n supportedEntities.Ad, supportedEntities.Campaign],\r\n },\r\n Ad: {\r\n header: i18n.getString('AutomatedRules_RuleTemplatesButton_Ad_Header'),\r\n body: [\r\n {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Ad_PauseAd'),\r\n value: 'AdGrid_automateRule_Ad_Pause',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Ad_EnableAds'),\r\n value: 'AdGrid_automateRule_Ad_Enable',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Ad_SendEmail'),\r\n value: 'AdGrid_automateRule_Ad_SendEmail',\r\n },\r\n ],\r\n switchMenuOrder: [supportedEntities.Keyword,\r\n supportedEntities.AdGroup, supportedEntities.Campaign],\r\n },\r\n Keyword: {\r\n header: i18n.getString('AutomatedRules_RuleTemplatesButton_Keyword_Header'),\r\n body: [\r\n {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Keyword_ChangeBid'),\r\n value: 'KeywordGrid_automateRule_Keyword_ChangeBid',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Keyword_RaiseToTopOfPage'),\r\n value: 'KeywordGrid_automateRule_Keyword_RaiseToTopOfPage',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Keyword_RaiseToFirstPage'),\r\n value: 'KeywordGrid_automateRule_Keyword_RaiseToFirstPage',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Keyword_PauseKeyword'),\r\n value: 'KeywordGrid_automateRule_Keyword_Pause',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Keyword_EnableKeyword'),\r\n value: 'KeywordGrid_automateRule_Keyword_Enable',\r\n }, {\r\n key: i18n.getString('AutomatedRules_RuleTemplatesTitle_Keyword_SendEmail'),\r\n value: 'KeywordGrid_automateRule_Keyword_SendEmail',\r\n },\r\n ],\r\n switchMenuOrder: [supportedEntities.Ad,\r\n supportedEntities.AdGroup, supportedEntities.Campaign],\r\n },\r\n };\r\n\r\n return metadata;\r\n}\r\n\r\nconst divider = {\r\n type: 'dropdown-divider',\r\n};\r\n\r\nfunction getMenuItemConfig(text, onClick, isFallbackEnabled = false, siteMapId = null) {\r\n return {\r\n text, onClick, isFallbackEnabled, siteMapId,\r\n };\r\n}\r\n\r\nexport function getRulesMenu(\r\n entity,\r\n render, switchTo, selectInfo, i18n, isForVNext, shouldBeDisabled = false,\r\n isFallbackEnabled = false\r\n) {\r\n const metadata = getMetadata(i18n);\r\n const items = [];\r\n const ret = {\r\n type: 'dropdown',\r\n id: 'dropdown-automate',\r\n iconLeftGlyphName: 'ba-LightningBolt',\r\n classes: ['nowrap'],\r\n button: {\r\n text: i18n.getString('AutomatedRules_RuleTemplatesButton_AutomateRule'),\r\n classes: ['btn', 'btn-secondary'],\r\n disabled: shouldBeDisabled,\r\n },\r\n menu: {\r\n items,\r\n },\r\n };\r\n\r\n items.push({\r\n type: 'dropdown-header',\r\n text: metadata[entity].header,\r\n });\r\n _.each(metadata[entity].body, ({ key, value }) => {\r\n items.push(getMenuItemConfig(key, render(value)));\r\n });\r\n items.push(divider);\r\n\r\n if (!isForVNext) {\r\n let subMenu = metadata[entity].switchMenuOrder;\r\n\r\n if (!_.isNull(selectInfo.campaignId)) {\r\n subMenu = _.without(subMenu, supportedEntities.Campaign);\r\n }\r\n if (!_.isNull(selectInfo.adGroupId)) {\r\n subMenu = _.without(subMenu, supportedEntities.AdGroup);\r\n }\r\n _.each(subMenu, (en) => {\r\n const subItems = _.map(\r\n metadata[en].body,\r\n ({ key, value }) => getMenuItemConfig(key, switchTo(value))\r\n );\r\n\r\n items.push({\r\n type: 'dropdown-submenu',\r\n button: {\r\n text: metadata[en].header,\r\n iconRight,\r\n },\r\n menu: {\r\n items: subItems,\r\n },\r\n });\r\n });\r\n\r\n items.push(divider);\r\n }\r\n\r\n items.push(getMenuItemConfig(\r\n i18n.getString('AutomatedRules_RuleTemplatesButton_RedirectToREManagement'),\r\n render('AdGroupGrid_automateRule_RedirectToREManagement'),\r\n isFallbackEnabled,\r\n 'rules'\r\n ));\r\n\r\n return ret;\r\n}\r\n","/**\r\n * @file Automated rules plugin for projection grids.\r\n *\r\n */\r\n\r\nimport _ from 'underscore';\r\nimport { RuleAuthoringView, RuleAuthoringModel } from '@bingads-webui-campaign/automated-rules';\r\nimport { supportedEntities, getRulesMenu } from './automated-rules-menu';\r\n\r\n/**\r\n * Projection grid automated rules plugin,\r\n * User need to set these things in config\r\n * filterService: the filterService which can get current filter using getEditableFilter\r\n * automatedRules: {\r\n * entityName: currently only support Campaign/AdGroup/Keyword/Ad\r\n * i18n { getString }, localization setting\r\n * i18nGlobal { getString }, localization setting\r\n * router: { navigateToRoute }, specify the routing function\r\n * scope: { campaignId, adgroupId } scope of the plugin\r\n * instrumentation - instrumentation that already intilized\r\n * and which should contains the senario of label and activity of createLabel\r\n * state: { set, get, unset } module to store/fetch/update status for selected template\r\n * stateMgr - the state manager which contains {getItem, setItem}\r\n * preferenceSvc - preference service to store user preferences.\r\n * appCfg - global app config\r\n * bidRange - { FloorValue, CeilingValue} for bid inputs, needed for adgroup/keyword entity\r\n * budgetRange - { FloorValue, CeilingValue} for budget inputs, needed for campaign entity\r\n * permissions - permissions for the user\r\n * accountTimeZone - accountTimeZone\r\n * accountCurrencyCode - accountCurrencyCode\r\n * currentUserId - currentUserId\r\n * @param { object } definePlugin: function pointer used to define plugin for grid\r\n * @returns {void}\r\n */\r\nexport const automatedRulesPlugin = definePlugin => definePlugin('automatedRules', [\r\n 'config',\r\n 'gridView',\r\n 'toolbar',\r\n 'pagination',\r\n 'crossPageSelectAll',\r\n], (config, gridView, toolbar, pagination, crossPageSelectAll) => {\r\n const menuId = 'dropdown-automate';\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n\r\n let automatedRulesView;\r\n\r\n const actionStateKey = 'automated-rules-action-to-render';\r\n const {\r\n entityName,\r\n i18n,\r\n i18nGlobal,\r\n router,\r\n scope,\r\n state,\r\n instrumentation,\r\n stateMgr,\r\n preferenceSvc,\r\n appCfg,\r\n bidRange,\r\n budgetRange,\r\n alertCenter,\r\n accountCurrencyCode,\r\n accountTimeZone,\r\n permissions,\r\n currentUserId,\r\n odata,\r\n directive,\r\n walkMe,\r\n walkMeLink,\r\n walkThrus,\r\n isForVNext = false,\r\n newI18n,\r\n CampaignAdgroupSelectorEdmView,\r\n PredicateListReact,\r\n currentEntity,\r\n } = _.result(config.plugins, 'automatedRules', {});\r\n const { filterService } = config;\r\n\r\n function getSelectionInfo() {\r\n const info = {\r\n allPages: false,\r\n selectedRowCount: 0,\r\n selectedRowIds: null,\r\n campaignId: null,\r\n adGroupId: null,\r\n };\r\n\r\n const { campaignId, adGroupId } = scope;\r\n\r\n if (!_.isEmpty(campaignId)) {\r\n info.campaignId = parseInt(campaignId, 10);\r\n }\r\n if (!_.isEmpty(adGroupId)) {\r\n info.adGroupId = parseInt(adGroupId, 10);\r\n }\r\n\r\n if (crossPageSelectAll.isAllSelected) {\r\n _.extendOwn(info, {\r\n allPages: true,\r\n selectedRowIds: null,\r\n selectedRowCount: gridView.totalCountRows,\r\n });\r\n } else {\r\n _.extendOwn(info, {\r\n allPages: false,\r\n selectedRowIds: gridView.selectedItems().map(x => x.Id),\r\n selectedRowCount: gridView.selectedItems().length,\r\n });\r\n }\r\n\r\n return info;\r\n }\r\n\r\n function renderView(action, entity) {\r\n const info = getSelectionInfo();\r\n const model = new RuleAuthoringModel({\r\n odata,\r\n Entity: entity,\r\n });\r\n const ruleViewModel = model.get('SelectedRule');\r\n\r\n _.extendOwn(ruleViewModel, { entity, action, scopeInfo: info });\r\n model.set('SelectedRule', ruleViewModel);\r\n\r\n automatedRulesView = new RuleAuthoringView({\r\n isForVNext,\r\n grid: {\r\n gridView,\r\n pgridPlugins: {\r\n pagination,\r\n filterService,\r\n crossPageSelectAll,\r\n },\r\n },\r\n koModel: model,\r\n bidBudgetRange: entity === supportedEntities.Campaign ? budgetRange : bidRange,\r\n alertCenter,\r\n stateMgr,\r\n preferenceSvc,\r\n appCfg,\r\n accountTimeZone,\r\n accountCurrencyCode,\r\n currentUserId,\r\n instrumentation,\r\n i18n,\r\n i18nGlobal,\r\n permissions,\r\n scope,\r\n newI18n,\r\n CampaignAdgroupSelectorEdmView,\r\n PredicateListReact,\r\n currentEntity,\r\n });\r\n\r\n automatedRulesView.listenTo(gridView, 'didSelect', () => {\r\n const selectInfo = getSelectionInfo();\r\n\r\n automatedRulesView.updateSelectedEntityCount(selectInfo);\r\n });\r\n\r\n automatedRulesView.render();\r\n if (entityName === supportedEntities.Keyword) {\r\n automatedRulesView.addWalkme({\r\n directive,\r\n walkMe,\r\n walkMeLink,\r\n walkThrus,\r\n });\r\n }\r\n\r\n automatedRulesView.$el.find(':input:enabled:first').focus();\r\n }\r\n\r\n function removeView() {\r\n if (automatedRulesView) {\r\n automatedRulesView.remove();\r\n automatedRulesView = null;\r\n }\r\n }\r\n\r\n function renderRuleAuthoringView(actionId) {\r\n return () => {\r\n // get action from actionID, the format is '{0}_{1}_{2}_{3}',\r\n // like 'CampaignsGrid_automateRule_Campaign_1'\r\n // {2} is the rule template's entitylevel and {3} is the rule template id.\r\n const selectedInfo = actionId.split('_');\r\n const selectedTemplateId = selectedInfo[selectedInfo.length - 1];\r\n\r\n if (selectedTemplateId === 'RedirectToREManagement') {\r\n router.navigateToRoute('bulk_rules');\r\n return;\r\n }\r\n const selectedTemplateEntityLevel = selectedInfo[selectedInfo.length - 2];\r\n\r\n if (automatedRulesView) {\r\n throw new Error('duplicate automated rules view.');\r\n } else {\r\n renderView(selectedTemplateId, selectedTemplateEntityLevel);\r\n }\r\n\r\n // use defer here to wait for the this dropdown menu to hide first\r\n _.defer(() => {\r\n const gridContainer = gridView.$el.closest('.bingadsgrid');\r\n const editorContainer = gridContainer.find('.editor__container');\r\n const gridToolbar = gridContainer.find('.grid-toolbar');\r\n\r\n if (isForVNext) {\r\n toolbarEditor.overrideWith(automatedRulesView);\r\n } else {\r\n editorContainer.html(automatedRulesView.$el);\r\n // show editor\r\n editorContainer.show();\r\n }\r\n // hide the toolbar with empty view, which will have blank height\r\n gridToolbar.hide();\r\n\r\n toolbar.gridToolbarGroup.hideAllToolbars();\r\n\r\n // show toolbar after hide the automated rules form\r\n automatedRulesView.once('hide', () => {\r\n gridToolbar.show();\r\n editorContainer.hide();\r\n toolbar.gridToolbarGroup.showAllToolbars();\r\n automatedRulesView = null;\r\n\r\n if (isForVNext) {\r\n toolbarEditor.overrideWith(null);\r\n }\r\n });\r\n });\r\n };\r\n }\r\n\r\n function switchTab(actionId) {\r\n return () => {\r\n const selectedMenu = actionId.split('_');\r\n const entityLevel = selectedMenu[selectedMenu.length - 2];\r\n\r\n const scenario = instrumentation[`authorRule${entityLevel}`].create();\r\n\r\n scenario.createRule.create().trace(`[AutomatedRulesRouting] User switching tabs via automated rules menu to ${actionId} on ${entityLevel} grid`);\r\n\r\n state.set(actionStateKey, actionId);\r\n switch (entityLevel) {\r\n case supportedEntities.Campaign:\r\n router.navigateToRoute('campaign');\r\n break;\r\n case supportedEntities.AdGroup:\r\n router.navigateToRoute('campaign_adgroup');\r\n break;\r\n case supportedEntities.Ad:\r\n router.navigateToRoute('adgroup_ad');\r\n break;\r\n case supportedEntities.Keyword:\r\n default:\r\n router.navigateToRoute('adgroup_keyword');\r\n break;\r\n }\r\n };\r\n }\r\n\r\n const selectInfo = getSelectionInfo();\r\n const shouldBeDisabled = isForVNext && (permissions.IsReadOnlyUser || appCfg.get('CurrentAccountInActive'));\r\n\r\n toolbarEditor.update(getRulesMenu(\r\n entityName,\r\n renderRuleAuthoringView, switchTab, selectInfo, i18n, isForVNext, shouldBeDisabled,\r\n false\r\n ));\r\n\r\n gridView.on('didReload', () => {\r\n const actionId = state.get(actionStateKey);\r\n\r\n if (actionId) {\r\n state.unset(actionStateKey, { silent: true });\r\n renderRuleAuthoringView(actionId)();\r\n }\r\n });\r\n\r\n return {\r\n remove: () => {\r\n removeView();\r\n },\r\n };\r\n});\r\n","export const biddingStrategyType = {\r\n parent: 'InheritFromParent',\r\n manual: 'ManualCpc',\r\n manualCpa: 'ManualCpa',\r\n enhancedCPC: 'EnhancedCpc',\r\n maximizeClicks: 'MaxClicks',\r\n maximizeConversions: 'MaxConversions',\r\n targetCpa: 'TargetCpa',\r\n targetRoas: 'TargetRoas',\r\n maxConversionValue: 'MaxConversionValue',\r\n targetImpressionShare: 'TargetImpressionShare',\r\n biddingStrategyTypeId: {\r\n InheritFromParent: 0,\r\n ManualCpc: 1,\r\n MaxClicks: 2,\r\n MaxConversions: 3,\r\n TargetCpa: 4,\r\n EnhancedCpc: 5,\r\n TargetRoas: 6,\r\n MaxConversionValue: 8,\r\n TargetImpressionShare: 9,\r\n CostPerSale: 15,\r\n ManualCpa: 16,\r\n },\r\n biddingStrategyType: {\r\n 0: 'InheritFromParent',\r\n 1: 'ManualCpc',\r\n 2: 'MaxClicks',\r\n 3: 'MaxConversions',\r\n 4: 'TargetCpa',\r\n 5: 'EnhancedCpc',\r\n 6: 'TargetRoas',\r\n 8: 'MaxConversionValue',\r\n 9: 'TargetImpressionShare',\r\n 15: 'CostPerSale',\r\n 16: 'ManualCpa',\r\n },\r\n};\r\n","import { biddingStrategyType } from './bidding-strategy-type';\r\n\r\nfunction getAdGroupItems({ i18n, changeBiddingStrategy }) {\r\n const entityName = 'AdGroup';\r\n\r\n const result = [\r\n {\r\n text: i18n.getString('BidStrategy_Option_ParentCampaign'),\r\n classes: ['bulk-edit-bid-strategy-inherit-parent'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.parent, entityName),\r\n }, {\r\n text: i18n.getString('BidStrategy_Option_Manual'),\r\n classes: ['bulk-edit-bid-strategy-manual'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.manual, entityName),\r\n },\r\n ];\r\n\r\n return result;\r\n}\r\n\r\nfunction getKeywordItems({ i18n, changeBiddingStrategy }) {\r\n const entityName = 'Keyword';\r\n\r\n const result = [\r\n {\r\n text: i18n.getString('BidStrategy_Option_ParentAdGroup'),\r\n classes: ['bulk-edit-bid-strategy-inherit-parent'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.parent, entityName),\r\n }, {\r\n text: i18n.getString('BidStrategy_Option_Manual'),\r\n classes: ['bulk-edit-bid-strategy-manual'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.manual, entityName),\r\n },\r\n ];\r\n\r\n return result;\r\n}\r\n\r\nfunction getCampaignItems({\r\n permissions, i18n, changeBiddingStrategy,\r\n}) {\r\n const entityName = 'Campaign';\r\n\r\n const result = permissions.IsManualBiddingDeprecationEnabled ?\r\n [\r\n {\r\n text: i18n.getString('BidStrategy_Option_EnhancedCPC'),\r\n classes: ['bulk-edit-bid-strategy-enhanced-cpc'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.enhancedCPC, entityName),\r\n },\r\n ] :\r\n [\r\n {\r\n text: i18n.getString('BidStrategy_Option_Manual_Campaign'),\r\n classes: ['bulk-edit-bid-strategy-manual'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.manual, entityName),\r\n }, {\r\n text: i18n.getString('BidStrategy_Option_EnhancedCPC'),\r\n classes: ['bulk-edit-bid-strategy-enhanced-cpc'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.enhancedCPC, entityName),\r\n },\r\n ];\r\n\r\n result.push({\r\n text: i18n.getString('BidStrategy_Option_MaximizeClicks'),\r\n classes: ['bulk-edit-bid-strategy-maximize-clicks'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.maximizeClicks, entityName),\r\n });\r\n\r\n result.push({\r\n text: i18n.getString('BidStrategy_Option_MaximizeConversions'),\r\n classes: ['bulk-edit-bid-strategy-maximize-conversioins'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.maximizeConversions, entityName),\r\n });\r\n\r\n result.push({\r\n text: i18n.getString('BidStrategy_Option_TargetCPA'),\r\n classes: ['bulk-edit-bid-strategy-target-cpa'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.targetCpa, entityName),\r\n });\r\n\r\n // should remove old pilot after new pilot enabled\r\n if (permissions.IsCampaignTargetROASBidStrategyEnabled || permissions.IsNewCampaignTargetROASBidStrategyEnabled) { // eslint-disable-line\r\n result.push({\r\n text: i18n.getString('BidStrategy_Option_TargetROAS'),\r\n classes: ['bulk-edit-bid-strategy-target-roas'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.targetRoas, entityName),\r\n });\r\n }\r\n\r\n if (permissions.IsMaximizeConversionValueEnabled) {\r\n result.push({\r\n text: i18n.getString('BidStrategy_Option_MaxConversionValue'),\r\n classes: ['bulk-edit-bid-strategy-maximize-conversion-value'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.maxConversionValue, entityName),\r\n });\r\n }\r\n\r\n if (permissions.IsTargetImpressionShareEnabled) {\r\n result.push({\r\n text: i18n.getString('BidStrategy_Option_TargetImpressionShare'),\r\n classes: ['bulk-edit-bid-strategy-target-impression-share'],\r\n onClick: changeBiddingStrategy(biddingStrategyType.targetImpressionShare, entityName),\r\n });\r\n }\r\n\r\n return result;\r\n}\r\n\r\nexport function getMenuItems({\r\n permissions, i18n, entityName, changeBiddingStrategy,\r\n}) {\r\n switch (entityName) {\r\n case 'Campaign':\r\n return getCampaignItems({\r\n permissions, i18n, changeBiddingStrategy,\r\n });\r\n case 'AdGroup':\r\n return getAdGroupItems({ i18n, changeBiddingStrategy });\r\n case 'Keyword':\r\n return getKeywordItems({ i18n, changeBiddingStrategy });\r\n default:\r\n throw new Error('Entity type bid strategy menu not defined');\r\n }\r\n}\r\n","import $ from 'jquery';\r\n\r\nimport { getMenuItems } from './menu-items';\r\n\r\n/**\r\n * Bid strategy plugin for projection-grid.\r\n *\r\n * User need to set these things in config\r\n * filterService: the filterService which can get current filter using getCombinedFilter\r\n * bidStrategy: {\r\n * ChangeBiddingStrategyModel (constructor for bidding strategy panel view),\r\n * ChangeBiddingStrategyView (constructor for bidding strategy panel model),\r\n * i18n,\r\n * permissions\r\n *\r\n * @param { function } definePlugin function passed in by p-grid\r\n * @returns { void }\r\n */\r\nexport const bidStrategy = definePlugin => definePlugin('bidStrategy', [\r\n 'config',\r\n 'gridView',\r\n 'toolbar',\r\n 'pagination',\r\n 'crossPageSelectAll',\r\n], (config, gridView, toolbar, pagination, crossPageSelectAll) => {\r\n const menuId = 'dropdown-bid-strategy';\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n const {\r\n ChangeBiddingStrategyView,\r\n ChangeBiddingStrategyModel,\r\n i18n,\r\n permissions,\r\n scope,\r\n isForVNext = false,\r\n } = config.plugins.bidStrategy;\r\n\r\n const { filterService } = config;\r\n let bidStrategyView = null;\r\n\r\n function getGridSelectionCount() {\r\n return crossPageSelectAll.isAllSelected ?\r\n crossPageSelectAll.viewModel.totalRowsTotalPageCount() :\r\n gridView.selectedKeys().length;\r\n }\r\n\r\n function renderView(type, entityName) {\r\n bidStrategyView = new ChangeBiddingStrategyView({\r\n model: new ChangeBiddingStrategyModel({\r\n Entity: entityName,\r\n selectedEntityCount: getGridSelectionCount(),\r\n scope,\r\n }),\r\n grid: {\r\n gridView,\r\n pgridPlugins: {\r\n pagination,\r\n crossPageSelectAll,\r\n filterService,\r\n },\r\n },\r\n entityType: entityName,\r\n biddingStrategyType: type,\r\n });\r\n\r\n bidStrategyView.listenTo(gridView, 'didSelect', () => {\r\n const count = getGridSelectionCount();\r\n\r\n bidStrategyView.updateSelectedEntityCount(count);\r\n });\r\n\r\n bidStrategyView.render();\r\n\r\n $('select:first', bidStrategyView.$el).focus();\r\n }\r\n\r\n function removeView() {\r\n if (bidStrategyView) {\r\n bidStrategyView.remove();\r\n bidStrategyView = null;\r\n }\r\n }\r\n\r\n function changeBiddingStrategy(type, entityName) {\r\n return () => {\r\n if (bidStrategyView) {\r\n throw new Error('duplicate bid strategy view.');\r\n } else {\r\n renderView(type, entityName);\r\n }\r\n const gridContainer = gridView.$el.closest('.bingadsgrid');\r\n const editorContainer = gridContainer.find('.editor__container');\r\n const gridToolbar = gridContainer.find('.grid-toolbar');\r\n\r\n editorContainer.html(bidStrategyView.$el);\r\n // show editor\r\n editorContainer.show();\r\n // hide the toolbar with empty view, which will have blank height\r\n gridToolbar.hide();\r\n\r\n toolbar.gridToolbarGroup.hideAllToolbars();\r\n\r\n bidStrategyView.once('hide', () => {\r\n gridToolbar.show();\r\n editorContainer.hide();\r\n toolbar.gridToolbarGroup.showAllToolbars();\r\n removeView();\r\n });\r\n };\r\n }\r\n\r\n function getItems() {\r\n const entityName = config.dataSource.entity.name;\r\n\r\n return getMenuItems({\r\n permissions, i18n, entityName, changeBiddingStrategy,\r\n });\r\n }\r\n\r\n function updateToolbar() {\r\n const items = gridView.selectedItems();\r\n\r\n toolbarEditor.update({\r\n type: 'dropdown',\r\n id: menuId,\r\n button: {\r\n text: i18n.getString('Grid_BidStrategy'),\r\n disabled: items.length === 0 || permissions.IsReadOnlyUser,\r\n classes: ['btn', 'btn-secondary'],\r\n },\r\n menu: {\r\n items: getItems(),\r\n },\r\n });\r\n }\r\n\r\n updateToolbar();\r\n\r\n // Don't need to redraw toolbar for vnext\r\n if (!isForVNext) {\r\n gridView.on('didUpdate', () => {\r\n updateToolbar();\r\n });\r\n }\r\n\r\n return {\r\n remove() {\r\n removeView();\r\n },\r\n };\r\n});\r\n","import _ from 'underscore';\r\nimport { defineGridPlugin } from '@bingads-webui/projection-grid-plugin';\r\nimport dataContextManager from '@bingads-webui-static-legacy/summary/SummaryDataContextManager';\r\n/**\r\n * @typedef { Object } MenuItem\r\n * @property { String } text menu item text.\r\n * @property { String[] } classes classes for the menu item.\r\n * @property { Function } createView create bulk edit view.\r\n * @property { MenuItem[] } subItems\r\n */\r\n\r\n/**\r\n * @typedef { Object } BulkEditOptions\r\n * @property { Object } status entity status schema.\r\n * @property { Object } ChangeStatusView entity change status view.\r\n * @property { Object } ChangeStatusModel entity change status model.\r\n * @property { String } DeleteConfirmation entity delete confirmation.\r\n * @property { Object } config config,\r\n * @property { Object } i18n i18n,\r\n * @property { String } entityType entity type.\r\n * @property { Boolean } showDelete show delete option or not. defaults to true.\r\n * @property { Object } function call back after update toolbar\r\n * @property { MenuItem[] } items menu items inserted after enable/pause/delete\r\n * @property { MenuItem[] } frontItems menu items inserted before enable/pause/delete\r\n */\r\n\r\n/**\r\n * updateGridToolbar\r\n * @param { Object } gridView gridView plugin\r\n * @param { Object } toolbar toolbar plugin\r\n * @param { Object } pagination pagination plugin\r\n * @param { Object } crossPageSelectAll crossPageSelectAll plugin\r\n * @param { Object } inlineError inlineError plugin\r\n * @param { BulkEditOptions } options bulk edit options (details below)\r\n * @param {object} options.status - status options\r\n * @param {ChangeStatusView} options.ChangeStatusView - ChangeStatusView\r\n * @param {ChangeStatusModel} options.ChangeStatusModel - ChangeStatusModel\r\n * @param {string} options.DeleteConfirmation - Delete Confirmation Message\r\n * @param {object} options.config - config\r\n * @param {object} options.filterService - filterService\r\n * @param {object} options.i18n - i18n\r\n * @param {string} options.entityType - the entity type\r\n * @param {function} options.gridDecorationCallback - grid decoration callback\r\n * @param {boolean} options.showDelete - flag to indicate if Delete option is to be supported\r\n * @param {boolean} options.showEnable - flag to indicate if Enable option is to be supported\r\n * @param {boolean} options.showExclude - flag to indicate if Exclude option is to be supported\r\n * @param {boolean} options.showPause - flag to indicate if Pause option is to be supported\r\n * @param {boolean} options.showSeparateExclude - indicate Exclude be displayed in separate divider\r\n * @param {boolean} options.disableDeselectAll - disable deselect all after bulk edit success\r\n * @returns { void }\r\n */\r\nfunction updateGridToolbar(\r\n gridView,\r\n toolbar,\r\n pagination,\r\n crossPageSelectAll,\r\n inlineError,\r\n options\r\n) {\r\n const menuId = 'dropdown-edit';\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n\r\n const {\r\n status,\r\n ChangeStatusView,\r\n ChangeStatusModel,\r\n DeleteConfirmation,\r\n config,\r\n filterService,\r\n i18n,\r\n entityType,\r\n items,\r\n frontItems = [],\r\n campaignUpgradeItem,\r\n gridDecorationCallback,\r\n showDelete = true,\r\n showEnable = true,\r\n showExclude = false,\r\n showPause = true,\r\n showSeparateExclude = false,\r\n scope,\r\n isForVNext = false,\r\n bulkEditUrl = '',\r\n customClickHandler = null,\r\n qualtricsSurveyCallback = null,\r\n importNotificationCallback = null,\r\n importBudgetBidNotificationCallback = null,\r\n disableDeselectAll = false,\r\n } = options;\r\n let bulkEditView;\r\n\r\n const defaultBulkEditViewConfig = {\r\n grid: {\r\n filterService,\r\n gridView,\r\n pgridPlugins: {\r\n pagination,\r\n crossPageSelectAll,\r\n },\r\n isForVNext,\r\n },\r\n onOperationSuccess: () => {\r\n if (!disableDeselectAll) {\r\n crossPageSelectAll.deselectAll();\r\n gridView.deselectAll();\r\n }\r\n },\r\n inlineError,\r\n };\r\n\r\n function getSelectionInfo() {\r\n const info = {};\r\n\r\n if (crossPageSelectAll.isAllSelected) {\r\n info.allPages = true;\r\n info.selectedRowCount = crossPageSelectAll.viewModel.totalRowsTotalPageCount();\r\n info.selectedRowIds = null;\r\n } else {\r\n const selectedIds = gridView.selectedKeys();\r\n\r\n info.allPages = false;\r\n info.selectedRowCount = selectedIds.length;\r\n info.selectedRowIds = selectedIds;\r\n }\r\n return info;\r\n }\r\n\r\n function afterStatusChange(selectionInfo, act) {\r\n if (selectionInfo.allPages) {\r\n window.App.trigger(`${entityType}Reload`);\r\n } else {\r\n const response = [];\r\n\r\n if (act === status.Deleted) {\r\n _.each(selectionInfo.selectedRowIds, (rowId) => {\r\n response.push({ Id: rowId });\r\n });\r\n window.App.trigger(`${entityType}Deleted`, { data: response });\r\n } else {\r\n let Status = '';\r\n\r\n if (act === status.Paused) {\r\n Status = status.EnumPaused;\r\n }\r\n _.each(selectionInfo.selectedRowIds, (rowId) => {\r\n response.push({\r\n Id: rowId,\r\n Status,\r\n });\r\n });\r\n window.App.trigger(`${entityType}Updated`, { data: response });\r\n }\r\n }\r\n\r\n // show import related notifications for bulk edit in campaign related grids\r\n if (entityType === 'campaign' && act !== status.Deleted && importNotificationCallback && _.isFunction(importNotificationCallback)) {\r\n const campaignItem = gridView.selectedItems();\r\n\r\n importNotificationCallback({ campaignItemList: campaignItem, updateStatus: act });\r\n }\r\n }\r\n\r\n function renderView() {\r\n if (_.isFunction(bulkEditView.updateSelectedEntityCount)) {\r\n bulkEditView.listenTo(gridView, 'didSelect', () => {\r\n const selectInfo = getSelectionInfo();\r\n\r\n if (bulkEditView && bulkEditView.updateSelectedEntityCount) {\r\n bulkEditView.updateSelectedEntityCount(selectInfo.selectedRowCount);\r\n }\r\n });\r\n }\r\n\r\n bulkEditView.render();\r\n }\r\n\r\n function removeView() {\r\n bulkEditView.remove();\r\n bulkEditView = null;\r\n }\r\n\r\n function hideToolBar() {\r\n // use defer here to wait for the this dropdown menu to hide first\r\n _.defer(() => {\r\n let editorviewHiden = false;\r\n const gridContainer = gridView.$el.closest('.bingadsgrid');\r\n const editorContainer = gridContainer.find('.editor__container');\r\n const getGridToolbar = () => gridContainer.find('.grid-toolbar');\r\n\r\n if (isForVNext) {\r\n toolbarEditor.overrideWith(bulkEditView);\r\n } else {\r\n editorContainer.html(bulkEditView.$el);\r\n // show editor\r\n editorContainer.show();\r\n bulkEditView.$el.find(':input:enabled:first').focus();\r\n }\r\n\r\n _.defer(() => {\r\n // if editor view already hide, then won't hide the toolbar again\r\n if (editorviewHiden) {\r\n return;\r\n }\r\n // hide the toolbar with empty view, which will have blank height\r\n // hide using height instaed of calling hide() to work around Edge browser bug,\r\n // where browser tab crashes when used with narrator.\r\n const gridToolbar = getGridToolbar();\r\n gridToolbar.css({\r\n height: 0,\r\n overflow: 'hidden',\r\n });\r\n gridToolbar.attr('aria-hidden', 'true');\r\n\r\n toolbar.gridToolbarGroup.hideAllToolbars();\r\n });\r\n\r\n bulkEditView.once('hide', () => {\r\n editorviewHiden = true;\r\n\r\n const gridToolbar = getGridToolbar();\r\n gridToolbar.css({\r\n height: 'auto',\r\n overflow: 'visible',\r\n });\r\n gridToolbar.attr('aria-hidden', 'false');\r\n editorContainer.hide();\r\n toolbar.gridToolbarGroup.showAllToolbars();\r\n removeView();\r\n\r\n if (isForVNext) {\r\n toolbarEditor.overrideWith(null);\r\n }\r\n });\r\n });\r\n }\r\n\r\n defaultBulkEditViewConfig.hideToolBar = hideToolBar;\r\n\r\n function noneSelectedAndAlert(count) {\r\n if (count < 1) {\r\n // eslint-disable-next-line no-alert, no-restricted-globals\r\n alert(i18n.getString('Grid_RowSelectionRequired'));\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n function changeStatus(act) {\r\n const info = getSelectionInfo();\r\n\r\n if (noneSelectedAndAlert(info.selectedRowCount)) {\r\n return;\r\n }\r\n\r\n if (!crossPageSelectAll.isAllSelected) {\r\n if (_.isFunction(customClickHandler)) {\r\n const keepOriginal = !customClickHandler(crossPageSelectAll, gridView, i18n, act);\r\n if (!keepOriginal) {\r\n return;\r\n }\r\n }\r\n // eslint-disable-next-line no-alert, no-restricted-globals\r\n if (act === status.Deleted && !confirm(DeleteConfirmation)) {\r\n return;\r\n }\r\n }\r\n\r\n // fire qualtrics event if user pauses all campaigns on the page or pauses all their campaigns.\r\n if (entityType === 'campaign' &&\r\n qualtricsSurveyCallback &&\r\n (crossPageSelectAll.isAllSelected ||\r\n crossPageSelectAll.viewModel.currentPageAllRowsSelected()\r\n ) &&\r\n act === status.Paused) {\r\n qualtricsSurveyCallback();\r\n }\r\n\r\n const statusModel = new ChangeStatusModel({\r\n selectedEntityCount: info.selectedRowCount,\r\n allPages: info.allPages,\r\n scope,\r\n });\r\n const action = statusModel.get('BatchAction').Actions[0];\r\n\r\n action.Value = act;\r\n\r\n bulkEditView = new ChangeStatusView(_.defaults({\r\n model: statusModel,\r\n onOperationSuccess: () => {\r\n afterStatusChange(info, act);\r\n if (!disableDeselectAll) {\r\n crossPageSelectAll.deselectAll();\r\n gridView.deselectAll();\r\n }\r\n },\r\n isSkipEntityCache: act === status.Deleted,\r\n isForVNext,\r\n bulkEditUrl,\r\n }, defaultBulkEditViewConfig));\r\n renderView();\r\n\r\n if (!isForVNext\r\n || crossPageSelectAll.isAllSelected\r\n || (typeof bulkEditView.isExcludeNonAudience === 'function' && bulkEditView.isExcludeNonAudience())) {\r\n // For VNext only hide\r\n // 1. when cross-page is selected\r\n // 2. when non audience campaign target is excluded.\r\n // Since that the only time we show top of grid panel for change status.\r\n hideToolBar();\r\n }\r\n }\r\n\r\n function generateClickableItem({\r\n text,\r\n iconLeft,\r\n iconLeftGlyphName,\r\n classes,\r\n createView,\r\n isFallbackEnabled,\r\n noSelectionRequired = false,\r\n hotkeys,\r\n }) {\r\n return {\r\n text,\r\n iconLeft,\r\n iconLeftGlyphName,\r\n classes,\r\n isFallbackEnabled,\r\n onClick: isFallbackEnabled ? null : () => {\r\n const info = getSelectionInfo();\r\n\r\n // check the selection for the menu that do require selection\r\n if (!noSelectionRequired && noneSelectedAndAlert(info.selectedRowCount)) {\r\n return;\r\n }\r\n if (_.isFunction(customClickHandler)) {\r\n const keepOriginal = !customClickHandler(crossPageSelectAll, gridView, i18n);\r\n if (!keepOriginal) {\r\n return;\r\n }\r\n }\r\n const selectedItems = gridView.selectedItems();\r\n\r\n const viewConfig = {\r\n ...defaultBulkEditViewConfig,\r\n onOperationSuccess: (model) => {\r\n const newValue = _.get(model, ['attributes', 'BatchAction', 'Actions', 0]);\r\n if (newValue && importBudgetBidNotificationCallback) {\r\n if (classes[0] === 'bulk-edit-change-budget') {\r\n importBudgetBidNotificationCallback({ campaignItemList: selectedItems, newBudget: newValue });\r\n }\r\n if (classes[0] === 'bulk-edit-change-lifetime-budget') {\r\n importBudgetBidNotificationCallback({ campaignItemList: selectedItems, newBudget: newValue });\r\n }\r\n if (classes[0] === 'bulk-edit-change-bid-strategy-type') {\r\n importBudgetBidNotificationCallback({ campaignItemList: selectedItems, newBidStrategy: newValue });\r\n }\r\n }\r\n\r\n defaultBulkEditViewConfig.onOperationSuccess();\r\n },\r\n };\r\n\r\n bulkEditView = createView({\r\n viewConfig,\r\n selectedRowCount: info.selectedRowCount,\r\n allPages: info.allPages,\r\n selectedRowIds: info.selectedRowIds,\r\n isForVNext,\r\n selectedItems,\r\n });\r\n\r\n if (_.isUndefined(bulkEditView)) {\r\n return;\r\n }\r\n\r\n bulkEditView.once('close', () => {\r\n toolbar.gridToolbarGroup.showAllToolbars();\r\n dataContextManager.updateContext(['AdGrid']);\r\n gridView.refresh(true);\r\n });\r\n\r\n bulkEditView.once('saveAndRefresh', () => {\r\n toolbar.gridToolbarGroup.showAllToolbars();\r\n dataContextManager.updateContext(['AdGrid']);\r\n gridView.refresh(true);\r\n });\r\n\r\n renderView();\r\n hideToolBar();\r\n },\r\n hotkeys,\r\n };\r\n }\r\n\r\n function generateClickableCampaignUpgradeItem({\r\n text,\r\n iconLeft,\r\n iconLeftGlyphName,\r\n classes,\r\n repos,\r\n isFallbackEnabled,\r\n noSelectionRequired = false,\r\n hotkeys,\r\n }) {\r\n return {\r\n text,\r\n iconLeft,\r\n iconLeftGlyphName,\r\n classes,\r\n isFallbackEnabled,\r\n onClick: isFallbackEnabled ? null : () => {\r\n const info = getSelectionInfo();\r\n\r\n // check the selection for the menu that do require selection\r\n if (!noSelectionRequired && noneSelectedAndAlert(info.selectedRowCount)) {\r\n return;\r\n }\r\n const selectedItems = gridView.selectedItems();\r\n const { allPages } = info;\r\n repos.openUpgradeDialog(selectedItems, allPages);\r\n },\r\n hotkeys,\r\n };\r\n }\r\n\r\n function getItems() {\r\n function getIconClasses(cls) {\r\n if (isForVNext) {\r\n return [cls];\r\n }\r\n return ['glyphicon', 'glyphicon-offset-left5'].concat(cls);\r\n }\r\n\r\n const divider = {\r\n type: 'dropdown-divider',\r\n };\r\n\r\n const excludeItem = {\r\n text: i18n.getString('Page_All_RowactionText_Exclude'),\r\n iconLeft: getIconClasses('icon-status-exclude'),\r\n iconLeftGlyphName: 'ba-Blocked',\r\n classes: ['bulk-edit-exclude'],\r\n onClick: () => {\r\n changeStatus(status.Excluded);\r\n },\r\n };\r\n\r\n const menuItems = _.compact([\r\n showEnable && {\r\n text: i18n.getString('Page_All_RowactionText_Enable'),\r\n iconLeft: getIconClasses('icon-status-active'),\r\n iconLeftGlyphName: 'ba-RadioBullet2',\r\n classes: ['bulk-edit-enable'],\r\n onClick: () => {\r\n changeStatus(status.Active);\r\n },\r\n },\r\n showPause && {\r\n text: i18n.getString('Page_All_RowactionText_Pause'),\r\n iconLeft: getIconClasses('icon-status-pause'),\r\n iconLeftGlyphName: 'ba-PauseListView12',\r\n classes: ['bulk-edit-pause'],\r\n onClick: () => {\r\n changeStatus(status.Paused);\r\n },\r\n },\r\n (showExclude && !showSeparateExclude) && excludeItem,\r\n ]);\r\n\r\n if (showDelete) {\r\n menuItems.splice(menuItems.length, 0, {\r\n text: i18n.getString('Page_All_RowactionText_Delete'),\r\n iconLeft: getIconClasses('icon-status-delete'),\r\n iconLeftGlyphName: 'ba-Delete',\r\n classes: ['bulk-edit-delete'],\r\n onClick: () => {\r\n changeStatus(status.Deleted);\r\n },\r\n }, divider);\r\n }\r\n\r\n if (showExclude && showSeparateExclude) {\r\n menuItems.splice(menuItems.length, 0, excludeItem, divider);\r\n }\r\n\r\n // Add a divider if not exist, before next group\r\n if (menuItems.lastIndexOf(divider) !== menuItems.length - 1) {\r\n menuItems.push(divider);\r\n }\r\n\r\n _.each(items, (item) => {\r\n if (_.isUndefined(item.isValid) || item.isValid()) {\r\n if (item.subItems) {\r\n menuItems.push({\r\n type: 'dropdown-submenu',\r\n menu: {\r\n items: _.map(item.subItems, subItem => generateClickableItem(subItem)),\r\n },\r\n button: {\r\n text: item.text,\r\n iconRight: ['glyphicon', 'toolbar-icon', 'grid-expand-icon', 'pull-right'],\r\n },\r\n });\r\n } else if (item.type === divider.type) {\r\n menuItems.push(item);\r\n } else {\r\n menuItems.push(generateClickableItem(item));\r\n }\r\n }\r\n });\r\n if (_.result(campaignUpgradeItem, 'isValid')) {\r\n const { allPages: allPagesSelected } = getSelectionInfo();\r\n const curSelectedItems = gridView.selectedItems();\r\n if (allPagesSelected || _.any(curSelectedItems, item => item.CampaignType === 'Shopping' && item.CampaignSubType === 'ShoppingSmartAds')) {\r\n menuItems.push(generateClickableCampaignUpgradeItem(campaignUpgradeItem));\r\n }\r\n }\r\n const frontMenuItems = [];\r\n _.each(frontItems, (item) => {\r\n if (_.isUndefined(item.isValid) || item.isValid()) {\r\n frontMenuItems.push(generateClickableItem(item));\r\n }\r\n });\r\n if (!_.isEmpty(frontMenuItems)) {\r\n frontMenuItems.push(divider);\r\n }\r\n\r\n return frontMenuItems.concat(menuItems);\r\n }\r\n\r\n function updateToolbar() {\r\n const isReadOnlyUser = config.get('Permissions').IsReadOnlyUser;\r\n const isAccountInactive = config.get('CurrentAccountInActive');\r\n\r\n toolbarEditor.update({\r\n type: 'dropdown',\r\n id: 'dropdown-edit',\r\n iconLeftGlyphName: 'ba-Edit',\r\n button: {\r\n text: i18n.getString('Grid_EditButtonText'),\r\n disabled: isReadOnlyUser || isAccountInactive,\r\n classes: ['btn', 'btn-secondary'],\r\n },\r\n menu: {\r\n items: getItems(),\r\n },\r\n });\r\n }\r\n\r\n gridView.on('didSelect', () => {\r\n if (isForVNext && !_.isEmpty(gridView.selectedItems())) {\r\n updateToolbar();\r\n }\r\n });\r\n\r\n updateToolbar();\r\n\r\n // For some of the grid, we need to show some message\r\n if (_.isFunction(gridDecorationCallback)) {\r\n gridDecorationCallback(gridView);\r\n }\r\n}\r\n\r\n/**\r\n * Projection grid bulk edit plugin,\r\n */\r\nexport const projectionGridBulkEdit = defineGridPlugin(\r\n 'projectionGridBulkEdit', [\r\n 'gridView',\r\n 'toolbar',\r\n 'pagination',\r\n 'crossPageSelectAll',\r\n 'inlineError',\r\n ],\r\n updateGridToolbar\r\n);\r\n","export const localPreferenceService = {\r\n findByNameAtUserLevel: (key) => {\r\n const data = localStorage.getItem(key);\r\n const value = data ? JSON.parse(data) : undefined;\r\n return { Name: key, Data: value };\r\n },\r\n setAtUserLevel: ({ Name, Data }) => {\r\n localStorage.setItem(Name, JSON.stringify(Data));\r\n },\r\n};\r\n","import { getColumnResizeProjectionFactory } from '@bingads-webui/projection-grid-column-resize';\r\nimport { defineGridPlugin } from '@bingads-webui/projection-grid-plugin';\r\n\r\nconst PLUGIN_NAME = 'campaignGridColumnResize';\r\nexport const campaignGridColumnResizePlugin = defineGridPlugin(\r\n PLUGIN_NAME,\r\n ['config', 'gridView'],\r\n (config, gridView, settings) => {\r\n // some other plugins also modify header html, ensure this is the last piped plugin\r\n gridView.once('didReload', () => {\r\n const plugin = getColumnResizeProjectionFactory()(PLUGIN_NAME, config, gridView, settings);\r\n gridView.pipeContentProjections(plugin);\r\n });\r\n }\r\n);\r\n","/* eslint-disable import/extensions */\r\n/* eslint-disable import/no-unresolved */\r\nimport _ from 'underscore';\r\nimport { ColumnDoubleClickingBehavior } from '@bingads-webui/projection-grid-column-resize';\r\nimport { localPreferenceService } from './local-preference-service';\r\nimport { campaignGridColumnResizePlugin } from './plugins';\r\nimport headerTemplate from './header.pug';\r\nimport './header.less';\r\n\r\nconst FILE_VERSION = 1;\r\n\r\nexport const getPGridColumnResizePlugin = ({\r\n gridName,\r\n preferenceService,\r\n}) => {\r\n const preferenceSrv = preferenceService || localPreferenceService;\r\n const preferenceKey = `${gridName}-ColumnResizePlugin`;\r\n const debouncedSaveToPreference = _.debounce(preferenceSrv.setAtUserLevel, 500);\r\n\r\n let cache = null;\r\n let manuallySetLastColumnWidth = null;\r\n\r\n // when saving data, try to keep existing data\r\n // for example, when CPA columns are expanded, columns\r\n // only contains CPA sub columns, but cache may contains\r\n // CPA column data. by this way, we can restore CPA column\r\n // width after collpase CPA column\r\n const saveToStore = (columns, widthState) => {\r\n if (columns) {\r\n if (cache === null) {\r\n cache = {};\r\n }\r\n columns.forEach((c) => {\r\n const col = {};\r\n if (_.isNumber(c.width)) {\r\n col.width = c.width;\r\n }\r\n if (_.isNumber(c.left)) {\r\n col.left = c.left;\r\n }\r\n if (c.name) {\r\n cache[c.name] = col;\r\n }\r\n });\r\n\r\n if (widthState && _.isNumber(widthState.manuallySetLastColumnWidth)) {\r\n // eslint-disable-next-line prefer-destructuring\r\n manuallySetLastColumnWidth = widthState.manuallySetLastColumnWidth;\r\n }\r\n\r\n // save to preference service\r\n debouncedSaveToPreference({\r\n Name: preferenceKey,\r\n Data: { version: FILE_VERSION, columns: cache, manuallySetLastColumnWidth },\r\n });\r\n }\r\n };\r\n\r\n const loadFromStore = (state) => {\r\n // load data\r\n if (cache === null) {\r\n const { Data = {} } = preferenceSrv.findByNameAtUserLevel(preferenceKey) || {};\r\n const { version, columns, manuallySetLastColumnWidth: mslcw } = Data;\r\n // discard the data if versions dismatch\r\n if (version === FILE_VERSION) {\r\n cache = columns;\r\n\r\n if (_.isNumber(mslcw)) {\r\n manuallySetLastColumnWidth = mslcw;\r\n }\r\n }\r\n }\r\n\r\n const loadedColumns = [];\r\n const stateColumns = state.columnGroup && state.columnGroup.leafColumns\r\n ? state.columnGroup.leafColumns\r\n : state.columns;\r\n if (cache && stateColumns) {\r\n stateColumns.forEach((c) => {\r\n const col = { name: c.name };\r\n const { width, left } = cache[c.name] || {};\r\n if (_.isNumber(width)) {\r\n col.width = width;\r\n }\r\n if (_.isNumber(left)) {\r\n col.left = left;\r\n }\r\n loadedColumns.push(col);\r\n });\r\n }\r\n\r\n return [loadedColumns, manuallySetLastColumnWidth];\r\n };\r\n\r\n // add grabber to table header cell, also add a class\r\n // 'resizable-column-header' to \r\n const renderGrabber = (cell, isDraggingCurCol) => _.defaults({\r\n html: headerTemplate({\r\n val: cell.html,\r\n dragging: isDraggingCurCol,\r\n }),\r\n classes: ['resizable-column-header', ...cell.classes],\r\n }, cell);\r\n\r\n return {\r\n plugin: campaignGridColumnResizePlugin,\r\n config: {\r\n isSaveEnabled: true,\r\n doubleClickingBehavior: ColumnDoubleClickingBehavior.resizeToMinWidth,\r\n saveToStore,\r\n loadFromStore,\r\n renderGrabber,\r\n },\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport { prompt } from '@bingads-webui/popup-editor';\r\nimport editTemplate from './editable-template.pug';\r\n/**\r\n * Projection grid editable plugin,\r\n * User need to set these things in config\r\n *\r\n *
plugins: { editable: {\r\n * i18n,\r\n * saveModel: (updated, viewEditor, item, property) default save model for inline edit\r\n * }}\r\n *
they can also set these things in the editable\r\n * editable: {\r\n * enableEdit: set cell level editable/ read-only for the editable columns (false to disable)\r\n * prompt: prompot function on edit\r\n * if nothing specified, it would use simple-form shown in popup-up-editor\r\n * prompt: open a popup editor, return promise which will be resolved after save & cancel\r\n * dismiss: close the editor\r\n * saveModel: (updated, editorView) save handler\r\n * can use editorView.trigger('save') to close view\r\n * updateHandler: (item, updated, editorView): can use to replace saveModel\r\n * editorConfig: object, use to set property for column editable\r\n *
Triggered event selectedLanguages:changed when user selection changes\r\n * @param { object } definePlugin: function pointer used to define plugin for grid\r\n * @returns {void}\r\n */\r\nexport const editablePlugin = definePlugin => definePlugin('editable', ['gridView', 'config'], (gridView, config) => {\r\n const {\r\n i18n, saveModel,\r\n // TODO: this is a temp fix. Related code should be removed if all\r\n // pages using \"EditIcon\" have i18n key \"Grid_EditButtonText\".\r\n isEditIconLocalized,\r\n } = _.result(config.plugins, 'editable', {});\r\n const editable = {\r\n name: 'editable',\r\n handler(state) {\r\n const { leafColumns } = state.columnGroup;\r\n const iconClasses = ['glyphicon', 'glyphicon-pencil', 'clickable'];\r\n const events = _.reduce(leafColumns, (memo, col) => {\r\n if (!col.editable) {\r\n return memo;\r\n }\r\n\r\n // editable columns can have read-only cells, just update the enableEdit function\r\n // all columns has grid-editable-cell should be editable\r\n // eslint-disable-next-line no-param-reassign\r\n memo[`click .grid-editable-cell.grid-column-${col.name}`] = (e) => {\r\n const $td = $(e.target).closest('td, .td');\r\n const key = this.keyOfElement(e.target);\r\n // eslint-disable-next-line no-underscore-dangle\r\n const item = _.find(\r\n gridView._chainData.state.items.slice(), // eslint-disable-line no-underscore-dangle\r\n i => i[gridView.primaryKey].toString() === key\r\n );\r\n\r\n if (_.isFunction(col.editable.enableEdit) && !col.editable.enableEdit(item)) {\r\n return;\r\n }\r\n this.trigger('willEdit', item);\r\n\r\n const offset = $td.offset();\r\n\r\n const uiNextVirtualOffset = $('.grid-and-disclaim-container:visible').offset();\r\n // newPosition = new method of calculating position for ui-next viewport\r\n const newPosition = {};\r\n const position = {};\r\n\r\n position.top = offset.top;\r\n position.left = offset.left;\r\n\r\n if (uiNextVirtualOffset) {\r\n newPosition.top = (offset.top - uiNextVirtualOffset.top) + ($td.height() / 2);\r\n newPosition.left = offset.left - uiNextVirtualOffset.left;\r\n }\r\n\r\n if (_.isFunction(col.editable.prompt)) {\r\n col.editable.prompt({\r\n position,\r\n newPosition,\r\n col,\r\n item,\r\n event: e,\r\n });\r\n } else {\r\n const options = {\r\n model: _.pick(item, col.name),\r\n fields: [col.name],\r\n schema: config.dataSource.schema,\r\n position: col.editable.isForVNext ? newPosition : position,\r\n hasLabels: false,\r\n template: 'inline',\r\n i18n,\r\n parentContainerSelector: col.editable.parentContainerSelector,\r\n };\r\n\r\n if (_.isFunction(saveModel)) {\r\n options.saveModel =\r\n (updatedModel, viewEditor) => saveModel(updatedModel, viewEditor, item, col.name);\r\n }\r\n\r\n if (_.isFunction(col.editable.updateHandler)) {\r\n options.saveModel = _.partial(col.editable.updateHandler, item);\r\n }\r\n\r\n let editorConfig = null;\r\n\r\n if (_.isFunction(col.editable.editorConfig)) {\r\n editorConfig = col.editable.editorConfig(item);\r\n } else if (_.isObject(col.editable.editorConfig)) {\r\n ({ editorConfig } = col.editable);\r\n }\r\n\r\n if (_.isObject(editorConfig)) {\r\n const generatedConfig = {};\r\n\r\n if (_.isFunction(editorConfig.model)) {\r\n _.extend(generatedConfig, {\r\n model: editorConfig.model(item),\r\n });\r\n }\r\n _.extend(options, editorConfig, generatedConfig);\r\n }\r\n prompt(options).then((model) => {\r\n gridView.trigger('didEdit', model, item, col.name);\r\n });\r\n }\r\n };\r\n return memo;\r\n }, {});\r\n const bodyRows = {\r\n length: state.bodyRows.length,\r\n slice: (...args) => state.bodyRows.slice(...args).map((row, rowIndex) => {\r\n if (row.type !== 'data') {\r\n return row;\r\n }\r\n\r\n const cells = _.map(row.cells, (cell, colIndex) => {\r\n const col = leafColumns[colIndex];\r\n\r\n if (col.editable) {\r\n if (_.isFunction(col.editable.enableEdit) && !col.editable.enableEdit(row.item)) {\r\n return cell;\r\n }\r\n const classes = _.union(cell.classes, ['grid-editable-cell', `grid-column-${col.name}`]);\r\n const html = editTemplate({\r\n $html: cell.html,\r\n classes: iconClasses,\r\n ariaLabel: i18n.getString('Grid_Edit_Cell', { columnName: col.title, rowIndex: rowIndex + 1 }),\r\n gridEditIconTitle: isEditIconLocalized ? i18n.getString('Grid_EditButtonText') : 'Edit',\r\n });\r\n\r\n return _.defaults({ classes, html }, cell);\r\n }\r\n return cell;\r\n });\r\n\r\n return _.defaults({ cells }, row);\r\n }),\r\n };\r\n\r\n _.defaults(events, state.events);\r\n\r\n return _.defaults({ events, bodyRows }, state);\r\n },\r\n defaults: {},\r\n };\r\n\r\n gridView.pipeContentProjections(editable);\r\n});\r\n","/* eslint-disable no-param-reassign */\r\n/* eslint-disable no-unused-expressions */\r\n/* eslint-disable arrow-body-style */\r\nimport $ from 'jquery';\r\nimport { chain, pick, extend, reduce, isUndefined, defaults, result, isNaN, map } from 'underscore';\r\nimport headerTemplate from './header.pug';\r\n\r\nconst defaultMinWidth = 80;\r\nconst defaultMaxWidth = 800;\r\n\r\nconst extendColumns = (columns, extendFunc) => map(columns, (column) => {\r\n if (column.columns) {\r\n return defaults({ columns: extendColumns(column.columns, extendFunc) }, extendFunc(column));\r\n }\r\n return extendFunc(column);\r\n});\r\n\r\nconst getStyleAttr = column => (isUndefined(column.width) || column.columns ? {} : {\r\n style: `width: ${column.width}px`,\r\n});\r\n\r\nconst extendWidthAttr = column => defaults({\r\n headAttributes: extend(getStyleAttr(column), column.headAttributes),\r\n bodyAttributes: extend(getStyleAttr(column), column.bodyAttributes),\r\n footAttributes: extend(getStyleAttr(column), column.footAttributes),\r\n}, column);\r\n\r\nconst getPoPWidth = (widthMap, column) =>\r\n ({\r\n PopSubColWidth: widthMap[`PopSubCol${column.name}`],\r\n ComparedWidth: widthMap[`Compared${column.name}`],\r\n ChangeWidth: widthMap[`${column.name}Change`],\r\n ChangePercentageWidth: widthMap[`${column.name}ChangePercentage`],\r\n });\r\n\r\nconst getColumnWidth = () => {\r\n const $headers = $('.header .flex-row:first-child .flex-cell');\r\n return reduce($headers.toArray(), (memo, header) => {\r\n const $header = $(header);\r\n const name = $header.data('column');\r\n const width = $header.outerWidth();\r\n if (name !== 'selection') {\r\n // eslint-disable-next-line no-param-reassign\r\n memo[name] = width;\r\n }\r\n return memo;\r\n }, {});\r\n};\r\n\r\nexport const projectionGridFlexColumnResize = definePlugin => definePlugin('projectionGridFlexColumnResize', [\r\n 'config',\r\n 'gridView',\r\n], (config, gridView) => {\r\n const { gridName, preferenceService } = config.plugins.projectionGridFlexColumnResize;\r\n const preferenceKey = `${gridName}-FlexColumnResizePlugin`;\r\n let isDown = false;\r\n let $cell;\r\n let cellWidth;\r\n let cellMaxWidth;\r\n let cellMinWidth;\r\n let prev;\r\n\r\n const saveColumnWidth = () => {\r\n const columns = gridView.model.get('columns');\r\n const widthMap = getColumnWidth();\r\n const columnWithWidth = extendColumns(columns, (column) => {\r\n column && column.headAttributes && delete column.headAttributes.style;\r\n column && column.bodyAttributes && delete column.bodyAttributes.style;\r\n column && column.footAttributes && delete column.footAttributes.style;\r\n return defaults({\r\n ...!isUndefined(widthMap[`PopSubCol${column.name}`]) ?\r\n getPoPWidth(widthMap, column) : {\r\n width: widthMap[column.name],\r\n },\r\n }, column);\r\n });\r\n\r\n // Don't save the column width to preference if the width > maxWidth.\r\n // This is possible if the the column is the last one\r\n preferenceService.setAtUserLevel({\r\n Name: preferenceKey,\r\n Data: { columns: pick(widthMap, v => v <= defaultMaxWidth) },\r\n });\r\n\r\n gridView.patch({ columns: columnWithWidth });\r\n };\r\n\r\n const onMouseUp = () => {\r\n if (isDown) {\r\n saveColumnWidth();\r\n }\r\n\r\n isDown = false;\r\n };\r\n\r\n const onMouseDown = (e) => {\r\n $cell = $(e.target).closest('.flex-cell');\r\n cellWidth = $cell.width();\r\n cellMinWidth = isNaN(parseInt($cell.css('minWidth'), 10)) ? defaultMinWidth : parseInt($cell.css('minWidth'), 10);\r\n cellMaxWidth = isNaN(parseInt($cell.css('maxWidth'), 10)) ? defaultMaxWidth : parseInt($cell.css('maxWidth'), 10);\r\n prev = e.clientX;\r\n isDown = true;\r\n };\r\n\r\n const onMouseMove = (e) => {\r\n if (isDown) {\r\n const delta = e.clientX - prev;\r\n const dist = cellWidth + delta;\r\n const name = $cell.data('column');\r\n if (dist >= cellMinWidth || dist <= cellMaxWidth) {\r\n $(`.flex-cell[data-column=\"${name}\"]`).width(dist);\r\n }\r\n }\r\n };\r\n\r\n const onMouseDbClick = (e) => {\r\n $cell = $(e.target).closest('.flex-cell');\r\n cellMinWidth = isNaN(parseInt($cell.css('minWidth'), 10)) ? defaultMinWidth : parseInt($cell.css('minWidth'), 10);\r\n const name = $cell.data('column');\r\n $(`.flex-cell[data-column=\"${name}\"]`).width(cellMinWidth);\r\n saveColumnWidth();\r\n };\r\n\r\n const resizeProjection = {\r\n name: 'resizeProjection',\r\n handler: function resizeProjection(state) {\r\n const headRows = state.headRows.map((headRow) => {\r\n const headRowCells = headRow.cells.map((cell) => {\r\n const column = state.columnGroup.columnIndex[cell.name];\r\n if (result(column, 'isResizable') === false) return cell;\r\n\r\n return defaults({\r\n html: headerTemplate({ val: cell.html }),\r\n classes: ['resizable-column-header', ...cell.classes],\r\n }, cell);\r\n });\r\n\r\n return defaults({ cells: headRowCells }, headRow);\r\n });\r\n\r\n const events = defaults({\r\n 'mousedown .dragger': onMouseDown,\r\n 'click .dragger': e => e.stopPropagation(),\r\n 'dblclick .dragger': onMouseDbClick,\r\n }, state.events);\r\n\r\n return defaults({ headRows, events }, state);\r\n },\r\n };\r\n\r\n gridView.pipeContentProjections(resizeProjection);\r\n\r\n document.addEventListener('mousemove', onMouseMove);\r\n document.addEventListener('mouseup', onMouseUp);\r\n\r\n // init the grid with width in preference\r\n gridView.on('willUpdate', () => {\r\n const res = preferenceService.findByNameAtUserLevel(preferenceKey);\r\n const columnWidthMap = chain(res).result('Data').result('columns').value();\r\n\r\n if (columnWidthMap) {\r\n const columns = gridView.model.get('columns');\r\n const columnWithWidth = extendColumns(columns, (column) => {\r\n const columnWidth = result(columnWidthMap, column.name);\r\n if (isUndefined(columnWidth)) return column;\r\n const widthMap = columnWidthMap;\r\n\r\n return defaults({\r\n ...!isUndefined(widthMap[`PopSubCol${column.name}`]) ?\r\n getPoPWidth(widthMap, column) : {\r\n width: widthMap[column.name],\r\n },\r\n }, column);\r\n });\r\n\r\n const columnWithStyle = extendColumns(columnWithWidth, extendWidthAttr);\r\n\r\n gridView.patch({ columns: columnWithStyle });\r\n }\r\n });\r\n});\r\n","export const pastePlugin = definePlugin => definePlugin('paste', [\r\n 'config',\r\n 'gridView',\r\n 'toolbar',\r\n 'pagination',\r\n 'crossPageSelectAll',\r\n 'filterState',\r\n], (config, gridView, toolbar, pagination, crossPageSelectAll, filterState) => {\r\n const {\r\n plugins: {\r\n paste: {\r\n i18n,\r\n CopyPaste,\r\n filterService,\r\n perfMarker,\r\n },\r\n },\r\n } = config;\r\n const menuId = 'button-paste';\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n\r\n function onClick() {\r\n let pasteView = CopyPaste.paste({\r\n filterService,\r\n gridView,\r\n pgridPlugins: {\r\n pagination,\r\n crossPageSelectAll,\r\n filterState,\r\n },\r\n isForVNext: true,\r\n perfMarker,\r\n });\r\n\r\n if (pasteView) {\r\n toolbarEditor.overrideWith(pasteView);\r\n toolbar.gridToolbarGroup.hideAllToolbars();\r\n pasteView.once('hide', () => {\r\n toolbarEditor.restoreToolbar();\r\n toolbar.gridToolbarGroup.showAllToolbars();\r\n pasteView = null;\r\n\r\n toolbarEditor.overrideWith(null);\r\n });\r\n }\r\n }\r\n toolbarEditor.update({\r\n id: menuId,\r\n text: i18n.getString('BulkEdit_PasteMenu'),\r\n onClick,\r\n hotkeys: {\r\n win: 'Ctrl-V',\r\n mac: '\\u2318V',\r\n },\r\n });\r\n\r\n return {\r\n onClick,\r\n };\r\n});\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\n\r\nconst sharedClassName = 'projection-grid-popup-plugin';\r\n\r\nexport const projectionGridPopupPlugin = definePlugin => definePlugin('projectionGridPopup', [\r\n 'config',\r\n 'gridView',\r\n], ({\r\n plugins: {\r\n projectionGridPopup,\r\n },\r\n}, gridView) => {\r\n const getPopover = container => $(container).find('.popover');\r\n const closePopover = () => $(`.${sharedClassName}`).remove();\r\n\r\n function getMouseleaveHandler() {\r\n return function mouseleaveHandler(e) {\r\n if ($(e.relatedTarget).parents('.popover').length === 1) return;\r\n closePopover();\r\n };\r\n }\r\n\r\n function getMouseenterHandler({\r\n title,\r\n content,\r\n className,\r\n container,\r\n }) {\r\n return function mouseenterHandler(e) {\r\n e.stopPropagation();\r\n const key = gridView.keyOfElement(e.target);\r\n const item = gridView.itemWithKey(key);\r\n const $target = $(e.target);\r\n\r\n // skip if the popup is triggered by same cell\r\n const existKey = getPopover(container).attr('data-key');\r\n if (existKey === key) return;\r\n closePopover();\r\n\r\n $target.popover({\r\n html: true,\r\n trigger: 'manual',\r\n title: _.isFunction(title) ? title(item) : title,\r\n content: _.isFunction(content) ? content(item) : content,\r\n container,\r\n placement: 'auto right',\r\n template: `\r\n
\r\n
\r\n

\r\n
\r\n
`,\r\n }).popover('show');\r\n\r\n const $popover = getPopover(container);\r\n\r\n $popover.on('mouseleave', () => {\r\n closePopover();\r\n });\r\n\r\n $popover.on('click', (ev) => {\r\n if (ev.target.tagName.toLowerCase() === 'a'\r\n || ev.target.tagName.toLowerCase() === 'button') {\r\n return;\r\n }\r\n ev.stopPropagation();\r\n });\r\n };\r\n }\r\n\r\n /*\r\n * popupEvents = {\r\n * 'mouseenter .selector1, () => {},\r\n * 'mouseleave .selector2, () => {},\r\n * }\r\n */\r\n const popupEvents = _.reduce(projectionGridPopup, (memo, i) => {\r\n const option = _.defaults(i, {\r\n title: '',\r\n content: '',\r\n className: '',\r\n container: 'body',\r\n });\r\n\r\n const events = _.extend({\r\n [`mouseenter ${i.selector}`]: _.debounce(getMouseenterHandler(option), 50),\r\n [`mouseleave ${i.outerSelector}`]: _.debounce(getMouseleaveHandler(option), 50),\r\n }, memo);\r\n return events;\r\n }, {});\r\n\r\n const projectionGridPopupProjection = {\r\n name: 'projectionGridPopupProjection',\r\n handler: function scopeNavigator(state) {\r\n const events = _.defaults({}, popupEvents, state.events);\r\n return _.defaults({ events }, state);\r\n },\r\n };\r\n\r\n gridView.pipeContentProjections(projectionGridPopupProjection);\r\n});\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport Uri from 'urijs';\r\n\r\nexport const projectionGridScopeNavigator = definePlugin => definePlugin('projectionGridScopeNavigator', [\r\n 'config',\r\n 'gridView',\r\n], ({\r\n plugins: {\r\n projectionGridScopeNavigator: scope,\r\n },\r\n} = {}, gridView) => {\r\n function navigate(e) {\r\n const $target = $(e.target);\r\n const targetCid = $target.data('cid');\r\n const targetAid = $target.data('aid');\r\n const campaignId = $target.data('campaignid');\r\n const adGroupId = $target.data('adgroupid');\r\n const customParams = $target.data('customparams');\r\n let pathname = $target.data('pathname');\r\n const skipScopeNavigation = $target.data('skipscopenavigation');\r\n const preventDefaultNavigation = $target.data('preventdefaultnavigation');\r\n const { cid, aid, uid } = scope.values;\r\n\r\n if (!pathname) {\r\n const href = $target.attr('href');\r\n if (!_.isUndefined(href)) {\r\n const uri = new Uri(href);\r\n uri.normalizeProtocol();\r\n if (uri.protocol() !== 'javascript') { // prevent invaid pathname for javascript href\r\n pathname = uri.pathname();\r\n }\r\n }\r\n }\r\n\r\n if (skipScopeNavigation) {\r\n return true;\r\n }\r\n\r\n if (preventDefaultNavigation) {\r\n e.preventDefault();\r\n }\r\n\r\n if (!_.isUndefined(targetCid)) {\r\n scope.set({\r\n cid: targetCid, uid,\r\n });\r\n }\r\n\r\n if (!_.isUndefined(targetAid)) {\r\n scope.set({\r\n cid: targetCid || cid, aid: targetAid, uid,\r\n });\r\n }\r\n\r\n if (!_.isUndefined(campaignId)) {\r\n scope.set({\r\n cid, aid, uid, campaignId,\r\n });\r\n }\r\n\r\n if (!_.isUndefined(adGroupId)) {\r\n scope.set({\r\n cid, aid, uid, campaignId, adGroupId,\r\n });\r\n }\r\n\r\n if (!_.isUndefined(customParams)) {\r\n const customQueries = queryString.parse(customParams);\r\n scope.set(_.extend({\r\n cid, aid, uid,\r\n }, customQueries));\r\n }\r\n\r\n if (!_.isUndefined(pathname)) {\r\n scope.save(pathname);\r\n } else {\r\n scope.save();\r\n }\r\n\r\n return false;\r\n }\r\n\r\n const scopeNavigatorProjection = {\r\n name: 'scopeNavigatorProjection',\r\n handler: function scopeNavigator(state) {\r\n const events = _.defaults({\r\n 'click .scope-navigator': navigate,\r\n }, state.events);\r\n\r\n return _.defaults({ events }, state);\r\n },\r\n };\r\n\r\n gridView.pipeContentProjections(scopeNavigatorProjection);\r\n});\r\n","/* eslint-disable no-underscore-dangle */\r\nimport Backbone from 'backbone';\r\nimport $ from 'jquery';\r\nimport { delay, debounce, extend, result, each, isUndefined, has } from 'underscore';\r\nimport { ResizeObserver as ResizeObserverPollyFill } from '@juggle/resize-observer';\r\nimport template from './template.pug';\r\n\r\n// [TODO] Need check Mac OS\r\nconst isFirefox = typeof InstallTrigger !== 'undefined';\r\nconst scrollbarWidth = isFirefox ? 17 : 12;\r\nconst overlapClass = 'overlap-shadow';\r\n\r\nclass ScrollbarView extends Backbone.View {\r\n initialize(options) {\r\n this.freezingSelector = options.freezingSelector;\r\n this.otherSelector = options.otherSelector;\r\n this.scrollbarParentSelector = options.scrollbarParentSelector;\r\n this.calculateOtherHorizontalOffset = options.calculateOtherHorizontalOffset;\r\n }\r\n\r\n addEvent() {\r\n const $bar = this.$el.find(this.scrollbarParentSelector);\r\n $bar.on('scroll', () => {\r\n this.calculateOtherHorizontalOffset();\r\n });\r\n }\r\n\r\n render() {\r\n const parentStyle = {\r\n 'z-index': 10,\r\n height: `${scrollbarWidth}px`,\r\n 'overflow-y': 'hidden',\r\n 'overflow-x': 'scroll',\r\n };\r\n const childStyle = {\r\n height: `${scrollbarWidth}px`,\r\n };\r\n this.$el.html(template({ parentStyle, childStyle }));\r\n\r\n this.addEvent();\r\n return this;\r\n }\r\n}\r\n\r\nexport const projectionGridScrollbarPlugin = definePlugin => definePlugin('projectionGridScrollbar', [\r\n 'gridView',\r\n 'config',\r\n], (gridView, config) => {\r\n const pluginConfig = result(config.plugins, 'projectionGridScrollbar', {});\r\n const {\r\n pageContainer = '.table-page-container',\r\n tableSelector = '.table-container',\r\n rowSelector = '.flex-row',\r\n cellSelector = '.flex-cell',\r\n freezingGroupSelector = '.freezing-group-container',\r\n freezingSelector = '.freezing-group',\r\n otherGroupSelector = '.other-group-container',\r\n otherSelector = '.other-group',\r\n scrollbarContainerSelector = '.scrollbar.flex-row',\r\n scrollbarParentSelector = '.bar-parent',\r\n scrollbarChildSelector = '.bar-child',\r\n scrollElementSelector = null,\r\n shellSelector = '.app-shell-content',\r\n } = pluginConfig;\r\n\r\n const getBarParent = () => $(scrollbarParentSelector);\r\n const getBarChild = () => $(scrollbarChildSelector);\r\n const scrollOtherGroupToLeft = () => $(otherGroupSelector).scrollLeft(0);\r\n const setOverlapClass = isOverLap => (isOverLap ?\r\n $(otherGroupSelector).addClass(overlapClass) :\r\n $(otherGroupSelector).removeClass(overlapClass));\r\n\r\n const $window = $(window);\r\n let prevOffsetWillEditing = 0;\r\n let prevOffset = 0;\r\n\r\n function calculateParentWidth() {\r\n const $freezing = $(freezingGroupSelector);\r\n const $table = $(tableSelector);\r\n const right = $table.width() - $freezing.width();\r\n getBarParent().css({ width: right });\r\n }\r\n\r\n function calculateChildWidth() {\r\n const width = $(otherSelector).width();\r\n getBarChild().css({ width });\r\n }\r\n\r\n // After grid reload, need restore the scrollbar's scrolling offset\r\n function setHorizontalOffset(offset, transition = false) {\r\n $(otherSelector).css({\r\n 'transition-duration': transition ? '0.3s' : '0s',\r\n transform: `translate(-${offset}px, 0)`,\r\n });\r\n getBarParent().scrollLeft(offset);\r\n setOverlapClass(prevOffset > 0);\r\n prevOffset = offset;\r\n }\r\n\r\n function calculateShowOrHide() {\r\n const $barParent = getBarParent();\r\n const $row = $(tableSelector).find(rowSelector).eq(0);\r\n const rowWidth = $row.width();\r\n const freezWidth = $row.find(freezingGroupSelector).width();\r\n const otherWidth = $row.find(otherSelector).width();\r\n\r\n if (rowWidth >= freezWidth + otherWidth) {\r\n // Hide scrollbar. Reset the css translate\r\n $barParent.css({ opacity: 0 });\r\n setHorizontalOffset(0);\r\n } else {\r\n // Show scrollbar\r\n $barParent.css({ opacity: 1 });\r\n }\r\n }\r\n\r\n function calculateScrollbarPosition() {\r\n const $freezing = $(freezingGroupSelector);\r\n const $other = $(otherGroupSelector);\r\n const $barContainer = $(scrollbarContainerSelector);\r\n const windowHeight = $window.height();\r\n const barContainerTopOffset = result($barContainer.offset(), 'top', 0);\r\n const style = { bottom: '0', left: 0 };\r\n const shellWidth = $(shellSelector).width();\r\n const pageWidth = $(pageContainer).width();\r\n let bottom = 0;\r\n if (shellWidth < pageWidth) {\r\n bottom = -16;\r\n }\r\n\r\n if (barContainerTopOffset > windowHeight) {\r\n const left = result($other.offset(), 'left');\r\n extend(style, {\r\n position: 'fixed',\r\n transform: `translate(${left}px, ${bottom}px)`,\r\n });\r\n } else {\r\n const left = $freezing.width();\r\n extend(style, {\r\n position: 'relative',\r\n transform: `translate(${left}px, 0)`,\r\n });\r\n }\r\n\r\n getBarParent().css(style);\r\n }\r\n\r\n function calculateOtherHorizontalOffset() {\r\n const left = getBarParent().scrollLeft();\r\n setHorizontalOffset(left);\r\n setOverlapClass(left > 0);\r\n\r\n if (scrollElementSelector) {\r\n const scrollElement = $(scrollElementSelector);\r\n scrollElement.css('transform', `translate(${-(left - prevOffsetWillEditing)}px, 0)`);\r\n }\r\n }\r\n\r\n\r\n function calculateFocusElementOffset(e) {\r\n delay(() => {\r\n const childElement = $(e.target).closest(cellSelector);\r\n const parentElement = childElement.closest(otherGroupSelector);\r\n const cRect = childElement[0].getBoundingClientRect();\r\n const pRect = parentElement[0].getBoundingClientRect();\r\n\r\n // [x]{[ ][ ][ ]} the focused cell is left of the parent view. Scroll to right\r\n // {[ ][ ][ ]}[x] the focused cell is left of the parent view. Scroll to left\r\n // {[ ][x][ ][ ]} the focused cell is inside of the parent view. No need scroll\r\n let offsetDelta;\r\n if (cRect.left < pRect.left) {\r\n offsetDelta = cRect.left - pRect.left;\r\n } else if (cRect.left + cRect.width > pRect.left + pRect.width) {\r\n offsetDelta = (cRect.left + cRect.width) - (pRect.left + pRect.width);\r\n } else {\r\n offsetDelta = 0;\r\n }\r\n setHorizontalOffset(prevOffset + offsetDelta, true);\r\n }, 50);\r\n }\r\n\r\n // This event can be triggered by Tab key\r\n // Need handle scroll event\r\n // Since the scroll event does not bubble up, need bind the event on the element directly\r\n function addScrollRowEvent() {\r\n const otherGroupElements = gridView.$(otherGroupSelector).toArray();\r\n each(otherGroupElements, (el) => {\r\n const scrollEvent = result($._data(el, 'events'), 'scroll');\r\n if (isUndefined(scrollEvent)) {\r\n $(el).on('scroll', scrollOtherGroupToLeft);\r\n }\r\n });\r\n\r\n const focusElements = gridView.$(`${otherGroupSelector} a, ${otherGroupSelector} [tabindex=0]`).toArray();\r\n each(focusElements, (el) => {\r\n const scrollEvent = result($._data(el, 'events'), 'focus');\r\n if (isUndefined(scrollEvent)) {\r\n $(el).on('focus', calculateFocusElementOffset);\r\n }\r\n });\r\n }\r\n\r\n function horizontalScrollHandler(e) {\r\n const isMouseInside = $(e.target).parents(`${otherGroupSelector}, ${freezingGroupSelector}`).length > 0;\r\n const isShowScrollbar = getBarParent().css('opacity') === '1';\r\n\r\n if (!isMouseInside || !isShowScrollbar) return;\r\n\r\n let offset;\r\n if (e.shiftKey) {\r\n offset = prevOffset + e.originalEvent.deltaY;\r\n } else if (Math.abs(e.originalEvent.deltaX) > 0) {\r\n offset = prevOffset + e.originalEvent.deltaX;\r\n } else {\r\n return;\r\n }\r\n\r\n const cWidth = $(otherSelector).width();\r\n const pWidth = $(otherGroupSelector).width();\r\n offset = Math.max(0, offset);\r\n offset = Math.min(cWidth - pWidth, offset);\r\n\r\n setHorizontalOffset(offset);\r\n e.preventDefault();\r\n }\r\n\r\n function addHorizontalScrollEvent() {\r\n const el = document.querySelector(tableSelector);\r\n if (el) {\r\n const scrollEvent = result($._data(el, 'events'), 'wheel');\r\n if (isUndefined(scrollEvent)) {\r\n $(el).on('wheel', horizontalScrollHandler);\r\n }\r\n }\r\n }\r\n\r\n // Add Scrollbar View into the grid footer\r\n const scrollbarView = new ScrollbarView({\r\n freezingSelector,\r\n otherSelector,\r\n scrollbarParentSelector,\r\n calculateOtherHorizontalOffset,\r\n }).render();\r\n\r\n gridView.prependFootRows([{\r\n classes: ['noborder', 'scrollbar'],\r\n view: scrollbarView,\r\n }]);\r\n\r\n // Listen event\r\n gridView.on('didUpdate', () => {\r\n calculateParentWidth();\r\n calculateChildWidth();\r\n calculateShowOrHide();\r\n calculateScrollbarPosition();\r\n });\r\n\r\n gridView.on('didRedrawHeader', () => {\r\n setHorizontalOffset(prevOffset);\r\n });\r\n\r\n gridView.on('didRedrawFooter', () => {\r\n setHorizontalOffset(prevOffset);\r\n });\r\n\r\n // grid body did redraw\r\n const lazyAddScrollRowEvent = debounce(addScrollRowEvent, 500);\r\n gridView.on('didRedrawBody', () => {\r\n setHorizontalOffset(prevOffset);\r\n lazyAddScrollRowEvent();\r\n addHorizontalScrollEvent();\r\n });\r\n\r\n // save the offset. this value will help to scroll the inline editing popup\r\n gridView.on('willEdit', () => {\r\n prevOffsetWillEditing = getBarParent().scrollLeft();\r\n });\r\n gridView.on('willShowLabelsPopup', () => {\r\n prevOffsetWillEditing = getBarParent().scrollLeft();\r\n });\r\n\r\n // scroll the vertical scrollbar\r\n const lazycalculateScrollbarPosition = debounce(calculateScrollbarPosition, 100);\r\n $(pageContainer).scroll(() => {\r\n lazycalculateScrollbarPosition();\r\n });\r\n\r\n // scroll horzatial bar of page container's parent\r\n $(pageContainer).parent().on('scroll', () => {\r\n lazycalculateScrollbarPosition();\r\n });\r\n\r\n // TODO remove event handler when the gridview was destroyed.\r\n // Resize the able-page-container.\r\n // can be triggered by resizing window, expand/collapse table, hide/show main menu.\r\n const lazyResizeCalculate = debounce(() => {\r\n calculateParentWidth();\r\n calculateChildWidth();\r\n calculateShowOrHide();\r\n }, 100);\r\n\r\n if (has(window, 'ResizeObserver')) {\r\n new ResizeObserver(lazyResizeCalculate).observe(document.querySelector(pageContainer));\r\n } else {\r\n new ResizeObserverPollyFill(lazyResizeCalculate).observe(document.querySelector(pageContainer));\r\n }\r\n});\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useEffect, useRef, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { clone } from 'underscore';\r\nimport classnames from 'classnames';\r\nimport Backbone from 'backbone';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport BudgetView from '@bingads-webui-campaign-legacy/budget/view/budget';\r\nimport SharedBudgetView from '@bingads-webui-campaign-legacy/shared-budget/view/shared-budget-switch-editor';\r\nimport '@bingads-webui-campaign/ko-stop-binding';\r\nimport PageContext from '@bingads-webui-static-legacy/page-context';\r\nimport { mergeStyles } from '@bingads-webui-campaign-react/common-styles';\r\n\r\nconst getStyles = (theme, palette = {}) => ({\r\n budgetContainer: {\r\n ...mergeStyles(\r\n { theme },\r\n {\r\n '& .container-budget': {\r\n '& span': {\r\n color: palette.neutralPrimary,\r\n },\r\n '& .form-control-static': {\r\n padding: '9px 0px',\r\n lineHeight: '14px',\r\n minHeight: 'auto',\r\n },\r\n '& .input-group': {\r\n '& .input-group-addon': {\r\n color: '#323130',\r\n border: 0,\r\n padding: '6px',\r\n background: '#ffffff',\r\n },\r\n },\r\n '& .col-sm-3': {\r\n display: 'table',\r\n paddingRight: 0,\r\n paddingLeft: 0,\r\n },\r\n '& .margin-rt-five': {\r\n paddingLeft: 28,\r\n },\r\n\r\n },\r\n '& span.bold': {\r\n fontWeight: 1000,\r\n },\r\n '& .alert-budget-button': {\r\n marginLeft: '10px',\r\n paddingTop: '5px',\r\n '& button': {\r\n color: 'black',\r\n fontSize: '13px',\r\n fontWeight: 500,\r\n borderColor: '#edebe9',\r\n },\r\n },\r\n '& .shared-budget-switch-editor-grid': {\r\n '& .cell-selection': {\r\n '& input': {\r\n outline: 'none !important',\r\n },\r\n },\r\n },\r\n }\r\n ),\r\n },\r\n});\r\n\r\nexport const LegacySharedBudget = React.memo(({\r\n id,\r\n className,\r\n campaignId,\r\n budget,\r\n onChange,\r\n i18n,\r\n validationDailyMinBudget,\r\n hideBudgetMinRecommendation,\r\n noApplyBudgetFromSharedLibrary,\r\n readOnly,\r\n}) => {\r\n const view = useRef();\r\n const viewListener = useMemo(() => clone(Backbone.Events), []);\r\n let container;\r\n\r\n useEffect(() => {\r\n const budgetFactory = SharedBudgetView.newFactory(BudgetView);\r\n const showBudgetMinRecommend = campaignId !== undefined && !hideBudgetMinRecommendation;\r\n const minimumBudget = budget ? budget.Amount * 0.5 : undefined;\r\n\r\n view.current = budgetFactory({\r\n withRealTimeUpdates: true,\r\n model: budget,\r\n campaignId,\r\n isForVNext: true,\r\n hideDailyBudgetOptions: false,\r\n showBudgetMinRecommend,\r\n currencySymbol: i18n.getCurrencySymbol(PageContext.AccountCurrencyCode),\r\n minimumBudget,\r\n validationDailyMinBudget,\r\n showInitialUiBlocker: false,\r\n noApplyBudgetFromSharedLibrary,\r\n showNoSharedBudgetLink: true,\r\n readOnly,\r\n });\r\n\r\n viewListener.listenTo(view.current, 'change', onChange);\r\n view.current.render();\r\n view.current.$el.appendTo(container);\r\n\r\n return () => {\r\n view.current.remove();\r\n };\r\n }, [campaignId]);\r\n\r\n useEffect(() => {\r\n viewListener.stopListening(view.current);\r\n viewListener.listenTo(view.current, 'change', onChange);\r\n\r\n return () => viewListener.stopListening(view.current);\r\n }, [onChange, viewListener]);\r\n\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n return (\r\n \r\n
{ container = ref; }} />\r\n
\r\n );\r\n});\r\n\r\nLegacySharedBudget.propTypes = {\r\n id: PropTypes.string,\r\n className: PropTypes.string,\r\n campaignId: PropTypes.string,\r\n budget: PropTypes.shape({\r\n Amount: PropTypes.number,\r\n }),\r\n onChange: PropTypes.func.isRequired,\r\n i18n: PropTypes.shape({ getCurrencySymbol: PropTypes.func.isRequired }).isRequired,\r\n validationDailyMinBudget: PropTypes.number,\r\n hideBudgetMinRecommendation: PropTypes.bool,\r\n noApplyBudgetFromSharedLibrary: PropTypes.bool,\r\n readOnly: PropTypes.bool,\r\n};\r\n\r\nLegacySharedBudget.defaultProps = {\r\n id: undefined,\r\n className: undefined,\r\n budget: undefined,\r\n campaignId: undefined,\r\n validationDailyMinBudget: undefined,\r\n hideBudgetMinRecommendation: true,\r\n noApplyBudgetFromSharedLibrary: false,\r\n readOnly: false,\r\n};\r\n","import React, { useCallback, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { LegacySharedBudget } from './legacy-shared-budget';\r\n\r\nconst LegacySharedBudgetWithCustomValidation = ({\r\n campaignId, validationProps, updateValidation, ...restProps\r\n}) => {\r\n const { data } = validationProps;\r\n const i18n = useContext(I18nContext);\r\n const activity = useContext(ActivityContext);\r\n\r\n const onChange = useCallback((newData, newIsValid) => {\r\n updateValidation(newIsValid ? [] : [i18n.getString(_TL_('Legacy Budget has validation errors'))], { Budget: newData });\r\n if (activity) {\r\n // signal activity to parent\r\n activity.signal(`onLegacySharedBudgetChange - ${JSON.stringify(newData)} - isValid: ${newIsValid}}`);\r\n }\r\n }, [i18n, updateValidation, activity]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nLegacySharedBudgetWithCustomValidation.propTypes = {\r\n campaignId: PropTypes.string.isRequired,\r\n validationProps: PropTypes.shape({\r\n data: PropTypes.shape({\r\n Budget: PropTypes.shape({\r\n Amount: PropTypes.number,\r\n }),\r\n }),\r\n }).isRequired,\r\n updateValidation: PropTypes.func.isRequired,\r\n};\r\n\r\nexport const ValidatedLegacySharedBudget = withCustomValidation(LegacySharedBudgetWithCustomValidation);\r\n\r\n","import _ from 'underscore';\r\n\r\nexport const getBudgetTitleDetails = (serverContext, i18n, budget) => {\r\n const currencyCode = serverContext.CurrentAccount.CurrencyCode;\r\n const amount = _.isNumber(budget && budget.Amount) ?\r\n i18n.formatCurrency(budget.Amount, currencyCode) :\r\n '-';\r\n return i18n.getString(_TL_('{{amount}} per day'), {\r\n amount,\r\n });\r\n};\r\n","export const UpgradeUrlStringMap = {\r\n Ad_DestinationUrl: _TL_('Destination URL'),\r\n Ad_FinalUrl: _TL_('Final URL'),\r\n BulkEdit_UrlOptions_CustomParameters_AddAnother: _TL_('Add another'),\r\n BulkEdit_UrlOptions_CustomParameters_InputAriaLabel: _TL_('Custom parameters {{key}} number {{number}}'),\r\n BulkEdit_UrlOptions_CustomParameters_MatchCase: _TL_('Match case'),\r\n BulkEdit_UrlOptions_CustomParameters_RemoveLineNumber: _TL_('Remove custom parameters number {{number}}'),\r\n BulkEdit_UrlOptions_UpgradeWarning: _TL_('You are about to upgrade this entity to use Final URL. '),\r\n Cancel: _TL_('Cancel'),\r\n CustomParameters_Placeholder_Key: _TL_('name'),\r\n CustomParameters_Placeholder_Value: _TL_('value'),\r\n ErrorNumber_UniqueCustomParameterNames: _TL_('Custom parameter names must be unique.'),\r\n Error_Campaign_API_FinalUrlRequiredWhenUsingMobileFinalUrl: _TL_('In order to use a mobile URL a final URL must also be used.'),\r\n Error_Campaign_API_InvalidCharactersInKey: _TL_('The name of a custom parameter can only contain alphanumeric characters (e.g., 0-9 a-z A-Z).'),\r\n Error_Campaign_API_InvalidCharactersInValue: _TL_('Value contains invalid characters.'),\r\n Error_Campaign_API_InvalidTag: _TL_('Value contains invalid tag.'),\r\n Error_Campaign_API_InvalidUrlScheme: _TL_('The URL entered is invalid. A valid URL must start with http:// or https:// or {lpurl} or {unescapedlpurl}.'),\r\n Error_Campaign_API_KeyNullOrEmpty: _TL_('Custom parameter requires a name.'),\r\n FinalUrlSuffix_Example: _TL_('Example: param1=values1¶m2=value2'),\r\n FinalUrlSuffix_Label: _TL_('Final URL suffix'),\r\n FinalUrl_Label: _TL_('Final URL (recommended)'),\r\n Input_NoChange_PlaceHolder: _TL_(''),\r\n LandingPage_Label: _TL_('Landing page'),\r\n LearnMore: _TL_('Learn more'),\r\n MobileFinalUrl_Label: _TL_('Mobile URL'),\r\n Save: _TL_('Save'),\r\n TrackingTemplate_Example: _TL_('Example: http://www.trackingtool.com/tracking?url={lpurl}&type=1 '),\r\n TrackingTemplate_Label: _TL_('Tracking template'),\r\n UpgradedUrl_Placeholder_FinalUrlSuffix: _TL_('Enter a Final URL suffix'),\r\n UrlOptions_None: _TL_('None'),\r\n};\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport * as url from '@bingads-webui/url-util';\r\n\r\nexport default class ViewModel {\r\n constructor({\r\n trackingTemplate,\r\n i18n,\r\n editMode,\r\n showUurlTestTool,\r\n }) {\r\n this.editMode = ko.observable(editMode);\r\n\r\n this.maxLength = 2048;\r\n\r\n this.trackingTemplate = ko.observable(trackingTemplate);\r\n\r\n this.inputClass = showUurlTestTool ? ['with-test-button form-control'] : ['full-width form-control'];\r\n\r\n this.validate = (newTrackingTemplate) => {\r\n let errorList = [];\r\n if (!url.hasScheme(newTrackingTemplate) &&\r\n !_.find(\r\n ['{lpurl}', '{unescapedlpurl}'],\r\n tag => newTrackingTemplate.indexOf(tag) === 0\r\n )) {\r\n errorList = _.union(errorList, [i18n.getString('Error_Campaign_API_InvalidUrlScheme')]);\r\n }\r\n\r\n return errorList;\r\n };\r\n\r\n this.errorMessages = ko.computed(() => {\r\n if (this.trackingTemplate()) {\r\n return this.validate(this.trackingTemplate());\r\n }\r\n return [];\r\n });\r\n\r\n this.showNone = ko.computed(() => !this.editMode() && !this.trackingTemplate());\r\n\r\n this.isValid = ko.computed(() => !this.errorMessages().length, this);\r\n }\r\n}\r\n","import { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport tmpl from './template.pug';\r\nimport ViewModel from './viewmodel';\r\n\r\nexport class TrackingTemplateView extends PureKnockoutView {\r\n /**\r\n * Initilize tracking template view settings\r\n *\r\n * @param {Object} param - An object containing these default options for view:\r\n * @param {Object} param.i18n - the localization settings\r\n * @param {Object} param.i18n.getString - localization settings function\r\n * @param {boolean} param.editMode - whether the view is in edit mode, default true\r\n * @param {function} param.template - template for the view, by default using tmpl\r\n * @param {String} param.trackingTemplate - tracking template\r\n * @param {String[]} param.errorMessages - error messages to show\r\n * @returns {void} void\r\n */\r\n initialize({\r\n i18n,\r\n editMode = true,\r\n template = tmpl,\r\n trackingTemplate,\r\n showUurlTestTool = false,\r\n }) {\r\n this.options = {\r\n i18n,\r\n editMode,\r\n trackingTemplate,\r\n template,\r\n showUurlTestTool,\r\n };\r\n\r\n super.initialize(this.options);\r\n\r\n this.viewModel.trackingTemplate.subscribe(() => {\r\n this.trigger('trackingTemplate:updated', { isValid: this.isValid(), trackingTemplate: this.getTrackingTemplate() });\r\n }, this);\r\n }\r\n\r\n get template() {\r\n return () => this.options.template({ i18n: this.options.i18n });\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n /**\r\n * Set edit mode\r\n * @param {boolean} isEdit - whether to set to edit (false to be read mode)\r\n *\r\n * @returns {void} void\r\n */\r\n setEditMode(isEdit) {\r\n this.viewModel.editMode(isEdit);\r\n }\r\n\r\n /**\r\n * Set tracking template\r\n * @param {String} trackingTemplate - new values to set\r\n *\r\n * @returns {void} void\r\n */\r\n setTrackingTemplate(trackingTemplate) {\r\n this.viewModel.trackingTemplate(trackingTemplate);\r\n }\r\n\r\n /**\r\n * Get tracking template\r\n *\r\n * @returns {String} tracking template\r\n */\r\n getTrackingTemplate() {\r\n return (this.viewModel.trackingTemplate() || '').trim(); // handle the space\r\n }\r\n\r\n setErrors(errors) {\r\n this.viewModel.errorMessages(errors);\r\n }\r\n\r\n isValid() {\r\n return this.viewModel.isValid();\r\n }\r\n}\r\n\r\n","import ko from 'knockout';\r\n\r\nexport default class InlineEditViewModel {\r\n constructor({\r\n error = '',\r\n isValid = true,\r\n }) {\r\n this.error = ko.observable(error);\r\n\r\n this.isValid = ko.observable(isValid);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport { globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { TrackingTemplateView } from './view';\r\nimport template from '../shared/inline-edit/template.pug';\r\nimport ViewModel from '../shared/inline-edit/viewmodel';\r\n\r\n\r\n/**\r\n * save event - When save button clicked, it fires with the new custom parameters.\r\n * It carries a parameter with format of { trackingTemplate }\r\n * @event TrackingTemplateInlineEditView#save\r\n * @type {Object}\r\n */\r\n\r\n/**\r\n * close event - When cancel button clicked, it fires close event.\r\n *\r\n * @event TrackingTemplateInlineEditView#close\r\n * @type {void}\r\n */\r\n\r\n/**\r\n * TrackingTemplateInlineEditView\r\n * will disable save button when input invalid\r\n *\r\n * @fires TrackingTemplateInlineEditView#save\r\n * @fires TrackingTemplateInlineEditView#close\r\n */\r\nexport class TrackingTemplateInlineEditView extends PureKnockoutView {\r\n /**\r\n * Initilize tracking template view settings\r\n *\r\n * @param {Object} param - An object containing these default options for view:\r\n * @param {Object} param.i18n - the localization settings\r\n * @param {Object} param.i18n.getString - localization settings function\r\n * @param {String} param.trackingTemplate - tracking template\r\n * @returns {void} void\r\n */\r\n initialize({\r\n i18n,\r\n trackingTemplate,\r\n showUurlTestTool,\r\n isForVNext,\r\n deps = null,\r\n }) {\r\n super.initialize({ i18n, trackingTemplate });\r\n\r\n this.i18n = i18n;\r\n this.trackingTemplateView = new TrackingTemplateView({\r\n i18n,\r\n editMode: true,\r\n trackingTemplate,\r\n showUurlTestTool,\r\n });\r\n\r\n this.trackingTemplateView.on('trackingTemplate:updated', ({ isValid }) => {\r\n this.viewModel.isValid(isValid);\r\n });\r\n\r\n this.viewModel.isValid(this.trackingTemplateView.isValid());\r\n\r\n this.setChild('childView', this.trackingTemplateView);\r\n\r\n if (showUurlTestTool) {\r\n let UurlTestToolView;\r\n\r\n // TODO: refactor this part later\r\n try {\r\n UurlTestToolView = globalContext.require('component/upgraded-url/view/urlTestTool');\r\n } catch (e) {\r\n if (deps) {\r\n UurlTestToolView = deps.uurlTestToolView;\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n if (UurlTestToolView) {\r\n setTimeout(() => {\r\n const urlTestTool = new UurlTestToolView({\r\n urlTestToolStatusContainer: this.$('.uurl-test-info__container'),\r\n isForVNext,\r\n });\r\n\r\n this.$('.uurl-test-tool__container').empty().append(urlTestTool.render().el);\r\n urlTestTool.on('testUurl', (fn, originalView) => {\r\n this.trigger('testUurl', fn, originalView);\r\n });\r\n }, 50);\r\n }\r\n }\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .btn-primary': 'save',\r\n 'click .btn-default.grid-popupeditor-cancel': 'cancel',\r\n };\r\n }\r\n\r\n get template() {\r\n return ({ model }) => template({ model, i18n: this.i18n });\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n /**\r\n * Fires save event after click save button\r\n *\r\n * @fires TrackingTemplateInlineEditView#save\r\n * @returns {void}\r\n */\r\n save() {\r\n this.trigger('save', { trackingTemplate: this.trackingTemplateView.getTrackingTemplate() });\r\n }\r\n\r\n /**\r\n * Fires close event after click cancel button\r\n *\r\n * @fires TrackingTemplateInlineEditView#close\r\n * @returns {void}\r\n */\r\n cancel() {\r\n this.trigger('close');\r\n }\r\n\r\n setErrors(errors) {\r\n if (errors && !_.isEmpty(errors) && _.isObject(errors)) {\r\n this.viewModel.error(errors[_.keys(errors)[0]]);\r\n } else {\r\n this.viewModel.error('');\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\n\r\nexport default class ViewModel {\r\n constructor({\r\n finalUrlSuffix,\r\n i18n,\r\n editMode,\r\n showPlaceholder = false,\r\n }) {\r\n this.editMode = ko.observable(editMode);\r\n\r\n this.maxLength = 1024;\r\n\r\n this.finalUrlSuffix = ko.observable(finalUrlSuffix);\r\n\r\n this.validate = (newFinalUrlSuffix) => {\r\n if (this.externalErrors) {\r\n this.externalErrors([]);\r\n }\r\n let errorList = [];\r\n const invalidFirstChars = ['#', '?', '&'];\r\n const firstChar = _.first(newFinalUrlSuffix);\r\n\r\n if (_.contains(invalidFirstChars, firstChar) || /\\s|\\r|\\n/g.test(newFinalUrlSuffix)) {\r\n errorList = _.union(errorList, [i18n.getString('Error_Campaign_API_InvalidCharactersInValue')]);\r\n }\r\n\r\n // Parameters reserved for tracking template can not be used here.\r\n if (_.find(\r\n ['{lpurl}',\r\n '{lpurl+2}',\r\n '{lpurl+3}',\r\n '{unescapedlpurl}',\r\n '{ignore}',\r\n '{escapedlpurl}',\r\n '{escapedlpurl+2}',\r\n '{escapedlpurl+3}',\r\n '{ignore}',\r\n ],\r\n tag => newFinalUrlSuffix.indexOf(tag) === 0\r\n )) {\r\n errorList = _.union(errorList, [i18n.getString('Error_Campaign_API_InvalidTag')]);\r\n }\r\n\r\n return errorList;\r\n };\r\n\r\n this.errorMessages = ko.computed(() => {\r\n if (this.finalUrlSuffix()) {\r\n return this.validate(this.finalUrlSuffix());\r\n }\r\n return [];\r\n });\r\n\r\n this.externalErrors = ko.observableArray();\r\n\r\n this.showNone = ko.computed(() => !this.editMode() && !this.finalUrlSuffix());\r\n\r\n this.isValid = ko.computed(() => !this.errorMessages().length, this);\r\n\r\n this.placeholderText = showPlaceholder ? i18n.getString('UpgradedUrl_Placeholder_FinalUrlSuffix') : '';\r\n }\r\n}\r\n","import { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport tmpl from './template.pug';\r\nimport ViewModel from './viewmodel';\r\n\r\nexport class FinalUrlSuffixView extends PureKnockoutView {\r\n /**\r\n * Initilize final url suffix view\r\n *\r\n * @param {Object} param - An object containing these default options for view:\r\n * @param {Object} param.i18n - the localization\r\n * @param {Object} param.i18n.getString - localization function\r\n * @param {boolean} param.editMode - whether the view is in edit mode, default true\r\n * @param {function} param.template - template for the view, by default using tmpl\r\n * @param {String} param.finalUrlSuffix - final url suffix\r\n * @param {String[]} param.errorMessages - error messages to show\r\n * @returns {void} void\r\n */\r\n initialize({\r\n i18n,\r\n editMode = true,\r\n template = tmpl,\r\n finalUrlSuffix,\r\n showPlaceholder = false,\r\n readOnly = false,\r\n }) {\r\n this.options = {\r\n i18n,\r\n editMode,\r\n finalUrlSuffix,\r\n template,\r\n showPlaceholder,\r\n readOnly,\r\n };\r\n\r\n super.initialize(this.options);\r\n\r\n this.viewModel.finalUrlSuffix.subscribe(() => {\r\n this.trigger('finalUrlSuffix:updated', { isValid: this.isValid(), finalUrlSuffix: this.getFinalUrlSuffix() });\r\n }, this);\r\n }\r\n\r\n get template() {\r\n return () => this.options.template({ i18n: this.options.i18n, readOnly: this.options.readOnly });\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n /**\r\n * Set edit mode\r\n * @param {boolean} isEdit - whether to set to edit (false to be read mode)\r\n *\r\n * @returns {void} void\r\n */\r\n setEditMode(isEdit) {\r\n this.viewModel.editMode(isEdit);\r\n }\r\n\r\n /**\r\n * Set final url suffix\r\n * @param {String} finalUrlSuffix - new values to set\r\n *\r\n * @returns {void} void\r\n */\r\n setFinalUrlSuffix(finalUrlSuffix) {\r\n this.viewModel.finalUrlSuffix(finalUrlSuffix);\r\n }\r\n\r\n /**\r\n * Get final url suffix\r\n *\r\n * @returns {String} final url suffix\r\n */\r\n getFinalUrlSuffix() {\r\n return (this.viewModel.finalUrlSuffix() || '').trim(); // handle the space\r\n }\r\n\r\n setErrors(errors) {\r\n this.viewModel.externalErrors(errors);\r\n }\r\n\r\n isValid() {\r\n return this.viewModel.isValid();\r\n }\r\n}\r\n\r\n","import _ from 'underscore';\r\nimport { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport { FinalUrlSuffixView } from './view';\r\nimport template from '../shared/inline-edit/template.pug';\r\nimport ViewModel from '../shared/inline-edit/viewmodel';\r\n\r\n/**\r\n * save event - When save button clicked, it fires with the new final url suffix.\r\n * It carries a parameter with format of { finalUrlSuffix }\r\n * @event FinalUrlSuffixInlineEditView#save\r\n * @type {Object}\r\n */\r\n\r\n/**\r\n * close event - When cancel button clicked, it fires close event.\r\n *\r\n * @event FinalUrlSuffixInlineEditView#close\r\n * @type {void}\r\n */\r\n\r\n/**\r\n * FinalUrlSuffixInlineEditView\r\n * will disable save button when input invalid\r\n *\r\n * @fires FinalUrlSuffixInlineEditView#save\r\n * @fires FinalUrlSuffixInlineEditView#close\r\n */\r\nexport class FinalUrlSuffixInlineEditView extends PureKnockoutView {\r\n /**\r\n * Initilize final url suffix\r\n *\r\n * @param {Object} param - An object containing these default options for view:\r\n * @param {Object} param.i18n - the localization settings\r\n * @param {Object} param.i18n.getString - localization settings function\r\n * @param {String} param.finalUrlSuffix - final url suffix\r\n * @returns {void} void\r\n */\r\n initialize({\r\n i18n,\r\n finalUrlSuffix,\r\n }) {\r\n super.initialize({ i18n, finalUrlSuffix });\r\n this.i18n = i18n;\r\n this.finalUrlSuffixView = new FinalUrlSuffixView({\r\n i18n,\r\n editMode: true,\r\n finalUrlSuffix,\r\n });\r\n\r\n this.finalUrlSuffixView.on('finalUrlSuffix:updated', ({ isValid }) => {\r\n this.viewModel.isValid(isValid);\r\n });\r\n\r\n this.viewModel.isValid(this.finalUrlSuffixView.isValid());\r\n\r\n this.setChild('childView', this.finalUrlSuffixView);\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .btn-primary': 'save',\r\n 'click .btn-default': 'cancel',\r\n };\r\n }\r\n\r\n get template() {\r\n return ({ model }) => template({ model, i18n: this.i18n });\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n /**\r\n * Fires save event after click save button\r\n *\r\n * @fires FinalUrlSuffixInlineEditView#save\r\n * @returns {void}\r\n */\r\n save() {\r\n this.trigger('save', { finalUrlSuffix: this.finalUrlSuffixView.getFinalUrlSuffix() });\r\n }\r\n\r\n /**\r\n * Fires close event after click cancel button\r\n *\r\n * @fires FinalUrlSuffixInlineEditView#close\r\n * @returns {void}\r\n */\r\n cancel() {\r\n this.trigger('close');\r\n }\r\n\r\n setErrors(errors) {\r\n if (errors && !_.isEmpty(errors) && _.isObject(errors)) {\r\n this.viewModel.error(errors[_.keys(errors)[0]]);\r\n } else {\r\n this.viewModel.error('');\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport $ from 'jquery';\r\n\r\nclass Parameter {\r\n constructor({ Key, Value, i18n }) {\r\n this.key = ko.observable(Key);\r\n this.val = ko.observable(Value);\r\n this.isValid = ko.observable(true);\r\n this.errorMessages = ko.computed(() => {\r\n const invalidChars = ['#', '/', ' '];\r\n const errors = [];\r\n const key = this.key();\r\n const value = this.val();\r\n\r\n if (value && !key) {\r\n errors.push(i18n.getString('Error_Campaign_API_KeyNullOrEmpty'));\r\n }\r\n if (_.some(invalidChars, c => _.contains(key, c))) {\r\n errors.push(i18n.getString('Error_Campaign_API_InvalidCharactersInKey'));\r\n }\r\n if (/\\s/.test(value)) { // Validate value against white spaces\r\n errors.push(i18n.getString('Error_Campaign_API_InvalidCharactersInValue'));\r\n }\r\n this.isValid(!errors.length);\r\n return errors;\r\n });\r\n }\r\n}\r\n\r\nexport default class CustomParams {\r\n constructor({\r\n customParameters = [],\r\n bulkEditMode,\r\n editMode,\r\n bulkEditShowAddLabel,\r\n bulkEditShowMatchCase,\r\n i18n,\r\n permissions,\r\n entityType,\r\n forceUseIncreasedCount,\r\n readOnly,\r\n }) {\r\n const params = customParameters;\r\n\r\n const paramsInitialLength = 1;\r\n while (params.length < paramsInitialLength) {\r\n params.push({\r\n Key: undefined,\r\n Value: undefined,\r\n });\r\n }\r\n\r\n this.bulkEditMode = bulkEditMode;\r\n\r\n this.editMode = ko.observable(editMode);\r\n\r\n this.isDisabled = ko.observable(false || readOnly);\r\n\r\n this.bulkEditShowAddLabel = ko.observable(bulkEditShowAddLabel);\r\n\r\n this.bulkEditShowMatchCase = ko.observable(bulkEditShowMatchCase);\r\n\r\n this.bulkEditMatchCaseSelected = ko.observable(false);\r\n\r\n let useIncreasedCount = !!forceUseIncreasedCount;\r\n\r\n if (!useIncreasedCount) {\r\n // Temporary check for MT staged release. Will remove after feature GA.\r\n const entityTypeLower = !entityType ? '' : entityType.toLowerCase();\r\n\r\n if (entityTypeLower === 'phase1entity' || entityTypeLower === 'campaign' || entityTypeLower === 'adgroup' || entityTypeLower === 'keyword' ||\r\n entityTypeLower === 'ad' || entityTypeLower === 'audience' || entityTypeLower === 'autotarget' || entityTypeLower === 'productgroup') {\r\n useIncreasedCount = true;\r\n } else {\r\n useIncreasedCount = permissions.IsCustomParameterCountIncreasePhase3Enabled;\r\n }\r\n }\r\n\r\n this.maxParameterCount = useIncreasedCount ? 8 : 3;\r\n this.valueMaxLength = ko.observable(useIncreasedCount ? 250 : 200);\r\n\r\n this.addCustomParamEntry = () => {\r\n this.parameters.push(new Parameter({\r\n Key: undefined,\r\n Value: undefined,\r\n i18n,\r\n }));\r\n $('.custom-param__key-field').last().focus();\r\n };\r\n\r\n this.removeCustomParamEntry = (index) => {\r\n this.parameters.splice(index, 1);\r\n };\r\n\r\n this.getInputAriaLabel = (index, isKey = true) => {\r\n const key = isKey ? i18n.getString('CustomParameters_Placeholder_Key') : i18n.getString('CustomParameters_Placeholder_Value');\r\n\r\n return (i18n.getString('BulkEdit_UrlOptions_CustomParameters_InputAriaLabel') || '').replace('{{key}}', key).replace('{{number}}', index + 1);\r\n };\r\n\r\n this.getRemoveButtonAriaLabel = index => (i18n.getString('BulkEdit_UrlOptions_CustomParameters_RemoveLineNumber') || '').replace('{{number}}', index + 1);\r\n\r\n this.parameters = ko.observableArray(_.map(params, p => new Parameter(_.extend({ i18n }, p))));\r\n\r\n this.showAddLable = ko.computed(() =>\r\n this.editMode() &&\r\n this.bulkEditShowAddLabel() &&\r\n this.parameters().length < this.maxParameterCount);\r\n\r\n this.errorMessages = ko.computed(() => {\r\n if (this.parametersError) {\r\n this.parametersError([]);\r\n }\r\n let keys = _.compact(_.invoke(this.parameters(), 'key'));\r\n keys = _.map(keys, key => key.toLowerCase());\r\n return _.unique(keys).length !== keys.length ?\r\n [i18n.getString('ErrorNumber_UniqueCustomParameterNames')] :\r\n '';\r\n });\r\n\r\n this.parameterArray = ko.computed(() => _.map(this.parameters(), param => ({\r\n Key: param.key(),\r\n Value: param.val(),\r\n })));\r\n\r\n this.parametersError = ko.observableArray();\r\n\r\n this.isValid = ko.computed(() => {\r\n if (this.parametersError) {\r\n this.parametersError([]);\r\n }\r\n return !this.errorMessages().length &&\r\n _.find(this.parameters(), p => p.errorMessages().length) === undefined;\r\n });\r\n\r\n this.showNone = ko.computed(() => !this.editMode() &&\r\n !_.find(this.parameters(), p => p.key() || p.val()));\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport tmplBulkEdit from './template.pug';\r\nimport ViewModel from './viewmodel';\r\n\r\n/**\r\n * CustomParametersView\r\n * Trigger event customParameters:updated when user input update\r\n */\r\nexport class CustomParametersView extends PureKnockoutView {\r\n /**\r\n * Initilize custom prameters view settings\r\n *\r\n * @param {Object} param - An object containing these default options for view:\r\n * @param {Object} param.i18n - the localization settings\r\n * @param {Object} param.i18n.getString - localization settings function\r\n * @param {boolean} param.editMode - whether the view is in edit mode, default true\r\n * @param {boolean} param.bulkEditMode - whether in bulk edit mode, default false\r\n * @param {boolean} param.bulkEditShowAddLabel - whether show add label,\r\n * only valid in bulk edit mode\r\n * @param {boolean} param.bulkEditShowMatchCase - whether show match case option,\r\n * only valid in bulk edit mode\r\n * @param {String[]} param.errorMessages - error messages to show\r\n * @param {Object[]} param.customParameters - initial custom params,\r\n * in the format of {Key, Value}\r\n * @param {boolean} param.forceUseIncreasedCount - if `true`, will disregard the pilot flags and\r\n * use the increased number of custom parameters. Otherwise, will follow the current\r\n * pilot+entityType logic to determine the enablement of the increased count.\r\n * @returns {void} void\r\n */\r\n initialize({\r\n i18n,\r\n editMode = true,\r\n bulkEditMode = false,\r\n bulkEditShowAddLabel = true,\r\n bulkEditShowMatchCase = false,\r\n errorMessages,\r\n customParameters = [],\r\n permissions,\r\n entityType,\r\n forceUseIncreasedCount,\r\n withRealTimeUpdates = false,\r\n readOnly = false,\r\n }) {\r\n this.options = {\r\n i18n,\r\n editMode,\r\n bulkEditMode,\r\n bulkEditShowAddLabel,\r\n bulkEditShowMatchCase,\r\n customParameters,\r\n template: tmplBulkEdit,\r\n errorMessages,\r\n permissions,\r\n entityType,\r\n forceUseIncreasedCount,\r\n readOnly,\r\n };\r\n\r\n super.initialize(this.options);\r\n\r\n // trigger customParameters:updated when user input update\r\n // isValid is computed based on customerParameters\r\n this.viewModel.isValid.subscribe(() => {\r\n this.trigger('customParameters:updated', { isValid: this.isValid(), customParameters: this.getValues() });\r\n }, this);\r\n\r\n if (withRealTimeUpdates) {\r\n this.viewModel.parameterArray.subscribe((val) => {\r\n const newVal = _.filter(val, item => !_.isEmpty(item.Key) || !_.isEmpty(item.Value));\r\n\r\n this.trigger('change:customParameters', { isValid: this.isValid(), customParameters: newVal });\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Go to add replace mode, only meaningful in bulk edit mode\r\n * It will hide 'match case' option, and show 'add another' link\r\n *\r\n * @returns {void} void\r\n */\r\n goToAddReplaceMode() {\r\n // those two only used in bulk edit mode\r\n this.viewModel.bulkEditShowAddLabel(true);\r\n this.viewModel.bulkEditShowMatchCase(false);\r\n }\r\n\r\n /**\r\n * Go to add remove mode, only meaningful in bulk edit mode\r\n * It will show 'match case' option, and hide 'add another' link\r\n * It will also only show the first parameter\r\n *\r\n * @returns {void} void\r\n */\r\n goToRemoveMode() {\r\n this.viewModel.bulkEditShowAddLabel(false);\r\n this.viewModel.bulkEditShowMatchCase(true);\r\n if (this.options.bulkEditMode) {\r\n this.viewModel.parameters(this.viewModel.parameters.slice(0, 1));\r\n }\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n get template() {\r\n return () => this.options.template({\r\n i18n: this.options.i18n,\r\n bulkEditMode: this.options.bulkEditMode,\r\n });\r\n }\r\n\r\n /**\r\n * Set edit mode\r\n * @param {boolean} isEdit - whether to set to edit (false to be read mode)\r\n *\r\n * @returns {void} void\r\n */\r\n setEditMode(isEdit) {\r\n this.viewModel.editMode(isEdit);\r\n }\r\n\r\n /**\r\n * set Disabled value\r\n * @param {boolean} disabled - whether to set to disabled (false to be editable mode)\r\n *\r\n * @returns {void} void\r\n */\r\n setDisabled(disabled) {\r\n this.viewModel.isDisabled(disabled);\r\n }\r\n\r\n isValid() {\r\n return this.viewModel.isValid();\r\n }\r\n\r\n /**\r\n * Get custom parameters values\r\n * @param {boolean} separatedKeyValueProperties - whether to seperate key value properties\r\n * when true, return result as format of [{Key:name, Value: value}]\r\n * when false, else return it as [{name:value}] format.\r\n * For bulk edit mode, it will return them as {params, matchCase};\r\n *\r\n * @returns {Object} parameters value\r\n */\r\n getValues(separatedKeyValueProperties) {\r\n const list = [];\r\n _.each(this.viewModel.parameters(), (p) => {\r\n const key = p.key();\r\n\r\n if (key) {\r\n const item = {};\r\n let val = p.val();\r\n\r\n if (val === undefined) {\r\n val = '';\r\n }\r\n if (separatedKeyValueProperties) {\r\n item.Key = key;\r\n item.Value = val;\r\n } else {\r\n item[key] = val;\r\n }\r\n list.push(item);\r\n }\r\n });\r\n\r\n if (this.options.bulkEditMode) {\r\n return {\r\n params: list,\r\n matchCase: this.viewModel.bulkEditMatchCaseSelected(),\r\n };\r\n }\r\n return list;\r\n }\r\n}\r\n\r\n","import _ from 'underscore';\r\nimport { PureKnockoutView } from '@bingads-webui/knockout-view';\r\nimport { CustomParametersView } from './view';\r\nimport template from '../shared/inline-edit/template.pug';\r\nimport ViewModel from '../shared/inline-edit/viewmodel';\r\n\r\n/**\r\n * save event - When save button clicked, it fires with the new custom parameters.\r\n * It carries a parameter in the format of [{Key, Value}]\r\n * @event CustomParameterInlineEditView#save\r\n * @type {Array}\r\n */\r\n\r\n/**\r\n * close event - When cancel button clicked, it fires close event.\r\n *\r\n * @event CustomParameterInlineEditView#close\r\n * @type {void}\r\n */\r\n\r\n/**\r\n * CustomParameterInlineEditView\r\n *\r\n *\r\n * @fires CustomParameterInlineEditView#save\r\n * @fires CustomParameterInlineEditView#close\r\n */\r\nexport class CustomParameterInlineEditView extends PureKnockoutView {\r\n /**\r\n * Initilize view settings\r\n *\r\n * @param {Object} param - An object containing these default options for view:\r\n * @param {Object} param.i18n - the localization settings\r\n * @param {Object} param.i18n.getString - localization settings function\r\n * @param {Object[]} param.customParameters - initial custom params,\r\n * in the format of {Key, Value}\r\n * @returns {void} void\r\n */\r\n initialize({\r\n i18n,\r\n customParameters,\r\n permissions,\r\n entityType,\r\n }) {\r\n super.initialize({ i18n, customParameters });\r\n\r\n this.i18n = i18n;\r\n this.customPramsView = new CustomParametersView({\r\n i18n,\r\n editMode: true,\r\n customParameters,\r\n permissions,\r\n entityType,\r\n });\r\n\r\n this.customPramsView.on('customParameters:updated', ({ isValid }) => {\r\n this.viewModel.isValid(isValid);\r\n });\r\n\r\n this.viewModel.isValid(this.customPramsView.isValid());\r\n\r\n this.setChild('childView', this.customPramsView);\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .btn-primary': 'save',\r\n 'click .btn-default': 'cancel',\r\n };\r\n }\r\n\r\n get template() {\r\n return ({ model }) => template({ model, i18n: this.i18n });\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n /**\r\n * Fires save event after click save button\r\n *\r\n * @fires CustomParameterInlineEditView#save\r\n * @returns {void}\r\n */\r\n save() {\r\n this.trigger('save', { customParams: this.customPramsView.getValues(true) });\r\n }\r\n\r\n /**\r\n * Fires close event after click cancel button\r\n *\r\n * @fires CustomParameterInlineEditView#close\r\n * @returns {void}\r\n */\r\n cancel() {\r\n this.trigger('close');\r\n }\r\n\r\n setErrors(errors) {\r\n if (errors && !_.isEmpty(errors) && _.isObject(errors)) {\r\n this.viewModel.error(errors[_.keys(errors)[0]]);\r\n } else {\r\n this.viewModel.error('');\r\n }\r\n }\r\n}\r\n","import ko from 'knockout';\r\n\r\nexport class ViewModel {\r\n constructor(options) {\r\n this.isFinalUrl = ko.observable(options.isFinal);\r\n\r\n this.isFinalUrl.Editing = ko.computed({\r\n read: () => this.isFinalUrl().toString(),\r\n write: newValue => this.isFinalUrl(newValue === 'true'),\r\n }, this);\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\nimport finalUrlTemplate from './final-url-template.pug';\r\nimport { ViewModel } from './final-url-viewmodel';\r\n\r\nexport class FinalUrlView extends Backbone.View {\r\n initialize(options = {}) {\r\n this.options = options;\r\n _.defaults(this.options, {\r\n template: finalUrlTemplate,\r\n isFinal: true,\r\n });\r\n this.ko_model = new ViewModel(this.options);\r\n\r\n this.ko_model.isFinalUrl.subscribe((newValue) => {\r\n if (newValue === true) {\r\n this.trigger('finalUrlSelected');\r\n } else {\r\n this.trigger('destinationUrlSelected');\r\n }\r\n });\r\n }\r\n\r\n render() {\r\n this.$el.html(finalUrlTemplate({\r\n i18n: this.options.i18n,\r\n }));\r\n\r\n ko.applyBindings(this.ko_model, this.el);\r\n return this;\r\n }\r\n\r\n getValues() {\r\n return {\r\n isFinal: this.ko_model.isFinalUrl(),\r\n };\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\nconst urlRegex = new RegExp('^(http|https)(://)(.+)', 'i');\r\n\r\nexport class ViewModel {\r\n constructor(options) {\r\n this.maxFullUrlLength = options.maxFullUrlLength || 2048;\r\n this.protocols = [{\r\n Value: 'https',\r\n Text: 'https://',\r\n }, {\r\n Value: 'http',\r\n Text: 'http://',\r\n }];\r\n\r\n // MT strips off the protocol from the destination URLs\r\n // adding a hack for now to add the protocol back to the url\r\n if (options.url && options.url.indexOf('http') !== 0) {\r\n options.url = `https://${options.url}`; // eslint-disable-line no-param-reassign\r\n }\r\n\r\n this.errorContainer = ko.observable('');\r\n this.errorMessage = ko.observable('');\r\n this.showErrors = ko.observable(false);\r\n\r\n this.protocol = ko.observable();\r\n this.urlWithoutProtocol = ko.observable();\r\n this.fullUrl = ko.computed({\r\n read: () => {\r\n // if no actual url is entered, then empty string should return\r\n if (!this.urlWithoutProtocol() || _.isEmpty(this.urlWithoutProtocol().trim())) {\r\n return null;\r\n }\r\n\r\n // strip off the protocol from the beginning of\r\n // the url (if any) and update the protocol select\r\n const regexResult = urlRegex.exec(this.urlWithoutProtocol().trim());\r\n if (regexResult) {\r\n this.protocol(regexResult[1]);\r\n this.urlWithoutProtocol(regexResult[3]);\r\n }\r\n\r\n const value = `${this.protocol()}://${this.urlWithoutProtocol().trim()}`;\r\n return value;\r\n },\r\n write: (value) => {\r\n // if the input doesn't start with the protocol, it is not valid and we show blank instead.\r\n const regexResult = urlRegex.exec(value);\r\n this.protocol(regexResult ? regexResult[1] : 'https');\r\n this.urlWithoutProtocol(regexResult ? regexResult[3] : '');\r\n },\r\n }, this);\r\n\r\n this.errorContainer(options.errorContainer);\r\n this.fullUrl(options.url);\r\n\r\n this.isDisabled = ko.observable(false);\r\n\r\n this.maxLength = ko.computed(() => (\r\n this.maxFullUrlLength - this.protocol().length - '://'.length\r\n ), this);\r\n\r\n this.hasErrors = ko.observable(false);\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\nimport { ViewModel } from './url-input-viewmodel';\r\nimport urlInputTemplate from './url-input.pug';\r\n\r\nexport class UrlEditorView extends Backbone.View {\r\n initialize(options) {\r\n this.options = options || {};\r\n\r\n _.defaults(this.options, {\r\n template: urlInputTemplate,\r\n urlPlaceholder: '',\r\n errorContainer: '',\r\n });\r\n\r\n this.ko_model = new ViewModel(this.options);\r\n\r\n this.ko_model.fullUrl.subscribe((value) => {\r\n this.trigger('urlChanged', value);\r\n }, this);\r\n }\r\n\r\n render() {\r\n this.$el.html(this.options.template({\r\n urlPlaceholder: this.options.urlPlaceholder,\r\n ariaLabelledby: this.options.ariaLabelledby,\r\n }));\r\n\r\n ko.applyBindings(this.ko_model, this.el);\r\n return this;\r\n }\r\n\r\n remove() {\r\n ko.cleanNode(this.el);\r\n super.remove();\r\n return this;\r\n }\r\n\r\n getFullUrl() {\r\n return this.ko_model.fullUrl();\r\n }\r\n\r\n setFullUrl(url) {\r\n return this.ko_model.fullUrl(url);\r\n }\r\n\r\n enable() {\r\n this.ko_model.isDisabled(false);\r\n }\r\n\r\n disable() {\r\n this.ko_model.isDisabled(true);\r\n }\r\n}\r\n","import ko from 'knockout';\r\n\r\nexport class ViewModel {\r\n constructor(options) {\r\n this.mobileUrlVisible = ko.observable(options.isFinal && !options.isMobilePreferred);\r\n this.showTitles = ko.observable(options.showTitles);\r\n this.errorMessages = ko.observableArray();\r\n this.landingPageUrlErrorMessages = ko.observableArray();\r\n this.showUpgradeWarning = ko.observable(false);\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport ko from 'knockout';\r\nimport _ from 'underscore';\r\n\r\nimport { FinalUrlView } from './final-url-view';\r\nimport { UrlEditorView } from './url-input/url-input-view';\r\nimport { ViewModel } from './upgraded-url-viewmodel';\r\nimport template from './upgraded-url.pug';\r\n\r\nexport class UpgradedUrlView extends Backbone.View {\r\n initialize(options = {}) {\r\n this.options = options;\r\n this.i18n = options.i18n;\r\n\r\n _.defaults(this.options, {\r\n template,\r\n isFinal: true,\r\n smallContainer: true,\r\n showTitles: true,\r\n campaignFlow: false,\r\n });\r\n\r\n this.showDestinationUrl = !this.options.disableKeywordDestinationUrl || !this.options.isFinal;\r\n this.ko_model = new ViewModel(this.options);\r\n }\r\n\r\n updateOnDevicePreference() {\r\n this.ko_model.mobileUrlVisible(true);\r\n }\r\n\r\n getValues() {\r\n const isFinal = !this.showDestinationUrl || this.finalUrl.getValues().isFinal;\r\n\r\n return {\r\n url: this.urlEditor.getFullUrl(),\r\n mobileFinalUrl: isFinal ?\r\n this.mobileUrl.ko_model.fullUrl() : null,\r\n isFinal,\r\n };\r\n }\r\n\r\n finalUrlSelected() {\r\n this.updateOnDevicePreference();\r\n this.urlEditor.enable();\r\n if (!this.options.isFinal) {\r\n this.ko_model.showUpgradeWarning(true);\r\n }\r\n\r\n this.isValid();\r\n }\r\n\r\n destinationUrlSelected() {\r\n this.ko_model.mobileUrlVisible(false);\r\n this.ko_model.showUpgradeWarning(false);\r\n if (this.options.disableKeywordDestinationUrl) {\r\n this.urlEditor.setFullUrl(this.options.url);\r\n this.urlEditor.disable();\r\n }\r\n this.isValid();\r\n }\r\n\r\n render() {\r\n this.$el.html(this.options.template({\r\n i18n: this.i18n,\r\n showDestinationUrl: this.showDestinationUrl,\r\n }));\r\n\r\n ko.applyBindings(this.ko_model, this.el);\r\n\r\n if (this.showDestinationUrl) {\r\n this.finalUrl = new FinalUrlView(_.extend({}, this.options, {\r\n el: this.$('.final-url'),\r\n }));\r\n\r\n this.finalUrl.on('finalUrlSelected', this.finalUrlSelected.bind(this));\r\n this.finalUrl.on('destinationUrlSelected', this.destinationUrlSelected.bind(this));\r\n\r\n this.finalUrl.render();\r\n }\r\n\r\n const $url = this.$('.url');\r\n\r\n this.urlEditor = new UrlEditorView({\r\n url: this.options.url,\r\n el: $url,\r\n });\r\n this.urlEditor.on('urlChanged', () => {\r\n this.trigger('finalUrlChanged');\r\n }, this);\r\n this.urlEditor.render();\r\n\r\n if (this.showDestinationUrl && this.options.disableKeywordDestinationUrl) {\r\n this.urlEditor.disable();\r\n }\r\n\r\n this.mobileUrl = new UrlEditorView({\r\n url: this.options.finalMobileUrl,\r\n el: this.$('.mobile-url'),\r\n });\r\n\r\n this.mobileUrl.on('urlChanged', () => {\r\n this.trigger('mobileUrlChanged');\r\n }, this);\r\n this.mobileUrl.render();\r\n\r\n this.$('.url input.url-field').attr('name', 'FinalUrls');\r\n this.$('.mobile-url input.url-field').attr('name', 'MobileFinalUrls');\r\n\r\n this.on('finalUrlChanged', this.isValid);\r\n this.on('mobileUrlChanged', this.isValid);\r\n\r\n return this;\r\n }\r\n\r\n isValid() {\r\n const values = this.getValues();\r\n const errors = [];\r\n const landingPageUrlErrorMessages = [];\r\n\r\n if (values.isFinal && values.mobileFinalUrl && !values.url) {\r\n errors.push(this.i18n.getString('Error_Campaign_API_FinalUrlRequiredWhenUsingMobileFinalUrl'));\r\n }\r\n\r\n this.ko_model.errorMessages(errors);\r\n this.ko_model.landingPageUrlErrorMessages(landingPageUrlErrorMessages);\r\n const errorMessageNotExists = !errors.length && !landingPageUrlErrorMessages.length;\r\n\r\n this.trigger('upgradedUrl:updated', { isValid: errorMessageNotExists });\r\n\r\n return errorMessageNotExists;\r\n }\r\n\r\n remove() {\r\n this.urlEditor.remove();\r\n if (this.finalUrl) {\r\n this.finalUrl.remove();\r\n }\r\n this.mobileUrl.remove();\r\n\r\n super.remove();\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport { DeterministicWrapperView } from '@bingads-webui/deterministic-wrapper-view';\r\nimport { PureKnockoutView } from '@bingads-webui/knockout-view';\r\n\r\nimport template from '../shared/inline-edit/template.pug';\r\nimport { UpgradedUrlView } from './upgraded-url-view';\r\nimport ViewModel from '../shared/inline-edit/viewmodel';\r\n\r\nclass SingleViewWrapper extends DeterministicWrapperView {\r\n initialize(options) {\r\n this.view = options.view;\r\n this.listenTo(this.view, 'all', this.trigger);\r\n this.rendered = true;\r\n }\r\n}\r\n\r\nexport class UpgradedUrlInlineEditView extends PureKnockoutView {\r\n initialize({ i18n, upgradedUrls, permissions }) {\r\n super.initialize({ i18n, upgradedUrls });\r\n this.i18n = i18n;\r\n const disableKeywordDestinationUrl = permissions ?\r\n permissions.IsKeywordDestinationURLDisabled : false;\r\n\r\n this.upgradedUrlView = new UpgradedUrlView({\r\n url: upgradedUrls.url,\r\n finalMobileUrl: upgradedUrls.mobileFinalUrl,\r\n isFinal: upgradedUrls.isFinal,\r\n showTitles: true,\r\n i18n,\r\n disableKeywordDestinationUrl,\r\n });\r\n\r\n this.upgradedUrlView.on('upgradedUrl:updated', ({ isValid }) => {\r\n this.viewModel.isValid(isValid);\r\n });\r\n\r\n this.setChild('childView', new SingleViewWrapper({\r\n view: this.upgradedUrlView.render(),\r\n }));\r\n\r\n // do not show errors before user interaction.\r\n this.viewModel.isValid(this.upgradedUrlView.isValid());\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .btn-primary': 'save',\r\n 'click .btn-default': 'cancel',\r\n };\r\n }\r\n\r\n get template() {\r\n return ({ model }) => template({ model, i18n: this.i18n, customClass: 'upgraded-url-inline-editor' });\r\n }\r\n\r\n get ViewModel() {\r\n return ViewModel;\r\n }\r\n\r\n save() {\r\n this.trigger('save', { upgradedUrls: this.upgradedUrlView.getValues() });\r\n }\r\n\r\n cancel() {\r\n this.trigger('close');\r\n }\r\n\r\n setErrors(errors) {\r\n if (errors && !_.isEmpty(errors) && _.isObject(errors)) {\r\n this.viewModel.error(errors[_.keys(errors)[0]]);\r\n } else {\r\n this.viewModel.error('');\r\n }\r\n }\r\n}\r\n","/* eslint-disable no-mixed-operators */\r\n\r\nimport $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport { focusLockInstanceDecorator } from '@bingads-webui/focus-lock-decorator';\r\nimport controlTemplate from '../template/popup.pug';\r\n\r\nfunction getDimensions(element) {\r\n const $element = $(element);\r\n\r\n return {\r\n width: $element.outerWidth(),\r\n height: $element.outerHeight(),\r\n };\r\n}\r\n\r\nfunction getBoundingRectPosition(element) {\r\n const position = element.position();\r\n const { width, height } = getDimensions(element);\r\n\r\n return {\r\n top: position.top,\r\n left: position.left,\r\n width,\r\n height,\r\n };\r\n}\r\n\r\nfunction getBoundingRectOffset(element) {\r\n const position = element.offset();\r\n const { width, height } = getDimensions(element);\r\n\r\n return {\r\n top: position.top,\r\n left: position.left,\r\n width,\r\n height,\r\n };\r\n}\r\n\r\nfunction testFit(containerDimensions, elementDimentions, position) {\r\n // Calculating how much of the element intersects with the container\r\n const verticalFit = Math.max(\r\n 0,\r\n Math.min(containerDimensions.height, position.top + elementDimentions.height) -\r\n Math.max(0, position.top)\r\n ) / elementDimentions.height;\r\n\r\n const horizontalFit = Math.max(\r\n 0,\r\n Math.min(containerDimensions.width, position.left + elementDimentions.width) -\r\n Math.max(0, position.left)\r\n ) / elementDimentions.width;\r\n\r\n return {\r\n verticalFit,\r\n horizontalFit,\r\n get areaFit() {\r\n return verticalFit * horizontalFit;\r\n },\r\n };\r\n}\r\n\r\nexport const FixedPositionLocation = Object.freeze({\r\n buttomLeft: 'buttomLeft',\r\n topRight: 'topRight',\r\n topLeft: 'topLeft',\r\n buttomRight: 'buttomRight',\r\n right: 'right',\r\n left: 'left',\r\n top: 'top',\r\n bottom: 'bottom',\r\n});\r\n\r\nexport const PositionAttribute = Object.freeze({\r\n fixed: 'fixed',\r\n absolute: 'absolute',\r\n});\r\n\r\nfunction getFixedPosition(positionOptions, container, anchor, element) {\r\n const popupDimensions = getDimensions(element);\r\n const anchorBoundingRect = positionOptions.positionAttribute === PositionAttribute.fixed ?\r\n getBoundingRectOffset(anchor) :\r\n getBoundingRectPosition(anchor);\r\n\r\n switch (positionOptions.location) {\r\n case FixedPositionLocation.buttomLeft: return {\r\n top: anchorBoundingRect.top + anchorBoundingRect.height,\r\n left: anchorBoundingRect.left + anchorBoundingRect.width - popupDimensions.width,\r\n };\r\n case FixedPositionLocation.topRight: return {\r\n top: anchorBoundingRect.top - popupDimensions.height,\r\n left: anchorBoundingRect.left,\r\n };\r\n case FixedPositionLocation.topLeft: return {\r\n top: anchorBoundingRect.top - popupDimensions.height,\r\n left: anchorBoundingRect.left + anchorBoundingRect.width - popupDimensions.width,\r\n };\r\n case FixedPositionLocation.right: return {\r\n top: anchorBoundingRect.top + anchorBoundingRect.height * 0.5 - popupDimensions.height * 0.5,\r\n left: anchorBoundingRect.left + anchorBoundingRect.width,\r\n };\r\n case FixedPositionLocation.left: return {\r\n top: anchorBoundingRect.top + anchorBoundingRect.height * 0.5 - popupDimensions.height * 0.5,\r\n left: anchorBoundingRect.left - popupDimensions.width,\r\n };\r\n case FixedPositionLocation.top: return {\r\n top: anchorBoundingRect.top - popupDimensions.height,\r\n left: anchorBoundingRect.left + anchorBoundingRect.width * 0.5 - popupDimensions.width * 0.5,\r\n };\r\n case FixedPositionLocation.bottom: return {\r\n top: anchorBoundingRect.top + anchorBoundingRect.height,\r\n left: anchorBoundingRect.left + anchorBoundingRect.width * 0.5 - popupDimensions.width * 0.5,\r\n };\r\n case FixedPositionLocation.buttomRight:\r\n default: return {\r\n top: anchorBoundingRect.top + anchorBoundingRect.height,\r\n left: anchorBoundingRect.left,\r\n };\r\n }\r\n}\r\n\r\nfunction getFittingPosition(positionOptions, container, anchor, element) {\r\n const containerDimensions = getDimensions(container);\r\n const popupDimensions = getDimensions(element);\r\n\r\n const positions = [\r\n getFixedPosition({ location: FixedPositionLocation.buttomRight }, container, anchor, element),\r\n getFixedPosition({ location: FixedPositionLocation.buttomLeft }, container, anchor, element),\r\n getFixedPosition({ location: FixedPositionLocation.topRight }, container, anchor, element),\r\n getFixedPosition({ location: FixedPositionLocation.topLeft }, container, anchor, element),\r\n ];\r\n\r\n const threshold = positionOptions && positionOptions.threshold;\r\n\r\n const fittingPosition =\r\n _.find(positions, position =>\r\n testFit(containerDimensions, popupDimensions, position).areaFit >= 1) ||\r\n threshold &&\r\n (_.find(positions, position =>\r\n testFit(containerDimensions, popupDimensions, position).areaFit >= threshold) ||\r\n positions[0]) ||\r\n _.max(positions, position => testFit(containerDimensions, popupDimensions, position).areaFit);\r\n\r\n return _.pick(fittingPosition, 'left', 'top');\r\n}\r\n\r\nexport const PositioningMethod = Object.freeze({\r\n fixed: 'fixed',\r\n fit: 'fit',\r\n});\r\n\r\nfunction getPositioningMethod(positioningMethod) {\r\n switch (positioningMethod) {\r\n case PositioningMethod.fixed:\r\n return getFixedPosition;\r\n case PositioningMethod.fit:\r\n default:\r\n return getFittingPosition;\r\n }\r\n}\r\n\r\nclass LabelsPopup extends Backbone.View {\r\n className() {\r\n return 'popup';\r\n }\r\n\r\n attributes() {\r\n return {\r\n role: 'dialog',\r\n };\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .popup__close': (e) => {\r\n this.onClose(e);\r\n },\r\n };\r\n }\r\n\r\n get combinedEvents() {\r\n return _.extend(\r\n this.options.events,\r\n this.events\r\n );\r\n }\r\n\r\n render() {\r\n this.$el.addClass((this.options.classes || []).join(' '));\r\n this.$el.append(controlTemplate({\r\n contents: this.options.template(),\r\n closeLabel: this.options.i18n.getString('Popup_Close'),\r\n }));\r\n this.setPosition(\r\n this.options.positioningMethod,\r\n this.options.positioningOptions,\r\n this.options.container,\r\n this.options.anchor,\r\n this.options.positionAttr\r\n );\r\n this.delegateEvents(this.combinedEvents);\r\n\r\n return this;\r\n }\r\n\r\n setPosition(positioningMethod, positioningOptions, container, anchor) {\r\n this.$el.css({\r\n position: positioningOptions.positionAttribute || PositionAttribute.absolute,\r\n visibility: 'hidden',\r\n });\r\n\r\n // Deferring the positioning to the next cycle\r\n // to have the popup layed out by the browser\r\n _.defer(() =>\r\n this.$el.css(_.extend(\r\n {\r\n visibility: 'visible',\r\n },\r\n getPositioningMethod(positioningMethod)(positioningOptions, container, anchor, this.$el)\r\n )));\r\n }\r\n\r\n onClose(e) {\r\n e.stopPropagation();\r\n this.trigger('close');\r\n }\r\n}\r\n\r\nlet currentPopup = null;\r\nlet popupInstance = null;\r\n\r\nexport function dismiss(result) {\r\n if (popupInstance) {\r\n popupInstance.trigger('close', result);\r\n }\r\n}\r\n\r\nfunction clickToDismiss(e) {\r\n if ($(e.target).closest('.popup').length === 0) {\r\n dismiss();\r\n }\r\n}\r\n\r\nfunction removePopup() {\r\n if (currentPopup) {\r\n currentPopup.remove();\r\n currentPopup = null;\r\n popupInstance = null;\r\n $(window).off('click', clickToDismiss);\r\n }\r\n}\r\n\r\nexport function show(options) {\r\n if (currentPopup) {\r\n dismiss();\r\n }\r\n\r\n return new Promise((resolveCallback) => {\r\n // eslint-disable-next-line no-param-reassign\r\n options.container = $(options.container || 'body');\r\n\r\n popupInstance = new LabelsPopup(options).render();\r\n\r\n const FocusLockInstanceView = focusLockInstanceDecorator(\r\n popupInstance,\r\n {\r\n onExit: (result) => {\r\n resolveCallback(result);\r\n removePopup();\r\n },\r\n getAnchor: options.anchor ? () => options.anchor[0] : undefined,\r\n }, {\r\n eventHandlers: {\r\n on: {\r\n close: (result) => {\r\n resolveCallback(result);\r\n removePopup();\r\n },\r\n },\r\n },\r\n managed: true,\r\n }\r\n );\r\n\r\n currentPopup = (new FocusLockInstanceView()).render();\r\n\r\n options.container.append(currentPopup.el);\r\n\r\n // Waiting for the next cycle to not intercept the click event\r\n // which may have triggered this showing of the popup.\r\n // Otherwise, the popup will close without even showing.\r\n _.defer(() => {\r\n $(window).on('click', clickToDismiss);\r\n if (currentPopup) {\r\n currentPopup.$('.popup__close').focus();\r\n }\r\n });\r\n });\r\n}\r\n\r\nexport class Popup {\r\n constructor({ i18n }) {\r\n this.popup = null;\r\n this.i18n = i18n;\r\n }\r\n\r\n show(options) {\r\n if (this.popup) {\r\n this.dismiss();\r\n }\r\n\r\n return new Promise((resolveCallback) => {\r\n // eslint-disable-next-line no-param-reassign\r\n options.container = $(options.container || 'body');\r\n\r\n this.popup = new LabelsPopup(options).render();\r\n\r\n const FocusLockInstanceView = focusLockInstanceDecorator(\r\n this.popup,\r\n {\r\n onExit: (result) => {\r\n resolveCallback(result);\r\n this.removePopup();\r\n },\r\n getAnchor: options.anchor ? () => options.anchor[0] : undefined,\r\n }, {\r\n eventHandlers: {\r\n on: {\r\n close: (result) => {\r\n resolveCallback(result);\r\n this.removePopup();\r\n },\r\n },\r\n },\r\n managed: true,\r\n }\r\n );\r\n\r\n this.wrappedPopup = (new FocusLockInstanceView()).render();\r\n\r\n options.container.append(this.wrappedPopup.el);\r\n\r\n // Waiting for the next cycle to not intercept the click event\r\n // which may have triggered this showing of the popup.\r\n // Otherwise, the popup will close without even showing.\r\n _.defer(() => {\r\n $(window).on('click', this.clickToDismiss.bind(this));\r\n if (this.wrappedPopup) {\r\n this.wrappedPopup.$('.popup__close').focus();\r\n }\r\n });\r\n });\r\n }\r\n\r\n removePopup() {\r\n if (this.wrappedPopup) {\r\n this.wrappedPopup.remove();\r\n this.popup = null;\r\n this.wrappedPopup = null;\r\n $(window).off('click', this.clickToDismiss);\r\n }\r\n }\r\n\r\n clickToDismiss(e) {\r\n if ($(e.target).closest('.popup--uurl-detail').length === 0) {\r\n this.dismiss();\r\n }\r\n }\r\n\r\n dismiss(result) {\r\n if (this.popup) {\r\n this.popup.trigger('close', result);\r\n }\r\n }\r\n}\r\n","/* eslint-disable */\r\nimport ko from 'knockout';\r\n\r\nexport default class ViewModel {\r\n constructor() {\r\n this.showTesting = ko.observable();\r\n this.resultType = ko.observable();\r\n this.resultString = ko.observable();\r\n }\r\n};","import $ from 'jquery';\r\nimport Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport { odata } from '@bingads-webui/http-util';\r\nimport { Popup, PositionAttribute, showPopup } from '@bingads-webui-campaign/popup';\r\nimport tmpl from './template/urlTestTool.pug';\r\nimport ViewModel from './viewmodel';\r\nimport urlTestToolStatusTemplate from './template/urlTestToolStatus.pug';\r\nimport urlTestResultTemplate from './template/urlTestResult.pug';\r\nimport urlTestResultSummaryTemplateV2 from './template/urlTestResultSummaryV2.pug';\r\nimport urlTestResultListSummaryTemplateV2 from './template/urlTestResultListSummaryV2.pug';\r\n\r\nconst ResultTypes = [\r\n 'UURLTestTool_Result_Found',\r\n 'UURLTestTool_Result_NotFound',\r\n 'UURLTestTool_Result_Mismatch',\r\n 'UURLTestTool_Result_Unreachable',\r\n 'UURLTestTool_Result_Unknown',\r\n 'UURLTestTool_Result_UserInputError',\r\n 'UURLTestTool_Result_NoEligibleUrlsFound',\r\n 'UURLTestTool_Result_TestComplete',\r\n];\r\n\r\nconst TrackingResultTypes = [\r\n 'UURLTestTool_TrackingCall_Successful',\r\n 'UURLTestTool_TrackingCall_Unsuccessful',\r\n];\r\n\r\nconst LevelTypes = [\r\n 'Unkown',\r\n 'Entity_Account',\r\n 'Entity_Campaign',\r\n 'Entity_Adgroup',\r\n 'Entity_Ads',\r\n 'Entity_Keywords',\r\n 'Entity_SitelinkExtensions',\r\n];\r\n\r\nconst TestingItemMapping = {\r\n ptLandingUrl: 'ptLandingUrl',\r\n ptTrackingUrl: 'ptTrackingUrl',\r\n sqServingUrl: 'sqServingUrl',\r\n};\r\n\r\nfunction getLevelString(level, i18n) {\r\n return level === 0 ? null : i18n.getString('UURLTestTool_From').replace('{0}', i18n.getString(LevelTypes[level]));\r\n}\r\n\r\nfunction normalizeUurlTestResult(rawResult, i18n) {\r\n if (_.isUndefined(rawResult)) {\r\n return rawResult;\r\n }\r\n\r\n let attributes = _.union(\r\n _.map(rawResult.CustomParameters, parameter => ({\r\n Key: `{_${parameter.Key}}`,\r\n Value: parameter.Value,\r\n Level: getLevelString(parameter.Level, i18n),\r\n })),\r\n _.map(rawResult.ValueTrackParameters, parameter => ({\r\n Key: `{${parameter.Key}}`,\r\n Value: parameter.Value,\r\n Level: null,\r\n })),\r\n _.map(rawResult.IndicateParameters, parameter => ({\r\n Key: parameter.Key,\r\n Value: parameter.Value,\r\n Level: null,\r\n }))\r\n );\r\n\r\n if (rawResult.LpUrl) {\r\n attributes = _.union([{\r\n Key: `{${rawResult.LpUrl.Key}}`,\r\n Value: rawResult.LpUrl.Value,\r\n Level: getLevelString(rawResult.LpUrl.Level, i18n),\r\n }], attributes);\r\n }\r\n\r\n let result = {\r\n resultType: rawResult.Result,\r\n resultString: i18n.getString(ResultTypes[rawResult.Result]),\r\n servingUrl: rawResult.ServingUrl,\r\n landingUrl: rawResult.LandingUrl,\r\n attributes,\r\n };\r\n\r\n if (rawResult.TrackingTemplate) {\r\n const trackingTemplate = {\r\n Value: rawResult.TrackingTemplate.Value,\r\n Level: getLevelString(rawResult.TrackingTemplate.Level, i18n),\r\n };\r\n result = _.extend(result, {\r\n trackingTemplate,\r\n });\r\n }\r\n\r\n if (rawResult.FinalUrl) {\r\n const finalUrl = {\r\n Value: rawResult.FinalUrl.Value,\r\n Level: getLevelString(rawResult.FinalUrl.Level, i18n),\r\n };\r\n result = _.extend(result, {\r\n finalUrl,\r\n });\r\n }\r\n\r\n if (rawResult.FinalUrlSuffix) {\r\n const finalUrlSuffix = {\r\n Value: rawResult.FinalUrlSuffix.Value,\r\n Level: getLevelString(rawResult.FinalUrlSuffix.Level, i18n),\r\n };\r\n result = _.extend(result, {\r\n finalUrlSuffix,\r\n });\r\n }\r\n\r\n if (rawResult.ParallelTrackingUrl) {\r\n const trackingUrl = {\r\n Value: rawResult.ParallelTrackingUrl.Value,\r\n Level: getLevelString(rawResult.ParallelTrackingUrl.Level, i18n),\r\n };\r\n result = _.extend(result, {\r\n trackingUrl,\r\n });\r\n }\r\n\r\n if (!_.isNull(rawResult.TrackingCallResult) && !_.isUndefined(rawResult.TrackingCallResult)) {\r\n result = _.extend(result, {\r\n trackingResultType: rawResult.TrackingCallResult,\r\n trackingResultString: i18n.getString(TrackingResultTypes[rawResult.TrackingCallResult]),\r\n });\r\n }\r\n\r\n return result;\r\n}\r\n\r\nlet detailPopup = null;\r\n\r\nexport class UrlTestTool extends Backbone.View {\r\n initialize({\r\n token,\r\n triggerTestUurl,\r\n instrumentation,\r\n i18n,\r\n }) {\r\n this.options = {\r\n token,\r\n triggerTestUurl,\r\n instrumentation,\r\n i18n,\r\n template: tmpl,\r\n isForVNext: true,\r\n location: 'topRight',\r\n position: PositionAttribute.fixed,\r\n };\r\n\r\n this.ko_model = new ViewModel();\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .testUurl': 'testUurl',\r\n 'click .resultDetails': 'showResultV2',\r\n 'click .resultString': 'showResultDetailsForVNext',\r\n 'mouseover .resultString': 'showResultDetailsForVNext',\r\n };\r\n }\r\n\r\n get attributes() {\r\n return {\r\n class: this.options && this.options.urlTestToolStatusContainer ? 'uurl-test-tool-inline' : '',\r\n };\r\n }\r\n\r\n render() {\r\n const useDefaultStatusContainer = !this.options.urlTestToolStatusContainer;\r\n const self = this;\r\n const popupSelector = `.popup--uurl-v2-${this.cid}`;\r\n\r\n this.$el.html($(tmpl({\r\n i18n: this.options.i18n,\r\n useDefaultStatusContainer,\r\n })));\r\n\r\n ko.cleanNode($(this.$('input.testUurl'))[0]);\r\n ko.applyBindings(this.ko_model, $(this.$('input.testUurl'))[0]);\r\n\r\n const urlTestToolStatusContainer = this.options.urlTestToolStatusContainer || this.$('.uurl-test-info__container');\r\n\r\n urlTestToolStatusContainer.empty()\r\n .append($(urlTestToolStatusTemplate({\r\n i18n: this.options.i18n,\r\n isForVNext: this.options.isForVNext,\r\n })));\r\n\r\n ko.cleanNode(urlTestToolStatusContainer[0]);\r\n ko.applyBindings(this.ko_model, urlTestToolStatusContainer[0]);\r\n\r\n if (!useDefaultStatusContainer) {\r\n urlTestToolStatusContainer.on('click', '.resultDetails', this.showResultV2.bind(this));\r\n urlTestToolStatusContainer.on('mouseover', '.resultString', this.showResultDetailsForVNext.bind(this));\r\n }\r\n\r\n // stopPropagation to prevent the tracking template inline editor from being closed\r\n $('body')\r\n .off('click', '.popup--uurl-v2')\r\n .on('click', '.popup--uurl-v2', (e) => {\r\n const $target = $(e.target);\r\n\r\n if (!$target.hasClass('HelpTopic')) {\r\n e.stopPropagation();\r\n }\r\n\r\n if ($target.closest('.popup--uurl-detail').length === 0) {\r\n self.dismissDetailPopup();\r\n }\r\n });\r\n\r\n $('body')\r\n .off('click', '.popup--uurl-v2 [data-toggle=\"collapse\"]')\r\n .on('click', '.popup--uurl-v2 [data-toggle=\"collapse\"]', (e) => {\r\n const curr = $(e.target);\r\n const parent = curr.parent(curr.attr('data-target'));\r\n const hasIn = parent.hasClass('in');\r\n const target = $(`[aria-expanded=\"${!hasIn}\"]${curr.attr('data-target')}`);\r\n\r\n parent.toggleClass('in').attr('aria-expanded', !hasIn).height(hasIn ? '0' : 'auto');\r\n target.toggleClass('in').attr('aria-expanded', hasIn).height(!hasIn ? '0' : 'auto');\r\n });\r\n\r\n $('body')\r\n .off('click', `${popupSelector} .ptLandingUrl`)\r\n .on('click', `${popupSelector} .ptLandingUrl`, (e) => {\r\n self.showResultUrlDetailV2(e, TestingItemMapping.ptLandingUrl);\r\n e.stopPropagation();\r\n });\r\n\r\n $('body')\r\n .off('click', `${popupSelector} .ptTrackingUrl`)\r\n .on('click', `${popupSelector} .ptTrackingUrl`, (e) => {\r\n self.showResultUrlDetailV2(e, TestingItemMapping.ptTrackingUrl);\r\n e.stopPropagation();\r\n });\r\n\r\n $('body')\r\n .off('click', `${popupSelector} .sqServingUrl`)\r\n .on('click', `${popupSelector} .sqServingUrl`, (e) => {\r\n self.showResultUrlDetailV2(e, TestingItemMapping.sqServingUrl);\r\n e.stopPropagation();\r\n });\r\n\r\n return this;\r\n }\r\n\r\n remove() {\r\n ko.cleanNode(this.el);\r\n return this;\r\n }\r\n\r\n fetchAccountFinalUrlSuffix() {\r\n const select = '$select=FinalUrlSuffix';\r\n const url = `/ODataApi/Campaign/V2/Customers(${window.App.state.get('advertisercustomer_id')})/Accounts(${window.App.state.get('account_id')})?${select}`;\r\n return odata.get(url, {\r\n headers: {\r\n Authorization: `CCMTSmallToken ${this.options.token}`,\r\n },\r\n })\r\n .then(response => response.FinalUrlSuffix)\r\n .catch((err) => {\r\n if (this.options.instrumentation.logError) {\r\n // TODO: update instrumentation\r\n this.options.instrumentation.logError('/Campaign/TestUurl/', `Failed on url ${url}: ${JSON.stringify(err)}`);\r\n }\r\n });\r\n }\r\n\r\n testUurl() {\r\n const self = this;\r\n\r\n this.fetchAccountFinalUrlSuffix().then((res) => {\r\n this.ko_model.showTesting(true);\r\n this.ko_model.resultString(null);\r\n this.ko_model.resultType(null);\r\n this.options.triggerTestUurl(\r\n self.handleTestResultList,\r\n _.extend(self, { isParallelTracking: true, accountFinalUrlSuffix: res })\r\n );\r\n });\r\n }\r\n\r\n getTestStatus() {\r\n return {\r\n resultType: this.ko_model.resultType(),\r\n resultString: this.ko_model.resultString(),\r\n showTesting: this.ko_model.showTesting(),\r\n };\r\n }\r\n\r\n handleTestResultList(rawResultList) {\r\n this.ko_model.showTesting(false);\r\n\r\n if (!rawResultList) {\r\n return;\r\n }\r\n\r\n if (rawResultList.Result && rawResultList.Errors && rawResultList.Errors.length) {\r\n this.ko_model.resultType(rawResultList.Result);\r\n this.ko_model.resultString(this.options.i18n.getString(ResultTypes[rawResultList.Result]));\r\n return;\r\n }\r\n\r\n if (!_.isArray(rawResultList) || !rawResultList.length) {\r\n return;\r\n }\r\n\r\n this.urlTestResultList = [];\r\n this.isMultipleResult = rawResultList.isMultipleResult;\r\n this.resultListTrackingTemplate = rawResultList.resultListTrackingTemplate;\r\n const self = this;\r\n\r\n _.each(rawResultList, (rawResult) => {\r\n if (!rawResult) {\r\n return;\r\n }\r\n\r\n const normalizedResult = {\r\n sequentialTrackingResult: normalizeUurlTestResult(_.extend(\r\n {},\r\n { Result: rawResultList.Result },\r\n rawResult.SequentialTrackingResult\r\n ), this.options.i18n),\r\n parallelTrackingResult: rawResult.ParallelTrackingResult ?\r\n normalizeUurlTestResult(_.extend(\r\n {},\r\n { Result: rawResultList.Result },\r\n rawResult.ParallelTrackingResult\r\n ), this.options.i18n)\r\n : null,\r\n campaignName: rawResult.CampaignName,\r\n adGroupName: rawResult.AdGroupName,\r\n };\r\n\r\n if (!self.ko_model.resultType()) {\r\n self.calculateResultType(normalizedResult);\r\n }\r\n\r\n self.urlTestResultList.push(normalizedResult);\r\n });\r\n\r\n // For account/campaign level test that tests multiple ads/keywords/sitelinks,\r\n // we show Test complete as result string\r\n if (rawResultList.Result === 7) {\r\n this.ko_model.resultString(this.options.i18n.getString(ResultTypes[rawResultList.Result]));\r\n }\r\n }\r\n\r\n calculateResultType(urlTestResult) {\r\n const { sequentialTrackingResult, parallelTrackingResult } = urlTestResult;\r\n const isParallelTracking = !!parallelTrackingResult;\r\n\r\n if (isParallelTracking && parallelTrackingResult.resultType !== 0) {\r\n this.ko_model.resultType(parallelTrackingResult.resultType);\r\n this.ko_model.resultString(parallelTrackingResult.resultString);\r\n } else if (isParallelTracking && parallelTrackingResult.trackingResultType !== 0) {\r\n this.ko_model.resultType(parallelTrackingResult.trackingResultType);\r\n this.ko_model.resultString(parallelTrackingResult.trackingResultString);\r\n } else {\r\n this.ko_model.resultType(sequentialTrackingResult.resultType);\r\n this.ko_model.resultString(sequentialTrackingResult.resultString);\r\n }\r\n }\r\n\r\n createResultItemV2(result) {\r\n const sq = result.sequentialTrackingResult || {};\r\n const pt = result.parallelTrackingResult || {};\r\n const item = {\r\n sq: {\r\n resultType: sq.resultType,\r\n resultString: sq.resultString,\r\n landingUrl: sq.landingUrl,\r\n servingUrl: sq.servingUrl,\r\n finalUrl: sq.finalUrl,\r\n attributes: sq.attributes,\r\n trackingTemplate: sq.trackingTemplate,\r\n finalUrlSuffix: sq.finalUrlSuffix,\r\n },\r\n pt: {\r\n resultType: pt.resultType,\r\n resultString: pt.resultString,\r\n landingUrl: pt.landingUrl,\r\n servingUrl: pt.servingUrl,\r\n finalUrl: pt.finalUrl,\r\n attributes: pt.attributes,\r\n trackingTemplate: pt.trackingTemplate,\r\n finalUrlSuffix: pt.finalUrlSuffix,\r\n trackingUrl: pt.trackingUrl,\r\n trackingResultType: pt.trackingResultType,\r\n trackingResultString: pt.trackingResultString,\r\n },\r\n campaignName: result.campaignName,\r\n adGroupName: result.adGroupName || this.options.i18n.getString('UURLTestTool_NA'),\r\n };\r\n\r\n return item;\r\n }\r\n\r\n showResultV2(event) {\r\n if (this.isMultipleResult) {\r\n this.showResultListV2(event);\r\n } else {\r\n this.showResultSingleV2(event);\r\n }\r\n }\r\n\r\n showResultSingleV2(event) {\r\n if (!this.urlTestResultList || !this.urlTestResultList.length) {\r\n return;\r\n }\r\n\r\n const self = this;\r\n\r\n const result = this.createResultItemV2(this.urlTestResultList[0]);\r\n\r\n showPopup(_.extend(\r\n { i18n: this.options.i18n },\r\n {\r\n positioningMethod: 'fixed',\r\n positioningOptions: {\r\n location: this.options.location,\r\n positionAttribute: this.options.position,\r\n },\r\n classes: ['popup--uurl-v2', `popup--uurl-v2-${this.cid}`],\r\n template() {\r\n return urlTestResultSummaryTemplateV2({\r\n sq: result.sq,\r\n pt: result.pt,\r\n i18n: self.options.i18n,\r\n });\r\n },\r\n },\r\n {\r\n container: $('body'), // Move container to body otherwise it may overlapped by page menu\r\n anchor: $(event.target),\r\n }\r\n ));\r\n\r\n // Fix the help topic position issue in legacy UI\r\n if (!this.options.isForVNext) {\r\n _.defer(() => {\r\n const $popupUurlV2 = $('.popup--uurl-v2');\r\n $popupUurlV2.css('marginTop', `${$popupUurlV2[0].offsetHeight / (-2)}px`);\r\n });\r\n }\r\n }\r\n\r\n showResultListV2(event) {\r\n const resultList = [];\r\n const self = this;\r\n\r\n _.each(this.urlTestResultList, (result) => {\r\n resultList.push(this.createResultItemV2(result));\r\n });\r\n\r\n showPopup(_.extend(\r\n { i18n: this.options.i18n },\r\n {\r\n positioningMethod: 'fixed',\r\n positioningOptions: {\r\n location: this.options.location,\r\n positionAttribute: this.options.position,\r\n },\r\n classes: ['popup--uurl-v2', `popup--uurl-v2-${this.cid}`],\r\n // eslint-disable-next-line func-names\r\n template: function () {\r\n return urlTestResultListSummaryTemplateV2({\r\n resultList,\r\n resultListTrackingTemplate: this.resultListTrackingTemplate,\r\n i18n: self.options.i18n,\r\n });\r\n }.bind(this),\r\n },\r\n {\r\n container: $('body'),\r\n anchor: $(event.target),\r\n }\r\n ));\r\n\r\n // Fix the help topic position issue in legacy UI\r\n if (!this.options.isForVNext) {\r\n _.defer(() => {\r\n const $popupUurlV2 = $('.popup--uurl-v2');\r\n $popupUurlV2.css('marginTop', `${$popupUurlV2[0].offsetHeight / (-2)}px`);\r\n });\r\n }\r\n }\r\n\r\n showResultDetailsForVNext(event) {\r\n if (this.options.isForVNext) {\r\n this.showResultV2(event);\r\n }\r\n }\r\n\r\n // Show the popup for the details of testing result of certain url of V2\r\n showResultUrlDetailV2(event, testingItem) {\r\n const index = $(event.target).data('index') || 0;\r\n const result = this.urlTestResultList[index];\r\n\r\n if (!result) {\r\n return;\r\n }\r\n\r\n const sq = result.sequentialTrackingResult;\r\n const pt = result.parallelTrackingResult;\r\n const trackingResult = testingItem === TestingItemMapping.sqServingUrl ? sq : pt;\r\n const {\r\n finalUrl, trackingTemplate, finalUrlSuffix, attributes,\r\n } = trackingResult;\r\n\r\n this.dismissDetailPopup();\r\n detailPopup = new Popup({\r\n i18n: this.options.i18n,\r\n });\r\n detailPopup.show(_.extend(\r\n {\r\n i18n: this.options.i18n,\r\n },\r\n {\r\n positioningMethod: 'fixed',\r\n positioningOptions: {\r\n location: this.calculateDetailPopupLocation($(event.target)),\r\n },\r\n classes: ['popup--uurl-detail'],\r\n template() {\r\n return urlTestResultTemplate({\r\n finalUrl,\r\n attributes,\r\n trackingTemplate,\r\n finalUrlSuffix,\r\n i18n: this.i18n,\r\n index: 0,\r\n });\r\n },\r\n },\r\n {\r\n container: $('.popup.popup--uurl-v2'),\r\n anchor: $(event.target),\r\n }\r\n ));\r\n }\r\n\r\n calculateDetailPopupLocation(anchor) {\r\n const windowHeight = $(window).height();\r\n const anchorTop = anchor[0].getBoundingClientRect().top;\r\n const anchorHeight = anchor.outerHeight();\r\n\r\n if (windowHeight - anchorHeight - anchorTop > 400) {\r\n return 'buttomRight';\r\n }\r\n\r\n return 'topRight';\r\n }\r\n\r\n dismissDetailPopup() {\r\n if (detailPopup) {\r\n detailPopup.dismiss();\r\n detailPopup = null;\r\n }\r\n }\r\n}\r\n\r\n","/* global UserVoice */\r\nimport Promise from 'bluebird';\r\n\r\nlet resolveContext;\r\nconst p$context = new Promise((resolve) => {\r\n resolveContext = resolve;\r\n});\r\n\r\nexport function init(context) {\r\n resolveContext(context);\r\n return p$context;\r\n}\r\n\r\n// This function popups the UV widget, but anchored to a custom target other than\r\n// the trigger itself.\r\n// Useful when the trigger is a dropdown submenu.\r\nfunction addTargetedTrigger({\r\n triggerId,\r\n featureName,\r\n areaName,\r\n targetId,\r\n}) {\r\n return p$context.then(({\r\n user,\r\n account,\r\n customer,\r\n i18n,\r\n }) => {\r\n const userVoice = UserVoice || [];\r\n\r\n userVoice.push(['identify', {\r\n // BingAds user ID\r\n id: user.Id,\r\n\r\n account: {\r\n // BingAds account ID\r\n id: account.Id,\r\n\r\n // BingAds account number\r\n name: account.AccountNumber,\r\n },\r\n }]);\r\n\r\n userVoice.push(['set', {\r\n ticket_custom_fields: {\r\n UserAgent: navigator.userAgent,\r\n Feature: featureName,\r\n FeatureArea: areaName,\r\n URL: window.location.href,\r\n AccountNumber: account.AccountNumber,\r\n AccountName: account.Name,\r\n AccountID: account.Id,\r\n CustomerID: customer.Id,\r\n CustomerName: customer.Name,\r\n PageHTML: '',\r\n },\r\n smartvote_enabled: false,\r\n\r\n target: targetId,\r\n\r\n screenshot_enabled: false,\r\n\r\n strings: {\r\n contact_menu_label: i18n.getString('UserVoice_WidgetText_ContactMenuLabel'),\r\n contact_title: i18n.getString('UserVoice_WidgetText_ContactTitle'),\r\n contact_message_placeholder: i18n.getString('UserVoice_WidgetText_ContactMessagePlaceholder'),\r\n contact_skip_instant_answers_button: i18n.getString('UserVoice_WidgetText_ContactSkipInstantAnswersButton'),\r\n contact_details_title: i18n.getString('UserVoice_WidgetText_ContactDetailsTitle'),\r\n contact_submit_button: i18n.getString('UserVoice_WidgetText_ContactSubmitButton'),\r\n contact_success_title: i18n.getString('UserVoice_WidgetText_ContactSuccessTitle'),\r\n contact_success_body: i18n.getString('UserVoice_WidgetText_ContactSuccessBody'),\r\n email_address_label: i18n.getString('UserVoice_WidgetText_EmailAddressLabel'),\r\n email_address_placeholder: i18n.getString('UserVoice_WidgetText_EmailAddressPlaceholder'),\r\n },\r\n }]);\r\n\r\n userVoice.push(['addTrigger', triggerId, {\r\n mode: 'contact',\r\n }]);\r\n });\r\n}\r\n\r\n// Popups a UV contact widget, and place the anchor to the trigger itself.\r\nexport function addTrigger({\r\n triggerId,\r\n featureName,\r\n areaName,\r\n}) {\r\n return addTargetedTrigger({\r\n triggerId,\r\n featureName,\r\n areaName,\r\n targetId: 'self',\r\n });\r\n}\r\n","export const constants = {\r\n videoSortBySelections: {\r\n recentUpload: {\r\n id: 1,\r\n enum: 'recentUpload',\r\n stringKey: 'ImageExperience_Sort_Recent_Upload',\r\n query: '$orderby=UploadedTime desc',\r\n edmDefinition: { UploadedTime: -1 },\r\n },\r\n description: {\r\n id: 2,\r\n enum: 'description',\r\n stringKey: 'ImageExperience_Sort_Video_Text',\r\n query: '$orderby=Text asc',\r\n edmDefinition: { Text: 1 },\r\n },\r\n },\r\n};\r\n","import { odata } from '@bingads-webui/http-util';\r\nimport _ from 'underscore';\r\nimport { Promise } from 'bluebird';\r\nimport { AzureUploader, FilePayload } from '@bingads-webui/azure-upload';\r\nimport { constants } from './constants';\r\n\r\nexport class VideoOData {\r\n constructor(\r\n cid,\r\n aid,\r\n oDataConfig,\r\n activityLogger\r\n ) {\r\n this.cid = cid;\r\n this.aid = aid;\r\n this.baseURL = `${oDataConfig.odataPath}/Customers(${this.cid})/Accounts(${this.aid})`;\r\n this.oDataConfig = {\r\n oDataToken: oDataConfig.odataToken,\r\n oDataTokenType: oDataConfig.oDataTokenType,\r\n applicationName: oDataConfig.applicationName,\r\n };\r\n this.uploader = new AzureUploader({\r\n logger: activityLogger ? {\r\n trace: activityLogger.signal,\r\n error: activityLogger.error,\r\n } : {\r\n trace: _.noop,\r\n error: _.noop,\r\n },\r\n });\r\n }\r\n\r\n getUploadUrl({ fileExtension }) {\r\n const url = `${this.baseURL}/Videos/Default.GetUploadUrl(fileExtension='${fileExtension}')`;\r\n return odata.get(url, this.oDataConfig);\r\n }\r\n\r\n getUploadUrlForRepair({ fileExtension, id }) {\r\n const url = `${this.baseURL}/Videos/${id}/Default.GetUploadUrlForRepair(fileExtension='${fileExtension}')`;\r\n return odata.get(url, this.oDataConfig);\r\n }\r\n\r\n postVideoByFile({\r\n file, description, onProgress,\r\n }) {\r\n return new Promise((resolve, reject) => {\r\n const { name } = file;\r\n const nameSplits = name.split('.');\r\n const ext = nameSplits[nameSplits.length - 1];\r\n this.getUploadUrl({ fileExtension: `.${ext}` })\r\n .then((blob) => {\r\n const { BlobName } = blob;\r\n const token = this.uploader.uploadPayloadToBlobWithCancellation({\r\n blob,\r\n payload: new FilePayload({ file }),\r\n onProgress,\r\n });\r\n token.chain(() => odata.post(`${this.baseURL}/Videos/`, {\r\n ...this.oDataConfig,\r\n urlParameters: { blobName: BlobName, description },\r\n }));\r\n resolve(token);\r\n })\r\n .catch(reject);\r\n });\r\n }\r\n\r\n postVideoByUrl({ videoUrl }) {\r\n return odata.post(`${this.baseURL}/Videos/`, {\r\n ...this.oDataConfig,\r\n urlParameters: { videoUrl, description: videoUrl },\r\n });\r\n }\r\n\r\n getVideos({\r\n sortById,\r\n searchTerm,\r\n pageNumber,\r\n pageSize,\r\n }) {\r\n const top = pageSize;\r\n const skip = pageNumber * pageSize;\r\n\r\n const sortDefinition = _.find(\r\n constants.videoSortBySelections,\r\n sortBySelection => sortBySelection.id === sortById\r\n );\r\n const sortQuery = sortDefinition.query;\r\n\r\n const query = {\r\n $top: top,\r\n $skip: skip,\r\n count: true,\r\n };\r\n /* istanbul ignore if */\r\n if (searchTerm.length > 0) {\r\n query.$filter = `contains(Text, '${searchTerm}')`;\r\n }\r\n\r\n return odata.get(\r\n `${this.baseURL}/Videos/?${sortQuery}`,\r\n {\r\n ...this.oDataConfig,\r\n data: query,\r\n customHeader: { name: 'x-ms-refreshcampaigncache', value: 'true' },\r\n }\r\n );\r\n }\r\n\r\n replaceVideoByUrl({ videoUrl, id }) {\r\n return odata.post(`${this.baseURL}/Videos/${id}/RepairVideo`, {\r\n ...this.oDataConfig,\r\n data: {\r\n videoUrl, description: videoUrl,\r\n },\r\n });\r\n }\r\n\r\n replaceVideoByBlob({ id, file, onProgress }) {\r\n return new Promise((resolve, reject) => {\r\n const { name } = file;\r\n const nameSplits = name.split('.');\r\n const ext = nameSplits[nameSplits.length - 1];\r\n this.getUploadUrlForRepair({ fileExtension: `.${ext}`, id })\r\n .then((blob) => {\r\n const { BlobName } = blob;\r\n const token = this.uploader.uploadPayloadToBlobWithCancellation({\r\n blob,\r\n payload: new FilePayload({ file }),\r\n onProgress,\r\n });\r\n token.chain(() => odata.post(`${this.baseURL}/Videos/${id}/RepairVideo`, {\r\n ...this.oDataConfig,\r\n data: {\r\n blobName: BlobName, description: name,\r\n },\r\n }));\r\n resolve(token);\r\n })\r\n .catch(reject);\r\n });\r\n }\r\n\r\n getVideo({ id }) {\r\n return odata.get(`${this.baseURL}/Videos/${id}`, this.oDataConfig);\r\n }\r\n\r\n patchVideo({ id, deltaVideo }) {\r\n return odata.patch(`${this.baseURL}/Videos/${id}`, { ...this.oDataConfig, data: deltaVideo });\r\n }\r\n\r\n deleteVideo({ id }) {\r\n return odata.delete(`${this.baseURL}/Videos/${id}`, this.oDataConfig);\r\n }\r\n\r\n /* istanbul ignore next */\r\n createVideoBasedOnOriginalVideo({ id, data }) {\r\n return odata.post(`${this.baseURL}/Videos/${id}/Default.CreateVideoBasedOnOriginalVideo`, {\r\n ...this.oDataConfig,\r\n data,\r\n });\r\n }\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;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: actions, optionsText: "Text", optionsValue: "Value", value: selectedAction\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_Action'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: bidTypes, optionsText: "Text", optionsValue: "Value", value: selectedBidType\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_BidType'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cinput\" + (\" class=\\\"bulkEdit-bid form-control\\\"\"+\" type=\\\"text\\\" data-bind=\\\"value: bidValue, valueUpdate: "input", css: {"error": bidErrorMessage().length > 0}, attr: {"aria-invalid": bidErrorMessage().length > 0, "aria-describedby": bidErrorMessage().length > 0 ? "AutomationRulesBidErrorMessage" : ""}\\\" aria-required=\\\"true\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_BidValue'), true, true)) + \"\\u003E\\u003Cselect\" + (\" class=\\\"bulkEdit-units form-control\\\"\"+\" data-bind=\\\"options: units, optionsText: "Text", optionsValue: "Value", value: selectedUnit\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_Unit'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Clabel class=\\\"checkbox-inline bulkEdit-limit-label\\\"\\u003E\\u003Cinput class=\\\"bulkEdit-limit\\\" type=\\\"checkbox\\\" data-bind=\\\"checked: useLimitValue\\\"\\u003E\\u003Cspan id=\\\"AdGroupLimitBidLabel\\\" data-bind=\\\"html: limitBidLabelText\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003Cinput class=\\\"bulkEdit-bid form-control\\\" type=\\\"text\\\" data-bind=\\\"value: limitValue, enable: useLimitValue, valueUpdate: "input", css: {"error": bidLimitErrorMessage().length > 0}, attr: {"aria-invalid": bidLimitErrorMessage().length > 0, "aria-describedby": bidLimitErrorMessage().length > 0 ? "AutomationRulesBidErrorMessage" : ""}\\\" aria-required=\\\"true\\\" aria-labelledby=\\\"AdGroupLimitBidLabel AdGroupLimitBidCurrencyLabel\\\"\\u003E\\u003Clabel class=\\\"bulk-edit-currency\\\" id=\\\"AdGroupLimitBidCurrencyLabel\\\" data-bind=\\\"text: accountCurrencyCode\\\"\\u003E\\u003C\\u002Flabel\\u003E\\u003Cdiv id=\\\"AutomationRulesBidErrorMessage\\\" role=\\\"alert\\\"\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"html: bidErrorMessage() || bidLimitErrorMessage()\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: actions, optionsText: "Text", optionsValue: "Value", value: selectedAction\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_Action'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cspan class=\\\"form-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('BulkEdit_Campaign_DailyBudget')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cinput\" + (\" class=\\\"bulkEdit-bid form-control\\\"\"+\" type=\\\"text\\\" data-bind=\\\"value: budgetValue, valueUpdate: "input", css: {"error": budgetErrorMessage().length > 0}, attr: {"aria-invalid": budgetErrorMessage().length > 0, "aria-describedby": budgetErrorMessage().length > 0 ? "AutomationRulesBudgetErrorMessage" : ""}\\\" aria-required=\\\"true\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_BidValue'), true, true)) + \"\\u003E\\u003Cselect\" + (\" class=\\\"bulkEdit-units form-control\\\"\"+\" data-bind=\\\"options: units, optionsText: "Text", optionsValue: "Value", value: selectedUnit\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_Unit'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Clabel class=\\\"checkbox-inline bulkEdit-limit-label\\\"\\u003E\\u003Cinput class=\\\"bulkEdit-limit\\\" type=\\\"checkbox\\\" data-bind=\\\"checked: useLimitValue\\\"\\u003E\\u003Cspan id=\\\"CampaignLimitBudgetLabel\\\" data-bind=\\\"html: limitBudgetLabelText\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003Cinput class=\\\"bulkEdit-bid form-control\\\" type=\\\"text\\\" data-bind=\\\"value: limitValue, enable: useLimitValue, valueUpdate: "input", css: {"error": budgetLimitErrorMessage().length > 0}, attr: {"aria-invalid": budgetLimitErrorMessage().length > 0, "aria-describedby": budgetLimitErrorMessage().length > 0 ? "AutomationRulesBudgetErrorMessage" : ""}\\\" aria-required=\\\"true\\\" aria-labelledby=\\\"CampaignLimitBudgetLabel\\\"\\u003E\\u003Clabel class=\\\"bulk-edit-currency\\\" data-bind=\\\"text: accountCurrencyCode\\\"\\u003E\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"changeBudgetHelp\\\"\\u003E\\u003Clabel data-bind=\\\"visible: isIncreaseBudgetHelp\\\"\\u003E\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" topic=\\\"pop_BA_BulkEditBudgetIncrease\\\" type=\\\"helppopup\\\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\" role=\\\"button\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Click to learn more about {{item}}', { item: view.i18n.getString('AutomatedRules_RuleAuthoring_IncreaseBudget') }), true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Flabel\\u003E\\u003Clabel data-bind=\\\"visible: !isIncreaseBudgetHelp()\\\"\\u003E\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" topic=\\\"pop_BA_BulkEditBudgetDecrease\\\" type=\\\"helppopup\\\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\" role=\\\"button\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Click to learn more about {{item}}', { item: view.i18n.getString('AutomatedRules_RuleAuthoring_DecreaseBudget') }), true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv id=\\\"AutomationRulesBudgetErrorMessage\\\" role=\\\"alert\\\"\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"html: budgetErrorMessage() || budgetLimitErrorMessage()\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"visible: isChangeByBid, options: actions, optionsText: "Text", optionsValue: "Value", value: selectedAction\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_Action'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cinput\" + (\" class=\\\"bulkEdit-bid form-control\\\"\"+\" type=\\\"text\\\" data-bind=\\\"visible: isChangeByBid, value: bidValue, valueUpdate: "input", css: {"error": bidErrorMessage().length > 0}, attr: {"aria-invalid": bidErrorMessage().length > 0, "aria-describedby": bidErrorMessage().length > 0 ? "AutomationRulesBidErrorMessage" : ""}\\\" aria-required=\\\"true\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_BidValue'), true, true)) + \"\\u003E\\u003Cselect\" + (\" class=\\\"bulkEdit-units form-control\\\"\"+\" data-bind=\\\"visible: isChangeByBid, options: units, optionsText: "Text", optionsValue: "Value", value: selectedUnit\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_Unit'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Clabel class=\\\"control-label\\\" data-bind=\\\"visible: !isChangeByBid, text: actionText, css: {"pull-left" : !isChangeByBid}\\\"\\u003E\\u003C\\u002Flabel\\u003E\\u003Clabel class=\\\"bulkEdit-limit-label checkbox-inline\\\" data-bind=\\\"css: {"pull-left" : !isChangeByBid}\\\"\\u003E\\u003Cinput class=\\\"bulkEdit-limit\\\" type=\\\"checkbox\\\" data-bind=\\\"checked: useLimitValue\\\"\\u003E\\u003Cspan id=\\\"KeywordLimitBidLabel\\\" data-bind=\\\"html: limitBidLabelText\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003Cinput class=\\\"bulkEdit-bid form-control\\\" type=\\\"text\\\" data-bind=\\\"value: limitValue, enable: useLimitValue, valueUpdate: "input", css: {"error": bidLimitErrorMessage().length > 0}, attr: {"aria-invalid": bidLimitErrorMessage().length > 0, "aria-describedby": bidLimitErrorMessage().length > 0 ? "AutomationRulesBidErrorMessage" : ""}\\\" aria-required=\\\"true\\\" aria-labelledby=\\\"KeywordLimitBidLabel\\\"\\u003E\\u003Clabel class=\\\"bulk-edit-currency\\\" data-bind=\\\"text: accountCurrencyCode\\\"\\u003E\\u003C\\u002Flabel\\u003E\\u003Cdiv id=\\\"AutomationRulesBidErrorMessage\\\" role=\\\"alert\\\"\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"html: bidErrorMessage() || bidLimitErrorMessage()\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (view) {pug_mixins[\"formgroupline\"] = pug_interp = function(){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\nif ((view.isForVNext)) {\npug_html = pug_html + \"\\u003Chr class=\\\"formgroupline\\\"\\u003E\";\n}\n};\nvar colSm2 = view.isForVNext ? '' : 'col-sm-2'\nvar colSm10 = view.isForVNext ? '' : 'col-sm-10'\npug_html = pug_html + \"\\u003Cdiv class=\\\"frequency-selection\\\"\\u003E\\u003Cdiv class=\\\"form-group form-inline\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"control-label\",colSm2], [false,true]), false, true)) + \"\\u003E\\u003Clabel id=\\\"RuleAuthoring_Frequence_Label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_Frequence')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" topic=\\\"pop_BA_AutoRule_Frequency\\\" role=\\\"button\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Click to learn more about {{item}}', { item: view.i18n.getString('RuleAuthoring_Frequence')}), true, true)+\" type=\\\"helppopup\\\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\"\") + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"rule-options-selection\",colSm10], [false,true]), false, true)+\" role=\\\"group\\\" aria-labelledby=\\\"RuleAuthoring_Frequence_Label\\\"\") + \"\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: frequencyGrains, optionsText: "Text", optionsValue: "Value", value: selectedFrequencyGrain\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_Frequency'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: weeklyOptions, optionsText: "Text", optionsValue: "Value", value: selectedWeekOption, visible: isWeekOption\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_FrequencyValue'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: monthlyOptions, optionsText: "Text", optionsValue: "Value", value: selectedMonthOption, visible: isMonthOption\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_FrequencyValue'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cdiv class=\\\"form-control k-datePicker-container\\\" data-bind=\\\"visible: isOnceOption\\\"\\u003E\\u003Cdiv\" + (\" class=\\\"runOnceDateFilter\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_DatePicker'), true, true)+\" data-ref=\\\"date-picker\\\"\") + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"visible: !isHourlyOption(), options: dailyOptions, optionsValue: "Value", value: selectedDailyOption, optionsText: function (item) { if ($root.isTwelveHourDisplayFormat() === "true") return item.twelveHourDisplay; else return item.twentyFourHourDisplay }\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_FrequencyValue'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cspan class=\\\"form-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_DataDateRange')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+\" data-bind=\\\"options: dataDateRangeOptions, optionsText: "Text", optionsValue: "Value", value: selectedDataDateRangeOption\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('RuleLabel_DateRange'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group form-inline\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\nif (!view.isForVNext) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"col-sm-2\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([colSm10], [true]), false, true)+\" role=\\\"radiogroup\\\" aria-labelledby=\\\"ImprovedAdScheduling_Display_Time_Label\\\"\") + \"\\u003E\\u003Cspan class=\\\"form-text control-label pull-left\\\" id=\\\"ImprovedAdScheduling_Display_Time_Label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('ImprovedAdScheduling_Display_Time')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput class=\\\"twelveHourOptionRadioButton\\\" type=\\\"radio\\\" value=\\\"true\\\" data-bind=\\\"checked: isTwelveHourDisplayFormat\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('ImprovedAdScheduling_12_Hour_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput class=\\\"twentyFourOptionRadioButton\\\" type=\\\"radio\\\" value=\\\"false\\\" data-bind=\\\"checked: isTwelveHourDisplayFormat\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('ImprovedAdScheduling_24_Hour_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group form-inline\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\nif (!view.isForVNext) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"col-sm-2\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"rule-options-selection\",colSm10], [false,true]), false, true)+\" role=\\\"group\\\" aria-labelledby=\\\"RuleAuthoring_TimeZone_Label\\\"\") + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"form-text\",view.isForVNext ? 'control-label' : ''], [false,true]), false, true)+\" id=\\\"RuleAuthoring_TimeZone_Label\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_TimeZone')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\nif (view.isForVNext) {\npug_html = pug_html + \"\\u003Cdiv\\u003E\\u003Cselect class=\\\"automated-rules-timezone-selection form-control\\\" data-bind=\\\"options: timeZoneOptions, optionsText: "Text", optionsValue: "Value", value: selectedTimeZoneOption, attr: {"aria-invalid": frequencyErrorMessage().length > 0}\\\" aria-labelledby=\\\"RuleAuthoring_TimeZone_Label\\\" aria-describedby=\\\"AutomationRulesFrequencyErrorMessage\\\"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cselect class=\\\"form-control\\\" data-bind=\\\"options: timeZoneOptions, optionsText: "Text", optionsValue: "Value", value: selectedTimeZoneOption, attr: {"aria-invalid": frequencyErrorMessage().length > 0}\\\" aria-labelledby=\\\"RuleAuthoring_TimeZone_Label\\\" aria-describedby=\\\"AutomationRulesFrequencyErrorMessage\\\"\\u003E\\u003C\\u002Fselect\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv id=\\\"AutomationRulesFrequencyErrorMessage\\\" data-bind=\\\"attr: { role: frequencyErrorRole }\\\"\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"html: frequencyErrorMessage\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (selectorControlClass, view) {pug_mixins[\"formgroupline\"] = pug_interp = function(){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\nif ((view.isForVNext)) {\npug_html = pug_html + \"\\u003Chr class=\\\"formgroupline\\\"\\u003E\";\n}\n};\nvar colSm2 = view.isForVNext ? '' : 'col-sm-2'\npug_html = pug_html + \"\\u003Cdiv class=\\\"automated-rules-vnext\\\"\\u003E\\u003Cdiv class=\\\"panel\\\"\\u003E\\u003Ch2 class=\\\"panel-heading\\\" aria-level=\\\"2\\\"\\u003E\\u003Cdiv class=\\\"panel-title\\\" data-bind=\\\"text: titleName\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fh2\\u003E\\u003Cdiv class=\\\"panel-body form-horizontal\\\"\\u003E\\u003Cdiv class=\\\"title-desc margin-zero\\\" data-bind=\\\"visible: !isEditRule, html: titleDescription\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"control-label\",colSm2], [false,true]), false, true)) + \"\\u003E\\u003Clabel id=\\\"RuleAuthoring_Scope_Label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_Scope')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" topic=\\\"pop_BA_AutoRule_ApplyTo\\\" role=\\\"button\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Click to learn more about {{item}}', { item: view.i18n.getString('RuleAuthoring_Scope')}), true, true)+\" type=\\\"helppopup\\\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\"\") + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3 rule-scope-options-selection\\\" role=\\\"group\\\" aria-labelledby=\\\"RuleAuthoring_Scope_Label\\\"\\u003E\";\nif (view.isForVNext && view.viewModel.isEditRule) {\npug_html = pug_html + \"\\u003C!--ko foreach: scopeOptions--\\u003E\\u003Cdiv class=\\\"radio\\\"\\u003E\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput type=\\\"radio\\\" data-bind=\\\"checked: $root.selectedScopeOption, value: Value\\\"\\u003E\\u003Cspan data-bind=\\\"text: Text\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!--\\u002Fko--\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"campaignAdgroupSelector\",selectorControlClass], [false,true]), false, true)+\" data-bind=\\\"visible: showCampaignAdGroupSelector\\\"\") + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cselect class=\\\"form-control ruleScopeOptions\\\" data-bind=\\\"options: scopeOptions, optionsText: "Text", optionsValue: "Value", value: selectedScopeOption, attr: {"aria-invalid": scopeErrorMessage().length > 0}\\\" aria-labelledby=\\\"RuleAuthoring_Scope_Label\\\" aria-describedby=\\\"AutomationRulesScopeErrorMessage\\\"\\u003E\\u003C\\u002Fselect\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv id=\\\"AutomationRulesScopeErrorMessage\\\" data-bind=\\\"attr: { role: scopeErrorRole }\\\"\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"html: scopeErrorMessage\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group form-inline\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"control-label\",colSm2], [false,true]), false, true)) + \"\\u003E\\u003Clabel id=\\\"RuleAuthoring_Action_Label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-10 rule-options-selection\\\" role=\\\"group\\\" aria-labelledby=\\\"RuleAuthoring_Action_Label\\\"\\u003E\\u003Clabel class=\\\"control-label\\\"\\u003E\\u003Cspan class=\\\"action-text\\\" data-bind=\\\"text: actionText, visible: isActionText\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"form-inline\\\" data-bind=\\\"visible: !isActionText()\\\" data-ref=\\\"action\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"control-label\",colSm2], [false,true]), false, true)) + \"\\u003E\\u003Clabel id=\\\"RuleAuthoring_Filter_Label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_Filter')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" topic=\\\"pop_BA_AutoRule_When\\\" role=\\\"button\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Click to learn more about {{item}}', { item: view.i18n.getString('RuleAuthoring_Filter')}), true, true)+\" type=\\\"helppopup\\\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\"\") + \"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-10 rule-filter-selection\\\" role=\\\"group\\\" aria-labelledby=\\\"RuleAuthoring_Filter_Label\\\"\\u003E\\u003Cform class=\\\"ruleAuthFilterForm\\\"\\u003E\\u003Cdiv class=\\\"ruleAuthFilter\\\" data-ref=\\\"filter\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fform\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"cron-selection\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group rule-name-form-group\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"control-label\",colSm2], [false,true]), false, true)) + \"\\u003E\\u003Clabel id=\\\"RuleAuthoring_RuleName_Label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_RuleName')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3 rule-options-selection\\\" aria-labelledby=\\\"RuleAuthoring_RuleName_Label\\\"\\u003E\\u003Cinput class=\\\"form-control\\\" type=\\\"text\\\" data-bind=\\\"value: ruleName, valueUpdate: "input", attr: { maxLength: maxRuleNameLength, "aria-invalid": ruleNameErrorMessage().length > 0 }, css: {"error": ruleNameErrorMessage().length > 0}\\\" aria-required=\\\"true\\\" aria-labelledby=\\\"RuleAuthoring_RuleName_Label\\\" aria-describedby=\\\"AutomationRulesNameErrorMessage\\\"\\u003E\\u003Cdiv id=\\\"AutomationRulesNameErrorMessage\\\" data-bind=\\\"attr: { role: ruleNameErrorRole }\\\"\\u003E\\u003Cdiv class=\\\"error\\\" data-bind=\\\"html: ruleNameErrorMessage\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\" data-bind=\\\"visible: isEmailOption\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"control-label\",colSm2], [false,true]), false, true)) + \"\\u003E\\u003Clabel id=\\\"RuleAuthoring_EmailResults_Label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_EmailResults')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3 rule-options-selection\\\" role=\\\"group\\\" aria-labelledby=\\\"RuleAuthoring_EmailResults_Label\\\"\\u003E\\u003Cselect class=\\\"form-control\\\" data-bind=\\\"options: emailOptions, optionsText: "Text", optionsValue: "Value", value: selectedEmailOption\\\" aria-labelledby=\\\"RuleAuthoring_EmailResults_Label\\\"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-10 different-user-warning\\\"\\u003E\\u003Cspan class=\\\"form-text\\\" data-bind=\\\"visible: isEditRuleWithDifferentUser, html: editRuleWarningMessage\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (view.isForVNext) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"preview-section\\\" data-bind=\\\"visible: inPreviewMode\\\"\\u003E\";\npug_mixins[\"formgroupline\"]();\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"control-label\",colSm2], [false,true]), false, true)) + \"\\u003E\\u003Clabel\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('RuleAuthoring_PreviewRule')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"rule-preview-body\\\"\\u003E\\u003Cdiv data-ref=\\\"preview-result\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"panel-footer\\\"\\u003E\\u003Cinput\" + (\" class=\\\"btn btn-primary btn-ruleAuth-save\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", view.i18n.getString('RuleAuthoring_SaveRule'), true, true)+\" data-bind=\\\"disable: isSelectorOpen\\\"\") + \"\\u003E\\u003Cinput\" + (\" class=\\\"btn btn-default btn-ruleAuth-preview\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", view.i18n.getString('RuleAuthoring_PreviewRule'), true, true)+\" data-bind=\\\"disable: isSelectorOpen\\\"\") + \"\\u003E\\u003Cinput\" + (\" class=\\\"btn btn-default btn-ruleAuth-cancel\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", view.i18n.getString('RuleAuthoring_Cancel'), true, true)+\" data-bind=\\\"disable: isSelectorOpen\\\"\") + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (!view.isForVNext) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"rule-preview-body\\\" data-bind=\\\"visible: inPreviewMode\\\"\\u003E\\u003Cdiv data-ref=\\\"preview-result\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"selectorControlClass\" in locals_for_with?locals_for_with.selectorControlClass:typeof selectorControlClass!==\"undefined\"?selectorControlClass:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"panel-footer\\\"\\u003E\\u003Cdiv data-bind=\\\"html: changeText\\\" role=\\\"alert\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"previewTable grid\\\" data-bind=\\\"if: results().length > 0, visible: results().length > 0\\\"\\u003E\\u003Ctable\\u003E\\u003Cthead\\u003E\\u003Ctr class=\\\"grid-header-row\\\"\\u003E\";\n// iterate view.viewModel.columns\n;(function(){\n var $$obj = view.viewModel.columns;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var column = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cth class=\\\"grid-header-cell grid-disabledsort\\\"\\u003E\\u003Cdiv class=\\\"grid-header-textcontainer\\\"\\u003E\\u003Ca class=\\\"grid-header-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = column) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fth\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var column = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cth class=\\\"grid-header-cell grid-disabledsort\\\"\\u003E\\u003Cdiv class=\\\"grid-header-textcontainer\\\"\\u003E\\u003Ca class=\\\"grid-header-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = column) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fth\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Ftr\\u003E\\u003C\\u002Fthead\\u003E\\u003Ctbody data-bind=\\\"foreach: results\\\"\\u003E\\u003Ctr class=\\\"grid-row\\\" data-bind=\\\"foreach: $data.data\\\"\\u003E\\u003Ctd class=\\\"grid-cell\\\"\\u003E\\u003C!-- ko if: $data.isHtml--\\u003E\\u003Cdiv class=\\\"grid-content-container\\\" data-bind=\\\"html: $data.value\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003C!-- ko if: !$data.isHtml--\\u003E\\u003Cdiv class=\\\"grid-content-container\\\" data-bind=\\\"text: $data.value\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003C\\u002Ftd\\u003E\\u003C\\u002Ftr\\u003E\\u003C\\u002Ftbody\\u003E\\u003C\\u002Ftable\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (campaignRemarketingAssociated, fromAudienceLibrary, i18n, isCustomInMarketEnabled) {if ((fromAudienceLibrary)) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-warning\\\"\\u003E\" + (null == (pug_interp = isCustomInMarketEnabled ? i18n.getString('Audiences_GoToCampaignTab_Custom_InMarket_Message') : i18n.getString('Audiences_GoToCampaignTab_Message')) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nif ((campaignRemarketingAssociated)) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-warning\\\"\\u003E\\u003Cspan\\u003E\" + (null == (pug_interp = isCustomInMarketEnabled ? i18n.getString('Audiences_AssociationSuccess_Message_CustomInMarket_Campaign').replace('{0}', '' + i18n.getString('Remarketing_Tutorial_Step3_Desc_AudienceTabLink') + '') : i18n.getString('Audiences_AssociationSuccess_Message_Campaign').replace('{0}', '' + i18n.getString('Remarketing_Tutorial_Step3_Desc_AudienceTabLink') + '')) ? \"\" : pug_interp) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\n}}.call(this,\"campaignRemarketingAssociated\" in locals_for_with?locals_for_with.campaignRemarketingAssociated:typeof campaignRemarketingAssociated!==\"undefined\"?campaignRemarketingAssociated:undefined,\"fromAudienceLibrary\" in locals_for_with?locals_for_with.fromAudienceLibrary:typeof fromAudienceLibrary!==\"undefined\"?fromAudienceLibrary:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isCustomInMarketEnabled\" in locals_for_with?locals_for_with.isCustomInMarketEnabled:typeof isCustomInMarketEnabled!==\"undefined\"?isCustomInMarketEnabled:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (Description, SelectedLanguages, SuggestedLanguagesDescription, i18n, inSingleColumnVersion, languageOptions) {pug_html = pug_html + \"\\u003Cdiv class=\\\"multi-language-selector\\\"\\u003E\";\nif (Description) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"container-fluid\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"form-control-static description\\\"\\u003E\" + (pug.escape(null == (pug_interp = Description) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-info\\\" data-bind=\\\"visible:suggestedLanguages().length > 0\\\"\\u003E\\u003Cdiv class=\\\"alert-image\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"display-inline-block\\\"\\u003E\" + (pug.escape(null == (pug_interp = SuggestedLanguagesDescription) ? \"\" : pug_interp)) + \"\\u003Cdiv class=\\\"form\\\" data-bind=\\\"foreach: {data: suggestedLanguagesName, as: 'suggestedLanguage'}\\\"\\u003E\\u003Cdiv class=\\\"suggested-language\\\" data-bind=\\\"text: suggestedLanguage\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Ca class=\\\"target-suggested-language\\\" data-bind=\\\"click: targetSuggestedLanguages\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('TargetSuggestedLanguage')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"language-display\\\" data-bind=\\\"visible:!inEditMode()\\\"\\u003E\\u003Cdiv class=\\\"language-name col-xs-2\\\"\\u003E\" + (pug.escape(null == (pug_interp = SelectedLanguages) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Ca class=\\\"update-to-edit-mode\\\" data-bind=\\\"click: inEditMode.bind($data,'true')\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Edit')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cform class=\\\"multi-language-selector\\\" data-bind=\\\"visible: inEditMode()\\\"\\u003E\";\n// iterate languageOptions\n;(function(){\n var $$obj = languageOptions;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var language = $$obj[pug_index0];\nvar singleLine = inSingleColumnVersion || language.Value === 'All';\npug_html = pug_html + \"\\u003Clabel\" + (pug.attr(\"class\", pug.classes([\"checkbox-inline\",singleLine ? 'col-xs-12' : 'col-xs-4'], [false,true]), false, true)) + \"\\u003E\\u003Cinput\" + (\" type=\\\"checkbox\\\"\"+pug.attr(\"value\", language.Value, true, true)+pug.attr(\"data-bind\", `css: { checked: selectedLanguages().indexOf('${language.Value}') >= 0 }, checked: selectedLanguages, enable: !allLanguageExclusive() || '${language.Value}' === 'All' || !allLanguageSelected()`, true, true)) + \"\\u003E\\u003Cdiv class=\\\"text\\\"\\u003E\" + (pug.escape(null == (pug_interp = language.Text) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var language = $$obj[pug_index0];\nvar singleLine = inSingleColumnVersion || language.Value === 'All';\npug_html = pug_html + \"\\u003Clabel\" + (pug.attr(\"class\", pug.classes([\"checkbox-inline\",singleLine ? 'col-xs-12' : 'col-xs-4'], [false,true]), false, true)) + \"\\u003E\\u003Cinput\" + (\" type=\\\"checkbox\\\"\"+pug.attr(\"value\", language.Value, true, true)+pug.attr(\"data-bind\", `css: { checked: selectedLanguages().indexOf('${language.Value}') >= 0 }, checked: selectedLanguages, enable: !allLanguageExclusive() || '${language.Value}' === 'All' || !allLanguageSelected()`, true, true)) + \"\\u003E\\u003Cdiv class=\\\"text\\\"\\u003E\" + (pug.escape(null == (pug_interp = language.Text) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fform\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"Description\" in locals_for_with?locals_for_with.Description:typeof Description!==\"undefined\"?Description:undefined,\"SelectedLanguages\" in locals_for_with?locals_for_with.SelectedLanguages:typeof SelectedLanguages!==\"undefined\"?SelectedLanguages:undefined,\"SuggestedLanguagesDescription\" in locals_for_with?locals_for_with.SuggestedLanguagesDescription:typeof SuggestedLanguagesDescription!==\"undefined\"?SuggestedLanguagesDescription:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"inSingleColumnVersion\" in locals_for_with?locals_for_with.inSingleColumnVersion:typeof inSingleColumnVersion!==\"undefined\"?inSingleColumnVersion:undefined,\"languageOptions\" in locals_for_with?locals_for_with.languageOptions:typeof languageOptions!==\"undefined\"?languageOptions:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (closeLabel, contents) {pug_html = pug_html + \"\\u003Cdiv\" + (\" class=\\\"popup__close clickable\\\"\"+\" role=\\\"button\\\"\"+pug.attr(\"aria-label\", closeLabel, true, true)+\" tabindex=\\\"0\\\"\") + \"\\u003E\\u003Cspan class=\\\"glyphicon glyphicon-remove\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"popup__contents\\\"\\u003E\" + (null == (pug_interp = contents) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"closeLabel\" in locals_for_with?locals_for_with.closeLabel:typeof closeLabel!==\"undefined\"?closeLabel:undefined,\"contents\" in locals_for_with?locals_for_with.contents:typeof contents!==\"undefined\"?contents:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (dragging, val) {pug_html = pug_html + (null == (pug_interp = val) ? \"\" : pug_interp) + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"grabber\",{dragging: dragging}], [false,true]), false, true)) + \"\\u003E\\u003Cdiv class=\\\"grabberBar\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"dragging\" in locals_for_with?locals_for_with.dragging:typeof dragging!==\"undefined\"?dragging:undefined,\"val\" in locals_for_with?locals_for_with.val:typeof val!==\"undefined\"?val:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function ($html, ariaLabel, classes, gridEditIconTitle, text) {pug_html = pug_html + \"\\u003Cdiv class=\\\"grid-editable-cell-container\\\"\\u003E\" + (null == (pug_interp = $html) ? \"\" : pug_interp) + (pug.escape(null == (pug_interp = text) ? \"\" : pug_interp)) + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"grid-edit-icon\",classes], [false,true]), false, true)+pug.attr(\"title\", gridEditIconTitle, true, true)+\" role=\\\"button\\\" tabindex=\\\"0\\\"\"+pug.attr(\"aria-label\", ariaLabel, true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"$html\" in locals_for_with?locals_for_with.$html:typeof $html!==\"undefined\"?$html:undefined,\"ariaLabel\" in locals_for_with?locals_for_with.ariaLabel:typeof ariaLabel!==\"undefined\"?ariaLabel:undefined,\"classes\" in locals_for_with?locals_for_with.classes:typeof classes!==\"undefined\"?classes:undefined,\"gridEditIconTitle\" in locals_for_with?locals_for_with.gridEditIconTitle:typeof gridEditIconTitle!==\"undefined\"?gridEditIconTitle:undefined,\"text\" in locals_for_with?locals_for_with.text:typeof text!==\"undefined\"?text:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (val) {pug_html = pug_html + (null == (pug_interp = val) ? \"\" : pug_interp) + \"\\u003Cdiv class=\\\"dragger\\\"\\u003E\\u003Cdiv class=\\\"dragger-bar\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"val\" in locals_for_with?locals_for_with.val:typeof val!==\"undefined\"?val:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (childStyle, parentStyle) {pug_html = pug_html + \"\\u003Cdiv\" + (\" class=\\\"bar-parent\\\"\"+pug.attr(\"style\", pug.style(parentStyle), true, true)) + \"\\u003E\\u003Cdiv\" + (\" class=\\\"bar-child\\\"\"+pug.attr(\"style\", pug.style(childStyle), true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"childStyle\" in locals_for_with?locals_for_with.childStyle:typeof childStyle!==\"undefined\"?childStyle:undefined,\"parentStyle\" in locals_for_with?locals_for_with.parentStyle:typeof parentStyle!==\"undefined\"?parentStyle:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (bulkEditMode, i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"custom-params-template\\\"\\u003E\\u003Cdiv data-bind=\\\"visible: showNone()\\\"\\u003E\\u003Cspan class=\\\"control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UrlOptions_None')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Ctable class=\\\"full-width\\\" data-bind=\\\"visible: editMode()\\\" role=\\\"presentation\\\"\\u003E\\u003Ctbody data-bind=\\\"foreach: parameters\\\"\\u003E\\u003Ctr class=\\\"custom-param-entry\\\"\\u003E\\u003Ctd data-bind=\\\"css: {'custom-param__bulk-first-row': $parent.parameters().length < 2 && $index() === 0}\\\"\\u003E\\u003Cdiv class=\\\"flex-row-fixed custom-param__key-container\\\"\\u003E\\u003Clabel class=\\\"control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = '{ _') ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\";\nvar keyPlaceHolder = bulkEditMode ? i18n.getString('Input_NoChange_PlaceHolder') : i18n.getString('CustomParameters_Placeholder_Key');\npug_html = pug_html + \"\\u003Cinput\" + (\" class=\\\"form-control custom-param__key-field\\\"\"+\" type=\\\"text\\\" data-bind=\\\"disable: $root.isDisabled, value: key, attr: {'aria-label': $root.getInputAriaLabel($index())}\\\"\"+pug.attr(\"placeholder\", keyPlaceHolder, true, true)+\" maxlength=\\\"16\\\"\") + \"\\u003E\\u003Clabel class=\\\"control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = '} =') ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cspan class=\\\"flex-row-dynamic\\\"\\u003E\";\nvar valuePlaceHolder = bulkEditMode ? i18n.getString('Input_NoChange_PlaceHolder') : i18n.getString('CustomParameters_Placeholder_Value')\npug_html = pug_html + \"\\u003Cinput\" + (\" class=\\\"form-control custom-param__value-field\\\"\"+\" type=\\\"text\\\" data-bind=\\\"disable: $root.isDisabled, value: val, attr: { maxlength: $root.valueMaxLength, 'aria-label': $root.getInputAriaLabel($index(), false)}\\\"\"+pug.attr(\"placeholder\", valuePlaceHolder, true, true)) + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Ftd\\u003E\\u003Ctd data-bind=\\\"style: { visibility: $root.bulkEditShowAddLabel() && $index() !== 0 ? "visible" : "hidden" }\\\"\\u003E\\u003C!-- ko if: $root.isDisabled--\\u003E\\u003Cdiv class=\\\"iconba iconba-Cancel control-label closeimage custom-param__close-button disabled\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003C!-- ko ifnot: $root.isDisabled--\\u003E\\u003Cdiv class=\\\"iconba iconba-Cancel control-label closeimage clickable custom-param__close-button\\\" data-bind=\\\"click: function(data, event) { event.stopPropagation(); $root.removeCustomParamEntry($index())}, attr: {'aria-label': $root.getRemoveButtonAriaLabel($index())}\\\" tabindex=\\\"0\\\" role=\\\"button\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003C\\u002Ftd\\u003E\\u003C\\u002Ftr\\u003E\\u003Ctr\\u003E\\u003Ctd\\u003E\\u003Cdiv class=\\\"font-error\\\"\\u003E\\u003Cul data-bind=\\\"foreach:errorMessages\\\"\\u003E\\u003Cli\\u003E\\u003Cspan data-bind=\\\"text: $data\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Ftd\\u003E\\u003C\\u002Ftr\\u003E\\u003C\\u002Ftbody\\u003E\\u003C\\u002Ftable\\u003E\";\nvar addAnother = i18n.getString('BulkEdit_UrlOptions_CustomParameters_AddAnother')\npug_html = pug_html + \"\\u003C!-- ko if: $root.isDisabled--\\u003E\\u003Cspan class=\\\"add-another-link inactive\\\" data-bind=\\\"visible: showAddLable\\\"\\u003E\" + (pug.escape(null == (pug_interp = addAnother) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003C!-- ko ifnot: $root.isDisabled--\\u003E\\u003Ca class=\\\"add-another-link\\\" data-bind=\\\"visible: showAddLable, click: addCustomParamEntry\\\" href=\\\"javascript:void(0)\\\" role=\\\"button\\\"\\u003E\" + (pug.escape(null == (pug_interp = addAnother) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003Cdiv class=\\\"checkbox\\\" data-bind=\\\"visible: $root.bulkEditShowMatchCase()\\\"\\u003E\\u003Clabel\\u003E\\u003Cinput name=\\\"match-case-checkbox\\\" type=\\\"checkbox\\\" data-bind=\\\"disable: $root.isDisabled, checked: bulkEditMatchCaseSelected\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('BulkEdit_UrlOptions_CustomParameters_MatchCase')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-bind=\\\"visible: !editMode(), foreach:parameters\\\"\\u003E\\u003Cdiv class=\\\"row\\\" data-bind=\\\"visible:$data.key\\\"\\u003E\\u003Cdiv class=\\\"form-inline col-sm-12\\\"\\u003E\\u003Cspan class=\\\"control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = '{_') ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"control-label\\\" data-bind=\\\"text:$data.key()\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = '} = ') ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"control-label\\\" data-bind=\\\"text:$data.val()\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"font-error\\\" data-bind=\\\"visible: errorMessages().length > 0 || parametersError().length > 0\\\"\\u003E\\u003Cul data-bind=\\\"visible: errorMessages().length > 0, foreach:errorMessages\\\" role=\\\"alert\\\"\\u003E\\u003Cli\\u003E\\u003Cspan class=\\\"is-error\\\" data-bind=\\\"text: $data\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003Cul data-bind=\\\"parametersError().length > 0, foreach:parametersError\\\" role=\\\"alert\\\"\\u003E\\u003Cli\\u003E\\u003Cspan class=\\\"is-error\\\" data-bind=\\\"text: $data.message\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"bulkEditMode\" in locals_for_with?locals_for_with.bulkEditMode:typeof bulkEditMode!==\"undefined\"?bulkEditMode:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n, readOnly) {pug_html = pug_html + \"\\u003C!-- ko if: editMode()--\\u003E\\u003Cinput\" + (\" class=\\\"form-control full-width\\\"\"+\" type=\\\"text\\\" name=\\\"FinalUrlSuffix\\\" data-bind=\\\"value: finalUrlSuffix, attr: {maxlength: maxLength, "aria-invalid": errorMessages().length > 0, "placeholder": placeholderText}\\\"\"+pug.attr(\"aria-label\", i18n.getString('FinalUrlSuffix_Label'), true, true)+\" aria-describedby=\\\"FinalUrlSuffixErrors FinalUrlSuffixExample\\\"\"+pug.attr(\"disabled\", readOnly, true, true)) + \"\\u003E\\u003Cdiv class=\\\"charactersRemaining\\\"\\u003E\\u003Cspan id=\\\"FinalUrlSuffixExample\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('FinalUrlSuffix_Example')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"font-error\\\"\\u003E\\u003Cul id=\\\"FinalUrlSuffixErrors\\\" data-bind=\\\"foreach:errorMessages\\\" role=\\\"alert\\\"\\u003E\\u003Cli\\u003E\\u003Cspan class=\\\"is-error\\\" data-bind=\\\"html: $data\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003Cul id=\\\"FinalUrlSuffixExternalErrors\\\" data-bind=\\\"foreach:externalErrors\\\" role=\\\"alert\\\"\\u003E\\u003Cli\\u003E\\u003Cspan class=\\\"is-error\\\" data-bind=\\\"html: $data\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003Cspan class=\\\"control-label\\\" data-bind=\\\"visible: !editMode(), text: finalUrlSuffix\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv data-bind=\\\"visible: showNone()\\\"\\u003E\\u003Cspan class=\\\"control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UrlOptions_None')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"readOnly\" in locals_for_with?locals_for_with.readOnly:typeof readOnly!==\"undefined\"?readOnly:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (customClass, i18n) {pug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([(customClass || '')], [true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"childView\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cinput\" + (\" class=\\\"grid-edit-menu grid-popupeditor-save btn btn-primary\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", i18n.getString('Save'), true, true)+\" data-bind=\\\"enable: isValid\\\"\") + \"\\u003E\\u003Cinput\" + (\" class=\\\"grid-popupeditor-cancel btn btn-default grid-edit-menu\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", i18n.getString('Cancel'), true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cul class=\\\"grid-error-list\\\" data-bind=\\\"visible: error().length > 0\\\"\\u003E\\u003Cdiv class=\\\"grid-error spritedimage\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cspan class=\\\"error\\\" data-bind=\\\"html: error\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Ful\\u003E\";}.call(this,\"customClass\" in locals_for_with?locals_for_with.customClass:typeof customClass!==\"undefined\"?customClass:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003C!-- ko if: editMode()--\\u003E\\u003Cinput\" + (\" class=\\\"form-control\\\"\"+\" type=\\\"text\\\" name=\\\"TrackingTemplate\\\" data-bind=\\\"value: trackingTemplate, attr: {class: inputClass, maxlength: maxLength, "aria-invalid": errorMessages().length > 0}\\\"\"+pug.attr(\"aria-label\", i18n.getString('TrackingTemplate_Label'), true, true)+\" aria-describedby=\\\"TrackingTemplateErrors TrackingTemplateExample\\\"\") + \"\\u003E\\u003Cdiv class=\\\"uurl-test-tool__container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"charactersRemaining\\\"\\u003E\\u003Cspan id=\\\"TrackingTemplateExample\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('TrackingTemplate_Example')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"font-error\\\"\\u003E\\u003Cul id=\\\"TrackingTemplateErrors\\\" data-bind=\\\"foreach:errorMessages\\\" role=\\\"alert\\\"\\u003E\\u003Cli\\u003E\\u003Cspan class=\\\"is-error\\\" data-bind=\\\"html: $data\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-test-info__container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003Cspan class=\\\"control-label\\\" data-bind=\\\"visible: !editMode(), text: trackingTemplate\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv data-bind=\\\"visible: showNone()\\\"\\u003E\\u003Cspan class=\\\"control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UrlOptions_None')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"radio\\\"\\u003E\\u003Clabel\\u003E\\u003Cinput class=\\\"radio-final-url\\\" type=\\\"radio\\\" name=\\\"isFinalUrl\\\" value=\\\"true\\\" data-bind=\\\"checked:isFinalUrl.Editing\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('FinalUrl_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"radio\\\"\\u003E\\u003Clabel\\u003E\\u003Cinput class=\\\"radio-destination-url\\\" type=\\\"radio\\\" name=\\\"isFinalUrl\\\" value=\\\"false\\\" data-bind=\\\"checked:isFinalUrl.Editing\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Ad_DestinationUrl')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n, showDestinationUrl) {pug_mixins[\"popupHelp\"] = pug_interp = function(popupId, arialLabelText, i18n){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" type=\\\"helppopup\\\"\"+pug.attr(\"topic\", popupId, true, true)+pug.attr(\"data-help\", true, true, true)+\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\"\"+pug.attr(\"aria-label\", i18n.getString('LearnMore') + ': ' + arialLabelText, true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv class=\\\"fieldRowAd\\\"\\u003E\\u003C!--final url form-group--\\u003E\";\nif (showDestinationUrl) {\npug_html = pug_html + (\"\\u003Cdiv class=\\\"with-destination-url-container\\\"\\u003E\\u003Clabel class=\\\"col-sm-4 control-label\\\" data-bind=\\\"visible: showTitles()\\\" style=\\\"margin-top:0px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('LandingPage_Label')) ? \"\" : pug_interp)));\npug_mixins[\"popupHelp\"]('pop_BA_NewCampaignCreate_Ad_LandingPage', i18n.getString('LandingPage_Label'), i18n);\npug_html = pug_html + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"fieldItemAd\\\" data-bind=\\\"css: {'col-sm-8': showTitles(), 'col-sm-12': !showTitles()}\\\"\\u003E\\u003Cdiv class=\\\"final-url\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + (\"\\u003Cdiv\\u003E\\u003Clabel class=\\\"col-sm-4 control-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Ad_FinalUrl')) ? \"\" : pug_interp)));\npug_mixins[\"popupHelp\"]('pop_BA_NewAdCreate_FinalURL', i18n.getString('Ad_FinalUrl'), i18n);\npug_html = pug_html + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + (\"\\u003C!--url form-group--\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003C!--offset by 4 because the url does not have title--\\u003E\\u003Cdiv class=\\\"fieldItemAd\\\" data-bind=\\\"css: {'col-sm-offset-4': showTitles()}\\\"\\u003E\\u003Cdiv class=\\\"url\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!--ko if: showUpgradeWarning--\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"div\\\" data-bind=\\\"css: {'col-sm-offset-4': showTitles()}\\\"\\u003E\\u003Cdiv class=\\\"alert alert-warning\\\"\\u003E\\u003Cdiv class=\\\"alert-image\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('BulkEdit_UrlOptions_UpgradeWarning')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Ca class=\\\"HelpTopic\\\" query=\\\"help:app51230\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('LearnMore')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\\u003Cdiv class=\\\"form-group\\\" data-bind=\\\"visible: landingPageUrlErrorMessages().length > 0\\\"\\u003E\\u003Cdiv class=\\\"div\\\" data-bind=\\\"css: {'col-sm-offset-4': showTitles()}\\\"\\u003E\\u003Cdiv class=\\\"font-error container-fluid\\\"\\u003E\\u003Cul data-bind=\\\"foreach:landingPageUrlErrorMessages\\\"\\u003E\\u003Cli\\u003E\\u003Cspan class=\\\"is-error\\\" data-bind=\\\"text: $data\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!--mobile url form-group--\\u003E\\u003Cdiv class=\\\"form-group\\\" data-bind=\\\"visible: mobileUrlVisible\\\"\\u003E\\u003Cdiv\\u003E\\u003Clabel class=\\\"col-sm-4 control-label\\\" data-bind=\\\"visible: showTitles()\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('MobileFinalUrl_Label')) ? \"\" : pug_interp)));\npug_mixins[\"popupHelp\"]('pop_BA_NewCampaignCreate_Ad_MobileURL', i18n.getString('MobileFinalUrl_Label'), i18n);\npug_html = pug_html + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"fieldItemAd\\\" data-bind=\\\"css: {'col-sm-offset-4': showTitles()}\\\"\\u003E\\u003Cdiv class=\\\"mobile-url\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group\\\" data-bind=\\\"visible: mobileUrlVisible() && errorMessages().length > 0\\\"\\u003E\\u003Cdiv class=\\\"div\\\" data-bind=\\\"css: {'col-sm-offset-4': showTitles()}\\\"\\u003E\\u003Cdiv class=\\\"font-error container-fluid\\\"\\u003E\\u003Cul data-bind=\\\"foreach:errorMessages\\\"\\u003E\\u003Cli\\u003E\\u003Cspan class=\\\"is-error\\\" data-bind=\\\"text: $data\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"showDestinationUrl\" in locals_for_with?locals_for_with.showDestinationUrl:typeof showDestinationUrl!==\"undefined\"?showDestinationUrl:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (ariaLabelledby, urlPlaceholder) {pug_html = pug_html + \"\\u003Cselect\" + (\" class=\\\"form-control flex-row-fixed url-protocol\\\"\"+\" id=\\\"protocolOptions\\\" data-bind=\\\"options: protocols, optionsText: "Text", optionsValue: "Value", value: protocol, disable: isDisabled\\\"\"+pug.attr(\"aria-labelledby\", ariaLabelledby, true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003Cinput\" + (\" class=\\\"form-control url-field\\\"\"+pug.attr(\"placeholder\", urlPlaceholder, true, true)+\" type=\\\"text\\\" data-bind=\\\"value: urlWithoutProtocol, valueUpdate: "input", attr: { maxlength: maxLength, "aria-describedby": errorContainer, "aria-invalid": errorMessage().length > 0 }, disable: isDisabled, css: {error: hasErrors}\\\"\"+pug.attr(\"aria-labelledby\", ariaLabelledby, true, true)) + \"\\u003E\\u003C!--ko if: errorMessage().length \\u003E 0--\\u003E\\u003Cdiv class=\\\"error is-error\\\" data-bind=\\\"html: errorMessage\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko--\\u003E\";}.call(this,\"ariaLabelledby\" in locals_for_with?locals_for_with.ariaLabelledby:typeof ariaLabelledby!==\"undefined\"?ariaLabelledby:undefined,\"urlPlaceholder\" in locals_for_with?locals_for_with.urlPlaceholder:typeof urlPlaceholder!==\"undefined\"?urlPlaceholder:undefined));;return pug_html;};\nmodule.exports = template;","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=\\\"container-fluid\\\"\\u003E\" + (null == (pug_interp = require(\"./url-input-core.pug\").call(this, locals)) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (attributes, finalUrl, finalUrlSuffix, i18n, index, landingUrl, resultString, resultType, servingUrl, trackingTemplate) {\n\n\n\npug_mixins[\"collapsibleUrl\"] = pug_interp = function(key, url, level){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\nvar dataTarget = '.result-' + key + '-' + index;\nvar resultClass = 'result-' + key\nvar resultIndexClass = 'result-' + key + ' result-' + key + '-' + index\nif (url && url.length > 40) {\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"collapse\",\"in\",\"uurl-no-transition\",resultIndexClass], [false,false,false,true]), false, true)+\" aria-expanded=\\\"true\\\"\") + \"\\u003E\\u003Cspan class=\\\"uurl-url\\\"\\u003E\" + (pug.escape(null == (pug_interp = url.substr(0, 40) + ' ...') ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Ca\" + (\" class=\\\"uurl-url-toggle clickable\\\"\"+\" data-toggle=\\\"collapse\\\"\"+pug.attr(\"data-target\", dataTarget, true, true)+\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Url_Expand_Button')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\nif (level) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-level\\\"\\u003E\" + (pug.escape(null == (pug_interp = level) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"collapse\",\"uurl-no-transition\",resultIndexClass], [false,false,true]), false, true)+\" aria-expanded=\\\"false\\\"\") + \"\\u003E\\u003Cspan class=\\\"uurl-url\\\"\\u003E\" + (pug.escape(null == (pug_interp = url) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Ca\" + (\" class=\\\"uurl-url-toggle clickable\\\"\"+\" data-toggle=\\\"collapse\\\"\"+pug.attr(\"data-target\", dataTarget, true, true)+\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Url_Collapse_Button')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\nif (level) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-level\\\"\\u003E\" + (pug.escape(null == (pug_interp = level) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"uurl-url\",resultClass], [false,true]), false, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = url) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\nif (level) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-level\\\"\\u003E\" + (pug.escape(null == (pug_interp = level) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\n}\n};\nif (resultString) {\npug_html = pug_html + \"\\u003Cdl\\u003E\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\";\nif (resultType == 0) {\npug_html = pug_html + \"\\u003Cspan class=\\\"status-icon\\\"\\u003E\\u003Cdiv class=\\\"glyph-status-ok page-found-icon\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan class=\\\"status-icon\\\"\\u003E\\u003Cdiv class=\\\"status_warning\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003Cstrong class=\\\"result-string\\\"\\u003E\" + (pug.escape(null == (pug_interp = resultString + ' ') ? \"\" : pug_interp)) + \"\\u003C\\u002Fstrong\\u003E\\u003Ca class=\\\"HelpTopic\\\" query=\\\"help:app54560\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('LearnMore')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003Cdiv\\u003E\";\nif (landingUrl && landingUrl.Value && resultType == 2) {\npug_mixins[\"collapsibleUrl\"]('landingUrl', landingUrl.Value);\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (servingUrl && servingUrl.Value) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_ServingURL')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\\u003Ca\" + (\" class=\\\"uurl-url result-servingUrl\\\"\"+pug.attr(\"href\", servingUrl.Value, true, true)+\" target=\\\"_blank\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = servingUrl.Value) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdl\\u003E\";\n}\nif (trackingTemplate && trackingTemplate.Value) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_TrackingTemplate')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\";\npug_mixins[\"collapsibleUrl\"]('trackingTemplate', trackingTemplate.Value, trackingTemplate.Level);\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\nif (finalUrlSuffix && finalUrlSuffix.Value) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_FinalURLSuffix')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\";\npug_mixins[\"collapsibleUrl\"]('finalUrlSuffix', finalUrlSuffix.Value, finalUrlSuffix.Level);\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\nif (finalUrl && finalUrl.Value) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_FinalURL')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\";\npug_mixins[\"collapsibleUrl\"]('finalUrl', finalUrl.Value, finalUrl.Level);\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\nif (attributes && attributes.length != 0) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section result-attributes\\\"\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_AttributeUsed')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\";\n// iterate attributes\n;(function(){\n var $$obj = attributes;\n if ('number' == typeof $$obj.length) {\n for (var index = 0, $$l = $$obj.length; index < $$l; index++) {\n var attribute = $$obj[index];\nif (index == 0 && attribute.Key.indexOf('lpurl') != -1) {\npug_html = pug_html + (\"\\u003Cspan class=\\\"uurl-url result-attribute\\\"\\u003E\" + (pug.escape(null == (pug_interp = attribute.Key + ': ') ? \"\" : pug_interp)));\npug_mixins[\"collapsibleUrl\"]('lpUrl', attribute.Value, attribute.Level);\npug_html = pug_html + \"\\u003C\\u002Fspan\\u003E\";\n}\nelse {\npug_html = pug_html + (\"\\u003Cdd class=\\\"uurl-url result-attribute\\\"\\u003E\" + (pug.escape(null == (pug_interp = attribute.Key + ': ' + attribute.Value) ? \"\" : pug_interp)));\nif (attribute.Level) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-level\\\"\\u003E\" + (pug.escape(null == (pug_interp = attribute.Level) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdd\\u003E\";\n}\n }\n } else {\n var $$l = 0;\n for (var index in $$obj) {\n $$l++;\n var attribute = $$obj[index];\nif (index == 0 && attribute.Key.indexOf('lpurl') != -1) {\npug_html = pug_html + (\"\\u003Cspan class=\\\"uurl-url result-attribute\\\"\\u003E\" + (pug.escape(null == (pug_interp = attribute.Key + ': ') ? \"\" : pug_interp)));\npug_mixins[\"collapsibleUrl\"]('lpUrl', attribute.Value, attribute.Level);\npug_html = pug_html + \"\\u003C\\u002Fspan\\u003E\";\n}\nelse {\npug_html = pug_html + (\"\\u003Cdd class=\\\"uurl-url result-attribute\\\"\\u003E\" + (pug.escape(null == (pug_interp = attribute.Key + ': ' + attribute.Value) ? \"\" : pug_interp)));\nif (attribute.Level) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-level\\\"\\u003E\" + (pug.escape(null == (pug_interp = attribute.Level) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdd\\u003E\";\n}\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cspan class=\\\"status-icon\\\"\\u003E\\u003Cdiv class=\\\"glyph-info\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Note_Title')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\\u003Cdd\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Note')) ? \"\" : pug_interp)) + \"\\u003Ca class=\\\"HelpTopic\\\" query=\\\"help:app54543\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('LearnMore')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdd\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"attributes\" in locals_for_with?locals_for_with.attributes:typeof attributes!==\"undefined\"?attributes:undefined,\"finalUrl\" in locals_for_with?locals_for_with.finalUrl:typeof finalUrl!==\"undefined\"?finalUrl:undefined,\"finalUrlSuffix\" in locals_for_with?locals_for_with.finalUrlSuffix:typeof finalUrlSuffix!==\"undefined\"?finalUrlSuffix:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"index\" in locals_for_with?locals_for_with.index:typeof index!==\"undefined\"?index:undefined,\"landingUrl\" in locals_for_with?locals_for_with.landingUrl:typeof landingUrl!==\"undefined\"?landingUrl:undefined,\"resultString\" in locals_for_with?locals_for_with.resultString:typeof resultString!==\"undefined\"?resultString:undefined,\"resultType\" in locals_for_with?locals_for_with.resultType:typeof resultType!==\"undefined\"?resultType:undefined,\"servingUrl\" in locals_for_with?locals_for_with.servingUrl:typeof servingUrl!==\"undefined\"?servingUrl:undefined,\"trackingTemplate\" in locals_for_with?locals_for_with.trackingTemplate:typeof trackingTemplate!==\"undefined\"?trackingTemplate:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n, resultList, resultListTrackingTemplate) {\n\n\n\npug_mixins[\"urlResultRow\"] = pug_interp = function(itemName, url, resultType, resultString, key, index){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section uurl-result-list\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-url\\\"\\u003E\";\nif (itemName) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-result-row-title\\\"\\u003E\" + (pug.escape(null == (pug_interp = itemName) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"uurl-result-hover-link\",\"clickable\",key], [false,false,true]), false, true)+pug.attr(\"title\", url, true, true)+pug.attr(\"data-index\", index, true, true)+\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = url) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-mid\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-string\\\"\\u003E\";\nvar className = key + 'Result';\nif (resultType == 0) {\npug_html = pug_html + \"\\u003Cspan class=\\\"status-icon\\\"\\u003E\\u003Cdiv class=\\\"glyph-status-ok page-found-icon\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"result-string\",className], [false,true]), false, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = resultString) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan class=\\\"status-icon\\\"\\u003E\\u003Cdiv class=\\\"status_warning\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"result-string\",className], [false,true]), false, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = resultString) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n};\npug_mixins[\"urlResultEntity\"] = pug_interp = function(pt, sq, adGroupName, index){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-entity\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-entity-left\\\"\\u003E\";\nif (pt.trackingTemplate && pt.trackingTemplate.Value) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\\u003Cdt style=\\\"display: inline-block; margin-right: 3px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_With_ParallelTracking')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\\u003Ca class=\\\"helpbutton\\\" type=\\\"helppopup\\\" topic=\\\"pop_BA_URLoptions_ParallelTracking\\\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\" aria-label=\\\"Learn more Parallel Tracking\\\"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\npug_mixins[\"urlResultRow\"](i18n.getString('UURLTestTool_LandingPage_URL') + ' ', pt.landingUrl ? pt.landingUrl.Value : (pt.servingUrl ? pt.servingUrl.Value : ''), pt.resultType, pt.resultString, 'ptLandingUrl', index);\npug_mixins[\"urlResultRow\"](i18n.getString('UURLTestTool_Tracking_URL') + ' ', pt.trackingUrl ? pt.trackingUrl.Value : '', pt.trackingResultType, pt.trackingResultString, 'ptTrackingUrl', index);\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\" style=\\\"margin-top: 16px;\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_When_ParallelTracking_Is_Not_Supported')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_mixins[\"urlResultRow\"]('', sq.servingUrl ? sq.servingUrl.Value : '', sq.resultType, sq.resultString, 'sqServingUrl', index);\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-entity-right\\\"\\u003E\";\nif (pt.trackingTemplate && pt.trackingTemplate.Value) {\npug_html = pug_html + \"\\u003Cdiv style=\\\"height: 32px\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = adGroupName) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdt\\u003E\\u003Cspan class=\\\"tracking-template-title\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_TrackingTemplate_Colon')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cdiv class=\\\"result-trackingTemplate\\\"\\u003E\";\nif (resultListTrackingTemplate) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-url result-trackingTemplate\\\" style=\\\"font-weight: normal\\\"\\u003E\" + (pug.escape(null == (pug_interp = resultListTrackingTemplate) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-url result-trackingTemplate\\\" style=\\\"font-weight: normal\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_TrackingTemplate_None')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdt\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-header uurl-result-list\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-header-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_ClickURLs')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-mid\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-header-text\\\" style=\\\"display: inline-block; margin-right: 5px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Ca class=\\\"HelpTopic\\\" query=\\\"help:app54560\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('LearnMore')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-right\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-header-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_AdGroup')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-entity-list\\\"\\u003E\";\n// iterate resultList\n;(function(){\n var $$obj = resultList;\n if ('number' == typeof $$obj.length) {\n for (var index = 0, $$l = $$obj.length; index < $$l; index++) {\n var result = $$obj[index];\npug_mixins[\"urlResultEntity\"](result.pt, result.sq, result.adGroupName, index);\n }\n } else {\n var $$l = 0;\n for (var index in $$obj) {\n $$l++;\n var result = $$obj[index];\npug_mixins[\"urlResultEntity\"](result.pt, result.sq, result.adGroupName, index);\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"resultList\" in locals_for_with?locals_for_with.resultList:typeof resultList!==\"undefined\"?resultList:undefined,\"resultListTrackingTemplate\" in locals_for_with?locals_for_with.resultListTrackingTemplate:typeof resultListTrackingTemplate!==\"undefined\"?resultListTrackingTemplate:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n, pt, sq) {\n\n\n\npug_mixins[\"urlResultRow\"] = pug_interp = function(itemName, url, resultType, resultString, key){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\";\nif (itemName) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-result-row-title\\\"\\u003E\" + (pug.escape(null == (pug_interp = itemName) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"uurl-result-hover-link\",\"clickable\",key], [false,false,true]), false, true)+pug.attr(\"title\", url, true, true)+\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = url) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-right\\\"\\u003E\";\nvar className = key + 'Result';\nif (resultType == 0) {\npug_html = pug_html + \"\\u003Cspan class=\\\"status-icon\\\"\\u003E\\u003Cdiv class=\\\"glyph-status-ok page-found-icon\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"result-string\",className], [false,true]), false, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = resultString) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan class=\\\"status-icon\\\"\\u003E\\u003Cdiv class=\\\"status_warning\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"result-string\",className], [false,true]), false, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = resultString) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\"\\u003E\\u003Cdt\\u003E\\u003Cspan class=\\\"tracking-template-title\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_TrackingTemplate_Colon')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cdiv class=\\\"result-trackingTemplate\\\"\\u003E\";\nif (pt.trackingTemplate && pt.trackingTemplate.Value) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-url result-trackingTemplate\\\" style=\\\"font-weight: normal\\\"\\u003E\" + (pug.escape(null == (pug_interp = pt.trackingTemplate.Value) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\nelse\nif (sq.trackingTemplate && sq.trackingTemplate.Value) {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-url result-trackingTemplate\\\" style=\\\"font-weight: normal\\\"\\u003E\" + (pug.escape(null == (pug_interp = sq.trackingTemplate.Value) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan class=\\\"uurl-url result-trackingTemplate\\\" style=\\\"font-weight: normal\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Title_TrackingTemplate_None')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdt\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-header\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-header-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_ClickURLs')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-right\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-header-text\\\" style=\\\"display: inline-block; margin-right: 5px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Ca class=\\\"HelpTopic\\\" query=\\\"help:app54560\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('LearnMore')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-result-list-container\\\"\\u003E\";\nif (pt.trackingTemplate && pt.trackingTemplate.Value) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\" style=\\\"margin-top: 16px;\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\\u003Cdt style=\\\"display: inline-block; margin-right: 3px;\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_With_ParallelTracking')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\\u003Ca class=\\\"helpbutton\\\" type=\\\"helppopup\\\" topic=\\\"pop_BA_URLoptions_ParallelTracking\\\" onclick=\\\"PopupController.PopupJsClick(this)\\\" href=\\\"javascript:void(0);\\\" aria-label=\\\"Learn more Parallel Tracking\\\"\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\npug_mixins[\"urlResultRow\"](i18n.getString('UURLTestTool_LandingPage_URL') + ' ', pt.landingUrl ? pt.landingUrl.Value : (pt.servingUrl ? pt.servingUrl.Value : ''), pt.resultType, pt.resultString, 'ptLandingUrl');\npug_mixins[\"urlResultRow\"](i18n.getString('UURLTestTool_Tracking_URL') + ' ', pt.trackingUrl ? pt.trackingUrl.Value : '', pt.trackingResultType, pt.trackingResultString, 'ptTrackingUrl');\npug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-result-section\\\" style=\\\"margin-top: 16px;\\\"\\u003E\\u003Cdiv class=\\\"uurl-result-left\\\"\\u003E\\u003Cdt\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_When_ParallelTracking_Is_Not_Supported')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdt\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_mixins[\"urlResultRow\"]('', sq.servingUrl ? sq.servingUrl.Value : '', sq.resultType, sq.resultString, 'sqServingUrl');\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"pt\" in locals_for_with?locals_for_with.pt:typeof pt!==\"undefined\"?pt:undefined,\"sq\" in locals_for_with?locals_for_with.sq:typeof sq!==\"undefined\"?sq:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n, useDefaultStatusContainer) {if (useDefaultStatusContainer) {\npug_html = pug_html + \"\\u003Cspan class=\\\"tracking-template__test-button\\\"\\u003E\\u003Cinput\" + (\" class=\\\"testUurl btn btn-default\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", i18n.getString('UURLTestTool_Test_Button'), true, true)+pug.attr(\"aria-label\", i18n.getString('UURLTestTool_Test_Button'), true, true)+\" data-bind=\\\"attr: { disabled: showTesting() }\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cdiv class=\\\"uurl-test-info__container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan class=\\\"tracking-template__test-button\\\"\\u003E\\u003Cinput\" + (\" class=\\\"testUurl btn btn-default\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", i18n.getString('UURLTestTool_Test_Button'), true, true)+pug.attr(\"aria-label\", i18n.getString('UURLTestTool_Test_Button'), true, true)+\" data-bind=\\\"attr: { disabled: showTesting() }\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\";\n}}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"useDefaultStatusContainer\" in locals_for_with?locals_for_with.useDefaultStatusContainer:typeof useDefaultStatusContainer!==\"undefined\"?useDefaultStatusContainer:undefined));;return pug_html;};\nmodule.exports = template;","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;;var locals_for_with = (locals || {});(function (i18n, isForVNext) {pug_html = pug_html + \"\\u003Cdiv class=\\\"uurl-test-info\\\" data-bind=\\\"visible: showTesting()\\\"\\u003E\\u003Cspan class=\\\"loading-image\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"loading-text\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('UURLTestTool_Test_Inprogress')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"uurl-test-info\\\" data-bind=\\\"visible: resultString()\\\"\\u003E\\u003Cspan class=\\\"status-icon\\\" data-bind=\\\"visible: resultType() == 0\\\"\\u003E\\u003Cdiv class=\\\"glyph-status-ok page-found-icon\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"status-icon\\\" data-bind=\\\"visible: resultType() != 0\\\"\\u003E\\u003Cdiv class=\\\"status_warning\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fspan\\u003E\";\nif (isForVNext) {\npug_html = pug_html + \"\\u003Cspan\" + (\" class=\\\"resultString clickable\\\"\"+\" data-bind=\\\"text: resultString()\\\"\"+pug.attr(\"aria-label\", i18n.getString('UURLTestTool_Result_ShowDetails'), true, true)+\" role=\\\"button\\\" tabindex=\\\"0\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cspan class=\\\"resultString\\\" data-bind=\\\"text: resultString()\\\"\\u003E\\u003C\\u002Fspan\\u003E\";\n}\npug_html = pug_html + \"\\u003Cspan\" + (\" class=\\\"resultDetails status_icon detail-icon clickable\\\"\"+\" data-bind=\\\"visible: resultType() < 3\\\"\"+pug.attr(\"title\", i18n.getString('UURLTestTool_Result_ShowDetails'), true, true)+\" tabindex=\\\"0\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isForVNext\" in locals_for_with?locals_for_with.isForVNext:typeof isForVNext!==\"undefined\"?isForVNext:undefined));;return pug_html;};\nmodule.exports = template;"],"names":["getStyles","_","_ref","_ref$palette","palette","adDistributionContainer","marginBottom","backgroundColor","concat","white","display","textDecoration","marginLeft","marginRight","outline","border","color","themePrimary","lineHeight","fontSize","borderBottom","themeDarker","neutralSecondary","AdDistribution","React","props","setAdDistributionView","options","adDistributionReactWrapper","viewFactory","onViewCreated","arguments","length","undefined","_ref$managed","managed","onViewRemoved","getCreatedView","_useState","useState","_useState2","_slicedToArray","backboneView","setBackboneView","useEffect","view","_jsx","BackboneInstanceWrapper","instance","useBackboneView","useCallback","AdDistributionView","_objectSpread","render","classes","useDefaultStyles","className","classnames","children","defaultProps","LegacyAdDistributionWithValidation","updateValidation","activity","useContext","ActivityContext","onChange","newData","signal","JSON","stringify","adDistribution","fontWeight","ValidatedAdDistribution","withCustomValidation","entityIsAdGroup","entityIs","ServerValidatedAdDistribution","withControlErrorHandling","withUnvalidatedControlErrors","withError","filter","andComp","propertyIs","getLocalizationMapping","syndEnum","BingYahooOnly","_TL_","SearchPartnersOnly","BingYahooAndSearchPartners","AdDistributionWithValidationSection","data","onValidate","i18n","icon","rest","_objectWithoutProperties","_excluded","ValidatedPanel","title","TextTitle","titleKey","topicKey","details","getString","attentionBeaconProps","getExtraProps","getPanelErrorProps","campaignType","validationProps","schema","AdGroup","field","__","core","datePickerStyle","adScheduleContainer","width","creationCommonStyle","advancedSettingsSectionStyle","borderTop","paddingTop","paddingRight","float","toggleButtonStyle","paddingLeft","top","LegacyAdSchedule","container","entity","campaignDayTimeRanges","setAdScheduleView","level","hideUseCampaignSetting","hideMinuteOptions","showDateSettings","showBidAdjustmentColumn","i18nKeys","campaignAdScheduleUseSearcherTimeZone","useRef","deletedDayTimeCb","deletedDayTimeCriterions","each","criterion","Criterion","BidAdjustment","Status","Campaign","Id","adScheduleOption","useMemo","model","dayTimeRanges","timeZone","TimeZone","adScheduleUseSearcherTimeZone","AdScheduleUseSearcherTimeZone","hideAdScheduleBidAdjustments","activityLogger","isValid","updatedData","adSchedulesBulkUpsert","current","getAdScheduleUseSearcherTimeZone","adScheduleDateSettings","getDateSettings","deleteCb","AdScheduleView","$el","appendTo","getValues","remove","ref","Warning","LegacyAdScheduleWithCustomValidation","restProps","adSchedules","I18nContext","newIsValid","shouldDirty","ValidatedLegacyAdSchedule","minuteToSaveMap","ZERO","FIFTEEN","THIRTY","FORTY_FIVE","minuteMap","getMin","min","getTime","hour","is12","getAdScheduleDetails","adScheduleView","hideBidAdjustment","schedules","koModel","useCampaignSettings","dateSettings","EndDate","from","StartDate","to","timeDisplayType","len","forEach","schedule","index","dayTime","startHour","StartHour","endHour","EndHour","startMin","StartMinute","endMin","EndMinute","dateTimePart","day","getDay","Day","BidAdjustmentType","BidAdjustmentAmount","getDayTimeDetails","dataDateRanges","Today","Yesterday","ThisWeekFromSun","ThisWeekFromMon","Last7Days","LastWeekStartingSun","LastWeekStartingMon","LastBusinessWeek","Last14Days","ThisMonth","Last30Days","LastMonth","Last3Month","Last6Month","ThisYear","LastYear","AllTime","frequencyGrains","Hourly","Daily","Weekly","Monthly","Once","weeklyOptions","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","setupOptions","locKey","key","value","Value","Text","CustomDateSerializer","_createClass","date","_classCallCheck","this","year","getFullYear","month","getMonth","getDate","get","RuleCronSelectionviewModel","_ref2","_this","permissions","accountTimeZone","selectedRule","stateMgr","preferenceSvc","appCfg","isEmailOption","instrumentation","_ref3","frequencyGrain","dateRangePreset","monthlyOption","weeklyOption","dailyOption","timeZoneOption","runOnceDate","scenario","create","createRule","cronFormatter","CronFormatter","dataDateRangeOptions","monthlyOptions","i","dailyOptions","twelveHourDisplay","formatHourOfDay","twentyFourHourDisplay","slice","isTwelveHourDisplay","ko","IsUsePreferencesServiceEnabled","initialize","then","prefix","isTwelveHourDisplayPreference","findByName","result","Data","getItem","err","state","permanent","timeZoneOptions","zone","selectedDataDateRangeOption","selectedMonthOption","selectedWeekOption","selectedDailyOption","selectedTimeZoneOption","getDefaultTimeZone","selectedFrequencyGrain","subscribe","newValue","isTwelveHourDisplayFormat","read","write","v","Name","setAtUserLevel","setItem","isMonthOption","pure","isWeekOption","isOnceOption","isHourlyOption","frequencyErrorMessage","frequencyErrorRole","startInput","formatDate","trim","parseDate","IsHourlyNotifyMeRuleAllowed","isHourlyNotifyMeRuleAllowed","item","selectedTimeZone","toIANATimeZone","fromLegacyTimeZone","selectedTime","convertedSelectedTime","toString","raw","format","currentTime","Date","utcYear","getUTCFullYear","utcMonth","getUTCMonth","utcDate","getUTCDate","utcHours","getUTCHours","setFullYear","setMonth","setDate","getUTCNowCustomDateSerializer","convertedCurrentTime","trace","cron","toCronString","dayOfWeek","dayOfMonth","RuleCronSelectionview","_PureKnockoutView","_callSuper","_inherits","_ref$isForVNext","isForVNext","_superPropGet","renderRunOnceDatePicker","template","today","lastNDate","end","todayNYearsAgo","needToUpdateDate","selectedDate","runOnceDatePicker","DatePicker","minDate","maxDate","on","newDate","viewModel","trigger","setChild","getCron","validate","PureKnockoutView","emailOptions","Always","OnChangeOrError","OnError","None","scopeOptions","Selected","AllEnabled","AllButRemoved","entityRelatedOptions","EnabledStatusFilterValue","Ad","Keyword","AssetGroup","EnabledStatusFilterQueryOdata","EnabledStatusFilterColumn","RuleAuthoringViewModel","isActionText","currentUserId","maxRuleNameLength","inPreviewMode","menuAction","action","isEditRule","id","isEditRuleWithDifferentUser","modifiedBy","editRuleId","editRuleWarningMessage","replace","name","actionName","ruleName","titleName","actionText","titleDescription","showCampaigns","showAdGroups","showCampaignAdGroupSelector","isSelectorOpen","setupScopeOption","selectedScopeInfo","scopeInfo","selectedEmailOption","emailOption","scopeErrorMessage","ruleNameErrorMessage","selectedScopeOption","ruleNameErrorRole","scopeErrorRole","isResultValid","selectedRowIds","_this2","adGroupId","campaignId","allPages","push","defaultSelectedScopeOptionText","scopeOption","selectedRowCount","info","updatedScopeOptions","isCrossPageAllSelected","grid","pgridPlugins","crossPageSelectAll","isAllSelected","PauseActionValue","EntitySettingBase","accountCurrencyCode","bidBudgetRange","isActionNoneText","actionView","createActionView","setPreviewErrorHeaders","previewOldHeader","previewNewHeader","previewAttempedHeader","setUpPreviewEntityNameAndEntityKey","previewEntityName","previewEntityKeys","defaultEntityValue","results","formatBidBudget","formatStatus","formatEmail","getUserAction","Actions","Property","ActionType","changeBudgetActions","changeBidActions","nonTextActionsForKeyword","RaiseToTopOfPage","RaiseToFirstPage","ChangeBid","validateBidBudgetInput","usePercentValidation","valueRange","localizedErrors","decimalValue","parseDecimal","invalidPercentageError","invalidValueError","minValue","FloorValue","maxValue","Number","MAX_VALUE","CeilingValue","outOfRangError","validateBidInput","keywordBidRange","validateBudgetInput","budgetRange","defaultAction","budgetValue","unit","useLimitValue","limitValue","isDailyBudget","ChangeBudgetActionViewModel","nonTextActionInfo","nonTextAction","actions","selectedAction","budgetErrorMessage","budgetLimitErrorMessage","isIncreaseBudgetHelp","units","selectedUnit","limitBudgetLabelText","budgetAmount","numericActionTypes","changeByPercent","changeByAmount","Limit","ChangeBudgetActionView","CampaignSetting","_EntitySettingBase","bidType","bidValue","ChangeAdgroupBidActionViewModel","bidErrorMessage","bidLimitErrorMessage","bidTypes","selectedBidType","limitBidLabelText","bidAmount","ChangeAdgroupBidActionView","AdGroupSetting","ChangeKeywordBidActionViewModel","isChangeByBid","ChangKeywordBidActionView","KeywordSetting","AssetGroupSetting","replaceAtom","atom","oldKey","newKey","newAtom","_defineProperty","RuleAuthoringHelper","isSimulation","getCurrentFilter","selectAll","selectedCounts","idBased","FilterExpressions","Values","gridHelper","gridView","totalCountRows","selectedKeys","getSelectedRowIds","set","getCurrentSelection","toRuleDescription","currentFilter","query","filterEntity","selectionRangeFilterQuery","selection","CampaignId","AdGroupId","_grid$pgridPlugins$pa","pagination","pageSize","pageNumber","sortInfo","directionIndex","column","columnWithName","sortedKey","sortable","sortStr","cronselectionView","getSelectedDataDateRangeOption","DateRange","DateRangePreset","filterQueryUrl","odataV4","filterEncodedUrl","encodeURIComponent","filterURLParam","QueryString","predicateListView","filters","ids","SelectedColumn","SelectedOperator","join","selectedFilter","predicateListFilter","editableFilter","getFilterEntity","fromFilterEntityToLegacyFilter","expr","mappedResult","SelectedNames","legacyDeliveryStatus","Eligible","InlineOpportunity","finalQuery","$and","array","replaceKeyOfQuery","PredicateListContainer","_React$PureComponent","_this$props","PredicateList","getPredicateIconClassName","entitySchema","onEditableFilterUpdate","maximumPredicateLimit","MaximumPredicateLimit","popoverContainer","readOnlyProperties","predicateValueNameGetter","seasonalityPredicateValueNameGetter","PredicateListBackboneView","_Backbone$View","_ref$selectableFilter","selectableFilter","_ref$editableFilter","_ref$isPoPEnabled","isPoPEnabled","_ref$savedFilters","savedFilters","_ref$recentFilters","recentFilters","_ref$openedPredicateI","openedPredicateIndex","_ref$selector","selector","_ref$updateWaterfallF","updateWaterfallFilter","_ref$onApplySavedFilt","onApplySavedFilter","_ref$onApplyRecentFil","onApplyRecentFilter","_ref$maximumPredicate","_ref$readOnlyProperti","_ref$instrumentation","_ref$hideAddFilterBut","hideAddFilterButton","_ref$getPredicateIcon","ReactDOM","el","Backbone","RuleAuthoringView","scope","newI18n","CampaignAdgroupSelectorEdmView","currentEntity","PredicateListReact","SelectCampaignOrAdGroup","entitySetting","entitySettingMapping","campaign","keyword","adgroup","assetgroup","keyToUse","toLowerCase","getEntitySetting","helper","alertHelper","AlertHelper","initializeInstrumentation","onScopeSelectionChange","once","getActionView","filterService","localize","SchemaI18n","getEditableFilter","createFilterEntity","selected","isComparingEnabled","filterEntityOptions","predicateListViewWrapper","DeterministicViewForBackBoneView","PreviewResultView","columns","getPreviewHeaders","totalCount","monitor","previewRuleResults","selectorView","$","isCampaignMode","selectedItems","parse","updateSelectedEntityCount","_this3","filterString","list","uiblocker","withUiBlock","Campaigns","select","where","limit","fetch","entitySelection","status","setupCampaignAdGroupSelector","AdGroups","campaignName","getAction","xhr","response","errors","parseSync","responseText","Code","Router","navigate","isScheduleInvalid","throttLimitMsg","showError","migrationMsg","scheduleInvalidMsg","_this4","ruleUrlTmpl","url","ruleId","Entity","NotificationType","TimeZoneId","setAction","currentCustomerId","setSelectionAndDescription","save","success","hideView","refresh","showSuccess","error","onSaveOrPreviewRuleError","_this5","unset","getChild","update","formatPreviewResults","isActionValidate","hasInvalidProperties","convertFilterEntityToPredicates","some","editablePredicate","isDeletedProperty","isInvalidProperty","ko_model","items","filterItem","onValueChange","canApply","find","first","focus","_this6","directive","walkMe","walkMeLink","walkThrus","Walkme","default","WalkmeLink","whenLoaded","walkme","setType","setWalkthrus","link","changeBid","addClass","append","RuleAuthoringModel","_backbone$Model","odata","idAttribute","Selection","Description","PreviewEntityIds","selectedEntityCount","TotalRowCount","BulkEditResults","SelectedRule","getHours","EveryTimeThisRuleRuns","method","type","BatchAction","CurrentCustomerId","Type","NotificationMedium","Cron","jq_ajax_adapter","call","backbone","theme","bidStrategyContainer","mergeStyles","flexDirection","marginTop","margin","whiteSpace","verticalAlign","textAlign","neutralPrimary","listStyle","padding","height","boxSizing","borderRadius","paddingBottom","appearance","resize","LegacyBidStrategy","BiddingScheme","CampaignSettings","campaignLanguage","campaignSubType","entityType","hideHeader","popupIds","validateWithBudget","viewListener","clone","BiddingStrategyView","biddingStrategyType","biddingStrategyId","BidStrategyId","targetCpa","TargetCpa","targetRoas","TargetRoas","costPerSale","CostPerSale","TargetCostPerSale","maxCpc","MaxCpc","Amount","targetAdPosition","TargetAdPosition","targetImpressionShare","TargetImpressionShare","campaignSettings","withRealTimeUpdates","isAfterSave","isRenderedInReact","listenTo","stopListening","BidStrategy","ValidatedLegacyBidStrategy","isFromInitialization","newBiddingScheme","isEqual","capValue","substring","acrossAllPages","idsCount","expressions","expressionsToMap","resultFilter","Filter","setAmount","ViewModel","_ref$results","_ref$columns","currentPageChangeCount","changeText","updateResult","resultsToUse","totalResultCount","adTypes","getGenericAdPreview","entityValues","AdTitle","getResponsiveSearchAdPreview","previewValue","values","AdHeadlines","getTitlePreview","getResponsiveAdPreview","responsiveAdPreviewTemplate","itemViewModel","LandscapeImageMediaUrl","OriginalImageMediaUrl","Headline","AdHeadline","LongHeadline","AdLongHeadline","AdText","BusinessName","AdBusinessName","convertedDisplayUrl","AdDisplayUrl","withContainer","getDynamicSearchAdPreview","dynamicSearchAdPreviewTemplate","DisplayUrl","Path1","AdPath1","Path2","AdPath2","getAdEntityPreviewCell","adType","AdTitle2","getAdType","isHtml","formatValueToFixed","formatDecimalToFixed","parseFloat","formatEntityValue","entityKeys","EntityKey","it","indexOf","Key","rows","entityItem","Changes","OriginalValue","NewValue","getEl","closest","onSuccess","isCustomInMarketEnabled","audiencesPath","audienceLink","window","App","views","alertCenter","toastInfo","campaignBulkEdit","ChangeStatusView","ChangeStatusModel","ChangeBudgetView","ChangeBudgetModel","ChangeCashbackBudgetView","ChangeCashbackBudgetModel","ChangeCashbackPercentView","ChangeCashbackPercentModel","ChangeBidStrategyModel","ChangeBidStrategyView","ChangeLanguageView","ChangeLanguageModel","BulkCampaignExclusionsView","AudienceAssociationView","AudienceAssociationModel","ChangeRsaAutoAssetsView","ChangeRsaAutoAssetsModel","CopyPaste","config","i18nNewDesign","router","bulkEditUrl","qualtricsSurveyCallback","importNotificationCallback","importBudgetBidNotificationCallback","_options$disableDesel","disableDeselectAll","getCampaignTypeGlobalFilter","perfMarker","campaignUpgradeProps","isFilterByPerformanceMaxCampaigns","CampaignType","PerformanceMax","isFilterByAppAdsCampaigns","isFilterByAllCampaigns","All","onCopyClicked","_ref10","viewConfig","copy","Object","assign","text","dynamic","CampaignLifetimeBudget","createView","budgetType","IsPersonalizedOffersEnabled","IsPersonalizedOffersV4Enabled","IsPersonalizedOffersV2Enabled","IsPersonalizedOffersV3Enabled","_ref4","_ref5","_ref6","_ref7","confirm","inlineError","IsCustomAudienceAllowed","IsInMarketAudienceAllowed","_ref8","audienceAssociationPerfMarker","_config$get","createChild","willInit","listener","done","off","onSuccessCallback","onAudienceAssociationSuccess","getRoutePathById","location","search","isFallbackEnabled","campaignUpgradeItem","pathname","repos","Shopping","frontItems","IsCampaignAdGroupCopyPasteEnabled","hotkeys","win","mac","_ref11","paste","noSelectionRequired","_ref9","Default","projectionGridBulkEdit","DeleteConfirmation","gridDecorationCallback","stateData","fromAudienceLibrary","html","show","campaignRemarketingAssociated","click","campaignAudienceAssociationDecoration","dateRangeMapping","RANGES","YESTERDAY","LastSevenDays","LAST_SEVEN_DAYS","TODAY","LastThirtyDays","LAST_THIRTY_DAYS","LastFourteenDays","LAST_FOURTEEN_DAYS","THIS_MONTH","LAST_MONTH","LastThreeMonths","LAST_THREE_MONTHS","LastSixMonths","LAST_SIX_MONTHS","THIS_YEAR","LAST_YEAR","ALL_TIME","THIS_WEEK_SUNDAY","THIS_WEEK_MONDAY","LAST_WEEK_SUNDAY","LAST_WEEK_MONDAY","LastFourWeeksStartingSun","getStateDateRangePreset","CUSTOM","getRanges","getDateRanges","convertDateRangePresetToRangeId","ranges","rangeKey","grains","Custom","getSelectionDateRangePreset","statePreset","grain","preset","getSelectionDateFormatter","dateFormatter","getSelectionDateParser","parser","dateParser","substr","getStateDateRange","customStart","customEnd","comparisonOptionMapping","PreviousPeriod","COMPARISON_RANGES","PREVIOUS_PERIOD","SamePeriodLastYear","SAME_PERIOD_LAST_YEAR","getStateComparisonDateRangeOption","ComparisonDateRangeOption","getStateComparedDateRange","primaryRange","ComparisonDateRange","getComparedDateRanges","comparedCustomStart","comparedCustomEnd","convertSelectionDateRangeToState","_ref$Selection","withoutTime","compared","convertStateDateRangeToSelection","$daterange","stateOption","formatAPIDate","start","startdate","enddate","RangeIndex","isRangeNotPreset","lockDownSelectionDateRange","primaryDateRange","comparedDateRange","selectionDateFormatter","customDateRangeFormatter","formatter","skeleton","str","DateRangeFormat","s$i18n","formatCustomDateRange","dateRange","formatPreset","enum","ComparisonDateRangeFormat","_ref2$noneStringKey","noneStringKey","comparisonDateRange","globalLegacyI18n","dateSettingContainer","minHeight","LegacyDateSetting","allowNoEndDateSelection","allowStartDateSelection","allowEndDateSelection","DateSettings","extend","callOnChangeCb","startDate","endDate","isCreate","getRawValues","getDateSettingDetails","isUseCampaignLevelDates","isDateLevelDisplayed","managementLevel","startFromDate","endToDate","convertDateBetweenTimeZones","dateString","getCurrentDate","validateDate","_ref2$hasFixedStartDa","hasFixedStartDate","validationErrors","currentDate","numberOfDaysBetweenDates","startDateUTC","UTC","endDateUTC","Math","floor","abs","getLaterDate","numberOfDaysLater","LegacyDateSettingWithCustomValidation","dataSettings","updatedDateSettings","setUpdatedDateSettings","validateDateUtil","validationError","dateSettingWithDefaultStartDate","ValidatedLegacyDateSetting","serializeCSV","imageInfos","aid","csvRows","imageInfo","metadata","baseId","sourceType","encodedUrl","serializecsvRow","ImageOData","cid","oDataConfig","timeout","bulkSaveImagesByUrl","baseURL","Promise","post","CsvRows","maxTimeout","res","csvData","errorColIndex","imageIdColIndex","headers","col","row","code","extractIds","addAsset","requestUrl","requestBody","FolderId","Asset","Url","SourceType","imageFit","imageUrl","placements","_ref2$skipOutpainting","skipOutpainting","ImageUrl","Placements","expandedImageUrl","imageExpansionType","ImageExpansionType","originalImageCropSettings","OriginalImageCropSetting","crop","AspectRatio","aspectRatio","CropSetting","SourceHeight","cropSetting","sourceHeight","SourceWidth","sourceWidth","SourceX","sourceX","SourceY","sourceY","expandedImageCropSettings","ImageCropSetting","expandedImageWidth","ImageDimension","w","expandedImageHeight","h","paddingColor","PaddingColor","parseImageFitResponse","odataPath","orderByDefault","orderDefault","oDataToken","odataToken","oDataTokenType","applicationName","beforeSend","sortQuery","searchTerm","_ref3$filterTerm","filterTerm","skip","filterArray","filterQuery","$top","$skip","count","sortBy","sortDirection","minWidth","dateAddedStart","dateAddedEnd","searchQuery","params","imageId","isImageFittingEnabled","imageData","inProgress","isLogo","dataToLog","processedImageData","base64","base64Index","progress","image","processUploadSingleImageRejection","patch","IdString","delete","body","stopBinding","init","controlsDescendantBindings","allowedBindings","translateLanguageName","language","selectedLanguages","suggestedLanguages","allLanguageExclusive","inEditMode","languages","ALL_LANGUAGES","languagesSet","unshift","languageOptions","selectedLanguagesName","x","suggestedLanguagesName","allLanguageSelected","targetSuggestedLanguages","updateSuggestedLanguages","newSuggestedLanguages","MultiLanguageSelector","i18nStrings","_ref$suggestedLanguag","_ref$selectedLanguage","_ref$inEditMode","_ref$allLanguageExclu","_ref$inSingleColumnVe","inSingleColumnVersion","_ref$i18n","SuggestedLanguagesDescription","selectedLangauges","getSelectedLanguages","logInteraction","empty","SelectedLanguages","observeInDOM","onAttached","onDetached","onAttachedToDOM","onDetachedFromDOM","wasInDOM","document","observer","MutationObserver","disconnect","observe","childList","subtree","getRouteforScope","preferenceService","featureName","FilterStorageFactory","getAuctionInsightEditableFilter","enableBSCAuctionInsights","storageArr","FEATURE_NAME_GENERAL_INSIGHTS","FEATURE_NAME_GENERAL_INSIGHTS_SHOPPING","navigateToCompetitionTab","pluginConfig","legacyRouter","pageName","IsBAACompetitionBSCAuctionInsightsEnabled","$contains","filterObject","CampaignName","AdGroupName","storage","writeAuctionInsightEditableFilter","CAMPAIGN_TYPES","saveGeneralInsightsPreferences","selectShoppingCampaignType","clean","cleanAuctionInsightEditableFilter","route","getRoute","navigateToRoute","campaign_id","adgroup_id","navigateToLegacyAuctionInsights","selectedIds","getNavigate","shouldNavigateToCompetitionTab","onClickSelected","crossPageSelectNotAllowedI18nKey","alert","auctionInsightPlugin","definePlugin","toolbar","plugins","auctionInsight","menuId","toolbarEditor","gridToolbarGroup","toolbarWithItem","Error","onClick","getDropdownMenuItems","size","iconLeftGlyphName","button","menu","iconRight","supportedEntities","divider","getMenuItemConfig","siteMapId","getRulesMenu","switchTo","selectInfo","shouldBeDisabled","header","switchMenuOrder","getMetadata","ret","disabled","subMenu","en","subItems","automatedRulesPlugin","automatedRulesView","actionStateKey","_$result","entityName","i18nGlobal","bidRange","_$result$isForVNext","getSelectionInfo","parseInt","map","renderRuleAuthoringView","actionId","selectedInfo","split","selectedTemplateId","selectedTemplateEntityLevel","ruleViewModel","addWalkme","renderView","gridContainer","editorContainer","gridToolbar","overrideWith","hide","hideAllToolbars","showAllToolbars","IsReadOnlyUser","selectedMenu","entityLevel","silent","getMenuItems","changeBiddingStrategy","IsManualBiddingDeprecationEnabled","IsCampaignTargetROASBidStrategyEnabled","IsNewCampaignTargetROASBidStrategyEnabled","IsMaximizeConversionValueEnabled","IsTargetImpressionShareEnabled","getCampaignItems","getAdGroupItems","getKeywordItems","bidStrategy","_config$plugins$bidSt","ChangeBiddingStrategyView","ChangeBiddingStrategyModel","_config$plugins$bidSt2","bidStrategyView","getGridSelectionCount","totalRowsTotalPageCount","removeView","getItems","dataSource","updateToolbar","defineGridPlugin","bulkEditView","_options$frontItems","_options$showDelete","showDelete","_options$showEnable","showEnable","_options$showExclude","showExclude","_options$showPause","showPause","_options$showSeparate","showSeparateExclude","_options$isForVNext","_options$bulkEditUrl","_options$customClickH","customClickHandler","_options$qualtricsSur","_options$importNotifi","_options$importBudget","defaultBulkEditViewConfig","onOperationSuccess","deselectAll","hideToolBar","editorviewHiden","getGridToolbar","css","overflow","attr","noneSelectedAndAlert","changeStatus","act","Deleted","currentPageAllRowsSelected","Paused","statusModel","selectionInfo","rowId","EnumPaused","campaignItem","campaignItemList","updateStatus","afterStatusChange","isSkipEntityCache","isExcludeNonAudience","generateClickableItem","iconLeft","_ref$noSelectionRequi","newBudget","newBidStrategy","dataContextManager","updateContext","getIconClasses","cls","excludeItem","Excluded","menuItems","Active","splice","lastIndexOf","subItem","allPagesSelected","curSelectedItems","CampaignSubType","_ref2$noSelectionRequ","openUpgradeDialog","generateClickableCampaignUpgradeItem","frontMenuItems","isReadOnlyUser","isAccountInactive","localPreferenceService","findByNameAtUserLevel","localStorage","PLUGIN_NAME","campaignGridColumnResizePlugin","settings","plugin","getColumnResizeProjectionFactory","pipeContentProjections","getPGridColumnResizePlugin","gridName","preferenceSrv","preferenceKey","debouncedSaveToPreference","cache","manuallySetLastColumnWidth","isSaveEnabled","doubleClickingBehavior","ColumnDoubleClickingBehavior","resizeToMinWidth","saveToStore","widthState","c","left","version","loadFromStore","_ref2$Data","mslcw","loadedColumns","stateColumns","columnGroup","leafColumns","renderGrabber","cell","isDraggingCurCol","headerTemplate","val","dragging","_toConsumableArray","editablePlugin","saveModel","isEditIconLocalized","editable","handler","iconClasses","events","memo","e","$td","target","keyOfElement","_chainData","primaryKey","enableEdit","offset","uiNextVirtualOffset","newPosition","position","prompt","event","fields","hasLabels","parentContainerSelector","updatedModel","viewEditor","updateHandler","editorConfig","generatedConfig","bodyRows","_state$bodyRows","apply","rowIndex","cells","colIndex","editTemplate","$html","ariaLabel","columnName","gridEditIconTitle","defaults","extendColumns","extendFunc","getStyleAttr","isUndefined","style","extendWidthAttr","headAttributes","bodyAttributes","footAttributes","getPoPWidth","widthMap","PopSubColWidth","ComparedWidth","ChangeWidth","ChangePercentageWidth","projectionGridFlexColumnResize","$cell","cellWidth","cellMaxWidth","cellMinWidth","prev","_config$plugins$proje","isDown","saveColumnWidth","$headers","reduce","toArray","$header","outerWidth","getColumnWidth","columnWithWidth","pick","onMouseDown","isNaN","clientX","onMouseDbClick","resizeProjection","headRows","headRow","headRowCells","columnIndex","stopPropagation","addEventListener","delta","dist","columnWidthMap","chain","columnWidth","columnWithStyle","pastePlugin","filterState","_config$plugins$paste","pasteView","restoreToolbar","sharedClassName","projectionGridPopupPlugin","projectionGridPopup","getPopover","closePopover","popupEvents","option","content","itemWithKey","$target","popover","placement","$popover","ev","tagName","getMouseenterHandler","outerSelector","relatedTarget","parents","projectionGridPopupProjection","projectionGridScopeNavigator","targetCid","targetAid","customParams","skipScopeNavigation","preventDefaultNavigation","_scope$values","uid","href","uri","Uri","normalizeProtocol","protocol","preventDefault","customQueries","queryString","scopeNavigatorProjection","scrollbarWidth","InstallTrigger","overlapClass","ScrollbarView","freezingSelector","otherSelector","scrollbarParentSelector","calculateOtherHorizontalOffset","parentStyle","childStyle","addEvent","projectionGridScrollbarPlugin","_pluginConfig$pageCon","pageContainer","_pluginConfig$tableSe","tableSelector","_pluginConfig$rowSele","rowSelector","_pluginConfig$cellSel","cellSelector","_pluginConfig$freezin","freezingGroupSelector","_pluginConfig$freezin2","_pluginConfig$otherGr","otherGroupSelector","_pluginConfig$otherSe","_pluginConfig$scrollb","scrollbarContainerSelector","_pluginConfig$scrollb2","_pluginConfig$scrollb3","scrollbarChildSelector","_pluginConfig$scrollE","scrollElementSelector","_pluginConfig$shellSe","shellSelector","getBarParent","scrollOtherGroupToLeft","scrollLeft","setOverlapClass","isOverLap","removeClass","$window","prevOffsetWillEditing","prevOffset","calculateParentWidth","$freezing","right","calculateChildWidth","setHorizontalOffset","transition","transform","calculateShowOrHide","$barParent","$row","eq","opacity","calculateScrollbarPosition","$other","$barContainer","windowHeight","barContainerTopOffset","bottom","calculateFocusElementOffset","delay","offsetDelta","childElement","parentElement","cRect","getBoundingClientRect","pRect","horizontalScrollHandler","isMouseInside","isShowScrollbar","shiftKey","originalEvent","deltaY","deltaX","cWidth","pWidth","max","scrollbarView","prependFootRows","lazyAddScrollRowEvent","debounce","otherGroupElements","scrollEvent","focusElements","querySelector","addHorizontalScrollEvent","lazycalculateScrollbarPosition","scroll","parent","lazyResizeCalculate","has","ResizeObserver","ResizeObserverPollyFill","budgetContainer","background","borderColor","LegacySharedBudget","budget","validationDailyMinBudget","hideBudgetMinRecommendation","noApplyBudgetFromSharedLibrary","readOnly","budgetFactory","SharedBudgetView","newFactory","BudgetView","showBudgetMinRecommend","minimumBudget","hideDailyBudgetOptions","currencySymbol","getCurrencySymbol","PageContext","AccountCurrencyCode","showInitialUiBlocker","showNoSharedBudgetLink","ValidatedLegacySharedBudget","Budget","getBudgetTitleDetails","serverContext","currencyCode","CurrentAccount","CurrencyCode","amount","formatCurrency","UpgradeUrlStringMap","Ad_DestinationUrl","Ad_FinalUrl","BulkEdit_UrlOptions_CustomParameters_AddAnother","BulkEdit_UrlOptions_CustomParameters_InputAriaLabel","BulkEdit_UrlOptions_CustomParameters_MatchCase","BulkEdit_UrlOptions_CustomParameters_RemoveLineNumber","BulkEdit_UrlOptions_UpgradeWarning","Cancel","CustomParameters_Placeholder_Key","CustomParameters_Placeholder_Value","ErrorNumber_UniqueCustomParameterNames","Error_Campaign_API_FinalUrlRequiredWhenUsingMobileFinalUrl","Error_Campaign_API_InvalidCharactersInKey","Error_Campaign_API_InvalidCharactersInValue","Error_Campaign_API_InvalidTag","Error_Campaign_API_InvalidUrlScheme","Error_Campaign_API_KeyNullOrEmpty","FinalUrlSuffix_Example","FinalUrlSuffix_Label","FinalUrl_Label","Input_NoChange_PlaceHolder","LandingPage_Label","LearnMore","MobileFinalUrl_Label","Save","TrackingTemplate_Example","TrackingTemplate_Label","UpgradedUrl_Placeholder_FinalUrlSuffix","UrlOptions_None","trackingTemplate","editMode","showUurlTestTool","maxLength","inputClass","newTrackingTemplate","errorList","tag","errorMessages","showNone","TrackingTemplateView","_ref$editMode","_ref$template","tmpl","_ref$showUurlTestTool","getTrackingTemplate","isEdit","InlineEditViewModel","_ref$error","_ref$isValid","TrackingTemplateInlineEditView","_ref$deps","deps","trackingTemplateView","UurlTestToolView","globalContext","require","uurlTestToolView","setTimeout","urlTestTool","urlTestToolStatusContainer","fn","originalView","finalUrlSuffix","_ref$showPlaceholder","showPlaceholder","newFinalUrlSuffix","externalErrors","firstChar","test","placeholderText","FinalUrlSuffixView","_ref$readOnly","getFinalUrlSuffix","FinalUrlSuffixInlineEditView","finalUrlSuffixView","Parameter","CustomParams","_ref2$customParameter","customParameters","bulkEditMode","bulkEditShowAddLabel","bulkEditShowMatchCase","forceUseIncreasedCount","isDisabled","bulkEditMatchCaseSelected","useIncreasedCount","entityTypeLower","IsCustomParameterCountIncreasePhase3Enabled","maxParameterCount","valueMaxLength","addCustomParamEntry","parameters","last","removeCustomParamEntry","getInputAriaLabel","getRemoveButtonAriaLabel","p","showAddLable","parametersError","keys","parameterArray","param","CustomParametersView","_ref$bulkEditMode","_ref$bulkEditShowAddL","_ref$bulkEditShowMatc","_ref$customParameters","_ref$withRealTimeUpda","tmplBulkEdit","newVal","separatedKeyValueProperties","matchCase","CustomParameterInlineEditView","customPramsView","isFinalUrl","isFinal","Editing","FinalUrlView","finalUrlTemplate","urlRegex","RegExp","maxFullUrlLength","protocols","errorContainer","errorMessage","showErrors","urlWithoutProtocol","fullUrl","regexResult","exec","hasErrors","UrlEditorView","urlInputTemplate","urlPlaceholder","ariaLabelledby","mobileUrlVisible","isMobilePreferred","showTitles","landingPageUrlErrorMessages","showUpgradeWarning","UpgradedUrlView","smallContainer","campaignFlow","showDestinationUrl","disableKeywordDestinationUrl","finalUrl","urlEditor","getFullUrl","mobileFinalUrl","mobileUrl","updateOnDevicePreference","enable","setFullUrl","disable","finalUrlSelected","bind","destinationUrlSelected","$url","finalMobileUrl","errorMessageNotExists","SingleViewWrapper","_DeterministicWrapper","rendered","DeterministicWrapperView","UpgradedUrlInlineEditView","upgradedUrls","IsKeywordDestinationURLDisabled","upgradedUrlView","customClass","getDimensions","element","$element","outerHeight","testFit","containerDimensions","elementDimentions","verticalFit","horizontalFit","areaFit","FixedPositionLocation","freeze","buttomLeft","topRight","topLeft","buttomRight","PositionAttribute","fixed","absolute","getFixedPosition","positionOptions","anchor","popupDimensions","anchorBoundingRect","positionAttribute","_getDimensions2","getBoundingRectOffset","_getDimensions","getBoundingRectPosition","getFittingPosition","positions","threshold","fittingPosition","PositioningMethod","fit","LabelsPopup","role","onClose","controlTemplate","contents","closeLabel","setPosition","positioningMethod","positioningOptions","positionAttr","delegateEvents","combinedEvents","visibility","getPositioningMethod","currentPopup","popupInstance","dismiss","clickToDismiss","removePopup","resolveCallback","FocusLockInstanceView","focusLockInstanceDecorator","onExit","getAnchor","eventHandlers","close","Popup","popup","wrappedPopup","showTesting","resultType","resultString","ResultTypes","TrackingResultTypes","LevelTypes","TestingItemMapping","getLevelString","normalizeUurlTestResult","rawResult","attributes","CustomParameters","parameter","Level","ValueTrackParameters","IndicateParameters","LpUrl","Result","servingUrl","ServingUrl","landingUrl","LandingUrl","TrackingTemplate","FinalUrl","FinalUrlSuffix","ParallelTrackingUrl","trackingUrl","TrackingCallResult","trackingResultType","trackingResultString","detailPopup","UrlTestTool","token","triggerTestUurl","class","useDefaultStatusContainer","self","popupSelector","urlTestToolStatusTemplate","showResultV2","showResultDetailsForVNext","hasClass","dismissDetailPopup","curr","hasIn","toggleClass","showResultUrlDetailV2","Authorization","catch","logError","fetchAccountFinalUrlSuffix","handleTestResultList","isParallelTracking","accountFinalUrlSuffix","rawResultList","Errors","urlTestResultList","isMultipleResult","resultListTrackingTemplate","normalizedResult","sequentialTrackingResult","SequentialTrackingResult","parallelTrackingResult","ParallelTrackingResult","adGroupName","calculateResultType","urlTestResult","sq","pt","showResultListV2","showResultSingleV2","createResultItemV2","showPopup","urlTestResultSummaryTemplateV2","$popupUurlV2","offsetHeight","resultList","urlTestResultListSummaryTemplateV2","testingItem","trackingResult","calculateDetailPopupLocation","urlTestResultTemplate","anchorTop","p$context","resolve","resolveContext","addTrigger","triggerId","areaName","targetId","user","account","customer","userVoice","UserVoice","AccountNumber","ticket_custom_fields","UserAgent","navigator","userAgent","Feature","FeatureArea","URL","AccountName","AccountID","CustomerID","CustomerName","PageHTML","smartvote_enabled","screenshot_enabled","strings","contact_menu_label","contact_title","contact_message_placeholder","contact_skip_instant_answers_button","contact_details_title","contact_submit_button","contact_success_title","contact_success_body","email_address_label","email_address_placeholder","mode","addTargetedTrigger","constants","recentUpload","stringKey","edmDefinition","UploadedTime","description","VideoOData","uploader","AzureUploader","logger","fileExtension","file","onProgress","reject","nameSplits","ext","getUploadUrl","blob","BlobName","uploadPayloadToBlobWithCancellation","payload","FilePayload","urlParameters","blobName","videoUrl","sortById","sortBySelection","$filter","customHeader","getUploadUrlForRepair","deltaVideo","pug","module","exports","locals","pug_html","locals_for_with","pug_interp","escape","pug_mixins","block","colSm2","colSm10","selectorControlClass","$$obj","pug_index0","$$l","singleLine","keyPlaceHolder","valuePlaceHolder","addAnother","popupId","arialLabelText","dataTarget","resultClass","resultIndexClass","attribute","itemName"],"sourceRoot":""}