1"use strict";(window.webpackChunksdc_neos=window.webpackChunksdc_neos||[]).push([[1181],{94169:(e,t,n)=>{n.d(t,{Yt:()=>i,bx:()=>o,lm:()=>l});var a=n(34242),r=n(33719),l={priority:1,type:r.b.Required,validationErrorLabel:"Required",value:!0},i={priority:2,type:r.b.Regex,validationErrorLabel:"Only numbers allowed",value:"^(?=.*[1-9])\\d*\\.?\\d+$"},o=(r.b.Regex,r.b.MaxLength,{priority:2,type:r.b.MaxLength,validationErrorLabel:"Maximum 140 characters",value:140});a.n.Hidden,a.n.Text,r.b.Regex,r.b.Regex,a.n.Number,r.b.Required,r.b.Regex,a.n.Email,r.b.Required,r.b.Regex,a.n.Password,r.b.Required,a.n.Text,r.b.Regex,r.b.Regex,a.n.Text,r.b.Regex,r.b.Regex,a.n.Text,r.b.Regex,a.n.TextArea,r.b.Required,r.b.Regex,a.n.Select,r.b.Required,a.n.SelectMultiple,r.b.Required,a.n.SelectFilter,r.b.Required,a.n.Switch,r.b.Required,a.n.Radio,r.b.Required},8212:(e,t,n)=>{n.d(t,{m:()=>d,v:()=>a});var a,r,l=n(94184),i=n.n(l),o=n(67294),c=n(28968),u=n(72798),s=n(57709);function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},m.apply(this,arguments)}(r=a||(a={}))[r.NAVIGATION=0]="NAVIGATION",r[r.COUNT=1]="COUNT",r[r.DELETE=2]="DELETE",r[r.CLOSE=3]="CLOSE",r[r.LOADING=4]="LOADING";var d=function(e){var t,n,r,l,d,v,y,f,g,b,E,p,h,_,D=e.submitHandler,N=e.actions,S=e.currentStep,A=e.totalSteps,C=e.onNextStep,w=e.onBackStep,T=e.disabled,O=e.count,F=e.onRequestClose,R=e.loading,I=e.fullWidthNav,x=e.steps,k=(0,s.f)(),K={disabled:R,className:"modal-footer__nav-btn modal-footer__nav-btn__delete button--color-secondary",onClick:F},P={onClick:D,disabled:R,className:"modal-footer__nav-btn modal-footer__nav-btn__delete button--color-delete",trailingIcon:!0,loading:R},Z={disabled:R,className:"modal-footer__nav-btn button--color-secondary",onClick:w,iconId:"icon_16_arrow-left"},V={disabled:T,className:"modal-footer__nav-btn",onClick:C,iconId:"icon_16_arrow-right",trailingIcon:!0},L={onClick:D,disabled:T,className:"modal-footer__nav-btn",trailingIcon:!0,loading:R},M={className:"modal-footer__nav-btn",onClick:F};return N&&N.includes(a.DELETE)?o.createElement("div",{className:"modal-footer modal-footer__delete"},o.createElement("div",{className:"modal-footer__nav-btns__delete"},o.createElement(c.Z,m({},K),k.global.cancel),o.createElement(c.Z,m({},P),x&&(null===(t=x[0].btnSettings)||void 0===t?void 0:t.deleteBtnText)?null===(n=x[0].btnSettings)||void 0===n?void 0:n.deleteBtnText:k.global.delete))):N&&N.includes(a.NAVIGATION)?o.createElement("div",{className:i()("modal-footer",{"modal-footer-full-width":I})},N&&void 0!==S&&N[S]===a.COUNT&&o.createElement("div",{className:"modal-footer__nav-count"},o.createElement(u.Z,{className:"modal-footer__nav-count__circle"},O),o.createElement("div",{className:"modal-footer__nav-count__label"},k.global.chosenBulkItemsLabel)),S&&(null==N?void 0:N[S])===a.LOADING?null:0===A?o.createElement(c.Z,m({},L),x&&(null===(r=x[0].btnSettings)||void 0===r?void 0:r.submitBtnText)?null===(l=x[0].btnSettings)||void 0===l?void 0:l.submitBtnText:k.global.approve):0===S?o.createElement(c.Z,m({},V,{disabled:x&&(null===(d=x[S].btnSettings)||void 0===d?void 0:d.isNextButtonDisabled)||V.disabled}),x&&(null===(v=x[S].btnSettings)||void 0===v?void 0:v.nextNavText)?null===(y=x[S].btnSettings)||void 0===y?void 0:y.nextNavText:k.global.next):S&&A&&S>0&&S<A?o.createElement("div",{className:"modal-footer__nav-btns"},x&&!1!==(null===(f=x[S].btnSettings)||void 0===f?void 0:f.showBackBtn)&&o.createElement(c.Z,m({},Z),k.global.back),o.createElement(c.Z,m({},V,{disabled:x&&(null===(g=x[S].btnSettings)||void 0===g?void 0:g.isNextButtonDisabled)||V.disabled}),x&&(null===(b=x[S].btnSettings)||void 0===b?void 0:b.nextNavText)?null===(E=x[S].btnSettings)||void 0===E?void 0:E.nextNavText:k.global.next)):S===A&&x&&S?o.createElement("div",{className:"modal-footer__nav-btns"},x&&S&&!1!==(null===(p=x[S].btnSettings)||void 0===p?void 0:p.showBackBtn)&&o.createElement(c.Z,m({},Z),k.global.back),o.createElement(c.Z,m({},L),(null===(h=x[S].btnSettings)||void 0===h?void 0:h.submitBtnText)?null===(_=x[S].btnSettings)||void 0===_?void 0:_.submitBtnText:k.global.approve)):null,N&&void 0!==S&&N[S]===a.COUNT&&o.createElement("div",{className:"modal-footer__nav-end"})):N&&N.includes(a.CLOSE)?o.createElement("div",{className:i()("modal-footer",{"modal-footer-full-width":I})},o.createElement(c.Z,m({},M),k.global.close)):null}},14445:(e,t,n)=>{n.d(t,{q:()=>v});var a=n(94184),r=n.n(a),l=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){i(e,t,n[t])})}return e}var c=function(e){var t=e.children;return l.createElement("div",{className:"modal-content"},function(){if(!t)return null;if(Array.isArray(t))return t.map(function(e,t){if("function"==typeof e){var n=e;return l.createElement(n,{key:t})}return l.cloneElement(e,o({},e.props,{key:t}))});var e=t;if("function"==typeof e){var n=e;return l.createElement(n,null)}return l.cloneElement(e,o({},e.props))}())},u=n(8212),s=function(e){var t=e.isDelete,n=e.children;return l.createElement("div",{className:"".concat(t?"modal-header-delete":"modal-header")},n)},m=n(17249);const d=function(e){var t,n,a=(t=(0,l.useState)(0),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}
1(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),r=a[0],i=a[1];return{currentStep:r,handleNextStep:function(){i(function(t){return Math.min(t+1,e)})},handleBackStep:function(){i(function(e){return Math.max(e-1,0)})},totalSteps:e}};var v=function(e){var t,n=e.isOpen,a=e.onRequestClose,i=e.handleSubmit,o=e.disabled,v=e.steps,y=e.count,f=e.isDelete,g=e.loading,b=e.additionalClassNames,E=e.fullWidthNav,p=e.scrollToTheTop,h=e.contentLabel,_=d(v.length-1),D=_.currentStep,N=_.handleNextStep,S=_.handleBackStep,A=_.totalSteps,C=Array.isArray(b)?b:[],w=(0,l.useRef)(null);return v&&0!==v.length?l.createElement(m.Z,{isOpen:n,onRequestClose:a,className:r().apply(void 0,["modal-with-navigation","modal-with-navigation__modal"].concat((t=C,function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(t)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()),[{"modal-with-navigation-small modal-with-navigation-delete":f}])),overlayClassName:r()({"neos-modal-overlay__delete":f}),contentLabel:h,noInnerOverflowScroll:!0},l.createElement("div",{className:"modal-with-navigation__container"},l.createElement("div",{className:"modal-with-navigation__scrollable-container",ref:w},l.createElement(s,{isDelete:f},v[Math.min(D,A)].headers),l.createElement(c,null,v[Math.min(D,A)].content)),l.createElement("div",{className:"modal-with-navigation__fixed-footer"},l.createElement(u.m,{submitHandler:i,actions:v.map(function(e){return e.action}),onNextStep:function(){N(),w.current&&p&&w.current.scrollTo(0,0)},onBackStep:function(){S(),w.current&&p&&w.current.scrollTo(0,0)},currentStep:Math.min(D,A),totalSteps:A,disabled:o,count:y||0,onRequestClose:a,loading:g,fullWidthNav:E,steps:v})))):null}},69045:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(94184),r=n.n(a),l=n(67294);const i=function(e){var t=e.color||"default";return l.createElement("div",{className:r()("tab-menu","tab-menu--"+t,e.className)},l.createElement("div",{className:"tab-menu__inner"},e.tabs.map(function(t,n){var a,i,o=r()("tab-menu__button",e.buttonClassNames,{"tab-menu__button--isSelected":t.key===e.selectedKey,"tab-menu__button--isBeforeSelected":(null===(a=e.tabs[n+1])||void 0===a?void 0:a.key)===e.selectedKey,"tab-menu__button--isAfterSelected":(null===(i=e.tabs[n-1])||void 0===i?void 0:i.key)===e.selectedKey});return l.createElement("button",{className:o,key:n,type:"button","data-test-id":"tab-menu-button","data-test-tab-key":t.key,onClick:function(n){n.preventDefault(),e.tabClickHandler(t)}},t.label)})))}},60683:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Yt});var a=n(67294),r=n(94184),l=n.n(r),i=n(45478),o=n(24787),c=n(87191),u=n(93564),s=n(44926),m=n(95171),d=n(80707),v=n(34533),y=n(81392),f=n(29190),g=n(70416),b=n(49441),E=n(79406),p=n(43346),h=n(57492),_=n(83850),D=n(28968),N=n(48491),S=n(12461),A=n(23258),C=n(80714),w=n(75168),T=n(44268),O=n(40769),F=n(87399),R=n(64857),I=n(1822),x=n(58082),k=n(57709),K=n(11603),P=n(68038),Z=function(e){var t=e.labels,n=e.securities,r=e.type,l=e.securitiesTotalValues,i=(0,k.f)(),o=(0,x.Z)({data:n,itemId:"securityCombinedKey",initialSort:{comparableFunction:(0,P.v4)("securityName"),sortId:"securityName"},sortOrder:K.D.ASC}),c=o.items,u=o.sortBy,s=o.sortId,m=o.sortOrder,d=o.toggleExpand,Z=o.isExpanded;return a.createElement(A.i,{className:"security-list-se-table",columnSpacing:!0,widen:!0},a.createElement(T.s,null,a.createElement(R.S,null,a.createElement(w.D,{className:"security-list-se-table__icon"}),a.createElement(w.D,{className:"security-list-se-table__name"},a.createElement(S.Z,{labels:{sortLabel:i.global.name},selected:"securityName"===s,sortOrder:m,onClick:function(){return u((0,P.v4)("securityName"),"securityName")}})),a.createElement(w.D,{className:"security-list-se-table__quantity",hideOnSizes:["small","medium"],alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:r===f.a.BOND?i.global.nominal:i.global.quantity},selected:"quantity"===s,sortOrder:m,onClick:function(){return u(p.HG,"quantity")}})),a.createElement(w.D,{className:"security-list-se-table__price",hideOnSizes:["small","medium"],alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:i.global.price},selected:"price"===s,sortOrder:m,onClick:function(){return u(p.$W,"price")}})),a.createElement(w.D,{className:"security-list-se-table__sub-price-date",hideOnSizes:["small","medium"],alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:i.priceDate},selected:"priceDate"===s,sortOrder:m,onClick:function(){return u(p.fq,"priceDate")}})),a.createElement(w.D,{className:"security-list-se-table__sub-purchase-price",hideOnSizes:["small","medium"],alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:i.global.purchasePrice},selected:"purchasePrice"===s,sortOrder:m,onClick:function(){return u(p.fq,"purchasePrice")}})),a.createElement(a.Fragment,null,a.createElement(w.D,{className:"security-list-se-table__value-change",hideOnSizes:["small"],alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:i.global.valueChangePercentage},selected:"valueChangePercentage"===s,sortOrder:m,onClick:function(){return u(p.R8,"valueChangePercentage")}})),a.createElement(w.D,{className:"security-list-se-table__value-change",hideOnSizes:["small","medium"],alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:i.global.valueChange},selected:"valueChange"===s,sortOrder:m,onClick:function(){return u(p.SL,"valueChange")}}))),a.createElement(w.D,{className:"security-list-se-table__value",alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:i.global.value},selected:"value"===s,sortOrder:m,onClick:function(){return u(p.NW,"value")}})),a.createElement(w.D,{className:"security-list-se-table__arrow",hideOnSizes:["small"]}))),a.createElement(C.R,null,!n.length&&a.createElement(O.q,null,i.global.noSecurities),c.map(function(n){var r,l,i=Z(n),o=i?"icon_16_arrow-up":"icon_16_arrow-down",c=n.securityType===f.a.SHARE||n.securityType===f.a.FUND,u=null===(r=new Date(n.price.date))||void 0===r?void 0:r.toLocaleDateString();return a.createElement(a.Fragment,{key:n.securityCombinedKey},a.createElement(R.S,{hover:!0,onClick:function(){return c&&d(n)},className:"security-list-se-table__row",expandedSibling:i},a.createElement(w.D,{className:"security-list-se-table__name",highlight:i},a.createElement(_.Z,{size:"medium",imageUrl:(0,v.f)(e.logoUrl,n.isin,n.securityType,y._i.Large)})),a.createElement(w.D,{className:"security-list-se-table__name"},a.createElement(h.q,{name:n.securityName})),a.createElement(w.D,{className:"security-list-se-table__quantity",hideOnSizes:["small","medium"]},a.createElement(g.$,{type:g.x.BALANCE,value:n.quantity.decimalValue,formatOptions:n.securityType===f.a.SHARE?{maximumFractionDigits:0}:{minimumFractionDigits:n.quantity.noOfDecimals,maximumFractionDigits:n.quantity.noOfDecimals}})),a.createElement(w.D,{className:"security-list-se-table__price",hideOnSizes:["small","medium"]},a.createElement(N.u,{listenTo:n.price.amount.decimalValue},a.createElement(g.$,{type:g.x.BALANCE,value:n.price.amount.decimalValue,currency:n.price.currencyCode,showCurrencyDisplay:!0,showAsInvestmentAmount:!0,formatOptions:{style:"decimal"}}))),a.createElement(w.D,{className:"security-list-se-table__sub-price-date",hideOnSizes:["small","medium"]},u),a.createElement(w.D,{className:"security-list-se-table__sub-purchase-price",hideOnSizes:["small","medium"]},a.createElement(N.u,{listenTo:n.marketValueInvested.amount.decimalValue},n.changeToday.value&&a.createElement(g.$,{type:g.x.BALANCE,value:n.marketValueInvested.amount.decimalValue,currency:n.marketValueInvested.currencyCode,showAsInvestmentAmount:!0,showCurrencyDisplay:!0}))),a.createElement(w.D,{className:"security-list-se-table__value-change",hideOnSizes:["small"]},a.createElement(N.u,{listenTo:n.changeToday.percentage.decimalValue},a.createElement(b.i,{value:n.changeToday.percentage.decimalValue,formattedValue:I.H.formatPercentage(n.changeToday.percentage),bold:!0,showIcon:!0,iconPosition:"right"}))),a.createElement(w.D,{className:"security-list-se-table__value-change",hideOnSizes:["small","medium"]},a.createElement(N.u,{listenTo:null===(l=n.changeToday.value)||void 0===l?void 0:l.amount.decimalValue},n.changeToday.value&&a.createElement(g.$,{type:g.x.BALANCE,value:n.changeToday.value.amount.decimalValue,currency:n.changeToday.value.currencyCode,showAsInvestmentAmount:!0,showCurrencyDisplay:!0}))),a.createElement(w.D,{className:"security-list-se-table__value"},a.createElement(N.u,{listenTo:n.marketValue.amount.decimalValue},a.createElement(g.$,{type:g.x.BALANCE,value:n.marketValue.amount.decimalValue,currency:n.marketValue.currencyCode,showAsInvestmentAmount:!0,showCurrencyDisplay:!0}))),a.createElement(w.D,{className:"security-list-se-table__arrow",hideOnSizes:["small"],noBorder:!0,hidden:!c}
1,a.createElement(D.Z,{iconId:o,color:"link",noBorder:!0}))),i&&a.createElement(F.X,{className:"security-list-se-table__row-nested",hidden:!c},a.createElement(E.S,{labels:t,securityCombinedKey:n.securityCombinedKey,mandatoryFormFields:e.mandatoryFormFields,currentCustodyAccount:e.currentCustodyAccount,showSellButton:!0})))}),a.createElement(R.S,{className:"security-list-se-table__total-sum-row"},a.createElement(w.D,null),a.createElement(w.D,null,i.total),a.createElement(w.D,{hideOnSizes:["small","medium"]}),a.createElement(w.D,{hideOnSizes:["small","medium"]}),a.createElement(w.D,{hideOnSizes:["small","medium"]}),a.createElement(w.D,{alignRight:!0,hideOnSizes:["small","medium"]},l&&a.createElement(g.$,{type:g.x.BALANCE,value:l.totalPurchaseValue.amount.decimalValue,currency:l.totalPurchaseValue.currencyCode,showAsInvestmentAmount:!0,showCurrencyDisplay:!0})),a.createElement(w.D,{alignRight:!0,hideOnSizes:["small"]},l&&a.createElement(b.i,{value:l.totalValueChange.percentage.decimalValue,formattedValue:I.H.formatPercentage(l.totalValueChange.percentage),bold:!0,showIcon:!0,iconPosition:"right"})),a.createElement(w.D,{alignRight:!0,hideOnSizes:["small","medium"]},l&&a.createElement(g.$,{type:g.x.BALANCE,value:l.totalValueChange.value.amount.decimalValue,currency:l.totalValueChange.value.currencyCode,showAsInvestmentAmount:!0,showCurrencyDisplay:!0})),a.createElement(w.D,{alignRight:!0},l&&a.createElement(g.$,{type:g.x.BALANCE,value:l.totalValue.amount.decimalValue,currency:l.totalValue.currencyCode,showAsInvestmentAmount:!0,showCurrencyDisplay:!0})),a.createElement(w.D,{hideOnSizes:["small"]}))))},V=n(11054),L=n(14578),M=n(23558),q=function(e){var t=e.labels,n=e.custodyAccountCombinedKey,r=e.size,v=e.logoUrl,y=(0,k.f)(),f=(0,L.Z)(),g=(0,m.F)(),b=(0,o.Rj)({custodyAccountCombinedKey:n},{refetchInterval:g}),E=b.data,p=b.isLoading,h=b.error,_=(0,i.XF)({custodyAccountCombinedKey:n},{refetchInterval:g}),D=_.data,N=_.isLoading,S=_.error||h;S&&f.dismissable(S);var A=(0,u.Z)(function(e){return e.securityType},(null==E?void 0:E.securities)||[]),C=(0,M.bw)(Object.keys(A)),w=l()("security-list-se","security-list-se--".concat(r));return p||N?a.createElement("div",{className:w},a.createElement(V.Z,{fillHeight:!0})):a.createElement("div",{className:w},!C.length&&a.createElement("div",{className:"security-list-se__empty"},y.global.noSecurities),C.map(function(n,r){return a.createElement("div",{key:n},a.createElement("div",{className:"security-list-se__section-title"},a.createElement(s.Z,{labels:{title:(0,c.B)(e.labels.typeMapping,n)}}),0===r&&a.createElement("div",{className:"security-list-se__subscription-rates-link"},a.createElement(d.D,{realTimeRatesUrl:e.realTimeRatesUrl}))),a.createElement(Z,{labels:t,type:n,securities:A[n]||[],mandatoryFormFields:e.mandatoryFormFields,currentCustodyAccount:e.custodyAccountCombinedKey,logoUrl:v,custodyAccountType:null==D?void 0:D.accountTypeId,securitiesTotalValues:null==E?void 0:E.securitiesTotalValues[n]}))}))},U=n(79533),j=n(62550),B=n(79405),H=n(69189),Y=n(59137),z=n(20253),G=n(31354),W=n(20371),X=function(e){var t=e.tradeInformation,n=t.title,r=t.links,l=t.text;return a.createElement("div",{className:"trade_information_se"},n&&a.createElement(s.Z,{labels:{title:n},className:"trade_information_se__title"}),!!r.length&&a.createElement("ul",{className:"trade_information_se__link"},null==r?void 0:r.map(function(e){return a.createElement("li",{key:e.text},a.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},e.text))})),l&&a.createElement("p",null,l))},$=n(27249),Q=n(90062),J=n(83248),ee=n(24248);var te=function(e){var t,n,r,l,i=e.custodyAccountCombinedKey,o=(0,k.f)(),c=(new Date).getFullYear(),u=(r=(0,a.useState)(c),l=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}(r,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),s=u[0],m=u[1],d=(0,$.J7)({custodyAccountCombinedKey:i,year:s}
1),v=d.data,y=d.isLoading,f=d.error,g=(0,L.Z)();if(f&&g.dismissable(f),y)return a.createElement("div",{className:"standard-tax-income"},a.createElement(J.Z,null));var b=[0,1,2,3,4].map(function(e){var t=c-e;return{value:t,label:t.toString()}});return a.createElement("div",{className:"standard-tax-income"},a.createElement("div",{className:"standard-tax-income__select-year"},a.createElement("span",{className:"standard-tax-income__select-year__text"},o.standardTaxIncomeForTheYear),a.createElement(ee.f,{label:(null===(t=b.find(function(e){return e.value===s}))||void 0===t?void 0:t.label)||"",icon:"icon_16_view-calendar-stroke",onSelect:function(e){return m(e.value)},options:b})),a.createElement(A.i,null,a.createElement(T.s,null,a.createElement(R.S,null,a.createElement(w.D,null,o.global.quarter),a.createElement(w.D,{alignRight:!0},o.global.currency),a.createElement(w.D,{alignRight:!0},o.global.securities),a.createElement(w.D,{alignRight:!0},o.global.balance),a.createElement(w.D,{alignRight:!0},o.global.deposit),a.createElement(w.D,{alignRight:!0},o.transfers),a.createElement(w.D,{alignRight:!0},o.global.total),a.createElement(w.D,{alignRight:!0},o.global.capitalBase),a.createElement(w.D,{alignRight:!0}
1,o.standardTaxIncome))),a.createElement(C.R,null,null==v||null===(n=v.quarters)||void 0===n?void 0:n.map(function(e){return a.createElement(R.S,{key:e.quarter},a.createElement(w.D,null,e.quarter),a.createElement(w.D,{alignRight:!0},e.currency),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.possesion,e.currency||Q.NE.SEK)),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.balance,e.currency||Q.NE.SEK)),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.deposit,e.currency||Q.NE.SEK)),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.transfers,e.currency||Q.NE.SEK)),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.total,e.currency||Q.NE.SEK)),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.capTotal,e.currency||Q.NE.SEK)),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.standardTaxIncome,e.currency||Q.NE.SEK)))}),a.createElement(R.S,{className:"standard-tax-income__total-sum-row"},a.createElement(w.D,null),a.createElement(w.D,{alignRight:!0}),a.createElement(w.D,{alignRight:!0}),a.createElement(w.D,{alignRight:!0}),a.createElement(w.D,{alignRight:!0}),a.createElement(w.D,{alignRight:!0}),a.createElement(w.D,{alignRight:!0}),a.createElement(w.D,{alignRight:!0},o.global.total),a.createElement(w.D,{alignRight:!0},v&&I.H.formatCurrency(v.totalStandardTaxIncome,Q.NE.SEK))))))},ne=n(10717),ae=n(55994),re=n(96967),le=n(56244),ie=n(14445),oe=n(8212),ce=function(){var e=(0,k.f)();return a.createElement("div",{className:"modal-header__title modal-header__title-delete"},a.createElement("span",null,e.deleteFundSaving))},ue=function(e){var t=e.fundName;return a.createElement("h1",{className:"modal-header__title modal-header__title-center"},t)},se=n(33087),me=n(75622),de=n(37155);function ve(e,t,n,a,r,l,i){try{var o=e[l](i),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(a,r)}var ye=n(35666),fe=function(e){var t=e.fund,n=e.showDeleteFundSavingsAgreement,r=e.handleCloseModal,l=e.custodyAccountCombinedKey,i=e.agreementCombinedKey,o=(0,se.V)(),c=o.mutateAsync,u=o.error,s=(0,de.su)(),m=(0,L.Z)();u&&m.dismissable(u);var d,v,y,f=(v=(0,a.useState)(!1),y=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}(v,y)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),g=f[0],b=f[1],E=(d=ye.mark(function e(t){var n;return ye.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,b(!0),e.next=4,c(t);case 4:return n=e.sent,e.next=7,s({signable:n,state:{receiptType:me.p1.FUND_SAVING_DELETE,dynamicLinkData:[{key:"id",value:l},{key:"agreementCombinedKey",value:i},{key:"tab",value:W.e.FUND_SAVINGS_AGREEMENT}]},onBeforeRedirect:function(e){e.invalidateQueries(ae.Kc,{refetchActive:!1})}});case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),b(!1),m.dismissable(e.t0);case 13:case"end":return e.stop()}},e,null,[[0,9]])}),function(){var e=this,t=arguments;return new Promise(function(n,a){var r=d.apply(e,t);function l(e){ve(r,n,a,l,i,"next",e)}function i(e){ve(r,n,a,l,i,"throw",e)}l(void 0)})}),p=[{headers:a.createElement(ce,null),content:a.createElement(ue,{fundName:t.accountName}),action:oe.v.DELETE}];return a.createElement(ie.q,{isOpen:n,onRequestClose:function(){return r(!1)},steps:p,handleSubmit:function(){return E({fundSavingsAgreementsCombinedKey:t.fundSavingsAgreementsCombinedKey})},disabled:!1,isDelete:!0,loading:g})},ge=n(46179),be=n(55855),Ee=n(23855),pe=n(79551),he=n(96770),_e=function(e){var t=e.isCreateFundSavings,n=(0,k.f)();return a.createElement(pe.lP,null,function(e){var r=e.values;return a.createElement(a.Fragment,null,a.createElement("h2",{className:"modal-header__title"},t?n.newFundSaving:r.fundSavingAgreementName),a.createElement("dl",{className:"modal-header__definition-list"},a.createElement("div",null,a.createElement("dt",null,n.global.accountNumber),a.createElement("dd",null,r.accountNumber)),a.createElement("div",null,a.createElement("dt",null,n.global.accountDetailsAccountType),a.createElement("dd",null,r.custodyAccountName)),r.paymentFrom&&r.debitAccountNumber&&a.createElement(a.Fragment,null,a.createElement("div",null,a.createElement("dt",null,n.payingCustomer),a.createElement("dd",null,r.paymentFrom)),a.createElement("div",null,a.createElement("dt",null,n.fromAccount),a.createElement("dd",null,r.debitAccountNumberDetails?I.H.formatAccountAndClearingNumber(r.debitAccountNumberDetails.accountNumber,r.debitAccountNumberDetails.clearingNumber):he.zG)))))})},De=n(18297),Ne=n(34242),Se=n(32946),Ae=n(58868),Ce=n(3002),we=n(22092),Te=n(18480),Oe=n(82412),Fe=n(94169),Re=n(49104),Ie=n(313),xe=n(77349),ke=n(42699),Ke=n(49546),Pe=n(69822),Ze=n(27484),Ve=n.n(Ze),Le=n(99373),Me=n(48659);function qe(){return qe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},qe.apply(this,arguments)}function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}
1(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var je=function(e){var t,n,r=e.mandatoryFormFields,l=e.setValidity,i=e.agreementCombinedKey,o=e.debitAccountNumber,c=e.paymentDate,u=e.isCreateFundSavings,s=(0,pe.cI)(),m=(0,k.f)(),d=(0,Oe.aj)().selectedAccountHolders,v=(0,Me.Z)().data,y=(0,Le.Hq)({accountHolders:d,includeDataAboutGuarantees:v===Q.vZ.PRIVATE}).data,f=void 0===y?[]:y,g=(0,he.pt)(i),b=null==f?void 0:f.filter(function(e){return g(e)}),E=b.find(function(e){return e.accountClearingNumber+e.accountNumber===o})||void 0,p=null==E?void 0:E.accountCombinedKey;(0,a.useEffect)(function(){void 0!==p&&s.change("fromAccount",p)},[E,s,p]);var h,_=(h=s,["fundSavingAgreementName","fundSavingsAgreementsCombinedKey","amount","pauseFrom","pauseTo"].some(function(e){var t;return!!(null===(t=h.getFieldState(e))||void 0===t?void 0:t.invalid)}));l(_);var D,N,S=s.getState().initialValues&&s.getState().initialValues.startPaymentDateDay,A=(0,a.useCallback)(function(e){var t=new Date,n=c&&(0,Ee.Z)(c)||new Date;15===parseInt(e,10)?n=new Date(t.getFullYear(),t.getMonth(),15):28===parseInt(e,10)&&(n=new Date(t.getFullYear(),t.getMonth(),28)),n&&n<t&&(n=new Date(t.getFullYear(),t.getMonth()+1,(0,be.Z)(n)));var a=[new Date(t.getFullYear(),t.getMonth()-1,(0,be.Z)(n)),new Date(t.getFullYear(),t.getMonth(),(0,be.Z)(n)),new Date(t.getFullYear(),t.getMonth()+1,(0,be.Z)(n))],r=a&&a.reduce(function(e,n){var a=Math.abs((0,Re.Z)(t,n));return a<e.daysDifference?{date:n,daysDifference:a}:e}
1,{date:a[0],daysDifference:Math.abs((0,Re.Z)(t,a[0]))});return(0,Ie.Z)(t,(0,xe.Z)(r.date,4))&&(0,ke.Z)(t,(0,xe.Z)(r.date,-4))&&(0,Ie.Z)(n,(0,xe.Z)(r.date,4))&&(0,ke.Z)(n,(0,xe.Z)(r.date,-4))&&(n=new Date(n.getFullYear(),n.getMonth()+1,(0,be.Z)(n))),n},[c]),C=Ue((0,a.useState)(S),2),w=C[0],T=C[1],O=Ue((0,a.useState)(A(w)),2),F=O[0],R=O[1],I=null!==(D=s.getState().values.pauseFrom)&&void 0!==D?D:null===(t=s.getState().initialValues)||void 0===t?void 0:t.pauseFrom,x=null!==(N=s.getState().values.pauseTo)&&void 0!==N?N:null===(n=s.getState().initialValues)||void 0===n?void 0:n.pauseTo;(0,a.useEffect)(function(){A(w)},[A,w]);var K=Ue((0,a.useState)(c&&Ve()(new Date).isAfter(new Date(c))?new Date(F.getFullYear(),F.getMonth()+1,1):new Date(F.getFullYear(),F.getMonth(),1)),2),P=K[0],Z=K[1],V=Ue((0,a.useState)(c&&Ve()(new Date).isAfter(new Date(c))?new Date(F.getFullYear()+1,F.getMonth(),1):new Date(F.getFullYear()+1,F.getMonth()-1,1)),2),L=V[0],M=V[1],q=Ue((0,a.useState)(I),2),U=q[0],j=q[1],B=Ue((0,a.useState)(null!=x?x:new Date(F.getFullYear()+1,F.getMonth(),1)),2),H=B[0],Y=B[1],z=function(e){Y(""!==e?e:new Date(F.getFullYear()+1,F.getMonth(),1)),Ve()(e).isValid()&&M(new Date(F.getFullYear()+1,F.getMonth(),1))},G=Ue((0,a.useState)(!!I&&!!x),2),W=G[0],X=G[1];return a.createElement("div",{className:"modal-content__form"},a.createElement("div",{className:"modal-content__form__input-container--full"},a.createElement(we.yE,qe({},r.fundSavingAgreementName,{id:"fundSavingAgreementName",label:m.ownNameOfSaving,validationRules:r.fundSavingAgreementName.validationRules,type:Ne.n.Text})),u&&a.createElement(pe.lP,null,function(e){var t=e.form,n=e.values;return a.createElement(Ae.Z,{fieldType:{label:m.fromAccount,validationRules:[Fe.lm]},id:"fromAccount",selectedAccountKey:n.fromAccount,groups:d.map(function(e){var t=(0,De.Q5)(b,e);return{title:d.length>1?e.name:"",options:(0,Ce.Mv)(t)}}).filter(function(e){return e.options.length>0}),onOptionSelected:function(e){return e?t.change("fromAccount",e.accountCombinedKey):t.change("fromAccount","")},onClearSelected:function(){t.change("fromAccount","")}})}),a.createElement(Te.Z,qe({},r.amount,{label:m.global.amount,validationRules:(0,he.vv)(m),id:"amount",type:Ne.n.Number,fractionDigits:2,annotation:"SEK"}))),a.createElement("div",{className:"modal-content__form__details-container"},a.createElement(we.e5,{id:"startPaymentDateDay",type:Ne.n.Radio,label:m.dayOfPayment,infoLabel:F?"".concat(m.firstPaymentDate," ").concat((0,Ke.Z)(F,"dd.MM.yyyy")):"",validationRules:[],fieldAttributes:{onChange:function(e){var t,n;T(e.target.value),R(A(e.target.value)),F&&(t=F,n=new Date(t.getFullYear(),t.getMonth()+1,1),Z(n))}},options:[{value:"15",label:"15"},{value:"28",label:"28"}]}),a.createElement(we.e5,{id:"frequency",type:Ne.n.Radio,label:m.frequency,validationRules:[],options:[{value:"M",label:m.monthly},{value:"Q",label:m.quarterly}]})),!u&&a.createElement(a.Fragment,null,a.createElement("div",{className:"modal-content__form__details-container--2col"},a.createElement(Se.Z,{label:m.fundEndDate,validationRules:[],id:"endDate",className:"modal-content__form__datepicker",type:Ne.n.DatePicker,iconId:"icon_16_view-calendar-stroke",showMonthYearPicker:!0,minDate:P.toISOString(),onChange:z,leadingIcon:!0,clearable:!0,clearDateLabel:"X"})),a.createElement("div",{className:"modal-content__form__details-container--2col"},a.createElement(Pe.Z,{labels:{tooltip:m.addPausePeriod},hideTooltip:!0,inputProps:{"aria-label":m.addPausePeriod,onChange:function(){W&&(j(""),Y(""),s.change("pauseFrom",void 0),s.change("pauseTo",void 0)),X(!W)},checked:W||void 0!==s.getState().values.pauseFrom&&void 0!==s.getState().values.pauseTo}}),a.createElement("label",{className:"modal-content__form-checkbox__label"},m.addPausePeriod)),W&&a.createElement("div",{className:"modal-content__form__details-container--2col"},a.createElement(Se.Z,{label:m.pauseStartDate,validationRules:[W&&(0,he.n0)(m)],id:"pauseFrom",type:Ne.n.DatePicker,iconId:"icon_16_view-calendar-stroke",minDate:P.toISOString(),maxDate:H,onChange:function(e){return j(e)},showMonthYearPicker:!0,clearable:!0,clearDateLabel:"X",leadingIcon:!0}),a.createElement(Se.Z,{label:m.pauseEndDate,validationRules:[W&&(0,he.n0)(m)],id:"pauseTo",type:Ne.n.DatePicker,iconId:"icon_16_view-calendar-stroke",minDate:U,maxDate:L.toISOString(),onChange:z,showMonthYearPicker:!0,clearable:!0,clearDateLabel:"X",leadingIcon:!0}))))},Be=n(18709),He=n(43433),Ye=function(e){var t=e.securitySearchResult,n=e.filterText,r=e.showOnlySelectedFunds,l=e.initialSelectedFunds,i=e.selectedFunds,o=e.addFund,c=e.removeFund,u=e.disabled,s=e.setDisabled,m=(0,k.f)(),d=a.useMemo(function(){return(null==l?void 0:l.map(function(e){return e.securityKey}))||[]},[l]),v=(0,x.Z)({itemId:"securityCombinedKey",data:t,sortOrder:K.D.ASC,initialSort:{sortId:"securityName",comparableFunction:(0,P.v4)("securityName")},preselectedData:t.filter(function(e){return d.includes(e.securityCombinedKey)})}),y=v.items,f=v.sortId,g=v.sortBy,b=v.sortOrder,E=v.toggleSelect,p=v.isSelected,h=(0,He.L0)(y,{filters:[{attribute:["securityName"],filter:(0,He.OE)(n)}]}),_=!i||0===i.length;_!==u&&s(_);var D=i&&i.length>=10,N=function(e){var t,n=e.links&&(null===(t=e.links.find(function(e){return e.type===Be.n_.FUND_DETAILS}))||void 0===t?void 0:t.url);return a.createElement(R.S,{height:"56px",key:e.securityCombinedKey},a.createElement(w.D,{colWidth:"60px"},a.createElement(Pe.Z,{labels:{tooltip:""},hideTooltip:!0,inputProps:{disabled:D&&!p(e),"aria-label":"",checked:p(e),id:e.securityCombinedKey,onChange:function(t){if(t.stopPropagation(),p(e)){var n=i.findIndex(function(t){return t.securityKey===e.securityCombinedKey});n>=0&&c(n)}else o({name:e.securityName,securityKey:e.securityCombinedKey,percentage:"0"});E(e)}}})),a.createElement(w.D,{alignLeft:!0},e.securityName),a.createElement(w.D,{colWidth:"16px"},a.createElement("button",{disabled:!n,className:"edit-fund-savings-agreement-funds__link-button",onClick:function(){n&&window.open(n,"_blank")}},a.createElement(re.Z,{iconId:"icon_16_link"}))))};return a.createElement(A.i,{columnSpacing:!0,hasScroll:!0},a.createElement(T.s,null,a.createElement(R.S,{height:"56px"},a.createElement(w.D,{colWidth:"60px"}),a.createElement(w.D,{alignLeft:!0,noBorder:!0},a.createElement(S.Z,{labels:{sortLabel:m.fundName},selected:"securityName"===f,sortOrder:b,onClick:function(){return g((0,P.v4)("securityName"),"securityName")}})),a.createElement(w.D,{colWidth:"80px",noBorder:!0},m.fundInfo))),a.createElement(C.R,null,h.map(function(e){return r?p(e)&&N(e):N(e)})))},ze=n(74563),Ge=n(12992),We=function(e){var t=e.filterText,n=e.showOnlySelectedFunds,r=e.disabled,l=e.setDisabled,i=(0,Ge.f_)({securityType:f.a.FUND,isTradable:!0}),o=i.data,c=i.isLoading,u=i.error,s=(0,L.Z)();return u&&s.dismissable(u),a.createElement("div",{className:"edit-fund-savings-agreement-funds"},o&&a.createElement(ze.F2,{name:"funds"},function(e){var i=e.fields;return a.createElement(Ye,{securitySearchResult:o,filterText:t,showOnlySelectedFunds:n,initialSelectedFunds:i.value,selectedFunds:i.value,addFund:function(e){return i.push(e)},removeFund:function(e){return i.remove(e)},disabled:r,setDisabled:l})}),c&&a.createElement(V.Z,null))};function Xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Xe(e,t,n[t])})}return e}var Qe=function(e){var t,n,r=e.disabled,i=e.setDisabled,o=(0,k.f)(),c=(t=(0,a.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}
1(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),u=c[0],s=c[1],m=(0,Ge.f_)({securityType:f.a.FUND,isTradable:!0}),d=m.data,v=m.error,y=(0,L.Z)();return v&&y.dismissable(v),a.createElement("div",{className:"edit-fund-savings-agreement-distribution"},a.createElement(pe.gN,{name:"amount"},function(e){var t=e.input;return a.createElement(ze.F2,{name:"funds"},function(e){var n,c,m,v=e.fields,y=v.value.reduce(function(e,t){return e+(!!t.percentage&&parseInt(t.percentage)||0)},0),f=100!=y,g=f||v.value.some(function(e){return 0===parseInt(e.percentage)});g!==r&&i(g);var b=d&&v.value.map(function(e){return d.find(function(t){return t.securityCombinedKey===e.securityKey})}),E=v.value.map(function(e){return t.value*(!!e.percentage&&parseInt(e.percentage)||0)*.01}),p=null==E?void 0:E.reduce(function(e,t){return e+t},0);return a.createElement(A.i,{columnSpacing:!0,hasScroll:!0},a.createElement(T.s,null,a.createElement(R.S,null,a.createElement(w.D,{alignRight:!0,noBorder:!0,noUpperCase:!0},a.createElement(D.Z,{small:!0,color:"secondary",shadow:!0,noBorder:!0,onClick:function(){var e=Math.trunc(100/v.value.length);if(v.value.length>0){for(var t=0;t<v.value.length-1;t++)v.update(t,$e({},v.value[t],{percentage:e.toString()}));v.update(v.value.length-1,$e({},v.value[v.value.length-1],{percentage:(100-e*(v.value.length-1)).toString()})),s(!0)}}},u&&o.evenDistribution||o.chooseEvenDistribution)),a.createElement(w.D,{noBorder:!0,colWidth:"100px",alignRight:!0,noUpperCase:!0},o.percentageWithSymbol),a.createElement(w.D,{noBorder:!0,colWidth:"150px",noUpperCase:!0},o.global.amount))),a.createElement(C.R,null,a.createElement(a.Fragment,null,v.map(function(e,t){return a.createElement(R.S,{key:e,height:"56px"},a.createElement(w.D,null,b&&(null===(n=b[t])||void 0===n?void 0:n.securityName)||""),a.createElement(w.D,{alignRight:!0},a.createElement(Te.Z,{label:"",validationRules:[],id:"".concat(e,".percentage"),type:Ne.n.Number,fractionDigits:0,annotation:"%",penEdit:!0,fieldAttributes:{onChange:function(e){if(e.target.value){var n=parseInt(e.target.value);n>100&&(n=100,v.update(t,$e({},v.value[t],{percentage:n.toString()}))),n<0&&(n=0,v.update(t,$e({},v.value[t],{percentage:n.toString()})))}s(!1)},placeholder:"0"}})),a.createElement(w.D,null,I.H.formatCurrency(E[t]||0,b&&(null===(c=b[t])||void 0===c?void 0:c.price.currencyCode)||Q.NE.SEK,{intl:{maximumFractionDigits:2,minimumFractionDigits:2},showCurrencyDisplay:!0})))}),a.createElement(R.S,{key:"total",height:"56px"},a.createElement(w.D,null,a.createElement("div",{className:"edit-fund-savings-agreement-distribution___total"},o.global.total)),a.createElement(w.D,{alignRight:!0},a.createElement("div",{className:l()("edit-fund-savings-agreement-distribution___total",{"edit-fund-savings-agreement-distribution___total--error":f})},"".concat(I.H.formatNumber({value:y})," %"))),a.createElement(w.D,null,a.createElement("div",{className:l()("edit-fund-savings-agreement-distribution___total",{"edit-fund-savings-agreement-distribution___total--error":f})},p&&I.H.formatCurrency(p,b&&(null===(m=b[0])||void 0===m?void 0:m.price.currencyCode)||Q.NE.SEK,{intl:{maximumFractionDigits:2,minimumFractionDigits:2},showCurrencyDisplay:!0})))))))})}))},Je=n(54712),et=n(35062),tt=function(e){var t=e.filterText,n=e.showOnlySelectedFunds,r=e.setShowOnlySelectedFunds,l=e.setFilterText,i=(0,k.f)();return a.createElement("div",{className:"edit-fund-savings-agreement-funds-header"},a.createElement("h2",{className:"modal-header__title"},i.selectFunds),a.createElement("div",{className:"edit-fund-savings-agreement-funds-header__info-text"},i.maxSelectableFunds),a.createElement("div",{className:"edit-fund-savings-agreement-funds-header__filter-container"},a.createElement(Je.D,{className:"edit-fund-savings-agreement-funds-header__search",inputProps:{value:t,onChange:function(e){return l(e.target.value)},disabled:n}}),a.createElement(et.Z,{className:"edit-fund-savings-agreement-funds-header__toggle",label:i.showOnlySelectedFunds,fieldAttributes:{checked:n,onChange:function(){return r(!n)}}})))},nt=n(78977),at=function(e){var t=e.currencyCode,n=(0,k.f)();return a.createElement(pe.gN,{name:"amount"},function(e){var r=e.input;return a.createElement(a.Fragment,null,a.createElement("h2",{className:"modal-header__title"},n.selectDistribution),(0,nt.Z)(n.investmentAmountToBeDistributed,{amount:I.H.formatCurrency(r.value,t,{showCurrencyDisplay:!0})}))})},rt=n(73342);function lt(e,t,n,a,r,l,i){try{var o=e[l](i),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(a,r)}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){it(e,t,n[t])})}return e}function ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}
1(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ut,st=n(35666),mt=function(e){var t,n=e.fund,r=e.showEditFundSavingsAgreement,l=e.handleCloseModal,i=e.custodyAccountCombinedKey,o=e.custodyAccountName,c=e.agreementCombinedKey,u=e.mandatoryFormFields,s=ct((0,a.useState)(!1),2),m=s[0],d=s[1],v=(0,ge.d)(),y=v.mutateAsync,f=v.error,g=(0,de.su)(),b=(0,L.Z)();f&&b.dismissable(f);var E,p=ct((0,a.useState)(!1),2),h=p[0],_=p[1],D=(E=st.mark(function e(t){var n;return st.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,_(!0),e.next=4,y(t);case 4:return n=e.sent,e.next=7,g({signable:n,state:{receiptType:me.p1.FUND_SAVING_UPDATED,dynamicLinkData:[{key:"id",value:i},{key:"agreementCombinedKey",value:c},{key:"tab",value:W.e.FUND_SAVINGS_AGREEMENT}]},onBeforeRedirect:function(e){e.invalidateQueries(ae.Kc,{refetchActive:!1})}});case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),_(!1),b.dismissable(e.t0);case 13:case"end":return e.stop()}},e,null,[[0,9]])}),function(){var e=this,t=arguments;return new Promise(function(n,a){var r=E.apply(e,t);function l(e){lt(r,n,a,l,i,"next",e)}function i(e){lt(r,n,a,l,i,"throw",e)}l(void 0)})}),N=n.paymentDate&&(0,be.Z)((0,Ee.Z)(n.paymentDate)).toString(),S=(0,a.useMemo)(function(){return(null===(t=n.fund)||void 0===t?void 0:t.map(function(e){return{name:e.name,securityKey:e.securityKey,percentage:e.percentage.decimalValue.toString()}}))||[]},[n.fund]),A={fundSavingAgreementName:n.accountName,amount:n.amount.amount.decimalValue,debitAccountNumber:n.debitAccountNumber,debitAccountNumberDetails:n.debitAccountNumberDetails,startPaymentDateDay:N,frequency:n.frequency,endDate:n.endDate,accountNumber:n.accountNumber,pauseFrom:n.pauseStartDate,pauseTo:n.pauseEndDate,paymentFrom:n.paymentFrom,custodyAccountName:o,fromAccount:"",funds:S,isFundsEvenDistribution:!1,paymentDate:n.paymentDate},C=ct((0,a.useState)(""),2),w=C[0],T=C[1],O=ct((0,a.useState)(!1),2),F=O[0],R=O[1],I=[{headers:a.createElement(_e,{isCreateFundSavings:!1}),content:a.createElement(je,{setValidity:d,agreementCombinedKey:c,debitAccountNumber:n.debitAccountNumber,mandatoryFormFields:u,paymentDate:n.paymentDate,isCreateFundSavings:!1}),action:oe.v.NAVIGATION},{headers:a.createElement(tt,{filterText:w,setFilterText:T,showOnlySelectedFunds:F,setShowOnlySelectedFunds:R}),content:a.createElement(We,{filterText:F?"":w,showOnlySelectedFunds:F,disabled:m,setDisabled:d}),action:oe.v.COUNT},{headers:a.createElement(at,{currencyCode:n.amount.currencyCode}),content:a.createElement(Qe,{disabled:m,setDisabled:d}),action:oe.v.COUNT}];return a.createElement(pe.l0,{onSubmit:function(e){Math.trunc(100/e.funds.length);var t,a,r,l,i=e.funds.every(function(e){parseInt(e.percentage)}),o=(null===(t=e.endDate)||void 0===t?void 0:t.length)&&(0,Ee.Z)(e.endDate)||void 0;D({fundSavingsAgreementsCombinedKey:n.fundSavingsAgreementsCombinedKey,fundSavingAgreementName:e.fundSavingAgreementName,startPaymentDateDay:(null===(a=e.startPaymentDateDay)||void 0===a?void 0:a.length)&&parseInt(e.startPaymentDateDay),endPaymentDateMonth:o&&o.getMonth()+1,endPaymentDateYear:null==o?void 0:o.getFullYear(),amount:e.amount,pauseFrom:(null===(r=e.pauseFrom)||void 0===r?void 0:r.length)&&e.pauseFrom||void 0,pauseTo:(null===(l=e.pauseTo)||void 0===l?void 0:l.length)&&e.pauseTo||void 0,frequency:e.frequency,funds:e.funds.map(function(e){var t=e.securityKey,n=e.percentage;return{securityKey:t,percentage:parseInt(n)}}),isFundsEvenDistribution:i})},mutators:ot({},rt.Z),initialValues:A,render:function(e){var t=e.values,n=e.handleSubmit,i=e.hasValidationErrors,o=e.form;return a.createElement("form",{onSubmit:n},a.createElement(ie.q,{isOpen:r,onRequestClose:function(){l(!1),o.reset()},loading:h,steps:I,handleSubmit:n,disabled:m||i,count:t.funds.length}))}})},dt=function(e){var t,n=e.fundList,r=(0,k.f)();return a.createElement("div",null,a.createElement(s.Z,{labels:{title:r.funds}}),a.createElement("div",{className:"fund-savings-agreement-fund-list__table"},a.createElement(A.i,null,a.createElement(T.s,null,a.createElement(R.S,null,a.createElement(w.D,null,r.fundName),a.createElement(w.D,null,r.percentageWithSymbol))),a.createElement(C.R,null,
1n&&n.map(function(e){return a.createElement(R.S,{key:e.name},a.createElement(w.D,null,a.createElement("a",{className:"fund-savings-agreement-fund-list__link",href:null===(t=e.links[0])||void 0===t?void 0:t.url,target:"_blank",rel:"noreferrer"},e.name)),a.createElement(w.D,{className:"fund-savings-agreement-fund-list__percentage",alignRight:!0},"".concat(e.percentage.decimalValue," %")))})))))},vt=n(56996);function yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ft(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var gt=function(e){var t,n=e.fund,r=(0,k.f)(),l=(yt(ut={},le.D.Q,r.quarterly),yt(ut,le.D.M,r.monthly),ut),i=[{label:r.payingCustomer,value:n.paymentFrom},{label:r.fromAccount,value:n.debitAccountNumberDetails?I.H.formatAccountAndClearingNumber(n.debitAccountNumberDetails.accountNumber,n.debitAccountNumberDetails.clearingNumber):he.zG},{label:r.global.amount,value:I.H.formatCurrency(null!==(t=n.amount.amount.decimalValue)&&void 0!==t?t:0,n.amount.currencyCode||Q.NE.SEK)},{label:r.global.currency,value:n.amount.currencyCode||Q.NE.SEK},{label:r.frequency,value:l[n.frequency]},{label:r.fundPaymentDate,value:Ve()(n.paymentDate).format("D")},{label:r.fundEndDate,value:n.endDate?Ve()(n.endDate).format(vt.vc.api.valueDateFormat):"-"}].concat(ft(n.pauseStartDate?[{label:r.pauseStartDate,value:Ve()(n.pauseStartDate).format(vt.vc.api.valueDateFormat)||"-",className:"fund-savings-agreement-info__table--date-background"}]:[]),ft(n.pauseEndDate?[{label:r.pauseEndDate,value:Ve()(n.pauseEndDate).format(vt.vc.api.valueDateFormat)||"-",className:"fund-savings-agreement-info__table--date-background"}]:[]));return a.createElement("div",null,a.createElement(s.Z,{labels:{title:r.global.information}}),a.createElement("div",{className:"fund-savings-agreement-info__table"},a.createElement(A.i,null,a.createElement(C.R,null,i.map(function(e,t){return a.createElement(a.Fragment,{key:t},a.createElement(R.S,{className:e.className||"",key:e.label},a.createElement(w.D,null,e.label),a.createElement(w.D,{alignRight:!0},a.createElement("div",null,e.value))))})))))};function bt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Et=function(e){var t,n,r=e.custodyAccountCombinedKey,l=e.fundAgreement,i=e.custodyAccountName,o=e.agreementCombinedKey,c=e.mandatoryFormFields,u=bt((0,a.useState)(!1),2),m=u[0],d=u[1],v=bt((0,a.useState)(!1),2),y=v[0],f=v[1],g=(0,k.f)();return a.createElement(a.Fragment,null,a.createElement("div",{className:"fund_savings_agreement_details"},a.createElement(s.Z,{labels:{title:l.accountName},className:"fund_savings_agreement_details__title"}),a.createElement("div",{className:"fund_savings_agreement_details__buttons"},a.createElement(D.Z,{type:"button",iconId:"icon_16_edit",shadow:!0,onClick:function(){d(!0)},disabled:!(null===(t=l.permissions)||void 0===t?void 0:t.includes(le.V.EDIT))},g.editSaving),a.createElement(D.Z,{type:"button",iconId:"icon_28_trash",color:"brand-4-on-white",onClick:function(){f(!0)},disabled:!(null===(n=l.permissions)||void 0===n?void 0:n.includes(le.V.DELETE))},g.deleteSaving))),a.createElement("div",{className:"fund_savings_agreement_details"},a.createElement(gt,{fund:l}),a.createElement(dt,{fundList:l.fund})),m&&a.createElement(mt,{fund:l,showEditFundSavingsAgreement:m,handleCloseModal:d,custodyAccountCombinedKey:r,custodyAccountName:i,agreementCombinedKey:o,mandatoryFormFields:c}
1),y&&a.createElement(fe,{fund:l,showDeleteFundSavingsAgreement:y,handleCloseModal:f,custodyAccountCombinedKey:r,custodyAccountName:i,agreementCombinedKey:o}))},pt=n(43732);function ht(e,t,n,a,r,l,i){try{var o=e[l](i),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(a,r)}function _t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){_t(e,t,n[t])})}return e}function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var St,At=n(35666),Ct=function(e){var t=e.showCreateFundSavingsAgreement,n=e.handleCloseModal,r=e.custodyAccountCombinedKey,l=e.agreementCombinedKey,i=e.mandatoryFormFields,o=e.custodyAccountName,c=e.accountNumber,u=Nt((0,a.useState)(!1),2),s=u[0],m=u[1],d=(0,pt.h)(),v=d.mutateAsync,y=d.error,f=(0,de.su)(),g=(0,L.Z)();y&&g.dismissable(y);var b,E=Nt((0,a.useState)(!1),2),p=E[0],h=E[1],_=(b=At.mark(function e(t){var n;return At.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h(!0),e.next=4,v(t);case 4:return n=e.sent,e.next=7,f({signable:n,state:{receiptType:me.p1.FUND_SAVING_CREATED,dynamicLinkData:[{key:"id",value:r},{key:"agreementCombinedKey",value:l},{key:"tab",value:W.e.FUND_SAVINGS_AGREEMENT}]},onBeforeRedirect:function(e){e.invalidateQueries(ae.Kc,{refetchActive:!1})}});case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),h(!1),g.dismissable(e.t0);case 13:case"end":return e.stop()}},e,null,[[0,9]])}),function(){var e=this,t=arguments;return new Promise(function(n,a){var r=b.apply(e,t);function l(e){ht(r,n,a,l,i,"next",e)}function i(e){ht(r,n,a,l,i,"throw",e)}l(void 0)})}),D={fundSavingAgreementName:"",startPaymentDateDay:"28",frequency:le.D.M,custodyAccountName:o,accountNumber:c,fromAccount:""},N=Nt((0,a.useState)(""),2),S=N[0],A=N[1],C=Nt((0,a.useState)(!1),2),w=C[0],T=C[1],O=[{headers:a.createElement(_e,{isCreateFundSavings:!0}),content:a.createElement(je,{setValidity:m,agreementCombinedKey:l,mandatoryFormFields:i,isCreateFundSavings:!0}),action:oe.v.NAVIGATION},{headers:a.createElement(tt,{filterText:S,setFilterText:A,showOnlySelectedFunds:w,setShowOnlySelectedFunds:T}),content:a.createElement(We,{filterText:w?"":S,showOnlySelectedFunds:w,disabled:s,setDisabled:m}),action:oe.v.COUNT},{headers:a.createElement(at,{currencyCode:Q.NE.SEK}),content:a.createElement(Qe,{disabled:s,setDisabled:m}),action:oe.v.COUNT}];return a.createElement(pe.l0,{onSubmit:function(e){e.funds&&Math.trunc(100/e.funds.length);var t,n,a,l=e.funds&&e.funds.every(function(e){parseInt(e.percentage)});_({custodyAccountCombinedKey:r,accountCombinedKey:e.fromAccount,fundSavingAgreementName:e.fundSavingAgreementName,startPaymentDateDay:(null===(t=e.startPaymentDateDay)||void 0===t?void 0:t.length)&&parseInt(e.startPaymentDateDay),endPaymentDateMonth:(null===(n=e.endDate)||void 0===n?void 0:n.length)&&(0,Ee.Z)(e.endDate).getMonth(),endPaymentDateYear:(null===(a=e.endDate)||void 0===a?void 0:a.length)&&(0,Ee.Z)(e.endDate).getFullYear(),amount:e.amount,frequency:e.frequency,funds:e.funds&&e.funds.map(function(e){var t=e.securityKey,n=e.percentage;return{securityKey:t,percentage:parseInt(n)}}),isFundsEvenDistribution:null!=l&&l})},mutators:Dt({},rt.Z),initialValues:D,render:function(e){var r=e.values,l=e.handleSubmit,i=e.hasValidationErrors,o=e.form;return a.createElement("form",{onSubmit:l},a.createElement(ie.q,{isOpen:t,onRequestClose:function(){n(!1),o.reset()},steps:O,handleSubmit:l,disabled:s||i,count:r.funds&&r.funds.length,loading:p}))}})};function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tt,Ot,Ft=function(e){var t,n,r=e.custodyAccountCombinedKey,l=e.custodyAccountName,i=e.agreementCombinedKey,o=e.mandatoryFormFields,c=e.accountNumber,u=(0,k.f)(),m=(wt(St={},le.D.Q,u.quarterly),wt(St,le.D.M,u.monthly),St),d=(0,ae.KD)({custodyAccountCombinedKey:r}
1),v=d.data,y=d.isLoading,f=d.error,g=(0,a.useMemo)(function(){return(null!=v?v:[]).map(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){wt(e,t,n[t])})}return e}({},e,{paymentDateDay:Ve()(e.paymentDate).format("D")})})},[v]),b=(0,x.Z)({data:g,itemId:"fundSavingsAgreementsCombinedKey",initialSort:{comparableFunction:(0,P.v4)("accountName"),sortId:"accountName"},sortOrder:K.D.ASC}),E=b.items,p=b.sortBy,h=b.sortId,_=b.sortOrder,N=b.toggleExpand,O=b.isExpanded,Z=(t=(0,a.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),V=Z[0],M=Z[1],q=(0,L.Z)();return f&&q.dismissable(f),y?a.createElement(J.Z,null):(null==v?void 0:v.length)?a.createElement("div",null,a.createElement("div",{className:"fund_savings_agreement_details fund_savings_agreement_details__no-savings__title"},a.createElement(s.Z,{labels:{title:u.savings},className:"fund_savings_agreement__title"}),a.createElement(D.Z,{type:"button",iconId:"icon_16_plus",shadow:!0,onClick:function(){M(!0)}},u.createSaving)),E.length>1?a.createElement(A.i,{className:"fund_savings_agreement__table",columnSpacing:!0,widen:!0},a.createElement(T.s,null,a.createElement(R.S,null,a.createElement(w.D,{className:"fund_savings_agreement__icon"}),a.createElement(w.D,null,a.createElement(S.Z,{labels:{sortLabel:u.global.name},selected:"accountName"===h,sortOrder:_,onClick:function(){return p((0,P.v4)("accountName"),"accountName")}})),a.createElement(w.D,{alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:u.global.amount},selected:"amount"===h,sortOrder:_,onClick:function(){return p((0,P.v4)("amount"),"amount")}})),a.createElement(w.D,{alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:u.fundPaymentDate},selected:"paymentDate"===h,sortOrder:_,onClick:function(){return p((0,P.v4)("paymentDateDay"),"paymentDateDay")}})),a.createElement(w.D,{alignRight:!0},a.createElement(S.Z,{labels:{sortLabel:u.frequency},selected:"frequency"===h,sortOrder:_,onClick:function(){return p((0,P.v4)("frequency"),"frequency")}})),a.createElement(w.D,{className:"fund_savings_agreement__arrow",hideOnSizes:["small"]}
1))),a.createElement(C.R,null,null==E?void 0:E.map(function(e,t){var n=O(e),c=n?"icon_16_arrow-up":"icon_16_arrow-down";return a.createElement(a.Fragment,{key:t},a.createElement(R.S,{hover:!0,onClick:function(){return N(e)},className:"fund_savings_agreement__row",expandedSibling:n,key:"row-".concat(e.fundSavingsAgreementsCombinedKey)},a.createElement(w.D,{className:"fund_savings_agreement__icon_column",noBorder:!0},a.createElement("div",{className:"fund_savings_agreement__icon_container"},a.createElement(re.Z,{className:"fund_savings_agreement__icon",iconId:"icon_16_investment"}))),a.createElement(w.D,{className:"fund-savings-agreement__name"},e.accountName),a.createElement(w.D,{alignRight:!0},I.H.formatCurrency(e.amount.amount||0,e.amount.currencyCode||Q.NE.SEK)),a.createElement(w.D,{alignRight:!0},e.paymentDateDay),a.createElement(w.D,{alignRight:!0},m[e.frequency]),a.createElement(w.D,{className:"fund_savings_agreement__arrow",hideOnSizes:["small"],noBorder:!0},a.createElement(D.Z,{iconId:c,color:"link",noBorder:!0}))),n&&a.createElement(F.X,{key:"nested-row-".concat(e.fundSavingsAgreementsCombinedKey),className:"fund_savings_agreement__row-nested"},a.createElement(Et,{custodyAccountCombinedKey:r,fundAgreement:e,custodyAccountName:l,agreementCombinedKey:i,mandatoryFormFields:o})))}))):a.createElement(Et,{custodyAccountCombinedKey:r,fundAgreement:E[0],custodyAccountName:l,agreementCombinedKey:i,mandatoryFormFields:o}),V&&a.createElement(Ct,{showCreateFundSavingsAgreement:V,handleCloseModal:M,custodyAccountCombinedKey:r,custodyAccountName:l,agreementCombinedKey:i,mandatoryFormFields:o,accountNumber:c})):a.createElement(a.Fragment,null,a.createElement("div",{className:"fund_savings_agreement_details fund_savings_agreement_details__no-savings__title"},a.createElement(s.Z,{labels:{title:u.savings},className:"fund_savings_agreement__title"}),a.createElement(D.Z,{type:"button",iconId:"icon_16_plus",shadow:!0,onClick:function(){M(!0)}},u.createSaving)),a.createElement("div",{className:"fund_savings_agreement_details fund_savings_agreement_details__no-savings__content"},a.createElement("p",null,u.noSavings)),V&&a.createElement(Ct,{showCreateFundSavingsAgreement:V,handleCloseModal:M,custodyAccountCombinedKey:r,custodyAccountName:l,agreementCombinedKey:i,mandatoryFormFields:o,accountNumber:c}))},Rt=n(21135),It=n(33203),xt=n(28627),kt=n(35781);function Kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pt=function(e){var t=e.custodyAccountCombinedKey,n=(0,xt.Xe)({custodyAccountCombinedKey:t}),r=n.data,l=n.isLoading,i=(0,k.f)(),o=(0,a.useMemo)(function(){var e,t,n,a,l;return r?[{label:i.depositTotal,value:I.H.formatCurrency(null!==(n=r.depositTotal.amount.decimalValue)&&void 0!==n?n:0,r.depositTotal.currencyCode||Q.NE.SEK,{showCurrencyDisplay:!0})},{label:i.creditInterestRate,value:I.H.formatNumber({value:r.creditInterestRate.decimalValue,formatOptions:{maximumFractionDigits:r.creditInterestRate.noOfDecimals}})},{label:i.recoveriesDuringTheYear,value:I.H.formatCurrency(null!==(a=r.recoveriesDuringTheYear.amount.decimalValue)&&void 0!==a?a:0,r.recoveriesDuringTheYear.currencyCode||Q.NE.SEK,{showCurrencyDisplay:!0})},{label:i.preliminaryYieldTax,value:I.H.formatCurrency(null!==(l=null===(e=r.preliminaryYieldTax)||void 0===e?void 0:e.amount.decimalValue)&&void 0!==l?l:0,(null===(t=r.preliminaryYieldTax)||void 0===t?void 0:t.currencyCode)||Q.NE.SEK,{showCurrencyDisplay:!0})}]:[]},[r,i]),c=(0,a.useMemo)(function(){if(!r)return[];var e,t=(Kt(Tt={},kt.U.UNKNOWN,i.global.unknown),Kt(Tt,kt.U.MONTH,i.global.month),Kt(Tt,kt.U.QUARTER,i.global.quarter),Kt(Tt,kt.U.FOUR_MONTHS,i.global.fourMonths),Kt(Tt,kt.U.SIX_MONTHS,i.global.sixMonths),Kt(Tt,kt.U.YEAR,i.global.year),Tt),n=(Kt(Ot={},kt.V.SPOUSE_OR_PARTNER_AND_IF_MISSING_THEN_CHILDREN,i.spouseOrPartnerAndIfMissingThenChildren),Kt(Ot,kt.V.SPOUSE_OR_PARTNER_AND_CHILDREN,i.spouseOrPartnerAndChildren),Kt(Ot,kt.V.CHILDREN_AND_IF_MISSING_THEN_SPOUSE_OR_PARTNER,i.childrenAndIfMissingThenSpouseOrPartner),Kt(Ot,kt.V.CHILDREN,i.children),Kt(Ot,kt.V.NONE,i.global.foreignTransferCostTypeNone),Ot);return[{label:i.paymentAge,value:r.paymentAge},{label:i.durationInvUniSE,value:r.duration},{label:i.frequencyInvUniSE,value:t[r.frequency]}
1,{label:i.privateInvUniSE,value:r.isPrivate?i.global.yes:i.global.no},{label:i.stopDate,value:r.stopDate?Ve()(r.stopDate).format(vt.vc.api.valueDateFormat):"-"},{label:i.firstPaymentDate,value:r.firstPaymentDate?Ve()(r.firstPaymentDate).format(vt.vc.api.valueDateFormat):"-"},{label:i.lastPaymentDateTerms,value:r.lastPaymentDate?Ve()(r.lastPaymentDate).format(vt.vc.api.valueDateFormat):"-"},{label:i.irrevocable,value:r.isIrrevocable?i.global.yes:i.global.no}].concat(function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e=r.taxPercent?[{label:i.tax,value:I.H.formatPercentage(r.taxPercent,!0)}]:[])||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}(),[{label:i.beneficiaryDescription,value:n[r.beneficiary]}])},[i,r]);return l?a.createElement(V.Z,null):a.createElement("div",{className:"overview-terms-ips__container"},o.length>0&&a.createElement("div",{className:"overview-terms-ips__column"},a.createElement(s.Z,{labels:{title:i.global.exportOverviewTab}}),a.createElement(A.i,{containerClassName:"overview-terms-ips__table"},a.createElement(C.R,null,o.map(function(e){return a.createElement(R.S,{key:e.label},a.createElement(w.D,null,e.label),a.createElement(w.D,{alignRight:!0},a.createElement("div",null,e.value)))})))),c.length>0&&a.createElement("div",{className:"overview-terms-ips__column"},a.createElement(s.Z,{labels:{title:i.termsOfAgreement}}),a.createElement(A.i,{containerClassName:"overview-terms-ips__table"},a.createElement(C.R,null,c.map(function(e){return a.createElement(R.S,{key:e.label},a.createElement(w.D,null,e.label),a.createElement(w.D,{alignRight:!0},a.createElement("div",null,e.value)))})))))},Zt=n(11088),Vt=n(84054);var Lt=function(e){var t,n,r,l,i,o,c,u,s,m,d=e.custodyAccountCombinedKey,v=(0,k.f)(),y=Mt(),f=(t=(0,a.useState)(y.currentYear),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),g=f[0],b=f[1],E=(0,Zt.$)({custodyAccountCombinedKey:d,year:g},{enabled:!!g}),p=E.data,h=E.isLoading,_=E.error,D=(0,L.Z)();return _&&D.dismissable(_),a.createElement("div",null,a.createElement("div",{className:"tax-declaration-support__selector-card-body"},a.createElement("span",{className:"tax-declaration-support__selector-text"},v.realizedProfitOrLoss)," ",a.createElement(Vt.Z,{options:[{value:y.currentYear,label:y.currentYear},{value:y.previousYear,label:y.previousYear}],value:g,onChange:function(e){return b(e)},"aria-label":v.global.selectAYear})),a.createElement("div",null,h?a.createElement(V.Z,null):_?a.createElement("p",{className:"tax-declaration-support__error-text"},v.global.unexpectedError):(null==p||null===(r=p.taxDeclarations)||void 0===r?void 0:r.length)?a.createElement(A.i,null,a.createElement(T.s,null,a.createElement(R.S,null,a.createElement(w.D,{alignLeft:!0},v.tradeDate),a.createElement(w.D,{alignLeft:!0},v.fund),a.createElement(w.D,{alignRight:!0},v.quantity),a.createElement(w.D,{alignRight:!0},v.global.purchasePrice),a.createElement(w.D,{alignRight:!0},v.currentValue),a.createElement(w.D,{alignRight:!0}
1,v.profitLoss))),a.createElement(C.R,null,null==p||null===(l=p.taxDeclarations)||void 0===l?void 0:l.map(function(e){return a.createElement(R.S,{key:"".concat(e.fund,"-").concat(null===(i=e.profitLoss)||void 0===i?void 0:i.decimalValue.toString())},a.createElement(w.D,{alignLeft:!0},I.H.formatShortDate(e.tradeDate||"")),a.createElement(w.D,{alignLeft:!0},e.fund),a.createElement(w.D,{alignRight:!0},null===(o=e.shares)||void 0===o?void 0:o.decimalValue.toString()),a.createElement(w.D,{alignRight:!0},null===(c=e.purchasePrice)||void 0===c?void 0:c.decimalValue.toString()),a.createElement(w.D,{alignRight:!0},null===(u=e.currentValue)||void 0===u?void 0:u.decimalValue.toString()),a.createElement(w.D,{alignRight:!0},null===(s=e.profitLoss)||void 0===s?void 0:s.decimalValue.toString()))}),a.createElement(R.S,{key:"sum"},a.createElement(w.D,null),a.createElement(w.D,null),a.createElement(w.D,null),a.createElement(w.D,null),a.createElement(w.D,{alignRight:!0},a.createElement("b",null,v.sum)),a.createElement(w.D,{alignRight:!0},a.createElement("b",null,null==p||null===(m=p.sum)||void 0===m?void 0:m.decimalValue.toString()))))):a.createElement("p",{className:"tax-declaration-support__no-trades-text"},v.noTradesSelectedYear)))},Mt=function(){return{currentYear:(new Date).getFullYear().toString(),previousYear:((new Date).getFullYear()-1).toString()}};function qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw l}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ut(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var jt=function(e){var t,n=(0,k.f)(),r=qt((0,G.Z)(),2),o=r[0],c=r[1],u=null==c?void 0:c.size,s=(0,i.XF)({custodyAccountCombinedKey:e.custodyAccountCombinedKey}),m=s.data,d=s.error,v=s.isLoading,y=(0,Rt.dc)(),f=y.data,g=y.error,b=y.isLoading,E=null==f?void 0:f.agreementRoles.find(function(e){return e.agreement===(null==m?void 0:m.agreementCombinedKey)}),p=(0,L.Z)(),h=d||g;h&&p.dismissable(h);var _=null===(t=e.tradeInformation)||void 0===t?void 0:t.filter(function(e){return e.type===function(e){if(!e)return"";var t=e===ne.q.NET_DEPOT?ne.q.DEPOT:e;return(Object.entries(ne.q).find(function(e){var n=qt(e,2);return n[0],n[1]===t})||"")[0]}(null==m?void 0:m.accountTypeId)})[0],D=(null==m?void 0:m.accountTypeId)&&[ne.q.FUND,ne.q.IP,ne.q.ISK].includes(m.accountTypeId)&&(null==E?void 0:E.roles.some(function(e){return[It.u.INVESTMENT_UNIVERSE_FUNDS,It.u.INVESTMENT_UNIVERSE_FUNDS].includes(e)})),N=(null==m?void 0:m.accountTypeId)===ne.q.IP&&(null==E?void 0:E.roles.some(function(e){return[It.u.INVESTMENT_UNIVERSE_FUNDS].includes(e)})),S=[{key:W.e.SECURITIES,label:n.global.securities},{key:W.e.ORDERS,label:n.orders},{key:W.e.TRANSACTIONS,label:n.global.transactions}].concat(Ut(D?[{key:W.e.FUND_SAVINGS_AGREEMENT,label:n.mySavings}]:[]),Ut((null==m?void 0:m.accountTypeId)===ne.q.FUND?[{key:W.e.TAX_DECLARATION_SUPPORT,label:n.declarationSupport}]:[]),Ut((null==m?void 0:m.accountTypeId)===ne.q.ISK?[{key:W.e.STANDARD_TAX_INCOME,label:n.standardTaxIncome}]:[]),Ut(N?[{key:W.e.OVERVIEW_AND_TERMS,label:n.overviewAndTerms}]:[]),Ut(_?[{key:W.e.TRADE_INFORMATION,label:n.tradeInformation}]:[])),A=qt((0,a.useState)(W.e.SECURITIES),2),C=A[0],w=A[1];(0,a.useEffect)(function(){var e,t=null!==(e=new URLSearchParams(window.location.search).get("tab"))&&void 0!==e?e:"SECURITIES";w(W.e[t])},[]);var T=l()("custody-account-activities-se",u&&"custody-account-activities-se--".concat(u)),O=v||b;return a.createElement(a.Fragment,null,!O&&a.createElement(a.Fragment,null,a.createElement("div",{className:T,ref:o},a.createElement("div",{className:"custody-account-activities-se__tab-menu"},a.createElement(z.Z,{tabs:S,selectedKey:C,tabClickHandler:function(e){return w(e.key)},color:"investment"})),u&&a.createElement(H.Z,null,a.createElement(Y.Z,null,C===W.e.SECURITIES&&a.createElement(q,{custodyAccountCombinedKey:e.custodyAccountCombinedKey,labels:e.labels,mandatoryFormFields:e.mandatoryFormFields,size:u,logoUrl:e.logoUrl,realTimeRatesUrl:e.realTimeRatesUrl}),C===W.e.ORDERS&&a.createElement(U.q,{custodyAccountCombinedKey:e.custodyAccountCombinedKey,labels:e.labels,size:u,mandatoryFormFields:e.mandatoryFormFields}),C===W.e.TRANSACTIONS&&a.createElement(j.y,{custodyAccountCombinedKey:e.custodyAccountCombinedKey,labels:e.labels,size:u}),C===W.e.TAX_DECLARATION_SUPPORT&&a.createElement(Lt,{custodyAccountCombinedKey:e.custodyAccountCombinedKey}),C===W.e.STANDARD_TAX_INCOME&&a.createElement(te,{custodyAccountCombinedKey:e.custodyAccountCombinedKey}),C===W.e.FUND_SAVINGS_AGREEMENT&&a.createElement(Ft,{custodyAccountCombinedKey:e.custodyAccountCombinedKey,custodyAccountName:null==m?void 0:m.accountName,agreementCombinedKey:e.agreementCombinedKey,mandatoryFormFields:e.mandatoryFormFields,accountNumber:null==m?void 0:m.accountNumber}),C===W.e.OVERVIEW_AND_TERMS&&a.createElement(Pt,{custodyAccountCombinedKey:e.custodyAccountCombinedKey}),C===W.e.TRADE_INFORMATION&&_&&a.createElement(X,{tradeInformation:_})))),a.createElement(B.h,null)))},Bt=n(80449);function Ht(){return Ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Ht.apply(this,arguments)}const Yt=function(e){var t=e.contextModel.custodyAccountCombinedKey||(0,Bt.EH)("id"),n=(0,Bt.EH)("agreementCombinedKey");if(!t)throw new Error("No ID available");if(!n)throw new Error("No Agreement Combined Key available");return a.createElement(jt,Ht({},e.contextModel,{custodyAccountCombinedKey:t,agreementCombinedKey:n}))}}}]); 2//# sourceMappingURL=1181.c910096e6a0b02357f84.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.