PageSourceSearch

https://www.aba.ae/public/build/js/SidebarCart.js

js aba.ae collected 2026-10-09 17:10:33 UTC 7,828 bytes, 1 lines download raw bytes

1import{H as v,u as S}from"./cart.js";import{T as N}from"./times.js";import{b as a,c as l,f as t,d as w,t as r,j as f,n as b,l as p,g as k,F as _,D}from"./runtime-core.esm-bundler.js";import{f as O}from"./currency.js";import{_ as C}from"./_plugin-vue_export-helper.js";import{g as I}from"./pageLanguage.js";import{w as P,a as $}from"./runtime-dom.esm-bundler.js";import"./pinia.js";import"./cartStorage.js";const M={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"};function H(e,i){return a(),l("svg",M,[...i[0]||(i[0]=[t("path",{stroke:"#0E56C2","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3.09 6.73c0-.82.62-1.75 1.39-2.06l5.57-2.28c1.25-.51 2.66-.51 3.91 0l5.57 2.28c.76.31 1.39 1.24 1.39 2.06v4.39c0 4.89-3.55 9.47-8.4 10.81-.33.09-.69.09-1.02 0-4.85-1.34-8.4-5.92-8.4-10.81"},null,-1),t("path",{stroke:"#0E56C2","stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":"10","stroke-width":"1.5",d:"M12 12.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4M12 12.5v3"},null,-1)])])}const B={render:H},V={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 32 32"};function j(e,i){return a(),l("svg",V,[...i[0]||(i[0]=[t("path",{fill:"#32993F",d:"M26.626 13.333V24c0 4-1.333 5.333-5.333 5.333H10.626c-4 0-5.333-1.333-5.333-5.333V13.333z",opacity:".4"},null,-1),t("path",{fill:"#32993F",d:"M28.667 9.333v1.334c0 1.466-.706 2.666-2.666 2.666H6c-2.04 0-2.667-1.2-2.667-2.666V9.333c0-1.466.627-2.666 2.667-2.666h20c1.96 0 2.666 1.2 2.666 2.666"},null,-1),t("path",{fill:"#32993F",d:"M15.52 6.667H8.16a1.25 1.25 0 0 1 .04-1.734l1.894-1.893a1.28 1.28 0 0 1 1.8 0zM23.827 6.667h-7.36l3.627-3.627a1.28 1.28 0 0 1 1.8 0l1.893 1.893c.48.48.493 1.24.04 1.734",opacity:".4"},null,-1),t("path",{fill:"#32993F",d:"M11.92 13.333v6.854c0 1.066 1.173 1.693 2.067 1.12l1.253-.827a1.33 1.33 0 0 1 1.467 0l1.186.8c.88.587 2.067-.04 2.067-1.107v-6.84z",opacity:".6"},null,-1)])])}const q={render:j},F=w({name:"MoneyDisplay",props:{amount:{type:[Number,String],required:!0},currency:{type:String,default:"PLN"},locale:{type:String,default:"en"}},computed:{formatted(){return O(Number(this.amount||0),this.currency,this.locale)}}}),L={class:"money-display"};function T(e,i,s,u,o,m){return a(),l("span",L,r(e.formatted),1)}const A=C(F,[["render",T]]),K=w({name:"SidebarCart",components:{TimesIcon:N,SslIcon:B,GiftBonus:q,MoneyDisplay:A},props:{plans:{type:String,required:!0},currency:{type:String,default:"USD"},locale:{type:String,default:"en"},showSslInfo:{type:String,default:"1"}},data(){return{plansParsed:JSON.parse(this.plans),cart:S(),selectedPeriod:null,visible:!1}},computed:{pickedPlan(){return this.plansParsed.find(e=>e.name===this.cart.pickedHostingPlan)},isVip(){return v.VIP===this.pickedPlan?.name},summaryAmount(){return this.pickedPlan?.prices.find(e=>e.period===this.selectedPeriod)?.price||0}},watch:{pickedPlan(e,i){e?(this.visible=!0,e!=i&&(this.selectedPeriod=null)):this.visible=!1},visible(){if(this.visible&&!this.selectedPeriod&&this.pickedPlan?.prices.length){const e=v.PRO===this.pickedPlan.name?Number(this.cart.pickedHostingPlanPayload?.period):null,i=this.pickedPlan.prices.find(s=>s.period===e);this.select(i||this.pickedPlan.prices[0])}}},methods:{translatePlanDuration(e){return this.$t("plan_month",{amount:e},e)},close(){this.visible=!1,this.cart.clearPickedHostingPlan()},select(e){this.selectedPeriod=e.period},backdropClicked(){this.close()},findSelectedDurationOption(){const e=this.selectedPeriod;if(e!==null)return this.cart.pickedHostingPlanPayload?.durationOptions?.find(i=>i.duration===e||Number(i.period)===e||i.value===String(e)||i.label===String(e))},onCheckoutClicked(){const e=this.pickedPlan,i=this.selectedPeriod;if(!e||i===null)return;const s=this.cart.pickedHostingPlanPayload||{},u=e.prices.find(c=>c.period===i),o=this.findSelectedDurationOption(),m=Number(o?.priceAfterDiscount??u?.price??s.priceAfterDiscount??0),h=Number(o?.priceBeforeDiscount??u?.salePrice??s.priceBeforeDiscount??m),y={id:s.id||`hosting-${e.name}`,name:s.name||String(this.$t("plan_name",{name:e.name})),nameKey:s.nameKey,category:s.category||"hosting",priceBeforeDiscount:h,priceAfterDiscount:m,period:o?.duration||o?.period||i,quantity:Number(s.quantity??1),selectedOfferId:o?.offerId??s.selectedOfferId,selectedOfferName:o?.offerName||o?.value||s.selectedOfferName,durationOptions:s.durationOptions};s.skipCart||this.cart.addItem(y);let d=s.redirect||`/${I()}/checkout`;if(s.selectedOfferQueryParameter&&o?.offerName){const c=new URL(d,window.location.origin);c.searchParams.set(s.selectedOfferQueryParameter,o.offerName),d=`${c.pathname}
1${c.search}${c.hash}`}this.close(),window.location.href=d}}}),z=["aria-hidden","inert"],E={class:"cart-header d-flex align-items-center justify-content-between p-3"},G={class:"d-flex flex-column gap-2 gap-md-1"},U={id:"sidebar-cart-title",class:"title"},Q={class:"subtitle"},R=["aria-label"],J={class:"content"},W={key:0,class:"ssl-info d-flex align-items-center gap-2 mb-2"},X={class:"ssl-text"},Y={class:"plan-options-label"},Z=["aria-label"],x=["aria-checked","onClick","onKeydown"],ee={class:"d-flex flex-column gap-1"},te={class:"plan-name"},ie={class:"plan-duration"},se={class:"price-wrp"},ne={key:0,class:"sale-price"},oe={class:"buttons d-flex flex-column gap-4"},re={key:0,class:"gift-info d-flex align-items-center justify-content-center gap-1 py-3 px-2"},ae=["innerHTML"],le={class:"total d-flex justify-content-between align-items-center"},ce={class:"price"};function de(e,i,s,u,o,m){const h=f("TimesIcon"),y=f("SslIcon"),d=f("money-display"),c=f("GiftBonus");return a(),l(_,null,[t("div",{class:b(["backdrop",{visible:e.visible}]),onClick:i[0]||(i[0]=(...n)=>e.backdropClicked&&e.backdropClicked(...n))},null,2),t("div",{id:"sidebar-cart",class:b({visible:e.visible}),role:"dialog","aria-modal":"true","aria-labelledby":"sidebar-cart-title","aria-hidden":!e.visible,inert:!e.visible},[t("div",E,[t("div",G,[t("div",U,r(e.$t("sidebar_cart.choose_plan_duration")),1),t("div",Q,r(e.$t("sidebar_cart.select_option_proceed")),1)]),t("button",{type:"button",class:"close-btn","aria-label":e.$t("auth.register.close_modal"),onClick:i[1]||(i[1]=(...n)=>e.close&&e.close(...n))}
1,[p(h)],8,R)]),t("div",J,[e.showSslInfo!=="0"?(a(),l("div",W,[p(y),t("div",X,r(e.$t("sidebar_cart.free_ssl_vip")),1)])):k("",!0),t("div",Y,r(e.$t("sidebar_cart.plan_options")),1),t("div",{class:"periods-list",role:"radiogroup","aria-label":e.$t("sidebar_cart.plan_options")},[(a(!0),l(_,null,D(e.pickedPlan?.prices,n=>(a(),l("div",{key:n.period,class:b(["d-flex justify-content-between align-items-center",{selected:e.selectedPeriod===n.period}]),role:"radio",tabindex:"0","aria-checked":e.selectedPeriod===n.period,onClick:g=>e.select(n),onKeydown:[P($(g=>e.select(n),["prevent"]),["enter"]),P($(g=>e.select(n),["prevent"]),["space"])]},[t("div",ee,[t("div",te,r(e.pickedPlan?.displayName||e.$t("plan_name",{name:e.pickedPlan?.name})),1),t("div",ie,r(e.translatePlanDuration(n.period)),1)]),t("div",se,[p(d,{amount:n.price,currency:e.currency,locale:e.locale},null,8,["amount","currency","locale"]),n.salePrice?(a(),l("div",ne,[p(d,{amount:n.salePrice,currency:e.currency,locale:e.locale},null,8,["amount","currency","locale"])])):k("",!0)])],42,x))),128))],8,Z)]),t("div",oe,[e.isVip?(a(),l("div",re,[p(c),t("span",{innerHTML:e.$t("sidebar_cart.included_free_ssl")},null,8,ae)])):k("",!0),t("div",le,[t("span",null,r(e.$t("sidebar_cart.total")),1),t("span",ce,[p(d,{amount:e.summaryAmount,currency:e.currency,locale:e.locale},null,8,["amount","currency","locale"])])]),t("button",{class:"btn btn-primary",onClick:i[2]||(i[2]=(...n)=>e.onCheckoutClicked&&e.onCheckoutClicked(...n))},r(e.$t("sidebar_cart.proceed_to_checkout")),1)])],10,z)],64)}const ve=C(K,[["render",de]]);export{ve 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.