PageSourceSearch

https://merchant.vatcompliance.co/static/js/route-addons.61418622.chunk.js

js vatcompliance.co collected 2026-10-01 12:03:19 UTC 15,183 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunklappa_app=self.webpackChunklappa_app||[]).push([[1370],{29496:(e,i,t)=>{t.r(i),t.d(i,{default:()=>S});var n=t(65043),s=t(91232),l=t(26699),o=t(60279),r=t(76930),a=t(83003),u=t(52399),_=t(15756),c=t(52496),d=t(45847),f=t(17848),p=t(79416),b=t(58030),v=t(42181),m=t(47386),y=t(41881),h=t(25686),g=t(59354),x=t(11157),D=t(22658),A=t(43243),w=t(42803),k=t(12292),j=t(71754),N=(t(12347),t(99579),t(26407),t(58361),t(55665),t(70579));const T=e=>{let{selectedTabKey:i}=e;const{clearServices:t}=(0,x.W)(),s=(0,n.useRef)(i);return(0,n.useEffect)((()=>{if(s.current===i)return;const e="subscriptions"===s.current,n="subscriptions_sales_tax"===s.current;(e&&"subscriptions_sales_tax"===i||n&&"subscriptions"===i)&&t(),s.current=i}),[i]),null},E=e=>{let{selectedTab:i,selectedTabKey:t,isAddonsPurchase:s=!0}=e;const l=(0,u.Ay)(),{user:o}=(0,a.d4)((e=>e.user)),r=(0,_.A)(),d=(0,a.d4)((e=>e.subscription.currentPlan)),f=(0,a.d4)((e=>e.subscription.subscriptionPlans)),{periodSettings:p}=(0,a.d4)((e=>e.subscriptionBuilder)),b="LEPR"===r,v="LTax"===r,m="LInvoice"===r,E="LAuthorize"===r,S=(0,n.useMemo)((()=>{if(!d)return null;let e=null;if(b)e=d.subscriptions_epr;else if(E)e=(0,c.rs)(d);else if(m)if("subscriptions_omp"===t)e=d.subscriptions_omp;else if("subscriptions_invoice"===t){const i=d.subscriptions_invoice;e=i?i.subscriptions||i:null}else e=null;else if(v)e="subscriptions_omp"===t?d.subscriptions_omp:"subscriptions_sales_tax"===t?d.subscriptions_sales_tax:d.subscriptions;else if("subscriptions_epr"===t)e=d.subscriptions_epr;else if("subscriptions_sales_tax"===t)e=d.subscriptions_sales_tax;else if("subscriptions_omp"===t)e=d.subscriptions_omp;else if("subscriptions"===t)e=d.subscriptions;else if("subscriptions_auth"===t)e=(0,c.rs)(d);else switch(i){case 0:default:e=d.subscriptions;break;case 1:e=d.subscriptions_sales_tax;break;case 2:e=d.subscriptions_epr;break;case 3:e=null}return e}),[d,i,t,b,v,m,E]);(0,n.useEffect)((()=>{(m||E)&&l((0,y.m4)("annually"))}),[m,E,l]),(0,n.useLayoutEffect)((()=>{if(!s||!d||!S)return;const e=d.currency_code?String(d.currency_code).toLowerCase():"eur";l((0,y.MN)((0,g.M)(S,e)))}),[s,d,S,l]);const L=(0,n.useMemo)((()=>{var e;return S&&((null===(e=S.tariff_plan)||void 0===e?void 0:e.name)||S.name)||null}),[S]);(0,n.useEffect)((()=>{var e,n;if(!S||!f||!s)return;const o=null===(e=S.tariff_plan)||void 0===e?void 0:e.id,r=null===(n=S.tariff_plan)||void 0===n?void 0:n.name;if(!o&&!r)return;let a=null;const u=Array.isArray(f)?f[0]:f;if(!u)return;let _=null;if(b)_=u.tariff_epr||u.tariff_plan_epr;else if(E)_=u.tariff_plan_auth;else if(m)_="subscriptions_omp"===t?u.tariff_plan_omp||u.tariff_omp:u.tariff_plan_inv||u.tariff_inv;else if(v)_="subscriptions_omp"===t?u.tariff_plan_omp||u.tariff_omp:"subscriptions_sales_tax"===t?u.tariff_plan_sales_tax:u.tariff_plan||u.tariff_plan_vat;else if("subscriptions_epr"===t)_=u.tariff_epr||u.tariff_plan_epr;else if("subscriptions_sales_tax"===t)_=u.tariff_plan_sales_tax;else if("subscriptions_omp"===t)_=u.tariff_plan_omp||u.tariff_omp;else if("subscriptions"===t)_=u.tariff_plan||u.tariff_plan_vat;else if("subscriptions_invoice"===t)_=u.tariff_plan_inv||u.tariff_inv;else if("subscriptions_auth"===t)_=u.tariff_plan_auth;else switch(i){case 0:_=u.tariff_plan||u.tariff_plan_vat;break;case 1:_=u.tariff_plan_sales_tax;break;case 2:_=u.tariff_epr||u.tariff_plan_epr;break;case 3:_=u.tariff_plan_inv||u.tariff_inv}_&&Array.isArray(_)&&(a=_.find((e=>o&&e.id===o||r&&e.name===r))),a&&l((0,y.Lg)(a))}),[S,f,s,i,t]);const I=(0,n.useRef)(!1),P=(0,n.useRef)(null);(0,n.useEffect)((()=>{var e;if(!S||!s)return;const n=S.id||(null===(e=S.tariff_plan)||void 0===e?void 0:e.id)||JSON.stringify({month_from:S.month_from,year_from:S.year_from,month_till:S.month_till,year_till:S.year_till,current_billing_date:S.current_billing_date});if(P.current===n&&I.current)return;let o=null,r=null,a=null;if(E){const e=e=>{if(!e)return null;const i=String(e).trim().match(/^(\d{4})-(\d{2})-(\d{2})/);if(i)return new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));const t=new Date(e);return Number.isNaN(t.getTime())?null:t},i=e(S.current_billing_date);if(i&&(o=i,r=new Date(i),r.setFullYear(r.getFullYear()+1)),!o){var u,_;const i=null!==(u=S.month_from)&&void 0!==u?u:S.month_from_sbs,t=null!==(_=S.year_from)&&void 0!==_?_:S.year_from_sbs;if(i&&t){var c,f;const e=Number(null!==(c=null!==(f=S.day_from)&&void 0!==f?f:S.day_from_sbs)&&void 0!==c?c:1)||1;o=new Date(t,i-1,e)}else S.period_from?o=e(S.period_from):S.date_from&&(o=e(S.date_from))}if(!r){var h,g;const i=null!==(h=S.month_till)&&void 0!==h?h:S.month_till_sbs,t=null!==(g=S.year_till)&&void 0!==g?g:S.year_till_sbs;if(i&&t){var x,D,A,w;const e=Number(null!==(x=null!==(D=null!==(A=null!==(w=S.day_till)&&void 0!==w?w:S.day_till_sbs)&&void 0!==A?A:S.day_from)&&void 0!==D?D:S.day_from_sbs)&&void 0!==x?x:1)||1;r=new Date(t,i-1,e)}else S.period_till?r=e(S.period_till):S.date_till?r=e(S.date_till):S.your_next_billing_date_invoice||S.your_next_billing_date?r=e(S.your_next_billing_date_invoice||S.your_next_billing_date):o&&(r=new Date(o),r.setFullYear(r.getFullYear()+1))}}else if(m){var k,j,N,T;const e=null!==(k=S.month_from)&&void 0!==k?k:S.month_from_sbs,i=null!==(j=S.year_from)&&void 0!==j?j:S.year_from_sbs;if(e&&i){var L,M;const t=Number(null!==(L=null!==(M=S.day_from)&&void 0!==M?M:S.day_from_sbs)&&void 0!==L?L:1)||1;o=new Date(i,e-1,t)}
1else S.period_from?o=new Date(S.period_from):S.date_from?o=new Date(S.date_from):S.date&&(o=new Date(S.date));const t=null!==(N=S.month_till)&&void 0!==N?N:S.month_till_sbs,n=null!==(T=S.year_till)&&void 0!==T?T:S.year_till_sbs;if(t&&n){var B,F,z,R;const e=Number(null!==(B=null!==(F=null!==(z=null!==(R=S.day_till)&&void 0!==R?R:S.day_till_sbs)&&void 0!==z?z:S.day_from)&&void 0!==F?F:S.day_from_sbs)&&void 0!==B?B:1)||1;r=new Date(n,t-1,e)}else S.period_till?r=new Date(S.period_till):S.date_till?r=new Date(S.date_till):o?r=new Date(o.getFullYear(),o.getMonth()+11,o.getDate()):null!==d&&void 0!==d&&d.your_next_billing_date_invoice&&(r=new Date(d.your_next_billing_date_invoice))}else S.month_from&&S.year_from?o=new Date(S.year_from,S.month_from-1,1):S.month_from_sbs&&S.year_from_sbs?o=new Date(S.year_from_sbs,S.month_from_sbs-1,1):S.period_from?o=new Date(S.period_from):S.date_from?o=new Date(S.date_from):S.date&&(o=new Date(S.date));if(S.month_till&&S.year_till)r=new Date(S.year_till,S.month_till,0);else if(S.month_till_sbs&&S.year_till_sbs)r=new Date(S.year_till_sbs,S.month_till_sbs,0);else if(S.period_till)r=new Date(S.period_till);else if(S.date_till)r=new Date(S.date_till);else if(d&&!r){let e=null;if(b)e=d.your_next_billing_date_epr;else if(v)e="subscriptions_omp"===t?d.your_next_billing_date_omp:"subscriptions_sales_tax"===t?d.your_next_billing_date_sales_tax:d.your_next_billing_date;else if(m){var Y,O,K,C;e=null!==(Y=null!==(O=d.your_next_billing_date_invoice)&&void 0!==O?O:null===(K=d.subscriptions_invoice)||void 0===K?void 0:K.your_next_billing_date)&&void 0!==Y?Y:null===(C=d.subscriptions_invoice)||void 0===C?void 0:C.your_next_billing_date_invoice}else if(E){var V,$,q;e=null!==(V=null!==($=null!==(q=S.your_next_billing_date_invoice)&&void 0!==q?q:S.your_next_billing_date)&&void 0!==$?$:d.your_next_billing_date_auth)&&void 0!==V?V:null}else switch(i){case 0:e=d.your_next_billing_date;break;case 1:e=d.your_next_billing_date_sales_tax;break;case 2:e=d.your_next_billing_date_epr}if(e){const i=new Date(e);r=E||m?i:new Date(i.getFullYear(),i.getMonth(),0)}}if(b&&o){const e=o.getFullYear(),i=o.getMonth();r=new Date(e+1,i+1,0)}if(S.country&&("object"===typeof S.country&&S.country.code?a=S.country:"string"===typeof S.country&&(a={code:S.country,name:S.country})),!a&&S.countries&&Array.isArray(S.countries)&&S.countries.length>0){const e=S.countries[0];"object"===typeof e&&e.code?a={code:e.code,name:e.name||e.label||e.code}:"string"===typeof e&&(a={code:e,name:e})}const J=null!==p&&void 0!==p&&p.fromDate?new Date(p.fromDate):null,W=null!==p&&void 0!==p&&p.toDate?new Date(p.toDate):null,U=!J||!W||!o||!r||o.getTime()!==J.getTime()||r.getTime()!==W.getTime(),X=a&&(!(null!==p&&void 0!==p&&p.country)||JSON.stringify(a)!==JSON.stringify(p.country));if(o&&r&&!isNaN(o.getTime())&&!isNaN(r.getTime())){(!(null!==p&&void 0!==p&&p.fromDate)||!(null!==p&&void 0!==p&&p.toDate)||U)&&(l((0,y.$8)({fromDate:o.toISOString(),toDate:r.toISOString(),country:a||(null===p||void 0===p?void 0:p.country)||null})),I.current=!0,P.current=n)}else if(null!==p&&void 0!==p&&p.fromDate&&null!==p&&void 0!==p&&p.toDate)a&&X&&(l((0,y.$8)({...p,country:a})),I.current=!0,P.current=n);else{let e=null,t=null;if(S.date&&(e=new Date(S.date)),d){let e=null;switch(i){case 0:e=d.your_next_billing_date;break;case 1:e=d.your_next_billing_date_sales_tax;break;case 2:e=d.your_next_billing_date_epr}if(e){const i=new Date(e);t=new Date(i.getFullYear(),i.getMonth(),0)}}e&&t&&!isNaN(e.getTime())&&!isNaN(t.getTime())?(l((0,y.$8)({fromDate:e.toISOString(),toDate:t.toISOString(),country:a||(null===p||void 0===p?void 0:p.country)||null})),I.current=!0,P.current=n):a&&X&&(l((0,y.$8)({...p,country:a})),I.current=!0,P.current=n)}}),[S,s]),(0,n.useEffect)((()=>{void 0!==i&&null!==i&&l((0,y.V5)(i))}),[i]);const M=(0,n.useMemo)((()=>s&&S&&(!!(S.month_from&&S.year_from&&S.month_till&&S.year_till)||!(!S.period_from||!S.period_till)||!(!S.date_from||!S.date_till)||!!S.current_billing_date)||!(null===p||void 0===p||!p.fromDate||null===p||void 0===p||!p.toDate)),[s,S,p]),[B,F]=(0,n.useState)(M),[z,R]=(0,n.use
1State)(!1),Y=(null===o||void 0===o?void 0:o.is_manager)||!1;(0,n.useEffect)((()=>{M&&F(!0)}),[M]);const{billingFrequency:O}=(0,a.d4)((e=>e.subscriptionBuilder));return(0,N.jsxs)(x.D,{children:[(0,N.jsx)(T,{selectedTabKey:t}),(0,N.jsx)(h.P,{children:(0,N.jsxs)(h.P.Section,{children:[s&&(0,N.jsx)("div",{style:{marginBottom:"24px",display:"flex",justifyContent:"flex-end"},children:(0,N.jsx)(D.A,{billingFrequency:O,onBillingToggle:e=>{l((0,y.m4)(e))}})}),(0,N.jsxs)("div",{className:"checkout-container",children:[(0,N.jsxs)("div",{className:"checkout-left-column",children:[(0,N.jsx)(A.A,{isViewMode:!!s||!z&&B,isEditingMode:!s&&z,onEdit:()=>{s||(R(!0),F(!0))},onContinue:()=>{F(!0),R(!1)},onCancel:()=>{R(!1),F(!0)},isAddonsPurchase:s,activeSubscription:S,planName:L,buyAddonsTabKey:s?t:null}),(s||B)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w.A,{}),Y&&(0,N.jsx)(j.A,{})]})]}),(0,N.jsx)("div",{className:"checkout-right-column",children:(0,N.jsx)(k.A,{planDetailsConfirmed:B,isAddonsPurchase:s,buyAddonsTabKey:s?t:null})})]})]})})]})},S=()=>{var e,i,t,h,g,x;const{t:D}=(0,r.Bd)(),A=(0,d.zy)(),w=(0,u.Ay)(),k=(0,a.d4)((e=>e.user.openProjectName)),j=(0,_.A)(),T=(0,a.d4)((e=>e.subscription.currentPlan)),S=(0,a.d4)((e=>e.subscription.subscriptionPlans)),{selectedTab:L}=(0,a.d4)((e=>e.subscriptionBuilder)),I=null!==(e=null===A||void 0===A||null===(i=A.state)||void 0===i?void 0:i.tabIndex)&&void 0!==e?e:0,P=(0,n.useRef)(null!==(t=null!==(h=null===A||void 0===A||null===(g=A.state)||void 0===g?void 0:g.tabKey)&&void 0!==h?h:new URLSearchParams((null===A||void 0===A?void 0:A.search)||"").get("tabKey"))&&void 0!==t?t:null),M=(0,c.gz)({state:A.state,search:A.search}),B=(0,c.j$)(M||k);(0,n.useEffect)((()=>{w((0,y.zI)(M))}),[M,w]);const{allTabs:F,shownTabs:z}=(0,n.useMemo)((()=>{const e=Boolean(null===T||void 0===T?void 0:T.subscriptions_omp),i=Array.isArray(S)?S[0]:S,t=i&&(i.tariff_plan&&Array.isArray(i.tariff_plan)&&i.tariff_plan.length>0||i.tariff_plan_vat&&Array.isArray(i.tariff_plan_vat)&&i.tariff_plan_vat.length>0),n="LTax"===j,s="LEPR"===j,l="LInvoice"===j,o="LAuthorize"===j,r=(0,c.rs)(T),a=n||!s&&!l&&!o,u=n||!s&&!l&&!o,_=s||!n&&!l&&!o,d=l,f=o,p=[{id:"vat",content:"Vat Addons",accessibilityLabel:"Vat Addons",panelID:"vat-tab",condition:(Boolean(null===T||void 0===T?void 0:T.subscriptions)||t)&&!e&&a,key:"subscriptions"},{id:"sales",content:"Sales Tax Addons",accessibilityLabel:"Sales Tax Addons",panelID:"sales-tab",condition:Boolean(null===T||void 0===T?void 0:T.subscriptions_sales_tax)&&u,key:"subscriptions_sales_tax"},{id:"omp",content:"OMP Addons",accessibilityLabel:"OMP Addons",panelID:"omp",condition:Boolean(null===T||void 0===T?void 0:T.subscriptions_omp),key:"subscriptions_omp"},{id:"epr",content:"EPR Addons",accessibilityLabel:"EPR Addons",panelID:"epr",condition:Boolean(null===T||void 0===T?void 0:T.subscriptions_epr)&&_,key:"subscriptions_epr"},{id:"invoice",content:"Invoice Addons",accessibilityLabel:"Invoice Addons",panelID:"invoice-tab",condition:Boolean(null===T||void 0===T?void 0:T.subscriptions_invoice)&&d,key:"subscriptions_invoice"},{id:"authorize",content:"Authorize Addons",accessibilityLabel:"Authorize Addons",panelID:"authorize-tab",condition:Boolean(r)&&f,key:"subscriptions_auth"}],b=p.filter((e=>e.condition));return{allTabs:p,shownTabs:b}}),[T,S,j]),R=(0,n.useMemo)((()=>void 0!==L&&null!==L&&L>=0&&L<z.length?L:z.length>0&&I>=0&&I<z.length?I:0),[L,I,z]);(0,n.useEffect)((()=>{const e=P.current;if(!e||null===z||void 0===z||!z.length)return;const i=z.findIndex((i=>i.key===e));i<0||(w((0,y.V5)(i)),P.current=null)}),[z,w]);const Y=(0,n.useRef)(R);(0,n.useEffect)((()=>{w((0,b.PE)()),w((0,b._F)({app:B})),w((0,v.yX)()),w((0,m.Zv)())}),[w,B]),(0,n.useEffect)((()=>{void 0===R||null===R||void 0!==L&&null!==L||w((0,y.V5)(R))}),[]),(0,n.useEffect)((()=>{if(!T)return;let e=null;const i=z[R];if(i)switch(i.key){case"subscriptions":e=T.subscriptions;break;case"subscriptions_sales_tax":e=T.subscriptions_sales_tax;break;case"subscriptions_omp":e=T.subscriptions_omp;break;case"subscriptions_epr":e=T.subscriptions_epr;break;case"subscriptions_invoice":{const i=T.subscriptions_invoice;e=i?i.subscriptions||i:null;break}case"subscriptions_auth":e=(0,c.rs)(T)}if(e){const t=e.billing_frequency||e.billingFrequency;if(t)w((0,y.m4)(t));else{const e="subscriptions_epr"===(null===i||void 0===i?void 0:i.key)||"subscriptions_invoice"===(null===i||void 0===i?void 0:i.key)||"subscriptions_auth"===(null===i||void 0===i?void 0:i.key)||"LInvoice"===j||"LAuthorize"===j;w((0,y.m4)(e?"annually":"monthly"))}}}),[T,R,z]);return(0,n.useEffect)((()=>{Y.current=R}),[R]),z&&0!==z.length?(0,N.jsxs)(s.Y,{title:(0,N.jsx)(f.A,{content:(0,N.jsx)(l.E,{variant:"heading3xl",as:"span",children:D("addons.buyAddons")})}),fullWidth:!0,children:[(0,N.jsx)(p.A,{title:"Addons"}),(0,N.jsx)(o.t,{tabs:z,selected:z.findIndex((e=>{var i;return e.id===(null===(i=F[R])||void 0===i?void 0:i.id)})),onSelect:e=>{const i=z[e],t=Y.current,n=z[t];if(i){const t=e=>"vat"===(null===e||void 0===e?void 0:e.id)||"sales"===(null===e||void 0===e?void 0:e.id);t(i)&&t(n)&&i.id!==(null===n||void 0===n?void 0:n.id)&&(w((0,y.f5)()),w((0,y.zB)(0)),w((0,y.Jd)())),w((0,y.V5)(e)),Y.current=e}}}),(0,N.jsx)("div",{className:"company-settings",children:(0,N.jsx)(E,{selectedTab:R,selectedTabKey:null===(x=z[R])||void 0===x?void 0:x.key,isAddonsPurchase:!0})})]}):(0,N.jsxs)(s.Y,{title:(0,N.jsx)(f.A,{content:(0,N.jsx)(l.E,{variant:"heading3xl",as:"span",children:D("addons.buyAddons")})}),fullWidth:!0,children:[(0,N.jsx)(p.A,{title:"Addons"}),(0,N.jsx)(l.E,{children:"No subscriptions available"})]})}}}]);
2//# sourceMappingURL=route-addons.61418622.chunk.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.