@moonbase.sh/storefront 0.4.46 → 0.4.47
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/moonbase.js +2 -2
- package/dist/moonbase.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/moonbase.js
CHANGED
|
@@ -17413,7 +17413,7 @@ function SE(e, t) {
|
|
|
17413
17413
|
const Ae = /* @__PURE__ */ ur(xE, [["render", SE]]), CE = { class: "moonbase:about" }, NE = /* @__PURE__ */ pe({
|
|
17414
17414
|
__name: "About",
|
|
17415
17415
|
setup(e) {
|
|
17416
|
-
const t = $e(), n = "0.4.
|
|
17416
|
+
const t = $e(), n = "0.4.47";
|
|
17417
17417
|
return (r, o) => (b(), O("div", CE, [
|
|
17418
17418
|
o[2] || (o[2] = rp('<svg viewBox="0 0 512 512" height="56px" width="56px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>', 1)),
|
|
17419
17419
|
E(v(Lp), { as: "h3" }, {
|
|
@@ -18745,7 +18745,7 @@ const Rt = /* @__PURE__ */ ur(i5, [["render", l5]]), u5 = ["data-corners"], c5 =
|
|
|
18745
18745
|
onSignedUp: o[1] || (o[1] = (s) => v(t).next ? v(t).dequeue() : v(t).show(v(ue).Customer, v(Q).ViewAccount, void 0, !0))
|
|
18746
18746
|
})) : v(t).intent === v(Q).ConfirmAccount ? (b(), Z(D5, {
|
|
18747
18747
|
key: 3,
|
|
18748
|
-
onConfirmedAccount: o[2] || (o[2] = (s) => v(t).show(v(ue).Customer, v(Q).
|
|
18748
|
+
onConfirmedAccount: o[2] || (o[2] = (s) => v(t).show(v(ue).Customer, v(Q).ViewProducts, void 0, !0))
|
|
18749
18749
|
})) : v(t).intent === v(Q).ConfirmEmail ? (b(), Z(R5, { key: 4 })) : v(t).intent === v(Q).ConfirmEmailChange ? (b(), Z(B5, { key: 5 })) : v(t).intent === v(Q).ForgotPassword ? (b(), Z(z5, { key: 6 })) : v(t).intent === v(Q).ResetPassword ? (b(), Z(W5, {
|
|
18750
18750
|
key: 7,
|
|
18751
18751
|
onPasswordReset: o[3] || (o[3] = (s) => v(t).show(v(ue).Customer, v(Q).ViewAccount, void 0))
|
package/dist/moonbase.umd.cjs
CHANGED
|
@@ -33,4 +33,4 @@ This will fail in production.`);a=ui,a._s.has(r)||(s?xu(r,t,o,a):Yh(r,o,a),Ue.NO
|
|
|
33
33
|
*
|
|
34
34
|
* You can read more about the APCA Readability Criterion at
|
|
35
35
|
* https://readtech.org/ARC/
|
|
36
|
-
*/const Bp=.027,C2=5e-4,N2=.1,Fp=1.14,Wa=.022,zp=1.414,P2=(e,t)=>{e=new Q(e),t=new Q(t),e.alpha()<1&&(e=Jo(t,e,e.alpha(),"rgb"));const n=Hp(...e.rgb()),r=Hp(...t.rgb()),o=n>=Wa?n:n+Math.pow(Wa-n,zp),s=r>=Wa?r:r+Math.pow(Wa-r,zp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<C2?0:o<s?i*Fp:a*Fp;return(Math.abs(l)<N2?0:l>0?l-Bp:l+Bp)*100};function Hp(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:ir,pow:pt,min:T2,max:$2,atan2:qp,abs:Wp,cos:Za,sin:Zp,exp:A2,PI:Yp}=Math;function D2(e,t,n=1,r=1,o=1){var s=function($e){return 360*$e/(2*Yp)},i=function($e){return 2*Yp*$e/360};e=new Q(e),t=new Q(t);const[a,l,u]=Array.from(e.lab()),[c,d,f]=Array.from(t.lab()),h=(a+c)/2,p=ir(pt(l,2)+pt(u,2)),g=ir(pt(d,2)+pt(f,2)),_=(p+g)/2,S=.5*(1-ir(pt(_,7)/(pt(_,7)+pt(25,7)))),R=l*(1+S),z=d*(1+S),q=ir(pt(R,2)+pt(u,2)),B=ir(pt(z,2)+pt(f,2)),D=(q+B)/2,y=s(qp(u,R)),P=s(qp(f,z)),I=y>=0?y:y+360,$=P>=0?P:P+360,T=Wp(I-$)>180?(I+$+360)/2:(I+$)/2,M=1-.17*Za(i(T-30))+.24*Za(i(2*T))+.32*Za(i(3*T+6))-.2*Za(i(4*T-63));let ie=$-I;ie=Wp(ie)<=180?ie:$<=I?ie+360:ie-360,ie=2*ir(q*B)*Zp(i(ie)/2);const Se=c-a,N=B-q,H=1+.015*pt(h-50,2)/ir(20+pt(h-50,2)),U=1+.045*D,ne=1+.015*D*M,be=30*A2(-pt((T-275)/25,2)),he=-(2*ir(pt(D,7)/(pt(D,7)+pt(25,7))))*Zp(2*i(be)),we=ir(pt(Se/(n*H),2)+pt(N/(r*U),2)+pt(ie/(o*ne),2)+he*(N/(r*U))*(ie/(o*ne)));return $2(0,T2(100,we))}function I2(e,t,n="lab"){e=new Q(e),t=new Q(t);const r=e.get(n),o=t.get(n);let s=0;for(let i in r){const a=(r[i]||0)-(o[i]||0);s+=a*a}return Math.sqrt(s)}const M2=(...e)=>{try{return new Q(...e),!0}catch{return!1}},V2={cool(){return qa([Ve.hsl(180,1,.9),Ve.hsl(250,.7,.4)])},hot(){return qa(["#000","#f00","#ff0","#fff"]).mode("rgb")}},nc={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Gp=Object.keys(nc),Kp=new Map(Gp.map(e=>[e.toLowerCase(),e])),R2=typeof Proxy=="function"?new Proxy(nc,{get(e,t){const n=t.toLowerCase();if(Kp.has(n))return e[Kp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Gp)}}):nc,L2=(...e)=>{e=Ie(e,"cmyk");const[t,n,r,o]=e,s=e.length>4?e[4]:1;return o===1?[0,0,0,s]:[t>=1?0:255*(1-t)*(1-o),n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),s]},{max:Xp}=Math,j2=(...e)=>{let[t,n,r]=Ie(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Xp(t,Xp(n,r)),s=o<1?1/(1-o):0,i=(1-t-o)*s,a=(1-n-o)*s,l=(1-r-o)*s;return[i,a,l,o]};Q.prototype.cmyk=function(){return j2(this._rgb)},Object.assign(Ve,{cmyk:(...e)=>new Q(...e,"cmyk")}),Te.format.cmyk=L2,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"cmyk"),je(e)==="array"&&e.length===4)return"cmyk"}});const U2=(...e)=>{const t=Ie(e,"hsla");let n=Ko(e)||"lsa";return t[0]=an(t[0]||0)+"deg",t[1]=an(t[1]*100)+"%",t[2]=an(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},B2=(...e)=>{const t=Ie(e,"lab");let n=Ko(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=an(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},F2=(...e)=>{const t=Ie(e,"lch");let n=Ko(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},z2=(...e)=>{const t=Ie(e,"lab");return t[0]=an(t[0]*100)+"%",t[1]=Uu(t[1]),t[2]=Uu(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Jp=(...e)=>{const[t,n,r,...o]=Ie(e,"rgb"),[s,i,a]=Ju(t,n,r),[l,u,c]=Ap(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},H2=(...e)=>{const t=Ie(e,"lch");return t[0]=an(t[0]*100)+"%",t[1]=Uu(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:rc}=Math,q2=(...e)=>{const t=Ie(e,"rgba");let n=Ko(e)||"rgb";if(n.substr(0,3)==="hsl")return U2(Ip(t),n);if(n.substr(0,3)==="lab"){const r=_i();sr("d50");const o=B2(Hu(t),n);return sr(r),o}if(n.substr(0,3)==="lch"){const r=_i();sr("d50");const o=F2(Yu(t),n);return sr(r),o}return n.substr(0,5)==="oklab"?z2(Ju(t)):n.substr(0,5)==="oklch"?H2(Jp(t)):(t[0]=rc(t[0]),t[1]=rc(t[1]),t[2]=rc(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},Qp=(...e)=>{e=Ie(e,"lch");const[t,n,r,...o]=e,[s,i,a]=$p(t,n,r),[l,u,c]=Xu(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},ar=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,Sn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Ya=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,ln=/\s*/.source,ns=/\s+/.source,oc=/\s*,\s*/.source,Ga=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,rs=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,em=new RegExp("^rgba?\\("+ln+[ar,ar,ar].join(ns)+rs+"\\)$"),tm=new RegExp("^rgb\\("+ln+[ar,ar,ar].join(oc)+ln+"\\)$"),nm=new RegExp("^rgba\\("+ln+[ar,ar,ar,Sn].join(oc)+ln+"\\)$"),rm=new RegExp("^hsla?\\("+ln+[Ga,Ya,Ya].join(ns)+rs+"\\)$"),om=new RegExp("^hsl?\\("+ln+[Ga,Ya,Ya].join(oc)+ln+"\\)$"),sm=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,im=new RegExp("^lab\\("+ln+[Sn,Sn,Sn].join(ns)+rs+"\\)$"),am=new RegExp("^lch\\("+ln+[Sn,Sn,Ga].join(ns)+rs+"\\)$"),lm=new RegExp("^oklab\\("+ln+[Sn,Sn,Sn].join(ns)+rs+"\\)$"),um=new RegExp("^oklch\\("+ln+[Sn,Sn,Ga].join(ns)+rs+"\\)$"),{round:cm}=Math,os=e=>e.map((t,n)=>n<=2?go(cm(t),0,255):t),mt=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),Bt=(e,t)=>e==="none"?t:e,sc=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Te.format.named)try{return Te.format.named(e)}catch{}if((t=e.match(em))||(t=e.match(tm))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+mt(Bt(n[o],0),0,255);n=os(n);const r=t[4]!==void 0?+mt(t[4],0,1):1;return n[3]=r,n}if(t=e.match(nm)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+mt(n[r],0,255);return n}if((t=e.match(rm))||(t=e.match(om))){const n=t.slice(1,4);n[0]=+Bt(n[0].replace("deg",""),0),n[1]=+mt(Bt(n[1],0),0,100)*.01,n[2]=+mt(Bt(n[2],0),0,100)*.01;const r=os(Ku(n)),o=t[4]!==void 0?+mt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(sm)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Ku(n);for(let o=0;o<3;o++)r[o]=cm(r[o]);return r[3]=+t[4],r}if(t=e.match(im)){const n=t.slice(1,4);n[0]=mt(Bt(n[0],0),0,100),n[1]=mt(Bt(n[1],0),-125,125,!0),n[2]=mt(Bt(n[2],0),-125,125,!0);const r=_i();sr("d50");const o=os(Fu(n));sr(r);const s=t[4]!==void 0?+mt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(am)){const n=t.slice(1,4);n[0]=mt(n[0],0,100),n[1]=mt(Bt(n[1],0),0,150,!1),n[2]=+Bt(n[2].replace("deg",""),0);const r=_i();sr("d50");const o=os(Zu(n));sr(r);const s=t[4]!==void 0?+mt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(lm)){const n=t.slice(1,4);n[0]=mt(Bt(n[0],0),0,1),n[1]=mt(Bt(n[1],0),-.4,.4,!0),n[2]=mt(Bt(n[2],0),-.4,.4,!0);const r=os(Xu(n)),o=t[4]!==void 0?+mt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(um)){const n=t.slice(1,4);n[0]=mt(Bt(n[0],0),0,1),n[1]=mt(Bt(n[1],0),0,.4,!1),n[2]=+Bt(n[2].replace("deg",""),0);const r=os(Qp(n)),o=t[4]!==void 0?+mt(t[4],0,1):1;return r[3]=o,r}};sc.test=e=>em.test(e)||rm.test(e)||im.test(e)||am.test(e)||lm.test(e)||um.test(e)||tm.test(e)||nm.test(e)||om.test(e)||sm.test(e)||e==="transparent",Q.prototype.css=function(e){return q2(this._rgb,e)};const W2=(...e)=>new Q(...e,"css");Ve.css=W2,Te.format.css=sc,Te.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&sc.test(e))return"css"}}),Te.format.gl=(...e)=>{const t=Ie(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const Z2=(...e)=>new Q(...e,"gl");Ve.gl=Z2,Q.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Q.prototype.hex=function(e){return Np(this._rgb,e)};const Y2=(...e)=>new Q(...e,"hex");Ve.hex=Y2,Te.format.hex=Cp,Te.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Ka}=Math,dm=e=>{const t=e/100;let n,r,o;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*Ka(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*Ka(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Ka(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Ka(r),o=255),[n,r,o,1]},{round:G2}=Math,K2=(...e)=>{const t=Ie(e,"rgb"),n=t[0],r=t[2];let o=1e3,s=4e4;const i=.4;let a;for(;s-o>i;){a=(s+o)*.5;const l=dm(a);l[2]/l[0]>=r/n?s=a:o=a}return G2(a)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return K2(this._rgb)};const ic=(...e)=>new Q(...e,"temp");Object.assign(Ve,{temp:ic,kelvin:ic,temperature:ic}),Te.format.temp=Te.format.kelvin=Te.format.temperature=dm,Q.prototype.oklch=function(){return Jp(this._rgb)},Object.assign(Ve,{oklch:(...e)=>new Q(...e,"oklch")}),Te.format.oklch=Qp,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"oklch"),je(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Ve,{analyze:jp,average:e2,bezier:i2,blend:On,brewer:R2,Color:Q,colors:Xo,contrast:S2,contrastAPCA:P2,cubehelix:v2,deltaE:D2,distance:I2,input:Te,interpolate:Jo,limits:Up,mix:Jo,random:E2,scale:qa,scales:V2,valid:M2});const X2=[{name:"Slate",id:"slate",reference:!1,shades:[{number:50,hexcode:"#f8fafc"},{number:100,hexcode:"#f1f5f9"},{number:200,hexcode:"#e2e8f0"},{number:300,hexcode:"#cbd5e1"},{number:400,hexcode:"#94a3b8"},{number:500,hexcode:"#64748b"},{number:600,hexcode:"#475569"},{number:700,hexcode:"#334155"},{number:800,hexcode:"#1e293b"},{number:900,hexcode:"#0f172a"},{number:950,hexcode:"#020617"}]},{name:"Gray",id:"gray",reference:!1,shades:[{number:50,hexcode:"#f9fafb"},{number:100,hexcode:"#f3f4f6"},{number:200,hexcode:"#e5e7eb"},{number:300,hexcode:"#d1d5db"},{number:400,hexcode:"#9ca3af"},{number:500,hexcode:"#6b7280"},{number:600,hexcode:"#4b5563"},{number:700,hexcode:"#374151"},{number:800,hexcode:"#1f2937"},{number:900,hexcode:"#111827"},{number:950,hexcode:"#030712"}]},{name:"Zinc",id:"zinc",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f4f4f5"},{number:200,hexcode:"#e4e4e7"},{number:300,hexcode:"#d4d4d8"},{number:400,hexcode:"#a1a1aa"},{number:500,hexcode:"#71717a"},{number:600,hexcode:"#52525b"},{number:700,hexcode:"#3f3f46"},{number:800,hexcode:"#27272a"},{number:900,hexcode:"#18181b"},{number:950,hexcode:"#09090b"}]},{name:"Neutral",id:"neutral",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f5f5f5"},{number:200,hexcode:"#e5e5e5"},{number:300,hexcode:"#d4d4d4"},{number:400,hexcode:"#a3a3a3"},{number:500,hexcode:"#737373"},{number:600,hexcode:"#525252"},{number:700,hexcode:"#404040"},{number:800,hexcode:"#262626"},{number:900,hexcode:"#171717"},{number:950,hexcode:"#0a0a0a"}]},{name:"Stone",id:"stone",reference:!1,shades:[{number:50,hexcode:"#fafaf9"},{number:100,hexcode:"#f5f5f4"},{number:200,hexcode:"#e7e5e4"},{number:300,hexcode:"#d6d3d1"},{number:400,hexcode:"#a8a29e"},{number:500,hexcode:"#78716c"},{number:600,hexcode:"#57534e"},{number:700,hexcode:"#44403c"},{number:800,hexcode:"#292524"},{number:900,hexcode:"#1c1917"},{number:950,hexcode:"#0c0a09"}]},{name:"Red",id:"red",reference:!0,shades:[{number:50,hexcode:"#fef2f2"},{number:100,hexcode:"#fee2e2"},{number:200,hexcode:"#fecaca"},{number:300,hexcode:"#fca5a5"},{number:400,hexcode:"#f87171"},{number:500,hexcode:"#ef4444"},{number:600,hexcode:"#dc2626"},{number:700,hexcode:"#b91c1c"},{number:800,hexcode:"#991b1b"},{number:900,hexcode:"#7f1d1d"},{number:950,hexcode:"#450a0a"}]},{name:"Orange",id:"orange",reference:!0,shades:[{number:50,hexcode:"#fff7ed"},{number:100,hexcode:"#ffedd5"},{number:200,hexcode:"#fed7aa"},{number:300,hexcode:"#fdba74"},{number:400,hexcode:"#fb923c"},{number:500,hexcode:"#f97316"},{number:600,hexcode:"#ea580c"},{number:700,hexcode:"#c2410c"},{number:800,hexcode:"#9a3412"},{number:900,hexcode:"#7c2d12"},{number:950,hexcode:"#431407"}]},{name:"Amber",id:"amber",reference:!0,shades:[{number:50,hexcode:"#fffbeb"},{number:100,hexcode:"#fef3c7"},{number:200,hexcode:"#fde68a"},{number:300,hexcode:"#fcd34d"},{number:400,hexcode:"#fbbf24"},{number:500,hexcode:"#f59e0b"},{number:600,hexcode:"#d97706"},{number:700,hexcode:"#b45309"},{number:800,hexcode:"#92400e"},{number:900,hexcode:"#78350f"},{number:950,hexcode:"#451a03"}]},{name:"Yellow",id:"yellow",reference:!0,shades:[{number:50,hexcode:"#fefce8"},{number:100,hexcode:"#fef9c3"},{number:200,hexcode:"#fef08a"},{number:300,hexcode:"#fde047"},{number:400,hexcode:"#facc15"},{number:500,hexcode:"#eab308"},{number:600,hexcode:"#ca8a04"},{number:700,hexcode:"#a16207"},{number:800,hexcode:"#854d0e"},{number:900,hexcode:"#713f12"},{number:950,hexcode:"#422006"}]},{name:"Lime",id:"lime",reference:!0,shades:[{number:50,hexcode:"#f7fee7"},{number:100,hexcode:"#ecfccb"},{number:200,hexcode:"#d9f99d"},{number:300,hexcode:"#bef264"},{number:400,hexcode:"#a3e635"},{number:500,hexcode:"#84cc16"},{number:600,hexcode:"#65a30d"},{number:700,hexcode:"#4d7c0f"},{number:800,hexcode:"#3f6212"},{number:900,hexcode:"#365314"},{number:950,hexcode:"#1a2e05"}]},{name:"Green",id:"green",reference:!0,shades:[{number:50,hexcode:"#f0fdf4"},{number:100,hexcode:"#dcfce7"},{number:200,hexcode:"#bbf7d0"},{number:300,hexcode:"#86efac"},{number:400,hexcode:"#4ade80"},{number:500,hexcode:"#22c55e"},{number:600,hexcode:"#16a34a"},{number:700,hexcode:"#15803d"},{number:800,hexcode:"#166534"},{number:900,hexcode:"#14532d"},{number:950,hexcode:"#052e16"}]},{name:"Emerald",id:"emerald",reference:!0,shades:[{number:50,hexcode:"#ecfdf5"},{number:100,hexcode:"#d1fae5"},{number:200,hexcode:"#a7f3d0"},{number:300,hexcode:"#6ee7b7"},{number:400,hexcode:"#34d399"},{number:500,hexcode:"#10b981"},{number:600,hexcode:"#059669"},{number:700,hexcode:"#047857"},{number:800,hexcode:"#065f46"},{number:900,hexcode:"#064e3b"},{number:950,hexcode:"#022c22"}]},{name:"Teal",id:"teal",reference:!0,shades:[{number:50,hexcode:"#f0fdfa"},{number:100,hexcode:"#ccfbf1"},{number:200,hexcode:"#99f6e4"},{number:300,hexcode:"#5eead4"},{number:400,hexcode:"#2dd4bf"},{number:500,hexcode:"#14b8a6"},{number:600,hexcode:"#0d9488"},{number:700,hexcode:"#0f766e"},{number:800,hexcode:"#115e59"},{number:900,hexcode:"#134e4a"},{number:950,hexcode:"#042f2e"}]},{name:"Cyan",id:"cyan",reference:!0,shades:[{number:50,hexcode:"#ecfeff"},{number:100,hexcode:"#cffafe"},{number:200,hexcode:"#a5f3fc"},{number:300,hexcode:"#67e8f9"},{number:400,hexcode:"#22d3ee"},{number:500,hexcode:"#06b6d4"},{number:600,hexcode:"#0891b2"},{number:700,hexcode:"#0e7490"},{number:800,hexcode:"#155e75"},{number:900,hexcode:"#164e63"},{number:950,hexcode:"#083344"}]},{name:"Sky",id:"sky",reference:!0,shades:[{number:50,hexcode:"#f0f9ff"},{number:100,hexcode:"#e0f2fe"},{number:200,hexcode:"#bae6fd"},{number:300,hexcode:"#7dd3fc"},{number:400,hexcode:"#38bdf8"},{number:500,hexcode:"#0ea5e9"},{number:600,hexcode:"#0284c7"},{number:700,hexcode:"#0369a1"},{number:800,hexcode:"#075985"},{number:900,hexcode:"#0c4a6e"},{number:950,hexcode:"#082f49"}]},{name:"Blue",id:"blue",reference:!0,shades:[{number:50,hexcode:"#eff6ff"},{number:100,hexcode:"#dbeafe"},{number:200,hexcode:"#bfdbfe"},{number:300,hexcode:"#93c5fd"},{number:400,hexcode:"#60a5fa"},{number:500,hexcode:"#3b82f6"},{number:600,hexcode:"#2563eb"},{number:700,hexcode:"#1d4ed8"},{number:800,hexcode:"#1e40af"},{number:900,hexcode:"#1e3a8a"},{number:950,hexcode:"#172554"}]},{name:"Indigo",id:"indigo",reference:!0,shades:[{number:50,hexcode:"#eef2ff"},{number:100,hexcode:"#e0e7ff"},{number:200,hexcode:"#c7d2fe"},{number:300,hexcode:"#a5b4fc"},{number:400,hexcode:"#818cf8"},{number:500,hexcode:"#6366f1"},{number:600,hexcode:"#4f46e5"},{number:700,hexcode:"#4338ca"},{number:800,hexcode:"#3730a3"},{number:900,hexcode:"#312e81"},{number:950,hexcode:"#1e1b4b"}]},{name:"Violet",id:"violet",reference:!0,shades:[{number:50,hexcode:"#f5f3ff"},{number:100,hexcode:"#ede9fe"},{number:200,hexcode:"#ddd6fe"},{number:300,hexcode:"#c4b5fd"},{number:400,hexcode:"#a78bfa"},{number:500,hexcode:"#8b5cf6"},{number:600,hexcode:"#7c3aed"},{number:700,hexcode:"#6d28d9"},{number:800,hexcode:"#5b21b6"},{number:900,hexcode:"#4c1d95"},{number:950,hexcode:"#2e1065"}]},{name:"Purple",id:"purple",reference:!0,shades:[{number:50,hexcode:"#faf5ff"},{number:100,hexcode:"#f3e8ff"},{number:200,hexcode:"#e9d5ff"},{number:300,hexcode:"#d8b4fe"},{number:400,hexcode:"#c084fc"},{number:500,hexcode:"#a855f7"},{number:600,hexcode:"#9333ea"},{number:700,hexcode:"#7e22ce"},{number:800,hexcode:"#6b21a8"},{number:900,hexcode:"#581c87"},{number:950,hexcode:"#3b0764"}]},{name:"Fuchsia",id:"fuchsia",reference:!0,shades:[{number:50,hexcode:"#fdf4ff"},{number:100,hexcode:"#fae8ff"},{number:200,hexcode:"#f5d0fe"},{number:300,hexcode:"#f0abfc"},{number:400,hexcode:"#e879f9"},{number:500,hexcode:"#d946ef"},{number:600,hexcode:"#c026d3"},{number:700,hexcode:"#a21caf"},{number:800,hexcode:"#86198f"},{number:900,hexcode:"#701a75"},{number:950,hexcode:"#4a044e"}]},{name:"Pink",id:"pink",reference:!0,shades:[{number:50,hexcode:"#fdf2f8"},{number:100,hexcode:"#fce7f3"},{number:200,hexcode:"#fbcfe8"},{number:300,hexcode:"#f9a8d4"},{number:400,hexcode:"#f472b6"},{number:500,hexcode:"#ec4899"},{number:600,hexcode:"#db2777"},{number:700,hexcode:"#be185d"},{number:800,hexcode:"#9d174d"},{number:900,hexcode:"#831843"},{number:950,hexcode:"#500724"}]},{name:"Rose",id:"rose",reference:!0,shades:[{number:50,hexcode:"#fff1f2"},{number:100,hexcode:"#ffe4e6"},{number:200,hexcode:"#fecdd3"},{number:300,hexcode:"#fda4af"},{number:400,hexcode:"#fb7185"},{number:500,hexcode:"#f43f5e"},{number:600,hexcode:"#e11d48"},{number:700,hexcode:"#be123c"},{number:800,hexcode:"#9f1239"},{number:900,hexcode:"#881337"},{number:950,hexcode:"#4c0519"}]}];function J2(e){const r=X2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:Ve.deltaE(e,a.hexcode)}))})).map(i=>({...i,closestShade:i.shades.reduce((a,l)=>a.delta<l.delta?a:l)})).reduce((i,a)=>i.closestShade.delta<a.closestShade.delta?i:a),o=r.shades.map(i=>({...i,lightnessDifference:Math.abs(Ve(i.hexcode).get("hsl.l")-e.get("hsl.l"))})),s=o.reduce((i,a)=>i.lightnessDifference<a.lightnessDifference?i:a);return{...r,shades:o,closestShade:s}}function Q2(e){const t=Ve(e),n=J2(t),r=t.get("hsl.h"),o=Ve(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/Ve(n.closestShade.hexcode).get("hsl.s");return n.shades.map(u=>{if(u.number===n.closestShade.number)return{number:u.number,hexcode:t.hex()};let c=Ve(u.hexcode);const d=c.get("hsl.s")*a;return c=c.set("hsl.s",d),c=c.set("hsl.h",i),{number:u.number,hexcode:c.hex()}})}class ss extends Error{constructor(){super(),this.name="IndiscriminateError"}}const eE={},tE={fill:"none",viewBox:"0 0 24 24"};function nE(e,t){return b(),x("svg",tE,t[0]||(t[0]=[j("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),j("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))}const tn=rr(eE,[["render",nE],["__scopeId","data-v-687bcaf0"]]),rE={"aria-hidden":"true"},ac=pe({__name:"MoonButtonBase",props:{label:{},successLabel:{},errorLabel:{},icon:{},variant:{},size:{},working:{type:Boolean},success:{type:Boolean},error:{type:Boolean},disabled:{type:Boolean},type:{}},emits:["click"],setup(e){const t=e,n=me(lt),r=te(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=te(()=>t.variant?t.variant==="secondary"?`secondary-${(n==null?void 0:n.value.theme.buttons)??"light"}`:t.variant:"primary");return(s,i)=>{var a,l;return b(),Z(Yl(s.type==="anchor"?"a":"button"),{class:"moonbase:button",type:s.type||"button",disabled:s.success||s.error||s.working||s.disabled,"data-success":s.success||void 0,"data-error":s.error||void 0,"data-working":s.working||void 0,"data-variant":o.value,"data-size":s.size||"large","data-corners":(a=v(n))==null?void 0:a.theme.corners,"data-background":(l=v(n))==null?void 0:l.theme.colors.background,"data-icon-visible":s.working||s.success||s.error||!!s.icon||void 0,onClick:i[0]||(i[0]=u=>s.$emit("click",u))},{default:k(()=>[j("div",rE,[s.working?(b(),Z(tn,{key:0})):s.success?(b(),Z(v(E_),{key:1})):s.error?(b(),Z(v(S_),{key:2})):s.icon?(b(),Z(Yl(s.icon),{key:3})):se("",!0)]),A(" "+V(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),Je=pe({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},icon:{},variant:{},size:{},noReset:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,n=L(!1),r=L(!1),o=L(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Wt(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof ss)return;o.value=!0,await Wt(2500),o.value=!1}}return(i,a)=>(b(),Z(ac,{label:i.label,working:n.value,"success-label":i.success,success:r.value,"error-label":i.error,error:o.value,icon:i.icon,disabled:i.disabled,variant:i.variant,size:i.size,onClick:s},null,8,["label","working","success-label","success","error-label","error","icon","disabled","variant","size"]))}}),oE={},sE={class:"moonbase:text-body"};function iE(e,t){return b(),x("span",sE,[Ct(e.$slots,"default")])}const rt=rr(oE,[["render",iE]]),aE={},lE={class:"moonbase:text-subtext"};function uE(e,t){return b(),x("span",lE,[Ct(e.$slots,"default")])}const Me=rr(aE,[["render",uE]]),cE={class:"moonbase:about"},dE=pe({__name:"About",setup(e){const t=De(),n="0.4.46";return(r,o)=>(b(),x("div",cE,[o[2]||(o[2]=Jf('<svg viewBox="0 0 512 512" height="56px" width="56px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>',1)),E(v(pp),{as:"h3"},{default:k(()=>o[0]||(o[0]=[A(" Moonbase Embedded Storefront ")])),_:1,__:[0]}),E(Me,null,{default:k(()=>[A(" Version "+V(v(n)),1)]),_:1}),E(rt,null,{default:k(()=>o[1]||(o[1]=[A(" This store is using the "),j("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),A(" module to accept payments, provide authentication and power software licensing. ")])),_:1,__:[1]}),E(Je,{label:"Close",variant:"primary",handler:()=>v(t).reset()},null,8,["handler"])]))}});var Zt=(e=>(e.SignedIn="signed-in",e.SignedUp="signed-up",e.SignedOut="signed-out",e.RedeemedVoucher="redeemed-voucher",e.DownloadedProduct="downloaded-product",e.ActivatedProduct="activated-product",e.AddedToCart="added-to-cart",e.CheckoutInitiated="checkout-initiated",e.CheckoutClosed="checkout-closed",e.CheckoutCompleted="checkout-completed",e))(Zt||{});const fE=["data-corners","data-variant"],hE={class:"moonbase:card-content"},un=pe({__name:"MoonCard",setup(e){const t=me(lt);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:card","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-variant":(s=v(t))==null?void 0:s.theme.cards},[j("div",hE,[Ct(n.$slots,"default")]),Ct(n.$slots,"addon")],8,fE)}}}),pE=["data-corners"],mE=["href"],bE=["src"],gE=["src"],vE={key:2,class:"moonbase:image-placeholder"},Ft=pe({__name:"ProductIcon",props:{url:{},href:{},size:{}},setup(e){const t=me(lt);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:product-icon",style:Ds({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=v(t))==null?void 0:o.theme.corners},[n.href&&n.url?(b(),x("a",{key:0,href:n.href},[j("img",{src:n.url,alt:""},null,8,bE)],8,mE)):n.url?(b(),x("img",{key:1,src:n.url,alt:""},null,8,gE)):(b(),x("div",vE,[E(v(k_))]))],12,pE)}}}),yE={},_E={class:"moonbase:text-title"};function wE(e,t){return b(),x("h4",_E,[Ct(e.$slots,"default")])}const is=rr(yE,[["render",wE]]),EE={class:"moonbase:product-card-content"},fm=pe({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(b(),Z(un,{class:"moonbase:product-card"},{default:k(()=>[E(Ft,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",EE,[E(is,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),Ct(t.$slots,"description")]),Ct(t.$slots,"default")]),_:3}))}}),kE={class:"moonbase:auto-activation"},xE={key:0,class:"moonbase:loader"},OE={key:1,class:"moonbase:loader"},SE={key:2,class:"moonbase:loader"},CE={key:3},NE={key:1,class:"moonbase:loader"},PE={key:2,class:"moonbase:loader"},TE={key:3,class:"moonbase:loader"},$E={key:4,class:"moonbase:auto-activation-content"},AE={key:0,class:"moonbase:auto-activation-option"},DE={class:"moonbase:auto-activation-cta"},IE={key:1,class:"moonbase:auto-activation-option"},ME={class:"moonbase:auto-activation-cta"},VE={key:2,class:"moonbase:auto-activation-option"},RE={key:3,class:"moonbase:auto-activation-option"},LE={class:"moonbase:auto-activation-cta"},jE={key:4,class:"moonbase:auto-activation-option"},UE={key:4,class:"moonbase:auto-activation-cta"},BE={key:5,class:"moonbase:auto-activation-cta"},FE=pe({__name:"AutoActivation",setup(e){const t=De(),{user:n,loaded:r}=tt(),o=me(Lr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=Ry(s),h=me(jt);Xe(i,y=>{var P;!l.value&&!u.value&&(y==null?void 0:y.status)===pn.Requested&&((P=y==null?void 0:y.licenseEligibility)!=null&&P.eligible)&&d(),(y==null?void 0:y.status)===pn.Completed&&(o==null||o(Zt.ActivatedProduct,{product:y.product,fulfillmentType:y.fulfillmentType,user:n.value}))},{deep:!0});const p=te(()=>{if(i.value)return v(li(i.value.product.id))}),g=te(()=>p.value&&p.value.defaultVariation),{currency:_,addToCart:S,setQuantity:R}=tr();function z(){t.show(ue.Product,J.ViewProduct,{product_id:i.value.product.id})}function q(){t.enqueue(ue.Activation,J.ActivateProduct,t.parameters??void 0),t.show(ue.Authentication,J.SignIn)}function B(){if(!p.value)return;const y=S(p.value);R(y,1),t.enqueue(ue.Activation,J.ActivateProduct,t.parameters),t.show(ue.Cart,J.ViewCart)}function D(){var y;t.enqueue(ue.Activation,J.ActivateProduct,{...t.parameters,product_id:((y=i.value)==null?void 0:y.product.id)??""}),n.value?t.show(ue.Customer,J.RedeemVoucher):t.show(ue.Redeem,J.RedeemVoucher)}return(y,P)=>{var I,$,T,M,ie,Se,N;return b(),x("div",kE,[v(a)||!v(r)||!((I=v(h))!=null&&I.loadedStorefront)?(b(),x("div",xE,[E(tn)])):v(c)?(b(),x("div",OE,[E(nt,null,{default:k(()=>P[0]||(P[0]=[A(" Uh oh ")])),_:1,__:[0]}),E(rt,null,{default:k(()=>[A(V(v(c)),1)]),_:1})])):v(i)?(b(),x("div",CE,[v(i).product?(b(),Z(fm,{key:0,product:v(i).product},null,8,["product"])):se("",!0),(($=v(i))==null?void 0:$.status)===v(pn).Cancelled?(b(),x("div",NE,[E(nt,null,{default:k(()=>P[3]||(P[3]=[A(" Uh oh ")])),_:1,__:[3]}),E(rt,null,{default:k(()=>P[4]||(P[4]=[A(" This activation request was cancelled, open your app to try again. ")])),_:1,__:[4]})])):v(l)||v(u)?(b(),x("div",PE,[E(tn),E(rt,null,{default:k(()=>[A(" Activating "+V(v(i).product.name)+"... ",1)]),_:1})])):((T=v(i))==null?void 0:T.status)===v(pn).Completed?(b(),x("div",TE,[E(nt,null,{default:k(()=>P[5]||(P[5]=[A(" Done! ")])),_:1,__:[5]}),E(rt,null,{default:k(()=>P[6]||(P[6]=[A(" Your product is activated. "),j("br",null,null,-1),A(" You may close this window and return to the app. ")])),_:1,__:[6]})])):(b(),x("div",$E,[g.value?(b(),x("div",AE,[E(nt,null,{default:k(()=>P[7]||(P[7]=[A(" Option 1: Purchase product ")])),_:1,__:[7]}),E(rt,null,{default:k(()=>[A(" Buy a copy of "+V(p.value.name)+" for ",1),j("strong",null,V(v(Ut)(p.value.defaultVariation.price[v(_)],v(_))),1),P[8]||(P[8]=A(". "))]),_:1,__:[8]}),j("span",DE,[E(Je,{label:"Purchase",variant:"primary",handler:()=>B()},null,8,["handler"])])])):se("",!0),v(n)?!v(n).ownedProducts||!((M=v(n).ownedProducts)!=null&&M.includes(v(i).product.id))&&!v(n).subscribedProducts||!((ie=v(n).subscribedProducts)!=null&&ie.includes(v(i).product.id))?(b(),x("div",VE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(rt,null,{default:k(()=>P[10]||(P[10]=[A(" You don't own any licenses for this product. ")])),_:1,__:[10]})])):(Se=v(n).ownedProducts)!=null&&Se.includes(v(i).product.id)||(N=v(n).subscribedProducts)!=null&&N.includes(v(i).product.id)?(b(),x("div",RE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(rt,null,{default:k(()=>P[11]||(P[11]=[A(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1,__:[11]}),j("span",LE,[E(Je,{label:"Licenses",variant:"secondary",handler:()=>z()},null,8,["handler"])])])):se("",!0):(b(),x("div",IE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(rt,null,{default:k(()=>P[9]||(P[9]=[A(" Please sign in to use a license for this product. ")])),_:1,__:[9]}),j("span",ME,[E(Je,{label:"Sign in",variant:"secondary",handler:()=>q()},null,8,["handler"])])])),v(i).trialEligibility?(b(),x("div",jE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"3":"2")+": Start trial ",1)]),_:1}),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),Z(rt,{key:0},{default:k(()=>P[12]||(P[12]=[A(" You need to be signed in to start a trial for this product. ")])),_:1,__:[12]})):v(i).trialEligibility.eligible&&v(i).trialEligibility.existing?(b(),Z(rt,{key:1},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+V(v(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):v(i).trialEligibility.eligible?(b(),Z(rt,{key:2},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(b(),Z(rt,{key:3},{default:k(()=>P[13]||(P[13]=[A(" This device or product is not eligible for a trial. ")])),_:1,__:[13]})),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),x("span",UE,[E(Je,{label:"Sign in",variant:"secondary",handler:()=>q()},null,8,["handler"])])):v(i).trialEligibility.eligible?(b(),x("span",BE,[E(Je,{label:"Start trial",variant:"secondary",handler:v(f)},null,8,["handler"])])):se("",!0)])):se("",!0),P[15]||(P[15]=j("div",{class:"moonbase:grow"},null,-1)),E(Me,{class:"moonbase:auto-activation-redeem"},{default:k(()=>[P[14]||(P[14]=A(" Have a voucher code? ")),j("button",{type:"button",onClick:D}," Redeem now ")]),_:1,__:[14]})]))])):(b(),x("div",SE,[E(nt,null,{default:k(()=>P[1]||(P[1]=[A(" Uh oh ")])),_:1,__:[1]}),E(rt,null,{default:k(()=>P[2]||(P[2]=[A(" Could not find activation request ")])),_:1,__:[2]})]))])}}}),zE={},HE={class:"moonbase:text-caption"};function qE(e,t){return b(),x("span",HE,[Ct(e.$slots,"default")])}const zt=rr(zE,[["render",qE]]),WE=["data-corners"],ZE=["accept"],YE={"data-error":""},GE=pe({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=me(lt),o=L(!1),s=te(()=>{let u=".dt";return r!=null&&r.value&&(u=r.value.activation.deviceTokenFileExtension),u.startsWith(".")?u:`.${u}`});function i(u){const c=new FileReader;c.onload=d=>{var f;n("input",(f=d.target)==null?void 0:f.result)},c.readAsText(u)}function a(u){var d;o.value=!1;const c=(d=u.dataTransfer)==null?void 0:d.files;if(!c||c.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(c[0])}function l(u){const c=u.target,d=c==null?void 0:c.files;if(!d||d.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(d[0])}return(u,c)=>{var d,f;return b(),x("div",{class:Is(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=v(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=$r(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=$r(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=$r(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=$r(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=$r(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=$r(h=>o.value=!1,["prevent","stop"])),onDrop:$r(a,["prevent","stop"])},[E(v(O_)),c[6]||(c[6]=j("label",{for:"fallback-input"},[j("span",{class:"moonbase:underline"},"Choose a machine file"),A(" or drag here to upload ")],-1)),j("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,ZE),j("p",YE,V((f=u.error)==null?void 0:f.message),1)],42,WE)}}}),KE={class:"moonbase:manual-activation"},XE={key:1,class:"moonbase:loader"},JE={key:2,class:"moonbase:manual-activation-content"},QE=pe({__name:"ManualActivation",setup(e){const t=me(lt),{activateProduct:n}=ao(),r=Fi.Offline,o=L(0),s=L(null),i=L(null);async function a(l){o.value=1;try{i.value=await n(l,r),o.value=2}catch(u){s.value=u,o.value=0}}return(l,u)=>(b(),x("div",KE,[E(rt,null,{default:k(()=>u[2]||(u[2]=[A(" Upload your machine file here to get a license file for activating offline devices. The machine file can be generated in the installed app. ")])),_:1,__:[2]}),E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[o.value===0?(b(),Z(GE,{key:0,error:s.value,onInput:u[0]||(u[0]=c=>a(c)),onError:u[1]||(u[1]=c=>s.value=c)},null,8,["error"])):o.value===1?(b(),x("div",XE,[E(tn)])):o.value===2&&i.value?(b(),x("div",JE,[E(nt,null,{default:k(()=>u[3]||(u[3]=[A(" Success! ")])),_:1,__:[3]}),E(rt,null,{default:k(()=>u[4]||(u[4]=[A(" Your license can be downloaded below: ")])),_:1,__:[4]}),i.value.license.product?(b(),Z(fm,{key:0,product:i.value.license.product},{description:k(()=>[E(zt,null,{default:k(()=>[A(V(i.value.license.activeNumberOfActivations)+" of "+V(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:k(()=>{var c;return[E(Yo,{href:i.value.url,target:"_blank",download:((c=v(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:k(()=>[E(v(x_))]),_:1},8,["href","download"])]}),_:1},8,["product"])):se("",!0),u[5]||(u[5]=j("div",null,null,-1)),u[6]||(u[6]=j("div",null,null,-1))])):se("",!0)]),_:1})]))}}),e5={class:"moonbase:activation"},t5=pe({__name:"Activation",setup(e){const t=De();return(n,r)=>(b(),x("div",e5,[v(t).getParameter("token")?(b(),Z(FE,{key:0})):(b(),Z(QE,{key:1}))]))}}),n5=["disabled"],hm=Symbol("form-state"),lr=pe({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=L(!1),r=L(!1),o=L(!1),s=te(()=>t.disabled||n.value||r.value||!1);qt(hm,{working:n,isSuccess:r,isError:o,disabled:s});async function i(){n.value=!0;try{await t.handler(),n.value=!1,r.value=!0,await Wt(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Wt(2500),o.value=!1}}return(a,l)=>(b(),x("form",{disabled:s.value,onSubmit:$r(i,["prevent"])},[Ct(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,n5))}}),r5=["hidden"],o5=["for"],s5=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],i5=["id"],a5=["id"],$t=pe({inheritAttrs:!1,__name:"MoonInput",props:{name:{},label:{},placeholder:{},type:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{},hidden:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=me(lt);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:input",hidden:n.hidden||void 0},[j("label",{for:`mb-${n.name}`},V(n.label),9,o5),j("input",uu({id:`mb-${n.name}`,type:n.type??"text",name:`mb-${n.name}`,placeholder:n.placeholder,value:n.modelValue,disabled:n.disabled,"aria-invalid":!!n.error,"aria-describedby":n.error?`mb-${n.name}-error`:n.hint?`mb-${n.name}-hint`:void 0,"data-corners":(o=v(t))==null?void 0:o.theme.corners},n.$attrs,{onInput:r[0]||(r[0]=s=>{var i;return n.$emit("update:modelValue",(i=s.target)==null?void 0:i.value)})}),null,16,s5),n.error?(b(),x("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},V(n.error),9,i5)):n.hint?(b(),x("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},V(n.hint),9,a5)):se("",!0)],8,r5)}}}),ur=pe({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=me(hm);return(s,i)=>(b(),Z(ac,{label:s.label,working:v(t),"success-label":s.success,success:v(n),"error-label":s.error,error:v(r),type:"submit",disabled:v(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),l5=["data-visible"],u5={class:"moonbase:sign-in-actions"},c5=["data-corners"],d5=pe({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(lt),i=me(Lr),a=L(r.getParameter("email")??""),l=L(""),u=L(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(Zt.SignedIn,{user:d}),Wt(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof yr?u.value="User not found":u.value=d.message,d}}return(d,f)=>(b(),Z(lr,{handler:c,class:"moonbase:sign-in"},{default:k(()=>{var h,p,g;return[E($t,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=_=>a.value=_),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E($t,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,l5),E(ur,{success:"Signed in",label:"Sign in",error:"Error"}),j("div",u5,[(h=v(s))!=null&&h.auth.signUp.enabled?(b(),Z(Je,{key:0,label:"Create account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignUp,{email:a.value})},null,8,["handler"])):se("",!0),E(Je,{label:"Forgot password",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).ForgotPassword,{email:a.value})},null,8,["handler"])]),(p=v(s))!=null&&p.auth.signIn.hint?(b(),x("div",{key:0,class:"moonbase:sign-in-hint","data-corners":(g=v(s))==null?void 0:g.theme.corners},[E(v(C_)),E(Me,null,{default:k(()=>[A(V(v(s).auth.signIn.hint),1)]),_:1})],8,c5)):se("",!0)]}),_:1}))}}),lc={default:[{title:"Password must be at least 6 characters long",test:e=>e.length>=6},{title:"Password must contain uppercase letters",test:e=>/[A-Z]/.test(e)},{title:"Password must contain lowercase letters",test:e=>/[a-z]/.test(e)},{title:"Password must contain at least one number",test:e=>/\d/.test(e)},{title:"Password must contain at least one special character",test:e=>/[=+\-^$*.[\\\]{}()?!@#%&/,><':;|_~`]/.test(e)}],lax:[{title:"Password must be at least 6 characters long",test:e=>e.length>=6}]},f5={key:0,class:"moonbase:loader"},h5={key:1,class:"moonbase:error","data-visible":""},p5={key:0,class:"moonbase:password-validation"},m5=["data-visible"],b5=pe({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(lt),i=L(!0),a=L(null),l=L(""),u=L(!1),c=L(null),d=te(()=>lc[(s==null?void 0:s.value.auth.passwords)??"default"]),f=te(()=>d.value.some(p=>!p.test(l.value)));ze(async()=>{try{const p=r.getParameter("email"),g=r.getParameter("code");if(!p||!g)throw new Error("Link is broken");a.value=await o.confirmAccount(p,g)}catch(p){p instanceof yr?c.value="Could not find a user to confirm":c.value=p.message}i.value=!1});async function h(){var p,g;if(c.value=null,!!((p=a.value)!=null&&p.resetPasswordToken))try{const _=r.getParameter("email");await o.resetPassword(_,l.value,(g=a.value)==null?void 0:g.resetPasswordToken);const S=await o.signIn(_,l.value);Wt(1500).then(()=>n("confirmedAccount",S))}catch(_){throw c.value=_.message,_}}return(p,g)=>(b(),Z(lr,{handler:h,disabled:f.value,class:"moonbase:confirm-account"},{default:k(()=>[i.value?(b(),x("div",f5,[E(tn)])):a.value?(b(),x(ye,{key:2},[j("h3",null," Hi "+V(a.value.name)+", ",1),g[2]||(g[2]=j("p",null," Please create a new password for your account: ",-1)),E($t,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E($t,{modelValue:l.value,"onUpdate:modelValue":g[0]||(g[0]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:g[1]||(g[1]=_=>u.value=!0)},null,8,["modelValue"]),u.value&&f.value?(b(),x("div",p5,[(b(!0),x(ye,null,dt(d.value.filter(_=>!_.test(l.value)),_=>(b(),Z(Me,{key:_.title,"data-error":""},{default:k(()=>[A(V(_.title),1)]),_:2},1024))),128))])):se("",!0),E(ur,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!c.value||void 0},V(c.value),9,m5)],64)):(b(),x("div",h5,V(c.value),1))]),_:1},8,["disabled"]))}}),g5={class:"moonbase:confirm-email-change"},v5={key:0,class:"moonbase:loader"},y5={key:1,class:"moonbase:error","data-visible":""},_5=pe({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmail:s}=tt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Wt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(b(),x("div",g5,[i.value?(b(),x("div",v5,[E(tn)])):a.value?(b(),x("div",y5,V(a.value),1)):(b(),x(ye,{key:2},[E(nt,null,{default:k(()=>u[0]||(u[0]=[A(" Success! ")])),_:1,__:[0]}),u[1]||(u[1]=j("p",null," Thanks for confirming your new email. ",-1)),v(o)?(b(),Z(Je,{key:0,handler:()=>v(r).show(v(ue).Customer,v(J).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):se("",!0)],64))]))}}),w5={class:"moonbase:confirm-email-change"},E5={key:0,class:"moonbase:loader"},k5={key:1,class:"moonbase:error","data-visible":""},x5=pe({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmailChange:s}=tt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Wt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return b(),x("div",w5,[i.value?(b(),x("div",E5,[E(tn)])):a.value?(b(),x("div",k5,V(a.value),1)):(b(),x(ye,{key:2},[j("h3",null," Hi "+V((c=v(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=j("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),O5=["data-visible"],S5=pe({__name:"ForgotPassword",setup(e){const t=De(),n=tt(),r=L(t.getParameter("email")??""),o=L(null),s=L(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Wt(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof yr?o.value="User not found":o.value=a.message,a}}return(a,l)=>(b(),Z(lr,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:k(({disabled:u})=>[l[1]||(l[1]=j("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),E($t,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:"",disabled:u},null,8,["modelValue","disabled"]),E(ur,{success:"Email sent",label:"Reset password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V(o.value),9,O5)]),_:1,__:[1]}))}}),C5={key:0,class:"moonbase:password-validation"},N5=["data-visible"],P5=pe({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(lt),i=te(()=>r.getParameter("email")),a=L(""),l=L(!1),u=L(null),c=te(()=>lc[(s==null?void 0:s.value.auth.passwords)??"default"]),d=te(()=>c.value.some(h=>!h.test(a.value)));ze(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(u.value="Link broken, please try again")});async function f(){u.value=null;const h=r.getParameter("code");if(h)try{await o.resetPassword(i.value,a.value,h);const p=await o.signIn(i.value,a.value);Wt(1500).then(()=>n("passwordReset",p))}catch(p){throw u.value=p.message,p}}return(h,p)=>(b(),Z(lr,{handler:f,disabled:d.value,class:"moonbase:reset-password"},{default:k(()=>[j("h3",null," Hi "+V(i.value)+", ",1),p[2]||(p[2]=j("p",null," Please create a new password for your account: ",-1)),E($t,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E($t,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=g=>a.value=g),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:p[1]||(p[1]=g=>l.value=!0)},null,8,["modelValue"]),l.value&&d.value?(b(),x("div",C5,[(b(!0),x(ye,null,dt(c.value.filter(g=>!g.test(a.value)),g=>(b(),Z(Me,{key:g.title,"data-error":""},{default:k(()=>[A(V(g.title),1)]),_:2},1024))),128))])):se("",!0),E(ur,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,N5)]),_:1,__:[2]},8,["disabled"]))}}),T5={class:"moonbase:checkbox"},$5={class:"moonbase:checkbox-container"},A5=["id","name","checked","disabled","aria-invalid","aria-describedby"],D5={class:"moonbase:checkbox-description"},I5=["for"],M5=["id"],V5=["id"],pm=pe({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(b(),x("div",T5,[j("div",$5,[j("input",uu({id:`mb-${t.name}`,type:"checkbox",name:`mb-${t.name}`,checked:t.modelValue,disabled:t.disabled,"aria-invalid":!!t.error,"aria-describedby":t.error?`mb-${t.name}-error`:t.hint?`mb-${t.name}-hint`:void 0},t.$attrs,{onChange:n[0]||(n[0]=r=>{var o;return t.$emit("update:modelValue",(o=r.target)==null?void 0:o.checked)})}),null,16,A5)]),j("div",D5,[j("label",{for:`mb-${t.name}`},V(t.label),9,I5),t.error?(b(),x("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},V(t.error),9,M5)):t.hint?(b(),x("p",{key:1,id:`mb-${t.name}-hint`},V(t.hint),9,V5)):se("",!0)])]))}}),R5={key:0,class:"moonbase:password-validation"},L5=["href"],j5=["href"],U5=["data-visible"],B5=pe({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(cc),i=me(Lr),a=me(lt),l=L(""),u=L(r.getParameter("email")??""),c=L(""),d=L(!1),f=L(!1),h=L(null),p=te(()=>lc[(a==null?void 0:a.value.auth.passwords)??"default"]),g=te(()=>p.value.some(S=>!S.test(c.value)));async function _(){h.value=null;try{const S=await o.signUp(l.value,u.value,c.value,null,!0,!0,f.value);i==null||i(Zt.SignedUp,{user:S}),Wt(1500).then(()=>n("signedUp",S))}catch(S){throw h.value=S.message,S}}return(S,R)=>(b(),Z(lr,{handler:_,disabled:g.value,class:"moonbase:sign-up"},{default:k(()=>[E($t,{modelValue:l.value,"onUpdate:modelValue":R[0]||(R[0]=z=>l.value=z),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),E($t,{modelValue:u.value,"onUpdate:modelValue":R[1]||(R[1]=z=>u.value=z),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E($t,{modelValue:c.value,"onUpdate:modelValue":R[2]||(R[2]=z=>c.value=z),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:R[3]||(R[3]=z=>d.value=!0)},null,8,["modelValue"]),d.value&&g.value?(b(),x("div",R5,[(b(!0),x(ye,null,dt(p.value.filter(z=>!z.test(c.value)),z=>(b(),Z(Me,{key:z.title,"data-error":""},{default:k(()=>[A(V(z.title),1)]),_:2},1024))),128))])):se("",!0),E(pm,{modelValue:f.value,"onUpdate:modelValue":R[4]||(R[4]=z=>f.value=z),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),E(Me,null,{default:k(()=>[R[5]||(R[5]=A(" By signing up, you accept our ")),j("a",{href:`${v(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,L5),R[6]||(R[6]=A(" and ")),j("a",{href:`${v(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,j5),R[7]||(R[7]=A(". "))]),_:1,__:[5,6,7]}),E(ur,{success:"Signed up",label:"Sign up",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!h.value||void 0},V(h.value),9,U5),E(Je,{label:"I already have an account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignIn,{email:u.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),F5={class:"moonbase:authentication"},z5={key:0,class:"moonbase:loader"},H5=pe({__name:"Authentication",setup(e){const t=De(),{loaded:n}=tt();return(r,o)=>(b(),x("div",F5,[E(si,{name:v(t).direction===v(Ou).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:k(()=>[v(n)?v(t).intent===v(J).SignIn?(b(),Z(d5,{key:1,onSignedIn:o[0]||(o[0]=s=>v(t).dequeue())})):v(t).intent===v(J).SignUp?(b(),Z(B5,{key:2,onSignedUp:o[1]||(o[1]=s=>v(t).next?v(t).dequeue():v(t).show(v(ue).Customer,v(J).ViewAccount,void 0,!0))})):v(t).intent===v(J).ConfirmAccount?(b(),Z(b5,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>v(t).show(v(ue).Customer,v(J).ViewAccount,void 0,!0))})):v(t).intent===v(J).ConfirmEmail?(b(),Z(_5,{key:4})):v(t).intent===v(J).ConfirmEmailChange?(b(),Z(x5,{key:5})):v(t).intent===v(J).ForgotPassword?(b(),Z(S5,{key:6})):v(t).intent===v(J).ResetPassword?(b(),Z(P5,{key:7,onPasswordReset:o[3]||(o[3]=s=>v(t).show(v(ue).Customer,v(J).ViewAccount,void 0))})):se("",!0):(b(),x("div",z5,[E(tn)]))]),_:1},8,["name"])]))}}),q5={},W5={class:"moonbase:text-subtext-bold"};function Z5(e,t){return b(),x("span",W5,[Ct(e.$slots,"default")])}const st=rr(q5,[["render",Z5]]);function Xa(){const e=me(jt);return e||console.warn("No storefront injectable"),{reportProblem:async(t,n)=>{try{await(e==null?void 0:e.client.api.fetch(`/api/customer/insights/${t}`,null,{method:"POST",body:{origin:window==null?void 0:window.location.href,...n}}))}catch{}}}}const Y5=["data-corners","data-cards"],mm=pe({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=me(lt);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:counter","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-cards":(s=v(t))==null?void 0:s.theme.cards},[j("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[E(v(N_))]),E(Me,null,{default:k(()=>[A(V(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),j("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[E(v(P_))])],8,Y5)}}});function wi(e){switch(e){case gr.Daily:return"day";case gr.Weekly:return"week";case gr.Monthly:return"month";case gr.Quarterly:return"quarter";case gr.Yearly:return"year"}throw new Error("Unknown cycle length")}const G5={class:"moonbase:bundle-cart-item-content"},K5={key:0,class:"moonbase:bundle-cart-item-total"},X5={key:0,class:"moonbase:discount"},J5={class:"moonbase:bundle-cart-item-summary"},Q5=["data-open"],ek=["data-open"],tk={class:"moonbase:bundle-cart-item-product-list-item-content"},nk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},rk=pe({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=Na(e.lineItem.bundleId),r=me(lt),o=tr(),s=L(!1),i=L(null);return Xe(s,a=>{i.value&&(i.value.style.height=a?`${i.value.scrollHeight}px`:"0px")}),(a,l)=>{var u;return b(),Z(un,{class:"moonbase:bundle-cart-item"},ba({default:k(()=>{var c,d,f,h,p,g;return[E(Ft,{url:(c=a.lineItem.bundle)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",G5,[E(st,null,{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:k(()=>[A(V(a.lineItem.variation.name),1)]),_:1})):se("",!0)]),a.lineItem.variation?(b(),x("div",K5,[E(Go,null,{default:k(()=>{var _;return[a.lineItem.variation.hasDiscount?(b(),x("span",X5,V(v(Ut)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):se("",!0),A(" "+V(v(Ut)(a.lineItem.variation.price[a.currency]*a.lineItem.quantity,a.currency))+" ",1),((_=a.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(rt,{key:1},{default:k(()=>[A(" / "+V(v(wi)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1}),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:0,"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=_=>v(o).setQuantity(a.lineItem,_))},null,8,["model-value"])):(b(),Z(Je,{key:1,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(o).setQuantity(a.lineItem,0)},null,8,["handler"]))])):se("",!0)]}),_:2},[(u=v(r))!=null&&u.cart.bundles.showProducts?{name:"addon",fn:k(()=>{var c;return[j("div",J5,[a.lineItem.bundle?(b(),x("button",{key:0,onClick:l[1]||(l[1]=d=>s.value=!s.value)},[E(st,null,{default:k(()=>{var d,f,h;return[A(V((d=a.lineItem.bundle)==null?void 0:d.products.filter(p=>p.included).length)+" ",1),(f=a.lineItem.bundle)!=null&&f.products.some(p=>!p.included)?(b(),x(ye,{key:0},[A(" of "+V((h=a.lineItem.bundle)==null?void 0:h.products.length),1)],64)):se("",!0),l[2]||(l[2]=A(" products "))]}),_:1,__:[2]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},l[3]||(l[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,Q5))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,dt(((c=a.lineItem.bundle)==null?void 0:c.products)||[],d=>(b(),x("div",{key:d.id,class:"moonbase:bundle-cart-item-product-list-item"},[E(Ft,{url:d==null?void 0:d.iconUrl,size:48},null,8,["url"]),j("div",tk,[E(st,{"data-included":d.included||void 0},{default:k(()=>[d.included?(b(),x("svg",nk,l[4]||(l[4]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),A(" "+V(d==null?void 0:d.name),1)]),_:2},1032,["data-included"]),d.included?d!=null&&d.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(d.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>l[5]||(l[5]=[A(" You already own this ")])),_:1,__:[5]}))])]))),128))],8,ek)]}),key:"0"}:void 0]),1024)}}}),ok={class:"moonbase:cart-offer-content"},sk=["href"],ik={class:"moonbase:cart-offer-cta"},ak={key:0,class:"moonbase:discount"},lk={class:"moonbase:cart-offer-bundle-summary"},uk=["data-open"],ck=["data-open"],dk={class:"moonbase:cart-offer-bundle-product-list-item-content"},fk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},hk=["href"],pk=pe({__name:"OfferUpsell",props:{offer:{}},setup(e){const t=e,n=me(lt),{addToCart:r,currency:o}=tr(),s=L(!1),i=L(null);Xe(s,c=>{i.value&&(i.value.style.height=c?`${i.value.scrollHeight}px`:"0px")});const a=te(()=>{var c;return(c=t.offer.target.defaultVariation)==null?void 0:c.originalPrice}),l=te(()=>t.offer.target.defaultVariation?od.subtract(t.offer.target.defaultVariation.price,wl.apply(t.offer.discount,t.offer.target.defaultVariation.price)):a.value),u=te(()=>!Kh(a.value,l.value));return(c,d)=>(b(),Z(un,{class:"moonbase:cart-offer"},ba({default:k(()=>[E(Ft,{url:c.offer.target.iconUrl,href:c.offer.target.type==="Product"?c.offer.target.website:void 0,size:64},null,8,["url","href"]),j("div",ok,[E(st,{class:"moonbase:cart-offer-name"},{default:k(()=>[c.offer.target.type==="Product"&&c.offer.target.website?(b(),x("a",{key:0,href:c.offer.target.website},V(c.offer.discount.name),9,sk)):(b(),x(ye,{key:1},[A(V(c.offer.discount.name),1)],64))]),_:1}),c.offer.discount.description?(b(),Z(Me,{key:0,class:"moonbase:cart-offer-description"},{default:k(()=>[A(V(c.offer.discount.description),1)]),_:1})):se("",!0)]),j("div",ik,[l.value?(b(),Z(Go,{key:0},{default:k(()=>[u.value&&a.value?(b(),x("span",ak,V(v(Ut)(a.value[v(o)],v(o))),1)):se("",!0),A(" "+V(v(Ut)(l.value[v(o)],v(o))),1)]),_:1})):se("",!0),E(Je,{label:"Add to cart",variant:"secondary",size:"small",handler:()=>{var f;return v(r)(c.offer.target,void 0,c.offer,{bundleBehaviour:(f=v(n))==null?void 0:f.cart.bundles.onAdd})}},null,8,["handler"])])]),_:2},[c.offer.target.type==="Bundle"?{name:"addon",fn:k(()=>{var f;return[j("div",lk,[c.offer.target?(b(),x("button",{key:0,onClick:d[0]||(d[0]=h=>s.value=!s.value)},[E(st,null,{default:k(()=>{var h,p,g;return[A(" Contains "+V((h=c.offer.target)==null?void 0:h.products.filter(_=>_.included).length)+" ",1),(p=c.offer.target)!=null&&p.products.some(_=>!_.included)?(b(),x(ye,{key:0},[A(" of "+V((g=c.offer.target)==null?void 0:g.products.length),1)],64)):se("",!0),d[1]||(d[1]=A(" products "))]}),_:1,__:[1]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},d[2]||(d[2]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,uk))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:cart-offer-bundle-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,dt(((f=c.offer.target)==null?void 0:f.products)||[],h=>(b(),x("div",{key:h.id,class:"moonbase:cart-offer-bundle-product-list-item"},[E(Ft,{url:h.iconUrl,href:h.website,size:48},null,8,["url","href"]),j("div",dk,[E(st,{"data-included":h.included||void 0},{default:k(()=>[h.included?(b(),x("svg",fk,d[3]||(d[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),h.website?(b(),x("a",{key:1,href:h.website},V(h.name),9,hk)):(b(),x(ye,{key:2},[A(V(h.name),1)],64))]),_:2},1032,["data-included"]),h.included?h.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(h.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>d[4]||(d[4]=[A(" You already own this ")])),_:1,__:[4]}))])]))),128))],8,ck)]}),key:"0"}:void 0]),1024))}}),mk={class:"moonbase:product-cart-item-content"},bk={class:"moonbase:product-cart-item-total"},gk={key:0,class:"moonbase:discount"},vk=pe({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=li(t.lineItem.productId),r=me(lt);function o(l){var c;if(!l.variation)throw new Error("No variation found");const u=i(l);return(u==null?void 0:u.price[t.currency])??((c=l.variation)==null?void 0:c.price[t.currency])}function s(l){return!!i(l)}function i(l){var c,d;const u=((d=(c=l.variation)==null?void 0:c.pricingTiers)==null?void 0:d.filter(f=>l.quantity>=f.minQuantity))??[];return u.length>0?u[u.length-1]:null}const a=tr();return(l,u)=>(b(),Z(un,{class:"moonbase:product-cart-item"},{default:k(()=>{var c,d,f,h,p,g;return[E(Ft,{url:(c=l.lineItem.product)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",mk,[E(st,null,{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:product-cart-item-tagline","data-truncate":l.lineItem.variation&&l.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),l.lineItem.variation&&l.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:product-cart-item-variation"},{default:k(()=>[A(V(l.lineItem.variation.name),1)]),_:1})):se("",!0)]),j("div",bk,[l.lineItem.variation?(b(),Z(Go,{key:0},{default:k(()=>{var _;return[l.lineItem.variation.hasDiscount||s(l.lineItem)?(b(),x("span",gk,V(v(Ut)(l.lineItem.variation.originalPrice[l.currency]*l.lineItem.quantity,l.currency)),1)):se("",!0),A(" "+V(v(Ut)(o(l.lineItem)*l.lineItem.quantity,l.currency))+" ",1),((_=l.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(rt,{key:1},{default:k(()=>[A(" / "+V(v(wi)(l.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1})):se("",!0),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:1,"model-value":l.lineItem.quantity,"onUpdate:modelValue":u[0]||(u[0]=_=>v(a).setQuantity(l.lineItem,_))},null,8,["model-value"])):(b(),Z(Je,{key:2,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(a).setQuantity(l.lineItem,0)},null,8,["handler"]))])]}),_:1}))}}),yk={class:"moonbase:cart"},_k=["data-background"],wk=["data-corners"],Ek={class:"moonbase:cart-total"},kk={"data-error":""},xk=pe({__name:"Cart",setup(e){const t=Xa(),{items:n,total:r,currency:o,checkout:s}=tr(),i=me(lt),a=By(),l=te(()=>a.value.length===0?null:a.value.find(d=>!d.target.owned)||a.value[0]),u=L(null);async function c(){u.value=null;try{const d=await s({redirect:(i==null?void 0:i.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(d!=null&&d.completed))throw new ss}catch(d){if(u.value=d.message,!(d instanceof ss))if(d instanceof mn)t.reportProblem("error",{type:d.name,title:d.title,detail:d.detail,status:d.status,errors:d.errors?Object.fromEntries(Object.entries(d.errors).map(([f,h])=>[f,[h]])):void 0,instance:"Cart.vue:startCheckout"});else{const f=d;t.reportProblem("error",{type:f.name,title:f.message,instance:"Cart.vue:startCheckout"})}throw d}}return(d,f)=>{var h,p;return b(),x("div",yk,[v(n).length>0?(b(),x("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(h=v(i))==null?void 0:h.theme.colors.background},[(b(!0),x(ye,null,dt(v(n),g=>(b(),x("li",{key:g.id},[g.type==="Product"?(b(),Z(vk,{key:0,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):g.type==="Bundle"?(b(),Z(rk,{key:1,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):se("",!0)]))),128)),l.value?(b(),x(ye,{key:0},[f[0]||(f[0]=j("li",{class:"moonbase:grow"},null,-1)),j("li",null,[E(st,null,{default:k(()=>{var g;return[A(V((g=v(i))==null?void 0:g.cart.offers.label),1)]}),_:1}),E(pk,{offer:l.value},null,8,["offer"])])],64)):se("",!0)],8,_k)):(b(),x("div",{key:1,class:"moonbase:cart-empty","data-corners":(p=v(i))==null?void 0:p.theme.corners},[E(v(T_)),E(st,null,{default:k(()=>f[1]||(f[1]=[A(" Your cart is empty ")])),_:1,__:[1]})],8,wk)),j("div",Ek,[f[2]||(f[2]=j("label",null," Total ",-1)),j("span",null,V(v(Ut)(v(r).amount,v(r).currency)),1),f[3]||(f[3]=j("p",null," Sales tax to be calculated at checkout ",-1)),j("p",kk,V(u.value),1)]),E(Je,{handler:c,disabled:v(n).length===0,label:"Checkout",error:u.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),Ok={class:"moonbase:account"},Sk={key:0,class:"moonbase:error"},Ck={key:1,class:"moonbase:notification"},Nk={key:0,class:"moonbase:error"},Pk=pe({__name:"Account",setup(e){var R,z,q;const t=De(),{user:n,update:r,setPassword:o,signOut:s}=tt(),i=me(Lr),a=L(((R=n.value)==null?void 0:R.name)??""),l=L(((z=n.value)==null?void 0:z.email)??""),u=L(((q=n.value)==null?void 0:q.communicationPreferences)??{newsletterOptIn:!1}),c=L(null),d=L(!1),f=L(""),h=L(""),p=L(null);async function g(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(B){throw c.value=B,B}}async function _(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(B){throw p.value=B,B}}async function S(){const B={...n.value};await s(),i==null||i(Zt.SignedOut,{user:B}),t.reset()}return(B,D)=>(b(),x("div",Ok,[E(lr,{handler:g},{default:k(()=>[E($t,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=y=>a.value=y),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),E($t,{modelValue:l.value,"onUpdate:modelValue":D[1]||(D[1]=y=>l.value=y),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),E(pm,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":D[2]||(D[2]=y=>u.value.newsletterOptIn=y),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),E(ur,{label:"Update",error:"Error",success:"Updated"}),c.value?(b(),x("p",Sk,V(c.value.message),1)):d.value?(b(),x("p",Ck," You need to confirm your new email address, please check your inbox ")):se("",!0)]),_:1}),E(lr,{handler:_},{default:k(()=>[E($t,{modelValue:f.value,"onUpdate:modelValue":D[3]||(D[3]=y=>f.value=y),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),E($t,{modelValue:h.value,"onUpdate:modelValue":D[4]||(D[4]=y=>h.value=y),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),E(ur,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(b(),x("p",Nk,V(p.value.message),1)):se("",!0)]),_:1}),E(Je,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:S})]))}}),bm=e=>e.includes("."),Tk={class:"moonbase:products"},$k={key:0,class:"moonbase:loader"},Ak={key:1,class:"moonbase:loader"},Dk=["data-is-sub-product"],Ik={key:0,class:"moonbase:products-item-sub-product-icon"},Mk={class:"moonbase:products-item-content"},Vk=pe({__name:"Products",setup(e){const t=De(),{getProducts:n}=ao(),r=L(null);return ze(async()=>{let o=await n();for(r.value=o.items;o.hasMore&&o.next;)o=await n(o.next),r.value.push(...o.items)}),(o,s)=>(b(),x("div",Tk,[r.value?r.value.length===0?(b(),x("div",Ak," No products found ")):se("",!0):(b(),x("div",$k,[E(tn),s[0]||(s[0]=A(" Loading products.. "))])),(b(!0),x(ye,null,dt(r.value||[],i=>(b(),x("div",{key:i.id,class:"moonbase:products-item","data-is-sub-product":v(bm)(i.id)||void 0},[v(bm)(i.id)?(b(),x("div",Ik,s[1]||(s[1]=[j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499"})],-1)]))):se("",!0),E(Ft,{url:i.iconUrl,size:48},null,8,["url"]),j("div",Mk,[E(st,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(b(),Z(Me,{key:0},{default:k(()=>[A(V((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):se("",!0)]),j("div",null,[E(Yo,{variant:"subtle",onClick:a=>v(t).show(v(ue).Product,v(J).ViewProduct,{product_id:i.id})},{default:k(()=>[E(v(wp)),s[2]||(s[2]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[2]},1032,["onClick"])])],8,Dk))),128))]))}}),Rk={class:"moonbase:bundle-redemption-item-content"},Lk={class:"moonbase:bundle-redemption-item-summary"},jk=["data-open"],Uk=["data-open"],gm=pe({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=L(!1),n=L(null);return Xe(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(b(),Z(un,{class:"moonbase:bundle-redemption-item"},{addon:k(()=>{var s;return[j("div",Lk,[r.bundle?(b(),x("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[E(st,null,{default:k(()=>{var i;return[A(V((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),E(Me,null,{default:k(()=>[A(V(t.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,jk))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(b(!0),x(ye,null,dt(((s=r.bundle)==null?void 0:s.products)||[],i=>(b(),x("div",{key:i.id},[E(Ft,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[E(st,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.tagline?(b(),Z(Me,{key:0},{default:k(()=>[A(V(i.tagline),1)]),_:2},1024)):se("",!0)])]))),128))],8,Uk)]}),default:k(()=>[E(Ft,{url:r.bundle.iconUrl,size:72},null,8,["url"]),j("div",Rk,[E(st,null,{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-redemption-item-tagline"},{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),Bk={class:"moonbase:product-redemption-item-content"},vm=pe({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(b(),Z(un,{class:"moonbase:product-redemption-item"},{default:k(()=>[E(Ft,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",Bk,[E(st,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,{class:"moonbase:product-redemption-item-tagline"},{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),Fk={class:"moonbase:redeem"},zk=["data-visible"],Hk={key:1,class:"moonbase:redeem-voucher"},qk={key:0,class:"moonbase:redeem-voucher-content"},Wk={key:1,class:"moonbase:redeem-voucher-return"},Zk=pe({__name:"Redeem",setup(e){const{redeem:t}=Ph(),n=De(),r=tt(),o=me(Lr),s=L(null),i=L(null),a=L(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(Zt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(b(),x("div",Fk,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[s.value?(b(),x("div",Hk,[j("div",null,[E(is,null,{default:k(()=>[A(V(s.value.name),1)]),_:1}),s.value.description?(b(),Z(nt,{key:0},{default:k(()=>[A(' "'+V(s.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[E(v(w_)),c[2]||(c[2]=A(" Licenses have been added to your account. "))]),_:1,__:[2]}),E(Me,null,{default:k(()=>[c[3]||(c[3]=A(" Code: ")),j("strong",null,V(s.value.code),1)]),_:1,__:[3]})]),E(nt,null,{default:k(()=>c[4]||(c[4]=[A(" Voucher summary ")])),_:1,__:[4]}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(b(),x("div",qk,[(b(!0),x(ye,null,dt(s.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,dt(s.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),v(n).next&&v(n).next[0]===v(ue).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=v(n).next)==null?void 0:f[2])==null?void 0:h.product_id)})||s.value.redeemsBundles.some(d=>d.value.products.some(f=>{var h,p;return f.id===((p=(h=v(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(b(),x("div",Wk,[E(Je,{label:"Return to activation",variant:"primary",icon:v(__),handler:()=>v(n).dequeue()},null,8,["icon","handler"])])):se("",!0)])):(b(),Z(lr,{key:0,handler:l},{default:k(()=>{var d;return[E(rt,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E($t,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=f=>a.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),E(ur,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!i.value||void 0},V((d=i.value)==null?void 0:d.message),9,zk)]}),_:1}))]),_:1})]))}}),Yk=["data-status"],Gk=["data-fulfilled"],ym=pe({__name:"MilestoneProgressBar",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",{class:"moonbase:milestone-progress-bar",style:Ds({gridTemplateColumns:`repeat(${t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1}, 1fr)`})},[(b(!0),x(ye,null,dt(Array(t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1),(r,o)=>(b(),x("div",{key:o},[j("div",{"data-status":o+1<t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"done":o+1===t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"in-progress":"future"},null,8,Yk),t.progress.events[o+1]?(b(),x("span",{key:0,"data-fulfilled":t.progress.events[o+1].some(s=>s.fulfilled)||void 0},null,8,Gk)):se("",!0)]))),128))],4))}}),_m=6048e5,Kk=864e5,Ja=43200,wm=1440,Em=Symbol.for("constructDateFrom");function cr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Em in e?e[Em](t):e instanceof Date?new e.constructor(t):new Date(t)}function _t(e,t){return cr(t||e,e)}let Xk={};function Ei(){return Xk}function ki(e,t){var a,l,u,c;const n=Ei(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=_t(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Qa(e,t){return ki(e,{...t,weekStartsOn:1})}function km(e,t){const n=_t(e,t==null?void 0:t.in),r=n.getFullYear(),o=cr(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Qa(o),i=cr(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Qa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function el(e){const t=_t(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tl(e,...t){const n=cr.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function xm(e,t){const n=_t(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Jk(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=xm(r),i=xm(o),a=+s-el(s),l=+i-el(i);return Math.round((a-l)/Kk)}function Qk(e,t){const n=km(e,t),r=cr(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Qa(r)}function nl(e,t){const n=+_t(e)-+_t(t);return n<0?-1:n>0?1:n}function ex(e){return cr(e,Date.now())}function tx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nx(e){return!(!tx(e)&&typeof e!="number"||isNaN(+_t(e)))}function rx(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function ox(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function sx(e,t){return+_t(e)-+_t(t)}function ix(e,t){const n=_t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function ax(e,t){const n=_t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function lx(e,t){const n=_t(e,t==null?void 0:t.in);return+ix(n,t)==+ax(n,t)}function ux(e,t,n){const[r,o,s]=tl(n==null?void 0:n.in,e,e,t),i=nl(o,s),a=Math.abs(rx(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=nl(o,s)===-i;lx(r)&&a===1&&nl(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function cx(e,t,n){const r=sx(e,t)/1e3;return ox(n==null?void 0:n.roundingMethod)(r)}function dx(e,t){const n=_t(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const fx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hx=(e,t,n)=>{let r;const o=fx[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function uc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const px={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gx={date:uc({formats:px,defaultWidth:"full"}),time:uc({formats:mx,defaultWidth:"full"}),dateTime:uc({formats:bx,defaultWidth:"full"})},vx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yx=(e,t,n,r)=>vx[e];function xi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const _x={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ex={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},kx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ox={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Sx={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:xi({values:_x,defaultWidth:"wide"}),quarter:xi({values:wx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xi({values:Ex,defaultWidth:"wide"}),day:xi({values:kx,defaultWidth:"wide"}),dayPeriod:xi({values:xx,defaultWidth:"wide",formattingValues:Ox,defaultFormattingWidth:"wide"})};function Oi(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Nx(a,d=>d.test(i)):Cx(a,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}function Cx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Nx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Px(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const Tx=/^(\d+)(th|st|nd|rd)?/i,$x=/\d+/i,Ax={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dx={any:[/^b/i,/^(a|c)/i]},Ix={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mx={any:[/1/i,/2/i,/3/i,/4/i]},Vx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Rx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Lx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},jx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ux={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Bx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Fx={ordinalNumber:Px({matchPattern:Tx,parsePattern:$x,valueCallback:e=>parseInt(e,10)}),era:Oi({matchPatterns:Ax,defaultMatchWidth:"wide",parsePatterns:Dx,defaultParseWidth:"any"}),quarter:Oi({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Mx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Oi({matchPatterns:Vx,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),day:Oi({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:jx,defaultParseWidth:"any"}),dayPeriod:Oi({matchPatterns:Ux,defaultMatchWidth:"any",parsePatterns:Bx,defaultParseWidth:"any"})},Om={code:"en-US",formatDistance:hx,formatLong:gx,formatRelative:yx,localize:Sx,match:Fx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zx(e,t){const n=_t(e,t==null?void 0:t.in);return Jk(n,dx(n))+1}function Hx(e,t){const n=_t(e,t==null?void 0:t.in),r=+Qa(n)-+Qk(n);return Math.round(r/_m)+1}function Sm(e,t){var c,d,f,h;const n=_t(e,t==null?void 0:t.in),r=n.getFullYear(),o=Ei(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=cr((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=ki(i,t),l=cr((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=ki(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function qx(e,t){var a,l,u,c;const n=Ei(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Sm(e,t),s=cr((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),ki(s,t)}function Wx(e,t){const n=_t(e,t==null?void 0:t.in),r=+ki(n,t)-+qx(n,t);return Math.round(r/_m)+1}function Ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Vr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ye(n+1,2)},d(e,t){return Ye(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ye(e.getHours()%12||12,t.length)},H(e,t){return Ye(e.getHours(),t.length)},m(e,t){return Ye(e.getMinutes(),t.length)},s(e,t){return Ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ye(o,t.length)}},as={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Vr.y(e,t)},Y:function(e,t,n,r){const o=Sm(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return Ye(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ye(s,t.length)},R:function(e,t){const n=km(e);return Ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ye(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ye(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ye(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Vr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ye(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Wx(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ye(o,t.length)},I:function(e,t,n){const r=Hx(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Vr.d(e,t)},D:function(e,t,n){const r=zx(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ye(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ye(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ye(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Ye(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=as.noon:r===0?o=as.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=as.evening:r>=12?o=as.afternoon:r>=4?o=as.morning:o=as.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Vr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Vr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Vr.s(e,t)},S:function(e,t){return Vr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Pm(r);case"XXXX":case"XX":return vo(r);case"XXXXX":case"XXX":default:return vo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Pm(r);case"xxxx":case"xx":return vo(r);case"xxxxx":case"xxx":default:return vo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nm(r,":");case"OOOO":default:return"GMT"+vo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nm(r,":");case"zzzz":default:return"GMT"+vo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ye(r,t.length)},T:function(e,t,n){return Ye(+e,t.length)}};function Nm(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Ye(s,2)}function Pm(e,t){return e%60===0?(e>0?"-":"+")+Ye(Math.abs(e)/60,2):vo(e,t)}function vo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ye(Math.trunc(r/60),2),s=Ye(r%60,2);return n+o+t+s}const Tm=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$m=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Zx={p:$m,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Tm(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Tm(r,t)).replace("{{time}}",$m(o,t))}},Yx=/^D+$/,Gx=/^Y+$/,Kx=["D","DD","YY","YYYY"];function Xx(e){return Yx.test(e)}function Jx(e){return Gx.test(e)}function Qx(e,t,n){const r=eO(e,t,n);if(console.warn(r),Kx.includes(e))throw new RangeError(r)}function eO(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const tO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rO=/^'([^]*?)'?$/,oO=/''/g,sO=/[a-zA-Z]/;function iO(e,t,n){var c,d,f,h;const r=Ei(),o=r.locale??Om,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=_t(e,n==null?void 0:n.in);if(!nx(a))throw new RangeError("Invalid time value");let l=t.match(nO).map(p=>{const g=p[0];if(g==="p"||g==="P"){const _=Zx[g];return _(p,o.formatLong)}return p}).join("").match(tO).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:aO(p)};if(Cm[g])return{isToken:!0,value:p};if(g.match(sO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(p=>{if(!p.isToken)return p.value;const g=p.value;(Jx(g)||Xx(g))&&Qx(g,t,String(e));const _=Cm[g[0]];return _(a,g,o.localize,u)}).join("")}function aO(e){const t=e.match(rO);return t?t[1].replace(oO,"'"):e}function lO(e,t,n){const r=Ei(),o=(n==null?void 0:n.locale)??r.locale??Om,s=2520,i=nl(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[l,u]=tl(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=cx(u,l),d=(el(u)-el(l))/1e3,f=Math.round((c-d)/60);let h;if(f<2)return n!=null&&n.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,a):c<10?o.formatDistance("lessThanXSeconds",10,a):c<20?o.formatDistance("lessThanXSeconds",20,a):c<40?o.formatDistance("halfAMinute",0,a):c<60?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",1,a):f===0?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",f,a);if(f<45)return o.formatDistance("xMinutes",f,a);if(f<90)return o.formatDistance("aboutXHours",1,a);if(f<wm){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<Ja){const p=Math.round(f/wm);return o.formatDistance("xDays",p,a)}else if(f<Ja*2)return h=Math.round(f/Ja),o.formatDistance("aboutXMonths",h,a)}if(h=ux(u,l),h<12){const p=Math.round(f/Ja);return o.formatDistance("xMonths",p,a)}else{const p=h%12,g=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",g,a):p<9?o.formatDistance("overXYears",g,a):o.formatDistance("almostXYears",g+1,a)}}function uO(e,t){return lO(e,ex(e),t)}function cO(e){return uO(e,{addSuffix:!0})}function ls(e,t){return iO(e,t||"PPP")}const dO={class:"moonbase:subscriptions"},fO={key:0,class:"moonbase:loader"},hO={key:1,class:"moonbase:loader"},pO=["data-subscription-status"],mO={class:"moonbase:subscriptions-item-content"},bO={class:"moonbase:subscriptions-item-content"},gO={key:0,class:"moonbase:subscriptions-item-milestone-progress"},vO={class:"moonbase:subscriptions-item-milestone-progress-title"},yO=pe({__name:"Subscriptions",setup(e){const t=De(),{getSubscriptions:n}=ao(),r=L(new Date),o=L(null);return ze(async()=>{let s=await n();for(o.value=s.items;s.hasMore&&s.next;)s=await n(s.next),o.value.push(...s.items)}),(s,i)=>(b(),x("div",dO,[o.value?o.value.length===0?(b(),x("div",hO," No subscriptions found ")):se("",!0):(b(),x("div",fO,[E(tn),i[0]||(i[0]=A(" Loading subscriptions.. "))])),(b(!0),x(ye,null,dt(o.value||[],a=>(b(),x(ye,{key:a.id},[j("div",{"data-subscription-status":a.status,class:"moonbase:subscriptions-item"},[a.content.type==="Product"?(b(),x(ye,{key:0},[E(Ft,{url:a.content.product.iconUrl,size:48},null,8,["url"]),j("div",mO,[E(st,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.product.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(_r).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)):(b(),x(ye,{key:1},[E(Ft,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),j("div",bO,[E(st,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.bundle.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(_r).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)),j("div",null,[E(Yo,{variant:"subtle",onClick:l=>v(t).show(v(ue).Subscription,v(J).ManageSubscription,{subscription_id:a.id})},{default:k(()=>[E(v(wp)),i[1]||(i[1]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[1]},1032,["onClick"])])],8,pO),a.milestoneProgress?(b(),x("div",gO,[j("div",vO,[E(st,null,{default:k(()=>[A(V(a.milestoneProgress.title),1)]),_:2},1024),E(zt,null,{default:k(()=>[A(V(a.milestoneProgress.currentNormalizedCycleNumber-(a.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(a.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(a.cycleLength))+"s ",1)]),_:2},1024)]),E(ym,{progress:a.milestoneProgress},null,8,["progress"])])):se("",!0)],64))),128))]))}}),_O={class:"moonbase:customer"},wO=pe({__name:"Customer",setup(e){const t=De(),{user:n}=tt(),r=me(lt),o=te(()=>[{intent:J.ViewProducts,title:"Products",content:Vk},{intent:J.ViewSubscriptions,title:"Subscriptions",content:yO,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:J.ViewAccount,title:"Account",content:Pk},{intent:J.RedeemVoucher,title:"Redeem",content:Zk}].filter(a=>a.predicate===void 0||a.predicate())),s=te(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(b(),x("div",_O,[E(v(i_),{"selected-index":s.value,onChange:i},{default:k(()=>{var u,c;return[E(v(a_),{"data-corners":(u=v(r))==null?void 0:u.theme.corners,"data-background":(c=v(r))==null?void 0:c.theme.colors.background},{default:k(()=>[(b(!0),x(ye,null,dt(o.value,d=>(b(),Z(v(l_),{key:d.intent},{default:k(()=>[A(V(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),E(v(u_),null,{default:k(()=>[(b(!0),x(ye,null,dt(o.value,d=>(b(),Z(v(c_),{key:d.intent},{default:k(()=>[(b(),Z(Yl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),EO={class:"moonbase:product-card-content"},kO=["data-open"],xO=pe({__name:"ProductCard",props:{product:{}},setup(e){const t=L(!1),n=L(null),r=te(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(b(),Z(un,{class:"moonbase:product-card"},{addon:k(()=>[j("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:n},{default:k(()=>[A(V(o.product.description),1)]),_:1},512),!t.value&&r.value?(b(),x("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[E(st,null,{default:k(()=>s[1]||(s[1]=[A(" read more ")])),_:1,__:[1]})])):se("",!0)],8,kO)]),default:k(()=>[E(Ft,{url:o.product.iconUrl,size:72},null,8,["url"]),j("div",EO,[E(is,null,{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.name),1)]}),_:1}),E(Me,{class:"moonbase:product-card-tagline"},{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function OO(e){const t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e<1)return`${e} B`;const n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);e=Number(e/1024**n);const r=t[n];return e>=10||e%1===0?`${e.toFixed(0)} ${r}`:`${e.toFixed(1)} ${r}`}const SO={class:"moonbase:product-downloads"},CO=["data-open"],NO={key:1,class:"moonbase:product-downloads-content"},PO={key:2,class:"moonbase:product-downloads-content"},TO={key:3,class:"moonbase:product-downloads-content"},$O={key:4,class:"moonbase:product-downloads-content"},AO={class:"moonbase:product-downloads-list"},DO={class:"moonbase:product-downloads-download-actions"},IO=pe({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=De(),r=tt(),o=Xa(),s=me(Lr),{downloadProduct:i}=ao(),a=L(!1),l=L(null),u=te(()=>l.value&&l.value.$el&&l.value.$el.scrollHeight>l.value.$el.clientHeight);function c(){n.enqueue(ue.Product,J.DownloadProduct,n.parameters??void 0),n.show(ue.Authentication,J.SignIn)}const d=[Tn.Windows,Tn.Mac,Tn.Linux,Tn.Universal];function f(){var R;const S=(((R=navigator.userAgentData)==null?void 0:R.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(S)?Tn.Mac:/win/.test(S)?Tn.Windows:/linux/.test(S)?Tn.Linux:Tn.Universal}const h=f(),p=[h,...d.filter(S=>S!==h)],g=te(()=>p.flatMap(S=>[...(t.product.downloads??[]).filter(R=>R.platform===S)]));async function _(S){try{await i(S),s==null||s(Zt.DownloadedProduct,{product:t.product,download:S,user:r.user.value})}catch(R){if(R instanceof mn)o.reportProblem("error",{type:R.name,title:R.title,detail:R.detail,status:R.status,errors:R.errors?Object.fromEntries(Object.entries(R.errors).map(([z,q])=>[z,[q]])):void 0,instance:"ProductDownloads.vue:startDownload"});else{const z=R;o.reportProblem("error",{type:z.name,title:z.message,instance:"ProductDownloads.vue:startDownload"})}throw R}}return(S,R)=>(b(),x("div",SO,[E(nt,null,{default:k(()=>[R[1]||(R[1]=A(" Downloads ")),E(Me,null,{default:k(()=>[A(" Version "+V(S.product.version),1)]),_:1})]),_:1,__:[1]}),S.product.releaseDescription?(b(),x("div",{key:0,class:"moonbase:product-downloads-description","data-open":a.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:l},{default:k(()=>[A(V(S.product.releaseDescription),1)]),_:1},512),!a.value&&u.value?(b(),x("button",{key:0,onClick:R[0]||(R[0]=z=>a.value=!0)},[E(st,null,{default:k(()=>R[2]||(R[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,CO)):se("",!0),S.product.downloadsNeedsUser&&S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",NO,[E(rt,{"data-center":""},{default:k(()=>R[3]||(R[3]=[A(" This product requires ownership to download ")])),_:1,__:[3]}),E(Je,{label:"Sign in",handler:c})])):S.product.downloadsNeedsUser&&!v(r).user?(b(),x("div",PO,[E(rt,{"data-center":""},{default:k(()=>R[4]||(R[4]=[A(" This product requires an account to download ")])),_:1,__:[4]}),E(Je,{label:"Sign in",handler:c})])):S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",TO,[E(rt,{"data-center":""},{default:k(()=>R[5]||(R[5]=[A(" This product requires ownership to download ")])),_:1,__:[5]})])):(b(),x("div",$O,[j("div",AO,[(b(!0),x(ye,null,dt(g.value,z=>(b(),Z(un,{key:z.key,class:"moonbase:product-downloads-download"},{addon:k(()=>[j("div",DO,[E(Je,{label:`Download for ${z.platform}`,variant:z.platform===v(h)?"primary":"secondary","no-reset":!0,handler:()=>_(z),icon:v(g_)},null,8,["label","variant","handler","icon"])])]),default:k(()=>[j("div",null,[E(nt,null,{default:k(()=>[A(V(z.name),1)]),_:2},1024),E(zt,null,{default:k(()=>[A(V(z.platform)+" - "+V(v(OO)(z.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),g.value.length===0?(b(),Z(rt,{key:0,"data-center":""},{default:k(()=>R[6]||(R[6]=[A(" No downloadable files found ")])),_:1,__:[6]})):se("",!0)]))]))}}),MO={class:"moonbase:product-licenses"},VO={key:0,class:"moonbase:loader"},RO={key:1,class:"moonbase:empty"},LO={key:0,class:"moonbase:loader"},jO={key:1,class:"moonbase:product-licenses-activations"},UO={key:0},BO={class:"moonbase:product-licenses-activation-actions"},FO={key:2,class:"moonbase:loader"},zO={key:3,class:"moonbase:product-licenses-licenses"},HO=pe({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=ao(),a=Xa(),l=L(null),u=L(null),c=L(!0);ze(async()=>{if(n.product.maxActivations){let f=await o(n.product.id);for(l.value=f.items.map(h=>({...h,revoking:!1}));f.hasMore&&f.next;)f=await o(n.product.id,f.next),l.value.push(...f.items.map(h=>({...h,revoking:!1})))}if(n.product.externalLicenses){let f=await s(n.product.id);for(u.value=f.items;f.hasMore&&f.next;)f=await s(n.product.id,f.next),u.value.push(...f.items)}c.value=!1});async function d(f){try{await i(f),r("revoked",f),l.value&&Wt(1e3).then(()=>{var h,p;return(p=l.value)==null?void 0:p.splice((h=l.value)==null?void 0:h.indexOf(f),1)})}catch(h){if(h instanceof mn)a.reportProblem("error",{type:h.name,title:h.title,detail:h.detail,status:h.status,errors:h.errors?Object.fromEntries(Object.entries(h.errors).map(([p,g])=>[p,[g]])):void 0,instance:"ProductLicenses.vue:revoke"});else{const p=h;a.reportProblem("error",{type:p.name,title:p.message,instance:"ProductLicenses.vue:revoke"})}throw h}}return(f,h)=>(b(),x("div",MO,[E(nt,null,{default:k(()=>[h[0]||(h[0]=A(" Licenses ")),f.product.maxActivations&&f.product.maxActivations>0?(b(),Z(Me,{key:0},{default:k(()=>[A(V(f.product.currentActivations??0)+" of "+V(f.product.maxActivations)+" seats used ",1)]),_:1})):se("",!0)]),_:1,__:[0]}),c.value?(b(),x("div",VO,[E(tn)])):!f.product.numberOfLicenses&&!f.product.subscriptionLicenses?(b(),x("div",RO,[E(rt,null,{default:k(()=>h[1]||(h[1]=[A(" You don't own any licenses for this product yet ")])),_:1,__:[1]}),f.product&&f.product.website?(b(),Z(ac,{key:0,type:"anchor",href:f.product.website,label:"Purchase",icon:v(y_)},null,8,["href","icon"])):se("",!0)])):se("",!0),c.value?se("",!0):(b(),x(ye,{key:2},[f.product.maxActivations&&f.product.maxActivations>0&&!f.product.currentActivations?(b(),x("div",LO,[E(v(Ep)),E(nt,null,{default:k(()=>h[2]||(h[2]=[A(" No activations yet ")])),_:1,__:[2]})])):se("",!0),f.product.maxActivations&&l.value?(b(),x("div",jO,[(b(!0),x(ye,null,dt(l.value??[],p=>(b(),Z(un,{key:p.id,class:"moonbase:product-licenses-activation"},ba({default:k(()=>[j("div",null,[E(zt,null,{default:k(()=>h[3]||(h[3]=[A(" Device ")])),_:1,__:[3]}),E(nt,null,{default:k(()=>[A(V(p.name),1)]),_:2},1024)]),j("div",null,[E(zt,null,{default:k(()=>h[4]||(h[4]=[A(" Activation ")])),_:1,__:[4]}),E(nt,null,{default:k(()=>[A(V(p.activationMethod),1)]),_:2},1024)]),p.lastValidatedAt?(b(),x("div",UO,[E(zt,null,{default:k(()=>h[5]||(h[5]=[A(" First activated ")])),_:1,__:[5]}),E(nt,null,{default:k(()=>[A(V(v(cO)(p.firstValidatedAt)),1)]),_:2},1024)])):se("",!0)]),_:2},[p.activationMethod===v(Fi).Online?{name:"addon",fn:k(()=>[j("div",BO,[E(Je,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>d(p)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):se("",!0),(!u.value||u.value.length===0)&&!f.product.maxActivations&&(f.product.numberOfLicenses||f.product.subscriptionLicenses)?(b(),x("div",FO,[E(v(Ep)),f.product.numberOfLicenses?(b(),Z(nt,{key:0},{default:k(()=>[A(" You own "+V(f.product.numberOfLicenses)+" license"+V(f.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0),f.product.subscriptionLicenses?(b(),Z(nt,{key:1},{default:k(()=>[A(" You have "+V(f.product.subscriptionLicenses)+" subscription license"+V(f.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0)])):f.product.externalLicenses&&u.value?(b(),x("div",zO,[(b(!0),x(ye,null,dt((u.value??[]).filter(p=>p.externalFulfillment),p=>(b(),Z(un,{key:p.id,class:"moonbase:product-licenses-license"},ba({default:k(()=>[j("div",null,[E(zt,null,{default:k(()=>[A(V(f.product.name)+" license ",1)]),_:1}),E(nt,null,{default:k(()=>[A(V(p.id),1)]),_:2},1024)])]),_:2},[p.externalFulfillment?{name:"addon",fn:k(()=>[j("code",null,V(p.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):se("",!0)],64))]))}}),qO={class:"moonbase:download-product"},WO={key:0,class:"moonbase:loader"},ZO={key:1,class:"moonbase:loader"},YO={key:2,class:"moonbase:loader"},GO={key:3},KO=pe({__name:"Product",setup(e){const t=De(),n=tt(),{loaded:r}=tt(),{getProduct:o}=ao(),s=L(null),i=L(null),a=L(!0);return ze(async()=>{const l=t.getParameter("product_id"),u=t.getParameter("version");if(!l){i.value="Link is broken";return}try{s.value=await o(l,u||void 0)}catch(c){i.value=c.message}a.value=!1}),(l,u)=>(b(),x("div",qO,[a.value||!v(r)?(b(),x("div",WO,[E(tn)])):i.value?(b(),x("div",ZO,V(i.value),1)):s.value?(b(),x("div",GO,[E(xO,{product:s.value},null,8,["product"]),s.value.downloads?(b(),Z(IO,{key:0,product:s.value},null,8,["product"])):se("",!0),v(n).user.value?(b(),Z(HO,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):se("",!0)])):(b(),x("div",YO," Could not find product "))]))}}),XO={class:"moonbase:peek"},JO=["data-visible"],QO={key:1,class:"moonbase:peek-voucher"},e3={key:0,class:"moonbase:peek-voucher-content"},t3={class:"moonbase:peek-voucher-auth"},n3=pe({__name:"Redeem",setup(e){const{peek:t}=Ph(),n=De(),r=L(null),o=L(null),s=L(n.getParameter("code")||"");async function i(){o.value=null;try{r.value=await t(s.value),n.parameters={code:r.value.code}}catch(u){throw o.value=u,u}}function a(){n.enqueue(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignIn)}function l(){n.enqueue(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignUp)}return(u,c)=>(b(),x("div",XO,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[r.value?(b(),x("div",QO,[j("div",null,[E(is,null,{default:k(()=>[A(V(r.value.name),1)]),_:1}),r.value.description?(b(),Z(nt,{key:0},{default:k(()=>[A(' "'+V(r.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[c[2]||(c[2]=A(" Code: ")),j("strong",null,V(r.value.code),1)]),_:1,__:[2]})]),E(nt,null,{default:k(()=>c[3]||(c[3]=[A(" Voucher summary ")])),_:1,__:[3]}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(b(),x("div",e3,[(b(!0),x(ye,null,dt(r.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,dt(r.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),j("div",t3,[E(rt,null,{default:k(()=>c[4]||(c[4]=[A(" Sign in or create an account to redeem products ")])),_:1,__:[4]}),E(Je,{label:"Sign in",variant:"primary",handler:a}),E(Je,{label:"Create account",variant:"subtle",handler:l})])])):(b(),Z(lr,{key:0,handler:i},{default:k(()=>{var d;return[E(rt,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E($t,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=f=>s.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),E(ur,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V((d=o.value)==null?void 0:d.message),9,JO)]}),_:1}))]),_:1})]))}});function Am(e,t){return b(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[j("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z","clip-rule":"evenodd"})])}const r3={class:"moonbase:subscription-content-card-content"},o3=["data-open"],s3={class:"moonbase:subscription-content-card-content"},i3=["data-open"],a3=pe({__name:"ContentCard",props:{subscription:{}},setup(e){const t=L(new Date),n=L(!1),r=L(null),o=te(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(b(),Z(un,{key:0,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[E(st,null,{default:k(()=>i[2]||(i[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,o3)]),default:k(()=>[E(Ft,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),j("div",r3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(_r).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(b(),Z(un,{key:1,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[E(st,null,{default:k(()=>i[3]||(i[3]=[A(" read more ")])),_:1,__:[3]})])):se("",!0)],8,i3)]),default:k(()=>[E(Ft,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),j("div",s3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(_r).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),l3={class:"moonbase:milestone-rewards"},u3={class:"moonbase:milestone-rewards-list"},c3={key:0},d3={key:1},f3=pe({__name:"MilestoneRewards",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",l3,[E(st,null,{default:k(()=>n[0]||(n[0]=[A(" Rewards: ")])),_:1,__:[0]}),j("div",u3,[(b(!0),x(ye,null,dt(Object.values(t.progress.events).flatMap(r=>r).filter(r=>r.fulfilled),r=>(b(),x("div",{key:r.milestoneId,class:"moonbase:milestone-rewards-item"},[E(Me,null,{default:k(()=>[A(V(r.message),1)]),_:2},1024),r.type==="CouponCodeMilestone"&&r.fulfilled&&r.code?(b(),x("div",c3,[E(zt,null,{default:k(()=>n[1]||(n[1]=[A(" Your coupon code: ")])),_:1,__:[1]}),n[2]||(n[2]=j("br",null,null,-1)),j("code",null,V(r.code),1)])):r.type==="PerpetualLicenseConversionMilestone"&&r.fulfilled?(b(),x("div",d3,[E(zt,null,{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),n[3]||(n[3]=A(" Your licenses have been converted to perpetual licenses. "))]),_:1,__:[3]})])):se("",!0)]))),128))])]))}}),h3={class:"moonbase:subscription"},p3={key:0,class:"moonbase:loader"},m3={key:1,class:"moonbase:loader"},b3={key:2,class:"moonbase:loader"},g3={key:3},v3={key:0,class:"moonbase:subscription-milestones"},y3={class:"moonbase:subscription-milestone-progress-title"},_3={class:"moonbase:subscription-actions"},w3=pe({__name:"Subscription",setup(e){const t=De(),{loaded:n}=tt(),r=Xa(),{getSubscription:o,renewSubscription:s,cancelSubscription:i,updateSubscriptionPaymentMethod:a}=ao(),l=L(null),u=L(new Date),c=L(null),d=L(!0);ze(async()=>{const g=t.getParameter("subscription_id");if(!g){c.value="Link is broken";return}try{l.value=await o(g)}catch(_){c.value=_.message}d.value=!1});async function f(){if(!l.value)return;if((await s(l.value.id,{redirect:!1})).completed){const _=await o(l.value.id);Wt(1500).then(()=>l.value=_)}else throw new ss}async function h(){l.value&&(l.value=await i(l.value.id))}async function p(){if(l.value){c.value=null;try{const g=await a(l.value,{returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(g!=null&&g.completed)l.value=await o(l.value.id);else throw new ss}catch(g){if(c.value=g.message,!(g instanceof ss))if(g instanceof mn)r.reportProblem("error",{type:g.name,title:g.title,detail:g.detail,status:g.status,errors:g.errors?Object.fromEntries(Object.entries(g.errors).map(([_,S])=>[_,[S]])):void 0,instance:"Subscription.vue:startUpdate"});else{const _=g;r.reportProblem("error",{type:_.name,title:_.message,instance:"Subscription.vue:startUpdate"})}throw g}}}return(g,_)=>(b(),x("div",h3,[d.value||!v(n)?(b(),x("div",p3,[E(tn)])):c.value?(b(),x("div",m3,V(c.value),1)):l.value?(b(),x("div",g3,[E(a3,{subscription:l.value},null,8,["subscription"]),l.value.milestoneProgress?(b(),x("div",v3,[j("div",y3,[E(st,null,{default:k(()=>[A(V(l.value.milestoneProgress.title),1)]),_:1}),E(zt,null,{default:k(()=>[A(V(l.value.milestoneProgress.currentNormalizedCycleNumber-(l.value.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(l.value.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(l.value.cycleLength))+"s ",1)]),_:1})]),E(ym,{progress:l.value.milestoneProgress},null,8,["progress"]),l.value.milestoneProgress.description?(b(),Z(zt,{key:0},{default:k(()=>[A(V(l.value.milestoneProgress.description),1)]),_:1})):se("",!0),Object.values(l.value.milestoneProgress.events).flatMap(S=>S).some(S=>S.fulfilled)?(b(),Z(f3,{key:1,progress:l.value.milestoneProgress},null,8,["progress"])):se("",!0)])):se("",!0),j("div",_3,[l.value.status===v(_r).Active?(b(),x(ye,{key:0},[E(Je,{label:"Update payment method",variant:"secondary",handler:p}),E(Je,{label:"Cancel subscription",variant:"danger",handler:h}),E(zt,null,{default:k(()=>[_[1]||(_[1]=A(" Cancelling a subscription will let you use the products to the end of the current period, after which you will lose access. If you want to continue using the products later, you may simply renew this subscription whenever you wish. You are currently paying ")),j("strong",null,V(v(Ut)(l.value.total.due)),1),A(" per "+V(v(wi)(l.value.cycleLength))+" for this subscription",1),l.value.paymentMethod?(b(),x(ye,{key:0},[_[0]||(_[0]=A(" using payment method ")),j("strong",null,V(l.value.paymentMethod),1)],64)):se("",!0),_[2]||(_[2]=A(". "))]),_:1,__:[1,2]})],64)):l.value.status===v(_r).Completed?(b(),Z(zt,{key:1},{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),_[3]||(_[3]=A(" This subscription has been completed, and cannot be renewed. "))]),_:1,__:[3]})):(b(),x(ye,{key:2},[l.value.nextPaymentScheduledAt&&l.value.cancellable?(b(),x(ye,{key:0},[E(Je,{label:"Continue subscription",variant:"primary",handler:f}),E(Je,{label:"Cancel subscription",variant:"danger",handler:h}),E(zt,null,{default:k(()=>[A(" We could not renew this subscription on the expiry date, the next attempt will be "+V(v(ls)(l.value.nextPaymentScheduledAt))+". To make sure you can use your products un-interrupted, continue the subscription, or cancel it if you do not wish to keep using these products. ",1)]),_:1})],64)):(b(),x(ye,{key:1},[E(Je,{label:"Continue subscription",variant:"primary",handler:f}),E(zt,null,{default:k(()=>[A(" This subscription has been stopped, and "+V(l.value.expiresAt>u.value?"expires":"expired")+" "+V(v(ls)(l.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1})],64))],64))])])):(b(),x("div",b3," Could not find subscription "))]))}}),E3=pe({__name:"App",setup(e){const t=me(lt),n=De();Xe(()=>[n.active,n.intent],([o,s])=>{});const r={Inter:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",Roboto:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap","EB Garamond":"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap",Merriweather:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",Poppins:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap","PT Serif":"https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap",Montserrat:"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",Aleo:"https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&display=swap"};if(t){const o=document.createElement("link");o.rel="stylesheet",o.href=r[t.value.theme.fonts.body],document.head.appendChild(o),document.documentElement.style.setProperty("--moonbase-font-body",t.value.theme.fonts.body??"");const s=document.createElement("link");s.rel="stylesheet",s.href=r[t.value.theme.fonts.heading],document.head.appendChild(s),document.documentElement.style.setProperty("--moonbase-font-heading",t.value.theme.fonts.heading??"")}return Xe(()=>t==null?void 0:t.value.theme.colors.primary,o=>{if(!o)return;let s=o;typeof s=="string"&&(s=Object.fromEntries(Q2(s).map(i=>[i.number<=100||i.number===950?i.number-50:i.number-100,i.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",s[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",s[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",s[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",s[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",s[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",s[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",s[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",s[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",s[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",s[900]??"")},{immediate:!0}),Xe(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),ew(),tw(),(o,s)=>{var i;return b(),x(ye,null,[(i=v(t))!=null&&i.toolbar.enabled?(b(),Z(Q_,{key:0})):se("",!0),E(q_,null,{default:k(()=>[v(n).active===v(ue).Cart?(b(),Z(xk,{key:0})):v(n).active===v(ue).Authentication?(b(),Z(H5,{key:1})):v(n).active===v(ue).Activation?(b(),Z(t5,{key:2})):v(n).active===v(ue).Product?(b(),Z(KO,{key:3})):v(n).active===v(ue).Subscription?(b(),Z(w3,{key:4})):v(n).active===v(ue).Customer?(b(),Z(wO,{key:5})):v(n).active===v(ue).Redeem?(b(),Z(n3,{key:6})):v(n).active===v(ue).About?(b(),Z(dE,{key:7})):se("",!0)]),_:1})],64)}}});function rl(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function ol(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(rl(e)&&rl(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];rl(o)&&rl(e[r])?e[r]=ol(e[r],o):o!==void 0&&(e[r]=o)}}return ol(e,...t)}function k3(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Ke(n)||yn(n)||Do(n)?t(Oe(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const cc=Symbol("url"),Dm=Symbol("moonbase_instance"),Rr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:k3(t)})),Lr=Symbol("event-emitter");class x3{constructor(){yo(this,"initialized",!1);yo(this,"pinia");yo(this,"storefront");yo(this,"options")}async setup(t,n){var u,c;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(globalThis.MoonbaseCSS&&globalThis.MoonbaseCSS.inject(),document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}this.options=L(ol(((u=this.options)==null?void 0:u.value)??Gh,n??{})),zo("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase"),(this.options.value.target??document.body).append(r);let s=t;if(t.includes(".moonbase.sh")){const d=/^(https:\/\/[a-z\-]+\.(?:beta\.)?moonbase\.sh)(.+)/.exec(t);d&&d.length>1&&d[1]&&(s=d[1],console.warn(`Moonbase url set up incorrectly, should be ${s}, was ${t}`))}this.storefront=Hy(s),this.pinia=m1(),vy(E3).use(this.storefront).use(this.pinia).provide(lt,this.options).provide(cc,s.replace(/\/$/,"")).provide(Lr,Rr).provide(Dm,this).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const a=De(this.pinia),l=tt(this.storefront);(c=this.storefront)==null||c.onCheckoutInitiated((d,f)=>{Rr(Zt.CheckoutInitiated,{order:d,total:f,user:l.user.value})}),this.storefront.onCheckoutClosed(d=>{Rr(Zt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:l.user.value}),d===J.ViewProducts&&(l.user?a.show(ue.Customer,J.ViewProducts):a.show(ue.Cart,J.ViewCart))}),this.storefront.onCheckoutCompleted(d=>{Rr(Zt.CheckoutCompleted,{order:d,user:l.user.value})})}configure(t){var r;const n=ol(((r=this.options)==null?void 0:r.value)??Gh,t??{});this.options?this.options.value=n:this.options=L(n)}on(t,n){window.addEventListener(`moonbase-storefront-${t}`,r=>n(r.detail))}handleLocationIntent(t){const n=new URLSearchParams(t.search),r=n.get("mb_intent");if(r&&Object.values(J).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===J.Checkout&&o.complete)return;this[r](o);for(const i of Object.keys(o))n.delete(`mb_${i}`);const s=n.toString();window.history.replaceState(null,"",t.href.split("?")[0]+(s?`?${s}`:""))}}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.SignIn,t)}sign_up(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!((r=this.options)!=null&&r.value.auth.signUp.enabled))throw new Error("Sign ups are not enabled");De(this.pinia).show(ue.Authentication,J.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);tt(this.storefront).user.value?n.show(ue.Authentication,J.ConfirmEmailChange,t):(n.enqueue(ue.Authentication,J.ConfirmEmailChange,t),n.show(ue.Authentication,J.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=De(this.pinia);tt(this.storefront).user.value?t.show(ue.Customer,J.ViewAccount):(t.enqueue(ue.Customer,J.ViewAccount),t.show(ue.Authentication,J.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);tt(this.storefront).user.value?n.show(ue.Customer,J.RedeemVoucher,t):n.show(ue.Redeem,J.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia),r=tt(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(ue.Activation,J.ActivateProduct,t),n.show(ue.Authentication,J.SignIn)):n.show(ue.Activation,J.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);tt(this.storefront).user.value?n.show(ue.Subscription,J.ManageSubscription,t):(n.enqueue(ue.Subscription,J.ManageSubscription,t),n.show(ue.Authentication,J.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Cart,J.ViewCart)}async add_to_cart(t){var s,i,a,l,u,c,d,f,h,p;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.product_id)&&!(t!=null&&t.bundle_id))throw new Error("You need to provide a product or bundle ID when adding to cart");const n=tr(this.storefront),r=tt(this.storefront),o=t.offer_id?Uy(t.offer_id):null;if(t!=null&&t.product_id){const g=li(t.product_id,this.storefront);if(g.value){let _=n.addToCart(g.value,(s=g.value.variations)==null?void 0:s.find(S=>S.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(_=n.setQuantity(_,_.quantity+t.quantity-1)),((i=this.options)==null?void 0:i.value.cart.quantity)==="single"&&(_=n.setQuantity(_,1)),Rr(Zt.AddedToCart,{item:_,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=li(t.product_id,this.storefront);if(_.value){let S=n.addToCart(_.value,(a=_.value.variations)==null?void 0:a.find(R=>R.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((l=this.options)==null?void 0:l.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Rr(Zt.AddedToCart,{item:S,currency:n.currency.value,user:r.user.value})}else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const g=Na(t.bundle_id,this.storefront);if(g.value){const _=(u=g.value.variations)==null?void 0:u.find(R=>R.id===t.variation_id);let S=n.addToCart(g.value,_,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(c=this.options)==null?void 0:c.value.cart.bundles.onAdd});t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((d=this.options)==null?void 0:d.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Rr(Zt.AddedToCart,{item:S,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=Na(t.bundle_id,this.storefront);if(_.value){const S=(f=_.value.variations)==null?void 0:f.find(z=>z.id===t.variation_id);let R=n.addToCart(_.value,S,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(h=this.options)==null?void 0:h.value.cart.bundles.onAdd});t!=null&&t.quantity&&(R=n.setQuantity(R,R.quantity+t.quantity-1)),((p=this.options)==null?void 0:p.value.cart.quantity)==="single"&&(R=n.setQuantity(R,1)),Rr(Zt.AddedToCart,{item:R,currency:n.currency.value,user:r.user.value})}else throw new Error(`Bundle '${t.bundle_id}' not found`)}}(t==null?void 0:t.show_cart)!==!1&&De(this.pinia).show(ue.Cart,J.AddToCart)}async purchase(t){var o,s,i,a,l;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(o=this.storefront)!=null&&o.loadedStorefront||await((s=this.storefront)==null?void 0:s.loadedStorefrontPromise);const n=t?Array.isArray(t)?t:[t]:[];if(n.length===0)throw new Error("No items given to purchase");const r=[];for(const u of n){if(!u.product_id&&!u.bundle_id)throw new Error("You need to provide a product or bundle ID when purchasing");if(u.product_id){const c=li(u.product_id,this.storefront);if(c.value)r.push({item:c.value,variation:(i=c.value.variations)==null?void 0:i.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Product '${u.product_id}' not found`)}if(u.bundle_id){const c=Na(u.bundle_id,this.storefront);if(c.value)r.push({item:c.value,variation:(a=c.value.variations)==null?void 0:a.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Bundle '${u.bundle_id}' not found`)}}await jy(r,{redirect:((l=this.options)==null?void 0:l.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`},this.storefront)}checkout(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;tr(this.storefront).checkout({redirect:((r=this.options)==null?void 0:r.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`})}close_checkout(){var t;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(t=this.storefront)==null||t.closeCheckout()}view_about(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.About,J.ViewAbout)}}const dc=new x3;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=dc),xt.MoonbaseIntent=J,xt.default=dc,xt.eventEmitterKey=Lr,xt.instanceKey=Dm,xt.urlKey=cc,Object.defineProperties(xt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
36
|
+
*/const Bp=.027,C2=5e-4,N2=.1,Fp=1.14,Wa=.022,zp=1.414,P2=(e,t)=>{e=new Q(e),t=new Q(t),e.alpha()<1&&(e=Jo(t,e,e.alpha(),"rgb"));const n=Hp(...e.rgb()),r=Hp(...t.rgb()),o=n>=Wa?n:n+Math.pow(Wa-n,zp),s=r>=Wa?r:r+Math.pow(Wa-r,zp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<C2?0:o<s?i*Fp:a*Fp;return(Math.abs(l)<N2?0:l>0?l-Bp:l+Bp)*100};function Hp(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:ir,pow:pt,min:T2,max:$2,atan2:qp,abs:Wp,cos:Za,sin:Zp,exp:A2,PI:Yp}=Math;function D2(e,t,n=1,r=1,o=1){var s=function($e){return 360*$e/(2*Yp)},i=function($e){return 2*Yp*$e/360};e=new Q(e),t=new Q(t);const[a,l,u]=Array.from(e.lab()),[c,d,f]=Array.from(t.lab()),h=(a+c)/2,p=ir(pt(l,2)+pt(u,2)),g=ir(pt(d,2)+pt(f,2)),_=(p+g)/2,S=.5*(1-ir(pt(_,7)/(pt(_,7)+pt(25,7)))),R=l*(1+S),z=d*(1+S),q=ir(pt(R,2)+pt(u,2)),B=ir(pt(z,2)+pt(f,2)),D=(q+B)/2,y=s(qp(u,R)),P=s(qp(f,z)),I=y>=0?y:y+360,$=P>=0?P:P+360,T=Wp(I-$)>180?(I+$+360)/2:(I+$)/2,M=1-.17*Za(i(T-30))+.24*Za(i(2*T))+.32*Za(i(3*T+6))-.2*Za(i(4*T-63));let ie=$-I;ie=Wp(ie)<=180?ie:$<=I?ie+360:ie-360,ie=2*ir(q*B)*Zp(i(ie)/2);const Se=c-a,N=B-q,H=1+.015*pt(h-50,2)/ir(20+pt(h-50,2)),U=1+.045*D,ne=1+.015*D*M,be=30*A2(-pt((T-275)/25,2)),he=-(2*ir(pt(D,7)/(pt(D,7)+pt(25,7))))*Zp(2*i(be)),we=ir(pt(Se/(n*H),2)+pt(N/(r*U),2)+pt(ie/(o*ne),2)+he*(N/(r*U))*(ie/(o*ne)));return $2(0,T2(100,we))}function I2(e,t,n="lab"){e=new Q(e),t=new Q(t);const r=e.get(n),o=t.get(n);let s=0;for(let i in r){const a=(r[i]||0)-(o[i]||0);s+=a*a}return Math.sqrt(s)}const M2=(...e)=>{try{return new Q(...e),!0}catch{return!1}},V2={cool(){return qa([Ve.hsl(180,1,.9),Ve.hsl(250,.7,.4)])},hot(){return qa(["#000","#f00","#ff0","#fff"]).mode("rgb")}},nc={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Gp=Object.keys(nc),Kp=new Map(Gp.map(e=>[e.toLowerCase(),e])),R2=typeof Proxy=="function"?new Proxy(nc,{get(e,t){const n=t.toLowerCase();if(Kp.has(n))return e[Kp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Gp)}}):nc,L2=(...e)=>{e=Ie(e,"cmyk");const[t,n,r,o]=e,s=e.length>4?e[4]:1;return o===1?[0,0,0,s]:[t>=1?0:255*(1-t)*(1-o),n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),s]},{max:Xp}=Math,j2=(...e)=>{let[t,n,r]=Ie(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Xp(t,Xp(n,r)),s=o<1?1/(1-o):0,i=(1-t-o)*s,a=(1-n-o)*s,l=(1-r-o)*s;return[i,a,l,o]};Q.prototype.cmyk=function(){return j2(this._rgb)},Object.assign(Ve,{cmyk:(...e)=>new Q(...e,"cmyk")}),Te.format.cmyk=L2,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"cmyk"),je(e)==="array"&&e.length===4)return"cmyk"}});const U2=(...e)=>{const t=Ie(e,"hsla");let n=Ko(e)||"lsa";return t[0]=an(t[0]||0)+"deg",t[1]=an(t[1]*100)+"%",t[2]=an(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},B2=(...e)=>{const t=Ie(e,"lab");let n=Ko(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=an(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},F2=(...e)=>{const t=Ie(e,"lch");let n=Ko(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},z2=(...e)=>{const t=Ie(e,"lab");return t[0]=an(t[0]*100)+"%",t[1]=Uu(t[1]),t[2]=Uu(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Jp=(...e)=>{const[t,n,r,...o]=Ie(e,"rgb"),[s,i,a]=Ju(t,n,r),[l,u,c]=Ap(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},H2=(...e)=>{const t=Ie(e,"lch");return t[0]=an(t[0]*100)+"%",t[1]=Uu(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:rc}=Math,q2=(...e)=>{const t=Ie(e,"rgba");let n=Ko(e)||"rgb";if(n.substr(0,3)==="hsl")return U2(Ip(t),n);if(n.substr(0,3)==="lab"){const r=_i();sr("d50");const o=B2(Hu(t),n);return sr(r),o}if(n.substr(0,3)==="lch"){const r=_i();sr("d50");const o=F2(Yu(t),n);return sr(r),o}return n.substr(0,5)==="oklab"?z2(Ju(t)):n.substr(0,5)==="oklch"?H2(Jp(t)):(t[0]=rc(t[0]),t[1]=rc(t[1]),t[2]=rc(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},Qp=(...e)=>{e=Ie(e,"lch");const[t,n,r,...o]=e,[s,i,a]=$p(t,n,r),[l,u,c]=Xu(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},ar=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,Sn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Ya=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,ln=/\s*/.source,ns=/\s+/.source,oc=/\s*,\s*/.source,Ga=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,rs=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,em=new RegExp("^rgba?\\("+ln+[ar,ar,ar].join(ns)+rs+"\\)$"),tm=new RegExp("^rgb\\("+ln+[ar,ar,ar].join(oc)+ln+"\\)$"),nm=new RegExp("^rgba\\("+ln+[ar,ar,ar,Sn].join(oc)+ln+"\\)$"),rm=new RegExp("^hsla?\\("+ln+[Ga,Ya,Ya].join(ns)+rs+"\\)$"),om=new RegExp("^hsl?\\("+ln+[Ga,Ya,Ya].join(oc)+ln+"\\)$"),sm=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,im=new RegExp("^lab\\("+ln+[Sn,Sn,Sn].join(ns)+rs+"\\)$"),am=new RegExp("^lch\\("+ln+[Sn,Sn,Ga].join(ns)+rs+"\\)$"),lm=new RegExp("^oklab\\("+ln+[Sn,Sn,Sn].join(ns)+rs+"\\)$"),um=new RegExp("^oklch\\("+ln+[Sn,Sn,Ga].join(ns)+rs+"\\)$"),{round:cm}=Math,os=e=>e.map((t,n)=>n<=2?go(cm(t),0,255):t),mt=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),Bt=(e,t)=>e==="none"?t:e,sc=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Te.format.named)try{return Te.format.named(e)}catch{}if((t=e.match(em))||(t=e.match(tm))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+mt(Bt(n[o],0),0,255);n=os(n);const r=t[4]!==void 0?+mt(t[4],0,1):1;return n[3]=r,n}if(t=e.match(nm)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+mt(n[r],0,255);return n}if((t=e.match(rm))||(t=e.match(om))){const n=t.slice(1,4);n[0]=+Bt(n[0].replace("deg",""),0),n[1]=+mt(Bt(n[1],0),0,100)*.01,n[2]=+mt(Bt(n[2],0),0,100)*.01;const r=os(Ku(n)),o=t[4]!==void 0?+mt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(sm)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Ku(n);for(let o=0;o<3;o++)r[o]=cm(r[o]);return r[3]=+t[4],r}if(t=e.match(im)){const n=t.slice(1,4);n[0]=mt(Bt(n[0],0),0,100),n[1]=mt(Bt(n[1],0),-125,125,!0),n[2]=mt(Bt(n[2],0),-125,125,!0);const r=_i();sr("d50");const o=os(Fu(n));sr(r);const s=t[4]!==void 0?+mt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(am)){const n=t.slice(1,4);n[0]=mt(n[0],0,100),n[1]=mt(Bt(n[1],0),0,150,!1),n[2]=+Bt(n[2].replace("deg",""),0);const r=_i();sr("d50");const o=os(Zu(n));sr(r);const s=t[4]!==void 0?+mt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(lm)){const n=t.slice(1,4);n[0]=mt(Bt(n[0],0),0,1),n[1]=mt(Bt(n[1],0),-.4,.4,!0),n[2]=mt(Bt(n[2],0),-.4,.4,!0);const r=os(Xu(n)),o=t[4]!==void 0?+mt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(um)){const n=t.slice(1,4);n[0]=mt(Bt(n[0],0),0,1),n[1]=mt(Bt(n[1],0),0,.4,!1),n[2]=+Bt(n[2].replace("deg",""),0);const r=os(Qp(n)),o=t[4]!==void 0?+mt(t[4],0,1):1;return r[3]=o,r}};sc.test=e=>em.test(e)||rm.test(e)||im.test(e)||am.test(e)||lm.test(e)||um.test(e)||tm.test(e)||nm.test(e)||om.test(e)||sm.test(e)||e==="transparent",Q.prototype.css=function(e){return q2(this._rgb,e)};const W2=(...e)=>new Q(...e,"css");Ve.css=W2,Te.format.css=sc,Te.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&sc.test(e))return"css"}}),Te.format.gl=(...e)=>{const t=Ie(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const Z2=(...e)=>new Q(...e,"gl");Ve.gl=Z2,Q.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Q.prototype.hex=function(e){return Np(this._rgb,e)};const Y2=(...e)=>new Q(...e,"hex");Ve.hex=Y2,Te.format.hex=Cp,Te.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Ka}=Math,dm=e=>{const t=e/100;let n,r,o;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*Ka(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*Ka(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Ka(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Ka(r),o=255),[n,r,o,1]},{round:G2}=Math,K2=(...e)=>{const t=Ie(e,"rgb"),n=t[0],r=t[2];let o=1e3,s=4e4;const i=.4;let a;for(;s-o>i;){a=(s+o)*.5;const l=dm(a);l[2]/l[0]>=r/n?s=a:o=a}return G2(a)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return K2(this._rgb)};const ic=(...e)=>new Q(...e,"temp");Object.assign(Ve,{temp:ic,kelvin:ic,temperature:ic}),Te.format.temp=Te.format.kelvin=Te.format.temperature=dm,Q.prototype.oklch=function(){return Jp(this._rgb)},Object.assign(Ve,{oklch:(...e)=>new Q(...e,"oklch")}),Te.format.oklch=Qp,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"oklch"),je(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Ve,{analyze:jp,average:e2,bezier:i2,blend:On,brewer:R2,Color:Q,colors:Xo,contrast:S2,contrastAPCA:P2,cubehelix:v2,deltaE:D2,distance:I2,input:Te,interpolate:Jo,limits:Up,mix:Jo,random:E2,scale:qa,scales:V2,valid:M2});const X2=[{name:"Slate",id:"slate",reference:!1,shades:[{number:50,hexcode:"#f8fafc"},{number:100,hexcode:"#f1f5f9"},{number:200,hexcode:"#e2e8f0"},{number:300,hexcode:"#cbd5e1"},{number:400,hexcode:"#94a3b8"},{number:500,hexcode:"#64748b"},{number:600,hexcode:"#475569"},{number:700,hexcode:"#334155"},{number:800,hexcode:"#1e293b"},{number:900,hexcode:"#0f172a"},{number:950,hexcode:"#020617"}]},{name:"Gray",id:"gray",reference:!1,shades:[{number:50,hexcode:"#f9fafb"},{number:100,hexcode:"#f3f4f6"},{number:200,hexcode:"#e5e7eb"},{number:300,hexcode:"#d1d5db"},{number:400,hexcode:"#9ca3af"},{number:500,hexcode:"#6b7280"},{number:600,hexcode:"#4b5563"},{number:700,hexcode:"#374151"},{number:800,hexcode:"#1f2937"},{number:900,hexcode:"#111827"},{number:950,hexcode:"#030712"}]},{name:"Zinc",id:"zinc",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f4f4f5"},{number:200,hexcode:"#e4e4e7"},{number:300,hexcode:"#d4d4d8"},{number:400,hexcode:"#a1a1aa"},{number:500,hexcode:"#71717a"},{number:600,hexcode:"#52525b"},{number:700,hexcode:"#3f3f46"},{number:800,hexcode:"#27272a"},{number:900,hexcode:"#18181b"},{number:950,hexcode:"#09090b"}]},{name:"Neutral",id:"neutral",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f5f5f5"},{number:200,hexcode:"#e5e5e5"},{number:300,hexcode:"#d4d4d4"},{number:400,hexcode:"#a3a3a3"},{number:500,hexcode:"#737373"},{number:600,hexcode:"#525252"},{number:700,hexcode:"#404040"},{number:800,hexcode:"#262626"},{number:900,hexcode:"#171717"},{number:950,hexcode:"#0a0a0a"}]},{name:"Stone",id:"stone",reference:!1,shades:[{number:50,hexcode:"#fafaf9"},{number:100,hexcode:"#f5f5f4"},{number:200,hexcode:"#e7e5e4"},{number:300,hexcode:"#d6d3d1"},{number:400,hexcode:"#a8a29e"},{number:500,hexcode:"#78716c"},{number:600,hexcode:"#57534e"},{number:700,hexcode:"#44403c"},{number:800,hexcode:"#292524"},{number:900,hexcode:"#1c1917"},{number:950,hexcode:"#0c0a09"}]},{name:"Red",id:"red",reference:!0,shades:[{number:50,hexcode:"#fef2f2"},{number:100,hexcode:"#fee2e2"},{number:200,hexcode:"#fecaca"},{number:300,hexcode:"#fca5a5"},{number:400,hexcode:"#f87171"},{number:500,hexcode:"#ef4444"},{number:600,hexcode:"#dc2626"},{number:700,hexcode:"#b91c1c"},{number:800,hexcode:"#991b1b"},{number:900,hexcode:"#7f1d1d"},{number:950,hexcode:"#450a0a"}]},{name:"Orange",id:"orange",reference:!0,shades:[{number:50,hexcode:"#fff7ed"},{number:100,hexcode:"#ffedd5"},{number:200,hexcode:"#fed7aa"},{number:300,hexcode:"#fdba74"},{number:400,hexcode:"#fb923c"},{number:500,hexcode:"#f97316"},{number:600,hexcode:"#ea580c"},{number:700,hexcode:"#c2410c"},{number:800,hexcode:"#9a3412"},{number:900,hexcode:"#7c2d12"},{number:950,hexcode:"#431407"}]},{name:"Amber",id:"amber",reference:!0,shades:[{number:50,hexcode:"#fffbeb"},{number:100,hexcode:"#fef3c7"},{number:200,hexcode:"#fde68a"},{number:300,hexcode:"#fcd34d"},{number:400,hexcode:"#fbbf24"},{number:500,hexcode:"#f59e0b"},{number:600,hexcode:"#d97706"},{number:700,hexcode:"#b45309"},{number:800,hexcode:"#92400e"},{number:900,hexcode:"#78350f"},{number:950,hexcode:"#451a03"}]},{name:"Yellow",id:"yellow",reference:!0,shades:[{number:50,hexcode:"#fefce8"},{number:100,hexcode:"#fef9c3"},{number:200,hexcode:"#fef08a"},{number:300,hexcode:"#fde047"},{number:400,hexcode:"#facc15"},{number:500,hexcode:"#eab308"},{number:600,hexcode:"#ca8a04"},{number:700,hexcode:"#a16207"},{number:800,hexcode:"#854d0e"},{number:900,hexcode:"#713f12"},{number:950,hexcode:"#422006"}]},{name:"Lime",id:"lime",reference:!0,shades:[{number:50,hexcode:"#f7fee7"},{number:100,hexcode:"#ecfccb"},{number:200,hexcode:"#d9f99d"},{number:300,hexcode:"#bef264"},{number:400,hexcode:"#a3e635"},{number:500,hexcode:"#84cc16"},{number:600,hexcode:"#65a30d"},{number:700,hexcode:"#4d7c0f"},{number:800,hexcode:"#3f6212"},{number:900,hexcode:"#365314"},{number:950,hexcode:"#1a2e05"}]},{name:"Green",id:"green",reference:!0,shades:[{number:50,hexcode:"#f0fdf4"},{number:100,hexcode:"#dcfce7"},{number:200,hexcode:"#bbf7d0"},{number:300,hexcode:"#86efac"},{number:400,hexcode:"#4ade80"},{number:500,hexcode:"#22c55e"},{number:600,hexcode:"#16a34a"},{number:700,hexcode:"#15803d"},{number:800,hexcode:"#166534"},{number:900,hexcode:"#14532d"},{number:950,hexcode:"#052e16"}]},{name:"Emerald",id:"emerald",reference:!0,shades:[{number:50,hexcode:"#ecfdf5"},{number:100,hexcode:"#d1fae5"},{number:200,hexcode:"#a7f3d0"},{number:300,hexcode:"#6ee7b7"},{number:400,hexcode:"#34d399"},{number:500,hexcode:"#10b981"},{number:600,hexcode:"#059669"},{number:700,hexcode:"#047857"},{number:800,hexcode:"#065f46"},{number:900,hexcode:"#064e3b"},{number:950,hexcode:"#022c22"}]},{name:"Teal",id:"teal",reference:!0,shades:[{number:50,hexcode:"#f0fdfa"},{number:100,hexcode:"#ccfbf1"},{number:200,hexcode:"#99f6e4"},{number:300,hexcode:"#5eead4"},{number:400,hexcode:"#2dd4bf"},{number:500,hexcode:"#14b8a6"},{number:600,hexcode:"#0d9488"},{number:700,hexcode:"#0f766e"},{number:800,hexcode:"#115e59"},{number:900,hexcode:"#134e4a"},{number:950,hexcode:"#042f2e"}]},{name:"Cyan",id:"cyan",reference:!0,shades:[{number:50,hexcode:"#ecfeff"},{number:100,hexcode:"#cffafe"},{number:200,hexcode:"#a5f3fc"},{number:300,hexcode:"#67e8f9"},{number:400,hexcode:"#22d3ee"},{number:500,hexcode:"#06b6d4"},{number:600,hexcode:"#0891b2"},{number:700,hexcode:"#0e7490"},{number:800,hexcode:"#155e75"},{number:900,hexcode:"#164e63"},{number:950,hexcode:"#083344"}]},{name:"Sky",id:"sky",reference:!0,shades:[{number:50,hexcode:"#f0f9ff"},{number:100,hexcode:"#e0f2fe"},{number:200,hexcode:"#bae6fd"},{number:300,hexcode:"#7dd3fc"},{number:400,hexcode:"#38bdf8"},{number:500,hexcode:"#0ea5e9"},{number:600,hexcode:"#0284c7"},{number:700,hexcode:"#0369a1"},{number:800,hexcode:"#075985"},{number:900,hexcode:"#0c4a6e"},{number:950,hexcode:"#082f49"}]},{name:"Blue",id:"blue",reference:!0,shades:[{number:50,hexcode:"#eff6ff"},{number:100,hexcode:"#dbeafe"},{number:200,hexcode:"#bfdbfe"},{number:300,hexcode:"#93c5fd"},{number:400,hexcode:"#60a5fa"},{number:500,hexcode:"#3b82f6"},{number:600,hexcode:"#2563eb"},{number:700,hexcode:"#1d4ed8"},{number:800,hexcode:"#1e40af"},{number:900,hexcode:"#1e3a8a"},{number:950,hexcode:"#172554"}]},{name:"Indigo",id:"indigo",reference:!0,shades:[{number:50,hexcode:"#eef2ff"},{number:100,hexcode:"#e0e7ff"},{number:200,hexcode:"#c7d2fe"},{number:300,hexcode:"#a5b4fc"},{number:400,hexcode:"#818cf8"},{number:500,hexcode:"#6366f1"},{number:600,hexcode:"#4f46e5"},{number:700,hexcode:"#4338ca"},{number:800,hexcode:"#3730a3"},{number:900,hexcode:"#312e81"},{number:950,hexcode:"#1e1b4b"}]},{name:"Violet",id:"violet",reference:!0,shades:[{number:50,hexcode:"#f5f3ff"},{number:100,hexcode:"#ede9fe"},{number:200,hexcode:"#ddd6fe"},{number:300,hexcode:"#c4b5fd"},{number:400,hexcode:"#a78bfa"},{number:500,hexcode:"#8b5cf6"},{number:600,hexcode:"#7c3aed"},{number:700,hexcode:"#6d28d9"},{number:800,hexcode:"#5b21b6"},{number:900,hexcode:"#4c1d95"},{number:950,hexcode:"#2e1065"}]},{name:"Purple",id:"purple",reference:!0,shades:[{number:50,hexcode:"#faf5ff"},{number:100,hexcode:"#f3e8ff"},{number:200,hexcode:"#e9d5ff"},{number:300,hexcode:"#d8b4fe"},{number:400,hexcode:"#c084fc"},{number:500,hexcode:"#a855f7"},{number:600,hexcode:"#9333ea"},{number:700,hexcode:"#7e22ce"},{number:800,hexcode:"#6b21a8"},{number:900,hexcode:"#581c87"},{number:950,hexcode:"#3b0764"}]},{name:"Fuchsia",id:"fuchsia",reference:!0,shades:[{number:50,hexcode:"#fdf4ff"},{number:100,hexcode:"#fae8ff"},{number:200,hexcode:"#f5d0fe"},{number:300,hexcode:"#f0abfc"},{number:400,hexcode:"#e879f9"},{number:500,hexcode:"#d946ef"},{number:600,hexcode:"#c026d3"},{number:700,hexcode:"#a21caf"},{number:800,hexcode:"#86198f"},{number:900,hexcode:"#701a75"},{number:950,hexcode:"#4a044e"}]},{name:"Pink",id:"pink",reference:!0,shades:[{number:50,hexcode:"#fdf2f8"},{number:100,hexcode:"#fce7f3"},{number:200,hexcode:"#fbcfe8"},{number:300,hexcode:"#f9a8d4"},{number:400,hexcode:"#f472b6"},{number:500,hexcode:"#ec4899"},{number:600,hexcode:"#db2777"},{number:700,hexcode:"#be185d"},{number:800,hexcode:"#9d174d"},{number:900,hexcode:"#831843"},{number:950,hexcode:"#500724"}]},{name:"Rose",id:"rose",reference:!0,shades:[{number:50,hexcode:"#fff1f2"},{number:100,hexcode:"#ffe4e6"},{number:200,hexcode:"#fecdd3"},{number:300,hexcode:"#fda4af"},{number:400,hexcode:"#fb7185"},{number:500,hexcode:"#f43f5e"},{number:600,hexcode:"#e11d48"},{number:700,hexcode:"#be123c"},{number:800,hexcode:"#9f1239"},{number:900,hexcode:"#881337"},{number:950,hexcode:"#4c0519"}]}];function J2(e){const r=X2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:Ve.deltaE(e,a.hexcode)}))})).map(i=>({...i,closestShade:i.shades.reduce((a,l)=>a.delta<l.delta?a:l)})).reduce((i,a)=>i.closestShade.delta<a.closestShade.delta?i:a),o=r.shades.map(i=>({...i,lightnessDifference:Math.abs(Ve(i.hexcode).get("hsl.l")-e.get("hsl.l"))})),s=o.reduce((i,a)=>i.lightnessDifference<a.lightnessDifference?i:a);return{...r,shades:o,closestShade:s}}function Q2(e){const t=Ve(e),n=J2(t),r=t.get("hsl.h"),o=Ve(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/Ve(n.closestShade.hexcode).get("hsl.s");return n.shades.map(u=>{if(u.number===n.closestShade.number)return{number:u.number,hexcode:t.hex()};let c=Ve(u.hexcode);const d=c.get("hsl.s")*a;return c=c.set("hsl.s",d),c=c.set("hsl.h",i),{number:u.number,hexcode:c.hex()}})}class ss extends Error{constructor(){super(),this.name="IndiscriminateError"}}const eE={},tE={fill:"none",viewBox:"0 0 24 24"};function nE(e,t){return b(),x("svg",tE,t[0]||(t[0]=[j("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),j("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))}const tn=rr(eE,[["render",nE],["__scopeId","data-v-687bcaf0"]]),rE={"aria-hidden":"true"},ac=pe({__name:"MoonButtonBase",props:{label:{},successLabel:{},errorLabel:{},icon:{},variant:{},size:{},working:{type:Boolean},success:{type:Boolean},error:{type:Boolean},disabled:{type:Boolean},type:{}},emits:["click"],setup(e){const t=e,n=me(lt),r=te(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=te(()=>t.variant?t.variant==="secondary"?`secondary-${(n==null?void 0:n.value.theme.buttons)??"light"}`:t.variant:"primary");return(s,i)=>{var a,l;return b(),Z(Yl(s.type==="anchor"?"a":"button"),{class:"moonbase:button",type:s.type||"button",disabled:s.success||s.error||s.working||s.disabled,"data-success":s.success||void 0,"data-error":s.error||void 0,"data-working":s.working||void 0,"data-variant":o.value,"data-size":s.size||"large","data-corners":(a=v(n))==null?void 0:a.theme.corners,"data-background":(l=v(n))==null?void 0:l.theme.colors.background,"data-icon-visible":s.working||s.success||s.error||!!s.icon||void 0,onClick:i[0]||(i[0]=u=>s.$emit("click",u))},{default:k(()=>[j("div",rE,[s.working?(b(),Z(tn,{key:0})):s.success?(b(),Z(v(E_),{key:1})):s.error?(b(),Z(v(S_),{key:2})):s.icon?(b(),Z(Yl(s.icon),{key:3})):se("",!0)]),A(" "+V(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),Je=pe({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},icon:{},variant:{},size:{},noReset:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,n=L(!1),r=L(!1),o=L(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Wt(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof ss)return;o.value=!0,await Wt(2500),o.value=!1}}return(i,a)=>(b(),Z(ac,{label:i.label,working:n.value,"success-label":i.success,success:r.value,"error-label":i.error,error:o.value,icon:i.icon,disabled:i.disabled,variant:i.variant,size:i.size,onClick:s},null,8,["label","working","success-label","success","error-label","error","icon","disabled","variant","size"]))}}),oE={},sE={class:"moonbase:text-body"};function iE(e,t){return b(),x("span",sE,[Ct(e.$slots,"default")])}const rt=rr(oE,[["render",iE]]),aE={},lE={class:"moonbase:text-subtext"};function uE(e,t){return b(),x("span",lE,[Ct(e.$slots,"default")])}const Me=rr(aE,[["render",uE]]),cE={class:"moonbase:about"},dE=pe({__name:"About",setup(e){const t=De(),n="0.4.47";return(r,o)=>(b(),x("div",cE,[o[2]||(o[2]=Jf('<svg viewBox="0 0 512 512" height="56px" width="56px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>',1)),E(v(pp),{as:"h3"},{default:k(()=>o[0]||(o[0]=[A(" Moonbase Embedded Storefront ")])),_:1,__:[0]}),E(Me,null,{default:k(()=>[A(" Version "+V(v(n)),1)]),_:1}),E(rt,null,{default:k(()=>o[1]||(o[1]=[A(" This store is using the "),j("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),A(" module to accept payments, provide authentication and power software licensing. ")])),_:1,__:[1]}),E(Je,{label:"Close",variant:"primary",handler:()=>v(t).reset()},null,8,["handler"])]))}});var Zt=(e=>(e.SignedIn="signed-in",e.SignedUp="signed-up",e.SignedOut="signed-out",e.RedeemedVoucher="redeemed-voucher",e.DownloadedProduct="downloaded-product",e.ActivatedProduct="activated-product",e.AddedToCart="added-to-cart",e.CheckoutInitiated="checkout-initiated",e.CheckoutClosed="checkout-closed",e.CheckoutCompleted="checkout-completed",e))(Zt||{});const fE=["data-corners","data-variant"],hE={class:"moonbase:card-content"},un=pe({__name:"MoonCard",setup(e){const t=me(lt);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:card","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-variant":(s=v(t))==null?void 0:s.theme.cards},[j("div",hE,[Ct(n.$slots,"default")]),Ct(n.$slots,"addon")],8,fE)}}}),pE=["data-corners"],mE=["href"],bE=["src"],gE=["src"],vE={key:2,class:"moonbase:image-placeholder"},Ft=pe({__name:"ProductIcon",props:{url:{},href:{},size:{}},setup(e){const t=me(lt);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:product-icon",style:Ds({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=v(t))==null?void 0:o.theme.corners},[n.href&&n.url?(b(),x("a",{key:0,href:n.href},[j("img",{src:n.url,alt:""},null,8,bE)],8,mE)):n.url?(b(),x("img",{key:1,src:n.url,alt:""},null,8,gE)):(b(),x("div",vE,[E(v(k_))]))],12,pE)}}}),yE={},_E={class:"moonbase:text-title"};function wE(e,t){return b(),x("h4",_E,[Ct(e.$slots,"default")])}const is=rr(yE,[["render",wE]]),EE={class:"moonbase:product-card-content"},fm=pe({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(b(),Z(un,{class:"moonbase:product-card"},{default:k(()=>[E(Ft,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",EE,[E(is,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),Ct(t.$slots,"description")]),Ct(t.$slots,"default")]),_:3}))}}),kE={class:"moonbase:auto-activation"},xE={key:0,class:"moonbase:loader"},OE={key:1,class:"moonbase:loader"},SE={key:2,class:"moonbase:loader"},CE={key:3},NE={key:1,class:"moonbase:loader"},PE={key:2,class:"moonbase:loader"},TE={key:3,class:"moonbase:loader"},$E={key:4,class:"moonbase:auto-activation-content"},AE={key:0,class:"moonbase:auto-activation-option"},DE={class:"moonbase:auto-activation-cta"},IE={key:1,class:"moonbase:auto-activation-option"},ME={class:"moonbase:auto-activation-cta"},VE={key:2,class:"moonbase:auto-activation-option"},RE={key:3,class:"moonbase:auto-activation-option"},LE={class:"moonbase:auto-activation-cta"},jE={key:4,class:"moonbase:auto-activation-option"},UE={key:4,class:"moonbase:auto-activation-cta"},BE={key:5,class:"moonbase:auto-activation-cta"},FE=pe({__name:"AutoActivation",setup(e){const t=De(),{user:n,loaded:r}=tt(),o=me(Lr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=Ry(s),h=me(jt);Xe(i,y=>{var P;!l.value&&!u.value&&(y==null?void 0:y.status)===pn.Requested&&((P=y==null?void 0:y.licenseEligibility)!=null&&P.eligible)&&d(),(y==null?void 0:y.status)===pn.Completed&&(o==null||o(Zt.ActivatedProduct,{product:y.product,fulfillmentType:y.fulfillmentType,user:n.value}))},{deep:!0});const p=te(()=>{if(i.value)return v(li(i.value.product.id))}),g=te(()=>p.value&&p.value.defaultVariation),{currency:_,addToCart:S,setQuantity:R}=tr();function z(){t.show(ue.Product,J.ViewProduct,{product_id:i.value.product.id})}function q(){t.enqueue(ue.Activation,J.ActivateProduct,t.parameters??void 0),t.show(ue.Authentication,J.SignIn)}function B(){if(!p.value)return;const y=S(p.value);R(y,1),t.enqueue(ue.Activation,J.ActivateProduct,t.parameters),t.show(ue.Cart,J.ViewCart)}function D(){var y;t.enqueue(ue.Activation,J.ActivateProduct,{...t.parameters,product_id:((y=i.value)==null?void 0:y.product.id)??""}),n.value?t.show(ue.Customer,J.RedeemVoucher):t.show(ue.Redeem,J.RedeemVoucher)}return(y,P)=>{var I,$,T,M,ie,Se,N;return b(),x("div",kE,[v(a)||!v(r)||!((I=v(h))!=null&&I.loadedStorefront)?(b(),x("div",xE,[E(tn)])):v(c)?(b(),x("div",OE,[E(nt,null,{default:k(()=>P[0]||(P[0]=[A(" Uh oh ")])),_:1,__:[0]}),E(rt,null,{default:k(()=>[A(V(v(c)),1)]),_:1})])):v(i)?(b(),x("div",CE,[v(i).product?(b(),Z(fm,{key:0,product:v(i).product},null,8,["product"])):se("",!0),(($=v(i))==null?void 0:$.status)===v(pn).Cancelled?(b(),x("div",NE,[E(nt,null,{default:k(()=>P[3]||(P[3]=[A(" Uh oh ")])),_:1,__:[3]}),E(rt,null,{default:k(()=>P[4]||(P[4]=[A(" This activation request was cancelled, open your app to try again. ")])),_:1,__:[4]})])):v(l)||v(u)?(b(),x("div",PE,[E(tn),E(rt,null,{default:k(()=>[A(" Activating "+V(v(i).product.name)+"... ",1)]),_:1})])):((T=v(i))==null?void 0:T.status)===v(pn).Completed?(b(),x("div",TE,[E(nt,null,{default:k(()=>P[5]||(P[5]=[A(" Done! ")])),_:1,__:[5]}),E(rt,null,{default:k(()=>P[6]||(P[6]=[A(" Your product is activated. "),j("br",null,null,-1),A(" You may close this window and return to the app. ")])),_:1,__:[6]})])):(b(),x("div",$E,[g.value?(b(),x("div",AE,[E(nt,null,{default:k(()=>P[7]||(P[7]=[A(" Option 1: Purchase product ")])),_:1,__:[7]}),E(rt,null,{default:k(()=>[A(" Buy a copy of "+V(p.value.name)+" for ",1),j("strong",null,V(v(Ut)(p.value.defaultVariation.price[v(_)],v(_))),1),P[8]||(P[8]=A(". "))]),_:1,__:[8]}),j("span",DE,[E(Je,{label:"Purchase",variant:"primary",handler:()=>B()},null,8,["handler"])])])):se("",!0),v(n)?!v(n).ownedProducts||!((M=v(n).ownedProducts)!=null&&M.includes(v(i).product.id))&&!v(n).subscribedProducts||!((ie=v(n).subscribedProducts)!=null&&ie.includes(v(i).product.id))?(b(),x("div",VE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(rt,null,{default:k(()=>P[10]||(P[10]=[A(" You don't own any licenses for this product. ")])),_:1,__:[10]})])):(Se=v(n).ownedProducts)!=null&&Se.includes(v(i).product.id)||(N=v(n).subscribedProducts)!=null&&N.includes(v(i).product.id)?(b(),x("div",RE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(rt,null,{default:k(()=>P[11]||(P[11]=[A(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1,__:[11]}),j("span",LE,[E(Je,{label:"Licenses",variant:"secondary",handler:()=>z()},null,8,["handler"])])])):se("",!0):(b(),x("div",IE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(rt,null,{default:k(()=>P[9]||(P[9]=[A(" Please sign in to use a license for this product. ")])),_:1,__:[9]}),j("span",ME,[E(Je,{label:"Sign in",variant:"secondary",handler:()=>q()},null,8,["handler"])])])),v(i).trialEligibility?(b(),x("div",jE,[E(nt,null,{default:k(()=>[A(" Option "+V(g.value?"3":"2")+": Start trial ",1)]),_:1}),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),Z(rt,{key:0},{default:k(()=>P[12]||(P[12]=[A(" You need to be signed in to start a trial for this product. ")])),_:1,__:[12]})):v(i).trialEligibility.eligible&&v(i).trialEligibility.existing?(b(),Z(rt,{key:1},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+V(v(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):v(i).trialEligibility.eligible?(b(),Z(rt,{key:2},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(b(),Z(rt,{key:3},{default:k(()=>P[13]||(P[13]=[A(" This device or product is not eligible for a trial. ")])),_:1,__:[13]})),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),x("span",UE,[E(Je,{label:"Sign in",variant:"secondary",handler:()=>q()},null,8,["handler"])])):v(i).trialEligibility.eligible?(b(),x("span",BE,[E(Je,{label:"Start trial",variant:"secondary",handler:v(f)},null,8,["handler"])])):se("",!0)])):se("",!0),P[15]||(P[15]=j("div",{class:"moonbase:grow"},null,-1)),E(Me,{class:"moonbase:auto-activation-redeem"},{default:k(()=>[P[14]||(P[14]=A(" Have a voucher code? ")),j("button",{type:"button",onClick:D}," Redeem now ")]),_:1,__:[14]})]))])):(b(),x("div",SE,[E(nt,null,{default:k(()=>P[1]||(P[1]=[A(" Uh oh ")])),_:1,__:[1]}),E(rt,null,{default:k(()=>P[2]||(P[2]=[A(" Could not find activation request ")])),_:1,__:[2]})]))])}}}),zE={},HE={class:"moonbase:text-caption"};function qE(e,t){return b(),x("span",HE,[Ct(e.$slots,"default")])}const zt=rr(zE,[["render",qE]]),WE=["data-corners"],ZE=["accept"],YE={"data-error":""},GE=pe({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=me(lt),o=L(!1),s=te(()=>{let u=".dt";return r!=null&&r.value&&(u=r.value.activation.deviceTokenFileExtension),u.startsWith(".")?u:`.${u}`});function i(u){const c=new FileReader;c.onload=d=>{var f;n("input",(f=d.target)==null?void 0:f.result)},c.readAsText(u)}function a(u){var d;o.value=!1;const c=(d=u.dataTransfer)==null?void 0:d.files;if(!c||c.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(c[0])}function l(u){const c=u.target,d=c==null?void 0:c.files;if(!d||d.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(d[0])}return(u,c)=>{var d,f;return b(),x("div",{class:Is(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=v(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=$r(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=$r(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=$r(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=$r(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=$r(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=$r(h=>o.value=!1,["prevent","stop"])),onDrop:$r(a,["prevent","stop"])},[E(v(O_)),c[6]||(c[6]=j("label",{for:"fallback-input"},[j("span",{class:"moonbase:underline"},"Choose a machine file"),A(" or drag here to upload ")],-1)),j("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,ZE),j("p",YE,V((f=u.error)==null?void 0:f.message),1)],42,WE)}}}),KE={class:"moonbase:manual-activation"},XE={key:1,class:"moonbase:loader"},JE={key:2,class:"moonbase:manual-activation-content"},QE=pe({__name:"ManualActivation",setup(e){const t=me(lt),{activateProduct:n}=ao(),r=Fi.Offline,o=L(0),s=L(null),i=L(null);async function a(l){o.value=1;try{i.value=await n(l,r),o.value=2}catch(u){s.value=u,o.value=0}}return(l,u)=>(b(),x("div",KE,[E(rt,null,{default:k(()=>u[2]||(u[2]=[A(" Upload your machine file here to get a license file for activating offline devices. The machine file can be generated in the installed app. ")])),_:1,__:[2]}),E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[o.value===0?(b(),Z(GE,{key:0,error:s.value,onInput:u[0]||(u[0]=c=>a(c)),onError:u[1]||(u[1]=c=>s.value=c)},null,8,["error"])):o.value===1?(b(),x("div",XE,[E(tn)])):o.value===2&&i.value?(b(),x("div",JE,[E(nt,null,{default:k(()=>u[3]||(u[3]=[A(" Success! ")])),_:1,__:[3]}),E(rt,null,{default:k(()=>u[4]||(u[4]=[A(" Your license can be downloaded below: ")])),_:1,__:[4]}),i.value.license.product?(b(),Z(fm,{key:0,product:i.value.license.product},{description:k(()=>[E(zt,null,{default:k(()=>[A(V(i.value.license.activeNumberOfActivations)+" of "+V(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:k(()=>{var c;return[E(Yo,{href:i.value.url,target:"_blank",download:((c=v(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:k(()=>[E(v(x_))]),_:1},8,["href","download"])]}),_:1},8,["product"])):se("",!0),u[5]||(u[5]=j("div",null,null,-1)),u[6]||(u[6]=j("div",null,null,-1))])):se("",!0)]),_:1})]))}}),e5={class:"moonbase:activation"},t5=pe({__name:"Activation",setup(e){const t=De();return(n,r)=>(b(),x("div",e5,[v(t).getParameter("token")?(b(),Z(FE,{key:0})):(b(),Z(QE,{key:1}))]))}}),n5=["disabled"],hm=Symbol("form-state"),lr=pe({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=L(!1),r=L(!1),o=L(!1),s=te(()=>t.disabled||n.value||r.value||!1);qt(hm,{working:n,isSuccess:r,isError:o,disabled:s});async function i(){n.value=!0;try{await t.handler(),n.value=!1,r.value=!0,await Wt(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Wt(2500),o.value=!1}}return(a,l)=>(b(),x("form",{disabled:s.value,onSubmit:$r(i,["prevent"])},[Ct(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,n5))}}),r5=["hidden"],o5=["for"],s5=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],i5=["id"],a5=["id"],$t=pe({inheritAttrs:!1,__name:"MoonInput",props:{name:{},label:{},placeholder:{},type:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{},hidden:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=me(lt);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:input",hidden:n.hidden||void 0},[j("label",{for:`mb-${n.name}`},V(n.label),9,o5),j("input",uu({id:`mb-${n.name}`,type:n.type??"text",name:`mb-${n.name}`,placeholder:n.placeholder,value:n.modelValue,disabled:n.disabled,"aria-invalid":!!n.error,"aria-describedby":n.error?`mb-${n.name}-error`:n.hint?`mb-${n.name}-hint`:void 0,"data-corners":(o=v(t))==null?void 0:o.theme.corners},n.$attrs,{onInput:r[0]||(r[0]=s=>{var i;return n.$emit("update:modelValue",(i=s.target)==null?void 0:i.value)})}),null,16,s5),n.error?(b(),x("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},V(n.error),9,i5)):n.hint?(b(),x("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},V(n.hint),9,a5)):se("",!0)],8,r5)}}}),ur=pe({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=me(hm);return(s,i)=>(b(),Z(ac,{label:s.label,working:v(t),"success-label":s.success,success:v(n),"error-label":s.error,error:v(r),type:"submit",disabled:v(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),l5=["data-visible"],u5={class:"moonbase:sign-in-actions"},c5=["data-corners"],d5=pe({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(lt),i=me(Lr),a=L(r.getParameter("email")??""),l=L(""),u=L(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(Zt.SignedIn,{user:d}),Wt(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof yr?u.value="User not found":u.value=d.message,d}}return(d,f)=>(b(),Z(lr,{handler:c,class:"moonbase:sign-in"},{default:k(()=>{var h,p,g;return[E($t,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=_=>a.value=_),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E($t,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,l5),E(ur,{success:"Signed in",label:"Sign in",error:"Error"}),j("div",u5,[(h=v(s))!=null&&h.auth.signUp.enabled?(b(),Z(Je,{key:0,label:"Create account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignUp,{email:a.value})},null,8,["handler"])):se("",!0),E(Je,{label:"Forgot password",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).ForgotPassword,{email:a.value})},null,8,["handler"])]),(p=v(s))!=null&&p.auth.signIn.hint?(b(),x("div",{key:0,class:"moonbase:sign-in-hint","data-corners":(g=v(s))==null?void 0:g.theme.corners},[E(v(C_)),E(Me,null,{default:k(()=>[A(V(v(s).auth.signIn.hint),1)]),_:1})],8,c5)):se("",!0)]}),_:1}))}}),lc={default:[{title:"Password must be at least 6 characters long",test:e=>e.length>=6},{title:"Password must contain uppercase letters",test:e=>/[A-Z]/.test(e)},{title:"Password must contain lowercase letters",test:e=>/[a-z]/.test(e)},{title:"Password must contain at least one number",test:e=>/\d/.test(e)},{title:"Password must contain at least one special character",test:e=>/[=+\-^$*.[\\\]{}()?!@#%&/,><':;|_~`]/.test(e)}],lax:[{title:"Password must be at least 6 characters long",test:e=>e.length>=6}]},f5={key:0,class:"moonbase:loader"},h5={key:1,class:"moonbase:error","data-visible":""},p5={key:0,class:"moonbase:password-validation"},m5=["data-visible"],b5=pe({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(lt),i=L(!0),a=L(null),l=L(""),u=L(!1),c=L(null),d=te(()=>lc[(s==null?void 0:s.value.auth.passwords)??"default"]),f=te(()=>d.value.some(p=>!p.test(l.value)));ze(async()=>{try{const p=r.getParameter("email"),g=r.getParameter("code");if(!p||!g)throw new Error("Link is broken");a.value=await o.confirmAccount(p,g)}catch(p){p instanceof yr?c.value="Could not find a user to confirm":c.value=p.message}i.value=!1});async function h(){var p,g;if(c.value=null,!!((p=a.value)!=null&&p.resetPasswordToken))try{const _=r.getParameter("email");await o.resetPassword(_,l.value,(g=a.value)==null?void 0:g.resetPasswordToken);const S=await o.signIn(_,l.value);Wt(1500).then(()=>n("confirmedAccount",S))}catch(_){throw c.value=_.message,_}}return(p,g)=>(b(),Z(lr,{handler:h,disabled:f.value,class:"moonbase:confirm-account"},{default:k(()=>[i.value?(b(),x("div",f5,[E(tn)])):a.value?(b(),x(ye,{key:2},[j("h3",null," Hi "+V(a.value.name)+", ",1),g[2]||(g[2]=j("p",null," Please create a new password for your account: ",-1)),E($t,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E($t,{modelValue:l.value,"onUpdate:modelValue":g[0]||(g[0]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:g[1]||(g[1]=_=>u.value=!0)},null,8,["modelValue"]),u.value&&f.value?(b(),x("div",p5,[(b(!0),x(ye,null,dt(d.value.filter(_=>!_.test(l.value)),_=>(b(),Z(Me,{key:_.title,"data-error":""},{default:k(()=>[A(V(_.title),1)]),_:2},1024))),128))])):se("",!0),E(ur,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!c.value||void 0},V(c.value),9,m5)],64)):(b(),x("div",h5,V(c.value),1))]),_:1},8,["disabled"]))}}),g5={class:"moonbase:confirm-email-change"},v5={key:0,class:"moonbase:loader"},y5={key:1,class:"moonbase:error","data-visible":""},_5=pe({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmail:s}=tt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Wt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(b(),x("div",g5,[i.value?(b(),x("div",v5,[E(tn)])):a.value?(b(),x("div",y5,V(a.value),1)):(b(),x(ye,{key:2},[E(nt,null,{default:k(()=>u[0]||(u[0]=[A(" Success! ")])),_:1,__:[0]}),u[1]||(u[1]=j("p",null," Thanks for confirming your new email. ",-1)),v(o)?(b(),Z(Je,{key:0,handler:()=>v(r).show(v(ue).Customer,v(J).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):se("",!0)],64))]))}}),w5={class:"moonbase:confirm-email-change"},E5={key:0,class:"moonbase:loader"},k5={key:1,class:"moonbase:error","data-visible":""},x5=pe({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmailChange:s}=tt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Wt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return b(),x("div",w5,[i.value?(b(),x("div",E5,[E(tn)])):a.value?(b(),x("div",k5,V(a.value),1)):(b(),x(ye,{key:2},[j("h3",null," Hi "+V((c=v(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=j("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),O5=["data-visible"],S5=pe({__name:"ForgotPassword",setup(e){const t=De(),n=tt(),r=L(t.getParameter("email")??""),o=L(null),s=L(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Wt(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof yr?o.value="User not found":o.value=a.message,a}}return(a,l)=>(b(),Z(lr,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:k(({disabled:u})=>[l[1]||(l[1]=j("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),E($t,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:"",disabled:u},null,8,["modelValue","disabled"]),E(ur,{success:"Email sent",label:"Reset password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V(o.value),9,O5)]),_:1,__:[1]}))}}),C5={key:0,class:"moonbase:password-validation"},N5=["data-visible"],P5=pe({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(lt),i=te(()=>r.getParameter("email")),a=L(""),l=L(!1),u=L(null),c=te(()=>lc[(s==null?void 0:s.value.auth.passwords)??"default"]),d=te(()=>c.value.some(h=>!h.test(a.value)));ze(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(u.value="Link broken, please try again")});async function f(){u.value=null;const h=r.getParameter("code");if(h)try{await o.resetPassword(i.value,a.value,h);const p=await o.signIn(i.value,a.value);Wt(1500).then(()=>n("passwordReset",p))}catch(p){throw u.value=p.message,p}}return(h,p)=>(b(),Z(lr,{handler:f,disabled:d.value,class:"moonbase:reset-password"},{default:k(()=>[j("h3",null," Hi "+V(i.value)+", ",1),p[2]||(p[2]=j("p",null," Please create a new password for your account: ",-1)),E($t,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E($t,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=g=>a.value=g),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:p[1]||(p[1]=g=>l.value=!0)},null,8,["modelValue"]),l.value&&d.value?(b(),x("div",C5,[(b(!0),x(ye,null,dt(c.value.filter(g=>!g.test(a.value)),g=>(b(),Z(Me,{key:g.title,"data-error":""},{default:k(()=>[A(V(g.title),1)]),_:2},1024))),128))])):se("",!0),E(ur,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,N5)]),_:1,__:[2]},8,["disabled"]))}}),T5={class:"moonbase:checkbox"},$5={class:"moonbase:checkbox-container"},A5=["id","name","checked","disabled","aria-invalid","aria-describedby"],D5={class:"moonbase:checkbox-description"},I5=["for"],M5=["id"],V5=["id"],pm=pe({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(b(),x("div",T5,[j("div",$5,[j("input",uu({id:`mb-${t.name}`,type:"checkbox",name:`mb-${t.name}`,checked:t.modelValue,disabled:t.disabled,"aria-invalid":!!t.error,"aria-describedby":t.error?`mb-${t.name}-error`:t.hint?`mb-${t.name}-hint`:void 0},t.$attrs,{onChange:n[0]||(n[0]=r=>{var o;return t.$emit("update:modelValue",(o=r.target)==null?void 0:o.checked)})}),null,16,A5)]),j("div",D5,[j("label",{for:`mb-${t.name}`},V(t.label),9,I5),t.error?(b(),x("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},V(t.error),9,M5)):t.hint?(b(),x("p",{key:1,id:`mb-${t.name}-hint`},V(t.hint),9,V5)):se("",!0)])]))}}),R5={key:0,class:"moonbase:password-validation"},L5=["href"],j5=["href"],U5=["data-visible"],B5=pe({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=De(),o=tt(),s=me(cc),i=me(Lr),a=me(lt),l=L(""),u=L(r.getParameter("email")??""),c=L(""),d=L(!1),f=L(!1),h=L(null),p=te(()=>lc[(a==null?void 0:a.value.auth.passwords)??"default"]),g=te(()=>p.value.some(S=>!S.test(c.value)));async function _(){h.value=null;try{const S=await o.signUp(l.value,u.value,c.value,null,!0,!0,f.value);i==null||i(Zt.SignedUp,{user:S}),Wt(1500).then(()=>n("signedUp",S))}catch(S){throw h.value=S.message,S}}return(S,R)=>(b(),Z(lr,{handler:_,disabled:g.value,class:"moonbase:sign-up"},{default:k(()=>[E($t,{modelValue:l.value,"onUpdate:modelValue":R[0]||(R[0]=z=>l.value=z),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),E($t,{modelValue:u.value,"onUpdate:modelValue":R[1]||(R[1]=z=>u.value=z),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E($t,{modelValue:c.value,"onUpdate:modelValue":R[2]||(R[2]=z=>c.value=z),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:R[3]||(R[3]=z=>d.value=!0)},null,8,["modelValue"]),d.value&&g.value?(b(),x("div",R5,[(b(!0),x(ye,null,dt(p.value.filter(z=>!z.test(c.value)),z=>(b(),Z(Me,{key:z.title,"data-error":""},{default:k(()=>[A(V(z.title),1)]),_:2},1024))),128))])):se("",!0),E(pm,{modelValue:f.value,"onUpdate:modelValue":R[4]||(R[4]=z=>f.value=z),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),E(Me,null,{default:k(()=>[R[5]||(R[5]=A(" By signing up, you accept our ")),j("a",{href:`${v(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,L5),R[6]||(R[6]=A(" and ")),j("a",{href:`${v(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,j5),R[7]||(R[7]=A(". "))]),_:1,__:[5,6,7]}),E(ur,{success:"Signed up",label:"Sign up",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!h.value||void 0},V(h.value),9,U5),E(Je,{label:"I already have an account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignIn,{email:u.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),F5={class:"moonbase:authentication"},z5={key:0,class:"moonbase:loader"},H5=pe({__name:"Authentication",setup(e){const t=De(),{loaded:n}=tt();return(r,o)=>(b(),x("div",F5,[E(si,{name:v(t).direction===v(Ou).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:k(()=>[v(n)?v(t).intent===v(J).SignIn?(b(),Z(d5,{key:1,onSignedIn:o[0]||(o[0]=s=>v(t).dequeue())})):v(t).intent===v(J).SignUp?(b(),Z(B5,{key:2,onSignedUp:o[1]||(o[1]=s=>v(t).next?v(t).dequeue():v(t).show(v(ue).Customer,v(J).ViewAccount,void 0,!0))})):v(t).intent===v(J).ConfirmAccount?(b(),Z(b5,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>v(t).show(v(ue).Customer,v(J).ViewProducts,void 0,!0))})):v(t).intent===v(J).ConfirmEmail?(b(),Z(_5,{key:4})):v(t).intent===v(J).ConfirmEmailChange?(b(),Z(x5,{key:5})):v(t).intent===v(J).ForgotPassword?(b(),Z(S5,{key:6})):v(t).intent===v(J).ResetPassword?(b(),Z(P5,{key:7,onPasswordReset:o[3]||(o[3]=s=>v(t).show(v(ue).Customer,v(J).ViewAccount,void 0))})):se("",!0):(b(),x("div",z5,[E(tn)]))]),_:1},8,["name"])]))}}),q5={},W5={class:"moonbase:text-subtext-bold"};function Z5(e,t){return b(),x("span",W5,[Ct(e.$slots,"default")])}const st=rr(q5,[["render",Z5]]);function Xa(){const e=me(jt);return e||console.warn("No storefront injectable"),{reportProblem:async(t,n)=>{try{await(e==null?void 0:e.client.api.fetch(`/api/customer/insights/${t}`,null,{method:"POST",body:{origin:window==null?void 0:window.location.href,...n}}))}catch{}}}}const Y5=["data-corners","data-cards"],mm=pe({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=me(lt);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:counter","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-cards":(s=v(t))==null?void 0:s.theme.cards},[j("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[E(v(N_))]),E(Me,null,{default:k(()=>[A(V(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),j("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[E(v(P_))])],8,Y5)}}});function wi(e){switch(e){case gr.Daily:return"day";case gr.Weekly:return"week";case gr.Monthly:return"month";case gr.Quarterly:return"quarter";case gr.Yearly:return"year"}throw new Error("Unknown cycle length")}const G5={class:"moonbase:bundle-cart-item-content"},K5={key:0,class:"moonbase:bundle-cart-item-total"},X5={key:0,class:"moonbase:discount"},J5={class:"moonbase:bundle-cart-item-summary"},Q5=["data-open"],ek=["data-open"],tk={class:"moonbase:bundle-cart-item-product-list-item-content"},nk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},rk=pe({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=Na(e.lineItem.bundleId),r=me(lt),o=tr(),s=L(!1),i=L(null);return Xe(s,a=>{i.value&&(i.value.style.height=a?`${i.value.scrollHeight}px`:"0px")}),(a,l)=>{var u;return b(),Z(un,{class:"moonbase:bundle-cart-item"},ba({default:k(()=>{var c,d,f,h,p,g;return[E(Ft,{url:(c=a.lineItem.bundle)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",G5,[E(st,null,{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:k(()=>[A(V(a.lineItem.variation.name),1)]),_:1})):se("",!0)]),a.lineItem.variation?(b(),x("div",K5,[E(Go,null,{default:k(()=>{var _;return[a.lineItem.variation.hasDiscount?(b(),x("span",X5,V(v(Ut)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):se("",!0),A(" "+V(v(Ut)(a.lineItem.variation.price[a.currency]*a.lineItem.quantity,a.currency))+" ",1),((_=a.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(rt,{key:1},{default:k(()=>[A(" / "+V(v(wi)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1}),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:0,"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=_=>v(o).setQuantity(a.lineItem,_))},null,8,["model-value"])):(b(),Z(Je,{key:1,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(o).setQuantity(a.lineItem,0)},null,8,["handler"]))])):se("",!0)]}),_:2},[(u=v(r))!=null&&u.cart.bundles.showProducts?{name:"addon",fn:k(()=>{var c;return[j("div",J5,[a.lineItem.bundle?(b(),x("button",{key:0,onClick:l[1]||(l[1]=d=>s.value=!s.value)},[E(st,null,{default:k(()=>{var d,f,h;return[A(V((d=a.lineItem.bundle)==null?void 0:d.products.filter(p=>p.included).length)+" ",1),(f=a.lineItem.bundle)!=null&&f.products.some(p=>!p.included)?(b(),x(ye,{key:0},[A(" of "+V((h=a.lineItem.bundle)==null?void 0:h.products.length),1)],64)):se("",!0),l[2]||(l[2]=A(" products "))]}),_:1,__:[2]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},l[3]||(l[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,Q5))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,dt(((c=a.lineItem.bundle)==null?void 0:c.products)||[],d=>(b(),x("div",{key:d.id,class:"moonbase:bundle-cart-item-product-list-item"},[E(Ft,{url:d==null?void 0:d.iconUrl,size:48},null,8,["url"]),j("div",tk,[E(st,{"data-included":d.included||void 0},{default:k(()=>[d.included?(b(),x("svg",nk,l[4]||(l[4]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),A(" "+V(d==null?void 0:d.name),1)]),_:2},1032,["data-included"]),d.included?d!=null&&d.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(d.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>l[5]||(l[5]=[A(" You already own this ")])),_:1,__:[5]}))])]))),128))],8,ek)]}),key:"0"}:void 0]),1024)}}}),ok={class:"moonbase:cart-offer-content"},sk=["href"],ik={class:"moonbase:cart-offer-cta"},ak={key:0,class:"moonbase:discount"},lk={class:"moonbase:cart-offer-bundle-summary"},uk=["data-open"],ck=["data-open"],dk={class:"moonbase:cart-offer-bundle-product-list-item-content"},fk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},hk=["href"],pk=pe({__name:"OfferUpsell",props:{offer:{}},setup(e){const t=e,n=me(lt),{addToCart:r,currency:o}=tr(),s=L(!1),i=L(null);Xe(s,c=>{i.value&&(i.value.style.height=c?`${i.value.scrollHeight}px`:"0px")});const a=te(()=>{var c;return(c=t.offer.target.defaultVariation)==null?void 0:c.originalPrice}),l=te(()=>t.offer.target.defaultVariation?od.subtract(t.offer.target.defaultVariation.price,wl.apply(t.offer.discount,t.offer.target.defaultVariation.price)):a.value),u=te(()=>!Kh(a.value,l.value));return(c,d)=>(b(),Z(un,{class:"moonbase:cart-offer"},ba({default:k(()=>[E(Ft,{url:c.offer.target.iconUrl,href:c.offer.target.type==="Product"?c.offer.target.website:void 0,size:64},null,8,["url","href"]),j("div",ok,[E(st,{class:"moonbase:cart-offer-name"},{default:k(()=>[c.offer.target.type==="Product"&&c.offer.target.website?(b(),x("a",{key:0,href:c.offer.target.website},V(c.offer.discount.name),9,sk)):(b(),x(ye,{key:1},[A(V(c.offer.discount.name),1)],64))]),_:1}),c.offer.discount.description?(b(),Z(Me,{key:0,class:"moonbase:cart-offer-description"},{default:k(()=>[A(V(c.offer.discount.description),1)]),_:1})):se("",!0)]),j("div",ik,[l.value?(b(),Z(Go,{key:0},{default:k(()=>[u.value&&a.value?(b(),x("span",ak,V(v(Ut)(a.value[v(o)],v(o))),1)):se("",!0),A(" "+V(v(Ut)(l.value[v(o)],v(o))),1)]),_:1})):se("",!0),E(Je,{label:"Add to cart",variant:"secondary",size:"small",handler:()=>{var f;return v(r)(c.offer.target,void 0,c.offer,{bundleBehaviour:(f=v(n))==null?void 0:f.cart.bundles.onAdd})}},null,8,["handler"])])]),_:2},[c.offer.target.type==="Bundle"?{name:"addon",fn:k(()=>{var f;return[j("div",lk,[c.offer.target?(b(),x("button",{key:0,onClick:d[0]||(d[0]=h=>s.value=!s.value)},[E(st,null,{default:k(()=>{var h,p,g;return[A(" Contains "+V((h=c.offer.target)==null?void 0:h.products.filter(_=>_.included).length)+" ",1),(p=c.offer.target)!=null&&p.products.some(_=>!_.included)?(b(),x(ye,{key:0},[A(" of "+V((g=c.offer.target)==null?void 0:g.products.length),1)],64)):se("",!0),d[1]||(d[1]=A(" products "))]}),_:1,__:[1]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},d[2]||(d[2]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,uk))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:cart-offer-bundle-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,dt(((f=c.offer.target)==null?void 0:f.products)||[],h=>(b(),x("div",{key:h.id,class:"moonbase:cart-offer-bundle-product-list-item"},[E(Ft,{url:h.iconUrl,href:h.website,size:48},null,8,["url","href"]),j("div",dk,[E(st,{"data-included":h.included||void 0},{default:k(()=>[h.included?(b(),x("svg",fk,d[3]||(d[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),h.website?(b(),x("a",{key:1,href:h.website},V(h.name),9,hk)):(b(),x(ye,{key:2},[A(V(h.name),1)],64))]),_:2},1032,["data-included"]),h.included?h.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(h.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>d[4]||(d[4]=[A(" You already own this ")])),_:1,__:[4]}))])]))),128))],8,ck)]}),key:"0"}:void 0]),1024))}}),mk={class:"moonbase:product-cart-item-content"},bk={class:"moonbase:product-cart-item-total"},gk={key:0,class:"moonbase:discount"},vk=pe({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=li(t.lineItem.productId),r=me(lt);function o(l){var c;if(!l.variation)throw new Error("No variation found");const u=i(l);return(u==null?void 0:u.price[t.currency])??((c=l.variation)==null?void 0:c.price[t.currency])}function s(l){return!!i(l)}function i(l){var c,d;const u=((d=(c=l.variation)==null?void 0:c.pricingTiers)==null?void 0:d.filter(f=>l.quantity>=f.minQuantity))??[];return u.length>0?u[u.length-1]:null}const a=tr();return(l,u)=>(b(),Z(un,{class:"moonbase:product-cart-item"},{default:k(()=>{var c,d,f,h,p,g;return[E(Ft,{url:(c=l.lineItem.product)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",mk,[E(st,null,{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:product-cart-item-tagline","data-truncate":l.lineItem.variation&&l.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),l.lineItem.variation&&l.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:product-cart-item-variation"},{default:k(()=>[A(V(l.lineItem.variation.name),1)]),_:1})):se("",!0)]),j("div",bk,[l.lineItem.variation?(b(),Z(Go,{key:0},{default:k(()=>{var _;return[l.lineItem.variation.hasDiscount||s(l.lineItem)?(b(),x("span",gk,V(v(Ut)(l.lineItem.variation.originalPrice[l.currency]*l.lineItem.quantity,l.currency)),1)):se("",!0),A(" "+V(v(Ut)(o(l.lineItem)*l.lineItem.quantity,l.currency))+" ",1),((_=l.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(rt,{key:1},{default:k(()=>[A(" / "+V(v(wi)(l.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1})):se("",!0),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:1,"model-value":l.lineItem.quantity,"onUpdate:modelValue":u[0]||(u[0]=_=>v(a).setQuantity(l.lineItem,_))},null,8,["model-value"])):(b(),Z(Je,{key:2,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(a).setQuantity(l.lineItem,0)},null,8,["handler"]))])]}),_:1}))}}),yk={class:"moonbase:cart"},_k=["data-background"],wk=["data-corners"],Ek={class:"moonbase:cart-total"},kk={"data-error":""},xk=pe({__name:"Cart",setup(e){const t=Xa(),{items:n,total:r,currency:o,checkout:s}=tr(),i=me(lt),a=By(),l=te(()=>a.value.length===0?null:a.value.find(d=>!d.target.owned)||a.value[0]),u=L(null);async function c(){u.value=null;try{const d=await s({redirect:(i==null?void 0:i.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(d!=null&&d.completed))throw new ss}catch(d){if(u.value=d.message,!(d instanceof ss))if(d instanceof mn)t.reportProblem("error",{type:d.name,title:d.title,detail:d.detail,status:d.status,errors:d.errors?Object.fromEntries(Object.entries(d.errors).map(([f,h])=>[f,[h]])):void 0,instance:"Cart.vue:startCheckout"});else{const f=d;t.reportProblem("error",{type:f.name,title:f.message,instance:"Cart.vue:startCheckout"})}throw d}}return(d,f)=>{var h,p;return b(),x("div",yk,[v(n).length>0?(b(),x("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(h=v(i))==null?void 0:h.theme.colors.background},[(b(!0),x(ye,null,dt(v(n),g=>(b(),x("li",{key:g.id},[g.type==="Product"?(b(),Z(vk,{key:0,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):g.type==="Bundle"?(b(),Z(rk,{key:1,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):se("",!0)]))),128)),l.value?(b(),x(ye,{key:0},[f[0]||(f[0]=j("li",{class:"moonbase:grow"},null,-1)),j("li",null,[E(st,null,{default:k(()=>{var g;return[A(V((g=v(i))==null?void 0:g.cart.offers.label),1)]}),_:1}),E(pk,{offer:l.value},null,8,["offer"])])],64)):se("",!0)],8,_k)):(b(),x("div",{key:1,class:"moonbase:cart-empty","data-corners":(p=v(i))==null?void 0:p.theme.corners},[E(v(T_)),E(st,null,{default:k(()=>f[1]||(f[1]=[A(" Your cart is empty ")])),_:1,__:[1]})],8,wk)),j("div",Ek,[f[2]||(f[2]=j("label",null," Total ",-1)),j("span",null,V(v(Ut)(v(r).amount,v(r).currency)),1),f[3]||(f[3]=j("p",null," Sales tax to be calculated at checkout ",-1)),j("p",kk,V(u.value),1)]),E(Je,{handler:c,disabled:v(n).length===0,label:"Checkout",error:u.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),Ok={class:"moonbase:account"},Sk={key:0,class:"moonbase:error"},Ck={key:1,class:"moonbase:notification"},Nk={key:0,class:"moonbase:error"},Pk=pe({__name:"Account",setup(e){var R,z,q;const t=De(),{user:n,update:r,setPassword:o,signOut:s}=tt(),i=me(Lr),a=L(((R=n.value)==null?void 0:R.name)??""),l=L(((z=n.value)==null?void 0:z.email)??""),u=L(((q=n.value)==null?void 0:q.communicationPreferences)??{newsletterOptIn:!1}),c=L(null),d=L(!1),f=L(""),h=L(""),p=L(null);async function g(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(B){throw c.value=B,B}}async function _(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(B){throw p.value=B,B}}async function S(){const B={...n.value};await s(),i==null||i(Zt.SignedOut,{user:B}),t.reset()}return(B,D)=>(b(),x("div",Ok,[E(lr,{handler:g},{default:k(()=>[E($t,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=y=>a.value=y),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),E($t,{modelValue:l.value,"onUpdate:modelValue":D[1]||(D[1]=y=>l.value=y),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),E(pm,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":D[2]||(D[2]=y=>u.value.newsletterOptIn=y),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),E(ur,{label:"Update",error:"Error",success:"Updated"}),c.value?(b(),x("p",Sk,V(c.value.message),1)):d.value?(b(),x("p",Ck," You need to confirm your new email address, please check your inbox ")):se("",!0)]),_:1}),E(lr,{handler:_},{default:k(()=>[E($t,{modelValue:f.value,"onUpdate:modelValue":D[3]||(D[3]=y=>f.value=y),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),E($t,{modelValue:h.value,"onUpdate:modelValue":D[4]||(D[4]=y=>h.value=y),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),E(ur,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(b(),x("p",Nk,V(p.value.message),1)):se("",!0)]),_:1}),E(Je,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:S})]))}}),bm=e=>e.includes("."),Tk={class:"moonbase:products"},$k={key:0,class:"moonbase:loader"},Ak={key:1,class:"moonbase:loader"},Dk=["data-is-sub-product"],Ik={key:0,class:"moonbase:products-item-sub-product-icon"},Mk={class:"moonbase:products-item-content"},Vk=pe({__name:"Products",setup(e){const t=De(),{getProducts:n}=ao(),r=L(null);return ze(async()=>{let o=await n();for(r.value=o.items;o.hasMore&&o.next;)o=await n(o.next),r.value.push(...o.items)}),(o,s)=>(b(),x("div",Tk,[r.value?r.value.length===0?(b(),x("div",Ak," No products found ")):se("",!0):(b(),x("div",$k,[E(tn),s[0]||(s[0]=A(" Loading products.. "))])),(b(!0),x(ye,null,dt(r.value||[],i=>(b(),x("div",{key:i.id,class:"moonbase:products-item","data-is-sub-product":v(bm)(i.id)||void 0},[v(bm)(i.id)?(b(),x("div",Ik,s[1]||(s[1]=[j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499"})],-1)]))):se("",!0),E(Ft,{url:i.iconUrl,size:48},null,8,["url"]),j("div",Mk,[E(st,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(b(),Z(Me,{key:0},{default:k(()=>[A(V((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):se("",!0)]),j("div",null,[E(Yo,{variant:"subtle",onClick:a=>v(t).show(v(ue).Product,v(J).ViewProduct,{product_id:i.id})},{default:k(()=>[E(v(wp)),s[2]||(s[2]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[2]},1032,["onClick"])])],8,Dk))),128))]))}}),Rk={class:"moonbase:bundle-redemption-item-content"},Lk={class:"moonbase:bundle-redemption-item-summary"},jk=["data-open"],Uk=["data-open"],gm=pe({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=L(!1),n=L(null);return Xe(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(b(),Z(un,{class:"moonbase:bundle-redemption-item"},{addon:k(()=>{var s;return[j("div",Lk,[r.bundle?(b(),x("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[E(st,null,{default:k(()=>{var i;return[A(V((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),E(Me,null,{default:k(()=>[A(V(t.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,jk))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(b(!0),x(ye,null,dt(((s=r.bundle)==null?void 0:s.products)||[],i=>(b(),x("div",{key:i.id},[E(Ft,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[E(st,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.tagline?(b(),Z(Me,{key:0},{default:k(()=>[A(V(i.tagline),1)]),_:2},1024)):se("",!0)])]))),128))],8,Uk)]}),default:k(()=>[E(Ft,{url:r.bundle.iconUrl,size:72},null,8,["url"]),j("div",Rk,[E(st,null,{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-redemption-item-tagline"},{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),Bk={class:"moonbase:product-redemption-item-content"},vm=pe({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(b(),Z(un,{class:"moonbase:product-redemption-item"},{default:k(()=>[E(Ft,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",Bk,[E(st,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,{class:"moonbase:product-redemption-item-tagline"},{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),Fk={class:"moonbase:redeem"},zk=["data-visible"],Hk={key:1,class:"moonbase:redeem-voucher"},qk={key:0,class:"moonbase:redeem-voucher-content"},Wk={key:1,class:"moonbase:redeem-voucher-return"},Zk=pe({__name:"Redeem",setup(e){const{redeem:t}=Ph(),n=De(),r=tt(),o=me(Lr),s=L(null),i=L(null),a=L(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(Zt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(b(),x("div",Fk,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[s.value?(b(),x("div",Hk,[j("div",null,[E(is,null,{default:k(()=>[A(V(s.value.name),1)]),_:1}),s.value.description?(b(),Z(nt,{key:0},{default:k(()=>[A(' "'+V(s.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[E(v(w_)),c[2]||(c[2]=A(" Licenses have been added to your account. "))]),_:1,__:[2]}),E(Me,null,{default:k(()=>[c[3]||(c[3]=A(" Code: ")),j("strong",null,V(s.value.code),1)]),_:1,__:[3]})]),E(nt,null,{default:k(()=>c[4]||(c[4]=[A(" Voucher summary ")])),_:1,__:[4]}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(b(),x("div",qk,[(b(!0),x(ye,null,dt(s.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,dt(s.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),v(n).next&&v(n).next[0]===v(ue).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=v(n).next)==null?void 0:f[2])==null?void 0:h.product_id)})||s.value.redeemsBundles.some(d=>d.value.products.some(f=>{var h,p;return f.id===((p=(h=v(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(b(),x("div",Wk,[E(Je,{label:"Return to activation",variant:"primary",icon:v(__),handler:()=>v(n).dequeue()},null,8,["icon","handler"])])):se("",!0)])):(b(),Z(lr,{key:0,handler:l},{default:k(()=>{var d;return[E(rt,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E($t,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=f=>a.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),E(ur,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!i.value||void 0},V((d=i.value)==null?void 0:d.message),9,zk)]}),_:1}))]),_:1})]))}}),Yk=["data-status"],Gk=["data-fulfilled"],ym=pe({__name:"MilestoneProgressBar",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",{class:"moonbase:milestone-progress-bar",style:Ds({gridTemplateColumns:`repeat(${t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1}, 1fr)`})},[(b(!0),x(ye,null,dt(Array(t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1),(r,o)=>(b(),x("div",{key:o},[j("div",{"data-status":o+1<t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"done":o+1===t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"in-progress":"future"},null,8,Yk),t.progress.events[o+1]?(b(),x("span",{key:0,"data-fulfilled":t.progress.events[o+1].some(s=>s.fulfilled)||void 0},null,8,Gk)):se("",!0)]))),128))],4))}}),_m=6048e5,Kk=864e5,Ja=43200,wm=1440,Em=Symbol.for("constructDateFrom");function cr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Em in e?e[Em](t):e instanceof Date?new e.constructor(t):new Date(t)}function _t(e,t){return cr(t||e,e)}let Xk={};function Ei(){return Xk}function ki(e,t){var a,l,u,c;const n=Ei(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=_t(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Qa(e,t){return ki(e,{...t,weekStartsOn:1})}function km(e,t){const n=_t(e,t==null?void 0:t.in),r=n.getFullYear(),o=cr(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Qa(o),i=cr(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Qa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function el(e){const t=_t(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tl(e,...t){const n=cr.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function xm(e,t){const n=_t(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Jk(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=xm(r),i=xm(o),a=+s-el(s),l=+i-el(i);return Math.round((a-l)/Kk)}function Qk(e,t){const n=km(e,t),r=cr(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Qa(r)}function nl(e,t){const n=+_t(e)-+_t(t);return n<0?-1:n>0?1:n}function ex(e){return cr(e,Date.now())}function tx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nx(e){return!(!tx(e)&&typeof e!="number"||isNaN(+_t(e)))}function rx(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function ox(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function sx(e,t){return+_t(e)-+_t(t)}function ix(e,t){const n=_t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function ax(e,t){const n=_t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function lx(e,t){const n=_t(e,t==null?void 0:t.in);return+ix(n,t)==+ax(n,t)}function ux(e,t,n){const[r,o,s]=tl(n==null?void 0:n.in,e,e,t),i=nl(o,s),a=Math.abs(rx(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=nl(o,s)===-i;lx(r)&&a===1&&nl(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function cx(e,t,n){const r=sx(e,t)/1e3;return ox(n==null?void 0:n.roundingMethod)(r)}function dx(e,t){const n=_t(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const fx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hx=(e,t,n)=>{let r;const o=fx[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function uc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const px={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gx={date:uc({formats:px,defaultWidth:"full"}),time:uc({formats:mx,defaultWidth:"full"}),dateTime:uc({formats:bx,defaultWidth:"full"})},vx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yx=(e,t,n,r)=>vx[e];function xi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const _x={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ex={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},kx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ox={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Sx={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:xi({values:_x,defaultWidth:"wide"}),quarter:xi({values:wx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xi({values:Ex,defaultWidth:"wide"}),day:xi({values:kx,defaultWidth:"wide"}),dayPeriod:xi({values:xx,defaultWidth:"wide",formattingValues:Ox,defaultFormattingWidth:"wide"})};function Oi(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Nx(a,d=>d.test(i)):Cx(a,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}function Cx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Nx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Px(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const Tx=/^(\d+)(th|st|nd|rd)?/i,$x=/\d+/i,Ax={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dx={any:[/^b/i,/^(a|c)/i]},Ix={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mx={any:[/1/i,/2/i,/3/i,/4/i]},Vx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Rx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Lx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},jx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ux={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Bx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Fx={ordinalNumber:Px({matchPattern:Tx,parsePattern:$x,valueCallback:e=>parseInt(e,10)}),era:Oi({matchPatterns:Ax,defaultMatchWidth:"wide",parsePatterns:Dx,defaultParseWidth:"any"}),quarter:Oi({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Mx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Oi({matchPatterns:Vx,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),day:Oi({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:jx,defaultParseWidth:"any"}),dayPeriod:Oi({matchPatterns:Ux,defaultMatchWidth:"any",parsePatterns:Bx,defaultParseWidth:"any"})},Om={code:"en-US",formatDistance:hx,formatLong:gx,formatRelative:yx,localize:Sx,match:Fx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zx(e,t){const n=_t(e,t==null?void 0:t.in);return Jk(n,dx(n))+1}function Hx(e,t){const n=_t(e,t==null?void 0:t.in),r=+Qa(n)-+Qk(n);return Math.round(r/_m)+1}function Sm(e,t){var c,d,f,h;const n=_t(e,t==null?void 0:t.in),r=n.getFullYear(),o=Ei(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=cr((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=ki(i,t),l=cr((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=ki(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function qx(e,t){var a,l,u,c;const n=Ei(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Sm(e,t),s=cr((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),ki(s,t)}function Wx(e,t){const n=_t(e,t==null?void 0:t.in),r=+ki(n,t)-+qx(n,t);return Math.round(r/_m)+1}function Ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Vr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ye(n+1,2)},d(e,t){return Ye(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ye(e.getHours()%12||12,t.length)},H(e,t){return Ye(e.getHours(),t.length)},m(e,t){return Ye(e.getMinutes(),t.length)},s(e,t){return Ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ye(o,t.length)}},as={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Vr.y(e,t)},Y:function(e,t,n,r){const o=Sm(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return Ye(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ye(s,t.length)},R:function(e,t){const n=km(e);return Ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ye(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ye(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ye(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Vr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ye(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Wx(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ye(o,t.length)},I:function(e,t,n){const r=Hx(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Vr.d(e,t)},D:function(e,t,n){const r=zx(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ye(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ye(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ye(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Ye(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=as.noon:r===0?o=as.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=as.evening:r>=12?o=as.afternoon:r>=4?o=as.morning:o=as.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Vr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Vr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Vr.s(e,t)},S:function(e,t){return Vr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Pm(r);case"XXXX":case"XX":return vo(r);case"XXXXX":case"XXX":default:return vo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Pm(r);case"xxxx":case"xx":return vo(r);case"xxxxx":case"xxx":default:return vo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nm(r,":");case"OOOO":default:return"GMT"+vo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nm(r,":");case"zzzz":default:return"GMT"+vo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ye(r,t.length)},T:function(e,t,n){return Ye(+e,t.length)}};function Nm(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Ye(s,2)}function Pm(e,t){return e%60===0?(e>0?"-":"+")+Ye(Math.abs(e)/60,2):vo(e,t)}function vo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ye(Math.trunc(r/60),2),s=Ye(r%60,2);return n+o+t+s}const Tm=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$m=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Zx={p:$m,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Tm(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Tm(r,t)).replace("{{time}}",$m(o,t))}},Yx=/^D+$/,Gx=/^Y+$/,Kx=["D","DD","YY","YYYY"];function Xx(e){return Yx.test(e)}function Jx(e){return Gx.test(e)}function Qx(e,t,n){const r=eO(e,t,n);if(console.warn(r),Kx.includes(e))throw new RangeError(r)}function eO(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const tO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rO=/^'([^]*?)'?$/,oO=/''/g,sO=/[a-zA-Z]/;function iO(e,t,n){var c,d,f,h;const r=Ei(),o=r.locale??Om,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=_t(e,n==null?void 0:n.in);if(!nx(a))throw new RangeError("Invalid time value");let l=t.match(nO).map(p=>{const g=p[0];if(g==="p"||g==="P"){const _=Zx[g];return _(p,o.formatLong)}return p}).join("").match(tO).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:aO(p)};if(Cm[g])return{isToken:!0,value:p};if(g.match(sO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(p=>{if(!p.isToken)return p.value;const g=p.value;(Jx(g)||Xx(g))&&Qx(g,t,String(e));const _=Cm[g[0]];return _(a,g,o.localize,u)}).join("")}function aO(e){const t=e.match(rO);return t?t[1].replace(oO,"'"):e}function lO(e,t,n){const r=Ei(),o=(n==null?void 0:n.locale)??r.locale??Om,s=2520,i=nl(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[l,u]=tl(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=cx(u,l),d=(el(u)-el(l))/1e3,f=Math.round((c-d)/60);let h;if(f<2)return n!=null&&n.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,a):c<10?o.formatDistance("lessThanXSeconds",10,a):c<20?o.formatDistance("lessThanXSeconds",20,a):c<40?o.formatDistance("halfAMinute",0,a):c<60?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",1,a):f===0?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",f,a);if(f<45)return o.formatDistance("xMinutes",f,a);if(f<90)return o.formatDistance("aboutXHours",1,a);if(f<wm){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<Ja){const p=Math.round(f/wm);return o.formatDistance("xDays",p,a)}else if(f<Ja*2)return h=Math.round(f/Ja),o.formatDistance("aboutXMonths",h,a)}if(h=ux(u,l),h<12){const p=Math.round(f/Ja);return o.formatDistance("xMonths",p,a)}else{const p=h%12,g=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",g,a):p<9?o.formatDistance("overXYears",g,a):o.formatDistance("almostXYears",g+1,a)}}function uO(e,t){return lO(e,ex(e),t)}function cO(e){return uO(e,{addSuffix:!0})}function ls(e,t){return iO(e,t||"PPP")}const dO={class:"moonbase:subscriptions"},fO={key:0,class:"moonbase:loader"},hO={key:1,class:"moonbase:loader"},pO=["data-subscription-status"],mO={class:"moonbase:subscriptions-item-content"},bO={class:"moonbase:subscriptions-item-content"},gO={key:0,class:"moonbase:subscriptions-item-milestone-progress"},vO={class:"moonbase:subscriptions-item-milestone-progress-title"},yO=pe({__name:"Subscriptions",setup(e){const t=De(),{getSubscriptions:n}=ao(),r=L(new Date),o=L(null);return ze(async()=>{let s=await n();for(o.value=s.items;s.hasMore&&s.next;)s=await n(s.next),o.value.push(...s.items)}),(s,i)=>(b(),x("div",dO,[o.value?o.value.length===0?(b(),x("div",hO," No subscriptions found ")):se("",!0):(b(),x("div",fO,[E(tn),i[0]||(i[0]=A(" Loading subscriptions.. "))])),(b(!0),x(ye,null,dt(o.value||[],a=>(b(),x(ye,{key:a.id},[j("div",{"data-subscription-status":a.status,class:"moonbase:subscriptions-item"},[a.content.type==="Product"?(b(),x(ye,{key:0},[E(Ft,{url:a.content.product.iconUrl,size:48},null,8,["url"]),j("div",mO,[E(st,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.product.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(_r).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)):(b(),x(ye,{key:1},[E(Ft,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),j("div",bO,[E(st,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.bundle.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(_r).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)),j("div",null,[E(Yo,{variant:"subtle",onClick:l=>v(t).show(v(ue).Subscription,v(J).ManageSubscription,{subscription_id:a.id})},{default:k(()=>[E(v(wp)),i[1]||(i[1]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[1]},1032,["onClick"])])],8,pO),a.milestoneProgress?(b(),x("div",gO,[j("div",vO,[E(st,null,{default:k(()=>[A(V(a.milestoneProgress.title),1)]),_:2},1024),E(zt,null,{default:k(()=>[A(V(a.milestoneProgress.currentNormalizedCycleNumber-(a.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(a.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(a.cycleLength))+"s ",1)]),_:2},1024)]),E(ym,{progress:a.milestoneProgress},null,8,["progress"])])):se("",!0)],64))),128))]))}}),_O={class:"moonbase:customer"},wO=pe({__name:"Customer",setup(e){const t=De(),{user:n}=tt(),r=me(lt),o=te(()=>[{intent:J.ViewProducts,title:"Products",content:Vk},{intent:J.ViewSubscriptions,title:"Subscriptions",content:yO,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:J.ViewAccount,title:"Account",content:Pk},{intent:J.RedeemVoucher,title:"Redeem",content:Zk}].filter(a=>a.predicate===void 0||a.predicate())),s=te(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(b(),x("div",_O,[E(v(i_),{"selected-index":s.value,onChange:i},{default:k(()=>{var u,c;return[E(v(a_),{"data-corners":(u=v(r))==null?void 0:u.theme.corners,"data-background":(c=v(r))==null?void 0:c.theme.colors.background},{default:k(()=>[(b(!0),x(ye,null,dt(o.value,d=>(b(),Z(v(l_),{key:d.intent},{default:k(()=>[A(V(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),E(v(u_),null,{default:k(()=>[(b(!0),x(ye,null,dt(o.value,d=>(b(),Z(v(c_),{key:d.intent},{default:k(()=>[(b(),Z(Yl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),EO={class:"moonbase:product-card-content"},kO=["data-open"],xO=pe({__name:"ProductCard",props:{product:{}},setup(e){const t=L(!1),n=L(null),r=te(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(b(),Z(un,{class:"moonbase:product-card"},{addon:k(()=>[j("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:n},{default:k(()=>[A(V(o.product.description),1)]),_:1},512),!t.value&&r.value?(b(),x("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[E(st,null,{default:k(()=>s[1]||(s[1]=[A(" read more ")])),_:1,__:[1]})])):se("",!0)],8,kO)]),default:k(()=>[E(Ft,{url:o.product.iconUrl,size:72},null,8,["url"]),j("div",EO,[E(is,null,{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.name),1)]}),_:1}),E(Me,{class:"moonbase:product-card-tagline"},{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function OO(e){const t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e<1)return`${e} B`;const n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);e=Number(e/1024**n);const r=t[n];return e>=10||e%1===0?`${e.toFixed(0)} ${r}`:`${e.toFixed(1)} ${r}`}const SO={class:"moonbase:product-downloads"},CO=["data-open"],NO={key:1,class:"moonbase:product-downloads-content"},PO={key:2,class:"moonbase:product-downloads-content"},TO={key:3,class:"moonbase:product-downloads-content"},$O={key:4,class:"moonbase:product-downloads-content"},AO={class:"moonbase:product-downloads-list"},DO={class:"moonbase:product-downloads-download-actions"},IO=pe({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=De(),r=tt(),o=Xa(),s=me(Lr),{downloadProduct:i}=ao(),a=L(!1),l=L(null),u=te(()=>l.value&&l.value.$el&&l.value.$el.scrollHeight>l.value.$el.clientHeight);function c(){n.enqueue(ue.Product,J.DownloadProduct,n.parameters??void 0),n.show(ue.Authentication,J.SignIn)}const d=[Tn.Windows,Tn.Mac,Tn.Linux,Tn.Universal];function f(){var R;const S=(((R=navigator.userAgentData)==null?void 0:R.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(S)?Tn.Mac:/win/.test(S)?Tn.Windows:/linux/.test(S)?Tn.Linux:Tn.Universal}const h=f(),p=[h,...d.filter(S=>S!==h)],g=te(()=>p.flatMap(S=>[...(t.product.downloads??[]).filter(R=>R.platform===S)]));async function _(S){try{await i(S),s==null||s(Zt.DownloadedProduct,{product:t.product,download:S,user:r.user.value})}catch(R){if(R instanceof mn)o.reportProblem("error",{type:R.name,title:R.title,detail:R.detail,status:R.status,errors:R.errors?Object.fromEntries(Object.entries(R.errors).map(([z,q])=>[z,[q]])):void 0,instance:"ProductDownloads.vue:startDownload"});else{const z=R;o.reportProblem("error",{type:z.name,title:z.message,instance:"ProductDownloads.vue:startDownload"})}throw R}}return(S,R)=>(b(),x("div",SO,[E(nt,null,{default:k(()=>[R[1]||(R[1]=A(" Downloads ")),E(Me,null,{default:k(()=>[A(" Version "+V(S.product.version),1)]),_:1})]),_:1,__:[1]}),S.product.releaseDescription?(b(),x("div",{key:0,class:"moonbase:product-downloads-description","data-open":a.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:l},{default:k(()=>[A(V(S.product.releaseDescription),1)]),_:1},512),!a.value&&u.value?(b(),x("button",{key:0,onClick:R[0]||(R[0]=z=>a.value=!0)},[E(st,null,{default:k(()=>R[2]||(R[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,CO)):se("",!0),S.product.downloadsNeedsUser&&S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",NO,[E(rt,{"data-center":""},{default:k(()=>R[3]||(R[3]=[A(" This product requires ownership to download ")])),_:1,__:[3]}),E(Je,{label:"Sign in",handler:c})])):S.product.downloadsNeedsUser&&!v(r).user?(b(),x("div",PO,[E(rt,{"data-center":""},{default:k(()=>R[4]||(R[4]=[A(" This product requires an account to download ")])),_:1,__:[4]}),E(Je,{label:"Sign in",handler:c})])):S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",TO,[E(rt,{"data-center":""},{default:k(()=>R[5]||(R[5]=[A(" This product requires ownership to download ")])),_:1,__:[5]})])):(b(),x("div",$O,[j("div",AO,[(b(!0),x(ye,null,dt(g.value,z=>(b(),Z(un,{key:z.key,class:"moonbase:product-downloads-download"},{addon:k(()=>[j("div",DO,[E(Je,{label:`Download for ${z.platform}`,variant:z.platform===v(h)?"primary":"secondary","no-reset":!0,handler:()=>_(z),icon:v(g_)},null,8,["label","variant","handler","icon"])])]),default:k(()=>[j("div",null,[E(nt,null,{default:k(()=>[A(V(z.name),1)]),_:2},1024),E(zt,null,{default:k(()=>[A(V(z.platform)+" - "+V(v(OO)(z.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),g.value.length===0?(b(),Z(rt,{key:0,"data-center":""},{default:k(()=>R[6]||(R[6]=[A(" No downloadable files found ")])),_:1,__:[6]})):se("",!0)]))]))}}),MO={class:"moonbase:product-licenses"},VO={key:0,class:"moonbase:loader"},RO={key:1,class:"moonbase:empty"},LO={key:0,class:"moonbase:loader"},jO={key:1,class:"moonbase:product-licenses-activations"},UO={key:0},BO={class:"moonbase:product-licenses-activation-actions"},FO={key:2,class:"moonbase:loader"},zO={key:3,class:"moonbase:product-licenses-licenses"},HO=pe({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=ao(),a=Xa(),l=L(null),u=L(null),c=L(!0);ze(async()=>{if(n.product.maxActivations){let f=await o(n.product.id);for(l.value=f.items.map(h=>({...h,revoking:!1}));f.hasMore&&f.next;)f=await o(n.product.id,f.next),l.value.push(...f.items.map(h=>({...h,revoking:!1})))}if(n.product.externalLicenses){let f=await s(n.product.id);for(u.value=f.items;f.hasMore&&f.next;)f=await s(n.product.id,f.next),u.value.push(...f.items)}c.value=!1});async function d(f){try{await i(f),r("revoked",f),l.value&&Wt(1e3).then(()=>{var h,p;return(p=l.value)==null?void 0:p.splice((h=l.value)==null?void 0:h.indexOf(f),1)})}catch(h){if(h instanceof mn)a.reportProblem("error",{type:h.name,title:h.title,detail:h.detail,status:h.status,errors:h.errors?Object.fromEntries(Object.entries(h.errors).map(([p,g])=>[p,[g]])):void 0,instance:"ProductLicenses.vue:revoke"});else{const p=h;a.reportProblem("error",{type:p.name,title:p.message,instance:"ProductLicenses.vue:revoke"})}throw h}}return(f,h)=>(b(),x("div",MO,[E(nt,null,{default:k(()=>[h[0]||(h[0]=A(" Licenses ")),f.product.maxActivations&&f.product.maxActivations>0?(b(),Z(Me,{key:0},{default:k(()=>[A(V(f.product.currentActivations??0)+" of "+V(f.product.maxActivations)+" seats used ",1)]),_:1})):se("",!0)]),_:1,__:[0]}),c.value?(b(),x("div",VO,[E(tn)])):!f.product.numberOfLicenses&&!f.product.subscriptionLicenses?(b(),x("div",RO,[E(rt,null,{default:k(()=>h[1]||(h[1]=[A(" You don't own any licenses for this product yet ")])),_:1,__:[1]}),f.product&&f.product.website?(b(),Z(ac,{key:0,type:"anchor",href:f.product.website,label:"Purchase",icon:v(y_)},null,8,["href","icon"])):se("",!0)])):se("",!0),c.value?se("",!0):(b(),x(ye,{key:2},[f.product.maxActivations&&f.product.maxActivations>0&&!f.product.currentActivations?(b(),x("div",LO,[E(v(Ep)),E(nt,null,{default:k(()=>h[2]||(h[2]=[A(" No activations yet ")])),_:1,__:[2]})])):se("",!0),f.product.maxActivations&&l.value?(b(),x("div",jO,[(b(!0),x(ye,null,dt(l.value??[],p=>(b(),Z(un,{key:p.id,class:"moonbase:product-licenses-activation"},ba({default:k(()=>[j("div",null,[E(zt,null,{default:k(()=>h[3]||(h[3]=[A(" Device ")])),_:1,__:[3]}),E(nt,null,{default:k(()=>[A(V(p.name),1)]),_:2},1024)]),j("div",null,[E(zt,null,{default:k(()=>h[4]||(h[4]=[A(" Activation ")])),_:1,__:[4]}),E(nt,null,{default:k(()=>[A(V(p.activationMethod),1)]),_:2},1024)]),p.lastValidatedAt?(b(),x("div",UO,[E(zt,null,{default:k(()=>h[5]||(h[5]=[A(" First activated ")])),_:1,__:[5]}),E(nt,null,{default:k(()=>[A(V(v(cO)(p.firstValidatedAt)),1)]),_:2},1024)])):se("",!0)]),_:2},[p.activationMethod===v(Fi).Online?{name:"addon",fn:k(()=>[j("div",BO,[E(Je,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>d(p)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):se("",!0),(!u.value||u.value.length===0)&&!f.product.maxActivations&&(f.product.numberOfLicenses||f.product.subscriptionLicenses)?(b(),x("div",FO,[E(v(Ep)),f.product.numberOfLicenses?(b(),Z(nt,{key:0},{default:k(()=>[A(" You own "+V(f.product.numberOfLicenses)+" license"+V(f.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0),f.product.subscriptionLicenses?(b(),Z(nt,{key:1},{default:k(()=>[A(" You have "+V(f.product.subscriptionLicenses)+" subscription license"+V(f.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0)])):f.product.externalLicenses&&u.value?(b(),x("div",zO,[(b(!0),x(ye,null,dt((u.value??[]).filter(p=>p.externalFulfillment),p=>(b(),Z(un,{key:p.id,class:"moonbase:product-licenses-license"},ba({default:k(()=>[j("div",null,[E(zt,null,{default:k(()=>[A(V(f.product.name)+" license ",1)]),_:1}),E(nt,null,{default:k(()=>[A(V(p.id),1)]),_:2},1024)])]),_:2},[p.externalFulfillment?{name:"addon",fn:k(()=>[j("code",null,V(p.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):se("",!0)],64))]))}}),qO={class:"moonbase:download-product"},WO={key:0,class:"moonbase:loader"},ZO={key:1,class:"moonbase:loader"},YO={key:2,class:"moonbase:loader"},GO={key:3},KO=pe({__name:"Product",setup(e){const t=De(),n=tt(),{loaded:r}=tt(),{getProduct:o}=ao(),s=L(null),i=L(null),a=L(!0);return ze(async()=>{const l=t.getParameter("product_id"),u=t.getParameter("version");if(!l){i.value="Link is broken";return}try{s.value=await o(l,u||void 0)}catch(c){i.value=c.message}a.value=!1}),(l,u)=>(b(),x("div",qO,[a.value||!v(r)?(b(),x("div",WO,[E(tn)])):i.value?(b(),x("div",ZO,V(i.value),1)):s.value?(b(),x("div",GO,[E(xO,{product:s.value},null,8,["product"]),s.value.downloads?(b(),Z(IO,{key:0,product:s.value},null,8,["product"])):se("",!0),v(n).user.value?(b(),Z(HO,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):se("",!0)])):(b(),x("div",YO," Could not find product "))]))}}),XO={class:"moonbase:peek"},JO=["data-visible"],QO={key:1,class:"moonbase:peek-voucher"},e3={key:0,class:"moonbase:peek-voucher-content"},t3={class:"moonbase:peek-voucher-auth"},n3=pe({__name:"Redeem",setup(e){const{peek:t}=Ph(),n=De(),r=L(null),o=L(null),s=L(n.getParameter("code")||"");async function i(){o.value=null;try{r.value=await t(s.value),n.parameters={code:r.value.code}}catch(u){throw o.value=u,u}}function a(){n.enqueue(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignIn)}function l(){n.enqueue(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignUp)}return(u,c)=>(b(),x("div",XO,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[r.value?(b(),x("div",QO,[j("div",null,[E(is,null,{default:k(()=>[A(V(r.value.name),1)]),_:1}),r.value.description?(b(),Z(nt,{key:0},{default:k(()=>[A(' "'+V(r.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[c[2]||(c[2]=A(" Code: ")),j("strong",null,V(r.value.code),1)]),_:1,__:[2]})]),E(nt,null,{default:k(()=>c[3]||(c[3]=[A(" Voucher summary ")])),_:1,__:[3]}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(b(),x("div",e3,[(b(!0),x(ye,null,dt(r.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,dt(r.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),j("div",t3,[E(rt,null,{default:k(()=>c[4]||(c[4]=[A(" Sign in or create an account to redeem products ")])),_:1,__:[4]}),E(Je,{label:"Sign in",variant:"primary",handler:a}),E(Je,{label:"Create account",variant:"subtle",handler:l})])])):(b(),Z(lr,{key:0,handler:i},{default:k(()=>{var d;return[E(rt,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E($t,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=f=>s.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),E(ur,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V((d=o.value)==null?void 0:d.message),9,JO)]}),_:1}))]),_:1})]))}});function Am(e,t){return b(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[j("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z","clip-rule":"evenodd"})])}const r3={class:"moonbase:subscription-content-card-content"},o3=["data-open"],s3={class:"moonbase:subscription-content-card-content"},i3=["data-open"],a3=pe({__name:"ContentCard",props:{subscription:{}},setup(e){const t=L(new Date),n=L(!1),r=L(null),o=te(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(b(),Z(un,{key:0,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[E(st,null,{default:k(()=>i[2]||(i[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,o3)]),default:k(()=>[E(Ft,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),j("div",r3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(_r).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(b(),Z(un,{key:1,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[E(st,null,{default:k(()=>i[3]||(i[3]=[A(" read more ")])),_:1,__:[3]})])):se("",!0)],8,i3)]),default:k(()=>[E(Ft,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),j("div",s3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(_r).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),l3={class:"moonbase:milestone-rewards"},u3={class:"moonbase:milestone-rewards-list"},c3={key:0},d3={key:1},f3=pe({__name:"MilestoneRewards",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",l3,[E(st,null,{default:k(()=>n[0]||(n[0]=[A(" Rewards: ")])),_:1,__:[0]}),j("div",u3,[(b(!0),x(ye,null,dt(Object.values(t.progress.events).flatMap(r=>r).filter(r=>r.fulfilled),r=>(b(),x("div",{key:r.milestoneId,class:"moonbase:milestone-rewards-item"},[E(Me,null,{default:k(()=>[A(V(r.message),1)]),_:2},1024),r.type==="CouponCodeMilestone"&&r.fulfilled&&r.code?(b(),x("div",c3,[E(zt,null,{default:k(()=>n[1]||(n[1]=[A(" Your coupon code: ")])),_:1,__:[1]}),n[2]||(n[2]=j("br",null,null,-1)),j("code",null,V(r.code),1)])):r.type==="PerpetualLicenseConversionMilestone"&&r.fulfilled?(b(),x("div",d3,[E(zt,null,{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),n[3]||(n[3]=A(" Your licenses have been converted to perpetual licenses. "))]),_:1,__:[3]})])):se("",!0)]))),128))])]))}}),h3={class:"moonbase:subscription"},p3={key:0,class:"moonbase:loader"},m3={key:1,class:"moonbase:loader"},b3={key:2,class:"moonbase:loader"},g3={key:3},v3={key:0,class:"moonbase:subscription-milestones"},y3={class:"moonbase:subscription-milestone-progress-title"},_3={class:"moonbase:subscription-actions"},w3=pe({__name:"Subscription",setup(e){const t=De(),{loaded:n}=tt(),r=Xa(),{getSubscription:o,renewSubscription:s,cancelSubscription:i,updateSubscriptionPaymentMethod:a}=ao(),l=L(null),u=L(new Date),c=L(null),d=L(!0);ze(async()=>{const g=t.getParameter("subscription_id");if(!g){c.value="Link is broken";return}try{l.value=await o(g)}catch(_){c.value=_.message}d.value=!1});async function f(){if(!l.value)return;if((await s(l.value.id,{redirect:!1})).completed){const _=await o(l.value.id);Wt(1500).then(()=>l.value=_)}else throw new ss}async function h(){l.value&&(l.value=await i(l.value.id))}async function p(){if(l.value){c.value=null;try{const g=await a(l.value,{returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(g!=null&&g.completed)l.value=await o(l.value.id);else throw new ss}catch(g){if(c.value=g.message,!(g instanceof ss))if(g instanceof mn)r.reportProblem("error",{type:g.name,title:g.title,detail:g.detail,status:g.status,errors:g.errors?Object.fromEntries(Object.entries(g.errors).map(([_,S])=>[_,[S]])):void 0,instance:"Subscription.vue:startUpdate"});else{const _=g;r.reportProblem("error",{type:_.name,title:_.message,instance:"Subscription.vue:startUpdate"})}throw g}}}return(g,_)=>(b(),x("div",h3,[d.value||!v(n)?(b(),x("div",p3,[E(tn)])):c.value?(b(),x("div",m3,V(c.value),1)):l.value?(b(),x("div",g3,[E(a3,{subscription:l.value},null,8,["subscription"]),l.value.milestoneProgress?(b(),x("div",v3,[j("div",y3,[E(st,null,{default:k(()=>[A(V(l.value.milestoneProgress.title),1)]),_:1}),E(zt,null,{default:k(()=>[A(V(l.value.milestoneProgress.currentNormalizedCycleNumber-(l.value.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(l.value.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(l.value.cycleLength))+"s ",1)]),_:1})]),E(ym,{progress:l.value.milestoneProgress},null,8,["progress"]),l.value.milestoneProgress.description?(b(),Z(zt,{key:0},{default:k(()=>[A(V(l.value.milestoneProgress.description),1)]),_:1})):se("",!0),Object.values(l.value.milestoneProgress.events).flatMap(S=>S).some(S=>S.fulfilled)?(b(),Z(f3,{key:1,progress:l.value.milestoneProgress},null,8,["progress"])):se("",!0)])):se("",!0),j("div",_3,[l.value.status===v(_r).Active?(b(),x(ye,{key:0},[E(Je,{label:"Update payment method",variant:"secondary",handler:p}),E(Je,{label:"Cancel subscription",variant:"danger",handler:h}),E(zt,null,{default:k(()=>[_[1]||(_[1]=A(" Cancelling a subscription will let you use the products to the end of the current period, after which you will lose access. If you want to continue using the products later, you may simply renew this subscription whenever you wish. You are currently paying ")),j("strong",null,V(v(Ut)(l.value.total.due)),1),A(" per "+V(v(wi)(l.value.cycleLength))+" for this subscription",1),l.value.paymentMethod?(b(),x(ye,{key:0},[_[0]||(_[0]=A(" using payment method ")),j("strong",null,V(l.value.paymentMethod),1)],64)):se("",!0),_[2]||(_[2]=A(". "))]),_:1,__:[1,2]})],64)):l.value.status===v(_r).Completed?(b(),Z(zt,{key:1},{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),_[3]||(_[3]=A(" This subscription has been completed, and cannot be renewed. "))]),_:1,__:[3]})):(b(),x(ye,{key:2},[l.value.nextPaymentScheduledAt&&l.value.cancellable?(b(),x(ye,{key:0},[E(Je,{label:"Continue subscription",variant:"primary",handler:f}),E(Je,{label:"Cancel subscription",variant:"danger",handler:h}),E(zt,null,{default:k(()=>[A(" We could not renew this subscription on the expiry date, the next attempt will be "+V(v(ls)(l.value.nextPaymentScheduledAt))+". To make sure you can use your products un-interrupted, continue the subscription, or cancel it if you do not wish to keep using these products. ",1)]),_:1})],64)):(b(),x(ye,{key:1},[E(Je,{label:"Continue subscription",variant:"primary",handler:f}),E(zt,null,{default:k(()=>[A(" This subscription has been stopped, and "+V(l.value.expiresAt>u.value?"expires":"expired")+" "+V(v(ls)(l.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1})],64))],64))])])):(b(),x("div",b3," Could not find subscription "))]))}}),E3=pe({__name:"App",setup(e){const t=me(lt),n=De();Xe(()=>[n.active,n.intent],([o,s])=>{});const r={Inter:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",Roboto:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap","EB Garamond":"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap",Merriweather:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",Poppins:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap","PT Serif":"https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap",Montserrat:"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",Aleo:"https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&display=swap"};if(t){const o=document.createElement("link");o.rel="stylesheet",o.href=r[t.value.theme.fonts.body],document.head.appendChild(o),document.documentElement.style.setProperty("--moonbase-font-body",t.value.theme.fonts.body??"");const s=document.createElement("link");s.rel="stylesheet",s.href=r[t.value.theme.fonts.heading],document.head.appendChild(s),document.documentElement.style.setProperty("--moonbase-font-heading",t.value.theme.fonts.heading??"")}return Xe(()=>t==null?void 0:t.value.theme.colors.primary,o=>{if(!o)return;let s=o;typeof s=="string"&&(s=Object.fromEntries(Q2(s).map(i=>[i.number<=100||i.number===950?i.number-50:i.number-100,i.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",s[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",s[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",s[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",s[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",s[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",s[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",s[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",s[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",s[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",s[900]??"")},{immediate:!0}),Xe(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),ew(),tw(),(o,s)=>{var i;return b(),x(ye,null,[(i=v(t))!=null&&i.toolbar.enabled?(b(),Z(Q_,{key:0})):se("",!0),E(q_,null,{default:k(()=>[v(n).active===v(ue).Cart?(b(),Z(xk,{key:0})):v(n).active===v(ue).Authentication?(b(),Z(H5,{key:1})):v(n).active===v(ue).Activation?(b(),Z(t5,{key:2})):v(n).active===v(ue).Product?(b(),Z(KO,{key:3})):v(n).active===v(ue).Subscription?(b(),Z(w3,{key:4})):v(n).active===v(ue).Customer?(b(),Z(wO,{key:5})):v(n).active===v(ue).Redeem?(b(),Z(n3,{key:6})):v(n).active===v(ue).About?(b(),Z(dE,{key:7})):se("",!0)]),_:1})],64)}}});function rl(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function ol(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(rl(e)&&rl(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];rl(o)&&rl(e[r])?e[r]=ol(e[r],o):o!==void 0&&(e[r]=o)}}return ol(e,...t)}function k3(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Ke(n)||yn(n)||Do(n)?t(Oe(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const cc=Symbol("url"),Dm=Symbol("moonbase_instance"),Rr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:k3(t)})),Lr=Symbol("event-emitter");class x3{constructor(){yo(this,"initialized",!1);yo(this,"pinia");yo(this,"storefront");yo(this,"options")}async setup(t,n){var u,c;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(globalThis.MoonbaseCSS&&globalThis.MoonbaseCSS.inject(),document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}this.options=L(ol(((u=this.options)==null?void 0:u.value)??Gh,n??{})),zo("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase"),(this.options.value.target??document.body).append(r);let s=t;if(t.includes(".moonbase.sh")){const d=/^(https:\/\/[a-z\-]+\.(?:beta\.)?moonbase\.sh)(.+)/.exec(t);d&&d.length>1&&d[1]&&(s=d[1],console.warn(`Moonbase url set up incorrectly, should be ${s}, was ${t}`))}this.storefront=Hy(s),this.pinia=m1(),vy(E3).use(this.storefront).use(this.pinia).provide(lt,this.options).provide(cc,s.replace(/\/$/,"")).provide(Lr,Rr).provide(Dm,this).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const a=De(this.pinia),l=tt(this.storefront);(c=this.storefront)==null||c.onCheckoutInitiated((d,f)=>{Rr(Zt.CheckoutInitiated,{order:d,total:f,user:l.user.value})}),this.storefront.onCheckoutClosed(d=>{Rr(Zt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:l.user.value}),d===J.ViewProducts&&(l.user?a.show(ue.Customer,J.ViewProducts):a.show(ue.Cart,J.ViewCart))}),this.storefront.onCheckoutCompleted(d=>{Rr(Zt.CheckoutCompleted,{order:d,user:l.user.value})})}configure(t){var r;const n=ol(((r=this.options)==null?void 0:r.value)??Gh,t??{});this.options?this.options.value=n:this.options=L(n)}on(t,n){window.addEventListener(`moonbase-storefront-${t}`,r=>n(r.detail))}handleLocationIntent(t){const n=new URLSearchParams(t.search),r=n.get("mb_intent");if(r&&Object.values(J).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===J.Checkout&&o.complete)return;this[r](o);for(const i of Object.keys(o))n.delete(`mb_${i}`);const s=n.toString();window.history.replaceState(null,"",t.href.split("?")[0]+(s?`?${s}`:""))}}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.SignIn,t)}sign_up(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!((r=this.options)!=null&&r.value.auth.signUp.enabled))throw new Error("Sign ups are not enabled");De(this.pinia).show(ue.Authentication,J.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);tt(this.storefront).user.value?n.show(ue.Authentication,J.ConfirmEmailChange,t):(n.enqueue(ue.Authentication,J.ConfirmEmailChange,t),n.show(ue.Authentication,J.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=De(this.pinia);tt(this.storefront).user.value?t.show(ue.Customer,J.ViewAccount):(t.enqueue(ue.Customer,J.ViewAccount),t.show(ue.Authentication,J.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);tt(this.storefront).user.value?n.show(ue.Customer,J.RedeemVoucher,t):n.show(ue.Redeem,J.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia),r=tt(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(ue.Activation,J.ActivateProduct,t),n.show(ue.Authentication,J.SignIn)):n.show(ue.Activation,J.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);tt(this.storefront).user.value?n.show(ue.Subscription,J.ManageSubscription,t):(n.enqueue(ue.Subscription,J.ManageSubscription,t),n.show(ue.Authentication,J.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Cart,J.ViewCart)}async add_to_cart(t){var s,i,a,l,u,c,d,f,h,p;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.product_id)&&!(t!=null&&t.bundle_id))throw new Error("You need to provide a product or bundle ID when adding to cart");const n=tr(this.storefront),r=tt(this.storefront),o=t.offer_id?Uy(t.offer_id):null;if(t!=null&&t.product_id){const g=li(t.product_id,this.storefront);if(g.value){let _=n.addToCart(g.value,(s=g.value.variations)==null?void 0:s.find(S=>S.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(_=n.setQuantity(_,_.quantity+t.quantity-1)),((i=this.options)==null?void 0:i.value.cart.quantity)==="single"&&(_=n.setQuantity(_,1)),Rr(Zt.AddedToCart,{item:_,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=li(t.product_id,this.storefront);if(_.value){let S=n.addToCart(_.value,(a=_.value.variations)==null?void 0:a.find(R=>R.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((l=this.options)==null?void 0:l.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Rr(Zt.AddedToCart,{item:S,currency:n.currency.value,user:r.user.value})}else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const g=Na(t.bundle_id,this.storefront);if(g.value){const _=(u=g.value.variations)==null?void 0:u.find(R=>R.id===t.variation_id);let S=n.addToCart(g.value,_,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(c=this.options)==null?void 0:c.value.cart.bundles.onAdd});t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((d=this.options)==null?void 0:d.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Rr(Zt.AddedToCart,{item:S,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=Na(t.bundle_id,this.storefront);if(_.value){const S=(f=_.value.variations)==null?void 0:f.find(z=>z.id===t.variation_id);let R=n.addToCart(_.value,S,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(h=this.options)==null?void 0:h.value.cart.bundles.onAdd});t!=null&&t.quantity&&(R=n.setQuantity(R,R.quantity+t.quantity-1)),((p=this.options)==null?void 0:p.value.cart.quantity)==="single"&&(R=n.setQuantity(R,1)),Rr(Zt.AddedToCart,{item:R,currency:n.currency.value,user:r.user.value})}else throw new Error(`Bundle '${t.bundle_id}' not found`)}}(t==null?void 0:t.show_cart)!==!1&&De(this.pinia).show(ue.Cart,J.AddToCart)}async purchase(t){var o,s,i,a,l;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(o=this.storefront)!=null&&o.loadedStorefront||await((s=this.storefront)==null?void 0:s.loadedStorefrontPromise);const n=t?Array.isArray(t)?t:[t]:[];if(n.length===0)throw new Error("No items given to purchase");const r=[];for(const u of n){if(!u.product_id&&!u.bundle_id)throw new Error("You need to provide a product or bundle ID when purchasing");if(u.product_id){const c=li(u.product_id,this.storefront);if(c.value)r.push({item:c.value,variation:(i=c.value.variations)==null?void 0:i.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Product '${u.product_id}' not found`)}if(u.bundle_id){const c=Na(u.bundle_id,this.storefront);if(c.value)r.push({item:c.value,variation:(a=c.value.variations)==null?void 0:a.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Bundle '${u.bundle_id}' not found`)}}await jy(r,{redirect:((l=this.options)==null?void 0:l.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`},this.storefront)}checkout(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;tr(this.storefront).checkout({redirect:((r=this.options)==null?void 0:r.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`})}close_checkout(){var t;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(t=this.storefront)==null||t.closeCheckout()}view_about(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.About,J.ViewAbout)}}const dc=new x3;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=dc),xt.MoonbaseIntent=J,xt.default=dc,xt.eventEmitterKey=Lr,xt.instanceKey=Dm,xt.urlKey=cc,Object.defineProperties(xt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.47",
|
|
5
5
|
"description": "Package to let you embed Moonbase.sh into your storefront as a payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"date-fns": "^4.1.0",
|
|
25
25
|
"pinia": "^2.1.7",
|
|
26
26
|
"vue": "^3.5.17",
|
|
27
|
-
"@moonbase.sh/vue": "0.4.
|
|
27
|
+
"@moonbase.sh/vue": "0.4.47"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/chroma-js": "^2.4.4",
|