UNPKG

commerce-kit

Version:

2 lines (1 loc) 20.2 kB
var xt=Object.defineProperty;var v=(e,t)=>()=>(e&&(t=e(e=0)),t);var wt=(e,t)=>{for(var r in t)xt(e,r,{get:t[r],enumerable:!0})};var Ct,vt,y,q=v(()=>{"use strict";Ct=process.env.STRIPE_SECRET_KEY,vt=process.env.STRIPE_CURRENCY,y={StripeSecretKey:Ct,StripeCurrency:vt}});function _(e,t){if(!e)throw new Error(t)}var M,J,K=v(()=>{"use strict";M=e=>{if(e==null)return 0;if(typeof e=="number")return e;let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t},J=e=>{if(e==null)return null;try{return JSON.parse(e)}catch{return null}}});var Pt,O,W=v(()=>{"use strict";Pt=e=>e.toString().replace(/\\/g,"\\\\").replace(/"/g,'\\"'),O=e=>Object.entries(e).map(([t,r])=>`${t}:"${Pt(r)}"`).join(" AND ").trim()});import{z as o}from"zod";function B(e){return e.toSorted((t,r)=>{let n=Number(t.metadata.order),i=Number(r.metadata.order);return Number.isNaN(n)&&Number.isNaN(i)||n===i?r.updated-t.updated:Number.isNaN(n)?1:Number.isNaN(i)?-1:n-i})}function $({default_price:e,marketing_features:t,...r}){return _(e,"Product must have a default price"),_(typeof e=="object","Product default price must be an object"),{...r,default_price:e,marketing_features:t.map(n=>n.name).filter(Boolean),metadata:St.parse(r.metadata)}}function _t(e){return!!(e.active&&!e.deleted&&e.default_price)}function N(e){return{...e,data:e.data.filter(_t)}}function G(e){return e.data.map($)}function F(e){return e.filter((t,r,n)=>r===n.findIndex(i=>i.metadata.slug===t.metadata.slug))}function Y(e){let t=e.payment_method;_(typeof t!="string","Payment method should not be a string");let r=e.customer;_(typeof r!="string"&&!r?.deleted,"Customer should not be a string");let n=U.parse(e.metadata),i=Object.entries(n).filter(([a])=>a.startsWith("taxBreakdown")).map(([a,s])=>{let d=It.safeParse(J(String(s)));return d.success?d.data:null}).filter(Boolean);return{...e,metadata:n,customer:r,payment_method:t,taxBreakdown:i}}var St,X,U,It,H=v(()=>{"use strict";K();W();St=o.object({category:o.string().optional(),order:o.coerce.number().optional(),slug:o.string(),variant:o.string().optional(),stock:o.coerce.number().optional().transform(e=>e===void 0?Number.POSITIVE_INFINITY:e),digitalAsset:o.string().optional(),preview:o.string().optional()});X=e=>!e.deleted&&e.active,U=o.object({shippingRateId:o.string().optional(),taxCalculationId:o.string().optional(),taxCalculationExp:o.string().optional(),taxId:o.string().optional(),couponCode:o.string().optional(),taxedAmount:o.string().optional(),"billingAddress.city":o.string().optional(),"billingAddress.country":o.string().optional(),"billingAddress.line1":o.string().optional(),"billingAddress.line2":o.string().optional(),"billingAddress.name":o.string().optional(),"billingAddress.postalCode":o.string().optional(),"billingAddress.state":o.string().optional(),netAmount:o.string().optional(),taxBreakdown0:o.string().optional(),taxBreakdown1:o.string().optional(),taxBreakdown2:o.string().optional(),taxBreakdown3:o.string().optional(),taxBreakdown4:o.string().optional(),taxBreakdown5:o.string().optional()}).and(o.record(o.string(),o.string())),It=o.object({taxType:o.string(),taxPercentage:o.string(),taxAmount:o.number()})});var S,Rt,Et,E,m,Z=v(()=>{"use strict";S={DEBUG:0,LOG:1,WARN:2,ERROR:3},Rt="LOG",Et=process.env.LOG_LEVEL&&process.env.LOG_LEVEL in S?process.env.LOG_LEVEL:Rt,E=S[Et],m={time(e){E>S.DEBUG||console.time(e)},timeEnd(e){E>S.DEBUG||console.timeEnd(e)},log(...e){E>S.LOG||console.log(...e)},dir(e,t){E>S.LOG||console.dir(e,t)},warn(...e){E>S.WARN||console.warn(...e)},error(...e){E>S.ERROR||console.error(...e)}}});var w,P,tt=v(()=>{"use strict";w=e=>e.filter(Boolean),P={accountGetById:{tags:({accountId:e})=>w(["account",e&&`account-${e}`]),revalidate:()=>{}},cartGetById:{tags:({cartId:e})=>w(["cart",`cart-${e}`]),revalidate:()=>{}},createTaxCalculation:{tags:({cartId:e})=>w(["tax-calculations",`tax-calculations-${e}`]),revalidate:()=>{}},fileGetById:{tags:({fileId:e})=>w(["files",`file-${e}`]),revalidate:()=>{}},orderGetById:{tags:({orderId:e})=>w(["order",`order-${e}`]),revalidate:()=>{}},productBrowse:{tags:({category:e})=>w(["product",e&&`category-${e}`]),revalidate:()=>{}},productGetById:{tags:({productId:e})=>w(["product",`product-${e}`]),revalidate:()=>{}},productGetBySlug:{tags:({productSlug:e})=>w(["product",`product-${e}`]),revalidate:()=>{}},shippingBrowse:{tags:()=>w(["shipping"]),revalidate:()=>{}},shippingGetById:{tags:({shippingId:e})=>w(["shipping",`shipping-${e}`]),revalidate:()=>{}},taxDefaultGet:{tags:()=>w(["tax-settings"]),revalidate:()=>{}}}});import et from"stripe";var bt,f,rt=v(()=>{"use strict";q();bt=(e,t)=>!e||!t?e:[...e,`prefix-${t}`,...e.map(r=>`${t}-${r}`)],f=({tags:e,revalidate:t,cache:r,tagPrefix:n,secretKey:i})=>{let a=i??y.StripeSecretKey;if(!a)throw new Error("Missing `secretKey` parameter and `STRIPE_SECRET_KEY` env variable.");let s=bt(e,n);return new et(a,{typescript:!0,apiVersion:"2025-08-27.basil",httpClient:et.createFetchHttpClient(((p,c)=>fetch(p,{...c,cache:r??c?.cache,next:{tags:s??c?.next?.tags,revalidate:t??c?.next?.revalidate}}))),appInfo:{name:"Commerce SDK",version:"beta",url:"https://yournextstore.com",partner_id:"CONS-003378"}})}});var h,at=v(()=>{"use strict";h=async()=>{let e={stripeAccount:void 0,storeId:void 0,secretKey:void 0,publishableKey:void 0};return await global?.__ynsFindStripeAccount?.()??e}});import{revalidateTag as At}from"next/cache";import b from"stripe";import{z as ue}from"zod";function ot({productId:e,cartId:t}){return t?j({cartId:t,productId:e,operation:"INCREASE",clearTaxCalculation:!0}):Tt({productId:e})}async function j({productId:e,cartId:t,operation:r,clearTaxCalculation:n}){let[i,a]=await Promise.all([V(e),pt(t)]);if(!i)throw new Error(`Product not found: ${e}`);if(!a)throw new Error(`Cart not found: ${t}`);if(i.metadata.stock<=0)throw Error(`Product ${e} is out of stock`);if(!y.StripeCurrency)throw new Error("Missing `STRIPE_CURRENCY` env variable");if(y.StripeCurrency.toLowerCase()!==i.default_price.currency.toLowerCase())throw new Error(`Product currency ${i.default_price.currency} does not match cart currency ${y.StripeCurrency}`);let s=a.cart.metadata??{},c=M(s[e])+(r==="INCREASE"?1:-1);c<=0?s[e]="":s[e]=c.toString();let C=Nt(a)+(i.default_price.unit_amount??0);try{return await Mt({paymentIntentId:t,data:{metadata:s,amount:C||it},clearTaxCalculation:n})}catch(g){m.error(g)}finally{At(`cart-${t}`)}}async function st(e){let{stripeAccount:t,storeId:r,secretKey:n}=await h(),i=f({secretKey:n,tagPrefix:r,tags:P.cartGetById.tags({cartId:e}),cache:"force-cache"});try{let a=await i.paymentIntents.retrieve(e,{expand:["payment_method","customer"]},{stripeAccount:t});if(dt.includes(a.status)){let s=Y(a);if(!s)return null;let d=await z(s.metadata),{metadata:{shippingRateId:p}}=s,c=p&&await Q(p);return{cart:s,lines:d.map(({product:C,quantity:g})=>C?{product:C,quantity:g}:null).filter(Boolean),shippingRate:c||null}}}catch(a){if(m.error(a),a instanceof b.errors.StripeError&&a.code==="resource_missing")return null;throw a}}async function Tt({productId:e}={}){let{stripeAccount:t,storeId:r,secretKey:n}=await h(),i=f({secretKey:n,tagPrefix:r,cache:"no-cache"});if(!y.StripeCurrency)throw new Error("Missing `STRIPE_CURRENCY` env variable");try{let a=e?await V(e):null;if(a&&a.metadata.stock<=0)throw Error(`Product ${e} is out of stock`);return await i.paymentIntents.create({currency:y.StripeCurrency,amount:a?.default_price.unit_amount||it,automatic_payment_methods:{enabled:!0},metadata:{...a&&{[a.id]:"1"}}},{stripeAccount:t})}catch(a){throw m.error(a),a}}async function D(e){let{stripeAccount:t,storeId:r,secretKey:n}=await h(),i=f({secretKey:n,tagPrefix:r,tags:P.productGetById.tags({productId:e}),cache:"force-cache"});try{let a=await i.products.retrieve(e,{expand:["default_price"]},{stripeAccount:t});return $(a)}catch(a){if(a instanceof b.errors.StripeError&&a.code==="resource_missing")return null;throw a}}async function ct({slug:e}){let{stripeAccount:t,storeId:r,secretKey:n}=await h(),a=await f({secretKey:n,tagPrefix:r,tags:P.productGetBySlug.tags({productSlug:e}),cache:"force-cache"}).products.search({query:O({active:!0,'metadata["slug"]':e}),expand:["data.default_price"]},{stripeAccount:t});if(a.data.length>1&&a.data.some(s=>!s.metadata.variant))throw new Error(`Multiple products found with the same slug (${e}) but no variant set.`);return await Promise.allSettled(a.data.map(s=>D(s.id))),B(G(N(a)))}async function ut(e){let{stripeAccount:t,storeId:r,secretKey:n}=await h();if(e.filter?.category){let s=e.filter?.category,p=await f({secretKey:n,tagPrefix:r,tags:P.productBrowse.tags({category:s}),cache:"force-cache"}).products.search({limit:100,query:O({active:!0,'metadata["category"]':s}),expand:["data.default_price"]},{stripeAccount:t});return B(F(G(N(p)))).slice(e.offset||0,e.first)}let a=await f({secretKey:n,tagPrefix:r,tags:P.productBrowse.tags({}),cache:"force-cache"}).products.list({limit:100,active:!0,expand:["data.default_price"]},{stripeAccount:t});return B(F(G(N(a))).filter(X)).slice(e.offset||0,e.first)}async function Q(e){let{stripeAccount:t,storeId:r,secretKey:n}=await h(),i=f({secretKey:n,tagPrefix:r,tags:P.shippingGetById.tags({shippingId:e}),cache:"force-cache"});try{let a=await i.shippingRates.retrieve(e,{},{stripeAccount:t});return a}catch(a){if(m.error(a),a instanceof b.errors.StripeError&&a.code==="resource_missing")return null;throw a}}async function z(e){let t=Bt(e);return await Promise.all(t.map(async([n,i])=>({product:await V(n),quantity:i})))}function Lt({oldCart:e,data:t,mergedMetadata:r,lines:n}){if(!process.env.ENABLE_STRIPE_TAX)return!1;let i=Date.now(),a=r.taxCalculationExp?Number.parseInt(r.taxCalculationExp,10)*1e3:null;if(!a||i>=a)return!0;let s=e.cart.metadata.netAmount||e.cart.amount,d=t.amount,p=Gt.some(u=>!r[u]&&!e.cart.metadata[u]?!1:r[u]!==e.cart.metadata[u]),c=n.length!==e.lines.length||n.some(u=>{let x=e.lines.find(I=>I.product.id===u.product?.id);return u.product?.default_price.unit_amount!==x?.product.default_price.unit_amount||u.quantity!==x?.quantity});return d&&s!==d||p||c}async function lt(e){let{stripeAccount:t,storeId:r,secretKey:n}=await h(),i=f({secretKey:n,tagPrefix:r,tags:["customers",`customers-${e}`],cache:"force-cache"});try{let a=await i.customers.retrieve(e,{},{stripeAccount:t});return a.deleted?null:a}catch(a){if(m.error(a),a instanceof b.errors.StripeError&&a.code==="resource_missing")return null;throw a}}function qt(e,t){return t.coupon.amount_off?Math.max(e-t.coupon.amount_off,0):t.coupon.percent_off?Math.floor(e*(1-t.coupon.percent_off/100)):e}async function Kt(){let{stripeAccount:e,storeId:t,secretKey:r}=await h();return await f({secretKey:r,tagPrefix:t,tags:["tax-settings"],cache:"force-cache"}).tax.settings.retrieve({},{stripeAccount:e})}var it,V,dt,Bt,$t,pt,Nt,Gt,kt,nt,Mt,mt=v(()=>{"use strict";q();H();Z();tt();rt();W();K();at();it=1e3;V=async e=>{let{stripeAccount:t,storeId:r,secretKey:n}=await h(),i=f({secretKey:n,tagPrefix:r,tags:P.productGetById.tags({productId:e}),cache:"force-cache"});try{let a=await i.products.retrieve(e,{expand:["default_price"]},{stripeAccount:t});return $(a)}catch(a){if(a instanceof b.errors.StripeError&&a.code==="resource_missing")return null;throw a}},dt=["requires_action","requires_confirmation","requires_capture","requires_payment_method"],Bt=e=>Object.entries(e??{}).filter(([t])=>t.startsWith("prod_")).map(([t,r])=>[t,M(r)]).filter(([,t])=>t&&Number.isFinite(t)&&t>0),$t=async e=>{let{stripeAccount:t,storeId:r,secretKey:n}=await h(),i=f({secretKey:n,tagPrefix:r,tags:P.cartGetById.tags({cartId:e}),cache:"force-cache"});try{let a=await i.paymentIntents.retrieve(e,{expand:["payment_method"]},{stripeAccount:t}),s=typeof a.customer=="string"?await lt(a.customer):null;if(dt.includes(a.status))return Y({...a,customer:s})}catch(a){if(m.error(a),a instanceof b.errors.StripeError&&a.code==="resource_missing")return null;throw a}};pt=async e=>{let t=await $t(e);if(!t)return null;let r=await z(t.metadata),{metadata:{shippingRateId:n}}=t,i=n&&await Q(n);return{cart:t,lines:r.map(({product:a,quantity:s})=>a?{product:a,quantity:s}:null).filter(Boolean),shippingRate:i||null}},Nt=e=>e?e.cart.metadata?.taxCalculationId?e.cart.amount:(e.shippingRate?.fixed_amount?.amount??0)+e.lines.reduce((t,{product:r,quantity:n})=>t+(r.default_price?.unit_amount??0)*n,0):0,Gt=["billingAddress.country","billingAddress.postalCode","billingAddress.state","taxId","shippingRateId","couponCode"];kt=async({lineItems:e,billingAddress:t,cartId:r,shippingRateId:n,taxId:i})=>{if(!process.env.ENABLE_STRIPE_TAX)return null;if(!y.StripeCurrency)throw new Error("Missing `STRIPE_CURRENCY` env variable");let{stripeAccount:a,storeId:s,secretKey:d}=await h(),p=f({secretKey:d,tagPrefix:s,tags:P.createTaxCalculation.tags({cartId:r}),cache:"force-cache"});if(!t?.country)return null;let c=n?await Q(n):null,C=typeof c?.tax_code=="string"?c.tax_code:c?.tax_code?.id,g=await Kt(),u=y.StripeCurrency==="usd"||y.StripeCurrency==="cad"?"exclusive":"inclusive",x=g.defaults.tax_behavior==="inferred_by_currency"?u:g.defaults.tax_behavior??u;g.defaults.tax_behavior||m.warn(`Tax behavior not set in Stripe settings. Inferring from currency ${y.StripeCurrency}: ${u}.`),m.time(`createTaxCalculation ${r}`);let I=await p.tax.calculations.create({expand:["line_items"],line_items:e.map(A=>({...A,tax_behavior:A.tax_behavior??x})),currency:y.StripeCurrency,shipping_cost:c?.active&&c?.fixed_amount?{amount:c.fixed_amount.amount,tax_behavior:c.tax_behavior==="inclusive"?"inclusive":c.tax_behavior==="exclusive"?"exclusive":x,tax_code:C??g.defaults.tax_code??void 0}:void 0,customer_details:{tax_ids:i?[{type:"eu_vat",value:i}]:void 0,address_source:"billing",address:{country:t.country,city:t?.city,line1:t?.line1,line2:t?.line2,postal_code:t?.postalCode,state:t?.state}}},{stripeAccount:a});return m.timeEnd(`createTaxCalculation ${r}`),console.log(JSON.stringify(I).length),I},nt={taxBreakdown0:"",taxBreakdown1:"",taxBreakdown2:"",taxBreakdown3:"",taxBreakdown4:"",taxBreakdown5:""};Mt=async({paymentIntentId:e,data:t,customerOverride:r,clearTaxCalculation:n})=>{let{stripeAccount:i,storeId:a,secretKey:s}=await h(),d=await pt(e);_(d,`Cart not found: ${e}`);let p=t.amount?t.amount.toString():null,c=U.parse({...d.cart.metadata,...t.metadata});m.time("getProductsFromMetadata");let C=await z(c);m.timeEnd("getProductsFromMetadata");let g=!n&&Lt({oldCart:d,data:t,mergedMetadata:c,lines:C});console.log({shouldRecalculateTax:g});let u=g?await kt({cartId:e,taxId:c.taxId??null,shippingRateId:c.shippingRateId??null,billingAddress:{country:c["billingAddress.country"]??"",city:c["billingAddress.city"]??"",line1:c["billingAddress.line1"]??"",line2:c["billingAddress.line2"]??"",name:c["billingAddress.name"]??"",postalCode:c["billingAddress.postalCode"]??"",state:c["billingAddress.state"]??""},lineItems:C.map(({product:l,quantity:T})=>{if(l?.default_price.unit_amount)return{product:l.id,reference:[l.metadata.slug,l.metadata.variant].filter(Boolean).join("-"),quantity:T,amount:l.default_price.unit_amount*T,tax_behavior:l.default_price.tax_behavior==="exclusive"?"exclusive":l.default_price.tax_behavior==="inclusive"?"inclusive":void 0,tax_code:l.tax_code?typeof l.tax_code=="string"?l.tax_code:l.tax_code.id:void 0}}).filter(Boolean)}):null,x=r??(t.customer?await lt(t.customer):d.cart.customer);console.log({customer:x});let I=f({secretKey:s,tagPrefix:a,cache:"no-cache"});m.time(`paymentIntents.update ${e}`);let A=u&&Object.fromEntries(u.tax_breakdown.map(l=>({taxType:l.tax_rate_details.tax_type,taxPercentage:l.tax_rate_details.percentage_decimal,taxAmount:l.amount})).map((l,T)=>[`taxBreakdown${T}`,JSON.stringify(l)])),R=u?u.amount_total:t.amount,k=R&&x?.discount?.coupon.valid?qt(R,x.discount):R;console.log({"discount.coupon.amount_off":x?.discount?.coupon.amount_off,"discount.coupon.percent_off":x?.discount?.coupon.percent_off,discountedAmount:k,taxedAmount:R,"taxCalculation.amount_total":u?.amount_total,"data.amount":t.amount,netAmount:p});let ht=await I.paymentIntents.update(e,{...t,...k&&{amount:k},metadata:{...c,...p&&{netAmount:p},...R&&{taxedAmount:R},...u?{...nt,...A,taxCalculationId:u.id,taxCalculationExp:u?.expires_at}:{...n&&{...nt,taxCalculationId:"",taxCalculationExp:""}}}},{stripeAccount:i});return m.timeEnd(`paymentIntents.update ${e}`),ht}});var ft={};wt(ft,{StripeProvider:()=>L,createStripeProvider:()=>Wt});function Wt(e){return new L(e)}var L,gt=v(()=>{"use strict";mt();L=class{constructor(t){this.config=t}mapStripeProduct(t){let r=t.default_price?.unit_amount||0,n=t.default_price?.currency||"usd";return{id:t.id,name:t.name,slug:t.metadata?.slug,summary:t.description,images:t.images||[],active:t.active,price:r/100,currency:n.toUpperCase(),stock:Number.parseInt(t.metadata?.stock||"0",10),stripeId:t.id,metadata:t.metadata||{}}}async productBrowse(t){let r=await ut({first:t.first||10,...t}),n=r.data.map(i=>this.mapStripeProduct(i));return{data:n,meta:{count:r.totalCount||n.length,offset:t.offset||0,limit:t.first||10,hasMore:n.length===(t.first||10)}}}async productGet(t){if(t.fields&&console.warn("GraphQL field selection not supported for Stripe provider. Ignoring 'fields' parameter."),t.slug){let r=await ct({slug:t.slug});return r?this.mapStripeProduct(r):null}if(t.id){let r=await D(t.id);return r?this.mapStripeProduct(r):null}throw new Error("Either slug or id is required for productGet")}async cartAdd(t){let r=t.quantity;if(t.cartId)try{let s=await this.cartGet({cartId:t.cartId});if(s){let d=s.items.find(p=>p.variantId===t.variantId);d&&(r=d.quantity+t.quantity)}}catch{}let i=(await ot({productId:t.variantId,cartId:t.cartId}))?.id||t.cartId||"",a=await this.cartGet({cartId:i});if(!a)throw new Error("Failed to retrieve cart after adding item");return a}async cartUpdate(t){let r=await j({cartId:t.cartId,productId:t.variantId,operation:"SET",quantity:t.quantity}),n=await this.cartGet({cartId:r?.id||t.cartId});if(!n)throw new Error("Failed to retrieve cart after update");return n}async cartClear(t){throw new Error("Cart clear not yet implemented for Stripe provider")}async cartRemove(t){return await this.cartUpdate({cartId:t.cartId,variantId:t.variantId,quantity:0})}async cartGet(t){let r=await st(t.cartId);return r?this.mapCart(r):null}mapCart(t){let r=this.mapCartItems(t.lines);return{id:t.cart.id,customerId:this.mapCustomerId(t.cart.customer),storeId:void 0,customer:void 0,items:r,total:this.calculateTotal(r),currency:t.cart.currency?.toUpperCase()||"USD",createdAt:new Date(t.cart.created*1e3).toISOString(),updatedAt:new Date().toISOString()}}mapCartItems(t){return t?.map(r=>this.mapCartItem(r))||[]}mapCartItem(t){return{id:t.product?.id||"",productId:t.product?.id||"",variantId:t.product?.id,quantity:t.quantity,price:t.product?.default_price?.unit_amount||0,stock:void 0,product:void 0}}mapCustomerId(t){if(typeof t=="string")return t;if(t?.id)return t.id}calculateTotal(t){return t.reduce((r,n)=>r+n.price*n.quantity,0)}}});var yt=class{config;provider;providerPromise;constructor(t){if(this.config=t||this.detectFromEnv(),!this.config.secretKey&&!process.env.STRIPE_SECRET_KEY)throw new Error("Stripe configuration required. Provide secretKey in constructor or set STRIPE_SECRET_KEY environment variable.")}detectFromEnv(){return{secretKey:process.env.STRIPE_SECRET_KEY,tagPrefix:process.env.STRIPE_TAG_PREFIX}}async getProvider(){return this.provider?this.provider:(this.providerPromise||(this.providerPromise=this.loadProvider()),this.provider=await this.providerPromise,this.provider)}async loadProvider(){try{let{createStripeProvider:t}=await Promise.resolve().then(()=>(gt(),ft));return t(this.config)}catch(t){throw new Error(`Failed to initialize Stripe provider: ${t instanceof Error?t.message:"Unknown error"}`)}}get product(){return{browse:async(t={})=>(await this.getProvider()).productBrowse(t),get:async t=>(await this.getProvider()).productGet(t)}}get cart(){return{add:async t=>(await this.getProvider()).cartAdd(t),update:async t=>(await this.getProvider()).cartUpdate(t),remove:async t=>(await this.getProvider()).cartRemove(t),clear:async t=>(await this.getProvider()).cartClear(t),get:async t=>(await this.getProvider()).cartGet(t)}}};export{yt as Commerce};