Files
yakpanel-core/YakPanel/static/vite/js/index-1Hsfnsau.js
2026-04-07 02:04:22 +05:30

2 lines
12 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{e as H,c as g,r as I,w as V,k as N,$ as b,a8 as R,a9 as u,a0 as l,_ as a,L as S,S as t,l as $,as as q,v as k,j as B,aa as p,Z as w,R as K,ak as A,F as D,o as Q,P as M}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{u as X}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{F as ee,G as z}from"./ssl-Bm8jcneQ.js?v=1773287522785";import{i as O,m as L,c as G,cE as ne,f as J,cF as te,h as oe,cG as se,u as ae}from"./index-BTglIPU2.js?v=1773287522785";import{a1 as U,k as E,B as W,a9 as ie,ad as le}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{l as re,a as ce}from"./paypal-js-DVrdQmks.js?v=1773287522785";const e=H({domainCount:1,certType:"dv",brand:"Positive",mode:"single",years:5,deploy:1});V(()=>e.certType,s=>{s==="dv"?e.brand="Positive":e.brand="sslTrus",e.domainCount>1?e.mode="multi":e.mode="single"});V(()=>e.domainCount,s=>{s>1&&e.mode==="single"?e.mode="multi":s===1&&e.mode==="multi"&&(e.mode="single")});V(()=>e.domainCount,s=>{s>1&&e.brand==="GeoTrust"&&(e.brand="Positive")});const v=g(()=>{var o;return((o=Y.value)==null?void 0:o.find(r=>{const _=r.brand===e.brand,y=r.type.substring(0,2).toLowerCase()===e.certType;let m=!1;return e.brand==="Sectigo"&&e.certType==="ov"&&e.mode==="wildcard"&&e.domainCount>1?(m=r.code.includes("comodo-multi-domain-wildcard"),_&&y&&m):e.brand==="Positive"&&e.certType==="dv"&&e.mode==="wildcard"&&e.domainCount>1?(m=r.code.includes("multi-domain-wildcard"),_&&y&&m):(e.mode==="single"?m=r.add_price===0:e.mode==="multi"?m=r.code.includes("multi"):e.mode==="wildcard"&&(e.brand==="Digicert"||e.domainCount===1?m=r.code.includes("wildcard"):(m=r.code.includes("multi-domain-wildcard"),m||(L.error("The current certificate brand does not support multi-domain certificate, has automatically switched to the supported certificate brand for you!"),e.mode="multi"))),e.brand==="Digicert"&&e.certType==="ov"&&e.mode==="wildcard"?m=r.code.includes("digicert-basic-ov-wildcard"):e.brand==="Digicert"&&!m&&(m=r.code.includes("digicert-secure-site-".concat(e.certType))),_&&y&&m)}))||{}}),de=[{value:"dv",name:"DV certificate",desc:"Recommended for personal, test use"},{value:"ov",name:"OV certificate",desc:"Recommended for enterprise use"},{value:"ev",name:"EV certificate",desc:"Recommended for large government and enterprise use, high security"}],ue=H([{value:"Positive",name:"Positive",show:g(()=>e.certType!=="ov")},{value:"sslTrus",name:"sslTrus",show:!0},{value:"Digicert",name:"Digicert",show:g(()=>e.certType!=="dv")},{value:"GeoTrust",name:"GeoTrust",show:g(()=>e.domainCount===1||e.domainCount!==1&&e.certType==="ev")},{value:"Sectigo",name:"Sectigo",show:!0}]),me=H([{value:"single",name:"Single domain",show:g(()=>e.domainCount===1)},{value:"multi",name:"Multi-domain",show:g(()=>e.domainCount>1)},{value:"wildcard",name:"Wildcard",show:g(()=>e.certType!=="ev")}]),pe=[{value:5,name:"5 year"},{value:4,name:"4 year"},{value:3,name:"3 year"},{value:2,name:"2 year"},{value:1,name:"1 year"}],_e=[{value:1,name:"Deploy Service"},{value:0,name:"It isn't necessary"}],F=I(),Y=I(),fe=g(()=>{var o;const s=(o=F.value)==null?void 0:o.type[e.certType];return Array.isArray(s)&&s.length>0?s[0]:""}),ve=g(()=>{var o;const s=(o=F.value)==null?void 0:o.brand[e.brand];return Array.isArray(s)&&s.length>0?s[0]:""}),ye=g(()=>{var o;const s=(o=F.value)==null?void 0:o.recommend[e.certType];return typeof s=="string"?s:""}),he=g(()=>e.mode==="single"?"Only one secondary domain or subdomain is supported, e.g. bt.com, cloud.bt.com, or dnspod.cloud.bt.com. If you need to bind all subdomains of a peer, e.g. *.bt.com, purchase a universal domain certificate.":"Domain names with wildcards, such as *.bt.com and *.cloud.bt.com, are universal domain names that contain all subdomain names of the same level.<br>Note that universal domain names do not support cross-tiers, e.g. *.bt.com does not include *.cloud.bt.com support"),be=g(()=>{var o;const s=(o=F.value)==null?void 0:o.times["".concat(e.years,"_year")];return Array.isArray(s)&&s.length>0?s[0]:""}),ge=async()=>{const{message:s}=await ee();O(s)&&(F.value=s.info,Y.value=s.data.map(o=>({...o,isMulti:o.code.indexOf("multi")>-1,isWildcard:o.code.indexOf("wildcard")>-1,isMultiWildcard:o.code.indexOf("multi-domain-wildcard")>-1})))},xe={class:"number-control"},Ce={class:"text-desc"},we={class:"text-#fc6d26"},$e=N({__name:"domain-count",setup(s){const o=r=>{e.domainCount<=1&&r===-1||e.domainCount>=99&&r===1||(e.domainCount+=r)};return(r,_)=>{const y=E,m=U;return b(),R(m,{label:r.$t("Domain Count")},{default:u(()=>[l(y,{class:"flex-col!"},{default:u(()=>{var x,c;return[a("div",xe,[a("div",{class:S(["minus",{"is-disable":t(e).domainCount<=1}]),onClick:_[0]||(_[0]=i=>o(-1))},null,2),$(a("input",{type:"number","onUpdate:modelValue":_[1]||(_[1]=i=>t(e).domainCount=i),class:"number-input",onInput:_[2]||(_[2]=i=>t(e).domainCount=Math.min(Math.max(t(e).domainCount,1),99))},null,544),[[q,t(e).domainCount,void 0,{number:!0}]]),a("div",{class:S(["plus",{"is-disable":t(e).domainCount>=99}]),onClick:_[3]||(_[3]=i=>o(1))},null,2)]),a("div",Ce,[$(a("div",null,[B(p(r.$t("SSL.Business.index_1",[(x=t(v))==null?void 0:x.num]))+" ",1),a("span",we,"$ "+p((((c=t(v))==null?void 0:c.add_price)/100).toFixed(2))+"/one/year",1)],512),[[k,t(e).domainCount>1]]),a("div",null,p(r.$t("SSL.Business.index_2")),1)])]}),_:1})]),_:1},8,["label"])}}}),Te=G($e,[["__scopeId","data-v-56ecb995"]]),ke=N({__name:"paypal-button",setup(s){const o=I(null),r=I(0),_=async x=>{var i,h;const c=await re({clientId:x});c&&o.value&&(o.value.innerHTML="",(h=c.Buttons)==null||h.call(c,{style:{height:30},fundingSource:(i=c.FUNDING)==null?void 0:i.PAYPAL,createOrder:async()=>(await m(!1),te({oid:r.value}).then(y).then(d=>d)),onApprove:d=>ne({paypal_order_id:d.orderID}).then(()=>{J()})}).render(o.value))},y=x=>new Promise((c,i)=>{const{message:h}=x;if(O(h)){if(h.status)return c(h.res);L.error(h.msg)}i(h)}),m=async(x=!0)=>{var i,h,d;const{message:c}=await z({pdata:JSON.stringify({pid:((i=v.value)==null?void 0:i.pid)||8001,years:e.years,deploy:e.deploy,num:e.domainCount-((h=v.value)==null?void 0:h.num)>0?e.domainCount-((d=v.value)==null?void 0:d.num):0})});O(c)&&(x&&_(c.paypal_client_id),r.value=c.order_id)};return m(),(x,c)=>(b(),w("div",{ref_key:"payBtnRef",ref:o},null,512))}}),Se={class:"flex-shrink-0! font-bold"},Be={class:"font-bold"},De={class:"text-#fc6d26"};const Le={class:"font-bold text-20px"},Pe={key:1},Me={class:"text-desc line-through"},Ie={class:"text-right"},Oe={class:"color-desc whitespace-nowrap"},Fe=N({__name:"total-price",setup(s){const{t:o}=K();let r=null;const _=g(()=>{var d,n,f;return e.domainCount-((d=v.value)==null?void 0:d.num)>0?(e.domainCount-((n=v.value)==null?void 0:n.num))*((f=v.value)==null?void 0:f.add_price):0}),y=g(()=>{var d,n;return(((((d=v.value)==null?void 0:d.price)+_.value)*e.years+(e.deploy?(n=v.value)==null?void 0:n.deploy_price:0))/100).toFixed(2)}),m=g(()=>{var d,n;return(((((d=v.value)==null?void 0:d.other_price)+_.value)*e.years+(e.deploy?(n=v.value)==null?void 0:n.deploy_price:0))/100).toFixed(2)}),x=I(0),c=async()=>{var n,f,T;const d=L.loading(o("Component.Pay.index_12"));try{const{message:C}=await z({pdata:JSON.stringify({pid:(n=v.value)==null?void 0:n.pid,years:e.years,deploy:e.deploy,num:e.domainCount-((f=v.value)==null?void 0:f.num)>0?e.domainCount-((T=v.value)==null?void 0:T.num):0})});O(C)&&(x.value=C.order_id,C.stripe_checkout_redirect_url?(h(),window.open(C.stripe_checkout_redirect_url,"_blank","no_opener,noreferrer")):C.session_id?(r=await ce(C.stripe_public_key),r&&r.redirectToCheckout({sessionId:C.session_id})):L.error(o("Component.Pay.index_28")))}finally{d.close()}};let i=null;const h=async()=>{const{close:d}=L.loading(()=>l(D,null,[l("span",null,[B("Paying in progress, ")]),l(W,{text:!0,type:"primary",onClick:n},{default:()=>[B("Cancel Pay")]})])),n=()=>{oe({title:o("Public.Confirm.Title"),content:"Do you want to confirm the cancellation of payment?",onConfirm:async()=>{i&&(clearTimeout(i),i=null),d()}})},f=async(C=!0)=>{const{message:P}=await se({order_id:x.value});if(O(P)&&P.res===1){i&&(clearTimeout(i),i=null),d(),L.success(o("Component.Pay.index_7")),await ae({force:1}),J();return}C&&i!==null&&T()},T=()=>{i=window.setTimeout(async()=>{await f()},1e3)};i&&clearTimeout(i),await f(!1),T()};return(d,n)=>{const f=E;return b(),R(f,{class:"total-price justify-between! flex-nowrap!"},{default:u(()=>[l(f,{class:"flex-col!"},{default:u(()=>[l(f,{class:"flex-nowrap!"},{default:u(()=>{var T,C,P,j;return[a("div",Se,p(d.$t("SSL.Business.index_3")),1),a("div",null,[a("span",null,"The default contains "+p((T=t(v))==null?void 0:T.num)+" domain $"+p((((C=t(v))==null?void 0:C.price)/100).toFixed(2))+"/year",1),$(a("span",null,"over "+p(t(e).domainCount-((P=t(v))==null?void 0:P.num))+" additional domain names $"+p((t(_)/100).toFixed(2))+"/year",513),[[k,t(e).domainCount>((j=t(v))==null?void 0:j.num)]])])]}),_:1}),l(f,{class:"items-center!"},{default:u(()=>[a("div",Be,p(d.$t("SSL.Business.index_4")),1),a("div",null,[a("div",De,[A("",!0),a("span",null,[a("text",Le,"$"+p(t(y)?(Number(t(y))/t(e).years).toFixed(2):"--"),1),n[0]||(n[0]=B("/year "))]),t(e).deploy?(b(),w("span",Pe,"("+p(d.$t("SSL.Business.index_5"))+")",1)):A("",!0)]),a("div",Me,"Original price $"+p(t(m)?(Number(t(m))/t(e).years).toFixed(2):"--")+"/year",1)])]),_:1})]),_:1}),l(f,{class:"flex-col!"},{default:u(()=>[a("div",Ie,[l(t(W),{type:"primary",size:"large",onClick:c},{default:u(()=>[B(p(d.$t("Component.Auth.index_3")),1)]),_:1})]),l(f,{class:"flex-nowrap! items-center!"},{default:u(()=>[a("span",Oe,p(d.$t("Component.Pay.index_27",["Stripe"])),1),l(ke)]),_:1})]),_:1})]),_:1})}}}),Ne=G(Fe,[["__scopeId","data-v-a0b5b610"]]),Ae=["onClick"],He={class:"item-title"},Ve={class:"text-desc leading-20px pb-10px"},Re={class:"item-tag"},Ge=["innerHTML"],Ee=["onClick"],je={class:"item-tag"},We=["innerHTML"],ze=["onClick"],Je=["innerHTML"],Ue=["onClick"],Ye=["innerHTML"],Ze=["onClick"],qe={class:"text-#fc6d26"},Ke=N({__name:"index",setup(s){const o=(y,m)=>{e[y]=m},{loading:r,setLoading:_}=X();return Q(async()=>{try{_(!0),await ge()}finally{_(!1)}}),(y,m)=>{const x=le,c=E,i=U,h=Z,d=ie;return b(),R(d,{show:t(r),class:"w-850px! select-none"},{default:u(()=>[A("",!0),l(h,{class:"px-16px pt-20px"},{default:u(()=>[l(Te),l(i,{label:"Cert Type"},{default:u(()=>[l(c,{class:"flex-col!"},{default:u(()=>[l(c,null,{default:u(()=>[(b(!0),w(D,null,M(t(de),n=>(b(),w("div",{key:n.value,class:S(["option-item w-210px",{"is-active":t(e).certType===n.value}]),onClick:f=>o("certType",n.value)},[a("div",He,p(n.name),1),a("div",Ve,p(n.desc),1),$(a("div",Re,"Hot",512),[[k,n.value==="dv"]])],10,Ae))),128))]),_:1}),a("div",{class:"text-desc",innerHTML:t(fe)},null,8,Ge)]),_:1})]),_:1}),l(i,{label:"Certificate brand"},{default:u(()=>[l(c,{class:"flex-col!"},{default:u(()=>[l(c,null,{default:u(()=>[(b(!0),w(D,null,M(t(ue),n=>$((b(),w("div",{key:n.value,class:S(["option-item",{"is-active":t(e).brand===n.value}]),onClick:f=>o("brand",n.value)},[B(p(n.name)+" ",1),$(a("div",je,"Hot",512),[[k,t(ye)===n.value]])],10,Ee)),[[k,n.show]])),128))]),_:1}),a("div",{class:"text-desc",innerHTML:t(ve)},null,8,We)]),_:1})]),_:1}),l(i,{label:"Certificate type"},{default:u(()=>[l(c,{class:"flex-col!"},{default:u(()=>[l(c,null,{default:u(()=>[(b(!0),w(D,null,M(t(me),n=>$((b(),w("div",{key:n.value,class:S(["option-item",{"is-active":t(e).mode===n.value}]),onClick:f=>o("mode",n.value)},p(n.name),11,ze)),[[k,n.show]])),128))]),_:1}),a("div",{class:"text-desc",innerHTML:t(he)},null,8,Je)]),_:1})]),_:1}),l(i,{label:"Purchase period"},{default:u(()=>[l(c,{class:"flex-col!"},{default:u(()=>[l(c,null,{default:u(()=>[(b(!0),w(D,null,M(t(pe),n=>(b(),w("div",{key:n.value,class:S(["option-item",{"is-active":t(e).years===n.value}]),onClick:f=>o("years",n.value)},p(n.name),11,Ue))),128))]),_:1}),a("div",{class:"text-desc",innerHTML:t(be)},null,8,Ye)]),_:1})]),_:1}),l(i,{label:"Deploy Service"},{default:u(()=>[l(c,{class:"flex-col!"},{default:u(()=>[l(c,{class:"items-center!"},{default:u(()=>[(b(!0),w(D,null,M(t(_e),n=>(b(),w("div",{key:n.value,class:S(["option-item",{"is-active":t(e).deploy===n.value}]),onClick:f=>o("deploy",n.value)},p(n.name),11,Ze))),128)),$(a("div",null,[B(p(y.$t("SSL.Business.index_7"))+" ",1),a("span",qe," $"+p((t(v).deploy_price/100).toFixed(2))+"/1 Time ",1)],512),[[k,t(e).deploy===1]])]),_:1}),$(a("div",{class:"text-desc"},p(y.$t("SSL.Business.index_8")),513),[[k,t(e).deploy===1]])]),_:1})]),_:1})]),_:1}),l(Ne)]),_:1},8,["show"])}}}),an=G(Ke,[["__scopeId","data-v-9bf6398d"]]);export{an as A};