mirror of
https://github.com/luxfi/lpm.git
synced 2026-10-30 16:20:57 +00:00
1 line
6.1 KiB
JavaScript
1 line
6.1 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37210,43298,e=>{"use strict";var t=e.i(29501),r=e.i(59979),n=e.i(39326),i=(0,r.forwardRef)(({href:e="#",external:r=e.match(/^\w+:/)||e.startsWith("//"),prefetch:i,...a},s)=>r?(0,n.jsx)("a",{ref:s,href:e,rel:"noreferrer noopener",target:"_blank",...a,children:a.children}):(0,n.jsx)(t.Link,{ref:s,href:e,prefetch:i,...a}));i.displayName="Link",e.s(["Link",()=>i],43298),e.i(35317),e.s([],37210)},8032,83125,e=>{"use strict";var t=e.i(43298);function r(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function n(e,t,i=!0){return(e=r(e))===(t=r(t))||i&&t.startsWith(`${e}/`)}function i(e,t){return e.urls?e.urls.has(r(t)):n(e.url,t,!0)}e.s(["default",()=>t.Link],8032),e.s(["isActive",()=>n,"isTabActive",()=>i],83125)},60341,e=>{"use strict";var t=e.i(39326),r=e.i(59979),n=e.i(91967),i=e.i(62568),a=e.i(76919),s=e.i(3071),o=e.i(7939),l=e.i(21467),u=e.i(62927),d=e.i(92822),c="Collapsible",[f,p]=(0,i.createContextScope)(c),[h,m]=f(c),v=r.forwardRef((e,n)=>{let{__scopeCollapsible:i,open:s,defaultOpen:o,disabled:u,onOpenChange:f,...p}=e,[m,v]=(0,a.useControllableState)({prop:s,defaultProp:o??!1,onChange:f,caller:c});return(0,t.jsx)(h,{scope:i,disabled:u,contentId:(0,d.useId)(),open:m,onOpenToggle:r.useCallback(()=>v(e=>!e),[v]),children:(0,t.jsx)(l.Primitive.div,{"data-state":P(m),"data-disabled":u?"":void 0,...p,ref:n})})});v.displayName=c;var x="CollapsibleTrigger",b=r.forwardRef((e,r)=>{let{__scopeCollapsible:i,...a}=e,s=m(x,i);return(0,t.jsx)(l.Primitive.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":P(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...a,ref:r,onClick:(0,n.composeEventHandlers)(e.onClick,s.onOpenToggle)})});b.displayName=x;var C="CollapsibleContent",y=r.forwardRef((e,r)=>{let{forceMount:n,...i}=e,a=m(C,e.__scopeCollapsible);return(0,t.jsx)(u.Presence,{present:n||a.open,children:({present:e})=>(0,t.jsx)(g,{...i,ref:r,present:e})})});y.displayName=C;var g=r.forwardRef((e,n)=>{let{__scopeCollapsible:i,present:a,children:u,...d}=e,c=m(C,i),[f,p]=r.useState(a),h=r.useRef(null),v=(0,o.useComposedRefs)(n,h),x=r.useRef(0),b=x.current,y=r.useRef(0),g=y.current,w=c.open||f,N=r.useRef(w),R=r.useRef(void 0);return r.useEffect(()=>{let e=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,s.useLayoutEffect)(()=>{let e=h.current;if(e){R.current=R.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,N.current||(e.style.transitionDuration=R.current.transitionDuration,e.style.animationName=R.current.animationName),p(a)}},[c.open,a]),(0,t.jsx)(l.Primitive.div,{"data-state":P(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...d,ref:v,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:w&&u})});function P(e){return e?"open":"closed"}e.i(95067);var w=e.i(83137);let N=(0,r.forwardRef)(({children:e,...n},i)=>{let[a,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{s(!0)},[]),(0,t.jsx)(y,{ref:i,...n,className:(0,w.cn)("overflow-hidden",a&&"data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down",n.className),children:e})});N.displayName=y.displayName,e.s(["Collapsible",()=>v,"CollapsibleContent",()=>N,"CollapsibleTrigger",()=>b],60341)},20261,51303,e=>{"use strict";var t=e.i(39326);e.i(26140);var r=e.i(29501),n=e.i(59979);function i(e,t,r){let{includePage:n=!1,includeSeparator:i=!1,includeRoot:a=!1}=r,s=[];for(let e=0;e<t.length;e++){let r=t[e];switch(r.type){case"page":n&&s.push({name:r.name,url:r.url});break;case"folder":if(r.root&&!a){s=[];break}(e===t.length-1||r.index!==t[e+1])&&s.push({name:r.name,url:r.index?.url});break;case"separator":r.name&&i&&s.push({name:r.name})}}return a&&s.unshift({name:e.name,url:"object"==typeof a?a.url:void 0}),s}function a(e,t){var r;let n=((r=t).startsWith("http://")||r.startsWith("https://")||(r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1))),r);return function(e,t,r={}){let{includeSeparator:n=!0}=r;return function e(r){let i;for(let a of r){if(t(a)){let e=[];return i&&e.push(i),e.push(a),e}if("separator"===a.type&&n){i=a;continue}if("folder"===a.type){let r=a.index&&t(a.index)?[a.index]:e(a.children);if(r)return r.unshift(a),i&&r.unshift(i),r}}}(e)??null}(e,e=>"page"===e.type&&e.url===n)}e.i(35317),e.s(["getBreadcrumbItemsFromPath",()=>i,"searchPath",()=>a],51303);let s=(0,r.createContext)("TreeContext"),o=(0,r.createContext)("PathContext",[]);function l(e){let i=(0,n.useRef)(0),l=(0,r.usePathname)(),u=(0,n.useMemo)(()=>e.tree,[e.tree.$id??e.tree]),d=(0,n.useMemo)(()=>{let e=a(u.children,l);return e||(u.fallback&&(e=a(u.fallback.children,l)),e??[])},[u,l]),c=d.findLast(e=>"folder"===e.type&&e.root)??u;return c.$id??(c.$id=String(i.current++)),(0,t.jsx)(s.Provider,{value:(0,n.useMemo)(()=>({root:c,full:u}),[c,u]),children:(0,t.jsx)(o.Provider,{value:d,children:e.children})})}function u(){return o.use()}function d(){return s.use("You must wrap this component under <DocsLayout />")}e.s(["TreeContextProvider",()=>l,"useTreeContext",()=>d,"useTreePath",()=>u],20261)},63003,e=>{"use strict";var t=e.i(39326),r=e.i(59979);e.i(26140);var n=e.i(29501);let i=(0,n.createContext)("StylesContext",{tocNav:"xl:hidden",toc:"max-xl:hidden"});function a(){return i.use()}function s({children:e,...r}){return(0,t.jsx)(i.Provider,{value:r,children:e})}let o=(0,n.createContext)("NavContext",{isTransparent:!1});function l({transparentMode:e="none",children:n}){let[i,a]=(0,r.useState)("none"!==e);return(0,r.useEffect)(()=>{if("top"!==e)return;let t=()=>{a(window.scrollY<10)};return t(),window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}},[e]),(0,t.jsx)(o.Provider,{value:(0,r.useMemo)(()=>({isTransparent:i}),[i]),children:n})}function u(){return o.use()}e.s(["NavProvider",()=>l,"StylesProvider",()=>s,"useNav",()=>u,"usePageStyles",()=>a])},25462,e=>{"use strict";e.i(37210);var t=e.i(43298);e.s(["default",()=>t.Link])}]); |