Files
kaiser-natron/dist/assets/checkout-BywUzOLD.js
Dorian d6a40592ff design system: add Footer and CheckoutStepper sections
The two newly-shipped components (Footer with cream/brand/paper
tones, CheckoutStepper with active/completed/upcoming states) are
now documented in the design system at /design/footer and
/design/checkout-stepper. Sidebar entries added under "Sections"
and "Components" respectively, with DE + EN copy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 19:14:09 +01:00

1 line
1.5 KiB
JavaScript

import{n as e}from"./pinia-D94NEbtV.js";var t=`kn-checkout-v1`,n=[`guest`,`signin`,`register`];function r(){return{name:``,company:``,street:``,postalCode:``,city:``,country:`AT`,phone:``}}function i(){return{accountMode:`guest`,email:``,acceptsMarketing:!1,password:``,passwordConfirm:``,firstName:``,lastName:``,billingSame:!0,shippingAddress:r(),billingAddress:r()}}function a(){if(typeof sessionStorage>`u`)return i();try{let e=sessionStorage.getItem(t);if(!e)return i();let n=JSON.parse(e);return{...i(),...n}}catch{return i()}}function o(e){if(!(typeof sessionStorage>`u`))try{let{password:n,passwordConfirm:r,...i}=e;sessionStorage.setItem(t,JSON.stringify(i))}catch{}}function s(e){return e?[`name`,`street`,`postalCode`,`city`,`country`].every(t=>String(e[t]||``).trim().length>0):!1}var c=e(`checkout`,{state:()=>a(),getters:{accountComplete(e){return!e.email||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.email.trim())?!1:e.accountMode===`signin`?e.password.length>=8:e.accountMode===`register`?e.password.length>=8&&e.password===e.passwordConfirm:!0},shippingComplete(e){return s(e.shippingAddress)?e.billingSame?!0:s(e.billingAddress):!1}},actions:{setAccountMode(e){n.includes(e)&&(this.accountMode=e,this.persist())},update(e){Object.assign(this,e),this.persist()},updateShipping(e){this.shippingAddress={...this.shippingAddress,...e},this.persist()},updateBilling(e){this.billingAddress={...this.billingAddress,...e},this.persist()},persist(){o(this.$state)},reset(){Object.assign(this,i()),typeof sessionStorage<`u`&&sessionStorage.removeItem(t)}}});export{c as t};