'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),Row=require("../../../grid/components/row/Row.js"),Col=require("../../../grid/components/col/Col.js");require("../../../modal/components/confirm.js");var Modal=require("../../../modal/components/Modal.js"),ProductButton=require("../product-button/ProductButton.js"),ProductImages=require("../ProductImages.js"),ProductPrice=require("../product-price/ProductPrice.js"),ProductQuantity=require("../product-quantity/ProductQuantity.js"),ProductTitle=require("../product-title/ProductTitle.js"),ProductVariants=require("../product-variants/ProductVariants.js");const ModalContent=()=>{let e=core.useProduct(),{data:t,isValidating:r,error:i}=core.useProductQuery(e?.id);return r?jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("svg",{className:"gp-mx-auto gp-my-20 gp-h-8 gp-w-8 gp-animate-spin gp-text-base",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):i?jsxRuntime.jsx("p",{className:"gp-py-20 gp-text-center gp-font-semibold",children:"Something went wrong"}):jsxRuntime.jsx(core.ProductProvider,{product:t,children:jsxRuntime.jsxs(Row.default,{setting:{layout:{desktop:{cols:[6,6],display:"fill"},mobile:{cols:[12]}}},children:[jsxRuntime.jsx(Col.default,{children:jsxRuntime.jsx(ProductImages.default,{})}),jsxRuntime.jsxs(Col.default,{children:[jsxRuntime.jsx(ProductTitle.default,{setting:{htmlTag:"p"},styles:{typography:{type:"heading-3"}}}),jsxRuntime.jsxs(Row.default,{setting:{layout:{desktop:{cols:[6,6],display:"fit"}}},children:[jsxRuntime.jsx(Col.default,{children:jsxRuntime.jsx(ProductPrice.default,{setting:{priceType:"regular"},styles:{typography:{type:"subheading-2"}}})}),jsxRuntime.jsx(Col.default,{children:jsxRuntime.jsx(ProductPrice.default,{setting:{priceType:"compare"},styles:{typography:{type:"paragraph-2"}}})})]}),jsxRuntime.jsx(ProductVariants.default,{}),jsxRuntime.jsx(ProductQuantity.default,{}),jsxRuntime.jsx(ProductButton.default,{})]})]})})},ProductQuickView=({label:e})=>{let[t,r]=React.useState(!1),i=core.usePluginEnable();return i?.includes("quick-view")?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{"aria-hidden":!0,role:"button","aria-label":"Quick view",onClick:()=>r(e=>!e),children:e}),jsxRuntime.jsx(Modal.default,{setting:{open:t},closeOnClickOutside:!0,onClose:()=>r(e=>!e),children:jsxRuntime.jsx(ModalContent,{})})]}):null};ProductQuickView.defaultProps={label:"Quick View"},exports.default=ProductQuickView;
