"use strict";var core=require("@gem-sdk/core");const PRODUCT_ID_LATEST="latest",PREFIX_PRODUCT_ID="gid://shopify/Product/",PREFIX_PRODUCT_VARIANT_ID="gid://shopify/ProductVariant/",PREFIX_PRODUCT_OPTION_VALUE_ID="gid://shopify/ProductOptionValue/",STATIC_PRODUCT_STATUS="static",DYNAMIC_PRODUCT_STATUS="dynamic",getData=T=>{let{setting:_,advanced:I,styles:D}=T,{productSetting:P,quantity:e,readOnly:t,isAuto:R,isSyncProduct:O,...U}=_??{},{...A}=D??{},{pos:C,top:a}=I??{},r=core.composeAdvanceStyle({pos:C,top:a}),o=P?.productHandle??"",s=P?.initialVariantBaseId,S=s?.replace(PREFIX_PRODUCT_VARIANT_ID,"")??"",c=P?.productId?.replace(PREFIX_PRODUCT_ID,"").toLowerCase()??PRODUCT_ID_LATEST,p=P?.productStatus??STATIC_PRODUCT_STATUS,E=P?.selectedOptions?.map(T=>T?.valueBaseID?.replace(PREFIX_PRODUCT_OPTION_VALUE_ID,""));return{formatVariantId:S,formatProductId:c,productStatus:p,preSelectedOptionIds:E,productHandle:o,advancedStyle:r,rowStyles:A,rowSetting:U}};exports.DYNAMIC_PRODUCT_STATUS="dynamic",exports.PREFIX_PRODUCT_ID=PREFIX_PRODUCT_ID,exports.PREFIX_PRODUCT_OPTION_VALUE_ID=PREFIX_PRODUCT_OPTION_VALUE_ID,exports.PREFIX_PRODUCT_VARIANT_ID=PREFIX_PRODUCT_VARIANT_ID,exports.PRODUCT_ID_LATEST=PRODUCT_ID_LATEST,exports.STATIC_PRODUCT_STATUS=STATIC_PRODUCT_STATUS,exports.getData=getData;
