/
opt
/
canhelp
/
apps
/
web
/
.next
/
static
/
chunks
/
app
/
pricing
/
/opt/canhelp/apps/web/.next/static/chunks/app/pricing
mkdir
upload
Name
Size
Mode
Actions
page-04446cc1413604bb.js
14056
0644
edit
dl
rm
Edit:
/opt/canhelp/apps/web/.next/static/chunks/app/pricing/page-04446cc1413604bb.js
(14056B)
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6907],{160:(e,t,r)=>{Promise.resolve().then(r.bind(r,8880))},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>l,Hh:()=>s,Jv:()=>n,wV:()=>i,yK:()=>a});let a=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:n,signOut:l,signUp:s,useSession:i}=a},2035:(e,t,r)=>{"use strict";r.d(t,{d:()=>l});var a=r(4568);let n={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function l(e){let{tier:t,verified:r,size:l="sm",className:c=""}=e;if("free"===t&&!r)return null;let o="sm"===l?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(r&&"free"!==t)return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(o," ").concat(n[t].class," ").concat(c),children:["ultimate"===t?(0,a.jsx)(s,{className:"w-3 h-3 fill-gray-900"}):(0,a.jsx)(i,{className:"w-3 h-3"}),n[t].label]});if(r)return(0,a.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(o," bg-green-100 text-green-700 border border-green-200 ").concat(c),children:(0,a.jsx)(i,{className:"w-3 h-3"})});let d=n[t];return(0,a.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(o," ").concat(d.class," ").concat(c),children:["pro"===t&&(0,a.jsx)(s,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===t&&(0,a.jsx)(s,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),d.label]})}function s(e){let{className:t=""}=e;return(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function i(e){let{className:t=""}=e;return(0,a.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:[(0,a.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,a.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},8880:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var a=r(4568),n=r(7620),l=r(9664),s=r.n(l),i=r(7541),c=r(1592),o=r(9906),d=r(2982),x=r(2035);let m=[{key:"maxMessagesPerDay",labelKey:"pricing.feat.messages",format:e=>null===e?"∞":String(e)},{key:"maxOrdersPerDay",labelKey:"pricing.feat.orders",format:e=>null===e?"∞":String(e)},{key:"canContactAll",labelKey:"pricing.feat.contact_all"},{key:"canViewPhone",labelKey:"pricing.feat.view_phone"},{key:"canShowContactInfo",labelKey:"pricing.feat.show_contact"},{key:"hasFavorites",labelKey:"pricing.feat.favorites"},{key:"hasVerifiedBadge",labelKey:"pricing.feat.verified_badge"},{key:"hasGoogleCalendar",labelKey:"pricing.feat.google_calendar"},{key:"hasPersonalSite",labelKey:"pricing.feat.personal_site"},{key:"hasAutoResponse",labelKey:"pricing.feat.auto_response"},{key:"hasAutoMatch",labelKey:"pricing.feat.auto_match"},{key:"highlightedReviews",labelKey:"pricing.feat.highlighted_reviews"},{key:"maxCards",labelKey:"pricing.feat.cards",format:e=>null===e?"∞":String(e)},{key:"notifyNewTasks",labelKey:"pricing.feat.notify_tasks"},{key:"canUploadVideo",labelKey:"pricing.feat.video"}];function g(){return(0,a.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-green-500 mx-auto",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}function p(){return(0,a.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4 text-gray-300 mx-auto",children:(0,a.jsx)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}let h=["free","pro","ultimate"],u={free:"text-gray-700",pro:"text-green-700",ultimate:"text-amber-600"},f={free:"bg-gray-100 text-gray-700 hover:bg-gray-200",pro:"bg-green-600 text-white hover:bg-green-700",ultimate:"bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600"};function b(){let{data:e}=(0,c.wV)(),{t}=(0,o.Y)(),r=(0,i.useRouter)(),[l,b]=(0,n.useState)([]),[y,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(!0),[v,k]=(0,n.useState)(null),[L,_]=(0,n.useState)(null),[C,P]=(0,n.useState)(!1),[K,S]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(0,d.l3)().then(e=>{e.showPricing||r.replace("/")}).catch(()=>{})},[r]),(0,n.useEffect)(()=>{let e=!1;return N(!0),(0,d.T9)().then(t=>{e||b(t.sort((e,t)=>h.indexOf(e.tier)-h.indexOf(t.tier)))}).catch(()=>{}).finally(()=>{e||N(!1)}),()=>{e=!0}},[]);let E=()=>{e&&(0,d.H)().then(e=>{var t,r;return j(null!=(r=null==(t=e.plan)?void 0:t.id)?r:null)}).catch(()=>{})};async function F(t){if(!e)return void r.push("/sign-in");k(t),_(null),P(!0);try{let e=await (0,d.Cs)(t.id);_(e)}catch(e){k(null)}finally{P(!1)}}async function B(){if(v&&L){S(!0);try{let e=await (0,d.Je)(v.id,L.canPayFromBalance);if(e.url&&e.params){let t=document.createElement("form");t.method="POST",t.action=e.url,Object.entries(e.params).forEach(e=>{let[r,a]=e,n=document.createElement("input");n.type="hidden",n.name=r,n.value=a,t.appendChild(n)}),document.body.appendChild(t),t.submit();return}j(v.id),k(null),_(null)}catch(e){}finally{S(!1)}}}return(0,n.useEffect)(E,[e]),(0,n.useEffect)(()=>{let e=()=>E();return window.addEventListener("canhelp:plan-changed",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("canhelp:plan-changed",e),document.removeEventListener("visibilitychange",e)}},[e]),(0,a.jsxs)("main",{className:"min-h-screen py-12 px-4",children:[(0,a.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,a.jsxs)("div",{className:"text-center mb-10",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold text-white mb-3",children:t("pricing.title","Pricing")}),(0,a.jsx)("p",{className:"text-white/70 text-lg",children:t("pricing.subtitle")})]}),w?(0,a.jsx)("div",{className:"text-center text-white/60 py-20",children:t("common.loading","Loading...")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:l.map(e=>{let r=e.id===y,n="free"===e.tier;return(0,a.jsxs)("div",{className:"rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(r?"ring-2 ring-green-500 ring-offset-2":""," ").concat("ultimate"===e.tier?"border-amber-300 shadow-lg shadow-amber-100":"border-gray-200"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(x.d,{tier:e.tier,size:"md"}),r&&(0,a.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full",children:t("pricing.current_plan","Your plan")}),"pro"===e.tier&&!r&&(0,a.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full",children:t("pricing.popular","Popular")})]}),(0,a.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-1",children:e.name}),(0,a.jsx)("p",{className:"text-gray-500 text-sm mb-4 min-h-[40px]",children:e.description}),(0,a.jsxs)("div",{className:"text-3xl font-extrabold mb-1 ".concat(u[e.tier]),children:[n?t("pricing.free","Free"):(0,a.jsxs)(a.Fragment,{children:[e.oldPrice&&(0,a.jsxs)("span",{className:"text-lg font-normal text-gray-400 line-through mr-2",children:["€",e.oldPrice]}),"€",e.price]}),!n&&(0,a.jsxs)("span",{className:"text-base font-normal text-gray-400",children:["/",t("pricing.per_month","month")]})]}),e.durationDays&&!n&&(0,a.jsxs)("p",{className:"text-xs text-gray-400 mb-5",children:[t("pricing.duration","Duration"),": ",e.durationDays," ",t("pricing.days","days")]}),n&&(0,a.jsx)("div",{className:"mb-5"}),(0,a.jsx)("div",{className:"mt-auto",children:r?(0,a.jsx)("div",{className:"w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl",children:t("pricing.your_plan","Current plan")}):n?(0,a.jsx)("div",{className:"w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl",children:t("pricing.free_default","Default")}):(0,a.jsxs)("button",{onClick:()=>F(e),className:"block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(f[e.tier]),children:[t("pricing.choose","Choose")," ",e.name]})})]},e.id)})}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden",children:[(0,a.jsx)("div",{className:"px-6 py-4 border-b border-gray-100",children:(0,a.jsx)("h3",{className:"font-semibold text-gray-900",children:t("pricing.compare","Feature comparison")})}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-gray-100",children:[(0,a.jsx)("th",{className:"text-left px-6 py-3 text-gray-500 font-medium w-1/2",children:t("pricing.feature","Feature")}),l.map(e=>(0,a.jsx)("th",{className:"text-center px-4 py-3 font-medium text-gray-700",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)(x.d,{tier:e.tier,size:"sm"}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:"free"===e.tier?t("pricing.free","Free"):"€".concat(e.price)})]})},e.id))]})}),(0,a.jsx)("tbody",{children:m.map(e=>{let{key:r,labelKey:n,format:s}=e;return(0,a.jsxs)("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50 transition",children:[(0,a.jsx)("td",{className:"px-6 py-3 text-gray-600",children:t(n,n)}),l.map(e=>{let t,n=e[r];return t=s?(0,a.jsx)("span",{className:"text-gray-700 font-medium",children:s(n)}):"boolean"==typeof n?n?(0,a.jsx)(g,{}):(0,a.jsx)(p,{}):(0,a.jsx)("span",{className:"text-gray-700",children:null===n?"∞":String(null!=n?n:"—")}),(0,a.jsx)("td",{className:"text-center px-4 py-3",children:t},e.id)})]},r)})})]})})]}),(0,a.jsx)("p",{className:"text-center text-white/50 text-sm mt-8",children:t("pricing.faq_note","Payment is deducted from your CanHelp balance. Top up is available in Payments.")})]})]}),v&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",children:(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-md p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:t("pricing.confirm.title","Confirm plan selection")}),C?(0,a.jsx)("div",{className:"py-10 text-center text-gray-400",children:t("common.loading","Loading...")}):L?(0,a.jsxs)("div",{className:"space-y-3 text-sm text-gray-700",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.plan","Plan")}),(0,a.jsx)("span",{className:"font-semibold",children:v.name})]}),"upgrade"===L.type&&Number(L.prorated)>0&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.prorated","Prorated credit")}),(0,a.jsxs)("span",{className:"text-green-600 font-medium",children:["−€",L.prorated]})]}),"downgrade"!==L.type&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.effective_price","To pay")}),(0,a.jsxs)("span",{className:"font-bold text-gray-900",children:["€",L.effectivePrice]})]}),"downgrade"!==L.type&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.your_balance","Your balance")}),(0,a.jsxs)("span",{className:L.canPayFromBalance?"text-green-600":"text-red-500",children:["€",L.currentBalance]})]}),"downgrade"===L.type&&(0,a.jsxs)("div",{className:"bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs",children:[t("pricing.confirm.downgrade_info","The switch to the new plan will happen automatically after the current period ends."),L.scheduledDate&&(0,a.jsxs)(a.Fragment,{children:[" ",new Date(L.scheduledDate).toLocaleDateString("ru-RU")]})]}),"downgrade"!==L.type&&!L.canPayFromBalance&&(0,a.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs",children:[t("pricing.confirm.insufficient","Insufficient balance.")," ",(0,a.jsx)(s(),{href:"/payment",className:"underline font-medium",onClick:()=>k(null),children:t("pricing.confirm.top_up","Top up")})]}),(0,a.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,a.jsx)("button",{onClick:()=>{k(null),_(null)},className:"flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition",children:t("common.cancel","Cancel")}),("downgrade"===L.type||L.canPayFromBalance)&&(0,a.jsx)("button",{onClick:B,disabled:K,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat("downgrade"===L.type?"bg-orange-500 hover:bg-orange-600":f[v.tier].replace("block w-full","").trim()," disabled:opacity-50"),children:K?t("common.loading","Loading..."):"downgrade"===L.type?t("pricing.confirm.schedule_downgrade","Schedule switch"):t("pricing.confirm.pay","Pay")})]})]}):null]})})]})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=160)),_N_E=e.O()}]);
Save
cmd:
run