PageSourceSearch

https://www.kettner-edelmetalle.de/_nuxt/Bl_v6IJW.js

js kettner-edelmetalle.de collected 2026-10-02 04:47:28 UTC 16,046 bytes, 1 lines download raw bytes

1import{N as R,w as j,aO as O,aP as H,aQ as V,y as E,_ as W,W as U,z as _,$ as I,b as $,t as q,r as D,q as Q,aw as K,A as G,ax as Y,x as Z,g as J,au as X}from"./Il4zDAxP.js";import{i as T,r as ee,p as te}from"./m1OiHKBT.js";import{o as se,n as ne,b as p,d,g as re,u as v,t as B,i as z,r as P,e as ie,j as ae,F as S,h as F,p as N,c as L}from"./DlIyoXyK.js";import{w as le}from"./D0F-c7fK.js";import{b as oe,i as ce}from"./DjVyTbxw.js";import{h as ue}from"./D40aLWsd.js";import{f as pe}from"./CtXWAF1x.js";import{p as de,u as ge}from"./dwAo0kCm.js";import{i as me}from"./BpTJceez.js";const ye={key:0,class:"mt-1 text-center text-xs whitespace-normal text-red-600"},fe={key:1,class:"mt-1 text-center text-xs whitespace-normal text-gray-500"},Ve={__name:"BraintreePayPalGuestExpress",props:{amount:{type:String,required:!0},currency:{type:String,default:"EUR"},onAddressChange:{type:Function,default:null}},emits:["approved","error","cancel","unavailable"],setup(a,{expose:r,emit:e}){const n=a,o=e,{$t:g}=R(),u=P(null),t=P(!1),c=P(null);let f=null,s=n.amount;function k(i){if(ee(),T()){o("unavailable"),E.$emit("notify",{type:"error",title:te()});return}u.value=i}async function A(){const{tokenData:i,deviceData:C}=await j();if(!i.paypal_available){o("unavailable");return}f=C;const l=await O(n.currency,n.amount),m=window.paypal.Buttons({fundingSource:window.paypal.FUNDING.PAYPAL,style:{height:44,label:"checkout",tagline:!1,shape:"rect"},createOrder:()=>(s=n.amount,l.createPayment({flow:"checkout",amount:s,currency:n.currency,intent:"capture",locale:V(),enableShippingAddress:!0,shippingAddressEditable:!0,userAction:"COMMIT",landingPageType:"login"})),...n.onAddressChange?{onShippingChange:async(h,y)=>{try{const x=h?.shipping_address??{},b=await n.onAddressChange({countryIso:x.country_code??null,zip:x.postal_code??null,city:x.city??null});return b?.ok?(s=(b.totalCents/100).toFixed(2),l.updatePayment({paymentId:h.paymentId??h.paymentID,amount:s,currency:n.currency})):y.reject()}catch{return y.reject()}}}:{},onApprove:async h=>{t.value=!0,u.value=null;try{const y=await l.tokenizePayment(h);o("approved",{nonce:y.nonce,deviceData:f,paymentType:"paypal",approvedAmount:s,creditFinancing:H(y),email:y.details?.email??null,firstName:y.details?.firstName??null,lastName:y.details?.lastName??null,phone:y.details?.phone??null,shippingAddress:y.details?.shippingAddress??null})}catch{t.value=!1,k(g("Die PayPal-Zahlung konnte nicht abgeschlossen werden."))}},onCancel:()=>{t.value=!1,o("cancel")},onError:()=>{t.value=!1,k(g("Bei PayPal ist ein Fehler aufgetreten."))}});if(m.isEligible&&!m.isEligible()){o("unavailable");return}await m.render(c.value)}return r({finishProcessing:()=>{t.value=!1}}),se(async()=>{try{if(T()){o("unavailable");return}await ne(),await A()}catch{o("unavailable")}}),(i,C)=>(p(),d("div",null,[re("div",{ref_key:"buttonContainer",ref:c,class:"min-h-11"},null,512),v(u)?(p(),d("p",ye,B(v(u)),1)):z("",!0),v(t)?(p(),d("p",fe,B(v(g)("Bestellung wird angelegt …")),1)):z("",!0)]))}},he={key:0,class:"inline-flex items-center gap-1.5 text-[11px] whitespace-nowrap text-gray-500 @lg:text-xs dark:text-neutral-400"},_e={key:1,class:"contents"},ve=["title","aria-label"],xe=["innerHTML"],we=["src","alt"],ke=["src","alt"],Ce=["innerHTML"],Ae={key:2,class:"flex flex-wrap items-center gap-x-2.5 gap-y-2 py-0.5 opacity-55 grayscale @md:flex-nowrap dark:opacity-65 dark:invert"},be=["src","alt","title"],Ne=["src","alt","title"],Pe=["title","aria-label","innerHTML"],Se={__name:"PaymentLogos",props:{variant:{type:String,default:"inline"}},setup(a){const r=a,e={klarna:'<svg viewBox="0 0 48 30" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="30" fill="#FFB3C7"/><text x="24" y="19" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" font-weight="700" fill="#0A0B09">Klarna.</text></svg>',twint:'<svg viewBox="0 0 48 30" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="30" fill="#000"/><text x="24" y="19" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="9" font-weight="700" letter-spacing=".5" fill="#fff">TWINT</text></svg>',ideal:'<svg viewBox="0 0 48 30" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg"><text x="24" y="19" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" font-weight="700" fill="#CC0066">iDEAL</text></svg>'},n={wire:'<svg viewBox="0 0 18 20" xmlns="http://www.w3.org/2000/svg"><g stroke="#334155" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" fill="none"><path d="M9 0.8 0.8 5.4h16.4L9 0.8Z" fill="#334155" stroke="none"/><line x1="2.9" y1="8.2" x2="2.9" y2="15.4"/>
1<line x1="7" y1="8.2" x2="7" y2="15.4"/><line x1="11" y1="8.2" x2="11" y2="15.4"/><line x1="15.1" y1="8.2" x2="15.1" y2="15.4"/><line x1="0.8" y1="18.4" x2="17.2" y2="18.4"/></g></svg>',klarna:'<svg viewBox="0 0 40 14" xmlns="http://www.w3.org/2000/svg"><text x="0" y="11" font-family="Arial,Helvetica,sans-serif" font-size="11" font-weight="700" fill="#0A0B09">Klarna.</text></svg>',twint:'<svg viewBox="0 0 38 14" xmlns="http://www.w3.org/2000/svg"><text x="0" y="11" font-family="Arial,Helvetica,sans-serif" font-size="10" font-weight="700" letter-spacing=".5" fill="#000">TWINT</text></svg>',ideal:'<svg viewBox="0 0 34 14" xmlns="http://www.w3.org/2000/svg"><text x="0" y="11" font-family="Arial,Helvetica,sans-serif" font-size="11" font-weight="700" fill="#CC0066">iDEAL</text></svg>'},o=L(()=>r.variant==="footer"),g=le({decorative:!0}),u=L(()=>{const t=I()==="ch",c=[{key:"wire",title:_("Überweisung"),type:"banks",svg:g,stripSvg:n.wire},{key:"visa",title:"Visa",type:"cover",img:"/payment-logos/badge-visa.svg"},{key:"mastercard",title:"Mastercard",type:"cover",img:"/payment-logos/badge-mastercard.svg"},{key:"amex",title:"American Express",type:"cover",img:"/payment-logos/badge-amex.svg"},{key:"paypal",title:"PayPal",type:"logo",img:"/payment-logos/paypal.svg",logoClass:"h-[11px]",stripClass:"h-[12px] @lg:h-[14px]"},{key:"apple_pay",title:"Apple Pay",type:"logo",img:"/payment-logos/logo-apple-pay.svg",logoClass:"h-[15px]",stripClass:"h-[15px] @lg:h-[17px]"},{key:"google_pay",title:"Google Pay",type:"logo",img:"/payment-logos/logo-google-pay.svg",logoClass:"h-[15px]",stripClass:"h-[14px] @lg:h-[16px]"}];return t?[{key:"twint",title:"TWINT",type:"svg",svg:e.twint,stripSvg:n.twint},...c.filter(f=>f.key!=="paypal")]:(c.push({key:"klarna",title:"Klarna",type:"svg",svg:e.klarna,stripSvg:n.klarna},{key:"ideal",title:"iDEAL",type:"svg",svg:e.ideal,stripSvg:n.ideal}),c)});return(t,c)=>{const f=U;return p(),d("div",{class:N(v(o)?"flex flex-wrap items-center gap-1.5":"flex flex-col gap-y-1.5 @md:flex-row @md:items-center @md:justify-between @md:gap-x-3")},[v(o)?z("",!0):(p(),d("span",he,[ie(f,{name:"heroicons:lock-closed-solid",class:"size-3 shrink-0 @lg:size-3.5","aria-hidden":"true"}),ae(" "+B(v(_)("Sichere Bezahlung")),1)])),v(o)?(p(),d("span",_e,[(p(!0),d(S,null,F(v(u),s=>(p(),d("span",{key:s.key,title:s.title,"aria-label":s.title,role:"img",class:N(["inline-flex h-8 shrink-0 items-center justify-center overflow-hidden",s.type==="banks"?"":"w-[53px] rounded-[5px] border border-gray-900/10 bg-[#fff]"])},[s.type==="banks"?(p(),d("span",{key:0,class:"banks-svg h-full","aria-hidden":"true",innerHTML:s.svg},null,8,xe)):s.type==="cover"?(p(),d("img",{key:1,src:s.img,alt:s.title,class:"size-full object-cover"},null,8,we)):s.type==="logo"?(p(),d("img",{key:2,src:s.img,alt:s.title,class:N(["w-auto",s.logoClass])},null,10,ke)):(p(),d("span",{key:3,class:"tile-fill size-full","aria-hidden":"true",innerHTML:s.svg},null,8,Ce))],10,ve))),128))])):(p(),d("span",Ae,[(p(!0),d(S,null,F(v(u),s=>(p(),d(S,{key:s.key},[s.type==="cover"?(p(),d("img",{key:0,src:s.img,alt:s.title,title:s.title,class:"h-[15px] w-auto shrink-0 rounded-[3px] @lg:h-[17px]"},null,8,be)):s.type==="logo"?(p(),d("img",{key:1,src:s.img,alt:s.title,title:s.title,class:N(["w-auto shrink-0",s.stripClass])},null,10,Ne)):(p(),d("span",{key:2,title:s.title,"aria-label":s.title,role:"img",class:"strip-svg inline-flex h-[14px] shrink-0 items-center @lg:h-4",innerHTML:s.stripSvg},null,8,Pe))],64))),128))]))],2)}}},We=W(Se,[["__scopeId","data-v-a1d21c64"]]);function Be(a){return a.getCartProductsQuantities.map(r=>({id:r.id,cartQuantity:r.cartQuantity??r.quantity??1,price:r.price}))}function ze(a){const r=a.getVoucher;return r?r.type==="amount"?r.value||0:r.type==="percent"?Math.round(a.getCartProductsTotalPrice*(r.percent/100)*100)/100:0:0}async function Ee(){try{return await D().getVisitorId()}catch{return null}}async function Ie({paymentType:a,countryIso:r=null,zip:e=null,products:n=null}){const o=$(),g=await $fetch(`${Q().public.baseUrl}/checkout/express-quote`,{method:"POST",headers:{Accept:"application/json","X-KETTNER-FRONTEND-TLD":I()},body:{visitor_hash:await Ee(),products:n?n.map(u=>({...u,price:(u.price??0)/100}
1)):Be(o),country_iso:r||null,zip:e||null,payment_type:a,voucher_amount:n?null:ze(o)||null}});if(!g?.success||!g?.data)throw new Error("Express quote failed");return g.data}function Ue(a,r=null){const e={lastQuote:null,lastAddress:null,correction:null};function n(t,c){return JSON.stringify([c?.countryIso??null,c?.zip??null,t.virtual_shipping_method_id??null,t.product_total_cents??null,t.shipping_cost_cents??null,t.surcharge_cents??null])}function o(t,c){return!e.correction||e.correction.signature!==n(t,c)?t:{...t,total_cents:Math.max(Number(t.total_cents)||0,e.correction.totalCents)}}async function g({countryIso:t=null,zip:c=null}={}){try{const f={countryIso:t,zip:c},s=o(await Ie({paymentType:a,countryIso:t,zip:c,products:r?.()??null}),f);return s.available?(e.lastQuote=s,e.lastAddress=f,{ok:!0,totalCents:s.total_cents,shippingCents:s.shipping_cost_cents,shippingLabel:s.name}):{ok:!1,errorMessage:s.reason||_("Lieferung an diese Adresse ist nicht möglich.")}}catch{return{ok:!1,errorMessage:_("Versandkosten konnten nicht berechnet werden.")}}}function u(t){const c=Math.round(Number(t));!e.lastQuote||!Number.isFinite(c)||c<=0||(e.correction={signature:n(e.lastQuote,e.lastAddress),totalCents:c},e.lastQuote={...e.lastQuote,total_cents:Math.max(Number(e.lastQuote.total_cents)||0,c)})}return{quoteForAddress:g,applyServerTotal:u,get lastQuote(){return e.lastQuote},get hasServerTotalCorrection(){return e.correction!==null}}}function Me(a,r){const e=Te(a,r);if(!e)return null;const n=oe({street:e.street,zip:e.zip,city:e.city,countryIso:e.countryIso});return{...e,street:n.street,zip:n.zip,city:n.city}}function Te(a,r){if(a==="mollie_apple_pay"){const e=r.shippingContact;return e?{firstName:e.givenName??"",lastName:e.familyName??"",street:(e.addressLines??[]).filter(Boolean).join(", "),zip:e.postalCode??"",city:e.locality??"",countryIso:(e.countryCode??"").toUpperCase(),phone:e.phoneNumber??null,email:e.emailAddress??null}:null}if(a==="mollie_google_pay"){const e=r.shippingAddress;if(!e)return null;const n=String(e.name??"").trim().split(/\s+/),o=n.length>1?n.pop():"";return{firstName:n.join(" "),lastName:o,street:[e.address1,e.address2,e.address3].filter(Boolean).join(", "),zip:e.postalCode??"",city:e.locality??"",countryIso:(e.countryCode??"").toUpperCase(),phone:e.phoneNumber??null,email:r.email??null}}if(a==="paypal"){const e=r.shippingAddress;if(!e)return null;let n=r.firstName??"",o=r.lastName??"";if(!n&&e.recipientName){const g=String(e.recipientName).trim().split(/\s+/);o=g.length>1?g.pop():"",n=g.join(" ")}return{firstName:n,lastName:o,street:[e.line1,e.line2].filter(Boolean).join(", "),zip:e.postalCode??"",city:e.city??"",countryIso:(e.countryCode??"").toUpperCase(),phone:r.phone??null,email:r.email??null}}return null}function w(a){E.$emit("notify",{type:"error",title:a})}async function qe({paymentType:a,quote:r,approval:e,products:n=null,addressOverride:o=null,session:g=null}){const u=$();if(!n&&u.getCartProductsQuantity===0&&u.getOfferProductsQuantity===0)return w(_("Ihr Warenkorb ist leer. Bitte legen Sie Produkte in den Warenkorb.")),{ok:!1};if(!r?.virtual_shipping_method_id)return w(_("Versandkosten konnten nicht berechnet werden.")),{ok:!1};const t=Me(a,e);if(t&&o&&Object.assign(t,o),!t||!t.firstName||!t.lastName||!t.zip||!t.city)return w(_("Die Adresse aus Ihrer Wallet ist unvollständig. Bitte nutzen Sie den normalen Checkout.")),{ok:!1};const c=t.email||u.getEmail;if(!c)return w(_("Es ist keine gültige E-Mail Adresse angegeben.")),{ok:!1};const f=q().find(l=>l.iso===t.countryIso&&l.active);if(!f)return w(_("Lieferung an diese Adresse ist nicht möglich.")),{ok:!1};const s=typeof t.phone=="string"?t.phone.trim():"",k=!me(s);if(k||!t.street||ce({street:t.street,zip:t.zip,city:t.city,countryIso:f.iso}))return{ok:!1,needsAddressFix:!0,phoneRequired:k,address:{...t}};const A={firstName:t.firstName,lastName:t.lastName,company:null,vat:null,street:t.street,zip:t.zip,city:t.city,country:f,phone:t.phone||null},i=pe({billingAddress:A,deliveryAddress:null,hasDeliveryAddress:!1,deliveryProvider:{id:r.virtual_shipping_method_id,key:r.slug}
1,deliveryPrice:(r.shipping_cost_cents??0)/100,exchangeRate:1,paymentProvider:a,postnummer:null,pickupLocation:null,userEmail:c});delete i.billing_address_id,delete i.shipping_address_id,delete i.is_packstation,delete i.packstation_number,i.email=c,i.billing_address=A,i.has_delivery_address=!1,i.delivery_address=null,n&&(i.products=n.map(l=>({id:l.id,quantity:l.cartQuantity??1,price:l.price,price_reduction:l.price_reduction??0,is_offer:!1,bundle_products:(l.bundle_products??[]).map(m=>({...m,price:m.price??0}))})),i.discount=null,i.voucher_code=null,i.offer_uuid=null,i.delivery_groups=null),i.payment_type=a,i.payment_approved_amount=e.approvedAmount,i.express_wallet=!0,u.clearRafflePrize(),i.raffle_server_draw=!0,a==="paypal"?(i.payment_nonce=e.nonce,i.device_data=e.deviceData??null,i.paypal_credit_financing=e.creditFinancing??null,i.mollie_wallet_token=null,i.mollie_card_token=null):(i.mollie_wallet_token=e.mollieWalletToken,i.payment_nonce=null);try{i.visitor_hash=await D().getVisitorId()}catch{}const C=ge();i.idempotency_key=C.resolveKey(i);try{const l=await de(()=>$fetch(`${Q().public.baseUrl}/orders`,{method:"POST",headers:{Accept:"application/json"},body:i}));if(!l?.success)return w(_("Die Bestellung konnte nicht angelegt werden. Bitte nutzen Sie den normalen Checkout.")),{ok:!1};C.clear();const m=l.data??{};ue(m.raffle_prize,m.reference);const h=l.duplicate===!0,y=n??[...Object.values(u.getCartProducts??{}),...Object.values(u.getOfferProducts??{})];if(!h){try{K("purchase",y,{currency:"EUR",transaction_id:m.reference,affiliation:`kettner-edelmetalle.${I()}`,shipping:(r.shipping_cost_cents??0)/100,value:(r.total_cents??0)/100})}catch{}try{G().addEvent("purchase",{what:m.reference,why:n?n.reduce((b,M)=>b+(Number(M.price)||0)*(M.cartQuantity??1),0)/100:Number(u.getCartProductsTotalPrice)||0,how_much:r.total_cents??0,data:Y(y)},!0)}catch{}try{await Z().incrementPurchaseCount()}catch{}}n||await u.clearCheckout();const x=m.is_collective?"&collective=1":"";return J().push(`/bestellbestaetigung?order=${m.reference}&hash=${m.hash}${x}`),{ok:!0}}catch(l){if(l?.data?.errors?.["billing_address.phone"]?.length)return{ok:!1,needsAddressFix:!0,phoneRequired:!0,address:{...t}};if([...l?.data?.errors?.["billing_address.street"]??[],...l?.data?.errors?.["delivery_address.street"]??[]].some(x=>/hausnummer/i.test(String(x))))return{ok:!1,needsAddressFix:!0,address:{...t}};const h=Number(l?.data?.error?.context?.grand_total_cents);if(l?.data?.error?.type==="payment_amount_mismatch"&&Number.isFinite(h)&&h>0)return g?.applyServerTotal?.(h),E.$emit("notify",{type:"warning",title:_("Der Bestellbetrag wurde aktualisiert ({amount}). Bitte bestätigen Sie die Zahlung erneut.",{amount:X(h/100,l?.data?.error?.context?.currency||null)})}),{ok:!1};const y=l?.data?.error?.message||l?.data?.message;return w(y||_("Die Bestellung konnte nicht angelegt werden. Bitte nutzen Sie den normalen Checkout.")),{ok:!1}}}export{Ve as _,We as a,Ue as c,Me as n,qe as s};

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.