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,UAAU,wCAA0C,GAAK2/B,GAAe,6HAA+LH,EAAIM,OAAO,OAASH,EAAa7qC,EAAKkL,UAAU,+BAAiC,GAAK2/B,GAAe,oBAA+DH,EAAIM,OAAO,OAASH,EAAa7qC,EAAKkL,UAAU,2CAA6C,GAAK2/B,GAAe,yHAAiLH,EAAIM,OAAO,OAASH,EAAa7qC,EAAKkL,UAAU,qCAAuC,GAAK2/B,GAAe,oBAA+DH,EAAIM,OAAO,OAASH,EAAa7qC,EAAKkL,UAAU,iDAAmD,GAAK2/B,GAAe,mBAAiE,EAAE7+B,KAAKlM,KAAK,SAAUirC,EAAgBA,EAAgB/qC,KAAmB,qBAAPA,KAAmBA,UAAK6M,EAAU,kBAAmBk+B,EAAgBA,EAAgBtW,cAAqC,qBAAhBA,cAA4BA,mBAAc5nB,GAAoBi+B,CAAS,C","sources":["../../../../audience-campaign/packages/audience-adgroup-creation-wizard/src/view.js","../../../../audience-campaign/packages/audience-adgroup-settings-wizard/src/view.js","../../../../audience-campaign/packages/audience-advanced-target-settings/src/helper.js","../../../../audience-campaign/packages/audience-advanced-target-settings/src/view.js","../../../../audience-campaign/packages/audience-campaign-creation-wizard/src/bmc-redirect/view.js","../../../../audience-campaign/packages/audience-campaign-creation-wizard/src/utils.js","../../../../audience-campaign/packages/audience-campaign-creation-wizard/src/view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-type.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-grid-view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/company-name-target-setting/search-result/search-result-view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-view-base.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/company-name-target-setting/search-view/search-view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/shared-utils/bid-adjustment-utils.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/company-name-target-setting/company-name-target-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/target-or-bid-selector/target-or-bid-selector.js","../../../../audience-campaign/packages/audience-criterion-setting/src/audience-criterion-setting-base.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/company-name-target-setting/company-name-criterion-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/job-function-target-setting/search-result/search-result-view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/job-function-target-setting/search-view/search-view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/job-function-target-setting/job-function-target-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/job-function-target-setting/job-function-criterion-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/industry-target-setting/search-view/search-view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/industry-target-setting/industry-target-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/industry-target-setting/industry-criterion-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-grid-view-placement.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/placement-setting/search-view/search-view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/placement-setting/placement-target-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/placement-setting/placement-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/checkbox-selection-base/view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/age-target-setting/view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/age-target-setting/age-criterion-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/device-target-setting/view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/device-target-setting/device-criterion-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/gender-target-setting/view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/gender-target-setting/gender-criterion-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/external-based-target/audience-target-setting/view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/external-based-target/audience-target-setting/audience-criterion-setting.js","../../../../audience-campaign/packages/audience-criterion-setting/src/external-based-target/location-target-setting/load-location-map.js","../../../../audience-campaign/packages/audience-criterion-setting/src/external-based-target/location-target-setting/view.js","../../../../audience-campaign/packages/audience-criterion-setting/src/external-based-target/location-target-setting/location-criterion-setting.js","../../../../audience-campaign/packages/audience-target-info/src/index.js","../../../../audience-campaign/packages/audience-adgroup-creation-wizard/src/template.pug","../../../../audience-campaign/packages/audience-adgroup-settings-wizard/src/audience-target-selector-collapse.pug","../../../../audience-campaign/packages/audience-adgroup-settings-wizard/src/template.pug","../../../../audience-campaign/packages/audience-advanced-target-settings/src/template.pug","../../../../audience-campaign/packages/audience-campaign-creation-wizard/src/bmc-redirect/template.pug","../../../../audience-campaign/packages/audience-campaign-creation-wizard/src/template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/checkbox-based-target/checkbox-selection-base/template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/criterion-setting-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/external-based-target/audience-target-setting/template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/external-based-target/location-target-setting/template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/company-name-target-setting/search-result/search-result-view-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/industry-target-setting/search-view/search-view-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/job-function-target-setting/search-result/search-result-view-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/pagination-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/placement-setting/placement-setting-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/placement-setting/search-view/search-view-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-grid-remove-column-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-grid-state-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-grid-view-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-based-target-setting-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/search-view-base-template.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/search-based-target/shared-utils/bid-adjustment.pug","../../../../audience-campaign/packages/audience-criterion-setting/src/target-or-bid-selector/target-or-bid-selector-template.pug"],"sourcesContent":["import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport { StepsWizard } from '@bingads-webui/steps-wizard';\r\nimport { AudienceTargetInfo } from '@bingads-webui-campaign/audience-target-info';\r\nimport { ResponsiveAdEditor } from '@bingads-webui-campaign/responsive-ad-editor';\r\nimport { CrudAudienceAdgroup, CrudAudienceAdgroupBasic } from '@bingads-webui-campaign/crud-audience-adgroup';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { schema } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport template from './template.pug';\r\n\r\n/**\r\n * AudienceAdgroupCreationWizard class for the AudienceCampaign creation\r\n *\r\n * @class AudienceAdgroupCreationWizard\r\n * @extends {Backbone.View}\r\n */\r\nexport class AudienceAdgroupCreationWizard extends Backbone.View {\r\n /**\r\n * Initializes the {AudienceAdgroupCreationWizard} class.\r\n *\r\n * @param {Object} options - options for initializing the class.\r\n * @param {Object} options.viewContext = viewContext for the View.\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.viewContext = options.viewContext;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.audienceCampaignType = options.audienceCampaignType || '';\r\n this.options = options;\r\n this.options.currentLevelTargetInfo = new AudienceTargetInfo({ resourceName: 'AdGroupCriterion', isForVNext: !!options.isForVNext, isAudienceCreationWorkflow: true });\r\n\r\n const router = _.chain(options.deps).result('router', {}).value();\r\n this.navigateToRoute = router.navigateToRoute || _.noop;\r\n this.eventDelegator = _.result(options.deps, 'eventDelegator');\r\n\r\n this.options.scenario = 'adgroup-creation';\r\n this.perfMarker = options.perfMarker;\r\n\r\n this.setupInstrumentation();\r\n if (this.audienceCampaignType !== 'shopping') {\r\n this.options.lastStep = 'ResponsiveAdEditor';\r\n } else { this.options.lastStep = 'CrudAudienceAdgroup'; }\r\n\r\n const crudOptions = _.extend(this.options, {\r\n wizardElement: this.$el,\r\n });\r\n\r\n this.step1 = new CrudAudienceAdgroupBasic(_.extend(crudOptions, {\r\n perfMarker: this.perfMarker.createChild('AdGroupBasic'),\r\n workflow: 'createadgroup',\r\n }));\r\n this.step2 = new CrudAudienceAdgroup(_.extend(crudOptions, {\r\n workflow: 'createadgroup',\r\n }));\r\n\r\n const crudAdOptions = _.extend(crudOptions, {\r\n perfMarker: this.perfMarker.createChild('CrudAudienceAd'),\r\n isImpressionTrackingUrlsEnabled: options.isImpressionTrackingUrlsEnabled,\r\n });\r\n\r\n this.handlePopState = () => {\r\n const campaignId = this.viewContext.currentCampaign.Id;\r\n this.navigateToRoute('campaign_adgroup', { campaign_id: campaignId });\r\n };\r\n\r\n window.addEventListener('popstate', this.handlePopState);\r\n\r\n this.loadCrudAudienceAdPromise = new Promise((resolve) => {\r\n // eslint-disable-next-line\r\n if (this.audienceCampaignType !== 'shopping') {\r\n this.step3 = new ResponsiveAdEditor(crudAdOptions);\r\n }\r\n\r\n this.listenTo(this.step1, 'saveAndExit', this.saveAndExit);\r\n this.listenTo(this.step1, 'canceled', this.onExit);\r\n this.listenTo(this.step2, 'saveAndExit', this.saveAndExit);\r\n this.listenTo(this.step2, 'canceled', this.onExit);\r\n if (this.step3) {\r\n this.listenTo(this.step3, 'saveAndExit', this.saveAndExit);\r\n }\r\n\r\n resolve();\r\n });\r\n }\r\n\r\n setupInstrumentation() {\r\n const instr = DependencyResolver.get('campaignui/feature/instrumentation/index');\r\n\r\n instr.addScenario(schema);\r\n\r\n if (this.audienceCampaignType === 'shopping') {\r\n this.aimAdGroupCreationScenario = instr.aimShoppingAdGroupCreationWizard.create();\r\n } else {\r\n this.aimAdGroupCreationScenario = instr.aimAdGroupCreationWizard.create();\r\n }\r\n\r\n this.options.logScenario = this.aimAdGroupCreationScenario;\r\n\r\n const inContextRepairRecScenario = instr.inContextRepairRecommendation.create();\r\n this.options.applyActivity = inContextRepairRecScenario.applyDeliveryStatus.create();\r\n }\r\n\r\n /**\r\n * Renders the View.\r\n *\r\n * @returns {View} - returns the view itself.\r\n */\r\n render() {\r\n this.perfMarker.willRender();\r\n this.loadCrudAudienceAdPromise.then(() => {\r\n this.wizard = new StepsWizard({\r\n config: this.getStepConfig(),\r\n currentStep: 'audience-adgroup-creation-wizard-step1',\r\n });\r\n\r\n this.$el.html(template(this));\r\n\r\n this.wizard.render();\r\n\r\n if (_.isFunction(this.options.callbackBeforeRender)) {\r\n this.options.callbackBeforeRender(() => {\r\n this.$('.audience-adgroup-creation-wizard').append(this.wizard.$el);\r\n });\r\n } else {\r\n this.$('.audience-adgroup-creation-wizard').append(this.wizard.$el);\r\n }\r\n this.perfMarker.done();\r\n });\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Get Steps config.\r\n *\r\n * @private\r\n * @returns {object} - config.\r\n */\r\n getStepConfig() {\r\n const steps = [];\r\n\r\n steps.push({\r\n name: 'audience-adgroup-creation-wizard-step1',\r\n view: this.step1,\r\n });\r\n\r\n steps.push({\r\n name: 'audience-adgroup-creation-wizard-step2',\r\n view: this.step2,\r\n });\r\n\r\n // Ad step not supported for shopping campaign\r\n if (this.audienceCampaignType !== 'shopping') {\r\n steps.push({\r\n name: 'audience-adgroup-creation-wizard-step3',\r\n view: this.step3,\r\n });\r\n }\r\n\r\n const extendConfig = {};\r\n if (_.isFunction(this.options.layout)) {\r\n extendConfig.layout = this.options.layout;\r\n } else if (_.isUndefined(this.options.isHorizontal)) {\r\n extendConfig.isHorizontal = true;\r\n } else {\r\n extendConfig.isHorizontal = !!this.options.isHorizontal;\r\n }\r\n\r\n if (_.isFunction(this.options.headerTemplate)) {\r\n extendConfig.headerTemplate = this.options.headerTemplate;\r\n }\r\n\r\n return {\r\n steps,\r\n ...extendConfig,\r\n };\r\n }\r\n\r\n /**\r\n * Restores Wunderbar. Called when view is removed.\r\n *\r\n * @returns {undefined}\r\n */\r\n remove() {\r\n if (this.wizard) {\r\n this.wizard.remove();\r\n }\r\n if (_.isFunction(this.options.callbackBeforeRemove)) {\r\n this.options.callbackBeforeRemove();\r\n }\r\n\r\n const panel = document.querySelector('.audience-creation-panel.isOpen');\r\n\r\n if (panel && panel.remove) {\r\n panel.remove();\r\n }\r\n\r\n window.removeEventListener('popstate', this.handlePopState);\r\n\r\n super.remove();\r\n }\r\n\r\n /**\r\n * Handles the event when the exit is requested from the child steps\r\n * It navigates to the campaign and restore the wunderbar.\r\n *\r\n * @returns {undefined}\r\n */\r\n onExit() {\r\n const campaignId = this.viewContext.currentCampaign.Id;\r\n this.navigateToRoute('campaign_adgroup', { campaign_id: campaignId });\r\n }\r\n\r\n /**\r\n * Handles the event when the save & exit is requested from the child steps\r\n * It enables the adgroup before navigating to the summary page\r\n *\r\n * @returns {undefined}\r\n */\r\n saveAndExit() {\r\n return this.enableAdGroup()\r\n .then(() => {\r\n this.navigateToSummaryPage();\r\n })\r\n .catch((response) => {\r\n if (response && response.errors) {\r\n this.errorsView.setErrors(this.i18nErrors.getBulkApiErrors(response.errors));\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Enable AdGroups by setting status to Active\r\n *\r\n * @returns {undefined}\r\n */\r\n enableAdGroup() {\r\n const jsdata = DependencyResolver.get('component/js-data-campaign/index');\r\n\r\n const campaign = this.viewContext.currentCampaign;\r\n const adgroup = this.viewContext.currentAdGroup;\r\n const params = {\r\n Id: adgroup.Id,\r\n Campaign: { Id: campaign.Id },\r\n Status: 'Active',\r\n };\r\n\r\n return jsdata.AdGroup\r\n .update(adgroup.Id, params, { adapter: 'bulk' });\r\n }\r\n\r\n\r\n /**\r\n * Reload and Navigate to Summary page\r\n *\r\n * @returns {undefined}\r\n */\r\n navigateToSummaryPage() {\r\n const summaryDataContextManager = DependencyResolver.get('SummaryDataContextManager');\r\n\r\n summaryDataContextManager.getContext('/campaign/newadgroup/create?');\r\n\r\n if (this.eventDelegator) {\r\n this.eventDelegator.trigger('adGroupReload');\r\n }\r\n\r\n this.onExit();\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport ReactDOM from 'react-dom';\r\nimport React from 'react';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { observeInDOM } from '@bingads-webui-campaign/observe-in-dom';\r\nimport { AudienceTargetInfo } from '@bingads-webui-campaign/audience-target-info';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { AudienceAdvancedTargetSettings } from '@bingads-webui-campaign/audience-advanced-target-settings';\r\nimport { CrudAudienceAdgroupBasic, OptTgtToggle } from '@bingads-webui-campaign/crud-audience-adgroup';\r\nimport { shouldSupportCashbackSettings, logAdGroupPersonalizedOffers } from '@bingads-webui-campaign/personalized-offer-shared';\r\nimport {\r\n AudienceCampaignErrorsView,\r\n schema,\r\n getBulkErrorsLogMessage,\r\n BidStrategy,\r\n getFeedInfo,\r\n isFeedBasedAudienceCampaign,\r\n} from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { ReachEstimateControl, EstimateRequestFactory } from '@bingads-webui-campaign/reach-estimate-control';\r\nimport { asyncFunctionWithPerfMarker } from '@bingads-webui/performance-marker';\r\nimport { showIMAReachModal, getLocationsInfo, getLocationsInfoFromCampaignCriterions } from '@bingads-webui-campaign-react/ima-reach-representation';\r\nimport template from './template.pug';\r\nimport collapseTemplate from './audience-target-selector-collapse.pug';\r\n\r\n/**\r\n * AudienceAdgroupSettingsWizard class for the Adgroup settings\r\n *\r\n * @class AudienceAdgroupSettingsWizard\r\n * @extends {Backbone.View}\r\n */\r\nexport class AudienceAdgroupSettingsWizard extends Backbone.View {\r\n /**\r\n * Initializes the {AudienceAdgroupSettingsWizard} class.\r\n *\r\n * @param {Object} options - options for initializing the class.\r\n * @param {Object} options.viewContext = viewContext for the View.\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.perfMarker = options.perfMarker;\r\n this.perfMarker.willInit();\r\n this.setupInstrumentation();\r\n this.viewContext = options.viewContext;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.decimal = DependencyResolver.get('component/humanize/decimal');\r\n this.i18nErrors = DependencyResolver.get('component/api-errors-campaign/index');\r\n this.options = options;\r\n this.options.scenario = 'adgroup-settings';\r\n this.options.viewContext.level = 'adgroup';\r\n this.reachControlOptions = this.options.reachControlOptions;\r\n\r\n const permissionConfig = DependencyResolver.get('component/config/index');\r\n this.permissions = permissionConfig.get('Permissions');\r\n this.isShowDisclaimerBannerEnabled = _.get(this.permissions, ['dynamic', 'AgeGenderDisclaimer'], false);\r\n this.isBoostConversionBasedSegmentEnabled = _.get(this.permissions, ['dynamic', 'BoostConversionBasedSegment'], false) &&\r\n _.get(this.permissions, ['IsAmplifyEnabled'], false);\r\n\r\n const targetInfoPerf = this.perfMarker.createChild('currentLevelTargetInfo');\r\n targetInfoPerf.willInit();\r\n this.currentLevelTargetInfo = new AudienceTargetInfo({\r\n resourceName: 'AdGroupCriterion',\r\n isForVNext: !!(options.deps && options.deps.isNewUI),\r\n initAudienceAssociationView: false,\r\n });\r\n targetInfoPerf.done();\r\n this.optTgtReactComponent = React.createRef();\r\n\r\n const parentTargetInfoPerf = this.perfMarker.createChild('parentLevelTargetInfo');\r\n parentTargetInfoPerf.willInit();\r\n this.parentLevelTargetInfo = new AudienceTargetInfo({ resourceName: 'CampaignCriterion', isForVNext: !!(options.deps && options.deps.isNewUI), initAudienceAssociationView: false });\r\n parentTargetInfoPerf.done();\r\n\r\n this.options.currentLevelTargetInfo = this.currentLevelTargetInfo;\r\n this.options.parentLevelTargetInfo = this.parentLevelTargetInfo;\r\n\r\n this.errorsView = new AudienceCampaignErrorsView();\r\n\r\n this.loadAdGroupDataTask = this.loadAdGroupDataAsync();\r\n\r\n const deps = this.options.deps || {};\r\n this.isNewUI = deps.isNewUI;\r\n this.router = deps.router;\r\n\r\n if (this.isNewUI) {\r\n this.currentCampaign = this.options.viewContext.currentCampaign;\r\n // mock\r\n // this.currentCampaign.CashbackSettings = { CashbackMonthlyBudget: 1 };\r\n\r\n this.supportCashbackSettings = shouldSupportCashbackSettings(\r\n this.currentCampaign,\r\n this.permissions\r\n );\r\n }\r\n\r\n this.saveSettingsActivityLogger = this.aimAdGroupSettingsWizardScenario.saveSettings.create();\r\n\r\n const campaignSubType = _.get(this.viewContext, 'currentCampaign.CampaignSubType', 0);\r\n this.isAudienceFeedBasedCampaign = (campaignSubType === 1) &&\r\n (_.get(this.viewContext, 'currentCampaign.CampaignType', 0) === 8);\r\n // we are intentionally not changing the above variable name because we do not know all scenarios where it's being used\r\n this.isAudienceFeedBasedCampaignNew = isFeedBasedAudienceCampaign(campaignSubType);\r\n }\r\n\r\n setupInstrumentation() {\r\n const instr = DependencyResolver.get('campaignui/feature/instrumentation/index');\r\n\r\n instr.addScenario(schema);\r\n\r\n this.aimAdGroupSettingsWizardScenario = instr.aimAdGroupSettingsWizard.create();\r\n }\r\n\r\n /**\r\n * Fetch AdGroup and AdGroup Criterion data\r\n * @private\r\n *\r\n * @returns {undefined} - undefined\r\n */\r\n loadAdGroupDataAsync() {\r\n if (this.loadAdGroupDataTask) {\r\n return this.loadAdGroupDataTask;\r\n }\r\n\r\n this.perfMarker.willFetchData();\r\n\r\n const loadSettingsActivityLogger =\r\n this.aimAdGroupSettingsWizardScenario.loadSettings.create();\r\n\r\n loadSettingsActivityLogger.start();\r\n\r\n const jsdata = DependencyResolver.get('component/js-data-campaign/index');\r\n const edmCampaign = DependencyResolver.get('component/edm-campaign/index');\r\n\r\n this.initializeAdgroupAudience();\r\n\r\n const getAdGroupTask =\r\n asyncFunctionWithPerfMarker(\r\n this.perfMarker.createChild('getAdGroup'),\r\n jsdata.AdGroup.find\r\n )(\r\n Number(this.viewContext.currentAdGroup.Id),\r\n { entitySet: edmCampaign.currentCampaign.AdGroups, bypassCache: true }\r\n );\r\n\r\n const getAdGroupCriterionsTask =\r\n asyncFunctionWithPerfMarker(\r\n this.perfMarker.createChild('getCriterions'),\r\n this.currentLevelTargetInfo.fetchCriterions,\r\n this.currentLevelTargetInfo\r\n )(\r\n this.viewContext.currentCampaign.Id,\r\n this.viewContext.currentAdGroup.Id,\r\n null,\r\n this.permissions.IsAmplifyEnabled && this.permissions.IsContextualTargetEnabled\r\n );\r\n\r\n const getCampaignCriterionsTask =\r\n asyncFunctionWithPerfMarker(\r\n this.perfMarker.createChild('getCampaignCriterions'),\r\n this.parentLevelTargetInfo.initializeWithCampaignAsync,\r\n this.parentLevelTargetInfo\r\n )(this.viewContext.currentCampaign.Id);\r\n\r\n this.reachControl = new ReachEstimateControl(_.extend({\r\n isSticky: true,\r\n scenario: this.aimAdGroupSettingsWizardScenario.value,\r\n }, this.reachControlOptions || {}));\r\n\r\n this.estimateRequestFactory = new EstimateRequestFactory({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n parentLevelTargetInfo: this.parentLevelTargetInfo,\r\n });\r\n\r\n return Promise.join(\r\n getAdGroupTask,\r\n getAdGroupCriterionsTask,\r\n getCampaignCriterionsTask,\r\n (adgroup) => {\r\n this.options.viewContext.currentAdGroup = adgroup;\r\n\r\n this.onAdGroupInitialized();\r\n }\r\n ).then(() => {\r\n this.handleEstimateUpdates();\r\n this.listenTo(this.currentLevelTargetInfo, 'AdGroupCriterionChanged', this.handleEstimateUpdates);\r\n this.listenTo(\r\n this.currentLevelTargetInfo,\r\n 'AdGroupCriterionChanged',\r\n this.disableOptToggle\r\n );\r\n\r\n if (this.parentLevelTargetInfo) {\r\n this.listenTo(this.parentLevelTargetInfo, 'CampaignCriterionChanged', this.handleEstimateUpdates);\r\n }\r\n\r\n // Listent to TargetBidSelector of each control\r\n this.listenTo(\r\n this.optTgtReactComponent,\r\n 'targetSettingChanged',\r\n this.handleAgeGenderExclusion\r\n );\r\n this.listenTo(\r\n this.advancedTargetSetting.companyNameTargetSetting.targetOrBidSelector,\r\n 'targetSettingChanged',\r\n this.handleEstimateUpdates\r\n );\r\n this.listenTo(\r\n this.advancedTargetSetting.industryTargetSetting.targetOrBidSelector,\r\n 'targetSettingChanged',\r\n this.handleEstimateUpdates\r\n );\r\n this.listenTo(\r\n this.advancedTargetSetting.jobFunctionTargetSetting.targetOrBidSelector,\r\n 'targetSettingChanged',\r\n this.handleEstimateUpdates\r\n );\r\n this.listenTo(\r\n this.advancedTargetSetting.audienceTargetSetting.targetOrBidSelector,\r\n 'targetSettingChanged',\r\n this.handleEstimateUpdates\r\n );\r\n\r\n loadSettingsActivityLogger.stop();\r\n }).catch((response) => {\r\n if (response) {\r\n return false;\r\n }\r\n\r\n return true;\r\n });\r\n }\r\n\r\n initializeAdgroupAudience() {\r\n const getAdGroupCriterionsTask =\r\n asyncFunctionWithPerfMarker(\r\n this.perfMarker.createChild('getAdGroupCriterions'),\r\n this.currentLevelTargetInfo.initializeWithhAdGroupAudience,\r\n this.currentLevelTargetInfo\r\n )(\r\n this.viewContext.currentCampaign.Id,\r\n this.viewContext.currentAdGroup.Id\r\n );\r\n\r\n getAdGroupCriterionsTask.finally(withUiBlock(\r\n this.$('.audience-adgroup-settings-wizard-container'),\r\n this.i18n.getString('Loading')\r\n )).then(() => {\r\n const targetSetting = this.advancedTargetSetting.audienceTargetSetting;\r\n if (targetSetting) {\r\n this.advancedTargetSetting.$('.audience-target-setting-container')\r\n .empty().append(targetSetting.render().$el);\r\n }\r\n\r\n const nonEmptyKeys = this.currentLevelTargetInfo.getAllNoneEmptyTypeKeys();\r\n const targetSelector = this.advancedTargetSetting.audienceTargetSelector;\r\n const isAudienceEnabled = _.contains(nonEmptyKeys, 'Audience');\r\n\r\n if (isAudienceEnabled) {\r\n if (targetSelector) {\r\n targetSelector.turnOnAudienceTarget();\r\n }\r\n this.advancedTargetSetting.updateUnmodifiedCriterions();\r\n } else {\r\n const el = document.querySelector('.audience-target-setting-container');\r\n\r\n if (el) {\r\n el.style.display = 'none';\r\n }\r\n }\r\n });\r\n }\r\n\r\n disableOptToggle() {\r\n if (!this.isAudienceFeedBasedCampaign && this.optTgtReactComponent && this.optTgtReactComponent.current) {\r\n this.optTgtReactComponent.current.disableByValidation.call(this.optTgtReactComponent.current);\r\n }\r\n }\r\n\r\n onRenderedInDOM() {\r\n this.loadAdGroupDataTask.finally(withUiBlock(\r\n this.$('.audience-adgroup-settings-wizard-container'),\r\n this.i18n.getString('Loading')\r\n ));\r\n }\r\n\r\n /**\r\n * Since AdGroup criterion initialize takes network calls,\r\n * This callback function is called when everything is initialized\r\n *\r\n * @returns {object} - the view itself\r\n */\r\n onAdGroupInitialized() {\r\n this.crudAudienceAdgroupBasic = new CrudAudienceAdgroupBasic(_.extend(\r\n {\r\n perfMarker: this.perfMarker.createChild('crudAudienceAdGroupBasic'),\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n },\r\n this.options\r\n ));\r\n this.advancedTargetSetting = new AudienceAdvancedTargetSettings(_.extend(\r\n {\r\n perfMarker: this.perfMarker.createChild('advancedTargetSetting'),\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n },\r\n this.options\r\n ));\r\n\r\n this.renderSettingsControls();\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .save-button': 'onSaveButtonClicked',\r\n 'click .cancel-button': 'onCancelButtonClicked',\r\n };\r\n }\r\n\r\n onCashbackPercentChange(value) {\r\n const { cashbackSettingsView } = this.crudAudienceAdgroupBasic;\r\n if (cashbackSettingsView.viewModel.validateCashbackPercent(value)) {\r\n const formattedValue = value === '' || value == null ? null : this.decimal.fromLocalToFloat(value);\r\n\r\n if (this.advancedTargetSetting) {\r\n this.advancedTargetSetting.toggleCashbackPercentColumns(true, {\r\n level: 'AdGroup',\r\n value: formattedValue,\r\n });\r\n }\r\n }\r\n }\r\n\r\n onSaveButtonClicked() {\r\n return this.validateAndSave();\r\n }\r\n\r\n onCancelButtonClicked() {\r\n const CampaignId = Number(this.viewContext.currentCampaign.Id);\r\n\r\n const AdGroupId = this.viewContext.currentAdGroup ?\r\n Number(this.viewContext.currentAdGroup.Id) : undefined;\r\n\r\n this.router.navigateToRoute('adgroup_ad', { campaign_id: CampaignId, adgroup_id: AdGroupId });\r\n }\r\n\r\n validate() {\r\n return this.advancedTargetSetting.validate()\r\n && this.crudAudienceAdgroupBasic.validate();\r\n }\r\n\r\n /**\r\n * It validates the reach and privacy of selected targets and then\r\n * attempts to save and return true if the save is done succefully.\r\n *\r\n * @returns {boolean} - returns true if save was succesful\r\n */\r\n validateAndSave() {\r\n if (!this.validate()) {\r\n return false;\r\n }\r\n\r\n return Promise.all([\r\n this.reachControl.validate(),\r\n this.advancedTargetSetting.locationTargetSetting\r\n .targetSelectionView.locationTargetsViewPromise,\r\n ]).then((isValid) => {\r\n if (isValid[0]) {\r\n return this.checkIMAReachAndSave();\r\n }\r\n const message = this.reachControl.errorMessage;\r\n\r\n this.errorsView.setErrors([{ message }]);\r\n\r\n return false;\r\n }).catch(() => {\r\n // TODO: log here\r\n });\r\n }\r\n\r\n /**\r\n * Get the data that is used for the parameter for saving.\r\n *\r\n * @returns {Object} - object representing the data for the adgroup to be saved.\r\n */\r\n getData() {\r\n const params = {};\r\n\r\n _.extend(params, this.crudAudienceAdgroupBasic.getData());\r\n\r\n const targetSettingsData = this.advancedTargetSetting.getData();\r\n\r\n // Separate audience criterion with others\r\n const allAdGroupCriterions = targetSettingsData.AdGroupCriterions;\r\n const audienceCriterions =\r\n _.filter(allAdGroupCriterions, target => target.Criterion.Type === 'Audience');\r\n const otherCriterions =\r\n _.reject(allAdGroupCriterions, target => target.Criterion.Type === 'Audience');\r\n\r\n params.AdGroupCriterions = _.union(params.AdGroupCriterions, otherCriterions);\r\n params.AdGroupAudienceCriterions = audienceCriterions;\r\n\r\n params.TargetSetting = this.getTargetSettings().length > 0 ? this.getTargetSettings().join(';') : 'delete_value';\r\n\r\n if (this.permissions && this.permissions.dynamic && this.permissions.dynamic.Enable1PPlacementTargeting\r\n && !this.isAudienceFeedBasedCampaignNew) {\r\n params.BoostAdunitIds = this.getAdUnitIds();\r\n }\r\n\r\n if (this.isAudienceFeedBasedCampaign) {\r\n params.UseOptimizedTargeting = true;\r\n } else {\r\n const useOptimizedTargeting = this.optTgtReactComponent.current.getData();\r\n params.UseOptimizedTargeting = useOptimizedTargeting;\r\n }\r\n\r\n return params;\r\n }\r\n\r\n getAllAdGroupLocationCriterion() {\r\n let adGroupCriterions = this.advancedTargetSetting.getAllLocations() || [];\r\n\r\n adGroupCriterions = _.filter(adGroupCriterions, c => c.Status !== 'Deleted');\r\n const adGroupCriterionsWithoutIntent = _.filter(adGroupCriterions, c => c.CriterionType !== 'LocationIntentCriterion');\r\n const campaignCriterions = this.advancedTargetSetting.getCampaignLocationCriterions();\r\n\r\n // inherit locations\r\n if (adGroupCriterionsWithoutIntent.length === 0 &&\r\n campaignCriterions &&\r\n campaignCriterions.length > 0) {\r\n const overrideInfo = getLocationsInfoFromCampaignCriterions(campaignCriterions);\r\n\r\n return overrideInfo.locations.concat(overrideInfo.intent);\r\n }\r\n\r\n return adGroupCriterions;\r\n }\r\n\r\n\r\n checkIMAReachAndSave() {\r\n let checkIMAReachPromise = Promise.resolve(false);\r\n\r\n const locationCriterions = this.getAllAdGroupLocationCriterion() || [];\r\n\r\n const config = DependencyResolver.get('component/config/index');\r\n const accountInfo = config.get('CurrentAccount');\r\n const isIMAReachRepresentationPhase1Enabled = _.result(config.get('Permissions'), 'IsIMAReachRepresentationPhase1Enabled');\r\n const params = this.getData();\r\n\r\n const changedLocationCriterions = params && params.AdGroupCriterions\r\n && _.filter(params.AdGroupCriterions, item =>\r\n item && (item.CriterionType === 'Location' || item.CriterionType === 'Radius'));\r\n\r\n const hasLocationChanged = changedLocationCriterions && changedLocationCriterions.length > 0;\r\n\r\n if (hasLocationChanged && isIMAReachRepresentationPhase1Enabled\r\n && this.isNewUI && locationCriterions.length > 0) {\r\n const onYes = () => this.saveAsync();\r\n const locationsInfo = getLocationsInfo(locationCriterions);\r\n\r\n checkIMAReachPromise = showIMAReachModal({\r\n locationsInfo,\r\n onYes,\r\n deliveryChannel: 'AIM',\r\n campaignId: Number(this.viewContext.currentCampaign.Id),\r\n adGroupId: Number(this.viewContext.currentAdGroup.Id),\r\n i18n: this.i18n,\r\n aid: accountInfo.Id,\r\n cid: accountInfo.AdvertiserCustomerID,\r\n });\r\n }\r\n\r\n return checkIMAReachPromise.then((isIMAReachModalShow) => {\r\n if (isIMAReachModalShow) {\r\n return false;\r\n }\r\n return this.saveAsync();\r\n });\r\n }\r\n\r\n /**\r\n * Save the adgroup with the given setting.\r\n *\r\n * @returns {Promise} - returns promise of returning boolean value indicating\r\n * if the save process is succesful or not.\r\n */\r\n saveAsync() {\r\n const params = this.getData();\r\n\r\n const jsdata = DependencyResolver.get('component/js-data-campaign/index');\r\n\r\n const updateAdGroupTask = jsdata.AdGroup.update(\r\n this.viewContext.currentAdGroup.Id,\r\n params,\r\n { adapter: 'bulk', cacheResponse: false }\r\n );\r\n\r\n this.errorsView.removeErrors();\r\n\r\n return updateAdGroupTask\r\n .then((data) => {\r\n if (_.isFinite(data.Id)) {\r\n this.viewContext.currentAdGroup = data;\r\n const saveSettingsActivity = this.aimAdGroupSettingsWizardScenario.saveSettings.create();\r\n logAdGroupPersonalizedOffers(\r\n this.supportCashbackSettings,\r\n saveSettingsActivity.signal.bind(saveSettingsActivity), params\r\n );\r\n return true;\r\n }\r\n\r\n return false;\r\n })\r\n .then((isSuccess) => {\r\n if (isSuccess) {\r\n return this.crudAudienceAdgroupBasic.advancedSettings.saveExtensions();\r\n }\r\n\r\n return Promise.resolve(false);\r\n })\r\n .then((isSuccess) => {\r\n if (window.App) {\r\n const CampaignId = Number(this.viewContext.currentCampaign.Id);\r\n const AdGroupId = Number(this.viewContext.currentAdGroup.Id);\r\n\r\n window.App.trigger('adGroupUpdated', {\r\n data: [{\r\n Id: AdGroupId,\r\n Name: this.viewContext.currentAdGroup.Name,\r\n CampaignId,\r\n }],\r\n });\r\n if (isSuccess) {\r\n this.router.navigateToRoute('adgroup_ad', { campaign_id: CampaignId, adgroup_id: AdGroupId });\r\n }\r\n }\r\n\r\n return isSuccess;\r\n })\r\n .catch((response) => {\r\n this.handleErrors(response);\r\n\r\n return Promise.resolve(false);\r\n })\r\n .finally(withUiBlock(this.$el, this.i18n.getString('Loading'), true));\r\n }\r\n\r\n handleErrors(response) {\r\n const saveSettingsActivity = this.aimAdGroupSettingsWizardScenario.saveSettings.create();\r\n\r\n if (response && response.entity) {\r\n const hasErrors = response && !_.isUndefined(response.errors);\r\n\r\n if (hasErrors) {\r\n if (response.errors.length) {\r\n const bulkApiErrors = this.i18nErrors.getBulkApiErrors(response.errors);\r\n const noMappedErrors = _.every(bulkApiErrors, error => error.code === error.message);\r\n\r\n if (_.isEmpty(bulkApiErrors) || noMappedErrors) {\r\n this.errorsView.setErrors([{ message: this.i18n.getString('GenericErrorMessage_Short') }]);\r\n\r\n saveSettingsActivity.error(`${getBulkErrorsLogMessage(response.errors)}, Entity:${JSON.stringify(response.entity)}`);\r\n } else {\r\n this.errorsView.setErrors(bulkApiErrors);\r\n\r\n saveSettingsActivity.trace(getBulkErrorsLogMessage(response.errors));\r\n }\r\n }\r\n } else {\r\n saveSettingsActivity.error(JSON.stringify(response));\r\n }\r\n } else {\r\n // Ajax error\r\n this.errorsView.setErrors(this.i18nErrors.getODataErrors(response.errors));\r\n }\r\n }\r\n\r\n /**\r\n * Renders the View.\r\n *\r\n * @returns {View} - returns the view itself.\r\n */\r\n render() {\r\n observeInDOM(\r\n this.$el,\r\n () => this.onRenderedInDOM()\r\n );\r\n\r\n this.$el.html(template(this));\r\n\r\n return this;\r\n }\r\n\r\n renderSettingsControls() {\r\n this.perfMarker.willRender();\r\n\r\n if (this.crudAudienceAdgroupBasic && this.advancedTargetSetting) {\r\n this.crudAudienceAdgroupBasic.render();\r\n this.advancedTargetSetting.render();\r\n\r\n this.$('.audience-adgroup-settings-container').append(this.crudAudienceAdgroupBasic.$el);\r\n this.$('.audience-adgroup-targets-container').append(this.advancedTargetSetting.$el);\r\n if (!this.isAudienceFeedBasedCampaign) {\r\n this.$('.audience-adgroup-targets-container').append('
');\r\n this.$('.optimized-container').html(collapseTemplate(this));\r\n this.renderOptTgtSwtich();\r\n }\r\n }\r\n\r\n if (this.crudAudienceAdgroupBasic.cashbackSettingsView) {\r\n this.crudAudienceAdgroupBasic.cashbackSettingsView.viewModel.CashbackPercent\r\n .subscribe((v) => {\r\n this.onCashbackPercentChange(v);\r\n });\r\n }\r\n\r\n this.$('.errors-container').append(this.errorsView.render().$el);\r\n\r\n if (!this.isAudienceFeedBasedCampaign) {\r\n this.$('.audience-reach-estimate-container').append(this.reachControl.render().$el);\r\n }\r\n\r\n this.perfMarker.done();\r\n }\r\n\r\n /**\r\n * Event handler for handling the updating of reach estimates.\r\n * @private\r\n * @param {object} parent - all raw critierions\r\n * @returns {View} - returns the view itself.\r\n */\r\n handleEstimateUpdates(parent = null) {\r\n const settingView = parent == null ? this : parent;\r\n const targetSettings = settingView.getTargetSettings();\r\n // This can be undefined if it's first displayed but has value when come from next step\r\n const biddingSchemeType = settingView.viewContext.currentCampaign &&\r\n settingView.viewContext.currentCampaign.BiddingScheme &&\r\n settingView.viewContext.currentCampaign.BiddingScheme.Type;\r\n const subType = settingView.viewContext.currentCampaign &&\r\n settingView.viewContext.currentCampaign.CampaignSubType;\r\n const bidinfo = BidStrategy[biddingSchemeType];\r\n const campaignSetting = _.first(_.get(settingView.viewContext.currentCampaign, 'CampaignSettings')) || {};\r\n const feedInfo = getFeedInfo(campaignSetting);\r\n const useOptimizedTargeting = settingView.optTgtReactComponent.current &&\r\n settingView.optTgtReactComponent.current.getData();\r\n // eslint-disable-next-line max-len\r\n const targets = this.estimateRequestFactory.createWithTargetSettings(\r\n targetSettings,\r\n bidinfo, subType, feedInfo, useOptimizedTargeting\r\n );\r\n const hasAudienceRemarketingList =\r\n settingView.currentLevelTargetInfo.hasAudienceRemarketingList();\r\n\r\n settingView.reachControl.updateEstimate(targets, hasAudienceRemarketingList);\r\n }\r\n\r\n /**\r\n * Event handler for Age/Gender Exclusion for PT\r\n * @private\r\n * @returns {View} - returns true if age/gender setting view is re-rendered.\r\n */\r\n handleAgeGenderExclusion() {\r\n const { advancedTargetSetting } = this;\r\n let shouldShowWarningMessage = false;\r\n if (advancedTargetSetting && (_.get(this.viewContext, 'currentCampaign.CampaignType') === 8) &&\r\n (_.get(this.viewContext, 'currentCampaign.CampaignSubType') === 0) &&\r\n advancedTargetSetting.showTargetExclusionActualDeliveryStatus) {\r\n if (advancedTargetSetting.criterionsHaveNoDataInOriginalPayload &&\r\n (!_.isEmpty(advancedTargetSetting.criterionsHaveNoDataInOriginalPayload.Age) ||\r\n !_.isEmpty(advancedTargetSetting.criterionsHaveNoDataInOriginalPayload.Gender))) {\r\n // if no-data target is found, we should show this warning because we are delivery actual delivery status with PT setting and target type.\r\n shouldShowWarningMessage = true;\r\n }\r\n const useOptimizedTargeting = this.optTgtReactComponent.current && this.optTgtReactComponent.current.getData();\r\n const genderTargetSelectionView = advancedTargetSetting.genderTargetSetting && advancedTargetSetting.genderTargetSetting.targetSelectionView;\r\n const ageTargetSelectionView = advancedTargetSetting.ageTargetSetting && advancedTargetSetting.ageTargetSetting.targetSelectionView;\r\n advancedTargetSetting.setupVirtualTargets(useOptimizedTargeting, ageTargetSelectionView, genderTargetSelectionView);\r\n ageTargetSelectionView.render();\r\n genderTargetSelectionView.render();\r\n }\r\n return shouldShowWarningMessage;\r\n }\r\n\r\n /**\r\n * Get User selected Target Setting options\r\n * @private\r\n *\r\n * @returns {Array} - Select TargetAndBid Targets\r\n */\r\n getTargetSettings() {\r\n // Location is not part of the TargetSetting Property\r\n let selectedTypes = this.currentLevelTargetInfo.getAllNoneEmptyTypeKeys();\r\n selectedTypes = _.reject(\r\n selectedTypes,\r\n selectedType => selectedType === 'Location' ||\r\n selectedType === 'Radius' ||\r\n selectedType === 'NegativeLocation' ||\r\n selectedType === 'Device' ||\r\n selectedType === 'ContextualTarget'\r\n );\r\n\r\n const targetSettingsSetByUser = this.advancedTargetSetting.getTargetSettings();\r\n const selectedAndTargetSetted = _.intersection(selectedTypes, targetSettingsSetByUser);\r\n\r\n return selectedAndTargetSetted;\r\n }\r\n\r\n getAdUnitIds() {\r\n return this.advancedTargetSetting.getAdUnitIds();\r\n }\r\n\r\n renderOptTgtSwtich() {\r\n ReactDOM.render(\r\n ,\r\n this.$('.optimized-toggle')[0]\r\n );\r\n }\r\n\r\n remove() {\r\n const locationTargetView = _.get(this, 'advancedTargetSetting.locationTargetSetting.targetSelectionView.locationTargetsView');\r\n if (locationTargetView) {\r\n locationTargetView.remove();\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport Promise from 'bluebird';\r\nimport {\r\n ageSettingOptionsFactory,\r\n genderSettingOptionsFactory,\r\n deviceSettingOptions\r\n} from '@bingads-webui-campaign/audience-campaign-shared';\r\n\r\nfunction getConfigs(isAudienceCampaign = false, isSearchDSAShoppingAdgroupLevel = false) {\r\n return {\r\n Age: ageSettingOptionsFactory(isAudienceCampaign || isSearchDSAShoppingAdgroupLevel),\r\n Gender: genderSettingOptionsFactory(isAudienceCampaign),\r\n Device: deviceSettingOptions,\r\n };\r\n}\r\n\r\nfunction populateCriterions(\r\n targetInfo, isAudienceCampaign, isSearchDSAShoppingAdgroupLevel, isTargetAndBidArr,\r\n useOptimizedTargeting, showTargetExclusionActualDeliveryStatus, criterionsHaveNoDataInOriginalPayload,\r\n ageTargetSelectionView, genderTargetSelectionView,\r\n criterionType\r\n) {\r\n const config = getConfigs(isAudienceCampaign, isSearchDSAShoppingAdgroupLevel)[criterionType];\r\n\r\n const savedSelections = _.map(\r\n targetInfo.getAllByType(criterionType),\r\n criterion => criterion.Criterion[`${criterionType}Criterion`][config.criterionTypeTarget]\r\n );\r\n\r\n // if all targets are all unselected or selected, we do not need to mock included status for Age/gender target\r\n const isTargetAllUnselectedOrSelected = savedSelections.length === 0;\r\n\r\n const unsavedSelections = _.difference(_.keys(config.selections), savedSelections);\r\n\r\n // eslint-disable-next-line no-param-reassign\r\n showTargetExclusionActualDeliveryStatus = showTargetExclusionActualDeliveryStatus && _.contains(isTargetAndBidArr, criterionType) && !isTargetAllUnselectedOrSelected;\r\n // map no data into included/excluded\r\n if (showTargetExclusionActualDeliveryStatus &&\r\n _.isEmpty(criterionsHaveNoDataInOriginalPayload[criterionType])) {\r\n _.extend(criterionsHaveNoDataInOriginalPayload[criterionType], unsavedSelections);\r\n } else if (showTargetExclusionActualDeliveryStatus && criterionsHaveNoDataInOriginalPayload[criterionType]) {\r\n // revert the mapping and fallback to default backfill behavior\r\n if (criterionType === 'Age' && ageTargetSelectionView) {\r\n ageTargetSelectionView.saveSnapshot();\r\n _.map(criterionsHaveNoDataInOriginalPayload[criterionType], (criterion) => {\r\n // eslint-disable-next-line no-param-reassign\r\n ageTargetSelectionView.selections[criterion].isSelected = useOptimizedTargeting;\r\n });\r\n ageTargetSelectionView.updateCriterionDataAsync();\r\n } else if (criterionType === 'Gender' && genderTargetSelectionView) {\r\n genderTargetSelectionView.saveSnapshot();\r\n _.map(criterionsHaveNoDataInOriginalPayload[criterionType], (criterion) => {\r\n // eslint-disable-next-line no-param-reassign\r\n genderTargetSelectionView.selections[criterion].isSelected = useOptimizedTargeting;\r\n });\r\n genderTargetSelectionView.updateCriterionDataAsync();\r\n }\r\n }\r\n\r\n // if isTargetAndBid and has positive and audienceCampaign and non-empty\r\n // fill with negative else fill with positive\r\n let shouldFillWithNegative = false;\r\n const isTargetAndBid = _.contains(isTargetAndBidArr, criterionType);\r\n\r\n if ((isAudienceCampaign || (isSearchDSAShoppingAdgroupLevel && criterionType === 'Age')) &&\r\n isTargetAndBid && targetInfo.getAllByType(criterionType).length > 0 &&\r\n !(showTargetExclusionActualDeliveryStatus && useOptimizedTargeting)\r\n ) {\r\n shouldFillWithNegative = _.some(\r\n targetInfo.getAllByType(criterionType),\r\n criterion => criterion.CriterionType === criterionType\r\n );\r\n }\r\n\r\n return _.map(unsavedSelections, (selection) => {\r\n const criterion = {\r\n CriterionType: shouldFillWithNegative ? `Negative${criterionType}` : criterionType,\r\n Criterion: {\r\n Type: criterionType,\r\n BidAdjustment: 0,\r\n [`${criterionType}Criterion`]: {\r\n [config.criterionTypeTarget]: selection,\r\n },\r\n },\r\n };\r\n\r\n return targetInfo.createAsync(criterion);\r\n });\r\n}\r\n\r\n\r\n/**\r\n * populate checkbox based criterions\r\n * @param {Object} targetInfo - instance of AudienceTargetInfo\r\n * @param {Boolean} isAudienceCampaign - boolean value indicating audience campaign type\r\n * @param {Array} isTargetAndBidArr - array containing CriterionTypes that are TargetAndBid\r\n *\r\n * @returns {Promise} - async task to create criterions\r\n */\r\nexport function populateCheckboxBasedCriterions({\r\n targetInfo,\r\n isAudienceCampaign = false,\r\n isSearchDSAShoppingAdgroupLevel = false,\r\n isTargetAndBidArr = [],\r\n useOptimizedTargeting = false,\r\n showTargetExclusionActualDeliveryStatus = false,\r\n criterionsHaveNoDataInOriginalPayload = {},\r\n ageTargetSelectionView,\r\n genderTargetSelectionView,\r\n}) {\r\n if (!targetInfo) {\r\n return Promise.resolve();\r\n }\r\n\r\n const populator = _.partial(\r\n populateCriterions,\r\n targetInfo,\r\n isAudienceCampaign,\r\n isSearchDSAShoppingAdgroupLevel,\r\n isTargetAndBidArr,\r\n useOptimizedTargeting,\r\n showTargetExclusionActualDeliveryStatus,\r\n criterionsHaveNoDataInOriginalPayload,\r\n ageTargetSelectionView,\r\n genderTargetSelectionView\r\n );\r\n const criterionTypes = _.keys(getConfigs());\r\n const asyncTasks = _.map(criterionTypes, populator);\r\n\r\n return Promise.all(_.flatten(asyncTasks));\r\n}\r\n\r\nexport function isCashbackPercentEmpty(percent) {\r\n return percent == null || percent === '';\r\n}\r\n\r\n/**\r\n * This function compacts the populated criterions with bid adjustment 0.\r\n * This function should only be used in non audience campaign scnearios in campaign level\r\n * @param {Array} criterions - criterions returned from compareAndGetCriterionsDelta\r\n * @param {Boolean} supportCashbackSettings - whether cashback offer is enabled\r\n *\r\n * @returns {Array} - array of criterions to save\r\n */\r\nexport function compactPopulatedCriterions(criterions) {\r\n const hasNonZeroDeviceCriterion = _.find(criterions, criterion =>\r\n (criterion.CriterionType === 'Device') &&\r\n (criterion.Criterion.BidAdjustment !== 0 ||\r\n !isCashbackPercentEmpty(criterion.Criterion.CashbackPercent)));\r\n\r\n const criterionsToReturn =\r\n _.reject(criterions, criterion =>\r\n // Not saved in MT\r\n (criterion.Id < 0) &&\r\n // No bid adjustment is set\r\n (criterion.Criterion.BidAdjustment === 0) &&\r\n isCashbackPercentEmpty(criterion.Criterion.CashbackPercent) &&\r\n // Only Age, Gender and Device criterions were populated\r\n _.contains(['Age', 'Gender', 'Device'], criterion.CriterionType) &&\r\n // If there is non-zero Device criterion, we need to keep all other device criterions\r\n // This happens in campaign creation scenario\r\n !((criterion.CriterionType === 'Device') && hasNonZeroDeviceCriterion));\r\n\r\n return criterionsToReturn;\r\n}\r\n\r\nexport function removeAllVirtuals(criterions) {\r\n let ageCriterions = _.filter(criterions, criterion => criterion.CriterionType === 'Age');\r\n let genderCriterions = _.filter(criterions, criterion => criterion.CriterionType === 'Gender');\r\n let deviceCriterions = _.filter(criterions, criterion => criterion.CriterionType === 'Device');\r\n const others = _.reject(\r\n criterions,\r\n criterion => (criterion.CriterionType === 'Age' ||\r\n criterion.CriterionType === 'Gender' ||\r\n criterion.CriterionType === 'Device')\r\n );\r\n\r\n // remove all ageCriterions in the given conditions\r\n const shouldRemoveAge = ageCriterions.length === 6 &&\r\n _.every(\r\n ageCriterions,\r\n ageCriterion => (\r\n ageCriterion.Id < 0 &&\r\n ageCriterion.Criterion.BidAdjustment === 0 &&\r\n isCashbackPercentEmpty(ageCriterion.Criterion.CashbackPercent)\r\n )\r\n );\r\n\r\n if (shouldRemoveAge) {\r\n ageCriterions = [];\r\n }\r\n\r\n const shouldRemoveGender = genderCriterions.length === 3 &&\r\n _.every(\r\n genderCriterions,\r\n genderCriterion => (\r\n genderCriterion.Id < 0 &&\r\n genderCriterion.Criterion.BidAdjustment === 0 &&\r\n isCashbackPercentEmpty(genderCriterion.Criterion.CashbackPercent)\r\n )\r\n );\r\n\r\n if (shouldRemoveGender) {\r\n genderCriterions = [];\r\n }\r\n\r\n const shouldRemoveDevice = deviceCriterions.length === 3 &&\r\n _.every(\r\n deviceCriterions,\r\n deviceCriterion => (\r\n deviceCriterion.Id < 0 &&\r\n deviceCriterion.Criterion.BidAdjustment === 0 &&\r\n isCashbackPercentEmpty(deviceCriterion.Criterion.CashbackPercent)\r\n )\r\n );\r\n\r\n if (shouldRemoveDevice) {\r\n deviceCriterions = [];\r\n }\r\n\r\n const criterionsToReturn = [\r\n ...ageCriterions,\r\n ...genderCriterions,\r\n ...deviceCriterions,\r\n ...others,\r\n ];\r\n\r\n return criterionsToReturn;\r\n}\r\n\r\nfunction isFeedBasedAudienceCampaign(campaignSubType) {\r\n // AudienceFeedBased = 1,\r\n // AudienceDynamicFeedBased = 2,\r\n return campaignSubType === 1 || campaignSubType === 2 || campaignSubType === 'AudienceFeedBased' || campaignSubType === 'AudienceDynamicFeedBased';\r\n}\r\n\r\nexport function getBlackListCriterions({\r\n campaignType, campaignSubType, permissions = {}, selectedTypeKeys = [], isMSStoreAdsGAWorkflow,\r\n} = {}) {\r\n let config;\r\n const isWindowsStoreAdsEnabled = isMSStoreAdsGAWorkflow;\r\n const isWindowsStoreAdsManualCPAEnabled = (permissions && permissions.dynamic && permissions.dynamic.WindowsStoreAdsManualCPA) || isMSStoreAdsGAWorkflow;\r\n const isDomesticSimplifiedChineseEnabled = permissions && permissions.IsDomesticSimplifiedChineseEnabled;\r\n\r\n if (campaignType === 'shopping' && campaignSubType === 'ShoppingSponsoredProductAd' &&\r\n isWindowsStoreAdsEnabled && isWindowsStoreAdsManualCPAEnabled) {\r\n config = ['device', 'audience', 'placement'];\r\n } else {\r\n const blackListMap = {\r\n // For audience campaign, device targeting is not allowed for the close-beta time frame\r\n audience: ['device'],\r\n // For search, DSA and shopping campaign, audience targeting and 1p placements are not applicable\r\n default: ['audience', 'placement'],\r\n };\r\n\r\n config = _.result(blackListMap, campaignType, blackListMap.default);\r\n }\r\n\r\n if (isFeedBasedAudienceCampaign(campaignSubType)) {\r\n // For feed based audience campaign, device targeting is not allowed\r\n config = _.union(['placement'], config);\r\n }\r\n\r\n if (isDomesticSimplifiedChineseEnabled) {\r\n // For campaign under Pilot 1183 DomesticSimplifiedChinese, companyName, industry, jobFunction is not applicable\r\n config = _.union(['companyName', 'industry', 'jobFunction'], config);\r\n }\r\n\r\n return _.difference(config, selectedTypeKeys);\r\n}\r\n","import Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport ko from 'knockout';\r\nimport { cloneDeep } from '@bingads-webui-universal/primitive-utilities';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport {\r\n CompanyNameCriterionSetting,\r\n JobFunctionCriterionSetting,\r\n IndustryCriterionSetting,\r\n AgeCriterionSetting,\r\n DeviceCriterionSetting,\r\n GenderCriterionSetting,\r\n AudienceCriterionSetting,\r\n LocationCriterionSetting,\r\n PlacementSetting,\r\n PlacementWithIds,\r\n} from '@bingads-webui-campaign/audience-criterion-setting';\r\nimport {\r\n AudienceTargetSelector,\r\n criterionHelper,\r\n getCampaignType,\r\n} from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport template from './template.pug';\r\nimport {\r\n populateCheckboxBasedCriterions,\r\n compactPopulatedCriterions,\r\n removeAllVirtuals,\r\n getBlackListCriterions,\r\n} from './helper';\r\n\r\nlet permissions = {};\r\n/**\r\n * Class for handling advanced target setting\r\n * Which shows both targeting and bid adjustment\r\n *\r\n */\r\nexport class AudienceAdvancedTargetSettings extends Backbone.View {\r\n /**\r\n * Initializes the Audience advanced target setting\r\n *\r\n * @param {Object} options - options for the target setting\r\n * @param {Object} options.viewContext - view context\r\n * @param {Object} options.adGroupTargetInfo - adgroup target info\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = options;\r\n this.activityLogger = options.activityLogger;\r\n this.viewContext = options.viewContext || {};\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.supportedTypes = [\r\n 'Age',\r\n 'Gender',\r\n 'Device',\r\n 'Location',\r\n 'Radius',\r\n 'NegativeLocation',\r\n 'CompanyName',\r\n 'Industry',\r\n 'JobFunction',\r\n 'Audience'];\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n\r\n this.deps = options.deps || {};\r\n const permissionConfig = DependencyResolver.get('component/config/index');\r\n permissions = permissionConfig.get('Permissions');\r\n\r\n this.Enable1PPlacementTargeting = permissions && permissions.dynamic && permissions.dynamic.Enable1PPlacementTargeting;\r\n\r\n this.supportedTypes = _.compact([\r\n 'Age',\r\n 'Gender',\r\n 'Device',\r\n 'Location',\r\n 'Radius',\r\n 'NegativeLocation',\r\n 'CompanyName',\r\n 'Industry',\r\n 'JobFunction',\r\n 'Audience',\r\n this.Enable1PPlacementTargeting && 'Placement',\r\n ]);\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.parentLevelTargetInfo = options.parentLevelTargetInfo;\r\n\r\n // Location criterion is purely handled by the location criterion control\r\n this.supportedTypes = _.reject(this.supportedTypes, type =>\r\n (type === 'Location' || type === 'Radius' || type === 'NegativeLocation'));\r\n\r\n // Unmodified needs to be saved, so that comparison can be made\r\n this.unmodifiedCriterions =\r\n cloneDeep(this.currentLevelTargetInfo.getAllByTypes(this.supportedTypes));\r\n\r\n this.populateInitialTargetOrBidSettings();\r\n\r\n // Create virtual targets for Age and Gender\r\n // but save the original data for further use\r\n this.showTargetExclusionActualDeliveryStatus = _.get(permissions, 'dynamic.PredictiveTargetingShowAgeGenderTargetExclusionActualDeliveryStatus', false);\r\n this.criterionsHaveNoDataInOriginalPayload = { Age: [], Gender: [] };\r\n const useOptimizedTargeting = _.get(this.viewContext, 'currentAdGroup.UseOptimizedTargeting', false);\r\n\r\n this.setupVirtualTargets(useOptimizedTargeting);\r\n\r\n const parentLevelSelectedTypeKeys =\r\n this.parentLevelTargetInfo ? this.parentLevelTargetInfo.getAllNoneEmptyTypeKeys() : [];\r\n const currentLevelSelectedTypeKeys = this.currentLevelTargetInfo.getAllNoneEmptyTypeKeys();\r\n this.initialSelectedTypeKeys = _.union(\r\n parentLevelSelectedTypeKeys,\r\n currentLevelSelectedTypeKeys\r\n );\r\n\r\n const { currentAdGroup } = this.viewContext;\r\n if (this.Enable1PPlacementTargeting && currentAdGroup && currentAdGroup.Settings) {\r\n const settingIndex = _.findIndex(currentAdGroup.Settings, setting => setting['@odata.type'] === '#Model.BoostPlacementSetting');\r\n const originalAdUnitIds = settingIndex === -1 ? [] : currentAdGroup.Settings[settingIndex].AdUnitIds;\r\n this.placementSelections = _.compact(_.map(PlacementWithIds, (value) => {\r\n if (_.difference(value.adUnitIds, originalAdUnitIds).length === 0) {\r\n return value;\r\n }\r\n return null;\r\n }));\r\n if (!_.isEmpty(this.placementSelections)) {\r\n this.initialSelectedTypeKeys.push('Placement');\r\n }\r\n }\r\n this.initializeTargetSettings();\r\n this.viewmodel = {\r\n isEditTargetCategoriesExpanded: ko.observable(false),\r\n };\r\n }\r\n\r\n get className() {\r\n return 'audience-advanced-target-settings-root';\r\n }\r\n\r\n setupVirtualTargets(useOptimizedTargeting = false, ageTargetSelectionView, genderTargetSelectionView) {\r\n if (!this.isAudienceCampaign) {\r\n return;\r\n }\r\n\r\n populateCheckboxBasedCriterions({\r\n targetInfo: this.currentLevelTargetInfo,\r\n isAudienceCampaign: true,\r\n isTargetAndBidArr: this.initialTargetSetting,\r\n useOptimizedTargeting,\r\n showTargetExclusionActualDeliveryStatus: this.showTargetExclusionActualDeliveryStatus,\r\n criterionsHaveNoDataInOriginalPayload: this.criterionsHaveNoDataInOriginalPayload,\r\n ageTargetSelectionView,\r\n genderTargetSelectionView,\r\n });\r\n }\r\n\r\n // Note: this is the audience feature adopted notion of campaignType mixed with more common, but\r\n // lower-cased notion of campaign type from Campaign UI\r\n get campaignType() {\r\n return getCampaignType(this.viewContext.currentCampaign) ||\r\n (_.isString(this.options.campaignType) && this.options.campaignType.toLowerCase());\r\n }\r\n\r\n get campaignSubType() {\r\n return this.viewContext.currentCampaign.CampaignSubType ||\r\n this.viewContext.currentCampaign.campaignSubType ||\r\n this.options.campaignSubType;\r\n }\r\n\r\n get isAudienceCampaign() {\r\n return this.campaignType === 'audience';\r\n }\r\n\r\n get isSearchDSAShoppingAdgroupLevel() {\r\n return _.contains(['search', 'dynamicSearch', 'shopping'], this.campaignType)\r\n && permissions && permissions.dynamic && permissions.dynamic.NegativeAgeTargetForAdGroups\r\n && this.viewContext.level === 'adgroup';\r\n }\r\n\r\n populateInitialTargetOrBidSettings() {\r\n this.initialTargetSetting = [];\r\n\r\n // Initialize target settings with all TargetAndBid targets\r\n const adGroupTargetSettings = _.result(this.viewContext.currentAdGroup, 'TargetSetting', null);\r\n if (adGroupTargetSettings) {\r\n _.each(adGroupTargetSettings.Details, (targetSetting) => {\r\n if (!targetSetting.TargetAll) {\r\n this.initialTargetSetting.push(targetSetting.CriterionType);\r\n }\r\n });\r\n }\r\n }\r\n\r\n getAdUnitIds() {\r\n if (this.Enable1PPlacementTargeting) {\r\n return this.placementSetting.getSnapshot();\r\n }\r\n return null;\r\n }\r\n /**\r\n * Handler for initialization after the criterion fetched\r\n *\r\n * @returns {Object} - this object.\r\n */\r\n initializeTargetSettings() {\r\n const parentLevelSelectedTypeKeys =\r\n this.parentLevelTargetInfo ? this.parentLevelTargetInfo.getAllNoneEmptyTypeKeys() : [];\r\n const currentLevelSelectedTypeKeys = this.currentLevelTargetInfo.getAllNoneEmptyTypeKeys();\r\n const selectedTypeKeys = _.union(parentLevelSelectedTypeKeys, currentLevelSelectedTypeKeys);\r\n if (this.Enable1PPlacementTargeting && !_.isEmpty(this.placementSelections)) {\r\n selectedTypeKeys.push('Placement');\r\n }\r\n const blackListCriterions = getBlackListCriterions({\r\n campaignType: this.campaignType,\r\n campaignSubType: this.campaignSubType,\r\n permissions,\r\n selectedTypeKeys: this.initialSelectedTypeKeys\r\n .filter((key) => {\r\n if (this.options.isMSStoreAdsGAWorkflow) {\r\n return key !== 'Device';\r\n }\r\n return true;\r\n }).map(key => key.toLocaleLowerCase()),\r\n isMSStoreAdsGAWorkflow: this.options.isMSStoreAdsGAWorkflow,\r\n });\r\n\r\n let lockedKeys = ['location', 'device'];\r\n\r\n if (this.activityLogger) {\r\n if (_.isArray(blackListCriterions) && !_.isEmpty(blackListCriterions)) {\r\n const conflictingKeys = _.intersection(lockedKeys, blackListCriterions);\r\n if (!_.isEmpty(conflictingKeys)) {\r\n this.activityLogger.signal(`conflicting audience target categories. lockedKeys: ${lockedKeys}; blackListCriterions: ${blackListCriterions}`, 'audience advanced target settings');\r\n }\r\n }\r\n }\r\n\r\n lockedKeys = _.difference(lockedKeys, blackListCriterions);\r\n\r\n this.audienceTargetSelector = new AudienceTargetSelector({\r\n selectedTypeKeys,\r\n blackListKeys: blackListCriterions,\r\n lockedKeys,\r\n level: this.viewContext.level,\r\n activityLogger: this.activityLogger,\r\n permissions,\r\n });\r\n this.listenTo(this.audienceTargetSelector, 'selectionChanged', this.onSelectionChanged);\r\n\r\n const checkBoxBasedOptions = {\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n parentLevelTargetInfo: this.parentLevelTargetInfo,\r\n showTargetSelection: true,\r\n showBidAdjustment: true,\r\n showTargetOrBid: false,\r\n isLiveUpdateEnabled: false,\r\n // level toggle is only enabled for non-audience campaign\r\n enableLevelToggle: !this.isAudienceCampaign,\r\n viewContext: this.viewContext,\r\n isAudienceCampaign: this.isAudienceCampaign,\r\n isSearchDSAShoppingAdgroupLevel: this.isSearchDSAShoppingAdgroupLevel,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n };\r\n\r\n const searchBasedOptions = {\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n parentLevelTargetInfo: this.parentLevelTargetInfo,\r\n showTargetSelection: true,\r\n showBidAdjustment: true,\r\n // For search, DSA and shopping campaign, the target settings are bid only\r\n // For audience campaign, user can choose between bid only / target and bid\r\n showTargetOrBid: this.isAudienceCampaign,\r\n // level toggle is only enabled for non-audience campaign\r\n enableLevelToggle: !this.isAudienceCampaign,\r\n viewContext: this.viewContext,\r\n showBidOnlyNote: !this.isAudienceCampaign,\r\n showExclusion: this.isAudienceCampaign,\r\n defaultBidAdjustment: this.isAudienceCampaign ? 0 : 15,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n isFilterCriterionLevelAdGroup: permissions.isFilterCriterionLevelAdGroup,\r\n };\r\n\r\n this.ageTargetSetting = new AgeCriterionSetting(_.extend({\r\n isTargetAndBid: _.contains(this.initialTargetSetting, 'Age'),\r\n activityLogger: this.activityLogger,\r\n }, checkBoxBasedOptions));\r\n\r\n this.genderTargetSetting = new GenderCriterionSetting(_.extend({\r\n isTargetAndBid: _.contains(this.initialTargetSetting, 'Gender'),\r\n activityLogger: this.activityLogger,\r\n }, checkBoxBasedOptions));\r\n\r\n if (!_.contains(blackListCriterions, 'device')) {\r\n this.deviceTargetSetting = new DeviceCriterionSetting(_.extend({\r\n isTargetAndBid: _.contains(this.initialTargetSetting, 'Device'),\r\n activityLogger: this.activityLogger,\r\n }, _.defaults({\r\n // For device, level toggle is always enabled regardless of the type.\r\n enableLevelToggle: true,\r\n scenario: this.options.scenario,\r\n }, checkBoxBasedOptions)));\r\n }\r\n\r\n this.companyNameTargetSetting = new CompanyNameCriterionSetting(_.extend({\r\n isTargetAndBid: _.contains(this.initialTargetSetting, 'CompanyName'),\r\n activityLogger: this.activityLogger,\r\n }, searchBasedOptions));\r\n\r\n this.industryTargetSetting = new IndustryCriterionSetting(_.extend({\r\n isTargetAndBid: _.contains(this.initialTargetSetting, 'Industry'),\r\n activityLogger: this.activityLogger,\r\n }, searchBasedOptions));\r\n if (this.Enable1PPlacementTargeting) {\r\n this.placementSetting = new PlacementSetting(_.defaults({\r\n showBidAdjustment: false,\r\n showExclusion: false,\r\n placementSelections: this.placementSelections,\r\n }, searchBasedOptions));\r\n }\r\n\r\n this.jobFunctionTargetSetting = new JobFunctionCriterionSetting(_.extend({\r\n isTargetAndBid: _.contains(this.initialTargetSetting, 'JobFunction'),\r\n activityLogger: this.activityLogger,\r\n }, searchBasedOptions));\r\n\r\n // Location Target Setting is solely done on the existing control.\r\n this.locationTargetSetting = new LocationCriterionSetting({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n viewContext: this.viewContext,\r\n scenario: this.options.scenario,\r\n showTargetSelection: true,\r\n showBidAdjustment: false,\r\n showTargetOrBid: false,\r\n hideTitleLabel: !((this.options.scenario === 'campaign-creation') && (_.contains(['search', 'dynamicSearch'], this.campaignType))),\r\n deps: this.deps,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n activityLogger: this.activityLogger,\r\n });\r\n\r\n if (!_.contains(blackListCriterions, 'audience')) {\r\n this.audienceTargetSetting = new AudienceCriterionSetting({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n isTargetAndBid: _.contains(this.initialTargetSetting, 'Audience'),\r\n showTargetSelection: true,\r\n showBidAdjustment: true,\r\n showTargetOrBid: true,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n viewContext: this.viewContext,\r\n activityLogger: this.activityLogger,\r\n });\r\n }\r\n\r\n // populate the current targets for search, DSA and shopping campaign\r\n if (!this.isAudienceCampaign) {\r\n populateCheckboxBasedCriterions({\r\n targetInfo: this.currentLevelTargetInfo,\r\n isSearchDSAShoppingAdgroupLevel: this.isSearchDSAShoppingAdgroupLevel,\r\n });\r\n }\r\n\r\n populateCheckboxBasedCriterions({\r\n targetInfo: this.parentLevelTargetInfo,\r\n isAudienceCampaign: this.isAudienceCampaign,\r\n });\r\n\r\n return true;\r\n }\r\n\r\n getTargetSettings() {\r\n // Location, Device not supported, Age and Gender only follow the intial target setting\r\n const targetSettings = _.compact([\r\n ..._.intersection(this.initialTargetSetting, ['Age', 'Gender']),\r\n this.audienceTargetSetting && this.audienceTargetSetting.getIsTargetAndBid() ? 'Audience' : null,\r\n this.companyNameTargetSetting.getIsTargetAndBid() ? 'CompanyName' : null,\r\n this.industryTargetSetting.getIsTargetAndBid() ? 'Industry' : null,\r\n this.jobFunctionTargetSetting.getIsTargetAndBid() ? 'JobFunction' : null,\r\n ]);\r\n\r\n return targetSettings;\r\n }\r\n\r\n onSelectionChanged(containerId) {\r\n this.$(this.getContainerNameFromId(containerId)).show();\r\n }\r\n\r\n getContainerNameFromId(id) {\r\n return `.${id}-target-setting-container`;\r\n }\r\n\r\n /**\r\n * Define events and event handlers for them.\r\n *\r\n * @readonly\r\n * @returns {Object} returns object defining events\r\n */\r\n get events() {\r\n return {\r\n 'click .toggle-edit-target-category': 'onToggleEditTargetCategory',\r\n };\r\n }\r\n\r\n getSubViews() {\r\n return _.compact([\r\n this.ageTargetSetting,\r\n this.genderTargetSetting,\r\n this.deviceTargetSetting,\r\n this.audienceTargetSetting,\r\n this.companyNameTargetSetting,\r\n this.industryTargetSetting,\r\n this.jobFunctionTargetSetting,\r\n this.locationTargetSetting,\r\n this.Enable1PPlacementTargeting && this.placementSetting,\r\n ]);\r\n }\r\n\r\n toggleCashbackPercentColumns(isCashbackPercentColumnVisible, inheritInfo) {\r\n this.supportCashbackSettings = isCashbackPercentColumnVisible;\r\n\r\n const subViews = this.getSubViews();\r\n subViews.forEach((subView) => {\r\n if (subView.resetSupportCashbackSettings) {\r\n subView.resetSupportCashbackSettings(isCashbackPercentColumnVisible, inheritInfo);\r\n }\r\n });\r\n }\r\n\r\n validate() {\r\n return this.ageTargetSetting.validate() &&\r\n this.genderTargetSetting.validate() &&\r\n (this.deviceTargetSetting ? this.deviceTargetSetting.validate() : true) &&\r\n (this.audienceTargetSetting ? this.audienceTargetSetting.validate() : true) &&\r\n this.companyNameTargetSetting.validate() &&\r\n this.industryTargetSetting.validate() &&\r\n this.jobFunctionTargetSetting.validate();\r\n }\r\n\r\n getCampaignLocationCriterions() {\r\n return this.locationTargetSetting ?\r\n this.locationTargetSetting.getCampaignLocationCriterions() : [];\r\n }\r\n\r\n getAllLocations() {\r\n const {\r\n intent = [],\r\n locations = [],\r\n } = this.locationTargetSetting ? this.locationTargetSetting.getAllLocations() : {};\r\n\r\n return locations.concat(intent);\r\n }\r\n\r\n // Audience Target Setting is fetched after the view is rendered.\r\n // Need to update the original criterions after the view is rendered so that the final calcultion will be correct.\r\n updateUnmodifiedCriterions() {\r\n this.unmodifiedCriterions = cloneDeep(this.currentLevelTargetInfo.getAllComputedByTypes(this.supportedTypes));\r\n }\r\n\r\n /**\r\n * Get the object data to save the AdGroup.\r\n *\r\n * @returns {Object} - data representation of the object.\r\n */\r\n getData() {\r\n const params = {};\r\n\r\n // use compact to remove null value for placement, it will be handle by placementSetting\r\n const modifiedCriterions =\r\n _.compact(cloneDeep(this.currentLevelTargetInfo.getAllComputedByTypes(this.supportedTypes)));\r\n let targets =\r\n criterionHelper.compareAndGetCriterionsDelta(_.compact(this.unmodifiedCriterions), modifiedCriterions);\r\n\r\n if (!this.isAudienceCampaign && (this.viewContext.level === 'campaign')) {\r\n targets = compactPopulatedCriterions(targets);\r\n } else if (this.isAudienceCampaign && this.viewContext.level !== 'campaign') {\r\n targets = removeAllVirtuals(targets);\r\n }\r\n\r\n const {\r\n intent = [],\r\n locations = [],\r\n deletedLocations = [],\r\n } = this.locationTargetSetting ? this.locationTargetSetting.getData() : {};\r\n const locationCriterions = this.isAudienceCampaign ? locations.concat(deletedLocations) :\r\n intent.concat(locations).concat(deletedLocations);\r\n\r\n targets = targets.concat(locationCriterions);\r\n\r\n if (this.deviceTargetSetting &&\r\n this.deviceTargetSetting.bidAdjustmentGrid.deviceTargetsUpdateView &&\r\n permissions.IsOriginalDeviceTargetingEnabled\r\n ) {\r\n const { deviceTargetsUpdateView } = this.deviceTargetSetting.bidAdjustmentGrid;\r\n const originalDeviceCriterions =\r\n deviceTargetsUpdateView.targetsView.viewmodel.getValues();\r\n\r\n if (originalDeviceCriterions && originalDeviceCriterions.length > 0) {\r\n _.each(originalDeviceCriterions, (target) => {\r\n target.Status = _.isEmpty(target.Status) ? 'Active' : target.Status;//eslint-disable-line\r\n });\r\n\r\n targets = _.filter(targets, target => target.CriterionType !== 'Device');\r\n targets = targets.concat(originalDeviceCriterions);\r\n }\r\n }\r\n\r\n _.each(targets, (target) => {\r\n if (target.Id < 0) {\r\n delete target.Id; //eslint-disable-line\r\n }\r\n\r\n // Since it is settings, ensure all criterions have Id for the scope.\r\n if (this.viewContext.level === 'campaign') {\r\n target.Campaign = { //eslint-disable-line\r\n Id: this.viewContext.currentCampaign.Id,\r\n };\r\n } else {\r\n target.AdGroup = { //eslint-disable-line\r\n Id: this.viewContext.currentAdGroup.Id,\r\n };\r\n }\r\n });\r\n\r\n this.removeCashbackPercent(targets);\r\n\r\n params[`${this.currentLevelTargetInfo.resourceName}s`] = targets;\r\n\r\n return params;\r\n }\r\n\r\n removeCashbackPercent(targets) {\r\n if (!this.supportCashbackSettings) {\r\n targets.forEach((criterion) => {\r\n delete criterion.Criterion.CashbackPercent; // eslint-disable-line\r\n });\r\n }\r\n }\r\n\r\n fillCriterionsWithId(criterions) {\r\n if (_.isArray(criterions) && criterions.length) {\r\n this.currentLevelTargetInfo.fillCriterionsWithId(criterions);\r\n }\r\n }\r\n\r\n /**\r\n * Handler for the edit category change\r\n *\r\n * @returns {undefined}\r\n */\r\n onToggleEditTargetCategory() {\r\n this.$('.audience-target-selector-container').toggle();\r\n this.viewmodel.isEditTargetCategoriesExpanded(!this.viewmodel.isEditTargetCategoriesExpanded());\r\n }\r\n\r\n /**\r\n * Renders this view\r\n *\r\n * @returns {Object} - the view itself\r\n */\r\n render() {\r\n this.$el.html(template({\r\n i18n: this.i18n,\r\n }));\r\n\r\n ko.applyBindings(this.viewmodel, this.el);\r\n\r\n const { initialSelectedTypeKeys } = this;\r\n\r\n this.$('.audience-target-selector-container').empty().append(this.audienceTargetSelector.render().$el);\r\n this.$('.location-target-setting-container').empty().append(this.locationTargetSetting.render().$el);\r\n\r\n // hide other criterions\r\n this.$('.age-target-setting-container').empty().append(this.ageTargetSetting.render().$el);\r\n\r\n if (!_.contains(initialSelectedTypeKeys, 'Age')) {\r\n this.$('.age-target-setting-container').hide();\r\n }\r\n\r\n this.$('.gender-target-setting-container').empty().append(this.genderTargetSetting.render().$el);\r\n\r\n if (!_.contains(initialSelectedTypeKeys, 'Gender')) {\r\n this.$('.gender-target-setting-container').hide();\r\n }\r\n\r\n // Device is always shown, either all or none is created.\r\n if (this.deviceTargetSetting) {\r\n this.$('.device-target-setting-container').empty().append(this.deviceTargetSetting.render().$el);\r\n }\r\n\r\n this.$('.companyName-target-setting-container').empty().append(this.companyNameTargetSetting.render().$el);\r\n\r\n if (!_.contains(initialSelectedTypeKeys, 'CompanyName')) {\r\n this.$('.companyName-target-setting-container').hide();\r\n }\r\n\r\n this.$('.industry-target-setting-container').empty().append(this.industryTargetSetting.render().$el);\r\n\r\n if (!_.contains(initialSelectedTypeKeys, 'Industry')) {\r\n this.$('.industry-target-setting-container').hide();\r\n }\r\n\r\n this.$('.jobFunction-target-setting-container').empty().append(this.jobFunctionTargetSetting.render().$el);\r\n\r\n if (!_.contains(initialSelectedTypeKeys, 'JobFunction')) {\r\n this.$('.jobFunction-target-setting-container').hide();\r\n }\r\n\r\n if (this.Enable1PPlacementTargeting) {\r\n this.$('.placement-target-setting-container').empty().append(this.placementSetting.render().$el);\r\n\r\n if (!_.contains(initialSelectedTypeKeys, 'Placement')) {\r\n this.$('.placement-target-setting-container').hide();\r\n }\r\n }\r\n return this;\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport template from './template.pug';\r\n\r\nexport class BmcRedirectView extends Backbone.View {\r\n /**\r\n * Initializes the {BmcRedirectView} class.\r\n *\r\n * @param {Object} options - options for initializing the class.\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = options;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n const router = _.chain(options.deps).result('router', {}).value();\r\n this.navigateToRoute = router.navigateToRoute || _.noop;\r\n this.activityLogger = options.logScenario.bmcRedirect.create();\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .btn-cancel': 'onExit',\r\n 'click .bmc_url_link': 'redirect2BMC',\r\n 'click .feed_url_link': 'redirect2UploadFeed',\r\n };\r\n }\r\n\r\n /**\r\n * Renders the View.\r\n *\r\n * @returns {View} - returns the view itself.\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n this.activityLogger.signal('have no store');\r\n return this;\r\n }\r\n\r\n /**\r\n * Handles the event when click BMC url\r\n *\r\n * @returns {undefined}\r\n */\r\n redirect2BMC() {\r\n this.activityLogger.signal('store creation link click');\r\n this.navigateToRoute('bing_merchant_center');\r\n }\r\n\r\n /**\r\n * Handles the event when click upload Feed url\r\n *\r\n * @returns {undefined}\r\n */\r\n redirect2UploadFeed() {\r\n this.activityLogger.signal('feed upload link click');\r\n this.navigateToRoute('dynamicdata_management');\r\n }\r\n\r\n /**\r\n * Handles the event when the exit is requested\r\n * and navigates to Campaign page\r\n *\r\n * @returns {undefined}\r\n */\r\n onExit() {\r\n if (_.isFunction(this.options.callbackBeforeRemove)) {\r\n this.options.callbackBeforeRemove();\r\n }\r\n this.activityLogger.signal('cancel clicked');\r\n this.navigateToRoute('campaign');\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\n\r\nexport const displaySuccessDialog = () => {\r\n const stateManager = DependencyResolver.get('component/statemanager/campaignStateManager');\r\n const config = DependencyResolver.get('component/config/index');\r\n const preferencesService = DependencyResolver.get('component/preference/service/index');\r\n\r\n const usePreferencesService = _.result(config.get('Permissions'), 'IsUsePreferencesServiceEnabled');\r\n\r\n function showSuccessDialog() {\r\n const context = DependencyResolver.get('audienceCampaignPageContext');\r\n const constants = DependencyResolver.get('Constants');\r\n\r\n const { CurrentAccount } = context;\r\n if (_.isObject(CurrentAccount)) {\r\n const aid = CurrentAccount.Id;\r\n const cid = CurrentAccount.AdvertiserCustomerID;\r\n const AccountStatus = constants.enums.accountStatus;\r\n const isPendingPayment = CurrentAccount.Status === AccountStatus.pendingPaymentInstrument;\r\n const isAccountOnHold = CurrentAccount.Status !== AccountStatus.active;\r\n\r\n let accountPausedReason = constants.enums.accountInactiveReason.notSet;\r\n\r\n if (_.isArray(CurrentAccount.InactiveReasons) &&\r\n CurrentAccount.InactiveReasons.length > 0) {\r\n const accountPausedReasons = [\r\n constants.enums.accountInactiveReason.pausedDueToSystemIssue,\r\n constants.enums.accountInactiveReason.pausedZeroBalance,\r\n constants.enums.accountInactiveReason.pausedNoValidiO,\r\n ];\r\n\r\n _.some(CurrentAccount.InactiveReasons, (reason) => {\r\n if (accountPausedReasons.indexOf(reason) !== -1) {\r\n accountPausedReason = reason;\r\n return true;\r\n }\r\n\r\n return false;\r\n });\r\n }\r\n\r\n const SuccessDialog = DependencyResolver.get('campaignui/feature/campaign-create-advanced/view/success-dialog');\r\n\r\n const successDialog = new SuccessDialog({\r\n aid,\r\n cid,\r\n isPendingPayment,\r\n isAccountOnHold,\r\n accountPausedReason,\r\n });\r\n successDialog.show();\r\n }\r\n }\r\n\r\n if (usePreferencesService === true) {\r\n preferencesService.initialize().then(() => {\r\n const prefix = config.get('StateManagerKeyPrefix');\r\n const gridPreference = preferencesService.findByName(`${prefix}successDialog`);\r\n\r\n if (!gridPreference || !gridPreference.Data.doNotShowAgain) {\r\n showSuccessDialog();\r\n }\r\n });\r\n } else {\r\n stateManager.getItem('successDialog', (err, data) => {\r\n if (err || !data || !data.permanent.doNotShowAgain) {\r\n showSuccessDialog();\r\n }\r\n });\r\n }\r\n};\r\n\r\nexport const getFeedData = ({ $top = 20, $skip = 0, permissions = {} } = {}) => {\r\n const jsdata = DependencyResolver.get('component/js-data-campaign/index');\r\n\r\n const query = {\r\n $filter: 'Status eq Enum.FeedStatus\\'Active\\' and FeedCategories/any(c:c eq Enum.FeedCategory\\'DynamicData\\')',\r\n // set a large number so that we don't miss any feed\r\n $top,\r\n $skip,\r\n };\r\n\r\n const supportedFeedTypeForDynamicDataFeedCamapign = {\r\n DynamicDataAutosListingFeed: 'DynamicDataAutosListingFeed',\r\n DynamicDataEventsFeed: 'DynamicDataEventsFeed',\r\n DynamicDataHotelsAndVacationRentalsFeed: 'DynamicDataHotelsAndVacationRentalsFeed',\r\n DynamicDataToursAndActivitiesFeed: 'DynamicDataToursAndActivitiesFeed',\r\n };\r\n\r\n if (_.result(permissions, 'IsCuriseFeedForAudienceCampaignEnabled')) {\r\n supportedFeedTypeForDynamicDataFeedCamapign.DynamicDataCruisesFeed = 'DynamicDataCruisesFeed';\r\n }\r\n\r\n return jsdata.Feed.findAll({\r\n query,\r\n }).then(data => _.reject(data, item =>\r\n !supportedFeedTypeForDynamicDataFeedCamapign[item.FeedType]));\r\n};\r\n","import _ from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport { StepsWizard } from '@bingads-webui/steps-wizard';\r\nimport { AudienceTargetInfo } from '@bingads-webui-campaign/audience-target-info';\r\nimport { ResponsiveAdEditor } from '@bingads-webui-campaign/responsive-ad-editor';\r\nimport { AlertHelper } from '@bingads-webui-campaign/alert-helper';\r\nimport { CrudAudienceBudgetBid } from '@bingads-webui-campaign/crud-audience-budget-bid';\r\nimport { CrudAudienceCampaign, CrudAudienceShoppingCampaign } from '@bingads-webui-campaign/crud-audience-campaign';\r\nimport { CrudAudienceAdgroup } from '@bingads-webui-campaign/crud-audience-adgroup';\r\nimport { getLocalStorage } from '@bingads-webui/storage';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { withDFMCache } from '@bingads-webui/dfm-cache';\r\nimport { getProductScopeData as GetProductScopeData, mergeData } from '@bingads-webui-campaign-react/product-services';\r\nimport { serverContextStore } from '@bingads-webui-campaign/global-context-store';\r\nimport {\r\n schema,\r\n getProductData as GetProductData,\r\n ExperimentName,\r\n postABTestingEventLog,\r\n postABTestingFlightLog,\r\n getAudienceCreationPath,\r\n} from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { BmcRedirectView } from './bmc-redirect/view';\r\nimport { displaySuccessDialog, getFeedData as GetFeedData } from './utils';\r\nimport template from './template.pug';\r\n\r\n/**\r\n * AudienceCampaignCreationWizard class for the AudienceCampaign creation\r\n *\r\n * @class AudienceCampaignCreationWizard\r\n * @extends {Backbone.View}\r\n */\r\nexport class AudienceCampaignCreationWizard extends Backbone.View {\r\n /**\r\n * Initializes the {AudienceCampaignCreationWizard} class.\r\n *\r\n * @param {Object} options - options for initializing the class.\r\n * @param {Object} options.viewContext = viewContext for the View.\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.config = DependencyResolver.get('component/config/index');\r\n this.permissions = this.config.get('Permissions');\r\n this.isSwapStepsEnabled = this.permissions.IsAudienceCampaignSwapAdsBudgetAndBidsEnabled &&\r\n this.audienceCampaignType !== 'shopping';\r\n this.isCopyCampaignSettingsAudienceCampaignEnabled =\r\n this.permissions.IsCopyCampaignSettingsAudienceCampaignEnabled;\r\n this.isAudienceCampaignCollapseTargetSelectionEnabled =\r\n this.permissions.IsAudienceCampaignCollapseTargetSelectionEnabled;\r\n this.campaignCreationFlowImporvementEnabled = this.isCopyCampaignSettingsAudienceCampaignEnabled\r\n && this.isAudienceCampaignCollapseTargetSelectionEnabled\r\n && this.isSwapStepsEnabled;\r\n this.isOdataGetProductScopeEnabled = _.get(this.permissions, ['dynamic', 'OdataGetProductScope'], false);\r\n\r\n // fetch cache in DFM\r\n this.getProductWithDFM = withDFMCache(this.getProductData, 'getAudienceProductScopeDFM', this);\r\n this.getFeedWithDFM = withDFMCache(this.getFeedData, 'getFeedScopeDFM', this);\r\n\r\n this.viewContext = options.viewContext;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.audienceCampaignType = options.audienceCampaignType || '';\r\n this.localStorage = getLocalStorage();\r\n this.options = options;\r\n\r\n this.startToFinishMarker = options.perfMarker.createChild('audienceCampaignCreationTimeSpend');\r\n\r\n this.options.currentLevelTargetInfo = new AudienceTargetInfo({\r\n resourceName: 'AdGroupCriterion',\r\n isShoppingCampaign: this.audienceCampaignType === 'shopping',\r\n deps: options.deps,\r\n isForVNext: options.isForVNext,\r\n isAudienceCreationWorkflow: true,\r\n });\r\n this.options.scenario = 'campaign-creation';\r\n this.options.isAdImpressions = this.localStorage.get('CampaignObjective') === 'AdImpressions';\r\n this.perfMarker = options.perfMarker;\r\n const router = _.chain(options.deps).result('router', {}).value();\r\n this.navigateToRoute = router.navigateToRoute || _.noop;\r\n this.eventDelegator = _.result(options.deps, 'eventDelegator');\r\n this.setupInstrumentation();\r\n\r\n if (this.wizardActivity) {\r\n this.wizardActivity.signal('setup campaign');\r\n this.wizardActivity.trace(`wizard initialized with swap steps ${this.isSwapStepsEnabled ? 'enabled' : 'disabled'}`);\r\n }\r\n this.wizardRenderTime = 0;\r\n }\r\n\r\n setupInstrumentation() {\r\n const instr = DependencyResolver.get('campaignui/feature/instrumentation/index');\r\n\r\n instr.addScenario(schema);\r\n\r\n if (this.audienceCampaignType === 'shopping') {\r\n this.aimCampaignCreationScenario = instr.aimShoppingCampaignCreationWizard.create();\r\n this.wizardActivity = this.aimCampaignCreationScenario.wizardActivity.create();\r\n } else {\r\n this.aimCampaignCreationScenario = instr.aimCampaignCreationWizard.create();\r\n this.wizardActivity = this.aimCampaignCreationScenario.wizardActivity.create();\r\n }\r\n\r\n this.options.logScenario = this.aimCampaignCreationScenario;\r\n }\r\n\r\n logShoppingCampaignCreationEvent(log) {\r\n if (this.audienceCampaignType === 'shopping') {\r\n const logContent = {\r\n ...log,\r\n flow: 'audience-shopping/old',\r\n guid: this.wizardActivity.id,\r\n };\r\n if (['Switch Done', 'Exit by CancelButton', 'SaveAndExit'].includes(log.status)) {\r\n const currentTime = new Date().getTime();\r\n logContent.stepDuration = currentTime - this.wizardRenderTime;\r\n logContent.preStep = this.wizard.stepIndex === 0 ? '' : this.wizard.previousStepName;\r\n this.wizardRenderTime = currentTime;\r\n }\r\n this.wizardActivity.trace(JSON.stringify(logContent));\r\n }\r\n }\r\n\r\n get ComponentsLoadedPromise() {\r\n return this.loadCrudAudienceAdPromise;\r\n }\r\n\r\n showError(msg) {\r\n const alertHelper = new AlertHelper({ i18n: this.i18n });\r\n alertHelper.showError(msg);\r\n }\r\n\r\n /**\r\n * Renders the View.\r\n *\r\n * @returns {View} - returns the view itself.\r\n */\r\n render() {\r\n this.perfMarker.willRender();\r\n const config = DependencyResolver.get('component/config/index');\r\n const isEnabledForVerifiedImpressionTrackingAtCampaignLevel = _.result(config.get('Permissions'), 'IsEnabledForVerifiedImpressionTrackingAtCampaignLevel');\r\n\r\n if (this.audienceCampaignType === 'shopping') {\r\n const shoppingCrudPerfMarker =\r\n this.perfMarker.createChild('ShoppingCampaignCrud');\r\n const isEnabledForDynamicFeedCampaign = _.result(config.get('Permissions'), 'IsEnabledForDynamicFeedCampaign');\r\n\r\n // If Store not available, and:\r\n // a. if isEnabledForDynamicFeedCampaign = true,\r\n // check if no feed data, show BMC redirect view\r\n // b. if isEnabledForDynamicFeedCampaign = false,\r\n // this.feedData will always equal to undefined\r\n /* istanbul ignore next */\r\n if ((_.isEmpty(this.productData) ||\r\n _.isEmpty(this.productData.ProductCollectionAccounts) ||\r\n // GlobalStore and CoOpStore will be filtered out befoe the page is fully rendered\r\n // If there is no other stores, we should consider it as there is no store\r\n _.findIndex(this.productData.ProductCollectionAccounts, item => !item.IsGlobalStore && !item.IsCoOpStore) < 0) &&\r\n (!this.feedData || this.feedData.length <= 0)\r\n ) {\r\n const bmcRedirectOptions = _.extend(\r\n _.pick(this.options, ['deps', 'callbackBeforeRemove', 'logScenario']),\r\n {\r\n isEnabledForDynamicFeedCampaign,\r\n }\r\n );\r\n const bmcRedirectView = new BmcRedirectView(bmcRedirectOptions);\r\n this.$el.append(bmcRedirectView.render().$el);\r\n return this;\r\n }\r\n\r\n const shoppingCampaignOptions = _.extend(\r\n this.options,\r\n {\r\n data: this.productData,\r\n perfMarker: shoppingCrudPerfMarker,\r\n wizardElement: this.$el,\r\n feedData: this.feedData,\r\n isEnabledForVerifiedImpressionTrackingAtCampaignLevel,\r\n }\r\n );\r\n\r\n this.crudAudienceCampaign = new CrudAudienceShoppingCampaign(shoppingCampaignOptions);\r\n } else {\r\n const campaignCrudPerfMarker =\r\n this.perfMarker.createChild('CampaignCrud');\r\n\r\n const campaignOptions = _.extend(\r\n this.options,\r\n {\r\n perfMarker: campaignCrudPerfMarker,\r\n wizardElement: this.$el,\r\n isEnabledForVerifiedImpressionTrackingAtCampaignLevel: false,\r\n }\r\n );\r\n\r\n this.crudAudienceCampaign = new CrudAudienceCampaign(campaignOptions);\r\n }\r\n\r\n const crudAudienceAdgroupOptions = _.extend(\r\n this.options,\r\n {\r\n perfMarker: this.perfMarker.createChild('CrudAdGroup'),\r\n wizardElement: this.$el,\r\n }\r\n );\r\n\r\n this.crudAudienceAdgroup = new CrudAudienceAdgroup(crudAudienceAdgroupOptions);\r\n\r\n this.loadCrudAudienceAdPromise = new Promise((resolve) => {\r\n if (this.audienceCampaignType === 'shopping') {\r\n resolve(null);\r\n } else {\r\n const crudAudienceAdOptions = _.extend(\r\n this.options,\r\n {\r\n audienceCampaignType: 'Audience',\r\n perfMarker: this.perfMarker.createChild('CrudAd'),\r\n wizardElement: this.$el,\r\n }\r\n );\r\n\r\n resolve(new ResponsiveAdEditor(crudAudienceAdOptions));\r\n }\r\n }).then((crudAudienceAdInstance) => {\r\n this.crudAudienceAd = crudAudienceAdInstance;\r\n\r\n const crudBudgetBidOptions = _.extend(\r\n this.options,\r\n {\r\n perfMarker: this.perfMarker.createChild('BudgetBid'),\r\n wizardElement: this.$el,\r\n }\r\n );\r\n\r\n this.crudAudienceBudgetBid = new CrudAudienceBudgetBid(crudBudgetBidOptions);\r\n\r\n this.listenTo(this.crudAudienceCampaign, 'saveAndExit', this.saveAndExit);\r\n this.listenTo(this.crudAudienceCampaign, 'canceled', this.onExit);\r\n this.listenTo(this.crudAudienceAdgroup, 'saveAndExit', this.saveAndExit);\r\n if (this.crudAudienceAd) {\r\n this.listenTo(this.crudAudienceAd, 'saveAndExit', this.saveAndExit);\r\n this.listenTo(this.crudAudienceAd, 'canceled', this.onExit);\r\n }\r\n this.listenTo(this.crudAudienceBudgetBid, 'saveAndExit', this.saveAndExit);\r\n\r\n this.wizard = new StepsWizard({\r\n config: this.getStepConfig(),\r\n currentStep: 'audience-campaign-creation-wizard-step1',\r\n });\r\n\r\n this.$el.html(template(this));\r\n this.$('.audience-campaign-creation-wizard').append(this.wizard.$el);\r\n\r\n if (_.isFunction(this.options.callbackBeforeRender)) {\r\n this.options.callbackBeforeRender(() => {\r\n this.wizard.render();\r\n this.wizardRenderTime = new Date().getTime();\r\n if (window.ApexPlatform) {\r\n window.ApexPlatform.Refresh();\r\n }\r\n });\r\n } else {\r\n this.wizard.render();\r\n this.wizardRenderTime = new Date().getTime();\r\n if (window.ApexPlatform) {\r\n window.ApexPlatform.Refresh();\r\n }\r\n }\r\n\r\n this.wizard.on('switch:finish', ({ stepName }) => {\r\n if (window.ApexPlatform) {\r\n window.ApexPlatform.Refresh();\r\n }\r\n this.logShoppingCampaignCreationEvent({ step: stepName, status: 'Switch Done' });\r\n postABTestingEventLog({\r\n UniqueId: this.wizardActivity.id, // creation session id\r\n EventName: `${ExperimentName.MSANCampaignCreationFlowImporvement}:${getAudienceCreationPath()}:DuringCreation`,\r\n EventValue: stepName,\r\n });\r\n });\r\n\r\n this.wizard.on('step:next', ({ currentStepName }) => {\r\n this.wizardActivity.trace('Wizard click next');\r\n this.logShoppingCampaignCreationEvent({ step: currentStepName, status: 'Next Click' });\r\n postABTestingEventLog({\r\n UniqueId: this.wizardActivity.id, // creation session id\r\n EventName: `${ExperimentName.MSANCampaignCreationFlowImporvement}:${getAudienceCreationPath()}:Next`,\r\n EventValue: currentStepName,\r\n });\r\n });\r\n\r\n this.wizard.on('step:back', ({ currentStepName }) => {\r\n this.wizardActivity.trace('Wizard click back');\r\n this.logShoppingCampaignCreationEvent({ step: currentStepName, status: 'Back Click' });\r\n postABTestingEventLog({\r\n UniqueId: this.wizardActivity.id, // creation session id\r\n EventName: `${ExperimentName.MSANCampaignCreationFlowImporvement}:${getAudienceCreationPath()}:Back`,\r\n EventValue: currentStepName,\r\n });\r\n });\r\n\r\n postABTestingFlightLog([{\r\n UniqueId: this.wizardActivity.id, // creation session id\r\n RandomizationIdType: 'AccountId',\r\n RandomizationId: String(_.result(this.config.get('CurrentAccount'), 'Id')), // Accountid\r\n ExperimentName: ExperimentName.MSANCampaignCreationFlowImporvement,\r\n Flight: this.campaignCreationFlowImporvementEnabled ? 'Control' : 'Treatment',\r\n }]);\r\n\r\n postABTestingEventLog({\r\n UniqueId: this.wizardActivity.id, // creation session id\r\n EventName: `${ExperimentName.MSANCampaignCreationFlowImporvement}:${getAudienceCreationPath()}:Start`,\r\n EventValue: this.wizard.currentStepName,\r\n });\r\n this.logShoppingCampaignCreationEvent({ step: this.wizard.currentStepName, status: 'Start' });\r\n });\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Get Steps config.\r\n *\r\n * @private\r\n * @returns {object} - config.\r\n */\r\n getStepConfig() {\r\n const steps = [];\r\n\r\n steps.push({\r\n name: 'audience-campaign-creation-wizard-step1',\r\n railviewId: this.options.isForVNext ? null : 'MSANCampaignCreate_Step1',\r\n view: this.crudAudienceCampaign,\r\n });\r\n\r\n steps.push({\r\n name: 'audience-campaign-creation-wizard-step2',\r\n railviewId: this.options.isForVNext ? null : 'MSANCampaignCreate_Step2',\r\n view: this.crudAudienceAdgroup,\r\n });\r\n\r\n if (this.isSwapStepsEnabled) {\r\n steps.push({\r\n name: 'audience-campaign-creation-wizard-step4',\r\n railviewId: this.options.isForVNext ? null : 'MSANCampaignCreate_Step4',\r\n view: this.crudAudienceBudgetBid,\r\n });\r\n\r\n // Ad step not supported for shopping campaign\r\n if (this.audienceCampaignType !== 'shopping') {\r\n steps.push({\r\n name: 'audience-campaign-creation-wizard-step3',\r\n railviewId: this.options.isForVNext ? null : 'MSANCampaignCreate_Step3',\r\n view: this.crudAudienceAd,\r\n });\r\n }\r\n } else {\r\n // Ad step not supported for shopping campaign\r\n if (this.audienceCampaignType !== 'shopping') {\r\n steps.push({\r\n name: 'audience-campaign-creation-wizard-step3',\r\n railviewId: this.options.isForVNext ? null : 'MSANCampaignCreate_Step3',\r\n view: this.crudAudienceAd,\r\n });\r\n }\r\n\r\n steps.push({\r\n name: 'audience-campaign-creation-wizard-step4',\r\n railviewId: this.options.isForVNext ? null : 'MSANCampaignCreate_Step4',\r\n view: this.crudAudienceBudgetBid,\r\n });\r\n }\r\n\r\n const extendConfig = {};\r\n if (_.isFunction(this.options.layout)) {\r\n extendConfig.layout = this.options.layout;\r\n } else if (_.isUndefined(this.options.isHorizontal)) {\r\n extendConfig.isHorizontal = true;\r\n } else {\r\n extendConfig.isHorizontal = !!this.options.isHorizontal;\r\n }\r\n\r\n if (_.isFunction(this.options.headerTemplate)) {\r\n extendConfig.headerTemplate = this.options.headerTemplate;\r\n }\r\n\r\n return _.extend({\r\n steps,\r\n }, extendConfig);\r\n }\r\n\r\n /**\r\n * Get Product Scope data.\r\n *\r\n * @private\r\n * @returns {View} - Product Scope.\r\n */\r\n /* istanbul ignore next */\r\n getProductScopeData() {\r\n const options = {\r\n countryCode: 'US',\r\n getProductConditionOptions: true,\r\n getSalesCountryCollection: true,\r\n getDynamicDataFeedOptions: true,\r\n getCategoryFullData: true,\r\n getProductTypeFullData: true,\r\n dataName: 'AudienceMetaData',\r\n bypassCache: false,\r\n cacheResponse: true,\r\n };\r\n const serverContext = _.get(serverContextStore, ['state', 'serverContext'], {});\r\n const p = GetProductScopeData(null, serverContext, options)\r\n .then((pData) => {\r\n const data = mergeData(pData);\r\n this.productDataProcess(data);\r\n }).catch(() => {\r\n this.showError(this.i18n.getString('GenericErrorMessage_Short'));\r\n });\r\n\r\n return p;\r\n }\r\n\r\n getProductData() {\r\n /* istanbul ignore if */\r\n if (this.isOdataGetProductScopeEnabled) {\r\n return this.getProductScopeData();\r\n }\r\n\r\n return GetProductData()\r\n .then(data => this.productDataProcess(data)).catch(() => {\r\n this.showError(this.i18n.getString('GenericErrorMessage_Short'));\r\n });\r\n }\r\n\r\n getFeedData({ $top = 20, $skip = 0 } = {}) {\r\n return GetFeedData({ $top, $skip }).then((data) => {\r\n this.feedData = data;\r\n }).catch(() => {\r\n this.showError(this.i18n.getString('GenericErrorMessage_Short'));\r\n });\r\n }\r\n\r\n getProductDataInit() {\r\n return this.getProductWithDFM().then((data) => {\r\n if (data) {\r\n /* istanbul ignore if */\r\n if (this.isOdataGetProductScopeEnabled) {\r\n const mergedData = mergeData(data);\r\n this.productDataProcess(mergedData);\r\n } else {\r\n this.productDataProcess(data);\r\n }\r\n }\r\n }).catch(() => {\r\n this.showError(this.i18n.getString('GenericErrorMessage_Short'));\r\n });\r\n }\r\n\r\n getFeedDataInit() {\r\n return this.getFeedWithDFM().then((data) => {\r\n if (data) {\r\n this.feedData = data;\r\n }\r\n }).catch(() => {\r\n this.showError(this.i18n.getString('GenericErrorMessage_Short'));\r\n });\r\n }\r\n\r\n productDataProcess(data) {\r\n this.productData = data;\r\n this.productData.ProductCollectionAccounts =\r\n _.filter(data.ProductCollectionAccounts, store => !store.IsCoOpStore);\r\n }\r\n\r\n /**\r\n * Restores Wunderbar. Called when view is removed.\r\n *\r\n * @returns {undefined}\r\n */\r\n remove() {\r\n if (this.wizard) {\r\n this.wizard.remove();\r\n }\r\n if (_.isFunction(this.options.callbackBeforeRemove)) {\r\n this.options.callbackBeforeRemove();\r\n }\r\n\r\n const panel = document.querySelector('.audience-creation-panel.isOpen');\r\n\r\n if (panel && panel.remove) {\r\n panel.remove();\r\n }\r\n super.remove();\r\n }\r\n\r\n /**\r\n * Handles the event when the exit is requested from the child steps\r\n * It navigates to the campaign and restore the wunderbar.\r\n *\r\n * @returns {undefined}\r\n */\r\n onExit() {\r\n postABTestingEventLog({\r\n UniqueId: this.wizardActivity.id, // creation session id\r\n EventName: `${ExperimentName.MSANCampaignCreationFlowImporvement}:${getAudienceCreationPath()}:Exit`,\r\n EventValue: this.wizard.currentStepName,\r\n });\r\n\r\n this.navigateToRoute('campaign');\r\n this.logShoppingCampaignCreationEvent({ step: this.wizard.currentStepName, status: 'Exit by CancelButton' });\r\n }\r\n\r\n saveAndExit() {\r\n postABTestingEventLog({\r\n UniqueId: this.wizardActivity.id, // creation session id\r\n EventName: `${ExperimentName.MSANCampaignCreationFlowImporvement}:${getAudienceCreationPath()}:SaveAndExit`,\r\n EventValue: this.wizard.currentStepName,\r\n });\r\n this.logShoppingCampaignCreationEvent({ step: this.wizard.currentStepName, status: 'SaveAndExit' });\r\n /* istanbul ignore next */\r\n if (this.wizard.currentStepName === 'audience-campaign-creation-wizard-step3') {\r\n this.startToFinishMarker.done({ campaignType: this.audienceCampaignType || 'Audience' });\r\n this.wizardActivity.signal('finish creating campaign');\r\n }\r\n\r\n const summaryDataContextManager = DependencyResolver.get('SummaryDataContextManager');\r\n summaryDataContextManager.getContext('/campaign/NewCampaign/Create?');\r\n\r\n if (this.eventDelegator &&\r\n !_.isEmpty(this.viewContext.currentCampaign) &&\r\n !_.isEmpty(this.viewContext.currentCampaign.Id) &&\r\n !_.isEmpty(this.viewContext.currentCampaign.Name)) {\r\n this.eventDelegator.trigger('campaignReload');\r\n }\r\n\r\n this.navigateToRoute('campaign');\r\n\r\n displaySuccessDialog();\r\n\r\n if (this.wizardActivity) {\r\n this.wizardActivity.trace(`wizard saved and exited with swap steps ${this.isSwapStepsEnabled ? 'enabled' : 'disabled'}`);\r\n }\r\n }\r\n}\r\n","export const Included = 'Included';\r\nexport const Excluded = 'Excluded';\r\nexport const All = 'All'; // Included + Excluded\r\n","import Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport pgrid from 'projection-grid';\r\nimport { paginationPlugin } from '@bingads-webui/projection-grid-pagination';\r\nimport { cloneDeep } from '@bingads-webui-universal/primitive-utilities';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport template from './search-based-target-grid-view-template.pug';\r\nimport paginationTemplate from './pagination-template.pug';\r\nimport * as targetTypes from './search-based-target-type';\r\n\r\n/**\r\n * Class for grid view for linkedin targets\r\n *\r\n * @class SearchBasedTargetGridView\r\n * @extends {Backbone.View}\r\n */\r\nexport class SearchBasedTargetGridView extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options object\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options = {}) {\r\n this.options = _.defaults(options, {\r\n level: 'adgroup',\r\n targetType: targetTypes.All,\r\n });\r\n\r\n this.isolated = this.options.targetType !== targetTypes.All;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.vm = {\r\n i18n: this.i18n,\r\n gridData: [],\r\n targetType: this.options.targetType,\r\n removeAllVisibleClass: this.isolated ? 'hide' : '',\r\n };\r\n\r\n this.grid = null;\r\n this.currentLevelTargetInfo = this.options.currentLevelTargetInfo;\r\n\r\n this.listenTo(\r\n this.currentLevelTargetInfo,\r\n `${this.currentLevelTargetInfo.resourceName}${this.options.type}Changed`,\r\n () => {\r\n if (options.activityLogger) {\r\n options.activityLogger.signal(`audienceCriterionSettingChanged: ${this.currentLevelTargetInfo.resourceName}${this.options.type}`);\r\n }\r\n this.onCriterionChange();\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Define events and event handlers for them.\r\n *\r\n * @readonly\r\n * @returns {Object} returns object defining events\r\n */\r\n get events() {\r\n return {\r\n 'click .target-grid-remove-all-container a': 'onRemoveAllTargets',\r\n };\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this.vm));\r\n\r\n this.initializeAndRenderGrid();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Event handler for criterion change\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n onCriterionChange() {\r\n if (this.isolated) {\r\n const allData = cloneDeep(this.currentLevelTargetInfo.getAllByType(this.options.type));\r\n const datas = _.partition(allData, d => d.CriterionType === this.options.type);\r\n this.vm.gridData = this.options.targetType === targetTypes.Included ? datas[0] : datas[1];\r\n } else {\r\n this.vm.gridData = cloneDeep(this.currentLevelTargetInfo.getAllByType(this.options.type));\r\n }\r\n\r\n this.refreshGridSource();\r\n\r\n if (this.vm.gridData.length === 0) {\r\n this.$(`.linked-in-target-grid-view.${this.options.targetType}`).addClass('hide');\r\n } else {\r\n this.$(`.linked-in-target-grid-view.${this.options.targetType}`).removeClass('hide');\r\n }\r\n }\r\n\r\n /**\r\n * Refreshes the grid source\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n refreshGridSource() {\r\n if (this.grid && this.grid.gridView) {\r\n this.grid.gridView.patch({\r\n dataSource: {\r\n data: this.vm.gridData,\r\n },\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Initializes and renders the grid\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n initializeAndRenderGrid() {\r\n this.commonGridConfig = {\r\n tableClasses: ['table', 'table--no-border', 'grid'],\r\n dataSource: {\r\n type: 'memory',\r\n data: [],\r\n primaryKey: 'Id',\r\n },\r\n rows: {\r\n bodyRows: [{\r\n type: 'data-rows',\r\n classes: ['linked-in-target-grid__area-row'],\r\n }],\r\n },\r\n events: {\r\n 'click .linked-in-target-grid__remove-col': e => this.removeSearchBasedTarget(e),\r\n 'click .linked-in-target-grid__removeall-header': e => this.removeSearchBasedTargets(e),\r\n },\r\n plugins: {\r\n pagination: {\r\n pageSize: this.isolated ? 5 : 10,\r\n availablePageSizes: this.isolated ? [5] : [10, 20, 50, 100],\r\n enableRandomPage: false,\r\n template: this.isolated ? paginationTemplate : undefined,\r\n pageNumberLabelText: this.i18n.getString('GridPage_Colon'),\r\n pageSizeText: this.i18n.getString('Grid_ShowRows'),\r\n totalPageCountText: this.i18n.getString('Grid_PageOf'),\r\n },\r\n },\r\n };\r\n\r\n const gridConfig = this.isolated ?\r\n this.options.gridConfig(this.options.targetType) :\r\n this.options.gridConfig;\r\n\r\n this.grid = pgrid.factory({ vnext: true })\r\n .use(paginationPlugin)\r\n .create(_.defaults(gridConfig, this.commonGridConfig));\r\n\r\n this.$('.target-grid').html(this.grid.gridView.render().el);\r\n\r\n this.grid.gridView.on('didUpdate', () => {\r\n // update coulumn header using grid rows count\r\n if (this.isolated) {\r\n const firstColumnHeaderSpan = this.grid.gridView.$el.find('th span.targeting-status');\r\n firstColumnHeaderSpan.text(firstColumnHeaderSpan.text()\r\n .replace(/\\d+|\\{\\{count\\}\\}/, this.grid.gridView.totalCountRows));\r\n }\r\n });\r\n\r\n // After initial creation, make the onCriterionChange to read from data\r\n this.onCriterionChange();\r\n }\r\n\r\n /**\r\n * Remove the targeted/excluded linked in target\r\n * @private\r\n * @param {object} e - event object\r\n *\r\n * @returns {Promise} - promise of destroying the linked in target\r\n */\r\n removeSearchBasedTarget(e) {\r\n e.stopPropagation();\r\n const targetId = _.result(this.grid.gridView.itemOfElement(e.target), 'Id');\r\n\r\n return this.currentLevelTargetInfo.destroyAsync(targetId);\r\n }\r\n\r\n /**\r\n * Remove all targeted/excluded in grid\r\n * @private\r\n * @param {object} e - event object\r\n *\r\n * @returns {undefined}\r\n */\r\n removeSearchBasedTargets(e) {\r\n if (this.isolated) {\r\n const allData = cloneDeep(this.currentLevelTargetInfo.getAllByType(this.options.type));\r\n const datas = _.partition(allData, d => d.CriterionType === this.options.type);\r\n const targetDatas = this.options.targetType === targetTypes.Included ? datas[0] : datas[1];\r\n\r\n e.stopPropagation();\r\n _.each(targetDatas, (d) => {\r\n this.currentLevelTargetInfo.destroyAsync(d.Id);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Event handler for removing all linked in targets\r\n * @private\r\n *\r\n * @param {object} e - event object\r\n * @returns {Promise} - Promise of destroying target type\r\n */\r\n onRemoveAllTargets(e) {\r\n e.stopPropagation();\r\n\r\n return this.currentLevelTargetInfo.destroyTargetTypeAsync(this.options.type);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { SearchBasedTargetGridView } from './search-based-target-grid-view';\r\nimport template from './search-based-target-setting-template.pug';\r\nimport searchBasedTargetGridRemoveColumnTemplate from './search-based-target-grid-remove-column-template.pug';\r\nimport searchBasedTargetGridStateTemplate from './search-based-target-grid-state-template.pug';\r\nimport * as targetTypes from './search-based-target-type';\r\n\r\nexport const removeAllColumnConfig = i18n => ({\r\n name: 'removeAll',\r\n template: () => searchBasedTargetGridRemoveColumnTemplate({ i18n }),\r\n headClasses: ['linked-in-target-grid__removeall-header', 'text-right'],\r\n bodyClasses: ['text-right'],\r\n html:\r\n `${i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Remove_All')}`,\r\n});\r\n\r\nexport const statusColumnConfig = targetType => ({\r\n name: 'Status',\r\n template: () => searchBasedTargetGridStateTemplate({\r\n isIncluded: targetType === 'Included',\r\n isExcluded: targetType === 'Excluded',\r\n includedString: '',\r\n excludedString: '',\r\n }),\r\n property: _.identity,\r\n});\r\n\r\nexport const nameColumnConfig = type => ({\r\n template: (local) => {\r\n const criterion = local.value.Criterion[type];\r\n return criterion.Name;\r\n },\r\n property: _.identity,\r\n});\r\n\r\n/**\r\n * Class for setting search based targets\r\n *\r\n * @class SearchBasedTargetSetting\r\n * @extends {TargetSettingBase}\r\n */\r\nexport class SearchBasedTargetSetting extends Backbone.View {\r\n initialize(options) {\r\n this.options = options;\r\n\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.showBidOnlyNote = options.showBidOnlyNote;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.decimal = DependencyResolver.get('component/humanize/decimal');\r\n\r\n const targetOptions = options.isolatedGrid ?\r\n _.defaults({ targetType: targetTypes.Included }, options) :\r\n options;\r\n this.searchBasedTargetGridView = new SearchBasedTargetGridView(targetOptions);\r\n if (options.isolatedGrid) {\r\n this.excludedSearchBasedTargetGridView =\r\n new SearchBasedTargetGridView(_.defaults({ targetType: targetTypes.Excluded }, options));\r\n }\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n this.searchView.render();\r\n this.$('.linked-in-target-search-container').append(this.searchView.$el);\r\n\r\n this.searchBasedTargetGridView.render();\r\n this.$('.linked-in-target-grid-container').append(this.searchBasedTargetGridView.$el);\r\n\r\n if (this.options.isolatedGrid) {\r\n this.excludedSearchBasedTargetGridView.render();\r\n this.$('.linked-in-excluded-grid-container').append(this.excludedSearchBasedTargetGridView.$el);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Check if the selection control has any targetting setting.\r\n *\r\n * @returns {boolean} boolean value indicating if the control has target or not.\r\n */\r\n isTargeted() {\r\n const criterions = _.clone(this.currentLevelTargetInfo.getAllByType(this.options.type));\r\n const hasTaget = criterions.length > 0;\r\n\r\n return hasTaget;\r\n }\r\n\r\n setDefaultCashbackPercent(percent) {\r\n this.searchView.setDefaultCashbackPercent(percent);\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { criterionHelper } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport template from './search-result-view-template.pug';\r\n\r\n/**\r\n * Class for search result view for linkedin targets\r\n *\r\n * @class SearchResultView\r\n * @extends {Backbone.View}\r\n */\r\nexport class SearchResultView extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options for the initialize\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = options;\r\n this.currentLevelTargetInfo = this.options.currentLevelTargetInfo;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n this.defaultBidAdjustment = _.has(options, 'defaultBidAdjustment') ? options.defaultBidAdjustment : 0;\r\n this.defaultCashbackPercent = options.defaultCashbackPercent;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n\r\n this.items = [];\r\n this.isVisible = false;\r\n }\r\n\r\n /**\r\n * Define events and event handlers for them.\r\n *\r\n * @readonly\r\n * @returns {Object} returns object defining events\r\n */\r\n get events() {\r\n return {\r\n 'click a.company-search-include-link': 'onInclude',\r\n 'click a.company-search-exclude-link': 'onExclude',\r\n };\r\n }\r\n\r\n /**\r\n * Update the state of the state\r\n *\r\n * @param {Object} searchResult - array of search result\r\n * @param {boolean} isVisible - boolean value indication if the search result is visible or not\r\n *\r\n * @return {Object} - view itself.\r\n */\r\n updateState(searchResult = [], isVisible) {\r\n if (!_.isUndefined(isVisible)) {\r\n this.isVisible = isVisible;\r\n }\r\n\r\n this.items = searchResult;\r\n\r\n // 'ms-Panel' event handling is needed when component is integrated in fluent panel\r\n const evenHandler = this.clickHandling.bind(this);\r\n $(document).off('click.company-name-result');\r\n document.getElementsByClassName('ms-Panel')[0]?.removeEventListener('click', evenHandler);\r\n\r\n if (this.isVisible) {\r\n $(document).on('click.company-name-result', evenHandler);\r\n document.getElementsByClassName('ms-Panel')[0]?.addEventListener('click', evenHandler);\r\n }\r\n\r\n this.render();\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n const ariaLiveResultsText = this.items.length < 1 ? this.i18n.getString('Audience_Campaign_Target_Setting_Company_Search_No_Result') : this.i18n.getString('Found {{totalCount}} Results', { totalCount: this.items.length });\r\n this.$el.closest('.search-result-view-container').find('.search-result.live-region').text(ariaLiveResultsText);\r\n\r\n return this;\r\n }\r\n\r\n clickHandling(e) {\r\n if (!$(e.target).hasClass('search-box__icon') &&\r\n $(e.target).closest('.search-result-view-container').length === 0) {\r\n this.updateState([], false);\r\n }\r\n }\r\n\r\n setDefaultCashbackPercent(percent) {\r\n this.defaultCashbackPercent = percent;\r\n }\r\n\r\n /**\r\n * Event handler for target include action\r\n * @private\r\n *\r\n * @param {Object} e - click event object\r\n * @returns {Promise} - Promise of handling onInclude event\r\n */\r\n onInclude(e) {\r\n e.stopPropagation();\r\n\r\n if (!e.target) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n const companyTargetItem =\r\n _.first(_.filter(this.items, item => item.id === parseInt(e.target.dataset.id, 10)));\r\n\r\n const criterion = criterionHelper.buildLinkedInCriterion(\r\n 'CompanyName',\r\n companyTargetItem,\r\n true,\r\n this.defaultBidAdjustment,\r\n this.defaultCashbackPercent\r\n );\r\n\r\n return this.currentLevelTargetInfo.createAsync(criterion);\r\n }\r\n\r\n /**\r\n * Event handler for target exclude action\r\n * @private\r\n *\r\n * @param {Object} e - click event object\r\n * @returns {Promise} - Promise of handling onExclude event\r\n */\r\n onExclude(e) {\r\n e.stopPropagation();\r\n\r\n if (!e.target) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n const companyTargetItem =\r\n _.first(_.filter(this.items, item => item.id === parseInt(e.target.dataset.id, 10)));\r\n\r\n const criterion = criterionHelper.buildLinkedInCriterion(\r\n 'CompanyName',\r\n companyTargetItem,\r\n false,\r\n this.defaultBidAdjustment\r\n );\r\n\r\n return this.currentLevelTargetInfo.createAsync(criterion);\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { SearchBox } from '@bingads-webui/search-box';\r\nimport template from './search-view-base-template.pug';\r\n\r\n// Temporary fix to prevent search glyph click event from bubbling up\r\n// TODO: Remove once PermissionDenied IE error has been verified fixed\r\nfunction onClickSearchContainer(event) {\r\n // If event has been bubble up from search glyph icon click then stop propagating\r\n if (event.target.className === 'search-box__icon glyphicon glyphicon-search') {\r\n event.stopPropagation();\r\n }\r\n}\r\n\r\n/**\r\n * Class for search view for linked in targets\r\n *\r\n * @class SearchViewBase\r\n * @extends {Backbone.View}\r\n */\r\nexport class SearchViewBase extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options object\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = options;\r\n this.currentLevelTargetInfo = this.options.currentLevelTargetInfo;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.criterionType = options.criterionType;\r\n\r\n this.searchBox = new SearchBox({\r\n placeholder: this.i18n.getString(`Audience_Campaign_Target_Setting_${this.criterionType}_Search_Placeholder`),\r\n maxLength: this.options.maxLength,\r\n value: '',\r\n iconClasses: ['glyphicon', 'glyphicon-search'],\r\n });\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .searchbox-container': onClickSearchContainer,\r\n };\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n this.searchBox.render();\r\n this.$('.searchbox-container').prepend(this.searchBox.$el);\r\n this.searchResultView.render();\r\n this.$('.search-result-view-container').append(this.searchResultView.$el);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Event handler for search result reseted\r\n * clear the searchbox\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n onSearchResultReseted() {\r\n this.searchBox.viewModel.value('');\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { withUiBlock } from '@bingads-webui/uiblocker';\r\nimport { companySizeEnumToString } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { SearchResultView } from '../search-result/search-result-view';\r\nimport { SearchViewBase } from '../../search-view-base';\r\n\r\n/**\r\n * Class for search view for linked in targets\r\n *\r\n * @class CompanyNameSearchView\r\n * @extends {Backbone.View}\r\n */\r\nexport class CompanyNameSearchView extends SearchViewBase {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options object\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n super.initialize(options);\r\n\r\n this.searchBox.on('search', searchTerm => this.onSearch(searchTerm));\r\n\r\n this.searchResultView = new SearchResultView(this.options);\r\n this.listenTo(this.searchResultView, 'searchResultReseted', this.onSearchResultReseted);\r\n\r\n this.listenTo(\r\n this.currentLevelTargetInfo,\r\n `${this.currentLevelTargetInfo.resourceName}CompanyNameChanged`,\r\n () => this.onCriterionChange()\r\n );\r\n }\r\n\r\n setDefaultCashbackPercent(percent) {\r\n this.searchResultView.setDefaultCashbackPercent(percent);\r\n }\r\n\r\n /**\r\n * Event handler for search requested\r\n * @private\r\n *\r\n * @param {string} searchTerm - search keyword\r\n * @returns {Object} - promise of setting the search result\r\n */\r\n onSearch(searchTerm) {\r\n if (!searchTerm) {\r\n return null;\r\n }\r\n\r\n const escapedSearchTerm = encodeURIComponent(searchTerm);\r\n const odata = DependencyResolver.get('component/http/channel/odata');\r\n const context = DependencyResolver.get('audienceCampaignPageContext');\r\n const demogrphicsUrl = `Customers(${context.CurrentCustomerId})/Accounts(${context.CurrentAccount.Id})/Demographics/`;\r\n const companySearchUrl = `Model.Company?$search=${escapedSearchTerm}&$top=20`;\r\n\r\n return odata.get(demogrphicsUrl + companySearchUrl).then((data) => {\r\n this.searchData = data.value;\r\n this.setSearchResult(true);\r\n })\r\n .finally(withUiBlock(this.$el, this.i18n.getString('Loading')));\r\n }\r\n\r\n /**\r\n * Set the search result for the render\r\n * @private\r\n * @param {boolean} makeSearchResultVisible - Make it visible\r\n *\r\n * @returns {undefined}\r\n */\r\n setSearchResult(makeSearchResultVisible) {\r\n const companies = _.clone(this.currentLevelTargetInfo.getAllByType('CompanyName'));\r\n const targetedCompanyIds = _.map(companies, (company) => {\r\n if (company.CriterionType === 'CompanyName') {\r\n return parseInt(company.Criterion.CompanyNameCriterion.Target, 10);\r\n }\r\n\r\n return -1;\r\n });\r\n const excludedCompanyIds = _.map(companies, (company) => {\r\n if (company.CriterionType === 'NegativeCompanyName') {\r\n return parseInt(company.Criterion.CompanyNameCriterion.Target, 10);\r\n }\r\n\r\n return -1;\r\n });\r\n\r\n const results = _.map(this.searchData, (result) => {\r\n const item = {\r\n id: result.Id,\r\n name: result.Name,\r\n logoUrl: result.LogoUrl,\r\n industry: result.Industry,\r\n size: companySizeEnumToString(result.Size),\r\n isIncluded: _.contains(targetedCompanyIds, result.Id),\r\n isExcluded: _.contains(excludedCompanyIds, result.Id),\r\n };\r\n\r\n return item;\r\n });\r\n\r\n this.searchResultView.updateState(results, makeSearchResultVisible);\r\n }\r\n\r\n onCriterionChange() {\r\n this.setSearchResult();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { CashbackPercentControlView } from '@bingads-webui-campaign/cashback-percent-control-view';\r\nimport bidAdjustmentTemplate from './bid-adjustment.pug';\r\n\r\nconst getBidAdjustmentOptions = () => {\r\n const i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n\r\n return {\r\n percentage: 0,\r\n availableOptions: [\r\n { key: 'inc', text: i18n.getString('Audience_Campaign_Settings_BidAdjustment_Increase') },\r\n { key: 'dec', text: i18n.getString('Audience_Campaign_Settings_BidAdjustment_Decrease') },\r\n ],\r\n selectedOption: 'inc',\r\n };\r\n};\r\n\r\nconst isCriterionExcluded = (criterion) => {\r\n let isExcluded = false;\r\n\r\n if (criterion.Status && criterion.Status === 'Excluded') {\r\n isExcluded = true;\r\n }\r\n\r\n if (criterion.SelectionStatus && criterion.SelectionStatus === 'Excluded') {\r\n isExcluded = true;\r\n }\r\n\r\n // Linked in target knows the excluded state by the type.\r\n if (criterion.CriterionType && criterion.CriterionType.indexOf('Negative') >= 0) {\r\n isExcluded = true;\r\n }\r\n\r\n return isExcluded;\r\n};\r\n\r\n/**\r\n * Function to compute bid adjustment\r\n * @param {string} rawBidPercentage Bid percentage input\r\n * @param {string} bidAdjOptionText Bid adjustment option input\r\n *\r\n * @returns {int} Computed Bid adjustment value\r\n */\r\nconst computeBidAdjustment = (rawBidPercentage, bidAdjOptionText) => {\r\n const percentage = Number(rawBidPercentage);\r\n\r\n const bidAdjustmentOptions = getBidAdjustmentOptions();\r\n const bidAdjOption = _.find(\r\n bidAdjustmentOptions.availableOptions,\r\n option => option.text === bidAdjOptionText\r\n );\r\n\r\n const bidAdjOptionKey = _.result(bidAdjOption, 'key');\r\n\r\n return bidAdjOptionKey === 'dec' ? -percentage : percentage;\r\n};\r\n\r\nconst onBidAdjChange = (vm, e, criterionName) => {\r\n const bidAdjustmentControl = vm.$(e.target).parent();\r\n const targetId = e.target.id || bidAdjustmentControl.children('input')[0].id;\r\n\r\n const bidAdjPercentage = bidAdjustmentControl.children('input').val();\r\n const bidAdjOption = bidAdjustmentControl.children('select').val();\r\n const criterion = vm.currentLevelTargetInfo.criterionsByType[criterionName];\r\n const bidAdj = computeBidAdjustment(bidAdjPercentage, bidAdjOption);\r\n\r\n const targetCrit = criterion.find(d => (d.Criterion[criterionName] ?\r\n (d.Criterion[criterionName] === targetId) :\r\n (d.Criterion.Name === targetId)));\r\n if (targetCrit && targetCrit.Criterion) {\r\n targetCrit.Criterion.BidAdjustment = bidAdj;\r\n }\r\n};\r\n\r\nconst isUsingCampaignSettings = CriterionType => (\r\n $(`.criterion-setting-${CriterionType} .toggle.toggle-off`).length > 0);\r\n\r\nconst onCashbackPercentChange = (vm, validated, cashbackPercent, id, criterionName) => {\r\n const criterion = vm.currentLevelTargetInfo.criterionsByType[criterionName];\r\n const targetCrit = criterion.find(d => (d.Criterion[criterionName] ?\r\n (d.Criterion[criterionName] === id) :\r\n (d.Criterion.Name === id)));\r\n\r\n if (validated) {\r\n if (targetCrit && targetCrit.Criterion) {\r\n targetCrit.Criterion.CashbackPercent = cashbackPercent;\r\n vm.currentLevelTargetInfo.updateAsync(targetCrit, true);\r\n }\r\n }\r\n};\r\n\r\nconst cashbackPercentColumnConfig = (vm, i18n) => ({\r\n i18n,\r\n name: 'CashbackPercent',\r\n property: item => item,\r\n bodyClasses: ['cashback-percent-cell-wrap'],\r\n title: 'Campaign_Maximum_Cashback_Offer',\r\n template: (locals) => {\r\n const that = vm;\r\n const criterion = locals.value;\r\n\r\n if (isCriterionExcluded(locals.value)) {\r\n return '-';\r\n }\r\n\r\n let cashbackPercentValue = null;\r\n if (criterion.Criterion.CashbackAdjustment != null) {\r\n cashbackPercentValue = criterion.Criterion.CashbackAdjustment;\r\n }\r\n\r\n if (criterion.Criterion.CashbackPercent != null) {\r\n cashbackPercentValue = criterion.Criterion.CashbackPercent;\r\n }\r\n\r\n if (isUsingCampaignSettings(criterion.CriterionType)) {\r\n that.readonly = false;\r\n } else {\r\n that.readonly = true;\r\n }\r\n\r\n const cashbackPercentControlView = new CashbackPercentControlView({\r\n viewContext: vm.options.viewContext,\r\n i18n: vm.i18n,\r\n decimal: vm.decimal,\r\n CashbackPercent: cashbackPercentValue,\r\n isParentLevel: that.readonly,\r\n });\r\n\r\n const name = criterion.Criterion[criterion.CriterionType] ?\r\n criterion.Criterion[criterion.CriterionType] : criterion.Criterion.Name;\r\n\r\n setTimeout(() => {\r\n // eslint-disable-next-line no-underscore-dangle\r\n const key = locals.value.Id;\r\n const row = vm.$(`tr[data-key='${key}']`);\r\n const root = vm.$(row).find('.cashback-percent-cell-wrap');\r\n root.empty().append(cashbackPercentControlView.render().$el);\r\n cashbackPercentControlView.on('change', (validated, val) => {\r\n vm.onCashbackPercentChange(vm, validated, val, name, vm.criterionName);\r\n });\r\n });\r\n\r\n return '';\r\n },\r\n});\r\n\r\nconst bidAdjColumnConfig = (vm, i18n) => ({\r\n i18n,\r\n name: 'BidAdjustment',\r\n property: item => item,\r\n title: 'Audience_Campaign_Settings_BidAdjustment',\r\n template: (locals) => {\r\n const that = vm;\r\n\r\n const criterion = locals.value;\r\n\r\n if (isCriterionExcluded(locals.value)) {\r\n return '-';\r\n }\r\n\r\n const bidAdjustmentOptions = getBidAdjustmentOptions();\r\n\r\n let bidValue = 0;\r\n\r\n // For Audience Criterions\r\n if (criterion.Criterion.BidMultiplier != null) {\r\n bidValue = criterion.Criterion.BidMultiplier;\r\n }\r\n\r\n // For ones that are generated\r\n if (criterion.Criterion.BidAdjustment != null) {\r\n bidValue = criterion.Criterion.BidAdjustment;\r\n }\r\n\r\n bidAdjustmentOptions.percentage = Math.abs(bidValue);\r\n\r\n // negtive or -0\r\n if ((bidValue < 0) || (1 / bidValue === -Infinity)) {\r\n bidAdjustmentOptions.selectedOption = 'dec';\r\n }\r\n\r\n if (isUsingCampaignSettings(criterion.CriterionType)) {\r\n that.readonly = false;\r\n } else {\r\n that.readonly = true;\r\n }\r\n\r\n return bidAdjustmentTemplate({\r\n size: 5, // input control size\r\n percentage: bidAdjustmentOptions.percentage === null ? 0 : bidAdjustmentOptions.percentage,\r\n availableOptions: bidAdjustmentOptions.availableOptions,\r\n selectedOption: bidAdjustmentOptions.selectedOption,\r\n readonly: that.readonly,\r\n i18n: that.i18n,\r\n Name: criterion.Criterion[criterion.CriterionType] ?\r\n criterion.Criterion[criterion.CriterionType] : criterion.Criterion.Name,\r\n });\r\n },\r\n bodyClasses: ['bid-adjustment-target-column'],\r\n});\r\n\r\nexport {\r\n getBidAdjustmentOptions,\r\n isCriterionExcluded,\r\n onBidAdjChange,\r\n bidAdjColumnConfig,\r\n onCashbackPercentChange,\r\n cashbackPercentColumnConfig,\r\n isUsingCampaignSettings\r\n};\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { companyTargetItemTemplate } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { SearchBasedTargetSetting, removeAllColumnConfig, statusColumnConfig, nameColumnConfig } from '../search-based-target-setting';\r\nimport searchBasedTargetGridRemoveColumnTemplate from '../search-based-target-grid-remove-column-template.pug';\r\nimport searchBasedTargetGridStateTemplate from '../search-based-target-grid-state-template.pug';\r\nimport { CompanyNameSearchView } from './search-view/search-view';\r\nimport { cashbackPercentColumnConfig } from '../shared-utils/bid-adjustment-utils';\r\n\r\nconst companyColumnConfig = i18n => ({\r\n i18n,\r\n name: 'targetName',\r\n title: 'Audience_Campaign_Target_Setting_Company_Grid_Column_Companies',\r\n template: (local) => {\r\n const criterion = local.value.Criterion.CompanyNameCriterion;\r\n const item = {\r\n name: criterion.Name,\r\n logoUrl: criterion.LogoUrl,\r\n industry: criterion.Industry,\r\n size: criterion.Size,\r\n i18n,\r\n };\r\n\r\n return companyTargetItemTemplate({ item, i18n });\r\n },\r\n property: _.identity,\r\n});\r\n\r\nexport class CompanyNameTargetSetting extends SearchBasedTargetSetting {\r\n initialize(options) {\r\n this.options = options;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n\r\n this.i18nKeys = {\r\n titleKey: 'Audience_Campaign_Target_Setting_Company_Title',\r\n helpKey: 'pop_BA_CampaignCreate_AudTargets_Company',\r\n descriptionKey: this.showExclusion\r\n ? 'Audience_Campaign_Target_Setting_Company_Description'\r\n : 'Audience_Campaign_Target_Setting_Company_Description_Bid_Only',\r\n };\r\n\r\n this.criterionName = 'CompanyName';\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n const i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n const bingadsGridColumn = DependencyResolver.get('component/bingads-grid/shared/column');\r\n const pageContext = DependencyResolver.get('audienceCampaignPageContext');\r\n this.isFilterCriterionLevelAdGroup =\r\n options.isFilterCriterionLevelAdGroup || pageContext.isFilterCriterionLevelAdGroup;\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n\r\n const companySettingGridConfig = {\r\n columns: [\r\n bingadsGridColumn({\r\n name: 'isIncludedOrExcluded',\r\n title: this.showExclusion ? i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Target') : '',\r\n template: (local) => {\r\n const criterionType = local.value.CriterionType;\r\n\r\n return searchBasedTargetGridStateTemplate({\r\n isIncluded: criterionType === 'CompanyName',\r\n isExcluded: criterionType === 'NegativeCompanyName',\r\n includedString: i18n.getString('Audience_Campaign_Target_Setting_Included_Status'),\r\n excludedString: i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status'),\r\n });\r\n },\r\n property: _.identity,\r\n }),\r\n bingadsGridColumn(companyColumnConfig(i18n)),\r\n ...(options.currentLevel === 'adgroup'\r\n && (this.options.showBidOnlyNote || this.options.showExclusion)\r\n && this.isFilterCriterionLevelAdGroup && this.supportCashbackSettings) ?\r\n [bingadsGridColumn(cashbackPercentColumnConfig(this, i18n, 'CompanyName'))] : [],\r\n bingadsGridColumn({\r\n name: 'removeAll',\r\n template: () => searchBasedTargetGridRemoveColumnTemplate({ i18n }),\r\n headClasses: ['linked-in-target-grid__remove-body'],\r\n bodyClasses: ['text-right'],\r\n }),\r\n ],\r\n };\r\n\r\n const companySettingNewUIGridConfig = targetType => ({\r\n columns: [\r\n {\r\n name: 'CompanyNameTarget',\r\n property: _.identity,\r\n html: `${i18n.getString(`Audience_Campaign_Target_Setting_Company_${targetType}_Grid_Title`)}`,\r\n columns: [\r\n bingadsGridColumn(_.extend({}, statusColumnConfig(targetType), { headClasses: 'hide' })),\r\n bingadsGridColumn(_.extend({}, companyColumnConfig(i18n), { headClasses: 'hide' })),\r\n ],\r\n },\r\n bingadsGridColumn(removeAllColumnConfig(i18n)),\r\n ],\r\n });\r\n\r\n const isolatedCompanySettingGridConfig = targetType => ({\r\n columns: [\r\n {\r\n name: 'CompanyNameTarget',\r\n property: _.identity,\r\n html: searchBasedTargetGridStateTemplate({\r\n isIncluded: targetType === 'Included',\r\n isExcluded: targetType === 'Excluded',\r\n includedString: i18n.getString(`Audience_Campaign_Target_Setting_Company_${targetType}_Status`),\r\n excludedString: i18n.getString(`Audience_Campaign_Target_Setting_Company_${targetType}_Status`),\r\n }),\r\n columns: [\r\n bingadsGridColumn(_.extend({}, nameColumnConfig('CompanyNameCriterion'), {\r\n name: 'CompanyName',\r\n headClasses: 'hide',\r\n })),\r\n bingadsGridColumn({\r\n name: 'CompanyType',\r\n headClasses: 'hide',\r\n template: (local) => {\r\n const criterion = local.value.Criterion.CompanyNameCriterion;\r\n return criterion.Industry;\r\n },\r\n property: _.identity,\r\n }),\r\n bingadsGridColumn({\r\n name: 'CompanyEmplyee',\r\n headClasses: 'hide',\r\n template: (local) => {\r\n const criterion = local.value.Criterion.CompanyNameCriterion;\r\n return `${criterion.Size} ${i18n.getString('Audience_Campaign_Target_Setting_Company_Employee_Count')}`;\r\n },\r\n property: _.identity,\r\n }),\r\n ],\r\n },\r\n bingadsGridColumn(removeAllColumnConfig(i18n)),\r\n ],\r\n });\r\n\r\n if (this.options.isolatedGrid) {\r\n if (this.options.isForVNext) {\r\n this.options.gridConfig = companySettingNewUIGridConfig;\r\n } else {\r\n this.options.gridConfig = isolatedCompanySettingGridConfig;\r\n }\r\n } else {\r\n this.options.gridConfig = companySettingGridConfig;\r\n }\r\n this.searchView = new CompanyNameSearchView(this.options);\r\n\r\n super.initialize(this.options);\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport template from './target-or-bid-selector-template.pug';\r\n\r\nconst targetAndBidClassName = 'target-and-bid-radio-check';\r\nconst bidOnlyClassName = 'bid-only-radio-check';\r\n\r\nexport class TargetOrBidSelector extends Backbone.View {\r\n initialize(options = {}) {\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.isLabelHidden = options.isLabelHidden;\r\n this.isTargetAndBid = options.isTargetAndBid;\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n if (this.isTargetAndBid) {\r\n this.$(`.${targetAndBidClassName}`).prop('checked', true);\r\n } else {\r\n this.$(`.${bidOnlyClassName}`).prop('checked', true);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n get events() {\r\n return {\r\n 'change input[type=radio]': e => this.onTargetSettingChanged(e),\r\n };\r\n }\r\n\r\n setIsTargetAndBid(isTargetAndBid) {\r\n this.isTargetAndBid = isTargetAndBid;\r\n\r\n if (this.isTargetAndBid) {\r\n this.$(`.${targetAndBidClassName}`).prop('checked', true);\r\n } else {\r\n this.$(`.${bidOnlyClassName}`).prop('checked', true);\r\n }\r\n }\r\n\r\n getIsTargetAndBid() {\r\n return this.isTargetAndBid;\r\n }\r\n\r\n onTargetSettingChanged(e) {\r\n if (e.currentTarget.className === targetAndBidClassName) {\r\n this.isTargetAndBid = true;\r\n } else if (e.currentTarget.className === bidOnlyClassName) {\r\n this.isTargetAndBid = false;\r\n }\r\n\r\n this.trigger('targetSettingChanged');\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { BidAdjustment } from '@bingads-webui-campaign/target-bid-adjustment';\r\nimport { cloneDeep } from '@bingads-webui-universal/primitive-utilities';\r\nimport { TargetOrBidSelector } from './target-or-bid-selector/target-or-bid-selector';\r\nimport template from './criterion-setting-template.pug';\r\n\r\nconst targetI18nMap = i18n => ({\r\n Age: i18n.getString('Demographic_Grid_Override_Age'),\r\n Gender: i18n.getString('Demographic_Grid_Override_Gender'),\r\n CompanyName: i18n.getString('Demographic_Grid_Override_Company'),\r\n Industry: i18n.getString('Demographic_Grid_Override_Industry'),\r\n JobFunction: i18n.getString('Demographic_Grid_Override_JobFunction'),\r\n Device: i18n.getString('Demographic_Grid_Override_Device'),\r\n});\r\n\r\nexport class AudienceCriterionSettingBase extends Backbone.View {\r\n initialize(options = {\r\n showTargetSelection: false,\r\n showBidAdjustment: false,\r\n showTargetOrBid: false,\r\n enableLevelToggle: false,\r\n activityLogger: null,\r\n supportCashbackSettings: false,\r\n }) {\r\n this.decimal = DependencyResolver.get('component/humanize/decimal');\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.parentLevelTargetInfo = options.parentLevelTargetInfo;\r\n this.viewContext = options.viewContext || {};\r\n this.isAudienceCampaign = options.isAudienceCampaign;\r\n this.isTargetAndBid = options.isTargetAndBid;\r\n this.activityLogger = options.activityLogger;\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n\r\n this.showTargetSelection = options.showTargetSelection;\r\n this.showBidAdjustment = options.showBidAdjustment;\r\n this.showTargetOrBid = options.showTargetOrBid;\r\n this.showLevelToggle = options.enableLevelToggle && (this.viewContext.level === 'adgroup');\r\n this.isTargetSelectionViewValid = true;\r\n\r\n this.hideTitleLabel = options.hideTitleLabel;\r\n this.target = targetI18nMap(this.i18n)[this.criterionType];\r\n this.scenario = options.scenario;\r\n this.getInitializePromise = options.getInitializePromise || Promise.resolve(true);\r\n\r\n if (this.showBidAdjustment) {\r\n this.initializeBidAdjustmentGrid();\r\n }\r\n\r\n if (this.showTargetOrBid) {\r\n this.initializeTargetOrBidSelector();\r\n }\r\n\r\n if (this.showLevelToggle) {\r\n this.initializeLevelToggle();\r\n if (this.showBidAdjustment && !_.isEmpty(this.parentLevelTargetInfo)) {\r\n this.initializeParentLevelBidAdjustmentGrid();\r\n }\r\n }\r\n\r\n if (this.currentLevelTargetInfo) {\r\n this.listenTo(\r\n this.currentLevelTargetInfo,\r\n `${this.currentLevelTargetInfo.resourceName}${this.criterionType}Changed`,\r\n () => this.changeVisibility(true)\r\n );\r\n }\r\n }\r\n\r\n initializeLevelToggle() {\r\n const ToggleView = DependencyResolver.get('component/toggle/view/index');\r\n const useCampaignSettings = this.isUsingCampaignSettings();\r\n\r\n this.levelToggle = new ToggleView({\r\n // override default toggle text\r\n toggleText: {},\r\n labelledbyId: 'criterion-use-campaign-settings',\r\n });\r\n this.levelToggle.setToggleState(useCampaignSettings ? 'on' : 'off');\r\n if (this.currentLevelTargetInfo) {\r\n this.currentLevelTargetInfo.setParentLevelToggle(this.criterionType, useCampaignSettings);\r\n }\r\n this.showAdGroupOverrideInformation = useCampaignSettings;\r\n this.listenTo(this.levelToggle, 'change', this.onLevelToggleChange);\r\n }\r\n\r\n isUsingCampaignSettings() {\r\n if (this.currentLevelTargetInfo) {\r\n const targetCriterions = this.currentLevelTargetInfo.getAllByType(this.criterionType);\r\n const useCampaignSettings =\r\n // Only location has multiple types, but it is handled by external component\r\n // So here use this.criterionType is good enough\r\n (this.viewContext.level === 'adgroup') &&\r\n (targetCriterions.length === 0 ||\r\n (targetCriterions.length > 0 &&\r\n _.every(targetCriterions, criterion => criterion.Id < 0)\r\n )\r\n );\r\n\r\n return useCampaignSettings;\r\n }\r\n return false;\r\n }\r\n\r\n setAdGroupInfoVisibility() {\r\n if (this.showAdGroupOverrideInformation) {\r\n this.$('.adgroup-override-info').show();\r\n } else {\r\n this.$('.adgroup-override-info').hide();\r\n }\r\n }\r\n\r\n onLevelToggleChange(toggleState) {\r\n const useCampaignSettings = toggleState === 'on';\r\n this.showAdGroupOverrideInformation = useCampaignSettings;\r\n this.setAdGroupInfoVisibility();\r\n if (this.currentLevelTargetInfo) {\r\n this.currentLevelTargetInfo.setParentLevelToggle(this.criterionType, useCampaignSettings);\r\n }\r\n\r\n if (useCampaignSettings) {\r\n this.closeTargetEditView();\r\n this.$('.target-edit-container').addClass('hide');\r\n this.$('.current-level-bid-adjustment-grid').addClass('hide');\r\n this.$('.parent-level-bid-adjustment-grid').removeClass('hide');\r\n } else {\r\n if (this.criterionType === 'Age' && this.isSearchDSAShoppingAdgroupLevel\r\n && !(this.targetSelectionView.hasSavedSelections || this.targetSelectionView.hasSavedNegSelections)) {\r\n this.saveSnapshot();\r\n }\r\n\r\n // copy parent criterions to child criterions if child criterions are empty\r\n this.copyParentCriterionsAsync().catch(() => {\r\n throw new Error('Failure in copying parent criterions');\r\n });\r\n\r\n this.$('.target-edit-container').removeClass('hide');\r\n this.$('.current-level-bid-adjustment-grid').removeClass('hide');\r\n this.$('.parent-level-bid-adjustment-grid').addClass('hide');\r\n this.$('.target-edit-container .bid-adjustment-target-column .form-inline .form-control').removeAttr('disabled');\r\n }\r\n }\r\n\r\n changeVisibility(fromCriterionChanged = false) {\r\n if (this.criterionType) {\r\n if (this.getInitializePromise && typeof this.getInitializePromise === 'function') {\r\n const initPromise = this.getInitializePromise();\r\n initPromise.then(() => {\r\n this.changeVisAction(fromCriterionChanged);\r\n });\r\n } else {\r\n this.changeVisAction(fromCriterionChanged);\r\n }\r\n }\r\n }\r\n\r\n changeVisAction(fromCriterionChanged = false) {\r\n const hasData = this.currentLevelTargetInfo && this.currentLevelTargetInfo.parentLevelTogglesByType[this.criterionType] ?\r\n (this.parentLevelTargetInfo &&\r\n this.parentLevelTargetInfo.getAllByType(this.criterionType).length > 0) :\r\n this.currentLevelTargetInfo.getAllByType(this.criterionType).length > 0;\r\n\r\n if (this.levelToggle\r\n && (this.viewContext.level === 'adgroup')\r\n && this.currentLevelTargetInfo\r\n && this.currentLevelTargetInfo.getAllByType(this.criterionType).length > 0\r\n && fromCriterionChanged) {\r\n if (this.currentLevelTargetInfo && this.currentLevelTargetInfo.getAllByType(this.criterionType)[0].LevelOfDetails === 'AdGroup') {\r\n this.levelToggle.setToggleState('off');\r\n } else if (!_.any(this.currentLevelTargetInfo.getAllByType(this.criterionType), d => d.LevelOfDetails !== 'Campaign')) {\r\n this.levelToggle.setToggleState('on');\r\n }\r\n }\r\n\r\n if (this.showBidAdjustment) {\r\n if (hasData) {\r\n this.$('.bid-adjustment-grids-container').show();\r\n this.$('.no-target-exist-edit-label').hide();\r\n } else {\r\n this.$('.bid-adjustment-grids-container').hide();\r\n this.$('.no-target-exist-edit-label').show();\r\n }\r\n }\r\n\r\n if (this.showTargetOrBid) {\r\n if (hasData) {\r\n this.$('.bid-or-target-and-bid-selector').show();\r\n } else {\r\n this.$('.bid-or-target-and-bid-selector').hide();\r\n }\r\n }\r\n }\r\n\r\n copyParentCriterionsAsync() {\r\n if (this.currentLevelTargetInfo && this.currentLevelTargetInfo.getAllByType(this.criterionType).length > 0) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n const criterionsToCopy = this.parentLevelTargetInfo.getAllByType(this.criterionType);\r\n const createTasks = [];\r\n\r\n _.each(criterionsToCopy, (criterion) => {\r\n // omit property belongs to parent criterions\r\n const copiedCriterion = _.pick(\r\n cloneDeep(criterion),\r\n 'AdGroup',\r\n 'Criterion',\r\n 'CriterionType'\r\n );\r\n if (this.currentLevelTargetInfo) {\r\n createTasks.push(this.currentLevelTargetInfo.createAsync(copiedCriterion));\r\n }\r\n });\r\n\r\n return Promise.all(createTasks);\r\n }\r\n\r\n initializeBidAdjustmentGrid() {\r\n this.bidAdjustmentGrid = new BidAdjustment({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n parentLevelTargetInfo: this.parentLevelTargetInfo,\r\n criterionTypes: this.criterionTypes ? this.criterionTypes : [this.criterionType],\r\n isAudienceCampaign: this.isAudienceCampaign,\r\n showExclusion: this.showExclusion,\r\n activityLogger: this.activityLogger,\r\n campaignId: this.viewContext.currentCampaign ? this.viewContext.currentCampaign.Id : '',\r\n adgroupId: this.viewContext.currentAdGroup ? this.viewContext.currentAdGroup.Id : '',\r\n level: this.viewContext.level,\r\n scenario: this.scenario,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n viewContext: this.viewContext,\r\n isSearchDSAShoppingAdgroupLevel: this.isSearchDSAShoppingAdgroupLevel,\r\n });\r\n }\r\n\r\n initializeParentLevelBidAdjustmentGrid() {\r\n this.parentLevelBidAdjustmentGrid = new BidAdjustment({\r\n currentLevelTargetInfo: this.parentLevelTargetInfo,\r\n criterionTypes: this.criterionTypes ? this.criterionTypes : [this.criterionType],\r\n readonly: true,\r\n showExclusion: this.showExclusion,\r\n campaignId: this.viewContext.currentCampaign ? this.viewContext.currentCampaign.Id : '',\r\n adgroupId: this.viewContext.currentAdGroup ? this.viewContext.currentAdGroup.Id : '',\r\n level: this.viewContext.level,\r\n scenario: this.scenario,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n viewContext: this.viewContext,\r\n });\r\n }\r\n\r\n initializeTargetOrBidSelector() {\r\n this.targetOrBidSelector = new TargetOrBidSelector({\r\n isTargetAndBid: this.isTargetAndBid,\r\n });\r\n }\r\n\r\n get isCashbackPercentValid() {\r\n if (this.supportCashbackSettings) {\r\n const cashbackPercentErrorSelector = [\r\n '.bid-adjustment-grid .table-container td[data-Column=CashbackPercent] .error',\r\n '.target-grid .table-container td[data-Column=CashbackPercent] .error',\r\n ].join(',');\r\n const $cashbackPercentErrors = this.$el.find(cashbackPercentErrorSelector);\r\n return _.every($cashbackPercentErrors, (__, i) => {\r\n const $err = $cashbackPercentErrors.eq(i);\r\n return $err.text() === '';\r\n });\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Returns true if the control is in a valid state\r\n * This should be overriden by the child components\r\n *\r\n * @returns {bool} - true if valid\r\n */\r\n validate() {\r\n const isBidAdjustmentGridValid = this.bidAdjustmentGrid ?\r\n this.bidAdjustmentGrid.getState().isValid : true;\r\n return isBidAdjustmentGridValid &&\r\n this.isTargetSelectionViewValid &&\r\n this.isCashbackPercentValid;\r\n }\r\n\r\n get events() {\r\n return {\r\n 'change .bid-adj-col': 'onBidAdjChange',\r\n 'change select[aria-label=\"Bid adjustment options\"]': 'onBidAdjChange',\r\n 'click .edit-target-show-button': 'onEditTargetShowButtonClicked',\r\n 'click .done-editing-target-button': 'onEditTargetDoneButtonClicked',\r\n };\r\n }\r\n\r\n onEditTargetShowButtonClicked() {\r\n if (!this.validate()) {\r\n return;\r\n }\r\n if (this.targetSelectionView && this.targetSelectionView.saveSnapshot) {\r\n // Before showing the target, save the snapshot.\r\n this.targetSelectionView.saveSnapshot();\r\n }\r\n\r\n this.$('.target-selection-container').removeClass('hide');\r\n this.$('.current-level-bid-adjustment-grid').addClass('hide');\r\n this.$('.edit-target-show-button-container').addClass('hide');\r\n this.$('.done-editing-target-button').removeClass('hide');\r\n this.$('.bid-only-note-container').addClass('hide');\r\n }\r\n\r\n onEditTargetDoneButtonClicked() {\r\n // we should validate the grid before switch view\r\n if (this.validate()) {\r\n if (this.targetSelectionView && this.targetSelectionView.updateCriterionDataAsync) {\r\n // When it is done, update the audience target info.\r\n this.targetSelectionView.updateCriterionDataAsync();\r\n // for search based editor, we need to refresh the bid adjustment grid\r\n } else if (this.targetSelectionView && this.targetSelectionView.searchBasedTargetGridView &&\r\n this.bidAdjustmentGrid) {\r\n this.bidAdjustmentGrid.onCriterionChanged();\r\n }\r\n this.closeTargetEditView();\r\n }\r\n }\r\n\r\n closeTargetEditView() {\r\n this.$('.target-selection-container').addClass('hide');\r\n this.$('.current-level-bid-adjustment-grid').removeClass('hide');\r\n this.$('.edit-target-show-button-container').removeClass('hide');\r\n this.$('.done-editing-target-button').addClass('hide');\r\n this.$('.bid-only-note-container').removeClass('hide');\r\n }\r\n\r\n resetSupportCashbackSettings(supportCashbackSettings, inheritInfo) {\r\n this.supportCashbackSettings = supportCashbackSettings;\r\n\r\n if (this.bidAdjustmentGrid) {\r\n this.bidAdjustmentGrid.remove();\r\n this.initializeBidAdjustmentGrid();\r\n }\r\n\r\n if (this.parentLevelBidAdjustmentGrid) {\r\n this.parentLevelBidAdjustmentGrid.remove();\r\n this.initializeParentLevelBidAdjustmentGrid();\r\n }\r\n\r\n if (inheritInfo != null) {\r\n const { value, level } = inheritInfo;\r\n if (level === 'AdGroup') {\r\n const originalAdGroupCashback = _.chain(this.viewContext)\r\n .result('currentAdGroup')\r\n .result('AdGroupCashback', {})\r\n .value();\r\n\r\n this.viewContext.currentAdGroup = {\r\n ..._.result(this.viewContext, 'currentAdGroup', {}),\r\n AdGroupCashback: {\r\n ...originalAdGroupCashback,\r\n Percent: value,\r\n },\r\n };\r\n } else {\r\n const originalCampaignCashback = _.chain(this.viewContext)\r\n .result('currentCampaign')\r\n .result('CampaignCashback', {})\r\n .value();\r\n\r\n this.viewContext.currentCampaign = {\r\n ..._.result(this.viewContext, 'currentCampaign', {}),\r\n CampaignCashback: {\r\n ...originalCampaignCashback,\r\n Percent: value,\r\n },\r\n };\r\n }\r\n }\r\n\r\n this.renderGrids();\r\n }\r\n\r\n renderGrids() {\r\n if (this.bidAdjustmentGrid) {\r\n this.bidAdjustmentGrid.render();\r\n this.$('.current-level-bid-adjustment-grid').empty().append(this.bidAdjustmentGrid.$el);\r\n }\r\n\r\n if (this.parentLevelBidAdjustmentGrid) {\r\n this.parentLevelBidAdjustmentGrid.render();\r\n this.$('.parent-level-bid-adjustment-grid').empty().append(this.parentLevelBidAdjustmentGrid.$el);\r\n }\r\n\r\n if (this.supportCashbackSettings) {\r\n this.$('.criterion-setting-container').addClass('show-cashback-percent');\r\n } else {\r\n this.$('.criterion-setting-container').removeClass('show-cashback-percent');\r\n }\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n this.$('.criterion-setting-container').addClass(`criterion-setting-${this.criterionType}`);\r\n\r\n if (this.targetSelectionView) {\r\n this.targetSelectionView.render();\r\n this.$('.target-selection-container').empty().append(this.targetSelectionView.$el);\r\n }\r\n\r\n this.renderGrids();\r\n\r\n if (this.targetOrBidSelector) {\r\n this.targetOrBidSelector.render();\r\n this.$('.bid-or-target-and-bid-selector').empty().append(this.targetOrBidSelector.$el);\r\n }\r\n\r\n if (this.levelToggle) {\r\n this.levelToggle.render();\r\n this.$('.level-toggle').empty().append(this.levelToggle.$el);\r\n if (this.currentLevelTargetInfo && this.currentLevelTargetInfo.getParentLevelToggle(this.criterionType)) {\r\n this.$('.target-edit-container').addClass('hide');\r\n this.$('.current-level-bid-adjustment-grid').addClass('hide');\r\n this.$('.parent-level-bid-adjustment-grid').removeClass('hide');\r\n }\r\n }\r\n\r\n this.changeVisibility();\r\n this.setAdGroupInfoVisibility();\r\n\r\n return this;\r\n }\r\n\r\n getIsTargetAndBid() {\r\n return this.targetOrBidSelector.getIsTargetAndBid();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { CompanyNameTargetSetting } from './company-name-target-setting';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\nimport { onBidAdjChange } from '../shared-utils/bid-adjustment-utils';\r\n\r\nexport class CompanyNameCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.criterionType = 'CompanyName';\r\n this.type = 'CompanyName';\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.showBidOnlyNote = options.showBidOnlyNote;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n this.defaultBidAdjustment = _.has(options, 'defaultBidAdjustment') ? options.defaultBidAdjustment : null;\r\n this.viewContext = options.viewContext || {};\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n this.isFilterCriterionLevelAdGroup = options.isFilterCriterionLevelAdGroup;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.activityLogger = options.activityLogger;\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n onBidAdjChange(e) {\r\n onBidAdjChange(this, e, 'CompanyName');\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new CompanyNameTargetSetting({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n criterionType: this.criterionType,\r\n type: this.type,\r\n showBidOnlyNote: this.showBidOnlyNote,\r\n showExclusion: this.showExclusion,\r\n defaultBidAdjustment: this.defaultBidAdjustment,\r\n currentLevel: this.viewContext.level,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n viewContext: this.viewContext,\r\n isFilterCriterionLevelAdGroup: this.isFilterCriterionLevelAdGroup,\r\n activityLogger: this.activityLogger,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Company_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_Company';\r\n }\r\n\r\n getSnapshot() {\r\n return this.targetSelectionView.currentLevelTargetInfo.criterionsByType.CompanyName;\r\n }\r\n\r\n getTargetedCriterion() {\r\n const targetedCriterion = _.filter(\r\n this.getSnapshot(),\r\n criterion => criterion.CriterionType === 'CompanyName'\r\n );\r\n\r\n return targetedCriterion;\r\n }\r\n\r\n getExcludedCriterion() {\r\n const excludedCriterion = _.filter(\r\n this.getSnapshot(),\r\n criterion => criterion.CriterionType === 'NegativeCompanyName'\r\n );\r\n\r\n return excludedCriterion;\r\n }\r\n\r\n // Turns list into array. ToDo: This method may be unneeded. Future Cleanup. Same for exclude.\r\n getTargetedValues() {\r\n const criterions = this.getTargetedCriterion();\r\n const selected = [];\r\n const len = criterions.length;\r\n let i = 0;\r\n for (i = 0; i < len; i += 1) {\r\n selected.push(criterions[i].Criterion.Name);\r\n }\r\n return selected;\r\n }\r\n\r\n getExcludedValues() {\r\n const criterions = this.getExcludedCriterion();\r\n const selected = [];\r\n const len = criterions.length;\r\n let i = 0;\r\n for (i = 0; i < len; i += 1) {\r\n selected.push(criterions[i].Criterion.Name);\r\n }\r\n return selected;\r\n }\r\n\r\n getSelectedString(arr) {\r\n let summary = '';\r\n if (arr.length > 1) {\r\n summary = `${arr[0]}, ${this.i18n.getString('CampaignImport_And')} ` +\r\n `${arr.length - 1} ${this.i18n.getString('Page_More')}`;\r\n } else {\r\n summary = `${arr[0]}`;\r\n }\r\n return summary;\r\n }\r\n\r\n getTargetedSummary() {\r\n const selected = this.getTargetedValues();\r\n const data = this.getSnapshot();\r\n\r\n let summary = '';\r\n if (data.length === 0) {\r\n summary = `${this.i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Target')}\r\n ${this.i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Companies')}`;\r\n } else if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Targeted')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n\r\n return summary;\r\n }\r\n\r\n getExcludedSummary() {\r\n const selected = this.getExcludedValues();\r\n let summary = '';\r\n\r\n if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Excluded')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n\r\n return summary;\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { criterionHelper } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport template from './search-result-view-template.pug';\r\n\r\n/**\r\n * Class for search result view for linkedin targets\r\n *\r\n * @class SearchResultView\r\n * @extends {Backbone.View}\r\n */\r\nexport class SearchResultView extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options for the initialize\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = options;\r\n this.currentLevelTargetInfo = this.options.currentLevelTargetInfo;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n this.defaultBidAdjustment = _.has(options, 'defaultBidAdjustment') ? options.defaultBidAdjustment : 0;\r\n this.defaultCashbackPercent = options.defaultCashbackPercent;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n\r\n this.items = [];\r\n this.isVisible = true;\r\n }\r\n\r\n /**\r\n * Define events and event handlers for them.\r\n *\r\n * @readonly\r\n * @returns {Object} returns object defining events\r\n */\r\n get events() {\r\n return {\r\n 'click a.job-function-search-include-link': 'onInclude',\r\n 'click a.job-function-search-exclude-link': 'onExclude',\r\n };\r\n }\r\n\r\n /**\r\n * Update the state of the state\r\n *\r\n * @param {Object} searchResult - array of search result\r\n * @param {String} searchTerm - search term string.\r\n *\r\n * @return {Object} - view itself.\r\n */\r\n setResults(searchResult, searchTerm) {\r\n this.items = _.map(searchResult, (resultItem) => {\r\n const item = resultItem;\r\n\r\n const matchStartIndex = item.name.toLowerCase().indexOf(searchTerm.toLowerCase());\r\n\r\n if (matchStartIndex >= 0) {\r\n const matchEndIndex = matchStartIndex + searchTerm.length;\r\n\r\n item.caseMatchedSearchTerm = item.name.substring(matchStartIndex, matchEndIndex);\r\n }\r\n\r\n return item;\r\n });\r\n\r\n return this.render();\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n const ariaLiveResultsText = this.items.length < 1 ? this.i18n.getString('Audience_Campaign_Target_Setting_Company_Search_No_Result') : this.i18n.getString('Found {{totalCount}} Results', { totalCount: this.items.length });\r\n this.$el.closest('.search-result-view-container').find('.search-result.live-region').text(ariaLiveResultsText);\r\n\r\n return this;\r\n }\r\n\r\n setDefaultCashbackPercent(percent) {\r\n this.defaultCashbackPercent = percent;\r\n }\r\n\r\n\r\n /**\r\n * Event handler for target include action\r\n * @private\r\n *\r\n * @param {Object} e - click event object\r\n * @returns {Promise} - Promise of handling onInclude event\r\n */\r\n onInclude(e) {\r\n e.stopPropagation();\r\n\r\n if (!e.target) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n const jobFunctionTargetItem =\r\n _.first(_.filter(this.items, item => item.id === parseInt(e.target.dataset.id, 10)));\r\n\r\n const criterion = criterionHelper.buildLinkedInCriterion(\r\n 'JobFunction',\r\n jobFunctionTargetItem,\r\n true,\r\n this.defaultBidAdjustment,\r\n this.defaultCashbackPercent\r\n );\r\n\r\n return this.currentLevelTargetInfo.createAsync(criterion);\r\n }\r\n\r\n /**\r\n * Event handler for target exclude action\r\n * @private\r\n *\r\n * @param {Object} e - click event object\r\n * @returns {Promise} - Promise of handling onExclude event\r\n */\r\n onExclude(e) {\r\n e.stopPropagation();\r\n\r\n if (!e.target) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n const jobFunctionTargetItem =\r\n _.first(_.filter(this.items, item => item.id === parseInt(e.target.dataset.id, 10)));\r\n\r\n const criterion = criterionHelper.buildLinkedInCriterion(\r\n 'JobFunction',\r\n jobFunctionTargetItem,\r\n false,\r\n this.defaultBidAdjustment\r\n );\r\n\r\n return this.currentLevelTargetInfo.createAsync(criterion);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { SearchResultView } from '../search-result/search-result-view';\r\nimport { SearchViewBase } from '../../search-view-base';\r\n\r\n/**\r\n * Class for search view for linked in targets\r\n *\r\n * @class JobFunctionSearchView\r\n * @extends {Backbone.View}\r\n */\r\nexport class JobFunctionSearchView extends SearchViewBase {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options object\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n super.initialize(options);\r\n\r\n this.initializeSearchDataTask = this.initializeSearchData();\r\n this.searchBox.on('search', searchTerm => this.onSearch(searchTerm));\r\n this.searchResultView = new SearchResultView(this.options);\r\n this.searchTerm = '';\r\n\r\n this.listenTo(\r\n this.currentLevelTargetInfo,\r\n `${this.currentLevelTargetInfo.resourceName}JobFunctionChanged`,\r\n () => this.onCriterionChange()\r\n );\r\n }\r\n\r\n /**\r\n * Initialize search data by fetching data from the MT\r\n * @private\r\n *\r\n * @returns {Promise} - promise of having data from MT\r\n */\r\n initializeSearchData() {\r\n const odata = DependencyResolver.get('component/http/channel/odata');\r\n const context = DependencyResolver.get('audienceCampaignPageContext');\r\n const demogrphicsUrl = `Customers(${context.CurrentCustomerId})/Accounts(${context.CurrentAccount.Id})/Demographics/`;\r\n const jobFunctionUrl = 'Model.JobFunction';\r\n\r\n return odata.get(demogrphicsUrl + jobFunctionUrl)\r\n .then((data) => {\r\n this.searchData = data.value;\r\n this.setSearchResult();\r\n });\r\n }\r\n\r\n /**\r\n * Event handler for search requested\r\n * @private\r\n *\r\n * @param {string} searchTerm - search keyword\r\n * @returns {Object} - promise of setting the search result\r\n */\r\n onSearch(searchTerm) {\r\n return this.initializeSearchDataTask.then(() => {\r\n this.searchTerm = searchTerm;\r\n\r\n this.setSearchResult();\r\n });\r\n }\r\n\r\n onCriterionChange() {\r\n this.setSearchResult();\r\n }\r\n\r\n setDefaultCashbackPercent(percent) {\r\n this.searchResultView.setDefaultCashbackPercent(percent);\r\n }\r\n\r\n /**\r\n * Set the search result for the render\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n setSearchResult() {\r\n const jobFunctions = this.currentLevelTargetInfo.getAllByType('JobFunction');\r\n const targetedJobFunctionIds = _.map(jobFunctions, (jobFunction) => {\r\n if (jobFunction.CriterionType === 'JobFunction') {\r\n return parseInt(jobFunction.Criterion.JobFunctionCriterion.Target, 10);\r\n }\r\n\r\n return -1;\r\n });\r\n const excludedJobFunctionIds = _.map(jobFunctions, (jobFunction) => {\r\n if (jobFunction.CriterionType === 'NegativeJobFunction') {\r\n return parseInt(jobFunction.Criterion.JobFunctionCriterion.Target, 10);\r\n }\r\n\r\n return -1;\r\n });\r\n\r\n // Filter the results based on search term\r\n const searchText = this.searchTerm.toLowerCase();\r\n\r\n let searchResults = this.searchData;\r\n\r\n if (this.searchTerm.length > 0) {\r\n searchResults =\r\n _.filter(this.searchData, item => item.Name.toLowerCase().indexOf(searchText) > -1);\r\n }\r\n\r\n const results = _.map(searchResults, (result) => {\r\n const item = {\r\n id: result.Id,\r\n name: result.Name,\r\n isIncluded: _.contains(targetedJobFunctionIds, result.Id),\r\n isExcluded: _.contains(excludedJobFunctionIds, result.Id),\r\n };\r\n\r\n return item;\r\n });\r\n\r\n this.searchResultView.setResults(results, this.searchTerm);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { SearchBasedTargetSetting, removeAllColumnConfig, statusColumnConfig, nameColumnConfig } from '../search-based-target-setting';\r\nimport searchBasedTargetGridRemoveColumnTemplate from '../search-based-target-grid-remove-column-template.pug';\r\nimport searchBasedTargetGridStateTemplate from '../search-based-target-grid-state-template.pug';\r\nimport { JobFunctionSearchView } from './search-view/search-view';\r\nimport { cashbackPercentColumnConfig } from '../shared-utils/bid-adjustment-utils';\r\n\r\nexport class JobFunctionTargetSetting extends SearchBasedTargetSetting {\r\n initialize(options) {\r\n this.options = options;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n\r\n this.i18nKeys = {\r\n titleKey: 'Audience_Campaign_Target_Setting_Job_Function_Title',\r\n helpKey: 'pop_BA_CampaignCreate_AudTargets_JobFunction',\r\n descriptionKey: this.showExclusion\r\n ? 'Audience_Campaign_Target_Setting_Job_Function_Description'\r\n : 'Audience_Campaign_Target_Setting_Job_Function_Description_Bid_Only',\r\n };\r\n\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.criterionName = 'JobFunction';\r\n const i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n const bingadsGridColumn = DependencyResolver.get('component/bingads-grid/shared/column');\r\n const pageContext = DependencyResolver.get('audienceCampaignPageContext');\r\n this.isFilterCriterionLevelAdGroup =\r\n options.isFilterCriterionLevelAdGroup || pageContext.isFilterCriterionLevelAdGroup;\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n\r\n const jobFunctionSettingGridConfig = {\r\n columns: [\r\n bingadsGridColumn({\r\n name: 'isIncludedOrExcluded',\r\n title: this.showExclusion ? i18n.getString('Audience_Campaign_Target_Setting_Job_Function_Grid_Column_Target') : '',\r\n template: (local) => {\r\n const criterionType = local.value.CriterionType;\r\n\r\n return searchBasedTargetGridStateTemplate({\r\n isIncluded: criterionType === 'JobFunction',\r\n isExcluded: criterionType === 'NegativeJobFunction',\r\n includedString: i18n.getString('Audience_Campaign_Target_Setting_Included_Status'),\r\n excludedString: i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status'),\r\n });\r\n },\r\n property: _.identity,\r\n }),\r\n bingadsGridColumn(_.extend({}, nameColumnConfig('JobFunctionCriterion'), {\r\n i18n,\r\n name: 'name',\r\n title: 'Audience_Campaign_Target_Setting_Job_Function_Grid_Column_Job_Functions',\r\n })),\r\n ...(options.currentLevel === 'adgroup'\r\n && (this.options.showBidOnlyNote || this.options.showExclusion)\r\n && this.isFilterCriterionLevelAdGroup && this.supportCashbackSettings) ?\r\n [bingadsGridColumn(cashbackPercentColumnConfig(this, i18n, 'JobFunction'))] : [],\r\n bingadsGridColumn({\r\n name: 'removeAll',\r\n template: () => searchBasedTargetGridRemoveColumnTemplate({ i18n }),\r\n headClasses: ['linked-in-target-grid__remove-body'],\r\n bodyClasses: ['text-right'],\r\n }),\r\n ],\r\n };\r\n\r\n const isolatedJobFunctionSettingGridConfig = targetType => ({\r\n columns: [\r\n bingadsGridColumn(_.extend({}, nameColumnConfig('JobFunctionCriterion'), {\r\n name: 'name',\r\n html: searchBasedTargetGridStateTemplate({\r\n isIncluded: targetType === 'Included',\r\n isExcluded: targetType === 'Excluded',\r\n includedString: i18n.getString(`Audience_Campaign_Target_Setting_Job_Function_${targetType}_Status`),\r\n excludedString: i18n.getString(`Audience_Campaign_Target_Setting_Job_Function_${targetType}_Status`),\r\n }),\r\n })),\r\n bingadsGridColumn(removeAllColumnConfig(i18n)),\r\n ],\r\n });\r\n\r\n const jobFunctionSettingNewUIGridConfig = targetType => ({\r\n columns: [\r\n {\r\n name: 'JobFuncitonTarget',\r\n property: _.identity,\r\n html: `${i18n.getString(`Audience_Campaign_Target_Setting_Job_Function_${targetType}_Grid_Title`)}`,\r\n columns: [\r\n bingadsGridColumn(_.extend({}, statusColumnConfig(targetType), { headClasses: 'hide' })),\r\n bingadsGridColumn(_.extend({}, nameColumnConfig('JobFunctionCriterion'), {\r\n name: 'name',\r\n headClasses: 'hide',\r\n })),\r\n ],\r\n },\r\n bingadsGridColumn(removeAllColumnConfig(i18n)),\r\n ],\r\n });\r\n\r\n if (this.options.isolatedGrid) {\r\n if (this.options.isForVNext) {\r\n this.options.gridConfig = jobFunctionSettingNewUIGridConfig;\r\n } else {\r\n this.options.gridConfig = isolatedJobFunctionSettingGridConfig;\r\n }\r\n } else {\r\n this.options.gridConfig = jobFunctionSettingGridConfig;\r\n }\r\n this.searchView = new JobFunctionSearchView(this.options);\r\n\r\n super.initialize(this.options);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { JobFunctionTargetSetting } from './job-function-target-setting';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\nimport { onBidAdjChange } from '../shared-utils/bid-adjustment-utils';\r\n\r\nexport class JobFunctionCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.criterionType = 'JobFunction';\r\n this.type = 'JobFunction';\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.showBidOnlyNote = options.showBidOnlyNote;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n this.defaultBidAdjustment = _.has(options, 'defaultBidAdjustment') ? options.defaultBidAdjustment : null;\r\n this.viewContext = options.viewContext || {};\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n this.isFilterCriterionLevelAdGroup = options.isFilterCriterionLevelAdGroup;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.activityLogger = options.activityLogger;\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n\r\n onBidAdjChange(e) {\r\n onBidAdjChange(this, e, 'JobFunction');\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new JobFunctionTargetSetting({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n criterionType: this.criterionType,\r\n type: this.type,\r\n showBidOnlyNote: this.showBidOnlyNote,\r\n showExclusion: this.showExclusion,\r\n defaultBidAdjustment: this.defaultBidAdjustment,\r\n currentLevel: this.viewContext.level,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n viewContext: this.viewContext,\r\n isFilterCriterionLevelAdGroup: this.isFilterCriterionLevelAdGroup,\r\n activityLogger: this.activityLogger,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Job_Function_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_JobFunction';\r\n }\r\n\r\n getSnapshot() {\r\n return this.targetSelectionView.currentLevelTargetInfo.criterionsByType.JobFunction;\r\n }\r\n\r\n getTargetedCriterion() {\r\n const targetedCriterion = _.filter(\r\n this.getSnapshot(),\r\n criterion => criterion.CriterionType === 'JobFunction'\r\n );\r\n\r\n return targetedCriterion;\r\n }\r\n\r\n getExcludedCriterion() {\r\n const excludedCriterion = _.filter(\r\n this.getSnapshot(),\r\n criterion => criterion.CriterionType === 'NegativeJobFunction'\r\n );\r\n\r\n return excludedCriterion;\r\n }\r\n\r\n getTargetedValues() {\r\n const criterions = this.getTargetedCriterion();\r\n const selected = [];\r\n const len = criterions.length;\r\n let i = 0;\r\n for (i = 0; i < len; i += 1) {\r\n selected.push(criterions[i].Criterion.Name);\r\n }\r\n return selected;\r\n }\r\n\r\n getExcludedValues() {\r\n const criterions = this.getExcludedCriterion();\r\n const selected = [];\r\n const len = criterions.length;\r\n let i = 0;\r\n for (i = 0; i < len; i += 1) {\r\n selected.push(criterions[i].Criterion.Name);\r\n }\r\n return selected;\r\n }\r\n\r\n getSelectedString(arr) {\r\n let summary = '';\r\n if (arr.length > 1) {\r\n summary = `${arr[0]}, ${this.i18n.getString('CampaignImport_And')} ${arr.length - 1}`\r\n + ` ${this.i18n.getString('Page_More')}`;\r\n } else {\r\n summary = `${arr[0]}`;\r\n }\r\n\r\n return summary;\r\n }\r\n\r\n getTargetedSummary() {\r\n const selected = this.getTargetedValues();\r\n const data = this.getSnapshot();\r\n let summary = '';\r\n\r\n if (data.length === 0) {\r\n summary = `${this.i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Target')}\r\n ${this.i18n.getString('Audience_Campaign_Target_Setting_Job_Function_Grid_Column_Job_Functions')}`;\r\n } else if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Targeted')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n\r\n return summary;\r\n }\r\n\r\n getExcludedSummary() {\r\n const selected = this.getExcludedValues();\r\n let summary = '';\r\n\r\n if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Excluded')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n\r\n return summary;\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { Treeview } from '@bingads-webui/treeview';\r\nimport { criterionHelper } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport template from './search-view-template.pug';\r\n\r\n/**\r\n * Class for search view for linked in targets\r\n *\r\n * @class SearchView\r\n * @extends {Backbone.View}\r\n */\r\nexport class SearchView extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options object\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = options;\r\n this.currentLevelTargetInfo = this.options.currentLevelTargetInfo;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n this.defaultBidAdjustment = _.has(options, 'defaultBidAdjustment') ? options.defaultBidAdjustment : 0;\r\n\r\n this.listenTo(\r\n this.currentLevelTargetInfo,\r\n `${this.currentLevelTargetInfo.resourceName}IndustryChanged`,\r\n () => this.onCriterionChange()\r\n );\r\n\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n\r\n this.searchTreeInitializationPromise = this.initializeSearchTree();\r\n this.defaultCashbackPercent = options.defaultCashbackPercent;\r\n\r\n this.refreshTargetedStates();\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n this.searchTreeInitializationPromise.then(() => {\r\n this.treeView.render();\r\n this.$('.search-result-view-container').append(this.treeView.$el);\r\n });\r\n\r\n return this;\r\n }\r\n\r\n setDefaultCashbackPercent(percent) {\r\n this.defaultCashbackPercent = percent;\r\n }\r\n\r\n /**\r\n * Event handler for target include action\r\n * @private\r\n *\r\n * @param {Object} data - criterion data\r\n * @returns {Promise} - Promise of handling onInclude event\r\n */\r\n onInclude(data) {\r\n const criterion = criterionHelper.buildLinkedInCriterion(\r\n 'Industry',\r\n data,\r\n true,\r\n this.defaultBidAdjustment,\r\n this.defaultCashbackPercent\r\n );\r\n\r\n return this.currentLevelTargetInfo.createAsync(criterion);\r\n }\r\n\r\n /**\r\n * Event handler for target exclude action\r\n * @private\r\n *\r\n * @param {Object} data - criterion data\r\n * @returns {Promise} - Promise of handling onExclude event\r\n */\r\n onExclude(data) {\r\n const criterion = criterionHelper.buildLinkedInCriterion(\r\n 'Industry',\r\n data,\r\n false,\r\n this.defaultBidAdjustment\r\n );\r\n\r\n return this.currentLevelTargetInfo.createAsync(criterion);\r\n }\r\n\r\n /**\r\n * Initializes the search tree by fetching the data\r\n *\r\n * @returns {Promise} - promise of creating a search tree instance\r\n */\r\n initializeSearchTree() {\r\n const odata = DependencyResolver.get('component/http/channel/odata');\r\n const context = DependencyResolver.get('audienceCampaignPageContext');\r\n const demogrphicsUrl = `Customers(${context.CurrentCustomerId})/Accounts(${context.CurrentAccount.Id})/Demographics/`;\r\n const industryUrl = 'Model.Industry';\r\n\r\n return odata.get(demogrphicsUrl + industryUrl)\r\n .then(data => this.processIndustryRowData(data.value))\r\n .then((treeData) => {\r\n const options = {\r\n i18n: this.i18n,\r\n actions: (() => {\r\n const actions = [];\r\n\r\n if (this.showExclusion) {\r\n actions.push({\r\n title: this.i18n.getString('Audience_Campaign_Target_Setting_Exclude_Action'),\r\n callback: node => this.onExclude(node.data),\r\n });\r\n }\r\n actions.push({\r\n title: this.i18n.getString('Audience_Campaign_Target_Setting_Include_Action'),\r\n callback: node => this.onInclude(node.data),\r\n });\r\n\r\n return actions;\r\n })(),\r\n setLeafState: (leafNodeData) => {\r\n const state = {\r\n shouldSetState: false,\r\n stateValue: '',\r\n };\r\n\r\n if (_.contains(this.targetedIndustryIds, leafNodeData.Id)) {\r\n state.shouldSetState = true;\r\n state.stateValue = this.i18n.getString('Audience_Campaign_Target_Setting_Included_Status');\r\n } else if (_.contains(this.excludedIndustryIds, leafNodeData.Id)) {\r\n state.shouldSetState = true;\r\n state.stateValue = this.i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status');\r\n }\r\n\r\n return state;\r\n },\r\n placeHolderText: this.i18n.getString('Audience_Campaign_Target_Setting_Industry_Search_Placeholder'),\r\n };\r\n\r\n this.treeView = new Treeview(treeData, options);\r\n });\r\n }\r\n\r\n /**\r\n * Update the search result.\r\n *\r\n * @returns {undefined}\r\n */\r\n updateSearchResult() {\r\n if (this.treeView) {\r\n this.treeView.updateView();\r\n }\r\n }\r\n\r\n /**\r\n * Using the data from the MT, it populates the Criterion field to be saved\r\n *\r\n * @param {Array} data - array of data objects containing the information\r\n * @returns {Object} groupedTree - tree structured data\r\n */\r\n processIndustryRowData(data) {\r\n const groupedTree = {\r\n children: [],\r\n };\r\n\r\n _.each(data, (item) => {\r\n const node = {\r\n title: item.Name,\r\n data: item,\r\n };\r\n\r\n if (!_.some(groupedTree.children, child => child.title === item.IndustryGroupName)) {\r\n groupedTree.children.push({\r\n title: item.IndustryGroupName,\r\n children: [],\r\n });\r\n }\r\n\r\n const groupToInsert = _.findWhere(groupedTree.children, { title: item.IndustryGroupName });\r\n\r\n groupToInsert.children.push(node);\r\n });\r\n\r\n return groupedTree;\r\n }\r\n\r\n /**\r\n * Event handler for criterion change\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n onCriterionChange() {\r\n this.refreshTargetedStates();\r\n\r\n this.updateSearchResult();\r\n }\r\n\r\n /**\r\n * Refreses the trageted state in memory data by reading what is svaed in Intermediate\r\n *\r\n * @returns {undefined}\r\n */\r\n refreshTargetedStates() {\r\n const industries = this.currentLevelTargetInfo.getAllByType('Industry');\r\n this.targetedIndustryIds = _.map(industries, (industry) => {\r\n if (industry.CriterionType === 'Industry') {\r\n return parseInt(industry.Criterion.IndustryCriterion.Target, 10);\r\n }\r\n\r\n return -1;\r\n });\r\n this.excludedIndustryIds = _.map(industries, (industry) => {\r\n if (industry.CriterionType === 'NegativeIndustry') {\r\n return parseInt(industry.Criterion.IndustryCriterion.Target, 10);\r\n }\r\n\r\n return -1;\r\n });\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { SearchBasedTargetSetting, removeAllColumnConfig, statusColumnConfig, nameColumnConfig } from '../search-based-target-setting';\r\nimport searchBasedTargetGridRemoveColumnTemplate from '../search-based-target-grid-remove-column-template.pug';\r\nimport searchBasedTargetGridStateTemplate from '../search-based-target-grid-state-template.pug';\r\nimport { SearchView } from './search-view/search-view';\r\nimport { cashbackPercentColumnConfig } from '../shared-utils/bid-adjustment-utils';\r\n\r\nexport class IndustryTargetSetting extends SearchBasedTargetSetting {\r\n initialize(options) {\r\n this.options = options;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n\r\n this.i18nKeys = {\r\n titleKey: 'Audience_Campaign_Target_Setting_Industry_Title',\r\n helpKey: 'pop_BA_CampaignCreate_AudTargets_Industry',\r\n descriptionKey: this.showExclusion\r\n ? 'Audience_Campaign_Target_Setting_Industry_Description'\r\n : 'Audience_Campaign_Target_Setting_Industry_Description_Bid_Only',\r\n };\r\n\r\n this.criterionName = 'Industry';\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n const i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n const bingadsGridColumn = DependencyResolver.get('component/bingads-grid/shared/column');\r\n const pageContext = DependencyResolver.get('audienceCampaignPageContext');\r\n this.isFilterCriterionLevelAdGroup =\r\n options.isFilterCriterionLevelAdGroup || pageContext.isFilterCriterionLevelAdGroup;\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n\r\n const industrySettingGridConfig = {\r\n columns: [\r\n bingadsGridColumn({\r\n name: 'isIncludedOrExcluded',\r\n title: this.showExclusion ? i18n.getString('Audience_Campaign_Target_Setting_Industry_Grid_Column_Target') : '',\r\n template: (local) => {\r\n const criterionType = local.value.CriterionType;\r\n\r\n return searchBasedTargetGridStateTemplate({\r\n isIncluded: criterionType === 'Industry',\r\n isExcluded: criterionType === 'NegativeIndustry',\r\n includedString: i18n.getString('Audience_Campaign_Target_Setting_Included_Status'),\r\n excludedString: i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status'),\r\n });\r\n },\r\n property: _.identity,\r\n }),\r\n bingadsGridColumn(_.extend({}, nameColumnConfig('IndustryCriterion'), {\r\n i18n,\r\n name: 'name',\r\n title: 'Audience_Campaign_Target_Setting_Industry_Grid_Column_Industries',\r\n })),\r\n ...(options.currentLevel === 'adgroup'\r\n && (this.options.showBidOnlyNote || this.options.showExclusion)\r\n && this.isFilterCriterionLevelAdGroup && this.supportCashbackSettings) ?\r\n [bingadsGridColumn(cashbackPercentColumnConfig(this, i18n, 'Industry'))] : [],\r\n bingadsGridColumn({\r\n name: 'removeAll',\r\n template: () => searchBasedTargetGridRemoveColumnTemplate({ i18n }),\r\n headClasses: ['linked-in-target-grid__remove-body'],\r\n bodyClasses: ['text-right'],\r\n }),\r\n ],\r\n };\r\n\r\n const isolatedIndustrySettingGridConfig = targetType => ({\r\n columns: [\r\n bingadsGridColumn({\r\n name: 'IndustryName',\r\n template: (local) => {\r\n const criterion = local.value.Criterion.IndustryCriterion;\r\n\r\n return criterion.Name;\r\n },\r\n property: _.identity,\r\n html: searchBasedTargetGridStateTemplate({\r\n isIncluded: targetType === 'Included',\r\n isExcluded: targetType === 'Excluded',\r\n includedString: i18n.getString(`Audience_Campaign_Target_Setting_Industry_${targetType}_Status`),\r\n excludedString: i18n.getString(`Audience_Campaign_Target_Setting_Industry_${targetType}_Status`),\r\n }),\r\n }),\r\n bingadsGridColumn(removeAllColumnConfig(i18n)),\r\n ],\r\n });\r\n\r\n const industrySettingNewUIGridConfig = targetType => ({\r\n columns: [\r\n {\r\n name: 'IndustryTarget',\r\n property: _.identity,\r\n html: `${i18n.getString(`Audience_Campaign_Target_Setting_Industry_${targetType}_Grid_Title`)}`,\r\n columns: [\r\n bingadsGridColumn(_.extend({}, statusColumnConfig(targetType), { headClasses: 'hide' })),\r\n bingadsGridColumn(_.extend({}, nameColumnConfig('IndustryCriterion'), {\r\n name: 'IndustryName',\r\n headClasses: 'hide',\r\n })),\r\n ],\r\n },\r\n bingadsGridColumn(removeAllColumnConfig(i18n)),\r\n ],\r\n });\r\n\r\n if (this.options.isolatedGrid) {\r\n if (this.options.isForVNext) {\r\n this.options.gridConfig = industrySettingNewUIGridConfig;\r\n } else {\r\n this.options.gridConfig = isolatedIndustrySettingGridConfig;\r\n }\r\n } else {\r\n this.options.gridConfig = industrySettingGridConfig;\r\n }\r\n this.searchView = new SearchView(this.options);\r\n\r\n super.initialize(this.options);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { IndustryTargetSetting } from './industry-target-setting';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\nimport { onBidAdjChange } from '../shared-utils/bid-adjustment-utils';\r\n\r\nexport class IndustryCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.criterionType = 'Industry';\r\n this.type = 'Industry';\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.showBidOnlyNote = options.showBidOnlyNote;\r\n this.showExclusion = _.has(options, 'showExclusion') ? options.showExclusion : true;\r\n this.defaultBidAdjustment = _.has(options, 'defaultBidAdjustment') ? options.defaultBidAdjustment : null;\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n this.viewContext = options.viewContext || {};\r\n this.isFilterCriterionLevelAdGroup = options.isFilterCriterionLevelAdGroup;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.activityLogger = options.activityLogger;\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n\r\n onBidAdjChange(e) {\r\n onBidAdjChange(this, e, 'Industry');\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new IndustryTargetSetting({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n criterionType: this.criterionType,\r\n type: this.type,\r\n showBidOnlyNote: this.showBidOnlyNote,\r\n showExclusion: this.showExclusion,\r\n defaultBidAdjustment: this.defaultBidAdjustment,\r\n currentLevel: this.viewContext.level,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n viewContext: this.viewContext,\r\n isFilterCriterionLevelAdGroup: this.isFilterCriterionLevelAdGroup,\r\n activityLogger: this.activityLogger,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Industry_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_Industry';\r\n }\r\n\r\n getSnapshot() {\r\n return this.targetSelectionView.currentLevelTargetInfo.criterionsByType.Industry;\r\n }\r\n\r\n getTargetedCriterion() {\r\n const targetedCriterion = _.filter(\r\n this.getSnapshot(),\r\n criterion => criterion.CriterionType === 'Industry'\r\n );\r\n\r\n return targetedCriterion;\r\n }\r\n\r\n getExcludedCriterion() {\r\n const excludedCriterion = _.filter(\r\n this.getSnapshot(),\r\n criterion => criterion.CriterionType === 'NegativeIndustry'\r\n );\r\n\r\n return excludedCriterion;\r\n }\r\n\r\n getTargetedValues() {\r\n const criterions = this.getTargetedCriterion();\r\n const selected = [];\r\n const len = criterions.length;\r\n let i = 0;\r\n for (i = 0; i < len; i += 1) {\r\n selected.push(criterions[i].Criterion.Name);\r\n }\r\n return selected;\r\n }\r\n\r\n getExcludedValues() {\r\n const criterions = this.getExcludedCriterion();\r\n const selected = [];\r\n const len = criterions.length;\r\n let i = 0;\r\n for (i = 0; i < len; i += 1) {\r\n selected.push(criterions[i].Criterion.Name);\r\n }\r\n return selected;\r\n }\r\n\r\n getSelectedString(arr) {\r\n let summary = '';\r\n if (arr.length > 1) {\r\n summary = `${arr[0]}, ${this.i18n.getString('CampaignImport_And')} ` +\r\n `${arr.length - 1} ${this.i18n.getString('Page_More')}`;\r\n } else {\r\n summary = `${arr[0]}`;\r\n }\r\n return summary;\r\n }\r\n\r\n getTargetedSummary() {\r\n const selected = this.getTargetedValues();\r\n const data = this.getSnapshot();\r\n let summary = '';\r\n\r\n if (data.length === 0) {\r\n summary = `${this.i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Target')}\r\n ${this.i18n.getString('Audience_Campaign_Target_Setting_Industry_Grid_Column_Industries')}`;\r\n } else if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Targeted')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n\r\n return summary;\r\n }\r\n\r\n getExcludedSummary() {\r\n const selected = this.getExcludedValues();\r\n let summary = '';\r\n\r\n if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Excluded')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n\r\n return summary;\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport pgrid from 'projection-grid';\r\nimport { paginationPlugin } from '@bingads-webui/projection-grid-pagination';\r\nimport { cloneDeep } from '@bingads-webui-universal/primitive-utilities';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport template from './search-based-target-grid-view-template.pug';\r\nimport paginationTemplate from './pagination-template.pug';\r\nimport * as targetTypes from './search-based-target-type';\r\n\r\n/**\r\n * Class for grid view for linkedin targets\r\n *\r\n * @class SearchBasedTargetGridViewPlacement\r\n * @extends {Backbone.View}\r\n */\r\nexport class SearchBasedTargetGridViewPlacement extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options object\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options = {}) {\r\n this.options = _.defaults(options, {\r\n level: 'adgroup',\r\n targetType: targetTypes.All,\r\n });\r\n\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.vm = {\r\n i18n: this.i18n,\r\n gridData: [],\r\n targetType: this.options.targetType,\r\n removeAllVisibleClass: 'hide',\r\n };\r\n\r\n this.grid = null;\r\n this.adUnitSelection = this.options.adUnitSelectionRef;\r\n this.triggerSearchViewRefreshRef = this.options.triggerSearchViewRefreshRef;\r\n }\r\n\r\n /**\r\n * Define events and event handlers for them.\r\n *\r\n * @readonly\r\n * @returns {Object} returns object defining events\r\n */\r\n get events() {\r\n return {};\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this.vm));\r\n\r\n this.initializeAndRenderGrid();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Event handler for criterion change\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n onCriterionChange() {\r\n this.refreshGridSource();\r\n const selectedData = this.adUnitSelection.current;\r\n if (_.isEmpty(selectedData)) {\r\n this.$(`.linked-in-target-grid-view.${this.options.targetType}`).addClass('hide');\r\n } else {\r\n this.$(`.linked-in-target-grid-view.${this.options.targetType}`).removeClass('hide');\r\n }\r\n if (this.triggerSearchViewRefreshRef.current) {\r\n this.triggerSearchViewRefreshRef.current();\r\n }\r\n }\r\n\r\n /**\r\n * Refreshes the grid source\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n refreshGridSource() {\r\n if (this.grid && this.grid.gridView) {\r\n const selectedData = this.adUnitSelection.current;\r\n this.gridData = cloneDeep(selectedData);\r\n this.grid.gridView.patch({\r\n dataSource: {\r\n data: this.gridData,\r\n },\r\n });\r\n }\r\n if (this.displayGrid && this.displayGrid.gridView) {\r\n this.displayGrid.gridView.patch({\r\n dataSource: {\r\n data: this.gridData,\r\n },\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Initializes and renders the grid\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n initializeAndRenderGrid() {\r\n this.commonGridConfig = {\r\n tableClasses: ['table', 'table--no-border', 'grid'],\r\n dataSource: {\r\n type: 'memory',\r\n data: [],\r\n primaryKey: 'Id',\r\n },\r\n rows: {\r\n bodyRows: [{\r\n type: 'data-rows',\r\n classes: ['linked-in-target-grid__area-row'],\r\n }],\r\n },\r\n events: {\r\n 'click .linked-in-target-grid__remove-col': e => this.removeSearchBasedTarget(e),\r\n },\r\n plugins: {\r\n pagination: {\r\n pageSize: this.isolated ? 5 : 10,\r\n availablePageSizes: this.isolated ? [5] : [10, 20, 50, 100],\r\n enableRandomPage: false,\r\n template: this.isolated ? paginationTemplate : undefined,\r\n pageNumberLabelText: this.i18n.getString('GridPage_Colon'),\r\n pageSizeText: this.i18n.getString('Grid_ShowRows'),\r\n totalPageCountText: this.i18n.getString('Grid_PageOf'),\r\n },\r\n },\r\n };\r\n\r\n const { gridConfig, gridConfigDisplay } = this.options;\r\n\r\n this.grid = pgrid.factory({ vnext: true })\r\n .use(paginationPlugin)\r\n .create(_.defaults(gridConfig, this.commonGridConfig));\r\n\r\n this.displayGrid = pgrid.factory({ vnext: true })\r\n .use(paginationPlugin)\r\n .create(_.defaults(gridConfigDisplay, this.commonGridConfig));\r\n\r\n // this.$('.target-grid').html(this.grid.gridView.render().el);\r\n this.$('.target-grid').html(this.displayGrid.gridView.render().el);\r\n\r\n // After initial creation, make the onCriterionChange to read from data\r\n this.onCriterionChange();\r\n }\r\n\r\n /**\r\n * Remove the targeted/excluded linked in target\r\n * @private\r\n * @param {object} e - event object\r\n *\r\n * @returns {Promise} - promise of destroying the linked in target\r\n */\r\n removeSearchBasedTarget(e) {\r\n e.stopPropagation();\r\n const targetId = _.result(this.grid.gridView.itemOfElement(e.target), 'Id');\r\n const selectedData = this.adUnitSelection.current;\r\n this.adUnitSelection.current = _.reject(selectedData, d => d.Id === targetId);\r\n this.onCriterionChange();\r\n }\r\n\r\n /**\r\n * Event handler for removing all linked in targets\r\n * @private\r\n *\r\n * @param {object} e - event object\r\n * @returns {Promise} - Promise of destroying target type\r\n */\r\n onRemoveAllTargets(e) {\r\n e.stopPropagation();\r\n\r\n this.adUnitSelection.current = [];\r\n this.onCriterionChange();\r\n }\r\n\r\n switchGrid() {\r\n this.$('.target-grid').empty().html(this.grid.gridView.render().el);\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { Treeview } from '@bingads-webui/treeview';\r\nimport { PlacementWithIds } from '../placement-setting';\r\nimport template from './search-view-template.pug';\r\n/**\r\n * Class for search view for linked in targets\r\n *\r\n * @class SearchView\r\n * @extends {Backbone.View}\r\n */\r\nexport class SearchView extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n * @param {Object} options - options object\r\n *\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = options;\r\n this.adUnitSelectionRef = options.adUnitSelectionRef;\r\n this.showExclusion = false;\r\n\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.targetedPlacementsIds = [];\r\n this.initializeSearchTree();\r\n\r\n this.refreshTargetedStates();\r\n this.refreshGrid = options.refreshGrid;\r\n this.triggerSearchViewRefreshRef = options.triggerSearchViewRefreshRef;\r\n this.triggerSearchViewRefreshRef.current = this.onCriterionChange.bind(this);\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n this.treeView.render();\r\n this.$('.search-result-view-container').append(this.treeView.$el);\r\n this.$('.search-result-view-container').addClass('hide');\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Event handler for target include action\r\n * @private\r\n *\r\n * @param {Object} data - criterion data\r\n * @returns {Promise} - Promise of handling onInclude event\r\n */\r\n onInclude(data) {\r\n // adunitSelectionRef is a reference to the adunit selection object\r\n const adUnitSelection = this.adUnitSelectionRef.current;\r\n adUnitSelection.push(data);\r\n this.adUnitSelectionRef.current = adUnitSelection;\r\n this.refreshTargetedStates();\r\n\r\n this.updateSearchResult();\r\n this.refreshGrid();\r\n }\r\n\r\n /**\r\n * Initializes the search tree by fetching the data\r\n *\r\n * @returns {Promise} - promise of creating a search tree instance\r\n */\r\n initializeSearchTree() {\r\n const treeData = this.processPlacementRowData(PlacementWithIds);\r\n const options = {\r\n i18n: this.i18n,\r\n actions: (() => {\r\n const actions = [];\r\n actions.push({\r\n title: this.i18n.getString('Audience_Campaign_Target_Setting_Include_Action'),\r\n callback: node => this.onInclude(node.data),\r\n });\r\n\r\n return actions;\r\n })(),\r\n setLeafState: (leafNodeData) => {\r\n const state = {\r\n shouldSetState: false,\r\n stateValue: '',\r\n };\r\n\r\n if (_.contains(this.targetedPlacementsIds, leafNodeData.Id)) {\r\n state.shouldSetState = true;\r\n state.stateValue = this.i18n.getString('Audience_Campaign_Target_Setting_Included_Status');\r\n }\r\n\r\n return state;\r\n },\r\n placeHolderText: this.i18n.getString('Audience_Campaign_Target_Setting_Placement_Search_Placeholder'),\r\n };\r\n\r\n this.treeView = new Treeview(treeData, options);\r\n }\r\n\r\n /**\r\n * Update the search result.\r\n *\r\n * @returns {undefined}\r\n */\r\n updateSearchResult() {\r\n if (this.treeView) {\r\n this.treeView.updateView();\r\n }\r\n }\r\n\r\n /**\r\n * Using the data from the MT, it populates the Criterion field to be saved\r\n *\r\n * @param {Array} data - array of data objects containing the information\r\n * @returns {Object} groupedTree - tree structured data\r\n */\r\n processPlacementRowData(data) {\r\n const groupedTree = {\r\n children: [],\r\n };\r\n\r\n _.each(data, (item) => {\r\n const node = {\r\n title: this.i18n.getString(item.Name),\r\n data: item,\r\n };\r\n\r\n if (!_.some(groupedTree.children, child => child.title === item.GroupName)) {\r\n groupedTree.children.push({\r\n title: item.GroupName,\r\n children: [],\r\n });\r\n }\r\n\r\n const groupToInsert = _.findWhere(groupedTree.children, { title: item.GroupName });\r\n\r\n groupToInsert.children.push(node);\r\n });\r\n\r\n return groupedTree;\r\n }\r\n\r\n /**\r\n * Event handler for criterion change\r\n * @private\r\n *\r\n * @returns {undefined}\r\n */\r\n onCriterionChange() {\r\n this.refreshTargetedStates();\r\n\r\n this.updateSearchResult();\r\n }\r\n\r\n /**\r\n * Refreses the trageted state in memory data by reading what is svaed in Intermediate\r\n *\r\n * @returns {undefined}\r\n */\r\n refreshTargetedStates() {\r\n const selectedData = this.adUnitSelectionRef.current;\r\n if (!selectedData) {\r\n this.targetedPlacementsIds = [];\r\n this.excludedPlacementsIds = [];\r\n return;\r\n }\r\n\r\n this.targetedPlacementsIds = _.map(selectedData, d => d.Id);\r\n }\r\n onEditTargetShowButtonClicked() {\r\n this.$('.search-result-view-container').removeClass('hide');\r\n }\r\n}\r\n","import React from 'react';\r\nimport _ from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport searchBasedTargetGridRemoveColumnTemplate from '../search-based-target-grid-remove-column-template.pug';\r\nimport searchBasedTargetGridStateTemplate from '../search-based-target-grid-state-template.pug';\r\nimport { SearchBasedTargetGridViewPlacement } from '../search-based-target-grid-view-placement';\r\nimport template from '../search-based-target-setting-template.pug';\r\nimport { SearchView } from './search-view/search-view';\r\n\r\nexport class PlacementTargetSetting extends Backbone.View {\r\n initialize(options) {\r\n this.options = options;\r\n this.showExclusion = false;\r\n this.i18nKeys = {\r\n titleKey: 'Audience_Campaign_Target_Setting_Placement_Title',\r\n helpKey: 'pop_BA_AdPlacements',\r\n descriptionKey: 'Audience_Campaign_Target_Setting_Placement_Description',\r\n };\r\n\r\n this.adUnitSelection = options.adUnitSelectionRef;\r\n const i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n const bingadsGridColumn = DependencyResolver.get('component/bingads-grid/shared/column');\r\n\r\n const industrySettingGridConfig = {\r\n columns: [\r\n bingadsGridColumn({\r\n name: 'isIncludedOrExcluded',\r\n title: '',\r\n template: () => searchBasedTargetGridStateTemplate({\r\n isIncluded: true,\r\n includedString: i18n.getString('Audience_Campaign_Target_Setting_Included_Status'),\r\n excludedString: i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status'),\r\n }),\r\n property: _.identity,\r\n }),\r\n bingadsGridColumn(_.extend({}, {\r\n i18n,\r\n name: 'name',\r\n title: 'placement',\r\n template: local => i18n.getString(local.value.Name),\r\n property: _.identity,\r\n })),\r\n bingadsGridColumn({\r\n name: 'removeAll',\r\n template: () => searchBasedTargetGridRemoveColumnTemplate({ i18n }),\r\n headClasses: ['linked-in-target-grid__remove-body'],\r\n bodyClasses: ['text-right'],\r\n }),\r\n ],\r\n };\r\n\r\n const industrySettingGridConfigDisplay = {\r\n columns: [\r\n bingadsGridColumn({\r\n name: 'isIncludedOrExcluded',\r\n title: '',\r\n template: () => searchBasedTargetGridStateTemplate({\r\n isIncluded: true,\r\n includedString: i18n.getString('Audience_Campaign_Target_Setting_Included_Status'),\r\n excludedString: i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status'),\r\n }),\r\n property: _.identity,\r\n }),\r\n bingadsGridColumn(_.extend({}, {\r\n i18n,\r\n name: 'name',\r\n title: 'placement',\r\n template: local => i18n.getString(local.value.Name),\r\n property: _.identity,\r\n })),\r\n ],\r\n };\r\n\r\n this.options.gridConfig = industrySettingGridConfig;\r\n this.options.gridConfigDisplay = industrySettingGridConfigDisplay;\r\n\r\n // This Ref is a ref to function that will later be assigned to by SearchView\r\n // so search View can be triggered to refresh when the grid is updated\r\n this.triggerSearchViewRefreshRef = React.createRef();\r\n this.options.triggerSearchViewRefreshRef = this.triggerSearchViewRefreshRef;\r\n // super.initialize(this.options);\r\n this.i18n = i18n;\r\n this.searchBasedTargetGridView = new SearchBasedTargetGridViewPlacement(this.options);\r\n this.options.refreshGrid = () => this.searchBasedTargetGridView.onCriterionChange();\r\n this.searchView = new SearchView(this.options);\r\n }\r\n\r\n onEditTargetShowButtonClicked() {\r\n if (this.searchView && this.searchView.onEditTargetShowButtonClicked) {\r\n this.searchView.onEditTargetShowButtonClicked();\r\n }\r\n this.switchGrid();\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n this.searchView.render();\r\n this.$('.linked-in-target-search-container').append(this.searchView.$el);\r\n\r\n this.searchBasedTargetGridView.render();\r\n this.$('.linked-in-target-grid-container').append(this.searchBasedTargetGridView.$el);\r\n this.$('.target-intent-header').addClass('hide');\r\n\r\n return this;\r\n }\r\n\r\n switchGrid() {\r\n this.$('.target-intent-header').removeClass('hide');\r\n this.searchBasedTargetGridView.switchGrid();\r\n }\r\n\r\n setDefaultCashbackPercent(percent) {\r\n this.searchView.setDefaultCashbackPercent(percent);\r\n }\r\n}\r\n","import React from 'react';\r\nimport Backbone from 'backbone';\r\nimport _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { PlacementDataMapping } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { PlacementTargetSetting } from './placement-target-setting';\r\nimport template from './placement-setting-template.pug';\r\n\r\nexport const PlacementWithIds = [\r\n {\r\n Id: 1,\r\n GroupName: 'Placement',\r\n Name: 'Games',\r\n Status: 'Active',\r\n adUnitIds: PlacementDataMapping.Games.adUnitIds,\r\n },\r\n {\r\n Id: 2,\r\n GroupName: 'Placement',\r\n Name: 'Home Pages',\r\n Status: 'Active',\r\n adUnitIds: PlacementDataMapping.HomePages.adUnitIds,\r\n },\r\n {\r\n Id: 3,\r\n GroupName: 'Placement',\r\n Name: 'Productivity',\r\n Status: 'Active',\r\n adUnitIds: PlacementDataMapping.Productivity.adUnitIds,\r\n },\r\n];\r\n\r\nexport class PlacementSetting extends Backbone.View {\r\n initialize(options) {\r\n this.isEditing = false;\r\n this.showExclusion = false;\r\n this.defaultBidAdjustment = null;\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n this.viewContext = options.viewContext || {};\r\n this.isFilterCriterionLevelAdGroup = options.isFilterCriterionLevelAdGroup;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n\r\n this.adUnitSelection = React.createRef();\r\n this.adUnitSelection.current = options.placementSelections || [];\r\n this.isEmpty = _.isEmpty(this.adUnitSelection.current);\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n // super.initialize(options);\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .edit-target-show-button': 'onEditTargetShowButtonClicked',\r\n };\r\n }\r\n\r\n onEditTargetShowButtonClicked() {\r\n this.$('.edit-target-show-button-container').addClass('hide');\r\n if (this.targetSelectionView && this.targetSelectionView.onEditTargetShowButtonClicked) {\r\n this.targetSelectionView.onEditTargetShowButtonClicked();\r\n }\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new PlacementTargetSetting({\r\n criterionType: this.criterionType,\r\n showBidOnlyNote: this.showBidOnlyNote,\r\n showExclusion: this.showExclusion,\r\n defaultBidAdjustment: this.defaultBidAdjustment,\r\n currentLevel: this.viewContext.level,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n viewContext: this.viewContext,\r\n isFilterCriterionLevelAdGroup: this.isFilterCriterionLevelAdGroup,\r\n adUnitSelectionRef: this.adUnitSelection,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return _TL_('Placements');\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_AdPlacements';\r\n }\r\n\r\n getSnapshot() {\r\n const selectedData = this.adUnitSelection.current;\r\n const adUnitIds = _.reduce(\r\n selectedData,\r\n (memo, val) => memo.concat(val.adUnitIds), []\r\n );\r\n\r\n if (_.isEmpty(adUnitIds)) {\r\n return null;\r\n }\r\n\r\n return adUnitIds.join(';');\r\n }\r\n\r\n getTargetedCriterion() {\r\n return this.adUnitSelection.current;\r\n }\r\n\r\n getExcludedCriterion() {\r\n return [];\r\n }\r\n\r\n getTargetedValues() {\r\n const criterions = this.getTargetedCriterion();\r\n const selected = [];\r\n const len = criterions.length;\r\n let i = 0;\r\n for (i = 0; i < len; i += 1) {\r\n selected.push(criterions[i].Name);\r\n }\r\n return selected;\r\n }\r\n getExcludedValues() {\r\n return [];\r\n }\r\n\r\n getSelectedString() {\r\n return '';\r\n }\r\n\r\n getTargetedSummary() {\r\n return '';\r\n }\r\n\r\n getExcludedSummary() {\r\n return '';\r\n }\r\n\r\n render() {\r\n this.$el.html(template(this));\r\n this.$('.criterion-setting-container').addClass('criterion-setting-Industry');\r\n\r\n if (this.targetSelectionView) {\r\n this.targetSelectionView.render();\r\n this.$('.target-selection-container').empty().append(this.targetSelectionView.$el);\r\n }\r\n return this;\r\n }\r\n}\r\n","/* eslint-disable no-param-reassign */\r\n/* eslint-disable max-len */\r\n\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\nimport Backbone from 'backbone';\r\nimport $ from 'jquery';\r\nimport { cloneDeep } from '@bingads-webui-universal/primitive-utilities';\r\nimport {\r\n AudienceCampaignErrorsView,\r\n createCriterion,\r\n ageSettingOptionsFactory,\r\n genderSettingOptionsFactory,\r\n deviceSettingOptions\r\n} from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport template from './template.pug';\r\n\r\n/**\r\n * CheckboxSelectionBase class that implements functionalities of selection controls,\r\n * where selected items are predefined and limited\r\n *\r\n * @class CheckboxSelectionBase\r\n * @extends {Backbone.View}\r\n */\r\nexport class CheckboxSelectionBase extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n *\r\n * @param {Object} options - options containing initializing information\r\n * @param {string} options.campaignId - current campaign ID\r\n * @param {string} options.adgroupId - current adGroup ID\r\n * @param {string} options.level - level of where where the control is used.\r\n * @param {Object} options.i18n - i18n loader used for this control.\r\n * @param {string} options.titleKey - i18n key used to get the title of the selection control\r\n * @param {string} options.descriptionKey\r\n * - i18n key used to get the description of the selection control\r\n * @param {Object} options.selections - selections used for the the selection control\r\n * @param {bool} options.isLiveUpdatedEnabled - changing selection updates the intermediate.\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.options = _.defaults(options, {\r\n campaignId: '',\r\n adgroupId: '',\r\n level: 'adGroup',\r\n });\r\n\r\n this.currentLevelTargetInfo = this.options.currentLevelTargetInfo;\r\n\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.titleKey = options.titleKey;\r\n this.helpKey = options.helpKey;\r\n this.descriptionKey = options.descriptionKey;\r\n this.errorsView = new AudienceCampaignErrorsView();\r\n this.selections = options.selections;\r\n\r\n this.hasSavedSelections = false;\r\n this.hasSavedNegSelections = options.savedNegSelections && options.savedNegSelections.length > 0;\r\n this.activityLogger = options.activityLogger;\r\n\r\n _.each(this.selections, (selection) => {\r\n selection.isSelected = false;\r\n\r\n // If there are existing selections, update the selection state\r\n if (options.savedSelections && options.savedSelections.length > 0) {\r\n this.hasSavedSelections = true;\r\n\r\n if (_.contains(options.savedSelections, selection.id)) {\r\n selection.isSelected = true; //eslint-disable-line\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Since checkbox can frequently change, we want to take the snapshot before\r\n * the user starts editing. So that we can compare the diff and update accordingly\r\n *\r\n * @returns {undefined}\r\n */\r\n saveSnapshot() {\r\n this.selectionsSnapshot = cloneDeep(this.selections);\r\n this.criterionsSnapshot\r\n = cloneDeep(this.currentLevelTargetInfo.getAllByType(this.options.criterionType));\r\n\r\n if (!this.hasSavedSelections) {\r\n this.onSelectAll();\r\n this.hasSavedSelections = true;\r\n }\r\n }\r\n\r\n /**\r\n * This function is called to update and save the criterion to the\r\n * audienceTargetInfo after the change is done.\r\n * The function compares the snapshot with the current state and either\r\n * delete or create criterions\r\n *\r\n * @returns {Promise} - Promise of updating the criterions.\r\n */\r\n updateCriterionDataAsync() {\r\n // go through the current selections, compare and return\r\n if (_.isEqual(this.selectionsSnapshot, this.selections)) {\r\n return Promise.resolve();\r\n }\r\n\r\n const updateTasks = [];\r\n _.each(this.selectionsSnapshot, (originalSelection, key) => {\r\n if (!originalSelection.isSelected && this.selections[key].isSelected) {\r\n // newly targeted, create a criterion\r\n const criterionToCreate = createCriterion(this.options.criterionType, key);\r\n\r\n const deleteAndCreateTask =\r\n this.deleteSameCriterionIfExistsAsync(criterionToCreate).then(() => this.currentLevelTargetInfo.createAsync(criterionToCreate));\r\n\r\n updateTasks.push(deleteAndCreateTask);\r\n } else if (originalSelection.isSelected && !this.selections[key].isSelected) {\r\n // criterion removed, delete a criterion\r\n const criterionToRemove = this.getSavedCriterionByKey(key);\r\n\r\n // After removing the Criterion, we need to create a NegativeTarget\r\n const deleteAndCreateTask =\r\n this.currentLevelTargetInfo.destroyAsync(criterionToRemove.Id).then(() => {\r\n const criterionToCreate = createCriterion(this.options.criterionType, key);\r\n criterionToCreate.CriterionType = `Negative${criterionToCreate.CriterionType}`;\r\n\r\n return this.currentLevelTargetInfo.createAsync(criterionToCreate);\r\n });\r\n\r\n updateTasks.push(deleteAndCreateTask);\r\n }\r\n });\r\n\r\n return Promise.resolve(updateTasks);\r\n }\r\n\r\n getConfigs() {\r\n return {\r\n Age: ageSettingOptionsFactory(true),\r\n Gender: genderSettingOptionsFactory(true),\r\n Device: deviceSettingOptions,\r\n };\r\n }\r\n\r\n /**\r\n * Age, Gender, and Device can have both Negative and Positive\r\n * When creating Positive when there is Negative, delete the negative and vise versa.\r\n *\r\n * @param {Object} criterion - criterion to compare\r\n * @returns {Promise} - promise of deleting the criterion\r\n */\r\n deleteSameCriterionIfExistsAsync(criterion) {\r\n const criterionsByType = this.currentLevelTargetInfo.getAllByType(criterion.Criterion.Type);\r\n const config = this.getConfigs();\r\n\r\n _.each(\r\n criterionsByType,\r\n (existingCriterion) => {\r\n const existingSelection =\r\n existingCriterion.Criterion[`${existingCriterion.Criterion.Type}Criterion`][config[existingCriterion.Criterion.Type].criterionTypeTarget];\r\n\r\n const currentSelection =\r\n criterion.Criterion[`${criterion.Criterion.Type}Criterion`][config[criterion.Criterion.Type].criterionTypeTarget];\r\n\r\n if (existingSelection === currentSelection) {\r\n return this.currentLevelTargetInfo.destroyAsync(existingCriterion.Id);\r\n }\r\n\r\n return Promise.resolve(true);\r\n }\r\n );\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n /**\r\n * This is a helper function that returns the criterion from the targetKey\r\n * @private\r\n *\r\n * @param {string} targetKey - used to identify the criterion.\r\n * @returns {object} - criterion object.\r\n */\r\n getSavedCriterionByKey(targetKey) {\r\n const criterionsSnapshotShallow\r\n = this.currentLevelTargetInfo.getAllByType(this.options.criterionType);\r\n\r\n return _.find(\r\n criterionsSnapshotShallow,\r\n criterion => criterion.Criterion[`${this.options.criterionType}Criterion`][`${this.options.criterionTypeTarget}`] === targetKey\r\n );\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n this.$('.errors-container').append(this.errorsView.render().$el);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Define events and event handlers for them.\r\n *\r\n * @readonly\r\n * @returns {Object} returns object defining events\r\n */\r\n get events() {\r\n return {\r\n 'click .select-all-button': 'onSelectAll',\r\n 'click :checkbox': 'onCheckboxClicked',\r\n };\r\n }\r\n\r\n // private funciton for handling select all event handler\r\n onSelectAll() {\r\n const shouldSelect = !this.isAllSelected();\r\n\r\n this.$(':checkbox').prop('checked', shouldSelect);\r\n _.each(this.selections, (selection) => {\r\n const targetSelection = selection;\r\n\r\n targetSelection.isSelected = shouldSelect;\r\n });\r\n\r\n this.onTargetUpdated();\r\n }\r\n\r\n setKeys(keys) {\r\n _.each(this.selections, (selection) => {\r\n if (_.contains(keys, selection.id)) {\r\n selection.isSelected = true;\r\n this.$(`#${selection.id}:checkbox`).prop('checked', true);\r\n } else {\r\n selection.isSelected = false;\r\n this.$(`#${selection.id}:checkbox`).prop('checked', false);\r\n }\r\n });\r\n this.onTargetUpdated();\r\n }\r\n\r\n // private function for checkbox clicked event handler.\r\n onCheckboxClicked(e) {\r\n const $target = $(e.target);\r\n const selected = $target.is(':checked');\r\n\r\n this.selections[$target[0].id].isSelected = selected;\r\n this.onTargetUpdated();\r\n }\r\n\r\n // private function returning boolean value indicating if all targets are selected.\r\n isAllSelected() {\r\n const states = _.pluck(this.selections, 'isSelected');\r\n const isAllSelected = _.every(states, state => state);\r\n\r\n return isAllSelected;\r\n }\r\n\r\n isNoneSelected() {\r\n const states = _.pluck(this.selections, 'isSelected');\r\n const isNoneSelected = _.every(states, state => !state);\r\n\r\n return isNoneSelected;\r\n }\r\n\r\n // private function for handling onTargetUpdated.\r\n onTargetUpdated() {\r\n if (this.activityLogger) {\r\n this.activityLogger.signal(`audienceCriterionSettingChanged: ${this.options.criterionType}`);\r\n }\r\n this.errorsView.removeErrors();\r\n\r\n if (this.isAllSelected()) {\r\n this.$('.select-all-button')\r\n .text(this.i18n.getString('Audience_Campaign_Target_Setting_Deselect_All_Label'));\r\n } else {\r\n this.$('.select-all-button')\r\n .text(this.i18n.getString('Audience_Campaign_Target_Setting_Select_All_Label'));\r\n if (this.isNoneSelected()) {\r\n this.errorsView.setErrorMessage(this.i18n.getString('Audience_Campaign_Target_Setting_No_Selection_Error'));\r\n }\r\n }\r\n\r\n if (this.options.isLiveUpdateEnabled) {\r\n this.updateCriterionDataAsync().then(() => {\r\n this.saveSnapshot();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Check if the control is in a valid state\r\n *\r\n * @returns {bool} - true if valid, false otherwise\r\n */\r\n validate() {\r\n return !this.isNoneSelected();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { ageSettingOptionsFactory } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { CheckboxSelectionBase } from '../checkbox-selection-base/view';\r\n\r\n/**\r\n * Class for setting age targets\r\n *\r\n * @class AgeTargetSetting\r\n * @extends {CheckboxSelectionBase}\r\n */\r\nexport class AgeTargetSetting extends CheckboxSelectionBase {\r\n /**\r\n * Initilizes the control with the pre-defined parameters.\r\n * @param {object} options - options containing viewContext\r\n *\r\n * @return {undefined}\r\n */\r\n initialize(options) {\r\n const isAudienceCampaign = _.result(options, 'isAudienceCampaign', true);\r\n const isSearchDSAShoppingAdgroupLevel = _.result(options, 'isSearchDSAShoppingAdgroupLevel', false);\r\n\r\n this.options = ageSettingOptionsFactory(isAudienceCampaign || isSearchDSAShoppingAdgroupLevel);\r\n _.extend(this.options, options);\r\n\r\n const selectedCriterions =\r\n this.options.currentLevelTargetInfo.getAllByType(this.options.criterionType);\r\n\r\n // Get only the positive targets\r\n const selectedPositiveCriterions = _.filter(\r\n selectedCriterions,\r\n criterion => criterion.CriterionType === 'Age'\r\n );\r\n\r\n let savedSelections = [];\r\n if (selectedPositiveCriterions.length > 0) {\r\n savedSelections = _.map(\r\n selectedPositiveCriterions,\r\n criterion => criterion.Criterion.AgeCriterion.Target\r\n );\r\n }\r\n\r\n const savedNegSelections = _.reduce(selectedCriterions, (memo, criterion) => {\r\n if (criterion.CriterionType === 'NegativeAge') {\r\n memo.push(criterion.Criterion.AgeCriterion.Target);\r\n }\r\n return memo;\r\n }, []);\r\n\r\n this.options.savedSelections = savedSelections;\r\n this.options.savedNegSelections = savedNegSelections;\r\n\r\n super.initialize(this.options);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { AgeTargetSetting } from './view';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\n\r\nexport class AgeCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.criterionType = 'Age';\r\n this.type = 'Age';\r\n this.isLiveUpdateEnabled = options.isLiveUpdateEnabled ? options.isLiveUpdateEnabled : false;\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.isAudienceCampaign = _.result(options, 'isAudienceCampaign', true);\r\n this.isSearchDSAShoppingAdgroupLevel = _.result(options, 'isSearchDSAShoppingAdgroupLevel', false);\r\n this.shouldValidate = this.isAudienceCampaign || this.isSearchDSAShoppingAdgroupLevel;\r\n this.isEditDisabled = !(this.isAudienceCampaign || this.isSearchDSAShoppingAdgroupLevel);\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.activityLogger = options.activityLogger;\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new AgeTargetSetting({\r\n isAudienceCampaign: this.isAudienceCampaign,\r\n isSearchDSAShoppingAdgroupLevel: this.isSearchDSAShoppingAdgroupLevel,\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n isLiveUpdateEnabled: this.isLiveUpdateEnabled,\r\n activityLogger: this.activityLogger,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Age_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_Age';\r\n }\r\n\r\n saveSnapshot() {\r\n this.targetSelectionView.saveSnapshot();\r\n }\r\n\r\n getSnapshot() {\r\n return this.targetSelectionView.options.selections;\r\n }\r\n\r\n get allSelections() {\r\n const snapshot = this.getSnapshot();\r\n\r\n const allSelections = [{\r\n id: snapshot.EighteenToTwentyFive.id,\r\n labelKey: snapshot.EighteenToTwentyFive.labelKey,\r\n isSelected: snapshot.EighteenToTwentyFive.isSelected,\r\n },\r\n {\r\n id: snapshot.TwentyFiveToThirtyFive.id,\r\n labelKey: snapshot.TwentyFiveToThirtyFive.labelKey,\r\n isSelected: snapshot.TwentyFiveToThirtyFive.isSelected,\r\n },\r\n {\r\n id: snapshot.ThirtyFiveToFifty.id,\r\n labelKey: snapshot.ThirtyFiveToFifty.id,\r\n isSelected: snapshot.ThirtyFiveToFifty.id,\r\n },\r\n {\r\n id: snapshot.FiftyToSixtyFive.id,\r\n labelKey: snapshot.FiftyToSixtyFive.labelKey,\r\n isSelected: snapshot.FiftyToSixtyFive.isSelected,\r\n },\r\n {\r\n id: snapshot.SixtyFiveAndAbove.id,\r\n labelKey: snapshot.SixtyFiveAndAbove.labelKey,\r\n isSelected: snapshot.SixtyFiveAndAbove.isSelected,\r\n },\r\n {\r\n id: snapshot.Unknown.id,\r\n labelKey: snapshot.Unknown.labelKey,\r\n isSelected: snapshot.Unknown.isSelected,\r\n }];\r\n return allSelections;\r\n }\r\n\r\n getSelectedCriterion() {\r\n const savedSelections = _.filter(\r\n this.getSnapshot(),\r\n criterion => criterion.isSelected\r\n );\r\n return savedSelections;\r\n }\r\n\r\n getSummary() {\r\n const selections = this.allSelections;\r\n const savedSelections = this.getSelectedCriterion();\r\n const total = selections.length;\r\n const totalSelected = savedSelections.length;\r\n let summary = '';\r\n let i = 0;\r\n if (total === totalSelected) {\r\n summary = this.i18n.getString('AgeRange_AllAges');\r\n } else if (totalSelected === 0) {\r\n summary = '';\r\n } else if (totalSelected > 0 && totalSelected < 4) {\r\n for (i = 0; i < totalSelected - 1; i += 1) {\r\n summary = `${summary + this.i18n.getString(savedSelections[i].labelKey)}, `;\r\n }\r\n summary = `${summary + this.i18n.getString(savedSelections[i].labelKey)}`;\r\n } else if (totalSelected > 3 && totalSelected < total) {\r\n for (i = 0; i < 2; i += 1) {\r\n summary = `${summary} ${this.i18n.getString(savedSelections[i].labelKey)}, `;\r\n }\r\n summary = `${summary} ${this.i18n.getString('CampaignImport_And')}\r\n ${totalSelected - i} ${this.i18n.getString('Page_More')}`;\r\n }\r\n\r\n return summary;\r\n }\r\n\r\n updateCriterionDataAsync() {\r\n return this.targetSelectionView.updateCriterionDataAsync();\r\n }\r\n\r\n validate() {\r\n const useCampaignSettings = this.levelToggle && this.levelToggle.viewModel && this.levelToggle.viewModel.state === 'on';\r\n return (this.shouldValidate && !(this.isSearchDSAShoppingAdgroupLevel && useCampaignSettings) && this.targetSelectionView ?\r\n this.targetSelectionView.validate() :\r\n true) &&\r\n super.validate();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { CheckboxSelectionBase } from '../checkbox-selection-base/view';\r\nimport { deviceSettingOptions } from './options';\r\n\r\n/**\r\n * Class for setting device targets.\r\n *\r\n * @class DeviceTargetSetting\r\n * @extends {CheckboxSelectionBase}\r\n */\r\nexport class DeviceTargetSetting extends CheckboxSelectionBase {\r\n /**\r\n * Initilizes the control with the pre-defined parameters.\r\n * @param {object} options - options containing viewContext\r\n *\r\n * @return {undefined}\r\n */\r\n initialize(options) {\r\n this.options = deviceSettingOptions;\r\n _.extend(this.options, options);\r\n\r\n const selectedCriterions =\r\n this.options.currentLevelTargetInfo.getAllByType(this.options.criterionType);\r\n\r\n let savedSelections = [];\r\n\r\n if (selectedCriterions.length > 0) {\r\n savedSelections = _.map(\r\n selectedCriterions,\r\n criterion => criterion.Criterion.DeviceCriterion.DeviceName\r\n );\r\n }\r\n\r\n this.options.savedSelections = savedSelections;\r\n\r\n // Since device setting is always targeted, and all types are targeted\r\n // We always save all the criterion for the first time.\r\n this.hasSavedBefore = false;\r\n\r\n super.initialize(this.options);\r\n }\r\n\r\n /**\r\n * Check if the selection control has any targetting setting.\r\n * DeviceTargetSetting should always be targeted all\r\n *\r\n * @returns {boolean} boolean value indicating if the control has target or not.\r\n */\r\n isTargeted() {\r\n return true;\r\n }\r\n}\r\n","import { DeviceTargetSetting } from './view';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\n\r\nexport class DeviceCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.criterionType = 'Device';\r\n this.type = 'Device';\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.isLiveUpdateEnabled = options.isLiveUpdateEnabled ? options.isLiveUpdateEnabled : false;\r\n this.isEditDisabled = true;\r\n this.activityLogger = options.activityLogger;\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new DeviceTargetSetting({\r\n viewContext: this.viewContext,\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n isLiveUpdateEnabled: this.isLiveUpdateEnabled,\r\n activityLogger: this.activityLogger,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Device_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_Device';\r\n }\r\n\r\n saveSnapshot() {\r\n this.targetSelectionView.saveSnapshot();\r\n }\r\n\r\n updateCriterionDataAsync() {\r\n return this.targetSelectionView.updateCriterionDataAsync();\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { genderSettingOptionsFactory } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { CheckboxSelectionBase } from '../checkbox-selection-base/view';\r\n\r\n/**\r\n * Class for setting gender targets.\r\n *\r\n * @class GenderTargetSetting\r\n * @extends {CheckboxSelectionBase}\r\n */\r\nexport class GenderTargetSetting extends CheckboxSelectionBase {\r\n /**\r\n * Initilizes the control with the pre-defined parameters.\r\n * @param {object} options - options containing viewContext\r\n *\r\n * @return {undefined}\r\n */\r\n initialize(options) {\r\n const isAudienceCampaign = _.has(options, 'isAudienceCampaign') ? options.isAudienceCampaign : true;\r\n\r\n this.options = genderSettingOptionsFactory(isAudienceCampaign);\r\n _.extend(this.options, options);\r\n\r\n const selectedCriterions =\r\n this.options.currentLevelTargetInfo.getAllByType(this.options.criterionType);\r\n\r\n // Get only the positive targets\r\n const selectedPositiveCriterions = _.filter(\r\n selectedCriterions,\r\n criterion => criterion.CriterionType === 'Gender'\r\n );\r\n\r\n let savedSelections = [];\r\n if (selectedPositiveCriterions.length > 0) {\r\n savedSelections = _.map(\r\n selectedPositiveCriterions,\r\n criterion => criterion.Criterion.GenderCriterion.Target\r\n );\r\n }\r\n\r\n this.options.savedSelections = savedSelections;\r\n\r\n super.initialize(this.options);\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { GenderTargetSetting } from './view';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\n\r\nexport class GenderCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.criterionType = 'Gender';\r\n this.type = 'Gender';\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.isLiveUpdateEnabled = options.isLiveUpdateEnabled ? options.isLiveUpdateEnabled : false;\r\n this.isAudienceCampaign = _.has(options, 'isAudienceCampaign') ? options.isAudienceCampaign : true;\r\n this.shouldValidate = this.isAudienceCampaign;\r\n this.isEditDisabled = !this.isAudienceCampaign;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.activityLogger = options.activityLogger;\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new GenderTargetSetting({\r\n isAudienceCampaign: this.isAudienceCampaign,\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n isLiveUpdateEnabled: this.isLiveUpdateEnabled,\r\n activityLogger: this.activityLogger,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Gender_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_Gender';\r\n }\r\n\r\n saveSnapshot() {\r\n this.targetSelectionView.saveSnapshot();\r\n }\r\n\r\n getSnapshot() {\r\n return this.targetSelectionView.selections;\r\n }\r\n\r\n get allSelections() {\r\n const snapshot = this.getSnapshot();\r\n\r\n const allSelections = [{\r\n id: snapshot.Female.id,\r\n labelKey: snapshot.Female.labelKey,\r\n isSelected: snapshot.Female.isSelected,\r\n },\r\n {\r\n id: snapshot.Male.id,\r\n labelKey: snapshot.Male.labelKey,\r\n isSelected: snapshot.Male.isSelected,\r\n },\r\n {\r\n id: snapshot.Unknown.id,\r\n labelKey: snapshot.Unknown.labelKey,\r\n isSelected: snapshot.Unknown.isSelected,\r\n }];\r\n return allSelections;\r\n }\r\n\r\n getSelectedCriterion() {\r\n const savedSelections = _.filter(\r\n this.allSelections,\r\n criterion => criterion.isSelected\r\n );\r\n return savedSelections;\r\n }\r\n\r\n getSummary() {\r\n const selections = this.allSelections;\r\n const savedSelections = this.getSelectedCriterion();\r\n const total = selections.length;\r\n const totalSelected = savedSelections.length;\r\n let summary = '';\r\n let i = 0;\r\n if (total === totalSelected) {\r\n summary = this.i18n.getString('Gender_AllGenders');\r\n } else if (totalSelected > 0) {\r\n for (i = 0; i < totalSelected - 1; i += 1) {\r\n summary = `${summary + this.i18n.getString(savedSelections[i].labelKey)}, `;\r\n }\r\n summary = `${summary + this.i18n.getString(savedSelections[i].labelKey)}`;\r\n }\r\n // Keep this commented for to archive for future cases.\r\n // else if (totalSelected > 3 && totalSelected < total) {\r\n // for (i = 0; i < 2; i += 1) {\r\n // summary = `${summary + this.i18n.getString(savedSelections[i].labelKey)}, `;\r\n // }\r\n // summary = `${summary} ${this.i18n.getString('CampaignImport_And')} $\r\n // {totalSelected - i} ${this.i18n.getString('Page_More')}`;\r\n // }\r\n\r\n return summary;\r\n }\r\n\r\n updateCriterionDataAsync() {\r\n return this.targetSelectionView.updateCriterionDataAsync();\r\n }\r\n\r\n validate() {\r\n return (this.shouldValidate && this.targetSelectionView ?\r\n this.targetSelectionView.validate() :\r\n true) &&\r\n super.validate();\r\n }\r\n}\r\n","import Backbone from 'backbone';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport template from './template.pug';\r\n\r\n/**\r\n * Class for setting audience targets\r\n *\r\n * @class AudienceTargetSetting\r\n * @extends {Backbone.View}\r\n */\r\nexport class AudienceTargetSetting extends Backbone.View {\r\n /**\r\n * Initializes the class.\r\n *\r\n * @param {object} options - options for initializing the control\r\n * @returns {undefined}\r\n */\r\n initialize(options) {\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n this.isTitleLabelHidden = options.isTitleLabelHidden;\r\n this.audienceTargetInfo = options.currentLevelTargetInfo;\r\n\r\n this.audienceAssociationView = this.audienceTargetInfo.aimAudienceAssociationView;\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template(this));\r\n\r\n this.$('.audience-association-view-container').html(this.audienceAssociationView.$el);\r\n\r\n return this;\r\n }\r\n\r\n reloadAudienceData(locationCriterionsData) {\r\n return this.audienceTargetInfo.reloadAudienceData(locationCriterionsData);\r\n }\r\n\r\n setOnAudiencesTargetChangeCallback(onAudiencesTargetChange) {\r\n this.audienceTargetInfo.setOnAudiencesTargetChangeCallback(onAudiencesTargetChange);\r\n }\r\n}\r\n","import Promise from 'bluebird';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { AudienceTargetSetting } from './view';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\n\r\nexport class AudienceCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.criterionType = 'Audience';\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new AudienceTargetSetting({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n });\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Audience_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_Audience';\r\n }\r\n\r\n getTargetedAudiences() {\r\n const data = this.getSnapshot();\r\n const selections = [];\r\n for (let i = 0; i < data.length; i += 1) {\r\n const targeted = data[i].Status;\r\n if (targeted === 'Active') {\r\n selections.push(data[i].Criterion.AudienceName);\r\n }\r\n }\r\n return selections;\r\n }\r\n\r\n getExcludedAudiences() {\r\n const data = this.getSnapshot();\r\n const selections = [];\r\n for (let i = 0; i < data.length; i += 1) {\r\n const excluded = data[i].Status;\r\n if (excluded === 'Excluded') {\r\n selections.push(data[i].Criterion.AudienceName);\r\n }\r\n }\r\n return selections;\r\n }\r\n\r\n getTargetedSummary() {\r\n const selected = this.getTargetedAudiences();\r\n const data = this.getSnapshot();\r\n let summary = '';\r\n if (data.length === 0) {\r\n summary = `${this.i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Target')}\r\n ${this.i18n.getString('Control_TabControl_AudiencesAssociation')}`;\r\n } else if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Targeted')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n return summary;\r\n }\r\n\r\n getExcludedSummary() {\r\n const selected = this.getExcludedAudiences();\r\n let summary = '';\r\n if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Excluded')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n return summary;\r\n }\r\n\r\n getSelectedString(arr) {\r\n const summary = `${arr.length} ${this.i18n.getString('Control_TabControl_AudiencesAssociation')}`;\r\n return summary;\r\n }\r\n\r\n getSnapshot() {\r\n return this.currentLevelTargetInfo.criterionsByType.Audience;\r\n }\r\n\r\n reloadAudienceData(locationCriterionsData) {\r\n if (this.targetSelectionView) {\r\n return this.targetSelectionView.reloadAudienceData(locationCriterionsData);\r\n }\r\n\r\n return Promise.resolve(false);\r\n }\r\n\r\n setOnAudiencesTargetChangeCallback(onAudiencesTargetChange) {\r\n if (this.targetSelectionView) {\r\n this.targetSelectionView.setOnAudiencesTargetChangeCallback(onAudiencesTargetChange);\r\n }\r\n }\r\n\r\n convertAudienceMTCriterion(criterion, configSettings) {\r\n let tgt = null;\r\n const id = criterion.Criterion.AudienceId;\r\n const isExcluded = (criterion.Status === 'Excluded');\r\n\r\n let searchObj;\r\n\r\n if (id) {\r\n for (let i = 0; i < configSettings.length; i += 1) {\r\n searchObj = configSettings[i];\r\n const searchTgt = !isExcluded ?\r\n searchObj.associationAllItems : searchObj.exclusionAllItems;\r\n tgt = searchTgt.find(a => a.Id === id);\r\n if (tgt != null) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!searchObj || tgt == null) {\r\n return;\r\n }\r\n\r\n const existingItems = isExcluded ?\r\n searchObj.exclusion.selectedLists() : searchObj.targeting.selectedLists();\r\n if (existingItems && tgt) {\r\n const ifContains = existingItems.find(a => a.Id === tgt.Id);\r\n if (!ifContains) {\r\n existingItems.push(tgt);\r\n if (!isExcluded) {\r\n searchObj.targeting.selectedLists(existingItems);\r\n } else {\r\n searchObj.exclusion.selectedLists(existingItems);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport Promise from 'bluebird';\r\n\r\nconst isMapLoaded = () => !(_.isUndefined(window.Microsoft)\r\n || _.isUndefined(window.Microsoft.Maps)\r\n || _.isUndefined(window.Microsoft.Maps.Color)\r\n || _.isUndefined(window.Microsoft.Maps.loadModule));\r\n\r\nconst injectScript = (src, resolve) => {\r\n const checkMapLoaded = () => {\r\n if (isMapLoaded()) {\r\n resolve();\r\n } else {\r\n _.delay(checkMapLoaded, 100);\r\n }\r\n };\r\n\r\n const script = document.createElement('script');\r\n\r\n script.type = 'text/javascript';\r\n script.async = true;\r\n script.src = src;\r\n script.onload = checkMapLoaded;\r\n script.onerror = (e) => {\r\n /* eslint-disable no-console */\r\n console.error('Failed to load map', e);\r\n resolve(e);\r\n };\r\n\r\n const node = document.getElementsByTagName('script')[0];\r\n\r\n node.parentNode.insertBefore(script, node);\r\n};\r\n\r\n\r\nexport const loadMap = _.memoize(() => new Promise((resolve, reject) => {\r\n if (isMapLoaded()) {\r\n resolve();\r\n } else {\r\n injectScript('https://www.bing.com/api/maps/mapcontrol', resolve, reject);\r\n }\r\n}));\r\n","import _ from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { getCampaignType } from '@bingads-webui-campaign/audience-campaign-shared';\r\nimport { loadMap } from './load-location-map';\r\nimport template from './template.pug';\r\n\r\n/**\r\n * Class for Location target setting\r\n *\r\n * @class LocationTargetSetting\r\n * @extends {Backbone.View}\r\n */\r\nexport class LocationTargetSetting extends Backbone.View {\r\n initialize(options) {\r\n this.options = options;\r\n this.viewContext = this.options.viewContext;\r\n\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n this.defaultCashbackPercent = options.defaultCashbackPercent;\r\n this.currentLevelTargetInfo = this.options.currentLevelTargetInfo;\r\n }\r\n\r\n get isAudienceCampaign() {\r\n return getCampaignType(this.viewContext.currentCampaign) === 'audience';\r\n }\r\n\r\n /**\r\n * Renders the view\r\n *\r\n * @returns {View} returns the view itself\r\n */\r\n render() {\r\n this.$el.html(template());\r\n\r\n if (!this.isAudienceCampaign) {\r\n return this;\r\n }\r\n\r\n const jsdata = DependencyResolver.get('component/js-data-campaign/index');\r\n\r\n // refresh the intermediate data when rendering a new location target instance\r\n this.locationTargetsViewPromise =\r\n jsdata.Intermediate.refresh(this.currentLevelTargetInfo.resourceName, [])\r\n .then(() => loadMap())\r\n .then(() => {\r\n this.initializeLocationTargetsView();\r\n\r\n this.$('.location-setting-controller')\r\n .empty()\r\n .append(this.locationTargetsView.render().$el);\r\n });\r\n\r\n return this;\r\n }\r\n\r\n // private funciton used for initialziing location targets view.\r\n initializeLocationTargetsView() {\r\n if (!this.isAudienceCampaign) {\r\n return;\r\n }\r\n\r\n const LocationTargetsView = DependencyResolver.get('campaignui/feature/location-targets/view/locationTargets');\r\n\r\n const isSettingsScenario = _.contains(['adgroup-settings', 'campaign-settings'], this.options.scenario);\r\n\r\n const options = {\r\n level: this.viewContext.level,\r\n showPhysicalIntentView: false,\r\n targetOption: 'everywhere',\r\n campaignId: this.viewContext.currentCampaign ? this.viewContext.currentCampaign.Id : '',\r\n adgroupId: this.viewContext.currentAdGroup ? this.viewContext.currentAdGroup.Id : '',\r\n deps: this.options.deps || {},\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n defaultCashbackPercent: this.defaultCashbackPercent,\r\n isForVNext: this.options.deps ? this.options.deps.isNewUI : false,\r\n };\r\n\r\n if (isSettingsScenario) {\r\n // when campaign/adgroup-settings, pass scenario so that it can take of saving targets\r\n options.scenario = this.options.scenario;\r\n }\r\n\r\n if (this.options.scenario === 'adgroup-creation') {\r\n // Location control accepts adgroup-create as the scenario.\r\n options.scenario = 'adgroup-settings';\r\n }\r\n\r\n this.locationTargetsView = new LocationTargetsView(options);\r\n\r\n const eventDispatcher = DependencyResolver.get('component/event-dispatcher/index');\r\n\r\n eventDispatcher.on('level:changed', (level) => {\r\n const isCampaignLevel = level === 'campaign';\r\n\r\n this.currentLevelTargetInfo.setParentLevelToggle('Radius', isCampaignLevel);\r\n this.currentLevelTargetInfo.setParentLevelToggle('Location', isCampaignLevel);\r\n this.currentLevelTargetInfo.setParentLevelToggle('NegativeLocation', isCampaignLevel);\r\n }, this.locationTargetsView);\r\n\r\n // initialize with the default locations for setup\r\n if (!isSettingsScenario) {\r\n this.onLocationTargetOptionChanged(this.locationTargetsView.getValues().locations);\r\n\r\n this.locationTargetsView.on(\r\n 'locationTargetOptionChanged',\r\n locations => this.onLocationTargetOptionChanged(locations)\r\n );\r\n }\r\n }\r\n\r\n getCampaignLocationCriterions() {\r\n if (!this.isAudienceCampaign) {\r\n return [];\r\n }\r\n\r\n return this.locationTargetsView.campaignCriterions;\r\n }\r\n\r\n getAllLocations() {\r\n if (!this.isAudienceCampaign) {\r\n return {};\r\n }\r\n\r\n return this.locationTargetsView.getValues({\r\n level: this.viewContext.level,\r\n }, {\r\n keepAllLocations: true,\r\n });\r\n }\r\n\r\n /**\r\n * Get the data that is used for target setting.\r\n *\r\n * @returns {Object} - object containing target data.\r\n */\r\n getData() {\r\n if (!this.isAudienceCampaign) {\r\n return {};\r\n }\r\n\r\n return this.locationTargetsView.getValues({\r\n level: this.viewContext.level,\r\n });\r\n }\r\n\r\n /**\r\n * Event handler for location target option changed\r\n *\r\n * @private\r\n * @param {array} locations - array of locations\r\n * @returns {Promise} - Promise of handling target option change\r\n */\r\n onLocationTargetOptionChanged(locations) {\r\n const destoryTasks = [];\r\n destoryTasks.push(this.currentLevelTargetInfo.destroyTargetTypeAsync('Radius'));\r\n destoryTasks.push(this.currentLevelTargetInfo.destroyTargetTypeAsync('Location'));\r\n destoryTasks.push(this.currentLevelTargetInfo.destroyTargetTypeAsync('NegativeLocation'));\r\n\r\n return Promise.all(destoryTasks).then(() => {\r\n _.each(\r\n locations,\r\n location => this.currentLevelTargetInfo.createAsync(location)\r\n );\r\n });\r\n }\r\n\r\n reloadLocationView(audienceTargets) {\r\n if (this.locationTargetsView) {\r\n this.locationTargetsView.reloadLocationView(audienceTargets);\r\n }\r\n }\r\n}\r\n","import { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { LocationTargetSetting } from './view';\r\nimport { AudienceCriterionSettingBase } from '../../audience-criterion-setting-base';\r\n\r\nexport class LocationCriterionSetting extends AudienceCriterionSettingBase {\r\n initialize(options) {\r\n this.currentLevelTargetInfo = options.currentLevelTargetInfo;\r\n this.criterionTypes = ['Location', 'Radius'];\r\n this.viewContext = options.viewContext;\r\n this.scenario = options.scenario;\r\n this.deps = options.deps || {};\r\n this.supportCashbackSettings = options.supportCashbackSettings;\r\n this.i18n = DependencyResolver.get('component/i18n/loader!campaignui/feature/audience-campaign');\r\n\r\n if (options.showTargetSelection) {\r\n this.initializeTargetSelectionView();\r\n }\r\n\r\n super.initialize(options);\r\n }\r\n\r\n initializeTargetSelectionView() {\r\n this.targetSelectionView = new LocationTargetSetting({\r\n currentLevelTargetInfo: this.currentLevelTargetInfo,\r\n viewContext: this.viewContext,\r\n scenario: this.scenario,\r\n deps: this.deps,\r\n supportCashbackSettings: this.supportCashbackSettings,\r\n });\r\n }\r\n\r\n validate() {\r\n if (!super.validate()) {\r\n return false;\r\n }\r\n if (this.targetSelectionView && this.targetSelectionView.locationTargetsView) {\r\n return this.targetSelectionView.locationTargetsView.viewmodel.validate('AdGroupCriterion');\r\n }\r\n return true;\r\n }\r\n\r\n getCampaignLocationCriterions() {\r\n return this.targetSelectionView ? this.targetSelectionView.getCampaignLocationCriterions() : [];\r\n }\r\n\r\n getAllLocations() {\r\n return this.targetSelectionView ? this.targetSelectionView.getAllLocations() : {};\r\n }\r\n\r\n getData() {\r\n return this.targetSelectionView ? this.targetSelectionView.getData() : {};\r\n }\r\n\r\n reloadLocationView(audienceTargets) {\r\n if (this.targetSelectionView) {\r\n this.targetSelectionView.reloadLocationView(audienceTargets);\r\n }\r\n }\r\n\r\n get titleKey() {\r\n return 'Audience_Campaign_Target_Setting_Location_Title';\r\n }\r\n\r\n get helpKey() {\r\n return 'pop_BA_CampaignCreate_AudTargets_Location';\r\n }\r\n\r\n getSnapshot() {\r\n return this.targetSelectionView.currentLevelTargetInfo.criterionsByType.Location;\r\n }\r\n\r\n getRadiusLocations() {\r\n return this.targetSelectionView.currentLevelTargetInfo.criterionsByType.Radius;\r\n }\r\n\r\n getTargetedLocations() {\r\n const data = this.getSnapshot();\r\n const radiusData = this.getRadiusLocations();\r\n const selections = [];\r\n\r\n for (let i = 0; i < data.length; i += 1) {\r\n const targeted = data[i].CriterionType;\r\n const isSelected = data[i].SelectionStatus;\r\n if (isSelected === 'Included' && targeted === 'Location') {\r\n selections.push(data[i].Criterion.LocationCriterion.Name);\r\n }\r\n }\r\n\r\n for (let i = 0; i < radiusData.length; i += 1) {\r\n const targeted = radiusData[i].CriterionType;\r\n if (targeted === 'Radius') {\r\n selections.push(radiusData[i].Criterion.RadiusCriterion.Name);\r\n }\r\n }\r\n\r\n return selections;\r\n }\r\n\r\n getExcludedLocations() {\r\n const data = this.getSnapshot();\r\n const selections = [];\r\n\r\n for (let i = 0; i < data.length; i += 1) {\r\n const excluded = data[i].CriterionType;\r\n if (excluded === 'NegativeLocation') {\r\n selections.push(data[i].Criterion.LocationCriterion.Name);\r\n }\r\n }\r\n\r\n return selections;\r\n }\r\n\r\n getSummary() {\r\n const data = this.getSnapshot();\r\n let summary = '';\r\n if (data.length === 0) {\r\n summary = this.i18n.getString('Location_Target_Options_Everywhere');\r\n }\r\n return summary;\r\n }\r\n\r\n getTargetedSummary() {\r\n const selected = this.getTargetedLocations();\r\n const data = this.getSnapshot();\r\n\r\n let summary = '';\r\n if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Targeted')}: `;\r\n summary += this.getSelectedString(selected);\r\n } else if (data.length === 0) {\r\n summary = this.i18n.getString('Location_Target_Options_Everywhere');\r\n }\r\n\r\n return summary;\r\n }\r\n\r\n getExcludedSummary() {\r\n const selected = this.getExcludedLocations();\r\n let summary = '';\r\n if (selected.length !== 0) {\r\n summary = `${this.i18n.getString('AudienceDashboard_Excluded')}: `;\r\n summary += this.getSelectedString(selected);\r\n }\r\n\r\n return summary;\r\n }\r\n\r\n getSelectedString(arr) {\r\n let summary = '';\r\n if (arr.length > 1) {\r\n summary = `${arr[0]}, ${this.i18n.getString('CampaignImport_And')} ` +\r\n `${arr.length - 1} ${this.i18n.getString('Page_More')}`;\r\n } else {\r\n summary = `${arr[0]}`;\r\n }\r\n return summary;\r\n }\r\n\r\n resetSupportCashbackSettings(supportCashbackSettings, inheritInfo) {\r\n if (this.targetSelectionView) {\r\n this.targetSelectionView.supportCashbackSettings = supportCashbackSettings;\r\n const { locationTargetsView } = this.targetSelectionView;\r\n if (locationTargetsView) {\r\n locationTargetsView.toggleCashbackPercentColumns(supportCashbackSettings, inheritInfo);\r\n }\r\n } else {\r\n super.resetSupportCashbackSettings(supportCashbackSettings, inheritInfo);\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport { cloneDeep } from '@bingads-webui-universal/primitive-utilities';\r\nimport { DependencyResolver } from '@bingads-webui-campaign/dependency-resolver';\r\nimport { criterionHelper, typeMapping } from '@bingads-webui-campaign/audience-campaign-shared';\r\n\r\n/**\r\n * AudienceTargetInfo class which acts as a cache and data layer\r\n * for the targeting information\r\n * This class never is an intermediate layer that only maintains its cache\r\n *\r\n * @extends {Backbone.View}\r\n */\r\nexport class AudienceTargetInfo extends Backbone.View {\r\n /**\r\n * Initializes the audience target info class\r\n *\r\n * @param {string} resourceName - resource name, which can be either\r\n * AdGroupCriterion or CampaignCriterion\r\n * @param {bool} isShoppingCampaign - if it is shopping campaign or not.\r\n * @param {bool} listenToLocationCriterion - if listen to location criterion or not.\r\n * @param {function} customizedTemplates - association view templates.\r\n * @param {bool} useLocationControl - if location control needs to be used or not.\r\n * @param {bool} initAudienceAssociationView - if init audience association view or not.\r\n * @returns {undefined}\r\n */\r\n initialize({\r\n resourceName,\r\n isShoppingCampaign = false,\r\n listenToLocationCriterion = true,\r\n customizedTemplates = {},\r\n useLocationControl = true,\r\n initAudienceAssociationView = true,\r\n deps = {},\r\n isForVNext = false,\r\n perfMarker = null,\r\n isAudienceCreationWorkflow = false,\r\n isFromAudienceDashboard = false,\r\n permissions,\r\n }) {\r\n this.jsdata = DependencyResolver.get('component/js-data-campaign/index');\r\n this.resourceName = resourceName;\r\n this.listenToLocationCriterion = listenToLocationCriterion;\r\n this.useLocationControl = useLocationControl;\r\n this.deps = deps;\r\n this.isForVNext = isForVNext;\r\n this.perfMarker = perfMarker;\r\n // To avoid the conflict with negative ID from jsdata.Intermediate\r\n this.currentVirtualId = -1000000;\r\n this.Enable1PPlacementTargeting = permissions && permissions.dynamic && permissions.Enable1PPlacementTargeting;\r\n\r\n if (initAudienceAssociationView) {\r\n let audiencePerfMarker = null;\r\n if (this.perfMarker) {\r\n audiencePerfMarker = this.perfMarker.createChild('AudienceAssociationView', { autoEnd: true });\r\n audiencePerfMarker.willFetchFile();\r\n }\r\n const AimAudienceAssociationView\r\n = DependencyResolver.get('campaignui/feature/audience/association/view/aim-component-view');\r\n\r\n this.audienceAssociationView = new AimAudienceAssociationView({\r\n isShoppingCampaign,\r\n customizedTemplates,\r\n deps,\r\n isForVNext,\r\n perfMarker: audiencePerfMarker,\r\n isAudienceCreationWorkflow,\r\n isFromAudienceDashboard,\r\n });\r\n this.audienceAssociationView.render();\r\n this.listenTo(\r\n this.audienceAssociationView,\r\n 'selectionChanged', () => this.onAudienceSelectionChangedAsync()\r\n );\r\n }\r\n\r\n this.criterionsByType =\r\n _.reduce(typeMapping, (memo, value) => _.extend(memo, { [value]: [] }), {});\r\n this.parentLevelTogglesByType =\r\n _.reduce(typeMapping, (memo, value) => _.extend(memo, { [value]: false }), {});\r\n\r\n if (listenToLocationCriterion) {\r\n this.onLocationCriterionChange();\r\n\r\n this.jsdata.Intermediate.subscribe(resourceName, () => this.onLocationCriterionChange());\r\n\r\n // Clear any un cleared Location Criterions\r\n this.jsdata.Intermediate.destroyAll(resourceName);\r\n }\r\n }\r\n\r\n reloadAudienceData(locationCriterionsData) {\r\n if (this.audienceAssociationView) {\r\n return this.audienceAssociationView.reloadAudienceData(locationCriterionsData);\r\n }\r\n return Promise.resolve(false);\r\n }\r\n\r\n setOnAudiencesTargetChangeCallback(onAudiencesTargetChange) {\r\n if (this.audienceAssociationView) {\r\n this.audienceAssociationView.onAudiencesTargetChange = onAudiencesTargetChange;\r\n }\r\n }\r\n\r\n /**\r\n * Set parent level toggle for a specific criterion type\r\n *\r\n * @public\r\n * @param {string} type - type of criterion\r\n * @param {bool} value - whether to use parent level setting\r\n * @returns {undefined}\r\n * @memberof AudienceTargetInfo\r\n */\r\n setParentLevelToggle(type, value) {\r\n if (!_.has(this.parentLevelTogglesByType, type)) {\r\n return;\r\n }\r\n\r\n this.parentLevelTogglesByType[type] = !!value;\r\n }\r\n\r\n getParentLevelToggle(type) {\r\n return this.parentLevelTogglesByType[type];\r\n }\r\n\r\n /**\r\n * Initialize with adgroup function\r\n *\r\n * @private\r\n * @param {string} campaignId - Id of campaign\r\n * @param {string} adGroupId - Id of adgroup\r\n * @returns {Promise} - promise of setting adgroup targets\r\n * @memberof AudienceTargetInfo\r\n */\r\n initializeWithAdGroupAsync(campaignId, adGroupId) {\r\n const audienceFetchCreationTask = this.fetchCriterions(campaignId, adGroupId);\r\n const audienceCriterionFetchCreationTask =\r\n this.initializeWithhAdGroupAudience(campaignId, adGroupId);\r\n\r\n return Promise.all([audienceCriterionFetchCreationTask, audienceFetchCreationTask]);\r\n }\r\n\r\n initializeWithhAdGroupAudience(campaignId, adGroupId) {\r\n const AimAudienceAssociationView\r\n = DependencyResolver.get('campaignui/feature/audience/association/view/aim-component-view');\r\n\r\n this.audienceAssociationView = new AimAudienceAssociationView({\r\n campaignId,\r\n adGroupId,\r\n deps: this.deps,\r\n isForVNext: this.isForVNext,\r\n });\r\n this.listenTo(\r\n this.audienceAssociationView,\r\n 'selectionChanged', () => this.onAudienceSelectionChangedAsync()\r\n );\r\n // audienceAssociationView needs to render in order to generate its list of associations\r\n this.audienceAssociationView.render();\r\n\r\n // const audienceCriterionFetchCreationTask =\r\n return this.fetchAdGroupAudienceCriterions(campaignId, adGroupId);\r\n }\r\n /**\r\n * Initialize with adgroup function\r\n *\r\n * @private\r\n * @param {string} campaignId - Id of campaign\r\n * @returns {Promise} - promise of setting targets\r\n * @memberof AudienceTargetInfo\r\n */\r\n initializeWithCampaignAsync(campaignId) {\r\n // Empty string for the adgroup.\r\n return this.fetchCriterions(campaignId, '');\r\n }\r\n\r\n get aimAudienceAssociationView() {\r\n return this.audienceAssociationView;\r\n }\r\n\r\n /**\r\n * Get the new virtual ID\r\n *\r\n * @returns {Number} - number of the ID\r\n */\r\n getNewVirtualId() {\r\n this.currentVirtualId -= 1;\r\n\r\n return this.currentVirtualId;\r\n }\r\n\r\n getSnapshot(supportCashbackSettings) {\r\n const criterions = _.values(typeMapping);\r\n const snapShot = cloneDeep(this.getAllComputedByTypes(criterions));\r\n\r\n // for linked-in targets, if there is nothing modified in bid step\r\n // the Criterion object will look like this { BidAdj: undefined, CashbackPercent: undefined }\r\n // this is not allowed for MT BulkUpsert API, so we need to set a default value manually\r\n if (supportCashbackSettings) {\r\n snapShot.forEach((target) => {\r\n const { Criterion } = target;\r\n\r\n if (Criterion && Criterion.CashbackPercent == null) {\r\n Criterion.CashbackPercent = -1;\r\n }\r\n });\r\n }\r\n\r\n return snapShot;\r\n }\r\n\r\n /**\r\n * Fetch Criterions and create them in intermediate cache\r\n * When 2nd parameter is empty, fetch Campaign Criterions\r\n * When 2nd parameter is not empty, fetch AdGroup Criterions\r\n *\r\n * @param {string} campaignId - campaign ID to load\r\n * @param {string} adGroupId - adGroup ID to load\r\n * @param {array|undefined} criterionsOverride - override the criterions to load\r\n * @param {bool} shouldFetchContextualTargets - should fetch ContextualTargets or not\r\n * @returns {Promise} - Promise to be completed\r\n */\r\n fetchCriterions(campaignId, adGroupId, criterionsOverride, shouldFetchContextualTargets) {\r\n const criterionLoader = DependencyResolver.get('campaignui/feature/base-targets/util/criterionLoader');\r\n const criterionsToLoad = criterionsOverride || _.compact([\r\n 'AgeCriterion',\r\n 'GenderCriterion',\r\n 'DeviceCriterion',\r\n 'CompanyNameCriterion',\r\n 'IndustryCriterion',\r\n 'JobFunctionCriterion',\r\n this.listenToLocationCriterion && 'LocationCriterion',\r\n shouldFetchContextualTargets && 'ContextualTarget',\r\n ]);\r\n\r\n return criterionLoader.load(campaignId, adGroupId, criterionsToLoad).then((criterions) => {\r\n const formattedCriterions = [];\r\n\r\n _.each(criterions, (loadedCriterionData) => {\r\n const formattedCriterion = criterionHelper.reformatFetchedCriterion(\r\n loadedCriterionData,\r\n campaignId,\r\n adGroupId\r\n );\r\n\r\n formattedCriterions.push(formattedCriterion);\r\n });\r\n\r\n return this.createMultipleAsync(formattedCriterions);\r\n });\r\n }\r\n\r\n /**\r\n * Fetch Audience AdGroup Criterions and create them in intermediate cache\r\n *\r\n * @returns {Promise} - Promise to be completed\r\n */\r\n fetchAdGroupAudienceCriterions() {\r\n return this.audienceAssociationView.ensureLoadedAsync()\r\n .then(() => this.onAudienceSelectionChangedAsync());\r\n }\r\n\r\n /**\r\n * Create criterion on jsdata\r\n *\r\n * @param {Object} criterion - criterion object\r\n * @returns {Promise} - promise of creating criterion\r\n */\r\n createAsync(criterion) {\r\n let createTask = Promise.resolve(true);\r\n\r\n if (_.has(this.criterionsByType, criterion.Criterion.Type)) {\r\n if (!criterion.Id) {\r\n /* eslint-disable no-param-reassign */\r\n criterion.Id = this.getNewVirtualId();\r\n }\r\n\r\n if (!(criterion.Criterion.Type === 'Audience' && _.contains(_.pluck(_.pluck(this.criterionsByType.Audience, 'Criterion'), 'AudienceName'), criterion.Criterion.AudienceName))) {\r\n this.criterionsByType[criterion.Criterion.Type].push(criterion);\r\n }\r\n\r\n if (this.useLocationControl &&\r\n this.isLocationTypeCriterionType(criterion.Criterion.Type)) {\r\n createTask = this.jsdata.Intermediate.create(this.resourceName, criterion);\r\n }\r\n\r\n return createTask.then(() => {\r\n this.trigger(`${this.resourceName}${criterion.Criterion.Type}Changed`);\r\n this.trigger(`${this.resourceName}Changed`);\r\n });\r\n }\r\n\r\n return Promise.resolve(true);\r\n }\r\n\r\n /**\r\n * Create criterions on jsdata\r\n *\r\n * @param {Array} criterions - array of criterion object\r\n * @returns {Promise} - promise of creating criterion\r\n */\r\n createMultipleAsync(criterions) {\r\n const locationCriterions = [];\r\n const updatedCriterionTypes =\r\n _.reduce(typeMapping, (memo, value) => _.extend(memo, { [value]: false }), {});\r\n\r\n _.each(criterions, (criterion) => {\r\n if (_.has(this.criterionsByType, criterion.Criterion.Type)) {\r\n if (!criterion.Id) {\r\n /* eslint-disable no-param-reassign */\r\n criterion.Id = this.getNewVirtualId();\r\n }\r\n\r\n this.criterionsByType[criterion.Criterion.Type].push(criterion);\r\n updatedCriterionTypes[criterion.Criterion.Type] = true;\r\n\r\n if (this.useLocationControl &&\r\n this.isLocationTypeCriterionType(criterion.Criterion.Type)) {\r\n locationCriterions.push(criterion);\r\n }\r\n }\r\n });\r\n\r\n let updateIntermediateTask = Promise.resolve(true);\r\n\r\n if (locationCriterions.length > 0) {\r\n updateIntermediateTask =\r\n this.jsdata.Intermediate.createMany(this.resourceName, locationCriterions);\r\n }\r\n\r\n return updateIntermediateTask.then(() => {\r\n _.each(updatedCriterionTypes, (isUpdated, criterionType) => {\r\n this.trigger(`${this.resourceName}${criterionType}Changed`);\r\n });\r\n\r\n this.trigger(`${this.resourceName}Changed`);\r\n });\r\n }\r\n\r\n /**\r\n * Update criterion on jsdata\r\n *\r\n * @param {Object} updatedCriterion - criterion object\r\n * @param {Boolean} noEvent - do not trigger change event\r\n * @returns {Promise} - promise of updating criterion\r\n */\r\n updateAsync(updatedCriterion, noEvent = false) {\r\n if (_.has(this.criterionsByType, updatedCriterion.Criterion.Type)) {\r\n const criterionGroupToUpdate = this.criterionsByType[updatedCriterion.Criterion.Type];\r\n\r\n _.extend(_.findWhere(\r\n criterionGroupToUpdate,\r\n {\r\n Id: updatedCriterion.Id,\r\n }\r\n ), updatedCriterion);\r\n\r\n return Promise.resolve().then(() => {\r\n if (!noEvent) {\r\n this.trigger(`${this.resourceName}${updatedCriterion.Criterion.Type}Changed`);\r\n this.trigger(`${this.resourceName}Changed`);\r\n }\r\n\r\n return true;\r\n });\r\n }\r\n\r\n return Promise.resolve(false);\r\n }\r\n\r\n fillCriterionsWithId(savedCriterions) {\r\n _.each(savedCriterions, (savedCriterion) => {\r\n if (!_.has(this.criterionsByType, savedCriterion.Criterion.Type) || !savedCriterion.Id) {\r\n return;\r\n }\r\n\r\n const criterionGroupToUpdate = this.criterionsByType[savedCriterion.Criterion.Type];\r\n const criterionToUpdate = _.find(criterionGroupToUpdate, c =>\r\n _.isEqual(c.Criterion, savedCriterion.Criterion));\r\n\r\n _.extend(criterionToUpdate, { Id: savedCriterion.Id });\r\n });\r\n }\r\n\r\n /**\r\n * Get all the target criterion\r\n *\r\n * @returns {array} - array of types\r\n */\r\n getAll() {\r\n return _.flatten(_.values(this.criterionsByType));\r\n }\r\n\r\n /**\r\n * Get all the target criterion with the matching type\r\n *\r\n * @param {string} type - string representation of the type\r\n * @returns {array} - array of types\r\n */\r\n getAllByType(type) {\r\n return this.criterionsByType[type];\r\n }\r\n\r\n /**\r\n * Get all the target criterion with the matching type\r\n *\r\n * @param {array} types - array of string representation of the type\r\n * @returns {array} - array of types\r\n */\r\n getAllByTypes(types) {\r\n let returnCriterions = [];\r\n\r\n _.each(\r\n types,\r\n // eslint-disable-next-line no-return-assign\r\n type => returnCriterions = returnCriterions.concat(this.criterionsByType[type])\r\n );\r\n\r\n return returnCriterions;\r\n }\r\n\r\n /**\r\n * Get all the computed target criterions with the matching types\r\n * If parentLevelToggle[aType] is set to true,\r\n * then all the criterions of aType would be set to deleted\r\n *\r\n * @param {array} types - array of string representation of the type\r\n * @returns {array} - array of types\r\n */\r\n getAllComputedByTypes(types) {\r\n let returnCriterions = [];\r\n\r\n _.each(\r\n types,\r\n (type) => {\r\n if (this.parentLevelTogglesByType[type]) {\r\n return;\r\n }\r\n returnCriterions = returnCriterions.concat(this.criterionsByType[type]);\r\n }\r\n );\r\n\r\n return returnCriterions;\r\n }\r\n\r\n getById(id) {\r\n const allCriterions = this.getAll();\r\n const criterionWithGivenId = _.find(allCriterions, criterion => criterion.Id === id);\r\n\r\n return criterionWithGivenId;\r\n }\r\n\r\n getAllNoneEmptyTypeKeys() {\r\n const noneEmptyTypeKeys = [];\r\n const criterionTypeKeys = _.keys(this.criterionsByType);\r\n\r\n _.each(criterionTypeKeys, (typeKey) => {\r\n if (this.criterionsByType[typeKey].length > 0) {\r\n noneEmptyTypeKeys.push(typeKey);\r\n }\r\n });\r\n\r\n return noneEmptyTypeKeys;\r\n }\r\n\r\n /**\r\n * Destroy the criterion target with the given id.\r\n *\r\n * @param {string} criterionId - Id of the target criterion\r\n * @returns {undefined}\r\n */\r\n destroyAsync(criterionId) {\r\n let destroyTask = Promise.resolve(true);\r\n let criterionTypeToChange;\r\n\r\n _.each(this.criterionsByType, (criterions) => {\r\n if (_.some(criterions, criterion => criterion.Id === criterionId)) {\r\n criterionTypeToChange = _.first(criterions).Criterion.Type;\r\n }\r\n });\r\n\r\n if (criterionTypeToChange) {\r\n this.criterionsByType[criterionTypeToChange] =\r\n _.reject(\r\n this.criterionsByType[criterionTypeToChange],\r\n criterion => criterion.Id === criterionId\r\n );\r\n }\r\n\r\n if (this.isLocationTypeCriterionType(criterionTypeToChange)) {\r\n destroyTask = this.jsdata.Intermediate.destroy(this.resourceName, criterionId);\r\n }\r\n\r\n return destroyTask.then(() => {\r\n this.trigger(\r\n `${this.resourceName}${criterionTypeToChange}Changed`,\r\n this.criterionsByType[criterionTypeToChange]\r\n );\r\n this.trigger(`${this.resourceName}Changed`);\r\n });\r\n }\r\n\r\n /**\r\n * Destroys all the saved criterion on Intermediate\r\n *\r\n * @returns {undefined}\r\n */\r\n destroyAllAsync() {\r\n const noneEmptyTypeKeys = this.getAllNoneEmptyTypeKeys();\r\n\r\n this.criterionsByType =\r\n _.reduce(typeMapping, (memo, value) => _.extend(memo, { [value]: [] }), {});\r\n\r\n return this.jsdata.Intermediate.destroyAll(this.resourceName).then(() => {\r\n _.each(noneEmptyTypeKeys, (typeKey) => {\r\n this.trigger(`${this.resourceName}${typeKey}Changed`, this.criterionsByType[typeKey]);\r\n this.trigger(`${this.resourceName}Changed`);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Destroys all the saved criterion on Intermediate with matching type\r\n *\r\n * @param {string} targetType - target type of the criterion\r\n * @returns {undefined}\r\n */\r\n destroyTargetTypeAsync(targetType) {\r\n const targetCriterions = this.criterionsByType[targetType];\r\n const destroyTasks = [];\r\n\r\n if (targetCriterions) {\r\n _.each(targetCriterions, (targetCriterion) => {\r\n destroyTasks.push(this.destroyAsync(targetCriterion.Id));\r\n });\r\n }\r\n\r\n return Promise.all(destroyTasks);\r\n }\r\n\r\n /**\r\n * Check if there is an audience remarketing list\r\n *\r\n * @returns {boolean} - true if it has remarketing list.\r\n */\r\n hasAudienceRemarketingList() {\r\n const audienceCriterions = this.getAllByType('Audience');\r\n const hasAudienceRemarketingList = _.any(audienceCriterions, audienceCriterion =>\r\n audienceCriterion.Criterion.AudienceType === 'Remessaging'\r\n || audienceCriterion.Criterion.AudienceType === 'Product'\r\n || audienceCriterion.Criterion.AudienceType === 'Custom'\r\n || audienceCriterion.Criterion.AudienceType === 'RemarketingSimilar');\r\n\r\n return hasAudienceRemarketingList;\r\n }\r\n\r\n /**\r\n * Check if it has Campaign Level Targets.\r\n * @param {string} criterionType - type of criterion\r\n * @returns {boolean} - true if it has Campaign Level Targets.\r\n */\r\n hasCampaignLevelTargets(criterionType) {\r\n return (\r\n this.getAllByType(criterionType).length <= 0 ||\r\n this.getAllByType(criterionType)[0].LevelOfDetails === 'Campaign' ||\r\n criterionType === 'Age' || criterionType === 'Gender' // Even if we have not set targets for age and gender\r\n // It has these 2 targets by default(view as campaign level targets)\r\n );\r\n }\r\n\r\n onAudienceSelectionChangedAsync() {\r\n const audiences = this.audienceAssociationView.getAudienceCriterion();\r\n\r\n // check if there are IMA audience inside\r\n if (this.audienceAssociationView && this.audienceAssociationView.onAudiencesTargetChange) {\r\n const IMAudience = _.chain(audiences)\r\n .filter(audience => audience &&\r\n audience.Criterion && audience.Criterion.AudienceType === 'InMarket')\r\n .map(audience => ({\r\n Level: 'AdGroup',\r\n AudienceCriterion: {\r\n AudienceId: audience.Criterion.AudienceId,\r\n },\r\n }))\r\n .value();\r\n\r\n this.audienceAssociationView.onAudiencesTargetChange({ value: IMAudience });\r\n }\r\n\r\n return this.destroyTargetTypeAsync('Audience').then(() => {\r\n const critionCreationTasks = [];\r\n\r\n _.each(audiences, (association) => {\r\n // Add CriterionType property\r\n const typePrefix = association.Status === 'Excluded' ? 'Negative' : '';\r\n\r\n association.CriterionType = `${typePrefix}${association.Criterion.AudienceType}`; //eslint-disable-line\r\n\r\n critionCreationTasks.push(this.createAsync(association));\r\n });\r\n\r\n return Promise.all(critionCreationTasks);\r\n });\r\n }\r\n\r\n /**\r\n * Event handler for criterion change\r\n * Criterion change only cares about the location critertions.\r\n * @private\r\n * @returns {undefined}\r\n */\r\n onLocationCriterionChange() {\r\n let criterions = _.clone(this.jsdata.Intermediate.getAll(this.resourceName));\r\n\r\n // Remove empty properties returned from jsdata.Intermediate\r\n criterions = _.map(criterions, criterion => _.pick(criterion, _.identity));\r\n\r\n const newCriterionsByType = {\r\n Location: [],\r\n Radius: [],\r\n NegativeLocation: [],\r\n };\r\n\r\n _.each(criterions, (criterion) => {\r\n newCriterionsByType[criterion.Criterion.Type].push(criterion);\r\n });\r\n\r\n const criterionTypeKeys = _.keys(newCriterionsByType);\r\n\r\n _.each(criterionTypeKeys, (typeKey) => {\r\n if (!_.isEqual(this.criterionsByType[typeKey], newCriterionsByType[typeKey])) {\r\n this.criterionsByType[typeKey] = newCriterionsByType[typeKey];\r\n\r\n this.trigger(`${this.resourceName}${typeKey}Changed`, this.criterionsByType[typeKey]);\r\n }\r\n });\r\n\r\n this.trigger(`${this.resourceName}Changed`);\r\n }\r\n\r\n getCampaignLocationCriterions() {\r\n const criterions = _.clone(this.jsdata.Intermediate.getAll('CampaignCriterion'));\r\n\r\n return _.filter(criterions, target => (\r\n target.CriterionType === 'Location' ||\r\n target.CriterionType === 'Radius' ||\r\n target.CriterionType === 'NegativeLocation'));\r\n }\r\n\r\n isLocationTypeCriterionType(criterionType) {\r\n return (\r\n criterionType === 'Location' ||\r\n criterionType === 'NegativeLocation' ||\r\n criterionType === 'Radius'\r\n );\r\n }\r\n\r\n /**\r\n * Get Effective Criterions, which will exclude age and gender criterions if they've all checked.\r\n * @returns {array} - Effective criterions\r\n */\r\n getEffectiveCriterions() {\r\n let criterions = this.getAll();\r\n if (!criterions || !criterions.length) {\r\n return [];\r\n }\r\n\r\n criterions = _.filter(criterions, target => (\r\n target.CriterionType !== 'Location' &&\r\n target.CriterionType !== 'Radius' &&\r\n target.CriterionType !== 'NegativeLocation'));\r\n if (!criterions || !criterions.length) {\r\n return [];\r\n }\r\n const AgeTargets = _.filter(criterions, target => (\r\n target.CriterionType === 'Age'));\r\n const GenderTargets = _.filter(criterions, target => (\r\n target.CriterionType === 'Gender'));\r\n const otherTargets = _.filter(criterions, target => (\r\n target.CriterionType !== 'Age' &&\r\n target.CriterionType !== 'Gender'));\r\n return ((AgeTargets.length === 6 && GenderTargets.length === 3) ||\r\n (AgeTargets.length === 0 && GenderTargets.length === 0)) ?\r\n otherTargets : criterions;\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 (i18n) {pug_html = pug_html + \"\\u003Cdiv class=\\\"audience-adgroup-creation-wizard-container\\\"\\u003E\\u003Ch1\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Adgroup_Wizard_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh1\\u003E\\u003Cdiv class=\\\"audience-adgroup-creation-wizard\\\"\\u003E\\u003C\\u002Fdiv\\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 (_TL_, collapseId, i18n, itemClassSelect, optTgtTgBtn) {pug_mixins[\"popupHelp\"] = pug_interp = function(popupId, ariaLabelContext, arialLabelText){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" type=\\\"helppopup\\\" style=\\\"z-index: 1\\\"\"+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\", (arialLabelText || 'Learn more') + ' ' + (ariaLabelContext || ''), true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv class=\\\"optimized-toggle-container\\\"\\u003E\\u003Cbutton\" + (\" class=\\\"btn btn-primary expand-btn\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"id\", optTgtTgBtn, true, true)+\" role=\\\"button\\\" data-toggle=\\\"collapse\\\"\"+pug.attr(\"data-target\", '#'+collapseId+'-toggle', true, true)+\" aria-expanded=\\\"true\\\"\"+pug.attr(\"aria-controls\", collapseId+'-toggle', true, true)) + \"\\u003E\\u003Cdiv class=\\\"target-header selection-item-button\\\"\\u003E\\u003Cp class=\\\"target-selection-title\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('OptimizedTargeting_Expand_SettingTitle')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fp\\u003E\";\npug_mixins[\"popupHelp\"]('pop_BA_PredictiveTargeting_OptimizedDisabled', i18n.getString(_TL_('Predictive targeting')), i18n);\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fbutton\\u003E\\u003Cdiv\" + (\" class=\\\"collapse in collapse-container\\\"\"+pug.attr(\"id\", collapseId+'-toggle', true, true)+\" aria-expanded=\\\"true\\\"\") + \"\\u003E\\u003Cdiv\" + (\" class=\\\"item-container\\\"\"+pug.attr(\"id\", itemClassSelect+'-toggle', true, true)) + \"\\u003E\\u003Cdiv class=\\\"optimized-toggle\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"_TL_\" in locals_for_with?locals_for_with._TL_:typeof _TL_!==\"undefined\"?_TL_:undefined,\"collapseId\" in locals_for_with?locals_for_with.collapseId:typeof collapseId!==\"undefined\"?collapseId:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"itemClassSelect\" in locals_for_with?locals_for_with.itemClassSelect:typeof itemClassSelect!==\"undefined\"?itemClassSelect:undefined,\"optTgtTgBtn\" in locals_for_with?locals_for_with.optTgtTgBtn:typeof optTgtTgBtn!==\"undefined\"?optTgtTgBtn: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, isNewUI, isShowDisclaimerBannerEnabled) {pug_html = pug_html + \"\\u003Cdiv class=\\\"audience-adgroup-settings-wizard-container\\\"\\u003E\";\nif (!isNewUI) {\npug_html = pug_html + \"\\u003Ch3\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Ad_Group_Settings_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003Chr\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"audience-adgroup-settings-container row\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Ch3\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Ad_Group_Targets_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003Chr\\u003E\\u003Cdiv class=\\\"target-setting-and-estimate-container\\\"\\u003E\\u003Cdiv class=\\\"audience-adgroup-targets-container col-sm-8\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"audience-reach-estimate-container col-sm-3\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"errors-container row\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (isShowDisclaimerBannerEnabled) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-info form-group page-alert\\\"\\u003E\\u003Cdiv class=\\\"alert-image\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"alert-info-inline\\\"\\u003E\" + (null == (pug_interp = i18n.getString('Targeting_Disclaimer')) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"action-buttons-container row\\\"\\u003E\\u003Cbutton class=\\\"btn btn-primary save-button\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Save_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fbutton\\u003E\\u003Cbutton class=\\\"btn btn-default cancel-button\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Cancel_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isNewUI\" in locals_for_with?locals_for_with.isNewUI:typeof isNewUI!==\"undefined\"?isNewUI:undefined,\"isShowDisclaimerBannerEnabled\" in locals_for_with?locals_for_with.isShowDisclaimerBannerEnabled:typeof isShowDisclaimerBannerEnabled!==\"undefined\"?isShowDisclaimerBannerEnabled: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=\\\"audience-advanced-target-settings\\\"\\u003E\\u003Ca class=\\\"toggle-edit-target-category\\\" href=\\\"javascript:void(0)\\\" role=\\\"button\\\" data-bind=\\\"attr: {"aria-expanded": isEditTargetCategoriesExpanded() ? "true" : "false"}\\\"\\u003E\\u003Cspan class=\\\"glyphicon glyphicon-pencil\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan\\u003E\\u003Cu\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Edit_Target_Categories')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fu\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"audience-target-selector-container\\\" style=\\\"display: none\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"audience-target-settings-container\\\"\\u003E\\u003Cdiv class=\\\"location-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"age-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"gender-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"device-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"audience-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"companyName-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"industry-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"jobFunction-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"placement-target-setting-container\\\"\\u003E\\u003C\\u002Fdiv\\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, options) {pug_html = pug_html + \"\\u003Cdiv class=\\\"bmc_redirect_page\\\"\\u003E\\u003Ch1 class=\\\"bmc_redirect_header\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('ShoppingCampaign_Header_Title')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fh1\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('ShoppingCampaign_NoBMCAccount_Message')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = ' ') ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Ca class=\\\"bmc_url_link\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('ShoppingCampaign_BmcURL_Text')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fa\\u003E\";\nif (options.isEnabledForDynamicFeedCampaign) {\npug_html = pug_html + \"\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = ' or ') ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Ca class=\\\"feed_url_link\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('AudienceShoppingCampaign_UploadFeed_Text')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fa\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"bmc_save_bar\\\"\\u003E\\u003Cinput\" + (\" class=\\\"btn-cancel btn btn-default\\\"\"+\" type=\\\"button\\\"\"+pug.attr(\"value\", i18n.getString('Audience_Campaign_Cancel_Label'), true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"options\" in locals_for_with?locals_for_with.options:typeof options!==\"undefined\"?options: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=\\\"audience-campaign-creation-wizard-container\\\"\\u003E\\u003Cdiv class=\\\"audience-campaign-creation-wizard\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\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 (Object, descriptionKey, i18n, selections) {\n\n\n\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"target-intent-header\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString(descriptionKey)) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Ca class=\\\"select-all-button\\\" href=\\\"javascript:void(0);\\\" type=\\\"button\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Deselect_All_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\nvar n=0\nvar keys=Object.keys(selections)\nwhile (n < keys.length) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"row\\\"\\u003E\\u003Cdiv class=\\\"col-sm-3\\\"\\u003E\";\nvar item = selections[keys[n]]\npug_html = pug_html + \"\\u003Clabel class=\\\"checkbox-inline\\\"\\u003E\\u003Cinput\" + (\" type=\\\"checkbox\\\"\"+pug.attr(\"id\", item.id, true, true)+pug.attr(\"checked\", item.isSelected, true, true)) + \"\\u003E\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString(item.labelKey)) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (++n < keys.length) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"col-sm-6\\\"\\u003E\";\nitem = selections[keys[n++]]\npug_html = pug_html + \"\\u003Clabel class=\\\"checkbox-inline\\\"\\u003E\\u003Cinput\" + (\" type=\\\"checkbox\\\"\"+pug.attr(\"id\", item.id, true, true)+pug.attr(\"checked\", item.isSelected, true, true)) + \"\\u003E\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString(item.labelKey)) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"row errors-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"Object\" in locals_for_with?locals_for_with.Object:typeof Object!==\"undefined\"?Object:undefined,\"descriptionKey\" in locals_for_with?locals_for_with.descriptionKey:typeof descriptionKey!==\"undefined\"?descriptionKey:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"selections\" in locals_for_with?locals_for_with.selections:typeof selections!==\"undefined\"?selections: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 (helpKey, hideTitleLabel, i18n, isAudienceCampaign, isEditDisabled, showBidAdjustment, showBidOnlyNote, showLevelToggle, showTargetOrBid, showTargetSelection, target, titleKey, viewContext) {pug_mixins[\"popupHelp\"] = pug_interp = function(popupId, ariaLabelContext, arialLabelText){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" type=\\\"helppopup\\\" style=\\\"z-index: 1\\\"\"+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\", (arialLabelText || 'Learn more') + ' ' + (ariaLabelContext || ''), true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\";\n};\npug_mixins[\"adGroupOverrideInformation\"] = pug_interp = function(target){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-info form-group adgroup-override-info\\\" role=\\\"alert\\\"\\u003E\\u003Cdiv class=\\\"alert-image\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"alert-info-inline\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Demographic_Targets_Override_Information_Line1', { target })) ? \"\" : pug_interp)) + \"\\u003Cbr\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Demographic_Targets_Override_Information_Line2', { target })) ? \"\" : pug_interp)) + \" \\u003Ca class=\\\"HelpTopic\\\" query=\\\"help:app54638\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Learn_more_link_text')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-horizontal criterion-setting-container\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Ch5\" + (pug.attr(\"class\", pug.classes([\"col-sm-2\",\"control-label\",hideTitleLabel ? 'hide' : 'show'], [false,false,true]), false, true)) + \"\\u003E\\u003Clabel\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString(titleKey)) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\";\npug_mixins[\"popupHelp\"](helpKey, i18n.getString(titleKey), i18n.getString('LearnMoreLinkText'));\npug_html = pug_html + \"\\u003C\\u002Fh5\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([hideTitleLabel ? 'col-sm-12' : 'col-sm-10'], [true]), false, true)) + \"\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"level-toggle-container\",showLevelToggle ? '' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003Cspan id=\\\"criterion-use-campaign-settings\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('LevelToggleLabel')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"level-toggle\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (showBidOnlyNote && showBidAdjustment) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"bid-only-note-container\\\"\\u003E\" + (null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Bid_Only_Note')) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nif (!isAudienceCampaign && isAudienceCampaign !== undefined && viewContext.level === 'adgroup') {\npug_mixins[\"adGroupOverrideInformation\"](target);\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"target-edit-container\\\"\\u003E\";\nif (!isEditDisabled) {\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"edit-target-show-button-container\",showTargetSelection && showBidAdjustment ? '' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003Cspan class=\\\"no-target-exist-edit-label\\\"\\u003E\\u003Cu\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_No_Target_Selected_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fu\\u003E\\u003C\\u002Fspan\\u003E\\u003Ca class=\\\"edit-target-show-button\\\" href=\\\"javascript:void(0);\\\"\\u003E\\u003Cu\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Edit_Target_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fu\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"target-selection-container\",showTargetSelection && !showBidAdjustment? '' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cbutton class=\\\"btn done-editing-target-button hide\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Done_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"bid-adjustment-grids-container\",showBidAdjustment ? '' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003Cdiv class=\\\"current-level-bid-adjustment-grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"parent-level-bid-adjustment-grid hide\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"bid-or-target-and-bid-selector\",showTargetOrBid ? '' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"helpKey\" in locals_for_with?locals_for_with.helpKey:typeof helpKey!==\"undefined\"?helpKey:undefined,\"hideTitleLabel\" in locals_for_with?locals_for_with.hideTitleLabel:typeof hideTitleLabel!==\"undefined\"?hideTitleLabel:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isAudienceCampaign\" in locals_for_with?locals_for_with.isAudienceCampaign:typeof isAudienceCampaign!==\"undefined\"?isAudienceCampaign:undefined,\"isEditDisabled\" in locals_for_with?locals_for_with.isEditDisabled:typeof isEditDisabled!==\"undefined\"?isEditDisabled:undefined,\"showBidAdjustment\" in locals_for_with?locals_for_with.showBidAdjustment:typeof showBidAdjustment!==\"undefined\"?showBidAdjustment:undefined,\"showBidOnlyNote\" in locals_for_with?locals_for_with.showBidOnlyNote:typeof showBidOnlyNote!==\"undefined\"?showBidOnlyNote:undefined,\"showLevelToggle\" in locals_for_with?locals_for_with.showLevelToggle:typeof showLevelToggle!==\"undefined\"?showLevelToggle:undefined,\"showTargetOrBid\" in locals_for_with?locals_for_with.showTargetOrBid:typeof showTargetOrBid!==\"undefined\"?showTargetOrBid:undefined,\"showTargetSelection\" in locals_for_with?locals_for_with.showTargetSelection:typeof showTargetSelection!==\"undefined\"?showTargetSelection:undefined,\"target\" in locals_for_with?locals_for_with.target:typeof target!==\"undefined\"?target:undefined,\"titleKey\" in locals_for_with?locals_for_with.titleKey:typeof titleKey!==\"undefined\"?titleKey:undefined,\"viewContext\" in locals_for_with?locals_for_with.viewContext:typeof viewContext!==\"undefined\"?viewContext: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=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"audience-association-view-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\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;pug_html = pug_html + \"\\u003Cdiv class=\\\"location-setting-controller\\\"\\u003E\\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 (i18n, isVisible, items, showExclusion) {pug_mixins[\"companyItemTemplate\"] = pug_interp = function(item){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-left\\\"\\u003E\\u003Cimg\" + (pug.attr(\"src\", item.logoUrl || 'https://static.licdn.com/sc/h/2274wx7bapao7ytcvp1wdxxvu', true, true)+pug.attr(\"alt\", item.name, true, true)+\" width=\\\"50px\\\" height=\\\"50px\\\"\") + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"company-name\\\"\\u003E\\u003Cdiv class=\\\"company-item-name\\\"\\u003E\" + (pug.escape(null == (pug_interp = item.name) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\nvar text = '';\nif(item.industry)\ntext = item.industry + '; ';\nif(item.size)\ntext += item.size + ' ' + i18n.getString('Audience_Campaign_Target_Setting_Company_Employee_Count');\npug_html = pug_html + \"\\u003Cdiv class=\\\"company-item-industry\\\"\\u003E\" + (pug.escape(null == (pug_interp = text) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"company-search-container\",isVisible ? 'show' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003Cdiv class=\\\"company-search-table\\\"\\u003E\";\n// iterate items\n;(function(){\n var $$obj = items;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var item = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"company-item-template\\\"\\u003E\";\nif (item.isIncluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right action-container\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Included_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse\nif (item.isExcluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right action-container\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right action-container\\\"\\u003E\\u003Ca\" + (\" class=\\\"company-search-include-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Include_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\nif (showExclusion) {\npug_html = pug_html + \"\\u003Cspan class=\\\"company-search-separator\\\"\\u003E|\\u003C\\u002Fspan\\u003E\\u003Ca\" + (\" class=\\\"company-search-exclude-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Exclude_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_mixins[\"companyItemTemplate\"](item);\npug_html = pug_html + \"\\u003Cdiv class=\\\"clearfix\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var item = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"company-item-template\\\"\\u003E\";\nif (item.isIncluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right action-container\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Included_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse\nif (item.isExcluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right action-container\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right action-container\\\"\\u003E\\u003Ca\" + (\" class=\\\"company-search-include-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Include_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\nif (showExclusion) {\npug_html = pug_html + \"\\u003Cspan class=\\\"company-search-separator\\\"\\u003E|\\u003C\\u002Fspan\\u003E\\u003Ca\" + (\" class=\\\"company-search-exclude-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Exclude_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_mixins[\"companyItemTemplate\"](item);\npug_html = pug_html + \"\\u003Cdiv class=\\\"clearfix\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\nif (items.length < 1) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"empty-result-message\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Company_Search_No_Result')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isVisible\" in locals_for_with?locals_for_with.isVisible:typeof isVisible!==\"undefined\"?isVisible:undefined,\"items\" in locals_for_with?locals_for_with.items:typeof items!==\"undefined\"?items:undefined,\"showExclusion\" in locals_for_with?locals_for_with.showExclusion:typeof showExclusion!==\"undefined\"?showExclusion: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=\\\"search-result-view-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"clearfix\\\"\\u003E\\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 (i18n, isVisible, items, showExclusion) {pug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"job-function-search-container\",isVisible ? 'show' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003Cdiv class=\\\"job-function-search-table\\\" role=\\\"listbox\\\"\\u003E\";\n// iterate items\n;(function(){\n var $$obj = items;\n if ('number' == typeof $$obj.length) {\n for (var index = 0, $$l = $$obj.length; index < $$l; index++) {\n var item = $$obj[index];\npug_html = pug_html + \"\\u003Cdiv\" + (\" class=\\\"job-function-item-template\\\"\"+\" role=\\\"option\\\"\"+pug.attr(\"tabindex\", index === 0 ? '0' : '-1', true, true)) + \"\\u003E\\u003Cdiv class=\\\"pull-left job-function-item-name\\\"\\u003E\" + (null == (pug_interp = item.name.replace(item.caseMatchedSearchTerm, '' + item.caseMatchedSearchTerm + '')) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\";\nif (item.isIncluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Included_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse\nif (item.isExcluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right\\\"\\u003E\\u003Ca\" + (\" class=\\\"job-function-search-include-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\" tabindex=\\\"-1\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Include_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\nif (showExclusion) {\npug_html = pug_html + \"\\u003Cspan class=\\\"job-function-search-separator\\\"\\u003E|\\u003C\\u002Fspan\\u003E\\u003Ca\" + (\" class=\\\"job-function-search-exclude-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\" tabindex=\\\"-1\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Exclude_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"clearfix\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var index in $$obj) {\n $$l++;\n var item = $$obj[index];\npug_html = pug_html + \"\\u003Cdiv\" + (\" class=\\\"job-function-item-template\\\"\"+\" role=\\\"option\\\"\"+pug.attr(\"tabindex\", index === 0 ? '0' : '-1', true, true)) + \"\\u003E\\u003Cdiv class=\\\"pull-left job-function-item-name\\\"\\u003E\" + (null == (pug_interp = item.name.replace(item.caseMatchedSearchTerm, '' + item.caseMatchedSearchTerm + '')) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\";\nif (item.isIncluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Included_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse\nif (item.isExcluded) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Excluded_Status')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"pull-right\\\"\\u003E\\u003Ca\" + (\" class=\\\"job-function-search-include-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\" tabindex=\\\"-1\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Include_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\nif (showExclusion) {\npug_html = pug_html + \"\\u003Cspan class=\\\"job-function-search-separator\\\"\\u003E|\\u003C\\u002Fspan\\u003E\\u003Ca\" + (\" class=\\\"job-function-search-exclude-link\\\"\"+\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"data-id\", item.id, true, true)+pug.attr(\"data-name\", item.name, true, true)+\" role=\\\"button\\\" tabindex=\\\"-1\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Exclude_Action')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv class=\\\"clearfix\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";\nif (items.length < 1) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"empty-result-message\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Job_Function_Search_No_Result')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isVisible\" in locals_for_with?locals_for_with.isVisible:typeof isVisible!==\"undefined\"?isVisible:undefined,\"items\" in locals_for_with?locals_for_with.items:typeof items!==\"undefined\"?items:undefined,\"showExclusion\" in locals_for_with?locals_for_with.showExclusion:typeof showExclusion!==\"undefined\"?showExclusion: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 (nextPageText, pageNumberLabelText, previousPageText, totalPageCountText) {pug_html = pug_html + \"\\u003Cform class=\\\"form-inline pagination-control\\\"\\u003E\\u003Cdiv class=\\\"pager\\\" data-bind=\\\"visible: pageCount() > 1\\\"\\u003E\\u003Cbutton\" + (\" class=\\\"btn btn-default btn-flat nav-button prev\\\"\"+\" data-bind=\\\"click: decPageNumber, enable: pageNumber() > 0\\\" type=\\\"button\\\"\"+pug.attr(\"aria-label\", previousPageText, true, true)) + \"\\u003E\\u003Cdiv class=\\\"glyphicon glyphicon-triangle-left\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fbutton\\u003E\\u003Cdiv class=\\\"text\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = pageNumberLabelText) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cinput\" + (\" class=\\\"form-control page-number-input\\\"\"+\" data-bind=\\\"value: pageNumberText, attr: { size: pageNumberSize, maxlength: pageNumberSize, disabled: !enableRandomPage() }\\\" type=\\\"text\\\"\"+pug.attr(\"aria-label\", pageNumberLabelText, true, true)) + \"\\u003E\\u003Cdiv class=\\\"text\\\"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = totalPageCountText) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cspan\\u003E \\u003C\\u002Fspan\\u003E\\u003Cspan data-bind=\\\"text: pageCount\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cbutton\" + (\" class=\\\"btn btn-default btn-flat nav-button next\\\"\"+\" data-bind=\\\"click: incPageNumber, enable: pageNumber() < pageCount() - 1\\\" type=\\\"button\\\"\"+pug.attr(\"aria-label\", nextPageText, true, true)) + \"\\u003E\\u003Cdiv class=\\\"glyphicon glyphicon-triangle-right\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fbutton\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fform\\u003E\";}.call(this,\"nextPageText\" in locals_for_with?locals_for_with.nextPageText:typeof nextPageText!==\"undefined\"?nextPageText:undefined,\"pageNumberLabelText\" in locals_for_with?locals_for_with.pageNumberLabelText:typeof pageNumberLabelText!==\"undefined\"?pageNumberLabelText:undefined,\"previousPageText\" in locals_for_with?locals_for_with.previousPageText:typeof previousPageText!==\"undefined\"?previousPageText:undefined,\"totalPageCountText\" in locals_for_with?locals_for_with.totalPageCountText:typeof totalPageCountText!==\"undefined\"?totalPageCountText: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 (helpKey, i18n, isEditing, isEmpty, titleKey) {pug_mixins[\"popupHelp\"] = pug_interp = function(popupId, ariaLabelContext, arialLabelText){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Ca\" + (\" class=\\\"helpbutton\\\"\"+\" type=\\\"helppopup\\\" style=\\\"z-index: 1\\\"\"+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\", (arialLabelText || 'Learn more') + ' ' + (ariaLabelContext || ''), true, true)) + \"\\u003E\\u003C\\u002Fa\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-horizontal criterion-setting-container\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Ch5 class=\\\"col-sm-2 control-label show\\\"\\u003E\\u003Clabel\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString(titleKey)) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\";\npug_mixins[\"popupHelp\"](helpKey, i18n.getString(titleKey), i18n.getString('LearnMoreLinkText'));\npug_html = pug_html + \"\\u003C\\u002Fh5\\u003E\\u003Cdiv class=\\\"col-sm-10\\\"\\u003E\\u003Cdiv class=\\\"target-edit-container\\\"\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"edit-target-show-button-container\",isEditing ? 'hide' : ''], [false,true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"no-target-exist-edit-label\",isEmpty ? '' : 'hide'], [false,true]), false, true)) + \"\\u003E\\u003Cu\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Microsoft_Advertising_Network')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fu\\u003E\\u003C\\u002Fspan\\u003E\\u003Ca class=\\\"edit-target-show-button\\\" href=\\\"javascript:void(0);\\\"\\u003E\\u003Cu\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Edit_Target_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fu\\u003E\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"target-selection-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"helpKey\" in locals_for_with?locals_for_with.helpKey:typeof helpKey!==\"undefined\"?helpKey:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isEditing\" in locals_for_with?locals_for_with.isEditing:typeof isEditing!==\"undefined\"?isEditing:undefined,\"isEmpty\" in locals_for_with?locals_for_with.isEmpty:typeof isEmpty!==\"undefined\"?isEmpty:undefined,\"titleKey\" in locals_for_with?locals_for_with.titleKey:typeof titleKey!==\"undefined\"?titleKey: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=\\\"search-result-view-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"clearfix\\\"\\u003E\\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 (i18n) {pug_html = pug_html + \"\\u003Cspan\" + (\" class=\\\"closeimage linked-in-target-grid__remove-col clickable\\\"\"+\" tabindex=\\\"0\\\" role=\\\"button\\\"\"+pug.attr(\"aria-label\", i18n.getString('Remove'), true, true)) + \"\\u003E\\u003C\\u002Fspan\\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 (excludedString, includedString, isExcluded, isIncluded) {if ((isExcluded)) {\npug_html = pug_html + \"\\u003Cspan class=\\\"statusExcluded_icon\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"targeting-status\\\"\\u003E\" + (pug.escape(null == (pug_interp = excludedString) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}\nelse\nif ((isIncluded)) {\npug_html = pug_html + \"\\u003Cspan class=\\\"statusEnabled_icon\\\"\\u003E\\u003C\\u002Fspan\\u003E\\u003Cspan class=\\\"targeting-status\\\"\\u003E\" + (pug.escape(null == (pug_interp = includedString) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\";\n}}.call(this,\"excludedString\" in locals_for_with?locals_for_with.excludedString:typeof excludedString!==\"undefined\"?excludedString:undefined,\"includedString\" in locals_for_with?locals_for_with.includedString:typeof includedString!==\"undefined\"?includedString:undefined,\"isExcluded\" in locals_for_with?locals_for_with.isExcluded:typeof isExcluded!==\"undefined\"?isExcluded:undefined,\"isIncluded\" in locals_for_with?locals_for_with.isIncluded:typeof isIncluded!==\"undefined\"?isIncluded: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, removeAllVisibleClass, targetType) {pug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"linked-in-target-grid-view\",\"hide\",targetType], [false,false,true]), false, true)) + \"\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"target-grid-remove-all-container\",removeAllVisibleClass], [false,true]), false, true)) + \"\\u003E\\u003Ca href=\\\"javascript:void(0)\\\" role=\\\"button\\\"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Company_Grid_Column_Remove_All')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"target-grid\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"removeAllVisibleClass\" in locals_for_with?locals_for_with.removeAllVisibleClass:typeof removeAllVisibleClass!==\"undefined\"?removeAllVisibleClass:undefined,\"targetType\" in locals_for_with?locals_for_with.targetType:typeof targetType!==\"undefined\"?targetType: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, i18nKeys, showBidOnlyNote) {pug_html = pug_html + \"\\u003Cdiv class=\\\"target-intent-header\\\"\\u003E\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString(i18nKeys.descriptionKey + (showBidOnlyNote ? '_Bid_Only' : ''))) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\nif (showBidOnlyNote) {\npug_html = pug_html + \"\\u003Cdiv\\u003E\" + (null == (pug_interp = i18n.getString('Audience_Campaign_Target_Setting_Bid_Only_Note')) ? \"\" : pug_interp) + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"linked-in-target-search-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"linked-in-target-grid-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"linked-in-excluded-grid-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"i18nKeys\" in locals_for_with?locals_for_with.i18nKeys:typeof i18nKeys!==\"undefined\"?i18nKeys:undefined,\"showBidOnlyNote\" in locals_for_with?locals_for_with.showBidOnlyNote:typeof showBidOnlyNote!==\"undefined\"?showBidOnlyNote: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=\\\"searchbox-container\\\"\\u003E\\u003Cdiv class=\\\"search-result-view-container\\\"\\u003E\\u003Cdiv class=\\\"search-result live-region sr-only\\\" role=\\\"status\\\" aria-live=\\\"polite\\\" aria-atomic\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\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 (Name, availableOptions, i18n, percentage, readonly, selectedOption, size) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-inline\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control\\\"\"+pug.attr(\"disabled\", readonly, true, true)+pug.attr(\"aria-label\", i18n.getString('BidAdjustment_Options'), true, true)) + \"\\u003E\";\n// iterate availableOptions\n;(function(){\n var $$obj = availableOptions;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var item = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Coption\" + (pug.attr(\"value\", item.text, true, true)+pug.attr(\"selected\", item.key === selectedOption, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = item.text) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var item = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Coption\" + (pug.attr(\"value\", item.text, true, true)+pug.attr(\"selected\", item.key === selectedOption, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = item.text) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fselect\\u003E\\u003Cinput\" + (\" class=\\\"inline-input form-control bid-adj-col\\\"\"+pug.attr(\"id\", Name, true, true)+\" type=\\\"text\\\"\"+pug.attr(\"aria-label\", i18n.getString('BidAdjustment_BidMultiplier'), true, true)+pug.attr(\"size\", size, true, true)+pug.attr(\"maxlength\", size, true, true)+pug.attr(\"value\", percentage, true, true)+pug.attr(\"disabled\", readonly, true, true)) + \"\\u003E\\u003Cspan\\u003E%\\u003C\\u002Fspan\\u003E\\u003Cdiv class=\\\"error\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"Name\" in locals_for_with?locals_for_with.Name:typeof Name!==\"undefined\"?Name:undefined,\"availableOptions\" in locals_for_with?locals_for_with.availableOptions:typeof availableOptions!==\"undefined\"?availableOptions:undefined,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"percentage\" in locals_for_with?locals_for_with.percentage:typeof percentage!==\"undefined\"?percentage:undefined,\"readonly\" in locals_for_with?locals_for_with.readonly:typeof readonly!==\"undefined\"?readonly:undefined,\"selectedOption\" in locals_for_with?locals_for_with.selectedOption:typeof selectedOption!==\"undefined\"?selectedOption:undefined,\"size\" in locals_for_with?locals_for_with.size:typeof size!==\"undefined\"?size: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, isLabelHidden) {pug_html = pug_html + \"\\u003Cdiv class=\\\"target-or-bid-selector-content\\\"\\u003E\\u003Clabel\" + (pug.attr(\"class\", pug.classes([\"control-label\",isLabelHidden ? 'hide' : ''], [false,true]), false, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Targeting_Setting')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cform\\u003E\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput class=\\\"bid-only-radio-check\\\" type=\\\"radio\\\" name=\\\"bid-only-or-target\\\"\\u003E\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Bid_Only')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\\u003Cp\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Bid_Only_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fp\\u003E\\u003Clabel class=\\\"radio-inline\\\"\\u003E\\u003Cinput class=\\\"target-and-bid-radio-check\\\" type=\\\"radio\\\" name=\\\"bid-only-or-target\\\"\\u003E\\u003Cdiv\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_And_Bid')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\\u003Cp\\u003E\" + (pug.escape(null == (pug_interp = i18n.getString('Audience_Campaign_Target_And_Bid_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fp\\u003E\\u003C\\u002Fform\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"i18n\" in locals_for_with?locals_for_with.i18n:typeof i18n!==\"undefined\"?i18n:undefined,\"isLabelHidden\" in locals_for_with?locals_for_with.isLabelHidden:typeof isLabelHidden!==\"undefined\"?isLabelHidden:undefined));;return pug_html;};\nmodule.exports = template;"],"names":["AudienceAdgroupCreationWizard","_Backbone$View","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","options","_this","this","viewContext","i18n","DependencyResolver","get","audienceCampaignType","currentLevelTargetInfo","AudienceTargetInfo","resourceName","isForVNext","isAudienceCreationWorkflow","router","_","deps","result","navigateToRoute","eventDelegator","scenario","perfMarker","setupInstrumentation","lastStep","crudOptions","wizardElement","$el","step1","CrudAudienceAdgroupBasic","createChild","workflow","step2","CrudAudienceAdgroup","crudAdOptions","isImpressionTrackingUrlsEnabled","handlePopState","campaignId","currentCampaign","Id","campaign_id","window","addEventListener","loadCrudAudienceAdPromise","Promise","resolve","step3","ResponsiveAdEditor","listenTo","saveAndExit","onExit","instr","addScenario","schema","aimAdGroupCreationScenario","aimShoppingAdGroupCreationWizard","create","aimAdGroupCreationWizard","logScenario","inContextRepairRecScenario","inContextRepairRecommendation","applyActivity","applyDeliveryStatus","_this2","willRender","then","wizard","StepsWizard","config","getStepConfig","currentStep","html","template","render","callbackBeforeRender","$","append","done","steps","push","name","view","extendConfig","layout","isHorizontal","headerTemplate","_objectSpread","remove","callbackBeforeRemove","panel","document","querySelector","removeEventListener","_superPropGet","_this3","enableAdGroup","navigateToSummaryPage","catch","response","errors","errorsView","setErrors","i18nErrors","getBulkApiErrors","jsdata","campaign","adgroup","currentAdGroup","params","Campaign","Status","AdGroup","update","adapter","getContext","trigger","Backbone","AudienceAdgroupSettingsWizard","willInit","decimal","level","reachControlOptions","permissionConfig","permissions","isShowDisclaimerBannerEnabled","isBoostConversionBasedSegmentEnabled","targetInfoPerf","isNewUI","initAudienceAssociationView","optTgtReactComponent","React","parentTargetInfoPerf","parentLevelTargetInfo","AudienceCampaignErrorsView","loadAdGroupDataTask","loadAdGroupDataAsync","supportCashbackSettings","shouldSupportCashbackSettings","saveSettingsActivityLogger","aimAdGroupSettingsWizardScenario","saveSettings","campaignSubType","isAudienceFeedBasedCampaign","isAudienceFeedBasedCampaignNew","isFeedBasedAudienceCampaign","aimAdGroupSettingsWizard","willFetchData","loadSettingsActivityLogger","loadSettings","start","edmCampaign","initializeAdgroupAudience","getAdGroupTask","asyncFunctionWithPerfMarker","find","Number","entitySet","AdGroups","bypassCache","getAdGroupCriterionsTask","fetchCriterions","IsAmplifyEnabled","IsContextualTargetEnabled","getCampaignCriterionsTask","initializeWithCampaignAsync","reachControl","ReachEstimateControl","isSticky","estimateRequestFactory","EstimateRequestFactory","onAdGroupInitialized","handleEstimateUpdates","disableOptToggle","handleAgeGenderExclusion","advancedTargetSetting","companyNameTargetSetting","targetOrBidSelector","industryTargetSetting","jobFunctionTargetSetting","audienceTargetSetting","stop","initializeWithhAdGroupAudience","finally","withUiBlock","getString","targetSetting","empty","nonEmptyKeys","getAllNoneEmptyTypeKeys","targetSelector","audienceTargetSelector","turnOnAudienceTarget","updateUnmodifiedCriterions","el","style","display","current","disableByValidation","call","crudAudienceAdgroupBasic","AudienceAdvancedTargetSettings","renderSettingsControls","cashbackSettingsView","viewModel","validateCashbackPercent","formattedValue","fromLocalToFloat","toggleCashbackPercentColumns","validateAndSave","CampaignId","AdGroupId","undefined","adgroup_id","validate","locationTargetSetting","targetSelectionView","locationTargetsViewPromise","isValid","checkIMAReachAndSave","message","errorMessage","getData","allAdGroupCriterions","AdGroupCriterions","audienceCriterions","target","Criterion","Type","otherCriterions","AdGroupAudienceCriterions","TargetSetting","getTargetSettings","length","join","dynamic","Enable1PPlacementTargeting","BoostAdunitIds","getAdUnitIds","UseOptimizedTargeting","useOptimizedTargeting","adGroupCriterions","getAllLocations","c","adGroupCriterionsWithoutIntent","CriterionType","campaignCriterions","getCampaignLocationCriterions","overrideInfo","getLocationsInfoFromCampaignCriterions","locations","concat","intent","_this4","checkIMAReachPromise","locationCriterions","getAllAdGroupLocationCriterion","accountInfo","isIMAReachRepresentationPhase1Enabled","changedLocationCriterions","item","locationsInfo","getLocationsInfo","showIMAReachModal","onYes","saveAsync","deliveryChannel","adGroupId","aid","cid","AdvertiserCustomerID","isIMAReachModalShow","_this5","updateAdGroupTask","cacheResponse","removeErrors","data","saveSettingsActivity","logAdGroupPersonalizedOffers","signal","bind","isSuccess","advancedSettings","saveExtensions","App","Name","handleErrors","entity","bulkApiErrors","noMappedErrors","error","code","getBulkErrorsLogMessage","JSON","stringify","trace","getODataErrors","_this6","observeInDOM","onRenderedInDOM","_this7","collapseTemplate","renderOptTgtSwtich","CashbackPercent","subscribe","v","onCashbackPercentChange","parent","settingView","targetSettings","biddingSchemeType","BiddingScheme","subType","CampaignSubType","bidinfo","BidStrategy","campaignSetting","feedInfo","getFeedInfo","targets","createWithTargetSettings","hasAudienceRemarketingList","updateEstimate","shouldShowWarningMessage","showTargetExclusionActualDeliveryStatus","criterionsHaveNoDataInOriginalPayload","Age","Gender","genderTargetSelectionView","genderTargetSetting","ageTargetSelectionView","ageTargetSetting","setupVirtualTargets","selectedTypes","selectedType","targetSettingsSetByUser","ReactDOM","_jsx","OptTgtToggle","ref","checked","i18nNewDesign","activityLogger","labelTxt","offTxt","alwaysDisabled","locationTargetView","getConfigs","isAudienceCampaign","isSearchDSAShoppingAdgroupLevel","ageSettingOptionsFactory","genderSettingOptionsFactory","Device","deviceSettingOptions","populateCriterions","targetInfo","isTargetAndBidArr","criterionType","savedSelections","getAllByType","criterion","criterionTypeTarget","isTargetAllUnselectedOrSelected","unsavedSelections","selections","saveSnapshot","isSelected","updateCriterionDataAsync","shouldFillWithNegative","isTargetAndBid","selection","_defineProperty","BidAdjustment","createAsync","populateCheckboxBasedCriterions","_ref","_ref$isAudienceCampai","_ref$isSearchDSAShopp","_ref$isTargetAndBidAr","_ref$useOptimizedTarg","_ref$showTargetExclus","_ref$criterionsHaveNo","populator","criterionTypes","asyncTasks","isCashbackPercentEmpty","percent","compactPopulatedCriterions","criterions","hasNonZeroDeviceCriterion","getBlackListCriterions","_ref2","campaignType","_ref2$permissions","_ref2$selectedTypeKey","selectedTypeKeys","isMSStoreAdsGAWorkflow","isWindowsStoreAdsEnabled","isWindowsStoreAdsManualCPAEnabled","WindowsStoreAdsManualCPA","isDomesticSimplifiedChineseEnabled","IsDomesticSimplifiedChineseEnabled","blackListMap","audience","default","supportedTypes","type","unmodifiedCriterions","cloneDeep","getAllByTypes","populateInitialTargetOrBidSettings","parentLevelSelectedTypeKeys","currentLevelSelectedTypeKeys","initialSelectedTypeKeys","Settings","settingIndex","setting","originalAdUnitIds","AdUnitIds","placementSelections","PlacementWithIds","adUnitIds","initializeTargetSettings","viewmodel","isEditTargetCategoriesExpanded","ko","initialTargetSetting","getCampaignType","toLowerCase","NegativeAgeTargetForAdGroups","adGroupTargetSettings","Details","TargetAll","placementSetting","getSnapshot","blackListCriterions","filter","map","toLocaleLowerCase","lockedKeys","conflictingKeys","AudienceTargetSelector","blackListKeys","onSelectionChanged","checkBoxBasedOptions","showTargetSelection","showBidAdjustment","showTargetOrBid","isLiveUpdateEnabled","enableLevelToggle","searchBasedOptions","showBidOnlyNote","showExclusion","defaultBidAdjustment","isFilterCriterionLevelAdGroup","AgeCriterionSetting","GenderCriterionSetting","deviceTargetSetting","DeviceCriterionSetting","CompanyNameCriterionSetting","IndustryCriterionSetting","PlacementSetting","JobFunctionCriterionSetting","LocationCriterionSetting","hideTitleLabel","AudienceCriterionSetting","_toConsumableArray","getIsTargetAndBid","containerId","getContainerNameFromId","show","id","isCashbackPercentColumnVisible","inheritInfo","getSubViews","forEach","subView","resetSupportCashbackSettings","_ref$intent","_ref$locations","getAllComputedByTypes","modifiedCriterions","criterionHelper","compareAndGetCriterionsDelta","ageCriterions","genderCriterions","deviceCriterions","others","ageCriterion","genderCriterion","deviceCriterion","removeAllVirtuals","_ref2$intent","_ref2$locations","_ref2$deletedLocation","deletedLocations","bidAdjustmentGrid","deviceTargetsUpdateView","IsOriginalDeviceTargetingEnabled","originalDeviceCriterions","targetsView","getValues","removeCashbackPercent","fillCriterionsWithId","toggle","hide","BmcRedirectView","bmcRedirect","getFeedData","_ref$$top","$top","_ref$$skip","$skip","_ref$permissions","query","$filter","supportedFeedTypeForDynamicDataFeedCamapign","DynamicDataAutosListingFeed","DynamicDataEventsFeed","DynamicDataHotelsAndVacationRentalsFeed","DynamicDataToursAndActivitiesFeed","DynamicDataCruisesFeed","Feed","findAll","FeedType","AudienceCampaignCreationWizard","isSwapStepsEnabled","IsAudienceCampaignSwapAdsBudgetAndBidsEnabled","isCopyCampaignSettingsAudienceCampaignEnabled","IsCopyCampaignSettingsAudienceCampaignEnabled","isAudienceCampaignCollapseTargetSelectionEnabled","IsAudienceCampaignCollapseTargetSelectionEnabled","campaignCreationFlowImporvementEnabled","isOdataGetProductScopeEnabled","getProductWithDFM","withDFMCache","getProductData","getFeedWithDFM","localStorage","getLocalStorage","startToFinishMarker","isShoppingCampaign","isAdImpressions","wizardActivity","wizardRenderTime","aimCampaignCreationScenario","aimShoppingCampaignCreationWizard","aimCampaignCreationWizard","log","logContent","flow","guid","includes","status","currentTime","Date","getTime","stepDuration","preStep","stepIndex","previousStepName","msg","AlertHelper","showError","isEnabledForVerifiedImpressionTrackingAtCampaignLevel","shoppingCrudPerfMarker","isEnabledForDynamicFeedCampaign","productData","ProductCollectionAccounts","IsGlobalStore","IsCoOpStore","feedData","bmcRedirectOptions","bmcRedirectView","shoppingCampaignOptions","crudAudienceCampaign","CrudAudienceShoppingCampaign","campaignCrudPerfMarker","campaignOptions","CrudAudienceCampaign","crudAudienceAdgroupOptions","crudAudienceAdgroup","crudAudienceAdOptions","crudAudienceAdInstance","crudAudienceAd","crudBudgetBidOptions","crudAudienceBudgetBid","CrudAudienceBudgetBid","ApexPlatform","Refresh","on","stepName","logShoppingCampaignCreationEvent","step","postABTestingEventLog","UniqueId","EventName","ExperimentName","MSANCampaignCreationFlowImporvement","getAudienceCreationPath","EventValue","currentStepName","_ref3","postABTestingFlightLog","RandomizationIdType","RandomizationId","String","Flight","railviewId","serverContext","serverContextStore","GetProductScopeData","countryCode","getProductConditionOptions","getSalesCountryCollection","getDynamicDataFeedOptions","getCategoryFullData","getProductTypeFullData","dataName","pData","mergeData","productDataProcess","getProductScopeData","GetProductData","_ref4","_ref4$$top","_ref4$$skip","GetFeedData","mergedData","store","stateManager","preferencesService","showSuccessDialog","context","constants","CurrentAccount","AccountStatus","enums","accountStatus","isPendingPayment","pendingPaymentInstrument","isAccountOnHold","active","accountPausedReason","accountInactiveReason","notSet","InactiveReasons","accountPausedReasons","pausedDueToSystemIssue","pausedZeroBalance","pausedNoValidiO","reason","indexOf","initialize","prefix","gridPreference","findByName","Data","doNotShowAgain","getItem","err","permanent","displaySuccessDialog","Included","All","SearchBasedTargetGridView","targetType","targetTypes","isolated","vm","gridData","removeAllVisibleClass","grid","onCriterionChange","initializeAndRenderGrid","allData","datas","d","refreshGridSource","addClass","removeClass","gridView","patch","dataSource","commonGridConfig","tableClasses","primaryKey","rows","bodyRows","classes","events","e","removeSearchBasedTarget","removeSearchBasedTargets","plugins","pagination","pageSize","availablePageSizes","enableRandomPage","paginationTemplate","pageNumberLabelText","pageSizeText","totalPageCountText","gridConfig","pgrid","vnext","use","paginationPlugin","firstColumnHeaderSpan","text","replace","totalCountRows","stopPropagation","targetId","itemOfElement","destroyAsync","targetDatas","destroyTargetTypeAsync","removeAllColumnConfig","searchBasedTargetGridRemoveColumnTemplate","headClasses","bodyClasses","statusColumnConfig","searchBasedTargetGridStateTemplate","isIncluded","isExcluded","includedString","excludedString","property","nameColumnConfig","local","SearchBasedTargetSetting","targetOptions","isolatedGrid","searchBasedTargetGridView","excludedSearchBasedTargetGridView","searchView","setDefaultCashbackPercent","SearchResultView","defaultCashbackPercent","items","isVisible","_document$getElements","searchResult","_document$getElements2","evenHandler","clickHandling","off","getElementsByClassName","ariaLiveResultsText","totalCount","closest","hasClass","updateState","companyTargetItem","parseInt","dataset","buildLinkedInCriterion","onClickSearchContainer","event","className","SearchViewBase","searchBox","SearchBox","placeholder","maxLength","iconClasses","prepend","searchResultView","CompanyNameSearchView","_SearchViewBase","searchTerm","onSearch","onSearchResultReseted","escapedSearchTerm","encodeURIComponent","odata","demogrphicsUrl","CurrentCustomerId","companySearchUrl","searchData","setSearchResult","makeSearchResultVisible","companies","targetedCompanyIds","company","CompanyNameCriterion","Target","excludedCompanyIds","results","logoUrl","LogoUrl","industry","Industry","size","companySizeEnumToString","Size","getBidAdjustmentOptions","percentage","availableOptions","selectedOption","isCriterionExcluded","SelectionStatus","onBidAdjChange","criterionName","bidAdjustmentControl","children","bidAdjPercentage","val","bidAdjOption","criterionsByType","bidAdj","rawBidPercentage","bidAdjOptionText","bidAdjustmentOptions","option","computeBidAdjustment","targetCrit","isUsingCampaignSettings","cashbackPercentColumnConfig","title","locals","that","cashbackPercentValue","CashbackAdjustment","readonly","cashbackPercentControlView","CashbackPercentControlView","isParentLevel","setTimeout","row","validated","companyColumnConfig","companyTargetItemTemplate","CompanyNameTargetSetting","_SearchBasedTargetSet","i18nKeys","titleKey","helpKey","descriptionKey","bingadsGridColumn","pageContext","companySettingGridConfig","columns","currentLevel","targetAndBidClassName","bidOnlyClassName","TargetOrBidSelector","isLabelHidden","prop","onTargetSettingChanged","currentTarget","AudienceCriterionSettingBase","showLevelToggle","isTargetSelectionViewValid","CompanyName","JobFunction","targetI18nMap","getInitializePromise","initializeBidAdjustmentGrid","initializeTargetOrBidSelector","initializeLevelToggle","initializeParentLevelBidAdjustmentGrid","changeVisibility","ToggleView","useCampaignSettings","levelToggle","toggleText","labelledbyId","setToggleState","setParentLevelToggle","showAdGroupOverrideInformation","onLevelToggleChange","targetCriterions","toggleState","setAdGroupInfoVisibility","closeTargetEditView","hasSavedSelections","hasSavedNegSelections","copyParentCriterionsAsync","Error","removeAttr","fromCriterionChanged","changeVisAction","hasData","parentLevelTogglesByType","LevelOfDetails","criterionsToCopy","createTasks","copiedCriterion","adgroupId","parentLevelBidAdjustmentGrid","cashbackPercentErrorSelector","$cashbackPercentErrors","__","i","eq","getState","isCashbackPercentValid","onCriterionChanged","originalAdGroupCashback","AdGroupCashback","Percent","originalCampaignCashback","CampaignCashback","renderGrids","getParentLevelToggle","_AudienceCriterionSet","initializeTargetSelectionView","getTargetedCriterion","selected","len","getExcludedCriterion","arr","getTargetedValues","summary","getSelectedString","getExcludedValues","resultItem","matchStartIndex","matchEndIndex","caseMatchedSearchTerm","substring","jobFunctionTargetItem","JobFunctionSearchView","initializeSearchDataTask","initializeSearchData","jobFunctions","targetedJobFunctionIds","jobFunction","JobFunctionCriterion","excludedJobFunctionIds","searchText","searchResults","setResults","JobFunctionTargetSetting","jobFunctionSettingGridConfig","SearchView","searchTreeInitializationPromise","initializeSearchTree","refreshTargetedStates","treeView","processIndustryRowData","treeData","actions","callback","node","onExclude","onInclude","setLeafState","leafNodeData","state","shouldSetState","stateValue","targetedIndustryIds","excludedIndustryIds","placeHolderText","Treeview","updateView","groupedTree","child","IndustryGroupName","updateSearchResult","industries","IndustryCriterion","IndustryTargetSetting","industrySettingGridConfig","SearchBasedTargetGridViewPlacement","adUnitSelection","adUnitSelectionRef","triggerSearchViewRefreshRef","selectedData","displayGrid","_this$options","gridConfigDisplay","targetedPlacementsIds","refreshGrid","processPlacementRowData","GroupName","excludedPlacementsIds","PlacementTargetSetting","industrySettingGridConfigDisplay","onEditTargetShowButtonClicked","switchGrid","PlacementDataMapping","Games","HomePages","Productivity","isEditing","isEmpty","_TL_","memo","CheckboxSelectionBase","savedNegSelections","selectionsSnapshot","criterionsSnapshot","onSelectAll","updateTasks","originalSelection","criterionToCreate","createCriterion","deleteAndCreateTask","deleteSameCriterionIfExistsAsync","criterionToRemove","getSavedCriterionByKey","existingCriterion","targetKey","criterionsSnapshotShallow","shouldSelect","isAllSelected","onTargetUpdated","keys","$target","is","states","isNoneSelected","setErrorMessage","AgeTargetSetting","_CheckboxSelectionBas","selectedCriterions","selectedPositiveCriterions","AgeCriterion","shouldValidate","isEditDisabled","snapshot","EighteenToTwentyFive","labelKey","TwentyFiveToThirtyFive","ThirtyFiveToFifty","FiftyToSixtyFive","SixtyFiveAndAbove","Unknown","allSelections","getSelectedCriterion","total","totalSelected","DeviceTargetSetting","DeviceCriterion","DeviceName","hasSavedBefore","GenderTargetSetting","GenderCriterion","Female","Male","AudienceTargetSetting","isTitleLabelHidden","audienceTargetInfo","audienceAssociationView","aimAudienceAssociationView","locationCriterionsData","reloadAudienceData","onAudiencesTargetChange","setOnAudiencesTargetChangeCallback","AudienceName","getTargetedAudiences","getExcludedAudiences","Audience","configSettings","searchObj","tgt","AudienceId","searchTgt","exclusionAllItems","associationAllItems","a","existingItems","exclusion","selectedLists","targeting","isMapLoaded","Microsoft","Maps","Color","loadModule","loadMap","reject","src","checkMapLoaded","script","createElement","async","onload","onerror","console","getElementsByTagName","parentNode","insertBefore","injectScript","LocationTargetSetting","Intermediate","refresh","initializeLocationTargetsView","locationTargetsView","LocationTargetsView","isSettingsScenario","showPhysicalIntentView","targetOption","isCampaignLevel","onLocationTargetOptionChanged","keepAllLocations","destoryTasks","location","audienceTargets","reloadLocationView","Location","Radius","radiusData","getRadiusLocations","targeted","LocationCriterion","RadiusCriterion","getTargetedLocations","getExcludedLocations","_ref$isShoppingCampai","_ref$listenToLocation","listenToLocationCriterion","_ref$customizedTempla","customizedTemplates","_ref$useLocationContr","useLocationControl","_ref$initAudienceAsso","_ref$deps","_ref$isForVNext","_ref$perfMarker","_ref$isAudienceCreati","_ref$isFromAudienceDa","isFromAudienceDashboard","currentVirtualId","audiencePerfMarker","autoEnd","willFetchFile","AimAudienceAssociationView","onAudienceSelectionChangedAsync","typeMapping","onLocationCriterionChange","destroyAll","audienceFetchCreationTask","audienceCriterionFetchCreationTask","fetchAdGroupAudienceCriterions","snapShot","criterionsOverride","shouldFetchContextualTargets","criterionLoader","criterionsToLoad","load","formattedCriterions","loadedCriterionData","formattedCriterion","reformatFetchedCriterion","createMultipleAsync","ensureLoadedAsync","createTask","getNewVirtualId","isLocationTypeCriterionType","updatedCriterionTypes","updateIntermediateTask","createMany","isUpdated","updatedCriterion","noEvent","criterionGroupToUpdate","savedCriterions","_this8","savedCriterion","criterionToUpdate","types","_this9","returnCriterions","_this10","allCriterions","getAll","_this11","noneEmptyTypeKeys","criterionTypeKeys","typeKey","criterionId","criterionTypeToChange","_this12","destroyTask","destroy","_this13","_this14","destroyTasks","targetCriterion","audienceCriterion","AudienceType","_this15","audiences","getAudienceCriterion","IMAudience","Level","AudienceCriterion","critionCreationTasks","association","typePrefix","_this16","newCriterionsByType","NegativeLocation","AgeTargets","GenderTargets","otherTargets","pug","module","exports","pug_interp","pug_html","locals_for_with","escape","pug_mixins","collapseId","itemClassSelect","optTgtTgBtn","popupId","ariaLabelContext","arialLabelText","block","attributes","attr","Object","n","$$obj","pug_index0","$$l","index","nextPageText","previousPageText"],"sourceRoot":""}