@tanstack/cta-ui 0.15.1 → 0.15.3

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.
@@ -208,6 +208,6 @@ Error generating stack: `+u.message+`
208
208
 
209
209
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
210
210
 
211
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return $.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},b9="DialogDescriptionWarning",v9=({contentRef:n,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cR(b9).contentName}}.`;return $.useEffect(()=>{var l;const r=(l=n.current)==null?void 0:l.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(i))},[i,n,e]),null},S9=F$,x9=eR,w9=tR,Q9=nR,k9=rR,C9=aR;function jo({...n}){return C.jsx(S9,{"data-slot":"dialog",...n})}function T9({...n}){return C.jsx(x9,{"data-slot":"dialog-portal",...n})}function P9({className:n,...e}){return C.jsx(w9,{"data-slot":"dialog-overlay",className:_t("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function Lo({className:n,children:e,hideCloseButton:t,...i}){return C.jsxs(T9,{"data-slot":"dialog-portal",children:[C.jsx(P9,{}),C.jsxs(Q9,{"data-slot":"dialog-content",className:_t("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg p-6 shadow-lg duration-200 sm:max-w-lg bg-opacity-70 backdrop-blur-md border-3 border-white/20",n),...i,children:[e,!t&&C.jsxs(C9,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[C.jsx(aD,{}),C.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function of({className:n,...e}){return C.jsx("div",{"data-slot":"dialog-header",className:_t("flex flex-col gap-2 text-center sm:text-left",n),...e})}function cf({className:n,...e}){return C.jsx("div",{"data-slot":"dialog-footer",className:_t("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...e})}function uf({className:n,...e}){return C.jsx(k9,{"data-slot":"dialog-title",className:_t("text-lg leading-none font-semibold",n),...e})}function A9(n){return Object.prototype.toString.call(n)==="[object Object]"}function Hk(n){return A9(n)||Array.isArray(n)}function $9(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function xb(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;const r=JSON.stringify(Object.keys(n.breakpoints||{})),l=JSON.stringify(Object.keys(e.breakpoints||{}));return r!==l?!1:t.every(o=>{const c=n[o],f=e[o];return typeof c=="function"?`${c}`==`${f}`:!Hk(c)||!Hk(f)?c===f:xb(c,f)})}function Ik(n){return n.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function R9(n,e){if(n.length!==e.length)return!1;const t=Ik(n),i=Ik(e);return t.every((r,l)=>{const o=i[l];return xb(r,o)})}function wb(n){return typeof n=="number"}function sy(n){return typeof n=="string"}function wp(n){return typeof n=="boolean"}function Fk(n){return Object.prototype.toString.call(n)==="[object Object]"}function St(n){return Math.abs(n)}function Qb(n){return Math.sign(n)}function du(n,e){return St(n-e)}function M9(n,e){if(n===0||e===0||St(n)<=St(e))return 0;const t=du(St(n),St(e));return St(t/n)}function E9(n){return Math.round(n*100)/100}function Zu(n){return _u(n).map(Number)}function ji(n){return n[ff(n)]}function ff(n){return Math.max(0,n.length-1)}function kb(n,e){return e===ff(n)}function Kk(n,e=0){return Array.from(Array(n),(t,i)=>e+i)}function _u(n){return Object.keys(n)}function uR(n,e){return[n,e].reduce((t,i)=>(_u(i).forEach(r=>{const l=t[r],o=i[r],c=Fk(l)&&Fk(o);t[r]=c?uR(l,o):o}),t),{})}function ly(n,e){return typeof e.MouseEvent<"u"&&n instanceof e.MouseEvent}function D9(n,e){const t={start:i,center:r,end:l};function i(){return 0}function r(f){return l(f)/2}function l(f){return e-f}function o(f,d){return sy(n)?t[n](f):n(e,f,d)}return{measure:o}}function Xu(){let n=[];function e(r,l,o,c={passive:!0}){let f;if("addEventListener"in r)r.addEventListener(l,o,c),f=()=>r.removeEventListener(l,o,c);else{const d=r;d.addListener(o),f=()=>d.removeListener(o)}return n.push(f),i}function t(){n=n.filter(r=>r())}const i={add:e,clear:t};return i}function Z9(n,e,t,i){const r=Xu(),l=1e3/60;let o=null,c=0,f=0;function d(){r.add(n,"visibilitychange",()=>{n.hidden&&v()})}function p(){b(),r.clear()}function m(x){if(!f)return;o||(o=x,t(),t());const w=x-o;for(o=x,c+=w;c>=l;)t(),c-=l;const P=c/l;i(P),f&&(f=e.requestAnimationFrame(m))}function g(){f||(f=e.requestAnimationFrame(m))}function b(){e.cancelAnimationFrame(f),o=null,c=0,f=0}function v(){o=null,c=0}return{init:d,destroy:p,start:g,stop:b,update:t,render:i}}function _9(n,e){const t=e==="rtl",i=n==="y",r=i?"y":"x",l=i?"x":"y",o=!i&&t?-1:1,c=p(),f=m();function d(v){const{height:S,width:x}=v;return i?S:x}function p(){return i?"top":t?"right":"left"}function m(){return i?"bottom":t?"left":"right"}function g(v){return v*o}return{scroll:r,cross:l,startEdge:c,endEdge:f,measureSize:d,direction:g}}function Ul(n=0,e=0){const t=St(n-e);function i(d){return d<n}function r(d){return d>e}function l(d){return i(d)||r(d)}function o(d){return l(d)?i(d)?n:e:d}function c(d){return t?d-t*Math.ceil((d-e)/t):d}return{length:t,max:e,min:n,constrain:o,reachedAny:l,reachedMax:r,reachedMin:i,removeOffset:c}}function fR(n,e,t){const{constrain:i}=Ul(0,n),r=n+1;let l=o(e);function o(g){return t?St((r+g)%r):i(g)}function c(){return l}function f(g){return l=o(g),m}function d(g){return p().set(c()+g)}function p(){return fR(n,c(),t)}const m={get:c,set:f,add:d,clone:p};return m}function X9(n,e,t,i,r,l,o,c,f,d,p,m,g,b,v,S,x,w,P){const{cross:A,direction:M}=n,R=["INPUT","SELECT","TEXTAREA"],Z={passive:!1},_=Xu(),z=Xu(),V=Ul(50,225).constrain(b.measure(20)),se={mouse:300,touch:400},K={mouse:500,touch:600},te=v?43:25;let fe=!1,ge=0,oe=0,X=!1,H=!1,W=!1,he=!1;function D(pe){if(!P)return;function Ge(Vt){(wp(P)||P(pe,Vt))&&ce(Vt)}const et=e;_.add(et,"dragstart",Vt=>Vt.preventDefault(),Z).add(et,"touchmove",()=>{},Z).add(et,"touchend",()=>{}).add(et,"touchstart",Ge).add(et,"mousedown",Ge).add(et,"touchcancel",Te).add(et,"contextmenu",Te).add(et,"click",Fe,!0)}function Y(){_.clear(),z.clear()}function ie(){const pe=he?t:e;z.add(pe,"touchmove",ke,Z).add(pe,"touchend",Te).add(pe,"mousemove",ke,Z).add(pe,"mouseup",Te)}function I(pe){const Ge=pe.nodeName||"";return R.includes(Ge)}function le(){return(v?K:se)[he?"mouse":"touch"]}function we(pe,Ge){const et=m.add(Qb(pe)*-1),Vt=p.byDistance(pe,!v).distance;return v||St(pe)<V?Vt:x&&Ge?Vt*.5:p.byIndex(et.get(),0).distance}function ce(pe){const Ge=ly(pe,i);he=Ge,W=v&&Ge&&!pe.buttons&&fe,fe=du(r.get(),o.get())>=2,!(Ge&&pe.button!==0)&&(I(pe.target)||(X=!0,l.pointerDown(pe),d.useFriction(0).useDuration(0),r.set(o),ie(),ge=l.readPoint(pe),oe=l.readPoint(pe,A),g.emit("pointerDown")))}function ke(pe){if(!ly(pe,i)&&pe.touches.length>=2)return Te(pe);const et=l.readPoint(pe),Vt=l.readPoint(pe,A),vn=du(et,ge),ut=du(Vt,oe);if(!H&&!he&&(!pe.cancelable||(H=vn>ut,!H)))return Te(pe);const si=l.pointerMove(pe);vn>S&&(W=!0),d.useFriction(.3).useDuration(.75),c.start(),r.add(M(si)),pe.preventDefault()}function Te(pe){const et=p.byDistance(0,!1).index!==m.get(),Vt=l.pointerUp(pe)*le(),vn=we(M(Vt),et),ut=M9(Vt,vn),si=te-10*ut,At=w+ut/50;H=!1,X=!1,z.clear(),d.useDuration(si).useFriction(At),f.distance(vn,!v),he=!1,g.emit("pointerUp")}function Fe(pe){W&&(pe.stopPropagation(),pe.preventDefault(),W=!1)}function rt(){return X}return{init:D,destroy:Y,pointerDown:rt}}function N9(n,e){let i,r;function l(m){return m.timeStamp}function o(m,g){const v=`client${(g||n.scroll)==="x"?"X":"Y"}`;return(ly(m,e)?m:m.touches[0])[v]}function c(m){return i=m,r=m,o(m)}function f(m){const g=o(m)-o(r),b=l(m)-l(i)>170;return r=m,b&&(i=m),g}function d(m){if(!i||!r)return 0;const g=o(r)-o(i),b=l(m)-l(i),v=l(m)-l(r)>170,S=g/b;return b&&!v&&St(S)>.1?S:0}return{pointerDown:c,pointerMove:f,pointerUp:d,readPoint:o}}function z9(){function n(t){const{offsetTop:i,offsetLeft:r,offsetWidth:l,offsetHeight:o}=t;return{top:i,right:r+l,bottom:i+o,left:r,width:l,height:o}}return{measure:n}}function q9(n){function e(i){return n*(i/100)}return{measure:e}}function j9(n,e,t,i,r,l,o){const c=[n].concat(i);let f,d,p=[],m=!1;function g(x){return r.measureSize(o.measure(x))}function b(x){if(!l)return;d=g(n),p=i.map(g);function w(P){for(const A of P){if(m)return;const M=A.target===n,R=i.indexOf(A.target),Z=M?d:p[R],_=g(M?n:i[R]);if(St(_-Z)>=.5){x.reInit(),e.emit("resize");break}}}f=new ResizeObserver(P=>{(wp(l)||l(x,P))&&w(P)}),t.requestAnimationFrame(()=>{c.forEach(P=>f.observe(P))})}function v(){m=!0,f&&f.disconnect()}return{init:b,destroy:v}}function L9(n,e,t,i,r,l){let o=0,c=0,f=r,d=l,p=n.get(),m=0;function g(){const Z=i.get()-n.get(),_=!f;let z=0;return _?(o=0,t.set(i),n.set(i),z=Z):(t.set(n),o+=Z/f,o*=d,p+=o,n.add(o),z=p-m),c=Qb(z),m=p,R}function b(){const Z=i.get()-e.get();return St(Z)<.001}function v(){return f}function S(){return c}function x(){return o}function w(){return A(r)}function P(){return M(l)}function A(Z){return f=Z,R}function M(Z){return d=Z,R}const R={direction:S,duration:v,velocity:x,seek:g,settled:b,useBaseFriction:P,useBaseDuration:w,useFriction:M,useDuration:A};return R}function B9(n,e,t,i,r){const l=r.measure(10),o=r.measure(50),c=Ul(.1,.99);let f=!1;function d(){return!(f||!n.reachedAny(t.get())||!n.reachedAny(e.get()))}function p(b){if(!d())return;const v=n.reachedMin(e.get())?"min":"max",S=St(n[v]-e.get()),x=t.get()-e.get(),w=c.constrain(S/o);t.subtract(x*w),!b&&St(x)<l&&(t.set(n.constrain(t.get())),i.useDuration(25).useBaseFriction())}function m(b){f=!b}return{shouldConstrain:d,constrain:p,toggleActive:m}}function V9(n,e,t,i,r){const l=Ul(-e+n,0),o=m(),c=p(),f=g();function d(v,S){return du(v,S)<=1}function p(){const v=o[0],S=ji(o),x=o.lastIndexOf(v),w=o.indexOf(S)+1;return Ul(x,w)}function m(){return t.map((v,S)=>{const{min:x,max:w}=l,P=l.constrain(v),A=!S,M=kb(t,S);return A?w:M||d(x,P)?x:d(w,P)?w:P}).map(v=>parseFloat(v.toFixed(3)))}function g(){if(e<=n+r)return[l.max];if(i==="keepSnaps")return o;const{min:v,max:S}=c;return o.slice(v,S)}return{snapsContained:f,scrollContainLimit:c}}function Y9(n,e,t){const i=e[0],r=t?i-n:ji(e);return{limit:Ul(r,i)}}function U9(n,e,t,i){const l=e.min+.1,o=e.max+.1,{reachedMin:c,reachedMax:f}=Ul(l,o);function d(g){return g===1?f(t.get()):g===-1?c(t.get()):!1}function p(g){if(!d(g))return;const b=n*(g*-1);i.forEach(v=>v.add(b))}return{loop:p}}function G9(n){const{max:e,length:t}=n;function i(l){const o=l-e;return t?o/-t:0}return{get:i}}function W9(n,e,t,i,r){const{startEdge:l,endEdge:o}=n,{groupSlides:c}=r,f=m().map(e.measure),d=g(),p=b();function m(){return c(i).map(S=>ji(S)[o]-S[0][l]).map(St)}function g(){return i.map(S=>t[l]-S[l]).map(S=>-St(S))}function b(){return c(d).map(S=>S[0]).map((S,x)=>S+f[x])}return{snaps:d,snapsAligned:p}}function H9(n,e,t,i,r,l){const{groupSlides:o}=r,{min:c,max:f}=i,d=p();function p(){const g=o(l),b=!n||e==="keepSnaps";return t.length===1?[l]:b?g:g.slice(c,f).map((v,S,x)=>{const w=!S,P=kb(x,S);if(w){const A=ji(x[0])+1;return Kk(A)}if(P){const A=ff(l)-ji(x)[0]+1;return Kk(A,ji(x)[0])}return v})}return{slideRegistry:d}}function I9(n,e,t,i,r){const{reachedAny:l,removeOffset:o,constrain:c}=i;function f(v){return v.concat().sort((S,x)=>St(S)-St(x))[0]}function d(v){const S=n?o(v):c(v),x=e.map((P,A)=>({diff:p(P-S,0),index:A})).sort((P,A)=>St(P.diff)-St(A.diff)),{index:w}=x[0];return{index:w,distance:S}}function p(v,S){const x=[v,v+t,v-t];if(!n)return v;if(!S)return f(x);const w=x.filter(P=>Qb(P)===S);return w.length?f(w):ji(x)-t}function m(v,S){const x=e[v]-r.get(),w=p(x,S);return{index:v,distance:w}}function g(v,S){const x=r.get()+v,{index:w,distance:P}=d(x),A=!n&&l(x);if(!S||A)return{index:w,distance:v};const M=e[w]-P,R=v+p(M,0);return{index:w,distance:R}}return{byDistance:g,byIndex:m,shortcut:p}}function F9(n,e,t,i,r,l,o){function c(m){const g=m.distance,b=m.index!==e.get();l.add(g),g&&(i.duration()?n.start():(n.update(),n.render(1),n.update())),b&&(t.set(e.get()),e.set(m.index),o.emit("select"))}function f(m,g){const b=r.byDistance(m,g);c(b)}function d(m,g){const b=e.clone().set(m),v=r.byIndex(b.get(),g);c(v)}return{distance:f,index:d}}function K9(n,e,t,i,r,l,o,c){const f={passive:!0,capture:!0};let d=0;function p(b){if(!c)return;function v(S){if(new Date().getTime()-d>10)return;o.emit("slideFocusStart"),n.scrollLeft=0;const P=t.findIndex(A=>A.includes(S));wb(P)&&(r.useDuration(0),i.index(P,0),o.emit("slideFocus"))}l.add(document,"keydown",m,!1),e.forEach((S,x)=>{l.add(S,"focus",w=>{(wp(c)||c(b,w))&&v(x)},f)})}function m(b){b.code==="Tab"&&(d=new Date().getTime())}return{init:p}}function su(n){let e=n;function t(){return e}function i(f){e=o(f)}function r(f){e+=o(f)}function l(f){e-=o(f)}function o(f){return wb(f)?f:f.get()}return{get:t,set:i,add:r,subtract:l}}function hR(n,e){const t=n.scroll==="x"?o:c,i=e.style;let r=null,l=!1;function o(g){return`translate3d(${g}px,0px,0px)`}function c(g){return`translate3d(0px,${g}px,0px)`}function f(g){if(l)return;const b=E9(n.direction(g));b!==r&&(i.transform=t(b),r=b)}function d(g){l=!g}function p(){l||(i.transform="",e.getAttribute("style")||e.removeAttribute("style"))}return{clear:p,to:f,toggleActive:d}}function J9(n,e,t,i,r,l,o,c,f){const p=Zu(r),m=Zu(r).reverse(),g=w().concat(P());function b(_,z){return _.reduce((V,se)=>V-r[se],z)}function v(_,z){return _.reduce((V,se)=>b(V,z)>0?V.concat([se]):V,[])}function S(_){return l.map((z,V)=>({start:z-i[V]+.5+_,end:z+e-.5+_}))}function x(_,z,V){const se=S(z);return _.map(K=>{const te=V?0:-t,fe=V?t:0,ge=V?"end":"start",oe=se[K][ge];return{index:K,loopPoint:oe,slideLocation:su(-1),translate:hR(n,f[K]),target:()=>c.get()>oe?te:fe}})}function w(){const _=o[0],z=v(m,_);return x(z,t,!1)}function P(){const _=e-o[0]-1,z=v(p,_);return x(z,-t,!0)}function A(){return g.every(({index:_})=>{const z=p.filter(V=>V!==_);return b(z,e)<=.1})}function M(){g.forEach(_=>{const{target:z,translate:V,slideLocation:se}=_,K=z();K!==se.get()&&(V.to(K),se.set(K))})}function R(){g.forEach(_=>_.translate.clear())}return{canLoop:A,clear:R,loop:M,loopPoints:g}}function eY(n,e,t){let i,r=!1;function l(f){if(!t)return;function d(p){for(const m of p)if(m.type==="childList"){f.reInit(),e.emit("slidesChanged");break}}i=new MutationObserver(p=>{r||(wp(t)||t(f,p))&&d(p)}),i.observe(n,{childList:!0})}function o(){i&&i.disconnect(),r=!0}return{init:l,destroy:o}}function tY(n,e,t,i){const r={};let l=null,o=null,c,f=!1;function d(){c=new IntersectionObserver(v=>{f||(v.forEach(S=>{const x=e.indexOf(S.target);r[x]=S}),l=null,o=null,t.emit("slidesInView"))},{root:n.parentElement,threshold:i}),e.forEach(v=>c.observe(v))}function p(){c&&c.disconnect(),f=!0}function m(v){return _u(r).reduce((S,x)=>{const w=parseInt(x),{isIntersecting:P}=r[w];return(v&&P||!v&&!P)&&S.push(w),S},[])}function g(v=!0){if(v&&l)return l;if(!v&&o)return o;const S=m(v);return v&&(l=S),v||(o=S),S}return{init:d,destroy:p,get:g}}function nY(n,e,t,i,r,l){const{measureSize:o,startEdge:c,endEdge:f}=n,d=t[0]&&r,p=v(),m=S(),g=t.map(o),b=x();function v(){if(!d)return 0;const P=t[0];return St(e[c]-P[c])}function S(){if(!d)return 0;const P=l.getComputedStyle(ji(i));return parseFloat(P.getPropertyValue(`margin-${f}`))}function x(){return t.map((P,A,M)=>{const R=!A,Z=kb(M,A);return R?g[A]+p:Z?g[A]+m:M[A+1][c]-P[c]}).map(St)}return{slideSizes:g,slideSizesWithGaps:b,startGap:p,endGap:m}}function iY(n,e,t,i,r,l,o,c,f){const{startEdge:d,endEdge:p,direction:m}=n,g=wb(t);function b(w,P){return Zu(w).filter(A=>A%P===0).map(A=>w.slice(A,A+P))}function v(w){return w.length?Zu(w).reduce((P,A,M)=>{const R=ji(P)||0,Z=R===0,_=A===ff(w),z=r[d]-l[R][d],V=r[d]-l[A][p],se=!i&&Z?m(o):0,K=!i&&_?m(c):0,te=St(V-K-(z+se));return M&&te>e+f&&P.push(A),_&&P.push(w.length),P},[]).map((P,A,M)=>{const R=Math.max(M[A-1]||0);return w.slice(R,P)}):[]}function S(w){return g?b(w,t):v(w)}return{groupSlides:S}}function rY(n,e,t,i,r,l,o){const{align:c,axis:f,direction:d,startIndex:p,loop:m,duration:g,dragFree:b,dragThreshold:v,inViewThreshold:S,slidesToScroll:x,skipSnaps:w,containScroll:P,watchResize:A,watchSlides:M,watchDrag:R,watchFocus:Z}=l,_=2,z=z9(),V=z.measure(e),se=t.map(z.measure),K=_9(f,d),te=K.measureSize(V),fe=q9(te),ge=D9(c,te),oe=!m&&!!P,X=m||!!P,{slideSizes:H,slideSizesWithGaps:W,startGap:he,endGap:D}=nY(K,V,se,t,X,r),Y=iY(K,te,x,m,V,se,he,D,_),{snaps:ie,snapsAligned:I}=W9(K,ge,V,se,Y),le=-ji(ie)+ji(W),{snapsContained:we,scrollContainLimit:ce}=V9(te,le,I,P,_),ke=oe?we:I,{limit:Te}=Y9(le,ke,m),Fe=fR(ff(ke),p,m),rt=Fe.clone(),Be=Zu(t),pe=({dragHandler:Sn,scrollBody:ns,scrollBounds:ci,options:{loop:Mi}})=>{Mi||ci.constrain(Sn.pointerDown()),ns.seek()},Ge=({scrollBody:Sn,translate:ns,location:ci,offsetLocation:Mi,previousLocation:is,scrollLooper:ui,slideLooper:kr,dragHandler:Cr,animation:Ks,eventHandler:An,scrollBounds:Il,options:{loop:rs}},Ei)=>{const Js=Sn.settled(),Me=!Il.shouldConstrain(),Ot=rs?Js:Js&&Me,bt=Ot&&!Cr.pointerDown();bt&&Ks.stop();const Ut=ci.get()*Ei+is.get()*(1-Ei);Mi.set(Ut),rs&&(ui.loop(Sn.direction()),kr.loop()),ns.to(Mi.get()),bt&&An.emit("settle"),Ot||An.emit("scroll")},et=Z9(i,r,()=>pe($t),Sn=>Ge($t,Sn)),Vt=.68,vn=ke[Fe.get()],ut=su(vn),si=su(vn),At=su(vn),li=su(vn),ai=L9(ut,At,si,li,g,Vt),Yt=I9(m,ke,le,Te,li),Vn=F9(et,Fe,rt,ai,Yt,li,o),Wl=G9(Te),Hl=Xu(),oi=tY(e,t,o,S),{slideRegistry:Ft}=H9(oe,P,ke,ce,Y,Be),Yn=K9(n,t,Ft,Vn,ai,Hl,o,Z),$t={ownerDocument:i,ownerWindow:r,eventHandler:o,containerRect:V,slideRects:se,animation:et,axis:K,dragHandler:X9(K,n,i,r,li,N9(K,r),ut,et,Vn,ai,Yt,Fe,o,fe,b,v,w,Vt,R),eventStore:Hl,percentOfView:fe,index:Fe,indexPrevious:rt,limit:Te,location:ut,offsetLocation:At,previousLocation:si,options:l,resizeHandler:j9(e,o,r,t,K,A,z),scrollBody:ai,scrollBounds:B9(Te,At,li,ai,fe),scrollLooper:U9(le,Te,At,[ut,At,si,li]),scrollProgress:Wl,scrollSnapList:ke.map(Wl.get),scrollSnaps:ke,scrollTarget:Yt,scrollTo:Vn,slideLooper:J9(K,te,le,H,W,ie,ke,At,t),slideFocus:Yn,slidesHandler:eY(e,o,M),slidesInView:oi,slideIndexes:Be,slideRegistry:Ft,slidesToScroll:Y,target:li,translate:hR(K,e)};return $t}function sY(){let n={},e;function t(d){e=d}function i(d){return n[d]||[]}function r(d){return i(d).forEach(p=>p(e,d)),f}function l(d,p){return n[d]=i(d).concat([p]),f}function o(d,p){return n[d]=i(d).filter(m=>m!==p),f}function c(){n={}}const f={init:t,emit:r,off:o,on:l,clear:c};return f}const lY={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function aY(n){function e(l,o){return uR(l,o||{})}function t(l){const o=l.breakpoints||{},c=_u(o).filter(f=>n.matchMedia(f).matches).map(f=>o[f]).reduce((f,d)=>e(f,d),{});return e(l,c)}function i(l){return l.map(o=>_u(o.breakpoints||{})).reduce((o,c)=>o.concat(c),[]).map(n.matchMedia)}return{mergeOptions:e,optionsAtMedia:t,optionsMediaQueries:i}}function oY(n){let e=[];function t(l,o){return e=o.filter(({options:c})=>n.optionsAtMedia(c).active!==!1),e.forEach(c=>c.init(l,n)),o.reduce((c,f)=>Object.assign(c,{[f.name]:f}),{})}function i(){e=e.filter(l=>l.destroy())}return{init:t,destroy:i}}function rp(n,e,t){const i=n.ownerDocument,r=i.defaultView,l=aY(r),o=oY(l),c=Xu(),f=sY(),{mergeOptions:d,optionsAtMedia:p,optionsMediaQueries:m}=l,{on:g,off:b,emit:v}=f,S=K;let x=!1,w,P=d(lY,rp.globalOptions),A=d(P),M=[],R,Z,_;function z(){const{container:Be,slides:pe}=A;Z=(sy(Be)?n.querySelector(Be):Be)||n.children[0];const et=sy(pe)?Z.querySelectorAll(pe):pe;_=[].slice.call(et||Z.children)}function V(Be){const pe=rY(n,Z,_,i,r,Be,f);if(Be.loop&&!pe.slideLooper.canLoop()){const Ge=Object.assign({},Be,{loop:!1});return V(Ge)}return pe}function se(Be,pe){x||(P=d(P,Be),A=p(P),M=pe||M,z(),w=V(A),m([P,...M.map(({options:Ge})=>Ge)]).forEach(Ge=>c.add(Ge,"change",K)),A.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(rt),w.eventHandler.init(rt),w.resizeHandler.init(rt),w.slidesHandler.init(rt),w.options.loop&&w.slideLooper.loop(),Z.offsetParent&&_.length&&w.dragHandler.init(rt),R=o.init(rt,M)))}function K(Be,pe){const Ge=Y();te(),se(d({startIndex:Ge},Be),pe),f.emit("reInit")}function te(){w.dragHandler.destroy(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),w.slidesInView.destroy(),w.animation.destroy(),o.destroy(),c.clear()}function fe(){x||(x=!0,c.clear(),te(),f.emit("destroy"),f.clear())}function ge(Be,pe,Ge){!A.active||x||(w.scrollBody.useBaseFriction().useDuration(pe===!0?0:A.duration),w.scrollTo.index(Be,Ge||0))}function oe(Be){const pe=w.index.add(1).get();ge(pe,Be,-1)}function X(Be){const pe=w.index.add(-1).get();ge(pe,Be,1)}function H(){return w.index.add(1).get()!==Y()}function W(){return w.index.add(-1).get()!==Y()}function he(){return w.scrollSnapList}function D(){return w.scrollProgress.get(w.offsetLocation.get())}function Y(){return w.index.get()}function ie(){return w.indexPrevious.get()}function I(){return w.slidesInView.get()}function le(){return w.slidesInView.get(!1)}function we(){return R}function ce(){return w}function ke(){return n}function Te(){return Z}function Fe(){return _}const rt={canScrollNext:H,canScrollPrev:W,containerNode:Te,internalEngine:ce,destroy:fe,off:b,on:g,emit:v,plugins:we,previousScrollSnap:ie,reInit:S,rootNode:ke,scrollNext:oe,scrollPrev:X,scrollProgress:D,scrollSnapList:he,scrollTo:ge,selectedScrollSnap:Y,slideNodes:Fe,slidesInView:I,slidesNotInView:le};return se(e,t),setTimeout(()=>f.emit("init"),0),rt}rp.globalOptions=void 0;function Cb(n={},e=[]){const t=$.useRef(n),i=$.useRef(e),[r,l]=$.useState(),[o,c]=$.useState(),f=$.useCallback(()=>{r&&r.reInit(t.current,i.current)},[r]);return $.useEffect(()=>{xb(t.current,n)||(t.current=n,f())},[n,f]),$.useEffect(()=>{R9(i.current,e)||(i.current=e,f())},[e,f]),$.useEffect(()=>{if($9()&&o){rp.globalOptions=Cb.globalOptions;const d=rp(o,t.current,i.current);return l(d),()=>d.destroy()}else l(void 0)},[o,l]),[c,r]}Cb.globalOptions=void 0;const cY=rf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Or({className:n,variant:e,size:t,asChild:i=!1,...r}){const l=i?P7:"button";return C.jsx(l,{"data-slot":"button",className:_t(cY({variant:e,size:t,className:n})),...r})}const dR=$.createContext(null);function pR(){const n=$.useContext(dR);if(!n)throw new Error("useCarousel must be used within a <Carousel />");return n}function uY({orientation:n="horizontal",opts:e,setApi:t,plugins:i,className:r,children:l,...o}){const[c,f]=Cb({...e,axis:n==="horizontal"?"x":"y"},i),[d,p]=$.useState(!1),[m,g]=$.useState(!1),b=$.useCallback(w=>{w&&(p(w.canScrollPrev()),g(w.canScrollNext()))},[]),v=$.useCallback(()=>{f==null||f.scrollPrev()},[f]),S=$.useCallback(()=>{f==null||f.scrollNext()},[f]),x=$.useCallback(w=>{w.key==="ArrowLeft"?(w.preventDefault(),v()):w.key==="ArrowRight"&&(w.preventDefault(),S())},[v,S]);return $.useEffect(()=>{!f||!t||t(f)},[f,t]),$.useEffect(()=>{if(f)return b(f),f.on("reInit",b),f.on("select",b),()=>{f==null||f.off("select",b)}},[f,b]),C.jsx(dR.Provider,{value:{carouselRef:c,api:f,opts:e,orientation:n||((e==null?void 0:e.axis)==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:S,canScrollPrev:d,canScrollNext:m},children:C.jsx("div",{onKeyDownCapture:x,className:_t("relative",r),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...o,children:l})})}function fY({className:n,...e}){const{carouselRef:t,orientation:i}=pR();return C.jsx("div",{ref:t,className:"overflow-hidden","data-slot":"carousel-content",children:C.jsx("div",{className:_t("flex",i==="horizontal"?"-ml-4":"-mt-4 flex-col",n),...e})})}function hY({className:n,...e}){const{orientation:t}=pR();return C.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:_t("min-w-0 shrink-0 grow-0 basis-full",t==="horizontal"?"pl-4":"pt-4",n),...e})}function mR({onImport:n}){const e=mb();return e?C.jsx("div",{children:C.jsx(uY,{children:C.jsx(fY,{children:e.starters.map(t=>C.jsx(hY,{className:"basis-1/3",children:C.jsxs("div",{className:"p-2 flex flex-col items-center hover:cursor-pointer hover:bg-gray-700/50 hover:text-white rounded-lg",onClick:()=>{n(t.url)},children:[C.jsx("img",{src:t.banner,alt:t.name,className:"w-100 max-w-full"}),C.jsx("div",{className:"text-md font-bold",children:t.name})]})},t.url))})})}):null}function dY(){var c;const n=Qr(),e=mb(),{open:t,setOpen:i,dontShowAgain:r,setDontShowAgain:l}=kB();if(n!=="setup"||!e||((c=e==null?void 0:e.starters)==null?void 0:c.length)===0)return null;async function o(f){const d=await R$(f);"error"in d?yb.error("Failed to load starter",{description:d.error}):(ty(d),i(!1))}return C.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:[C.jsx(of,{children:C.jsx(uf,{className:"text-center text-2xl font-bold",children:"Would you like to use a starter project?"})}),C.jsx("div",{children:C.jsx(mR,{onImport:o})}),C.jsxs(cf,{className:"flex sm:justify-between w-full",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(Ir,{id:"show-startup-dialog",checked:r,onCheckedChange:l}),C.jsx(Hr,{htmlFor:"show-startup-dialog",children:"Don't show this again"})]}),C.jsx(Or,{onClick:()=>i(!1),children:"No, I want to start from scratch"})]})]})})}var pY=(n,e,t,i,r,l,o,c)=>{let f=document.documentElement,d=["light","dark"];function p(b){(Array.isArray(n)?n:[n]).forEach(v=>{let S=v==="class",x=S&&l?r.map(w=>l[w]||w):r;S?(f.classList.remove(...x),f.classList.add(l&&l[b]?l[b]:b)):f.setAttribute(v,b)}),m(b)}function m(b){c&&d.includes(b)&&(f.style.colorScheme=b)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)p(i);else try{let b=localStorage.getItem(e)||t,v=o&&b==="system"?g():b;p(v)}catch{}},mY=$.createContext(void 0),OY={setTheme:n=>{},themes:[]},gY=()=>{var n;return(n=$.useContext(mY))!=null?n:OY};$.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:i,enableColorScheme:r,defaultTheme:l,value:o,themes:c,nonce:f,scriptProps:d})=>{let p=JSON.stringify([t,e,l,n,c,o,i,r]).slice(1,-1);return $.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${pY.toString()})(${p})`}})});const yY=({...n})=>{const{theme:e="system"}=gY();return C.jsx(lV,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n})};function Tb({className:n,type:e,...t}){return C.jsx("input",{type:e,"data-slot":"input",className:_t("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...t})}function bY(){const[n,e]=$.useState(""),[t,i]=$.useState(!1),r=af(),{toggleAddOn:l}=lf();async function o(){const c=await cB(n);"error"in c?yb.error("Failed to load add-on",{description:c.error}):(bB(c),c.modes.includes(r)&&l(c.id),i(!1))}return C.jsxs("div",{children:[C.jsxs(Or,{variant:"secondary",className:"w-full",onClick:()=>{e(""),i(!0)},children:[C.jsx(iD,{className:"w-4 h-4"}),"Import Custom Add-On"]}),C.jsx(jo,{modal:!0,open:t,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:[C.jsx(of,{children:C.jsx(uf,{children:"Import Custom Add-On"})}),C.jsx("div",{children:C.jsx(Tb,{value:n,onChange:c=>e(c.target.value),placeholder:"https://github.com/myorg/myproject/add-on.json",className:"min-w-lg w-full",onKeyDown:c=>{c.key==="Enter"&&o()}})}),C.jsx(cf,{children:C.jsx(Or,{onClick:o,children:"Import"})})]})})]})}function vY({addOn:n,onClose:e}){return C.jsx(jo,{modal:!0,open:!!n,onOpenChange:e,children:C.jsx(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:C.jsxs("div",{className:"flex flex-row",children:[(n==null?void 0:n.smallLogo)&&C.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(n.smallLogo)}`,alt:n.name,className:"w-15"}),C.jsxs("div",{className:"flex flex-col ml-4 gap-4",children:[C.jsx("p",{className:"text-lg font-bold",children:n==null?void 0:n.name}),C.jsx("p",{className:"text-sm text-gray-500",children:n==null?void 0:n.description}),C.jsxs("a",{href:n==null?void 0:n.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-500 underline",children:["More information on ",n==null?void 0:n.name]})]})]})})})}const Jk={toolchain:"Toolchain","add-on":"Add-on",example:"Example"};function SY(){const{availableAddOns:n,addOnState:e,toggleAddOn:t}=lf(),i=$.useMemo(()=>n.sort((o,c)=>o.name.localeCompare(c.name)),[n]),[r,l]=$.useState();return C.jsxs(C.Fragment,{children:[C.jsx(vY,{addOn:r,onClose:()=>l(void 0)}),Object.keys(Jk).map(o=>C.jsx($.Fragment,{children:i.filter(c=>c.type===o).length>0&&C.jsxs("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active",children:[C.jsx("h3",{className:"font-medium",children:Jk[o]}),C.jsx("div",{className:"flex flex-row flex-wrap",children:i.filter(c=>c.type===o).map(c=>C.jsx("div",{className:"w-1/2 flex flex-row justify-between pr-4",children:C.jsxs("div",{className:"p-1 flex flex-row items-center",children:[C.jsx(Ir,{id:c.id,checked:e[c.id].selected,disabled:!e[c.id].enabled,onCheckedChange:()=>{t(c.id)}}),C.jsxs(Hr,{htmlFor:c.id,className:"pl-2 font-semibold text-gray-300",children:[c.smallLogo&&C.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(c.smallLogo)}`,alt:c.name,className:"w-5"}),c.name]}),C.jsx(A2,{className:"ml-2 w-4 text-gray-600",onClick:()=>l(c)})]})},c.id))})]},`${o}-add-ons`)},o)),C.jsx("div",{className:"mt-4",children:C.jsx(bY,{})})]})}const xY={file:J5,command:tD,"package-manager":F5,info:A2,other:H5};function OR(){const[n,e]=$.useState([]),[t,i]=$.useState(!1),r=$.useCallback(async l=>{var d;i(!1);const o=(d=l.body)==null?void 0:d.getReader(),c=new TextDecoder;let f="";for(;;){const p=await(o==null?void 0:o.read());if(p!=null&&p.done)break;f+=c.decode(p==null?void 0:p.value);let m;const g=[];for(const b of f.split(`
212
- `))if(b.startsWith("{")&&b.endsWith("}")){const v=JSON.parse(b);v.msgType==="start"?m===v.id?g[g.length-1].message=v.message:(m=v.id,g.push({id:m,icon:xY[v.type],message:v.message})):(g.length>0&&(g[g.length-1].message=v.message),m=void 0)}e(g)}return i(!0),f},[]);return{finished:t,streamItems:n,monitorStream:r}}function gR({streamItems:n,finished:e}){return C.jsx("div",{className:"flex flex-col gap-2",children:n.map((t,i)=>C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(t.icon,{className:`w-4 h-4 ${i===n.length-1&&!e?"text-green-500 animate-spin":""}`}),t.message]},t.id))})}function wY(){const{chosenAddOns:n}=lf(),[e,t]=$.useState(!1),{streamItems:i,monitorStream:r,finished:l}=OR();if(Qr()!=="add")return null;async function c(){t(!0),r(await oB(n))}return C.jsxs("div",{children:[C.jsx(jo,{open:e,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",hideCloseButton:!0,children:[C.jsx(of,{children:C.jsx(uf,{children:"Adding Add-Ons"})}),C.jsx(gR,{streamItems:i,finished:l}),C.jsx(cf,{children:C.jsx(Or,{variant:"default",onClick:async()=>{await $$(),window.close()},disabled:!l,children:"Exit This Application"})})]})}),C.jsx("div",{className:"flex flex-col gap-2",children:C.jsx(Or,{variant:"default",onClick:c,disabled:n.length===0||e,className:"w-full",children:"Add These Add-Ons To Your App"})})]})}function QY(){const[n,e]=$.useState(!1),{streamItems:t,monitorStream:i,finished:r}=OR(),l=Qr(),o=ri(),{chosenAddOns:c}=lf(),{projectStarter:f}=qo();if(l!=="setup")return null;async function d(){e(!0),i(await aB(o,c,f))}return C.jsxs("div",{children:[C.jsx(jo,{open:n,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",hideCloseButton:!0,children:[C.jsx(of,{children:C.jsx(uf,{children:"Creating Your Application"})}),C.jsx(gR,{streamItems:t,finished:r}),C.jsx(cf,{children:C.jsx(Or,{variant:"default",onClick:async()=>{await $$(),window.close()},disabled:!r,children:"Exit This Application"})})]})}),C.jsx("div",{className:"flex flex-col gap-2",children:C.jsxs(Or,{variant:"default",onClick:d,disabled:n,className:"w-full",children:[C.jsx(U5,{className:"w-4 h-4"}),"Build Your App"]})})]})}function kY(){const n=wB();return Qr()!=="setup"?null:C.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[C.jsx("h3",{className:"font-medium whitespace-nowrap",children:"Project Name"}),C.jsx(Tb,{value:n,placeholder:"my-app",onChange:t=>CB(t.target.value),className:"w-full bg-gray-500/10 rounded-md px-2 py-1 min-w-[200px] text-sm"})]})}var Eg="rovingFocusGroup.onEntryFocus",CY={bubbles:!1,cancelable:!0},hf="RovingFocusGroup",[ay,yR,TY]=ZA(hf),[PY,bR]=Gl(hf,[TY]),[AY,$Y]=PY(hf),vR=$.forwardRef((n,e)=>C.jsx(ay.Provider,{scope:n.__scopeRovingFocusGroup,children:C.jsx(ay.Slot,{scope:n.__scopeRovingFocusGroup,children:C.jsx(RY,{...n,ref:e})})}));vR.displayName=hf;var RY=$.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:i,loop:r=!1,dir:l,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=n,g=$.useRef(null),b=Bn(e,g),v=cb(l),[S,x]=ts({prop:o,defaultProp:c??null,onChange:f,caller:hf}),[w,P]=$.useState(!1),A=Ro(d),M=yR(t),R=$.useRef(!1),[Z,_]=$.useState(0);return $.useEffect(()=>{const z=g.current;if(z)return z.addEventListener(Eg,A),()=>z.removeEventListener(Eg,A)},[A]),C.jsx(AY,{scope:t,orientation:i,dir:v,loop:r,currentTabStopId:S,onItemFocus:$.useCallback(z=>x(z),[x]),onItemShiftTab:$.useCallback(()=>P(!0),[]),onFocusableItemAdd:$.useCallback(()=>_(z=>z+1),[]),onFocusableItemRemove:$.useCallback(()=>_(z=>z-1),[]),children:C.jsx(Pt.div,{tabIndex:w||Z===0?-1:0,"data-orientation":i,...m,ref:b,style:{outline:"none",...n.style},onMouseDown:sn(n.onMouseDown,()=>{R.current=!0}),onFocus:sn(n.onFocus,z=>{const V=!R.current;if(z.target===z.currentTarget&&V&&!w){const se=new CustomEvent(Eg,CY);if(z.currentTarget.dispatchEvent(se),!se.defaultPrevented){const K=M().filter(X=>X.focusable),te=K.find(X=>X.active),fe=K.find(X=>X.id===S),oe=[te,fe,...K].filter(Boolean).map(X=>X.ref.current);wR(oe,p)}}R.current=!1}),onBlur:sn(n.onBlur,()=>P(!1))})})}),SR="RovingFocusGroupItem",xR=$.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:i=!0,active:r=!1,tabStopId:l,children:o,...c}=n,f=no(),d=l||f,p=$Y(SR,t),m=p.currentTabStopId===d,g=yR(t),{onFocusableItemAdd:b,onFocusableItemRemove:v,currentTabStopId:S}=p;return $.useEffect(()=>{if(i)return b(),()=>v()},[i,b,v]),C.jsx(ay.ItemSlot,{scope:t,id:d,focusable:i,active:r,children:C.jsx(Pt.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:sn(n.onMouseDown,x=>{i?p.onItemFocus(d):x.preventDefault()}),onFocus:sn(n.onFocus,()=>p.onItemFocus(d)),onKeyDown:sn(n.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){p.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=DY(x,p.orientation,p.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let A=g().filter(M=>M.focusable).map(M=>M.ref.current);if(w==="last")A.reverse();else if(w==="prev"||w==="next"){w==="prev"&&A.reverse();const M=A.indexOf(x.currentTarget);A=p.loop?ZY(A,M+1):A.slice(M+1)}setTimeout(()=>wR(A))}}),children:typeof o=="function"?o({isCurrentTabStop:m,hasTabStop:S!=null}):o})})});xR.displayName=SR;var MY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function EY(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function DY(n,e,t){const i=EY(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return MY[i]}function wR(n,e=!1){const t=document.activeElement;for(const i of n)if(i===t||(i.focus({preventScroll:e}),document.activeElement!==t))return}function ZY(n,e){return n.map((t,i)=>n[(e+i)%n.length])}var _Y=vR,XY=xR,QR="Toggle",kR=$.forwardRef((n,e)=>{const{pressed:t,defaultPressed:i,onPressedChange:r,...l}=n,[o,c]=ts({prop:t,onChange:r,defaultProp:i??!1,caller:QR});return C.jsx(Pt.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":n.disabled?"":void 0,...l,ref:e,onClick:sn(n.onClick,()=>{n.disabled||c(!o)})})});kR.displayName=QR;var Fs="ToggleGroup",[CR,h8]=Gl(Fs,[bR]),TR=bR(),Pb=F.forwardRef((n,e)=>{const{type:t,...i}=n;if(t==="single"){const r=i;return C.jsx(NY,{...r,ref:e})}if(t==="multiple"){const r=i;return C.jsx(zY,{...r,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Fs}\``)});Pb.displayName=Fs;var[PR,AR]=CR(Fs),NY=F.forwardRef((n,e)=>{const{value:t,defaultValue:i,onValueChange:r=()=>{},...l}=n,[o,c]=ts({prop:t,defaultProp:i??"",onChange:r,caller:Fs});return C.jsx(PR,{scope:n.__scopeToggleGroup,type:"single",value:F.useMemo(()=>o?[o]:[],[o]),onItemActivate:c,onItemDeactivate:F.useCallback(()=>c(""),[c]),children:C.jsx($R,{...l,ref:e})})}),zY=F.forwardRef((n,e)=>{const{value:t,defaultValue:i,onValueChange:r=()=>{},...l}=n,[o,c]=ts({prop:t,defaultProp:i??[],onChange:r,caller:Fs}),f=F.useCallback(p=>c((m=[])=>[...m,p]),[c]),d=F.useCallback(p=>c((m=[])=>m.filter(g=>g!==p)),[c]);return C.jsx(PR,{scope:n.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:f,onItemDeactivate:d,children:C.jsx($R,{...l,ref:e})})});Pb.displayName=Fs;var[qY,jY]=CR(Fs),$R=F.forwardRef((n,e)=>{const{__scopeToggleGroup:t,disabled:i=!1,rovingFocus:r=!0,orientation:l,dir:o,loop:c=!0,...f}=n,d=TR(t),p=cb(o),m={role:"group",dir:p,...f};return C.jsx(qY,{scope:t,rovingFocus:r,disabled:i,children:r?C.jsx(_Y,{asChild:!0,...d,orientation:l,dir:p,loop:c,children:C.jsx(Pt.div,{...m,ref:e})}):C.jsx(Pt.div,{...m,ref:e})})}),sp="ToggleGroupItem",RR=F.forwardRef((n,e)=>{const t=AR(sp,n.__scopeToggleGroup),i=jY(sp,n.__scopeToggleGroup),r=TR(n.__scopeToggleGroup),l=t.value.includes(n.value),o=i.disabled||n.disabled,c={...n,pressed:l,disabled:o},f=F.useRef(null);return i.rovingFocus?C.jsx(XY,{asChild:!0,...r,focusable:!o,active:l,ref:f,children:C.jsx(e2,{...c,ref:e})}):C.jsx(e2,{...c,ref:e})});RR.displayName=sp;var e2=F.forwardRef((n,e)=>{const{__scopeToggleGroup:t,value:i,...r}=n,l=AR(sp,t),o={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},c=l.type==="single"?o:void 0;return C.jsx(kR,{...c,...r,ref:e,onPressedChange:f=>{f?l.onItemActivate(i):l.onItemDeactivate(i)}})}),LY=Pb,BY=RR;const VY=rf("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),MR=$.createContext({size:"default",variant:"default"});function YY({className:n,variant:e,size:t,children:i,...r}){return C.jsx(LY,{"data-slot":"toggle-group","data-variant":e,"data-size":t,className:_t("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),...r,children:C.jsx(MR.Provider,{value:{variant:e,size:t},children:i})})}function t2({className:n,children:e,variant:t,size:i,...r}){const l=$.useContext(MR);return C.jsx(BY,{"data-slot":"toggle-group-item","data-variant":l.variant||t,"data-size":l.size||i,className:_t(VY({variant:l.variant||t,size:l.size||i}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),...r,children:e})}function UY(){const n=Qr(),e=vB(),t=af();return n!=="setup"?null:C.jsxs("div",{className:"flex flex-col @md:flex-row @md:items-center gap-2 items-start",children:[C.jsx("h3",{className:"font-medium whitespace-nowrap",children:"Router Mode"}),C.jsx("div",{className:"flex flex-row justify-center items-center",children:C.jsxs(YY,{type:"single",value:t,onValueChange:i=>{i&&TB(i)},className:"rounded-md border-2 border-gray-500/10",children:[C.jsxs(t2,{value:"code-router",className:"px-4",disabled:!e,children:[C.jsx(N5,{className:"w-4 h-4"}),"Code Router"]}),C.jsxs(t2,{value:"file-router",className:"px-4",disabled:!e,children:[C.jsx(B5,{className:"w-4 h-4"}),"File Router"]})]})})]})}function GY(){const n=ri(l=>l.typescript),e=ri(l=>l.tailwind),t=Qr(),i=xB(),r=SB();return t!=="setup"?null:C.jsxs("div",{className:"flex",children:[C.jsxs("div",{className:"w-1/2 flex flex-row items-center justify-center",children:[C.jsx(Ir,{id:"typescript-switch",checked:n,onCheckedChange:l=>PB(l),disabled:!r}),C.jsxs(Hr,{htmlFor:"typescript-switch",className:"ml-2",children:[C.jsx("img",{src:"/typescript.svg",className:"w-5"}),"TypeScript"]})]}),C.jsxs("div",{className:"w-1/2 flex flex-row items-center justify-center",children:[C.jsx(Ir,{id:"tailwind-switch",checked:e,onCheckedChange:l=>AB(l),disabled:!i}),C.jsxs(Hr,{htmlFor:"tailwind-switch",className:"ml-2",children:[C.jsx("img",{src:"/tailwind.svg",className:"w-5"}),"Tailwind"]})]})]})}function WY(){const[n,e]=$.useState(""),[t,i]=$.useState(!1),r=Qr(),{projectStarter:l}=qo();if(r!=="setup")return null;async function o(f){const d=await R$(f||n);"error"in d?yb.error("Failed to load starter",{description:d.error}):(ty(d),i(!1))}const c=mb();return C.jsxs(C.Fragment,{children:[(l==null?void 0:l.banner)&&C.jsx("div",{className:"flex justify-center mb-4",children:C.jsx("div",{className:"p-2 bg-gray-300 rounded-lg shadow-xl shadow-gray-800",children:C.jsx("img",{src:l.banner,alt:"Starter Banner",className:"w-40 max-w-full"})})}),(l==null?void 0:l.name)&&C.jsxs("div",{className:"text-md mb-4",children:[C.jsx(Or,{variant:"outline",size:"sm",className:"mr-2",onClick:()=>{ty(void 0)},children:C.jsx(sD,{className:"w-4 h-4"})}),C.jsx("span",{className:"font-bold",children:"Starter: "}),l.name]}),C.jsxs("div",{children:[C.jsxs(Or,{variant:"secondary",className:"w-full",onClick:()=>{e(""),i(!0)},children:[C.jsx(q5,{className:"w-4 h-4"}),"Set Project Starter"]}),C.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:[C.jsx(of,{children:C.jsx(uf,{children:"Project Starter URL"})}),(c==null?void 0:c.starters)&&C.jsx("div",{children:C.jsx(mR,{onImport:o})}),C.jsx("div",{children:C.jsx(Tb,{value:n,onChange:f=>e(f.target.value),placeholder:"https://github.com/myorg/myproject/starter.json",className:"min-w-lg w-full",onKeyDown:f=>{f.key==="Enter"&&o()}})}),C.jsx(cf,{children:C.jsx(Or,{onClick:o,children:"Load"})})]})})]})]})}function HY(){const n=Ob(),e=Qr();return C.jsxs("div",{className:"flex flex-col gap-2",children:[n&&C.jsxs(C.Fragment,{children:[e==="setup"&&C.jsxs("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 space-y-2 rounded-lg",children:[C.jsx("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active @container",children:C.jsx(kY,{})}),C.jsx("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active @container",children:C.jsx(UY,{})}),C.jsx("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active @container",children:C.jsx(GY,{})})]}),C.jsx("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 space-y-2 rounded-lg",children:C.jsx(SY,{})}),e==="setup"&&C.jsx("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 space-y-2 rounded-lg",children:C.jsx(WY,{})})]}),C.jsxs("div",{className:"mt-5",children:[C.jsx(wY,{}),C.jsx(QY,{})]})]})}function IY(){return C.jsxs("div",{className:"bg-white dark:bg-black/50 rounded-lg p-2 sm:p-4 flex items-center gap-2 text-lg sm:text-xl shadow-xl",children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("img",{src:"/logo-color-100w.png",alt:"TanStack Logo",className:"w-[30px] rounded-full overflow-hidden border-2 border-black dark:border-none"}),C.jsx("div",{className:"font-black text-xl uppercase",children:"TanStack"})]}),C.jsx("svg",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"0 0 256 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"})}),C.jsxs("div",{className:"hover:text-blue-500 flex items-center gap-2",children:["Create TanStack App"," ",C.jsx("span",{className:"bg-gradient-to-r from-blue-500 to-cyan-500 text-white text-xs font-bold px-2 py-0.5 rounded",children:"ALPHA"})]})]})}function FY(){const[n,e]=$.useState(!1);return $.useEffect(()=>{e(!0)},[]),n}const KY=()=>{const[n,e]=$.useState(null);return $.useEffect(()=>{const t=window.matchMedia("(prefers-reduced-motion: reduce)");e(t.matches);const i=r=>{e(r.matches)};return t.addEventListener("change",i),()=>{t.removeEventListener("change",i)}},[]),n};function JY(){const n=$.useRef(null),e=KY(),t=FY();return $.useEffect(()=>{if(e!==!1)return;const i=n.current;let r=2e3;const l=1e3*60*2,o=e8(.645,.045,.355,1);if(i){let c=function(){return f([{color:{h:10,s:100,l:50}},{color:{h:40,s:100,l:50}},{color:{h:150,s:100,l:50}},{color:{h:200,s:100,l:50}}]).map(A=>({...A,x:Math.random()*i.width,y:Math.random()*i.height,r:Math.random()*500+700,colorH:A.color.h,colorS:A.color.s,colorL:A.color.l}))},f=function(A){for(let M=A.length-1;M>0;M--){const R=Math.floor(Math.random()*(M+1));[A[M],A[R]]=[A[R],A[M]]}return A},d=function(){const A=document.createElement("canvas");A.width=i.width,A.height=i.height,A.getContext("2d").drawImage(i,0,0),i.width=window.innerWidth,i.height=window.innerHeight,g.drawImage(A,0,0,i.width,i.height)},p=function(){v&&clearTimeout(v),b&&cancelAnimationFrame(b),x=JSON.parse(JSON.stringify(w)),P=c(),S=performance.now(),m()},m=function(){g.clearRect(0,0,i.width,i.height);const M=(performance.now()-S)/r,R=o(M);x.forEach((Z,_)=>{const z=P[_];w[_].x=Wc(Z.x,z.x,R),w[_].y=Wc(Z.y,z.y,R);const V=g.createRadialGradient(w[_].x,w[_].y,0,w[_].x,w[_].y,w[_].r);w[_].colorH=Wc(Z.colorH,z.colorH,R),w[_].colorS=Wc(Z.colorS,z.colorS,R),w[_].colorL=Wc(Z.colorL,z.colorL,R),V.addColorStop(0,`hsla(${w[_].colorH}, ${w[_].colorS}%, ${w[_].colorL}%, 1)`),V.addColorStop(1,`hsla(${w[_].colorH}, ${w[_].colorS}%, ${w[_].colorL}%, 0)`),g.fillStyle=V,g.beginPath(),g.arc(w[_].x,w[_].y,w[_].r,0,Math.PI*2),g.fill()}),M<1?b=requestAnimationFrame(m):v=setTimeout(()=>{r=4e3,p()},l)};const g=i.getContext("2d");let b=null,v=null,S=performance.now(),x=c(),w=x,P=[];return d(),p(),window.addEventListener("resize",d),()=>{b&&cancelAnimationFrame(b),v&&clearTimeout(v),window.removeEventListener("resize",d)}}},[e]),C.jsx("div",{className:p$("fixed inset-0 z-0 opacity-20 pointer-events-none","transition-opacity duration-[2s] ease-linear","[&+*]:relative",t?"opacity-10 dark:opacity-20":"opacity-0"),children:C.jsx("canvas",{ref:n})})}function e8(n,e,t,i){return function(r){const l=3*e,o=3*(i-e)-l;return(((1-l-o)*r+o)*r+l)*r}}function Wc(n,e,t){return n+(e-n)*t}const t8=new p5;function n8(){return $B(),C.jsxs("main",{className:"min-w-[1280px]",children:[C.jsx(JY,{}),C.jsxs("div",{className:"min-h-dvh p-2 sm:p-4 space-y-2 sm:space-y-4 @container",children:[C.jsx(IY,{}),C.jsxs("div",{className:"flex flex-row",children:[C.jsx("div",{className:"w-1/3 @8xl:w-1/4 pr-2",children:C.jsx(HY,{})}),C.jsx("div",{className:"w-2/3 @8xl:w-3/4 pl-2",children:C.jsx(EB,{})})]})]}),C.jsx(dY,{})]})}function i8(){return C.jsxs(b5,{client:t8,children:[C.jsx(n8,{}),C.jsx(yY,{})]})}const n2=document.getElementById("root");n2&&FE.createRoot(n2).render(C.jsx(i8,{}));
213
- //# sourceMappingURL=index-BOlcot4d.js.map
211
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return $.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},b9="DialogDescriptionWarning",v9=({contentRef:n,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cR(b9).contentName}}.`;return $.useEffect(()=>{var l;const r=(l=n.current)==null?void 0:l.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(i))},[i,n,e]),null},S9=F$,x9=eR,w9=tR,Q9=nR,k9=rR,C9=aR;function jo({...n}){return C.jsx(S9,{"data-slot":"dialog",...n})}function T9({...n}){return C.jsx(x9,{"data-slot":"dialog-portal",...n})}function P9({className:n,...e}){return C.jsx(w9,{"data-slot":"dialog-overlay",className:_t("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function Lo({className:n,children:e,hideCloseButton:t,...i}){return C.jsxs(T9,{"data-slot":"dialog-portal",children:[C.jsx(P9,{}),C.jsxs(Q9,{"data-slot":"dialog-content",className:_t("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg p-6 shadow-lg duration-200 sm:max-w-lg bg-opacity-70 backdrop-blur-md border-3 border-white/20",n),...i,children:[e,!t&&C.jsxs(C9,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[C.jsx(aD,{}),C.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function of({className:n,...e}){return C.jsx("div",{"data-slot":"dialog-header",className:_t("flex flex-col gap-2 text-center sm:text-left",n),...e})}function cf({className:n,...e}){return C.jsx("div",{"data-slot":"dialog-footer",className:_t("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...e})}function uf({className:n,...e}){return C.jsx(k9,{"data-slot":"dialog-title",className:_t("text-lg leading-none font-semibold",n),...e})}function A9(n){return Object.prototype.toString.call(n)==="[object Object]"}function Hk(n){return A9(n)||Array.isArray(n)}function $9(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function xb(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;const r=JSON.stringify(Object.keys(n.breakpoints||{})),l=JSON.stringify(Object.keys(e.breakpoints||{}));return r!==l?!1:t.every(o=>{const c=n[o],f=e[o];return typeof c=="function"?`${c}`==`${f}`:!Hk(c)||!Hk(f)?c===f:xb(c,f)})}function Ik(n){return n.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function R9(n,e){if(n.length!==e.length)return!1;const t=Ik(n),i=Ik(e);return t.every((r,l)=>{const o=i[l];return xb(r,o)})}function wb(n){return typeof n=="number"}function sy(n){return typeof n=="string"}function wp(n){return typeof n=="boolean"}function Fk(n){return Object.prototype.toString.call(n)==="[object Object]"}function St(n){return Math.abs(n)}function Qb(n){return Math.sign(n)}function du(n,e){return St(n-e)}function M9(n,e){if(n===0||e===0||St(n)<=St(e))return 0;const t=du(St(n),St(e));return St(t/n)}function E9(n){return Math.round(n*100)/100}function Zu(n){return _u(n).map(Number)}function ji(n){return n[ff(n)]}function ff(n){return Math.max(0,n.length-1)}function kb(n,e){return e===ff(n)}function Kk(n,e=0){return Array.from(Array(n),(t,i)=>e+i)}function _u(n){return Object.keys(n)}function uR(n,e){return[n,e].reduce((t,i)=>(_u(i).forEach(r=>{const l=t[r],o=i[r],c=Fk(l)&&Fk(o);t[r]=c?uR(l,o):o}),t),{})}function ly(n,e){return typeof e.MouseEvent<"u"&&n instanceof e.MouseEvent}function D9(n,e){const t={start:i,center:r,end:l};function i(){return 0}function r(f){return l(f)/2}function l(f){return e-f}function o(f,d){return sy(n)?t[n](f):n(e,f,d)}return{measure:o}}function Xu(){let n=[];function e(r,l,o,c={passive:!0}){let f;if("addEventListener"in r)r.addEventListener(l,o,c),f=()=>r.removeEventListener(l,o,c);else{const d=r;d.addListener(o),f=()=>d.removeListener(o)}return n.push(f),i}function t(){n=n.filter(r=>r())}const i={add:e,clear:t};return i}function Z9(n,e,t,i){const r=Xu(),l=1e3/60;let o=null,c=0,f=0;function d(){r.add(n,"visibilitychange",()=>{n.hidden&&v()})}function p(){b(),r.clear()}function m(x){if(!f)return;o||(o=x,t(),t());const w=x-o;for(o=x,c+=w;c>=l;)t(),c-=l;const P=c/l;i(P),f&&(f=e.requestAnimationFrame(m))}function g(){f||(f=e.requestAnimationFrame(m))}function b(){e.cancelAnimationFrame(f),o=null,c=0,f=0}function v(){o=null,c=0}return{init:d,destroy:p,start:g,stop:b,update:t,render:i}}function _9(n,e){const t=e==="rtl",i=n==="y",r=i?"y":"x",l=i?"x":"y",o=!i&&t?-1:1,c=p(),f=m();function d(v){const{height:S,width:x}=v;return i?S:x}function p(){return i?"top":t?"right":"left"}function m(){return i?"bottom":t?"left":"right"}function g(v){return v*o}return{scroll:r,cross:l,startEdge:c,endEdge:f,measureSize:d,direction:g}}function Ul(n=0,e=0){const t=St(n-e);function i(d){return d<n}function r(d){return d>e}function l(d){return i(d)||r(d)}function o(d){return l(d)?i(d)?n:e:d}function c(d){return t?d-t*Math.ceil((d-e)/t):d}return{length:t,max:e,min:n,constrain:o,reachedAny:l,reachedMax:r,reachedMin:i,removeOffset:c}}function fR(n,e,t){const{constrain:i}=Ul(0,n),r=n+1;let l=o(e);function o(g){return t?St((r+g)%r):i(g)}function c(){return l}function f(g){return l=o(g),m}function d(g){return p().set(c()+g)}function p(){return fR(n,c(),t)}const m={get:c,set:f,add:d,clone:p};return m}function X9(n,e,t,i,r,l,o,c,f,d,p,m,g,b,v,S,x,w,P){const{cross:A,direction:M}=n,R=["INPUT","SELECT","TEXTAREA"],Z={passive:!1},_=Xu(),z=Xu(),V=Ul(50,225).constrain(b.measure(20)),se={mouse:300,touch:400},K={mouse:500,touch:600},te=v?43:25;let fe=!1,ge=0,oe=0,X=!1,H=!1,W=!1,he=!1;function D(pe){if(!P)return;function Ge(Vt){(wp(P)||P(pe,Vt))&&ce(Vt)}const et=e;_.add(et,"dragstart",Vt=>Vt.preventDefault(),Z).add(et,"touchmove",()=>{},Z).add(et,"touchend",()=>{}).add(et,"touchstart",Ge).add(et,"mousedown",Ge).add(et,"touchcancel",Te).add(et,"contextmenu",Te).add(et,"click",Fe,!0)}function Y(){_.clear(),z.clear()}function ie(){const pe=he?t:e;z.add(pe,"touchmove",ke,Z).add(pe,"touchend",Te).add(pe,"mousemove",ke,Z).add(pe,"mouseup",Te)}function I(pe){const Ge=pe.nodeName||"";return R.includes(Ge)}function le(){return(v?K:se)[he?"mouse":"touch"]}function we(pe,Ge){const et=m.add(Qb(pe)*-1),Vt=p.byDistance(pe,!v).distance;return v||St(pe)<V?Vt:x&&Ge?Vt*.5:p.byIndex(et.get(),0).distance}function ce(pe){const Ge=ly(pe,i);he=Ge,W=v&&Ge&&!pe.buttons&&fe,fe=du(r.get(),o.get())>=2,!(Ge&&pe.button!==0)&&(I(pe.target)||(X=!0,l.pointerDown(pe),d.useFriction(0).useDuration(0),r.set(o),ie(),ge=l.readPoint(pe),oe=l.readPoint(pe,A),g.emit("pointerDown")))}function ke(pe){if(!ly(pe,i)&&pe.touches.length>=2)return Te(pe);const et=l.readPoint(pe),Vt=l.readPoint(pe,A),vn=du(et,ge),ut=du(Vt,oe);if(!H&&!he&&(!pe.cancelable||(H=vn>ut,!H)))return Te(pe);const si=l.pointerMove(pe);vn>S&&(W=!0),d.useFriction(.3).useDuration(.75),c.start(),r.add(M(si)),pe.preventDefault()}function Te(pe){const et=p.byDistance(0,!1).index!==m.get(),Vt=l.pointerUp(pe)*le(),vn=we(M(Vt),et),ut=M9(Vt,vn),si=te-10*ut,At=w+ut/50;H=!1,X=!1,z.clear(),d.useDuration(si).useFriction(At),f.distance(vn,!v),he=!1,g.emit("pointerUp")}function Fe(pe){W&&(pe.stopPropagation(),pe.preventDefault(),W=!1)}function rt(){return X}return{init:D,destroy:Y,pointerDown:rt}}function N9(n,e){let i,r;function l(m){return m.timeStamp}function o(m,g){const v=`client${(g||n.scroll)==="x"?"X":"Y"}`;return(ly(m,e)?m:m.touches[0])[v]}function c(m){return i=m,r=m,o(m)}function f(m){const g=o(m)-o(r),b=l(m)-l(i)>170;return r=m,b&&(i=m),g}function d(m){if(!i||!r)return 0;const g=o(r)-o(i),b=l(m)-l(i),v=l(m)-l(r)>170,S=g/b;return b&&!v&&St(S)>.1?S:0}return{pointerDown:c,pointerMove:f,pointerUp:d,readPoint:o}}function z9(){function n(t){const{offsetTop:i,offsetLeft:r,offsetWidth:l,offsetHeight:o}=t;return{top:i,right:r+l,bottom:i+o,left:r,width:l,height:o}}return{measure:n}}function q9(n){function e(i){return n*(i/100)}return{measure:e}}function j9(n,e,t,i,r,l,o){const c=[n].concat(i);let f,d,p=[],m=!1;function g(x){return r.measureSize(o.measure(x))}function b(x){if(!l)return;d=g(n),p=i.map(g);function w(P){for(const A of P){if(m)return;const M=A.target===n,R=i.indexOf(A.target),Z=M?d:p[R],_=g(M?n:i[R]);if(St(_-Z)>=.5){x.reInit(),e.emit("resize");break}}}f=new ResizeObserver(P=>{(wp(l)||l(x,P))&&w(P)}),t.requestAnimationFrame(()=>{c.forEach(P=>f.observe(P))})}function v(){m=!0,f&&f.disconnect()}return{init:b,destroy:v}}function L9(n,e,t,i,r,l){let o=0,c=0,f=r,d=l,p=n.get(),m=0;function g(){const Z=i.get()-n.get(),_=!f;let z=0;return _?(o=0,t.set(i),n.set(i),z=Z):(t.set(n),o+=Z/f,o*=d,p+=o,n.add(o),z=p-m),c=Qb(z),m=p,R}function b(){const Z=i.get()-e.get();return St(Z)<.001}function v(){return f}function S(){return c}function x(){return o}function w(){return A(r)}function P(){return M(l)}function A(Z){return f=Z,R}function M(Z){return d=Z,R}const R={direction:S,duration:v,velocity:x,seek:g,settled:b,useBaseFriction:P,useBaseDuration:w,useFriction:M,useDuration:A};return R}function B9(n,e,t,i,r){const l=r.measure(10),o=r.measure(50),c=Ul(.1,.99);let f=!1;function d(){return!(f||!n.reachedAny(t.get())||!n.reachedAny(e.get()))}function p(b){if(!d())return;const v=n.reachedMin(e.get())?"min":"max",S=St(n[v]-e.get()),x=t.get()-e.get(),w=c.constrain(S/o);t.subtract(x*w),!b&&St(x)<l&&(t.set(n.constrain(t.get())),i.useDuration(25).useBaseFriction())}function m(b){f=!b}return{shouldConstrain:d,constrain:p,toggleActive:m}}function V9(n,e,t,i,r){const l=Ul(-e+n,0),o=m(),c=p(),f=g();function d(v,S){return du(v,S)<=1}function p(){const v=o[0],S=ji(o),x=o.lastIndexOf(v),w=o.indexOf(S)+1;return Ul(x,w)}function m(){return t.map((v,S)=>{const{min:x,max:w}=l,P=l.constrain(v),A=!S,M=kb(t,S);return A?w:M||d(x,P)?x:d(w,P)?w:P}).map(v=>parseFloat(v.toFixed(3)))}function g(){if(e<=n+r)return[l.max];if(i==="keepSnaps")return o;const{min:v,max:S}=c;return o.slice(v,S)}return{snapsContained:f,scrollContainLimit:c}}function Y9(n,e,t){const i=e[0],r=t?i-n:ji(e);return{limit:Ul(r,i)}}function U9(n,e,t,i){const l=e.min+.1,o=e.max+.1,{reachedMin:c,reachedMax:f}=Ul(l,o);function d(g){return g===1?f(t.get()):g===-1?c(t.get()):!1}function p(g){if(!d(g))return;const b=n*(g*-1);i.forEach(v=>v.add(b))}return{loop:p}}function G9(n){const{max:e,length:t}=n;function i(l){const o=l-e;return t?o/-t:0}return{get:i}}function W9(n,e,t,i,r){const{startEdge:l,endEdge:o}=n,{groupSlides:c}=r,f=m().map(e.measure),d=g(),p=b();function m(){return c(i).map(S=>ji(S)[o]-S[0][l]).map(St)}function g(){return i.map(S=>t[l]-S[l]).map(S=>-St(S))}function b(){return c(d).map(S=>S[0]).map((S,x)=>S+f[x])}return{snaps:d,snapsAligned:p}}function H9(n,e,t,i,r,l){const{groupSlides:o}=r,{min:c,max:f}=i,d=p();function p(){const g=o(l),b=!n||e==="keepSnaps";return t.length===1?[l]:b?g:g.slice(c,f).map((v,S,x)=>{const w=!S,P=kb(x,S);if(w){const A=ji(x[0])+1;return Kk(A)}if(P){const A=ff(l)-ji(x)[0]+1;return Kk(A,ji(x)[0])}return v})}return{slideRegistry:d}}function I9(n,e,t,i,r){const{reachedAny:l,removeOffset:o,constrain:c}=i;function f(v){return v.concat().sort((S,x)=>St(S)-St(x))[0]}function d(v){const S=n?o(v):c(v),x=e.map((P,A)=>({diff:p(P-S,0),index:A})).sort((P,A)=>St(P.diff)-St(A.diff)),{index:w}=x[0];return{index:w,distance:S}}function p(v,S){const x=[v,v+t,v-t];if(!n)return v;if(!S)return f(x);const w=x.filter(P=>Qb(P)===S);return w.length?f(w):ji(x)-t}function m(v,S){const x=e[v]-r.get(),w=p(x,S);return{index:v,distance:w}}function g(v,S){const x=r.get()+v,{index:w,distance:P}=d(x),A=!n&&l(x);if(!S||A)return{index:w,distance:v};const M=e[w]-P,R=v+p(M,0);return{index:w,distance:R}}return{byDistance:g,byIndex:m,shortcut:p}}function F9(n,e,t,i,r,l,o){function c(m){const g=m.distance,b=m.index!==e.get();l.add(g),g&&(i.duration()?n.start():(n.update(),n.render(1),n.update())),b&&(t.set(e.get()),e.set(m.index),o.emit("select"))}function f(m,g){const b=r.byDistance(m,g);c(b)}function d(m,g){const b=e.clone().set(m),v=r.byIndex(b.get(),g);c(v)}return{distance:f,index:d}}function K9(n,e,t,i,r,l,o,c){const f={passive:!0,capture:!0};let d=0;function p(b){if(!c)return;function v(S){if(new Date().getTime()-d>10)return;o.emit("slideFocusStart"),n.scrollLeft=0;const P=t.findIndex(A=>A.includes(S));wb(P)&&(r.useDuration(0),i.index(P,0),o.emit("slideFocus"))}l.add(document,"keydown",m,!1),e.forEach((S,x)=>{l.add(S,"focus",w=>{(wp(c)||c(b,w))&&v(x)},f)})}function m(b){b.code==="Tab"&&(d=new Date().getTime())}return{init:p}}function su(n){let e=n;function t(){return e}function i(f){e=o(f)}function r(f){e+=o(f)}function l(f){e-=o(f)}function o(f){return wb(f)?f:f.get()}return{get:t,set:i,add:r,subtract:l}}function hR(n,e){const t=n.scroll==="x"?o:c,i=e.style;let r=null,l=!1;function o(g){return`translate3d(${g}px,0px,0px)`}function c(g){return`translate3d(0px,${g}px,0px)`}function f(g){if(l)return;const b=E9(n.direction(g));b!==r&&(i.transform=t(b),r=b)}function d(g){l=!g}function p(){l||(i.transform="",e.getAttribute("style")||e.removeAttribute("style"))}return{clear:p,to:f,toggleActive:d}}function J9(n,e,t,i,r,l,o,c,f){const p=Zu(r),m=Zu(r).reverse(),g=w().concat(P());function b(_,z){return _.reduce((V,se)=>V-r[se],z)}function v(_,z){return _.reduce((V,se)=>b(V,z)>0?V.concat([se]):V,[])}function S(_){return l.map((z,V)=>({start:z-i[V]+.5+_,end:z+e-.5+_}))}function x(_,z,V){const se=S(z);return _.map(K=>{const te=V?0:-t,fe=V?t:0,ge=V?"end":"start",oe=se[K][ge];return{index:K,loopPoint:oe,slideLocation:su(-1),translate:hR(n,f[K]),target:()=>c.get()>oe?te:fe}})}function w(){const _=o[0],z=v(m,_);return x(z,t,!1)}function P(){const _=e-o[0]-1,z=v(p,_);return x(z,-t,!0)}function A(){return g.every(({index:_})=>{const z=p.filter(V=>V!==_);return b(z,e)<=.1})}function M(){g.forEach(_=>{const{target:z,translate:V,slideLocation:se}=_,K=z();K!==se.get()&&(V.to(K),se.set(K))})}function R(){g.forEach(_=>_.translate.clear())}return{canLoop:A,clear:R,loop:M,loopPoints:g}}function eY(n,e,t){let i,r=!1;function l(f){if(!t)return;function d(p){for(const m of p)if(m.type==="childList"){f.reInit(),e.emit("slidesChanged");break}}i=new MutationObserver(p=>{r||(wp(t)||t(f,p))&&d(p)}),i.observe(n,{childList:!0})}function o(){i&&i.disconnect(),r=!0}return{init:l,destroy:o}}function tY(n,e,t,i){const r={};let l=null,o=null,c,f=!1;function d(){c=new IntersectionObserver(v=>{f||(v.forEach(S=>{const x=e.indexOf(S.target);r[x]=S}),l=null,o=null,t.emit("slidesInView"))},{root:n.parentElement,threshold:i}),e.forEach(v=>c.observe(v))}function p(){c&&c.disconnect(),f=!0}function m(v){return _u(r).reduce((S,x)=>{const w=parseInt(x),{isIntersecting:P}=r[w];return(v&&P||!v&&!P)&&S.push(w),S},[])}function g(v=!0){if(v&&l)return l;if(!v&&o)return o;const S=m(v);return v&&(l=S),v||(o=S),S}return{init:d,destroy:p,get:g}}function nY(n,e,t,i,r,l){const{measureSize:o,startEdge:c,endEdge:f}=n,d=t[0]&&r,p=v(),m=S(),g=t.map(o),b=x();function v(){if(!d)return 0;const P=t[0];return St(e[c]-P[c])}function S(){if(!d)return 0;const P=l.getComputedStyle(ji(i));return parseFloat(P.getPropertyValue(`margin-${f}`))}function x(){return t.map((P,A,M)=>{const R=!A,Z=kb(M,A);return R?g[A]+p:Z?g[A]+m:M[A+1][c]-P[c]}).map(St)}return{slideSizes:g,slideSizesWithGaps:b,startGap:p,endGap:m}}function iY(n,e,t,i,r,l,o,c,f){const{startEdge:d,endEdge:p,direction:m}=n,g=wb(t);function b(w,P){return Zu(w).filter(A=>A%P===0).map(A=>w.slice(A,A+P))}function v(w){return w.length?Zu(w).reduce((P,A,M)=>{const R=ji(P)||0,Z=R===0,_=A===ff(w),z=r[d]-l[R][d],V=r[d]-l[A][p],se=!i&&Z?m(o):0,K=!i&&_?m(c):0,te=St(V-K-(z+se));return M&&te>e+f&&P.push(A),_&&P.push(w.length),P},[]).map((P,A,M)=>{const R=Math.max(M[A-1]||0);return w.slice(R,P)}):[]}function S(w){return g?b(w,t):v(w)}return{groupSlides:S}}function rY(n,e,t,i,r,l,o){const{align:c,axis:f,direction:d,startIndex:p,loop:m,duration:g,dragFree:b,dragThreshold:v,inViewThreshold:S,slidesToScroll:x,skipSnaps:w,containScroll:P,watchResize:A,watchSlides:M,watchDrag:R,watchFocus:Z}=l,_=2,z=z9(),V=z.measure(e),se=t.map(z.measure),K=_9(f,d),te=K.measureSize(V),fe=q9(te),ge=D9(c,te),oe=!m&&!!P,X=m||!!P,{slideSizes:H,slideSizesWithGaps:W,startGap:he,endGap:D}=nY(K,V,se,t,X,r),Y=iY(K,te,x,m,V,se,he,D,_),{snaps:ie,snapsAligned:I}=W9(K,ge,V,se,Y),le=-ji(ie)+ji(W),{snapsContained:we,scrollContainLimit:ce}=V9(te,le,I,P,_),ke=oe?we:I,{limit:Te}=Y9(le,ke,m),Fe=fR(ff(ke),p,m),rt=Fe.clone(),Be=Zu(t),pe=({dragHandler:Sn,scrollBody:ns,scrollBounds:ci,options:{loop:Mi}})=>{Mi||ci.constrain(Sn.pointerDown()),ns.seek()},Ge=({scrollBody:Sn,translate:ns,location:ci,offsetLocation:Mi,previousLocation:is,scrollLooper:ui,slideLooper:kr,dragHandler:Cr,animation:Ks,eventHandler:An,scrollBounds:Il,options:{loop:rs}},Ei)=>{const Js=Sn.settled(),Me=!Il.shouldConstrain(),Ot=rs?Js:Js&&Me,bt=Ot&&!Cr.pointerDown();bt&&Ks.stop();const Ut=ci.get()*Ei+is.get()*(1-Ei);Mi.set(Ut),rs&&(ui.loop(Sn.direction()),kr.loop()),ns.to(Mi.get()),bt&&An.emit("settle"),Ot||An.emit("scroll")},et=Z9(i,r,()=>pe($t),Sn=>Ge($t,Sn)),Vt=.68,vn=ke[Fe.get()],ut=su(vn),si=su(vn),At=su(vn),li=su(vn),ai=L9(ut,At,si,li,g,Vt),Yt=I9(m,ke,le,Te,li),Vn=F9(et,Fe,rt,ai,Yt,li,o),Wl=G9(Te),Hl=Xu(),oi=tY(e,t,o,S),{slideRegistry:Ft}=H9(oe,P,ke,ce,Y,Be),Yn=K9(n,t,Ft,Vn,ai,Hl,o,Z),$t={ownerDocument:i,ownerWindow:r,eventHandler:o,containerRect:V,slideRects:se,animation:et,axis:K,dragHandler:X9(K,n,i,r,li,N9(K,r),ut,et,Vn,ai,Yt,Fe,o,fe,b,v,w,Vt,R),eventStore:Hl,percentOfView:fe,index:Fe,indexPrevious:rt,limit:Te,location:ut,offsetLocation:At,previousLocation:si,options:l,resizeHandler:j9(e,o,r,t,K,A,z),scrollBody:ai,scrollBounds:B9(Te,At,li,ai,fe),scrollLooper:U9(le,Te,At,[ut,At,si,li]),scrollProgress:Wl,scrollSnapList:ke.map(Wl.get),scrollSnaps:ke,scrollTarget:Yt,scrollTo:Vn,slideLooper:J9(K,te,le,H,W,ie,ke,At,t),slideFocus:Yn,slidesHandler:eY(e,o,M),slidesInView:oi,slideIndexes:Be,slideRegistry:Ft,slidesToScroll:Y,target:li,translate:hR(K,e)};return $t}function sY(){let n={},e;function t(d){e=d}function i(d){return n[d]||[]}function r(d){return i(d).forEach(p=>p(e,d)),f}function l(d,p){return n[d]=i(d).concat([p]),f}function o(d,p){return n[d]=i(d).filter(m=>m!==p),f}function c(){n={}}const f={init:t,emit:r,off:o,on:l,clear:c};return f}const lY={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function aY(n){function e(l,o){return uR(l,o||{})}function t(l){const o=l.breakpoints||{},c=_u(o).filter(f=>n.matchMedia(f).matches).map(f=>o[f]).reduce((f,d)=>e(f,d),{});return e(l,c)}function i(l){return l.map(o=>_u(o.breakpoints||{})).reduce((o,c)=>o.concat(c),[]).map(n.matchMedia)}return{mergeOptions:e,optionsAtMedia:t,optionsMediaQueries:i}}function oY(n){let e=[];function t(l,o){return e=o.filter(({options:c})=>n.optionsAtMedia(c).active!==!1),e.forEach(c=>c.init(l,n)),o.reduce((c,f)=>Object.assign(c,{[f.name]:f}),{})}function i(){e=e.filter(l=>l.destroy())}return{init:t,destroy:i}}function rp(n,e,t){const i=n.ownerDocument,r=i.defaultView,l=aY(r),o=oY(l),c=Xu(),f=sY(),{mergeOptions:d,optionsAtMedia:p,optionsMediaQueries:m}=l,{on:g,off:b,emit:v}=f,S=K;let x=!1,w,P=d(lY,rp.globalOptions),A=d(P),M=[],R,Z,_;function z(){const{container:Be,slides:pe}=A;Z=(sy(Be)?n.querySelector(Be):Be)||n.children[0];const et=sy(pe)?Z.querySelectorAll(pe):pe;_=[].slice.call(et||Z.children)}function V(Be){const pe=rY(n,Z,_,i,r,Be,f);if(Be.loop&&!pe.slideLooper.canLoop()){const Ge=Object.assign({},Be,{loop:!1});return V(Ge)}return pe}function se(Be,pe){x||(P=d(P,Be),A=p(P),M=pe||M,z(),w=V(A),m([P,...M.map(({options:Ge})=>Ge)]).forEach(Ge=>c.add(Ge,"change",K)),A.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(rt),w.eventHandler.init(rt),w.resizeHandler.init(rt),w.slidesHandler.init(rt),w.options.loop&&w.slideLooper.loop(),Z.offsetParent&&_.length&&w.dragHandler.init(rt),R=o.init(rt,M)))}function K(Be,pe){const Ge=Y();te(),se(d({startIndex:Ge},Be),pe),f.emit("reInit")}function te(){w.dragHandler.destroy(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),w.slidesInView.destroy(),w.animation.destroy(),o.destroy(),c.clear()}function fe(){x||(x=!0,c.clear(),te(),f.emit("destroy"),f.clear())}function ge(Be,pe,Ge){!A.active||x||(w.scrollBody.useBaseFriction().useDuration(pe===!0?0:A.duration),w.scrollTo.index(Be,Ge||0))}function oe(Be){const pe=w.index.add(1).get();ge(pe,Be,-1)}function X(Be){const pe=w.index.add(-1).get();ge(pe,Be,1)}function H(){return w.index.add(1).get()!==Y()}function W(){return w.index.add(-1).get()!==Y()}function he(){return w.scrollSnapList}function D(){return w.scrollProgress.get(w.offsetLocation.get())}function Y(){return w.index.get()}function ie(){return w.indexPrevious.get()}function I(){return w.slidesInView.get()}function le(){return w.slidesInView.get(!1)}function we(){return R}function ce(){return w}function ke(){return n}function Te(){return Z}function Fe(){return _}const rt={canScrollNext:H,canScrollPrev:W,containerNode:Te,internalEngine:ce,destroy:fe,off:b,on:g,emit:v,plugins:we,previousScrollSnap:ie,reInit:S,rootNode:ke,scrollNext:oe,scrollPrev:X,scrollProgress:D,scrollSnapList:he,scrollTo:ge,selectedScrollSnap:Y,slideNodes:Fe,slidesInView:I,slidesNotInView:le};return se(e,t),setTimeout(()=>f.emit("init"),0),rt}rp.globalOptions=void 0;function Cb(n={},e=[]){const t=$.useRef(n),i=$.useRef(e),[r,l]=$.useState(),[o,c]=$.useState(),f=$.useCallback(()=>{r&&r.reInit(t.current,i.current)},[r]);return $.useEffect(()=>{xb(t.current,n)||(t.current=n,f())},[n,f]),$.useEffect(()=>{R9(i.current,e)||(i.current=e,f())},[e,f]),$.useEffect(()=>{if($9()&&o){rp.globalOptions=Cb.globalOptions;const d=rp(o,t.current,i.current);return l(d),()=>d.destroy()}else l(void 0)},[o,l]),[c,r]}Cb.globalOptions=void 0;const cY=rf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Or({className:n,variant:e,size:t,asChild:i=!1,...r}){const l=i?P7:"button";return C.jsx(l,{"data-slot":"button",className:_t(cY({variant:e,size:t,className:n})),...r})}const dR=$.createContext(null);function pR(){const n=$.useContext(dR);if(!n)throw new Error("useCarousel must be used within a <Carousel />");return n}function uY({orientation:n="horizontal",opts:e,setApi:t,plugins:i,className:r,children:l,...o}){const[c,f]=Cb({...e,axis:n==="horizontal"?"x":"y"},i),[d,p]=$.useState(!1),[m,g]=$.useState(!1),b=$.useCallback(w=>{w&&(p(w.canScrollPrev()),g(w.canScrollNext()))},[]),v=$.useCallback(()=>{f==null||f.scrollPrev()},[f]),S=$.useCallback(()=>{f==null||f.scrollNext()},[f]),x=$.useCallback(w=>{w.key==="ArrowLeft"?(w.preventDefault(),v()):w.key==="ArrowRight"&&(w.preventDefault(),S())},[v,S]);return $.useEffect(()=>{!f||!t||t(f)},[f,t]),$.useEffect(()=>{if(f)return b(f),f.on("reInit",b),f.on("select",b),()=>{f==null||f.off("select",b)}},[f,b]),C.jsx(dR.Provider,{value:{carouselRef:c,api:f,opts:e,orientation:n||((e==null?void 0:e.axis)==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:S,canScrollPrev:d,canScrollNext:m},children:C.jsx("div",{onKeyDownCapture:x,className:_t("relative",r),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...o,children:l})})}function fY({className:n,...e}){const{carouselRef:t,orientation:i}=pR();return C.jsx("div",{ref:t,className:"overflow-hidden","data-slot":"carousel-content",children:C.jsx("div",{className:_t("flex",i==="horizontal"?"-ml-4":"-mt-4 flex-col",n),...e})})}function hY({className:n,...e}){const{orientation:t}=pR();return C.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:_t("min-w-0 shrink-0 grow-0 basis-full",t==="horizontal"?"pl-4":"pt-4",n),...e})}function mR({onImport:n}){const e=mb();return e?C.jsx("div",{children:C.jsx(uY,{children:C.jsx(fY,{children:e.starters.map(t=>C.jsx(hY,{className:"basis-1/3",children:C.jsxs("div",{className:"p-2 flex flex-col items-center hover:cursor-pointer hover:bg-gray-700/50 hover:text-white rounded-lg",onClick:()=>{n(t.url)},children:[C.jsx("img",{src:t.banner,alt:t.name,className:"w-100 max-w-full"}),C.jsx("div",{className:"text-md font-bold",children:t.name})]})},t.url))})})}):null}function dY(){var c;const n=Qr(),e=mb(),{open:t,setOpen:i,dontShowAgain:r,setDontShowAgain:l}=kB();if(n!=="setup"||!e||((c=e==null?void 0:e.starters)==null?void 0:c.length)===0)return null;async function o(f){const d=await R$(f);"error"in d?yb.error("Failed to load starter",{description:d.error}):(ty(d),i(!1))}return C.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:[C.jsx(of,{children:C.jsx(uf,{className:"text-center text-2xl font-bold",children:"Would you like to use a starter project?"})}),C.jsx("div",{children:C.jsx(mR,{onImport:o})}),C.jsxs(cf,{className:"flex sm:justify-between w-full",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(Ir,{id:"show-startup-dialog",checked:r,onCheckedChange:l}),C.jsx(Hr,{htmlFor:"show-startup-dialog",children:"Don't show this again"})]}),C.jsx(Or,{onClick:()=>i(!1),children:"No, I want to start from scratch"})]})]})})}var pY=(n,e,t,i,r,l,o,c)=>{let f=document.documentElement,d=["light","dark"];function p(b){(Array.isArray(n)?n:[n]).forEach(v=>{let S=v==="class",x=S&&l?r.map(w=>l[w]||w):r;S?(f.classList.remove(...x),f.classList.add(l&&l[b]?l[b]:b)):f.setAttribute(v,b)}),m(b)}function m(b){c&&d.includes(b)&&(f.style.colorScheme=b)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)p(i);else try{let b=localStorage.getItem(e)||t,v=o&&b==="system"?g():b;p(v)}catch{}},mY=$.createContext(void 0),OY={setTheme:n=>{},themes:[]},gY=()=>{var n;return(n=$.useContext(mY))!=null?n:OY};$.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:i,enableColorScheme:r,defaultTheme:l,value:o,themes:c,nonce:f,scriptProps:d})=>{let p=JSON.stringify([t,e,l,n,c,o,i,r]).slice(1,-1);return $.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${pY.toString()})(${p})`}})});const yY=({...n})=>{const{theme:e="system"}=gY();return C.jsx(lV,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n})};function Tb({className:n,type:e,...t}){return C.jsx("input",{type:e,"data-slot":"input",className:_t("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...t})}function bY(){const[n,e]=$.useState(""),[t,i]=$.useState(!1),r=af(),{toggleAddOn:l}=lf();async function o(){const c=await cB(n);"error"in c?yb.error("Failed to load add-on",{description:c.error}):(bB(c),c.modes.includes(r)&&l(c.id),i(!1))}return C.jsxs("div",{children:[C.jsxs(Or,{variant:"secondary",className:"w-full",onClick:()=>{e(""),i(!0)},children:[C.jsx(iD,{className:"w-4 h-4"}),"Import Custom Add-On"]}),C.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:[C.jsx(of,{children:C.jsx(uf,{children:"Import Custom Add-On"})}),C.jsx("div",{children:C.jsx(Tb,{value:n,onChange:c=>e(c.target.value),placeholder:"https://github.com/myorg/myproject/add-on.json",className:"min-w-lg w-full",onKeyDown:c=>{c.key==="Enter"&&o()}})}),C.jsx(cf,{children:C.jsx(Or,{onClick:o,children:"Import"})})]})})]})}function vY({addOn:n,onClose:e}){return C.jsx(jo,{modal:!0,open:!!n,onOpenChange:e,children:C.jsx(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:C.jsxs("div",{className:"flex flex-row",children:[(n==null?void 0:n.smallLogo)&&C.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(n.smallLogo)}`,alt:n.name,className:"w-15"}),C.jsxs("div",{className:"flex flex-col ml-4 gap-4",children:[C.jsx("p",{className:"text-lg font-bold",children:n==null?void 0:n.name}),C.jsx("p",{className:"text-sm text-gray-500",children:n==null?void 0:n.description}),C.jsxs("a",{href:n==null?void 0:n.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-500 underline",children:["More information on ",n==null?void 0:n.name]})]})]})})})}const Jk={toolchain:"Toolchain","add-on":"Add-on",example:"Example"};function SY(){const{availableAddOns:n,addOnState:e,toggleAddOn:t}=lf(),i=$.useMemo(()=>n.sort((o,c)=>o.name.localeCompare(c.name)),[n]),[r,l]=$.useState();return C.jsxs(C.Fragment,{children:[C.jsx(vY,{addOn:r,onClose:()=>l(void 0)}),Object.keys(Jk).map(o=>C.jsx($.Fragment,{children:i.filter(c=>c.type===o).length>0&&C.jsxs("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active",children:[C.jsx("h3",{className:"font-medium",children:Jk[o]}),C.jsx("div",{className:"flex flex-row flex-wrap",children:i.filter(c=>c.type===o).map(c=>C.jsx("div",{className:"w-1/2 flex flex-row justify-between pr-4",children:C.jsxs("div",{className:"p-1 flex flex-row items-center",children:[C.jsx(Ir,{id:c.id,checked:e[c.id].selected,disabled:!e[c.id].enabled,onCheckedChange:()=>{t(c.id)}}),C.jsxs(Hr,{htmlFor:c.id,className:"pl-2 font-semibold text-gray-300",children:[c.smallLogo&&C.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(c.smallLogo)}`,alt:c.name,className:"w-5"}),c.name]}),C.jsx(A2,{className:"ml-2 w-4 text-gray-600",onClick:()=>l(c)})]})},c.id))})]},`${o}-add-ons`)},o)),C.jsx("div",{className:"mt-4",children:C.jsx(bY,{})})]})}const xY={file:J5,command:tD,"package-manager":F5,info:A2,other:H5};function OR(){const[n,e]=$.useState([]),[t,i]=$.useState(!1),r=$.useCallback(async l=>{var d;i(!1);const o=(d=l.body)==null?void 0:d.getReader(),c=new TextDecoder;let f="";for(;;){const p=await(o==null?void 0:o.read());if(p!=null&&p.done)break;f+=c.decode(p==null?void 0:p.value);let m;const g=[];for(const b of f.split(`
212
+ `))if(b.startsWith("{")&&b.endsWith("}")){const v=JSON.parse(b);v.msgType==="start"?m===v.id?g[g.length-1].message=v.message:(m=v.id,g.push({id:m,icon:xY[v.type],message:v.message})):(g.length>0&&(g[g.length-1].message=v.message),m=void 0)}e(g)}return i(!0),f},[]);return{finished:t,streamItems:n,monitorStream:r}}function gR({streamItems:n,finished:e}){return C.jsx("div",{className:"flex flex-col gap-2",children:n.map((t,i)=>C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(t.icon,{className:`w-4 h-4 ${i===n.length-1&&!e?"text-green-500 animate-spin":""}`}),t.message]},t.id))})}function wY(){const{chosenAddOns:n}=lf(),[e,t]=$.useState(!1),{streamItems:i,monitorStream:r,finished:l}=OR();if(Qr()!=="add")return null;async function c(){t(!0),r(await oB(n))}return C.jsxs("div",{children:[C.jsx(jo,{open:e,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",hideCloseButton:!0,children:[C.jsx(of,{children:C.jsx(uf,{children:"Adding Add-Ons"})}),C.jsx(gR,{streamItems:i,finished:l}),C.jsx(cf,{children:C.jsx(Or,{variant:"default",onClick:async()=>{await $$(),window.close()},disabled:!l,children:"Exit This Application"})})]})}),C.jsx("div",{className:"flex flex-col gap-2",children:C.jsx(Or,{variant:"default",onClick:c,disabled:n.length===0||e,className:"w-full",children:"Add These Add-Ons To Your App"})})]})}function QY(){const[n,e]=$.useState(!1),{streamItems:t,monitorStream:i,finished:r}=OR(),l=Qr(),o=ri(),{chosenAddOns:c}=lf(),{projectStarter:f}=qo();if(l!=="setup")return null;async function d(){e(!0),i(await aB(o,c,f))}return C.jsxs("div",{children:[C.jsx(jo,{open:n,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",hideCloseButton:!0,children:[C.jsx(of,{children:C.jsx(uf,{children:"Creating Your Application"})}),C.jsx(gR,{streamItems:t,finished:r}),C.jsx(cf,{children:C.jsx(Or,{variant:"default",onClick:async()=>{await $$(),window.close()},disabled:!r,children:"Exit This Application"})})]})}),C.jsx("div",{className:"flex flex-col gap-2",children:C.jsxs(Or,{variant:"default",onClick:d,disabled:n,className:"w-full",children:[C.jsx(U5,{className:"w-4 h-4"}),"Build Your App"]})})]})}function kY(){const n=wB();return Qr()!=="setup"?null:C.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[C.jsx("h3",{className:"font-medium whitespace-nowrap",children:"Project Name"}),C.jsx(Tb,{value:n,placeholder:"my-app",onChange:t=>CB(t.target.value),className:"w-full bg-gray-500/10 rounded-md px-2 py-1 min-w-[200px] text-sm"})]})}var Eg="rovingFocusGroup.onEntryFocus",CY={bubbles:!1,cancelable:!0},hf="RovingFocusGroup",[ay,yR,TY]=ZA(hf),[PY,bR]=Gl(hf,[TY]),[AY,$Y]=PY(hf),vR=$.forwardRef((n,e)=>C.jsx(ay.Provider,{scope:n.__scopeRovingFocusGroup,children:C.jsx(ay.Slot,{scope:n.__scopeRovingFocusGroup,children:C.jsx(RY,{...n,ref:e})})}));vR.displayName=hf;var RY=$.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:i,loop:r=!1,dir:l,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=n,g=$.useRef(null),b=Bn(e,g),v=cb(l),[S,x]=ts({prop:o,defaultProp:c??null,onChange:f,caller:hf}),[w,P]=$.useState(!1),A=Ro(d),M=yR(t),R=$.useRef(!1),[Z,_]=$.useState(0);return $.useEffect(()=>{const z=g.current;if(z)return z.addEventListener(Eg,A),()=>z.removeEventListener(Eg,A)},[A]),C.jsx(AY,{scope:t,orientation:i,dir:v,loop:r,currentTabStopId:S,onItemFocus:$.useCallback(z=>x(z),[x]),onItemShiftTab:$.useCallback(()=>P(!0),[]),onFocusableItemAdd:$.useCallback(()=>_(z=>z+1),[]),onFocusableItemRemove:$.useCallback(()=>_(z=>z-1),[]),children:C.jsx(Pt.div,{tabIndex:w||Z===0?-1:0,"data-orientation":i,...m,ref:b,style:{outline:"none",...n.style},onMouseDown:sn(n.onMouseDown,()=>{R.current=!0}),onFocus:sn(n.onFocus,z=>{const V=!R.current;if(z.target===z.currentTarget&&V&&!w){const se=new CustomEvent(Eg,CY);if(z.currentTarget.dispatchEvent(se),!se.defaultPrevented){const K=M().filter(X=>X.focusable),te=K.find(X=>X.active),fe=K.find(X=>X.id===S),oe=[te,fe,...K].filter(Boolean).map(X=>X.ref.current);wR(oe,p)}}R.current=!1}),onBlur:sn(n.onBlur,()=>P(!1))})})}),SR="RovingFocusGroupItem",xR=$.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:i=!0,active:r=!1,tabStopId:l,children:o,...c}=n,f=no(),d=l||f,p=$Y(SR,t),m=p.currentTabStopId===d,g=yR(t),{onFocusableItemAdd:b,onFocusableItemRemove:v,currentTabStopId:S}=p;return $.useEffect(()=>{if(i)return b(),()=>v()},[i,b,v]),C.jsx(ay.ItemSlot,{scope:t,id:d,focusable:i,active:r,children:C.jsx(Pt.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:sn(n.onMouseDown,x=>{i?p.onItemFocus(d):x.preventDefault()}),onFocus:sn(n.onFocus,()=>p.onItemFocus(d)),onKeyDown:sn(n.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){p.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=DY(x,p.orientation,p.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let A=g().filter(M=>M.focusable).map(M=>M.ref.current);if(w==="last")A.reverse();else if(w==="prev"||w==="next"){w==="prev"&&A.reverse();const M=A.indexOf(x.currentTarget);A=p.loop?ZY(A,M+1):A.slice(M+1)}setTimeout(()=>wR(A))}}),children:typeof o=="function"?o({isCurrentTabStop:m,hasTabStop:S!=null}):o})})});xR.displayName=SR;var MY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function EY(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function DY(n,e,t){const i=EY(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return MY[i]}function wR(n,e=!1){const t=document.activeElement;for(const i of n)if(i===t||(i.focus({preventScroll:e}),document.activeElement!==t))return}function ZY(n,e){return n.map((t,i)=>n[(e+i)%n.length])}var _Y=vR,XY=xR,QR="Toggle",kR=$.forwardRef((n,e)=>{const{pressed:t,defaultPressed:i,onPressedChange:r,...l}=n,[o,c]=ts({prop:t,onChange:r,defaultProp:i??!1,caller:QR});return C.jsx(Pt.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":n.disabled?"":void 0,...l,ref:e,onClick:sn(n.onClick,()=>{n.disabled||c(!o)})})});kR.displayName=QR;var Fs="ToggleGroup",[CR,h8]=Gl(Fs,[bR]),TR=bR(),Pb=F.forwardRef((n,e)=>{const{type:t,...i}=n;if(t==="single"){const r=i;return C.jsx(NY,{...r,ref:e})}if(t==="multiple"){const r=i;return C.jsx(zY,{...r,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Fs}\``)});Pb.displayName=Fs;var[PR,AR]=CR(Fs),NY=F.forwardRef((n,e)=>{const{value:t,defaultValue:i,onValueChange:r=()=>{},...l}=n,[o,c]=ts({prop:t,defaultProp:i??"",onChange:r,caller:Fs});return C.jsx(PR,{scope:n.__scopeToggleGroup,type:"single",value:F.useMemo(()=>o?[o]:[],[o]),onItemActivate:c,onItemDeactivate:F.useCallback(()=>c(""),[c]),children:C.jsx($R,{...l,ref:e})})}),zY=F.forwardRef((n,e)=>{const{value:t,defaultValue:i,onValueChange:r=()=>{},...l}=n,[o,c]=ts({prop:t,defaultProp:i??[],onChange:r,caller:Fs}),f=F.useCallback(p=>c((m=[])=>[...m,p]),[c]),d=F.useCallback(p=>c((m=[])=>m.filter(g=>g!==p)),[c]);return C.jsx(PR,{scope:n.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:f,onItemDeactivate:d,children:C.jsx($R,{...l,ref:e})})});Pb.displayName=Fs;var[qY,jY]=CR(Fs),$R=F.forwardRef((n,e)=>{const{__scopeToggleGroup:t,disabled:i=!1,rovingFocus:r=!0,orientation:l,dir:o,loop:c=!0,...f}=n,d=TR(t),p=cb(o),m={role:"group",dir:p,...f};return C.jsx(qY,{scope:t,rovingFocus:r,disabled:i,children:r?C.jsx(_Y,{asChild:!0,...d,orientation:l,dir:p,loop:c,children:C.jsx(Pt.div,{...m,ref:e})}):C.jsx(Pt.div,{...m,ref:e})})}),sp="ToggleGroupItem",RR=F.forwardRef((n,e)=>{const t=AR(sp,n.__scopeToggleGroup),i=jY(sp,n.__scopeToggleGroup),r=TR(n.__scopeToggleGroup),l=t.value.includes(n.value),o=i.disabled||n.disabled,c={...n,pressed:l,disabled:o},f=F.useRef(null);return i.rovingFocus?C.jsx(XY,{asChild:!0,...r,focusable:!o,active:l,ref:f,children:C.jsx(e2,{...c,ref:e})}):C.jsx(e2,{...c,ref:e})});RR.displayName=sp;var e2=F.forwardRef((n,e)=>{const{__scopeToggleGroup:t,value:i,...r}=n,l=AR(sp,t),o={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},c=l.type==="single"?o:void 0;return C.jsx(kR,{...c,...r,ref:e,onPressedChange:f=>{f?l.onItemActivate(i):l.onItemDeactivate(i)}})}),LY=Pb,BY=RR;const VY=rf("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),MR=$.createContext({size:"default",variant:"default"});function YY({className:n,variant:e,size:t,children:i,...r}){return C.jsx(LY,{"data-slot":"toggle-group","data-variant":e,"data-size":t,className:_t("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),...r,children:C.jsx(MR.Provider,{value:{variant:e,size:t},children:i})})}function t2({className:n,children:e,variant:t,size:i,...r}){const l=$.useContext(MR);return C.jsx(BY,{"data-slot":"toggle-group-item","data-variant":l.variant||t,"data-size":l.size||i,className:_t(VY({variant:l.variant||t,size:l.size||i}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),...r,children:e})}function UY(){const n=Qr(),e=vB(),t=af();return n!=="setup"?null:C.jsxs("div",{className:"flex flex-col @md:flex-row @md:items-center gap-2 items-start",children:[C.jsx("h3",{className:"font-medium whitespace-nowrap",children:"Router Mode"}),C.jsx("div",{className:"flex flex-row justify-center items-center",children:C.jsxs(YY,{type:"single",value:t,onValueChange:i=>{i&&TB(i)},className:"rounded-md border-2 border-gray-500/10",children:[C.jsxs(t2,{value:"code-router",className:"px-4",disabled:!e,children:[C.jsx(N5,{className:"w-4 h-4"}),"Code Router"]}),C.jsxs(t2,{value:"file-router",className:"px-4",disabled:!e,children:[C.jsx(B5,{className:"w-4 h-4"}),"File Router"]})]})})]})}function GY(){const n=ri(l=>l.typescript),e=ri(l=>l.tailwind),t=Qr(),i=xB(),r=SB();return t!=="setup"?null:C.jsxs("div",{className:"flex",children:[C.jsxs("div",{className:"w-1/2 flex flex-row items-center justify-center",children:[C.jsx(Ir,{id:"typescript-switch",checked:n,onCheckedChange:l=>PB(l),disabled:!r}),C.jsxs(Hr,{htmlFor:"typescript-switch",className:"ml-2",children:[C.jsx("img",{src:"/typescript.svg",className:"w-5"}),"TypeScript"]})]}),C.jsxs("div",{className:"w-1/2 flex flex-row items-center justify-center",children:[C.jsx(Ir,{id:"tailwind-switch",checked:e,onCheckedChange:l=>AB(l),disabled:!i}),C.jsxs(Hr,{htmlFor:"tailwind-switch",className:"ml-2",children:[C.jsx("img",{src:"/tailwind.svg",className:"w-5"}),"Tailwind"]})]})]})}function WY(){const[n,e]=$.useState(""),[t,i]=$.useState(!1),r=Qr(),{projectStarter:l}=qo();if(r!=="setup")return null;async function o(f){const d=await R$(f||n);"error"in d?yb.error("Failed to load starter",{description:d.error}):(ty(d),i(!1))}const c=mb();return C.jsxs(C.Fragment,{children:[(l==null?void 0:l.banner)&&C.jsx("div",{className:"flex justify-center mb-4",children:C.jsx("div",{className:"p-2 bg-gray-300 rounded-lg shadow-xl shadow-gray-800",children:C.jsx("img",{src:l.banner,alt:"Starter Banner",className:"w-40 max-w-full"})})}),(l==null?void 0:l.name)&&C.jsxs("div",{className:"text-md mb-4",children:[C.jsx(Or,{variant:"outline",size:"sm",className:"mr-2",onClick:()=>{ty(void 0)},children:C.jsx(sD,{className:"w-4 h-4"})}),C.jsx("span",{className:"font-bold",children:"Starter: "}),l.name]}),C.jsxs("div",{children:[C.jsxs(Or,{variant:"secondary",className:"w-full",onClick:()=>{e(""),i(!0)},children:[C.jsx(q5,{className:"w-4 h-4"}),"Set Project Starter"]}),C.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:C.jsxs(Lo,{className:"sm:min-w-[425px] sm:max-w-fit",children:[C.jsx(of,{children:C.jsx(uf,{children:"Project Starter URL"})}),(c==null?void 0:c.starters)&&C.jsx("div",{children:C.jsx(mR,{onImport:f=>o(f)})}),C.jsx("div",{children:C.jsx(Tb,{value:n,onChange:f=>e(f.target.value),placeholder:"https://github.com/myorg/myproject/starter.json",className:"min-w-lg w-full",onKeyDown:f=>{f.key==="Enter"&&o()}})}),C.jsx(cf,{children:C.jsx(Or,{onClick:()=>o(),children:"Load"})})]})})]})]})}function HY(){const n=Ob(),e=Qr();return C.jsxs("div",{className:"flex flex-col gap-2",children:[n&&C.jsxs(C.Fragment,{children:[e==="setup"&&C.jsxs("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 space-y-2 rounded-lg",children:[C.jsx("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active @container",children:C.jsx(kY,{})}),C.jsx("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active @container",children:C.jsx(UY,{})}),C.jsx("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active @container",children:C.jsx(GY,{})})]}),C.jsx("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 space-y-2 rounded-lg",children:C.jsx(SY,{})}),e==="setup"&&C.jsx("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 space-y-2 rounded-lg",children:C.jsx(WY,{})})]}),C.jsxs("div",{className:"mt-5",children:[C.jsx(wY,{}),C.jsx(QY,{})]})]})}function IY(){return C.jsxs("div",{className:"bg-white dark:bg-black/50 rounded-lg p-2 sm:p-4 flex items-center gap-2 text-lg sm:text-xl shadow-xl",children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("img",{src:"/logo-color-100w.png",alt:"TanStack Logo",className:"w-[30px] rounded-full overflow-hidden border-2 border-black dark:border-none"}),C.jsx("div",{className:"font-black text-xl uppercase",children:"TanStack"})]}),C.jsx("svg",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"0 0 256 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"})}),C.jsxs("div",{className:"hover:text-blue-500 flex items-center gap-2",children:["Create TanStack App"," ",C.jsx("span",{className:"bg-gradient-to-r from-blue-500 to-cyan-500 text-white text-xs font-bold px-2 py-0.5 rounded",children:"ALPHA"})]})]})}function FY(){const[n,e]=$.useState(!1);return $.useEffect(()=>{e(!0)},[]),n}const KY=()=>{const[n,e]=$.useState(null);return $.useEffect(()=>{const t=window.matchMedia("(prefers-reduced-motion: reduce)");e(t.matches);const i=r=>{e(r.matches)};return t.addEventListener("change",i),()=>{t.removeEventListener("change",i)}},[]),n};function JY(){const n=$.useRef(null),e=KY(),t=FY();return $.useEffect(()=>{if(e!==!1)return;const i=n.current;let r=2e3;const l=1e3*60*2,o=e8(.645,.045,.355,1);if(i){let c=function(){return f([{color:{h:10,s:100,l:50}},{color:{h:40,s:100,l:50}},{color:{h:150,s:100,l:50}},{color:{h:200,s:100,l:50}}]).map(A=>({...A,x:Math.random()*i.width,y:Math.random()*i.height,r:Math.random()*500+700,colorH:A.color.h,colorS:A.color.s,colorL:A.color.l}))},f=function(A){for(let M=A.length-1;M>0;M--){const R=Math.floor(Math.random()*(M+1));[A[M],A[R]]=[A[R],A[M]]}return A},d=function(){const A=document.createElement("canvas");A.width=i.width,A.height=i.height,A.getContext("2d").drawImage(i,0,0),i.width=window.innerWidth,i.height=window.innerHeight,g.drawImage(A,0,0,i.width,i.height)},p=function(){v&&clearTimeout(v),b&&cancelAnimationFrame(b),x=JSON.parse(JSON.stringify(w)),P=c(),S=performance.now(),m()},m=function(){g.clearRect(0,0,i.width,i.height);const M=(performance.now()-S)/r,R=o(M);x.forEach((Z,_)=>{const z=P[_];w[_].x=Wc(Z.x,z.x,R),w[_].y=Wc(Z.y,z.y,R);const V=g.createRadialGradient(w[_].x,w[_].y,0,w[_].x,w[_].y,w[_].r);w[_].colorH=Wc(Z.colorH,z.colorH,R),w[_].colorS=Wc(Z.colorS,z.colorS,R),w[_].colorL=Wc(Z.colorL,z.colorL,R),V.addColorStop(0,`hsla(${w[_].colorH}, ${w[_].colorS}%, ${w[_].colorL}%, 1)`),V.addColorStop(1,`hsla(${w[_].colorH}, ${w[_].colorS}%, ${w[_].colorL}%, 0)`),g.fillStyle=V,g.beginPath(),g.arc(w[_].x,w[_].y,w[_].r,0,Math.PI*2),g.fill()}),M<1?b=requestAnimationFrame(m):v=setTimeout(()=>{r=4e3,p()},l)};const g=i.getContext("2d");let b=null,v=null,S=performance.now(),x=c(),w=x,P=[];return d(),p(),window.addEventListener("resize",d),()=>{b&&cancelAnimationFrame(b),v&&clearTimeout(v),window.removeEventListener("resize",d)}}},[e]),C.jsx("div",{className:p$("fixed inset-0 z-0 opacity-20 pointer-events-none","transition-opacity duration-[2s] ease-linear","[&+*]:relative",t?"opacity-10 dark:opacity-20":"opacity-0"),children:C.jsx("canvas",{ref:n})})}function e8(n,e,t,i){return function(r){const l=3*e,o=3*(i-e)-l;return(((1-l-o)*r+o)*r+l)*r}}function Wc(n,e,t){return n+(e-n)*t}const t8=new p5;function n8(){return $B(),C.jsxs("main",{className:"min-w-[1280px]",children:[C.jsx(JY,{}),C.jsxs("div",{className:"min-h-dvh p-2 sm:p-4 space-y-2 sm:space-y-4 @container",children:[C.jsx(IY,{}),C.jsxs("div",{className:"flex flex-row",children:[C.jsx("div",{className:"w-1/3 @8xl:w-1/4 pr-2",children:C.jsx(HY,{})}),C.jsx("div",{className:"w-2/3 @8xl:w-3/4 pl-2",children:C.jsx(EB,{})})]})]}),C.jsx(dY,{})]})}function i8(){return C.jsxs(b5,{client:t8,children:[C.jsx(n8,{}),C.jsx(yY,{})]})}const n2=document.getElementById("root");n2&&FE.createRoot(n2).render(C.jsx(i8,{}));
213
+ //# sourceMappingURL=index-BktnQA5a.js.map