mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
1 line
27 KiB
JavaScript
1 line
27 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[395],{1186:(e,t,r)=>{r.d(t,{N_:()=>c,Uy:()=>i,_V:()=>d,a8:()=>s,q6:()=>f,rd:()=>u});var n=r(7620),l=r(54568),a=()=>{throw Error("You need to wrap your application inside `FrameworkProvider`.")},o=f("FrameworkContext",{useParams:a,useRouter:a,usePathname:a});function i({Link:e,useRouter:t,useParams:r,usePathname:a,Image:i,children:s}){let u=n.useMemo(()=>({usePathname:a,useRouter:t,Link:e,Image:i,useParams:r}),[e,a,t,r,i]);return(0,l.jsx)(o.Provider,{value:u,children:s})}function s(){return o.use().usePathname()}function u(){return o.use().useRouter()}function d(e){let{Image:t}=o.use();if(!t){let{src:t,alt:r,priority:n,...a}=e;return(0,l.jsx)("img",{alt:r,src:t,fetchPriority:n?"high":"auto",...a})}return(0,l.jsx)(t,{...e})}function c(e){let{Link:t}=o.use();if(!t){let{href:t,prefetch:r,...n}=e;return(0,l.jsx)("a",{href:t,...n})}return(0,l.jsx)(t,{...e})}function f(e,t){let r=n.createContext(t);return{Provider:e=>(0,l.jsx)(r.Provider,{value:e.value,children:e.children}),use:t=>{let l=n.useContext(r);if(!l)throw Error(t??`Provider of ${e} is required but missing.`);return l}}}},5388:(e,t,r)=>{r.d(t,{T:()=>l});var n=r(7620);function l(e,t,r=function e(t,r){return Array.isArray(t)&&Array.isArray(r)?r.length!==t.length||t.some((t,n)=>e(t,r[n])):t!==r}){let[a,o]=(0,n.useState)(e);r(a,e)&&(t(e,a),o(e))}},6209:(e,t,r)=>{r.d(t,{Nt:()=>k,Ke:()=>T,R6:()=>R});var n=r(54568),l=r(7620),a=r(12710),o=r(62402),i=r(73284),s=r(58463),u=r(93608),d=r(37460),c=r(69312),f=r(62104),h="Collapsible",[p,m]=(0,o.A)(h),[x,g]=p(h),v=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:a,defaultOpen:o,disabled:s,onOpenChange:u,...c}=e,[p,m]=(0,i.i)({prop:a,defaultProp:null!=o&&o,onChange:u,caller:h});return(0,n.jsx)(x,{scope:r,disabled:s,contentId:(0,f.B)(),open:p,onOpenToggle:l.useCallback(()=>m(e=>!e),[m]),children:(0,n.jsx)(d.sG.div,{"data-state":P(p),"data-disabled":s?"":void 0,...c,ref:t})})});v.displayName=h;var y="CollapsibleTrigger",b=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,...l}=e,o=g(y,r);return(0,n.jsx)(d.sG.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":P(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...l,ref:t,onClick:(0,a.m)(e.onClick,o.onOpenToggle)})});b.displayName=y;var w="CollapsibleContent",N=l.forwardRef((e,t)=>{let{forceMount:r,...l}=e,a=g(w,e.__scopeCollapsible);return(0,n.jsx)(c.C,{present:r||a.open,children:e=>{let{present:r}=e;return(0,n.jsx)(j,{...l,ref:t,present:r})}})});N.displayName=w;var j=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:a,children:o,...i}=e,c=g(w,r),[f,h]=l.useState(a),p=l.useRef(null),m=(0,u.s)(t,p),x=l.useRef(0),v=x.current,y=l.useRef(0),b=y.current,N=c.open||f,j=l.useRef(N),C=l.useRef(void 0);return l.useEffect(()=>{let e=requestAnimationFrame(()=>j.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,s.N)(()=>{let e=p.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();x.current=t.height,y.current=t.width,j.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),h(a)}},[c.open,a]),(0,n.jsx)(d.sG.div,{"data-state":P(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!N,...i,ref:m,style:{"--radix-collapsible-content-height":v?"".concat(v,"px"):void 0,"--radix-collapsible-content-width":b?"".concat(b,"px"):void 0,...e.style},children:N&&o})});function P(e){return e?"open":"closed"}var C=r(99039);let k=v,R=b,T=(0,l.forwardRef)((e,t)=>{let{children:r,...a}=e,[o,i]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{i(!0)},[]),(0,n.jsx)(N,{ref:t,...a,className:(0,C.QP)("overflow-hidden",o&&"data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down",a.className),children:r})});T.displayName=N.displayName},8272:(e,t,r)=>{r.r(t),r.d(t,{I18nContext:()=>a,I18nLabel:()=>o,defaultTranslations:()=>l,useI18n:()=>i});var n=r(7620);let l={search:"Search",searchNoResult:"No results found",toc:"On this page",tocNoHeadings:"No Headings",lastUpdate:"Last updated on",chooseLanguage:"Choose a language",nextPage:"Next Page",previousPage:"Previous Page",chooseTheme:"Theme",editOnGithub:"Edit on GitHub"},a=(0,n.createContext)({text:l});function o(e){let{text:t}=i();return t[e.label]}function i(){return(0,n.useContext)(a)}},14547:(e,t,r)=>{r.d(t,{TOCItems:()=>p,TOCScrollArea:()=>h,W:()=>f,a:()=>c});var n=r(54568),l=r(96435),a=r(7620),o=r(99039),i=r(8272),s=r(20242),u=r(99936);let d=(0,a.createContext)([]);function c(){return(0,a.useContext)(d)}function f(e){let{toc:t,children:r,...a}=e;return(0,n.jsx)(d,{value:t,children:(0,n.jsx)(l.NQ,{toc:t,...a,children:r})})}function h(e){let{ref:t,className:r,...i}=e,s=(0,a.useRef)(null);return(0,n.jsx)("div",{ref:(0,u.P)(s,t),className:(0,o.QP)("relative min-h-0 text-sm ms-px overflow-auto [scrollbar-width:none] [mask-image:linear-gradient(to_bottom,transparent,white_16px,white_calc(100%-16px),transparent)] py-3",r),...i,children:(0,n.jsx)(l.N2,{containerRef:s,children:i.children})})}function p(e){let{ref:t,className:r,...l}=e,d=(0,a.useRef)(null),f=c(),{text:h}=(0,i.useI18n)();return 0===f.length?(0,n.jsx)("div",{className:"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",children:h.tocNoHeadings}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.j,{containerRef:d,className:"absolute top-(--fd-top) h-(--fd-height) w-px bg-fd-primary transition-all"}),(0,n.jsx)("div",{ref:(0,u.P)(t,d),className:(0,o.QP)("flex flex-col border-s border-fd-foreground/10",r),...l,children:f.map(e=>(0,n.jsx)(m,{item:e},e.url))})]})}function m(e){let{item:t}=e;return(0,n.jsx)(l.Cz,{href:t.url,className:(0,o.QP)("prose py-1.5 text-sm text-fd-muted-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary",t.depth<=2&&"ps-3",3===t.depth&&"ps-6",t.depth>=4&&"ps-8"),children:t.title})}},19142:(e,t,r)=>{r.d(t,{NavProvider:()=>i,hI:()=>s});var n=r(54568),l=r(7620),a=r(56705);(0,a.q6)("StylesContext",{tocNav:"xl:hidden",toc:"max-xl:hidden"});let o=(0,a.q6)("NavContext",{isTransparent:!1});function i(e){let{transparentMode:t="none",children:r}=e,[a,i]=(0,l.useState)("none"!==t);return(0,l.useEffect)(()=>{if("top"!==t)return;let e=()=>{i(window.scrollY<10)};return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[t]),(0,n.jsx)(o.Provider,{value:(0,l.useMemo)(()=>({isTransparent:a}),[a]),children:r})}function s(){return o.use()}},20242:(e,t,r)=>{r.d(t,{j:()=>d});var n=r(54568),l=r(7620),a=r(96435),o=r(53158),i=r(34998);function s(e,t){if(0===t.length||0===e.clientHeight)return[0,0];let r=Number.MAX_VALUE,n=0;for(let l of t){let t=e.querySelector(`a[href="#${l}"]`);if(!t)continue;let a=getComputedStyle(t);r=Math.min(r,t.offsetTop+parseFloat(a.paddingTop)),n=Math.max(n,t.offsetTop+t.clientHeight-parseFloat(a.paddingBottom))}return[r,n-r]}function u(e,t){e.style.setProperty("--fd-top",`${t[0]}px`),e.style.setProperty("--fd-height",`${t[1]}px`)}function d({containerRef:e,...t}){let r=a.Mf(),d=(0,l.useRef)(null),c=(0,i.J)(()=>{e.current&&d.current&&u(d.current,s(e.current,r))});return(0,l.useEffect)(()=>{if(!e.current)return;let t=e.current;c();let r=new ResizeObserver(c);return r.observe(t),()=>{r.disconnect()}},[e,c]),(0,o.T)(r,()=>{e.current&&d.current&&u(d.current,s(e.current,r))}),(0,n.jsx)("div",{ref:d,role:"none",...t})}},25664:(e,t,r)=>{r.d(t,{CodeBlock:()=>d,Pre:()=>u});var n=r(54568),l=r(22715),a=r(7620),o=r(99039),i=r(34998),s=r(65615);let u=(0,a.forwardRef)((e,t)=>{let{className:r,...l}=e;return(0,n.jsx)("pre",{ref:t,className:(0,o.QP)("min-w-full w-max *:flex *:flex-col",r),...l,children:l.children})});u.displayName="Pre";let d=(0,a.forwardRef)((e,t)=>{var r;let{title:l,allowCopy:i=!0,keepBackground:s=!1,icon:u,viewportProps:d,children:f,...h}=e,p=(0,a.useRef)(null),m=()=>{var e,t;let r=null==(e=p.current)?void 0:e.getElementsByTagName("pre").item(0);if(!r)return;let n=r.cloneNode(!0);n.querySelectorAll(".nd-copy-ignore").forEach(e=>{e.remove()}),navigator.clipboard.writeText(null!=(t=n.textContent)?t:"")};return(0,n.jsxs)("figure",{ref:t,dir:"ltr",...h,className:(0,o.QP)("not-prose group relative my-4 overflow-hidden rounded-lg border bg-fd-card text-sm outline-none",s&&"bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)",h.className),children:[l?(0,n.jsxs)("div",{className:"flex items-center gap-2 bg-fd-secondary px-4 py-1.5",children:[u?(0,n.jsx)("div",{className:"text-fd-muted-foreground [&_svg]:size-3.5",dangerouslySetInnerHTML:"string"==typeof u?{__html:u}:void 0,children:"string"!=typeof u?u:null}):null,(0,n.jsx)("figcaption",{className:"flex-1 truncate text-fd-muted-foreground",children:l}),i?(0,n.jsx)(c,{className:"-me-2",onCopy:m}):null]}):i&&(0,n.jsx)(c,{className:"absolute right-2 top-2 z-[2] backdrop-blur-md",onCopy:m}),(0,n.jsx)("div",{ref:p,...d,className:(0,o.QP)("text-[13px] py-3.5 overflow-auto [&_.line]:px-4 max-h-[600px] fd-scroll-container",h["data-line-numbers"]&&"[&_.line]:pl-3",null==d?void 0:d.className),style:{counterSet:h["data-line-numbers"]?"line ".concat(Number(null!=(r=h["data-line-numbers-start"])?r:1)-1):void 0,...null==d?void 0:d.style},children:f})]})});function c(e){let{className:t,onCopy:r,...u}=e,[d,c]=function(e){let[t,r]=(0,a.useState)(!1),n=(0,a.useRef)(null),l=(0,i.J)(()=>{n.current&&window.clearTimeout(n.current),Promise.resolve(e()).then(()=>{r(!0),n.current=window.setTimeout(()=>{r(!1)},1500)})});return(0,a.useEffect)(()=>()=>{n.current&&window.clearTimeout(n.current)},[]),[t,l]}(r);return(0,n.jsxs)("button",{type:"button",className:(0,o.QP)((0,s.r)({color:"ghost"}),"transition-opacity group-hover:opacity-100 [&_svg]:size-3.5",!d&&"[@media(hover:hover)]:opacity-0",t),"aria-label":d?"Copied Text":"Copy Text",onClick:c,...u,children:[(0,n.jsx)(l.Jl,{className:(0,o.QP)("transition-transform",!d&&"scale-0")}),(0,n.jsx)(l.QR,{className:(0,o.QP)("absolute transition-transform",d&&"scale-0")})]})}d.displayName="CodeBlock"},28219:(e,t,r)=>{function n(e,t,r){let{includePage:n=!0,includeSeparator:l=!1,includeRoot:a}=r,o=[];return t.forEach((e,r)=>{if("separator"===e.type&&e.name&&l&&o.push({name:e.name}),"folder"===e.type){let n=t.at(r+1);if(n&&e.index===n)return;if(e.root){o=[];return}o.push({name:e.name,url:e.index?.url})}"page"===e.type&&n&&o.push({name:e.name,url:e.url})}),a&&o.unshift({name:e.name,url:"object"==typeof a?a.url:void 0}),o}r.d(t,{Pp:()=>n,oe:()=>function e(t,r){let n;for(let l of(r.endsWith("/")&&(r=r.slice(0,-1)),t)){if("separator"===l.type&&(n=l),"folder"===l.type){if(l.index?.url===r){let e=[];return n&&e.push(n),e.push(l,l.index),e}let t=e(l.children,r);if(t)return t.unshift(l),n&&t.unshift(n),t}if("page"===l.type&&l.url===r){let e=[];return n&&e.push(n),e.push(l),e}}return null}}),r(41758),r(7620)},34998:(e,t,r)=>{r.d(t,{J:()=>l}),r(41758);var n=r(7620);function l(e){let t=(0,n.useRef)(e);return t.current=e,(0,n.useCallback)(function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current(...r)},[])}},41758:(e,t,r)=>{},50720:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var n=r(1186),l=r(7620),a=r(54568),o=(0,l.forwardRef)(({href:e="#",external:t=!(e.startsWith("/")||e.startsWith("#")||e.startsWith(".")),prefetch:r,...l},o)=>t?(0,a.jsx)("a",{ref:o,href:e,rel:"noreferrer noopener",target:"_blank",...l,children:l.children}):(0,a.jsx)(n.N_,{ref:o,href:e,prefetch:r,...l}));o.displayName="Link",r(41758)},53158:(e,t,r)=>{r.d(t,{T:()=>n.T});var n=r(5388);r(41758)},56406:(e,t,r)=>{r.d(t,{PageBreadcrumb:()=>M,PageFooter:()=>R,PageLastUpdate:()=>C,PageRoot:()=>P,PageTOC:()=>I,PageTOCPopover:()=>j,PageTOCPopoverContent:()=>N,PageTOCPopoverTrigger:()=>b});var n=r(54568),l=r(7620),a=r(22715),o=r(50720),i=r(99039),s=r(8272),u=r(87156),d=r(56705),c=r(28219),f=r(19142),h=r(59230),p=r(34998),m=r(6209),x=r(94948),g=r(14547),v=r(96435);let y=(0,d.q6)("TocPopoverContext");function b(e){var t,r;let{text:o}=(0,s.useI18n)(),{open:d}=y.use(),c=(0,g.a)(),f=(0,v.R3)(),h=(0,l.useMemo)(()=>c.findIndex(e=>f===e.url.slice(1)),[c,f]),p=(0,u.L)().at(-1),x=-1!==h&&!d;return(0,n.jsxs)(m.R6,{...e,className:(0,i.QP)("flex w-full h-(--fd-tocnav-height) items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:shrink-0 [&_svg]:size-4 md:px-6",e.className),children:[(0,n.jsx)(w,{value:(h+1)/Math.max(1,c.length),max:1,className:(0,i.QP)(d&&"text-fd-primary")}),(0,n.jsxs)("span",{className:"grid flex-1 *:my-auto *:row-start-1 *:col-start-1",children:[(0,n.jsx)("span",{className:(0,i.QP)("truncate transition-all",d&&"text-fd-foreground",x&&"opacity-0 -translate-y-full pointer-events-none"),children:null!=(r=null==p?void 0:p.name)?r:o.toc}),(0,n.jsx)("span",{className:(0,i.QP)("truncate transition-all",!x&&"opacity-0 translate-y-full pointer-events-none"),children:null==(t=c[h])?void 0:t.title})]}),(0,n.jsx)(a.yQ,{className:(0,i.QP)("transition-transform mx-0.5",d&&"rotate-180")})]})}function w(e){let{value:t,strokeWidth:r=2,size:l=24,min:a=0,max:o=100,...i}=e,s=t<a?a:t>o?o:t,u=(l-r)/2,d=2*Math.PI*u,c=s/o*d,f={cx:l/2,cy:l/2,r:u,fill:"none",strokeWidth:r};return(0,n.jsxs)("svg",{role:"progressbar",viewBox:"0 0 ".concat(l," ").concat(l),"aria-valuenow":s,"aria-valuemin":a,"aria-valuemax":o,...i,children:[(0,n.jsx)("circle",{...f,className:"stroke-current/25"}),(0,n.jsx)("circle",{...f,stroke:"currentColor",strokeDasharray:d,strokeDashoffset:d-c,strokeLinecap:"round",transform:"rotate(-90 ".concat(l/2," ").concat(l/2,")"),className:"transition-all"})]})}function N(e){return(0,n.jsx)(m.Ke,{"data-toc-popover":"",...e,className:(0,i.QP)("flex flex-col px-4 max-h-[50vh] md:px-6",e.className),children:e.children})}function j(e){let t=(0,l.useRef)(null),[r,a]=(0,l.useState)(!1),{collapsed:o}=(0,x.c)(),{isTransparent:s}=(0,f.hI)(),u=(0,p.J)(e=>{r&&t.current&&!t.current.contains(e.target)&&a(!1)});return(0,l.useEffect)(()=>(window.addEventListener("click",u),()=>{window.removeEventListener("click",u)}),[u]),(0,n.jsx)(y.Provider,{value:(0,l.useMemo)(()=>({open:r,setOpen:a}),[a,r]),children:(0,n.jsx)(m.Nt,{open:r,onOpenChange:a,asChild:!0,children:(0,n.jsx)("header",{ref:t,id:"nd-tocnav",...e,className:(0,i.QP)("fixed inset-x-0 z-10 border-b backdrop-blur-sm transition-colors xl:hidden",(!s||r)&&"bg-fd-background/80",r&&"shadow-lg",e.className),style:{...e.style,top:"calc(var(--fd-banner-height) + var(--fd-nav-height))",insetInlineStart:o?"0px":"calc(var(--fd-sidebar-width) + var(--fd-layout-offset))"},children:e.children})})})}function P(e){let{toc:t,children:r,...l}=e,{collapsed:a}=(0,x.c)();return(0,n.jsx)(g.W,{...t,children:(0,n.jsx)("div",{id:"nd-page",...l,className:(0,i.QP)("flex flex-1 mx-auto w-full",l.className),style:{paddingTop:"calc(var(--fd-nav-height) + var(--fd-tocnav-height))",maxWidth:a?"var(--fd-page-width)":"min(var(--fd-page-width),calc(var(--fd-layout-width) - var(--fd-sidebar-width)))",...l.style},children:r})})}function C(e){let{date:t,...r}=e,{text:a}=(0,s.useI18n)(),[o,u]=(0,l.useState)("");return(0,l.useEffect)(()=>{u(new Date(t).toLocaleDateString())},[t]),(0,n.jsxs)("p",{...r,className:(0,i.QP)("text-sm text-fd-muted-foreground",r.className),children:[a.lastUpdate," ",o]})}let k=new WeakMap;function R(e){let{items:t,...r}=e,{root:a}=(0,u.t)(),o=(0,d.a8)(),{previous:s,next:c}=(0,l.useMemo)(()=>{if(t)return t;let e=k.get(a),r=null!=e?e:function e(t){let r=[];return t.forEach(t=>{if("folder"===t.type){t.index&&r.push(t.index),r.push(...e(t.children));return}"page"!==t.type||t.external||r.push(t)}),r}(a.children);k.set(a,r);let n=r.findIndex(e=>(0,h.$)(e.url,o,!1));return -1===n?{}:{previous:r[n-1],next:r[n+1]}},[t,o,a]);return(0,n.jsxs)("div",{...r,className:(0,i.QP)("@container grid gap-4 pb-6",s&&c?"grid-cols-2":"grid-cols-1",r.className),children:[s?(0,n.jsx)(T,{item:s,index:0}):null,c?(0,n.jsx)(T,{item:c,index:1}):null]})}function T(e){var t;let{item:r,index:l}=e,{text:u}=(0,s.useI18n)(),d=0===l?a.JG:a.c_;return(0,n.jsxs)(o.default,{href:r.url,className:(0,i.QP)("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full",1===l&&"text-end"),children:[(0,n.jsxs)("div",{className:(0,i.QP)("inline-flex items-center gap-1.5 font-medium",1===l&&"flex-row-reverse"),children:[(0,n.jsx)(d,{className:"-mx-1 size-4 shrink-0 rtl:rotate-180"}),(0,n.jsx)("p",{children:r.name})]}),(0,n.jsx)("p",{className:"text-fd-muted-foreground truncate",children:null!=(t=r.description)?t:0===l?u.previousPage:u.nextPage})]})}function M(e){let{includeRoot:t=!1,includeSeparator:r,includePage:a=!1,...s}=e,d=(0,u.L)(),{root:f}=(0,u.t)(),h=(0,l.useMemo)(()=>(0,c.Pp)(f,d,{includePage:a,includeSeparator:r,includeRoot:t}),[a,t,r,d,f]);return 0===h.length?null:(0,n.jsx)("div",{...s,className:(0,i.QP)("flex items-center gap-1.5 text-[15px] text-fd-muted-foreground",s.className),children:h.map((e,t)=>{let r=(0,i.QP)("truncate",t===h.length-1&&"text-fd-primary font-medium");return(0,n.jsxs)(l.Fragment,{children:[0!==t&&(0,n.jsx)("span",{className:"text-fd-foreground/30",children:"/"}),e.url?(0,n.jsx)(o.default,{href:e.url,className:(0,i.QP)(r,"transition-opacity hover:opacity-80"),children:e.name}):(0,n.jsx)("span",{className:r,children:e.name})]},t)})})}function I(e){return(0,n.jsx)("div",{id:"nd-toc",...e,className:(0,i.QP)("sticky pb-2 pt-12 max-xl:hidden",e.className),style:{...e.style,top:"calc(var(--fd-banner-height) + var(--fd-nav-height))",height:"calc(100dvh - var(--fd-banner-height) - var(--fd-nav-height))"},children:(0,n.jsx)("div",{className:"flex h-full w-(--fd-toc-width) max-w-full flex-col pe-4",children:e.children})})}},56705:(e,t,r)=>{r.d(t,{Image:()=>n._V,a8:()=>n.a8,q6:()=>n.q6,rd:()=>n.rd});var n=r(1186);r(41758)},59230:(e,t,r)=>{r.d(t,{$:()=>n});function n(e,t,r=!0){return e.endsWith("/")&&(e=e.slice(0,-1)),t.endsWith("/")&&(t=t.slice(0,-1)),e===t||r&&t.startsWith(`${e}/`)}},87156:(e,t,r)=>{r.d(t,{L:()=>d,TreeContextProvider:()=>u,t:()=>c});var n=r(54568),l=r(56705),a=r(7620),o=r(28219);let i=(0,l.q6)("TreeContext"),s=(0,l.q6)("PathContext",[]);function u(e){var t,r,u;let d=(0,a.useRef)(0),c=(0,l.a8)(),f=(0,a.useMemo)(()=>e.tree,[null!=(t=e.tree.$id)?t:e.tree]),h=(0,a.useMemo)(()=>{var e;return null!=(e=(0,o.oe)(f.children,c))?e:[]},[f,c]),p=null!=(r=h.findLast(e=>"folder"===e.type&&e.root))?r:f;return null!=p.$id||(p.$id=String(d.current++)),(0,n.jsx)(i.Provider,{value:(0,a.useMemo)(()=>({root:p}),[p]),children:(0,n.jsx)(s.Provider,{value:h,children:e.children})})}function d(){return s.use()}function c(){return i.use("You must wrap this component under <DocsLayout />")}},93627:(e,t,r)=>{r.d(t,{default:()=>c});var n=r(54568),l=r(96435),a=r(7620),o=r(99039),i=r(20242),s=r(14547),u=r(99936),d=r(8272);function c(e){let{ref:t,className:r,...l}=e,c=(0,a.useRef)(null),p=(0,s.a)(),{text:m}=(0,d.useI18n)(),[x,g]=(0,a.useState)();return((0,a.useEffect)(()=>{if(!c.current)return;let e=c.current;function t(){if(0===e.clientHeight)return;let t=0,r=0,n=[];for(let l=0;l<p.length;l++){let a=e.querySelector('a[href="#'.concat(p[l].url.slice(1),'"]'));if(!a)continue;let o=getComputedStyle(a),i=f(p[l].depth)+1,s=a.offsetTop+parseFloat(o.paddingTop),u=a.offsetTop+a.clientHeight-parseFloat(o.paddingBottom);t=Math.max(i,t),r=Math.max(r,u),n.push("".concat(0===l?"M":"L").concat(i," ").concat(s)),n.push("L".concat(i," ").concat(u))}g({path:n.join(" "),width:t+1,height:r})}let r=new ResizeObserver(t);return t(),r.observe(e),()=>{r.disconnect()}},[p]),0===p.length)?(0,n.jsx)("div",{className:"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",children:m.tocNoHeadings}):(0,n.jsxs)(n.Fragment,{children:[x?(0,n.jsx)("div",{className:"absolute start-0 top-0 rtl:-scale-x-100",style:{width:x.width,height:x.height,maskImage:'url("data:image/svg+xml,'.concat(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '.concat(x.width," ").concat(x.height,'"><path d="').concat(x.path,'" stroke="black" stroke-width="1" fill="none" /></svg>')),'")')},children:(0,n.jsx)(i.j,{containerRef:c,className:"mt-(--fd-top) h-(--fd-height) bg-fd-primary transition-all"})}):null,(0,n.jsx)("div",{ref:(0,u.P)(c,t),className:(0,o.QP)("flex flex-col",r),...l,children:p.map((e,t)=>{var r,l;return(0,n.jsx)(h,{item:e,upper:null==(r=p[t-1])?void 0:r.depth,lower:null==(l=p[t+1])?void 0:l.depth},e.url)})})]})}function f(e){return 10*(e>=3)}function h(e){var t;let{item:r,upper:a=r.depth,lower:i=r.depth}=e,s=f(r.depth),u=f(a),d=f(i);return(0,n.jsxs)(l.Cz,{href:r.url,style:{paddingInlineStart:(t=r.depth)<=2?14:3===t?26:36},className:"prose relative py-1.5 text-sm text-fd-muted-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary",children:[s!==u?(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",className:"absolute -top-1.5 start-0 size-4 rtl:-scale-x-100",children:(0,n.jsx)("line",{x1:u,y1:"0",x2:s,y2:"12",className:"stroke-fd-foreground/10",strokeWidth:"1"})}):null,(0,n.jsx)("div",{className:(0,o.QP)("absolute inset-y-0 w-px bg-fd-foreground/10",s!==u&&"top-1.5",s!==d&&"bottom-1.5"),style:{insetInlineStart:s}}),r.title]})}},94948:(e,t,r)=>{r.d(t,{G:()=>u,c:()=>s});var n=r(54568),l=r(7620),a=r(56705),o=r(53158);let i=(0,a.q6)("SidebarContext");function s(){return i.use()}function u(e){let{children:t}=e,r=(0,l.useRef)(!0),[s,u]=(0,l.useState)(!1),[d,c]=(0,l.useState)(!1),f=(0,a.a8)();return(0,o.T)(f,()=>{r.current&&u(!1),r.current=!0}),(0,n.jsx)(i.Provider,{value:(0,l.useMemo)(()=>({open:s,setOpen:u,collapsed:d,setCollapsed:c,closeOnRedirect:r}),[s,d]),children:t})}},96435:(e,t,r)=>{r.d(t,{NQ:()=>v,N2:()=>g,Cz:()=>y,R3:()=>m,Mf:()=>x});var n=r(5388);r(41758);var l=r(7620);let a=e=>"object"==typeof e&&null!=e&&1===e.nodeType,o=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,i=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let r=getComputedStyle(e,null);return o(r.overflowY,t)||o(r.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},s=(e,t,r,n,l,a,o,i)=>a<e&&o>t||a>e&&o<t?0:a<=e&&i<=r||o>=t&&i>=r?a-e-n:o>t&&i<r||a<e&&i>r?o-t+l:0,u=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},d=(e,t)=>{var r,n,l,o;if("undefined"==typeof document)return[];let{scrollMode:d,block:c,inline:f,boundary:h,skipOverflowHiddenElements:p}=t,m="function"==typeof h?h:e=>e!==h;if(!a(e))throw TypeError("Invalid target");let x=document.scrollingElement||document.documentElement,g=[],v=e;for(;a(v)&&m(v);){if((v=u(v))===x){g.push(v);break}null!=v&&v===document.body&&i(v)&&!i(document.documentElement)||null!=v&&i(v,p)&&g.push(v)}let y=null!=(n=null==(r=window.visualViewport)?void 0:r.width)?n:innerWidth,b=null!=(o=null==(l=window.visualViewport)?void 0:l.height)?o:innerHeight,{scrollX:w,scrollY:N}=window,{height:j,width:P,top:C,right:k,bottom:R,left:T}=e.getBoundingClientRect(),{top:M,right:I,bottom:E,left:Q}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),S="start"===c||"nearest"===c?C-M:"end"===c?R+E:C+j/2-M+E,L="center"===f?T+P/2-Q+I:"end"===f?k+I:T-Q,W=[];for(let e=0;e<g.length;e++){let t=g[e],{height:r,width:n,top:l,right:a,bottom:o,left:u}=t.getBoundingClientRect();if("if-needed"===d&&C>=0&&T>=0&&R<=b&&k<=y&&(t===x&&!i(t)||C>=l&&R<=o&&T>=u&&k<=a))break;let h=getComputedStyle(t),p=parseInt(h.borderLeftWidth,10),m=parseInt(h.borderTopWidth,10),v=parseInt(h.borderRightWidth,10),M=parseInt(h.borderBottomWidth,10),I=0,E=0,Q="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-v:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-M:0,_="offsetWidth"in t?0===t.offsetWidth?0:n/t.offsetWidth:0,F="offsetHeight"in t?0===t.offsetHeight?0:r/t.offsetHeight:0;if(x===t)I="start"===c?S:"end"===c?S-b:"nearest"===c?s(N,N+b,b,m,M,N+S,N+S+j,j):S-b/2,E="start"===f?L:"center"===f?L-y/2:"end"===f?L-y:s(w,w+y,y,p,v,w+L,w+L+P,P),I=Math.max(0,I+N),E=Math.max(0,E+w);else{I="start"===c?S-l-m:"end"===c?S-o+M+H:"nearest"===c?s(l,o,r,m,M+H,S,S+j,j):S-(l+r/2)+H/2,E="start"===f?L-u-p:"center"===f?L-(u+n/2)+Q/2:"end"===f?L-a+v+Q:s(u,a,n,p,v+Q,L,L+P,P);let{scrollLeft:e,scrollTop:i}=t;I=0===F?0:Math.max(0,Math.min(i+I/F,t.scrollHeight-r/F+H)),E=0===_?0:Math.max(0,Math.min(e+E/_,t.scrollWidth-n/_+Q)),S+=i-I,L+=e-E}W.push({el:t,top:I,left:E})}return W},c=e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"};var f=r(54568),h=(0,l.createContext)([]),p=(0,l.createContext)({current:null});function m(){return(0,l.useContext)(h).at(-1)}function x(){return(0,l.useContext)(h)}function g(e){let{containerRef:t,children:r}=e;return(0,f.jsx)(p.Provider,{value:t,children:r})}function v(e){let{toc:t,single:r=!0,children:n}=e,a=(0,l.useMemo)(()=>t.map(e=>e.url.split("#")[1]),[t]);return(0,f.jsx)(h.Provider,{value:function(e,t){let[r,n]=(0,l.useState)([]);return(0,l.useEffect)(()=>{let r=[],l=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&!r.includes(t.target.id)?r=[...r,t.target.id]:!t.isIntersecting&&r.includes(t.target.id)&&(r=r.filter(e=>e!==t.target.id));r.length>0&&n(r)},{rootMargin:t?"-80px 0% -70% 0%":"-20px 0% -40% 0%",threshold:1});function a(){let r=document.scrollingElement;if(!r)return;let l=r.scrollTop;l<=0&&t?n(e.slice(0,1)):l+r.clientHeight>=r.scrollHeight-6&&n(r=>r.length>0&&!t?e.slice(e.indexOf(r[0])):e.slice(-1))}for(let t of e){let e=document.getElementById(t);e&&l.observe(e)}return a(),window.addEventListener("scroll",a),()=>{window.removeEventListener("scroll",a),l.disconnect()}},[t,e]),t?r.slice(0,1):r}(a,r),children:n})}var y=(0,l.forwardRef)((e,t)=>{let{onActiveChange:r,...a}=e,o=(0,l.useContext)(p),i=x(),s=(0,l.useRef)(null),u=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>{t.forEach(t=>{"function"==typeof t?t(e):null!==t&&(t.current=e)})}}(s,t),h=i.includes(a.href.slice(1));return(0,n.T)(h,e=>{let t=s.current;t&&(e&&o.current&&function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let r=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(d(e,t));let n="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:l,top:a,left:o}of d(e,c(t))){let e=a-r.top+r.bottom,t=o-r.left+r.right;l.scroll({top:e,left:t,behavior:n})}}(t,{behavior:"smooth",block:"center",inline:"center",scrollMode:"always",boundary:o.current}),null==r||r(e))}),(0,f.jsx)("a",{ref:u,"data-active":h,...a,children:a.children})});y.displayName="TOCItem"},99936:(e,t,r)=>{r.d(t,{P:()=>n});function n(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})}}}}]); |