1import{j as r}from"./jsx-runtime.u17CrQMm.js";import{D as L}from"./jwt-generator.DZpDpWmD.js";import{a as I}from"./FaqSchema.DQEM2Yug.js";import{F as M}from"./FAQItem.CcrIn_rj.js";import{S as O}from"./SectionHeader.B-M5V7Eg.js";import{b as S,a as E}from"./animate-attributes.CG3A8P5v.js";import{r as c}from"./chunk-BV7QT456.BQ71lt_D.js";import"./ExternalLinks.DYQ1kwe5.js";import{B as A}from"./index.Bq7B3-hS.js";import{t as F,a as _,b as T}from"./tabs.BbG9WasU.js";import{S as R}from"./SlidingHighlight.DL8H39PY.js";import{M as C}from"./theme.DGKosm2U.js";import{P as p}from"./pricing._R-DLwkp.js";import{r as D}from"./ArrowRight.es.JKcZaiQP.js";import{B as Y}from"./badge.DcPQDkYT.js";import{c as B}from"./CheckCircle.es.CwngeVIy.js";import{o as k}from"./XCircle.es.CBeDTnar.js";import{S as H}from"./SiteLink.DZj8NgI4.js";const x={EDGE_EPSILON_PX:2,STOP_MERGE_PX:16,REDUCED_MOTION:"(prefers-reduced-motion: reduce)"},G=()=>r.jsx("div",{className:"flex flex-col gap-2",children:I.map((e,t)=>r.jsx("div",{...S(t,4),children:r.jsx(M,{question:e.question,answer:e.answer})},e.question))}),Fe=()=>r.jsx(r.Fragment,{children:r.jsx("section",{id:"faqs",className:"py-20 sm:py-28 md:py-36 bg-background",children:r.jsxs("div",{className:"max-w-section mx-auto px-5 md:px-[60px] w-full",children:[r.jsx(O,{title:"Frequently Asked Questions",subtitle:"Quick answers about encryption, plans and the ecosystem, so you can decide whether Envless fits before you install anything.",maxSubtitleWidth:"700px"}),r.jsx("div",{className:"max-w-[880px] mx-auto",children:r.jsx(G,{})})]})})}),U={stops:[],active:0,overflow:!1,moreStart:!1,moreEnd:!1},z=(e,t)=>{const s=[];return e.forEach((o,n)=>{const a=Math.min(Math.max(Math.round(o),0),Math.round(t)),i=s[s.length-1];i&&a-i.offset<x.STOP_MERGE_PX?i.offset=a:s.push({offset:a,item:n})}),s},W=(e,t)=>e.reduce((s,o,n)=>Math.abs(o.offset-t)<Math.abs(e[s].offset-t)?n:s,0),X=({scrollLeft:e,scrollWidth:t,clientWidth:s,offsets:o})=>{const n=Math.max(t-s,0),a=n>x.EDGE_EPSILON_PX,i=z(o,n);return{stops:i,active:i.length>0?W(i,e):0,overflow:a,moreStart:a&&e>x.EDGE_EPSILON_PX,moreEnd:a&&e<n-x.EDGE_EPSILON_PX}},q=(e,t)=>e.active===t.active&&e.overflow===t.overflow&&e.moreStart===t.moreStart&&e.moreEnd===t.moreEnd&&e.stops.length===t.stops.length&&e.stops.every((s,o)=>s.offset===t.stops[o].offset&&s.item===t.stops[o].item),Q=({overflow:e,moreStart:t,moreEnd:s})=>({"data-swipe-overflow":e?"":void 0,"data-swipe-more-start":t?"":void 0,"data-swipe-more-end":s?"":void 0,tabIndex:e?0:void 0}),$=e=>{const t=e.getBoundingClientRect().left+e.clientLeft,s=parseFloat(getComputedStyle(e).scrollPaddingLeft)||0;return X({scrollLeft:e.scrollLeft,scrollWidth:e.scrollWidth,clientWidth:e.clientWidth,offsets:Array.from(e.children,o=>o.getBoundingClientRect().left-t+e.scrollLeft-s)})},V=()=>{const e=c.useRef(null),[t,s]=c.useState(U);c.useEffect(()=>{const n=e.current;if(!n)return;let a=0;const i=()=>{a=0;const d=$(n);s(u=>q(u,d)?u:d)},l=()=>{a||(a=requestAnimationFrame(i))},m=new ResizeObserver(l);return m.observe(n),Array.from(n.children).forEach(d=>m.observe(d)),n.addEventListener("scroll",l,{passive:!0}),l(),()=>{cancelAnimationFrame(a),m.disconnect(),n.removeEventListener("scroll",l)}},[]);const o=c.useCallback(n=>{const a=e.current,i=t.stops[n];if(!a||!i)return;const l=window.matchMedia(x.REDUCED_MOTION).matches;a.scrollTo({left:i.offset,behavior:l?"auto":"smooth"})},[t.stops]);return{ref:e,...t,attributes:Q(t),scrollToStop:o}},f={MONTHLY:"monthly",YEARLY:"yearly"},K=[{value:f.MONTHLY,label:"Monthly"},{value:f.YEARLY,label:"Yearly"}],v={MONTHLY:"/ month",YEARLY:"/ year"},h=/\d[\d,]*(?:\.\d+)?/,J=C.DURATION_MS,Z="(prefers-reduced-motion: reduce)",g=c.createContext({period:f.MONTHLY,setPeriod:()=>{}}),ee=()=>{const{period:e,setPeriod:t}=c.useContext(g);return r.jsx("div",{className:"flex justify-center",children:r.jsxs("div",{className:T({size:"lg"}),children:[r.jsx(R,{active:'[data-state="active"]',activeKey:e,activeClass:F({size:"lg"})}),K.map(({value:s,label:o})=>r.jsx("button",{type:"button","data-state":s===e?"active":"inactive","aria-pressed":s===e,className:_({size:"lg"}),onClick:()=>t(s),children:o},s))]})})},te=({name:e,savings:t})=>r.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 min-h-6",children:[r.jsx("h3",{className:"text-xs font-semibold tracking-[0.14em] uppercase text-muted-foreground",children:e}),t&&r.jsx(Y,{children:`Save ${t}`})]}),j=e=>{const t=h.exec(e);return t?Number(t[0].replace(/,/g,"")):Number.NaN},se=e=>{var t,s;return((s=(t=h.exec(e))==null?void 0:t[0].split(".")[1])==null?void 0:s.length)??0},re=(e,t,s)=>e.replace(h,t.toFixed(s)),oe=e=>{const[t,s]=c.useState(e),o=c.useRef(e);return c.useEffect(()=>{const n=j(o.current),a=j(e);if(o.current=e,!Number.isFinite(n)||!Number.isFinite(a)||n===a||window.matchMedia(Z).matches){s(e);return}const i=se(e),l=performance.now();let m=0;const d=u=>{const N=Math.min((u-l)/J,1);if(N>=1)return s(e);s(re(e,n+(a-n)*(1-(1-N)**3),i)),m=requestAnimationFrame(d)};return m=requestAnimationFrame(d),()=>cancelAnimationFrame(m)},[e]),t},ne=({price:e,yearlyPrice:t})=>{const{period:s}=c.useContext(g),o=e==="$0"||e.toLowerCase()==="free",n=s===f.YEARLY,a=oe(o?"Free":n?t:e);return r.jsxs("div",{className:"flex items-baseline flex-wrap gap-x-2 mb-3",children:[r.jsx("span",{className:"text-[40px] sm:text-5xl font-display text-foreground leading-none",children:a}),!o&&r.jsx("span",{className:"text-base text-muted-foreground",children:n?v.YEARLY:v.MONTHLY})]})},y=({text:e,included:t=!0})=>r.jsxs("li",{className:"flex items-center gap-2.5",children:[t?r.jsx(B,{size:20,weight:"fill",color:"currentColor",className:"text-foreground flex-shrink-0"}):r.jsx(k,{size:20,weight:"fill",color:"currentColor",className:"text-muted-foreground flex-shrink-0"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:e})]}),ae=({features:e})=>r.jsx("ul",{className:"flex flex-col gap-2.5",children:e.map(t=>r.jsx(y,{text:t.text,included:t.included??!0},t.text))}),b=e=>
1Number(e.replace(/[^\d.]/g,""))||0,ie=({name:e,subtitle:t,price:s,yearlyPrice:o,highlighted:n,features:a,index:i=0})=>{const l=b(s),m=b(o),d=l*12,u=l>0&&m>0&&m<d?`${Math.round((1-m/d)*100)}%`:void 0;return r.jsxs("div",{...S(i,4),className:n?"pricing-card rounded-[24px] p-6 sm:p-7 md:p-8 xl:p-7 flex flex-col pricing-card-highlighted":"pricing-card rounded-[24px] p-6 sm:p-7 md:p-8 xl:p-7 flex flex-col",children:[r.jsx(te,{name:e,savings:u}),r.jsx(ne,{price:s,yearlyPrice:o}),r.jsx("p",{className:"text-base text-muted-foreground mb-5 min-h-12",children:t}),r.jsx(A,{asChild:!0,variant:n?"default":"secondary",className:"w-full mb-6",children:r.jsxs(H,{href:L,children:["Get started",r.jsx(D,{weight:"bold",className:"size-4"})]})}),r.jsx(ae,{features:a})]})},ce=({features:e})=>e.length===0?null:r.jsxs("div",{...E(1),className:"flex flex-col items-center gap-4 text-center",children:[r.jsx("p",{className:"text-xs font-semibold tracking-[0.14em] uppercase text-muted-foreground",children:"Every plan includes"}),r.jsx("ul",{className:"flex flex-wrap justify-center gap-x-8 gap-y-3",children:e.map(t=>r.jsx(y,{text:t.text,included:t.included??!0},t.text))})]}),w=e=>e.included??!0,P=(e,t)=>e.text===t.text&&w(e)===w(t),le=e=>{var t;return(((t=e[0])==null?void 0:t.features)??[]).filter(s=>e.length>1&&e.every(o=>o.features.some(n=>P(n,s))))},me=(e,t)=>e.features.filter(s=>!t.some(o=>P(o,s))),de=({stops:e,active:t,labels:s,onSelect:o,className:n=""})=>r.jsx("div",{className:`flex min-h-6 items-center justify-center gap-1 ${n}`,children:e.length>1&&e.map((a,i)=>r.jsx("button",{type:"button","aria-label":`Show ${s[a.item]??i+1}`,"aria-current":i===t?"true":void 0,className:"group flex h-6 min-w-6 cursor-pointer items-center justify-center rounded-full px-1.5 outline-none focus-visible:ring-2 focus-visible:ring-primary",onClick:()=>o(i),children:r.jsx("span",{className:"block h-2 w-2 rounded-full bg-foreground
1/20 transition-all group-hover:bg-foreground/40 motion-reduce:transition-none group-aria-[current=true]:w-5 group-aria-[current=true]:bg-foreground"})},a.item))}),ue=p.map(e=>`${e.name} plan`),xe=()=>{const e=le(p),t=V();return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:t.ref,...t.attributes,role:"region","aria-label":"Pricing plans",className:"swipe-scroller -mx-5 -mt-6 flex snap-x snap-mandatory scroll-px-5 gap-4 overflow-x-auto overflow-y-hidden px-5 py-6 *:w-[88%] *:shrink-0 *:snap-start sm:*:w-[calc(50%-38px)] lg:*:w-[calc(33.333%-32px)] xl:mx-0 xl:mt-0 xl:mb-12 xl:grid xl:grid-cols-4 xl:gap-5 xl:overflow-visible xl:p-0 xl:*:w-auto",children:p.map((s,o)=>r.jsx(ie,{name:s.name,subtitle:s.subtitle,price:s.price,yearlyPrice:s.yearlyPrice,highlighted:s.highlighted,features:me(s,e),index:o},s.name))}),r.jsx(de,{stops:t.stops,active:t.active,labels:ue,onSelect:t.scrollToStop,className:"-mt-2 mb-8 xl:hidden"}),r.jsx(ce,{features:e})]})},_e=()=>{const[e,t]=c.useState(f.MONTHLY),s=c.useMemo(()=>({period:e,setPeriod:t}),[e]);return r.jsx(g.Provider,{value:s,children:r.jsxs("div",{className:"max-w-pricing mx-auto w-full",children:[r.jsx("div",{...E(1),className:"mb-10",children:r.jsx(ee,{})}),r.jsx(xe,{})]})})};export{Fe as F,_e as P,V as u};
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.