kolenkainc-honohub-react
Version:
React admin panel for honohub
28 lines • 98.7 kB
JavaScript
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import*as n from"@heroicons/react/24/outline";import{PuzzlePieceIcon as o,ChevronRightIcon as a,ChevronLeftIcon as i,ArchiveBoxIcon as l,XMarkIcon as c,Bars3Icon as u,ChevronDownIcon as s,CheckIcon as f,Bars3BottomRightIcon as d,EllipsisVerticalIcon as p,PlusIcon as y,ArrowPathIcon as m,ComputerDesktopIcon as h,SunIcon as b,MoonIcon as v,BoltIcon as g,StarIcon as O,LightBulbIcon as w,BugAntIcon as x,AdjustmentsHorizontalIcon as S}from"@heroicons/react/24/outline";import{useInfiniteQuery as j,useQuery as k,useQueryClient as P,useMutation as N,QueryClient as E,QueryClientProvider as A}from"@tanstack/react-query";import{NuqsAdapter as D}from"nuqs/adapters/react-router";import I,{Toaster as _}from"react-hot-toast";import{Link as T,NavLink as C,useLocation as z,Outlet as L,useNavigate as M,useSearchParams as R,useParams as K,useRouteError as U,isRouteErrorResponse as V,createBrowserRouter as H,RouterProvider as $}from"react-router-dom";import B,{useState as F,createContext as q,useContext as G,useMemo as Y,useEffect as W,useRef as Q,forwardRef as J,Fragment as Z,useCallback as X,Suspense as ee,lazy as re,createElement as te,useId as ne}from"react";import{useBoolean as oe,useBreakpointValue as ae,eventHandler as ie,AlertDialog as le,AlertDialogOverlay as ce,AlertDialogContent as ue,AlertDialogTitle as se,AlertDialogDescription as fe,AlertDialogCancel as de,Button as pe,classNames as ye,Text as me,Drawer as he,DrawerOverlay as be,DrawerClose as ve,DrawerContent as ge,InputField as Oe,AccordionItem as we,AccordionTrigger as xe,AccordionContent as Se,RadioGroup as je,RadioGroupItem as ke,useLastElement as Pe,Spinner as Ne,Accordion as Ee,Menu as Ae,MenuTrigger as De,MenuContent as Ie,MenuItem as _e,Toast as Te,Tooltip as Ce,TooltipTrigger as ze,TooltipContent as Le,Avatar as Me,useFieldControlContext as Re,getValue as Ke,Skeleton as Ue,Card as Ve,CardHeader as He,CardContent as $e,Label as Be,ToggleGroup as Fe,ToggleGroupItem as qe}from"@rafty/ui";import Ge,{isAxiosError as Ye}from"axios";import"shiki";import{highlightMatches as We,SearchbarComponent as Qe,ActionSelect as Je,Searchbar as Ze,Pagination as Xe,rowSelectionColumn as er,FormMode as rr,FormFooter as tr,DocumentSubmitType as nr,SUBMIT_BUTTON_KEY as or}from"kolenkainc-honohub-shared";import ar from"fuse.js";import{useField as ir,DuckForm as lr,Blueprint as cr,DuckField as ur,useDuckForm as sr,useBlueprint as fr}from"duck-form";import{useQueryState as dr,parseAsBoolean as pr,parseAsArrayOf as yr,parseAsString as mr,useQueryStates as hr,parseAsInteger as br}from"nuqs";import vr,{ZodError as gr}from"zod";import{DataTable as Or,Combobox as wr,ComboboxTrigger as xr,ComboboxClearButton as Sr,ComboboxContent as jr,useComboboxContext as kr,ComboboxItem as Pr}from"@rafty/corp";import Nr from"dayjs";import Er from"@heroicons/react/24/outline/BoltIcon";import{useFormContext as Ar,Controller as Dr,useForm as Ir,FormProvider as _r}from"react-hook-form";import{BlockWrapper as Tr,quackFields as Cr}from"@duck-form/fields";function zr(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Lr(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return zr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return zr(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Mr=q(null),Rr=function(r){var t,n,o,a=(t=Lr(F({show:!1}),2),n=t[0],o=t[1],{action:{state:n,setState:o}});return e(Mr.Provider,{value:a,children:r.children})};var Kr=function(){var e=G(Mr);if(!e)throw new Error("Missing DialogManagerContext.Provider in the tree!");return e};function Ur(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Vr(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return Ur(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ur(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Hr=q(null);function $r(r){var t,n,o,a=r.children,i=(t=Vr(oe(),2),n=t[0],o=t[1],{isOpen:n,setOpen:o});return e(Hr.Provider,{value:i,children:a})}function Br(){var e=G(Hr);if(!e)throw new Error("Missing DrawerContext.Provider in the tree!");return e}function Fr(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function qr(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||Yr(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gr(e){return function(e){if(Array.isArray(e))return Fr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Yr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yr(e,r){if(e){if("string"==typeof e)return Fr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Fr(e,r):void 0}}function Wr(e){return"string"==typeof e?e:e.singular}function Qr(e){return"string"==typeof e?e:e.plural}function Jr(e){return Object.entries(e).reduce((function(e,r){var t,n,o,a=qr(r,2),i=a[0],l=a[1];l&&(Array.isArray(l)?(t=e).push.apply(t,Gr(l.map((function(e){return"".concat(i,"=").concat(e)})))):"object"==(void 0===l?"undefined":(o=l)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)?(n=e).push.apply(n,Gr(Object.entries(l).map((function(e){var r=qr(e,2),t=r[0],n=r[1];return"".concat(t,"=").concat(n)})))):e.push("".concat(i,"=").concat(l)));return e}),[]).join("&")}function Zr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Xr(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function et(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var rt=q(null),tt=function(r){var t=r.children,n=function(e){var r=Y((function(){return Ge.create(Xr(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){Zr(e,r,t[r])}))}return e}({},e),{paramsSerializer:Jr}))}),[e]);return{endpoint:r}}(et(r,["children"]));return e(rt.Provider,{value:n,children:t})};var nt,ot=function(){var e=G(rt);if(!e)throw new Error("Missing ServerContext.Provider in the tree!");return e};function at(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function it(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return at(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return at(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e){e.DARK="dark",e.LIGHT="light",e.SYSTEM="system"}(nt||(nt={}));var lt=q(null),ct=function(r){var t,n,o,a=r.children,i=(t=it(F(localStorage.theme||"system"),2),n=t[0],o=t[1],W((function(){var e=function(e){"dark"===e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};if("system"===n){var r=window.matchMedia("(prefers-color-scheme: dark)"),t=r.matches?"dark":"light";e(t);var o=function(r){e(r.matches?"dark":"light")};return r.addEventListener("change",o),function(){return r.removeEventListener("change",o)}}e(n)}),[n]),{theme:n,setTheme:function(e){o(e),localStorage.setItem("theme",e)}});return e(lt.Provider,{value:i,children:a})};var ut=function(e){var r,t=new Set,n=function(e,n){var o,a="function"==typeof e?e(r):e;if(!Object.is(a,r)){var i=r;r=(null!=n?n:"object"!=(void 0===a?"undefined":(o=a)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)||null===a)?a:Object.assign({},r,a),t.forEach((function(e){return e(r,i)}))}},o=function(){return r},a={setState:n,getState:o,getInitialState:function(){return i},subscribe:function(e){return t.add(e),function(){return t.delete(e)}},destroy:function(){"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},i=r=e(n,o,a);return a};function st(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ft,dt={exports:{}},pt={},yt={exports:{}},mt={};var ht,bt,vt,gt={};
/**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/function Ot(){return ht||(ht=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=B,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];!function(e,t,n){var o=r.ReactDebugCurrentFrame.getStackAddendum();""!==o&&(t+="%s",n=n.concat([o]));var a=n.map((function(e){return String(e)}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}("error",e,n)}var n="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},o=e.useState,a=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue,c=!1,u=!1;function s(e){var r=e.getSnapshot,t=e.value;try{var o=r();return!n(t,o)}catch(e){return!0}}var f=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,r,t){return r()}:function(r,f,d){c||void 0!==e.startTransition&&(c=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=f();if(!u){var y=f();n(p,y)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}var m=o({inst:{value:p,getSnapshot:f}}),h=m[0].inst,b=m[1];return i((function(){h.value=p,h.getSnapshot=f,s(h)&&b({inst:h})}),[r,p,f]),a((function(){s(h)&&b({inst:h});return r((function(){s(h)&&b({inst:h})}))}),[r]),l(p),p},d=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:f;gt.useSyncExternalStore=d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),gt}function wt(){return bt||(bt=1,"production"===process.env.NODE_ENV?yt.exports=function(){if(ft)return mt;ft=1;var e=B,r="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},t=e.useState,n=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function i(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,r){return r()}:function(e,r){var l=r(),c=t({inst:{value:l,getSnapshot:r}}),u=c[0].inst,s=c[1];return o((function(){u.value=l,u.getSnapshot=r,i(u)&&s({inst:u})}),[e,l,r]),n((function(){return i(u)&&s({inst:u}),e((function(){i(u)&&s({inst:u})}))}),[e]),a(l),l};return mt.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,mt}():yt.exports=Ot()),yt.exports}
/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xt,St={};
/**
* @license React
* use-sync-external-store-shim/with-selector.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/"production"===process.env.NODE_ENV?dt.exports=function(){if(vt)return pt;vt=1;var e=B,r=wt(),t="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},n=r.useSyncExternalStore,o=e.useRef,a=e.useEffect,i=e.useMemo,l=e.useDebugValue;return pt.useSyncExternalStoreWithSelector=function(e,r,c,u,s){var f=o(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i((function(){function e(e){if(!a){if(a=!0,n=e,e=u(e),void 0!==s&&d.hasValue){var r=d.value;if(s(r,e))return o=r}return o=e}if(r=o,t(n,e))return r;var i=u(e);return void 0!==s&&s(r,i)?r:(n=e,o=i)}var n,o,a=!1,i=void 0===c?null:c;return[function(){return e(r())},null===i?void 0:function(){return e(i())}]}),[r,c,u,s]);var p=n(e,f[0],f[1]);return a((function(){d.hasValue=!0,d.value=p}),[p]),l(p),p},pt}():dt.exports=(xt||(xt=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=B,r=wt(),t="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},n=r.useSyncExternalStore,o=e.useRef,a=e.useEffect,i=e.useMemo,l=e.useDebugValue;St.useSyncExternalStoreWithSelector=function(e,r,c,u,s){var f,d=o(null);null===d.current?(f={hasValue:!1,value:null},d.current=f):f=d.current;var p=i((function(){var e,n,o=!1,a=function(r){if(!o){o=!0,e=r;var a=u(r);if(void 0!==s&&f.hasValue){var i=f.value;if(s(i,a))return n=i,i}return n=a,a}var l=n;if(t(e,r))return l;var c=u(r);return void 0!==s&&s(l,c)?l:(e=r,n=c,c)},i=void 0===c?null:c;return[function(){return a(r())},null===i?void 0:function(){return a(i())}]}),[r,c,u,s]),y=p[0],m=p[1],h=n(e,y,m);return a((function(){f.hasValue=!0,f.value=h}),[h]),l(h),h},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),St);var jt=st(dt.exports),kt=B.useDebugValue,Pt=jt.useSyncExternalStoreWithSelector,Nt=!1,Et=function(e){return e};function At(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Et,t=arguments.length>2?arguments[2]:void 0;"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&t&&!Nt&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Nt=!0);var n=Pt(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,t);return kt(n),n}var Dt=function(e){"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");var r="function"==typeof e?function(e){return e?ut(e):ut}(e):e,t=function(e,t){return At(r,e,t)};return Object.assign(t,r),t};function It(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _t(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Tt(e,r){return null!=r&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function Ct(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){_t(e,r,t[r])}))}return e}function zt(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||Mt(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lt(e){return function(e){if(Array.isArray(e))return It(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Mt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mt(e,r){if(e){if("string"==typeof e)return It(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?It(e,r):void 0}}function Rt(e,r){var t;try{t=e()}catch(e){return}return{getItem:function(e){var r,n=function(e){return null===e?null:JSON.parse(e,void 0)},o=null!=(r=t.getItem(e))?r:null;return Tt(o,Promise)?o.then(n):n(o)},setItem:function(e,r){return t.setItem(e,JSON.stringify(r,void 0))},removeItem:function(e){return t.removeItem(e)}}}var Kt,Ut=function(e){return function(r){try{var t=e(r);return Tt(t,Promise)?t:{then:function(e){return Ut(e)(t)},catch:function(e){return this}}}catch(e){return{then:function(e){return this},catch:function(r){return Ut(r)(e)}}}}},Vt=function(e,r){return"getStorage"in r||"serialize"in r||"deserialize"in r?("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),function(e,r){return function(t,n,o){var a,i=Ct({getStorage:function(){return localStorage},serialize:JSON.stringify,deserialize:JSON.parse,partialize:function(e){return e},version:0,merge:function(e,r){return Ct({},r,e)}},r),l=!1,c=new Set,u=new Set;try{a=i.getStorage()}catch(e){}if(!a)return e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];console.warn("[zustand persist middleware] Unable to update item '".concat(i.name,"', the given storage is currently unavailable.")),t.apply(void 0,Lt(r))}),n,o);var s=Ut(i.serialize),f=function(){var e,r=i.partialize(Ct({},n())),t=s({state:r,version:i.version}).then((function(e){return a.setItem(i.name,e)})).catch((function(r){e=r}));if(e)throw e;return t},d=o.setState;o.setState=function(e,r){d(e,r),f()};var p,y=e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.apply(void 0,Lt(r)),f()}),n,o),m=function(){var e;if(a){l=!1,c.forEach((function(e){return e(n())}));var r=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,n()))||void 0;return Ut(a.getItem.bind(a))(i.name).then((function(e){if(e)return i.deserialize(e)})).then((function(e){if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((function(e){var r;return p=i.merge(e,null!=(r=n())?r:y),t(p,!0),f()})).then((function(){null==r||r(p,void 0),l=!0,u.forEach((function(e){return e(p)}))})).catch((function(e){null==r||r(void 0,e)}))}};return o.persist={setOptions:function(e){i=Ct({},i,e),e.getStorage&&(a=e.getStorage())},clearStorage:function(){null==a||a.removeItem(i.name)},getOptions:function(){return i},rehydrate:function(){return m()},hasHydrated:function(){return l},onHydrate:function(e){return c.add(e),function(){c.delete(e)}},onFinishHydration:function(e){return u.add(e),function(){u.delete(e)}}},m(),p||y}}(e,r)):function(e,r){return function(t,n,o){var a=Ct({storage:Rt((function(){return localStorage})),partialize:function(e){return e},version:0,merge:function(e,r){return Ct({},r,e)}},r),i=!1,l=new Set,c=new Set,u=a.storage;if(!u)return e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];console.warn("[zustand persist middleware] Unable to update item '".concat(a.name,"', the given storage is currently unavailable.")),t.apply(void 0,Lt(r))}),n,o);var s=function(){var e=a.partialize(Ct({},n()));return u.setItem(a.name,{state:e,version:a.version})},f=o.setState;o.setState=function(e,r){f(e,r),s()};var d,p=e((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.apply(void 0,Lt(r)),s()}),n,o);o.getInitialState=function(){return p};var y=function(){var e,r;if(u){i=!1,l.forEach((function(e){var r;return e(null!=(r=n())?r:p)}));var o=(null==(r=a.onRehydrateStorage)?void 0:r.call(a,null!=(e=n())?e:p))||void 0;return Ut(u.getItem.bind(u))(a.name).then((function(e){if(e){if("number"!=typeof e.version||e.version===a.version)return[!1,e.state];if(a.migrate)return[!0,a.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]})).then((function(e){var r,o=zt(e,2),i=o[0],l=o[1];if(d=a.merge(l,null!=(r=n())?r:p),t(d,!0),i)return s()})).then((function(){null==o||o(d,void 0),d=n(),i=!0,c.forEach((function(e){return e(d)}))})).catch((function(e){null==o||o(void 0,e)}))}};return o.persist={setOptions:function(e){a=Ct({},a,e),e.storage&&(u=e.storage)},clearStorage:function(){null==u||u.removeItem(a.name)},getOptions:function(){return a},rehydrate:function(){return y()},hasHydrated:function(){return i},onHydrate:function(e){return l.add(e),function(){l.delete(e)}},onFinishHydration:function(e){return c.add(e),function(){c.delete(e)}}},a.skipHydration||y(),d||p}}(e,r)};!function(e){e.NODEJS="js",e.PYTHON="py",e.CURL="bash"}(Kt||(Kt={}));var Ht=function(){return(e?Dt(e):Dt)(Vt((function(e){return{isShrink:!1,lang:"js",setLang:function(r){return e({lang:r})},setShrink:function(r){return e((function(e){return{isShrink:void 0!==r?r:!e.isShrink}}))}}}),{name:"preferences",storage:Rt((function(){return sessionStorage}))}));var e},$t=q(null);function Bt(t){var n=t.children,o=Q(Ht()).current;return r($t.Provider,{value:o,children:[e(Ft,{}),n]})}function Ft(){var r,n=qt((function(e){return{setShrink:e.setShrink}})).setShrink,o=null!==(r=ae({sm:!1,md:!0,lg:!0,xl:!1}))&&void 0!==r&&r;return W((function(){n(o)}),[o]),e(t,{})}function qt(e){var r=G($t);if(!r)throw new Error("Missing PreferencesContext.Provider in the tree!");return At(r,e)}function Gt(r){return e("div",{className:"flex w-full h-screen text-black dark:text-white dark:bg-secondary-950 selection:text-secondary-700 bg-white selection:bg-[#79ffe1] dark:selection:bg-[#f81ce5] dark:selection:text-white",children:r.children})}function Yt(){var n=Kr().action,o=n.state,a=n.setState,i=o.show?ie((function(){o.action(),a({show:!1})})):void 0;return r(le,{size:"sm",open:o.show,onOpenChange:function(){return a({show:!1})},children:[e(ce,{}),e(ue,{className:"gap-1 rounded-lg",children:o.show&&r(t,{children:[e(se,{children:o.title}),e(fe,{children:o.message}),r("div",{className:"flex justify-between mt-4",children:[e(de,{asChild:!0,children:e(pe,{children:"Cancel"})}),e(pe,{colorScheme:"error",onClick:i,onKeyDown:i,children:"Confirm"})]})]})})]})}function Wt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Qt(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function Jt(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function Zt(r){var t=r.className,n=Jt(r,["className"]);return e("img",Qt(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){Wt(e,r,t[r])}))}return e}({},n),{src:"https://honohub.dev/images/logo-small.png",alt:"honohub logo",className:ye("size-7",t)}))}function Xt(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function en(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function rn(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){en(e,r,t[r])}))}return e}function tn(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function nn(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function on(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return Xt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Xt(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var an,ln=J((function(t,n){var o=t.className,a=t.options,i=nn(t,["className","options"]),l=qt((function(e){return e.isShrink}));return r("div",tn(rn({},i),{className:ye("flex h-full relative flex-col flex-shrink-0 flex-grow-0",l?"w-16":"w-[250px] min-w-[250px] max-w-[250px]",o),ref:n,children:[e("header",{className:"px-3 my-[7.5px]",children:e("div",{className:"w-max",children:e(T,{to:"/",children:l?e(Zt,{className:"h-[39px] w-max"}):r("div",{className:"flex items-center ml-1 w-max",children:[e(Zt,{className:"h-8 w-max"}),r("p",{className:"text-[26px] font-bold tracking-tight",children:["Hono",e("span",{className:"text-primary-500 dark:text-primary-300",children:"Hub"})]})]})})})}),e("hr",{className:l?"border-transparent":"border-secondary-200 dark:border-secondary-800"}),e("div",{className:"mt-[15px] px-3 overflow-x-hidden overflow-y-auto h-full",children:Object.entries(a).map((function(t,n){var o=on(t,2),a=o[0],i=o[1];return r(Z,{children:[0!==n&&(l?e("div",{className:"h-[33px] flex items-center",children:e("hr",{className:"border-secondary-200 dark:border-secondary-800 w-full"})}):e(cn,{children:a})),i.map((function(r){return e(un,rn({},r),r.label)}))]},a)}))}),e(sn,{})]}))}));function cn(r){return e("div",{className:"w-full mx-[5px] first:mt-0 mt-5 mb-1.5 font-semibold text-[10px] text-secondary-500 dark:text-secondary-400 uppercase select-none",children:r.children})}function un(t){var n=t.label,a=t.icon,i=t.path,l=qt((function(e){return e.isShrink}));return r(C,{title:n,to:i,className:function(e){var r=e.isActive;return ye("cursor-pointer outline-none no-underline flex w-full items-center gap-2 mb-2 px-3 py-1 min-h-10 rounded-md min-w-0 select-none transition-all ease-in-out",r?"bg-primary-100 text-primary-600 dark:bg-secondary-700/80 dark:text-white":"text-secondary-600 dark:text-secondary-400 hover:text-black dark:hover:text-white hover:bg-secondary-100 dark:hover:bg-secondary-800/80",l&&"w-max")},children:[e(null!=a?a:o,{className:"size-4 stroke-2"}),!l&&e(me,{className:"font-semibold text-sm leading-none",children:n})]})}function sn(){var r=qt((function(e){return{isShrink:e.isShrink,setShrink:e.setShrink}})),t=r.isShrink,n=r.setShrink,o=t?a:i,l=ie((function(){return n()}));return e(pe,{className:"hidden lg:block absolute bottom-6 hover:dark:bg-secondary-950 hover:bg-white -right-4 border border-secondary-300 dark:border-secondary-700 bg-white dark:bg-secondary-950",size:"fab",onClick:l,onKeyDown:l,children:e(o,{className:"size-4 stroke-2 stroke-secondary-500 dark:stroke-secondary-400"})})}function fn(t){var n=t.options,o=Br(),a=o.isOpen,i=o.setOpen,l=z().pathname;return W((function(){i(!1)}),[l]),r(he,{side:"left",open:a,onOpenChange:i,children:[e(be,{className:"z-[100]",children:e(ve,{className:"top-2 right-2"})}),e(ge,{className:"w-max p-0 z-[100] dark:bg-secondary-900",children:e(ln,{options:n})})]})}function dn(t){var n=t.options;return e(Rr,{children:e($r,{children:r(Gt,{children:[e(ln,{options:n,className:"hidden md:flex border-r border-secondary-200 dark:border-secondary-800"}),e(L,{}),e(Yt,{}),e(fn,{options:n})]})})})}function pn(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function yn(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function mn(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function hn(r){var t=r.children,n=r.className,o=mn(r,["children","className"]);return e("div",yn(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){pn(e,r,t[r])}))}return e}({},o),{className:ye("flex-1 px-3 py-2 md:px-[18px] md:py-3 lg:px-6 lg:py-4 overflow-x-hidden overflow-y-auto scroll-smooth",n),children:e("div",{className:"flex flex-col min-h-0 w-full flex-grow gap-3 md:gap-4 lg:gap-5",children:t})}))}function bn(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function vn(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function gn(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function On(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return bn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bn(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wn(n){var o=n.options,a=ae({sm:"drawer",md:"static",lg:"static",xl:"static"}),i=On(oe(),2),s=i[0],f=i[1],d=z().pathname;W((function(){f(!1)}),[d]);var p=ie((function(){return f()})),y=s?c:u,m=function(t){var n=t.className;return r("div",{className:ye("flex items-center w-full bg-secondary-100 dark:bg-secondary-900 p-3 md:p-4 lg:p-5 gap-2 md:gap-3 lg:gap-4 text-secondary-700 dark:text-secondary-300",n),children:[e(l,{className:"size-[18px] stroke-3"}),e("p",{className:"font-medium",children:"Collections"}),e("div",{className:"flex-1"}),e(pe,{size:"icon",variant:"ghost",onClick:p,onKeyDown:p,children:e(y,{className:"size-[18px] stroke-[3]"})})]})};return"drawer"===a?r(t,{children:[e(m,{className:"fixed z-30 bottom-0"}),r(he,{open:s,onOpenChange:f,children:[e(be,{className:"z-40 bg-black/5"}),r(ge,{className:"h-max z-40 max-h-[60%] flex flex-col bottom-0 top-auto !animate-none dark:bg-secondary-900 p-0 shadow-[0_-8px_10px_-5px_rgb(0,0,0,0.1)] dark:shadow-none",children:[e(xn,{options:o}),e(m,{})]})]})]}):e("div",{className:"flex h-full w-[250px] min-w-[250px] max-w-[250px] border-r flex-col flex-shrink-0 flex-grow-0 dark:border-secondary-800",children:e(xn,{options:o})})}function xn(n){var o=n.options,a=On(F(),2),i=a[0],l=a[1],c=On(Y((function(){var e=o.map((function(e){var r=e.label,t=e.slug;return{label:Qr(r),slug:t}}));return[e,new ar(e,{keys:["label"],includeMatches:!0})]}),[o]),2),u=c[0],s=c[1],f=u,d=!1;if(i){var p=s.search(i);0===p.length&&(d=!0),f=p.reduce((function(e,r){var t=r.item,n=r.matches;return e.push(gn(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){vn(e,r,t[r])}))}return e}({},t),{matches:null==n?void 0:n.flatMap((function(e){return e.indices}))})),e}),[])}return r(t,{children:[e("header",{className:"px-4 my-[15px]",children:e(Oe,{size:"sm",type:"search",value:i,onChange:function(e){return l(e.target.value)},placeholder:"Search...",variant:"ghost",className:"px-0 py-0 focus:border-transparent focus:ring-transparent dark:focus:border-transparent dark:focus:ring-transparent dark:ring-offset-transparent ring-offset-transparent"})}),e("hr",{className:"dark:border-secondary-800"}),e("div",{className:"mt-[15px] px-3 overflow-x-hidden overflow-y-auto h-full",children:d?e("p",{className:"font-medium text-sm text-center select-none text-secondary-400 dark:text-secondary-600",children:"Not found"}):f.map((function(r){var t=r.slug,n=r.label,o=r.matches;return e(Sn,{link:t,label:n,matches:o},t)}))})]})}function Sn(r){var t=r.link,n=r.label,o=r.matches,a=Qr(n);return e(C,{title:a,to:t,className:function(e){var r=e.isActive;return ye("cursor-pointer outline-none no-underline flex w-full items-center gap-2 mb-2 px-3 py-1 min-h-10 rounded-md min-w-0 select-none transition-all ease-in-out",r?"bg-primary-100 text-primary-600 dark:bg-secondary-700/80 dark:text-white":"text-secondary-600 dark:text-secondary-400 hover:text-black dark:hover:text-white hover:bg-secondary-100 dark:hover:bg-secondary-800/80")},children:e(me,{className:"font-semibold text-sm leading-none capitalize",children:We(a,o)})})}function jn(n){var o=n.options,a=M(),i=z().pathname;return W((function(){"/collections"===i&&a("/collections/".concat(o[0].slug))}),[o,i]),r(t,{children:[e(wn,{options:o}),e(hn,{className:"[&>div]:h-full",children:e(L,{})})]})}function kn(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Pn(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){kn(e,r,t[r])}))}return e}function Nn(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function En(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}!function(e){e.DRAWER="drawer",e.STATIC="static"}(an||(an={}));var An=J((function(t,n){var o=t.className,a=t.children,i=En(t,["className","children"]),l=Br().setOpen,c=ie((function(){return l(!0)}));return r("header",Nn(Pn({},i),{className:ye("flex items-center gap-2",o),ref:n,children:[e(pe,{variant:"ghost",size:"icon",className:"md:hidden",onClick:c,onKeyDown:c,children:e(u,{className:"size-[18px] stroke-[3]"})}),a]}))})),Dn=J((function(r,t){var n=r.as,o=void 0===n?"h2":n,a=r.className,i=En(r,["as","className"]);return e(o,Nn(Pn({},i),{className:ye("text-2xl md:text-3xl font-bold dark:text-secondary-100 leading-tight",a),ref:t}))}));function In(t){return r("div",{className:"flex-1 flex flex-col",children:[e(An,{className:"md:hidden px-2 py-1 md:px-2.5 md:1.5 lg:px-3 lg:py-2 border-b border-secondary-200 dark:border-secondary-800",children:e(Dn,{children:t.name})}),e("div",{className:"flex-1 overflow-x-hidden overflow-y-auto scroll-smooth",children:t.children})]})}function _n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Tn(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return _n(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _n(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cn(e,r,t,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){return void t(e)}l.done?r(c):Promise.resolve(c).then(n,o)}function zn(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ln(e,r){var t,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=r.call(e,i)}catch(e){a=[6,e],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Mn(e){var r,t,n=ot().endpoint,o=function(e){return["collections",e.slug,"reference",e.search].filter((function(e){return null!=e}))}(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){zn(e,r,t[r])}))}return e}({},e));return j({queryKey:o,queryFn:(r=function(r){var t,o,a;return Ln(this,(function(i){return t=r.pageParam,o=void 0===t?0:t,a=r.signal,[2,n.get("/collections/".concat(e.slug,"/reference"),{signal:a,params:{search:e.search,offset:10*o}}).then((function(e){return e.data}))]}))},t=function(){var e=this,t=arguments;return new Promise((function(n,o){var a=r.apply(e,t);function i(e){Cn(a,n,o,i,l,"next",e)}function l(e){Cn(a,n,o,i,l,"throw",e)}i(void 0)}))},function(e){return t.apply(this,arguments)}),getNextPageParam:function(e,r){var t=r.flatMap((function(e){return e.results})).length;if(!(e.count<=t))return r.length},initialPageParam:0})}function Rn(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Kn(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}(e,r)||Vn(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Un(e){return function(e){if(Array.isArray(e))return Rn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Vn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vn(e,r){if(e){if("string"==typeof e)return Rn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Rn(e,r):void 0}}function Hn(e){var r=Kn(dr(e,yr(mr)),2),t=r[0],n=r[1];return{query:t,clear:ie((function(){return n(null)})),setQuery:function(e){return ie((function(){return n((function(r){var t=r?Un(r):[],n=t.findIndex((function(r){return r===e}));return n>-1?t.splice(n,1):t.push(e),0===t.length?null:t}))}))}}}function $n(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Bn(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function Fn(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function qn(n){var o=n.label,a=n.name,i=n.children,l=Hn(a),u=l.query,f=l.clear;return r(we,{value:a,className:"flex flex-col",children:[r(xe,{className:"bg-transparent dark:bg-transparent hover:bg-secondary-100 dark:hover:bg-secondary-900 data-[state=open]:bg-secondary-100 dark:data-[state=open]:bg-secondary-900 py-2 flex-none data-[state=open]:text-black dark:data-[state=open]:text-white justify-start gap-2 capitalize",showIcon:!1,children:[e(s,{className:"stroke-secondary-600 group-data-[state=open]:stroke-black dark:stroke-secondary-400 dark:group-data-[state=open]:stroke-white shrink-0 -rotate-90 stroke-[2.5] transition-transform duration-200 group-data-[state=open]:rotate-0 size-3.5"}),o,u&&u.length>0&&r(t,{children:[e("div",{className:"flex-1"}),e("div",{className:"p-0.5 rounded text-red-500 dark:text-red-300 hover:bg-red-200/40 dark:hover:bg-red-300/10 transition-all outline-none focus-visible:ring-2 ring-red-300 dark:ring-red-100 ring-offset-2 ring-offset-white dark:ring-offset-secondary-950",onClick:f,onKeyDown:f,children:e(c,{className:"size-3.5 stroke-2"})})]})]}),e(Se,{className:"h-full px-0",children:i})]})}var Gn=J((function(t,n){var o=t.items,a=t.className,i=Fn(t,["items","className"]),l=Hn(i.name),c=l.query,u=l.setQuery;return e("div",Bn(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){$n(e,r,t[r])}))}return e}({},i),{className:ye("w-full max-h-[250px] overflow-y-auto",a),children:o.map((function(t){return r("div",{className:"px-2.5 py-1.5 hover:dark:bg-secondary-800 rounded-sm cursor-pointer transition-all hover:bg-secondary-100 flex justify-between items-center",onClick:u(t.value),onKeyDown:u(t.value),ref:n,children:[e("p",{className:"text-xs",children:t.label}),(null==c?void 0:c.includes(t.value))&&e(f,{className:"size-3.5 stroke-2 stroke-primary-500 dark:stroke-primary-300"})]},t.value)}))}))}));function Yn(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Wn(e,r