{"version":3,"sources":["webpack:///./src/modules/main/pages/missions/components/internal-components/RewardCardComponent.vue?f1c8","webpack:///./node_modules/quasar/src/components/space/QSpace.js","webpack:///./src/modules/main/pages/missions/components/internal-components/RewardCardComponent.vue","webpack:///./src/modules/main/pages/missions/components/internal-components/RewardCardComponent.vue?39a6","webpack:///./node_modules/quasar/src/composables/private/use-ratio.js","webpack:///./src/modules/main/pages/missions/components/internal-components/RewardCardComponent.vue?01c0","webpack:///./src/modules/main/pages/missions/helpers/script_helpers.js"],"names":["space","h","class","createComponent","name","setup","props","reward","type","Object","required","slide","ref","useRatioProps","ratio","String","Number","naturalRatio","computed","value","isNaN","paddingBottom","t","i18n","global","generateformData","payload","formData","FormData","keys","forEach","key","Array","i","append","getLabel","rewards","credits","getEventPeriod","mission","time_in_days","d1","formatDate","start_at","d2","end_at","getEventPeriodSubs","subscribe_start_at","subscribe_end_at","getBadgePaticipantColor","status","badgeColors","Content_approved","Content_received","Content_reproved","Content_to_be_improved","getTargetIcon","target","targetIcons","toLowerCase","accountData","acc","getOptionLabels","uploadType","targets","length","getMoment","date","moment","getDiffDays","today","diff","getBadgeMessage","diffDays","showDeadlineBadge","start_current_step","currentStep","missionEndAt","format","when_date","deadline","when_integer","add","getFinishDate","integer","formatFullDate","isMissionStepExpired","missionStartAt","currentStepEndAt","currentStepWhenInt","isBefore","_createBlock","_component_q_card","flat","$props","images","_component_q_img","style","src","_ctx","$t","_component_q_carousel","animated","infinite","$setup","$event","autoplay","_createElementBlock","_Fragment","_renderList","JSON","parse","r","_component_q_carousel_slide","url","_createVNode","_component_q_card_section","_createElementVNode","innerHTML","description"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAuB;AAEwC;AAE/D,MAAMA,KAAK,GAAGC,6CAAC,CAAC,KAAK,EAAE;EAAEC,KAAK,EAAE;AAAU,CAAC,CAAC;AAE7BC,+IAAe,CAAC;EAC7BC,IAAI,EAAE,QAA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AAM,CAACgH","file":"js/chunk-fee48a08.a4ff7632.js","sourcesContent":["export * from \"-!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/vue-cli-plugin-quasar/lib/loader.js.transform-quasar-imports.js!../../../../../../../node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!../../../../../../../node_modules/vue-cli-plugin-quasar/lib/loader.vue.auto-import-quasar.js??ref--1-0!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-1!../../../../../../../node_modules/vue-loader-v16/dist/index.js??ref--1-2!./RewardCardComponent.vue?vue&type=template&id=5fad16b9\"","import { h } from 'vue'\n\nimport { createComponent } from '../../utils/private/create.js'\n\nconst space = h('div', { class: 'q-space' })\n\nexport default createComponent({\n name: 'QSpace',\n\n setup () {\n return () => space\n }\n})\n","\n \n \n\n \n \n \n\n \n \n \n \n\n\n\n","export { default } from \"-!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/vue-cli-plugin-quasar/lib/loader.js.transform-quasar-imports.js!../../../../../../../node_modules/vue-cli-plugin-quasar/lib/loader.vue.auto-import-quasar.js??ref--1-0!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-1!../../../../../../../node_modules/vue-loader-v16/dist/index.js??ref--1-2!./RewardCardComponent.vue?vue&type=script&lang=js\"; export * from \"-!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/vue-cli-plugin-quasar/lib/loader.js.transform-quasar-imports.js!../../../../../../../node_modules/vue-cli-plugin-quasar/lib/loader.vue.auto-import-quasar.js??ref--1-0!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-1!../../../../../../../node_modules/vue-loader-v16/dist/index.js??ref--1-2!./RewardCardComponent.vue?vue&type=script&lang=js\"","import { computed } from 'vue'\n\nexport const useRatioProps = {\n ratio: [ String, Number ]\n}\n\nexport default function (props, naturalRatio) {\n // return ratioStyle\n return computed(() => {\n const ratio = Number(\n props.ratio || (naturalRatio !== void 0 ? naturalRatio.value : void 0)\n )\n\n return isNaN(ratio) !== true && ratio > 0\n ? { paddingBottom: `${ 100 / ratio }%` }\n : null\n })\n}\n","import { render } from \"./RewardCardComponent.vue?vue&type=template&id=5fad16b9\"\nimport script from \"./RewardCardComponent.vue?vue&type=script&lang=js\"\nexport * from \"./RewardCardComponent.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"/codebuild/output/src1250588209/src/flip-child-frontend/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__\nimport QCard from 'quasar/src/components/card/QCard.js';\nimport QImg from 'quasar/src/components/img/QImg.js';\nimport QCarousel from 'quasar/src/components/carousel/QCarousel.js';\nimport QCarouselSlide from 'quasar/src/components/carousel/QCarouselSlide.js';\nimport QCardSection from 'quasar/src/components/card/QCardSection.js';\nimport qInstall from \"../../../../../../../node_modules/vue-cli-plugin-quasar/lib/runtime.auto-import.js\";\nqInstall(script, 'components', {QCard,QImg,QCarousel,QCarouselSlide,QCardSection});\n","import {\n formatDate,\n formatFullDate,\n} from \"@/shared/helpers/numbersManipulation\";\nimport i18n from \"@/i18n/wrappers/i18n\";\nimport moment from \"moment\";\n\nconst t = i18n.global.t;\n\n/**\n * generate formData from payload dinamically\n * @param {*} payload\n */\nexport const generateformData = (payload) => {\n const formData = new FormData();\n\n Object.keys(payload).forEach((key) => {\n if (payload[key] instanceof Array)\n payload[key].forEach((i) => formData.append(key, i));\n else formData.append(key, payload[key]);\n });\n\n return formData;\n};\n\n/**\n * get mission item label\n * @param {*} rewards\n * @param {*} credits\n */\nexport const getLabel = (rewards, credits) =>\n rewards > 0 && credits > 0\n ? t(\"missions.credit_if_complete_with_reward\", { value: credits })\n : rewards === 0 && credits > 0\n ? t(\"missions.credit_if_complete_show\", { value: credits })\n : rewards > 0 && credits === 0\n ? t(\"missions.credit_if_complete_only_reward\")\n : t(\"missions.only_reward\");\n\n/**\n * @param {*} mission\n */\nexport const getEventPeriod = (mission) =>\n mission.time_in_days\n ? t(\"missions.time_in_days\", { value: mission.time_in_days })\n : t(\"missions.period\", {\n d1: formatDate(mission.start_at),\n d2: formatDate(mission.end_at),\n });\n\n/**\n * @param {*} mission\n */\nexport const getEventPeriodSubs = (mission) =>\n t(\"missions.period\", {\n d1: formatDate(mission.subscribe_start_at),\n d2: formatDate(mission.subscribe_end_at),\n });\n\n/**\n * @param {*} status\n */\nexport const getBadgePaticipantColor = (status) => {\n const badgeColors = {\n Content_approved: \"green-7\",\n Content_received: \"blue-7\",\n Content_reproved: \"red-9\",\n Content_to_be_improved: \"orange-9\",\n };\n return badgeColors[status];\n};\n\n/*\nexport const getTargetIcon = (target) => {\n return target == t(\"missions.targets.flip\")\n ? \"fas fa-upload\"\n : target == t(\"missions.targets.social\")\n ? `fab fa-google-${target.toLowerCase()}`\n : `fab fa-${target.toLowerCase()}`;\n};\n*/\n\nexport const getTargetIcon = (target) => {\n const targetIcons = {\n [\"Texto\"]: \"text_fields\",\n [t(\"missions.targets.flip\")]: \"fas fa-upload\",\n [t(\"missions.targets.social\")]: `fab fa-google-${target.toLowerCase()}`,\n };\n return targetIcons[target] || `fab fa-${target.toLowerCase()}`;\n};\n\nexport const accountData = (acc) => [\n acc.toLowerCase() == \"pj\" ? \"pj_fantasia\" : \"nome\",\n \"email_principal\",\n \"celular\",\n \"end_cep\",\n \"end_rua\",\n \"end_numero\",\n \"end_bairro\",\n \"end_cidade\",\n \"end_uf\",\n];\n\nexport const getOptionLabels = (uploadType, targets) => {\n return uploadType && targets.length > 1\n ? 1\n : !uploadType && targets.length >= 1\n ? 2\n : 3;\n};\n\nexport const getMoment = (date) => moment(date, \"DD/MM/YYYY\"),\n getDiffDays = (date, today) => getMoment(date).diff(getMoment(today), \"days\"),\n getBadgeMessage = (diffDays) =>\n diffDays < 0\n ? t(\"missions.expired_period\")\n : diffDays > 0\n ? t(\"missions.end_in\", { value: diffDays })\n : t(\"missions.end_today\");\n\nexport const showDeadlineBadge = (\n start_current_step,\n currentStep,\n missionEndAt\n) => {\n const today = moment().format(\"DD/MM/YYYY\");\n\n if (currentStep.when_date) {\n const deadline = moment(currentStep.when_date).format(\"DD/MM/YYYY\"),\n diffDays = getDiffDays(deadline, today);\n\n return getBadgeMessage(diffDays);\n }\n if (currentStep.when_integer) {\n const deadline = moment(start_current_step).add(\n currentStep.when_integer,\n \"days\"\n ),\n diffDays = getDiffDays(deadline, today);\n\n return getBadgeMessage(diffDays);\n }\n if (missionEndAt) {\n const deadline = moment(missionEndAt).format(\"DD/MM/YYYY\"),\n diffDays = getDiffDays(deadline, today);\n\n return getBadgeMessage(diffDays);\n }\n};\n\nexport const getFinishDate = (date, integer, start_current_step) => {\n if (date) return t(\"missions.finish_date\", { value: formatFullDate(date) });\n if (integer) {\n const deadline = moment(start_current_step).add(integer, \"days\");\n return t(\"missions.finish_date\", {\n value: moment(deadline).format(\"DD/MM/YYYY\"),\n });\n }\n};\n\nexport const isMissionStepExpired = (\n missionStartAt,\n missionEndAt,\n currentStepEndAt,\n currentStepWhenInt\n) => {\n if (currentStepWhenInt) {\n const deadline = moment(missionStartAt).add(currentStepWhenInt, \"days\");\n return moment(deadline).isBefore(moment());\n } else if (currentStepEndAt) {\n return moment(currentStepEndAt).isBefore(moment());\n }\n return moment(missionEndAt).isBefore(moment());\n};\n"],"sourceRoot":""}