{"version":3,"sources":["webpack:///./src/views/campaigns/components/steps/components/BudgetContent/NewBudgetWhenEndDateChanged.vue?6ac5","webpack:///src/views/campaigns/components/steps/components/BudgetContent/NewBudgetWhenEndDateChanged.vue","webpack:///./src/views/campaigns/components/steps/components/BudgetContent/NewBudgetWhenEndDateChanged.vue?f2c0","webpack:///./src/views/campaigns/components/steps/components/BudgetContent/NewBudgetWhenEndDateChanged.vue","webpack:///./node_modules/@babel/runtime-corejs2/helpers/esm/typeof.js","webpack:///./src/views/campaigns/components/steps/components/BudgetContent/NewBudgetWhenEndDateChanged.vue?cd60","webpack:///./src/validators/budget.js","webpack:///./node_modules/core-js/modules/es6.number.is-nan.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","editingBudgetType","staticClass","_v","_s","$t","_l","adsetBudgetItem","index","key","name","minAllowedBudgetMsg","slot","staticStyle","domProps","newAdsetBudgets","budget","on","$event","validateCampaignBudget","updateAdsetBudgetItem","id","cancelNewBudgets","areInputsInvalid","confirmNewBudgetAndUpdate","errorPopup","show","staticRenderFns","props","adsetBudgets","type","Array","required","default","Boolean","objective","Object","startDate","String","endDate","data","body","computed","validatedBudget","msg","length","created","forEach","i","methods","value","budgetValidator","Number","isNaN","parseFloat","fraction","$emit","component","_typeof","obj","constructor","prototype","validateBudget","newBudget","objectiveDailyBudget","campaignStartDate","campaignEndDate","minBudget","isValidBudget","dateFormat","now","moment","Date","format","dateToCalcRemainingDays","isAfter","campaignWorkingDays","diff","valid","$export","S","number"],"mappings":"mKAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,WAAW,CAACE,MAAM,CAAC,OAASN,EAAIO,kBAAkB,kBAAiB,IAAO,CAACH,EAAG,SAAS,CAACA,EAAG,MAAM,CAACI,YAAY,2BAA2B,CAACJ,EAAG,KAAK,CAACI,YAAY,eAAe,CAACR,EAAIS,GAAG,aAAa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AAYM,QAAQL,GAAOC,IAAOlC,GAAaiC,EAE3FM,EAAsBL,IAAOL,GAAiBW,KAAKH,EAAyB,QAAU,EAE5FP,EAAYH,EAAuBY,EAOrC,OAJKb,IAAcI,IACjBC,GAAgB,GAGX,CACLD,YACAW,MAAOV,EACPxB,IAAK,eAAF,OAAiBsB,EAAkB,GAAK,QAAxC,8BAAsEC,EAAtE,eAIQL,U,qBC5Bf,IAAIiB,EAAU,EAAQ,QAEtBA,EAAQA,EAAQC,EAAG,SAAU,CAC3B3B,MAAO,SAAe4B,GAEpB,OAAOA,GAAUA","file":"js/chunk-3c28b59a.cccc0946.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('vs-popup',{attrs:{\"active\":_vm.editingBudgetType,\"buttons-hidden\":true}},[_c('vs-row',[_c('div',{staticClass:\"vx-col w-full text-left\"},[_c('h3',{staticClass:\"font-medium\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('Confirmation'))+\"\\n \")]),_c('p',{staticClass:\"text-gray-500 mt-2\"},[_vm._v(\"\\n If your campaign does not have a specific end date or a total budget, you need to set a budget.\\n \")])]),_vm._l((_vm.adsetBudgets),function(adsetBudgetItem,index){return _c('div',{key:'adsets-' + index,staticClass:\"inputs-parent vx-col md:w-1/2 sm:w-full pr-5 my-5\"},[_c('h5',{staticClass:\"font-normal text-lg mb-2\"},[_vm._v(\"Adset \"+_vm._s(adsetBudgetItem.name))]),_c('p',{staticClass:\"text-gray-500 mt-2 mb-2 text-sm\"},[_vm._v(_vm._s(_vm.minAllowedBudgetMsg))]),_c('vx-input-group',[_c('template',{slot:\"prepend\"},[_c('div',{staticClass:\"prepend-text dollar-sign\",staticStyle:{\"margin-top\":\"0\"}},[_c('span',[_vm._v(\"$\")])])]),_c('div',{staticClass:\"vx-input-group-default flex-grow\"},[_c('div',{staticClass:\"vs-component vs-con-input-label vs-input w-full vs-input-primary\"},[_c('div',{staticClass:\"vs-con-input\"},[_c('input',{staticClass:\"vs-inputx vs-input--input\",attrs:{\"min\":\"0\",\"type\":\"number\",\"placeholder\":_vm.$t('Budget')},domProps:{\"value\":_vm.newAdsetBudgets[index].budget},on:{\"blur\":function($event){return _vm.validateCampaignBudget($event, adsetBudgetItem)},\"input\":function($event){return _vm.updateAdsetBudgetItem(adsetBudgetItem.id, $event)}}})]),_c('span')])])],2)],1)}),_c('div',{staticClass:\"vx-col w-full mt-10 text-right\"},[_c('vs-button',{staticClass:\"mr-4 cancel-button\",attrs:{\"color\":\"primary\",\"type\":\"border\"},on:{\"click\":_vm.cancelNewBudgets}},[_vm._v(_vm._s(_vm.$t('Cancel')))]),_c('vs-button',{staticClass:\"confirm-update-button\",attrs:{\"color\":\"primary\",\"type\":\"filled\",\"disabled\":_vm.areInputsInvalid},on:{\"click\":_vm.confirmNewBudgetAndUpdate}},[_vm._v(_vm._s(_vm.$t('Confirm & Update')))])],1)],2),_c('speakol-response-popup',{attrs:{\"responsePopupData\":_vm.errorPopup},on:{\"hide-response-popup\":function($event){_vm.errorPopup.show = false}}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewBudgetWhenEndDateChanged.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewBudgetWhenEndDateChanged.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./NewBudgetWhenEndDateChanged.vue?vue&type=template&id=4bed017e&\"\nimport script from \"./NewBudgetWhenEndDateChanged.vue?vue&type=script&lang=js&\"\nexport * from \"./NewBudgetWhenEndDateChanged.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NewBudgetWhenEndDateChanged.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import _Symbol from \"@babel/runtime-corejs2/core-js/symbol\";\nimport _Symbol$iterator from \"@babel/runtime-corejs2/core-js/symbol/iterator\";\nexport default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof _Symbol === \"function\" && typeof _Symbol$iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof _Symbol === \"function\" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","export * from \"-!../../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewBudgetWhenEndDateChanged.vue?vue&type=style&index=0&lang=scss&\"","import moment from 'moment'\n\nconst validateBudget = (newBudget, objectiveDailyBudget, campaignStartDate, campaignEndDate = null) => {\n\n let minBudget = objectiveDailyBudget,\n isValidBudget = false\n\n if (campaignEndDate) {\n const dateFormat = 'YYYY-MM-DD'\n const now = moment(new Date()).format(dateFormat)\n const startDate = moment(campaignStartDate, dateFormat)\n const dateToCalcRemainingDays = moment(startDate, dateFormat).isAfter(now) ? moment(startDate) : now\n\n const campaignWorkingDays = moment(campaignEndDate).diff(dateToCalcRemainingDays, 'days') + 1\n\n minBudget = objectiveDailyBudget * campaignWorkingDays\n }\n\n if (+newBudget >= +minBudget) {\n isValidBudget = true\n }\n\n return {\n minBudget,\n valid: isValidBudget,\n msg: `The minimum ${campaignEndDate ? '' : 'daily'} budget has to be $${ minBudget } or more.`\n }\n}\n\nexport default validateBudget\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n"],"sourceRoot":""}