import{h as r,i as S,r as w,e as _,o as p,b as A,d as i,c as C,t as c,u as v,a as P,f as h,w as x,F as B,a2 as I}from"./chunks/vue.esm-bundler.js?ver=1.5.2";import{u as b}from"./chunks/useElementPlusComponents.js?ver=1.5.2";import{_ as E}from"./chunks/AddProductItemModal.js?ver=1.5.2";import{t as d}from"./chunks/Translator.js?ver=1.5.2";import{u as N}from"./chunks/useElementor.js?ver=1.5.2";import"./chunks/ServerSidePreview.vue_vue_type_style_index_0_scoped_42048dbb_lang.js?ver=1.5.2";import{_ as j}from"./chunks/_plugin-vue_export-helper.js?ver=1.5.2";import"./chunks/index.js?ver=1.5.2";import"./chunks/index2.js?ver=1.5.2";import"./chunks/index4.js?ver=1.5.2";import"./chunks/dayjs.min.js?ver=1.5.2";import"./chunks/index3.js?ver=1.5.2";import"./chunks/DynamicIcon.js?ver=1.5.2";import"./chunks/CaretRight.js?ver=1.5.2";import"./chunks/Str.js?ver=1.5.2";import"./chunks/productService.js?ver=1.5.2";import"./chunks/CurrencyFormatter.js?ver=1.5.2";import"./chunks/Arr.js?ver=1.5.2";import"./chunks/Model.js?ver=1.5.2";import"./chunks/Rest.js?ver=1.5.2";import"./chunks/Asset.js?ver=1.5.2";import"./chunks/Url.js?ver=1.5.2";import"./chunks/vue-router.js?ver=1.5.2";const D={class:"fluent-cart-direct-checkout-app"},F={class:"fluent-cart-direct-checkout-app-title"},M={key:0,class:"fluent-cart-direct-checkout-app-content"},Q=["title"],H={class:"fluent-cart-direct-checkout-app-product-id"},L=["innerHTML"],$={__name:"App",props:{variantId:{type:String,default:""},variantTitle:{type:String,default:""},variantPrice:{type:String,default:""}},setup(t){let e=null;const o=t;r(0);const n=r(o.variantId),a=r(o.variantTitle),s=r(o.variantPrice);r(null);const k=()=>{n.value="",a.value="",s.value="",setTimeout(()=>{e.setSettings("variant_id","")},100)},y=l=>{n.value=l,setTimeout(()=>{e.setSettings("variant_id",l.toString())},100)};return S(()=>{e=N()}),(l,m)=>{const g=w("el-button");return p(),_(B,null,[A("",!0),i("div",D,[i("h3",F,c(v(d)("Direct Checkout Button")),1),n.value?(p(),_("div",M,[i("div",{class:"fluent-cart-direct-checkout-app-product-title",title:a.value},[i("span",H,"#"+c(n.value),1),h(c(a.value),1)],8,Q),i("div",{class:"fluent-cart-direct-checkout-app-product-price",innerHTML:s.value},null,8,L),P(g,{class:"fluent-cart-direct-checkout-app-reset-button",type:"primary",onClick:k},{default:x(()=>[h(c(v(d)("Reset")),1)]),_:1})])):(p(),C(E,{key:1,onOnVariationSelectionUpdated:m[0]||(m[0]=(f,T)=>{y(f[0]),T.forEach(V=>{for(const u of V.variants)if(u.id===f[0])return a.value=u.variation_title,s.value=u.formatted_total,!1})})}))])],64)}}},O=j($,[["__scopeId","data-v-972ea6c6"]]),R=t=>{const e=t.dataset.variantId,o=t.dataset.variantTitle,n=t.dataset.variantPrice,a=I(O,{variantId:e,variantTitle:o,variantPrice:n});b(a),a.mixin({methods:{$t:d}}).mount(t)};jQuery(document).ready(function(){elementor.hooks.addAction("panel/open_editor/widget/fluent_cart_direct_checkout",function(t,e,o){e.get("settings")})});jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/fluent_cart_direct_checkout.default",function(t){const e=jQuery(t[0]).find("[data-fluent-cart-direct-checkout-app]")[0];R(e)})});
