@sudobility/subscription-components 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +22 -22
- package/dist/index.umd.js +1 -1
- package/dist/subscription-tile.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2815,8 +2815,8 @@ const Lt = {
|
|
|
2815
2815
|
{
|
|
2816
2816
|
className: C(
|
|
2817
2817
|
"relative rounded-2xl p-6 transition-all flex flex-col h-full",
|
|
2818
|
-
// Add extra bottom padding for radio button
|
|
2819
|
-
|
|
2818
|
+
// Add extra bottom padding for radio button or CTA button
|
|
2819
|
+
P ? "pb-20" : "pb-14",
|
|
2820
2820
|
w ? "opacity-50 cursor-not-allowed" : P ? "cursor-default" : "cursor-pointer",
|
|
2821
2821
|
v,
|
|
2822
2822
|
I
|
|
@@ -2962,28 +2962,28 @@ const Lt = {
|
|
|
2962
2962
|
),
|
|
2963
2963
|
children: y
|
|
2964
2964
|
}
|
|
2965
|
+
),
|
|
2966
|
+
k && /* @__PURE__ */ g(
|
|
2967
|
+
"div",
|
|
2968
|
+
{
|
|
2969
|
+
className: C(
|
|
2970
|
+
"p-3 rounded-lg mt-auto",
|
|
2971
|
+
n ? "bg-blue-500/30" : "bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800"
|
|
2972
|
+
),
|
|
2973
|
+
children: /* @__PURE__ */ g(
|
|
2974
|
+
"p",
|
|
2975
|
+
{
|
|
2976
|
+
className: C(
|
|
2977
|
+
"text-sm font-semibold text-center",
|
|
2978
|
+
n ? "text-white" : "text-yellow-700 dark:text-yellow-300"
|
|
2979
|
+
),
|
|
2980
|
+
children: k
|
|
2981
|
+
}
|
|
2982
|
+
)
|
|
2983
|
+
}
|
|
2965
2984
|
)
|
|
2966
2985
|
] }),
|
|
2967
|
-
|
|
2968
|
-
"div",
|
|
2969
|
-
{
|
|
2970
|
-
className: C(
|
|
2971
|
-
"p-3 rounded-lg mt-auto",
|
|
2972
|
-
n ? "bg-blue-500/30" : "bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800"
|
|
2973
|
-
),
|
|
2974
|
-
children: /* @__PURE__ */ g(
|
|
2975
|
-
"p",
|
|
2976
|
-
{
|
|
2977
|
-
className: C(
|
|
2978
|
-
"text-sm font-semibold text-center",
|
|
2979
|
-
n ? "text-white" : "text-yellow-700 dark:text-yellow-300"
|
|
2980
|
-
),
|
|
2981
|
-
children: k
|
|
2982
|
-
}
|
|
2983
|
-
)
|
|
2984
|
-
}
|
|
2985
|
-
),
|
|
2986
|
-
P && /* @__PURE__ */ g("div", { className: "mt-auto", children: x.href ? /* @__PURE__ */ g(
|
|
2986
|
+
P && /* @__PURE__ */ g("div", { className: "absolute bottom-4 left-6 right-6", children: x.href ? /* @__PURE__ */ g(
|
|
2987
2987
|
"a",
|
|
2988
2988
|
{
|
|
2989
2989
|
href: x.href,
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(D,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react/jsx-runtime"),require("@sudobility/design"),require("@sudobility/components"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@sudobility/design","@sudobility/components","react"],d):(D=typeof globalThis<"u"?globalThis:D||self,d(D.SubscriptionComponents={},D.ReactJSXRuntime,D.SudobilityDesign,D.SudobilityComponents,D.React))})(this,(function(D,d,me,oe,P){"use strict";function ye(e){var o,t,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(o=0;o<s;o++)e[o]&&(t=ye(e[o]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ue(){for(var e,o,t=0,r="",s=arguments.length;t<s;t++)(e=arguments[t])&&(o=ye(e))&&(r&&(r+=" "),r+=o);return r}const qe=(e,o)=>{const t=new Array(e.length+o.length);for(let r=0;r<e.length;r++)t[r]=e[r];for(let r=0;r<o.length;r++)t[e.length+r]=o[r];return t},Ke=(e,o)=>({classGroupId:e,validator:o}),ke=(e=new Map,o=null,t)=>({nextPart:e,validators:o,classGroupId:t}),se="-",ve=[],Ye="arbitrary..",Xe=e=>{const o=He(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Je(a);const f=a.split(se),u=f[0]===""&&f.length>1?1:0;return Ce(f,u,o)},getConflictingClassGroupIds:(a,f)=>{if(f){const u=r[a],g=t[a];return u?g?qe(g,u):u:g||ve}return t[a]||ve}}},Ce=(e,o,t)=>{if(e.length-o===0)return t.classGroupId;const s=e[o],n=t.nextPart.get(s);if(n){const g=Ce(e,o+1,n);if(g)return g}const a=t.validators;if(a===null)return;const f=o===0?e.join(se):e.slice(o).join(se),u=a.length;for(let g=0;g<u;g++){const y=a[g];if(y.validator(f))return y.classGroupId}},Je=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=e.slice(1,-1),t=o.indexOf(":"),r=o.slice(0,t);return r?Ye+r:void 0})(),He=e=>{const{theme:o,classGroups:t}=e;return Qe(t,o)},Qe=(e,o)=>{const t=ke();for(const r in e){const s=e[r];fe(s,t,r,o)}return t},fe=(e,o,t,r)=>{const s=e.length;for(let n=0;n<s;n++){const a=e[n];Ze(a,o,t,r)}},Ze=(e,o,t,r)=>{if(typeof e=="string"){Re(e,o,t);return}if(typeof e=="function"){et(e,o,t,r);return}tt(e,o,t,r)},Re=(e,o,t)=>{const r=e===""?o:Se(o,e);r.classGroupId=t},et=(e,o,t,r)=>{if(rt(e)){fe(e(r),o,t,r);return}o.validators===null&&(o.validators=[]),o.validators.push(Ke(t,e))},tt=(e,o,t,r)=>{const s=Object.entries(e),n=s.length;for(let a=0;a<n;a++){const[f,u]=s[a];fe(u,Se(o,f),t,r)}},Se=(e,o)=>{let t=e;const r=o.split(se),s=r.length;for(let n=0;n<s;n++){const a=r[n];let f=t.nextPart.get(a);f||(f=ke(),t.nextPart.set(a,f)),t=f}return t},rt=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ot=e=>{if(e<1)return{get:()=>{},set:()=>{}};let o=0,t=Object.create(null),r=Object.create(null);const s=(n,a)=>{t[n]=a,o++,o>e&&(o=0,r=t,t=Object.create(null))};return{get(n){let a=t[n];if(a!==void 0)return a;if((a=r[n])!==void 0)return s(n,a),a},set(n,a){n in t?t[n]=a:s(n,a)}}},pe="!",Pe=":",st=[],ze=(e,o,t,r,s)=>({modifiers:e,hasImportantModifier:o,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),nt=e=>{const{prefix:o,experimentalParseClassName:t}=e;let r=s=>{const n=[];let a=0,f=0,u=0,g;const y=s.length;for(let N=0;N<y;N++){const w=s[N];if(a===0&&f===0){if(w===Pe){n.push(s.slice(u,N)),u=N+1;continue}if(w==="/"){g=N;continue}}w==="["?a++:w==="]"?a--:w==="("?f++:w===")"&&f--}const v=n.length===0?s:s.slice(u);let _=v,x=!1;v.endsWith(pe)?(_=v.slice(0,-1),x=!0):v.startsWith(pe)&&(_=v.slice(1),x=!0);const O=g&&g>u?g-u:void 0;return ze(n,x,_,O)};if(o){const s=o+Pe,n=r;r=a=>a.startsWith(s)?n(a.slice(s.length)):ze(st,!1,a,void 0,!0)}if(t){const s=r;r=n=>t({className:n,parseClassName:s})}return r},at=e=>{const o=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{o.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let n=0;n<t.length;n++){const a=t[n],f=a[0]==="[",u=o.has(a);f||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},it=e=>({cache:ot(e.cacheSize),parseClassName:nt(e),sortModifiers:at(e),...Xe(e)}),lt=/\s+/,ct=(e,o)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:n}=o,a=[],f=e.trim().split(lt);let u="";for(let g=f.length-1;g>=0;g-=1){const y=f[g],{isExternal:v,modifiers:_,hasImportantModifier:x,baseClassName:O,maybePostfixModifierPosition:N}=t(y);if(v){u=y+(u.length>0?" "+u:u);continue}let w=!!N,V=r(w?O.substring(0,N):O);if(!V){if(!w){u=y+(u.length>0?" "+u:u);continue}if(V=r(O),!V){u=y+(u.length>0?" "+u:u);continue}w=!1}const F=_.length===0?"":_.length===1?_[0]:n(_).join(":"),$=x?F+pe:F,A=$+V;if(a.indexOf(A)>-1)continue;a.push(A);const S=s(V,w);for(let C=0;C<S.length;++C){const W=S[C];a.push($+W)}u=y+(u.length>0?" "+u:u)}return u},dt=(...e)=>{let o=0,t,r,s="";for(;o<e.length;)(t=e[o++])&&(r=Ne(t))&&(s&&(s+=" "),s+=r);return s},Ne=e=>{if(typeof e=="string")return e;let o,t="";for(let r=0;r<e.length;r++)e[r]&&(o=Ne(e[r]))&&(t&&(t+=" "),t+=o);return t},ut=(e,...o)=>{let t,r,s,n;const a=u=>{const g=o.reduce((y,v)=>v(y),e());return t=it(g),r=t.cache.get,s=t.cache.set,n=f,f(u)},f=u=>{const g=r(u);if(g)return g;const y=ct(u,t);return s(u,y),y};return n=a,(...u)=>n(dt(...u))},mt=[],z=e=>{const o=t=>t[e]||mt;return o.isThemeGetter=!0,o},Ae=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ie=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ft=/^\d+\/\d+$/,pt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ht=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Q=e=>ft.test(e),h=e=>!!e&&!Number.isNaN(Number(e)),K=e=>!!e&&Number.isInteger(Number(e)),be=e=>e.endsWith("%")&&h(e.slice(0,-1)),q=e=>pt.test(e),wt=()=>!0,yt=e=>bt.test(e)&&!gt.test(e),Me=()=>!1,kt=e=>ht.test(e),vt=e=>xt.test(e),Ct=e=>!l(e)&&!c(e),St=e=>Z(e,Ge,Me),l=e=>Ae.test(e),J=e=>Z(e,je,yt),ge=e=>Z(e,It,h),De=e=>Z(e,Te,Me),Pt=e=>Z(e,Ee,vt),ne=e=>Z(e,Le,kt),c=e=>Ie.test(e),te=e=>R(e,je),zt=e=>R(e,Mt),Oe=e=>R(e,Te),Nt=e=>R(e,Ge),At=e=>R(e,Ee),ae=e=>R(e,Le,!0),Z=(e,o,t)=>{const r=Ae.exec(e);return r?r[1]?o(r[1]):t(r[2]):!1},R=(e,o,t=!1)=>{const r=Ie.exec(e);return r?r[1]?o(r[1]):t:!1},Te=e=>e==="position"||e==="percentage",Ee=e=>e==="image"||e==="url",Ge=e=>e==="length"||e==="size"||e==="bg-size",je=e=>e==="length",It=e=>e==="number",Mt=e=>e==="family-name",Le=e=>e==="shadow",Dt=ut(()=>{const e=z("color"),o=z("font"),t=z("text"),r=z("font-weight"),s=z("tracking"),n=z("leading"),a=z("breakpoint"),f=z("container"),u=z("spacing"),g=z("radius"),y=z("shadow"),v=z("inset-shadow"),_=z("text-shadow"),x=z("drop-shadow"),O=z("blur"),N=z("perspective"),w=z("aspect"),V=z("ease"),F=z("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...A(),c,l],C=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],p=()=>[c,l,u],I=()=>[Q,"full","auto",...p()],G=()=>[K,"none","subgrid",c,l],Y=()=>["auto",{span:["full",K,c,l]},K,c,l],ee=()=>[K,"auto",c,l],ie=()=>["auto","min","max","fr",c,l],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],m=()=>["auto",...p()],b=()=>[Q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...p()],i=()=>[e,c,l],j=()=>[...A(),Oe,De,{position:[c,l]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",Nt,St,{size:[c,l]}],H=()=>[be,te,J],T=()=>["","none","full",g,c,l],B=()=>["",h,te,J],le=()=>["solid","dashed","dotted","double"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>[h,be,Oe,De],We=()=>["","none",O,c,l],ce=()=>["none",h,c,l],de=()=>["none",h,c,l],we=()=>[h,c,l],ue=()=>[Q,"full",...p()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[wt],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[Ct],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",h],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Q,l,c,w]}],container:["container"],columns:[{columns:[h,l,c,f]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[K,"auto",c,l]}],basis:[{basis:[Q,"full","auto",f,...p()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[h,Q,"auto","initial","none",l]}],grow:[{grow:["",h,c,l]}],shrink:[{shrink:["",h,c,l]}],order:[{order:[K,"first","last","none",c,l]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:p()}],"gap-x":[{"gap-x":p()}],"gap-y":[{"gap-y":p()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:p()}],px:[{px:p()}],py:[{py:p()}],ps:[{ps:p()}],pe:[{pe:p()}],pt:[{pt:p()}],pr:[{pr:p()}],pb:[{pb:p()}],pl:[{pl:p()}],m:[{m:m()}],mx:[{mx:m()}],my:[{my:m()}],ms:[{ms:m()}],me:[{me:m()}],mt:[{mt:m()}],mr:[{mr:m()}],mb:[{mb:m()}],ml:[{ml:m()}],"space-x":[{"space-x":p()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":p()}],"space-y-reverse":["space-y-reverse"],size:[{size:b()}],w:[{w:[f,"screen",...b()]}],"min-w":[{"min-w":[f,"screen","none",...b()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[a]},...b()]}],h:[{h:["screen","lh",...b()]}],"min-h":[{"min-h":["screen","lh","none",...b()]}],"max-h":[{"max-h":["screen","lh",...b()]}],"font-size":[{text:["base",t,te,J]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,c,ge]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",be,l]}],"font-family":[{font:[zt,l,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,c,l]}],"line-clamp":[{"line-clamp":[h,"none",c,ge]}],leading:[{leading:[n,...p()]}],"list-image":[{"list-image":["none",c,l]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",c,l]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:i()}],"text-color":[{text:i()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[h,"from-font","auto",c,J]}],"text-decoration-color":[{decoration:i()}],"underline-offset":[{"underline-offset":[h,"auto",c,l]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:p()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c,l]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",c,l]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},K,c,l],radial:["",c,l],conic:[K,c,l]},At,Pt]}],"bg-color":[{bg:i()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:i()}],"gradient-via":[{via:i()}],"gradient-to":[{to:i()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:i()}],"border-color-x":[{"border-x":i()}],"border-color-y":[{"border-y":i()}],"border-color-s":[{"border-s":i()}],"border-color-e":[{"border-e":i()}],"border-color-t":[{"border-t":i()}],"border-color-r":[{"border-r":i()}],"border-color-b":[{"border-b":i()}],"border-color-l":[{"border-l":i()}],"divide-color":[{divide:i()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[h,c,l]}],"outline-w":[{outline:["",h,te,J]}],"outline-color":[{outline:i()}],shadow:[{shadow:["","none",y,ae,ne]}],"shadow-color":[{shadow:i()}],"inset-shadow":[{"inset-shadow":["none",v,ae,ne]}],"inset-shadow-color":[{"inset-shadow":i()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:i()}],"ring-offset-w":[{"ring-offset":[h,J]}],"ring-offset-color":[{"ring-offset":i()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":i()}],"text-shadow":[{"text-shadow":["none",_,ae,ne]}],"text-shadow-color":[{"text-shadow":i()}],opacity:[{opacity:[h,c,l]}],"mix-blend":[{"mix-blend":[...Be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[h]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":i()}],"mask-image-linear-to-color":[{"mask-linear-to":i()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":i()}],"mask-image-t-to-color":[{"mask-t-to":i()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":i()}],"mask-image-r-to-color":[{"mask-r-to":i()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":i()}],"mask-image-b-to-color":[{"mask-b-to":i()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":i()}],"mask-image-l-to-color":[{"mask-l-to":i()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":i()}],"mask-image-x-to-color":[{"mask-x-to":i()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":i()}],"mask-image-y-to-color":[{"mask-y-to":i()}],"mask-image-radial":[{"mask-radial":[c,l]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":i()}],"mask-image-radial-to-color":[{"mask-radial-to":i()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[h]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":i()}],"mask-image-conic-to-color":[{"mask-conic-to":i()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",c,l]}],filter:[{filter:["","none",c,l]}],blur:[{blur:We()}],brightness:[{brightness:[h,c,l]}],contrast:[{contrast:[h,c,l]}],"drop-shadow":[{"drop-shadow":["","none",x,ae,ne]}],"drop-shadow-color":[{"drop-shadow":i()}],grayscale:[{grayscale:["",h,c,l]}],"hue-rotate":[{"hue-rotate":[h,c,l]}],invert:[{invert:["",h,c,l]}],saturate:[{saturate:[h,c,l]}],sepia:[{sepia:["",h,c,l]}],"backdrop-filter":[{"backdrop-filter":["","none",c,l]}],"backdrop-blur":[{"backdrop-blur":We()}],"backdrop-brightness":[{"backdrop-brightness":[h,c,l]}],"backdrop-contrast":[{"backdrop-contrast":[h,c,l]}],"backdrop-grayscale":[{"backdrop-grayscale":["",h,c,l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h,c,l]}],"backdrop-invert":[{"backdrop-invert":["",h,c,l]}],"backdrop-opacity":[{"backdrop-opacity":[h,c,l]}],"backdrop-saturate":[{"backdrop-saturate":[h,c,l]}],"backdrop-sepia":[{"backdrop-sepia":["",h,c,l]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":p()}],"border-spacing-x":[{"border-spacing-x":p()}],"border-spacing-y":[{"border-spacing-y":p()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",c,l]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[h,"initial",c,l]}],ease:[{ease:["linear","initial",V,c,l]}],delay:[{delay:[h,c,l]}],animate:[{animate:["none",F,c,l]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,c,l]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[c,l,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:i()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:i()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c,l]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":p()}],"scroll-mx":[{"scroll-mx":p()}],"scroll-my":[{"scroll-my":p()}],"scroll-ms":[{"scroll-ms":p()}],"scroll-me":[{"scroll-me":p()}],"scroll-mt":[{"scroll-mt":p()}],"scroll-mr":[{"scroll-mr":p()}],"scroll-mb":[{"scroll-mb":p()}],"scroll-ml":[{"scroll-ml":p()}],"scroll-p":[{"scroll-p":p()}],"scroll-px":[{"scroll-px":p()}],"scroll-py":[{"scroll-py":p()}],"scroll-ps":[{"scroll-ps":p()}],"scroll-pe":[{"scroll-pe":p()}],"scroll-pt":[{"scroll-pt":p()}],"scroll-pr":[{"scroll-pr":p()}],"scroll-pb":[{"scroll-pb":p()}],"scroll-pl":[{"scroll-pl":p()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c,l]}],fill:[{fill:["none",...i()]}],"stroke-w":[{stroke:[h,te,J,ge]}],stroke:[{stroke:["none",...i()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function k(...e){return Dt(Ue(e))}const Ot={purple:"bg-purple-500",green:"bg-green-500",blue:"bg-blue-500",yellow:"bg-yellow-400 !text-yellow-900",red:"bg-red-500"},_e=({id:e,title:o,price:t,periodLabel:r,features:s,isSelected:n,onSelect:a,topBadge:f,discountBadge:u,premiumCallout:g,bottomNote:y,introPriceNote:v,isBestValue:_=!1,ctaButton:x,className:O,children:N,disabled:w=!1,ariaLabel:V,onTrack:F,trackingLabel:$,componentName:A="SubscriptionTile"})=>{const S=!!x,C=n?"bg-blue-600 text-white ring-4 ring-blue-600 ring-offset-4 ring-offset-white dark:ring-offset-gray-900 border-transparent":"bg-gray-100 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600 hover:shadow-md",W=()=>{!w&&!S&&(F?.({action:"select",trackingLabel:$,componentName:A}),a())},p=G=>{!w&&!S&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),F?.({action:"select",trackingLabel:$,componentName:A}),a())},I=G=>{G.stopPropagation(),F?.({action:"cta_click",trackingLabel:$,componentName:A}),x?.onClick&&x.onClick()};return d.jsxs("div",{className:k("relative rounded-2xl p-6 transition-all flex flex-col h-full",!S&&"pb-14",w?"opacity-50 cursor-not-allowed":S?"cursor-default":"cursor-pointer",C,O),onClick:W,onKeyDown:p,role:S?"article":"radio","aria-checked":S?void 0:n,"aria-label":V||`${o} - ${t}${r||""}`,"aria-disabled":w,tabIndex:S||w?-1:0,children:[f&&d.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 z-10",children:d.jsx("span",{className:k(Ot[f.color],"text-white px-4 py-1.5 rounded-full text-sm font-semibold shadow-lg whitespace-nowrap"),children:f.text})}),d.jsxs("div",{className:"flex flex-col flex-grow",children:[d.jsxs("div",{className:k("text-center mb-6",f&&"mt-2"),children:[d.jsx("h3",{className:k(me.textVariants.heading.h4(),"mb-2",n?"text-white":""),children:o}),d.jsxs("div",{className:"mb-3",children:[d.jsx("span",{className:k("text-4xl font-bold",n?"text-white":"text-gray-900 dark:text-gray-100"),children:t}),r&&d.jsx("span",{className:k("text-lg",n?"text-blue-100":"text-gray-500 dark:text-gray-400"),children:r})]}),u&&d.jsx("div",{className:k("inline-flex items-center px-2 py-1 rounded-full text-sm font-semibold",n?"bg-blue-500 text-white":"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300"),children:u.text})]}),N,s.length>0&&d.jsx("div",{className:"space-y-3 mb-6 flex-grow",children:s.map((G,Y)=>d.jsxs("div",{className:"flex items-start",children:[d.jsx("svg",{className:k("w-5 h-5 mr-3 flex-shrink-0",n?"text-blue-200":"text-green-500"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),d.jsx("span",{className:k("text-sm text-left",n?"text-white":"text-gray-700 dark:text-gray-300"),children:G.replace(/^✓\s*/,"")})]},Y))}),g&&d.jsxs("div",{className:k("rounded-lg p-4 mb-4",n?"bg-blue-500/30":"bg-gradient-to-r from-purple-50 to-blue-50 dark:from-purple-900/20 dark:to-blue-900/20"),children:[d.jsx("div",{className:"flex items-center mb-2",children:d.jsx("span",{className:k("font-semibold text-sm",n?"text-white":"text-purple-600 dark:text-purple-400"),children:g.title})}),d.jsx("ul",{className:k("text-xs space-y-1",n?"text-blue-100":"text-gray-600 dark:text-gray-400"),children:g.features.map((G,Y)=>d.jsxs("li",{children:["• ",G]},Y))})]}),y&&d.jsx("div",{className:k("text-center text-sm font-medium mb-4",n?"text-blue-100":"text-blue-600 dark:text-blue-400"),children:y})]}),v&&d.jsx("div",{className:k("p-3 rounded-lg mt-auto",n?"bg-blue-500/30":"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800"),children:d.jsx("p",{className:k("text-sm font-semibold text-center",n?"text-white":"text-yellow-700 dark:text-yellow-300"),children:v})}),S&&d.jsx("div",{className:"mt-auto",children:x.href?d.jsx("a",{href:x.href,className:k("block w-full py-3 font-semibold rounded-lg text-center transition-colors",n?"bg-white text-blue-600 hover:bg-gray-100":"bg-blue-600 text-white hover:bg-blue-700"),onClick:G=>G.stopPropagation(),children:x.label}):d.jsx("button",{onClick:I,disabled:w,className:k("w-full py-3 font-semibold rounded-lg transition-colors",n?"bg-white text-blue-600 hover:bg-gray-100":"bg-blue-600 text-white hover:bg-blue-700",w&&"opacity-50 cursor-not-allowed"),children:x.label})}),!S&&d.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2",children:d.jsx("div",{className:k("w-5 h-5 rounded-full border-2 flex items-center justify-center",n?"border-white bg-white":"border-gray-300 dark:border-gray-600"),children:n&&d.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-600"})})})]})},Tt=({title:e,children:o,error:t,variant:r="selection",currentStatus:s,primaryAction:n,secondaryAction:a,minTileWidth:f=240,className:u,headerContent:g,aboveProducts:y,footerContent:v,currentStatusLabel:_="Current Status",freeTileConfig:x,onTrack:O,trackingLabel:N,componentName:w="SubscriptionLayout"})=>{const V=r==="selection"&&n,F=()=>{O?.({action:"primary_action",trackingLabel:N,componentName:w}),n?.onClick()},$=()=>{O?.({action:"secondary_action",trackingLabel:N,componentName:w}),a?.onClick()},A=r==="cta"&&x,S={display:"grid",gridTemplateColumns:`repeat(auto-fit, minmax(min(100%, ${f}px), 1fr))`,gap:"1.5rem"};return d.jsx(oe.Card,{className:u,children:d.jsxs(oe.CardContent,{className:"pt-6",children:[g,s&&d.jsxs(d.Fragment,{children:[d.jsx("h2",{className:k(me.textVariants.heading.h3(),"mb-4"),children:_}),s.isActive?d.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6",children:[d.jsxs("div",{className:"flex items-center mb-2",children:[d.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full mr-3"}),d.jsx("span",{className:"font-semibold text-green-800 dark:text-green-300",children:s.activeContent?.title||"Active Subscription"})]}),s.activeContent?.fields&&s.activeContent.fields.length>0&&d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:s.activeContent.fields.map((C,W)=>d.jsxs("div",{children:[d.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:C.label}),d.jsx("p",{className:"font-semibold text-green-800 dark:text-green-300",children:C.value})]},W))})]}):d.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4 mb-6",children:[d.jsxs("div",{className:"flex items-center mb-2",children:[d.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full mr-3"}),d.jsx("span",{className:"font-semibold text-yellow-800 dark:text-yellow-300",children:s.inactiveContent?.title||"No Active Subscription"})]}),s.inactiveContent?.message&&d.jsx("p",{className:"text-yellow-700 dark:text-yellow-400",children:s.inactiveContent.message})]})]}),d.jsx("h2",{className:k(me.textVariants.heading.h3(),"mb-4"),children:e}),y,d.jsxs("div",{style:S,children:[A&&d.jsx(_e,{id:"free",title:x.title,price:x.price,periodLabel:x.periodLabel,features:x.features,isSelected:!1,onSelect:()=>{},topBadge:x.topBadge,ctaButton:x.ctaButton}),o]}),v,t&&d.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mt-6",children:d.jsx("p",{className:"text-red-600 dark:text-red-400",children:t})}),V&&d.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mt-6",children:[a&&d.jsx(oe.Button,{onClick:$,disabled:a.disabled||a.loading,variant:"outline",className:"sm:flex-shrink-0",children:a.label}),d.jsx(oe.Button,{onClick:F,disabled:n.disabled||n.loading,className:"flex-1",children:n.label})]})]})})};function Et({options:e,value:o,onChange:t,className:r,disabled:s=!1,size:n="md"}){const a={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"};return d.jsx("div",{className:k("inline-flex rounded-lg bg-gray-100 dark:bg-gray-800 p-1",s&&"opacity-50",r),role:"radiogroup",children:e.map(f=>{const u=o===f.value;return d.jsx("button",{type:"button",role:"radio","aria-checked":u,disabled:s,onClick:()=>!s&&t(f.value),className:k(a[n],"font-medium rounded-md transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",u?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white",s&&"cursor-not-allowed"),children:f.label},f.value)})})}let he=null;const Gt=async()=>(he||(he=await import("@revenuecat/purchases-js")),he);let E=null;const Fe=(e,o)=>{const t=e.rcBillingProduct,r=t?.defaultSubscriptionOption,s=typeof o?.entitlement=="string"?o.entitlement:void 0;return{identifier:e.identifier,productId:t?.identifier||void 0,price:t?.currentPrice?.amountMicros?(t.currentPrice.amountMicros/1e6).toFixed(2):"0",priceString:t?.currentPrice?.formattedPrice||"$0",title:t?.title||e.identifier,description:t?.description||"",period:t?.normalPeriodDuration||void 0,introPrice:r?.introPrice?.price?.formattedPrice||void 0,introPriceAmount:r?.introPrice?.price?.amountMicros?(r.introPrice.price.amountMicros/1e6).toFixed(2):void 0,introPricePeriod:r?.introPrice?.periodDuration||void 0,introPriceCycles:r?.introPrice?.cycleCount||void 0,freeTrialPeriod:r?.trial?.periodDuration||void 0,entitlement:s}},xe=(e,o)=>{const t=e.entitlements.active[o];return t?{isActive:!0,expirationDate:t.expirationDate?new Date(t.expirationDate):void 0,purchaseDate:t.latestPurchaseDate?new Date(t.latestPurchaseDate):void 0,productIdentifier:t.productIdentifier,willRenew:t.willRenew,isSandbox:t.isSandbox,unsubscribeDetectedAt:t.unsubscribeDetectedAt?new Date(t.unsubscribeDetectedAt):void 0,billingIssueDetectedAt:t.billingIssueDetectedAt?new Date(t.billingIssueDetectedAt):void 0}:{isActive:!1}},Ve=P.createContext(void 0),jt=({apiKey:e,entitlementId:o,userEmail:t,onError:r,onPurchaseSuccess:s,children:n})=>{const[a,f]=P.useState([]),[u,g]=P.useState(null),[y,v]=P.useState(!1),[_,x]=P.useState(null),[O,N]=P.useState(!1),[w,V]=P.useState(null),[F,$]=P.useState(null),[A,S]=P.useState(null),C=!e||e==="your_revenuecat_api_key_here",W=P.useCallback(()=>{f([]),g(null),$(null),S(null),x(null),N(!1),V(null),E=null},[]),p=P.useCallback(async()=>{if(E)try{const m=await E.getOfferings();m.current&&$(m.current);const b=m.all;if(b){S(b);const i=[];for(const j of Object.keys(b)){const L=b[j];if(L?.availablePackages){const U=L.metadata,H=L.availablePackages.map(T=>Fe(T,U));i.push(...H)}}f(i)}else if(m.current){const i=m.current.metadata,j=m.current.availablePackages.map(L=>Fe(L,i));f(j)}}catch(m){const b=m instanceof Error?m.message:"Failed to load offerings";x(b),r?.(m instanceof Error?m:new Error(b))}},[r]),I=P.useCallback(async()=>{if(E)try{const m=await E.getCustomerInfo(),b=xe(m,o);g(b.isActive?b:null)}catch(m){const b=m instanceof Error?m.message:"Failed to load subscription status";x(b),r?.(m instanceof Error?m:new Error(b))}},[o,r]),G=P.useCallback(async(m,b)=>{if(w&&w!==m&&W(),!(O&&w===m))try{if(v(!0),x(null),C)console.warn("[SubscriptionProvider] RevenueCat API key not configured"),f([]),g(null);else{const i=await Gt(),j={apiKey:e,appUserId:m};E=i.Purchases.configure(j);const L=b||t;if(L&&E)try{await E.setAttributes({email:L})}catch{}await Promise.all([p(),I()])}V(m),N(!0)}catch(i){const j=i instanceof Error?i.message:"Failed to initialize";x(j),g(null),f([]),r?.(i instanceof Error?i:new Error(j))}finally{v(!1)}},[w,O,C,e,t,p,I,r,W]),Y=P.useCallback(async m=>{try{if(v(!0),x(null),C){await new Promise(U=>setTimeout(U,2e3));const L={isActive:!0,expirationDate:new Date(Date.now()+365*24*60*60*1e3),purchaseDate:new Date,productIdentifier:m,willRenew:!0};return g(L),s?.(m),!0}if(!E||!F&&!A)throw new Error("Subscription service not initialized");let b;if(A)for(const L of Object.keys(A)){const U=A[L];if(U?.availablePackages&&(b=U.availablePackages.find(H=>H.identifier===m),b))break}else F&&(b=F.availablePackages.find(U=>U.identifier===m));if(!b)throw new Error(`Package not found: ${m}`);const i=await E.purchase({rcPackage:b,...t?{customerEmail:t}:{}}),j=xe(i.customerInfo,o);return g(j.isActive?j:null),j.isActive&&s?.(m),j.isActive}catch(b){const i=b instanceof Error?b.message:"Purchase failed";return x(i),r?.(b instanceof Error?b:new Error(i)),!1}finally{v(!1)}},[C,F,A,t,o,s,r]),ee=P.useCallback(async()=>{try{if(v(!0),x(null),C)return await new Promise(i=>setTimeout(i,1e3)),x("No previous purchases found"),!1;if(!E)throw new Error("Subscription service not initialized");const m=await E.getCustomerInfo(),b=xe(m,o);return g(b.isActive?b:null),b.isActive||x("No previous purchases found"),b.isActive}catch(m){const b=m instanceof Error?m.message:"Restore failed";return x(b),r?.(m instanceof Error?m:new Error(b)),!1}finally{v(!1)}},[C,o,r]),ie=P.useCallback(async()=>{if(!C)try{x(null),await Promise.all([I(),p()])}catch(m){const b=m instanceof Error?m.message:"Refresh failed";x(b),r?.(m instanceof Error?m:new Error(b))}},[C,I,p,r]),re=P.useCallback(()=>{x(null)},[]);P.useEffect(()=>{if(!O||C||!E)return;const m=setInterval(()=>{I().catch(()=>{})},300*1e3);return()=>clearInterval(m)},[O,C,I]);const X={products:a,currentSubscription:u,isLoading:y,error:_,initialize:G,purchase:Y,restore:ee,refresh:ie,clearError:re};return d.jsx(Ve.Provider,{value:X,children:n})},Lt=()=>{const e=P.useContext(Ve);if(!e)throw new Error("useSubscriptionContext must be used within a SubscriptionProvider");return e},$e=()=>{try{const e=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);r&&(r.includes("revenuecat")||r.includes("rcb")||r.includes("rc_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t));const o=[];for(let t=0;t<sessionStorage.length;t++){const r=sessionStorage.key(t);r&&(r.includes("revenuecat")||r.includes("rcb")||r.includes("rc_"))&&o.push(r)}o.forEach(t=>sessionStorage.removeItem(t))}catch{}},_t=()=>{try{E&&(E.close(),E=null),$e()}catch{}};D.SegmentedControl=Et,D.SubscriptionLayout=Tt,D.SubscriptionProvider=jt,D.SubscriptionTile=_e,D.clearRevenueCatCheckoutSessions=$e,D.closeRevenueCatInstance=_t,D.cn=k,D.useSubscriptionContext=Lt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(D,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react/jsx-runtime"),require("@sudobility/design"),require("@sudobility/components"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@sudobility/design","@sudobility/components","react"],d):(D=typeof globalThis<"u"?globalThis:D||self,d(D.SubscriptionComponents={},D.ReactJSXRuntime,D.SudobilityDesign,D.SudobilityComponents,D.React))})(this,(function(D,d,me,oe,P){"use strict";function ye(e){var o,t,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(o=0;o<s;o++)e[o]&&(t=ye(e[o]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ue(){for(var e,o,t=0,r="",s=arguments.length;t<s;t++)(e=arguments[t])&&(o=ye(e))&&(r&&(r+=" "),r+=o);return r}const qe=(e,o)=>{const t=new Array(e.length+o.length);for(let r=0;r<e.length;r++)t[r]=e[r];for(let r=0;r<o.length;r++)t[e.length+r]=o[r];return t},Ke=(e,o)=>({classGroupId:e,validator:o}),ke=(e=new Map,o=null,t)=>({nextPart:e,validators:o,classGroupId:t}),se="-",ve=[],Ye="arbitrary..",Xe=e=>{const o=He(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Je(a);const f=a.split(se),u=f[0]===""&&f.length>1?1:0;return Ce(f,u,o)},getConflictingClassGroupIds:(a,f)=>{if(f){const u=r[a],g=t[a];return u?g?qe(g,u):u:g||ve}return t[a]||ve}}},Ce=(e,o,t)=>{if(e.length-o===0)return t.classGroupId;const s=e[o],n=t.nextPart.get(s);if(n){const g=Ce(e,o+1,n);if(g)return g}const a=t.validators;if(a===null)return;const f=o===0?e.join(se):e.slice(o).join(se),u=a.length;for(let g=0;g<u;g++){const y=a[g];if(y.validator(f))return y.classGroupId}},Je=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=e.slice(1,-1),t=o.indexOf(":"),r=o.slice(0,t);return r?Ye+r:void 0})(),He=e=>{const{theme:o,classGroups:t}=e;return Qe(t,o)},Qe=(e,o)=>{const t=ke();for(const r in e){const s=e[r];fe(s,t,r,o)}return t},fe=(e,o,t,r)=>{const s=e.length;for(let n=0;n<s;n++){const a=e[n];Ze(a,o,t,r)}},Ze=(e,o,t,r)=>{if(typeof e=="string"){Re(e,o,t);return}if(typeof e=="function"){et(e,o,t,r);return}tt(e,o,t,r)},Re=(e,o,t)=>{const r=e===""?o:Se(o,e);r.classGroupId=t},et=(e,o,t,r)=>{if(rt(e)){fe(e(r),o,t,r);return}o.validators===null&&(o.validators=[]),o.validators.push(Ke(t,e))},tt=(e,o,t,r)=>{const s=Object.entries(e),n=s.length;for(let a=0;a<n;a++){const[f,u]=s[a];fe(u,Se(o,f),t,r)}},Se=(e,o)=>{let t=e;const r=o.split(se),s=r.length;for(let n=0;n<s;n++){const a=r[n];let f=t.nextPart.get(a);f||(f=ke(),t.nextPart.set(a,f)),t=f}return t},rt=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ot=e=>{if(e<1)return{get:()=>{},set:()=>{}};let o=0,t=Object.create(null),r=Object.create(null);const s=(n,a)=>{t[n]=a,o++,o>e&&(o=0,r=t,t=Object.create(null))};return{get(n){let a=t[n];if(a!==void 0)return a;if((a=r[n])!==void 0)return s(n,a),a},set(n,a){n in t?t[n]=a:s(n,a)}}},pe="!",Pe=":",st=[],ze=(e,o,t,r,s)=>({modifiers:e,hasImportantModifier:o,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),nt=e=>{const{prefix:o,experimentalParseClassName:t}=e;let r=s=>{const n=[];let a=0,f=0,u=0,g;const y=s.length;for(let N=0;N<y;N++){const w=s[N];if(a===0&&f===0){if(w===Pe){n.push(s.slice(u,N)),u=N+1;continue}if(w==="/"){g=N;continue}}w==="["?a++:w==="]"?a--:w==="("?f++:w===")"&&f--}const v=n.length===0?s:s.slice(u);let _=v,x=!1;v.endsWith(pe)?(_=v.slice(0,-1),x=!0):v.startsWith(pe)&&(_=v.slice(1),x=!0);const O=g&&g>u?g-u:void 0;return ze(n,x,_,O)};if(o){const s=o+Pe,n=r;r=a=>a.startsWith(s)?n(a.slice(s.length)):ze(st,!1,a,void 0,!0)}if(t){const s=r;r=n=>t({className:n,parseClassName:s})}return r},at=e=>{const o=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{o.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let n=0;n<t.length;n++){const a=t[n],f=a[0]==="[",u=o.has(a);f||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},it=e=>({cache:ot(e.cacheSize),parseClassName:nt(e),sortModifiers:at(e),...Xe(e)}),lt=/\s+/,ct=(e,o)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:n}=o,a=[],f=e.trim().split(lt);let u="";for(let g=f.length-1;g>=0;g-=1){const y=f[g],{isExternal:v,modifiers:_,hasImportantModifier:x,baseClassName:O,maybePostfixModifierPosition:N}=t(y);if(v){u=y+(u.length>0?" "+u:u);continue}let w=!!N,V=r(w?O.substring(0,N):O);if(!V){if(!w){u=y+(u.length>0?" "+u:u);continue}if(V=r(O),!V){u=y+(u.length>0?" "+u:u);continue}w=!1}const F=_.length===0?"":_.length===1?_[0]:n(_).join(":"),$=x?F+pe:F,A=$+V;if(a.indexOf(A)>-1)continue;a.push(A);const S=s(V,w);for(let C=0;C<S.length;++C){const W=S[C];a.push($+W)}u=y+(u.length>0?" "+u:u)}return u},dt=(...e)=>{let o=0,t,r,s="";for(;o<e.length;)(t=e[o++])&&(r=Ne(t))&&(s&&(s+=" "),s+=r);return s},Ne=e=>{if(typeof e=="string")return e;let o,t="";for(let r=0;r<e.length;r++)e[r]&&(o=Ne(e[r]))&&(t&&(t+=" "),t+=o);return t},ut=(e,...o)=>{let t,r,s,n;const a=u=>{const g=o.reduce((y,v)=>v(y),e());return t=it(g),r=t.cache.get,s=t.cache.set,n=f,f(u)},f=u=>{const g=r(u);if(g)return g;const y=ct(u,t);return s(u,y),y};return n=a,(...u)=>n(dt(...u))},mt=[],z=e=>{const o=t=>t[e]||mt;return o.isThemeGetter=!0,o},Ae=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ie=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ft=/^\d+\/\d+$/,pt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ht=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Q=e=>ft.test(e),h=e=>!!e&&!Number.isNaN(Number(e)),K=e=>!!e&&Number.isInteger(Number(e)),be=e=>e.endsWith("%")&&h(e.slice(0,-1)),q=e=>pt.test(e),wt=()=>!0,yt=e=>bt.test(e)&&!gt.test(e),Me=()=>!1,kt=e=>ht.test(e),vt=e=>xt.test(e),Ct=e=>!l(e)&&!c(e),St=e=>Z(e,Ge,Me),l=e=>Ae.test(e),J=e=>Z(e,je,yt),ge=e=>Z(e,It,h),De=e=>Z(e,Te,Me),Pt=e=>Z(e,Ee,vt),ne=e=>Z(e,Le,kt),c=e=>Ie.test(e),te=e=>R(e,je),zt=e=>R(e,Mt),Oe=e=>R(e,Te),Nt=e=>R(e,Ge),At=e=>R(e,Ee),ae=e=>R(e,Le,!0),Z=(e,o,t)=>{const r=Ae.exec(e);return r?r[1]?o(r[1]):t(r[2]):!1},R=(e,o,t=!1)=>{const r=Ie.exec(e);return r?r[1]?o(r[1]):t:!1},Te=e=>e==="position"||e==="percentage",Ee=e=>e==="image"||e==="url",Ge=e=>e==="length"||e==="size"||e==="bg-size",je=e=>e==="length",It=e=>e==="number",Mt=e=>e==="family-name",Le=e=>e==="shadow",Dt=ut(()=>{const e=z("color"),o=z("font"),t=z("text"),r=z("font-weight"),s=z("tracking"),n=z("leading"),a=z("breakpoint"),f=z("container"),u=z("spacing"),g=z("radius"),y=z("shadow"),v=z("inset-shadow"),_=z("text-shadow"),x=z("drop-shadow"),O=z("blur"),N=z("perspective"),w=z("aspect"),V=z("ease"),F=z("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...A(),c,l],C=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],p=()=>[c,l,u],I=()=>[Q,"full","auto",...p()],G=()=>[K,"none","subgrid",c,l],Y=()=>["auto",{span:["full",K,c,l]},K,c,l],ee=()=>[K,"auto",c,l],ie=()=>["auto","min","max","fr",c,l],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],m=()=>["auto",...p()],b=()=>[Q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...p()],i=()=>[e,c,l],j=()=>[...A(),Oe,De,{position:[c,l]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",Nt,St,{size:[c,l]}],H=()=>[be,te,J],T=()=>["","none","full",g,c,l],B=()=>["",h,te,J],le=()=>["solid","dashed","dotted","double"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>[h,be,Oe,De],We=()=>["","none",O,c,l],ce=()=>["none",h,c,l],de=()=>["none",h,c,l],we=()=>[h,c,l],ue=()=>[Q,"full",...p()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[wt],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[Ct],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",h],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Q,l,c,w]}],container:["container"],columns:[{columns:[h,l,c,f]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[K,"auto",c,l]}],basis:[{basis:[Q,"full","auto",f,...p()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[h,Q,"auto","initial","none",l]}],grow:[{grow:["",h,c,l]}],shrink:[{shrink:["",h,c,l]}],order:[{order:[K,"first","last","none",c,l]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:p()}],"gap-x":[{"gap-x":p()}],"gap-y":[{"gap-y":p()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:p()}],px:[{px:p()}],py:[{py:p()}],ps:[{ps:p()}],pe:[{pe:p()}],pt:[{pt:p()}],pr:[{pr:p()}],pb:[{pb:p()}],pl:[{pl:p()}],m:[{m:m()}],mx:[{mx:m()}],my:[{my:m()}],ms:[{ms:m()}],me:[{me:m()}],mt:[{mt:m()}],mr:[{mr:m()}],mb:[{mb:m()}],ml:[{ml:m()}],"space-x":[{"space-x":p()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":p()}],"space-y-reverse":["space-y-reverse"],size:[{size:b()}],w:[{w:[f,"screen",...b()]}],"min-w":[{"min-w":[f,"screen","none",...b()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[a]},...b()]}],h:[{h:["screen","lh",...b()]}],"min-h":[{"min-h":["screen","lh","none",...b()]}],"max-h":[{"max-h":["screen","lh",...b()]}],"font-size":[{text:["base",t,te,J]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,c,ge]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",be,l]}],"font-family":[{font:[zt,l,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,c,l]}],"line-clamp":[{"line-clamp":[h,"none",c,ge]}],leading:[{leading:[n,...p()]}],"list-image":[{"list-image":["none",c,l]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",c,l]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:i()}],"text-color":[{text:i()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[h,"from-font","auto",c,J]}],"text-decoration-color":[{decoration:i()}],"underline-offset":[{"underline-offset":[h,"auto",c,l]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:p()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c,l]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",c,l]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},K,c,l],radial:["",c,l],conic:[K,c,l]},At,Pt]}],"bg-color":[{bg:i()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:i()}],"gradient-via":[{via:i()}],"gradient-to":[{to:i()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:i()}],"border-color-x":[{"border-x":i()}],"border-color-y":[{"border-y":i()}],"border-color-s":[{"border-s":i()}],"border-color-e":[{"border-e":i()}],"border-color-t":[{"border-t":i()}],"border-color-r":[{"border-r":i()}],"border-color-b":[{"border-b":i()}],"border-color-l":[{"border-l":i()}],"divide-color":[{divide:i()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[h,c,l]}],"outline-w":[{outline:["",h,te,J]}],"outline-color":[{outline:i()}],shadow:[{shadow:["","none",y,ae,ne]}],"shadow-color":[{shadow:i()}],"inset-shadow":[{"inset-shadow":["none",v,ae,ne]}],"inset-shadow-color":[{"inset-shadow":i()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:i()}],"ring-offset-w":[{"ring-offset":[h,J]}],"ring-offset-color":[{"ring-offset":i()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":i()}],"text-shadow":[{"text-shadow":["none",_,ae,ne]}],"text-shadow-color":[{"text-shadow":i()}],opacity:[{opacity:[h,c,l]}],"mix-blend":[{"mix-blend":[...Be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[h]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":i()}],"mask-image-linear-to-color":[{"mask-linear-to":i()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":i()}],"mask-image-t-to-color":[{"mask-t-to":i()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":i()}],"mask-image-r-to-color":[{"mask-r-to":i()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":i()}],"mask-image-b-to-color":[{"mask-b-to":i()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":i()}],"mask-image-l-to-color":[{"mask-l-to":i()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":i()}],"mask-image-x-to-color":[{"mask-x-to":i()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":i()}],"mask-image-y-to-color":[{"mask-y-to":i()}],"mask-image-radial":[{"mask-radial":[c,l]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":i()}],"mask-image-radial-to-color":[{"mask-radial-to":i()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[h]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":i()}],"mask-image-conic-to-color":[{"mask-conic-to":i()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",c,l]}],filter:[{filter:["","none",c,l]}],blur:[{blur:We()}],brightness:[{brightness:[h,c,l]}],contrast:[{contrast:[h,c,l]}],"drop-shadow":[{"drop-shadow":["","none",x,ae,ne]}],"drop-shadow-color":[{"drop-shadow":i()}],grayscale:[{grayscale:["",h,c,l]}],"hue-rotate":[{"hue-rotate":[h,c,l]}],invert:[{invert:["",h,c,l]}],saturate:[{saturate:[h,c,l]}],sepia:[{sepia:["",h,c,l]}],"backdrop-filter":[{"backdrop-filter":["","none",c,l]}],"backdrop-blur":[{"backdrop-blur":We()}],"backdrop-brightness":[{"backdrop-brightness":[h,c,l]}],"backdrop-contrast":[{"backdrop-contrast":[h,c,l]}],"backdrop-grayscale":[{"backdrop-grayscale":["",h,c,l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h,c,l]}],"backdrop-invert":[{"backdrop-invert":["",h,c,l]}],"backdrop-opacity":[{"backdrop-opacity":[h,c,l]}],"backdrop-saturate":[{"backdrop-saturate":[h,c,l]}],"backdrop-sepia":[{"backdrop-sepia":["",h,c,l]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":p()}],"border-spacing-x":[{"border-spacing-x":p()}],"border-spacing-y":[{"border-spacing-y":p()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",c,l]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[h,"initial",c,l]}],ease:[{ease:["linear","initial",V,c,l]}],delay:[{delay:[h,c,l]}],animate:[{animate:["none",F,c,l]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,c,l]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[c,l,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:i()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:i()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c,l]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":p()}],"scroll-mx":[{"scroll-mx":p()}],"scroll-my":[{"scroll-my":p()}],"scroll-ms":[{"scroll-ms":p()}],"scroll-me":[{"scroll-me":p()}],"scroll-mt":[{"scroll-mt":p()}],"scroll-mr":[{"scroll-mr":p()}],"scroll-mb":[{"scroll-mb":p()}],"scroll-ml":[{"scroll-ml":p()}],"scroll-p":[{"scroll-p":p()}],"scroll-px":[{"scroll-px":p()}],"scroll-py":[{"scroll-py":p()}],"scroll-ps":[{"scroll-ps":p()}],"scroll-pe":[{"scroll-pe":p()}],"scroll-pt":[{"scroll-pt":p()}],"scroll-pr":[{"scroll-pr":p()}],"scroll-pb":[{"scroll-pb":p()}],"scroll-pl":[{"scroll-pl":p()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c,l]}],fill:[{fill:["none",...i()]}],"stroke-w":[{stroke:[h,te,J,ge]}],stroke:[{stroke:["none",...i()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function k(...e){return Dt(Ue(e))}const Ot={purple:"bg-purple-500",green:"bg-green-500",blue:"bg-blue-500",yellow:"bg-yellow-400 !text-yellow-900",red:"bg-red-500"},_e=({id:e,title:o,price:t,periodLabel:r,features:s,isSelected:n,onSelect:a,topBadge:f,discountBadge:u,premiumCallout:g,bottomNote:y,introPriceNote:v,isBestValue:_=!1,ctaButton:x,className:O,children:N,disabled:w=!1,ariaLabel:V,onTrack:F,trackingLabel:$,componentName:A="SubscriptionTile"})=>{const S=!!x,C=n?"bg-blue-600 text-white ring-4 ring-blue-600 ring-offset-4 ring-offset-white dark:ring-offset-gray-900 border-transparent":"bg-gray-100 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600 hover:shadow-md",W=()=>{!w&&!S&&(F?.({action:"select",trackingLabel:$,componentName:A}),a())},p=G=>{!w&&!S&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),F?.({action:"select",trackingLabel:$,componentName:A}),a())},I=G=>{G.stopPropagation(),F?.({action:"cta_click",trackingLabel:$,componentName:A}),x?.onClick&&x.onClick()};return d.jsxs("div",{className:k("relative rounded-2xl p-6 transition-all flex flex-col h-full",S?"pb-20":"pb-14",w?"opacity-50 cursor-not-allowed":S?"cursor-default":"cursor-pointer",C,O),onClick:W,onKeyDown:p,role:S?"article":"radio","aria-checked":S?void 0:n,"aria-label":V||`${o} - ${t}${r||""}`,"aria-disabled":w,tabIndex:S||w?-1:0,children:[f&&d.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 z-10",children:d.jsx("span",{className:k(Ot[f.color],"text-white px-4 py-1.5 rounded-full text-sm font-semibold shadow-lg whitespace-nowrap"),children:f.text})}),d.jsxs("div",{className:"flex flex-col flex-grow",children:[d.jsxs("div",{className:k("text-center mb-6",f&&"mt-2"),children:[d.jsx("h3",{className:k(me.textVariants.heading.h4(),"mb-2",n?"text-white":""),children:o}),d.jsxs("div",{className:"mb-3",children:[d.jsx("span",{className:k("text-4xl font-bold",n?"text-white":"text-gray-900 dark:text-gray-100"),children:t}),r&&d.jsx("span",{className:k("text-lg",n?"text-blue-100":"text-gray-500 dark:text-gray-400"),children:r})]}),u&&d.jsx("div",{className:k("inline-flex items-center px-2 py-1 rounded-full text-sm font-semibold",n?"bg-blue-500 text-white":"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300"),children:u.text})]}),N,s.length>0&&d.jsx("div",{className:"space-y-3 mb-6 flex-grow",children:s.map((G,Y)=>d.jsxs("div",{className:"flex items-start",children:[d.jsx("svg",{className:k("w-5 h-5 mr-3 flex-shrink-0",n?"text-blue-200":"text-green-500"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),d.jsx("span",{className:k("text-sm text-left",n?"text-white":"text-gray-700 dark:text-gray-300"),children:G.replace(/^✓\s*/,"")})]},Y))}),g&&d.jsxs("div",{className:k("rounded-lg p-4 mb-4",n?"bg-blue-500/30":"bg-gradient-to-r from-purple-50 to-blue-50 dark:from-purple-900/20 dark:to-blue-900/20"),children:[d.jsx("div",{className:"flex items-center mb-2",children:d.jsx("span",{className:k("font-semibold text-sm",n?"text-white":"text-purple-600 dark:text-purple-400"),children:g.title})}),d.jsx("ul",{className:k("text-xs space-y-1",n?"text-blue-100":"text-gray-600 dark:text-gray-400"),children:g.features.map((G,Y)=>d.jsxs("li",{children:["• ",G]},Y))})]}),y&&d.jsx("div",{className:k("text-center text-sm font-medium mb-4",n?"text-blue-100":"text-blue-600 dark:text-blue-400"),children:y}),v&&d.jsx("div",{className:k("p-3 rounded-lg mt-auto",n?"bg-blue-500/30":"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800"),children:d.jsx("p",{className:k("text-sm font-semibold text-center",n?"text-white":"text-yellow-700 dark:text-yellow-300"),children:v})})]}),S&&d.jsx("div",{className:"absolute bottom-4 left-6 right-6",children:x.href?d.jsx("a",{href:x.href,className:k("block w-full py-3 font-semibold rounded-lg text-center transition-colors",n?"bg-white text-blue-600 hover:bg-gray-100":"bg-blue-600 text-white hover:bg-blue-700"),onClick:G=>G.stopPropagation(),children:x.label}):d.jsx("button",{onClick:I,disabled:w,className:k("w-full py-3 font-semibold rounded-lg transition-colors",n?"bg-white text-blue-600 hover:bg-gray-100":"bg-blue-600 text-white hover:bg-blue-700",w&&"opacity-50 cursor-not-allowed"),children:x.label})}),!S&&d.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2",children:d.jsx("div",{className:k("w-5 h-5 rounded-full border-2 flex items-center justify-center",n?"border-white bg-white":"border-gray-300 dark:border-gray-600"),children:n&&d.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-600"})})})]})},Tt=({title:e,children:o,error:t,variant:r="selection",currentStatus:s,primaryAction:n,secondaryAction:a,minTileWidth:f=240,className:u,headerContent:g,aboveProducts:y,footerContent:v,currentStatusLabel:_="Current Status",freeTileConfig:x,onTrack:O,trackingLabel:N,componentName:w="SubscriptionLayout"})=>{const V=r==="selection"&&n,F=()=>{O?.({action:"primary_action",trackingLabel:N,componentName:w}),n?.onClick()},$=()=>{O?.({action:"secondary_action",trackingLabel:N,componentName:w}),a?.onClick()},A=r==="cta"&&x,S={display:"grid",gridTemplateColumns:`repeat(auto-fit, minmax(min(100%, ${f}px), 1fr))`,gap:"1.5rem"};return d.jsx(oe.Card,{className:u,children:d.jsxs(oe.CardContent,{className:"pt-6",children:[g,s&&d.jsxs(d.Fragment,{children:[d.jsx("h2",{className:k(me.textVariants.heading.h3(),"mb-4"),children:_}),s.isActive?d.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6",children:[d.jsxs("div",{className:"flex items-center mb-2",children:[d.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full mr-3"}),d.jsx("span",{className:"font-semibold text-green-800 dark:text-green-300",children:s.activeContent?.title||"Active Subscription"})]}),s.activeContent?.fields&&s.activeContent.fields.length>0&&d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:s.activeContent.fields.map((C,W)=>d.jsxs("div",{children:[d.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:C.label}),d.jsx("p",{className:"font-semibold text-green-800 dark:text-green-300",children:C.value})]},W))})]}):d.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4 mb-6",children:[d.jsxs("div",{className:"flex items-center mb-2",children:[d.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full mr-3"}),d.jsx("span",{className:"font-semibold text-yellow-800 dark:text-yellow-300",children:s.inactiveContent?.title||"No Active Subscription"})]}),s.inactiveContent?.message&&d.jsx("p",{className:"text-yellow-700 dark:text-yellow-400",children:s.inactiveContent.message})]})]}),d.jsx("h2",{className:k(me.textVariants.heading.h3(),"mb-4"),children:e}),y,d.jsxs("div",{style:S,children:[A&&d.jsx(_e,{id:"free",title:x.title,price:x.price,periodLabel:x.periodLabel,features:x.features,isSelected:!1,onSelect:()=>{},topBadge:x.topBadge,ctaButton:x.ctaButton}),o]}),v,t&&d.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mt-6",children:d.jsx("p",{className:"text-red-600 dark:text-red-400",children:t})}),V&&d.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mt-6",children:[a&&d.jsx(oe.Button,{onClick:$,disabled:a.disabled||a.loading,variant:"outline",className:"sm:flex-shrink-0",children:a.label}),d.jsx(oe.Button,{onClick:F,disabled:n.disabled||n.loading,className:"flex-1",children:n.label})]})]})})};function Et({options:e,value:o,onChange:t,className:r,disabled:s=!1,size:n="md"}){const a={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"};return d.jsx("div",{className:k("inline-flex rounded-lg bg-gray-100 dark:bg-gray-800 p-1",s&&"opacity-50",r),role:"radiogroup",children:e.map(f=>{const u=o===f.value;return d.jsx("button",{type:"button",role:"radio","aria-checked":u,disabled:s,onClick:()=>!s&&t(f.value),className:k(a[n],"font-medium rounded-md transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",u?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white",s&&"cursor-not-allowed"),children:f.label},f.value)})})}let he=null;const Gt=async()=>(he||(he=await import("@revenuecat/purchases-js")),he);let E=null;const Fe=(e,o)=>{const t=e.rcBillingProduct,r=t?.defaultSubscriptionOption,s=typeof o?.entitlement=="string"?o.entitlement:void 0;return{identifier:e.identifier,productId:t?.identifier||void 0,price:t?.currentPrice?.amountMicros?(t.currentPrice.amountMicros/1e6).toFixed(2):"0",priceString:t?.currentPrice?.formattedPrice||"$0",title:t?.title||e.identifier,description:t?.description||"",period:t?.normalPeriodDuration||void 0,introPrice:r?.introPrice?.price?.formattedPrice||void 0,introPriceAmount:r?.introPrice?.price?.amountMicros?(r.introPrice.price.amountMicros/1e6).toFixed(2):void 0,introPricePeriod:r?.introPrice?.periodDuration||void 0,introPriceCycles:r?.introPrice?.cycleCount||void 0,freeTrialPeriod:r?.trial?.periodDuration||void 0,entitlement:s}},xe=(e,o)=>{const t=e.entitlements.active[o];return t?{isActive:!0,expirationDate:t.expirationDate?new Date(t.expirationDate):void 0,purchaseDate:t.latestPurchaseDate?new Date(t.latestPurchaseDate):void 0,productIdentifier:t.productIdentifier,willRenew:t.willRenew,isSandbox:t.isSandbox,unsubscribeDetectedAt:t.unsubscribeDetectedAt?new Date(t.unsubscribeDetectedAt):void 0,billingIssueDetectedAt:t.billingIssueDetectedAt?new Date(t.billingIssueDetectedAt):void 0}:{isActive:!1}},Ve=P.createContext(void 0),jt=({apiKey:e,entitlementId:o,userEmail:t,onError:r,onPurchaseSuccess:s,children:n})=>{const[a,f]=P.useState([]),[u,g]=P.useState(null),[y,v]=P.useState(!1),[_,x]=P.useState(null),[O,N]=P.useState(!1),[w,V]=P.useState(null),[F,$]=P.useState(null),[A,S]=P.useState(null),C=!e||e==="your_revenuecat_api_key_here",W=P.useCallback(()=>{f([]),g(null),$(null),S(null),x(null),N(!1),V(null),E=null},[]),p=P.useCallback(async()=>{if(E)try{const m=await E.getOfferings();m.current&&$(m.current);const b=m.all;if(b){S(b);const i=[];for(const j of Object.keys(b)){const L=b[j];if(L?.availablePackages){const U=L.metadata,H=L.availablePackages.map(T=>Fe(T,U));i.push(...H)}}f(i)}else if(m.current){const i=m.current.metadata,j=m.current.availablePackages.map(L=>Fe(L,i));f(j)}}catch(m){const b=m instanceof Error?m.message:"Failed to load offerings";x(b),r?.(m instanceof Error?m:new Error(b))}},[r]),I=P.useCallback(async()=>{if(E)try{const m=await E.getCustomerInfo(),b=xe(m,o);g(b.isActive?b:null)}catch(m){const b=m instanceof Error?m.message:"Failed to load subscription status";x(b),r?.(m instanceof Error?m:new Error(b))}},[o,r]),G=P.useCallback(async(m,b)=>{if(w&&w!==m&&W(),!(O&&w===m))try{if(v(!0),x(null),C)console.warn("[SubscriptionProvider] RevenueCat API key not configured"),f([]),g(null);else{const i=await Gt(),j={apiKey:e,appUserId:m};E=i.Purchases.configure(j);const L=b||t;if(L&&E)try{await E.setAttributes({email:L})}catch{}await Promise.all([p(),I()])}V(m),N(!0)}catch(i){const j=i instanceof Error?i.message:"Failed to initialize";x(j),g(null),f([]),r?.(i instanceof Error?i:new Error(j))}finally{v(!1)}},[w,O,C,e,t,p,I,r,W]),Y=P.useCallback(async m=>{try{if(v(!0),x(null),C){await new Promise(U=>setTimeout(U,2e3));const L={isActive:!0,expirationDate:new Date(Date.now()+365*24*60*60*1e3),purchaseDate:new Date,productIdentifier:m,willRenew:!0};return g(L),s?.(m),!0}if(!E||!F&&!A)throw new Error("Subscription service not initialized");let b;if(A)for(const L of Object.keys(A)){const U=A[L];if(U?.availablePackages&&(b=U.availablePackages.find(H=>H.identifier===m),b))break}else F&&(b=F.availablePackages.find(U=>U.identifier===m));if(!b)throw new Error(`Package not found: ${m}`);const i=await E.purchase({rcPackage:b,...t?{customerEmail:t}:{}}),j=xe(i.customerInfo,o);return g(j.isActive?j:null),j.isActive&&s?.(m),j.isActive}catch(b){const i=b instanceof Error?b.message:"Purchase failed";return x(i),r?.(b instanceof Error?b:new Error(i)),!1}finally{v(!1)}},[C,F,A,t,o,s,r]),ee=P.useCallback(async()=>{try{if(v(!0),x(null),C)return await new Promise(i=>setTimeout(i,1e3)),x("No previous purchases found"),!1;if(!E)throw new Error("Subscription service not initialized");const m=await E.getCustomerInfo(),b=xe(m,o);return g(b.isActive?b:null),b.isActive||x("No previous purchases found"),b.isActive}catch(m){const b=m instanceof Error?m.message:"Restore failed";return x(b),r?.(m instanceof Error?m:new Error(b)),!1}finally{v(!1)}},[C,o,r]),ie=P.useCallback(async()=>{if(!C)try{x(null),await Promise.all([I(),p()])}catch(m){const b=m instanceof Error?m.message:"Refresh failed";x(b),r?.(m instanceof Error?m:new Error(b))}},[C,I,p,r]),re=P.useCallback(()=>{x(null)},[]);P.useEffect(()=>{if(!O||C||!E)return;const m=setInterval(()=>{I().catch(()=>{})},300*1e3);return()=>clearInterval(m)},[O,C,I]);const X={products:a,currentSubscription:u,isLoading:y,error:_,initialize:G,purchase:Y,restore:ee,refresh:ie,clearError:re};return d.jsx(Ve.Provider,{value:X,children:n})},Lt=()=>{const e=P.useContext(Ve);if(!e)throw new Error("useSubscriptionContext must be used within a SubscriptionProvider");return e},$e=()=>{try{const e=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);r&&(r.includes("revenuecat")||r.includes("rcb")||r.includes("rc_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t));const o=[];for(let t=0;t<sessionStorage.length;t++){const r=sessionStorage.key(t);r&&(r.includes("revenuecat")||r.includes("rcb")||r.includes("rc_"))&&o.push(r)}o.forEach(t=>sessionStorage.removeItem(t))}catch{}},_t=()=>{try{E&&(E.close(),E=null),$e()}catch{}};D.SegmentedControl=Et,D.SubscriptionLayout=Tt,D.SubscriptionProvider=jt,D.SubscriptionTile=_e,D.clearRevenueCatCheckoutSessions=$e,D.closeRevenueCatInstance=_t,D.cn=k,D.useSubscriptionContext=Lt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-tile.d.ts","sourceRoot":"","sources":["../src/subscription-tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,iDAAiD;IACjD,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,uCAAuC;IACvC,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACvD,8BAA8B;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"subscription-tile.d.ts","sourceRoot":"","sources":["../src/subscription-tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,iDAAiD;IACjD,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,uCAAuC;IACvC,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACvD,8BAA8B;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAgT5D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|