'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),Text=require("../../text/components/Text.js");const CartTotalPrice=({setting:e,styles:r,builderProps:t})=>{let{data:c}=core.useCartData(),u=React.useMemo(()=>{switch(e?.priceType){case"tax":default:return{value:c?.totalPrice,currency:c?.currency};case"duty":return{value:c?.lineItemsSubtotalPrice,currency:c?.currency};case"subtotal":return{value:c?.subtotalPrice,currency:c?.currency}}},[c?.currency,c?.lineItemsSubtotalPrice,c?.subtotalPrice,c?.totalPrice,e?.priceType]),a=core.useFormatMoney(u.value||0,!1);return u?jsxRuntime.jsx(Text.default,{builderProps:t,styles:r,setting:{text:a,excludeFlex:!0}}):null};exports.default=CartTotalPrice;
