umwd-components 0.1.449 → 0.1.451

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/node_modules/base64-js/index.js +1 -1
  2. package/dist/node_modules/ieee754/index.js +1 -1
  3. package/dist/src/components/e-commerce/checkout/CheckoutForm.js +1 -1
  4. package/dist/src/components/e-commerce/checkout/Step3.js +1 -1
  5. package/dist/src/components/e-commerce/checkout/Step4.js +1 -1
  6. package/dist/src/components/e-commerce/invoice/InvoicePDF.js +1 -1
  7. package/dist/src/components/layout/Footer.js +1 -1
  8. package/dist/src/context/e-commerce/checkout/CheckoutContext.js +1 -1
  9. package/dist/src/data/actions/e-commerce/checkout-action.js +1 -1
  10. package/dist/tsconfig.build.tsbuildinfo +1 -1
  11. package/dist/types/components/e-commerce/checkout/Step3.d.ts +2 -1
  12. package/dist/types/components/e-commerce/checkout/Step4.d.ts +4 -1
  13. package/dist/types/components/layout/Footer.d.ts +1 -1
  14. package/dist/types/context/e-commerce/checkout/CheckoutContext.d.ts +1 -0
  15. package/dist/types/types/e-commerce/checkout/types.d.ts +6 -0
  16. package/dist/types/types/e-commerce/invoice/types.d.ts +1 -0
  17. package/package.json +1 -1
  18. package/src/components/e-commerce/checkout/CheckoutForm.tsx +9 -3
  19. package/src/components/e-commerce/checkout/Step3.tsx +5 -0
  20. package/src/components/e-commerce/checkout/Step4.tsx +10 -1
  21. package/src/components/e-commerce/invoice/InvoicePDF.tsx +2 -2
  22. package/src/components/layout/Footer.tsx +4 -3
  23. package/src/context/e-commerce/checkout/CheckoutContext.tsx +22 -0
  24. package/src/data/actions/e-commerce/checkout-action.ts +3 -0
  25. package/src/types/e-commerce/checkout/types.ts +5 -0
  26. package/src/types/e-commerce/invoice/types.ts +1 -1
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{__exports as r}from"../../_virtual/index7.js";var t;function e(){if(t)return r;t=1,r.byteLength=function(r){var t=i(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,e,a=i(r),u=a[0],h=a[1],c=new o(function(r,t,e){return 3*(t+e)/4-e}(0,u,h)),f=0,d=h>0?u-4:u;for(e=0;e<d;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===h&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,c[f++]=255&t);1===h&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var t,n=r.length,o=n%3,a=[],u=16383,i=0,c=n-o;i<c;i+=u)a.push(h(r,i,i+u>c?c:i+u));1===o?(t=r[n-1],a.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],a.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"="));return a.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;function i(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r,t,n){for(var o,a,u=[],i=t;i<n;i+=3)o=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(255&r[i+2]),u.push(e[(a=o)>>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return u.join("")}return n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63,r}export{e as __require};
6
+ import{__exports as r}from"../../_virtual/index8.js";var t;function e(){if(t)return r;t=1,r.byteLength=function(r){var t=i(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,e,a=i(r),u=a[0],h=a[1],c=new o(function(r,t,e){return 3*(t+e)/4-e}(0,u,h)),f=0,d=h>0?u-4:u;for(e=0;e<d;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===h&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,c[f++]=255&t);1===h&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var t,n=r.length,o=n%3,a=[],u=16383,i=0,c=n-o;i<c;i+=u)a.push(h(r,i,i+u>c?c:i+u));1===o?(t=r[n-1],a.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],a.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"="));return a.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;function i(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r,t,n){for(var o,a,u=[],i=t;i<n;i+=3)o=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(255&r[i+2]),u.push(e[(a=o)>>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return u.join("")}return n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63,r}export{e as __require};
@@ -3,5 +3,5 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{__exports as a}from"../../_virtual/index8.js";
6
+ import{__exports as a}from"../../_virtual/index7.js";
7
7
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var t;function o(){return t||(t=1,a.read=function(a,t,o,r,h){var M,e,i=8*h-r-1,p=(1<<i)-1,f=p>>1,n=-7,w=o?h-1:0,s=o?-1:1,u=a[t+w];for(w+=s,M=u&(1<<-n)-1,u>>=-n,n+=i;n>0;M=256*M+a[t+w],w+=s,n-=8);for(e=M&(1<<-n)-1,M>>=-n,n+=r;n>0;e=256*e+a[t+w],w+=s,n-=8);if(0===M)M=1-f;else{if(M===p)return e?NaN:1/0*(u?-1:1);e+=Math.pow(2,r),M-=f}return(u?-1:1)*e*Math.pow(2,M-r)},a.write=function(a,t,o,r,h,M){var e,i,p,f=8*M-h-1,n=(1<<f)-1,w=n>>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,u=r?0:M-1,N=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,e=n):(e=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-e))<1&&(e--,p*=2),(t+=e+w>=1?s/p:s*Math.pow(2,1-w))*p>=2&&(e++,p/=2),e+w>=n?(i=0,e=n):e+w>=1?(i=(t*p-1)*Math.pow(2,h),e+=w):(i=t*Math.pow(2,w-1)*Math.pow(2,h),e=0));h>=8;a[o+u]=255&i,u+=N,i/=256,h-=8);for(e=e<<h|i,f+=h;f>0;a[o+u]=255&e,u+=N,e/=256,f-=8);a[o+u-N]|=128*_}),a}export{o as __require};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Typography";import n from"@mui/material/Container";import a from"@mui/material/Stack";import l from"@mui/material/Grid";import i from"@mui/material/Paper";import o from"@mui/material/Box";import m from"@mui/material/Button";import c from"@mui/material/Stepper";import s from"@mui/material/Step";import p from"@mui/material/StepLabel";import u from"@mui/material/MobileStepper";import d from"@mui/material/Alert";import f from"@mui/material/useMediaQuery";import{useTheme as E}from"@mui/material/styles";import x,{useState as g,useEffect as b}from"react";import v from"next/link";import{useSearchParams as h}from"next/navigation";import{useSession as k}from"../../../context/auth/SessionContext.js";import y from"@mui/icons-material/KeyboardArrowLeft";import B from"@mui/icons-material/KeyboardArrowRight";import C from"./Step1.js";import S from"./Step2.js";import A from"./Step3.js";import N from"./Step4.js";import _ from"./Step5.js";import{useCheckout as j}from"../../../context/e-commerce/checkout/CheckoutContext.js";import{useCart as D}from"../../../context/e-commerce/cart/CartContext.js";function P(P){var w=P.shopUrl,z=void 0===w?"/shop":w,I=E(),O=f(I.breakpoints.down("sm")),T=j(),H=T.state,L=T.runAllChecks,M=T.togglePrefersBillingAddress,V=T.togglePrefersDeliveryAddress,F=D().dispatch,K=t(g(0),2),G=K[0],Q=K[1],R=function(){Q((function(e){return e+1}))},U=function(){Q((function(e){return e-1}))},q=k(),J=q.loading;q.error;var W=q.user;q.login;var X=q.logout,Y=h();b((function(){null!==Y&&(Y.get("order")&&(Q(4),localStorage.removeItem("cart"),F({type:"SET_ITEMS",payload:[]})))}),[Y]),b((function(){L()}),[W]);var Z=!H.confirmations.itemsInCart,$=!H.confirmations.customerProfileComplete,ee=[{label:"Login or register",children:x.createElement(C,{user:W,logout:X}),backButton:x.createElement(m,{variant:O?"text":"outlined",disabled:0===G,onClick:U,sx:{mr:1}},"Back",O&&x.createElement(y,null)),nextButton:x.createElement(m,{variant:O?"text":"contained",onClick:R,sx:{ml:1},disabled:(!W||Z)&&"production"===process.env.NODE_ENV,size:O?"small":"large"},"Next",O&&x.createElement(B,null))},{label:"Provide us with your address",children:x.createElement(S,null),backButton:x.createElement(m,{size:O?"small":"large",onClick:U,disabled:0===G,variant:O?"text":"outlined"},"Back",O&&x.createElement(y,null)),nextButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"contained",onClick:function(){R()},disabled:(!W||Z||$)&&"production"===process.env.NODE_ENV},"Next",O&&x.createElement(B,null))},{label:"Set up mailing options",children:x.createElement(A,{user:W,prefersBillingAddress:H.prefersBillingAddress,prefersDeliveryAddress:H.prefersDeliveryAddress,delivery_options:H.delivery_options,payment_options:H.payment_options,togglePrefersBillingAddress:M,togglePrefersDeliveryAddress:V}),backButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"outlined",onClick:U,disabled:0===G},"Back",O&&x.createElement(y,null)),nextButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"contained",onClick:function(){R()},disabled:(!W||Z||$)&&"production"===process.env.NODE_ENV},"Next",O&&x.createElement(B,null))},{label:"Confirm and make a payment",children:x.createElement(N,null),nextButton:x.createElement(x.Fragment,null,x.createElement(m,{size:O?"small":"large",variant:O?"text":"contained",onClick:function(){R()},disabled:!0},"Next",O&&x.createElement(B,null))),backButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"outlined",onClick:U,disabled:0===G},"Back",O&&x.createElement(y,null))},{label:"Done!",children:x.createElement(_,null)}];return x.createElement(n,{sx:{py:2,minHeight:"100vh"}},x.createElement(l,{container:!0,spacing:2,sx:{py:3,minHeight:"60vh"}},x.createElement(l,{item:!0,xs:12},x.createElement(r,{variant:"h4",align:"center"},"Check Out")),Z&&4!=G&&x.createElement(l,{item:!0,xs:12},x.createElement(d,{severity:"error"},x.createElement(r,{variant:"h5"},"No products in cart"),x.createElement(r,{variant:"body1"},"There are no products selected to order, please visit the shop befor continuing"))),x.createElement(l,{item:!0,xs:12},x.createElement(o,{width:"100%"},x.createElement(i,{sx:{p:2,mb:2,display:{xs:"block",sm:"none"}}},x.createElement(a,{direction:"row",spacing:2,alignItems:"center"},x.createElement(r,{variant:"body2"},"".concat(G+1," / ").concat(ee.length)),x.createElement(r,null,"".concat(ee[G].label)))),x.createElement(i,{sx:{px:2,pt:2,mb:2,display:{xs:"none",sm:"block"}}},x.createElement(c,{activeStep:G},ee.map((function(t,r){var n={};return x.createElement(s,e({key:r},{},{sx:{pb:"20px"}}),x.createElement(p,n,t.label))})))),!J&&x.createElement(x.Fragment,null,ee[G].children,x.createElement(i,{sx:{p:2,mt:2,display:{xs:"none",sm:"block"}}},x.createElement(a,{direction:"row",spacing:2},ee[G].backButton,x.createElement(m,{variant:"outlined",sx:{ml:1}},x.createElement(v,{href:z},"continue shopping")),x.createElement(o,{sx:{flex:"1 1 auto"}}),ee[G].nextButton))))),x.createElement(l,{item:!0,xs:12},x.createElement(u,{sx:{display:{xs:"flex",sm:"none"}},variant:"text",steps:ee.length,position:"static",activeStep:G,nextButton:ee[G].nextButton,backButton:ee[G].backButton}))))}export{P as default};
7
+ import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Typography";import n from"@mui/material/Container";import a from"@mui/material/Stack";import l from"@mui/material/Grid";import i from"@mui/material/Paper";import o from"@mui/material/Box";import m from"@mui/material/Button";import c from"@mui/material/Stepper";import s from"@mui/material/Step";import p from"@mui/material/StepLabel";import u from"@mui/material/MobileStepper";import d from"@mui/material/Alert";import f from"@mui/material/useMediaQuery";import{useTheme as E}from"@mui/material/styles";import x,{useState as g,useEffect as b}from"react";import v from"next/link";import{useSearchParams as h}from"next/navigation";import{useSession as k}from"../../../context/auth/SessionContext.js";import y from"@mui/icons-material/KeyboardArrowLeft";import B from"@mui/icons-material/KeyboardArrowRight";import C from"./Step1.js";import S from"./Step2.js";import _ from"./Step3.js";import A from"./Step4.js";import N from"./Step5.js";import{useCheckout as j}from"../../../context/e-commerce/checkout/CheckoutContext.js";import{useCart as D}from"../../../context/e-commerce/cart/CartContext.js";function P(P){var w=P.shopUrl,z=void 0===w?"/shop":w,I=E(),O=f(I.breakpoints.down("sm")),T=j(),H=T.state,L=T.runAllChecks,M=T.togglePrefersBillingAddress,R=T.togglePrefersDeliveryAddress,V=T.setCustomerInternalReference,F=D().dispatch,K=k(),G=K.loading;K.error;var Q=K.user;K.login;var U=K.logout,q=t(g(0),2),J=q[0],W=q[1],X=function(){W((function(e){return e+1}))},Y=function(){W((function(e){return e-1}))},Z=h();b((function(){null!==Z&&(Z.get("order")&&(W(4),localStorage.removeItem("cart"),F({type:"SET_ITEMS",payload:[]})))}),[Z]),b((function(){L()}),[Q]);var $=!H.confirmations.itemsInCart,ee=!H.confirmations.customerProfileComplete,te=[{label:"Login or register",children:x.createElement(C,{user:Q,logout:U}),backButton:x.createElement(m,{variant:O?"text":"outlined",disabled:0===J,onClick:Y,sx:{mr:1}},"Back",O&&x.createElement(y,null)),nextButton:x.createElement(m,{variant:O?"text":"contained",onClick:X,sx:{ml:1},disabled:(!Q||$)&&"production"===process.env.NODE_ENV,size:O?"small":"large"},"Next",O&&x.createElement(B,null))},{label:"Provide us with your address",children:x.createElement(S,null),backButton:x.createElement(m,{size:O?"small":"large",onClick:Y,disabled:0===J,variant:O?"text":"outlined"},"Back",O&&x.createElement(y,null)),nextButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"contained",onClick:function(){X()},disabled:(!Q||$||ee)&&"production"===process.env.NODE_ENV},"Next",O&&x.createElement(B,null))},{label:"Set up mailing options",children:x.createElement(_,{user:Q,prefersBillingAddress:H.prefersBillingAddress,prefersDeliveryAddress:H.prefersDeliveryAddress,delivery_options:H.delivery_options,payment_options:H.payment_options,togglePrefersBillingAddress:M,togglePrefersDeliveryAddress:R,setCustomerInternalReference:V}),backButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"outlined",onClick:Y,disabled:0===J},"Back",O&&x.createElement(y,null)),nextButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"contained",onClick:function(){X()},disabled:(!Q||$||ee)&&"production"===process.env.NODE_ENV},"Next",O&&x.createElement(B,null))},{label:"Confirm and make a payment",children:x.createElement(A,{customer_internal_reference:H.customer_internal_reference}),nextButton:x.createElement(x.Fragment,null,x.createElement(m,{size:O?"small":"large",variant:O?"text":"contained",onClick:function(){X()},disabled:!0},"Next",O&&x.createElement(B,null))),backButton:x.createElement(m,{size:O?"small":"large",variant:O?"text":"outlined",onClick:Y,disabled:0===J},"Back",O&&x.createElement(y,null))},{label:"Done!",children:x.createElement(N,null)}];return x.createElement(n,{sx:{py:2,minHeight:"100vh"}},x.createElement(l,{container:!0,spacing:2,sx:{py:3,minHeight:"60vh"}},x.createElement(l,{item:!0,xs:12},x.createElement(r,{variant:"h4",align:"center"},"Check Out")),$&&4!=J&&x.createElement(l,{item:!0,xs:12},x.createElement(d,{severity:"error"},x.createElement(r,{variant:"h5"},"No products in cart"),x.createElement(r,{variant:"body1"},"There are no products selected to order, please visit the shop befor continuing"))),x.createElement(l,{item:!0,xs:12},x.createElement(o,{width:"100%"},x.createElement(i,{sx:{p:2,mb:2,display:{xs:"block",sm:"none"}}},x.createElement(a,{direction:"row",spacing:2,alignItems:"center"},x.createElement(r,{variant:"body2"},"".concat(J+1," / ").concat(te.length)),x.createElement(r,null,"".concat(te[J].label)))),x.createElement(i,{sx:{px:2,pt:2,mb:2,display:{xs:"none",sm:"block"}}},x.createElement(c,{activeStep:J},te.map((function(t,r){var n={};return x.createElement(s,e({key:r},{},{sx:{pb:"20px"}}),x.createElement(p,n,t.label))})))),!G&&x.createElement(x.Fragment,null,te[J].children,x.createElement(i,{sx:{p:2,mt:2,display:{xs:"none",sm:"block"}}},x.createElement(a,{direction:"row",spacing:2},te[J].backButton,x.createElement(m,{variant:"outlined",sx:{ml:1}},x.createElement(v,{href:z},"continue shopping")),x.createElement(o,{sx:{flex:"1 1 auto"}}),te[J].nextButton))))),x.createElement(l,{item:!0,xs:12},x.createElement(u,{sx:{display:{xs:"flex",sm:"none"}},variant:"text",steps:te.length,position:"static",activeStep:J,nextButton:te[J].nextButton,backButton:te[J].backButton}))))}export{P as default};
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import t from"react";import r from"@mui/material/Paper";import n from"@mui/material/Stack";import a from"@mui/material/Typography";import l from"@mui/material/Autocomplete";import i from"@mui/material/Grid";import o from"@mui/material/Checkbox";import m from"@mui/material/TextField";import s from"../../common/Address.js";function c(c){var d,p,u=c.user,f=c.prefersBillingAddress,E=void 0===f||f,v=c.prefersDeliveryAddress,g=void 0===v||v,_=c.delivery_options,y=c.payment_options,h=c.togglePrefersBillingAddress,b=c.togglePrefersDeliveryAddress;return t.createElement(r,{sx:{p:2}},t.createElement(n,{spacing:2},null!==u&&t.createElement("form",null,t.createElement(i,{container:!0,spacing:2},t.createElement(i,{item:!0,xs:12,md:6},t.createElement(n,{spacing:2,justifyContent:"space-between"},t.createElement(a,{variant:"h5"},"Delivery Options"),t.createElement(a,{variant:"body1"},"Your order will be delivered at this address"),g&&u.customer_profile.delivery_address?t.createElement(s,{data:u.customer_profile.delivery_address}):t.createElement(s,{data:u.customer_profile.company_address}),null!=(null===(d=null==u?void 0:u.customer_profile)||void 0===d?void 0:d.delivery_address)&&t.createElement(n,{direction:"row",spacing:2,alignItems:"center"},t.createElement(o,{checked:!g,onChange:b}),t.createElement(a,null,"Use company address instead")),_&&_.length>0&&t.createElement(l,{options:_,renderInput:function(r){return t.createElement(m,e({},r,{label:"Delivery Options"}))}}))),t.createElement(i,{item:!0,xs:12,md:6},t.createElement(n,{spacing:2,justifyContent:"space-between"},t.createElement(a,{variant:"h5"},"Payment Options"),t.createElement(a,{variant:"body1"},"Your invoice will be shipped to this address"),E&&u.customer_profile.billing_address?t.createElement(s,{data:u.customer_profile.billing_address}):t.createElement(s,{data:u.customer_profile.company_address}),null!=(null===(p=null==u?void 0:u.customer_profile)||void 0===p?void 0:p.billing_address)&&t.createElement(n,{direction:"row",spacing:2,alignItems:"center"},t.createElement(o,{checked:!E,onChange:h}),t.createElement(a,null,"Use company address instead")),y&&y.length>0&&t.createElement(l,{options:y,renderInput:function(r){return t.createElement(m,e({},r,{label:"Payment Options"}))}}))),t.createElement(i,{item:!0,xs:12},t.createElement(n,{spacing:2},t.createElement(a,{variant:"h5"},"Internal Reference"),t.createElement(a,{variant:"body1"},"Optionaly attach an internal reference to this order"),t.createElement(m,{id:"customer_internal_reference",name:"customer_internal_reference",label:"Internal Reference"})))))))}export{c as default};
6
+ import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import t from"react";import r from"@mui/material/Paper";import n from"@mui/material/Stack";import a from"@mui/material/Typography";import l from"@mui/material/Autocomplete";import i from"@mui/material/Grid";import o from"@mui/material/Checkbox";import m from"@mui/material/TextField";import s from"../../common/Address.js";function c(c){var d,p,u=c.user,f=c.prefersBillingAddress,E=void 0===f||f,v=c.prefersDeliveryAddress,g=void 0===v||v,_=c.delivery_options,y=c.payment_options,h=c.togglePrefersBillingAddress,b=c.togglePrefersDeliveryAddress,x=c.setCustomerInternalReference;return t.createElement(r,{sx:{p:2}},t.createElement(n,{spacing:2},null!==u&&t.createElement("form",null,t.createElement(i,{container:!0,spacing:2},t.createElement(i,{item:!0,xs:12,md:6},t.createElement(n,{spacing:2,justifyContent:"space-between"},t.createElement(a,{variant:"h5"},"Delivery Options"),t.createElement(a,{variant:"body1"},"Your order will be delivered at this address"),g&&u.customer_profile.delivery_address?t.createElement(s,{data:u.customer_profile.delivery_address}):t.createElement(s,{data:u.customer_profile.company_address}),null!=(null===(d=null==u?void 0:u.customer_profile)||void 0===d?void 0:d.delivery_address)&&t.createElement(n,{direction:"row",spacing:2,alignItems:"center"},t.createElement(o,{checked:!g,onChange:b}),t.createElement(a,null,"Use company address instead")),_&&_.length>0&&t.createElement(l,{options:_,renderInput:function(r){return t.createElement(m,e({},r,{label:"Delivery Options"}))}}))),t.createElement(i,{item:!0,xs:12,md:6},t.createElement(n,{spacing:2,justifyContent:"space-between"},t.createElement(a,{variant:"h5"},"Payment Options"),t.createElement(a,{variant:"body1"},"Your invoice will be shipped to this address"),E&&u.customer_profile.billing_address?t.createElement(s,{data:u.customer_profile.billing_address}):t.createElement(s,{data:u.customer_profile.company_address}),null!=(null===(p=null==u?void 0:u.customer_profile)||void 0===p?void 0:p.billing_address)&&t.createElement(n,{direction:"row",spacing:2,alignItems:"center"},t.createElement(o,{checked:!E,onChange:h}),t.createElement(a,null,"Use company address instead")),y&&y.length>0&&t.createElement(l,{options:y,renderInput:function(r){return t.createElement(m,e({},r,{label:"Payment Options"}))}}))),t.createElement(i,{item:!0,xs:12},t.createElement(n,{spacing:2},t.createElement(a,{variant:"h5"},"Internal Reference"),t.createElement(a,{variant:"body1"},"Optionaly attach an internal reference to this order"),t.createElement(m,{id:"customer_internal_reference",name:"customer_internal_reference",label:"Internal Reference",onChange:function(e){return x(e.target.value)}})))))))}export{c as default};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{Fragment as r}from"react";import a from"@mui/material/Paper";import o from"@mui/material/Stack";import m from"@mui/material/Alert";import i from"@mui/material/Button";import n from"@mui/material/Typography";import{useClientSideCart as l}from"../cart/hooks.js";import s from"../cart/CartSummary.js";import{useFormState as c}from"react-dom";import{checkoutAction as p}from"../../../data/actions/e-commerce/checkout-action.js";import{StrapiErrors as u}from"../../StrapiErrors.js";function d(){var d=l(),y=d.state;d.isClient;var f=e(c(p,{zodErrors:null,strapiErrors:null,data:null,message:null}),2),E=f[0],h=f[1];return t.createElement(a,{sx:{p:2}},t.createElement(o,{spacing:2},t.createElement(s,null),t.createElement(u,{error:null==E?void 0:E.strapiErrors}),(null==E?void 0:E.message)&&t.createElement(m,{severity:"error"},null==E?void 0:E.message),t.createElement(n,null,"Please double check all details prior to payment."),t.createElement(n,null,"Is this order compleet?"),t.createElement("form",{id:"paymentform",action:h},y.items&&y.items.map((function(e,a){return t.createElement(r,{key:a},t.createElement("input",{type:"hidden",name:"opo_items[".concat(a,"].product"),value:e.id}),t.createElement("input",{type:"hidden",name:"opo_items[".concat(a,"].ordered_quantity"),value:e.quantity}))})),t.createElement(n,null,"Please click 'Proceed to payment' to proceed to the secure payment page. After completing the payment, you will automatically return to our shop. For any updates on this order, you can always access the latest information in your personal details."),t.createElement(i,{variant:"contained",form:"paymentform",type:"submit"},"Proceed to payment"))))}export{d as default};
7
+ import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{Fragment as r}from"react";import a from"@mui/material/Paper";import o from"@mui/material/Stack";import m from"@mui/material/Alert";import n from"@mui/material/Button";import i from"@mui/material/Typography";import{useClientSideCart as l}from"../cart/hooks.js";import c from"../cart/CartSummary.js";import{useFormState as s}from"react-dom";import{checkoutAction as p}from"../../../data/actions/e-commerce/checkout-action.js";import{StrapiErrors as u}from"../../StrapiErrors.js";function d(d){var y=d.customer_internal_reference,f=l(),E=f.state;f.isClient;var h=e(s(p,{zodErrors:null,strapiErrors:null,data:null,message:null}),2),v=h[0],_=h[1];return t.createElement(a,{sx:{p:2}},t.createElement(o,{spacing:2},t.createElement(c,null),t.createElement(u,{error:null==v?void 0:v.strapiErrors}),(null==v?void 0:v.message)&&t.createElement(m,{severity:"error"},null==v?void 0:v.message),t.createElement(i,null,"Please double check all details prior to payment."),t.createElement(i,null,"Is this order compleet?"),t.createElement("form",{id:"paymentform",action:_},E.items&&E.items.map((function(e,a){return t.createElement(r,{key:a},t.createElement("input",{type:"hidden",name:"opo_items[".concat(a,"].product"),value:e.id}),t.createElement("input",{type:"hidden",name:"opo_items[".concat(a,"].ordered_quantity"),value:e.quantity}))})),t.createElement("input",{type:"hidden",name:"customer_internal_reference",value:y}),t.createElement(i,null,"Please click 'Proceed to payment' to proceed to the secure payment page. After completing the payment, you will automatically return to our shop. For any updates on this order, you can always access the latest information in your personal details."),t.createElement(n,{variant:"contained",form:"paymentform",type:"submit"},"Proceed to payment"))))}export{d as default};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__read as e,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import{StyleSheet as l,PDFDownloadLink as n,PDFViewer as o,Document as r,Page as c,View as i,Text as a}from"@react-pdf/renderer";import m,{useState as u,Fragment as d}from"react";import s from"@mui/material/IconButton";import E from"@mui/material/Dialog";import y from"@mui/material/DialogContent";import p from"@mui/material/DialogActions";import v from"@mui/material/Button";import _ from"@mui/icons-material/PictureAsPdf";var S=l.create({page:{flexDirection:"column",backgroundColor:"#E4E4E4"},header:{padding:10,flexDirection:"row",alignItems:"center"},logo:{width:24,height:24,marginRight:10},section:{margin:10,padding:10,fontSize:12},row:{flexDirection:"row"},rowSection:{flex:1},productRowSection:{flex:1,width:1/6},h1:{fontSize:28},h2:{fontSize:24,fontStyle:"bold"},h3:{fontSize:16,fontStyle:"bold"}});function f(e){var l,n,o=e.props.invoice,u=o.seller_business_credentials,s=o.seller_company_address,E=o.buyer_company_address,y=o.buyer_business_credentials;return m.createElement(r,null,m.createElement(c,{size:"A4",style:S.page},m.createElement(i,{style:S.header},m.createElement(a,{style:S.h1},null==u?void 0:u.company_name)),m.createElement(i,{style:S.section},m.createElement(a,{style:S.h2},"INVOICE")),m.createElement(i,{style:S.section},m.createElement(i,{style:S.row},m.createElement(i,{style:S.rowSection},m.createElement(a,{style:S.h3},"BILLING DETAILS"),m.createElement(a,null,null==y?void 0:y.company_name),m.createElement(a,null,null==o?void 0:o.buyer_first_name," ",null==o?void 0:o.buyer_last_name),m.createElement(a,null,null==E?void 0:E.street," ",null==E?void 0:E.street_number," ",null==E?void 0:E.street_number_addition),m.createElement(a,null,null==E?void 0:E.postal_code," ",null==E?void 0:E.city)),m.createElement(i,{style:S.rowSection},m.createElement(a,{style:S.h3},"FROM"),m.createElement(a,null,null==u?void 0:u.company_name),m.createElement(a,null,null==s?void 0:s.street," ",null==s?void 0:s.street_number," ",null==s?void 0:s.street_number_addition),m.createElement(a,null,null==s?void 0:s.postal_code," ",null==s?void 0:s.city),m.createElement(a,{style:{fontStyle:"bold",marginTop:10}},"CoC Number"),m.createElement(a,null,null==u?void 0:u.coc_number),m.createElement(a,{style:{fontStyle:"bold",marginTop:10}},"VAT Number"),m.createElement(a,null,null==u?void 0:u.vat_number)))),m.createElement(i,{style:S.section},m.createElement(i,{style:S.row},m.createElement(i,{style:S.rowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Invoice number: "),m.createElement(a,null,null==o?void 0:o.invoice_number)),m.createElement(i,{style:S.rowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Invoice date"),m.createElement(a,null,null==o?void 0:o.invoice_date)))),m.createElement(i,{style:S.section},m.createElement(a,{style:S.h3},"SUMMARY"),m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Title")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Amount")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"VAT rate")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Excl. VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Incl. VAT"))),null===(l=null==o?void 0:o.items)||void 0===l?void 0:l.map((function(e,t){return m.createElement(d,{key:t},m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"product_title"in e&&e.product_title,"item_description"in e&&e.item_description)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,e.quantity)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,e.vat_rate," %")," "),m.createElement(i,{style:S.productRowSection},e.price_excl_vat&&e.price_incl_vat&&m.createElement(a,null,"€"," ",(e.price_incl_vat-e.price_excl_vat).toFixed(2))),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",e.price_excl_vat)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",e.price_incl_vat))))}))),m.createElement(i,{style:S.section},m.createElement(a,{style:S.h3},"TOTALS"),m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Excl. VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Incl. VAT"))),m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",null===(n=null==o?void 0:o.VAT_total)||void 0===n?void 0:n.toFixed(2))),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",null==o?void 0:o.total_excl_vat)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",null==o?void 0:o.total_incl_vat)))),m.createElement(i,{style:S.section},m.createElement(a,{style:t(t({},S.h3),{border:"2px solid black",padding:10})},"Total Due: € ",null==o?void 0:o.total_incl_vat))))}function w(e){var t=e.invoice;return m.createElement(n,{document:m.createElement(f,{props:{invoice:t}}),fileName:"invoice_".concat(null==t?void 0:t.invoice_number)},m.createElement(s,null,m.createElement(_,null)))}function b(t){var l=t.invoice,n=e(u(!1),2),r=n[0],c=n[1];return m.createElement(m.Fragment,null,m.createElement(s,{onClick:function(){return c(!0)}},m.createElement(_,null)),m.createElement(E,{open:r,fullWidth:!0,maxWidth:"lg"},m.createElement(y,null,m.createElement(o,{style:{width:"100%",minHeight:"70vh"}},m.createElement(f,{props:{invoice:l}}))),m.createElement(p,null,m.createElement(v,{variant:"contained",onClick:function(){return c(!1)}},"Close"))))}export{w as InvoiceDownloadLink,b as InvoicePDFViewer};
7
+ import{__read as e,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import{StyleSheet as l,PDFDownloadLink as n,PDFViewer as o,Document as r,Page as c,View as i,Text as a}from"@react-pdf/renderer";import m,{useState as u,Fragment as s}from"react";import d from"@mui/material/IconButton";import E from"@mui/material/Dialog";import y from"@mui/material/DialogContent";import p from"@mui/material/DialogActions";import v from"@mui/material/Button";import _ from"@mui/icons-material/PictureAsPdf";var S=l.create({page:{flexDirection:"column",backgroundColor:"#E4E4E4"},header:{padding:10,flexDirection:"row",alignItems:"center"},logo:{width:24,height:24,marginRight:10},section:{margin:10,padding:10,fontSize:12},row:{flexDirection:"row"},rowSection:{flex:1},productRowSection:{flex:1,width:1/6},h1:{fontSize:28},h2:{fontSize:24,fontStyle:"bold"},h3:{fontSize:16,fontStyle:"bold"}});function f(e){var l,n,o=e.props.invoice,u=o.seller_business_credentials,d=o.seller_company_address,E=o.buyer_company_address,y=o.buyer_business_credentials;return m.createElement(r,null,m.createElement(c,{size:"A4",style:S.page},m.createElement(i,{style:S.header},m.createElement(a,{style:S.h1},null==u?void 0:u.company_name)),m.createElement(i,{style:S.section},m.createElement(a,{style:S.h2},"INVOICE")),m.createElement(i,{style:S.section},m.createElement(i,{style:S.row},m.createElement(i,{style:S.rowSection},m.createElement(a,{style:S.h3},"BILLING DETAILS"),m.createElement(a,null,null==y?void 0:y.company_name),m.createElement(a,null,null==o?void 0:o.buyer_first_name," ",null==o?void 0:o.buyer_last_name),m.createElement(a,null,null==E?void 0:E.street," ",null==E?void 0:E.street_number," ",null==E?void 0:E.street_number_addition),m.createElement(a,null,null==E?void 0:E.postal_code," ",null==E?void 0:E.city)),m.createElement(i,{style:S.rowSection},m.createElement(a,{style:S.h3},"FROM"),m.createElement(a,null,null==u?void 0:u.company_name),m.createElement(a,null,null==d?void 0:d.street," ",null==d?void 0:d.street_number," ",null==d?void 0:d.street_number_addition),m.createElement(a,null,null==d?void 0:d.postal_code," ",null==d?void 0:d.city),m.createElement(a,{style:{fontStyle:"bold",marginTop:10}},"CoC Number"),m.createElement(a,null,null==u?void 0:u.coc_number),m.createElement(a,{style:{fontStyle:"bold",marginTop:10}},"VAT Number"),m.createElement(a,null,null==u?void 0:u.vat_number)))),m.createElement(i,{style:S.section},m.createElement(i,{style:S.row},m.createElement(i,{style:S.rowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Invoice number: "),m.createElement(a,null,null==o?void 0:o.invoice_number)),(null==o?void 0:o.customer_internal_reference)&&m.createElement(i,{style:S.rowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Your reference: "),m.createElement(a,null,null==o?void 0:o.customer_internal_reference)),m.createElement(i,{style:S.rowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Invoice date"),m.createElement(a,null,null==o?void 0:o.invoice_date)))),m.createElement(i,{style:S.section},m.createElement(a,{style:S.h3},"SUMMARY"),m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Title")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Amount")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"VAT rate")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Excl. VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Incl. VAT"))),null===(l=null==o?void 0:o.items)||void 0===l?void 0:l.map((function(e,t){return m.createElement(s,{key:t},m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"product_title"in e&&e.product_title,"item_description"in e&&e.item_description)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,e.quantity)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,e.vat_rate," %")," "),m.createElement(i,{style:S.productRowSection},e.price_excl_vat&&e.price_incl_vat&&m.createElement(a,null,"€"," ",(e.price_incl_vat-e.price_excl_vat).toFixed(2))),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",e.price_excl_vat)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",e.price_incl_vat))))}))),m.createElement(i,{style:S.section},m.createElement(a,{style:S.h3},"TOTALS"),m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Excl. VAT")),m.createElement(i,{style:S.productRowSection},m.createElement(a,{style:{fontStyle:"bold"}},"Incl. VAT"))),m.createElement(i,{style:S.row},m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection}),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",null===(n=null==o?void 0:o.VAT_total)||void 0===n?void 0:n.toFixed(2))),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",null==o?void 0:o.total_excl_vat)),m.createElement(i,{style:S.productRowSection},m.createElement(a,null,"€ ",null==o?void 0:o.total_incl_vat)))),m.createElement(i,{style:S.section},m.createElement(a,{style:t(t({},S.h3),{border:"2px solid black",padding:10})},"Total Due: € ",null==o?void 0:o.total_incl_vat))))}function w(e){var t=e.invoice;return m.createElement(n,{document:m.createElement(f,{props:{invoice:t}}),fileName:"invoice_".concat(null==t?void 0:t.invoice_number)},m.createElement(d,null,m.createElement(_,null)))}function b(t){var l=t.invoice,n=e(u(!1),2),r=n[0],c=n[1];return m.createElement(m.Fragment,null,m.createElement(d,{onClick:function(){return c(!0)}},m.createElement(_,null)),m.createElement(E,{open:r,fullWidth:!0,maxWidth:"lg"},m.createElement(y,null,m.createElement(o,{style:{width:"100%",minHeight:"70vh"}},m.createElement(f,{props:{invoice:l}}))),m.createElement(p,null,m.createElement(v,{variant:"contained",onClick:function(){return c(!1)}},"Close"))))}export{w as InvoiceDownloadLink,b as InvoicePDFViewer};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{useTheme as n}from"@mui/material/styles";import r from"@mui/material/AppBar";import a from"@mui/material/Container";import i from"@mui/material/Toolbar";import m from"@mui/material/Typography";import l from"@mui/material/Box";import o from"@mui/material/IconButton";import c from"@mui/material/Grid";import s from"@mui/material/Divider";import d from"@mui/material/Stack";import u from"next/link";import p from"next/image";import f from"../../lib/getIcon.js";import{StyledLink as E}from"../StyledLink.js";import y from"@mui/icons-material/Home";import x from"@mui/icons-material/Phone";import b from"@mui/icons-material/Email";function g(g){var h=g.data,v=h.site_title,_=h.logo,C=h.parent_company_name,j=h.business_credentials,w=h.address,I=h.socials,k=h.disclaimer_link,A=h.privacypolicy_link,D=h.maxWidth,T=void 0===D?"lg":D,F=h.referal,B=h.sx,P=void 0===B?{}:B,S=h.useIcons,W=void 0!==S&&S,G=n(),V=f("APIcon");return t.createElement(r,{position:"relative",sx:e({backgroundColor:"light"===G.palette.mode?G.palette.primary.light:G.palette.primary.dark,top:"auto",bottom:0},P),component:"footer"},t.createElement(a,{maxWidth:T},t.createElement(i,{disableGutters:!0},t.createElement(c,{container:!0,sx:{p:2},spacing:2},t.createElement(c,{item:!0,xs:12,sm:6,md:4,sx:[W&&{display:"grid",justifyContent:"center"}]},t.createElement(l,{sx:{display:{xs:"none",md:"flex"},cursor:"pointer",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",height:"100%",textDecoration:"none"}},t.createElement(m,{variant:"h6",color:"#ffffff",sx:{mb:2},component:"h2"},v),void 0!==(null==_?void 0:_.url)&&t.createElement(u,{href:"#home"},t.createElement(l,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",p:1}},t.createElement(p,{src:_.url,width:_.width||100,height:_.height||100,alt:_.alternativeText||"site logo"}))))),t.createElement(c,{item:!0,xs:12,sm:6,md:4,sx:[W&&{display:"grid",justifyContent:"stretch",width:{xs:"80%",sm:"60%",md:"80%"}}]},t.createElement(m,{variant:"h6",sx:[{mb:2},W&&{textAlign:"center"}],component:"h2"},"Contact Information"),j&&t.createElement(t.Fragment,null,t.createElement(m,{id:"company_name",variant:"h6",component:"h3",sx:[{mb:2},W&&{textAlign:"center"}]},j.company_name),C&&t.createElement(m,{id:"parent_company_name",variant:"h6",component:"h4",sx:{mb:2,textAlign:"center"}},"By ",C)),!0===W?t.createElement(d,{spacing:1},w&&t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(y,null),t.createElement(d,{alignItems:"flex-end"},t.createElement(m,{variant:"body1"},w.street," ",w.street_number," ",w.street_number_addition&&w.street_number_addition),t.createElement(m,{variant:"body1"},w.postal_code," ",w.city))),t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(x,null),t.createElement(m,{variant:"body1"},"+3133867606")),t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(b,null),t.createElement(m,{variant:"body1"},"info@jellepaulus.nl")),j&&t.createElement(t.Fragment,null,t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(m,{variant:"body1"},"CoC:"),t.createElement(m,{variant:"body1"},j.coc_number)),t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(m,{variant:"body1"},"VAT:"),t.createElement(m,{variant:"body1",align:"right"},j.vat_number)))):t.createElement(t.Fragment,null,w&&t.createElement(t.Fragment,null,t.createElement(m,{variant:"body1"},w.street," ",w.street_number," ",w.street_number_addition&&w.street_number_addition),t.createElement(m,{variant:"body1"},w.postal_code," ",w.city),j&&t.createElement(t.Fragment,null,t.createElement(m,{variant:"body1"},j.company_name," by"," ",C),t.createElement(m,{variant:"body1"},"CoC: ",j.coc_number),t.createElement(m,{variant:"body1"},"VAT: ",j.vat_number))))),t.createElement(c,{item:!0,xs:12,sm:6,md:4,sx:[W&&{display:"grid",justifyContent:"center"}]},I&&I.length>0&&t.createElement(t.Fragment,null,t.createElement(m,{variant:"h6",sx:{mb:2},component:"h2"},"Socials"),t.createElement(d,{spacing:2,sx:{width:"min-content",color:"primary.contrastText",alignContent:"space-between"}},I.map((function(e,n){var r=void 0!==e.icon?f(e.icon):null;return t.createElement(E,{href:e.url,key:n},t.createElement(o,{key:n,color:"inherit",size:"large"},null!==r&&t.createElement(r,null)))}))))),t.createElement(c,{item:!0,xs:12},t.createElement(s,null)),t.createElement(c,{item:!0,xs:12},t.createElement(d,{direction:{xs:"column",sm:"row"},alignItems:"center",gap:2,justifyContent:"space-around"},k&&t.createElement(E,{href:k},t.createElement(m,{variant:"body1",color:"#ffffff"},"Disclaimer")),A&&t.createElement(E,{href:A},t.createElement(m,{variant:"body1",color:"#ffffff"},"Privacy Policy")))),Boolean(k||A)&&t.createElement(c,{item:!0,xs:12},t.createElement(s,null)),t.createElement(c,{item:!0,xs:12,sx:{display:"flex",justifyContent:"center",alignItems:"center",pb:"50px"}},F||t.createElement(E,{href:"https://atelierpaulus.nl/"},t.createElement(m,{color:"secondary.contrastText",sx:{textDecoration:"underline",verticalAlign:"middle",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:{xs:"column",sm:"row"},gap:2}},"Design & Webdevelopment",null!==V&&t.createElement(V,{sx:{mx:2}}),"Atelier Paulus")))))))}export{g as default};
7
+ import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{useTheme as n}from"@mui/material/styles";import r from"@mui/material/AppBar";import a from"@mui/material/Container";import i from"@mui/material/Toolbar";import m from"@mui/material/Typography";import l from"@mui/material/Box";import o from"@mui/material/IconButton";import c from"@mui/material/Grid";import s from"@mui/material/Divider";import d from"@mui/material/Stack";import u from"next/link";import p from"next/image";import f from"../../lib/getIcon.js";import{StyledLink as E}from"../StyledLink.js";import y from"@mui/icons-material/Home";import x from"@mui/icons-material/Phone";import b from"@mui/icons-material/Email";import g from"@mui/icons-material/Link";function h(h){var v=h.data,_=v.site_title,C=v.logo,j=v.parent_company_name,w=v.business_credentials,I=v.address,k=v.socials,A=v.disclaimer_link,D=v.privacypolicy_link,T=v.maxWidth,F=void 0===T?"lg":T,B=v.referal,P=v.sx,S=void 0===P?{}:P,W=v.useIcons,G=void 0!==W&&W,L=n(),V=f("APIcon");return t.createElement(r,{position:"relative",sx:e({backgroundColor:"light"===L.palette.mode?L.palette.primary.light:L.palette.primary.dark,top:"auto",bottom:0},S),component:"footer"},t.createElement(a,{maxWidth:F},t.createElement(i,{disableGutters:!0},t.createElement(c,{container:!0,sx:{p:2},spacing:2},t.createElement(c,{item:!0,xs:12,sm:6,md:4,sx:[G&&{display:"grid",justifyContent:"center"}]},t.createElement(l,{sx:{display:{xs:"none",md:"flex"},cursor:"pointer",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",height:"100%",textDecoration:"none"}},t.createElement(m,{variant:"h6",color:"#ffffff",sx:{mb:2},component:"h2"},_),void 0!==(null==C?void 0:C.url)&&t.createElement(u,{href:"#home"},t.createElement(l,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",p:1}},t.createElement(p,{src:C.url,width:C.width||100,height:C.height||100,alt:C.alternativeText||"site logo"}))))),t.createElement(c,{item:!0,xs:12,sm:6,md:4,sx:[G&&{display:"grid",justifyContent:"stretch",width:{xs:"80%",sm:"60%",md:"80%"}}]},t.createElement(m,{variant:"h6",sx:[{mb:2},G&&{textAlign:"center"}],component:"h2"},"Contact Information"),w&&t.createElement(t.Fragment,null,t.createElement(m,{id:"company_name",variant:"h6",component:"h3",sx:[{mb:2},G&&{textAlign:"center"}]},w.company_name),j&&t.createElement(m,{id:"parent_company_name",variant:"h6",component:"h4",sx:{mb:2,textAlign:"center"}},"By ",j)),!0===G?t.createElement(d,{spacing:1},I&&t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(y,null),t.createElement(d,{alignItems:"flex-end"},t.createElement(m,{variant:"body1"},I.street," ",I.street_number," ",I.street_number_addition&&I.street_number_addition),t.createElement(m,{variant:"body1"},I.postal_code," ",I.city))),t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(x,null),t.createElement(m,{variant:"body1"},"+3133867606")),t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(b,null),t.createElement(m,{variant:"body1"},"info@jellepaulus.nl")),w&&t.createElement(t.Fragment,null,t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(m,{variant:"body1"},"CoC:"),t.createElement(m,{variant:"body1"},w.coc_number)),t.createElement(d,{direction:"row",justifyContent:"space-between"},t.createElement(m,{variant:"body1"},"VAT:"),t.createElement(m,{variant:"body1",align:"right"},w.vat_number)))):t.createElement(t.Fragment,null,I&&t.createElement(t.Fragment,null,t.createElement(m,{variant:"body1"},I.street," ",I.street_number," ",I.street_number_addition&&I.street_number_addition),t.createElement(m,{variant:"body1"},I.postal_code," ",I.city),w&&t.createElement(t.Fragment,null,t.createElement(m,{variant:"body1"},w.company_name," by"," ",j),t.createElement(m,{variant:"body1"},"CoC: ",w.coc_number),t.createElement(m,{variant:"body1"},"VAT: ",w.vat_number))))),t.createElement(c,{item:!0,xs:12,sm:6,md:4,sx:[G&&{display:"grid",justifyContent:"center"}]},k&&k.length>0&&t.createElement(t.Fragment,null,t.createElement(m,{variant:"h6",sx:{mb:2},component:"h2"},"Socials"),t.createElement(d,{spacing:2,sx:{width:"min-content",color:"primary.contrastText",alignContent:"space-between"}},k.map((function(e,n){var r=void 0!==e.icon?f(e.icon):null;return t.createElement(E,{href:e.url,key:n},t.createElement(o,{key:n,size:"large"},null!==r?t.createElement(r,null):t.createElement(g,null)))}))))),t.createElement(c,{item:!0,xs:12},t.createElement(s,null)),t.createElement(c,{item:!0,xs:12},t.createElement(d,{direction:{xs:"column",sm:"row"},alignItems:"center",gap:2,justifyContent:"space-around"},A&&t.createElement(E,{href:A},t.createElement(m,{variant:"body1",color:"#ffffff"},"Disclaimer")),D&&t.createElement(E,{href:D},t.createElement(m,{variant:"body1",color:"#ffffff"},"Privacy Policy")))),Boolean(A||D)&&t.createElement(c,{item:!0,xs:12},t.createElement(s,null)),t.createElement(c,{item:!0,xs:12,sx:{display:"flex",justifyContent:"center",alignItems:"center",pb:"50px"}},B||t.createElement(E,{href:"https://atelierpaulus.nl/"},t.createElement(m,{color:"secondary.contrastText",sx:{textDecoration:"underline",verticalAlign:"middle",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:{xs:"column",sm:"row"},gap:2}},"Design & Webdevelopment",null!==V&&t.createElement(V,{sx:{mx:2}}),"Atelier Paulus")))))))}export{h as default};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__read as e,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import s,{useReducer as i,useContext as l,createContext as o}from"react";import{isCustomerProfileComplete as d}from"../../../lib/isCustomerProfileComplete.js";import{isAddressComplete as t}from"../../../lib/isAddressComplete.js";import{areBusinessCredentailsComplete as n}from"../../../lib/areBusinessCredentialsComplete.js";import{useClientSideCart as a}from"../../../components/e-commerce/cart/hooks.js";import{useSession as p}from"../../auth/SessionContext.js";import m from"../../../lib/isVATValid.js";import u from"../../../lib/isEORIValid.js";var f={confirmations:{itemsInCart:!1,customerProfileComplete:!1,companyAddressComplete:!1,deliveryAddressComplete:!1,billingAddressComplete:!1,businessCredentailsComplete:!1,hasValidatedVAT:!1,hasValidatedEORI:!1},delivery_options:[{id:1,label:"ptt"}],payment_options:[{id:1,label:"ideal"}],prefersBillingAddress:!0,prefersDeliveryAddress:!0},c=o({state:f,runAllChecks:function(){},togglePrefersBillingAddress:function(){},togglePrefersDeliveryAddress:function(){}}),v=function(e,s){switch(s.type){case"UPDATE_CONFIRMATIONS":return r(r({},e),{confirmations:r(r({},e.confirmations),s.payload)});case"SET_PREFERS_BILLING_ADDRESS":return r(r({},e),{prefersBillingAddress:s.payload.prefersBillingAddress});case"SET_PREFERS_DELIVERY_ADDRESS":return r(r({},e),{prefersDeliveryAddress:s.payload.prefersDeliveryAddress});default:return e}},A=function(r){var l=r.children,o=e(i(v,f),2),A=o[0],_=o[1],E=p(),y=E.user;E.loading,E.error;var C=a(),g={state:A,runAllChecks:function(){var e,r,s,i,l,o,a=C.state.items.length>0,p=d(null==y?void 0:y.customer_profile),f=t(null===(e=null==y?void 0:y.customer_profile)||void 0===e?void 0:e.company_address),c=t(null===(r=null==y?void 0:y.customer_profile)||void 0===r?void 0:r.delivery_address),v=t(null===(s=null==y?void 0:y.customer_profile)||void 0===s?void 0:s.billing_address),A=n(null===(i=null==y?void 0:y.customer_profile)||void 0===i?void 0:i.business_credentials),E=m(null===(l=null==y?void 0:y.customer_profile)||void 0===l?void 0:l.business_credentials),g=u(null===(o=null==y?void 0:y.customer_profile)||void 0===o?void 0:o.business_credentials);_({type:"UPDATE_CONFIRMATIONS",payload:{itemsInCart:a,customerProfileComplete:p,companyAddressComplete:f,deliveryAddressComplete:c,billingAddressComplete:v,businessCredentailsComplete:A,hasValidatedVAT:E,hasValidatedEORI:g}})},togglePrefersBillingAddress:function(){_({type:"SET_PREFERS_BILLING_ADDRESS",payload:{prefersBillingAddress:!A.prefersBillingAddress}})},togglePrefersDeliveryAddress:function(){_({type:"SET_PREFERS_DELIVERY_ADDRESS",payload:{prefersDeliveryAddress:!A.prefersDeliveryAddress}})}};return s.createElement(c.Provider,{value:g},l)},_=function(){return l(c)};export{A as CheckoutProvider,_ as useCheckout};
7
+ import{__read as e,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import s,{useReducer as i,useEffect as l,useContext as o,createContext as t}from"react";import{isCustomerProfileComplete as n}from"../../../lib/isCustomerProfileComplete.js";import{isAddressComplete as d}from"../../../lib/isAddressComplete.js";import{areBusinessCredentailsComplete as a}from"../../../lib/areBusinessCredentialsComplete.js";import{useClientSideCart as m}from"../../../components/e-commerce/cart/hooks.js";import{useSession as p}from"../../auth/SessionContext.js";import u from"../../../lib/isVATValid.js";import f from"../../../lib/isEORIValid.js";var c={confirmations:{itemsInCart:!1,customerProfileComplete:!1,companyAddressComplete:!1,deliveryAddressComplete:!1,billingAddressComplete:!1,businessCredentailsComplete:!1,hasValidatedVAT:!1,hasValidatedEORI:!1},delivery_options:[{id:1,label:"ptt"}],payment_options:[{id:1,label:"ideal"}],prefersBillingAddress:!0,prefersDeliveryAddress:!0,customer_internal_reference:""},_=t({state:c,runAllChecks:function(){},togglePrefersBillingAddress:function(){},togglePrefersDeliveryAddress:function(){},setCustomerInternalReference:function(){}}),E=function(e,s){switch(s.type){case"UPDATE_CONFIRMATIONS":return r(r({},e),{confirmations:r(r({},e.confirmations),s.payload)});case"SET_PREFERS_BILLING_ADDRESS":return r(r({},e),{prefersBillingAddress:s.payload.prefersBillingAddress});case"SET_PREFERS_DELIVERY_ADDRESS":return r(r({},e),{prefersDeliveryAddress:s.payload.prefersDeliveryAddress});case"SET_CUSTOMER_INTERNAL_REFERENCE":return r(r({},e),{customer_internal_reference:s.payload.customer_internal_reference});default:return e}},v=function(r){var o=r.children,t=e(i(E,c),2),v=t[0],A=t[1],C=p(),R=C.user;C.loading,C.error;var y=m(),S=function(){var e,r,s,i,l,o,t=y.state.items.length>0,m=n(null==R?void 0:R.customer_profile),p=d(null===(e=null==R?void 0:R.customer_profile)||void 0===e?void 0:e.company_address),c=d(null===(r=null==R?void 0:R.customer_profile)||void 0===r?void 0:r.delivery_address),_=d(null===(s=null==R?void 0:R.customer_profile)||void 0===s?void 0:s.billing_address),E=a(null===(i=null==R?void 0:R.customer_profile)||void 0===i?void 0:i.business_credentials),v=u(null===(l=null==R?void 0:R.customer_profile)||void 0===l?void 0:l.business_credentials),C=f(null===(o=null==R?void 0:R.customer_profile)||void 0===o?void 0:o.business_credentials);A({type:"UPDATE_CONFIRMATIONS",payload:{itemsInCart:t,customerProfileComplete:m,companyAddressComplete:p,deliveryAddressComplete:c,billingAddressComplete:_,businessCredentailsComplete:E,hasValidatedVAT:v,hasValidatedEORI:C}})};l((function(){R&&S()}),[R]);var g={state:v,runAllChecks:S,togglePrefersBillingAddress:function(){A({type:"SET_PREFERS_BILLING_ADDRESS",payload:{prefersBillingAddress:!v.prefersBillingAddress}})},togglePrefersDeliveryAddress:function(){A({type:"SET_PREFERS_DELIVERY_ADDRESS",payload:{prefersDeliveryAddress:!v.prefersDeliveryAddress}})},setCustomerInternalReference:function(e){A({type:"SET_CUSTOMER_INTERNAL_REFERENCE",payload:{customer_internal_reference:e}})}};return s.createElement(_.Provider,{value:g},o)},A=function(){return o(_)};export{v as CheckoutProvider,A as useCheckout};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__awaiter as r,__generator as e,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import{mutateData as s}from"../../services/mutate-data.js";import{parseFormData as o}from"../../../lib/parseFormData.js";import{createMolliePayment as a}from"../../../lib/molliePaymentProvider.js";import{redirect as n}from"next/navigation";function i(i,p){return r(this,void 0,void 0,(function(){var r,c,m,u,l,d;return e(this,(function(e){switch(e.label){case 0:return r=o(p),[4,s("POST","/api/opos/",r)];case 1:return(c=e.sent())?c.error?[2,t(t({},i),{strapiErrors:c.error,message:"Failed to create order."})]:"production"!==process.env.NODE_ENV?[3,3]:[4,a(c)]:[2,t(t({},i),{strapiErrors:null,message:"Ops! Something went wrong. Please try again."})];case 2:return u=e.sent(),[3,4];case 3:u=null,e.label=4;case 4:return"string"==typeof(m=u)?[2,t(t({},i),{strapiErrors:null,message:m})]:"production"===process.env.NODE_ENV&&m?[4,s("POST","api/payments/",{data:{opo:c.id,payment_status:m.status,provider_id:m.id,provider_response:m}})]:[3,6];case 5:return d=e.sent(),[3,8];case 6:return[4,s("POST","api/payments/",{data:{opo:c.id,payment_status:"open"}})];case 7:d=e.sent(),e.label=8;case 8:return(l=d).error?[2,t(t({},i),{strapiErrors:l.error,message:"Failed to create payment."})]:("production"===process.env.NODE_ENV&&m?n("".concat(m.getCheckoutUrl())):n("/shop/check-out"),[2])}}))}))}export{i as checkoutAction};
7
+ import{__awaiter as e,__generator as r,__assign as s}from"../../../../node_modules/tslib/tslib.es6.js";import{mutateData as t}from"../../services/mutate-data.js";import{parseFormData as o}from"../../../lib/parseFormData.js";import{createMolliePayment as a}from"../../../lib/molliePaymentProvider.js";import{redirect as n}from"next/navigation";function i(i,p){return e(this,void 0,void 0,(function(){var e,c,l,m,u,d;return r(this,(function(r){switch(r.label){case 0:return e=o(p),console.log("parsedFormData",e),[4,t("POST","/api/opos/",e)];case 1:return c=r.sent(),console.log("responseData",c),c?c.error?[2,s(s({},i),{strapiErrors:c.error,message:"Failed to create order."})]:"production"!==process.env.NODE_ENV?[3,3]:[4,a(c)]:[2,s(s({},i),{strapiErrors:null,message:"Ops! Something went wrong. Please try again."})];case 2:return m=r.sent(),[3,4];case 3:m=null,r.label=4;case 4:return"string"==typeof(l=m)?[2,s(s({},i),{strapiErrors:null,message:l})]:"production"===process.env.NODE_ENV&&l?[4,t("POST","api/payments/",{data:{opo:c.id,payment_status:l.status,provider_id:l.id,provider_response:l}})]:[3,6];case 5:return d=r.sent(),[3,8];case 6:return[4,t("POST","api/payments/",{data:{opo:c.id,payment_status:"open"}})];case 7:d=r.sent(),r.label=8;case 8:return(u=d).error?[2,s(s({},i),{strapiErrors:u.error,message:"Failed to create payment."})]:("production"===process.env.NODE_ENV&&l?n("".concat(l.getCheckoutUrl())):n("/shop/check-out"),[2])}}))}))}export{i as checkoutAction};