PageSourceSearch

https://deep-image.ai/app/assets/PaymentTypeModal-CMf74tFy.js

js deep-image.ai collected 2026-09-25 14:09:00 UTC 11,491 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-DllQ6TZO.js","assets/index-DHT8ocXi.js","assets/index-0J5qu82O.css"])))=>i.map(i=>d[i]);
2import{l as Se,j as t,o as s,fn as _e,aG as we,m as X,H as Pe,r as g,Y as k,aj as ge,ng as Re,nb as Te,aq as ne,ap as oe,ar as ie,as as re,q as H,A as W,s as z,nh as ce,C as le,ni as de,g9 as pe,nj as Ee,D,ma as Ne,b7 as Ie,nk as Fe,kX as ke,al as Ae,am as qe,m4 as $e,mq as Be,nl as Ge,mp as ue,a2 as Me,nm as Ue,nn as Le,ay as De,no as Oe}from"./index-DHT8ocXi.js";import{bQ as Ve,w as Z,bR as Ye,bS as He,bT as We,bJ as ze,e as Je,bA as Ke,k as E,l as Q,m as J}from"./RerollBtn-BPahoQdf.js";import{u as Qe,S as Xe,P as Ze}from"./useHandlePaymentModalGA4Events-D4ZazDL-.js";import{I as et,C as tt}from"./Invoice-CXRPzZwK.js";import"./_baseClone-CLcwX-rf.js";var st=Ve();const at=Se(st),fe=({paymentType:e,selectedPaymentType:o,setSelectedPaymentType:n,i18n:p,icon:d,isDisabled:b=!1,setInvoiceRequested:A})=>{const a=e===o;return t.jsxs("div",{"data-tip":b?p.t("payments.payment_type_paypal_unavailable"):"",className:`d-flex justify-content-between ${a?"current-plan selected-plan":""} ${b?"disabled":""}`,onClick:()=>{e==="coingate"&&A(!1),b||n(e)},children:[t.jsxs("div",{className:"radio-white",children:[t.jsx("input",{disabled:b,type:"radio",name:"payment-type",checked:a,onChange:at,id:`payment-type-${e}`}),t.jsx("label",{htmlFor:`payment-type-${e}`,children:p.t(`payments.payment_type_${e}`)})]}),t.jsxs("div",{children:[t.jsxs("span",{className:"icon payment-type-icon",children:[e==="coingate"&&t.jsx("img",{alt:"btn-icon",src:d,height:"25"}),e==="paypal"&&t.jsx("img",{alt:"btn-icon",src:d,height:"15"}),e==="stripe"&&t.jsx("img",{alt:"btn-icon",src:d,height:"20"})]}),t.jsx(Ye,{placement:"top"})]})]},e)};fe.propTypes={paymentType:s.string,selectedPaymentType:s.string,i18n:s.object,setSelectedPaymentType:s.func};const me=Z()(fe),nt="/app/assets/icon-stripe-payments-DpKER7qJ.svg",ot="/app/assets/logo_coingate-CKWcYsxg.png";function ye(e){return e.replace(/^\/+/,"")}const K=_e("Browser",{web:()=>we(()=>import("./web-DllQ6TZO.js"),__vite__mapDeps([0,1,2])).then(e=>new e.BrowserWeb)}),be=({text:e,user:o,selectedItem:n,billingType:p,subscriptionUpdate:d,isChangingSubscription:b,subscriptionChangeSuccess:A,promoCodeValue:a,promoCodeLoading:r,setProcessingError:j,processingError:N,i18n:x,paymentType:S,disabled:O,invoiceData:q,invoiceDataRef:_,invoiceRequested:v,buyerCountry:V,buyerIsCompany:m,updateUserInvoiceData:C,mappedGa4Item:R,quantity:I,currency:$,trialPeriodDays:B})=>{const F=We(),[f,y]=g.useState(!1);n&&n.type.includes("gradual");const ee=n&&n.type.includes("onetime"),G=k(ge),{setError:te}=ze(),M=async c=>{const h=_?.current?_.current():q,i={};if(!pe(h,o?.address)&&v&&(i.address=h),pe(v,o?.invoiceRequested)||(i.invoiceRequested=v),i.address||i.invoiceRequested!==void 0){const l=await H.post(`${W}/update-user-invoice`,i,{headers:{authorization:`Bearer ${c}`,"x-application-name":z}});C(l.data)}},w=async()=>{const c=_?.current?_.current():q,h=v&&c?.country||V,i=v&&typeof c?.isCompany=="boolean"?c.isCompany:!!m;if(!h)return j(x.t("payments.invoice.declarationFailed")),!1;try{const{address:l}=await Ee({country:h,isCompany:i});return C({address:l}),!0}catch(l){return console.error(l),j(x.t("payments.invoice.declarationFailed")),!1}},U=async()=>{try{y(!0);const c=ne();if(oe(R,S),await M(c),!await w()){y(!1);return}const h=await ie(),i=await re(),l=await H.post(`${W}/onetime-purchase`,{redirectPath:ye(window.location.pathname),analytics_client_id:h,analytics_session_id:i,plan:`${n.id||n._id}`,type:S,code:G&&a?a:"",quantity:I,credits:n.credits},{params:{...ce()},headers:{authorization:`Bearer ${c}`,"x-application-name":z}});S==="paypal"?await K.open({url:l.data.approveLink,windowName:"_self"}):le.isNativePlatform()?await K.open({url:l.data.session.url}):l.data.session.url?window.location.assign(l.data.session.url):await F.redirectToCheckout({sessionId:l.data.session.id}),y(!1),de(),N&&j("")}catch(c){console.error(c),y(!1),j(x.t("errors.general"))}},L=async()=>{try{y(!0);const c=ne(),h=p==="monthly"?n.stripe.id:p==="yearly"?n.stripe_yearly.id:"";if(oe(R,S),await M(c),!await w()){y(!1);return}const i=await ie(),l=await re(),T=await H.post(`${W}/purchase-subscription`,{redirectPath:ye(window.location.pathname),analytics_client_id:i,analytics_session_id:l,plan:h,planId:n._id,billing_type:p,code:G&&a||"",trial:B&&B>0},{params:{...ce()},headers:{authorization:`Bearer ${c}`,"x-application-name":z}});le.isNativePlatform()?await K.open({url:T.data.session.url}):T.data.session.url?window.location.assign(T.data.session.url):await F.redirectToCheckout({sessionId:T.data.session.id}),de(),y(!1),N&&j("")}catch(c){console.error(c),y(!1),j(x.t("errors.general"))}};return t.jsxs("div",{className:"d-flex gap-4",children:[t.jsx("button",{id:"checkout-btn",className:"btn-new confirm w-100",disabled:!n||b||f||O||r,onClick:o?ee?async()=>{await U()}:()=>d?Te():L():Re,children:t.jsx("span",{children:f?x.t("payments.redirecting"):b?x.t("payments.processing"):e})}),t.jsx("button",{disabled:f,className:"btn-new cancel-on-white w-100","data-bs-dismiss":!f&&"modal","aria-label":"Close",children:"Cancel"})]})};be.propTypes={i18n:s.shape({t:s.func}
2),isChangingSubscription:s.bool,paymentType:s.string,selectedItem:s.object,promoCodeValue:s.string,subscriptionChangeSuccess:s.any,subscriptionUpdate:s.any,text:s.any,user:s.any,disabled:s.bool,invoiceData:s.object,invoiceDataRef:s.object,updateUserInvoiceData:s.func,invoiceRequested:s.bool,billingType:s.string};const it=e=>({user:e.auth.user,isChangingSubscription:e.payments.isChangingSubscription,subscriptionChangeSuccess:e.payments.subscriptionChangeSuccess,quantity:e.payments.quantityItem,language:e.dashboard.language}),rt={updateUserInvoiceData:D(Ne)},ct=X(it,rt)(Pe(He(Z()(be)))),Ce=({show:e,children:o})=>e?o:null;Ce.propTypes={show:s.bool.isRequired};const xe=({feature_flag:e,children:o,user:n,device:p})=>{const d=n||p;return t.jsx(Ce,{show:d&&d.feature_flags&&e in d.feature_flags?d.feature_flags[e]:!1,children:o})};xe.propTypes={feature_flag:s.string,test:s.string,user:s.object,device:s.object};const lt=e=>({user:e.auth.user,device:e.auth.device}),dt=X(lt)(xe),he=e=>{const o=String(e||"").split(/[-_]/)[1];return o&&/^[A-Za-z]{2}$/.test(o)?o.toUpperCase():""},pt=({errors:e,title:o})=>{const n=Object.values(e);return n.length!==0?t.jsx(E,{type:Q.ERROR,title:o,children:n.map((p,d)=>t.jsx("p",{children:p.message},d))}):null};function ve({paymentType:e,setPaymentType:o,billingType:n,selectedItem:p,promoCodeLoading:d,promoCodeError:b,promoCodeBonus:A,user:a,i18n:r,getNewUserPromoCode:j}){const N=Je({mode:"all"}),{reset:x,getValues:S,setValue:O,formState:{errors:q,isValid:_}}=N,[v,V]=g.useState(""),[m,C]=g.useState(),[R,I]=g.useState(""),[$,B]=g.useState({}),F=g.useRef(null),[f,y]=g.useState(""),{data:ee}=Ie(1),{modalRef:G,mappedGa4Item:te}=Qe(),M=Fe(a),w=k(ke),U=k(Ae),L=k(ge),c=k(qe),h=$e(),i=w?0:h?.data?.trialPeriodDays,{data:l,isLoading:T}=Be(),{data:se}=Ge(),ae=R||a?.address?.country||"",P=!!(l?.enabled&&l?.countries?.includes(ae)),je=P?!!m:m?!!$?.isCompany:ue(a?.address);g.useEffect(()=>{if(f){const u=setTimeout(()=>{y("")},5e3);return()=>clearTimeout(u)}},[f]),g.useEffect(()=>{!m&&a&&C(a.invoiceRequested);const u=R||a?.address?.country||se||he(navigator?.languages?.[0]||navigator?.language)||he(r.language)||"";Object.keys(S).length===0&&a?.address&&x({...a?.address,countryCode:u}),u&&S("countryCode")!==u&&O("countryCode",u,{shouldValidate:!0}),u!==R&&I(u)},[a,se,r.language]);const Y=g.useRef(null);return g.useEffect(()=>{if(!a||Y.current===P)return;const u=Y.current===null;if(Y.current=P,P){C(ue(a?.address));return}(u||!m)&&C(!!a?.invoiceRequested)},[P,a]),t.jsx("div",{ref:G,className:"modal fade modal-big modal-payment-type modal-white",id:"paymentTypeModal",tabIndex:"-1",role:"dialog","aria-labelledby":"signInUpModalLabel","aria-hidden":"true",children:t.jsx("div",{className:"modal-dialog modal-dialog-centered",role:"document",children:t.jsxs("div",{className:"modal-content",children:[t.jsx(Me,{title:i>0?r.t("payments.trial_summary"):r.t("payments.summary")}),t.jsx(Ke,{...N,children:t.jsxs("div",{className:"modal-body content-wrapper",children:[t.jsxs("div",{className:"vstack gap-4 alerts-box",children:[f&&t.jsx(E,{type:Q.ERROR,title:f}),t.jsx(pt,{errors:q,title:r.t("payments.invoice.error.invoiceForm")}),b&&t.jsx(E,{type:Q.ERROR,title:r.t("payments.promo.invalid_code")}),m&&_!==!0&&t.jsx(E,{variant:J.INFO.GRAY,title:r.t("payments.invoice.error.fillAllFields")}),L&&t.jsx(E,{variant:J.SUCCESS.BRIGHT,title:r.t(U?"payments.active_promocode_stripe_subscription_modal":"payments.promo.valid_code",{promoCodeBonus:A})}),c&&t.jsx(E,{variant:J.INFO.GRAY,title:r.t("payments.promo.invalid_for_this_purchase")})]}),m?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"section-title",children:r.t("payments.invoice_section")}),t.jsx(et,{invoiceData:$,setInvoiceData:B,invoiceDataRef:F,forceCompany:P,buyerTypeChoiceReady:!T,onCountryChange:I})]}):t.jsx("div",{className:"modal-form form-white vstack gap-5 mb-4",children:t.jsx(tt,{revalidateFields:[],onCountryChange:I})}),i>0&&t.jsx("div",{className:"trial-info",children:r.t("payments.trial_modal_info",{trialDays:i})}),t.jsx(Xe,{isStripeSubscriptionPromo:U,isProduct:w,isPromoCodeValid:L}),i===0&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"section-title",children:r.t("payments.payment_section")}),t.jsx("form",{action:"#",children:t.jsxs("div",{className:"form-group",children:[t.jsx("div",{style:{marginBottom:w&&20},children:t.jsx(me,{paymentType:"stripe",selectedPaymentType:e,setSelectedPaymentType:o,icon:nt,setInvoiceRequested:C})}),t.jsx(dt,{feature_flag:Ue,user:a,children:w&&t.jsx(me,{paymentType:"coingate",selectedPaymentType:e,setSelectedPaymentType:o,icon:ot,setInvoiceRequested:C})})]})})]}),t.jsx(Ze,{promoCodeValue:v,setPromoCodeValue:V}),t.jsx("div",{className:"d-flex justify-content-start",children:t.jsxs("div",{className:"checkbox-white",children:[t.jsx("input",{type:"checkbox",checked:!!m,onChange:u=>
2C(u.target.checked),name:"invoiceRequested",id:"invoiceRequested"}),t.jsx("label",{htmlFor:"invoiceRequested",style:e==="coingate"?{"text-decoration":"line-through"}:{},children:r.t(P?"payments.invoice.buyingAsCompany":"payments.invoice.getInvoice")})]})}),t.jsx(ct,{text:i>0?r.t("payments.trial_checkout"):r.t("payments.checkout"),selectedItem:p,billingType:n,subscriptionUpdate:!!M.length,promoCodeLoading:d,promoCodeValue:v,paymentType:e,disabled:!_&&m,invoiceRequested:m,buyerCountry:ae,buyerIsCompany:je,invoiceData:$,invoiceDataRef:F,processingError:f,setProcessingError:y,mappedGa4Item:te,trialPeriodDays:i})]})})]})})})}ve.propTypes={i18n:s.shape({t:s.func})};const ut=e=>({paymentType:e.payments.paymentType,billingType:e.payments.billingType,plans:e.payments.plans,products:e.payments.products,subscription:e.auth.subscription,user:e.auth.user,stripeSubscription:e.auth.stripeSubscription,isChangingSubscription:e.payments.isChangingSubscription,subscriptionChangeSuccess:e.payments.subscriptionChangeSuccess,subscriptionChangeError:e.payments.subscriptionChangeError,promoCodeError:e.payments.promoCodeError,promoCodeLoading:e.payments.promoCodeLoading,promoCodeBonus:e.payments.promoCodeBonus,selectedItem:e.payments.selectedItem,quantityItem:e.payments.quantityItem}),mt={setPaymentType:D(Oe),setBillingType:D(De),getNewUserPromoCode:D(Le)},Ct=X(ut,mt)(Z()(ve));export{Ct as default};

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.