1import{u as E}from"./settingsStore-8bwiLMEn.js";import{u as F}from"./appStore-CFAkQG2b.js";import{i as B,j as M}from"./fieldsStore-C1RSpEgb.js";import{_ as O}from"./Button.vue_vue_type_style_index_0_lang-CxqKrtR4.js";import{_ as z}from"./ThankYouPage-po85OjL9.js";import{d as I,e as i,a as G,b as K,f,i as p,t as w,j as C,k as Q}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as R,r as _,u as v}from"./vendor-vue-reactivity-CheHbvBM.js";import{a as V,b as q}from"./vendor-vue-shared-DrzsEcag.js";import"./vendor-pinia-BSPefQhS.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.js";import"./translationsStore-D6vLzgNA.js";import"./vendor-moment-Cv92BTSA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-php-date-formatter-DSpPwBF8.js";import"./callbackStore-BhxBUA6V.js";import"./ProBadge.vue_vue_type_style_index_0_lang-DqDXUf8-.js";import"./vendor-vue-runtime-dom-B2rky8vu.js";import"./vendor-vue3-html2pdf-KR020wX8.js";import"./vendor-html2pdf.js-B-tok4Ns.js";import"./vendor-html2canvas-BfYXEYrK.js";import"./open-pdf-preview-QpFYzkRU.js";import"./Popup.vue_vue_type_style_index_0_lang-uNTBWSeR.js";const U={key:0,class:"ccb-pdf-invoice",ref:"pdfInvoiceRef"},H=I({__name:"GeneratePdf",props:{hideButtons:{type:Boolean},options:{}},setup(d,{expose:l}){const s=F(),a=d,{hideButtons:r}=R(a),g=_({name:"",email:"",message:"",pdfName:""}),h=_(),S=_(),n=E(),m=()=>{var e;(e=h.value)==null||e.generate()};l({generatePdf:m});const k=()=>{var e;(e=S.value)==null||e.showPopup()},P=e=>{const t=g.value;setTimeout(async()=>{const o=new FormData;o.append("action","ccb_send_invoice"),o.append("nonce",window.ccb_nonces.ccb_send_invoice),o.append("pdfString",e.data),t.pdfName=A.value;const c=M(t);o.append("data",c),await(await fetch(window.ajax_window.ajax_url,{method:"POST",body:o})).json()},3e3)},x=i(()=>{var o,c,u;const e=(o=n.getFormSettings)==null?void 0:o.summaryDisplay;if(e!=null&&e.enable&&(e==null?void 0:e.actionAfterSubmit)!=="show_summary_block_with_pdf"||!((c=n.getInvoice)!=null&&c.useInAll))return!1;const t=B();return!((u=n.getInvoice)!=null&&u.showAfterPayment)||t.notificationType==="finish"}),D=i(()=>{var e;return((e=n.getInvoice)==null?void 0:e.pdfButtonText)||"PDF Download"}),T=i(()=>{var e;return(e=n.getInvoice)==null?void 0:e.emailButton}),A=i(()=>s.getCalcTitle),L=i(()=>s.getIsLive),N=i(()=>T.value?"ccb-pdf-invoice__actions--show-share":"ccb-pdf-invoice__actions--show-pdf"),b=()=>{m()},y=e=>{var o;((o=e.detail)==null?void 0:o.calcId)===s.getCalcId&&k()},$=()=>{var c;const e=`__ccb_pdf_listeners_${s.getCalcId}`;if(window[e])return;const t=n.getThankYouPage,o=(c=n==null?void 0:n.stickyCalc)==null?void 0:c.oneClickAction;(s.isThankYouPage||t!=null&&t.enable&&(t==null?void 0:t.type)==="modal"&&(t!=null&&t.downloadButton)||o==="pdf")&&window.addEventListener("ccbDownLoadPdf",b),window.addEventListener("ccbOpenModal",y),window[e]=!0},j=i(()=>{var t;if(r.value)return!0;const e=B();return(t=n.getInvoice)!=null&&t.showAfterPayment?e.notificationType!=="finish":!1});return G(()=>{$()}),K(()=>{window.removeEventListener("ccbDownLoadPdf",b),window.removeEventListener("ccbOpenModal",y);const e=`__ccb_pdf_listeners_${s.getCalcId}`;window[e]&&delete window[e]}),(e,t)=>(p(),f("div",null,[x.value?(p(),f("div",U,[j.value?w("",!0):(p(),f("div",{key:0,class:V(["ccb-pdf-invoice__actions",N.value])},[C(v(O),{type:"light",text:D.value,onClick:m,isDemo:L.value},null,8,["text","isDemo"])],2))],512)):w("",!0),C(v(z),{ref_key:"invoiceComponent",ref:h,onGenerateQuote:P},null,512)]))}}),he=I({__name:"PdfButtonAlias",props:{showSummary:{type:Boolean},item:{}},setup(d){const l=d,s=i(()=>{var r;const a=(r=l.item.options)==null?void 0:r.width;return{width:a?`calc(${a}% - 5px)`:"100%"}});return(a,r)=>a.showSummary?(p(),Q(v(H),{key:0,class:"ccb-total-summary-action",options:a.item.options,style:q(s.value)},null,8,["options","style"])):w("",!0)}});export{he as default}; 2//# sourceMappingURL=PdfButtonAlias-91EKQ9ir.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.