1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2283],{16200:(e,a,s)=>{"use strict";s.d(a,{I:()=>m,M5:()=>f,SQ:()=>g,V0:()=>v,_2:()=>C,dc:()=>p,lp:()=>b,lv:()=>x,mB:()=>j,nV:()=>h,rI:()=>c,ty:()=>u});var l=s(95155),t=s(12115),n=s(60186),r=s(27937),i=s(5917),o=s(99051),d=s(25016);let c=n.bL,u=n.l9,m=n.YJ,p=n.ZL,x=n.Pb;n.z6;let h=t.forwardRef((e,a)=>{let{className:s,inset:t,children:i,...o}=e;return(0,l.jsxs)(n.ZP,{ref:a,className:(0,d.cn)("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"ps-8",s),...o,children:[i,(0,l.jsx)(r.A,{className:"ms-auto"})]})});h.displayName=n.ZP.displayName;let f=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(n.G5,{ref:a,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...t})});f.displayName=n.G5.displayName;let g=t.forwardRef((e,a)=>{let{className:s,sideOffset:t=4,...r}=e;return(0,l.jsx)(n.ZL,{children:(0,l.jsx)(n.UC,{ref:a,sideOffset:t,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})})});g.displayName=n.UC.displayName;let C=t.forwardRef((e,a)=>{let{className:s,inset:t,...r}=e;return(0,l.jsx)(n.q7,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"ps-8",s),...r})});C.displayName=n.q7.displayName,t.forwardRef((e,a)=>{let{className:s,children:t,checked:r,...o}=e;return(0,l.jsxs)(n.H_,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:r,...o,children:[(0,l.jsx)("span",{className:"absolute start-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,l.jsx)(n.VF,{children:(0,l.jsx)(i.A,{className:"h-4 w-4"})})}),t]})}).displayName=n.H_.displayName,t.forwardRef((e,a)=>{let{className:s,children:t,...r}=e;return(0,l.jsxs)(n.hN,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[(0,l.jsx)("span",{className:"absolute start-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,l.jsx)(n.VF,{children:(0,l.jsx)(o.A,{className:"h-2 w-2 fill-current"})})}),t]})}).displayName=n.hN.displayName;let b=t.forwardRef((e,a)=>{let{className:s,inset:t,...r}=e;return(0,l.jsx)(n.JU,{ref:a,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",t&&"ps-8",s),...r})});b.displayName=n.JU.displayName;let j=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(n.wv,{ref:a,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",s),...t})});j.displayName=n.wv.displayName;let v=e=>{let{className:a,...s}=e;return(0,l.jsx)("span",{className:(0,d.cn)("ms-auto text-xs tracking-widest opacity-60",a),...s})};v.displayName="DropdownMenuShortcut"},26125:(e,a,s)=>{"use strict";s.d(a,{T:()=>r});var l=s(95155),t=s(12115),n=s(25016);let r=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)("textarea",{className:(0,n.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:a,...t})});r.displayName="Textarea"},29698:(e,a,s)=>{"use strict";s.d(a,{Ay:()=>r,TV:()=>n,so:()=>t});var l=s(18720);let t={token:"",id:0,name:"",first_name:"",last_name:"",email:"",username:""};function n(e,a,s){let l=new Date;l.setTime(l.getTime()+24*s*36e5);let t="expires="+l.toUTCString();"undefined"!=typeof document&&(document.cookie=e+"="+a+";"+t+";path=/")}
1async function r(e,a){if(!e)return a&&(a(t),n("slToken","",-1),(0,l.toast)("Logging out..."),window.location.reload()),t;let s=await fetch("".concat("https://api.sociallibra.com/wp-json/social_libra/v2","/current_user"),{next:{tags:["currentUser"]},method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!s.ok)return t;let r=await s.json();return s.ok?(r.token=e,n("slToken",e,7),a&&a(r),r):(r&&r.ip_blocked&&(t.ip_blocked=!0),t)}},31008:(e,a,s)=>{"use strict";s.d(a,{CustomerPortal:()=>ew});var l=s(95155),t=s(12115),n=s(25016);function r(e){let{className:a,...s}=e;return(0,l.jsx)("h2",{className:(0,n.cn)("text-sm pb-4 border-b border-b-muted border-solid text-muted-foreground uppercase font-semibold mb-4",a),...s})}var i=s(45949),o=s(81989),d=s(10183),c=s(33431),u=s(86504),m=s(32894);let p=(0,s(83101).F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),x=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(m.b,{ref:a,className:(0,n.cn)(p(),s),...t})});x.displayName=m.b.displayName;var h=s(26125);let f={WANT_PAYMENT_CONTROL:"1",NOT_SURE_IF_NEEDED:"2",SELDOM_USED:"3",DIFFICULT_TO_SET_UP:"4",MISSING_FEATURES:"5",SLOW_AND_BUGGY:"6",EXPENSIVE:"7"};var g=s(38446),C=s(87351);function b(e){let{onClose:a,subscription:s,cancellationCoupons:n,afterCancel:r,afterCouponApplied:i}=e,[o,d]=t.useState("confirm");return(0,l.jsx)("div",{className:"max-w-[65ch] my-5 bg-accent p-8 rounded-lg",children:function(){switch(o){case"confirm":return(0,l.jsx)(j,{subscription:s,onClose:a,onCancel:()=>{(null==n?void 0:n.length)&&s.applyRenewalCancellationCouponUrl?d("coupon"):d("reason")}});case"coupon":return(0,l.jsx)(v,{subscription:s,onClose:a,onCancel:()=>d("reason"),coupons:e.cancellationCoupons,afterCouponApplied:i});case"reason":return(0,l.jsx)(N,{subscription:s,onClose:a,afterCancel:r});default:return null}}()})}function j(e){let{onClose:a,subscription:s,onCancel:t}=e,n=(0,i.Ym)(),r=s.isTrial&&s.trialEnds?(0,d.le)(s.trialEnds):(0,d.le)(s.renewalDate);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:n.portal.cancelSubscription.title.confirm()}),(0,l.jsx)("div",{className:"leading-relaxed mt-6",children:(s.isTrial?n.portal.cancelSubscription.message.trial.paragraphs(r,null):n.portal.cancelSubscription.message.regular.paragraphs(r)).map((e,a)=>(0,l.jsx)("p",{className:"mb-4",children:e},a))}),(0,l.jsxs)("div",{className:"mt-6 flex flex-col sm:flex-row gap-3",children:[(0,l.jsx)(c.$,{variant:"outline",onClick:t,children:n.portal.cancelSubscription.action.cancel()}),(0,l.jsx)(c.$,{variant:"default",onClick:a,children:n.portal.cancelSubscription.action.remindMe()})]})]})}function v(e){var a,s,t,n,r,u,m,p,x;let h,f,{onClose:b,subscription:j,onCancel:v,coupons:N}=e,y=(0,i.Ym)(),w=N&&N.length>0,{execute:_,loading:S}=(0,g.kb)(j.applyRenewalCancellationCouponUrl);if(!w)throw Error("No coupons available");let M=N[0],{dollarOff:A,percentageOff:P}=(s=j.renewalAmount,t=j.currency,n="paypal"===j.paymentMethod,h=0,f=0,"percentage"===M.discount_type?f=(h=null!=(r=M.discount)?r:0)/100*s:(f=null!=(x=null!=(p=null==(u=M.discounts)?void 0:u[t])?p:null==(m=M.discounts)?void 0:m[t.toLowerCase()])?x:0,s>0&&(h=Math.round(f/s*100))),!M.has_renewals_discount&&n&&(h=Math.min(16,h),f=Math.min(.16*s,f)),{percentageOff:h,dollarOff:f}),E=P>A?"".concat(P,"%"):(0,d.vv)(A,j.currency,y.code);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center text-center",children:[(0,l.jsxs)("div",{className:"bg-primary text-primary-foreground rounded-xl p-10 gap-1 flex flex-col items-center justify-center w-50 h-50 shrink-0 grow-0",children:[(0,l.jsx)("div",{className:"text-6xl font-bold",children:E}),(0,l.jsx)("div",{className:"text-4xl font-semibold",children:y.portal.cancelSubscription.message.coupon.off()})]}),(0,l.jsx)("h2",{className:"text-2xl font-semibold mt-4 mb-3",children:y.portal.cancelSubscription.title.coupon(E)}),(0,l.jsx)("div",{className:"leading-relaxed",children:y.portal.cancelSubscription.message.coupon.paragraphs(null!=(a=M.has_renewals_discount)&&a,E).map((e,a)=>(0,l.jsx)("p",{className:"mb-2",children:e},a))})]}),(0,l.jsxs)("div",{className:"flex flex-wrap justify-center gap-2 mt-8",children:[(0,l.jsx)(c.$,{variant:"outline",onClick:v,disabled:S,children:y.portal.cancelSubscription.action.couponCancel()}),(0,l.jsxs)(c.$,{disabled:S,onClick:()=>{_({couponId:(0,o.m4)(M.coupon_id)}).then(()=>{var a;window.alert(y.portal.cancelSubscription.alert.couponApplied()),null==(a=e.afterCouponApplied)||a.call(e)})},children:[S?(0,l.jsx)(C.A,{className:"size-4"}):null,"Get discount"]}),(0,l.jsx)(c.$,{variant:"ghost",size:"sm",onClick:b,disabled:S,children:y.portal.cancelSubscription.action.back()})]})]})}function N(e){let{onClose:a,subscription:s,afterCancel:n}=e,r=(0,i.Ym)(),[o,d]=t.useState([]),[m,p]=t.useState(""),{execute:b,loading:j}=(0,g.kb)(s.cancelRenewalUrl),v=s.isTrial,N=t.useMemo(()=>(function(e){let a=[{id:f.NOT_SURE_IF_NEEDED,label:"I'm not sure I want to keep it."},{id:f.DIFFICULT_TO_SET_UP,label:"It was too difficult to set up."},{id:f.MISSING_FEATURES,label:"It didn't have the features I was looking for."}
1,{id:f.SLOW_AND_BUGGY,label:"It was too slow and/or buggy."},{id:f.EXPENSIVE,label:"The cost was too high."}];e||a.push({id:f.WANT_PAYMENT_CONTROL,label:"I want to control when I pay."},{id:f.SELDOM_USED,label:"I never/seldom use it."});let s=[...a];for(let e=s.length-1;e>0;e--){let a=Math.floor(Math.random()*(e+1));[s[e],s[a]]=[s[a],s[e]]}return s})(v),[v]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:r.portal.cancelSubscription.title.reason()}),(0,l.jsx)("div",{className:"leading-relaxed mt-6",children:r.portal.cancelSubscription.message.reason.paragraphs().map((e,a)=>(0,l.jsx)("p",{className:"mb-2",children:e},a))}),(0,l.jsxs)("div",{className:"flex flex-col mt-6 gap-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(x,{className:"mb-3",children:r.portal.cancelSubscription.message.reason.form.reason()}),(0,l.jsx)("div",{className:"space-y-3",children:N.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(u.S,{id:"reason-".concat(e.id),checked:o.includes(e.id),onCheckedChange:a=>{a?d(a=>[...a,e.id]):d(a=>a.filter(a=>a!==e.id))}}),(0,l.jsx)("label",{htmlFor:"reason-".concat(e.id),className:"text-sm cursor-pointer",children:e.label})]},e.id))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x,{htmlFor:"sub-cancel-reason",className:"mb-3",children:r.portal.cancelSubscription.message.reason.form.feedback()}),(0,l.jsx)(h.T,{placeholder:r.portal.cancelSubscription.message.reason.form.feedbackPlaceholder(),value:m,onChange:e=>p(e.target.value),id:"sub-cancel-reason",className:"min-h-25"})]})]}),(0,l.jsxs)("div",{className:"mt-6 flex flex-col sm:flex-row gap-3",children:[(0,l.jsx)(c.$,{variant:"outline",onClick:a,disabled:j,children:r.portal.cancelSubscription.action.back()}),(0,l.jsxs)(c.$,{variant:"destructive",disabled:j,onClick:()=>{b({feedback:m,reason_ids:o.length?o:void 0}).then(()=>{window.alert(r.portal.cancelSubscription.alert.subscriptionCancelled()),null==n||n()})},children:[j?(0,l.jsx)(C.A,{className:"size-4"}):null,r.portal.cancelSubscription.action.confirmCancel(v)]})]})]})}var y=s(16200),w=s(63354);function _(e){let{subscription:a,plans:s,onCancel:n}=e,r=(0,i.Ym)(),u=(0,w.Q5)(),m=(0,t.useMemo)(()=>{var e,l,t;let n=s.filter(e=>{var a;return null==(a=e.pricing)?void 0:a.some(e=>e.annual_price||e.monthly_price)}).map(e=>{var s;let l=null==(s=e.pricing)?void 0:s.filter(e=>(e.annual_price||e.monthly_price)&&(0,o.vu)(e.currency)===a.currency).map(e=>{let s=null,l=null;return a.billingCycle===o.zD.MONTHLY?e.monthly_price?(s=o.zD.MONTHLY,l=e.monthly_price):e.annual_price&&(s=o.zD.YEARLY,l=e.annual_price):e.annual_price?(s=o.zD.YEARLY,l=e.annual_price):e.monthly_price&&(s=o.zD.MONTHLY,l=e.monthly_price),{...e,updateAmount:l?(0,d.vv)(l,a.currency,r.code):null,updatePeriod:s?r.billingCycle(s).toLocaleLowerCase():null}});if(!(null==l?void 0:l.length))throw Error("Plan ".concat(e.id," has no valid pricing."));let t=function(e,a){var s,l;if(!a||!e||0===e.length)return null!=(s=null==e?void 0:e[0])?s:null;let t=null,n=1/0;for(let s of e){if(null==s.licenses)continue;let e=Math.abs(s.licenses-a);e<n&&(n=e,t=s)}return null!=(l=null!=t?t:e[0])?l:null}(l,a.quota),n=t?l.filter(e=>!(0,o.Xm)(e.id,t.id)):l;return t&&n.unshift(t),{...e,pricing:n,closestPricing:t}}),i=null!=(l=n.findIndex(e=>(0,o.Xm)(e.id,a.planId)))?l:0,c=n[i],u=n.slice(0,i),m=n.slice(i+1),p=m.length>0||(null!=(t=null==(e=c.pricing)?void 0:e.length)?t:0)>1,x=u.length>0;return{lowerPlans:u,higherPlans:m,currentPlan:c,hasDowngrade:x,hasUpgrade:p}},[a,s,r]);return a.isActive?(0,l.jsxs)("div",{className:"w-full flex flex-col gap-2",children:[(0,l.jsxs)(y.rI,{children:[(0,l.jsx)(y.ty,{asChild:!0,children:(0,l.jsx)(c.$,{className:"w-full",children:r.portal.action.update()})}),(0,l.jsxs)(y.SQ,{className:"w-70",align:"start",children:[m.hasUpgrade?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(S,{label:"Upgrade",plans:m.higherPlans,subscription:a,sellingUnit:e.sellingUnit}),(0,l.jsx)(S,{plans:[m.currentPlan],subscription:a,sellingUnit:e.sellingUnit})]}):null,m.hasDowngrade?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.mB,{}),(0,l.jsx)(S,{label:"Downgrade",plans:m.lowerPlans,subscription:a,sellingUnit:e.sellingUnit})]}):null]})]}),n?(0,l.jsx)(c.$,{className:"w-full",variant:"outline",onClick:n,children:r.portal.action.cancel()}):null]}):(0,l.jsx)(c.$,{className:"w-full",onClick:()=>u.open({license_id:a.licenseId,authorization:a.checkoutUpgradeAuthorization,plan_id:a.planId}),children:r.portal.action.reactivate()})}function S(e){let{label:a,plans:s,subscription:t,sellingUnit:n}=e,r=(0,i.Ym)(),c=(0,w.Q5)();return(0,l.jsxs)(l.Fragment,{children:[a?(0,l.jsx)(y.lp,{children:a}):null,(0,l.jsx)(y.I,{children:s.map(e=>{var a,s;if(!(null==(a=e.pricing)?void 0:a.length))return null;if(1===e.pricing.length)return(0,l.jsxs)(y._2,{disabled:(0,o.Xm)(e.closestPricing.id,t.pricingId),onClick:()=>{var a;return c.open({license_id:t.licenseId,authorization:t.checkoutUpgradeAuthorization,plan_id:e.id,pricing_id:null==(a=e.closestPricing)?void 0:a.id})},children:[e.title,(null==(s=e.closestPricing)?void 0:s.updateAmount)&&e.closestPricing.updatePeriod?(0,l.jsx)(y.V0,{children:r.portal.action.amount(e.closestPricing.updateAmount,e.closestPricing.updatePeriod)}):null]},e.id);let i=e.pricing[0];return(0,l.jsxs)(y.lv,{children:[(0,l.jsxs)(y.nV,{children:[e.title,i.updateAmount&&i.updatePeriod?(0,l.jsx)(y.V0,{children:r.portal.action.amount(i.updateAmount,i.updatePeriod)}):null]}),(0,l.jsx)(y.dc,{children:(0,l.jsx)(y.M5,{className:"w-70",children:e.pricing.map(a=>{var s,i;return a.updateAmount&&a.updatePeriod?(0,l.jsxs)(y._2,{disabled:(0,o.Xm)(a.id,t.pricingId),onClick:()=>c.open({license_id:t.licenseId,authorization:t.checkoutUpgradeAuthorization,plan_id:e.id,pricing_id:a.id}),children:[r.portal.action.pricingTitle((0,d.ZV)(null!=(s=a.licenses)?s:0),null!=(i=a.licenses)?i:0,n),(0,l.jsx)(y.V0,{children:(0,o.Xm)(a.id,t.pricingId)?r.portal.action.current():r.portal.action.amount(a.updateAmount,a.updatePeriod)})]},a.id):null})})})]},e.id)})})]})}let M=(0,t.forwardRef)((e,a)=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 21 21",ref:a,...e,children:(0,l.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.347 1.583H6.53c-.613.001-.878.238-.97.84-.145.946-.295 1.892-.445 2.837l-.104.656-.292 1.85-.363 2.295c-.24 1.515-.477 3.03-.714 4.546l-.093.587c-.091.576-.182 1.152-.265 1.73-.048.33.135.563.451.565.742.006 1.484.006 2.226.006h1.08c.103 0 .153-.039.166-.146.02-.169.047-.336.074-.504l.027-.17.192-1.228c.168-1.071.335-2.142.507-3.213.072-.454.38-.705.846-.708.26-.002.52-.001.782-.001l.817-.001a9.503 9.503 0 0 0 1.843-.172c1.3-.266 2.427-.832 3.275-1.88.668-.826 1.042-1.785 1.265-2.81.169-.77.271-1.55.082-2.324-.289-1.188-1.066-1.945-2.2-2.352-.882-.315-1.8-.399-2.728-.402a404.92 404.92 0 0 0-1.642 0Zm7.464 5.277Zm0 0c-.021.08-.04.155-.06.226l-.08.303c-.763 2.85-2.793 4.628-5.696 5.02-.763.103-1.527.101-2.291.1h-.517c-.147 0-.208.033-.23.19-.103.688-.212 1.376-.321 2.064a578.574 578.574 0 0 0-.262 1.656c-.15.955-.3 1.91-.454 2.863-.028.171.032.203.189.202.444-.005.89-.005 1.334-.004h.69c.538-.001.772-.214.854-.744.184-1.185.371-2.37.566-3.554.08-.482.314-.67.803-.668.655.004 1.306-.025 1.95-.154 1.168-.234 2.184-.737 2.914-1.7.945-1.25 1.293-2.687 1.21-4.23a2.694 2.694 0 0 0-.599-1.57Z",clipRule:"evenodd"})})),A=(0,t.forwardRef)((e,a)=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 21 21",ref:a,...e,children:(0,l.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.4 4.93c-.673 0-1.218.546-1.218 1.218v1.39h16v-1.39c0-.672-.544-1.217-1.217-1.217H3.4Zm15.782 3.108V15.164a2.217 2.217 0 0 1-2.217 2.217H3.4a2.217 2.217 0 0 1-2.217-2.217V6.148c0-1.225.993-2.217 2.217-2.217h13.566c1.225 0 2.217.992 2.217 2.217v1.89Zm-17 3.118v4.008c0 .672.545 1.217 1.217 1.217h13.566c.672 0 1.217-.545 1.217-1.217v-4.008h-16Zm9.993 2.732a.5.5 0 0 1 .5-.5h1.49a.5.5 0 1 1 0 1h-1.49a.5.5 0 0 1-.5-.5Zm-8.044-.5a.5.5 0 0 0 0 1h6.052a.5.5 0 1 0 0-1H4.13Z",clipRule:"evenodd"})}));function P(e){return(0,l.jsx)("span",{className:"inline-flex items-center bg-muted text-muted-foreground rounded-sm h-8 w-8 justify-center mr-2",children:"paypal"===e.method?(0,l.jsx)(M,{}):(0,l.jsx)(A,{})})}function E(e){let{subscription:a}=e,s=(0,w.Q5)(),t=(0,i.Ym)();return(0,l.jsxs)("p",{className:"flex flex-wrap justify-between items-center gap-4",children:[(0,l.jsxs)("span",{className:"grow-0 shrink-0 flex items-center text-muted-foreground text-sm ",children:[(0,l.jsx)(P,{method:a.paymentMethod}),(0,l.jsx)("span",{className:"font-semibold uppercase text-xs",children:t.portal.payment.info(a.paymentMethod)})]}),(0,l.jsx)(c.$,{variant:"outline",onClick:()=>s.open({is_payment_method_update:!0,plan_id:a.planId,pricing_id:a.pricingId,license_id:a.licenseId,authorization:a.checkoutUpgradeAuthorization}
1),children:t.portal.payment.update()})]})}var k=s(93736);function I(e){let{subscription:a,plans:s,sellingUnit:t,onCancel:n}=e,r=(0,i.Ym)(),o=a.renewalDate?new Date(a.renewalDate):null,c=a.isActive;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 items-center",children:[(0,l.jsxs)("div",{className:"",children:[(0,l.jsxs)("h3",{className:"text-lg mb-0 flex align-baseline",children:[r.portal.primary.planTitle(a.planTitle),c?null:(0,l.jsx)(k.E,{variant:"destructive",className:"ml-2",children:r.portal.primary.inactiveBadge()})]}),(0,l.jsx)("p",{className:"text-2xl font-bold",children:a.billingCycle?r.portal.primary.renewal.amount((0,d.vv)(a.renewalAmount,a.currency,r.code),r.billingCycle(a.billingCycle).toLocaleLowerCase()):(0,d.vv)(a.renewalAmount,a.currency,r.code)}),(0,l.jsx)("p",{className:"text-sm mt-5",children:c?r.portal.primary.renewal.active((0,d.Yq)(a.renewalDate,r.code)):r.portal.primary.renewal.inactive((0,d.Yq)(a.cancelledAt,r.code))})]}),(0,l.jsx)("div",{className:"max-w-50 md:ml-auto",children:(0,l.jsx)(_,{subscription:a,plans:s,sellingUnit:t,onCancel:n})})]}),(0,l.jsx)("div",{className:"mt-4",children:c?(0,l.jsx)(E,{subscription:a}):o&&o>new Date?(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(P,{method:a.paymentMethod}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:r.portal.primary.renewal.updatePaymentMethodBefore((0,d.Yq)(o,r.code))})]}):null})]})}function L(e){let{subscription:a,plans:s,sellingUnit:n,cancellationCoupons:o,afterCancel:d,afterCouponApplied:c}=e,[u,m]=t.useState(!1),p=(0,i.Ym)();return(0,l.jsxs)("div",{className:"fs-saas-starter-portal__primary-subscription",children:[(0,l.jsx)(r,{children:p.portal.primary.title()}),u?(0,l.jsx)(b,{subscription:a,onClose:()=>m(!1),cancellationCoupons:o,afterCancel:d,afterCouponApplied:c}):(0,l.jsx)(I,{onCancel:()=>m(!0),subscription:a,plans:s,sellingUnit:n})]})}var R=s(71537);function T(e){return(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-[200px_1fr] gap-1 md:gap-2 items-start",children:[(0,l.jsx)("div",{className:"text-muted-foreground text-sm font-semibold",children:e.label}),(0,l.jsx)("div",{children:e.value})]})}let B=[["AF","Afghanistan"],["AX","Aland Islands"],["AL","Albania"],["DZ","Algeria"],["AS","American Samoa"],["AD","Andorra"],["AO","Angola"],["AI","Anguilla"],["AQ","Antarctica"],["AG","Antigua And Barbuda"],["AR","Argentina"],["AM","Armenia"],["AW","Aruba"],["AU","Australia"],["AT","Austria"],["AZ","Azerbaijan"],["BS","Bahamas"],["BH","Bahrain"],["BD","Bangladesh"],["BB","Barbados"],["BY","Belarus"],["BE","Belgium"],["BZ","Belize"],["BJ","Benin"],["BM","Bermuda"],["BT","Bhutan"],["BO","Bolivia"],["BA","Bosnia And Herzegovina"],["BW","Botswana"],["BV","Bouvet Island"],["BR","Brazil"],["IO","British Indian Ocean Territory"],["BN","Brunei Darussalam"],["BG","Bulgaria"],["BF","Burkina Faso"],["BI","Burundi"],["KH","Cambodia"],["CM","Cameroon"],["CA","Canada"],["IC","Canary Islands"],["CV","Cape Verde"],["BQ","Caribbean Netherlands"],["KY","Cayman Islands"],["CF","Central African Republic"],["TD","Chad"],["CL","Chile"],["CN","China"],["CX","Christmas Island"],["CC","Cocos (Keeling) Islands"],["CO","Colombia"],["KM","Comoros"],["CG","Congo"],["CD","Congo, Democratic Republic"],["CK","Cook Islands"],["CR","Costa Rica"],["CI","Cote D'Ivoire"],["HR","Croatia"],["CU","Cuba"],["CW","Cura\xe7ao"],["CY","Cyprus"],["CZ","Czech Republic"],["DK","Denmark"],["DJ","Djibouti"],["DM","Dominica"],["DO","Dominican Republic"],["EC","Ecuador"],["EG","Egypt"],["SV","El Salvador"],["GQ","Equatorial Guinea"],["ER","Eritrea"],["EE","Estonia"],["ET","Ethiopia"],["FK","Falkland Islands (Malvinas)"],["FO","Faroe Islands"],["FJ","Fiji"],["FI","Finland"],["FR","France"],["GF","French Guiana"],["PF","French Polynesia"],["TF","French Southern Territories"],["GA","Gabon"],["GM","Gambia"],["GE","Georgia"],["DE","Germany"],["GH","Ghana"],["GI","Gibraltar"],["GR","Greece"],["GL","Greenland"],["GD","Grenada"],["GP","Guadeloupe"],["GU","Guam"],["GT","Guatemala"],["GG","Guernsey"],["GN","Guinea"],["GW","Guinea-Bissau"],["GY","Guyana"],["HT","Haiti"],["HM","Heard Island & Mcdonald Islands"],["VA","Holy See (Vatican City State)"],["HN","Honduras"],["HK","Hong Kong"],["HU","Hungary"],["IS","Iceland"],["IN","India"],["ID","Indonesia"],["IR","Iran, Islam
1ic Republic Of"],["IQ","Iraq"],["IE","Ireland"],["IM","Isle Of Man"],["IL","Israel"],["IT","Italy"],["JM","Jamaica"],["JP","Japan"],["JE","Jersey"],["JO","Jordan"],["KZ","Kazakhstan"],["KE","Kenya"],["KI","Kiribati"],["KR","Korea, South"],["KP","Korea, North"],["XK","Kosovo"],["KW","Kuwait"],["KG","Kyrgyzstan"],["LA","Lao People's Democratic Republic"],["LV","Latvia"],["LB","Lebanon"],["LS","Lesotho"],["LR","Liberia"],["LY","Libyan Arab Jamahiriya"],["LI","Liechtenstein"],["LT","Lithuania"],["LU","Luxembourg"],["MO","Macao"],["MK","Macedonia"],["MG","Madagascar"],["MW","Malawi"],["MY","Malaysia"],["MV","Maldives"],["ML","Mali"],["MT","Malta"],["MH","Marshall Islands"],["MQ","Martinique"],["MR","Mauritania"],["MU","Mauritius"],["YT","Mayotte"],["MX","Mexico"],["FM","Micronesia, Federated States Of"],["MD","Moldova"],["MC","Monaco"],["MN","Mongolia"],["ME","Montenegro"],["MS","Montserrat"],["MA","Morocco"],["MZ","Mozambique"],["MM","Myanmar"],["NA","Namibia"],["NR","Nauru"],["NP","Nepal"],["NL","Netherlands"],["AN","Netherlands Antilles"],["NC","New Caledonia"],["NZ","New Zealand"],["NI","Nicaragua"],["NE","Niger"],["NG","Nigeria"],["NU","Niue"],["NF","Norfolk Island"],["MP","Northern Mariana Islands"],["NO","Norway"],["OM","Oman"],["PK","Pakistan"],["PW","Palau"],["PS","Palestinian Territory, Occupied"],["PA","Panama"],["PG","Papua New Guinea"],["PY","Paraguay"],["PE","Peru"],["PH","Philippines"],["PN","Pitcairn"],["PL","Poland"],["PT","Portugal"],["PR","Puerto Rico"],["QA","Qatar"],["RE","Reunion"],["RO","Romania"],["RU","Russia"],["RW","Rwanda"],["BL","Saint Barthelemy"],["SH","Saint Helena"],["KN","Saint Kitts And Nevis"],["LC","Saint Lucia"],["MF","Saint Martin"],["PM","Saint Pierre And Miquelon"],["VC","Saint Vincent And Grenadines"],["WS","Samoa"],["SM","San Marino"],["ST","Sao Tome And Principe"],["SA","Saudi Arabia"],["SN","Senegal"],["RS","Serbia"],["SC","Seychelles"],["SL","Sierra Leone"],["SG","Singapore"],["SX","Sint Maarten"],["SK","Slovakia"],["SI","Slovenia"],["SB","Solomon Islands"],["SO","Somalia"],["ZA","South Africa"],["GS","South Georgia And Sandwich Isl."],["SS","South Sudan"],["ES","Spain"],["LK","Sri Lanka"],["SD","Sudan"],["SR","Suriname"],["SJ","Svalbard And Jan Mayen"],["SZ","Swaziland"],["SE","Sweden"],["CH","Switzerland"],["SY","Syrian Arab Republic"],["TW","Taiwan"],["TJ","Tajikistan"],["TZ","Tanzania"],["TH","Thailand"],["TL","Timor-Leste"],["TG","Togo"],["TK","Tokelau"],["TO","Tonga"],["TT","Trinidad And Tobago"],["TN","Tunisia"],["TR","Turkey"],["TM","Turkmenistan"],["TC","Turks And Caicos Islands"],["TV","Tuvalu"],["UG","Uganda"],["UA","Ukraine"],["AE","United Arab Emirates"],["GB","United Kingdom"],["US","United States"],["UM","United States Outlying Islands"],["UY","Uruguay"],["UZ","Uzbekistan"],["VU","Vanuatu"],["VE","Venezuela"],["VN","Viet Nam"],["VG","Virgin Islands, British"],["VI","Virgin Islands, U.S."],["WF","Wallis And Futuna"],["EH","Western Sahara"],["YE","Yemen"],["ZM","Zambia"],["ZW","Zimbabwe"]].map(e=>{let[a,s]=e;return{value:a,label:s}});var U=s(74054),V=s(5917),H=s(41808),G=s(86651);s(42475);let F=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(H.uB,{ref:a,className:(0,n.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...t})});F.displayName=H.uB.displayName;let z=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,l.jsx)(G.A,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,l.jsx)(H.uB.Input,{ref:a,className:(0,n.cn)("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...t})]})});z.displayName=H.uB.Input.displayName;let D=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(H.uB.List,{ref:a,className:(0,n.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...t})});D.displayName=H.uB.List.displayName;let Z=t.forwardRef((e,a)=>(0,l.jsx)(H.uB.Empty,{ref:a,className:"py-6 text-center text-sm",...e}));Z.displayName=H.uB.Empty.displayName;let Y=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(H.uB.Group,{ref:a,className:(0,n.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",s),...t})});Y.displayName=H.uB.Group.displayName,t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(H.uB.Separator,{ref:a,className:(0,n.cn)("-mx-1 h-px bg-border",s),...t})}).displayName=H.uB.Separator.displayName;let O=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(H.uB.Item,{ref:a,className:(0,n.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s),...t})});O.displayName=H.uB.Item.displayName;var K=s(36230);function $(e){let{options:a,value:s="",onValueChange:r,placeholder:i="Select option...",searchPlaceholder:o="Search...",emptyMessage:d="No option found.",className:u,disabled:m=!1}=e,[p,x]=t.useState(!1),h=a.find(e=>e.value===s),f=e=>{null==r||r(e===s?"":e),x(!1)};return(0,l.jsxs)(K.AM,{open:p,onOpenChange:x,children:[(0,l.jsx)(K.Wv,{asChild:!0,children:(0,l.jsxs)(c.$,{variant:"outline",role:"combobox","aria-expanded":p,className:(0,n.cn)("justify-between",u),disabled:m,children:[h?h.label:i,(0,l.jsx)(U.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,l.jsx)(K.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",children:(0,l.jsxs)(F,{children:[(0,l.jsx)(z,{placeholder:o,className:"h-9"}),(0,l.jsxs)(D,{children:[(0,l.jsx)(Z,{children:d}),(0,l.jsx)(Y,{children:a.map(e=>(0,l.jsxs)(O,{value:e.value,onSelect:f,keywords:[e.label,e.value],children:[e.label,(0,l.jsx)(V.A,{className:(0,n.cn)("ml-auto h-4 w-4",s===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function W(e){var a,s,n,r,o,d,u,m,p;let{billing:x,setIsUpdating:h,updateBilling:f}=e,[g,b]=t.useState(!1),j=(0,i.Ym)(),v=t.useRef(null);t.useEffect(()=>{if(v.current){let e=v.current.querySelector("input, textarea");e&&e.focus()}},[]);let[N,y]=t.useState({business_name:null!=(a=x.business_name)?a:"",tax_id:null!=(s=x.tax_id)?s:"",phone:null!=(n=x.phone)?n:"",address_apt:null!=(r=x.address_apt)?r:"",address_street:null!=(o=x.address_street)?o:"",address_city:null!=(d=x.address_city)?d:"",address_state:null!=(u=x.address_state)?u:"",address_country_code:null!=(m=x.address_country_code)?m:"",address_zip:null!=(p=x.address_zip)?p:""}),w=(e,a)=>{y(s=>({...s,[e]:a}))},_=async e=>{e.preventDefault();try{b(!0);let e={};N.business_name.trim()&&(e.business_name=N.business_name.trim()),N.phone.trim()&&(e.phone=N.phone.trim()),N.tax_id.trim()&&(e.tax_id=N.tax_id.trim()),N.address_street.trim()&&(e.address_street=N.address_street.trim()),N.address_apt.trim()&&(e.address_apt=N.address_apt.trim()),N.address_city.trim()&&(e.address_city=N.address_city.trim()),N.address_country_code.trim()&&(e.address_country_code=N.address_country_code.trim()),N.address_state.trim()&&(e.address_state=N.address_state.trim()),N.address_zip.trim()&&(e.address_zip=N.address_zip.trim()),await f(e),h(!1)}catch(e){console.error("Failed to update billing information:",e),e instanceof Error&&window.alert("Failed to update billing information: "+e.message)}finally{b(!1)}};return(0,l.jsxs)("form",{onSubmit:_,className:"space-y-4",ref:v,children:[(0,l.jsxs)("div",{className:"fs-saas-starter-billing-section__form flex flex-col gap-4",children:[(0,l.jsx)(T,{label:j.portal.billing.label.businessName(),value:(0,l.jsx)(R.p,{type:"text",value:N.business_name,onChange:e=>w("business_name",e.target.value),placeholder:"Enter business name"})}),(0,l.jsx)(T,{label:j.portal.billing.label.phone(),value:(0,l.jsx)(R.p,{type:"tel",value:N.phone,onChange:e=>w("phone",e.target.value),placeholder:"Enter phone number"})}),(0,l.jsx)(T,{label:j.portal.billing.label.tax(),value:(0,l.jsx)(R.p,{type:"text",value:N.tax_id,onChange:e=>w("tax_id",e.target.value),placeholder:"Enter tax ID"})}),(0,l.jsx)(T,{label:j.portal.billing.label.address(),value:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(R.p,{type:"text",value:N.address_street,onChange:e=>w("address_street",e.target.value),placeholder:"Street address"}),(0,l.jsx)(R.p,{type:"text",value:N.address_apt,onChange:e=>w("address_apt",e.target.value),placeholder:"Apartment, suite, etc. (optional)"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(R.p,{type:"text",value:N.address_city,onChange:e=>w("address_city",e.target.value),placeholder:"City",className:"flex-1"}),(0,l.jsx)(R.p,{type:"text",value:N.address_state,onChange:e=>w("address_state",e.target.value),placeholder:"State",className:"flex-1"})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(R.p,{type:"text",value:N.address_zip,onChange:e=>w("address_zip",e.target.value),placeholder:"ZIP/Postal code",className:"flex-1"}),(0,l.jsx)($,{options:B,value:N.address_country_code.toUpperCase(),onValueChange:e=>w("address_country_code",e),placeholder:"Select country",searchPlaceholder:"Search countries...",emptyMessage:"No country found.",className:"flex-1"})]})]})})]}),(0,l.jsxs)("div",{className:"mt-4 flex gap-4",children:[(0,l.jsxs)(c.$,{type:"submit",disabled:g,children:[g?(0,l.jsx)(C.A,{}):null,j.portal.billing.action.save()]}),(0,l.jsx)(c.$,{type:"button",variant:"outline",onClick:()=>h(!1),disabled:g,children:j.portal.billing.action.cancel()})]})]})}function q(e){var a,s,t,n,r;let{billing:o,user:d,setIsUpdating:u}=e,m=(0,i.Ym)(),p=[];return o.address_street&&p.push(o.address_street),o.address_apt&&p.push(o.address_apt),p.push("".concat(o.address_city?"".concat(o.address_city,", "):"").concat(null!=(a=o.address_state)?a:""," ").concat(null!=(s=o.address_zip)?s:""),o.address_country?o.address_country:""),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"fs-saas-starter-billing-section__details flex flex-col gap-4",children:[(0,l.jsx)(T,{label:m.portal.billing.label.businessName(),value:null!=(t=o.business_name)?t:""}),(0,l.jsx)(T,{label:m.portal.billing.label.phone(),value:(0,l.jsx)("code",{className:"font-mono tracking-wide",children:null!=(n=o.phone)?n:""})}),(0,l.jsx)(T,{label:m.portal.billing.label.tax(),value:(0,l.jsx)("code",{className:"font-mono tracking-widest",children:null!=(r=o.tax_id)?r:""})}),(0,l.jsx)(T,{label:m.portal.billing.label.address(),value:(0,l.jsx)("div",{className:"flex flex-col gap-1",children:p.map(e=>(0,l.jsx)("p",{children:e},e))})}),(0,l.jsx)(T,{label:m.portal.billing.label.account(),value:(0,l.jsxs)("strong",{className:"font-mono tracking-widest",children:["#",d.id]})})]}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(c.$,{variant:"outline",onClick:()=>u(!0),children:m.portal.billing.action.update()})})]})}function J(e){let[a,s]=t.useState(!1),n=(0,i.Ym)(),[o,d]=t.useState({...e.billing}),{execute:c}=(0,g.kb)(e.billing.updateUrl),u=async e=>{d(await c(e))};return(0,l.jsxs)("div",{className:"fs-saas-starter-billing-section",children:[(0,l.jsx)(r,{children:n.portal.billing.title()}),a?(0,l.jsx)(W,{billing:o,setIsUpdating:s,updateBilling:u}):(0,l.jsx)(q,{billing:o,user:e.user,setIsUpdating:s})]})}let Q=(0,t.forwardRef)((e,a)=>(0,l.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:
1a,...e,children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.65324 5.71456L9.6712 2.8H15.6633C16.6478 2.8 17.4466 3.59884 17.4466 4.5834V17.0102C17.4466 17.9947 16.6478 18.7936 15.6633 18.7936C15.6363 18.7936 15.6095 18.7957 15.5833 18.8H6.33674C5.3522 18.8 4.55334 18.0011 4.55334 17.0166V7.88C4.55334 7.87121 4.55353 7.86246 4.55389 7.85374H7.49627C8.6843 7.85374 9.64048 6.89566 9.65322 5.71689L9.65324 5.71456ZM9.64269 1.8C9.22202 1.8 8.81155 1.96747 8.51106 2.26784L4.0305 6.73907C3.71961 7.04205 3.55334 7.45483 3.55334 7.88V17.0166C3.55334 18.5534 4.79991 19.8 6.33674 19.8H15.6568C15.6861 19.8 15.7151 19.7974 15.7435 19.7924C17.2433 19.7499 18.4466 18.5202 18.4466 17.0102V4.5834C18.4466 3.04657 17.2001 1.8 15.6633 1.8H9.64269ZM10.8344 8.30919C11.1288 8.16411 11.2662 8.15634 11.3092 8.15777C11.325 8.19085 11.3528 8.27823 11.3512 8.4771C11.3486 8.81276 11.2579 9.31325 11.0553 9.99412C11.0261 10.0922 10.9948 10.1934 10.9613 10.2978C10.8216 10.0887 10.6956 9.8771 10.5955 9.66846C10.4199 9.30252 10.3605 9.01708 10.3912 8.81283C10.4157 8.64984 10.5063 8.47096 10.8344 8.30919ZM11.2986 8.14046C11.2987 8.14039 11.2994 8.14108 11.3006 8.14272C11.2992 8.14135 11.2986 8.14053 11.2986 8.14046ZM12.0138 10.2794C11.9236 10.5821 11.8156 10.9093 11.69 11.2602C11.7748 11.3635 11.858 11.4633 11.9374 11.5587L11.9383 11.5597C11.9892 11.6209 12.0386 11.6802 12.086 11.7375C12.2205 11.9002 12.382 12.1059 12.5628 12.3364L12.563 12.3366C12.7853 12.6201 13.037 12.9409 13.3042 13.2651C13.7208 13.2462 14.1445 13.2487 14.5392 13.2845C15.0868 13.3342 15.659 13.4541 16.0697 13.7369C16.2854 13.8853 16.4737 14.0907 16.5729 14.3664C16.6725 14.643 16.6637 14.9384 16.5763 15.2332C16.4798 15.5589 16.3171 15.8548 16.0416 16.0368C15.7523 16.228 15.4313 16.2337 15.1532 16.1621C14.8853 16.0931 14.6258 15.9465 14.3899 15.7784C14.1495 15.607 13.9065 15.3935 13.6704 15.1627C13.4024 14.9007 13.1294 14.6016 12.8659 14.296C12.3461 14.3406 11.862 14.4143 11.5125 14.4871C11.3476 14.5215 11.1532 14.5587 10.9385 14.5998L10.9385 14.5998C10.7057 14.6444 10.4491 14.6935 10.1799 14.7486C9.61306 15.8124 9.04832 16.5992 8.51117 17.0838C8.10506 17.4501 7.6379 17.7128 7.1437 17.6829C6.61171 17.6506 6.23076 17.2961 5.98747 16.8355C5.8315 16.5402 5.7737 16.2276 5.84148 15.9161C5.90745 15.613 6.08025 15.3666 6.28342 15.1716C6.67697 14.794 7.27756 14.5209 7.87766 14.3142C8.39399 14.1364 8.96686 13.99 9.50807 13.8695C9.71918 13.4466 9.93455 12.9749 10.1518 12.4534C10.3004 12.0968 10.4352 11.7599 10.5562 11.4429C10.2384 11.0299 9.91596 10.5638 9.69394 10.1011C9.48459 9.66487 9.32772 9.16038 9.4023 8.6642C9.48308 8.12675 9.81932 7.69469 10.3923 7.41224C10.8255 7.19869 11.3397 7.04259 11.7768 7.26638C12.2533 7.5103 12.3547 8.0426 12.3512 8.485C12.3474 8.96141 12.2253 9.56836 12.0138 10.2794ZM11.0749 12.838C11.1466 12.6659 11.2154 12.4978 11.2812 12.3336L11.3154 12.3748C11.4244 12.5067 11.5662 12.6874 11.7318 12.8986L11.7318 12.8986L11.7319 12.8987C11.8464 13.0446 11.9723 13.2051 12.1066 13.374C11.8036 13.4148 11.5308 13.4618 11.3086 13.5081C11.168 13.5374 10.9934 13.5708 10.7941 13.6088L10.7939 13.6089L10.7344 13.6202C10.8482 13.3703 10.9618 13.1095 11.0749 12.838ZM14.3694 14.4476C14.308 14.3876 14.2465 14.3257 14.185 14.2622C14.2746 14.2666 14.3627 14.2726 14.4488 14.2804C14.9541 14.3262 15.3113 14.4288 15.5027 14.5606C15.5882 14.6195 15.6192 14.6694 15.632 14.705C15.6446 14.7399 15.6582 14.812 15.6175 14.9491C15.5562 15.1559 15.4931 15.2007 15.4903 15.2025L15.4903 15.2025C15.4902 15.2027 15.4901 15.2033 15.484 15.204C15.4745 15.205 15.449 15.2056 15.4026 15.1937C15.3033 15.1681 15.159 15.0985 14.9703 14.9641C14.7862 14.8328 14.5837 14.6572 14.3694 14.4476ZM8.20332 15.2597C8.41069 15.1883 8.62726 15.1225 8.84741 15.0617C8.48513 15.6429 8.14511 16.0672 7.84132 16.3413C7.51223 16.6382 7.30173 16.6906 7.20424 16.6847C7.14453 16.6811 7.01975 16.6487 6.8717 16.3684C6.80686 16.2457 6.809 16.1729 6.81861 16.1288C6.83002 16.0763 6.86763 15.997 6.97579 15.8932C7.20488 15.6734 7.63055 15.457 8.20332 15.2597Z",fill:"currentColor"})})),X=(0,t.forwardRef)((e,a)=>(0,l.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:
1a,...e,children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.9375 3.35223C8.37532 3.35223 6.13231 4.7241 4.90508 6.77585H6.74229C7.1565 6.77585 7.49229 7.11164 7.49229 7.52585C7.49229 7.94007 7.1565 8.27585 6.74229 8.27585H3.42452C3.01031 8.27585 2.67452 7.94007 2.67452 7.52585V4.0845C2.67452 3.67028 3.01031 3.3345 3.42452 3.3345C3.83873 3.3345 4.17452 3.67028 4.17452 4.0845V5.18731C5.73217 3.1601 8.1816 1.85223 10.9375 1.85223C14.6552 1.85223 17.8152 4.23187 18.9811 7.54879C19.1184 7.93956 18.913 8.3677 18.5222 8.50505C18.1314 8.64241 17.7033 8.43697 17.5659 8.04619C16.6046 5.31116 13.9988 3.35223 10.9375 3.35223ZM17.5235 16.6658C17.5235 17.08 17.8593 17.4158 18.2735 17.4158C18.6877 17.4158 19.0235 17.08 19.0235 16.6658V13.2742C19.0235 12.86 18.6877 12.5242 18.2735 12.5242L15.0037 12.5242C14.5895 12.5242 14.2537 12.86 14.2537 13.2742C14.2537 13.6884 14.5895 14.0242 15.0037 14.0242L16.7929 14.0242C15.5657 16.0759 13.3227 17.4478 10.7605 17.4478C7.69917 17.4478 5.09342 15.4889 4.13208 12.7538C3.99473 12.3631 3.5666 12.1576 3.17582 12.295C2.78504 12.4323 2.5796 12.8605 2.71696 13.2512C3.88282 16.5681 7.0428 18.9478 10.7605 18.9478C13.5164 18.9478 15.9658 17.6399 17.5235 15.6127V16.6658ZM10.5288 9.45476V13.9313H11.7349V6.86882H10.5723V7.34689C10.5723 7.93362 10.1703 8.3465 9.5944 8.3465H9.13806V9.45476H10.5288Z",fill:"currentColor"})})),ee=(0,t.forwardRef)((e,a)=>(0,l.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,...e,children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.9375 3.35221C8.37532 3.35221 6.13231 4.72408 4.90508 6.77584H6.74229C7.1565 6.77584 7.49229 7.11162 7.49229 7.52584C7.49229 7.94005 7.1565 8.27584 6.74229 8.27584H3.42452C3.01031 8.27584 2.67452 7.94005 2.67452 7.52584V4.08448C2.67452 3.67027 3.01031 3.33448 3.42452 3.33448C3.83873 3.33448 4.17452 3.67027 4.17452 4.08448V5.18729C5.73217 3.16009 8.1816 1.85221 10.9375 1.85221C14.6552 1.85221 17.8152 4.23186 18.9811 7.54877C19.1184 7.93955 18.913 8.36768 18.5222 8.50504C18.1314 8.64239 17.7033 8.43695 17.5659 8.04618C16.6046 5.31114 13.9988 3.35221 10.9375 3.35221ZM17.5235 16.6658C17.5235 17.08 17.8593 17.4158 18.2735 17.4158C18.6877 17.4158 19.0235 17.08 19.0235 16.6658V13.2741C19.0235 12.8599 18.6877 12.5241 18.2735 12.5241L15.0037 12.5241C14.5895 12.5241 14.2537 12.8599 14.2537 13.2741C14.2537 13.6884 14.5895 14.0241 15.0037 14.0241L16.7929 14.0241C15.5657 16.0759 13.3227 17.4478 10.7605 17.4478C7.69917 17.4478 5.09342 15.4888 4.13208 12.7538C3.99473 12.363 3.5666 12.1576 3.17582 12.295C2.78504 12.4323 2.5796 12.8604 2.71696 13.2512C3.88282 16.5681 7.0428 18.9478 10.7605 18.9478C13.5164 18.9478 15.9658 17.6399 17.5235 15.6127V16.6658ZM11.3497 6.3874C11.3497 6.11126 11.1258 5.8874 10.8497 5.8874C10.5735 5.8874 10.3497 6.11126 10.3497 6.3874V7.42823C9.4782 7.52588 8.80663 8.25988 8.80663 9.1586C8.80663 10.1244 9.58222 10.9 10.548 10.9H11.1499C11.5634 10.9 11.8913 11.2279 11.8913 11.6414C11.8913 12.0549 11.5634 12.3828 11.1499 12.3828H9.03076C8.75462 12.3828 8.53076 12.6067 8.53076 12.8828C8.53076 13.1589 8.75462 13.3828 9.03076 13.3828H10.3497V14.4126C10.3497 14.6888 10.5735 14.9126 10.8497 14.9126C11.1258 14.9126 11.3497 14.6888 11.3497 14.4126V13.3716C12.2205 13.2733 12.8913 12.5396 12.8913 11.6414C12.8913 10.6756 12.1157 9.9 11.1499 9.9H10.548C10.1345 9.9 9.80663 9.57212 9.80663 9.1586C9.80663 8.74507 10.1345 8.4172 10.548 8.4172H10.8473L10.8497 8.4172L10.8521 8.4172H12.6672C12.9433 8.4172 13.1672 8.19334 13.1672 7.9172C13.1672 7.64105 12.9433 7.4172 12.6672 7.4172H11.3497V6.3874Z",fill:"currentColor"})})),ea=(0,t.forwardRef)((e,a)=>(0,l.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,...e,children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0712 2.96664C8.56813 2.96664 7.34961 4.18516 7.34961 5.68828V5.73837H12.7929V5.68828C12.7929 4.18516 11.5744 2.96664 10.0712 2.96664ZM6.34961 7.76059V6.73837H4.82549C4.56869 6.73837 4.35365 6.93291 4.32799 7.18843L3.30111 17.417C3.27155 17.7114 3.50272 17.9
1669 3.79861 17.9669H16.359C16.6521 17.9669 16.8824 17.7159 16.8571 17.4238L15.9712 7.19523C15.9488 6.93678 15.7324 6.73837 15.473 6.73837H13.7929V7.76059C13.7929 8.03673 13.569 8.26059 13.2929 8.26059C13.0167 8.26059 12.7929 8.03673 12.7929 7.76059V6.73837H7.34961V7.76059C7.34961 8.03673 7.12575 8.26059 6.84961 8.26059C6.57347 8.26059 6.34961 8.03673 6.34961 7.76059ZM6.34961 5.68828V5.73837H4.82549C4.05509 5.73837 3.40995 6.32199 3.333 7.08854L2.30611 17.3171C2.21744 18.2003 2.91094 18.9669 3.79861 18.9669H16.359C17.2385 18.9669 17.9293 18.2137 17.8534 17.3375L16.9674 7.10894C16.9003 6.33358 16.2513 5.73837 15.473 5.73837H13.7929V5.68828C13.7929 3.63288 12.1266 1.96664 10.0712 1.96664C8.01584 1.96664 6.34961 3.63288 6.34961 5.68828ZM6.5154 13.4777C5.95745 12.9198 5.95857 12.0187 6.51586 11.458C7.06731 10.907 7.86851 10.8933 8.50867 11.4298C8.85543 11.7204 9.23005 12.1967 9.64893 12.7377L9.69239 12.7939L9.6924 12.7939C10.0776 13.2917 10.502 13.8402 10.9242 14.2081C11.89 15.0517 13.3624 15.1552 14.3328 14.1848C15.2826 13.2351 15.2826 11.7012 14.3328 10.7514C13.3835 9.8021 11.8449 9.80071 10.8983 10.7522L10.7451 10.9129C10.5545 11.1128 10.562 11.4293 10.7619 11.6198C10.9617 11.8104 11.2782 11.8029 11.4688 11.603L11.6108 11.4541C12.1658 10.9 13.0671 10.8999 13.6257 11.4585C14.1849 12.0177 14.1849 12.9185 13.6257 13.4777C13.0871 14.0163 12.2179 14.0106 11.5813 13.4543C11.2342 13.1519 10.8603 12.6689 10.4407 12.1269L10.4407 12.1269L10.4381 12.1235C10.0406 11.6102 9.59711 11.0373 9.15104 10.6634C8.1579 9.83103 6.76585 9.79381 5.80829 10.7514L5.80738 10.7523C4.86386 11.7007 4.85735 13.2339 5.80829 14.1848C6.75807 15.1346 8.29199 15.1346 9.24176 14.1848L9.24784 14.1788L9.3952 14.0209C9.58364 13.8191 9.57276 13.5027 9.3709 13.3142C9.16904 13.1258 8.85265 13.1367 8.66421 13.3385L8.52901 13.4834C7.96936 14.037 7.07277 14.0351 6.5154 13.4777Z",fill:"currentColor"})})),es=(0,t.forwardRef)((e,a)=>(0,l.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,...e,children:[(0,l.jsx)("g",{clipPath:"url(#clip0_653_3226)",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8517 1.4811C10.8517 1.28128 10.7328 1.10064 10.5492 1.02174C10.3656 0.942827 10.1527 0.980798 10.0077 1.1183L5.58093 5.31635C5.48235 5.40984 5.42606 5.53941 5.425 5.67526C5.42395 5.81111 5.47822 5.94155 5.57533 6.03656L6.81101 7.24546C4.85215 8.41209 3.53979 10.5511 3.53979 12.9966C3.53979 16.6908 6.53456 19.6856 10.2288 19.6856C10.258 19.6856 10.2873 19.6854 10.3164 19.685C10.335 19.6868 10.354 19.6876 10.3731 19.6873C12.4264 19.6544 14.2792 18.9626 15.6198 17.6046C16.9622 16.2447 17.7442 14.2642 17.7442 11.7434C17.7442 8.5166 16.1147 6.38855 14.4041 5.07228C13.5519 4.41659 12.6763 3.95851 11.9617 3.65741C11.5304 3.4757 11.1459 3.34625 10.8517 3.26564V1.4811ZM7.55531 7.97363L9.66114 10.0338C8.82314 10.1612 8.18645 10.8801 8.18645 11.7552C8.18645 12.721 8.96204 13.4966 9.92785 13.4966H10.5297C10.9433 13.4966 11.2711 13.8244 11.2711 14.238C11.2711 14.6515 10.9433 14.9794 10.5297 14.9794H8.41058C8.13444 14.9794 7.91058 15.2032 7.91058 15.4794C7.91058 15.7555 8.13444 15.9794 8.41058 15.9794H9.72951V17.0092C9.72951 17.2853 9.95337 17.5092 10.2295 17.5092C10.5057 17.5092 10.7295 17.2853 10.7295 17.0092V15.9682C11.6003 15.8699 12.2711 15.1362 12.2711 14.238C12.2711 13.2722 11.4955 12.4966 10.5297 12.4966H9.92785C9.51433 12.4966 9.18645 12.1687 9.18645 11.7552C9.18645 11.3416 9.51433 11.0138 9.92785 11.0138H10.2269L10.2295 11.0138L10.2321 11.0138H12.047C12.3231 11.0138 12.547 10.7899 12.547 10.5138C12.547 10.2376 12.3231 10.0138 12.047 10.0138H10.8559V8.24116C10.9043 8.25919 10.955 8.27887 11.0078 8.30027C11.3907 8.45541 11.871 8.696 12.3586 9.03939C13.3334 9.7259 14.3137 10.8047 14.6428 12.4216C14.9558 13.9594 14.7557 15.5272 14.0515 16.699C13.5827 17.479 12.8805 18.1025 11.9137 18.4319C11.3812 18.5968 10.8154 18.6856 10.2288 18.6856C7.08684 18.6856 4.53979 16.1385 4.53979 12.9966C4.53979 10.821 5.761 8.93065 7.55531 7.97363Z",fill:"currentColor"})}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_653_3226",children:(0,l.jsx)("rect",{width:20,height:20,fill:"white",transform:"translate(0.626831 0.333332)"})})})]}));function el(e){let{type:a,occurance:s}=e,n=(0,i.Ym)(),r=(0,t.useMemo)(()=>{switch(a){case"chargeback":case"lost_dispute":case"won_dispute":case"disputed":return"destructive";case"refund":return"outline";default:return"secondary"}}
1,[a]);return(0,l.jsxs)(k.E,{variant:r,className:"fs-saas-starter-payment-badge",title:"payment"===a?n.portal.payments.type[s]():void 0,children:["refund"===a?(0,l.jsx)(es,{}):"payment"!==a?null:"first"===s?(0,l.jsx)(X,{}):"renewal"===s?(0,l.jsx)(ee,{}):(0,l.jsx)(ea,{}),n.paymentBadge(a)]})}var et=s(90368),en=s(27937),er=s(37772);let ei=e=>{let{className:a,...s}=e;return(0,l.jsx)("nav",{role:"navigation","aria-label":"pagination",className:(0,n.cn)("mx-auto flex w-full justify-center",a),...s})};ei.displayName="Pagination";let eo=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)("ul",{ref:a,className:(0,n.cn)("flex flex-row items-center gap-1",s),...t})});eo.displayName="PaginationContent";let ed=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)("li",{ref:a,className:(0,n.cn)("",s),...t})});ed.displayName="PaginationItem";let ec=e=>{let{className:a,isActive:s,size:t="icon",...r}=e;return(0,l.jsx)("a",{"aria-current":s?"page":void 0,className:(0,n.cn)((0,c.r)({variant:s?"outline":"ghost",size:t}),a),...r})};ec.displayName="PaginationLink";let eu=e=>{let{className:a,...s}=e;return(0,l.jsxs)(ec,{"aria-label":"Go to previous page",size:"default",className:(0,n.cn)("gap-1 ps-2.5",a),...s,children:[(0,l.jsx)(et.A,{className:"h-4 w-4"}),(0,l.jsx)("span",{children:"Previous"})]})};eu.displayName="PaginationPrevious";let em=e=>{let{className:a,...s}=e;return(0,l.jsxs)(ec,{"aria-label":"Go to next page",size:"default",className:(0,n.cn)("gap-1 pe-2.5",a),...s,children:[(0,l.jsx)("span",{children:"Next"}),(0,l.jsx)(en.A,{className:"h-4 w-4"})]})};em.displayName="PaginationNext";let ep=e=>{let{className:a,...s}=e;return(0,l.jsxs)("span",{"aria-hidden":!0,className:(0,n.cn)("flex h-9 w-9 items-center justify-center",a),...s,children:[(0,l.jsx)(er.A,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"sr-only",children:"More pages"})]})};ep.displayName="PaginationEllipsis";let ex=(0,t.memo)(function(e){let{currentPage:a,totalPages:s,onPageChange:t,maxVisiblePages:n=5}=e,r=[],i=Math.max(1,a-Math.floor(n/2)),o=Math.min(s,i+n-1);o-i+1<n&&(i=Math.max(1,o-n+1)),i>1&&(r.push((0,l.jsx)(ed,{children:(0,l.jsx)(ec,{onClick:()=>t(1),isActive:1===a,children:"1"})},"1")),i>2&&r.push((0,l.jsx)(ed,{children:(0,l.jsx)(ep,{})},"ellipsis-start")));for(let e=i;e<=o;e++)r.push((0,l.jsx)(ed,{children:(0,l.jsx)(ec,{onClick:()=>t(e),isActive:a===e,children:e})},e));return o<s&&(o<s-1&&r.push((0,l.jsx)(ed,{children:(0,l.jsx)(ep,{})},"ellipsis-end")),r.push((0,l.jsx)(ed,{children:(0,l.jsx)(ec,{onClick:()=>t(s),isActive:a===s,children:s})},s))),(0,l.jsx)(l.Fragment,{children:r})});function eh(e){let{items:a,children:s,getKey:n,perPage:r=10,renderContainer:i}=e,[o,d]=(0,t.useState)(1);(0,t.useEffect)(()=>{d(1)},[a,r,d]);let c=Math.ceil(a.length/r),u=(o-1)*r,m=a.slice(u,u+r),p=(0,t.useCallback)(e=>{d(e)},[d]);return 0===a.length?null:(0,l.jsxs)("div",{className:"fs-saas-starter-paginated-list",children:[i?i((0,l.jsx)(l.Fragment,{children:m.map(e=>(0,l.jsx)(t.Fragment,{children:s(e)},n(e)))})):(0,l.jsx)("div",{children:m.map(e=>(0,l.jsx)("div",{children:s(e)},n(e)))}),c>1&&(0,l.jsx)(ei,{className:"mt-8 justify-end",children:(0,l.jsxs)(eo,{children:[(0,l.jsx)(ed,{children:(0,l.jsx)(eu,{onClick:()=>p(Math.max(1,o-1)),className:1===o?"pointer-events-none opacity-50":"cursor-pointer"})}),(0,l.jsx)(ex,{currentPage:o,totalPages:c,onPageChange:p}),(0,l.jsx)(ed,{children:(0,l.jsx)(em,{onClick:()=>p(Math.min(c,o+1)),className:o===c?"pointer-events-none opacity-50":"cursor-pointer"})})]})})]})}function ef(e){let{payments:a}=e,s=(0,i.Ym)();return(0,l.jsxs)("div",{className:"fs-saas-starter-payments-section",children:[(0,l.jsx)(r,{children:s.portal.payments.title()}),(0,l.jsx)(eh,{items:a,getKey:e=>e.id,renderContainer:e=>(0,l.jsx)("div",{className:"fs-saas-starter-payments-section__details grid lg:grid-cols-[150px_100px_auto_auto_auto] gap-x-10 gap-y-8 items-center",children:e}),children:a=>(0,l.jsxs)("div",{className:"fs-saas-starter-payments-section__payment grid items-center col-span-full grid-cols-[auto_auto_auto] grid-rows-2 gap-2 lg:grid-cols-subgrid lg:grid-rows-1 lg:gap-6",children:[(0,l.jsxs)("div",{className:"fs-saas-starter-payments-section__date flex gap-1 items-center",children:[(0,l.jsx)(P,{method:a.paymentMethod}),(0,l.jsx)("span",{className:"fs-saas-starter-payments-section__date-value ml-2",children:(0,d.Yq)(a.createdAt,s.code,!1)})]}),(0,l.jsx)("div",{className:"fs-saas-starter-payments-section__amount tabular-nums text-right",children:(0,d.vv)(a.gross,a.currency,s.code)}),(0,l.jsx)("div",{className:"fs-saas-starter-payments-section__badge ml-auto lg:ml-0",children:(0,l.jsx)(el,{type:a.type,occurance:a.subscription_id?a.is_renewal?"renewal":"first":"oneoff"})}),(0,l.jsxs)("div",{className:"fs-saas-starter-payments-section__plan col-span-2 lg:col-span-1",children:[a.planTitle," ",a.quota&&a.quota>1?(0,l.jsx)("span",{className:"text-disabled-foreground text-xs font-semibold",children:s.portal.payments.pricingTitle((0,d.ZV)(a.quota,s.code),a.quota,e.unit)}):null]}),(0,l.jsx)("div",{className:"fs-saas-starter-payments-section__download ml-auto",children:(0,l.jsx)(c.$,{variant:"outline",size:"sm",asChild:!0,children:(0,l.jsxs)("a",{href:a.invoiceUrl,target:"_blank",rel:"noopener noreferrer",children:[(0,l.jsx)(Q,{}),s.portal.payments.action.downloadInvoice()]})})})]},a.id)})]})}var eg=s(29214),eC=s(62264);let eb=(0,t.forwardRef)((e,a)=>(0,l.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:
1a,...e,children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.66547 2.346C3.66547 1.93179 3.32968 1.596 2.91547 1.596C2.50126 1.596 2.16547 1.93179 2.16547 2.346V7.88647C2.16547 8.30069 2.50126 8.63647 2.91547 8.63647H8.44701C8.86123 8.63647 9.19701 8.30069 9.19701 7.88647C9.19701 7.47226 8.86123 7.13647 8.44701 7.13647H4.31842C5.67127 4.85539 8.15383 3.32815 10.9963 3.32815C14.0985 3.32815 16.8921 5.23119 18.0965 7.95331C18.2641 8.33211 18.7071 8.50331 19.0859 8.33572C19.4646 8.16812 19.6359 7.72518 19.4683 7.34639C18.0297 4.09498 14.7069 1.82815 10.9963 1.82815C8.00917 1.82815 5.35764 3.24157 3.66547 5.43302V2.346ZM2.61201 12.4643C2.9908 12.2967 3.43374 12.4679 3.60134 12.8467C4.80565 15.5686 7.5947 17.4674 10.6971 17.4674C13.5401 17.4674 16.0223 15.9434 17.3749 13.6635H13.2464C12.8322 13.6635 12.4964 13.3277 12.4964 12.9135C12.4964 12.4993 12.8322 12.1635 13.2464 12.1635H18.7779C19.1922 12.1635 19.5279 12.4993 19.5279 12.9135V18.454C19.5279 18.8682 19.1922 19.204 18.7779 19.204C18.3637 19.204 18.0279 18.8682 18.0279 18.454V15.3665C16.3355 17.5572 13.6838 18.9674 10.6971 18.9674C6.98671 18.9674 3.66829 16.7052 2.22961 13.4536C2.06201 13.0748 2.23322 12.6319 2.61201 12.4643Z",fill:"currentColor"})}));function ej(e){let{portalEndpoint:a,onRestored:s,onError:t}=e,{isLoading:n,refetch:r}=(0,g.tk)(a),o=(0,i.Ym)(),d=async()=>{try{await r(s)}catch(e){null==t||t(e)}};return(0,l.jsx)(c.$,{onClick:d,disabled:n,variant:"outline",children:n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C.A,{className:"w-4 h-4 mr-2"}),o.refreshPurchase.action.restoring()]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eb,{className:"w-4 h-4 mr-2"}),o.refreshPurchase.action.restore()]})})}var ev=s(12284);let eN=(0,t.createContext)(null);var ey=s(61962);function ew(e){let{endpoint:a}=e,s=(0,t.useContext)(w.gF),{data:n,error:r,isLoading:o,refetch:d}=(0,g.UK)(a),c=(0,i.Ym)(),u=t.useCallback(e=>{e&&e.length>0?(window.alert(c.refreshPurchase.alert.restored(e.length)),d()):window.alert(c.refreshPurchase.alert.nothingToRestore())},[d,c]),m=t.useCallback(()=>{d()},[d]),p=t.useMemo(()=>({endpoint:a}),[a]);if(!s)throw Error("CustomerPortal must be used within a CheckoutProvider");return r?(0,l.jsxs)("div",{className:"text-center text-destructive",children:[c.portal.error.fetchingData(),": ",r.message]}):(0,l.jsx)(eN.Provider,{value:p,children:(0,l.jsx)(ev.s,{onAfterSync:m,endpoint:s.endpoint,checkout:s.serializedData,children:o||void 0===n?(0,l.jsx)(eM,{}):n?(0,l.jsx)(eS,{portalData:n,refresh:d}):(0,l.jsx)(e_,{endpoint:a,onSubscribe:d,onRestore:u})})})}function e_(e){let{endpoint:a,onSubscribe:s,onRestore:t}=e,n=(0,i.Ym)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"max-w-[65ch] text-center mx-auto",children:[(0,l.jsx)("h2",{className:"mb-2 text-lg font-semibold",children:n.portal.subscribe.title()}),(0,l.jsx)("p",{className:"mb-10",children:n.portal.subscribe.message()})]}),(0,l.jsx)(eC.Subscribe,{onCheckout:s}),(0,l.jsxs)("div",{className:"mt-10 max-w-[65ch] mx-auto text-center",children:[(0,l.jsx)("p",{className:"text-muted-foreground mb-5",children:n.portal.empty.message.restore()}),(0,l.jsx)(ej,{portalEndpoint:a,onRestored:t})]})]})}function eS(e){let{portalData:a,refresh:s}=e,t=(0,i.Ym)();return(0,l.jsxs)("div",{className:"fs-saas-starter-portal flex flex-col gap-16",children:[a.subscriptions.primary?(0,l.jsx)(L,{subscription:a.subscriptions.primary,plans:a.plans,sellingUnit:a.sellingUnit,cancellationCoupons:a.cancellationCoupons,afterCancel:s,afterCouponApplied:s}):null,a.subscriptions.primary&&!a.subscriptions.primary.isActive?(0,l.jsxs)("div",{children:[(0,l.jsx)(r,{children:t.portal.subscribe.title()}),(0,l.jsx)(ey.n,{plans:a.plans})]}):null,a.billing?(0,l.jsx)(J,{billing:a.billing,user:a.user}):null,a.payments&&a.payments.length>0?(0,l.jsx)(ef,{payments:a.payments,unit:a.sellingUnit}):null]})}function eM(){return(0,l.jsxs)("div",{className:"fs-saas-starter-portal flex flex-col gap-16",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)("div",{className:"border-b border-b-muted border-solid mb-2 pb-4 w-full",children:(0,l.jsx)(eg.E,{className:"h-6 w-50 max-w-full"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(eg.E,{className:"h-7 w-50 max-w-full"})," ",(0,l.jsx)(eg.E,{className:"h-10 w-70 max-w-full"})," "]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(eg.E,{className:"h-8 w-40 max-w-full"})," ",(0,l.jsx)(eg.E,{className:"h-8 w-40 max-w-full"})," "]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 mt-4",children:[(0,l.jsx)(eg.E,{className:"h-4 w-70 max-w-full"})," ",(0,l.jsx)(eg.E,{className:"h-7 w-150 mt-4 max-w-full"})," "]})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)("div",{className:"border-b border-b-muted border-solid mb-2 pb-4 w-full",children:(0,l.jsx)(eg.E,{className:"h-6 w-48"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[[1,2,3,4].map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-[200px_1fr] gap-1 md:gap-2 items-start",children:[(0,l.jsx)(eg.E,{className:"h-4 w-24"}),(0,l.jsx)(eg.E,{className:"h-4 w-48"})]},e)),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-[200px_1fr] gap-1 md:gap-2 items-start",children:[(0,l.jsx)(eg.E,{className:"h-4 w-24"}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(eg.E,{className:"h-4 w-56"}),(0,l.jsx)(eg.E,{className:"h-4 w-40"})]})]})]}),(0,l.jsx)(eg.E,{className:"h-8 w-40"})," "]}),(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)("div",{className:"border-b border-b-muted border-solid mb-4 pb-4 w-full",children:(0,l.jsx)(eg.E,{className:"h-6 w-48"})}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:[...Array(9)].map((e,a)=>(0,l.jsxs)("div",{className:"flex items-center gap-4 py-1",children:[(0,l.jsx)(eg.E,{className:"h-4 w-4"})," ",(0,l.jsx)(eg.E,{className:"h-4 w-24"})," ",(0,l.jsx)(eg.E,{className:"h-4 w-16"})," ",(0,l.jsx)(eg.E,{className:"h-6 w-16"})," ",(0,l.jsx)(eg.E,{className:"h-4 w-32"})," ",(0,l.jsx)(eg.E,{className:"h-4 w-20"})," ",(0,l.jsx)(eg.E,{className:"h-8 w-16 ml-auto"})," "]},a))})]})]})}},36230:(e,a,s)=>{"use strict";s.d(a,{AM:()=>i,Wv:()=>
1o,dT:()=>d,hl:()=>c});var l=s(95155),t=s(12115),n=s(31138),r=s(25016);let i=n.bL,o=n.l9,d=n.Mz,c=t.forwardRef((e,a)=>{let{className:s,align:t="center",sideOffset:i=4,...o}=e;return(0,l.jsx)(n.ZL,{children:(0,l.jsx)(n.UC,{ref:a,align:t,sideOffset:i,className:(0,r.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...o})})});c.displayName=n.UC.displayName},42409:(e,a,s)=>{"use strict";s.d(a,{Aw:()=>d,Pc:()=>u,Rs:()=>i,U5:()=>o,be:()=>m,default:()=>p,o7:()=>c});var l=s(95155),t=s(12115),n=s(29698),r=s(20063);let i=(0,t.createContext)({user:n.so,setCurrentUser:void 0}),o=(0,t.createContext)({topics:{choices:[],max:!1,selected:null},setTopicsData:void 0}),d=(0,t.createContext)({users:{choices:{},max:!1},setUsersData:e=>{}}),c=(0,t.createContext)({search:{query:"",activeSearch:!1},setSearch:null}),u=(0,t.createContext)({eventsData:null,setEventsData:null}),m=(0,t.createContext)({entitlement:null,setEntitlementData:null});function p(e){let{currentUser:a,loadedTopics:s,loadedUsers:n,children:p,loadedEntitlement:x}=e,[h,f]=(0,t.useState)(s),[g,C]=(0,t.useState)(n),[b,j]=(0,t.useState)(a),[v,N]=(0,t.useState)(x),y=(0,r.useSearchParams)().get("search"),[w,_]=(0,t.useState)({query:y||"",activeSearch:!1}),[S,M]=(0,t.useState)({events:{},nonce:"test"});return(0,l.jsx)(u.Provider,{value:{eventsData:S,setEventsData:M},children:(0,l.jsx)(i.Provider,{value:{user:b,setCurrentUser:j},children:(0,l.jsx)(m.Provider,{value:{entitlement:v,setEntitlementData:N},children:(0,l.jsx)(o.Provider,{value:{topics:h,setTopicsData:f},children:(0,l.jsx)(d.Provider,{value:{users:g,setUsersData:C},children:(0,l.jsx)(c.Provider,{value:{search:w,setSearch:_},children:p})})})})})})}},42475:(e,a,s)=>{"use strict";s.d(a,{Cf:()=>m,Es:()=>x,L3:()=>h,c7:()=>p,lG:()=>o,zM:()=>d});var l=s(95155);s(12115);var t=s(93409),n=s(25016),r=s(33431),i=s(65229);function o(e){let{...a}=e;return(0,l.jsx)(t.bL,{"data-slot":"dialog",...a})}function d(e){let{...a}=e;return(0,l.jsx)(t.l9,{"data-slot":"dialog-trigger",...a})}function c(e){let{...a}=e;return(0,l.jsx)(t.ZL,{"data-slot":"dialog-portal",...a})}function u(e){let{className:a,...s}=e;return(0,l.jsx)(t.hJ,{"data-slot":"dialog-overlay",className:(0,n.cn)("data-open:animate-in overflow-auto data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/30 duration-100 backdrop-blur-sm fixed grid place-items-center inset-0 isolate z-[10000]",a),...s})}function m(e){let{className:a,children:s,showCloseButton:o=!0,...d}=e;return(0,l.jsx)(c,{children:(0,l.jsx)(u,{children:(0,l.jsxs)(t.UC,{"data-slot":"dialog-content",className:(0,n.cn)("bg-background overflow-auto data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm z-[50000] w-full",a),...d,children:[s,o&&(0,l.jsx)(t.bm,{"data-slot":"dialog-close",asChild:!0,children:(0,l.jsxs)(r.$,{variant:"ghost",className:"absolute top-2 end-2",size:"icon",children:[(0,l.jsx)(i.A,{}),(0,l.jsx)("span",{className:"sr-only",children:"Close"})]})})]})})})}function p(e){let{className:a,...s}=e;return(0,l.jsx)("div",{"data-slot":"dialog-header",className:(0,n.cn)("gap-2 flex flex-col",a),...s})}function x(e){let{className:a,showCloseButton:s=!1,children:i,...o}=e;return(0,l.jsxs)("div",{"data-slot":"dialog-footer",className:(0,n.cn)("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...o,children:[i,s&&(0,l.jsx)(t.bm,{asChild:!0,children:(0,l.jsx)(r.$,{variant:"outline",children:"Close"})})]})}function h(e){let{className:a,...s}=e;return(0,l.jsx)(t.hE,{"data-slot":"dialog-title",className:(0,n.cn)("text-base leading-none font-medium",a),...s})}},55756:(e,a,s)=>{Promise.resolve().then(s.bind(s,62307)),Promise.resolve().then(s.bind(s,89400)),Promise.resolve().then(s.bind(s,64707)),Promise.resolve().then(s.bind(s,3809)),Promise.resolve().then(s.bind(s,18720)),Promise.resolve().then(s.bind(s,31008))},71537:(e,a,s)=>{"use strict";s.d(a,{p:()=>r});var l=s(95155),t=s(12115),n=s(25016);let r=t.forwardRef((e,a)=>{let{className:s,type:t,...r}=e;return(0,l.jsx)("input",{type:t,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:a,...r})});r.displayName="Input"},86504:(e,a,s)=>{"use strict";s.d(a,{S:()=>o});var l=s(95155),t=s(12115),n=s(38162),r=s(5917),i=s(25016);let o=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,l.jsx)(n.bL,{ref:a,className:(0,i.cn)("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...t,children:(0,l.jsx)(n.C1,{className:(0,i.cn)("grid place-content-center text-current"),children:(0,l.jsx)(r.A,{className:"h-4 w-4"})})})});o.displayName=n.bL.displayName},89400:(e,a,s)=>{"use strict";s.d(a,{default:()=>c});var l=s(95155),t=s(78661),n=s(33431),r=s(63354),i=s(42409),o=s(12115),d=s(25016);function c(){let{preselect:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{entitlement:a}=(0,o.useContext)(i.be),{user:s,setCurrentUser:c}=(0,o.useContext)(i.Rs),u=null==a?void 0:a.fs_license_id,m=(0,r.Q5)();return(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-center text-sm text-muted-foreground mb-4 max-w-2xl mx-auto",children:"Free and Voter accounts can post Story Frames, but they only show up on your own page â share the link to let others see them. Only Influencer accounts publish Story Frames to public feeds and search results."}),(0,l.jsx)("div",{className:"flex gap-6 justify-center p-8",children:[{name:"Free",price:"$0",features:["Basic analytics","Up to 50 votes/month","Community support","Post Story Frames to your own page only"],role:"subscriber"},{name:"Voter",price:"$2.50",features:["Advanced analytics","Unlimited votes","Priority support","Custom branding","Post Story Frames to your own page only"],role:"contributor"},{name:"Influencer",price:"$8.33",features:["Expert analytics","Unlimited votes","Expert support","Custom branding","Team collaboration","Publish Story Frames to public feeds & search"],role:"author"}].map(a=>(0,l.jsxs)(t.Zp,{className:(0,d.cn)("w-80 flex flex-col justify-between",e===a.role&&"border-primary border-2"),children:[(0,l.jsx)(t.aR,{children:(0,l.jsxs)(t.ZB,{children:[a.name," ",e===a.role&&(0,l.jsx)("span",{className:"text-sm text-primary font-normal",children:"(Recommended)"})]})}),(0,l.jsx)(t.Wu,{children:(0,l.jsxs)("div",{className:"flex flex-col justify-stretch min-h-[200px]",children:[(0,l.jsx)("div",{className:"text-3xl font-bold mb-4",children:a.price}),(0,l.jsx)("ul",{className:"space-y-2",children:a.features.map(e=>(0,l.jsxs)("li",{className:"text-sm",children:["â ",e]},e))})]})}),(0,l.jsx)(t.wL,{className:"text-center text-sm text-muted-foreground",children:(0,l.jsxs)(n.$,{onClick:()=>(e=>{if("Free"===e.name)return void alert("You have selected the Free plan!");let a="Voter"==e.name?"39279":"38795";m.open({plan_id:a,license_id:u,user_email:(null==s?void 0:s.email)||"",purchaseCompleted:function(e){console.log("Purchase Successful",e),window.location.href="/dashboard?licensed=true";let s="39279"===a?"contributor":"author";c&&c(e=>e?{...e,role:s}:e)}})})(a),variant:"outline",className:"w-full mt-6",children:[(null==s?void 0:s.role)===a.role&&(0,l.jsx)("p",{className:"text-green-500 me-3",children:"â "})," Choose Plan"]})})]},a.name))})]})}}},e=>{e.O(0,[9268,8720,2619,4707,1474,4579,1359,5779,1417,7295,1159,251,1610,8441,783,7358],()=>e(e.s=55756)),_N_E=e.O()}]);
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.