import{w as Q}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{$ as i}from"./vendor-jquery-D5wxN8bs.js";import{u as Y}from"./sticky-3wbT2QJo.js";import{u as j}from"./useSticky-D4NGUYBY.js";import{u as q}from"./translationsStore-D6vLzgNA.js";import{d as G,e as T,a as J,f as m,t as S,i as g,x as _}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{u as e}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as b,b as K,a as O}from"./vendor-vue-shared-DrzsEcag.js";import{_ as R}from"./vendor-vue3-html2pdf-KR020wX8.js";import"./vendor-bootstrap-CCU-90um.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.js";import"./vendor-pinia-BSPefQhS.js";import"./vendor-html2pdf.js-B-tok4Ns.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-html2canvas-BfYXEYrK.js";const U={key:0,class:"sticky-calculator-btn--icon is-image"},X=["src"],Z={key:1,class:"ccb-icon-Calculators-filled"},tt={class:"sticky-calculator-btn--text"},ot={class:"sticky-calculator-btn--text__title"},it={key:0,class:"sticky-calculator-btn--text__description"},st=G({__name:"FloatingCart",setup(et){const{classList:F,clickAction:w,getFormattedTotal:L,getShortTitle:B,showTotal:M,updateFormulas:D,initListeners:N}=j(),t=Y(),V=q(),E=T(()=>{var n;return window.innerWidth<=640&&((n=t.getStickySettings)==null?void 0:n.showCalculator)}),H=T(()=>{var v,C,x,A,$,W,P,z,I;const n=((v=t.getStickySettings)==null?void 0:v.btnPosition.split("_"))||[],o=n[0]||"",c=n[1]||"";let a=window.innerWidth>1280?40:20;((C=i(`.ccb-calc-id-${t.getCalcId}`))==null?void 0:C.prevAll()).each(function(){var s,u;const r=i(this)[0];if(i(r).data("position")===((s=t.getStickySettings)==null?void 0:s.btnPosition)){const y=((u=i(r).find(".sticky-calculator-btn"))==null?void 0:u.outerWidth())||0;a+=y>0?y+20:y}});let p=window.innerWidth>1280?40:20;const h=".sticky-calculator-banner";if(((x=i(h))==null?void 0:x.length)>0&&!i(h).hasClass("ccb-hide-button")&&((($=(A=i(h))==null?void 0:A.attr("class"))==null?void 0:$.split(/\s+/))||[]).includes(o)&&!((W=i(h))!=null&&W.hasClass("ccb-hide-button"))){p=20;let k=i(".sticky-calculator-banner").height()||0,s=window.innerWidth>600?0:20;p=p+k+s}const f=i("#wpadminbar");f.length&&o==="top"&&(p+=((f==null?void 0:f.height())||0)-10);const d={[o]:`${p}px`,[c]:`${a}px`};if(c==="center"){let r=0;((z=(P=i(`.ccb-calc-id-${t.getCalcId}`))==null?void 0:P.prevAll())==null?void 0:z.filter(function(){var s;return i(this).data("position")===((s=t.getStickySettings)==null?void 0:s.btnPosition)})).each(function(){var s,u;r=(((u=(s=i(this))==null?void 0:s.find(".sticky-calculator-btn"))==null?void 0:u.outerWidth())||0)+20||0}),d.left=`calc(40% + ${r}px)`}return o==="center"&&(d.top="50%",d.transform="translateY(-50%)"),window.innerWidth<=540&&o==="bottom"&&((I=t.getStickySettings)!=null&&I.showCalculator)&&(d.bottom="80px"),d});return J(()=>{var c,a,l;const n=((c=t.getStickySettings)==null?void 0:c.oneClickAction)||"";let o=((a=t.getStickySettings)==null?void 0:a.formulas)||[];["woo_checkout","woo_product_as_modal","woo_product_with_redirect"].includes(n)&&(o=((l=t.getWooCheckoutSettings)==null?void 0:l.formulas)||[]),D(o),N()}),(n,o)=>{var c,a;return E.value?S("",!0):(g(),m("div",{key:0,class:O(["sticky-calculator-btn",e(F)]),style:K(H.value),onClick:o[0]||(o[0]=Q((...l)=>e(w)&&e(w)(...l),["prevent"]))},[(c=e(t).getStickySettings)!=null&&c.hideIcon?S("",!0):(g(),m("div",U,[(a=e(t).getStickySettings)!=null&&a.icon?(g(),m("img",{key:0,src:e(t).getStickySettings.icon,alt:"icon svg"},null,8,X)):(g(),m("i",Z))])),_("div",tt,[_("span",ot,b(e(B)),1),e(M)?(g(),m("span",it,b(e(V).getTranslations.total)+": "+b(e(L)),1)):S("",!0)]),o[1]||(o[1]=_("div",{class:"ccb-icon-arrow"},[_("i",{class:"ccb-icon-Down"})],-1))],6))}}}),St=R(st,[["__scopeId","data-v-536a29c9"]]);export{St as default};
//# sourceMappingURL=index-cr3PNecz.js.map
