"use strict";(this.webpackChunk_tsmesolutions_cubes_initiatives=this.webpackChunk_tsmesolutions_cubes_initiatives||[]).push([[1152],{51152:(e,n,t)=>{t.r(n),t.d(n,{default:()=>y});var l=t(24590);const a={modelValue:Object,disabled:Boolean};var o=t(16464),r=t(39168),i=t(90726);function s(e,n,t,l,a,o,r){try{var i=e[o](r),s=i.value}catch(e){return void t(e)}i.done?n(s):Promise.resolve(s).then(l,a)}const c={class:"mb-0"},d={class:"pt-2"},p={class:"text-muted"},m={key:0,class:"mb-1 text-danger"},u={key:1,class:"mb-1 text-danger"},f={key:2,class:"mb-1 text-danger"},v={key:3,class:"mb-1 text-danger"},g={key:4,class:"mb-1 text-danger"},E={key:5,class:"mb-1 text-danger"},x=(0,l.defineComponent)({__name:"spending.view",props:a,setup(e,n){let{expose:a}=n;const x=e,y=(0,l.inject)(o.Ow.milestoneContext),V=(0,l.inject)(o.Ow.initiativeLayoutContext),C=i.IoC.DI().resolve(o.Ow.appContext).translation.global,k=y.translation.tActivityForm,b=y?.translation.tSpendingView,N=(0,l.ref)(),B=(0,l.toRef)(x,"modelValue");(0,l.watch)(()=>N.value,e=>{e&&B.value.activities?.length&&y?.actions.updatePlanningValues()}),a({validatePlanningView:()=>new Promise(function(){var e,n=(e=function*(e,n){try{e(yield N.value.validateAsync())}catch(e){n(!1)}},function(){var n=this,t=arguments;return new Promise(function(l,a){var o=e.apply(n,t);function r(e){s(o,l,a,r,i,"next",e)}function i(e){s(o,l,a,r,i,"throw",e)}r(void 0)})});return function(e,t){return n.apply(this,arguments)}}())});const h=(0,l.defineAsyncComponent)(()=>t.e(4496).then(t.bind(t,34496)));return(e,n)=>((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,null,[(0,l.createElementVNode)("div",null,[(0,l.createElementVNode)("div",null,[(0,l.createElementVNode)("h6",c,(0,l.toDisplayString)((0,l.unref)(b)?.header),1)]),(0,l.createElementVNode)("div",d,[(0,l.createElementVNode)("p",p,(0,l.toDisplayString)((0,l.unref)(b)?.subHeader),1)])]),((0,l.openBlock)(),(0,l.createBlock)((0,l.unref)(h),{modelValue:B.value.progressSpendingPlans,"onUpdate:modelValue":n[0]||(n[0]=e=>B.value.progressSpendingPlans=e),ref_key:"planningRef",ref:N,frequency:(0,l.unref)(V)?.initiativeWriteDC.model.frequency,"max-CapEx-spending":+(0,l.unref)(y)?.milestoneDc.model.allocatedBudgetCapEx,"max-OpEx-spending":+(0,l.unref)(y)?.milestoneDc.model.allocatedBudgetOpEx,readonly:!!(0,l.unref)(y).milestoneDc.model?.activities?.length,key:`${(0,l.unref)(y)?.props.planningReady.value}`},{error:(0,l.withCtx)(e=>{let{aboveMaxSpendingCapEx:n,aboveMaxSpendingOpEx:t,plannedCompletion:a,plannedCompletionLast:o,plannedOpex:i,plannedCapex:s}=e;return[a?((0,l.openBlock)(),(0,l.createElementBlock)("p",m,[(0,l.createElementVNode)("small",null,[(0,l.createElementVNode)("b",null,(0,l.toDisplayString)((0,l.unref)(k).errors.plannedCompletionPeriods),1)])])):(0,l.createCommentVNode)("v-if",!0),o?((0,l.openBlock)(),(0,l.createElementBlock)("p",u,[(0,l.createElementVNode)("small",null,[(0,l.createElementVNode)("b",null,(0,l.toDisplayString)((0,l.unref)(k).errors.lastPeriod),1)])])):(0,l.createCommentVNode)("v-if",!0),n?((0,l.openBlock)(),(0,l.createElementBlock)("p",f,[(0,l.createElementVNode)("small",null,[(0,l.createElementVNode)("b",null,(0,l.toDisplayString)((0,l.unref)(C).errors.aboveCapExBudget((0,l.unref)(r.E).Milestone)),1)])])):(0,l.createCommentVNode)("v-if",!0),t?((0,l.openBlock)(),(0,l.createElementBlock)("p",v,[(0,l.createElementVNode)("small",null,[(0,l.createElementVNode)("b",null,(0,l.toDisplayString)((0,l.unref)(C).errors.aboveOpExBudget((0,l.unref)(r.E).Milestone)),1)])])):(0,l.createCommentVNode)("v-if",!0),s?((0,l.openBlock)(),(0,l.createElementBlock)("p",g,[(0,l.createElementVNode)("small",null,[(0,l.createElementVNode)("b",null,(0,l.toDisplayString)((0,l.unref)(k).errors.plannedCapexOpexCompletionPeriods(!0)),1)])])):(0,l.createCommentVNode)("v-if",!0),i?((0,l.openBlock)(),(0,l.createElementBlock)("p",E,[(0,l.createElementVNode)("small",null,[(0,l.createElementVNode)("b",null,(0,l.toDisplayString)((0,l.unref)(k).errors.plannedCapexOpexCompletionPeriods(!1)),1)])])):(0,l.createCommentVNode)("v-if",!0)]}),_:1},8,["modelValue","frequency","max-CapEx-spending","max-OpEx-spending","readonly"]))],64))}}),y=x}}]);
//# sourceMappingURL=1143825ed12fb91b7e70.js.map