ocean-brain 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/server/client/dist/assets/{ArrowRight.es-C4zlc54Z.js → ArrowRight.es-CbA8ey6a.js} +1 -1
- package/server/client/dist/assets/{Calendar-COrN6Hjv.js → Calendar-CgWgr1BV.js} +1 -1
- package/server/client/dist/assets/{Callout-BK0K9E74.js → Callout-DKruIT0f.js} +1 -1
- package/server/client/dist/assets/{Copy.es-zm8f_XXX.js → Copy.es-DFbgpaNJ.js} +1 -1
- package/server/client/dist/assets/{Graph-BH1fzhue.js → Graph-kCltGRlY.js} +1 -1
- package/server/client/dist/assets/{Image-KXuHOG4b.js → Image-7W0DZwMo.js} +1 -1
- package/server/client/dist/assets/{Image.es-BKahRbIm.js → Image.es-5pXLx9TU.js} +1 -1
- package/server/client/dist/assets/Note-BW6Np_5g.js +20 -0
- package/server/client/dist/assets/{Plus.es-BqeC8T8h.js → Plus.es-B0sg64VJ.js} +1 -1
- package/server/client/dist/assets/{Reminders-BYG5rz1M.js → Reminders-C10fHQcl.js} +1 -1
- package/server/client/dist/assets/{Search-DBWsIMDP.js → Search-tf2nV4v0.js} +1 -1
- package/server/client/dist/assets/{SurfaceCard-CNSQfYfM.js → SurfaceCard-pydtvHfu.js} +1 -1
- package/server/client/dist/assets/{Tag-5aCfSO8Y.js → Tag-uCoYbISy.js} +1 -1
- package/server/client/dist/assets/{TagNotes-BPZjN-6l.js → TagNotes-CqOcQiRw.js} +1 -1
- package/server/client/dist/assets/{Trash.es-CRQkTnXZ.js → Trash.es-w32Goxfa.js} +1 -1
- package/server/client/dist/assets/{ViewNotes-DGLNF96x.js → ViewNotes-slPXXoOY.js} +1 -1
- package/server/client/dist/assets/{ViewSectionDialog-CzskgmMF.js → ViewSectionDialog-brTrsF6G.js} +1 -1
- package/server/client/dist/assets/{Views-DR5jT23G.js → Views-B_wsb-XJ.js} +1 -1
- package/server/client/dist/assets/{graph-vendor-UTvF2NS_.js → graph-vendor-BAF95C0g.js} +1 -1
- package/server/client/dist/assets/{image.api-8dlMwzMd.js → image.api-CYsjXiMr.js} +1 -1
- package/server/client/dist/assets/{index-VHp17GQX.js → index-BR05aSXr.js} +4 -4
- package/server/client/dist/assets/{index-DGIAh3ZY.js → index-D83QbOcw.js} +1 -1
- package/server/client/dist/assets/{index-BEUqDuAZ.css → index-DPI6YoDt.css} +1 -1
- package/server/client/dist/assets/{manage-image-RqtWKas2.js → manage-image-BYIhWu56.js} +1 -1
- package/server/client/dist/assets/{manage-image-detail-BTSIbLlQ.js → manage-image-detail-6KgmQvbN.js} +1 -1
- package/server/client/dist/assets/{mcp-EDurbggR.js → mcp-Dd98N9Hq.js} +2 -2
- package/server/client/dist/assets/{mcp-admin-adapter-DmGUo5G8.js → mcp-admin-adapter-DOgBsYpl.js} +1 -1
- package/server/client/dist/assets/note-core-CMGUaW1v.js +176 -0
- package/server/client/dist/assets/note-vendor-Hoz9Q4-4.js +54 -0
- package/server/client/dist/assets/{placeholder-DeKgSBnC.js → placeholder-siHGg9aK.js} +4 -4
- package/server/client/dist/assets/{properties-BjrZvOYn.js → properties-CyVRKgcT.js} +1 -1
- package/server/client/dist/assets/{tag.api-Dl8DQd0m.js → tag.api-CwmC8crB.js} +1 -1
- package/server/client/dist/assets/{trash-C5ntddLu.js → trash-wojQBK9Z.js} +1 -1
- package/server/client/dist/assets/{useReminderMutate-CoXXqJY2.js → useReminderMutate-DuVKxpBh.js} +1 -1
- package/server/client/dist/index.html +5 -5
- package/server/dist/app.js +0 -1
- package/server/dist/features/auth/http/api.js +0 -1
- package/server/dist/features/auth/http/login-page.js +272 -5
- package/server/dist/features/auth/http/pages.js +20 -3
- package/server/dist/features/auth/service.js +3 -2
- package/server/dist/features/cache/graphql/cache.field.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.mutation.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.query.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.resolver.js +0 -1
- package/server/dist/features/cache/graphql/cache.type-defs.js +0 -1
- package/server/dist/features/cache/graphql/index.js +0 -1
- package/server/dist/features/image/graphql/image.field.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.mutation.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.query.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.resolver.js +0 -1
- package/server/dist/features/image/graphql/image.type-defs.js +0 -1
- package/server/dist/features/image/graphql/index.js +0 -1
- package/server/dist/features/image/http/upload.js +0 -1
- package/server/dist/features/image/services/delete.js +0 -1
- package/server/dist/features/image/services/upload.js +0 -1
- package/server/dist/features/image/services/validation.js +0 -1
- package/server/dist/features/mcp-admin/http/handlers.js +0 -1
- package/server/dist/features/mcp-admin/service.js +0 -1
- package/server/dist/features/note/graphql/index.js +0 -1
- package/server/dist/features/note/graphql/note.field.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.mutation.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.query.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.resolver.js +0 -1
- package/server/dist/features/note/graphql/note.type-defs.js +0 -1
- package/server/dist/features/note/http/mcp.js +0 -1
- package/server/dist/features/note/services/authoring.js +0 -1
- package/server/dist/features/note/services/cleanup.js +0 -1
- package/server/dist/features/note/services/content-blocks.js +0 -1
- package/server/dist/features/note/services/markdown-intent-write.js +0 -1
- package/server/dist/features/note/services/markdown-patch.js +0 -1
- package/server/dist/features/note/services/properties.js +0 -1
- package/server/dist/features/note/services/search-backfill.js +0 -1
- package/server/dist/features/note/services/search.js +0 -1
- package/server/dist/features/note/services/snapshot.js +0 -1
- package/server/dist/features/note/services/tag-filter.js +0 -1
- package/server/dist/features/note/services/trash.js +0 -1
- package/server/dist/features/note/services/write-conflict.js +0 -1
- package/server/dist/features/note/services/write.js +0 -1
- package/server/dist/features/placeholder/graphql/index.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.field.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.mutation.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.query.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.resolver.js +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.type-defs.js +0 -1
- package/server/dist/features/reminder/graphql/index.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.field.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.mutation.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.query.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.resolver.js +0 -1
- package/server/dist/features/reminder/graphql/reminder.type-defs.js +0 -1
- package/server/dist/features/tag/graphql/index.js +0 -1
- package/server/dist/features/tag/graphql/tag.field.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.mutation.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.query.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.resolver.js +0 -1
- package/server/dist/features/tag/graphql/tag.type-defs.js +0 -1
- package/server/dist/features/tag/http/mcp.js +0 -1
- package/server/dist/features/tag/services/organization.js +0 -1
- package/server/dist/features/view/graphql/index.js +0 -1
- package/server/dist/features/view/graphql/view.mutation.resolver.js +0 -1
- package/server/dist/features/view/graphql/view.query.resolver.js +0 -1
- package/server/dist/features/view/graphql/view.resolver.js +0 -1
- package/server/dist/features/view/graphql/view.type-defs.js +0 -1
- package/server/dist/features/view/services/workspace.js +0 -1
- package/server/dist/main.js +0 -1
- package/server/dist/models.js +0 -1
- package/server/dist/modules/app-version.js +0 -1
- package/server/dist/modules/auth-guard.js +0 -1
- package/server/dist/modules/auth-mode.js +0 -1
- package/server/dist/modules/auth-redirect.js +0 -1
- package/server/dist/modules/blocknote-markdown-editor.js +53 -0
- package/server/dist/modules/blocknote-tree.js +0 -1
- package/server/dist/modules/blocknote.js +10 -4
- package/server/dist/modules/data-maintenance.js +0 -1
- package/server/dist/modules/error-handler.js +0 -1
- package/server/dist/modules/graphql.js +0 -1
- package/server/dist/modules/logger.js +0 -1
- package/server/dist/modules/mcp-auth.js +0 -1
- package/server/dist/modules/mcp-token.js +0 -1
- package/server/dist/modules/prisma-runtime.js +0 -1
- package/server/dist/modules/rate-limit.js +0 -1
- package/server/dist/modules/recovery-retention.js +0 -1
- package/server/dist/modules/server-events-handler.js +0 -1
- package/server/dist/modules/server-events.js +0 -1
- package/server/dist/modules/session-store.js +0 -1
- package/server/dist/modules/use-async.js +0 -1
- package/server/dist/paths.js +0 -1
- package/server/dist/routes/api.js +0 -1
- package/server/dist/routes/auth-pages.js +0 -1
- package/server/dist/routes/client.js +0 -1
- package/server/dist/routes/graphql.js +0 -1
- package/server/dist/routes/index.js +0 -1
- package/server/dist/routes/mcp.js +0 -1
- package/server/dist/schema/index.js +0 -1
- package/server/dist/start.js +0 -1
- package/server/dist/types/index.js +0 -1
- package/server/dist/types/input.js +0 -1
- package/server/client/dist/assets/Note-C143cKKw.js +0 -12
- package/server/client/dist/assets/note-core-BklwyZHk.js +0 -180
- package/server/client/dist/assets/note-vendor-DkYKUmLo.js +0 -54
- package/server/client/dist/fonts/Pretendard-Bold.woff +0 -0
- package/server/client/dist/fonts/Pretendard-Regular.woff +0 -0
- package/server/dist/app.js.map +0 -1
- package/server/dist/features/auth/http/api.js.map +0 -1
- package/server/dist/features/auth/http/login-page.js.map +0 -1
- package/server/dist/features/auth/http/pages.js.map +0 -1
- package/server/dist/features/auth/service.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.field.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.mutation.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.query.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.resolver.js.map +0 -1
- package/server/dist/features/cache/graphql/cache.type-defs.js.map +0 -1
- package/server/dist/features/cache/graphql/index.js.map +0 -1
- package/server/dist/features/image/graphql/image.field.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.mutation.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.query.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.resolver.js.map +0 -1
- package/server/dist/features/image/graphql/image.type-defs.js.map +0 -1
- package/server/dist/features/image/graphql/index.js.map +0 -1
- package/server/dist/features/image/http/upload.js.map +0 -1
- package/server/dist/features/image/services/delete.js.map +0 -1
- package/server/dist/features/image/services/upload.js.map +0 -1
- package/server/dist/features/image/services/validation.js.map +0 -1
- package/server/dist/features/mcp-admin/http/handlers.js.map +0 -1
- package/server/dist/features/mcp-admin/service.js.map +0 -1
- package/server/dist/features/note/graphql/index.js.map +0 -1
- package/server/dist/features/note/graphql/note.field.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.mutation.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.query.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.resolver.js.map +0 -1
- package/server/dist/features/note/graphql/note.type-defs.js.map +0 -1
- package/server/dist/features/note/http/mcp.js.map +0 -1
- package/server/dist/features/note/services/authoring.js.map +0 -1
- package/server/dist/features/note/services/cleanup.js.map +0 -1
- package/server/dist/features/note/services/content-blocks.js.map +0 -1
- package/server/dist/features/note/services/markdown-intent-write.js.map +0 -1
- package/server/dist/features/note/services/markdown-patch.js.map +0 -1
- package/server/dist/features/note/services/properties.js.map +0 -1
- package/server/dist/features/note/services/search-backfill.js.map +0 -1
- package/server/dist/features/note/services/search.js.map +0 -1
- package/server/dist/features/note/services/snapshot.js.map +0 -1
- package/server/dist/features/note/services/tag-filter.js.map +0 -1
- package/server/dist/features/note/services/trash.js.map +0 -1
- package/server/dist/features/note/services/write-conflict.js.map +0 -1
- package/server/dist/features/note/services/write.js.map +0 -1
- package/server/dist/features/placeholder/graphql/index.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.field.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.mutation.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.query.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.resolver.js.map +0 -1
- package/server/dist/features/placeholder/graphql/placeholder.type-defs.js.map +0 -1
- package/server/dist/features/reminder/graphql/index.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.field.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.mutation.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.query.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.resolver.js.map +0 -1
- package/server/dist/features/reminder/graphql/reminder.type-defs.js.map +0 -1
- package/server/dist/features/tag/graphql/index.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.field.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.mutation.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.query.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.resolver.js.map +0 -1
- package/server/dist/features/tag/graphql/tag.type-defs.js.map +0 -1
- package/server/dist/features/tag/http/mcp.js.map +0 -1
- package/server/dist/features/tag/services/organization.js.map +0 -1
- package/server/dist/features/view/graphql/index.js.map +0 -1
- package/server/dist/features/view/graphql/view.mutation.resolver.js.map +0 -1
- package/server/dist/features/view/graphql/view.query.resolver.js.map +0 -1
- package/server/dist/features/view/graphql/view.resolver.js.map +0 -1
- package/server/dist/features/view/graphql/view.type-defs.js.map +0 -1
- package/server/dist/features/view/services/workspace.js.map +0 -1
- package/server/dist/main.js.map +0 -1
- package/server/dist/models.js.map +0 -1
- package/server/dist/modules/app-version.js.map +0 -1
- package/server/dist/modules/auth-guard.js.map +0 -1
- package/server/dist/modules/auth-mode.js.map +0 -1
- package/server/dist/modules/auth-redirect.js.map +0 -1
- package/server/dist/modules/blocknote-tree.js.map +0 -1
- package/server/dist/modules/blocknote.js.map +0 -1
- package/server/dist/modules/data-maintenance.js.map +0 -1
- package/server/dist/modules/error-handler.js.map +0 -1
- package/server/dist/modules/graphql.js.map +0 -1
- package/server/dist/modules/logger.js.map +0 -1
- package/server/dist/modules/mcp-auth.js.map +0 -1
- package/server/dist/modules/mcp-token.js.map +0 -1
- package/server/dist/modules/prisma-runtime.js.map +0 -1
- package/server/dist/modules/rate-limit.js.map +0 -1
- package/server/dist/modules/recovery-retention.js.map +0 -1
- package/server/dist/modules/server-events-handler.js.map +0 -1
- package/server/dist/modules/server-events.js.map +0 -1
- package/server/dist/modules/session-store.js.map +0 -1
- package/server/dist/modules/use-async.js.map +0 -1
- package/server/dist/paths.js.map +0 -1
- package/server/dist/routes/api.js.map +0 -1
- package/server/dist/routes/auth-pages.js.map +0 -1
- package/server/dist/routes/client.js.map +0 -1
- package/server/dist/routes/graphql.js.map +0 -1
- package/server/dist/routes/index.js.map +0 -1
- package/server/dist/routes/mcp.js.map +0 -1
- package/server/dist/schema/index.js.map +0 -1
- package/server/dist/start.js.map +0 -1
- package/server/dist/types/index.js.map +0 -1
- package/server/dist/types/input.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-
|
|
2
|
-
import{j as g,w as u1,r as Zt,R as lu,a as ri,c as d1,u as f1,o as h1,s as p1,f as m1,b as g1,d as v1,h as y1,e as b1,l as w1,_ as Je,g as x1}from"./note-vendor-DkYKUmLo.js";import{a as u,R as ns,N as X,g as Xn,r as E1,P as De,c as ro}from"./graph-vendor-UTvF2NS_.js";import"./note-core-BklwyZHk.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const oi={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},uu=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,si=(e,t,n=!0)=>{const r=uu(e);n&&t(r?.matches||!1);const o=s=>{t?.(s.matches)};return r?.addEventListener("change",o),()=>{r?.removeEventListener("change",o)}},_1=(e,t=!0)=>si(oi.DARK,e,t),S1=(e,t,n=!0)=>si(oi.RESPONSIVE(e),t,n),C1={MEDIA_QUERY:oi,listenThemeChange:_1,listenResponsiveChange:S1,createMediaQuery:uu,listenMediaQueryChange:si};var je=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(je||{});function du({update:e,notify:t,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:i,shallowPropagate:a};function r(l,f,d){const p=f.depsTail;if(p!==void 0&&p.dep===l)return;const h=p!==void 0?p.nextDep:f.deps;if(h!==void 0&&h.dep===l){h.version=d,f.depsTail=h;return}const y=l.subsTail;if(y!==void 0&&y.version===d&&y.sub===f)return;const m=f.depsTail=l.subsTail={version:d,dep:l,sub:f,prevDep:p,nextDep:h,prevSub:y,nextSub:void 0};h!==void 0&&(h.prevDep=m),p!==void 0?p.nextDep=m:f.deps=m,y!==void 0?y.nextSub=m:l.subs=m}function o(l,f=l.sub){const d=l.dep,p=l.prevDep,h=l.nextDep,y=l.nextSub,m=l.prevSub;return h!==void 0?h.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=h:f.deps=h,y!==void 0?y.prevSub=m:d.subsTail=m,m!==void 0?m.nextSub=y:(d.subs=y)===void 0&&n(d),h}function s(l){let f=l.nextSub,d;e:do{const p=l.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&c(l,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const y=p.subs;if(y!==void 0){const m=(l=y).nextSub;m!==void 0&&(d={value:f,prev:d},f=m);continue}}if((l=f)!==void 0){f=l.nextSub;continue}for(;d!==void 0;)if(l=d.value,d=d.prev,l!==void 0){f=l.nextSub;continue e}break}while(!0)}function i(l,f){let d,p=0,h=!1;e:do{const y=l.dep,m=y.flags;if(f.flags&16)h=!0;else if((m&17)===17){if(e(y)){const v=y.subs;v.nextSub!==void 0&&a(v),h=!0}}else if((m&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(d={value:l,prev:d}),l=y.deps,f=y,++p;continue}if(!h){const v=l.nextDep;if(v!==void 0){l=v;continue}}for(;p--;){const v=f.subs,b=v.nextSub!==void 0;if(b?(l=d.value,d=d.prev):l=v,h){if(e(f)){b&&a(v),f=l.sub;continue}h=!1}else f.flags&=-33;f=l.sub;const w=l.nextDep;if(w!==void 0){l=w;continue e}}return h}while(!0)}function a(l){do{const f=l.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&t(f))}while((l=l.nextSub)!==void 0)}function c(l,f){let d=f.depsTail;for(;d!==void 0;){if(d===l)return!0;d=d.prevDep}return!1}}let ai=0,fn=0,xr=0;const Ut=[],{link:nC,unlink:fu,propagate:rC,checkDirty:R1,shallowPropagate:oC}=du({update(e){return e.depsTail!==void 0?M1(e):N1(e)},notify(e){let t=xr,n=t;do if(Ut[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(xr=t;n<--t;){const r=Ut[n];Ut[n++]=Ut[t],Ut[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,rs(e)):k1.call(e)}});function A1(){return ai}function T1(){++ai}function P1(){--ai||I1()}function M1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,rs(e)}}function N1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function O1(e){const t=e.flags;if(t&16||t&32&&R1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,rs(e)}}else e.flags=2}function I1(){try{for(;fn<xr;){const e=Ut[fn];Ut[fn++]=void 0,O1(e)}}finally{for(;fn<xr;){const e=Ut[fn];Ut[fn++]=void 0,e.flags|=10}fn=0,xr=0}}function k1(){this.depsTail=void 0,this.flags=0,rs(this);const e=this.subs;e!==void 0&&fu(e)}function rs(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=fu(n,e)}function ii(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}const ga=[];let xo=0;const{link:fc,unlink:D1,propagate:L1,checkDirty:hu,shallowPropagate:hc}=du({update(e){return e._update()},notify(e){ga[va++]=e,e.flags&=~je.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=je.Mutable|je.Dirty,Mo(e))}});let oo=0,va=0,kt;function Mo(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=D1(n,e)}function pu(){if(!(A1()>0)){for(;oo<va;){const e=ga[oo];ga[oo++]=void 0,e.notify()}oo=0,va=0}}function mu(e,t){const n=typeof e=="function",r=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?je.None:je.Mutable,get(){return kt!==void 0&&fc(o,kt,xo),o._snapshot},subscribe(s){const i=ii(s),a={current:!1},c=j1(()=>{o.get(),a.current?i.next?.(o._snapshot):a.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(s){const i=kt,a=Object.is;if(n)kt=o,++xo,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=je.Mutable|je.RecursedCheck);try{const c=o._snapshot,l=typeof s=="function"?s(c):s===void 0&&n?r(c):s;return c===void 0||!a(c,l)?(o._snapshot=l,!0):!1}finally{kt=i,n&&(o.flags&=~je.RecursedCheck),Mo(o)}}};return n?(o.flags=je.Mutable|je.Dirty,o.get=function(){const s=o.flags;if(s&je.Dirty||s&je.Pending&&hu(o.deps,o)){if(o._update()){const i=o.subs;i!==void 0&&hc(i)}}else s&je.Pending&&(o.flags=s&~je.Pending);return kt!==void 0&&fc(o,kt,xo),o._snapshot}):o.set=function(s){if(o._update(s)){const i=o.subs;i!==void 0&&(L1(i),hc(i),pu())}},o}function j1(e){const t=()=>{const r=kt;kt=n,++xo,n.depsTail=void 0,n.flags=je.Watching|je.RecursedCheck;try{return e()}finally{kt=r,n.flags&=~je.RecursedCheck,Mo(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:je.Watching|je.RecursedCheck,notify(){const r=this.flags;r&je.Dirty||r&je.Pending&&hu(this.deps,this)?t():this.flags=je.Watching},stop(){this.flags=je.None,this.depsTail=void 0,Mo(this)}};return t(),n}class F1{constructor(t){this.atom=mu(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ii(t))}}class B1{constructor(t){this.atom=mu(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ii(t))}}function $1(e){return typeof e=="function"?new B1(e):new F1(e)}function H1(e){try{T1(),e()}finally{P1(),pu()}}const rn="__TSR_index",pc="popstate",mc="beforeunload";function z1(e){let t=e.getLocation();const n=new Set,r=i=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:i}))},o=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},s=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const f=e.getBlockers?.()??[],d=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&f.length&&d)for(const p of f){const h=No(c.path,c.state);if(await p.blockerFn({currentLocation:t,nextLocation:h,action:c.type})){e.onBlocked?.();return}}i()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:i=>(n.add(i),()=>{n.delete(i)}),push:(i,a,c)=>{const l=t.state[rn];a=gc(l+1,a),s({task:()=>{e.pushState(i,a),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const l=t.state[rn];a=gc(l,a),s({task:()=>{e.replaceState(i,a),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{s({task:()=>{e.go(i),o({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{s({task:()=>{e.back(i?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{s({task:()=>{e.forward(i?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[rn]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,i]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(l=>l!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function gc(e,t){t||(t={});const n=ci();return{...t,key:n,__TSR_key:n,[rn]:e}}function U1(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,i=P=>o=P,a=(P=>P),c=(()=>No(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=ci();t.history.replaceState({[rn]:0,key:P,__TSR_key:P},"")}let l=c(),f,d=!1,p=!1,h=!1,y=!1;const m=()=>l;let v,b;const w=()=>{v&&(T._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),T._ignoreSubscribers=!1,v=void 0,b=void 0,f=void 0)},_=(P,N,F)=>{const z=a(N);b||(f=l),l=No(N,F),v={href:z,state:F,isPush:v?.isPush||P==="push"},b||(b=Promise.resolve().then(()=>w()))},S=P=>{l=c(),T.notify({type:P})},C=async()=>{if(p){p=!1;return}const P=c(),N=P.state[rn]-l.state[rn],F=N===1,z=N===-1,R=!F&&!z||d;d=!1;const H=R?"GO":z?"BACK":"FORWARD",x=R?{type:"GO",index:N}:{type:z?"BACK":"FORWARD"};if(h)h=!1;else{const I=s();if(typeof document<"u"&&I.length){for(const $ of I)if(await $.blockerFn({currentLocation:l,nextLocation:P,action:H})){p=!0,t.history.go(1),T.notify(x);return}}}l=c(),T.notify(x)},O=P=>{if(y){y=!1;return}let N=!1;const F=s();if(typeof document<"u"&&F.length)for(const z of F){const R=z.enableBeforeUnload??!0;if(R===!0){N=!0;break}if(typeof R=="function"&&R()===!0){N=!0;break}}if(N)return P.preventDefault(),P.returnValue=""},T=z1({getLocation:m,getLength:()=>t.history.length,pushState:(P,N)=>_("push",P,N),replaceState:(P,N)=>_("replace",P,N),back:P=>(P&&(h=!0),y=!0,t.history.back()),forward:P=>{P&&(h=!0),y=!0,t.history.forward()},go:P=>{d=!0,t.history.go(P)},createHref:P=>a(P),flush:w,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(mc,O,{capture:!0}),t.removeEventListener(pc,C)},onBlocked:()=>{f&&l!==f&&(l=f)},getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(mc,O,{capture:!0}),t.addEventListener(pc,C),t.history.pushState=function(...P){const N=n.apply(t.history,P);return T._ignoreSubscribers||S("PUSH"),N},t.history.replaceState=function(...P){const N=r.apply(t.history,P);return T._ignoreSubscribers||S("REPLACE"),N},T}function V1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function No(e,t){const n=V1(e),r=n.indexOf("#"),o=n.indexOf("?"),s=ci();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[rn]:0,key:s,__TSR_key:s}}}function ci(){return(Math.random()+1).toString(36).substring(7)}const Z1=!1;function Er(e){let t;return H1(()=>{t=e()}),t}function Ar(e){return e[e.length-1]}function W1(e){return typeof e=="function"}function tn(e,t){return W1(e)?e(t):e}const q1=Object.prototype.hasOwnProperty,vc=Object.prototype.propertyIsEnumerable;function gt(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=wc(e)&&wc(r);if(!o&&!(Oo(e)&&Oo(r)))return r;const s=o?e:yc(e);if(!s)return r;const i=o?r:yc(r);if(!i)return r;const a=s.length,c=i.length,l=o?new Array(c):{};let f=0;for(let d=0;d<c;d++){const p=o?d:i[d],h=e[p],y=r[p];if(h===y){l[p]=h,(o?d<a:q1.call(e,p))&&f++;continue}if(h===null||y===null||typeof h!="object"||typeof y!="object"){l[p]=y;continue}const m=gt(h,y,n+1);l[p]=m,m===h&&f++}return a===c&&f===a?e:l}function yc(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!vc.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!vc.call(e,o))return!1;r.push(o)}return r}function Oo(e){if(!bc(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!bc(n)||!n.hasOwnProperty("isPrototypeOf"))}function bc(e){return Object.prototype.toString.call(e)==="[object Object]"}function wc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vn(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!vn(e[r],t[r],n))return!1;return!0}if(Oo(e)&&Oo(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!vn(e[i],t[i],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&o++;let s=0;for(const i in t)if((!r||t[i]!==void 0)&&(s++,s>o||!vn(e[i],t[i],n)))return!1;return o===s}return!1}function qn(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function K1(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Tr(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function G1(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function xc(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return G1(t)}const Y1=["http:","https:","mailto:","tel:"];function Io(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function dr(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=xc(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+xc(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function Q1(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var X1="Invariant failed";function an(e,t){if(!e)throw new Error(X1)}function ko(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const i=t.get(s);if(i)return o(i),i.value},set(s,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(s);if(a)a.value=i,o(a);else{const c={key:s,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(s,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Kn=0,xn=1,En=2,Pr=3,hn=4,gu=5;function J1(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function li(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=Kn,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const a=e.length;return n[0]=En,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(s.charCodeAt(0)===36)return n[0]=xn,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const i=J1(s);if(i){const[a,c]=i,l=s.charCodeAt(a+1);if(l===45){if(a+2<s.length&&s.charCodeAt(a+2)===36){const f=a+3,d=c;if(f<d)return n[0]=Pr,n[1]=t+a,n[2]=t+f,n[3]=t+d,n[4]=t+c+1,n[5]=o,n}}else if(l===36){const f=a+1,d=a+2;return d===c?(n[0]=En,n[1]=t+a,n[2]=t+f,n[3]=t+d,n[4]=t+c+1,n[5]=e.length,n):(n[0]=xn,n[1]=t+a,n[2]=t+d,n[3]=t+c,n[4]=t+c+1,n[5]=o,n)}}return n[0]=Kn,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function os(e,t,n,r,o,s,i){i?.(n);let a=r;{const c=n.fullPath??n.from,l=c.length,f=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<l;){const h=li(c,a,t);let y;const m=a,v=h[5];switch(a=v+1,s++,h[0]){case Kn:{const w=c.substring(h[2],h[3]);if(f){const _=o.static?.get(w);if(_)y=_;else{o.static??=new Map;const S=pn(n.fullPath??n.from);S.parent=o,S.depth=s,y=S,o.static.set(w,S)}}else{const _=w.toLowerCase(),S=o.staticInsensitive?.get(_);if(S)y=S;else{o.staticInsensitive??=new Map;const C=pn(n.fullPath??n.from);C.parent=o,C.depth=s,y=C,o.staticInsensitive.set(_,C)}}break}case xn:{const w=c.substring(m,h[1]),_=c.substring(h[4],v),S=f&&!!(w||_),C=w?S?w:w.toLowerCase():void 0,O=_?S?_:_.toLowerCase():void 0,T=!d&&o.dynamic?.find(P=>!P.skipOnParamError&&P.caseSensitive===S&&P.prefix===C&&P.suffix===O);if(T)y=T;else{const P=$s(xn,n.fullPath??n.from,S,C,O);y=P,P.depth=s,P.parent=o,o.dynamic??=[],o.dynamic.push(P)}break}case Pr:{const w=c.substring(m,h[1]),_=c.substring(h[4],v),S=f&&!!(w||_),C=w?S?w:w.toLowerCase():void 0,O=_?S?_:_.toLowerCase():void 0,T=!d&&o.optional?.find(P=>!P.skipOnParamError&&P.caseSensitive===S&&P.prefix===C&&P.suffix===O);if(T)y=T;else{const P=$s(Pr,n.fullPath??n.from,S,C,O);y=P,P.parent=o,P.depth=s,o.optional??=[],o.optional.push(P)}break}case En:{const w=c.substring(m,h[1]),_=c.substring(h[4],v),S=f&&!!(w||_),C=w?S?w:w.toLowerCase():void 0,O=_?S?_:_.toLowerCase():void 0,T=$s(En,n.fullPath??n.from,S,C,O);y=T,T.parent=o,T.depth=s,o.wildcard??=[],o.wildcard.push(T)}}o=y}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const h=pn(n.fullPath??n.from);h.kind=gu,h.parent=o,s++,h.depth=s,o.pathless??=[],o.pathless.push(h),o=h}const p=(n.path||!n.children)&&!n.isRoot;if(p&&c.endsWith("/")){const h=pn(n.fullPath??n.from);h.kind=hn,h.parent=o,s++,h.depth=s,o.index=h,o=h}o.parse=n.options?.params?.parse??null,o.skipOnParamError=d,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,p&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)os(e,t,c,a,o,s,i)}function Bs(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Jt(e){if(e.pathless)for(const t of e.pathless)Jt(t);if(e.static)for(const t of e.static.values())Jt(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Jt(t);if(e.dynamic?.length){e.dynamic.sort(Bs);for(const t of e.dynamic)Jt(t)}if(e.optional?.length){e.optional.sort(Bs);for(const t of e.optional)Jt(t)}if(e.wildcard?.length){e.wildcard.sort(Bs);for(const t of e.wildcard)Jt(t)}}function pn(e){return{kind:Kn,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function $s(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function em(e,t){const n=pn("/"),r=new Uint16Array(6);for(const o of e)os(!1,r,o,1,n,0);Jt(n),t.masksTree=n,t.flatCache=ko(1e3)}function tm(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=ui(e,t.masksTree);return t.flatCache.set(e,r),r}function nm(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let i=o.singleCache.get(s);if(!i){i=pn("/");const a=new Uint16Array(6);os(t,a,{from:e},1,i,0),o.singleCache.set(s,i)}return ui(r,i,n)}function rm(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=ui(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=am(s.route)),t.matchCache.set(r,s),s}function om(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function sm(e,t=!1,n){const r=pn(e.fullPath),o=new Uint16Array(6),s={},i={};let a=0;return os(t,o,e,1,r,0,l=>{if(n?.(l,a),an(!(l.id in s),`Duplicate routes found with id: ${String(l.id)}`),s[l.id]=l,a!==0&&l.path){const f=om(l.fullPath);(!i[f]||l.fullPath.endsWith("/"))&&(i[f]=l)}a++}),Jt(r),{processedTree:{segmentTree:r,singleCache:ko(1e3),matchCache:ko(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function ui(e,t,n=!1){const r=e.split("/"),o=cm(e,r,t,n);if(!o)return null;const[s]=vu(e,r,o);return{route:o.node.route,rawParams:s,parsedParams:o.parsedParams}}function vu(e,t,n){const r=im(n.node);let o=null;const s={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,l++){const f=r[a];if(f.kind===hn)break;if(f.kind===gu){l--,i--,c--;continue}const d=t[i],p=c;if(d&&(c+=d.length),f.kind===xn){o??=n.node.fullPath.split("/");const h=o[l],y=f.prefix?.length??0;if(h.charCodeAt(y)===123){const v=f.suffix?.length??0,b=h.substring(y+2,h.length-v-1),w=d.substring(y,d.length-v);s[b]=decodeURIComponent(w)}else{const v=h.substring(1);s[v]=decodeURIComponent(d)}}else if(f.kind===Pr){if(n.skipped&1<<a){i--,c=p-1;continue}o??=n.node.fullPath.split("/");const h=o[l],y=f.prefix?.length??0,m=f.suffix?.length??0,v=h.substring(y+3,h.length-m-1),b=f.suffix||f.prefix?d.substring(y,d.length-m):d;b&&(s[v]=decodeURIComponent(b))}else if(f.kind===En){const h=f,y=e.substring(p+(h.prefix?.length??0),e.length-(h.suffix?.length??0)),m=decodeURIComponent(y);s["*"]=m,s._splat=m;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:i,node:a,path:c,segment:l}]}function am(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function im(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function cm(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!Ar(t),s=o&&e!=="/",i=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,f=null;for(;a.length;){const d=a.pop(),{node:p,index:h,skipped:y,depth:m,statics:v,dynamics:b,optionals:w}=d;let{extract:_,rawParams:S,parsedParams:C}=d;if(p.skipOnParamError){if(!Hs(e,t,d))continue;S=d.rawParams,_=d.extract,C=d.parsedParams}r&&p.route&&p.kind!==hn&&fr(l,d)&&(l=d);const O=h===i;if(O&&(p.route&&!s&&fr(f,d)&&(f=d),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const T=O?void 0:t[h];let P;if(O&&p.index){const N={node:p.index,index:h,skipped:y,depth:m+1,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C};let F=!0;if(p.index.skipOnParamError&&(Hs(e,t,N)||(F=!1)),F){if(v===i&&!b&&!w&&!y)return N;fr(f,N)&&(f=N)}}if(p.wildcard&&fr(c,d))for(const N of p.wildcard){const{prefix:F,suffix:z}=N;if(F&&(O||!(N.caseSensitive?T:P??=T.toLowerCase()).startsWith(F)))continue;if(z){if(O)continue;const H=t.slice(h).join("/").slice(-z.length);if((N.caseSensitive?H:H.toLowerCase())!==z)continue}const R={node:N,index:i,skipped:y,depth:m,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C};if(!(N.skipOnParamError&&!Hs(e,t,R))){c=R;break}}if(p.optional){const N=y|1<<m,F=m+1;for(let z=p.optional.length-1;z>=0;z--){const R=p.optional[z];a.push({node:R,index:h,skipped:N,depth:F,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(!O)for(let z=p.optional.length-1;z>=0;z--){const R=p.optional[z],{prefix:H,suffix:x}=R;if(H||x){const I=R.caseSensitive?T:P??=T.toLowerCase();if(H&&!I.startsWith(H)||x&&!I.endsWith(x))continue}a.push({node:R,index:h+1,skipped:y,depth:F,statics:v,dynamics:b,optionals:w+1,extract:_,rawParams:S,parsedParams:C})}}if(!O&&p.dynamic&&T)for(let N=p.dynamic.length-1;N>=0;N--){const F=p.dynamic[N],{prefix:z,suffix:R}=F;if(z||R){const H=F.caseSensitive?T:P??=T.toLowerCase();if(z&&!H.startsWith(z)||R&&!H.endsWith(R))continue}a.push({node:F,index:h+1,skipped:y,depth:m+1,statics:v,dynamics:b+1,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(!O&&p.staticInsensitive){const N=p.staticInsensitive.get(P??=T.toLowerCase());N&&a.push({node:N,index:h+1,skipped:y,depth:m+1,statics:v+1,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(!O&&p.static){const N=p.static.get(T);N&&a.push({node:N,index:h+1,skipped:y,depth:m+1,statics:v+1,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(p.pathless){const N=m+1;for(let F=p.pathless.length-1;F>=0;F--){const z=p.pathless[F];a.push({node:z,index:h,skipped:y,depth:N,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}}}if(f&&c)return fr(c,f)?f:c;if(f)return f;if(c)return c;if(r&&l){let d=l.index;for(let h=0;h<l.index;h++)d+=t[h].length;const p=d===e.length?"/":e.slice(d);return l.rawParams??={},l.rawParams["**"]=decodeURIComponent(p),l}return null}function Hs(e,t,n){try{const[r,o]=vu(e,t,n);n.rawParams=r,n.extract=o;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function fr(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===hn)>(e.node.kind===hn)||t.node.kind===hn==(e.node.kind===hn)&&t.depth>e.depth))):!0}function Eo(e){return di(e.filter(t=>t!==void 0).join("/"))}function di(e){return e.replace(/\/{2,}/g,"/")}function yu(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function on(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function bu(e){return on(yu(e))}function Do(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function lm(e,t,n){return Do(e,n)===Do(t,n)}function um({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let i;if(r){i=o?t:s?e:e+"\0"+t;const d=r.get(i);if(d)return d}let a;if(s)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&Ar(a)==="";)a.pop();const d=t.split("/");for(let p=0,h=d.length;p<h;p++){const y=d[p];y===""?p?p===h-1&&a.push(y):a=[y]:y===".."?a.pop():y==="."||a.push(y)}}a.length>1&&(Ar(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,l="";for(let d=0;d<a.length;d++){d>0&&(l+="/");const p=a[d];if(!p)continue;c=li(p,0,c);const h=c[0];if(h===Kn){l+=p;continue}const y=c[5],m=p.substring(0,c[1]),v=p.substring(c[4],y),b=p.substring(c[2],c[3]);h===xn?l+=m||v?`${m}{$${b}}${v}`:`$${b}`:h===En?l+=m||v?`${m}{$}${v}`:"$":l+=`${m}{-$${b}}${v}`}l=di(l);const f=l||"/";return i&&r&&r.set(i,f),f}function dm(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function zs(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>_c(o,n)).join("/"):_c(r,n)}function Ec({path:e,params:t,decoder:n,...r}){let o=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const i=e.length;let a=0,c,l="";for(;a<i;){const d=a;c=li(e,d,c);const p=c[5];if(a=p+1,d===p)continue;const h=c[0];if(h===Kn){l+="/"+e.substring(d,p);continue}if(h===En){const y=t._splat;s._splat=y,s["*"]=y;const m=e.substring(d,c[1]),v=e.substring(c[4],p);if(!y){o=!0,(m||v)&&(l+="/"+m+v);continue}const b=zs("_splat",t,n);l+="/"+m+b+v;continue}if(h===xn){const y=e.substring(c[2],c[3]);!o&&!(y in t)&&(o=!0),s[y]=t[y];const m=e.substring(d,c[1]),v=e.substring(c[4],p),b=zs(y,t,n)??"undefined";l+="/"+m+b+v;continue}if(h===Pr){const y=e.substring(c[2],c[3]),m=t[y];if(m==null)continue;s[y]=m;const v=e.substring(d,c[1]),b=e.substring(c[4],p),w=zs(y,t,n)??"";l+="/"+v+w+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:s,interpolatedPath:l||"/",isMissingParams:o}}function _c(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function wu(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function dt(e){return!!e?.isNotFound}function fm(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ya="tsr-scroll-restoration-v1_3",hm=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function pm(){const e=fm();if(!e)return null;const t=e.getItem(ya);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=tn(r,n)||n;try{e.setItem(ya,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const so=pm(),mm=e=>e.state.__TSR_key||e.href;function gm(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Lo=!1;function vm({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:o,location:s}){let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(l){console.error(l);return}const a=t||window.history.state?.__TSR_key,c=i[a];Lo=!0;e:{if(r&&c&&Object.keys(c).length>0){for(const d in c){const p=c[d];if(d==="window")window.scrollTo({top:p.scrollY,left:p.scrollX,behavior:n});else if(d){const h=document.querySelector(d);h&&(h.scrollLeft=p.scrollX,h.scrollTop=p.scrollY)}}break e}const l=(s??window.location).hash.split("#",2)[1];if(l){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const p=document.getElementById(l);p&&p.scrollIntoView(d)}break e}const f={top:0,left:0,behavior:n};if(window.scrollTo(f),o)for(const d of o){if(d==="window")continue;const p=typeof d=="function"?d():document.querySelector(d);p&&p.scrollTo(f)}}Lo=!1}function ym(e,t){if(!so||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!so))return;e.isScrollRestorationSetup=!0,Lo=!1;const r=e.options.getScrollRestorationKey||mm;window.history.scrollRestoration="manual";const o=s=>{if(Lo||!e.isScrollRestoring)return;let i="";if(s.target===document||s.target===window)i="window";else{const c=s.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=gm(s.target)}const a=r(e.state.location);so.set(c=>{const l=c[a]||={},f=l[i]||={};if(i==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(i){const d=document.querySelector(i);d&&(f.scrollX=d.scrollLeft||0,f.scrollY=d.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",hm(o,100),!0),e.subscribe("onRendered",s=>{const i=r(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(vm({storageKey:ya,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&so.set(a=>(a[i]||={},a)))})}function bm(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function wm(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function Us(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function xm(e){const t=new URLSearchParams(e),n={};for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=Us(o):Array.isArray(s)?s.push(Us(o)):n[r]=[s,Us(o)]}return n}const Em=Sm(JSON.parse),_m=Cm(JSON.stringify,JSON.parse);function Sm(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=xm(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function Cm(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=wm(o,r);return s?`?${s}`:""}}const xt="__root__";function xu(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function vt(e){return e instanceof Response&&!!e.options}const ba=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ss=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Un=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const i=e.matches[s];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},Sc=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(i=>i.routeId===e.router.routeTree.id),o=r>=0?r:0;let s=n?e.matches.findIndex(i=>i.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=o);for(let i=s;i>=0;i--){const a=e.matches[i];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return i}return n?s:o},nn=(e,t,n)=>{if(!(!vt(n)&&!dt(n)))throw vt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:vt(n)?"redirected":r.status==="pending"?"success":r.status,context:Un(e,t.index),isFetching:!1,error:n})),dt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),vt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Eu=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,hr=(e,t,n,r)=>{const{id:o,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,nn(e,e.router.getMatch(o),n);try{i.options.onError?.(n)}catch(a){n=a,nn(e,e.router.getMatch(o),n)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!vt(n)&&!dt(n)&&(e.serialError??=n)},_u=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!ss(e,t)&&(n.options.loader||n.options.beforeLoad||Cu(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{ba(e)},o);r._nonReactive.pendingTimeout=i}},Rm=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;_u(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&nn(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},Am=(e,t,n,r)=>{const o=e.router.getMatch(t),s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=qn(()=>{s?.resolve()});const{paramsError:i,searchError:a}=o;i&&hr(e,n,i,"PARSE_PARAMS"),a&&hr(e,n,a,"VALIDATE_SEARCH"),_u(e,t,r,o);const c=new AbortController;let l=!1;const f=()=>{l||(l=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:c})))},d=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!r.options.beforeLoad){Er(()=>{f(),d()});return}o._nonReactive.beforeLoadPromise=qn();const p={...Un(e,n,!1),...o.__routeContext},{search:h,params:y,cause:m}=o,v=ss(e,t),b={search:h,abortController:c,params:y,preload:v,context:p,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":m,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},w=S=>{if(S===void 0){Er(()=>{f(),d()});return}(vt(S)||dt(S))&&(f(),hr(e,n,S,"BEFORE_LOAD")),Er(()=>{f(),e.updateMatch(t,C=>({...C,__beforeLoadContext:S})),d()})};let _;try{if(_=r.options.beforeLoad(b),Tr(_))return f(),_.catch(S=>{hr(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){f(),hr(e,n,S,"BEFORE_LOAD")}w(_)},Tm=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>a(),i=()=>Am(e,n,t,o),a=()=>{if(Eu(e,n))return;const c=Rm(e,n,o);return Tr(c)?c.then(i):i()};return s()},Pm=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,i,a])=>{const c=s?.meta,l=s?.links,f=s?.scripts,d=s?.styles;return{meta:c,links:l,headScripts:f,headers:a,scripts:i,styles:d}})},Su=(e,t,n,r,o)=>{const s=t[r-1],{params:i,loaderDeps:a,abortController:c,cause:l}=e.router.getMatch(n),f=Un(e,r),d=ss(e,n);return{params:i,deps:a,preload:!!d,parentMatchPromise:s,abortController:c,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:d?"preload":l,route:o,...e.router.options.additionalContext}},Cc=async(e,t,n,r,o)=>{try{const s=e.router.getMatch(n);try{(!(Z1??e.router.isServer)||s.ssr===!0)&&jo(o);const i=o.options.loader?.(Su(e,t,n,r,o)),a=o.options.loader&&Tr(i);if((a||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,f=>({...f,isFetching:"loader"})),o.options.loader){const f=a?await i:i;nn(e,e.router.getMatch(n),f),f!==void 0&&e.updateMatch(n,d=>({...d,loaderData:f}))}o._lazyPromise&&await o._lazyPromise;const l=s._nonReactive.minPendingPromise;l&&await l,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,f=>({...f,error:void 0,context:Un(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let a=i;if(a?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,l=>({...l,status:l.status==="pending"?"success":l.status,isFetching:!1,context:Un(e,r)}));return}const c=s._nonReactive.minPendingPromise;c&&await c,dt(i)&&await o.options.notFoundComponent?.preload?.(),nn(e,e.router.getMatch(n),i);try{o.options.onError?.(i)}catch(l){a=l,nn(e,e.router.getMatch(n),l)}e.updateMatch(n,l=>({...l,error:a,context:Un(e,r),status:"error",isFetching:!1}))}}catch(s){const i=e.router.getMatch(n);i&&(i._nonReactive.loaderPromise=void 0),nn(e,i,s)}},Mm=async(e,t,n)=>{async function r(d,p,h,y){const m=Date.now()-p.updatedAt,v=d?y.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:y.options.staleTime??e.router.options.defaultStaleTime??0,b=y.options.shouldReload,w=typeof b=="function"?b(Su(e,t,o,n,y)):b,{status:_,invalid:S}=h;i=_==="success"&&(S||(w??m>v)),d&&y.options.preload===!1||(i&&!e.sync?(a=!0,(async()=>{try{await Cc(e,t,o,n,y);const C=e.router.getMatch(o);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){vt(C)&&await e.router.navigate(C.options)}})()):(_!=="success"||i&&e.sync)&&await Cc(e,t,o,n,y))}const{id:o,routeId:s}=e.matches[n];let i=!1,a=!1;const c=e.router.looseRoutesById[s];if(!Eu(e,o)){const d=e.router.getMatch(o),p=ss(e,o);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const h=e.router.getMatch(o),y=h._nonReactive.error||h.error;y&&nn(e,h,y),h.status==="pending"&&await r(p,d,h,c)}else{const h=p&&!e.router.state.matches.some(m=>m.id===o),y=e.router.getMatch(o);y._nonReactive.loaderPromise=qn(),h!==y.preload&&e.updateMatch(o,m=>({...m,preload:h})),await r(p,d,y,c)}}const l=e.router.getMatch(o);a||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,a||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;const f=a?l.isFetching:!1;return f!==l.isFetching||l.invalid!==!1?(e.updateMatch(o,d=>({...d,isFetching:f,invalid:!1})),e.router.getMatch(o)):l};async function Rc(e){const t=e,n=[];t.router.state.matches.some(p=>p._forcePending)&&ba(t);let r;for(let p=0;p<t.matches.length;p++){try{const h=Tm(t,p);Tr(h)&&await h}catch(h){if(vt(h))throw h;if(dt(h))r=h;else if(!t.preload)throw h;break}if(t.serialError)break}const o=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?Sc(t,r):void 0,i=r&&t.preload?0:s!==void 0?Math.min(s+1,o):o;let a,c;for(let p=0;p<i;p++)n.push(Mm(t,n,p));try{await Promise.all(n)}catch{const p=await Promise.allSettled(n);for(const h of p){if(h.status!=="rejected")continue;const y=h.reason;if(vt(y))throw y;dt(y)?a??=y:c??=y}if(c!==void 0)throw c}const l=a??(r&&!t.preload?r:void 0);let f=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!l&&r&&t.preload)return t.matches;if(l){const p=Sc(t,l);an(p!==void 0);const h=t.matches[p],y=t.router.looseRoutesById[h.routeId],m=t.router.options?.defaultNotFoundComponent;!y.options.notFoundComponent&&m&&(y.options.notFoundComponent=m),l.routeId=h.routeId;const v=h.routeId===t.router.routeTree.id;t.updateMatch(h.id,b=>({...b,...v?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:l},isFetching:!1})),f=p,await jo(y)}else if(!t.preload){const p=t.matches[0];p.globalNotFound||t.router.getMatch(p.id)?.globalNotFound&&t.updateMatch(p.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const p=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await jo(p)}for(let p=0;p<=f;p++){const h=t.matches[p],{id:y,routeId:m}=h,v=t.router.looseRoutesById[m];try{const b=Pm(t,y,v);if(b){const w=await b;t.updateMatch(y,_=>({..._,...w}))}}catch(b){console.error(`Error executing head for route ${m}:`,b)}}const d=ba(t);if(Tr(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function jo(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of Ru){const o=e.options[r]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Cu(e){for(const t of Ru)if(e.options[t]?.preload)return!0;return!1}const Ru=["component","errorComponent","pendingComponent","notFoundComponent"];function Nm(e){return{input:({url:t})=>{for(const n of e)t=wa(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Au(e[n],t);return t}}}function Om(e){const t=bu(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===o?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(n.length)),i},output:({url:i})=>(i.pathname=Eo(["/",t,i.pathname]),i)}}function wa(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Au(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function yn(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,o=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:o,hashChanged:s}}function Im(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class km{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=dm(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=U1()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=ko(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=$1(Lm(this.latestLocation)),ym(this));let a=!1;const c=this.options.basepath??"/",l=this.options.rewrite;if(s||o!==c||i!==l){this.basepath=c;const p=[],h=bu(c);h&&h!=="/"&&p.push(Om({basepath:c})),l&&p.push(l),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Nm(p),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(p=>({...p,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=sm(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&em(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:c,search:l,hash:f,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const w=this.options.parseSearch(l),_=this.options.stringifySearch(w);return{href:c+_+f,publicHref:d,pathname:dr(c).path,external:!1,searchStr:_,search:gt(r?.search,w),hash:dr(f.slice(1)).path,state:gt(r?.state,p)}}const h=new URL(d,this.origin),y=wa(this.rewrite,h),m=this.options.parseSearch(y.search),v=this.options.stringifySearch(m);return y.search=v,{href:y.href.replace(y.origin,""),publicHref:d,pathname:dr(y.pathname).path,external:!!this.rewrite&&y.origin!==this.origin,searchStr:v,search:gt(r?.search,m),hash:dr(y.hash.slice(1)).path,state:gt(r?.state,p)}},s=o(n),{__tempLocation:i,__tempKey:a}=s.state;if(i&&(!a||a===this.tempLocationKey)){const c=o(i);return c.state.key=s.state.key,c.state.__TSR_key=s.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>um({base:n,to:di(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>jm({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),r=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const r=(s={})=>{const i=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);s.from;const c=s.unsafeRelative==="path"?i.pathname:s.from??a.fullPath,l=this.resolvePathWithBase(c,"."),f=a.search,d={...a.params},p=s.to?this.resolvePathWithBase(l,`${s.to}`):this.resolvePathWithBase(l,"."),h=s.params===!1||s.params===null?{}:(s.params??!0)===!0?d:Object.assign(d,tn(s.params,d)),y=this.getMatchedRoutes(p);let m=y.matchedRoutes;if((!y.foundRoute||y.foundRoute.path!=="/"&&y.routeParams["**"])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(h).length>0)for(const z of m){const R=z.options.params?.stringify??z.options.stringifyParams;if(R)try{Object.assign(h,R(h))}catch{}}const b=n.leaveParams?p:dr(Ec({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=f;if(n._includeValidateSearch&&this.options.search?.strict){const z={};m.forEach(R=>{if(R.options.validateSearch)try{Object.assign(z,_o(R.options.validateSearch,{...z,...w}))}catch{}}),w=z}w=Fm({search:w,dest:s,destRoutes:m,_includeValidateSearch:n._includeValidateSearch}),w=gt(f,w);const _=this.options.stringifySearch(w),S=s.hash===!0?i.hash:s.hash?tn(s.hash,i.hash):void 0,C=S?`#${S}`:"";let O=s.state===!0?i.state:s.state?tn(s.state,i.state):{};O=gt(i.state,O);const T=`${b}${_}${C}`;let P,N,F=!1;if(this.rewrite){const z=new URL(T,this.origin),R=Au(this.rewrite,z);P=z.href.replace(z.origin,""),R.origin!==this.origin?(N=R.href,F=!0):N=R.pathname+R.search+R.hash}else P=Q1(T),N=P;return{publicHref:N,href:P,pathname:b,search:w,searchStr:_,state:O,hash:S??"",external:F,unmaskOnReload:s.unmaskOnReload}},o=(s={},i)=>{const a=r(s);let c=i?r(i):void 0;if(!c){const l={};if(this.options.routeMasks){const f=tm(a.pathname,this.processedTree);if(f){Object.assign(l,f.rawParams);const{from:d,params:p,...h}=f.route,y=p===!1||p===null?{}:(p??!0)===!0?l:Object.assign(l,tn(p,l));i={from:n.from,...h,params:y},c=r(i)}}}return c&&(a.maskedLocation=c),a};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const s=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(f=>{o.state[f]=this.latestLocation.state[f]});const l=vn(o.state,this.latestLocation.state);return c.forEach(f=>{delete o.state[f]}),l},i=on(this.latestLocation.href)===on(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=qn(()=>{a?.resolve()}),i&&s())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...f}=o;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:i,href:a,...c}={})=>{if(a){const d=this.history.location.state.__TSR_index,p=No(a,{__TSR_index:n?d:d+1}),h=new URL(p.pathname,this.origin),y=wa(this.rewrite,h);c.to=y.pathname,c.search=this.options.parseSearch(p.search),c.hash=p.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const f=this.commitLocation({...l,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...i})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!o){const l=this.buildLocation({to:n,...i});o=o??l.publicHref,s=s??l.publicHref}const c=!a&&s?s:o;if(Io(c,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const d of f)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(o=>!n.some(s=>s.id===o.id))}))},this.load=async n=>{let r,o,s;for(s=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...yn({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...yn({resolvedLocation:l,location:c})}),await Rc({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],d=[],p=[],h=[];Er(()=>{this.__store.setState(y=>{const m=y.matches,v=y.pendingMatches||y.matches;return f=m.filter(b=>!v.some(w=>w.id===b.id)),d=m.filter(b=>!v.some(w=>w.routeId===b.routeId)),p=v.filter(b=>!m.some(w=>w.routeId===b.routeId)),h=v.filter(b=>m.some(w=>w.routeId===b.routeId)),{...y,isLoading:!1,loadedAt:Date.now(),matches:v,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[p,"onEnter"],[h,"onStay"]].forEach(([y,m])=>{y.forEach(v=>{this.looseRoutesById[v.routeId].options[m]?.(v)})})})})}})}catch(c){vt(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):dt(c)&&(o=c),this.__store.setState(l=>({...l,statusCode:r?r.status:o?404:l.matches.some(f=>f.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,i=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(yn({resolvedLocation:i,location:s})):r.types;if(a===!1){n();return}o={update:n,types:a}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";o&&(o==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:Im(s.cachedMatches.map(i=>i.id===n?r(i):i))})):this.__store.setState(s=>({...s,[o]:s[o]?.map(i=>i.id===n?r(i):i)})))})},this.getMatch=n=>{const r=o=>o.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&Io(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(s=>!r(s))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const s=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=jo,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...s,...this.state.cachedMatches.map(a=>a.id)]);Er(()=>{o.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return o=await Rc({router:this,matches:o,location:r,preload:!0,updateMatch:(a,c)=>{s.has(a)?o=o.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),o}catch(a){if(vt(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});dt(a)||console.error(a);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const a=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=nm(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!vn(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?vn(a.search,s.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??_m,parseSearch:t.parseSearch??Em,protocolAllowlist:t.protocolAllowlist??Y1}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:s,parsedParams:i}=r;let{matchedRoutes:a}=r,c=!1;(o?o.path!=="/"&&s["**"]:on(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const l=c?$m(this.options.notFoundMode,a):void 0,f=new Array(a.length),d=new Map(this.state.matches.map(p=>[p.routeId,p]));for(let p=0;p<a.length;p++){const h=a[p],y=f[p-1];let m,v,b;{const x=y?.search??t.search,I=y?._strictSearch??void 0;try{const $=_o(h.options.validateSearch,{...x})??void 0;m={...x,...$},v={...I,...$},b=void 0}catch($){let D=$;if($ instanceof Fo||(D=new Fo($.message,{cause:$})),n?.throwOnError)throw D;m=x,v={},b=D}}const w=h.options.loaderDeps?.({search:m})??"",_=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:C}=Ec({path:h.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),O=h.id+S+_,T=this.getMatch(O),P=d.get(h.id),N=T?._strictParams??C;let F;if(!T)try{Ac(h,C,i,N)}catch(x){if(dt(x)||vt(x)?F=x:F=new Dm(x.message,{cause:x}),n?.throwOnError)throw F}Object.assign(s,N);const z=P?"stay":"enter";let R;if(T)R={...T,cause:z,params:P?.params??s,_strictParams:N,search:gt(P?P.search:T.search,m),_strictSearch:v};else{const x=h.options.loader||h.options.beforeLoad||h.lazyFn||Cu(h)?"pending":"success";R={id:O,ssr:h.options.ssr,index:p,routeId:h.id,params:P?.params??s,_strictParams:N,pathname:S,updatedAt:Date.now(),search:P?gt(P.search,m):m,_strictSearch:v,searchError:void 0,status:x,isFetching:!1,error:void 0,paramsError:F,__routeContext:void 0,_nonReactive:{loadPromise:qn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:z,loaderDeps:P?gt(P.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}n?.preload||(R.globalNotFound=l===h.id),R.searchError=b;const H=this.getParentContext(y);R.context={...H,...R.__routeContext,...R.__beforeLoadContext},f[p]=R}for(let p=0;p<f.length;p++){const h=f[p],y=this.looseRoutesById[h.routeId],m=this.getMatch(h.id),v=d.get(h.routeId);if(h.params=v?gt(v.params,s):s,!m){const b=f[p-1],w=this.getParentContext(b);if(y.options.context){const _={deps:h.loaderDeps,params:h.params,context:w??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:f,routeId:y.id};h.__routeContext=y.options.context(_)??void 0}h.context={...w,...h.__routeContext,...h.__beforeLoadContext}}}return f}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),s=Ar(n),i={...t.search};for(const f of n)try{Object.assign(i,_o(f.options.validateSearch,i))}catch{}const a=Ar(this.state.matches),c=a&&a.routeId===s.id&&t.pathname===this.state.location.pathname;let l;if(c)l=a.params;else{const f={...r};for(const d of n)try{Ac(d,r,o??{},f)}catch{}l=f}return{matchedRoutes:n,fullPath:s.fullPath,search:i,params:l}}}class Fo extends Error{}class Dm extends Error{}function Lm(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function _o(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Fo("Async validation not supported");if(n.issues)throw new Fo(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function jm({pathname:e,routesById:t,processedTree:n}){const r={},o=on(e);let s,i;const a=rm(o,n,!0);return a&&(s=a.route,Object.assign(r,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:a?.branch||[t[xt]],routeParams:r,foundRoute:s,parsedParams:i}}function Fm({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Bm(n)(e,t,r??!1)}function Bm(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const s=({search:i,next:a})=>{let c=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(c=o.options.preSearchFilters.reduce((f,d)=>d(f),i));const l=a(c);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,d)=>d(f),l):l};t.middlewares.push(s)}if(o.options.validateSearch){const s=({search:i,next:a})=>{const c=a(i);if(!t._includeValidateSearch)return c;try{return{...c,..._o(o.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(s)}}const n=({search:o})=>{const s=t.dest;return s.search?s.search===!0?o:tn(s.search,o):{}};t.middlewares.push(n);const r=(o,s,i)=>{if(o>=i.length)return s;const a=i[o];return a({search:s,next:l=>r(o+1,l,i)})};return function(s,i,a){return t.dest=i,t._includeValidateSearch=a,r(0,s,t.middlewares)}}function $m(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return xt}function Ac(e,t,n,r){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=o(r);Object.assign(r,s)}}const Hm="Error preloading route! ☝️";class Tu{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=xt:this.parentRoute||an(!1);let s=o?xt:r?.path;s&&s!=="/"&&(s=yu(s));const i=r?.id||s;let a=o?xt:Eo([this.parentRoute.id===xt?"":this.parentRoute.id,i]);s===xt&&(s="/"),a!==xt&&(a=Eo(["/",a]));const c=a===xt?"/":Eo([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=c,this._to=on(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>xu({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class zm{constructor({id:t}){this.notFound=n=>wu({routeId:this.id,...n}),this.redirect=n=>xu({from:this.id,...n}),this.id=t}}class Um extends Tu{constructor(t){super(t)}}const Vm="use",Tc=ns[Vm],ao=typeof window<"u"?u.useLayoutEffect:u.useEffect;function Vs(e){const t=u.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Zm(e,t,n={},r={}){u.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function Wm(e){const t=u.useRef(null);return u.useImperativeHandle(e,()=>t.current,[]),t}function fi(e){const t=e.errorComponent??hi;return g.jsx(qm,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?u.createElement(t,{error:n,reset:r}):e.children})}class qm extends u.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function hi({error:e}){const[t,n]=u.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function Km({children:e,fallback:t=null}){return Pu()?g.jsx(X.Fragment,{children:e}):g.jsx(X.Fragment,{children:t})}function Pu(){return X.useSyncExternalStore(Gm,()=>!0,()=>!1)}function Gm(){return()=>{}}function Ym(e,t){return e===t}function Qm(e,t,n=Ym){const r=u.useCallback(i=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(i);return a},[e]),o=u.useCallback(()=>e?.get(),[e]);return u1.useSyncExternalStoreWithSelector(r,o,o,t,n)}const Mu=u.createContext(null);function it(e){const t=u.useContext(Mu);return e?.warn,t}function yt(e){const t=it({warn:e?.router===void 0}),n=e?.router||t,r=u.useRef(void 0);return Qm(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=gt(r.current,e.select(o));return r.current=s,s}return e.select(o)}return o})}const as=u.createContext(void 0),Xm=u.createContext(void 0);function Ct(e){const t=u.useContext(e.from?Xm:as);return yt({select:r=>{const o=r.matches.find(s=>e.from?e.from===s.routeId:s.id===t);if(an(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function is(e){return Ct({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function cs(e){const{select:t,...n}=e;return Ct({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function ls(e){return Ct({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function us(e){return Ct({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Pn(e){const t=it();return u.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Jm(e,t){const n=it(),r=Wm(t),{activeProps:o,inactiveProps:s,activeOptions:i,to:a,preload:c,preloadDelay:l,hashScrollIntoView:f,replace:d,startTransition:p,resetScroll:h,viewTransition:y,children:m,target:v,disabled:b,style:w,className:_,onClick:S,onBlur:C,onFocus:O,onMouseEnter:T,onMouseLeave:P,onTouchStart:N,ignoreBlocker:F,params:z,search:R,hash:H,state:x,mask:I,reloadDocument:$,unsafeRelative:D,from:q,_fromLocation:k,...Y}=e,L=Pu(),j=yt({select:ae=>{const ge=ae.matches[ae.matches.length-1];return{search:ge?.search,hash:ae.location.hash,path:ge?.pathname}},structuralSharing:!0}),K=e.from,G=u.useMemo(()=>({...e,from:K}),[n,j,K,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Z=u.useMemo(()=>n.buildLocation({...G}),[n,G]),le=Z.maskedLocation?Z.maskedLocation.publicHref:Z.publicHref,te=Z.maskedLocation?Z.maskedLocation.external:Z.external,Q=u.useMemo(()=>sg(le,te,n.history,b),[b,te,le,n.history]),ie=u.useMemo(()=>{if(Q?.external)return Io(Q.href,n.protocolAllowlist)?void 0:Q.href;if(!ag(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Io(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Q,n.protocolAllowlist]),re=yt({select:ae=>{if(ie)return!1;if(i?.exact){if(!lm(ae.location.pathname,Z.pathname,n.basepath))return!1}else{const ge=Do(ae.location.pathname,n.basepath),pe=Do(Z.pathname,n.basepath);if(!(ge.startsWith(pe)&&(ge.length===pe.length||ge[pe.length]==="/")))return!1}return(i?.includeSearch??!0)&&!vn(ae.location.search,Z.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?L&&ae.location.hash===Z.hash:!0}}),ce=re?tn(o,{})??eg:Zs,fe=re?Zs:tn(s,{})??Zs,ve=[_,ce.className,fe.className].filter(Boolean).join(" "),E=(w||ce.style||fe.style)&&{...w,...ce.style,...fe.style},[J,W]=u.useState(!1),M=u.useRef(!1),A=e.reloadDocument||ie?!1:c??n.options.defaultPreload,B=l??n.options.defaultPreloadDelay??0,ee=u.useCallback(()=>{n.preloadRoute({...G,_builtLocation:Z}).catch(ae=>{console.warn(ae),console.warn(Hm)})},[n,G,Z]),ne=u.useCallback(ae=>{ae?.isIntersecting&&ee()},[ee]);Zm(r,ne,og,{disabled:!!b||A!=="viewport"}),u.useEffect(()=>{M.current||!b&&A==="render"&&(ee(),M.current=!0)},[b,ee,A]);const U=ae=>{const ge=ae.currentTarget.getAttribute("target"),pe=v!==void 0?v:ge;if(!b&&!ig(ae)&&!ae.defaultPrevented&&(!pe||pe==="_self")&&ae.button===0){ae.preventDefault(),Zt.flushSync(()=>{W(!0)});const Ne=n.subscribe("onResolved",()=>{Ne(),W(!1)});n.navigate({...G,replace:d,resetScroll:h,hashScrollIntoView:f,startTransition:p,viewTransition:y,ignoreBlocker:F})}};if(ie)return{...Y,ref:r,href:ie,...m&&{children:m},...v&&{target:v},...b&&{disabled:b},...w&&{style:w},..._&&{className:_},...S&&{onClick:S},...C&&{onBlur:C},...O&&{onFocus:O},...T&&{onMouseEnter:T},...P&&{onMouseLeave:P},...N&&{onTouchStart:N}};const oe=ae=>{if(b||A!=="intent")return;if(!B){ee();return}const ge=ae.currentTarget;if(pr.has(ge))return;const pe=setTimeout(()=>{pr.delete(ge),ee()},B);pr.set(ge,pe)},ue=ae=>{b||A!=="intent"||ee()},se=ae=>{if(b||!A||!B)return;const ge=ae.currentTarget,pe=pr.get(ge);pe&&(clearTimeout(pe),pr.delete(ge))};return{...Y,...ce,...fe,href:Q?.href,ref:r,onClick:kn([S,U]),onBlur:kn([C,se]),onFocus:kn([O,oe]),onMouseEnter:kn([T,oe]),onMouseLeave:kn([P,se]),onTouchStart:kn([N,ue]),disabled:!!b,target:v,...E&&{style:E},...ve&&{className:ve},...b&&tg,...re&&ng,...L&&J&&rg}}const Zs={},eg={className:"active"},tg={role:"link","aria-disabled":!0},ng={"data-status":"active","aria-current":"page"},rg={"data-transitioning":"transitioning"},pr=new WeakMap,og={rootMargin:"100px"},kn=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function sg(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function ag(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Wt=u.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=Jm(r,t),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=s;return u.createElement("a",c,i)}return u.createElement(n,s,i)});function ig(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function cg(e){return new lg({id:e})}class lg extends zm{constructor({id:t}){super({id:t}),this.useMatch=n=>Ct({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>cs({...n,from:this.id,strict:!1}),this.useLoaderData=n=>is({...n,from:this.id,strict:!1}),this.useNavigate=()=>{const n=it();return Pn({from:n.routesById[this.id].fullPath})},this.notFound=n=>wu({routeId:this.id,...n}),this.Link=X.forwardRef((n,r)=>{const s=it().routesById[this.id].fullPath;return g.jsx(Wt,{ref:r,from:s,...n})})}}let ug=class extends Tu{constructor(t){super(t),this.useMatch=n=>Ct({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>cs({...n,from:this.id}),this.useLoaderData=n=>is({...n,from:this.id}),this.useNavigate=()=>Pn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>g.jsx(Wt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function We(e){return new ug(e)}class dg extends Um{constructor(t){super(t),this.useMatch=n=>Ct({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>cs({...n,from:this.id}),this.useLoaderData=n=>is({...n,from:this.id}),this.useNavigate=()=>Pn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>g.jsx(Wt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function fg(e){return new dg(e)}function Pc(e){return typeof e=="object"?new Mc(e,{silent:!0}).createRoute(e):new Mc(e,{silent:!0}).createRoute}class Mc{constructor(t,n){this.path=t,this.createRoute=r=>{const o=We(r);return o.isRoot=!1,o},this.silent=n?.silent}}class Nc{constructor(t){this.useMatch=n=>Ct({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>cs({...n,from:this.options.id}),this.useLoaderData=n=>is({...n,from:this.options.id}),this.useNavigate=()=>{const n=it();return Pn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Oc(e){return typeof e=="object"?new Nc(e):t=>new Nc({id:e,...t})}function et(e,t){let n,r,o,s;const i=()=>(n||(n=e().then(c=>{n=void 0,r=c.default}).catch(c=>{if(o=c,K1(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const l=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(l)||(sessionStorage.setItem(l,"1"),s=!0)}})),n),a=function(l){if(s)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!r)if(Tc)Tc(i());else throw i();return u.createElement(r,l)};return a.preload=i,a}function hg(){const e=it(),t=u.useRef({router:e,mounted:!1}),[n,r]=u.useState(!1),{hasPendingMatches:o,isLoading:s}=yt({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),i=Vs(s),a=s||n||o,c=Vs(a),l=s||o,f=Vs(l);return e.startTransition=d=>{r(!0),u.startTransition(()=>{d(),r(!1)})},u.useEffect(()=>{const d=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return on(e.latestLocation.publicHref)!==on(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{d()}},[e,e.history]),ao(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),ao(()=>{i&&!s&&e.emit({type:"onLoad",...yn(e.state)})},[i,e,s]),ao(()=>{f&&!l&&e.emit({type:"onBeforeRouteMount",...yn(e.state)})},[l,f,e]),ao(()=>{if(c&&!a){const d=yn(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),d.hrefChanged&&bm(e)}},[a,c,e]),null}function pg(e){const t=yt({select:n=>`not-found-${n.location.pathname}-${n.status}`});return g.jsx(fi,{getResetKey:()=>t,onCatch:(n,r)=>{if(dt(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(dt(n))return e.fallback?.(n);throw n},children:e.children})}function mg(){return g.jsx("p",{children:"Not Found"})}function $n(e){return g.jsx(g.Fragment,{children:e.children})}function Nu(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):g.jsx(mg,{})}function gg(){return it().isScrollRestoring,null}const Ou=u.memo(function({matchId:t}){const n=it(),r=yt({select:m=>{const v=m.matches.findIndex(w=>w.id===t),b=m.matches[v];return an(b),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:m.loadedAt,parentRouteId:m.matches[v-1]?.routeId}},structuralSharing:!0}),o=n.routesById[r.routeId],s=o.options.pendingComponent??n.options.defaultPendingComponent,i=s?g.jsx(s,{}):null,a=o.options.errorComponent??n.options.defaultErrorComponent,c=o.options.onCatch??n.options.defaultOnCatch,l=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",d=(!o.isRoot||o.options.wrapInSuspense||f)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||f))?u.Suspense:$n,p=a?fi:$n,h=l?pg:$n,y=o.isRoot?o.options.shellComponent??$n:$n;return g.jsxs(y,{children:[g.jsx(as.Provider,{value:t,children:g.jsx(d,{fallback:i,children:g.jsx(p,{getResetKey:()=>r.resetKey,errorComponent:a||hi,onCatch:(m,v)=>{if(dt(m))throw m;c?.(m,v)},children:g.jsx(h,{fallback:m=>{if(!l||m.routeId&&m.routeId!==r.routeId||!m.routeId&&!o.isRoot)throw m;return u.createElement(l,m)},children:f||r._displayPending?g.jsx(Km,{fallback:i,children:g.jsx(Ic,{matchId:t})}):g.jsx(Ic,{matchId:t})})})})}),r.parentRouteId===xt&&n.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(vg,{}),g.jsx(gg,{})]}):null]})});function vg(){const e=it(),t=u.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...yn(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Ic=u.memo(function({matchId:t}){const n=it(),{match:r,key:o,routeId:s}=yt({select:c=>{const l=c.matches.find(y=>y.id===t),f=l.routeId,p=(n.routesById[f].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:f,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:p?JSON.stringify(p):void 0,routeId:f,match:{id:l.id,status:l.status,error:l.error,invalid:l.invalid,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=n.routesById[s],a=u.useMemo(()=>{const c=i.options.component??n.options.defaultComponent;return c?g.jsx(c,{},o):g.jsx(Iu,{})},[o,i.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const c=i.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const l=n.getMatch(r.id);if(l&&!l._nonReactive.minPendingPromise){const f=qn();l._nonReactive.minPendingPromise=f,setTimeout(()=>{f.resolve(),l._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return an(dt(r.error)),Nu(n,i,r.error);if(r.status==="redirected")throw an(vt(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return a}),Iu=u.memo(function(){const t=it(),n=u.useContext(as),r=yt({select:l=>l.matches.find(f=>f.id===n)?.routeId}),o=t.routesById[r],s=yt({select:l=>{const d=l.matches.find(p=>p.id===n);return an(d),d.globalNotFound}}),i=yt({select:l=>{const f=l.matches,d=f.findIndex(p=>p.id===n);return f[d+1]?.id}}),a=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Nu(t,o,void 0);if(!i)return null;const c=g.jsx(Ou,{matchId:i});return r===xt?g.jsx(u.Suspense,{fallback:a,children:c}):c});function yg(){const e=it(),n=e.routesById[xt].options.pendingComponent??e.options.defaultPendingComponent,r=n?g.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?$n:u.Suspense,s=g.jsxs(o,{fallback:r,children:[g.jsx(hg,{}),g.jsx(bg,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:s}):s}function bg(){const e=it(),t=yt({select:o=>o.matches[0]?.id}),n=yt({select:o=>o.loadedAt}),r=t?g.jsx(Ou,{matchId:t}):null;return g.jsx(as.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:g.jsx(fi,{getResetKey:()=>n,errorComponent:hi,onCatch:void 0,children:r})})}const wg=e=>new xg(e);class xg extends km{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Pc,globalThis.createLazyFileRoute=Oc):typeof window<"u"&&(window.createFileRoute=Pc,window.createLazyFileRoute=Oc);function Eg({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=g.jsx(Mu.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:r}):r}function _g({router:e,...t}){return g.jsx(Eg,{router:e,...t,children:g.jsx(yg,{})})}function ds(e){return yt({select:t=>e?.select?e.select(t.location):t.location})}var Jn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cg=class{#e=Sg;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},mn=new Cg;function Rg(e){setTimeout(e,0)}var _n=typeof window>"u"||"Deno"in globalThis;function st(){}function Ag(e,t){return typeof e=="function"?e(t):e}function xa(e){return typeof e=="number"&&e>=0&&e!==1/0}function ku(e,t){return Math.max(e+(t||0)-Date.now(),0)}function sn(e,t){return typeof e=="function"?e(t):e}function Et(e,t){return typeof e=="function"?e(t):e}function kc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==pi(i,t.options))return!1}else if(!Mr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Dc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Sn(t.options.mutationKey)!==Sn(s))return!1}else if(!Mr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function pi(e,t){return(t?.queryKeyHashFn||Sn)(e)}function Sn(e){return JSON.stringify(e,(t,n)=>Ea(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Mr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Mr(e[n],t[n])):!1}var Tg=Object.prototype.hasOwnProperty;function Du(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Lc(e)&&Lc(t);if(!r&&!(Ea(e)&&Ea(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let l=0;for(let f=0;f<a;f++){const d=r?f:i[f],p=e[d],h=t[d];if(p===h){c[d]=p,(r?f<s:Tg.call(e,d))&&l++;continue}if(p===null||h===null||typeof p!="object"||typeof h!="object"){c[d]=h;continue}const y=Du(p,h,n+1);c[d]=y,y===p&&l++}return s===a&&l===s?e:c}function Bo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Lc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ea(e){if(!jc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pg(e){return new Promise(t=>{mn.setTimeout(t,e)})}function _a(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Du(e,t):t}function Mg(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ng(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mi=Symbol();function Lu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gi(e,t){return typeof e=="function"?e(...t):!!e}function Og(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Ig=class extends Jn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!_n&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},vi=new Ig;function Sa(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var kg=Rg;function Dg(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=kg;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ve=Dg(),Lg=class extends Jn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!_n&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},$o=new Lg;function jg(e){return Math.min(1e3*2**e,3e4)}function ju(e){return(e??"online")==="online"?$o.isOnline():!0}var Ca=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fu(e){let t=!1,n=0,r;const o=Sa(),s=()=>o.status!=="pending",i=m=>{if(!s()){const v=new Ca(m);p(v),e.onCancel?.(v)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>vi.isFocused()&&(e.networkMode==="always"||$o.isOnline())&&e.canRun(),f=()=>ju(e.networkMode)&&e.canRun(),d=m=>{s()||(r?.(),o.resolve(m))},p=m=>{s()||(r?.(),o.reject(m))},h=()=>new Promise(m=>{r=v=>{(s()||l())&&m(v)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),y=()=>{if(s())return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{if(s())return;const w=e.retry??(_n?0:3),_=e.retryDelay??jg,S=typeof _=="function"?_(n,b):_,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,b);if(t||!C){p(b);return}n++,e.onFail?.(n,b),Pg(S).then(()=>l()?void 0:h()).then(()=>{t?p(b):y()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r?.(),o),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?y():h().then(y),o)}}var Bu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xa(this.gcTime)&&(this.#e=mn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_n?1/0:300*1e3))}clearGcTimeout(){this.#e&&(mn.clearTimeout(this.#e),this.#e=void 0)}},Fg=class extends Bu{#e;#t;#n;#o;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Bc(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Bc(this.options);t.data!==void 0&&(this.setState(Fc(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=_a(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(st).catch(st):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Et(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mi||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>sn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ku(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const a=Lu(this.options,t),l=(()=>{const f={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#i=!1,this.options.persister?this.options.persister(a,l,this):a(l)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Fu({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Ca&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#s({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ca){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#s({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...$u(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Fc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ve.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function $u(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ju(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Fc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hu=class extends Jn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=Sa(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#a;#i;#s;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),$c(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ra(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ra(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Et(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!Bo(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Hc(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Et(this.options.enabled,this.#t)!==Et(t.enabled,this.#t)||sn(this.options.staleTime,this.#t)!==sn(t.staleTime,this.#t))&&this.#g();const o=this.#v();r&&(this.#t!==n||Et(this.options.enabled,this.#t)!==Et(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return $g(this,n)&&(this.#o=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(st)),t}#g(){this.#w();const e=sn(this.options.staleTime,this.#t);if(_n||this.#o.isStale||!xa(e))return;const n=ku(this.#o.dataUpdatedAt,e)+1;this.#l=mn.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#c=e,!(_n||Et(this.options.enabled,this.#t)===!1||!xa(this.#c)||this.#c===0)&&(this.#u=mn.setInterval(()=>{(this.options.refetchIntervalInBackground||vi.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#w(){this.#l&&(mn.clearTimeout(this.#l),this.#l=void 0)}#x(){this.#u&&(mn.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#o,s=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:l}=e;let f={...l},d=!1,p;if(t._optimisticResults){const P=this.hasListeners(),N=!P&&$c(e,t),F=P&&Hc(e,n,t,r);(N||F)&&(f={...f,...$u(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:h,errorUpdatedAt:y,status:m}=f;p=f.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&m==="pending"){let P;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(P=o.data,v=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,P!==void 0&&(m="success",p=_a(o?.data,P,t),d=!0)}if(t.select&&p!==void 0&&!v)if(o&&p===s?.data&&t.select===this.#m)p=this.#f;else try{this.#m=t.select,p=t.select(p),p=_a(o?.data,p,t),this.#f=p,this.#s=null}catch(P){this.#s=P}this.#s&&(h=this.#s,p=this.#f,y=Date.now(),m="error");const b=f.fetchStatus==="fetching",w=m==="pending",_=m==="error",S=w&&b,C=p!==void 0,T={status:m,fetchStatus:f.fetchStatus,isPending:w,isSuccess:m==="success",isError:_,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:f.dataUpdatedAt,error:h,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:_&&!C,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:_&&C,isStale:yi(e,t),refetch:this.refetch,promise:this.#i,isEnabled:Et(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=T.data!==void 0,N=T.status==="error"&&!P,F=H=>{N?H.reject(T.error):P&&H.resolve(T.data)},z=()=>{const H=this.#i=T.promise=Sa();F(H)},R=this.#i;switch(R.status){case"pending":e.queryHash===n.queryHash&&F(R);break;case"fulfilled":(N||T.data!==R.value)&&z();break;case"rejected":(!N||T.error!==R.reason)&&z();break}}return T}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Bo(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#p.size)return!0;const s=new Set(o??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#o).some(i=>{const a=i;return this.#o[a]!==e[a]&&s.has(a)})};this.#_({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Ve.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Bg(e,t){return Et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $c(e,t){return Bg(e,t)||e.state.data!==void 0&&Ra(e,t,t.refetchOnMount)}function Ra(e,t,n){if(Et(t.enabled,e)!==!1&&sn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&yi(e,t)}return!1}function Hc(e,t,n,r){return(e!==t||Et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&yi(e,n)}function yi(e,t){return Et(t.enabled,e)!==!1&&e.isStaleByTime(sn(t.staleTime,e))}function $g(e,t){return!Bo(e.getCurrentResult(),t)}function zc(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let f=!1;const d=y=>{Og(y,()=>t.signal,()=>f=!0)},p=Lu(t.options,t.fetchOptions),h=async(y,m,v)=>{if(f)return Promise.reject();if(m==null&&y.pages.length)return Promise.resolve(y);const w=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:m,direction:v?"backward":"forward",meta:t.options.meta};return d(O),O})(),_=await p(w),{maxPages:S}=t.options,C=v?Ng:Mg;return{pages:C(y.pages,_,S),pageParams:C(y.pageParams,m,S)}};if(o&&s.length){const y=o==="backward",m=y?Hg:Uc,v={pages:s,pageParams:i},b=m(r,v);a=await h(v,b,y)}else{const y=e??s.length;do{const m=c===0?i[0]??r.initialPageParam:Uc(r,a);if(c>0&&m==null)break;a=await h(a,m),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Uc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Hg(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var zg=class extends Bu{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||zu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=Fu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,i)=>{this.#r({type:"failed",failureCount:s,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:o})}const s=await this.#o.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ve.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function zu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ug=class extends Jn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new zg({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=io(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=io(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=io(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=io(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ve.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Dc(t,n))}findAll(e={}){return this.getAll().filter(t=>Dc(e,t))}notify(e){Ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ve.batch(()=>Promise.all(e.map(t=>t.continue().catch(st))))}};function io(e){return e.options.scope?.id}var Vg=class extends Jn{#e;#t=void 0;#n;#o;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Bo(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Sn(n.mutationKey)!==Sn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??zu();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Ve.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(t.data,null,n,r,o)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(void 0,t.error,n,r,o)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Zg=class extends Jn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??pi(r,t);let s=this.get(o);return s||(s=new Fg({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ve.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>kc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>kc(e,n)):t}notify(e){Ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ve.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ve.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Wg=class{#e;#t;#n;#o;#r;#a;#i;#s;constructor(e={}){this.#e=e.queryCache||new Zg,this.#t=e.mutationCache||new Ug,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=vi.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=$o.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(sn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=Ag(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ve.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ve.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ve.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ve.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(st).catch(st)}invalidateQueries(e,t={}){return Ve.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ve.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(st)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(st)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(sn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(st).catch(st)}fetchInfiniteQuery(e){return e.behavior=zc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(st).catch(st)}ensureInfiniteQueryData(e){return e.behavior=zc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return $o.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(Sn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Mr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Sn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Mr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===mi&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Uu=u.createContext(void 0),er=e=>{const t=u.useContext(Uu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qg=({client:e,children:t})=>(u.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(Uu.Provider,{value:e,children:t})),Vu=u.createContext(!1),Kg=()=>u.useContext(Vu);Vu.Provider;function Zu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wu=u.createContext(Zu()),Gg=()=>u.useContext(Wu),Yg=({children:e})=>{const[t]=u.useState(()=>Zu());return g.jsx(Wu.Provider,{value:t,children:typeof e=="function"?e(t):e})},Qg=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?gi(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Xg=e=>{u.useEffect(()=>{e.clearReset()},[e])},Jg=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||gi(n,[e.error,r])),e2=(e,t)=>t.state.data===void 0,t2=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},n2=(e,t)=>e.isLoading&&e.isFetching&&!t,r2=(e,t)=>e?.suspense&&t.isPending,Vc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qu(e,t,n){const r=Kg(),o=Gg(),s=er(),i=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=s.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",t2(i),Qg(i,o,a),Xg(o);const c=!s.getQueryCache().get(i.queryHash),[l]=u.useState(()=>new t(s,i)),f=l.getOptimisticResult(i),d=!r&&e.subscribed!==!1;if(u.useSyncExternalStore(u.useCallback(p=>{const h=d?l.subscribe(Ve.batchCalls(p)):st;return l.updateResult(),h},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u.useEffect(()=>{l.setOptions(i)},[i,l]),r2(i,f))throw Vc(i,l,o);if(Jg({result:f,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,f),i.experimental_prefetchInRender&&!_n&&n2(f,r)&&(c?Vc(i,l,o):a?.promise)?.catch(st).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?f:l.trackResult(f)}function o2(e,t){return qu(e,Hu)}function Ku(e,t){return qu({...e,enabled:!0,suspense:!0,throwOnError:e2,placeholderData:void 0},Hu)}function s2(e,t){const n=er(),[r]=u.useState(()=>new Vg(n,e));u.useEffect(()=>{r.setOptions(e)},[r,e]);const o=u.useSyncExternalStore(u.useCallback(i=>r.subscribe(Ve.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=u.useCallback((i,a)=>{r.mutate(i,a).catch(st)},[r]);if(o.error&&gi(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Ws={confirmLabel:"OK",dismissible:!0},Zc={confirmLabel:"Continue",cancelLabel:"Cancel",tone:"default",dismissible:!0},a2=e=>typeof e=="string"?{title:e,...Ws}:{...Ws,...e,dismissible:e.dismissible??Ws.dismissible},i2=e=>typeof e=="string"?{title:e,...Zc}:{...Zc,...e,dismissible:e.dismissible??e.tone!=="danger"},c2=()=>{let e={current:null};const t=new Set,n=()=>{t.forEach(c=>c())},r=c=>{e=c,n()},o=()=>e,s=()=>{const c=e.current;!c||c.kind!=="alert"||(r({current:null}),c.resolver())},i=c=>{const l=e.current;!l||l.kind!=="confirm"||(r({current:null}),l.resolver(c))},a=()=>{const c=e.current;if(c){if(c.kind==="confirm"){i(!1);return}s()}};return{subscribe:c=>(t.add(c),()=>{t.delete(c)}),getSnapshot:o,alert:c=>{const l=a2(c);return a(),new Promise(f=>{r({current:{kind:"alert",options:l,resolver:f}})})},confirm:c=>{const l=i2(c);return a(),new Promise(f=>{r({current:{kind:"confirm",options:l,resolver:f}})})},resolveAlert:s,resolveConfirm:i,dismiss:a,reset:()=>{a()}}},Gu=u.createContext(null),l2=()=>{const e=u.useRef();return e.current||(e.current=c2()),e.current},u2=({children:e,components:t})=>{const n=l2(),r=u.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);u.useEffect(()=>()=>{n.reset()},[n]);const o=n,s=r.current;return g.jsxs(Gu.Provider,{value:o,children:[e,s?.kind==="alert"&&g.jsx(t.Alert,{open:!0,options:s.options,onClose:n.resolveAlert}),s?.kind==="confirm"&&g.jsx(t.Confirm,{open:!0,options:s.options,onCancel:()=>n.resolveConfirm(!1),onConfirm:()=>n.resolveConfirm(!0)})]})},d2=()=>{const e=u.useContext(Gu);if(!e)throw new Error("useModal must be used within ModalProvider");return e};function f2(e,t){const n=u.createContext(t),r=s=>{const{children:i,...a}=s,c=u.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Bt(e,t=[]){let n=[];function r(s,i){const a=u.createContext(i),c=n.length;n=[...n,i];const l=d=>{const{scope:p,children:h,...y}=d,m=p?.[e]?.[c]||a,v=u.useMemo(()=>y,Object.values(y));return g.jsx(m.Provider,{value:v,children:h})};l.displayName=s+"Provider";function f(d,p){const h=p?.[e]?.[c]||a,y=u.useContext(h);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(i=>u.createContext(i));return function(a){const c=a?.[e]||s;return u.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,h2(o,...t)]}function h2(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Wc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $r(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Wc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Wc(e[o],null)}}}}function Ee(...e){return u.useCallback($r(...e),e)}function de(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Xe=globalThis?.document?u.useLayoutEffect:()=>{},p2=ns[" useId ".trim().toString()]||(()=>{}),m2=0;function Dt(e){const[t,n]=u.useState(p2());return Xe(()=>{n(r=>r??String(m2++))},[e]),t?`radix-${t}`:""}var g2=ns[" useInsertionEffect ".trim().toString()]||Xe;function qt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=v2({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=u.useCallback(f=>{if(a){const d=y2(f)?f(e):f;d!==e&&i.current?.(d)}else s(f)},[a,e,s,i]);return[c,l]}function v2({defaultProp:e,onChange:t}){const[n,r]=u.useState(e),o=u.useRef(n),s=u.useRef(t);return g2(()=>{s.current=t},[t]),u.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function y2(e){return typeof e=="function"}function Gn(e){const t=b2(e),n=u.forwardRef((r,o)=>{const{children:s,...i}=r,a=u.Children.toArray(s),c=a.find(w2);if(c){const l=c.props.children,f=a.map(d=>d===c?u.Children.count(l)>1?u.Children.only(null):u.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:o,children:u.isValidElement(l)?u.cloneElement(l,void 0,f):null})}return g.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function b2(e){const t=u.forwardRef((n,r)=>{const{children:o,...s}=n;if(u.isValidElement(o)){const i=E2(o),a=x2(s,o.props);return o.type!==u.Fragment&&(a.ref=r?$r(r,i):i),u.cloneElement(o,a)}return u.Children.count(o)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yu=Symbol("radix.slottable");function Qu(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Yu,t}function w2(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yu}function x2(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function E2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],be=_2.reduce((e,t)=>{const n=Gn(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xu(e,t){e&&Zt.flushSync(()=>e.dispatchEvent(t))}function jt(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>t.current?.(...n),[])}function S2(e,t=globalThis?.document){const n=jt(e);u.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var C2="DismissableLayer",Aa="dismissableLayer.update",R2="dismissableLayer.pointerDownOutside",A2="dismissableLayer.focusOutside",qc,Ju=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hr=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=u.useContext(Ju),[f,d]=u.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=u.useState({}),y=Ee(t,T=>d(T)),m=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),w=f?m.indexOf(f):-1,_=l.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,C=M2(T=>{const P=T.target,N=[...l.branches].some(F=>F.contains(P));!S||N||(o?.(T),i?.(T),T.defaultPrevented||a?.())},p),O=N2(T=>{const P=T.target;[...l.branches].some(F=>F.contains(P))||(s?.(T),i?.(T),T.defaultPrevented||a?.())},p);return S2(T=>{w===l.layers.size-1&&(r?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},p),u.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(qc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Kc(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=qc)}},[f,p,n,l]),u.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Kc())},[f,l]),u.useEffect(()=>{const T=()=>h({});return document.addEventListener(Aa,T),()=>document.removeEventListener(Aa,T)},[]),g.jsx(be.div,{...c,ref:y,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:de(e.onFocusCapture,O.onFocusCapture),onBlurCapture:de(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:de(e.onPointerDownCapture,C.onPointerDownCapture)})});Hr.displayName=C2;var T2="DismissableLayerBranch",P2=u.forwardRef((e,t)=>{const n=u.useContext(Ju),r=u.useRef(null),o=Ee(t,r);return u.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(be.div,{...e,ref:o})});P2.displayName=T2;function M2(e,t=globalThis?.document){const n=jt(e),r=u.useRef(!1),o=u.useRef(()=>{});return u.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){ed(R2,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function N2(e,t=globalThis?.document){const n=jt(e),r=u.useRef(!1);return u.useEffect(()=>{const o=s=>{s.target&&!r.current&&ed(A2,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kc(){const e=new CustomEvent(Aa);document.dispatchEvent(e)}function ed(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Xu(o,s):o.dispatchEvent(s)}var qs="focusScope.autoFocusOnMount",Ks="focusScope.autoFocusOnUnmount",Gc={bubbles:!1,cancelable:!0},O2="FocusScope",fs=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=u.useState(null),l=jt(o),f=jt(s),d=u.useRef(null),p=Ee(t,m=>c(m)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let m=function(_){if(h.paused||!a)return;const S=_.target;a.contains(S)?d.current=S:Xt(d.current,{select:!0})},v=function(_){if(h.paused||!a)return;const S=_.relatedTarget;S!==null&&(a.contains(S)||Xt(d.current,{select:!0}))},b=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&Xt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const w=new MutationObserver(b);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),u.useEffect(()=>{if(a){Qc.add(h);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(qs,Gc);a.addEventListener(qs,l),a.dispatchEvent(b),b.defaultPrevented||(I2(F2(td(a)),{select:!0}),document.activeElement===m&&Xt(a))}return()=>{a.removeEventListener(qs,l),setTimeout(()=>{const b=new CustomEvent(Ks,Gc);a.addEventListener(Ks,f),a.dispatchEvent(b),b.defaultPrevented||Xt(m??document.body,{select:!0}),a.removeEventListener(Ks,f),Qc.remove(h)},0)}}},[a,l,f,h]);const y=u.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const w=m.currentTarget,[_,S]=k2(w);_&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&Xt(_,{select:!0})):m.shiftKey&&b===_&&(m.preventDefault(),n&&Xt(S,{select:!0})):b===w&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(be.div,{tabIndex:-1,...i,ref:p,onKeyDown:y})});fs.displayName=O2;function I2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xt(r,{select:t}),document.activeElement!==n)return}function k2(e){const t=td(e),n=Yc(t,e),r=Yc(t.reverse(),e);return[n,r]}function td(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yc(e,t){for(const n of e)if(!D2(n,{upTo:t}))return n}function D2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function L2(e){return e instanceof HTMLInputElement&&"select"in e}function Xt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&L2(e)&&t&&e.select()}}var Qc=j2();function j2(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Xc(e,t),e.unshift(t)},remove(t){e=Xc(e,t),e[0]?.resume()}}}function Xc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function F2(e){return e.filter(t=>t.tagName!=="A")}var B2="Portal",zr=u.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=u.useState(!1);Xe(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?lu.createPortal(g.jsx(be.div,{...r,ref:t}),i):null});zr.displayName=B2;function $2(e,t){return u.useReducer((n,r)=>t[n][r]??n,e)}var $t=e=>{const{present:t,children:n}=e,r=H2(t),o=typeof n=="function"?n({present:r.isPresent}):u.Children.only(n),s=Ee(r.ref,z2(o));return typeof n=="function"||r.isPresent?u.cloneElement(o,{ref:s}):null};$t.displayName="Presence";function H2(e){const[t,n]=u.useState(),r=u.useRef(null),o=u.useRef(e),s=u.useRef("none"),i=e?"mounted":"unmounted",[a,c]=$2(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const l=co(r.current);s.current=a==="mounted"?l:"none"},[a]),Xe(()=>{const l=r.current,f=o.current;if(f!==e){const p=s.current,h=co(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Xe(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=h=>{const m=co(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(s.current=co(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:u.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function co(e){return e?.animationName||"none"}function z2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gs=0;function bi(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jc()),document.body.insertAdjacentElement("beforeend",e[1]??Jc()),Gs++,()=>{Gs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gs--}},[])}function Jc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var U2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dn=new WeakMap,lo=new WeakMap,uo={},Ys=0,nd=function(e){return e&&(e.host||nd(e.parentNode))},V2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=nd(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Z2=function(e,t,n,r){var o=V2(t,Array.isArray(e)?e:[e]);uo[n]||(uo[n]=new WeakMap);var s=uo[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))f(p);else try{var h=p.getAttribute(r),y=h!==null&&h!=="false",m=(Dn.get(p)||0)+1,v=(s.get(p)||0)+1;Dn.set(p,m),s.set(p,v),i.push(p),m===1&&y&&lo.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return f(t),a.clear(),Ys++,function(){i.forEach(function(d){var p=Dn.get(d)-1,h=s.get(d)-1;Dn.set(d,p),s.set(d,h),p||(lo.has(d)||d.removeAttribute(r),lo.delete(d)),h||d.removeAttribute(n)}),Ys--,Ys||(Dn=new WeakMap,Dn=new WeakMap,lo=new WeakMap,uo={})}},wi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=U2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Z2(r,o,n,"aria-hidden")):function(){return null}},hs="Dialog",[rd,od]=Bt(hs),[W2,Mt]=rd(hs),sd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=u.useRef(null),c=u.useRef(null),[l,f]=qt({prop:r,defaultProp:o??!1,onChange:s,caller:hs});return g.jsx(W2,{scope:t,triggerRef:a,contentRef:c,contentId:Dt(),titleId:Dt(),descriptionId:Dt(),open:l,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(d=>!d),[f]),modal:i,children:n})};sd.displayName=hs;var ad="DialogTrigger",id=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(ad,n),s=Ee(t,o.triggerRef);return g.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":_i(o.open),...r,ref:s,onClick:de(e.onClick,o.onOpenToggle)})});id.displayName=ad;var xi="DialogPortal",[q2,cd]=rd(xi,{forceMount:void 0}),ld=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Mt(xi,t);return g.jsx(q2,{scope:t,forceMount:n,children:u.Children.map(r,i=>g.jsx($t,{present:n||s.open,children:g.jsx(zr,{asChild:!0,container:o,children:i})}))})};ld.displayName=xi;var Ho="DialogOverlay",ud=u.forwardRef((e,t)=>{const n=cd(Ho,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Mt(Ho,e.__scopeDialog);return s.modal?g.jsx($t,{present:r||s.open,children:g.jsx(G2,{...o,ref:t})}):null});ud.displayName=Ho;var K2=Gn("DialogOverlay.RemoveScroll"),G2=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(Ho,n);return g.jsx(ri,{as:K2,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx(be.div,{"data-state":_i(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Cn="DialogContent",dd=u.forwardRef((e,t)=>{const n=cd(Cn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Mt(Cn,e.__scopeDialog);return g.jsx($t,{present:r||s.open,children:s.modal?g.jsx(Y2,{...o,ref:t}):g.jsx(Q2,{...o,ref:t})})});dd.displayName=Cn;var Y2=u.forwardRef((e,t)=>{const n=Mt(Cn,e.__scopeDialog),r=u.useRef(null),o=Ee(t,n.contentRef,r);return u.useEffect(()=>{const s=r.current;if(s)return wi(s)},[]),g.jsx(fd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:de(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:de(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:de(e.onFocusOutside,s=>s.preventDefault())})}),Q2=u.forwardRef((e,t)=>{const n=Mt(Cn,e.__scopeDialog),r=u.useRef(!1),o=u.useRef(!1);return g.jsx(fd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),fd=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Mt(Cn,n),c=u.useRef(null),l=Ee(t,c);return bi(),g.jsxs(g.Fragment,{children:[g.jsx(fs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:g.jsx(Hr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":_i(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(J2,{titleId:a.titleId}),g.jsx(tv,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Ei="DialogTitle",hd=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(Ei,n);return g.jsx(be.h2,{id:o.titleId,...r,ref:t})});hd.displayName=Ei;var pd="DialogDescription",md=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(pd,n);return g.jsx(be.p,{id:o.descriptionId,...r,ref:t})});md.displayName=pd;var gd="DialogClose",vd=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(gd,n);return g.jsx(be.button,{type:"button",...r,ref:t,onClick:de(e.onClick,()=>o.onOpenChange(!1))})});vd.displayName=gd;function _i(e){return e?"open":"closed"}var yd="DialogTitleWarning",[X2,bd]=f2(yd,{contentName:Cn,titleName:Ei,docsSlug:"dialog"}),J2=({titleId:e})=>{const t=bd(yd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-CgWgr1BV.js","assets/note-vendor-Hoz9Q4-4.js","assets/graph-vendor-BAF95C0g.js","assets/note-core-CMGUaW1v.js","assets/Callout-DKruIT0f.js","assets/Views-B_wsb-XJ.js","assets/tag.api-CwmC8crB.js","assets/ViewSectionDialog-brTrsF6G.js","assets/SurfaceCard-pydtvHfu.js","assets/ArrowRight.es-CbA8ey6a.js","assets/Plus.es-B0sg64VJ.js","assets/Reminders-C10fHQcl.js","assets/useReminderMutate-DuVKxpBh.js","assets/Graph-kCltGRlY.js","assets/Search-tf2nV4v0.js","assets/Tag-uCoYbISy.js","assets/Note-BW6Np_5g.js","assets/image.api-CYsjXiMr.js","assets/Copy.es-DFbgpaNJ.js","assets/TagNotes-CqOcQiRw.js","assets/ViewNotes-slPXXoOY.js","assets/index-D83QbOcw.js","assets/mcp-admin-adapter-DOgBsYpl.js","assets/Image.es-5pXLx9TU.js","assets/Trash.es-w32Goxfa.js","assets/mcp-Dd98N9Hq.js","assets/trash-wojQBK9Z.js","assets/manage-image-BYIhWu56.js","assets/Image-7W0DZwMo.js","assets/manage-image-detail-6KgmQvbN.js","assets/properties-CyVRKgcT.js","assets/placeholder-siHGg9aK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as g,w as u1,r as Zt,R as lu,a as ri,c as d1,u as f1,o as h1,s as p1,f as m1,b as g1,d as v1,h as y1,e as b1,l as w1,g as x1}from"./note-vendor-Hoz9Q4-4.js";import{a as u,R as ns,b as X,g as Xn,r as E1,P as De,c as ro}from"./graph-vendor-BAF95C0g.js";import{_ as Je}from"./note-core-CMGUaW1v.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const oi={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},uu=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,si=(e,t,n=!0)=>{const r=uu(e);n&&t(r?.matches||!1);const o=s=>{t?.(s.matches)};return r?.addEventListener("change",o),()=>{r?.removeEventListener("change",o)}},_1=(e,t=!0)=>si(oi.DARK,e,t),S1=(e,t,n=!0)=>si(oi.RESPONSIVE(e),t,n),C1={MEDIA_QUERY:oi,listenThemeChange:_1,listenResponsiveChange:S1,createMediaQuery:uu,listenMediaQueryChange:si};var je=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(je||{});function du({update:e,notify:t,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:i,shallowPropagate:a};function r(l,f,d){const p=f.depsTail;if(p!==void 0&&p.dep===l)return;const h=p!==void 0?p.nextDep:f.deps;if(h!==void 0&&h.dep===l){h.version=d,f.depsTail=h;return}const y=l.subsTail;if(y!==void 0&&y.version===d&&y.sub===f)return;const m=f.depsTail=l.subsTail={version:d,dep:l,sub:f,prevDep:p,nextDep:h,prevSub:y,nextSub:void 0};h!==void 0&&(h.prevDep=m),p!==void 0?p.nextDep=m:f.deps=m,y!==void 0?y.nextSub=m:l.subs=m}function o(l,f=l.sub){const d=l.dep,p=l.prevDep,h=l.nextDep,y=l.nextSub,m=l.prevSub;return h!==void 0?h.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=h:f.deps=h,y!==void 0?y.prevSub=m:d.subsTail=m,m!==void 0?m.nextSub=y:(d.subs=y)===void 0&&n(d),h}function s(l){let f=l.nextSub,d;e:do{const p=l.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&c(l,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const y=p.subs;if(y!==void 0){const m=(l=y).nextSub;m!==void 0&&(d={value:f,prev:d},f=m);continue}}if((l=f)!==void 0){f=l.nextSub;continue}for(;d!==void 0;)if(l=d.value,d=d.prev,l!==void 0){f=l.nextSub;continue e}break}while(!0)}function i(l,f){let d,p=0,h=!1;e:do{const y=l.dep,m=y.flags;if(f.flags&16)h=!0;else if((m&17)===17){if(e(y)){const v=y.subs;v.nextSub!==void 0&&a(v),h=!0}}else if((m&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(d={value:l,prev:d}),l=y.deps,f=y,++p;continue}if(!h){const v=l.nextDep;if(v!==void 0){l=v;continue}}for(;p--;){const v=f.subs,b=v.nextSub!==void 0;if(b?(l=d.value,d=d.prev):l=v,h){if(e(f)){b&&a(v),f=l.sub;continue}h=!1}else f.flags&=-33;f=l.sub;const w=l.nextDep;if(w!==void 0){l=w;continue e}}return h}while(!0)}function a(l){do{const f=l.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&t(f))}while((l=l.nextSub)!==void 0)}function c(l,f){let d=f.depsTail;for(;d!==void 0;){if(d===l)return!0;d=d.prevDep}return!1}}let ai=0,fn=0,xr=0;const Ut=[],{link:nC,unlink:fu,propagate:rC,checkDirty:R1,shallowPropagate:oC}=du({update(e){return e.depsTail!==void 0?M1(e):N1(e)},notify(e){let t=xr,n=t;do if(Ut[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(xr=t;n<--t;){const r=Ut[n];Ut[n++]=Ut[t],Ut[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,rs(e)):k1.call(e)}});function A1(){return ai}function T1(){++ai}function P1(){--ai||I1()}function M1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,rs(e)}}function N1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function O1(e){const t=e.flags;if(t&16||t&32&&R1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,rs(e)}}else e.flags=2}function I1(){try{for(;fn<xr;){const e=Ut[fn];Ut[fn++]=void 0,O1(e)}}finally{for(;fn<xr;){const e=Ut[fn];Ut[fn++]=void 0,e.flags|=10}fn=0,xr=0}}function k1(){this.depsTail=void 0,this.flags=0,rs(this);const e=this.subs;e!==void 0&&fu(e)}function rs(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=fu(n,e)}function ii(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}const ga=[];let xo=0;const{link:fc,unlink:D1,propagate:L1,checkDirty:hu,shallowPropagate:hc}=du({update(e){return e._update()},notify(e){ga[va++]=e,e.flags&=~je.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=je.Mutable|je.Dirty,Mo(e))}});let oo=0,va=0,kt;function Mo(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=D1(n,e)}function pu(){if(!(A1()>0)){for(;oo<va;){const e=ga[oo];ga[oo++]=void 0,e.notify()}oo=0,va=0}}function mu(e,t){const n=typeof e=="function",r=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?je.None:je.Mutable,get(){return kt!==void 0&&fc(o,kt,xo),o._snapshot},subscribe(s){const i=ii(s),a={current:!1},c=j1(()=>{o.get(),a.current?i.next?.(o._snapshot):a.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(s){const i=kt,a=Object.is;if(n)kt=o,++xo,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=je.Mutable|je.RecursedCheck);try{const c=o._snapshot,l=typeof s=="function"?s(c):s===void 0&&n?r(c):s;return c===void 0||!a(c,l)?(o._snapshot=l,!0):!1}finally{kt=i,n&&(o.flags&=~je.RecursedCheck),Mo(o)}}};return n?(o.flags=je.Mutable|je.Dirty,o.get=function(){const s=o.flags;if(s&je.Dirty||s&je.Pending&&hu(o.deps,o)){if(o._update()){const i=o.subs;i!==void 0&&hc(i)}}else s&je.Pending&&(o.flags=s&~je.Pending);return kt!==void 0&&fc(o,kt,xo),o._snapshot}):o.set=function(s){if(o._update(s)){const i=o.subs;i!==void 0&&(L1(i),hc(i),pu())}},o}function j1(e){const t=()=>{const r=kt;kt=n,++xo,n.depsTail=void 0,n.flags=je.Watching|je.RecursedCheck;try{return e()}finally{kt=r,n.flags&=~je.RecursedCheck,Mo(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:je.Watching|je.RecursedCheck,notify(){const r=this.flags;r&je.Dirty||r&je.Pending&&hu(this.deps,this)?t():this.flags=je.Watching},stop(){this.flags=je.None,this.depsTail=void 0,Mo(this)}};return t(),n}class F1{constructor(t){this.atom=mu(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ii(t))}}class B1{constructor(t){this.atom=mu(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ii(t))}}function $1(e){return typeof e=="function"?new B1(e):new F1(e)}function H1(e){try{T1(),e()}finally{P1(),pu()}}const rn="__TSR_index",pc="popstate",mc="beforeunload";function z1(e){let t=e.getLocation();const n=new Set,r=i=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:i}))},o=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},s=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const f=e.getBlockers?.()??[],d=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&f.length&&d)for(const p of f){const h=No(c.path,c.state);if(await p.blockerFn({currentLocation:t,nextLocation:h,action:c.type})){e.onBlocked?.();return}}i()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:i=>(n.add(i),()=>{n.delete(i)}),push:(i,a,c)=>{const l=t.state[rn];a=gc(l+1,a),s({task:()=>{e.pushState(i,a),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const l=t.state[rn];a=gc(l,a),s({task:()=>{e.replaceState(i,a),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{s({task:()=>{e.go(i),o({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{s({task:()=>{e.back(i?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{s({task:()=>{e.forward(i?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[rn]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,i]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(l=>l!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function gc(e,t){t||(t={});const n=ci();return{...t,key:n,__TSR_key:n,[rn]:e}}function U1(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,i=P=>o=P,a=(P=>P),c=(()=>No(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=ci();t.history.replaceState({[rn]:0,key:P,__TSR_key:P},"")}let l=c(),f,d=!1,p=!1,h=!1,y=!1;const m=()=>l;let v,b;const w=()=>{v&&(T._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),T._ignoreSubscribers=!1,v=void 0,b=void 0,f=void 0)},_=(P,N,F)=>{const z=a(N);b||(f=l),l=No(N,F),v={href:z,state:F,isPush:v?.isPush||P==="push"},b||(b=Promise.resolve().then(()=>w()))},S=P=>{l=c(),T.notify({type:P})},C=async()=>{if(p){p=!1;return}const P=c(),N=P.state[rn]-l.state[rn],F=N===1,z=N===-1,R=!F&&!z||d;d=!1;const H=R?"GO":z?"BACK":"FORWARD",x=R?{type:"GO",index:N}:{type:z?"BACK":"FORWARD"};if(h)h=!1;else{const I=s();if(typeof document<"u"&&I.length){for(const $ of I)if(await $.blockerFn({currentLocation:l,nextLocation:P,action:H})){p=!0,t.history.go(1),T.notify(x);return}}}l=c(),T.notify(x)},O=P=>{if(y){y=!1;return}let N=!1;const F=s();if(typeof document<"u"&&F.length)for(const z of F){const R=z.enableBeforeUnload??!0;if(R===!0){N=!0;break}if(typeof R=="function"&&R()===!0){N=!0;break}}if(N)return P.preventDefault(),P.returnValue=""},T=z1({getLocation:m,getLength:()=>t.history.length,pushState:(P,N)=>_("push",P,N),replaceState:(P,N)=>_("replace",P,N),back:P=>(P&&(h=!0),y=!0,t.history.back()),forward:P=>{P&&(h=!0),y=!0,t.history.forward()},go:P=>{d=!0,t.history.go(P)},createHref:P=>a(P),flush:w,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(mc,O,{capture:!0}),t.removeEventListener(pc,C)},onBlocked:()=>{f&&l!==f&&(l=f)},getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(mc,O,{capture:!0}),t.addEventListener(pc,C),t.history.pushState=function(...P){const N=n.apply(t.history,P);return T._ignoreSubscribers||S("PUSH"),N},t.history.replaceState=function(...P){const N=r.apply(t.history,P);return T._ignoreSubscribers||S("REPLACE"),N},T}function V1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function No(e,t){const n=V1(e),r=n.indexOf("#"),o=n.indexOf("?"),s=ci();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[rn]:0,key:s,__TSR_key:s}}}function ci(){return(Math.random()+1).toString(36).substring(7)}const Z1=!1;function Er(e){let t;return H1(()=>{t=e()}),t}function Ar(e){return e[e.length-1]}function W1(e){return typeof e=="function"}function tn(e,t){return W1(e)?e(t):e}const q1=Object.prototype.hasOwnProperty,vc=Object.prototype.propertyIsEnumerable;function gt(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=wc(e)&&wc(r);if(!o&&!(Oo(e)&&Oo(r)))return r;const s=o?e:yc(e);if(!s)return r;const i=o?r:yc(r);if(!i)return r;const a=s.length,c=i.length,l=o?new Array(c):{};let f=0;for(let d=0;d<c;d++){const p=o?d:i[d],h=e[p],y=r[p];if(h===y){l[p]=h,(o?d<a:q1.call(e,p))&&f++;continue}if(h===null||y===null||typeof h!="object"||typeof y!="object"){l[p]=y;continue}const m=gt(h,y,n+1);l[p]=m,m===h&&f++}return a===c&&f===a?e:l}function yc(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!vc.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!vc.call(e,o))return!1;r.push(o)}return r}function Oo(e){if(!bc(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!bc(n)||!n.hasOwnProperty("isPrototypeOf"))}function bc(e){return Object.prototype.toString.call(e)==="[object Object]"}function wc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vn(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!vn(e[r],t[r],n))return!1;return!0}if(Oo(e)&&Oo(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!vn(e[i],t[i],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&o++;let s=0;for(const i in t)if((!r||t[i]!==void 0)&&(s++,s>o||!vn(e[i],t[i],n)))return!1;return o===s}return!1}function qn(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function K1(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Tr(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function G1(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function xc(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return G1(t)}const Y1=["http:","https:","mailto:","tel:"];function Io(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function dr(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=xc(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+xc(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function Q1(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var X1="Invariant failed";function an(e,t){if(!e)throw new Error(X1)}function ko(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const i=t.get(s);if(i)return o(i),i.value},set(s,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(s);if(a)a.value=i,o(a);else{const c={key:s,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(s,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Kn=0,xn=1,En=2,Pr=3,hn=4,gu=5;function J1(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function li(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=Kn,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const a=e.length;return n[0]=En,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(s.charCodeAt(0)===36)return n[0]=xn,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const i=J1(s);if(i){const[a,c]=i,l=s.charCodeAt(a+1);if(l===45){if(a+2<s.length&&s.charCodeAt(a+2)===36){const f=a+3,d=c;if(f<d)return n[0]=Pr,n[1]=t+a,n[2]=t+f,n[3]=t+d,n[4]=t+c+1,n[5]=o,n}}else if(l===36){const f=a+1,d=a+2;return d===c?(n[0]=En,n[1]=t+a,n[2]=t+f,n[3]=t+d,n[4]=t+c+1,n[5]=e.length,n):(n[0]=xn,n[1]=t+a,n[2]=t+d,n[3]=t+c,n[4]=t+c+1,n[5]=o,n)}}return n[0]=Kn,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function os(e,t,n,r,o,s,i){i?.(n);let a=r;{const c=n.fullPath??n.from,l=c.length,f=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<l;){const h=li(c,a,t);let y;const m=a,v=h[5];switch(a=v+1,s++,h[0]){case Kn:{const w=c.substring(h[2],h[3]);if(f){const _=o.static?.get(w);if(_)y=_;else{o.static??=new Map;const S=pn(n.fullPath??n.from);S.parent=o,S.depth=s,y=S,o.static.set(w,S)}}else{const _=w.toLowerCase(),S=o.staticInsensitive?.get(_);if(S)y=S;else{o.staticInsensitive??=new Map;const C=pn(n.fullPath??n.from);C.parent=o,C.depth=s,y=C,o.staticInsensitive.set(_,C)}}break}case xn:{const w=c.substring(m,h[1]),_=c.substring(h[4],v),S=f&&!!(w||_),C=w?S?w:w.toLowerCase():void 0,O=_?S?_:_.toLowerCase():void 0,T=!d&&o.dynamic?.find(P=>!P.skipOnParamError&&P.caseSensitive===S&&P.prefix===C&&P.suffix===O);if(T)y=T;else{const P=$s(xn,n.fullPath??n.from,S,C,O);y=P,P.depth=s,P.parent=o,o.dynamic??=[],o.dynamic.push(P)}break}case Pr:{const w=c.substring(m,h[1]),_=c.substring(h[4],v),S=f&&!!(w||_),C=w?S?w:w.toLowerCase():void 0,O=_?S?_:_.toLowerCase():void 0,T=!d&&o.optional?.find(P=>!P.skipOnParamError&&P.caseSensitive===S&&P.prefix===C&&P.suffix===O);if(T)y=T;else{const P=$s(Pr,n.fullPath??n.from,S,C,O);y=P,P.parent=o,P.depth=s,o.optional??=[],o.optional.push(P)}break}case En:{const w=c.substring(m,h[1]),_=c.substring(h[4],v),S=f&&!!(w||_),C=w?S?w:w.toLowerCase():void 0,O=_?S?_:_.toLowerCase():void 0,T=$s(En,n.fullPath??n.from,S,C,O);y=T,T.parent=o,T.depth=s,o.wildcard??=[],o.wildcard.push(T)}}o=y}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const h=pn(n.fullPath??n.from);h.kind=gu,h.parent=o,s++,h.depth=s,o.pathless??=[],o.pathless.push(h),o=h}const p=(n.path||!n.children)&&!n.isRoot;if(p&&c.endsWith("/")){const h=pn(n.fullPath??n.from);h.kind=hn,h.parent=o,s++,h.depth=s,o.index=h,o=h}o.parse=n.options?.params?.parse??null,o.skipOnParamError=d,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,p&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)os(e,t,c,a,o,s,i)}function Bs(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Jt(e){if(e.pathless)for(const t of e.pathless)Jt(t);if(e.static)for(const t of e.static.values())Jt(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Jt(t);if(e.dynamic?.length){e.dynamic.sort(Bs);for(const t of e.dynamic)Jt(t)}if(e.optional?.length){e.optional.sort(Bs);for(const t of e.optional)Jt(t)}if(e.wildcard?.length){e.wildcard.sort(Bs);for(const t of e.wildcard)Jt(t)}}function pn(e){return{kind:Kn,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function $s(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function em(e,t){const n=pn("/"),r=new Uint16Array(6);for(const o of e)os(!1,r,o,1,n,0);Jt(n),t.masksTree=n,t.flatCache=ko(1e3)}function tm(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=ui(e,t.masksTree);return t.flatCache.set(e,r),r}function nm(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let i=o.singleCache.get(s);if(!i){i=pn("/");const a=new Uint16Array(6);os(t,a,{from:e},1,i,0),o.singleCache.set(s,i)}return ui(r,i,n)}function rm(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=ui(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=am(s.route)),t.matchCache.set(r,s),s}function om(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function sm(e,t=!1,n){const r=pn(e.fullPath),o=new Uint16Array(6),s={},i={};let a=0;return os(t,o,e,1,r,0,l=>{if(n?.(l,a),an(!(l.id in s),`Duplicate routes found with id: ${String(l.id)}`),s[l.id]=l,a!==0&&l.path){const f=om(l.fullPath);(!i[f]||l.fullPath.endsWith("/"))&&(i[f]=l)}a++}),Jt(r),{processedTree:{segmentTree:r,singleCache:ko(1e3),matchCache:ko(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function ui(e,t,n=!1){const r=e.split("/"),o=cm(e,r,t,n);if(!o)return null;const[s]=vu(e,r,o);return{route:o.node.route,rawParams:s,parsedParams:o.parsedParams}}function vu(e,t,n){const r=im(n.node);let o=null;const s={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,l++){const f=r[a];if(f.kind===hn)break;if(f.kind===gu){l--,i--,c--;continue}const d=t[i],p=c;if(d&&(c+=d.length),f.kind===xn){o??=n.node.fullPath.split("/");const h=o[l],y=f.prefix?.length??0;if(h.charCodeAt(y)===123){const v=f.suffix?.length??0,b=h.substring(y+2,h.length-v-1),w=d.substring(y,d.length-v);s[b]=decodeURIComponent(w)}else{const v=h.substring(1);s[v]=decodeURIComponent(d)}}else if(f.kind===Pr){if(n.skipped&1<<a){i--,c=p-1;continue}o??=n.node.fullPath.split("/");const h=o[l],y=f.prefix?.length??0,m=f.suffix?.length??0,v=h.substring(y+3,h.length-m-1),b=f.suffix||f.prefix?d.substring(y,d.length-m):d;b&&(s[v]=decodeURIComponent(b))}else if(f.kind===En){const h=f,y=e.substring(p+(h.prefix?.length??0),e.length-(h.suffix?.length??0)),m=decodeURIComponent(y);s["*"]=m,s._splat=m;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:i,node:a,path:c,segment:l}]}function am(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function im(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function cm(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!Ar(t),s=o&&e!=="/",i=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,f=null;for(;a.length;){const d=a.pop(),{node:p,index:h,skipped:y,depth:m,statics:v,dynamics:b,optionals:w}=d;let{extract:_,rawParams:S,parsedParams:C}=d;if(p.skipOnParamError){if(!Hs(e,t,d))continue;S=d.rawParams,_=d.extract,C=d.parsedParams}r&&p.route&&p.kind!==hn&&fr(l,d)&&(l=d);const O=h===i;if(O&&(p.route&&!s&&fr(f,d)&&(f=d),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const T=O?void 0:t[h];let P;if(O&&p.index){const N={node:p.index,index:h,skipped:y,depth:m+1,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C};let F=!0;if(p.index.skipOnParamError&&(Hs(e,t,N)||(F=!1)),F){if(v===i&&!b&&!w&&!y)return N;fr(f,N)&&(f=N)}}if(p.wildcard&&fr(c,d))for(const N of p.wildcard){const{prefix:F,suffix:z}=N;if(F&&(O||!(N.caseSensitive?T:P??=T.toLowerCase()).startsWith(F)))continue;if(z){if(O)continue;const H=t.slice(h).join("/").slice(-z.length);if((N.caseSensitive?H:H.toLowerCase())!==z)continue}const R={node:N,index:i,skipped:y,depth:m,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C};if(!(N.skipOnParamError&&!Hs(e,t,R))){c=R;break}}if(p.optional){const N=y|1<<m,F=m+1;for(let z=p.optional.length-1;z>=0;z--){const R=p.optional[z];a.push({node:R,index:h,skipped:N,depth:F,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(!O)for(let z=p.optional.length-1;z>=0;z--){const R=p.optional[z],{prefix:H,suffix:x}=R;if(H||x){const I=R.caseSensitive?T:P??=T.toLowerCase();if(H&&!I.startsWith(H)||x&&!I.endsWith(x))continue}a.push({node:R,index:h+1,skipped:y,depth:F,statics:v,dynamics:b,optionals:w+1,extract:_,rawParams:S,parsedParams:C})}}if(!O&&p.dynamic&&T)for(let N=p.dynamic.length-1;N>=0;N--){const F=p.dynamic[N],{prefix:z,suffix:R}=F;if(z||R){const H=F.caseSensitive?T:P??=T.toLowerCase();if(z&&!H.startsWith(z)||R&&!H.endsWith(R))continue}a.push({node:F,index:h+1,skipped:y,depth:m+1,statics:v,dynamics:b+1,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(!O&&p.staticInsensitive){const N=p.staticInsensitive.get(P??=T.toLowerCase());N&&a.push({node:N,index:h+1,skipped:y,depth:m+1,statics:v+1,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(!O&&p.static){const N=p.static.get(T);N&&a.push({node:N,index:h+1,skipped:y,depth:m+1,statics:v+1,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}if(p.pathless){const N=m+1;for(let F=p.pathless.length-1;F>=0;F--){const z=p.pathless[F];a.push({node:z,index:h,skipped:y,depth:N,statics:v,dynamics:b,optionals:w,extract:_,rawParams:S,parsedParams:C})}}}if(f&&c)return fr(c,f)?f:c;if(f)return f;if(c)return c;if(r&&l){let d=l.index;for(let h=0;h<l.index;h++)d+=t[h].length;const p=d===e.length?"/":e.slice(d);return l.rawParams??={},l.rawParams["**"]=decodeURIComponent(p),l}return null}function Hs(e,t,n){try{const[r,o]=vu(e,t,n);n.rawParams=r,n.extract=o;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function fr(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===hn)>(e.node.kind===hn)||t.node.kind===hn==(e.node.kind===hn)&&t.depth>e.depth))):!0}function Eo(e){return di(e.filter(t=>t!==void 0).join("/"))}function di(e){return e.replace(/\/{2,}/g,"/")}function yu(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function on(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function bu(e){return on(yu(e))}function Do(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function lm(e,t,n){return Do(e,n)===Do(t,n)}function um({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let i;if(r){i=o?t:s?e:e+"\0"+t;const d=r.get(i);if(d)return d}let a;if(s)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&Ar(a)==="";)a.pop();const d=t.split("/");for(let p=0,h=d.length;p<h;p++){const y=d[p];y===""?p?p===h-1&&a.push(y):a=[y]:y===".."?a.pop():y==="."||a.push(y)}}a.length>1&&(Ar(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,l="";for(let d=0;d<a.length;d++){d>0&&(l+="/");const p=a[d];if(!p)continue;c=li(p,0,c);const h=c[0];if(h===Kn){l+=p;continue}const y=c[5],m=p.substring(0,c[1]),v=p.substring(c[4],y),b=p.substring(c[2],c[3]);h===xn?l+=m||v?`${m}{$${b}}${v}`:`$${b}`:h===En?l+=m||v?`${m}{$}${v}`:"$":l+=`${m}{-$${b}}${v}`}l=di(l);const f=l||"/";return i&&r&&r.set(i,f),f}function dm(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function zs(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>_c(o,n)).join("/"):_c(r,n)}function Ec({path:e,params:t,decoder:n,...r}){let o=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const i=e.length;let a=0,c,l="";for(;a<i;){const d=a;c=li(e,d,c);const p=c[5];if(a=p+1,d===p)continue;const h=c[0];if(h===Kn){l+="/"+e.substring(d,p);continue}if(h===En){const y=t._splat;s._splat=y,s["*"]=y;const m=e.substring(d,c[1]),v=e.substring(c[4],p);if(!y){o=!0,(m||v)&&(l+="/"+m+v);continue}const b=zs("_splat",t,n);l+="/"+m+b+v;continue}if(h===xn){const y=e.substring(c[2],c[3]);!o&&!(y in t)&&(o=!0),s[y]=t[y];const m=e.substring(d,c[1]),v=e.substring(c[4],p),b=zs(y,t,n)??"undefined";l+="/"+m+b+v;continue}if(h===Pr){const y=e.substring(c[2],c[3]),m=t[y];if(m==null)continue;s[y]=m;const v=e.substring(d,c[1]),b=e.substring(c[4],p),w=zs(y,t,n)??"";l+="/"+v+w+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:s,interpolatedPath:l||"/",isMissingParams:o}}function _c(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function wu(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function dt(e){return!!e?.isNotFound}function fm(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ya="tsr-scroll-restoration-v1_3",hm=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function pm(){const e=fm();if(!e)return null;const t=e.getItem(ya);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=tn(r,n)||n;try{e.setItem(ya,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const so=pm(),mm=e=>e.state.__TSR_key||e.href;function gm(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Lo=!1;function vm({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:o,location:s}){let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(l){console.error(l);return}const a=t||window.history.state?.__TSR_key,c=i[a];Lo=!0;e:{if(r&&c&&Object.keys(c).length>0){for(const d in c){const p=c[d];if(d==="window")window.scrollTo({top:p.scrollY,left:p.scrollX,behavior:n});else if(d){const h=document.querySelector(d);h&&(h.scrollLeft=p.scrollX,h.scrollTop=p.scrollY)}}break e}const l=(s??window.location).hash.split("#",2)[1];if(l){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const p=document.getElementById(l);p&&p.scrollIntoView(d)}break e}const f={top:0,left:0,behavior:n};if(window.scrollTo(f),o)for(const d of o){if(d==="window")continue;const p=typeof d=="function"?d():document.querySelector(d);p&&p.scrollTo(f)}}Lo=!1}function ym(e,t){if(!so||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!so))return;e.isScrollRestorationSetup=!0,Lo=!1;const r=e.options.getScrollRestorationKey||mm;window.history.scrollRestoration="manual";const o=s=>{if(Lo||!e.isScrollRestoring)return;let i="";if(s.target===document||s.target===window)i="window";else{const c=s.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=gm(s.target)}const a=r(e.state.location);so.set(c=>{const l=c[a]||={},f=l[i]||={};if(i==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(i){const d=document.querySelector(i);d&&(f.scrollX=d.scrollLeft||0,f.scrollY=d.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",hm(o,100),!0),e.subscribe("onRendered",s=>{const i=r(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(vm({storageKey:ya,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&so.set(a=>(a[i]||={},a)))})}function bm(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function wm(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function Us(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function xm(e){const t=new URLSearchParams(e),n={};for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=Us(o):Array.isArray(s)?s.push(Us(o)):n[r]=[s,Us(o)]}return n}const Em=Sm(JSON.parse),_m=Cm(JSON.stringify,JSON.parse);function Sm(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=xm(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function Cm(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=wm(o,r);return s?`?${s}`:""}}const xt="__root__";function xu(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function vt(e){return e instanceof Response&&!!e.options}const ba=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ss=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Un=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const i=e.matches[s];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},Sc=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(i=>i.routeId===e.router.routeTree.id),o=r>=0?r:0;let s=n?e.matches.findIndex(i=>i.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=o);for(let i=s;i>=0;i--){const a=e.matches[i];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return i}return n?s:o},nn=(e,t,n)=>{if(!(!vt(n)&&!dt(n)))throw vt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:vt(n)?"redirected":r.status==="pending"?"success":r.status,context:Un(e,t.index),isFetching:!1,error:n})),dt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),vt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Eu=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,hr=(e,t,n,r)=>{const{id:o,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,nn(e,e.router.getMatch(o),n);try{i.options.onError?.(n)}catch(a){n=a,nn(e,e.router.getMatch(o),n)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!vt(n)&&!dt(n)&&(e.serialError??=n)},_u=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!ss(e,t)&&(n.options.loader||n.options.beforeLoad||Cu(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{ba(e)},o);r._nonReactive.pendingTimeout=i}},Rm=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;_u(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&nn(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},Am=(e,t,n,r)=>{const o=e.router.getMatch(t),s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=qn(()=>{s?.resolve()});const{paramsError:i,searchError:a}=o;i&&hr(e,n,i,"PARSE_PARAMS"),a&&hr(e,n,a,"VALIDATE_SEARCH"),_u(e,t,r,o);const c=new AbortController;let l=!1;const f=()=>{l||(l=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:c})))},d=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!r.options.beforeLoad){Er(()=>{f(),d()});return}o._nonReactive.beforeLoadPromise=qn();const p={...Un(e,n,!1),...o.__routeContext},{search:h,params:y,cause:m}=o,v=ss(e,t),b={search:h,abortController:c,params:y,preload:v,context:p,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":m,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},w=S=>{if(S===void 0){Er(()=>{f(),d()});return}(vt(S)||dt(S))&&(f(),hr(e,n,S,"BEFORE_LOAD")),Er(()=>{f(),e.updateMatch(t,C=>({...C,__beforeLoadContext:S})),d()})};let _;try{if(_=r.options.beforeLoad(b),Tr(_))return f(),_.catch(S=>{hr(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){f(),hr(e,n,S,"BEFORE_LOAD")}w(_)},Tm=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>a(),i=()=>Am(e,n,t,o),a=()=>{if(Eu(e,n))return;const c=Rm(e,n,o);return Tr(c)?c.then(i):i()};return s()},Pm=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,i,a])=>{const c=s?.meta,l=s?.links,f=s?.scripts,d=s?.styles;return{meta:c,links:l,headScripts:f,headers:a,scripts:i,styles:d}})},Su=(e,t,n,r,o)=>{const s=t[r-1],{params:i,loaderDeps:a,abortController:c,cause:l}=e.router.getMatch(n),f=Un(e,r),d=ss(e,n);return{params:i,deps:a,preload:!!d,parentMatchPromise:s,abortController:c,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:d?"preload":l,route:o,...e.router.options.additionalContext}},Cc=async(e,t,n,r,o)=>{try{const s=e.router.getMatch(n);try{(!(Z1??e.router.isServer)||s.ssr===!0)&&jo(o);const i=o.options.loader?.(Su(e,t,n,r,o)),a=o.options.loader&&Tr(i);if((a||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,f=>({...f,isFetching:"loader"})),o.options.loader){const f=a?await i:i;nn(e,e.router.getMatch(n),f),f!==void 0&&e.updateMatch(n,d=>({...d,loaderData:f}))}o._lazyPromise&&await o._lazyPromise;const l=s._nonReactive.minPendingPromise;l&&await l,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,f=>({...f,error:void 0,context:Un(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let a=i;if(a?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,l=>({...l,status:l.status==="pending"?"success":l.status,isFetching:!1,context:Un(e,r)}));return}const c=s._nonReactive.minPendingPromise;c&&await c,dt(i)&&await o.options.notFoundComponent?.preload?.(),nn(e,e.router.getMatch(n),i);try{o.options.onError?.(i)}catch(l){a=l,nn(e,e.router.getMatch(n),l)}e.updateMatch(n,l=>({...l,error:a,context:Un(e,r),status:"error",isFetching:!1}))}}catch(s){const i=e.router.getMatch(n);i&&(i._nonReactive.loaderPromise=void 0),nn(e,i,s)}},Mm=async(e,t,n)=>{async function r(d,p,h,y){const m=Date.now()-p.updatedAt,v=d?y.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:y.options.staleTime??e.router.options.defaultStaleTime??0,b=y.options.shouldReload,w=typeof b=="function"?b(Su(e,t,o,n,y)):b,{status:_,invalid:S}=h;i=_==="success"&&(S||(w??m>v)),d&&y.options.preload===!1||(i&&!e.sync?(a=!0,(async()=>{try{await Cc(e,t,o,n,y);const C=e.router.getMatch(o);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){vt(C)&&await e.router.navigate(C.options)}})()):(_!=="success"||i&&e.sync)&&await Cc(e,t,o,n,y))}const{id:o,routeId:s}=e.matches[n];let i=!1,a=!1;const c=e.router.looseRoutesById[s];if(!Eu(e,o)){const d=e.router.getMatch(o),p=ss(e,o);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const h=e.router.getMatch(o),y=h._nonReactive.error||h.error;y&&nn(e,h,y),h.status==="pending"&&await r(p,d,h,c)}else{const h=p&&!e.router.state.matches.some(m=>m.id===o),y=e.router.getMatch(o);y._nonReactive.loaderPromise=qn(),h!==y.preload&&e.updateMatch(o,m=>({...m,preload:h})),await r(p,d,y,c)}}const l=e.router.getMatch(o);a||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,a||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;const f=a?l.isFetching:!1;return f!==l.isFetching||l.invalid!==!1?(e.updateMatch(o,d=>({...d,isFetching:f,invalid:!1})),e.router.getMatch(o)):l};async function Rc(e){const t=e,n=[];t.router.state.matches.some(p=>p._forcePending)&&ba(t);let r;for(let p=0;p<t.matches.length;p++){try{const h=Tm(t,p);Tr(h)&&await h}catch(h){if(vt(h))throw h;if(dt(h))r=h;else if(!t.preload)throw h;break}if(t.serialError)break}const o=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?Sc(t,r):void 0,i=r&&t.preload?0:s!==void 0?Math.min(s+1,o):o;let a,c;for(let p=0;p<i;p++)n.push(Mm(t,n,p));try{await Promise.all(n)}catch{const p=await Promise.allSettled(n);for(const h of p){if(h.status!=="rejected")continue;const y=h.reason;if(vt(y))throw y;dt(y)?a??=y:c??=y}if(c!==void 0)throw c}const l=a??(r&&!t.preload?r:void 0);let f=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!l&&r&&t.preload)return t.matches;if(l){const p=Sc(t,l);an(p!==void 0);const h=t.matches[p],y=t.router.looseRoutesById[h.routeId],m=t.router.options?.defaultNotFoundComponent;!y.options.notFoundComponent&&m&&(y.options.notFoundComponent=m),l.routeId=h.routeId;const v=h.routeId===t.router.routeTree.id;t.updateMatch(h.id,b=>({...b,...v?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:l},isFetching:!1})),f=p,await jo(y)}else if(!t.preload){const p=t.matches[0];p.globalNotFound||t.router.getMatch(p.id)?.globalNotFound&&t.updateMatch(p.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const p=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await jo(p)}for(let p=0;p<=f;p++){const h=t.matches[p],{id:y,routeId:m}=h,v=t.router.looseRoutesById[m];try{const b=Pm(t,y,v);if(b){const w=await b;t.updateMatch(y,_=>({..._,...w}))}}catch(b){console.error(`Error executing head for route ${m}:`,b)}}const d=ba(t);if(Tr(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function jo(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of Ru){const o=e.options[r]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Cu(e){for(const t of Ru)if(e.options[t]?.preload)return!0;return!1}const Ru=["component","errorComponent","pendingComponent","notFoundComponent"];function Nm(e){return{input:({url:t})=>{for(const n of e)t=wa(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Au(e[n],t);return t}}}function Om(e){const t=bu(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===o?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(n.length)),i},output:({url:i})=>(i.pathname=Eo(["/",t,i.pathname]),i)}}function wa(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Au(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function yn(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,o=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:o,hashChanged:s}}function Im(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class km{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=dm(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=U1()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=ko(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=$1(Lm(this.latestLocation)),ym(this));let a=!1;const c=this.options.basepath??"/",l=this.options.rewrite;if(s||o!==c||i!==l){this.basepath=c;const p=[],h=bu(c);h&&h!=="/"&&p.push(Om({basepath:c})),l&&p.push(l),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Nm(p),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(p=>({...p,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=sm(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&em(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:c,search:l,hash:f,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const w=this.options.parseSearch(l),_=this.options.stringifySearch(w);return{href:c+_+f,publicHref:d,pathname:dr(c).path,external:!1,searchStr:_,search:gt(r?.search,w),hash:dr(f.slice(1)).path,state:gt(r?.state,p)}}const h=new URL(d,this.origin),y=wa(this.rewrite,h),m=this.options.parseSearch(y.search),v=this.options.stringifySearch(m);return y.search=v,{href:y.href.replace(y.origin,""),publicHref:d,pathname:dr(y.pathname).path,external:!!this.rewrite&&y.origin!==this.origin,searchStr:v,search:gt(r?.search,m),hash:dr(y.hash.slice(1)).path,state:gt(r?.state,p)}},s=o(n),{__tempLocation:i,__tempKey:a}=s.state;if(i&&(!a||a===this.tempLocationKey)){const c=o(i);return c.state.key=s.state.key,c.state.__TSR_key=s.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>um({base:n,to:di(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>jm({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),r=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const r=(s={})=>{const i=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);s.from;const c=s.unsafeRelative==="path"?i.pathname:s.from??a.fullPath,l=this.resolvePathWithBase(c,"."),f=a.search,d={...a.params},p=s.to?this.resolvePathWithBase(l,`${s.to}`):this.resolvePathWithBase(l,"."),h=s.params===!1||s.params===null?{}:(s.params??!0)===!0?d:Object.assign(d,tn(s.params,d)),y=this.getMatchedRoutes(p);let m=y.matchedRoutes;if((!y.foundRoute||y.foundRoute.path!=="/"&&y.routeParams["**"])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(h).length>0)for(const z of m){const R=z.options.params?.stringify??z.options.stringifyParams;if(R)try{Object.assign(h,R(h))}catch{}}const b=n.leaveParams?p:dr(Ec({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=f;if(n._includeValidateSearch&&this.options.search?.strict){const z={};m.forEach(R=>{if(R.options.validateSearch)try{Object.assign(z,_o(R.options.validateSearch,{...z,...w}))}catch{}}),w=z}w=Fm({search:w,dest:s,destRoutes:m,_includeValidateSearch:n._includeValidateSearch}),w=gt(f,w);const _=this.options.stringifySearch(w),S=s.hash===!0?i.hash:s.hash?tn(s.hash,i.hash):void 0,C=S?`#${S}`:"";let O=s.state===!0?i.state:s.state?tn(s.state,i.state):{};O=gt(i.state,O);const T=`${b}${_}${C}`;let P,N,F=!1;if(this.rewrite){const z=new URL(T,this.origin),R=Au(this.rewrite,z);P=z.href.replace(z.origin,""),R.origin!==this.origin?(N=R.href,F=!0):N=R.pathname+R.search+R.hash}else P=Q1(T),N=P;return{publicHref:N,href:P,pathname:b,search:w,searchStr:_,state:O,hash:S??"",external:F,unmaskOnReload:s.unmaskOnReload}},o=(s={},i)=>{const a=r(s);let c=i?r(i):void 0;if(!c){const l={};if(this.options.routeMasks){const f=tm(a.pathname,this.processedTree);if(f){Object.assign(l,f.rawParams);const{from:d,params:p,...h}=f.route,y=p===!1||p===null?{}:(p??!0)===!0?l:Object.assign(l,tn(p,l));i={from:n.from,...h,params:y},c=r(i)}}}return c&&(a.maskedLocation=c),a};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const s=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(f=>{o.state[f]=this.latestLocation.state[f]});const l=vn(o.state,this.latestLocation.state);return c.forEach(f=>{delete o.state[f]}),l},i=on(this.latestLocation.href)===on(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=qn(()=>{a?.resolve()}),i&&s())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...f}=o;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:i,href:a,...c}={})=>{if(a){const d=this.history.location.state.__TSR_index,p=No(a,{__TSR_index:n?d:d+1}),h=new URL(p.pathname,this.origin),y=wa(this.rewrite,h);c.to=y.pathname,c.search=this.options.parseSearch(p.search),c.hash=p.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const f=this.commitLocation({...l,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...i})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!o){const l=this.buildLocation({to:n,...i});o=o??l.publicHref,s=s??l.publicHref}const c=!a&&s?s:o;if(Io(c,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const d of f)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(o=>!n.some(s=>s.id===o.id))}))},this.load=async n=>{let r,o,s;for(s=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...yn({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...yn({resolvedLocation:l,location:c})}),await Rc({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],d=[],p=[],h=[];Er(()=>{this.__store.setState(y=>{const m=y.matches,v=y.pendingMatches||y.matches;return f=m.filter(b=>!v.some(w=>w.id===b.id)),d=m.filter(b=>!v.some(w=>w.routeId===b.routeId)),p=v.filter(b=>!m.some(w=>w.routeId===b.routeId)),h=v.filter(b=>m.some(w=>w.routeId===b.routeId)),{...y,isLoading:!1,loadedAt:Date.now(),matches:v,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[p,"onEnter"],[h,"onStay"]].forEach(([y,m])=>{y.forEach(v=>{this.looseRoutesById[v.routeId].options[m]?.(v)})})})})}})}catch(c){vt(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):dt(c)&&(o=c),this.__store.setState(l=>({...l,statusCode:r?r.status:o?404:l.matches.some(f=>f.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,i=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(yn({resolvedLocation:i,location:s})):r.types;if(a===!1){n();return}o={update:n,types:a}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";o&&(o==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:Im(s.cachedMatches.map(i=>i.id===n?r(i):i))})):this.__store.setState(s=>({...s,[o]:s[o]?.map(i=>i.id===n?r(i):i)})))})},this.getMatch=n=>{const r=o=>o.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&Io(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(s=>!r(s))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const s=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=jo,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...s,...this.state.cachedMatches.map(a=>a.id)]);Er(()=>{o.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return o=await Rc({router:this,matches:o,location:r,preload:!0,updateMatch:(a,c)=>{s.has(a)?o=o.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),o}catch(a){if(vt(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});dt(a)||console.error(a);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const a=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=nm(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!vn(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?vn(a.search,s.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??_m,parseSearch:t.parseSearch??Em,protocolAllowlist:t.protocolAllowlist??Y1}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:s,parsedParams:i}=r;let{matchedRoutes:a}=r,c=!1;(o?o.path!=="/"&&s["**"]:on(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const l=c?$m(this.options.notFoundMode,a):void 0,f=new Array(a.length),d=new Map(this.state.matches.map(p=>[p.routeId,p]));for(let p=0;p<a.length;p++){const h=a[p],y=f[p-1];let m,v,b;{const x=y?.search??t.search,I=y?._strictSearch??void 0;try{const $=_o(h.options.validateSearch,{...x})??void 0;m={...x,...$},v={...I,...$},b=void 0}catch($){let D=$;if($ instanceof Fo||(D=new Fo($.message,{cause:$})),n?.throwOnError)throw D;m=x,v={},b=D}}const w=h.options.loaderDeps?.({search:m})??"",_=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:C}=Ec({path:h.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),O=h.id+S+_,T=this.getMatch(O),P=d.get(h.id),N=T?._strictParams??C;let F;if(!T)try{Ac(h,C,i,N)}catch(x){if(dt(x)||vt(x)?F=x:F=new Dm(x.message,{cause:x}),n?.throwOnError)throw F}Object.assign(s,N);const z=P?"stay":"enter";let R;if(T)R={...T,cause:z,params:P?.params??s,_strictParams:N,search:gt(P?P.search:T.search,m),_strictSearch:v};else{const x=h.options.loader||h.options.beforeLoad||h.lazyFn||Cu(h)?"pending":"success";R={id:O,ssr:h.options.ssr,index:p,routeId:h.id,params:P?.params??s,_strictParams:N,pathname:S,updatedAt:Date.now(),search:P?gt(P.search,m):m,_strictSearch:v,searchError:void 0,status:x,isFetching:!1,error:void 0,paramsError:F,__routeContext:void 0,_nonReactive:{loadPromise:qn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:z,loaderDeps:P?gt(P.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}n?.preload||(R.globalNotFound=l===h.id),R.searchError=b;const H=this.getParentContext(y);R.context={...H,...R.__routeContext,...R.__beforeLoadContext},f[p]=R}for(let p=0;p<f.length;p++){const h=f[p],y=this.looseRoutesById[h.routeId],m=this.getMatch(h.id),v=d.get(h.routeId);if(h.params=v?gt(v.params,s):s,!m){const b=f[p-1],w=this.getParentContext(b);if(y.options.context){const _={deps:h.loaderDeps,params:h.params,context:w??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:f,routeId:y.id};h.__routeContext=y.options.context(_)??void 0}h.context={...w,...h.__routeContext,...h.__beforeLoadContext}}}return f}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),s=Ar(n),i={...t.search};for(const f of n)try{Object.assign(i,_o(f.options.validateSearch,i))}catch{}const a=Ar(this.state.matches),c=a&&a.routeId===s.id&&t.pathname===this.state.location.pathname;let l;if(c)l=a.params;else{const f={...r};for(const d of n)try{Ac(d,r,o??{},f)}catch{}l=f}return{matchedRoutes:n,fullPath:s.fullPath,search:i,params:l}}}class Fo extends Error{}class Dm extends Error{}function Lm(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function _o(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Fo("Async validation not supported");if(n.issues)throw new Fo(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function jm({pathname:e,routesById:t,processedTree:n}){const r={},o=on(e);let s,i;const a=rm(o,n,!0);return a&&(s=a.route,Object.assign(r,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:a?.branch||[t[xt]],routeParams:r,foundRoute:s,parsedParams:i}}function Fm({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Bm(n)(e,t,r??!1)}function Bm(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const s=({search:i,next:a})=>{let c=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(c=o.options.preSearchFilters.reduce((f,d)=>d(f),i));const l=a(c);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,d)=>d(f),l):l};t.middlewares.push(s)}if(o.options.validateSearch){const s=({search:i,next:a})=>{const c=a(i);if(!t._includeValidateSearch)return c;try{return{...c,..._o(o.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(s)}}const n=({search:o})=>{const s=t.dest;return s.search?s.search===!0?o:tn(s.search,o):{}};t.middlewares.push(n);const r=(o,s,i)=>{if(o>=i.length)return s;const a=i[o];return a({search:s,next:l=>r(o+1,l,i)})};return function(s,i,a){return t.dest=i,t._includeValidateSearch=a,r(0,s,t.middlewares)}}function $m(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return xt}function Ac(e,t,n,r){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=o(r);Object.assign(r,s)}}const Hm="Error preloading route! ☝️";class Tu{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=xt:this.parentRoute||an(!1);let s=o?xt:r?.path;s&&s!=="/"&&(s=yu(s));const i=r?.id||s;let a=o?xt:Eo([this.parentRoute.id===xt?"":this.parentRoute.id,i]);s===xt&&(s="/"),a!==xt&&(a=Eo(["/",a]));const c=a===xt?"/":Eo([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=c,this._to=on(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>xu({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class zm{constructor({id:t}){this.notFound=n=>wu({routeId:this.id,...n}),this.redirect=n=>xu({from:this.id,...n}),this.id=t}}class Um extends Tu{constructor(t){super(t)}}const Vm="use",Tc=ns[Vm],ao=typeof window<"u"?u.useLayoutEffect:u.useEffect;function Vs(e){const t=u.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Zm(e,t,n={},r={}){u.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function Wm(e){const t=u.useRef(null);return u.useImperativeHandle(e,()=>t.current,[]),t}function fi(e){const t=e.errorComponent??hi;return g.jsx(qm,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?u.createElement(t,{error:n,reset:r}):e.children})}class qm extends u.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function hi({error:e}){const[t,n]=u.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function Km({children:e,fallback:t=null}){return Pu()?g.jsx(X.Fragment,{children:e}):g.jsx(X.Fragment,{children:t})}function Pu(){return X.useSyncExternalStore(Gm,()=>!0,()=>!1)}function Gm(){return()=>{}}function Ym(e,t){return e===t}function Qm(e,t,n=Ym){const r=u.useCallback(i=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(i);return a},[e]),o=u.useCallback(()=>e?.get(),[e]);return u1.useSyncExternalStoreWithSelector(r,o,o,t,n)}const Mu=u.createContext(null);function it(e){const t=u.useContext(Mu);return e?.warn,t}function yt(e){const t=it({warn:e?.router===void 0}),n=e?.router||t,r=u.useRef(void 0);return Qm(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=gt(r.current,e.select(o));return r.current=s,s}return e.select(o)}return o})}const as=u.createContext(void 0),Xm=u.createContext(void 0);function Ct(e){const t=u.useContext(e.from?Xm:as);return yt({select:r=>{const o=r.matches.find(s=>e.from?e.from===s.routeId:s.id===t);if(an(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function is(e){return Ct({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function cs(e){const{select:t,...n}=e;return Ct({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function ls(e){return Ct({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function us(e){return Ct({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Pn(e){const t=it();return u.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Jm(e,t){const n=it(),r=Wm(t),{activeProps:o,inactiveProps:s,activeOptions:i,to:a,preload:c,preloadDelay:l,hashScrollIntoView:f,replace:d,startTransition:p,resetScroll:h,viewTransition:y,children:m,target:v,disabled:b,style:w,className:_,onClick:S,onBlur:C,onFocus:O,onMouseEnter:T,onMouseLeave:P,onTouchStart:N,ignoreBlocker:F,params:z,search:R,hash:H,state:x,mask:I,reloadDocument:$,unsafeRelative:D,from:q,_fromLocation:k,...Y}=e,L=Pu(),j=yt({select:ae=>{const ge=ae.matches[ae.matches.length-1];return{search:ge?.search,hash:ae.location.hash,path:ge?.pathname}},structuralSharing:!0}),K=e.from,G=u.useMemo(()=>({...e,from:K}),[n,j,K,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Z=u.useMemo(()=>n.buildLocation({...G}),[n,G]),le=Z.maskedLocation?Z.maskedLocation.publicHref:Z.publicHref,te=Z.maskedLocation?Z.maskedLocation.external:Z.external,Q=u.useMemo(()=>sg(le,te,n.history,b),[b,te,le,n.history]),ie=u.useMemo(()=>{if(Q?.external)return Io(Q.href,n.protocolAllowlist)?void 0:Q.href;if(!ag(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Io(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Q,n.protocolAllowlist]),re=yt({select:ae=>{if(ie)return!1;if(i?.exact){if(!lm(ae.location.pathname,Z.pathname,n.basepath))return!1}else{const ge=Do(ae.location.pathname,n.basepath),pe=Do(Z.pathname,n.basepath);if(!(ge.startsWith(pe)&&(ge.length===pe.length||ge[pe.length]==="/")))return!1}return(i?.includeSearch??!0)&&!vn(ae.location.search,Z.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?L&&ae.location.hash===Z.hash:!0}}),ce=re?tn(o,{})??eg:Zs,fe=re?Zs:tn(s,{})??Zs,ve=[_,ce.className,fe.className].filter(Boolean).join(" "),E=(w||ce.style||fe.style)&&{...w,...ce.style,...fe.style},[J,W]=u.useState(!1),M=u.useRef(!1),A=e.reloadDocument||ie?!1:c??n.options.defaultPreload,B=l??n.options.defaultPreloadDelay??0,ee=u.useCallback(()=>{n.preloadRoute({...G,_builtLocation:Z}).catch(ae=>{console.warn(ae),console.warn(Hm)})},[n,G,Z]),ne=u.useCallback(ae=>{ae?.isIntersecting&&ee()},[ee]);Zm(r,ne,og,{disabled:!!b||A!=="viewport"}),u.useEffect(()=>{M.current||!b&&A==="render"&&(ee(),M.current=!0)},[b,ee,A]);const U=ae=>{const ge=ae.currentTarget.getAttribute("target"),pe=v!==void 0?v:ge;if(!b&&!ig(ae)&&!ae.defaultPrevented&&(!pe||pe==="_self")&&ae.button===0){ae.preventDefault(),Zt.flushSync(()=>{W(!0)});const Ne=n.subscribe("onResolved",()=>{Ne(),W(!1)});n.navigate({...G,replace:d,resetScroll:h,hashScrollIntoView:f,startTransition:p,viewTransition:y,ignoreBlocker:F})}};if(ie)return{...Y,ref:r,href:ie,...m&&{children:m},...v&&{target:v},...b&&{disabled:b},...w&&{style:w},..._&&{className:_},...S&&{onClick:S},...C&&{onBlur:C},...O&&{onFocus:O},...T&&{onMouseEnter:T},...P&&{onMouseLeave:P},...N&&{onTouchStart:N}};const oe=ae=>{if(b||A!=="intent")return;if(!B){ee();return}const ge=ae.currentTarget;if(pr.has(ge))return;const pe=setTimeout(()=>{pr.delete(ge),ee()},B);pr.set(ge,pe)},ue=ae=>{b||A!=="intent"||ee()},se=ae=>{if(b||!A||!B)return;const ge=ae.currentTarget,pe=pr.get(ge);pe&&(clearTimeout(pe),pr.delete(ge))};return{...Y,...ce,...fe,href:Q?.href,ref:r,onClick:kn([S,U]),onBlur:kn([C,se]),onFocus:kn([O,oe]),onMouseEnter:kn([T,oe]),onMouseLeave:kn([P,se]),onTouchStart:kn([N,ue]),disabled:!!b,target:v,...E&&{style:E},...ve&&{className:ve},...b&&tg,...re&&ng,...L&&J&&rg}}const Zs={},eg={className:"active"},tg={role:"link","aria-disabled":!0},ng={"data-status":"active","aria-current":"page"},rg={"data-transitioning":"transitioning"},pr=new WeakMap,og={rootMargin:"100px"},kn=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function sg(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function ag(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Wt=u.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=Jm(r,t),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=s;return u.createElement("a",c,i)}return u.createElement(n,s,i)});function ig(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function cg(e){return new lg({id:e})}class lg extends zm{constructor({id:t}){super({id:t}),this.useMatch=n=>Ct({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>cs({...n,from:this.id,strict:!1}),this.useLoaderData=n=>is({...n,from:this.id,strict:!1}),this.useNavigate=()=>{const n=it();return Pn({from:n.routesById[this.id].fullPath})},this.notFound=n=>wu({routeId:this.id,...n}),this.Link=X.forwardRef((n,r)=>{const s=it().routesById[this.id].fullPath;return g.jsx(Wt,{ref:r,from:s,...n})})}}let ug=class extends Tu{constructor(t){super(t),this.useMatch=n=>Ct({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>cs({...n,from:this.id}),this.useLoaderData=n=>is({...n,from:this.id}),this.useNavigate=()=>Pn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>g.jsx(Wt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function We(e){return new ug(e)}class dg extends Um{constructor(t){super(t),this.useMatch=n=>Ct({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>cs({...n,from:this.id}),this.useLoaderData=n=>is({...n,from:this.id}),this.useNavigate=()=>Pn({from:this.fullPath}),this.Link=X.forwardRef((n,r)=>g.jsx(Wt,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function fg(e){return new dg(e)}function Pc(e){return typeof e=="object"?new Mc(e,{silent:!0}).createRoute(e):new Mc(e,{silent:!0}).createRoute}class Mc{constructor(t,n){this.path=t,this.createRoute=r=>{const o=We(r);return o.isRoot=!1,o},this.silent=n?.silent}}class Nc{constructor(t){this.useMatch=n=>Ct({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ct({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>us({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>ls({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>cs({...n,from:this.options.id}),this.useLoaderData=n=>is({...n,from:this.options.id}),this.useNavigate=()=>{const n=it();return Pn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Oc(e){return typeof e=="object"?new Nc(e):t=>new Nc({id:e,...t})}function et(e,t){let n,r,o,s;const i=()=>(n||(n=e().then(c=>{n=void 0,r=c.default}).catch(c=>{if(o=c,K1(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const l=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(l)||(sessionStorage.setItem(l,"1"),s=!0)}})),n),a=function(l){if(s)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!r)if(Tc)Tc(i());else throw i();return u.createElement(r,l)};return a.preload=i,a}function hg(){const e=it(),t=u.useRef({router:e,mounted:!1}),[n,r]=u.useState(!1),{hasPendingMatches:o,isLoading:s}=yt({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),i=Vs(s),a=s||n||o,c=Vs(a),l=s||o,f=Vs(l);return e.startTransition=d=>{r(!0),u.startTransition(()=>{d(),r(!1)})},u.useEffect(()=>{const d=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return on(e.latestLocation.publicHref)!==on(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{d()}},[e,e.history]),ao(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),ao(()=>{i&&!s&&e.emit({type:"onLoad",...yn(e.state)})},[i,e,s]),ao(()=>{f&&!l&&e.emit({type:"onBeforeRouteMount",...yn(e.state)})},[l,f,e]),ao(()=>{if(c&&!a){const d=yn(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),d.hrefChanged&&bm(e)}},[a,c,e]),null}function pg(e){const t=yt({select:n=>`not-found-${n.location.pathname}-${n.status}`});return g.jsx(fi,{getResetKey:()=>t,onCatch:(n,r)=>{if(dt(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(dt(n))return e.fallback?.(n);throw n},children:e.children})}function mg(){return g.jsx("p",{children:"Not Found"})}function $n(e){return g.jsx(g.Fragment,{children:e.children})}function Nu(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):g.jsx(mg,{})}function gg(){return it().isScrollRestoring,null}const Ou=u.memo(function({matchId:t}){const n=it(),r=yt({select:m=>{const v=m.matches.findIndex(w=>w.id===t),b=m.matches[v];return an(b),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:m.loadedAt,parentRouteId:m.matches[v-1]?.routeId}},structuralSharing:!0}),o=n.routesById[r.routeId],s=o.options.pendingComponent??n.options.defaultPendingComponent,i=s?g.jsx(s,{}):null,a=o.options.errorComponent??n.options.defaultErrorComponent,c=o.options.onCatch??n.options.defaultOnCatch,l=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",d=(!o.isRoot||o.options.wrapInSuspense||f)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||f))?u.Suspense:$n,p=a?fi:$n,h=l?pg:$n,y=o.isRoot?o.options.shellComponent??$n:$n;return g.jsxs(y,{children:[g.jsx(as.Provider,{value:t,children:g.jsx(d,{fallback:i,children:g.jsx(p,{getResetKey:()=>r.resetKey,errorComponent:a||hi,onCatch:(m,v)=>{if(dt(m))throw m;c?.(m,v)},children:g.jsx(h,{fallback:m=>{if(!l||m.routeId&&m.routeId!==r.routeId||!m.routeId&&!o.isRoot)throw m;return u.createElement(l,m)},children:f||r._displayPending?g.jsx(Km,{fallback:i,children:g.jsx(Ic,{matchId:t})}):g.jsx(Ic,{matchId:t})})})})}),r.parentRouteId===xt&&n.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(vg,{}),g.jsx(gg,{})]}):null]})});function vg(){const e=it(),t=u.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...yn(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Ic=u.memo(function({matchId:t}){const n=it(),{match:r,key:o,routeId:s}=yt({select:c=>{const l=c.matches.find(y=>y.id===t),f=l.routeId,p=(n.routesById[f].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:f,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:p?JSON.stringify(p):void 0,routeId:f,match:{id:l.id,status:l.status,error:l.error,invalid:l.invalid,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=n.routesById[s],a=u.useMemo(()=>{const c=i.options.component??n.options.defaultComponent;return c?g.jsx(c,{},o):g.jsx(Iu,{})},[o,i.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const c=i.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const l=n.getMatch(r.id);if(l&&!l._nonReactive.minPendingPromise){const f=qn();l._nonReactive.minPendingPromise=f,setTimeout(()=>{f.resolve(),l._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return an(dt(r.error)),Nu(n,i,r.error);if(r.status==="redirected")throw an(vt(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return a}),Iu=u.memo(function(){const t=it(),n=u.useContext(as),r=yt({select:l=>l.matches.find(f=>f.id===n)?.routeId}),o=t.routesById[r],s=yt({select:l=>{const d=l.matches.find(p=>p.id===n);return an(d),d.globalNotFound}}),i=yt({select:l=>{const f=l.matches,d=f.findIndex(p=>p.id===n);return f[d+1]?.id}}),a=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Nu(t,o,void 0);if(!i)return null;const c=g.jsx(Ou,{matchId:i});return r===xt?g.jsx(u.Suspense,{fallback:a,children:c}):c});function yg(){const e=it(),n=e.routesById[xt].options.pendingComponent??e.options.defaultPendingComponent,r=n?g.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?$n:u.Suspense,s=g.jsxs(o,{fallback:r,children:[g.jsx(hg,{}),g.jsx(bg,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:s}):s}function bg(){const e=it(),t=yt({select:o=>o.matches[0]?.id}),n=yt({select:o=>o.loadedAt}),r=t?g.jsx(Ou,{matchId:t}):null;return g.jsx(as.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:g.jsx(fi,{getResetKey:()=>n,errorComponent:hi,onCatch:void 0,children:r})})}const wg=e=>new xg(e);class xg extends km{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Pc,globalThis.createLazyFileRoute=Oc):typeof window<"u"&&(window.createFileRoute=Pc,window.createLazyFileRoute=Oc);function Eg({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=g.jsx(Mu.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:r}):r}function _g({router:e,...t}){return g.jsx(Eg,{router:e,...t,children:g.jsx(yg,{})})}function ds(e){return yt({select:t=>e?.select?e.select(t.location):t.location})}var Jn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cg=class{#e=Sg;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},mn=new Cg;function Rg(e){setTimeout(e,0)}var _n=typeof window>"u"||"Deno"in globalThis;function st(){}function Ag(e,t){return typeof e=="function"?e(t):e}function xa(e){return typeof e=="number"&&e>=0&&e!==1/0}function ku(e,t){return Math.max(e+(t||0)-Date.now(),0)}function sn(e,t){return typeof e=="function"?e(t):e}function Et(e,t){return typeof e=="function"?e(t):e}function kc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==pi(i,t.options))return!1}else if(!Mr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Dc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Sn(t.options.mutationKey)!==Sn(s))return!1}else if(!Mr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function pi(e,t){return(t?.queryKeyHashFn||Sn)(e)}function Sn(e){return JSON.stringify(e,(t,n)=>Ea(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Mr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Mr(e[n],t[n])):!1}var Tg=Object.prototype.hasOwnProperty;function Du(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Lc(e)&&Lc(t);if(!r&&!(Ea(e)&&Ea(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let l=0;for(let f=0;f<a;f++){const d=r?f:i[f],p=e[d],h=t[d];if(p===h){c[d]=p,(r?f<s:Tg.call(e,d))&&l++;continue}if(p===null||h===null||typeof p!="object"||typeof h!="object"){c[d]=h;continue}const y=Du(p,h,n+1);c[d]=y,y===p&&l++}return s===a&&l===s?e:c}function Bo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Lc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ea(e){if(!jc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pg(e){return new Promise(t=>{mn.setTimeout(t,e)})}function _a(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Du(e,t):t}function Mg(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ng(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mi=Symbol();function Lu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gi(e,t){return typeof e=="function"?e(...t):!!e}function Og(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Ig=class extends Jn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!_n&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},vi=new Ig;function Sa(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var kg=Rg;function Dg(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=kg;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ve=Dg(),Lg=class extends Jn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!_n&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},$o=new Lg;function jg(e){return Math.min(1e3*2**e,3e4)}function ju(e){return(e??"online")==="online"?$o.isOnline():!0}var Ca=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fu(e){let t=!1,n=0,r;const o=Sa(),s=()=>o.status!=="pending",i=m=>{if(!s()){const v=new Ca(m);p(v),e.onCancel?.(v)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>vi.isFocused()&&(e.networkMode==="always"||$o.isOnline())&&e.canRun(),f=()=>ju(e.networkMode)&&e.canRun(),d=m=>{s()||(r?.(),o.resolve(m))},p=m=>{s()||(r?.(),o.reject(m))},h=()=>new Promise(m=>{r=v=>{(s()||l())&&m(v)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),y=()=>{if(s())return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{if(s())return;const w=e.retry??(_n?0:3),_=e.retryDelay??jg,S=typeof _=="function"?_(n,b):_,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,b);if(t||!C){p(b);return}n++,e.onFail?.(n,b),Pg(S).then(()=>l()?void 0:h()).then(()=>{t?p(b):y()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r?.(),o),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?y():h().then(y),o)}}var Bu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xa(this.gcTime)&&(this.#e=mn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_n?1/0:300*1e3))}clearGcTimeout(){this.#e&&(mn.clearTimeout(this.#e),this.#e=void 0)}},Fg=class extends Bu{#e;#t;#n;#o;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Bc(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Bc(this.options);t.data!==void 0&&(this.setState(Fc(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=_a(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(st).catch(st):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Et(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mi||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>sn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ku(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const a=Lu(this.options,t),l=(()=>{const f={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#i=!1,this.options.persister?this.options.persister(a,l,this):a(l)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Fu({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Ca&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#s({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ca){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#s({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...$u(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Fc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ve.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function $u(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ju(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Fc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hu=class extends Jn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=Sa(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#a;#i;#s;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),$c(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ra(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ra(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Et(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!Bo(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Hc(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Et(this.options.enabled,this.#t)!==Et(t.enabled,this.#t)||sn(this.options.staleTime,this.#t)!==sn(t.staleTime,this.#t))&&this.#g();const o=this.#v();r&&(this.#t!==n||Et(this.options.enabled,this.#t)!==Et(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return $g(this,n)&&(this.#o=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(st)),t}#g(){this.#w();const e=sn(this.options.staleTime,this.#t);if(_n||this.#o.isStale||!xa(e))return;const n=ku(this.#o.dataUpdatedAt,e)+1;this.#l=mn.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#c=e,!(_n||Et(this.options.enabled,this.#t)===!1||!xa(this.#c)||this.#c===0)&&(this.#u=mn.setInterval(()=>{(this.options.refetchIntervalInBackground||vi.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#w(){this.#l&&(mn.clearTimeout(this.#l),this.#l=void 0)}#x(){this.#u&&(mn.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#o,s=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:l}=e;let f={...l},d=!1,p;if(t._optimisticResults){const P=this.hasListeners(),N=!P&&$c(e,t),F=P&&Hc(e,n,t,r);(N||F)&&(f={...f,...$u(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:h,errorUpdatedAt:y,status:m}=f;p=f.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&m==="pending"){let P;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(P=o.data,v=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,P!==void 0&&(m="success",p=_a(o?.data,P,t),d=!0)}if(t.select&&p!==void 0&&!v)if(o&&p===s?.data&&t.select===this.#m)p=this.#f;else try{this.#m=t.select,p=t.select(p),p=_a(o?.data,p,t),this.#f=p,this.#s=null}catch(P){this.#s=P}this.#s&&(h=this.#s,p=this.#f,y=Date.now(),m="error");const b=f.fetchStatus==="fetching",w=m==="pending",_=m==="error",S=w&&b,C=p!==void 0,T={status:m,fetchStatus:f.fetchStatus,isPending:w,isSuccess:m==="success",isError:_,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:f.dataUpdatedAt,error:h,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:_&&!C,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:_&&C,isStale:yi(e,t),refetch:this.refetch,promise:this.#i,isEnabled:Et(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=T.data!==void 0,N=T.status==="error"&&!P,F=H=>{N?H.reject(T.error):P&&H.resolve(T.data)},z=()=>{const H=this.#i=T.promise=Sa();F(H)},R=this.#i;switch(R.status){case"pending":e.queryHash===n.queryHash&&F(R);break;case"fulfilled":(N||T.data!==R.value)&&z();break;case"rejected":(!N||T.error!==R.reason)&&z();break}}return T}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Bo(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#p.size)return!0;const s=new Set(o??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#o).some(i=>{const a=i;return this.#o[a]!==e[a]&&s.has(a)})};this.#_({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Ve.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Bg(e,t){return Et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $c(e,t){return Bg(e,t)||e.state.data!==void 0&&Ra(e,t,t.refetchOnMount)}function Ra(e,t,n){if(Et(t.enabled,e)!==!1&&sn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&yi(e,t)}return!1}function Hc(e,t,n,r){return(e!==t||Et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&yi(e,n)}function yi(e,t){return Et(t.enabled,e)!==!1&&e.isStaleByTime(sn(t.staleTime,e))}function $g(e,t){return!Bo(e.getCurrentResult(),t)}function zc(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let f=!1;const d=y=>{Og(y,()=>t.signal,()=>f=!0)},p=Lu(t.options,t.fetchOptions),h=async(y,m,v)=>{if(f)return Promise.reject();if(m==null&&y.pages.length)return Promise.resolve(y);const w=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:m,direction:v?"backward":"forward",meta:t.options.meta};return d(O),O})(),_=await p(w),{maxPages:S}=t.options,C=v?Ng:Mg;return{pages:C(y.pages,_,S),pageParams:C(y.pageParams,m,S)}};if(o&&s.length){const y=o==="backward",m=y?Hg:Uc,v={pages:s,pageParams:i},b=m(r,v);a=await h(v,b,y)}else{const y=e??s.length;do{const m=c===0?i[0]??r.initialPageParam:Uc(r,a);if(c>0&&m==null)break;a=await h(a,m),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Uc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Hg(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var zg=class extends Bu{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||zu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=Fu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,i)=>{this.#r({type:"failed",failureCount:s,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:o})}const s=await this.#o.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ve.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function zu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ug=class extends Jn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new zg({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=io(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=io(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=io(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=io(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ve.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Dc(t,n))}findAll(e={}){return this.getAll().filter(t=>Dc(e,t))}notify(e){Ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ve.batch(()=>Promise.all(e.map(t=>t.continue().catch(st))))}};function io(e){return e.options.scope?.id}var Vg=class extends Jn{#e;#t=void 0;#n;#o;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Bo(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Sn(n.mutationKey)!==Sn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??zu();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Ve.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(t.data,null,n,r,o)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,n,r,o)}catch(s){Promise.reject(s)}try{this.#o.onSettled?.(void 0,t.error,n,r,o)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Zg=class extends Jn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??pi(r,t);let s=this.get(o);return s||(s=new Fg({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ve.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>kc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>kc(e,n)):t}notify(e){Ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ve.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ve.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Wg=class{#e;#t;#n;#o;#r;#a;#i;#s;constructor(e={}){this.#e=e.queryCache||new Zg,this.#t=e.mutationCache||new Ug,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=vi.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=$o.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(sn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=Ag(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ve.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ve.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ve.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ve.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(st).catch(st)}invalidateQueries(e,t={}){return Ve.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ve.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(st)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(st)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(sn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(st).catch(st)}fetchInfiniteQuery(e){return e.behavior=zc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(st).catch(st)}ensureInfiniteQueryData(e){return e.behavior=zc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return $o.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(Sn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Mr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Sn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Mr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===mi&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Uu=u.createContext(void 0),er=e=>{const t=u.useContext(Uu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qg=({client:e,children:t})=>(u.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(Uu.Provider,{value:e,children:t})),Vu=u.createContext(!1),Kg=()=>u.useContext(Vu);Vu.Provider;function Zu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wu=u.createContext(Zu()),Gg=()=>u.useContext(Wu),Yg=({children:e})=>{const[t]=u.useState(()=>Zu());return g.jsx(Wu.Provider,{value:t,children:typeof e=="function"?e(t):e})},Qg=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?gi(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Xg=e=>{u.useEffect(()=>{e.clearReset()},[e])},Jg=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||gi(n,[e.error,r])),e2=(e,t)=>t.state.data===void 0,t2=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},n2=(e,t)=>e.isLoading&&e.isFetching&&!t,r2=(e,t)=>e?.suspense&&t.isPending,Vc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qu(e,t,n){const r=Kg(),o=Gg(),s=er(),i=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=s.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",t2(i),Qg(i,o,a),Xg(o);const c=!s.getQueryCache().get(i.queryHash),[l]=u.useState(()=>new t(s,i)),f=l.getOptimisticResult(i),d=!r&&e.subscribed!==!1;if(u.useSyncExternalStore(u.useCallback(p=>{const h=d?l.subscribe(Ve.batchCalls(p)):st;return l.updateResult(),h},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u.useEffect(()=>{l.setOptions(i)},[i,l]),r2(i,f))throw Vc(i,l,o);if(Jg({result:f,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,f),i.experimental_prefetchInRender&&!_n&&n2(f,r)&&(c?Vc(i,l,o):a?.promise)?.catch(st).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?f:l.trackResult(f)}function o2(e,t){return qu(e,Hu)}function Ku(e,t){return qu({...e,enabled:!0,suspense:!0,throwOnError:e2,placeholderData:void 0},Hu)}function s2(e,t){const n=er(),[r]=u.useState(()=>new Vg(n,e));u.useEffect(()=>{r.setOptions(e)},[r,e]);const o=u.useSyncExternalStore(u.useCallback(i=>r.subscribe(Ve.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=u.useCallback((i,a)=>{r.mutate(i,a).catch(st)},[r]);if(o.error&&gi(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Ws={confirmLabel:"OK",dismissible:!0},Zc={confirmLabel:"Continue",cancelLabel:"Cancel",tone:"default",dismissible:!0},a2=e=>typeof e=="string"?{title:e,...Ws}:{...Ws,...e,dismissible:e.dismissible??Ws.dismissible},i2=e=>typeof e=="string"?{title:e,...Zc}:{...Zc,...e,dismissible:e.dismissible??e.tone!=="danger"},c2=()=>{let e={current:null};const t=new Set,n=()=>{t.forEach(c=>c())},r=c=>{e=c,n()},o=()=>e,s=()=>{const c=e.current;!c||c.kind!=="alert"||(r({current:null}),c.resolver())},i=c=>{const l=e.current;!l||l.kind!=="confirm"||(r({current:null}),l.resolver(c))},a=()=>{const c=e.current;if(c){if(c.kind==="confirm"){i(!1);return}s()}};return{subscribe:c=>(t.add(c),()=>{t.delete(c)}),getSnapshot:o,alert:c=>{const l=a2(c);return a(),new Promise(f=>{r({current:{kind:"alert",options:l,resolver:f}})})},confirm:c=>{const l=i2(c);return a(),new Promise(f=>{r({current:{kind:"confirm",options:l,resolver:f}})})},resolveAlert:s,resolveConfirm:i,dismiss:a,reset:()=>{a()}}},Gu=u.createContext(null),l2=()=>{const e=u.useRef();return e.current||(e.current=c2()),e.current},u2=({children:e,components:t})=>{const n=l2(),r=u.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);u.useEffect(()=>()=>{n.reset()},[n]);const o=n,s=r.current;return g.jsxs(Gu.Provider,{value:o,children:[e,s?.kind==="alert"&&g.jsx(t.Alert,{open:!0,options:s.options,onClose:n.resolveAlert}),s?.kind==="confirm"&&g.jsx(t.Confirm,{open:!0,options:s.options,onCancel:()=>n.resolveConfirm(!1),onConfirm:()=>n.resolveConfirm(!0)})]})},d2=()=>{const e=u.useContext(Gu);if(!e)throw new Error("useModal must be used within ModalProvider");return e};function f2(e,t){const n=u.createContext(t),r=s=>{const{children:i,...a}=s,c=u.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Bt(e,t=[]){let n=[];function r(s,i){const a=u.createContext(i),c=n.length;n=[...n,i];const l=d=>{const{scope:p,children:h,...y}=d,m=p?.[e]?.[c]||a,v=u.useMemo(()=>y,Object.values(y));return g.jsx(m.Provider,{value:v,children:h})};l.displayName=s+"Provider";function f(d,p){const h=p?.[e]?.[c]||a,y=u.useContext(h);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(i=>u.createContext(i));return function(a){const c=a?.[e]||s;return u.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,h2(o,...t)]}function h2(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Wc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $r(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Wc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Wc(e[o],null)}}}}function Ee(...e){return u.useCallback($r(...e),e)}function de(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Xe=globalThis?.document?u.useLayoutEffect:()=>{},p2=ns[" useId ".trim().toString()]||(()=>{}),m2=0;function Dt(e){const[t,n]=u.useState(p2());return Xe(()=>{n(r=>r??String(m2++))},[e]),t?`radix-${t}`:""}var g2=ns[" useInsertionEffect ".trim().toString()]||Xe;function qt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=v2({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=u.useCallback(f=>{if(a){const d=y2(f)?f(e):f;d!==e&&i.current?.(d)}else s(f)},[a,e,s,i]);return[c,l]}function v2({defaultProp:e,onChange:t}){const[n,r]=u.useState(e),o=u.useRef(n),s=u.useRef(t);return g2(()=>{s.current=t},[t]),u.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function y2(e){return typeof e=="function"}function Gn(e){const t=b2(e),n=u.forwardRef((r,o)=>{const{children:s,...i}=r,a=u.Children.toArray(s),c=a.find(w2);if(c){const l=c.props.children,f=a.map(d=>d===c?u.Children.count(l)>1?u.Children.only(null):u.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:o,children:u.isValidElement(l)?u.cloneElement(l,void 0,f):null})}return g.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function b2(e){const t=u.forwardRef((n,r)=>{const{children:o,...s}=n;if(u.isValidElement(o)){const i=E2(o),a=x2(s,o.props);return o.type!==u.Fragment&&(a.ref=r?$r(r,i):i),u.cloneElement(o,a)}return u.Children.count(o)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yu=Symbol("radix.slottable");function Qu(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Yu,t}function w2(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yu}function x2(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function E2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],be=_2.reduce((e,t)=>{const n=Gn(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xu(e,t){e&&Zt.flushSync(()=>e.dispatchEvent(t))}function jt(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>t.current?.(...n),[])}function S2(e,t=globalThis?.document){const n=jt(e);u.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var C2="DismissableLayer",Aa="dismissableLayer.update",R2="dismissableLayer.pointerDownOutside",A2="dismissableLayer.focusOutside",qc,Ju=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hr=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=u.useContext(Ju),[f,d]=u.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=u.useState({}),y=Ee(t,T=>d(T)),m=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),w=f?m.indexOf(f):-1,_=l.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,C=M2(T=>{const P=T.target,N=[...l.branches].some(F=>F.contains(P));!S||N||(o?.(T),i?.(T),T.defaultPrevented||a?.())},p),O=N2(T=>{const P=T.target;[...l.branches].some(F=>F.contains(P))||(s?.(T),i?.(T),T.defaultPrevented||a?.())},p);return S2(T=>{w===l.layers.size-1&&(r?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},p),u.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(qc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Kc(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=qc)}},[f,p,n,l]),u.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Kc())},[f,l]),u.useEffect(()=>{const T=()=>h({});return document.addEventListener(Aa,T),()=>document.removeEventListener(Aa,T)},[]),g.jsx(be.div,{...c,ref:y,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:de(e.onFocusCapture,O.onFocusCapture),onBlurCapture:de(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:de(e.onPointerDownCapture,C.onPointerDownCapture)})});Hr.displayName=C2;var T2="DismissableLayerBranch",P2=u.forwardRef((e,t)=>{const n=u.useContext(Ju),r=u.useRef(null),o=Ee(t,r);return u.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(be.div,{...e,ref:o})});P2.displayName=T2;function M2(e,t=globalThis?.document){const n=jt(e),r=u.useRef(!1),o=u.useRef(()=>{});return u.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){ed(R2,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function N2(e,t=globalThis?.document){const n=jt(e),r=u.useRef(!1);return u.useEffect(()=>{const o=s=>{s.target&&!r.current&&ed(A2,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kc(){const e=new CustomEvent(Aa);document.dispatchEvent(e)}function ed(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Xu(o,s):o.dispatchEvent(s)}var qs="focusScope.autoFocusOnMount",Ks="focusScope.autoFocusOnUnmount",Gc={bubbles:!1,cancelable:!0},O2="FocusScope",fs=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=u.useState(null),l=jt(o),f=jt(s),d=u.useRef(null),p=Ee(t,m=>c(m)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let m=function(_){if(h.paused||!a)return;const S=_.target;a.contains(S)?d.current=S:Xt(d.current,{select:!0})},v=function(_){if(h.paused||!a)return;const S=_.relatedTarget;S!==null&&(a.contains(S)||Xt(d.current,{select:!0}))},b=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&Xt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const w=new MutationObserver(b);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),u.useEffect(()=>{if(a){Qc.add(h);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(qs,Gc);a.addEventListener(qs,l),a.dispatchEvent(b),b.defaultPrevented||(I2(F2(td(a)),{select:!0}),document.activeElement===m&&Xt(a))}return()=>{a.removeEventListener(qs,l),setTimeout(()=>{const b=new CustomEvent(Ks,Gc);a.addEventListener(Ks,f),a.dispatchEvent(b),b.defaultPrevented||Xt(m??document.body,{select:!0}),a.removeEventListener(Ks,f),Qc.remove(h)},0)}}},[a,l,f,h]);const y=u.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const w=m.currentTarget,[_,S]=k2(w);_&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&Xt(_,{select:!0})):m.shiftKey&&b===_&&(m.preventDefault(),n&&Xt(S,{select:!0})):b===w&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(be.div,{tabIndex:-1,...i,ref:p,onKeyDown:y})});fs.displayName=O2;function I2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xt(r,{select:t}),document.activeElement!==n)return}function k2(e){const t=td(e),n=Yc(t,e),r=Yc(t.reverse(),e);return[n,r]}function td(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yc(e,t){for(const n of e)if(!D2(n,{upTo:t}))return n}function D2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function L2(e){return e instanceof HTMLInputElement&&"select"in e}function Xt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&L2(e)&&t&&e.select()}}var Qc=j2();function j2(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Xc(e,t),e.unshift(t)},remove(t){e=Xc(e,t),e[0]?.resume()}}}function Xc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function F2(e){return e.filter(t=>t.tagName!=="A")}var B2="Portal",zr=u.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=u.useState(!1);Xe(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?lu.createPortal(g.jsx(be.div,{...r,ref:t}),i):null});zr.displayName=B2;function $2(e,t){return u.useReducer((n,r)=>t[n][r]??n,e)}var $t=e=>{const{present:t,children:n}=e,r=H2(t),o=typeof n=="function"?n({present:r.isPresent}):u.Children.only(n),s=Ee(r.ref,z2(o));return typeof n=="function"||r.isPresent?u.cloneElement(o,{ref:s}):null};$t.displayName="Presence";function H2(e){const[t,n]=u.useState(),r=u.useRef(null),o=u.useRef(e),s=u.useRef("none"),i=e?"mounted":"unmounted",[a,c]=$2(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const l=co(r.current);s.current=a==="mounted"?l:"none"},[a]),Xe(()=>{const l=r.current,f=o.current;if(f!==e){const p=s.current,h=co(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Xe(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=h=>{const m=co(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(s.current=co(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:u.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function co(e){return e?.animationName||"none"}function z2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gs=0;function bi(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jc()),document.body.insertAdjacentElement("beforeend",e[1]??Jc()),Gs++,()=>{Gs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gs--}},[])}function Jc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var U2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dn=new WeakMap,lo=new WeakMap,uo={},Ys=0,nd=function(e){return e&&(e.host||nd(e.parentNode))},V2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=nd(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Z2=function(e,t,n,r){var o=V2(t,Array.isArray(e)?e:[e]);uo[n]||(uo[n]=new WeakMap);var s=uo[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))f(p);else try{var h=p.getAttribute(r),y=h!==null&&h!=="false",m=(Dn.get(p)||0)+1,v=(s.get(p)||0)+1;Dn.set(p,m),s.set(p,v),i.push(p),m===1&&y&&lo.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return f(t),a.clear(),Ys++,function(){i.forEach(function(d){var p=Dn.get(d)-1,h=s.get(d)-1;Dn.set(d,p),s.set(d,h),p||(lo.has(d)||d.removeAttribute(r),lo.delete(d)),h||d.removeAttribute(n)}),Ys--,Ys||(Dn=new WeakMap,Dn=new WeakMap,lo=new WeakMap,uo={})}},wi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=U2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Z2(r,o,n,"aria-hidden")):function(){return null}},hs="Dialog",[rd,od]=Bt(hs),[W2,Mt]=rd(hs),sd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=u.useRef(null),c=u.useRef(null),[l,f]=qt({prop:r,defaultProp:o??!1,onChange:s,caller:hs});return g.jsx(W2,{scope:t,triggerRef:a,contentRef:c,contentId:Dt(),titleId:Dt(),descriptionId:Dt(),open:l,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(d=>!d),[f]),modal:i,children:n})};sd.displayName=hs;var ad="DialogTrigger",id=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(ad,n),s=Ee(t,o.triggerRef);return g.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":_i(o.open),...r,ref:s,onClick:de(e.onClick,o.onOpenToggle)})});id.displayName=ad;var xi="DialogPortal",[q2,cd]=rd(xi,{forceMount:void 0}),ld=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Mt(xi,t);return g.jsx(q2,{scope:t,forceMount:n,children:u.Children.map(r,i=>g.jsx($t,{present:n||s.open,children:g.jsx(zr,{asChild:!0,container:o,children:i})}))})};ld.displayName=xi;var Ho="DialogOverlay",ud=u.forwardRef((e,t)=>{const n=cd(Ho,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Mt(Ho,e.__scopeDialog);return s.modal?g.jsx($t,{present:r||s.open,children:g.jsx(G2,{...o,ref:t})}):null});ud.displayName=Ho;var K2=Gn("DialogOverlay.RemoveScroll"),G2=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(Ho,n);return g.jsx(ri,{as:K2,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx(be.div,{"data-state":_i(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Cn="DialogContent",dd=u.forwardRef((e,t)=>{const n=cd(Cn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Mt(Cn,e.__scopeDialog);return g.jsx($t,{present:r||s.open,children:s.modal?g.jsx(Y2,{...o,ref:t}):g.jsx(Q2,{...o,ref:t})})});dd.displayName=Cn;var Y2=u.forwardRef((e,t)=>{const n=Mt(Cn,e.__scopeDialog),r=u.useRef(null),o=Ee(t,n.contentRef,r);return u.useEffect(()=>{const s=r.current;if(s)return wi(s)},[]),g.jsx(fd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:de(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:de(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:de(e.onFocusOutside,s=>s.preventDefault())})}),Q2=u.forwardRef((e,t)=>{const n=Mt(Cn,e.__scopeDialog),r=u.useRef(!1),o=u.useRef(!1);return g.jsx(fd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),fd=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Mt(Cn,n),c=u.useRef(null),l=Ee(t,c);return bi(),g.jsxs(g.Fragment,{children:[g.jsx(fs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:g.jsx(Hr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":_i(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(J2,{titleId:a.titleId}),g.jsx(tv,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Ei="DialogTitle",hd=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(Ei,n);return g.jsx(be.h2,{id:o.titleId,...r,ref:t})});hd.displayName=Ei;var pd="DialogDescription",md=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(pd,n);return g.jsx(be.p,{id:o.descriptionId,...r,ref:t})});md.displayName=pd;var gd="DialogClose",vd=u.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mt(gd,n);return g.jsx(be.button,{type:"button",...r,ref:t,onClick:de(e.onClick,()=>o.onOpenChange(!1))})});vd.displayName=gd;function _i(e){return e?"open":"closed"}var yd="DialogTitleWarning",[X2,bd]=f2(yd,{contentName:Cn,titleName:Ei,docsSlug:"dialog"}),J2=({titleId:e})=>{const t=bd(yd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
3
3
|
|
|
4
4
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
24
24
|
border border-transparent
|
|
25
25
|
rounded-[10px]
|
|
26
26
|
transition-all duration-200
|
|
27
|
-
`,c=e?"cursor-default bg-cta border-cta text-fg-on-filled":t?"cursor-default text-fg-disabled border-transparent":"cursor-pointer text-fg-default hover:bg-hover hover:border-border-subtle",l=n?"relative [&>svg]:absolute [&>svg:first-child]:-translate-x-[3px] [&>svg:last-child]:translate-x-[3px]":"";return g.jsx("button",{ref:i,type:"button",disabled:t,className:`${a} ${c} ${l} ${o}`,...s,children:r})});Hn.displayName="PaginationItem";const Ew=Ke(["h-full","transition-all","duration-300","ease-out"],{variants:{color:{primary:"bg-pastel-blue-200",success:"bg-pastel-green-200",danger:"bg-pastel-pink-200",warning:"bg-pastel-orange-200"}},defaultVariants:{color:"primary"}}),_w=u.forwardRef(({value:e,max:t,color:n,className:r="",...o},s)=>{const i=Math.min(100,Math.max(0,e/t*100));return g.jsx("div",{ref:s,className:xe("w-full h-3","bg-surface","border-2 border-border","rounded-[6px]","overflow-hidden",r),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,...o,children:g.jsx("div",{className:`progress-fill ${Ew({color:n})}`,style:{"--progress-width":`${i}%`}})})});_w.displayName="Progress";function Cl(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sw(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var x0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Cw="VisuallyHidden",E0=u.forwardRef((e,t)=>g.jsx(be.span,{...e,ref:t,style:{...x0,...e.style}}));E0.displayName=Cw;var Rw=E0,Aw=[" ","Enter","ArrowUp","ArrowDown"],Tw=[" ","Enter"],An="Select",[Cs,Rs,Pw]=Fi(An),[rr]=Bt(An,[Pw,nr]),As=nr(),[Mw,ln]=rr(An),[Nw,Ow]=rr(An),_0=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:d,disabled:p,required:h,form:y}=e,m=As(t),[v,b]=u.useState(null),[w,_]=u.useState(null),[S,C]=u.useState(!1),O=ws(l),[T,P]=qt({prop:r,defaultProp:o??!1,onChange:s,caller:An}),[N,F]=qt({prop:i,defaultProp:a,onChange:c,caller:An}),z=u.useRef(null),R=v?y||!!v.closest("form"):!0,[H,x]=u.useState(new Set),I=Array.from(H).map($=>$.props.value).join(";");return g.jsx(Hi,{...m,children:g.jsxs(Mw,{required:h,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Dt(),value:N,onValueChange:F,open:T,onOpenChange:P,dir:O,triggerPointerDownPosRef:z,disabled:p,children:[g.jsx(Cs.Provider,{scope:t,children:g.jsx(Nw,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback($=>{x(D=>new Set(D).add($))},[]),onNativeOptionRemove:u.useCallback($=>{x(D=>{const q=new Set(D);return q.delete($),q})},[]),children:n})}),R?g.jsxs(z0,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:N,onChange:$=>F($.target.value),disabled:p,form:y,children:[N===void 0?g.jsx("option",{value:""}):null,Array.from(H)]},I):null]})})};_0.displayName=An;var S0="SelectTrigger",C0=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=As(n),i=ln(S0,n),a=i.disabled||r,c=Ee(t,i.onTriggerChange),l=Rs(n),f=u.useRef("touch"),[d,p,h]=V0(m=>{const v=l().filter(_=>!_.disabled),b=v.find(_=>_.value===i.value),w=Z0(v,m,b);w!==void 0&&i.onValueChange(w.value)}),y=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(zi,{asChild:!0,...s,children:g.jsx(be.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":U0(i.value)?"":void 0,...o,ref:c,onClick:de(o.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&y(m)}),onPointerDown:de(o.onPointerDown,m=>{f.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:de(o.onKeyDown,m=>{const v=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(v&&m.key===" ")&&Aw.includes(m.key)&&(y(),m.preventDefault())})})})});C0.displayName=S0;var R0="SelectValue",A0=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=ln(R0,n),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,d=Ee(t,c.onValueNodeChange);return Xe(()=>{l(f)},[l,f]),g.jsx(be.span,{...a,ref:d,style:{pointerEvents:"none"},children:U0(c.value)?g.jsx(g.Fragment,{children:i}):s})});A0.displayName=R0;var Iw="SelectIcon",T0=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx(be.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});T0.displayName=Iw;var kw="SelectPortal",P0=e=>g.jsx(zr,{asChild:!0,...e});P0.displayName=kw;var Tn="SelectContent",M0=u.forwardRef((e,t)=>{const n=ln(Tn,e.__scopeSelect),[r,o]=u.useState();if(Xe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Zt.createPortal(g.jsx(N0,{scope:e.__scopeSelect,children:g.jsx(Cs.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),s):null}return g.jsx(O0,{...e,ref:t})});M0.displayName=Tn;var Rt=10,[N0,un]=rr(Tn),Dw="SelectContentImpl",Lw=Gn("SelectContent.RemoveScroll"),O0=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:v,...b}=e,w=ln(Tn,n),[_,S]=u.useState(null),[C,O]=u.useState(null),T=Ee(t,te=>S(te)),[P,N]=u.useState(null),[F,z]=u.useState(null),R=Rs(n),[H,x]=u.useState(!1),I=u.useRef(!1);u.useEffect(()=>{if(_)return wi(_)},[_]),bi();const $=u.useCallback(te=>{const[Q,...ie]=R().map(fe=>fe.ref.current),[re]=ie.slice(-1),ce=document.activeElement;for(const fe of te)if(fe===ce||(fe?.scrollIntoView({block:"nearest"}),fe===Q&&C&&(C.scrollTop=0),fe===re&&C&&(C.scrollTop=C.scrollHeight),fe?.focus(),document.activeElement!==ce))return},[R,C]),D=u.useCallback(()=>$([P,_]),[$,P,_]);u.useEffect(()=>{H&&D()},[H,D]);const{onOpenChange:q,triggerPointerDownPosRef:k}=w;u.useEffect(()=>{if(_){let te={x:0,y:0};const Q=re=>{te={x:Math.abs(Math.round(re.pageX)-(k.current?.x??0)),y:Math.abs(Math.round(re.pageY)-(k.current?.y??0))}},ie=re=>{te.x<=10&&te.y<=10?re.preventDefault():_.contains(re.target)||q(!1),document.removeEventListener("pointermove",Q),k.current=null};return k.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",ie,{capture:!0})}}},[_,q,k]),u.useEffect(()=>{const te=()=>q(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[q]);const[Y,L]=V0(te=>{const Q=R().filter(ce=>!ce.disabled),ie=Q.find(ce=>ce.ref.current===document.activeElement),re=Z0(Q,te,ie);re&&setTimeout(()=>re.ref.current.focus())}),j=u.useCallback((te,Q,ie)=>{const re=!I.current&&!ie;(w.value!==void 0&&w.value===Q||re)&&(N(te),re&&(I.current=!0))},[w.value]),K=u.useCallback(()=>_?.focus(),[_]),G=u.useCallback((te,Q,ie)=>{const re=!I.current&&!ie;(w.value!==void 0&&w.value===Q||re)&&z(te)},[w.value]),Z=r==="popper"?Ba:I0,le=Z===Ba?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:v}:{};return g.jsx(N0,{scope:n,content:_,viewport:C,onViewportChange:O,itemRefCallback:j,selectedItem:P,onItemLeave:K,itemTextRefCallback:G,focusSelectedItem:D,selectedItemText:F,position:r,isPositioned:H,searchRef:Y,children:g.jsx(ri,{as:Lw,allowPinchZoom:!0,children:g.jsx(fs,{asChild:!0,trapped:w.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:de(o,te=>{w.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:g.jsx(Hr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:g.jsx(Z,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:te=>te.preventDefault(),...b,...le,onPlaced:()=>x(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:de(b.onKeyDown,te=>{const Q=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!Q&&te.key.length===1&&L(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let re=R().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(te.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const ce=te.target,fe=re.indexOf(ce);re=re.slice(fe+1)}setTimeout(()=>$(re)),te.preventDefault()}})})})})})})});O0.displayName=Dw;var jw="SelectItemAlignedPosition",I0=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ln(Tn,n),i=un(Tn,n),[a,c]=u.useState(null),[l,f]=u.useState(null),d=Ee(t,T=>f(T)),p=Rs(n),h=u.useRef(!1),y=u.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=i,_=u.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&v&&b){const T=s.trigger.getBoundingClientRect(),P=l.getBoundingClientRect(),N=s.valueNode.getBoundingClientRect(),F=b.getBoundingClientRect();if(s.dir!=="rtl"){const ce=F.left-P.left,fe=N.left-ce,ve=T.left-fe,E=T.width+ve,J=Math.max(E,P.width),W=window.innerWidth-Rt,M=Cl(fe,[Rt,Math.max(Rt,W-J)]);a.style.minWidth=E+"px",a.style.left=M+"px"}else{const ce=P.right-F.right,fe=window.innerWidth-N.right-ce,ve=window.innerWidth-T.right-fe,E=T.width+ve,J=Math.max(E,P.width),W=window.innerWidth-Rt,M=Cl(fe,[Rt,Math.max(Rt,W-J)]);a.style.minWidth=E+"px",a.style.right=M+"px"}const z=p(),R=window.innerHeight-Rt*2,H=m.scrollHeight,x=window.getComputedStyle(l),I=parseInt(x.borderTopWidth,10),$=parseInt(x.paddingTop,10),D=parseInt(x.borderBottomWidth,10),q=parseInt(x.paddingBottom,10),k=I+$+H+q+D,Y=Math.min(v.offsetHeight*5,k),L=window.getComputedStyle(m),j=parseInt(L.paddingTop,10),K=parseInt(L.paddingBottom,10),G=T.top+T.height/2-Rt,Z=R-G,le=v.offsetHeight/2,te=v.offsetTop+le,Q=I+$+te,ie=k-Q;if(Q<=G){const ce=z.length>0&&v===z[z.length-1].ref.current;a.style.bottom="0px";const fe=l.clientHeight-m.offsetTop-m.offsetHeight,ve=Math.max(Z,le+(ce?K:0)+fe+D),E=Q+ve;a.style.height=E+"px"}else{const ce=z.length>0&&v===z[0].ref.current;a.style.top="0px";const ve=Math.max(G,I+m.offsetTop+(ce?j:0)+le)+ie;a.style.height=ve+"px",m.scrollTop=Q-G+m.offsetTop}a.style.margin=`${Rt}px 0`,a.style.minHeight=Y+"px",a.style.maxHeight=R+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,a,l,m,v,b,s.dir,r]);Xe(()=>_(),[_]);const[S,C]=u.useState();Xe(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);const O=u.useCallback(T=>{T&&y.current===!0&&(_(),w?.(),y.current=!1)},[_,w]);return g.jsx(Bw,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:O,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:g.jsx(be.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});I0.displayName=jw;var Fw="SelectPopperPosition",Ba=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Rt,...s}=e,i=As(n);return g.jsx(Ui,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ba.displayName=Fw;var[Bw,Xi]=rr(Tn,{}),$a="SelectViewport",k0=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=un($a,n),i=Xi($a,n),a=Ee(t,s.onViewportChange),c=u.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(Cs.Slot,{scope:n,children:g.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:de(o.onScroll,l=>{const f=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=i;if(p?.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const y=window.innerHeight-Rt*2,m=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),b=Math.max(m,v);if(b<y){const w=b+h,_=Math.min(y,w),S=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});k0.displayName=$a;var D0="SelectGroup",[$w,Hw]=rr(D0),zw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Dt();return g.jsx($w,{scope:n,id:o,children:g.jsx(be.div,{role:"group","aria-labelledby":o,...r,ref:t})})});zw.displayName=D0;var L0="SelectLabel",Uw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hw(L0,n);return g.jsx(be.div,{id:o.id,...r,ref:t})});Uw.displayName=L0;var qo="SelectItem",[Vw,j0]=rr(qo),F0=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=ln(qo,n),c=un(qo,n),l=a.value===r,[f,d]=u.useState(s??""),[p,h]=u.useState(!1),y=Ee(t,w=>c.itemRefCallback?.(w,r,o)),m=Dt(),v=u.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Vw,{scope:n,value:r,disabled:o,textId:m,isSelected:l,onItemTextChange:u.useCallback(w=>{d(_=>_||(w?.textContent??"").trim())},[]),children:g.jsx(Cs.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:g.jsx(be.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:y,onFocus:de(i.onFocus,()=>h(!0)),onBlur:de(i.onBlur,()=>h(!1)),onClick:de(i.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:de(i.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:de(i.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:de(i.onPointerMove,w=>{v.current=w.pointerType,o?c.onItemLeave?.():v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:de(i.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:de(i.onKeyDown,w=>{c.searchRef?.current!==""&&w.key===" "||(Tw.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});F0.displayName=qo;var wr="SelectItemText",B0=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ln(wr,n),a=un(wr,n),c=j0(wr,n),l=Ow(wr,n),[f,d]=u.useState(null),p=Ee(t,b=>d(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=f?.textContent,y=u.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=l;return Xe(()=>(m(y),()=>v(y)),[m,v,y]),g.jsxs(g.Fragment,{children:[g.jsx(be.span,{id:c.textId,...s,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Zt.createPortal(s.children,i.valueNode):null]})});B0.displayName=wr;var $0="SelectItemIndicator",Zw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return j0($0,n).isSelected?g.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});Zw.displayName=$0;var Ha="SelectScrollUpButton",Ww=u.forwardRef((e,t)=>{const n=un(Ha,e.__scopeSelect),r=Xi(Ha,e.__scopeSelect),[o,s]=u.useState(!1),i=Ee(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(H0,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Ww.displayName=Ha;var za="SelectScrollDownButton",qw=u.forwardRef((e,t)=>{const n=un(za,e.__scopeSelect),r=Xi(za,e.__scopeSelect),[o,s]=u.useState(!1),i=Ee(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<l;s(f)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(H0,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});qw.displayName=za;var H0=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=un("SelectScrollButton",n),i=u.useRef(null),a=Rs(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Xe(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),g.jsx(be.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:de(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:de(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:de(o.onPointerLeave,()=>{c()})})}),Kw="SelectSeparator",Gw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});Gw.displayName=Kw;var Ua="SelectArrow",Yw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=As(n),s=ln(Ua,n),i=un(Ua,n);return s.open&&i.position==="popper"?g.jsx(Vi,{...o,...r,ref:t}):null});Yw.displayName=Ua;var Qw="SelectBubbleInput",z0=u.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=u.useRef(null),s=Ee(r,o),i=Sw(t);return u.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const d=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(d)}},[i,t]),g.jsx(be.select,{...n,style:{...x0,...n.style},ref:s,defaultValue:t})});z0.displayName=Qw;function U0(e){return e===""||e===void 0}function V0(e){const t=jt(e),n=u.useRef(""),r=u.useRef(0),o=u.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=u.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Z0(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Xw(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Xw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jw=_0,ex=C0,tx=A0,nx=T0,rx=P0,ox=M0,sx=k0,ax=F0,ix=B0,cx=Jw,lx=tx,ux=ex,dx=nx,fx=rx,hx=ox,px=sx,mx=ax,gx=ix;const vx=Ke(["inline-flex","items-center","justify-between","gap-2","border","border-border-subtle","bg-elevated","text-fg-default","font-medium","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","cursor-pointer","whitespace-nowrap"],{variants:{variant:{default:["border-border-subtle"],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),Ao=({id:e,value:t,defaultValue:n,onValueChange:r,placeholder:o,ariaLabel:s,"aria-labelledby":i,"aria-describedby":a,variant:c,size:l,className:f,children:d,disabled:p})=>g.jsxs(cx,{value:t,defaultValue:n,onValueChange:r,disabled:p,children:[g.jsxs(ux,{id:e,"aria-label":s,"aria-labelledby":i,"aria-describedby":a,className:vx({variant:c,size:l,className:f}),children:[g.jsx(lx,{className:"min-w-0 truncate",placeholder:o}),g.jsx(dx,{children:g.jsx(ny,{className:"w-3.5 h-3.5 opacity-60"})})]}),g.jsx(fx,{children:g.jsx(W0,{children:g.jsx(px,{className:"p-1",children:d})})})]}),W0=u.forwardRef(({className:e,children:t,...n},r)=>g.jsx(hx,{ref:r,position:"popper",sideOffset:4,className:xe("z-[1100]","min-w-[var(--radix-select-trigger-width)]","overflow-hidden","surface-floating","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n,children:t}));W0.displayName="SelectContent";const zn=u.forwardRef(({className:e,children:t,...n},r)=>g.jsx(mx,{ref:r,className:xe("relative","flex","items-center","cursor-pointer","select-none","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","data-[highlighted]:bg-hover-subtle","data-[highlighted]:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:g.jsx(gx,{children:t})}));zn.displayName="SelectItem";Ao.displayName="Select";const Rl=e=>typeof e=="number"?`${e}px`:e,Lt=u.forwardRef(({width:e,height:t=30,opacity:n,className:r="",style:o,...s},i)=>g.jsx("div",{ref:i,className:xe("rounded-[14px]","skeleton-sized","bg-[length:200%_100%]","bg-gradient-to-r","from-pastel-lavender-200/30","via-pastel-yellow-200/20","to-pastel-lavender-200/30","animate-shimmer","animate-fade-in",r),style:{"--skeleton-width":Rl(e),"--skeleton-height":Rl(t),"--skeleton-opacity":n,...o},...s}));Lt.displayName="Skeleton";const yx=u.forwardRef(({checked:e,onCheckedChange:t,onClick:n,className:r,disabled:o,...s},i)=>g.jsx("button",{ref:i,type:"button",role:"switch","aria-checked":e,disabled:o,className:xe("focus-ring-soft relative inline-flex h-7 w-12 items-center rounded-full border p-1 transition-colors duration-200 outline-none",e?"border-transparent bg-cta hover:bg-cta-hover active:bg-cta-hover":"border-border bg-subtle hover:bg-hover active:bg-active",o&&"cursor-not-allowed opacity-80",r),onClick:a=>{n?.(a),!(a.defaultPrevented||o)&&t?.(!e)},...s,children:g.jsx("span",{"aria-hidden":"true",className:xe("pointer-events-none inline-block h-5 w-5 rounded-full shadow-sm transition-transform duration-200",e?"translate-x-5 bg-white":"translate-x-0 bg-fg-secondary")})}));yx.displayName="Switch";const bx=Ke(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","resize-none"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"min-h-[60px] p-3 text-sm rounded-[12px]",md:"min-h-[80px] p-3 text-sm rounded-[14px]",lg:"min-h-[100px] p-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),wx=u.forwardRef(({className:e,variant:t,size:n,...r},o)=>g.jsx("textarea",{ref:o,className:bx({variant:t,size:n,className:e}),...r}));wx.displayName="Textarea";var q0="Toggle",K0=u.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=qt({prop:n,onChange:o,defaultProp:r??!1,caller:q0});return g.jsx(be.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:de(e.onClick,()=>{e.disabled||a(!i)})})});K0.displayName=q0;var dn="ToggleGroup",[G0]=Bt(dn,[xs]),Y0=xs(),Ji=X.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(xx,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(Ex,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${dn}\``)});Ji.displayName=dn;var[Q0,X0]=G0(dn),xx=X.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=qt({prop:n,defaultProp:r??"",onChange:o,caller:dn});return g.jsx(Q0,{scope:e.__scopeToggleGroup,type:"single",value:X.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:X.useCallback(()=>a(""),[a]),children:g.jsx(J0,{...s,ref:t})})}),Ex=X.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=qt({prop:n,defaultProp:r??[],onChange:o,caller:dn}),c=X.useCallback(f=>a((d=[])=>[...d,f]),[a]),l=X.useCallback(f=>a((d=[])=>d.filter(p=>p!==f)),[a]);return g.jsx(Q0,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:l,children:g.jsx(J0,{...s,ref:t})})});Ji.displayName=dn;var[_x,Sx]=G0(dn),J0=X.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,l=Y0(n),f=ws(i),d={role:"group",dir:f,...c};return g.jsx(_x,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(wh,{asChild:!0,...l,orientation:s,dir:f,loop:a,children:g.jsx(be.div,{...d,ref:t})}):g.jsx(be.div,{...d,ref:t})})}),Ko="ToggleGroupItem",ep=X.forwardRef((e,t)=>{const n=X0(Ko,e.__scopeToggleGroup),r=Sx(Ko,e.__scopeToggleGroup),o=Y0(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,a={...e,pressed:s,disabled:i},c=X.useRef(null);return r.rovingFocus?g.jsx(xh,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:g.jsx(Al,{...a,ref:t})}):g.jsx(Al,{...a,ref:t})});ep.displayName=Ko;var Al=X.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=X0(Ko,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return g.jsx(K0,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),Cx=Ji,Rx=ep,Ax=Cx,Tx=Rx;const Px=Ke(["inline-flex","gap-0.5","overflow-hidden"],{variants:{variant:{default:["border-2","border-border","rounded-[10px]","bg-surface"],outline:["border-2","border-border","rounded-[10px]","bg-transparent"],pills:["surface-base","p-1"],quiet:["rounded-[12px]","border","border-border-subtle/80","bg-hover-subtle/55","p-0.5"]}},defaultVariants:{variant:"default"}}),Mx=Ke(["flex","items-center","justify-center","font-bold","border","border-transparent","transition-colors","duration-200","disabled:pointer-events-none","disabled:opacity-50"],{variants:{variant:{default:["text-fg-muted","hover:bg-hover","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],outline:["text-fg-muted","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],pills:["text-fg-secondary","rounded-[10px]","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled","data-[state=on]:border-border-secondary"],quiet:["rounded-[10px]","font-medium","text-fg-secondary","hover:bg-hover-subtle/80","data-[state=on]:border-border-secondary/70","data-[state=on]:bg-elevated","data-[state=on]:text-fg-default","data-[state=on]:shadow-[0_8px_18px_-16px_rgba(15,18,24,0.28)]"]},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),tp=u.createContext({}),Nx=u.forwardRef(({className:e,variant:t,size:n,children:r,...o},s)=>g.jsx(tp.Provider,{value:{variant:t??"default",size:n??"md"},children:g.jsx(Ax,{ref:s,className:Px({variant:t,className:e}),...o,children:r})}));Nx.displayName="ToggleGroup";const Ox=u.forwardRef(({className:e,activeClassName:t,children:n,...r},o)=>{const s=u.useContext(tp);return g.jsx(Tx,{ref:o,className:Mx({variant:s.variant,size:s.size,className:xe(e,t)}),...r,children:n})});Ox.displayName="ToggleGroupItem";var[Ts]=Bt("Tooltip",[nr]),Ps=nr(),np="TooltipProvider",Ix=700,Va="tooltip.open",[kx,ec]=Ts(np),rp=e=>{const{__scopeTooltip:t,delayDuration:n=Ix,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=u.useRef(!0),a=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),g.jsx(kx,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:u.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};rp.displayName=np;var Ir="Tooltip",[Dx,Xr]=Ts(Ir),op=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ec(Ir,e.__scopeTooltip),l=Ps(t),[f,d]=u.useState(null),p=Dt(),h=u.useRef(0),y=i??c.disableHoverableContent,m=a??c.delayDuration,v=u.useRef(!1),[b,w]=qt({prop:r,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(Va))):c.onClose(),s?.(T)},caller:Ir}),_=u.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),S=u.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,w(!0)},[w]),C=u.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),O=u.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0),h.current=0},m)},[m,w]);return u.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),g.jsx(Hi,{...l,children:g.jsx(Dx,{scope:t,contentId:p,open:b,stateAttribute:_,trigger:f,onTriggerChange:d,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?O():S()},[c.isOpenDelayedRef,O,S]),onTriggerLeave:u.useCallback(()=>{y?C():(window.clearTimeout(h.current),h.current=0)},[C,y]),onOpen:S,onClose:C,disableHoverableContent:y,children:n})})};op.displayName=Ir;var Za="TooltipTrigger",sp=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Xr(Za,n),s=ec(Za,n),i=Ps(n),a=u.useRef(null),c=Ee(t,a,o.onTriggerChange),l=u.useRef(!1),f=u.useRef(!1),d=u.useCallback(()=>l.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(zi,{asChild:!0,...i,children:g.jsx(be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:de(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:de(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:de(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:de(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:de(e.onBlur,o.onClose),onClick:de(e.onClick,o.onClose)})})});sp.displayName=Za;var tc="TooltipPortal",[Lx,jx]=Ts(tc,{forceMount:void 0}),ap=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Xr(tc,t);return g.jsx(Lx,{scope:t,forceMount:n,children:g.jsx($t,{present:n||s.open,children:g.jsx(zr,{asChild:!0,container:o,children:r})})})};ap.displayName=tc;var Qn="TooltipContent",ip=u.forwardRef((e,t)=>{const n=jx(Qn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Xr(Qn,e.__scopeTooltip);return g.jsx($t,{present:r||i.open,children:i.disableHoverableContent?g.jsx(cp,{side:o,...s,ref:t}):g.jsx(Fx,{side:o,...s,ref:t})})}),Fx=u.forwardRef((e,t)=>{const n=Xr(Qn,e.__scopeTooltip),r=ec(Qn,e.__scopeTooltip),o=u.useRef(null),s=Ee(t,o),[i,a]=u.useState(null),{trigger:c,onClose:l}=n,f=o.current,{onPointerInTransitChange:d}=r,p=u.useCallback(()=>{a(null),d(!1)},[d]),h=u.useCallback((y,m)=>{const v=y.currentTarget,b={x:y.clientX,y:y.clientY},w=Ux(b,v.getBoundingClientRect()),_=Vx(b,w),S=Zx(m.getBoundingClientRect()),C=qx([..._,...S]);a(C),d(!0)},[d]);return u.useEffect(()=>()=>p(),[p]),u.useEffect(()=>{if(c&&f){const y=v=>h(v,f),m=v=>h(v,c);return c.addEventListener("pointerleave",y),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",m)}}},[c,f,h,p]),u.useEffect(()=>{if(i){const y=m=>{const v=m.target,b={x:m.clientX,y:m.clientY},w=c?.contains(v)||f?.contains(v),_=!Wx(b,i);w?p():_&&(p(),l())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,f,i,l,p]),g.jsx(cp,{...e,ref:s})}),[Bx,$x]=Ts(Ir,{isInside:!1}),Hx=Qu("TooltipContent"),cp=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Xr(Qn,n),l=Ps(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Va,f),()=>document.removeEventListener(Va,f)),[f]),u.useEffect(()=>{if(c.trigger){const d=p=>{p.target?.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),g.jsx(Hr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:g.jsxs(Ui,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(Hx,{children:r}),g.jsx(Bx,{scope:n,isInside:!0,children:g.jsx(Rw,{id:c.contentId,role:"tooltip",children:o||r})})]})})});ip.displayName=Qn;var lp="TooltipArrow",zx=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ps(n);return $x(lp,n).isInside?null:g.jsx(Vi,{...o,...r,ref:t})});zx.displayName=lp;function Ux(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Vx(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Zx(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Wx(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],l=a.x,f=a.y,d=c.x,p=c.y;f>r!=p>r&&n<(d-l)*(r-f)/(p-f)+l&&(o=!o)}return o}function qx(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Kx(t)}function Kx(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Gx=rp,Yx=op,Qx=sp,Xx=ap,Jx=ip,e3=Gx,t3=Yx,n3=Qx,r3=Xx,up=Jx;const o3=e3,s3=t3,a3=n3,dp=u.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(up,{ref:r,sideOffset:t,className:xe("z-[1200]","overflow-hidden","px-3","py-1.5","text-xs","font-bold","bg-elevated","text-fg-secondary","border","border-border-subtle","shadow-sm","rounded-[8px]","animate-in","fade-in-0","zoom-in-95","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",e),...n}));dp.displayName=up.displayName;const PC=({content:e,children:t,side:n="top",delayDuration:r=200})=>g.jsx(o3,{children:g.jsxs(s3,{delayDuration:r,children:[g.jsx(a3,{asChild:!0,children:t}),g.jsx(r3,{children:g.jsx(dp,{side:n,children:e})})]})}),Tl=({children:e,fallback:t})=>e||t;function i3({children:e}){return g.jsx("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:e})}const Ms=28,nc=[Ms,50,100];function c3(e){return nc.includes(e)}function l3({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:r,sortOrder:o,onSortOrderChange:s,pinnedFirst:i,onPinnedFirstChange:a}){return g.jsx("div",{className:"flex justify-end",children:g.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(of,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),g.jsx(Re,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),g.jsx(Ao,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:c=>{const l=Number(c);c3(l)&&t(l)},variant:"ghost",size:"sm",children:nc.map(c=>g.jsx(zn,{value:String(c),children:c===Ms?`Default (${c})`:c},c))})]}),g.jsx("div",{className:"h-5 w-px bg-divider"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(fy,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),g.jsx(Re,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),g.jsxs(Ao,{value:n,ariaLabel:"Sort field",onValueChange:c=>r(c),variant:"ghost",size:"sm",children:[g.jsx(zn,{value:"updatedAt",children:"Updated"}),g.jsx(zn,{value:"createdAt",children:"Created"})]}),g.jsxs(Ao,{value:o,ariaLabel:"Sort order",onValueChange:c=>s(c),variant:"ghost",size:"sm",children:[g.jsx(zn,{value:"desc",children:"Newest"}),g.jsx(zn,{value:"asc",children:"Oldest"})]})]}),g.jsx("div",{className:"h-5 w-px bg-divider"}),g.jsxs(b0,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[g.jsx(Wf,{id:"pinnedFirst",size:"sm",checked:i,onChange:c=>a(c.target.checked)}),g.jsx(Re,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}var sa,Pl;function u3(){if(Pl)return sa;Pl=1;function e(a){return a&&typeof a=="object"&&"default"in a?a.default:a}var t=E1(),n=e(t);function r(a,c,l){return c in a?Object.defineProperty(a,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[c]=l,a}function o(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c}var s=!!(typeof window<"u"&&window.document&&window.document.createElement);function i(a,c,l){if(typeof a!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof c!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof l<"u"&&typeof l!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function f(d){return d.displayName||d.name||"Component"}return function(p){if(typeof p!="function")throw new Error("Expected WrappedComponent to be a React component.");var h=[],y;function m(){y=a(h.map(function(b){return b.props})),v.canUseDOM?c(y):l&&(y=l(y))}var v=(function(b){o(w,b);function w(){return b.apply(this,arguments)||this}w.peek=function(){return y},w.rewind=function(){if(w.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var C=y;return y=void 0,h=[],C};var _=w.prototype;return _.UNSAFE_componentWillMount=function(){h.push(this),m()},_.componentDidUpdate=function(){m()},_.componentWillUnmount=function(){var C=h.indexOf(this);h.splice(C,1),m()},_.render=function(){return n.createElement(p,this.props)},w})(t.PureComponent);return r(v,"displayName","SideEffect("+f(p)+")"),r(v,"canUseDOM",s),v}}return sa=i,sa}var d3=u3();const f3=Xn(d3);var aa,Ml;function h3(){if(Ml)return aa;Ml=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var a,c,l;if(Array.isArray(s)){if(a=s.length,a!=i.length)return!1;for(c=a;c--!==0;)if(!o(s[c],i[c]))return!1;return!0}var f;if(t&&s instanceof Map&&i instanceof Map){if(s.size!==i.size)return!1;for(f=s.entries();!(c=f.next()).done;)if(!i.has(c.value[0]))return!1;for(f=s.entries();!(c=f.next()).done;)if(!o(c.value[1],i.get(c.value[0])))return!1;return!0}if(n&&s instanceof Set&&i instanceof Set){if(s.size!==i.size)return!1;for(f=s.entries();!(c=f.next()).done;)if(!i.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(i)){if(a=s.length,a!=i.length)return!1;for(c=a;c--!==0;)if(s[c]!==i[c])return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf&&typeof s.valueOf=="function"&&typeof i.valueOf=="function")return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString&&typeof s.toString=="function"&&typeof i.toString=="function")return s.toString()===i.toString();if(l=Object.keys(s),a=l.length,a!==Object.keys(i).length)return!1;for(c=a;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,l[c]))return!1;if(e&&s instanceof Element)return!1;for(c=a;c--!==0;)if(!((l[c]==="_owner"||l[c]==="__v"||l[c]==="__o")&&s.$$typeof)&&!o(s[l[c]],i[l[c]]))return!1;return!0}return s!==s&&i!==i}return aa=function(i,a){try{return o(i,a)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},aa}var p3=h3();const m3=Xn(p3);var ia,Nl;function g3(){if(Nl)return ia;Nl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(f){l[f]=f}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ia=o()?Object.assign:function(s,i){for(var a,c=r(s),l,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var d in a)t.call(a,d)&&(c[d]=a[d]);if(e){l=e(a);for(var p=0;p<l.length;p++)n.call(a,l[p])&&(c[l[p]]=a[l[p]])}}return c},ia}var v3=g3();const y3=Xn(v3);var wn={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},ye={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(ye).map(function(e){return ye[e]});var Le={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},Go={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},kr={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},b3=Object.keys(Go).reduce(function(e,t){return e[Go[t]]=t,e},{}),w3=[ye.NOSCRIPT,ye.SCRIPT,ye.STYLE],Tt="data-react-helmet",x3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E3=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},_3=(function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S3=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Ol=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C3=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Wa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},R3=function(t){var n=Zn(t,ye.TITLE),r=Zn(t,kr.TITLE_TEMPLATE);if(r&&n)return r.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var o=Zn(t,kr.DEFAULT_TITLE);return n||o||void 0},A3=function(t){return Zn(t,kr.ON_CHANGE_CLIENT_STATE)||function(){}},ca=function(t,n){return n.filter(function(r){return typeof r[t]<"u"}).map(function(r){return r[t]}).reduce(function(r,o){return lt({},r,o)},{})},T3=function(t,n){return n.filter(function(r){return typeof r[ye.BASE]<"u"}).map(function(r){return r[ye.BASE]}).reverse().reduce(function(r,o){if(!r.length)for(var s=Object.keys(o),i=0;i<s.length;i++){var a=s[i],c=a.toLowerCase();if(t.indexOf(c)!==-1&&o[c])return r.concat(o)}return r},[])},vr=function(t,n,r){var o={};return r.filter(function(s){return Array.isArray(s[t])?!0:(typeof s[t]<"u"&&O3("Helmet: "+t+' should be of type "Array". Instead found type "'+x3(s[t])+'"'),!1)}).map(function(s){return s[t]}).reverse().reduce(function(s,i){var a={};i.filter(function(p){for(var h=void 0,y=Object.keys(p),m=0;m<y.length;m++){var v=y[m],b=v.toLowerCase();n.indexOf(b)!==-1&&!(h===Le.REL&&p[h].toLowerCase()==="canonical")&&!(b===Le.REL&&p[b].toLowerCase()==="stylesheet")&&(h=b),n.indexOf(v)!==-1&&(v===Le.INNER_HTML||v===Le.CSS_TEXT||v===Le.ITEM_PROP)&&(h=v)}if(!h||!p[h])return!1;var w=p[h].toLowerCase();return o[h]||(o[h]={}),a[h]||(a[h]={}),o[h][w]?!1:(a[h][w]=!0,!0)}).reverse().forEach(function(p){return s.push(p)});for(var c=Object.keys(a),l=0;l<c.length;l++){var f=c[l],d=y3({},o[f],a[f]);o[f]=d}return s},[]).reverse()},Zn=function(t,n){for(var r=t.length-1;r>=0;r--){var o=t[r];if(o.hasOwnProperty(n))return o[n]}return null},P3=function(t){return{baseTag:T3([Le.HREF,Le.TARGET],t),bodyAttributes:ca(wn.BODY,t),defer:Zn(t,kr.DEFER),encode:Zn(t,kr.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:ca(wn.HTML,t),linkTags:vr(ye.LINK,[Le.REL,Le.HREF],t),metaTags:vr(ye.META,[Le.NAME,Le.CHARSET,Le.HTTPEQUIV,Le.PROPERTY,Le.ITEM_PROP],t),noscriptTags:vr(ye.NOSCRIPT,[Le.INNER_HTML],t),onChangeClientState:A3(t),scriptTags:vr(ye.SCRIPT,[Le.SRC,Le.INNER_HTML],t),styleTags:vr(ye.STYLE,[Le.CSS_TEXT],t),title:R3(t),titleAttributes:ca(wn.TITLE,t)}},qa=(function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){qa(t)},0)}})(),Il=function(t){return clearTimeout(t)},M3=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||qa:global.requestAnimationFrame||qa,N3=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Il:global.cancelAnimationFrame||Il,O3=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},yr=null,I3=function(t){yr&&N3(yr),t.defer?yr=M3(function(){kl(t,function(){yr=null})}):(kl(t),yr=null)},kl=function(t,n){var r=t.baseTag,o=t.bodyAttributes,s=t.htmlAttributes,i=t.linkTags,a=t.metaTags,c=t.noscriptTags,l=t.onChangeClientState,f=t.scriptTags,d=t.styleTags,p=t.title,h=t.titleAttributes;Ka(ye.BODY,o),Ka(ye.HTML,s),k3(p,h);var y={baseTag:Fn(ye.BASE,r),linkTags:Fn(ye.LINK,i),metaTags:Fn(ye.META,a),noscriptTags:Fn(ye.NOSCRIPT,c),scriptTags:Fn(ye.SCRIPT,f),styleTags:Fn(ye.STYLE,d)},m={},v={};Object.keys(y).forEach(function(b){var w=y[b],_=w.newTags,S=w.oldTags;_.length&&(m[b]=_),S.length&&(v[b]=y[b].oldTags)}),n&&n(),l(t,m,v)},fp=function(t){return Array.isArray(t)?t.join(""):t},k3=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=fp(t)),Ka(ye.TITLE,n)},Ka=function(t,n){var r=document.getElementsByTagName(t)[0];if(r){for(var o=r.getAttribute(Tt),s=o?o.split(","):[],i=[].concat(s),a=Object.keys(n),c=0;c<a.length;c++){var l=a[c],f=n[l]||"";r.getAttribute(l)!==f&&r.setAttribute(l,f),s.indexOf(l)===-1&&s.push(l);var d=i.indexOf(l);d!==-1&&i.splice(d,1)}for(var p=i.length-1;p>=0;p--)r.removeAttribute(i[p]);s.length===i.length?r.removeAttribute(Tt):r.getAttribute(Tt)!==a.join(",")&&r.setAttribute(Tt,a.join(","))}},Fn=function(t,n){var r=document.head||document.querySelector(ye.HEAD),o=r.querySelectorAll(t+"["+Tt+"]"),s=Array.prototype.slice.call(o),i=[],a=void 0;return n&&n.length&&n.forEach(function(c){var l=document.createElement(t);for(var f in c)if(c.hasOwnProperty(f))if(f===Le.INNER_HTML)l.innerHTML=c.innerHTML;else if(f===Le.CSS_TEXT)l.styleSheet?l.styleSheet.cssText=c.cssText:l.appendChild(document.createTextNode(c.cssText));else{var d=typeof c[f]>"u"?"":c[f];l.setAttribute(f,d)}l.setAttribute(Tt,"true"),s.some(function(p,h){return a=h,l.isEqualNode(p)})?s.splice(a,1):i.push(l)}),s.forEach(function(c){return c.parentNode.removeChild(c)}),i.forEach(function(c){return r.appendChild(c)}),{oldTags:s,newTags:i}},hp=function(t){return Object.keys(t).reduce(function(n,r){var o=typeof t[r]<"u"?r+'="'+t[r]+'"':""+r;return n?n+" "+o:o},"")},D3=function(t,n,r,o){var s=hp(r),i=fp(n);return s?"<"+t+" "+Tt+'="true" '+s+">"+Wa(i,o)+"</"+t+">":"<"+t+" "+Tt+'="true">'+Wa(i,o)+"</"+t+">"},L3=function(t,n,r){return n.reduce(function(o,s){var i=Object.keys(s).filter(function(l){return!(l===Le.INNER_HTML||l===Le.CSS_TEXT)}).reduce(function(l,f){var d=typeof s[f]>"u"?f:f+'="'+Wa(s[f],r)+'"';return l?l+" "+d:d},""),a=s.innerHTML||s.cssText||"",c=w3.indexOf(t)===-1;return o+"<"+t+" "+Tt+'="true" '+i+(c?"/>":">"+a+"</"+t+">")},"")},pp=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[Go[o]||o]=t[o],r},n)},j3=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[b3[o]||o]=t[o],r},n)},F3=function(t,n,r){var o,s=(o={key:n},o[Tt]=!0,o),i=pp(r,s);return[X.createElement(ye.TITLE,i,n)]},B3=function(t,n){return n.map(function(r,o){var s,i=(s={key:o},s[Tt]=!0,s);return Object.keys(r).forEach(function(a){var c=Go[a]||a;if(c===Le.INNER_HTML||c===Le.CSS_TEXT){var l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[c]=r[a]}),X.createElement(t,i)})},zt=function(t,n,r){switch(t){case ye.TITLE:return{toComponent:function(){return F3(t,n.title,n.titleAttributes)},toString:function(){return D3(t,n.title,n.titleAttributes,r)}};case wn.BODY:case wn.HTML:return{toComponent:function(){return pp(n)},toString:function(){return hp(n)}};default:return{toComponent:function(){return B3(t,n)},toString:function(){return L3(t,n,r)}}}},mp=function(t){var n=t.baseTag,r=t.bodyAttributes,o=t.encode,s=t.htmlAttributes,i=t.linkTags,a=t.metaTags,c=t.noscriptTags,l=t.scriptTags,f=t.styleTags,d=t.title,p=d===void 0?"":d,h=t.titleAttributes;return{base:zt(ye.BASE,n,o),bodyAttributes:zt(wn.BODY,r,o),htmlAttributes:zt(wn.HTML,s,o),link:zt(ye.LINK,i,o),meta:zt(ye.META,a,o),noscript:zt(ye.NOSCRIPT,c,o),script:zt(ye.SCRIPT,l,o),style:zt(ye.STYLE,f,o),title:zt(ye.TITLE,{title:p,titleAttributes:h},o)}},$3=function(t){var n,r;return r=n=(function(o){S3(s,o);function s(){return E3(this,s),C3(this,o.apply(this,arguments))}return s.prototype.shouldComponentUpdate=function(a){return!m3(this.props,a)},s.prototype.mapNestedChildrenToProps=function(a,c){if(!c)return null;switch(a.type){case ye.SCRIPT:case ye.NOSCRIPT:return{innerHTML:c};case ye.STYLE:return{cssText:c}}throw new Error("<"+a.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},s.prototype.flattenArrayTypeChildren=function(a){var c,l=a.child,f=a.arrayTypeChildren,d=a.newChildProps,p=a.nestedChildren;return lt({},f,(c={},c[l.type]=[].concat(f[l.type]||[],[lt({},d,this.mapNestedChildrenToProps(l,p))]),c))},s.prototype.mapObjectTypeChildren=function(a){var c,l,f=a.child,d=a.newProps,p=a.newChildProps,h=a.nestedChildren;switch(f.type){case ye.TITLE:return lt({},d,(c={},c[f.type]=h,c.titleAttributes=lt({},p),c));case ye.BODY:return lt({},d,{bodyAttributes:lt({},p)});case ye.HTML:return lt({},d,{htmlAttributes:lt({},p)})}return lt({},d,(l={},l[f.type]=lt({},p),l))},s.prototype.mapArrayTypeChildrenToProps=function(a,c){var l=lt({},c);return Object.keys(a).forEach(function(f){var d;l=lt({},l,(d={},d[f]=a[f],d))}),l},s.prototype.warnOnInvalidChildren=function(a,c){return!0},s.prototype.mapChildrenToProps=function(a,c){var l=this,f={};return X.Children.forEach(a,function(d){if(!(!d||!d.props)){var p=d.props,h=p.children,y=Ol(p,["children"]),m=j3(y);switch(l.warnOnInvalidChildren(d,h),d.type){case ye.LINK:case ye.META:case ye.NOSCRIPT:case ye.SCRIPT:case ye.STYLE:f=l.flattenArrayTypeChildren({child:d,arrayTypeChildren:f,newChildProps:m,nestedChildren:h});break;default:c=l.mapObjectTypeChildren({child:d,newProps:c,newChildProps:m,nestedChildren:h});break}}}),c=this.mapArrayTypeChildrenToProps(f,c),c},s.prototype.render=function(){var a=this.props,c=a.children,l=Ol(a,["children"]),f=lt({},l);return c&&(f=this.mapChildrenToProps(c,f)),X.createElement(t,f)},_3(s,null,[{key:"canUseDOM",set:function(a){t.canUseDOM=a}}]),s})(X.Component),n.propTypes={base:De.object,bodyAttributes:De.object,children:De.oneOfType([De.arrayOf(De.node),De.node]),defaultTitle:De.string,defer:De.bool,encodeSpecialCharacters:De.bool,htmlAttributes:De.object,link:De.arrayOf(De.object),meta:De.arrayOf(De.object),noscript:De.arrayOf(De.object),onChangeClientState:De.func,script:De.arrayOf(De.object),style:De.arrayOf(De.object),title:De.string,titleAttributes:De.object,titleTemplate:De.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var o=t.rewind();return o||(o=mp({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),o},r},H3=function(){return null},z3=f3(P3,I3,mp)(H3),Ga=$3(z3);Ga.renderStatic=Ga.rewind;function Dl(e,t){return t==null?g.jsx(Re,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:e}):typeof t=="string"||typeof t=="number"?g.jsx(Re,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:t}):g.jsx("div",{role:"heading","aria-level":1,children:t})}function Ll(e){return e==null?null:typeof e=="string"||typeof e=="number"?g.jsx(Re,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"mt-1",children:e}):g.jsx("div",{className:"mt-1",children:e})}function Ns({title:e,heading:t,variant:n="default",description:r,headerRight:o,children:s}){return g.jsxs(g.Fragment,{children:[g.jsx(Ga,{children:g.jsx("title",{children:e?`${e} | Ocean Brain`:"Ocean Brain"})}),n==="default"&&g.jsx("div",{className:"mb-5 border-b border-border-subtle/80 pb-4",children:g.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[g.jsxs("div",{children:[Dl(e,t),Ll(r)]}),o]})}),n==="subtle"&&g.jsx("div",{className:"mb-6",children:g.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[g.jsxs("div",{children:[Dl(e,t),Ll(r)]}),o]})}),s]})}const U3=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},la=new Map;function V3(){const e=ds({select:n=>n.pathname}),t=u.useRef(null);return u.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,r=i=>{if(i!==0){la.set(e,i);return}la.delete(e)},o=U3(()=>{if(t.current){const{scrollTop:i}=n;r(i)}}),s=la.get(e);return s&&(n.scrollTop=s),n.addEventListener("scroll",o),()=>{n.removeEventListener("scroll",o)}}},[e]),g.jsx("div",{ref:t,className:"hidden"})}const Jr="/",gp="/views",Z3="/views/notes",vp="/calendar",yp="/reminders",bp="/graph",wp="/search",xp="/tag",or="/$id",Ep="/tag/$id",_p="/setting",W3="/setting/mcp",q3="/setting/trash",K3="/setting/manage-image",G3="/setting/manage-image/$id",Y3="/setting/placeholder",Q3="/setting/properties",Ya="An unexpected routing error occurred.",Sp=e=>typeof e=="object"&&e!==null&&"errors"in e&&Array.isArray(e.errors),X3=e=>e instanceof Error?e.message:Sp(e)?e.errors?.[0]?.message??Ya:Ya,J3=e=>{if(Sp(e))return e.errors?.[0]?.code};function rc({title:e,error:t,description:n,onRetry:r,showBackAction:o=!0,showHomeAction:s=!0}){const i=Pn(),a=it(),[c,l]=u.useState("idle"),f=X3(t),d=J3(t),p=async()=>{try{const h=[d,f].filter(Boolean).join(" :: ");await navigator.clipboard.writeText(h||Ya),l("copied")}catch{l("failed")}};return g.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[g.jsx(Re,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:e}),n&&g.jsx(Re,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:n}),g.jsxs(Re,{as:"div",variant:"body",tone:"secondary",className:"mt-4 rounded-[14px] border border-border-subtle bg-subtle px-3 py-2",children:[f,d&&g.jsxs(Re,{as:"span",variant:"body",weight:"bold",tone:"tertiary",className:"ml-2",children:["[",d,"]"]})]}),g.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r&&g.jsx(At,{size:"sm",onClick:r,children:"Try again"}),o&&g.jsx(At,{size:"sm",variant:"ghost",onClick:()=>a.history.back(),children:"Go back"}),s&&g.jsx(At,{size:"sm",variant:"ghost",onClick:()=>i({to:Jr,search:{page:1,limit:Ms,sortBy:"updatedAt",sortOrder:"desc",pinnedFirst:!1}}),children:"Go home"}),g.jsx(At,{size:"sm",variant:"ghost",onClick:p,children:c==="copied"?"Copied details":c==="failed"?"Copy failed":"Copy details"})]})]})}function Ge({title:e="Loading page",description:t="Preparing route resources."}){return g.jsx(Ns,{title:e,description:t,variant:"none",children:g.jsxs("div",{role:"status","aria-label":e,className:"flex flex-col gap-4",children:[g.jsx(Lt,{height:"56px"}),g.jsx(Lt,{height:"220px"}),g.jsx(Lt,{height:"160px"})]})})}function eE({error:e,reset:t}){return g.jsx(Ns,{title:"Something went wrong",variant:"none",children:g.jsx(rc,{title:"Route failed to render",description:"Retry the route or navigate somewhere safe.",error:e,onRetry:t})})}function tE(){return g.jsx(Ns,{title:"Not found",variant:"none",children:g.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[g.jsx(Re,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:"This page does not exist."}),g.jsx(Re,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:"Check the URL or navigate from the sidebar."})]})})}const nE=(e=[],t=[])=>e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]));class rE extends u.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error!==null&&nE(t.resetKeys,this.props.resetKeys)&&this.resetErrorBoundary()}resetErrorBoundary=()=>{this.props.onReset?.(),this.setState({error:null})};render(){return this.state.error!==null?this.props.fallbackRender({error:this.state.error,resetErrorBoundary:this.resetErrorBoundary}):this.props.children}}function Cp({children:e,fallback:t,errorTitle:n,errorDescription:r,resetKeys:o,renderError:s}){return g.jsx(Yg,{children:({reset:i})=>g.jsx(rE,{onReset:i,resetKeys:o,fallbackRender:({error:a,resetErrorBoundary:c})=>s?s({error:a,retry:c}):g.jsx(rc,{title:n,description:r,error:a,onRetry:c}),children:g.jsx(u.Suspense,{fallback:t,children:e})})})}const jl=e=>{let t;const n=new Set,r=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},oE=(e=>e?jl(e):jl),sE=e=>e;function aE(e,t=sE){const n=X.useSyncExternalStore(e.subscribe,X.useCallback(()=>t(e.getState()),[e,t]),X.useCallback(()=>t(e.getInitialState()),[e,t]));return X.useDebugValue(n),n}const Fl=e=>{const t=oE(e),n=r=>aE(t,r);return Object.assign(n,t),n},iE=(e=>e?Fl(e):Fl),Rp="theme",Bl="(prefers-color-scheme: dark)";function cE(e){return e==="light"||e==="dark"}function lE(){return typeof document>"u"?null:document.documentElement}function Ap(){return typeof window>"u"?null:window.localStorage}function Tp(e){const t=lE();t&&(t.classList.remove("light","dark"),t.classList.add(e))}function Yo(){const e=Ap()?.getItem(Rp)??null;return cE(e)?e:null}function uE({storedTheme:e,systemPrefersDark:t}){return e||(t?"dark":"light")}function dE(e,t={}){Tp(e),t.persist!==!1&&Ap()?.setItem(Rp,e)}function fE(e={}){const t=e.matchMedia?e.matchMedia(Bl).matches:typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Bl).matches:!1,n=uE({storedTheme:Yo(),systemPrefersDark:t});return Tp(n),n}const $l=Yo(),Qo=iE(e=>({explicitTheme:$l,theme:$l??"light",setTheme:t=>{e({explicitTheme:t,theme:t})},setSystemTheme:t=>{e(n=>n.explicitTheme?n:{theme:t})},toggleTheme:()=>{e(t=>{const n=t.theme==="light"?"dark":"light";return{explicitTheme:n,theme:n}})}}));Qo.subscribe(e=>{dE(e.theme,{persist:e.explicitTheme===e.theme})});const hE=()=>null,pE="flex h-dvh min-h-0 w-full flex-row overflow-hidden",mE=xe("fixed","bottom-4","left-4","z-[1003]","flex","h-12","w-12","items-center","justify-center","rounded-[14px]","border","border-border-subtle","bg-surface","text-fg-secondary","shadow-[0_12px_24px_-18px_rgba(0,0,0,0.35)]","transition-all","hover:bg-hover-subtle","hover:text-fg-default","active:translate-y-px","aria-expanded:bg-hover-subtle","aria-expanded:text-fg-default"),gE=xe("fixed","z-[1002]","h-full","w-full","flex-[0_0_300px]","overflow-y-auto","border-r-0","border-border-subtle","bg-[var(--page-bg)]","pb-20","md:static","md:w-auto","md:translate-x-0","md:border-r","md:pb-0","md:pointer-events-auto"),vE="pointer-events-none -translate-x-full",yE="pointer-events-auto translate-x-0",bE=xe("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),wE=xe("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-md:after:content-['']","max-md:after:pointer-events-none","max-md:after:absolute","max-md:after:inset-y-0","max-md:after:right-0","max-md:after:w-12","max-md:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),xE=xe("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),EE=xe("min-h-0","min-w-0","max-w-full","flex-1","overflow-x-clip","px-4","pt-4","after:block","after:h-4","after:content-['']","max-md:after:h-24"),_E=({sidebar:e,topNavigation:t,children:n})=>{const r=ds({select:a=>a.pathname}),[o,s]=u.useState(!1),i="site-layout-sidebar";return u.useEffect(()=>{s(!1)},[r]),g.jsxs("div",{className:pE,children:[g.jsx("div",{className:"md:hidden",children:g.jsx("button",{type:"button",className:mE,"aria-label":"Toggle sidebar","aria-controls":i,"aria-expanded":o,onClick:()=>s(a=>!a),children:g.jsx(cy,{className:"h-6 w-6"})})}),g.jsx("aside",{id:i,className:xe(gE,o?yE:vE),children:e}),g.jsxs("main",{className:bE,children:[g.jsx("div",{className:wE,children:g.jsx("div",{className:xE,children:t})}),g.jsx("div",{className:EE,children:n}),g.jsx(V3,{})]})]})},SE=e=>({type:"error",category:"graphql",errors:e.map(t=>({code:t.extensions?.code??"GRAPHQL_ERROR",message:t.message??"GraphQL request failed",details:t}))}),CE=e=>{const t=Se.isAxiosError(e)?e.response?.data?.message??e.message??"Network request failed":"Network request failed",n=Se.isAxiosError(e)?e.code??(e.response?.status?`HTTP_${e.response.status}`:"NETWORK_ERROR"):"NETWORK_ERROR",r=Se.isAxiosError(e)?e.response?.data:void 0;return{type:"error",category:"network",errors:[{code:n,message:t,details:r}]}},RE={async execute(e){try{const{data:t}=await Se.post("/graphql",e);return t.errors&&t.errors.length>0?SE(t.errors):t.data?{type:"success",...t.data}:{type:"error",category:"graphql",errors:[{code:"EMPTY_RESPONSE",message:"GraphQL response data is empty",details:t}]}}catch(t){return CE(t)}}},AE={server:RE},TE=()=>AE.server;async function Pe(e,t,n){const r=typeof e=="string"?{query:e,variables:t,operationName:n}:e;return TE().execute(r)}const Pp=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",Mp=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),PE=async e=>{try{const t=await Pe(`
|
|
27
|
+
`,c=e?"cursor-default bg-cta border-cta text-fg-on-filled":t?"cursor-default text-fg-disabled border-transparent":"cursor-pointer text-fg-default hover:bg-hover hover:border-border-subtle",l=n?"relative [&>svg]:absolute [&>svg:first-child]:-translate-x-[3px] [&>svg:last-child]:translate-x-[3px]":"";return g.jsx("button",{ref:i,type:"button",disabled:t,className:`${a} ${c} ${l} ${o}`,...s,children:r})});Hn.displayName="PaginationItem";const Ew=Ke(["h-full","transition-all","duration-300","ease-out"],{variants:{color:{primary:"bg-pastel-blue-200",success:"bg-pastel-green-200",danger:"bg-pastel-pink-200",warning:"bg-pastel-orange-200"}},defaultVariants:{color:"primary"}}),_w=u.forwardRef(({value:e,max:t,color:n,className:r="",...o},s)=>{const i=Math.min(100,Math.max(0,e/t*100));return g.jsx("div",{ref:s,className:xe("w-full h-3","bg-surface","border-2 border-border","rounded-[6px]","overflow-hidden",r),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,...o,children:g.jsx("div",{className:`progress-fill ${Ew({color:n})}`,style:{"--progress-width":`${i}%`}})})});_w.displayName="Progress";function Cl(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sw(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var x0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Cw="VisuallyHidden",E0=u.forwardRef((e,t)=>g.jsx(be.span,{...e,ref:t,style:{...x0,...e.style}}));E0.displayName=Cw;var Rw=E0,Aw=[" ","Enter","ArrowUp","ArrowDown"],Tw=[" ","Enter"],An="Select",[Cs,Rs,Pw]=Fi(An),[rr]=Bt(An,[Pw,nr]),As=nr(),[Mw,ln]=rr(An),[Nw,Ow]=rr(An),_0=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:d,disabled:p,required:h,form:y}=e,m=As(t),[v,b]=u.useState(null),[w,_]=u.useState(null),[S,C]=u.useState(!1),O=ws(l),[T,P]=qt({prop:r,defaultProp:o??!1,onChange:s,caller:An}),[N,F]=qt({prop:i,defaultProp:a,onChange:c,caller:An}),z=u.useRef(null),R=v?y||!!v.closest("form"):!0,[H,x]=u.useState(new Set),I=Array.from(H).map($=>$.props.value).join(";");return g.jsx(Hi,{...m,children:g.jsxs(Mw,{required:h,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Dt(),value:N,onValueChange:F,open:T,onOpenChange:P,dir:O,triggerPointerDownPosRef:z,disabled:p,children:[g.jsx(Cs.Provider,{scope:t,children:g.jsx(Nw,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback($=>{x(D=>new Set(D).add($))},[]),onNativeOptionRemove:u.useCallback($=>{x(D=>{const q=new Set(D);return q.delete($),q})},[]),children:n})}),R?g.jsxs(z0,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:N,onChange:$=>F($.target.value),disabled:p,form:y,children:[N===void 0?g.jsx("option",{value:""}):null,Array.from(H)]},I):null]})})};_0.displayName=An;var S0="SelectTrigger",C0=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=As(n),i=ln(S0,n),a=i.disabled||r,c=Ee(t,i.onTriggerChange),l=Rs(n),f=u.useRef("touch"),[d,p,h]=V0(m=>{const v=l().filter(_=>!_.disabled),b=v.find(_=>_.value===i.value),w=Z0(v,m,b);w!==void 0&&i.onValueChange(w.value)}),y=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(zi,{asChild:!0,...s,children:g.jsx(be.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":U0(i.value)?"":void 0,...o,ref:c,onClick:de(o.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&y(m)}),onPointerDown:de(o.onPointerDown,m=>{f.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:de(o.onKeyDown,m=>{const v=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(v&&m.key===" ")&&Aw.includes(m.key)&&(y(),m.preventDefault())})})})});C0.displayName=S0;var R0="SelectValue",A0=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=ln(R0,n),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,d=Ee(t,c.onValueNodeChange);return Xe(()=>{l(f)},[l,f]),g.jsx(be.span,{...a,ref:d,style:{pointerEvents:"none"},children:U0(c.value)?g.jsx(g.Fragment,{children:i}):s})});A0.displayName=R0;var Iw="SelectIcon",T0=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx(be.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});T0.displayName=Iw;var kw="SelectPortal",P0=e=>g.jsx(zr,{asChild:!0,...e});P0.displayName=kw;var Tn="SelectContent",M0=u.forwardRef((e,t)=>{const n=ln(Tn,e.__scopeSelect),[r,o]=u.useState();if(Xe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Zt.createPortal(g.jsx(N0,{scope:e.__scopeSelect,children:g.jsx(Cs.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),s):null}return g.jsx(O0,{...e,ref:t})});M0.displayName=Tn;var Rt=10,[N0,un]=rr(Tn),Dw="SelectContentImpl",Lw=Gn("SelectContent.RemoveScroll"),O0=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:v,...b}=e,w=ln(Tn,n),[_,S]=u.useState(null),[C,O]=u.useState(null),T=Ee(t,te=>S(te)),[P,N]=u.useState(null),[F,z]=u.useState(null),R=Rs(n),[H,x]=u.useState(!1),I=u.useRef(!1);u.useEffect(()=>{if(_)return wi(_)},[_]),bi();const $=u.useCallback(te=>{const[Q,...ie]=R().map(fe=>fe.ref.current),[re]=ie.slice(-1),ce=document.activeElement;for(const fe of te)if(fe===ce||(fe?.scrollIntoView({block:"nearest"}),fe===Q&&C&&(C.scrollTop=0),fe===re&&C&&(C.scrollTop=C.scrollHeight),fe?.focus(),document.activeElement!==ce))return},[R,C]),D=u.useCallback(()=>$([P,_]),[$,P,_]);u.useEffect(()=>{H&&D()},[H,D]);const{onOpenChange:q,triggerPointerDownPosRef:k}=w;u.useEffect(()=>{if(_){let te={x:0,y:0};const Q=re=>{te={x:Math.abs(Math.round(re.pageX)-(k.current?.x??0)),y:Math.abs(Math.round(re.pageY)-(k.current?.y??0))}},ie=re=>{te.x<=10&&te.y<=10?re.preventDefault():_.contains(re.target)||q(!1),document.removeEventListener("pointermove",Q),k.current=null};return k.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",ie,{capture:!0})}}},[_,q,k]),u.useEffect(()=>{const te=()=>q(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[q]);const[Y,L]=V0(te=>{const Q=R().filter(ce=>!ce.disabled),ie=Q.find(ce=>ce.ref.current===document.activeElement),re=Z0(Q,te,ie);re&&setTimeout(()=>re.ref.current.focus())}),j=u.useCallback((te,Q,ie)=>{const re=!I.current&&!ie;(w.value!==void 0&&w.value===Q||re)&&(N(te),re&&(I.current=!0))},[w.value]),K=u.useCallback(()=>_?.focus(),[_]),G=u.useCallback((te,Q,ie)=>{const re=!I.current&&!ie;(w.value!==void 0&&w.value===Q||re)&&z(te)},[w.value]),Z=r==="popper"?Ba:I0,le=Z===Ba?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:v}:{};return g.jsx(N0,{scope:n,content:_,viewport:C,onViewportChange:O,itemRefCallback:j,selectedItem:P,onItemLeave:K,itemTextRefCallback:G,focusSelectedItem:D,selectedItemText:F,position:r,isPositioned:H,searchRef:Y,children:g.jsx(ri,{as:Lw,allowPinchZoom:!0,children:g.jsx(fs,{asChild:!0,trapped:w.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:de(o,te=>{w.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:g.jsx(Hr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:g.jsx(Z,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:te=>te.preventDefault(),...b,...le,onPlaced:()=>x(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:de(b.onKeyDown,te=>{const Q=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!Q&&te.key.length===1&&L(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let re=R().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(te.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const ce=te.target,fe=re.indexOf(ce);re=re.slice(fe+1)}setTimeout(()=>$(re)),te.preventDefault()}})})})})})})});O0.displayName=Dw;var jw="SelectItemAlignedPosition",I0=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ln(Tn,n),i=un(Tn,n),[a,c]=u.useState(null),[l,f]=u.useState(null),d=Ee(t,T=>f(T)),p=Rs(n),h=u.useRef(!1),y=u.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=i,_=u.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&v&&b){const T=s.trigger.getBoundingClientRect(),P=l.getBoundingClientRect(),N=s.valueNode.getBoundingClientRect(),F=b.getBoundingClientRect();if(s.dir!=="rtl"){const ce=F.left-P.left,fe=N.left-ce,ve=T.left-fe,E=T.width+ve,J=Math.max(E,P.width),W=window.innerWidth-Rt,M=Cl(fe,[Rt,Math.max(Rt,W-J)]);a.style.minWidth=E+"px",a.style.left=M+"px"}else{const ce=P.right-F.right,fe=window.innerWidth-N.right-ce,ve=window.innerWidth-T.right-fe,E=T.width+ve,J=Math.max(E,P.width),W=window.innerWidth-Rt,M=Cl(fe,[Rt,Math.max(Rt,W-J)]);a.style.minWidth=E+"px",a.style.right=M+"px"}const z=p(),R=window.innerHeight-Rt*2,H=m.scrollHeight,x=window.getComputedStyle(l),I=parseInt(x.borderTopWidth,10),$=parseInt(x.paddingTop,10),D=parseInt(x.borderBottomWidth,10),q=parseInt(x.paddingBottom,10),k=I+$+H+q+D,Y=Math.min(v.offsetHeight*5,k),L=window.getComputedStyle(m),j=parseInt(L.paddingTop,10),K=parseInt(L.paddingBottom,10),G=T.top+T.height/2-Rt,Z=R-G,le=v.offsetHeight/2,te=v.offsetTop+le,Q=I+$+te,ie=k-Q;if(Q<=G){const ce=z.length>0&&v===z[z.length-1].ref.current;a.style.bottom="0px";const fe=l.clientHeight-m.offsetTop-m.offsetHeight,ve=Math.max(Z,le+(ce?K:0)+fe+D),E=Q+ve;a.style.height=E+"px"}else{const ce=z.length>0&&v===z[0].ref.current;a.style.top="0px";const ve=Math.max(G,I+m.offsetTop+(ce?j:0)+le)+ie;a.style.height=ve+"px",m.scrollTop=Q-G+m.offsetTop}a.style.margin=`${Rt}px 0`,a.style.minHeight=Y+"px",a.style.maxHeight=R+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,a,l,m,v,b,s.dir,r]);Xe(()=>_(),[_]);const[S,C]=u.useState();Xe(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);const O=u.useCallback(T=>{T&&y.current===!0&&(_(),w?.(),y.current=!1)},[_,w]);return g.jsx(Bw,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:O,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:g.jsx(be.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});I0.displayName=jw;var Fw="SelectPopperPosition",Ba=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Rt,...s}=e,i=As(n);return g.jsx(Ui,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ba.displayName=Fw;var[Bw,Xi]=rr(Tn,{}),$a="SelectViewport",k0=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=un($a,n),i=Xi($a,n),a=Ee(t,s.onViewportChange),c=u.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(Cs.Slot,{scope:n,children:g.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:de(o.onScroll,l=>{const f=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=i;if(p?.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const y=window.innerHeight-Rt*2,m=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),b=Math.max(m,v);if(b<y){const w=b+h,_=Math.min(y,w),S=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});k0.displayName=$a;var D0="SelectGroup",[$w,Hw]=rr(D0),zw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Dt();return g.jsx($w,{scope:n,id:o,children:g.jsx(be.div,{role:"group","aria-labelledby":o,...r,ref:t})})});zw.displayName=D0;var L0="SelectLabel",Uw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hw(L0,n);return g.jsx(be.div,{id:o.id,...r,ref:t})});Uw.displayName=L0;var qo="SelectItem",[Vw,j0]=rr(qo),F0=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=ln(qo,n),c=un(qo,n),l=a.value===r,[f,d]=u.useState(s??""),[p,h]=u.useState(!1),y=Ee(t,w=>c.itemRefCallback?.(w,r,o)),m=Dt(),v=u.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Vw,{scope:n,value:r,disabled:o,textId:m,isSelected:l,onItemTextChange:u.useCallback(w=>{d(_=>_||(w?.textContent??"").trim())},[]),children:g.jsx(Cs.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:g.jsx(be.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:y,onFocus:de(i.onFocus,()=>h(!0)),onBlur:de(i.onBlur,()=>h(!1)),onClick:de(i.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:de(i.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:de(i.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:de(i.onPointerMove,w=>{v.current=w.pointerType,o?c.onItemLeave?.():v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:de(i.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:de(i.onKeyDown,w=>{c.searchRef?.current!==""&&w.key===" "||(Tw.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});F0.displayName=qo;var wr="SelectItemText",B0=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ln(wr,n),a=un(wr,n),c=j0(wr,n),l=Ow(wr,n),[f,d]=u.useState(null),p=Ee(t,b=>d(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=f?.textContent,y=u.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=l;return Xe(()=>(m(y),()=>v(y)),[m,v,y]),g.jsxs(g.Fragment,{children:[g.jsx(be.span,{id:c.textId,...s,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Zt.createPortal(s.children,i.valueNode):null]})});B0.displayName=wr;var $0="SelectItemIndicator",Zw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return j0($0,n).isSelected?g.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});Zw.displayName=$0;var Ha="SelectScrollUpButton",Ww=u.forwardRef((e,t)=>{const n=un(Ha,e.__scopeSelect),r=Xi(Ha,e.__scopeSelect),[o,s]=u.useState(!1),i=Ee(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(H0,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Ww.displayName=Ha;var za="SelectScrollDownButton",qw=u.forwardRef((e,t)=>{const n=un(za,e.__scopeSelect),r=Xi(za,e.__scopeSelect),[o,s]=u.useState(!1),i=Ee(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<l;s(f)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(H0,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});qw.displayName=za;var H0=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=un("SelectScrollButton",n),i=u.useRef(null),a=Rs(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Xe(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),g.jsx(be.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:de(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:de(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:de(o.onPointerLeave,()=>{c()})})}),Kw="SelectSeparator",Gw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});Gw.displayName=Kw;var Ua="SelectArrow",Yw=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=As(n),s=ln(Ua,n),i=un(Ua,n);return s.open&&i.position==="popper"?g.jsx(Vi,{...o,...r,ref:t}):null});Yw.displayName=Ua;var Qw="SelectBubbleInput",z0=u.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=u.useRef(null),s=Ee(r,o),i=Sw(t);return u.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const d=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(d)}},[i,t]),g.jsx(be.select,{...n,style:{...x0,...n.style},ref:s,defaultValue:t})});z0.displayName=Qw;function U0(e){return e===""||e===void 0}function V0(e){const t=jt(e),n=u.useRef(""),r=u.useRef(0),o=u.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=u.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Z0(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Xw(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Xw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jw=_0,ex=C0,tx=A0,nx=T0,rx=P0,ox=M0,sx=k0,ax=F0,ix=B0,cx=Jw,lx=tx,ux=ex,dx=nx,fx=rx,hx=ox,px=sx,mx=ax,gx=ix;const vx=Ke(["inline-flex","items-center","justify-between","gap-2","border","border-border-subtle","bg-elevated","text-fg-default","font-medium","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","cursor-pointer","whitespace-nowrap"],{variants:{variant:{default:["border-border-subtle"],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"]},size:{sm:"h-8 px-3 text-sm rounded-[12px]",md:"h-9 px-3 text-sm rounded-[14px]",lg:"h-11 px-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),Ao=({id:e,value:t,defaultValue:n,onValueChange:r,placeholder:o,ariaLabel:s,"aria-labelledby":i,"aria-describedby":a,variant:c,size:l,className:f,children:d,disabled:p})=>g.jsxs(cx,{value:t,defaultValue:n,onValueChange:r,disabled:p,children:[g.jsxs(ux,{id:e,"aria-label":s,"aria-labelledby":i,"aria-describedby":a,className:vx({variant:c,size:l,className:f}),children:[g.jsx(lx,{className:"min-w-0 truncate",placeholder:o}),g.jsx(dx,{children:g.jsx(ny,{className:"w-3.5 h-3.5 opacity-60"})})]}),g.jsx(fx,{children:g.jsx(W0,{children:g.jsx(px,{className:"p-1",children:d})})})]}),W0=u.forwardRef(({className:e,children:t,...n},r)=>g.jsx(hx,{ref:r,position:"popper",sideOffset:4,className:xe("z-[1100]","min-w-[var(--radix-select-trigger-width)]","overflow-hidden","surface-floating","data-[state=open]:animate-fade-in","data-[state=open]:animate-zoom-in",e),...n,children:t}));W0.displayName="SelectContent";const zn=u.forwardRef(({className:e,children:t,...n},r)=>g.jsx(mx,{ref:r,className:xe("relative","flex","items-center","cursor-pointer","select-none","px-3","py-2","text-sm","font-medium","text-fg-secondary","outline-none","focus-ring-soft","transition-colors","rounded-[10px]","data-[highlighted]:bg-hover-subtle","data-[highlighted]:text-fg-default","data-[disabled]:pointer-events-none","data-[disabled]:opacity-50",e),...n,children:g.jsx(gx,{children:t})}));zn.displayName="SelectItem";Ao.displayName="Select";const Rl=e=>typeof e=="number"?`${e}px`:e,Lt=u.forwardRef(({width:e,height:t=30,opacity:n,className:r="",style:o,...s},i)=>g.jsx("div",{ref:i,className:xe("rounded-[14px]","skeleton-sized","bg-[length:200%_100%]","bg-gradient-to-r","from-pastel-lavender-200/30","via-pastel-yellow-200/20","to-pastel-lavender-200/30","animate-shimmer","animate-fade-in",r),style:{"--skeleton-width":Rl(e),"--skeleton-height":Rl(t),"--skeleton-opacity":n,...o},...s}));Lt.displayName="Skeleton";const yx=u.forwardRef(({checked:e,onCheckedChange:t,onClick:n,className:r,disabled:o,...s},i)=>g.jsx("button",{ref:i,type:"button",role:"switch","aria-checked":e,disabled:o,className:xe("focus-ring-soft relative inline-flex h-7 w-12 items-center rounded-full border p-1 transition-colors duration-200 outline-none",e?"border-transparent bg-cta hover:bg-cta-hover active:bg-cta-hover":"border-border bg-subtle hover:bg-hover active:bg-active",o&&"cursor-not-allowed opacity-80",r),onClick:a=>{n?.(a),!(a.defaultPrevented||o)&&t?.(!e)},...s,children:g.jsx("span",{"aria-hidden":"true",className:xe("pointer-events-none inline-block h-5 w-5 rounded-full shadow-sm transition-transform duration-200",e?"translate-x-5 bg-white":"translate-x-0 bg-fg-secondary")})}));yx.displayName="Switch";const bx=Ke(["w-full","border","border-border-subtle","bg-elevated","text-fg-default","placeholder:text-fg-placeholder","transition-colors","outline-none","focus-ring-soft","disabled:cursor-not-allowed","disabled:opacity-50","resize-none"],{variants:{variant:{default:[],ghost:["border-transparent","bg-subtle","hover:bg-hover-subtle"],error:["border-border-error","bg-accent-soft-danger/40","text-fg-default"]},size:{sm:"min-h-[60px] p-3 text-sm rounded-[12px]",md:"min-h-[80px] p-3 text-sm rounded-[14px]",lg:"min-h-[100px] p-4 text-base rounded-[16px]"}},defaultVariants:{variant:"default",size:"md"}}),wx=u.forwardRef(({className:e,variant:t,size:n,...r},o)=>g.jsx("textarea",{ref:o,className:bx({variant:t,size:n,className:e}),...r}));wx.displayName="Textarea";var q0="Toggle",K0=u.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=qt({prop:n,onChange:o,defaultProp:r??!1,caller:q0});return g.jsx(be.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:de(e.onClick,()=>{e.disabled||a(!i)})})});K0.displayName=q0;var dn="ToggleGroup",[G0]=Bt(dn,[xs]),Y0=xs(),Ji=X.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(xx,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(Ex,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${dn}\``)});Ji.displayName=dn;var[Q0,X0]=G0(dn),xx=X.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=qt({prop:n,defaultProp:r??"",onChange:o,caller:dn});return g.jsx(Q0,{scope:e.__scopeToggleGroup,type:"single",value:X.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:X.useCallback(()=>a(""),[a]),children:g.jsx(J0,{...s,ref:t})})}),Ex=X.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=qt({prop:n,defaultProp:r??[],onChange:o,caller:dn}),c=X.useCallback(f=>a((d=[])=>[...d,f]),[a]),l=X.useCallback(f=>a((d=[])=>d.filter(p=>p!==f)),[a]);return g.jsx(Q0,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:l,children:g.jsx(J0,{...s,ref:t})})});Ji.displayName=dn;var[_x,Sx]=G0(dn),J0=X.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,l=Y0(n),f=ws(i),d={role:"group",dir:f,...c};return g.jsx(_x,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(wh,{asChild:!0,...l,orientation:s,dir:f,loop:a,children:g.jsx(be.div,{...d,ref:t})}):g.jsx(be.div,{...d,ref:t})})}),Ko="ToggleGroupItem",ep=X.forwardRef((e,t)=>{const n=X0(Ko,e.__scopeToggleGroup),r=Sx(Ko,e.__scopeToggleGroup),o=Y0(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,a={...e,pressed:s,disabled:i},c=X.useRef(null);return r.rovingFocus?g.jsx(xh,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:g.jsx(Al,{...a,ref:t})}):g.jsx(Al,{...a,ref:t})});ep.displayName=Ko;var Al=X.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=X0(Ko,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return g.jsx(K0,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),Cx=Ji,Rx=ep,Ax=Cx,Tx=Rx;const Px=Ke(["inline-flex","gap-0.5","overflow-hidden"],{variants:{variant:{default:["border-2","border-border","rounded-[10px]","bg-surface"],outline:["border-2","border-border","rounded-[10px]","bg-transparent"],pills:["surface-base","p-1"],quiet:["rounded-[12px]","border","border-border-subtle/80","bg-hover-subtle/55","p-0.5"]}},defaultVariants:{variant:"default"}}),Mx=Ke(["flex","items-center","justify-center","font-bold","border","border-transparent","transition-colors","duration-200","disabled:pointer-events-none","disabled:opacity-50"],{variants:{variant:{default:["text-fg-muted","hover:bg-hover","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],outline:["text-fg-muted","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled"],pills:["text-fg-secondary","rounded-[10px]","hover:bg-hover-subtle","data-[state=on]:bg-cta","data-[state=on]:text-fg-on-filled","data-[state=on]:border-border-secondary"],quiet:["rounded-[10px]","font-medium","text-fg-secondary","hover:bg-hover-subtle/80","data-[state=on]:border-border-secondary/70","data-[state=on]:bg-elevated","data-[state=on]:text-fg-default","data-[state=on]:shadow-[0_8px_18px_-16px_rgba(15,18,24,0.28)]"]},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),tp=u.createContext({}),Nx=u.forwardRef(({className:e,variant:t,size:n,children:r,...o},s)=>g.jsx(tp.Provider,{value:{variant:t??"default",size:n??"md"},children:g.jsx(Ax,{ref:s,className:Px({variant:t,className:e}),...o,children:r})}));Nx.displayName="ToggleGroup";const Ox=u.forwardRef(({className:e,activeClassName:t,children:n,...r},o)=>{const s=u.useContext(tp);return g.jsx(Tx,{ref:o,className:Mx({variant:s.variant,size:s.size,className:xe(e,t)}),...r,children:n})});Ox.displayName="ToggleGroupItem";var[Ts]=Bt("Tooltip",[nr]),Ps=nr(),np="TooltipProvider",Ix=700,Va="tooltip.open",[kx,ec]=Ts(np),rp=e=>{const{__scopeTooltip:t,delayDuration:n=Ix,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=u.useRef(!0),a=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),g.jsx(kx,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:u.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};rp.displayName=np;var Ir="Tooltip",[Dx,Xr]=Ts(Ir),op=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ec(Ir,e.__scopeTooltip),l=Ps(t),[f,d]=u.useState(null),p=Dt(),h=u.useRef(0),y=i??c.disableHoverableContent,m=a??c.delayDuration,v=u.useRef(!1),[b,w]=qt({prop:r,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(Va))):c.onClose(),s?.(T)},caller:Ir}),_=u.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),S=u.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,w(!0)},[w]),C=u.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),O=u.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0),h.current=0},m)},[m,w]);return u.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),g.jsx(Hi,{...l,children:g.jsx(Dx,{scope:t,contentId:p,open:b,stateAttribute:_,trigger:f,onTriggerChange:d,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?O():S()},[c.isOpenDelayedRef,O,S]),onTriggerLeave:u.useCallback(()=>{y?C():(window.clearTimeout(h.current),h.current=0)},[C,y]),onOpen:S,onClose:C,disableHoverableContent:y,children:n})})};op.displayName=Ir;var Za="TooltipTrigger",sp=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Xr(Za,n),s=ec(Za,n),i=Ps(n),a=u.useRef(null),c=Ee(t,a,o.onTriggerChange),l=u.useRef(!1),f=u.useRef(!1),d=u.useCallback(()=>l.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(zi,{asChild:!0,...i,children:g.jsx(be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:de(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:de(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:de(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:de(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:de(e.onBlur,o.onClose),onClick:de(e.onClick,o.onClose)})})});sp.displayName=Za;var tc="TooltipPortal",[Lx,jx]=Ts(tc,{forceMount:void 0}),ap=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Xr(tc,t);return g.jsx(Lx,{scope:t,forceMount:n,children:g.jsx($t,{present:n||s.open,children:g.jsx(zr,{asChild:!0,container:o,children:r})})})};ap.displayName=tc;var Qn="TooltipContent",ip=u.forwardRef((e,t)=>{const n=jx(Qn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Xr(Qn,e.__scopeTooltip);return g.jsx($t,{present:r||i.open,children:i.disableHoverableContent?g.jsx(cp,{side:o,...s,ref:t}):g.jsx(Fx,{side:o,...s,ref:t})})}),Fx=u.forwardRef((e,t)=>{const n=Xr(Qn,e.__scopeTooltip),r=ec(Qn,e.__scopeTooltip),o=u.useRef(null),s=Ee(t,o),[i,a]=u.useState(null),{trigger:c,onClose:l}=n,f=o.current,{onPointerInTransitChange:d}=r,p=u.useCallback(()=>{a(null),d(!1)},[d]),h=u.useCallback((y,m)=>{const v=y.currentTarget,b={x:y.clientX,y:y.clientY},w=Ux(b,v.getBoundingClientRect()),_=Vx(b,w),S=Zx(m.getBoundingClientRect()),C=qx([..._,...S]);a(C),d(!0)},[d]);return u.useEffect(()=>()=>p(),[p]),u.useEffect(()=>{if(c&&f){const y=v=>h(v,f),m=v=>h(v,c);return c.addEventListener("pointerleave",y),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",m)}}},[c,f,h,p]),u.useEffect(()=>{if(i){const y=m=>{const v=m.target,b={x:m.clientX,y:m.clientY},w=c?.contains(v)||f?.contains(v),_=!Wx(b,i);w?p():_&&(p(),l())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,f,i,l,p]),g.jsx(cp,{...e,ref:s})}),[Bx,$x]=Ts(Ir,{isInside:!1}),Hx=Qu("TooltipContent"),cp=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Xr(Qn,n),l=Ps(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Va,f),()=>document.removeEventListener(Va,f)),[f]),u.useEffect(()=>{if(c.trigger){const d=p=>{p.target?.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),g.jsx(Hr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:g.jsxs(Ui,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(Hx,{children:r}),g.jsx(Bx,{scope:n,isInside:!0,children:g.jsx(Rw,{id:c.contentId,role:"tooltip",children:o||r})})]})})});ip.displayName=Qn;var lp="TooltipArrow",zx=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ps(n);return $x(lp,n).isInside?null:g.jsx(Vi,{...o,...r,ref:t})});zx.displayName=lp;function Ux(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Vx(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Zx(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Wx(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],l=a.x,f=a.y,d=c.x,p=c.y;f>r!=p>r&&n<(d-l)*(r-f)/(p-f)+l&&(o=!o)}return o}function qx(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Kx(t)}function Kx(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Gx=rp,Yx=op,Qx=sp,Xx=ap,Jx=ip,e3=Gx,t3=Yx,n3=Qx,r3=Xx,up=Jx;const o3=e3,s3=t3,a3=n3,dp=u.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(up,{ref:r,sideOffset:t,className:xe("z-[1200]","overflow-hidden","px-3","py-1.5","text-xs","font-bold","bg-elevated","text-fg-secondary","border","border-border-subtle","shadow-sm","rounded-[8px]","animate-in","fade-in-0","zoom-in-95","data-[state=closed]:animate-out","data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",e),...n}));dp.displayName=up.displayName;const PC=({content:e,children:t,side:n="top",delayDuration:r=200})=>g.jsx(o3,{children:g.jsxs(s3,{delayDuration:r,children:[g.jsx(a3,{asChild:!0,children:t}),g.jsx(r3,{children:g.jsx(dp,{side:n,children:e})})]})}),Tl=({children:e,fallback:t})=>e||t;function i3({children:e}){return g.jsx("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:e})}const Ms=28,nc=[Ms,50,100];function c3(e){return nc.includes(e)}function l3({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:r,sortOrder:o,onSortOrderChange:s,pinnedFirst:i,onPinnedFirstChange:a}){return g.jsx("div",{className:"flex justify-end",children:g.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(of,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),g.jsx(Re,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),g.jsx(Ao,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:c=>{const l=Number(c);c3(l)&&t(l)},variant:"ghost",size:"sm",children:nc.map(c=>g.jsx(zn,{value:String(c),children:c===Ms?`Default (${c})`:c},c))})]}),g.jsx("div",{className:"h-5 w-px bg-divider"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(fy,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),g.jsx(Re,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),g.jsxs(Ao,{value:n,ariaLabel:"Sort field",onValueChange:c=>r(c),variant:"ghost",size:"sm",children:[g.jsx(zn,{value:"updatedAt",children:"Updated"}),g.jsx(zn,{value:"createdAt",children:"Created"})]}),g.jsxs(Ao,{value:o,ariaLabel:"Sort order",onValueChange:c=>s(c),variant:"ghost",size:"sm",children:[g.jsx(zn,{value:"desc",children:"Newest"}),g.jsx(zn,{value:"asc",children:"Oldest"})]})]}),g.jsx("div",{className:"h-5 w-px bg-divider"}),g.jsxs(b0,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[g.jsx(Wf,{id:"pinnedFirst",size:"sm",checked:i,onChange:c=>a(c.target.checked)}),g.jsx(Re,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}var sa,Pl;function u3(){if(Pl)return sa;Pl=1;function e(a){return a&&typeof a=="object"&&"default"in a?a.default:a}var t=E1(),n=e(t);function r(a,c,l){return c in a?Object.defineProperty(a,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[c]=l,a}function o(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c}var s=!!(typeof window<"u"&&window.document&&window.document.createElement);function i(a,c,l){if(typeof a!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof c!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof l<"u"&&typeof l!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function f(d){return d.displayName||d.name||"Component"}return function(p){if(typeof p!="function")throw new Error("Expected WrappedComponent to be a React component.");var h=[],y;function m(){y=a(h.map(function(b){return b.props})),v.canUseDOM?c(y):l&&(y=l(y))}var v=(function(b){o(w,b);function w(){return b.apply(this,arguments)||this}w.peek=function(){return y},w.rewind=function(){if(w.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var C=y;return y=void 0,h=[],C};var _=w.prototype;return _.UNSAFE_componentWillMount=function(){h.push(this),m()},_.componentDidUpdate=function(){m()},_.componentWillUnmount=function(){var C=h.indexOf(this);h.splice(C,1),m()},_.render=function(){return n.createElement(p,this.props)},w})(t.PureComponent);return r(v,"displayName","SideEffect("+f(p)+")"),r(v,"canUseDOM",s),v}}return sa=i,sa}var d3=u3();const f3=Xn(d3);var aa,Ml;function h3(){if(Ml)return aa;Ml=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var a,c,l;if(Array.isArray(s)){if(a=s.length,a!=i.length)return!1;for(c=a;c--!==0;)if(!o(s[c],i[c]))return!1;return!0}var f;if(t&&s instanceof Map&&i instanceof Map){if(s.size!==i.size)return!1;for(f=s.entries();!(c=f.next()).done;)if(!i.has(c.value[0]))return!1;for(f=s.entries();!(c=f.next()).done;)if(!o(c.value[1],i.get(c.value[0])))return!1;return!0}if(n&&s instanceof Set&&i instanceof Set){if(s.size!==i.size)return!1;for(f=s.entries();!(c=f.next()).done;)if(!i.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(i)){if(a=s.length,a!=i.length)return!1;for(c=a;c--!==0;)if(s[c]!==i[c])return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf&&typeof s.valueOf=="function"&&typeof i.valueOf=="function")return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString&&typeof s.toString=="function"&&typeof i.toString=="function")return s.toString()===i.toString();if(l=Object.keys(s),a=l.length,a!==Object.keys(i).length)return!1;for(c=a;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,l[c]))return!1;if(e&&s instanceof Element)return!1;for(c=a;c--!==0;)if(!((l[c]==="_owner"||l[c]==="__v"||l[c]==="__o")&&s.$$typeof)&&!o(s[l[c]],i[l[c]]))return!1;return!0}return s!==s&&i!==i}return aa=function(i,a){try{return o(i,a)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},aa}var p3=h3();const m3=Xn(p3);var ia,Nl;function g3(){if(Nl)return ia;Nl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(f){l[f]=f}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ia=o()?Object.assign:function(s,i){for(var a,c=r(s),l,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var d in a)t.call(a,d)&&(c[d]=a[d]);if(e){l=e(a);for(var p=0;p<l.length;p++)n.call(a,l[p])&&(c[l[p]]=a[l[p]])}}return c},ia}var v3=g3();const y3=Xn(v3);var wn={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},ye={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(ye).map(function(e){return ye[e]});var Le={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},Go={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},kr={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},b3=Object.keys(Go).reduce(function(e,t){return e[Go[t]]=t,e},{}),w3=[ye.NOSCRIPT,ye.SCRIPT,ye.STYLE],Tt="data-react-helmet",x3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E3=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},_3=(function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})(),lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S3=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Ol=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C3=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Wa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},R3=function(t){var n=Zn(t,ye.TITLE),r=Zn(t,kr.TITLE_TEMPLATE);if(r&&n)return r.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var o=Zn(t,kr.DEFAULT_TITLE);return n||o||void 0},A3=function(t){return Zn(t,kr.ON_CHANGE_CLIENT_STATE)||function(){}},ca=function(t,n){return n.filter(function(r){return typeof r[t]<"u"}).map(function(r){return r[t]}).reduce(function(r,o){return lt({},r,o)},{})},T3=function(t,n){return n.filter(function(r){return typeof r[ye.BASE]<"u"}).map(function(r){return r[ye.BASE]}).reverse().reduce(function(r,o){if(!r.length)for(var s=Object.keys(o),i=0;i<s.length;i++){var a=s[i],c=a.toLowerCase();if(t.indexOf(c)!==-1&&o[c])return r.concat(o)}return r},[])},vr=function(t,n,r){var o={};return r.filter(function(s){return Array.isArray(s[t])?!0:(typeof s[t]<"u"&&O3("Helmet: "+t+' should be of type "Array". Instead found type "'+x3(s[t])+'"'),!1)}).map(function(s){return s[t]}).reverse().reduce(function(s,i){var a={};i.filter(function(p){for(var h=void 0,y=Object.keys(p),m=0;m<y.length;m++){var v=y[m],b=v.toLowerCase();n.indexOf(b)!==-1&&!(h===Le.REL&&p[h].toLowerCase()==="canonical")&&!(b===Le.REL&&p[b].toLowerCase()==="stylesheet")&&(h=b),n.indexOf(v)!==-1&&(v===Le.INNER_HTML||v===Le.CSS_TEXT||v===Le.ITEM_PROP)&&(h=v)}if(!h||!p[h])return!1;var w=p[h].toLowerCase();return o[h]||(o[h]={}),a[h]||(a[h]={}),o[h][w]?!1:(a[h][w]=!0,!0)}).reverse().forEach(function(p){return s.push(p)});for(var c=Object.keys(a),l=0;l<c.length;l++){var f=c[l],d=y3({},o[f],a[f]);o[f]=d}return s},[]).reverse()},Zn=function(t,n){for(var r=t.length-1;r>=0;r--){var o=t[r];if(o.hasOwnProperty(n))return o[n]}return null},P3=function(t){return{baseTag:T3([Le.HREF,Le.TARGET],t),bodyAttributes:ca(wn.BODY,t),defer:Zn(t,kr.DEFER),encode:Zn(t,kr.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:ca(wn.HTML,t),linkTags:vr(ye.LINK,[Le.REL,Le.HREF],t),metaTags:vr(ye.META,[Le.NAME,Le.CHARSET,Le.HTTPEQUIV,Le.PROPERTY,Le.ITEM_PROP],t),noscriptTags:vr(ye.NOSCRIPT,[Le.INNER_HTML],t),onChangeClientState:A3(t),scriptTags:vr(ye.SCRIPT,[Le.SRC,Le.INNER_HTML],t),styleTags:vr(ye.STYLE,[Le.CSS_TEXT],t),title:R3(t),titleAttributes:ca(wn.TITLE,t)}},qa=(function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){qa(t)},0)}})(),Il=function(t){return clearTimeout(t)},M3=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||qa:global.requestAnimationFrame||qa,N3=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Il:global.cancelAnimationFrame||Il,O3=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},yr=null,I3=function(t){yr&&N3(yr),t.defer?yr=M3(function(){kl(t,function(){yr=null})}):(kl(t),yr=null)},kl=function(t,n){var r=t.baseTag,o=t.bodyAttributes,s=t.htmlAttributes,i=t.linkTags,a=t.metaTags,c=t.noscriptTags,l=t.onChangeClientState,f=t.scriptTags,d=t.styleTags,p=t.title,h=t.titleAttributes;Ka(ye.BODY,o),Ka(ye.HTML,s),k3(p,h);var y={baseTag:Fn(ye.BASE,r),linkTags:Fn(ye.LINK,i),metaTags:Fn(ye.META,a),noscriptTags:Fn(ye.NOSCRIPT,c),scriptTags:Fn(ye.SCRIPT,f),styleTags:Fn(ye.STYLE,d)},m={},v={};Object.keys(y).forEach(function(b){var w=y[b],_=w.newTags,S=w.oldTags;_.length&&(m[b]=_),S.length&&(v[b]=y[b].oldTags)}),n&&n(),l(t,m,v)},fp=function(t){return Array.isArray(t)?t.join(""):t},k3=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=fp(t)),Ka(ye.TITLE,n)},Ka=function(t,n){var r=document.getElementsByTagName(t)[0];if(r){for(var o=r.getAttribute(Tt),s=o?o.split(","):[],i=[].concat(s),a=Object.keys(n),c=0;c<a.length;c++){var l=a[c],f=n[l]||"";r.getAttribute(l)!==f&&r.setAttribute(l,f),s.indexOf(l)===-1&&s.push(l);var d=i.indexOf(l);d!==-1&&i.splice(d,1)}for(var p=i.length-1;p>=0;p--)r.removeAttribute(i[p]);s.length===i.length?r.removeAttribute(Tt):r.getAttribute(Tt)!==a.join(",")&&r.setAttribute(Tt,a.join(","))}},Fn=function(t,n){var r=document.head||document.querySelector(ye.HEAD),o=r.querySelectorAll(t+"["+Tt+"]"),s=Array.prototype.slice.call(o),i=[],a=void 0;return n&&n.length&&n.forEach(function(c){var l=document.createElement(t);for(var f in c)if(c.hasOwnProperty(f))if(f===Le.INNER_HTML)l.innerHTML=c.innerHTML;else if(f===Le.CSS_TEXT)l.styleSheet?l.styleSheet.cssText=c.cssText:l.appendChild(document.createTextNode(c.cssText));else{var d=typeof c[f]>"u"?"":c[f];l.setAttribute(f,d)}l.setAttribute(Tt,"true"),s.some(function(p,h){return a=h,l.isEqualNode(p)})?s.splice(a,1):i.push(l)}),s.forEach(function(c){return c.parentNode.removeChild(c)}),i.forEach(function(c){return r.appendChild(c)}),{oldTags:s,newTags:i}},hp=function(t){return Object.keys(t).reduce(function(n,r){var o=typeof t[r]<"u"?r+'="'+t[r]+'"':""+r;return n?n+" "+o:o},"")},D3=function(t,n,r,o){var s=hp(r),i=fp(n);return s?"<"+t+" "+Tt+'="true" '+s+">"+Wa(i,o)+"</"+t+">":"<"+t+" "+Tt+'="true">'+Wa(i,o)+"</"+t+">"},L3=function(t,n,r){return n.reduce(function(o,s){var i=Object.keys(s).filter(function(l){return!(l===Le.INNER_HTML||l===Le.CSS_TEXT)}).reduce(function(l,f){var d=typeof s[f]>"u"?f:f+'="'+Wa(s[f],r)+'"';return l?l+" "+d:d},""),a=s.innerHTML||s.cssText||"",c=w3.indexOf(t)===-1;return o+"<"+t+" "+Tt+'="true" '+i+(c?"/>":">"+a+"</"+t+">")},"")},pp=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[Go[o]||o]=t[o],r},n)},j3=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,o){return r[b3[o]||o]=t[o],r},n)},F3=function(t,n,r){var o,s=(o={key:n},o[Tt]=!0,o),i=pp(r,s);return[X.createElement(ye.TITLE,i,n)]},B3=function(t,n){return n.map(function(r,o){var s,i=(s={key:o},s[Tt]=!0,s);return Object.keys(r).forEach(function(a){var c=Go[a]||a;if(c===Le.INNER_HTML||c===Le.CSS_TEXT){var l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[c]=r[a]}),X.createElement(t,i)})},zt=function(t,n,r){switch(t){case ye.TITLE:return{toComponent:function(){return F3(t,n.title,n.titleAttributes)},toString:function(){return D3(t,n.title,n.titleAttributes,r)}};case wn.BODY:case wn.HTML:return{toComponent:function(){return pp(n)},toString:function(){return hp(n)}};default:return{toComponent:function(){return B3(t,n)},toString:function(){return L3(t,n,r)}}}},mp=function(t){var n=t.baseTag,r=t.bodyAttributes,o=t.encode,s=t.htmlAttributes,i=t.linkTags,a=t.metaTags,c=t.noscriptTags,l=t.scriptTags,f=t.styleTags,d=t.title,p=d===void 0?"":d,h=t.titleAttributes;return{base:zt(ye.BASE,n,o),bodyAttributes:zt(wn.BODY,r,o),htmlAttributes:zt(wn.HTML,s,o),link:zt(ye.LINK,i,o),meta:zt(ye.META,a,o),noscript:zt(ye.NOSCRIPT,c,o),script:zt(ye.SCRIPT,l,o),style:zt(ye.STYLE,f,o),title:zt(ye.TITLE,{title:p,titleAttributes:h},o)}},$3=function(t){var n,r;return r=n=(function(o){S3(s,o);function s(){return E3(this,s),C3(this,o.apply(this,arguments))}return s.prototype.shouldComponentUpdate=function(a){return!m3(this.props,a)},s.prototype.mapNestedChildrenToProps=function(a,c){if(!c)return null;switch(a.type){case ye.SCRIPT:case ye.NOSCRIPT:return{innerHTML:c};case ye.STYLE:return{cssText:c}}throw new Error("<"+a.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},s.prototype.flattenArrayTypeChildren=function(a){var c,l=a.child,f=a.arrayTypeChildren,d=a.newChildProps,p=a.nestedChildren;return lt({},f,(c={},c[l.type]=[].concat(f[l.type]||[],[lt({},d,this.mapNestedChildrenToProps(l,p))]),c))},s.prototype.mapObjectTypeChildren=function(a){var c,l,f=a.child,d=a.newProps,p=a.newChildProps,h=a.nestedChildren;switch(f.type){case ye.TITLE:return lt({},d,(c={},c[f.type]=h,c.titleAttributes=lt({},p),c));case ye.BODY:return lt({},d,{bodyAttributes:lt({},p)});case ye.HTML:return lt({},d,{htmlAttributes:lt({},p)})}return lt({},d,(l={},l[f.type]=lt({},p),l))},s.prototype.mapArrayTypeChildrenToProps=function(a,c){var l=lt({},c);return Object.keys(a).forEach(function(f){var d;l=lt({},l,(d={},d[f]=a[f],d))}),l},s.prototype.warnOnInvalidChildren=function(a,c){return!0},s.prototype.mapChildrenToProps=function(a,c){var l=this,f={};return X.Children.forEach(a,function(d){if(!(!d||!d.props)){var p=d.props,h=p.children,y=Ol(p,["children"]),m=j3(y);switch(l.warnOnInvalidChildren(d,h),d.type){case ye.LINK:case ye.META:case ye.NOSCRIPT:case ye.SCRIPT:case ye.STYLE:f=l.flattenArrayTypeChildren({child:d,arrayTypeChildren:f,newChildProps:m,nestedChildren:h});break;default:c=l.mapObjectTypeChildren({child:d,newProps:c,newChildProps:m,nestedChildren:h});break}}}),c=this.mapArrayTypeChildrenToProps(f,c),c},s.prototype.render=function(){var a=this.props,c=a.children,l=Ol(a,["children"]),f=lt({},l);return c&&(f=this.mapChildrenToProps(c,f)),X.createElement(t,f)},_3(s,null,[{key:"canUseDOM",set:function(a){t.canUseDOM=a}}]),s})(X.Component),n.propTypes={base:De.object,bodyAttributes:De.object,children:De.oneOfType([De.arrayOf(De.node),De.node]),defaultTitle:De.string,defer:De.bool,encodeSpecialCharacters:De.bool,htmlAttributes:De.object,link:De.arrayOf(De.object),meta:De.arrayOf(De.object),noscript:De.arrayOf(De.object),onChangeClientState:De.func,script:De.arrayOf(De.object),style:De.arrayOf(De.object),title:De.string,titleAttributes:De.object,titleTemplate:De.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var o=t.rewind();return o||(o=mp({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),o},r},H3=function(){return null},z3=f3(P3,I3,mp)(H3),Ga=$3(z3);Ga.renderStatic=Ga.rewind;function Dl(e,t){return t==null?g.jsx(Re,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:e}):typeof t=="string"||typeof t=="number"?g.jsx(Re,{as:"h1",variant:"heading",weight:"bold",tracking:"tighter",children:t}):g.jsx("div",{role:"heading","aria-level":1,children:t})}function Ll(e){return e==null?null:typeof e=="string"||typeof e=="number"?g.jsx(Re,{as:"p",variant:"meta",weight:"medium",tone:"tertiary",className:"mt-1",children:e}):g.jsx("div",{className:"mt-1",children:e})}function Ns({title:e,heading:t,variant:n="default",description:r,headerRight:o,children:s}){return g.jsxs(g.Fragment,{children:[g.jsx(Ga,{children:g.jsx("title",{children:e?`${e} | Ocean Brain`:"Ocean Brain"})}),n==="default"&&g.jsx("div",{className:"mb-5 border-b border-border-subtle/80 pb-4",children:g.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[g.jsxs("div",{children:[Dl(e,t),Ll(r)]}),o]})}),n==="subtle"&&g.jsx("div",{className:"mb-6",children:g.jsxs("div",{className:o?"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between":void 0,children:[g.jsxs("div",{children:[Dl(e,t),Ll(r)]}),o]})}),s]})}const U3=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},la=new Map;function V3(){const e=ds({select:n=>n.pathname}),t=u.useRef(null);return u.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,r=s=>{if(s!==0){la.set(e,s);return}la.delete(e)},o=U3(()=>{if(t.current){const{scrollTop:s}=n;r(s)}});return n.scrollTop=la.get(e)??0,n.addEventListener("scroll",o),()=>{n.removeEventListener("scroll",o)}}},[e]),g.jsx("div",{ref:t,className:"hidden"})}const Jr="/",gp="/views",Z3="/views/notes",vp="/calendar",yp="/reminders",bp="/graph",wp="/search",xp="/tag",or="/$id",Ep="/tag/$id",_p="/setting",W3="/setting/mcp",q3="/setting/trash",K3="/setting/manage-image",G3="/setting/manage-image/$id",Y3="/setting/placeholder",Q3="/setting/properties",Ya="An unexpected routing error occurred.",Sp=e=>typeof e=="object"&&e!==null&&"errors"in e&&Array.isArray(e.errors),X3=e=>e instanceof Error?e.message:Sp(e)?e.errors?.[0]?.message??Ya:Ya,J3=e=>{if(Sp(e))return e.errors?.[0]?.code};function rc({title:e,error:t,description:n,onRetry:r,showBackAction:o=!0,showHomeAction:s=!0}){const i=Pn(),a=it(),[c,l]=u.useState("idle"),f=X3(t),d=J3(t),p=async()=>{try{const h=[d,f].filter(Boolean).join(" :: ");await navigator.clipboard.writeText(h||Ya),l("copied")}catch{l("failed")}};return g.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[g.jsx(Re,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:e}),n&&g.jsx(Re,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:n}),g.jsxs(Re,{as:"div",variant:"body",tone:"secondary",className:"mt-4 rounded-[14px] border border-border-subtle bg-subtle px-3 py-2",children:[f,d&&g.jsxs(Re,{as:"span",variant:"body",weight:"bold",tone:"tertiary",className:"ml-2",children:["[",d,"]"]})]}),g.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r&&g.jsx(At,{size:"sm",onClick:r,children:"Try again"}),o&&g.jsx(At,{size:"sm",variant:"ghost",onClick:()=>a.history.back(),children:"Go back"}),s&&g.jsx(At,{size:"sm",variant:"ghost",onClick:()=>i({to:Jr,search:{page:1,limit:Ms,sortBy:"updatedAt",sortOrder:"desc",pinnedFirst:!1}}),children:"Go home"}),g.jsx(At,{size:"sm",variant:"ghost",onClick:p,children:c==="copied"?"Copied details":c==="failed"?"Copy failed":"Copy details"})]})]})}function Ge({title:e="Loading page",description:t="Preparing route resources."}){return g.jsx(Ns,{title:e,description:t,variant:"none",children:g.jsxs("div",{role:"status","aria-label":e,className:"flex flex-col gap-4",children:[g.jsx(Lt,{height:"56px"}),g.jsx(Lt,{height:"220px"}),g.jsx(Lt,{height:"160px"})]})})}function eE({error:e,reset:t}){return g.jsx(Ns,{title:"Something went wrong",variant:"none",children:g.jsx(rc,{title:"Route failed to render",description:"Retry the route or navigate somewhere safe.",error:e,onRetry:t})})}function tE(){return g.jsx(Ns,{title:"Not found",variant:"none",children:g.jsxs("div",{className:"rounded-[18px] border-2 border-border bg-surface p-6",children:[g.jsx(Re,{as:"p",variant:"heading",weight:"bold",tracking:"tighter",children:"This page does not exist."}),g.jsx(Re,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:"Check the URL or navigate from the sidebar."})]})})}const nE=(e=[],t=[])=>e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]));class rE extends u.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error!==null&&nE(t.resetKeys,this.props.resetKeys)&&this.resetErrorBoundary()}resetErrorBoundary=()=>{this.props.onReset?.(),this.setState({error:null})};render(){return this.state.error!==null?this.props.fallbackRender({error:this.state.error,resetErrorBoundary:this.resetErrorBoundary}):this.props.children}}function Cp({children:e,fallback:t,errorTitle:n,errorDescription:r,resetKeys:o,renderError:s}){return g.jsx(Yg,{children:({reset:i})=>g.jsx(rE,{onReset:i,resetKeys:o,fallbackRender:({error:a,resetErrorBoundary:c})=>s?s({error:a,retry:c}):g.jsx(rc,{title:n,description:r,error:a,onRetry:c}),children:g.jsx(u.Suspense,{fallback:t,children:e})})})}const jl=e=>{let t;const n=new Set,r=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},oE=(e=>e?jl(e):jl),sE=e=>e;function aE(e,t=sE){const n=X.useSyncExternalStore(e.subscribe,X.useCallback(()=>t(e.getState()),[e,t]),X.useCallback(()=>t(e.getInitialState()),[e,t]));return X.useDebugValue(n),n}const Fl=e=>{const t=oE(e),n=r=>aE(t,r);return Object.assign(n,t),n},iE=(e=>e?Fl(e):Fl),Rp="theme",Bl="(prefers-color-scheme: dark)";function cE(e){return e==="light"||e==="dark"}function lE(){return typeof document>"u"?null:document.documentElement}function Ap(){return typeof window>"u"?null:window.localStorage}function Tp(e){const t=lE();t&&(t.classList.remove("light","dark"),t.classList.add(e))}function Yo(){const e=Ap()?.getItem(Rp)??null;return cE(e)?e:null}function uE({storedTheme:e,systemPrefersDark:t}){return e||(t?"dark":"light")}function dE(e,t={}){Tp(e),t.persist!==!1&&Ap()?.setItem(Rp,e)}function fE(e={}){const t=e.matchMedia?e.matchMedia(Bl).matches:typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Bl).matches:!1,n=uE({storedTheme:Yo(),systemPrefersDark:t});return Tp(n),n}const $l=Yo(),Qo=iE(e=>({explicitTheme:$l,theme:$l??"light",setTheme:t=>{e({explicitTheme:t,theme:t})},setSystemTheme:t=>{e(n=>n.explicitTheme?n:{theme:t})},toggleTheme:()=>{e(t=>{const n=t.theme==="light"?"dark":"light";return{explicitTheme:n,theme:n}})}}));Qo.subscribe(e=>{dE(e.theme,{persist:e.explicitTheme===e.theme})});const hE=()=>null,pE="flex h-dvh min-h-0 w-full flex-row overflow-hidden",mE=xe("fixed","bottom-4","left-4","z-[1003]","flex","h-12","w-12","items-center","justify-center","rounded-[14px]","border","border-border-subtle","bg-surface","text-fg-secondary","shadow-[0_12px_24px_-18px_rgba(0,0,0,0.35)]","transition-all","hover:bg-hover-subtle","hover:text-fg-default","active:translate-y-px","aria-expanded:bg-hover-subtle","aria-expanded:text-fg-default"),gE=xe("fixed","z-[1002]","h-full","w-full","flex-[0_0_300px]","overflow-y-auto","border-r-0","border-border-subtle","bg-[var(--page-bg)]","pb-20","md:static","md:w-auto","md:translate-x-0","md:border-r","md:pb-0","md:pointer-events-auto"),vE="pointer-events-none -translate-x-full",yE="pointer-events-auto translate-x-0",bE=xe("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),wE=xe("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-md:after:content-['']","max-md:after:pointer-events-none","max-md:after:absolute","max-md:after:inset-y-0","max-md:after:right-0","max-md:after:w-12","max-md:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),xE=xe("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),EE=xe("min-h-0","min-w-0","max-w-full","flex-1","overflow-x-clip","px-4","pt-4","after:block","after:h-4","after:content-['']","max-md:after:h-24"),_E=({sidebar:e,topNavigation:t,children:n})=>{const r=ds({select:a=>a.pathname}),[o,s]=u.useState(!1),i="site-layout-sidebar";return u.useEffect(()=>{s(!1)},[r]),g.jsxs("div",{className:pE,children:[g.jsx("div",{className:"md:hidden",children:g.jsx("button",{type:"button",className:mE,"aria-label":"Toggle sidebar","aria-controls":i,"aria-expanded":o,onClick:()=>s(a=>!a),children:g.jsx(cy,{className:"h-6 w-6"})})}),g.jsx("aside",{id:i,className:xe(gE,o?yE:vE),children:e}),g.jsxs("main",{className:bE,children:[g.jsx("div",{className:wE,children:g.jsx("div",{className:xE,children:t})}),g.jsx("div",{className:EE,children:n}),g.jsx(V3,{})]})]})},SE=e=>({type:"error",category:"graphql",errors:e.map(t=>({code:t.extensions?.code??"GRAPHQL_ERROR",message:t.message??"GraphQL request failed",details:t}))}),CE=e=>{const t=Se.isAxiosError(e)?e.response?.data?.message??e.message??"Network request failed":"Network request failed",n=Se.isAxiosError(e)?e.code??(e.response?.status?`HTTP_${e.response.status}`:"NETWORK_ERROR"):"NETWORK_ERROR",r=Se.isAxiosError(e)?e.response?.data:void 0;return{type:"error",category:"network",errors:[{code:n,message:t,details:r}]}},RE={async execute(e){try{const{data:t}=await Se.post("/graphql",e);return t.errors&&t.errors.length>0?SE(t.errors):t.data?{type:"success",...t.data}:{type:"error",category:"graphql",errors:[{code:"EMPTY_RESPONSE",message:"GraphQL response data is empty",details:t}]}}catch(t){return CE(t)}}},AE={server:RE},TE=()=>AE.server;async function Pe(e,t,n){const r=typeof e=="string"?{query:e,variables:t,operationName:n}:e;return TE().execute(r)}const Pp=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",Mp=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),PE=async e=>{try{const t=await Pe(`
|
|
28
28
|
query GetServerCache($key: String!) {
|
|
29
29
|
cache(key: $key) {
|
|
30
30
|
value
|
|
@@ -339,4 +339,4 @@ __NOTE_ADDITIONAL_FIELDS__ id
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
`);if(n.type==="error")throw n;return n.pinnedNotes}});return g.jsx(g.Fragment,{children:e.render(t)})},NS="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-tertiary opacity-70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default hover:opacity-100 focus-visible:opacity-100 active:cursor-grabbing touch-none",OS="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",IS=(e,t,n)=>{if(t===n)return null;const r=e.findIndex(a=>a.id===t),o=e.findIndex(a=>a.id===n);if(r<0||o<0)return null;const s=[...e],[i]=s.splice(r,1);return i?(s.splice(o,0,i),{nextItems:s,orders:s.map((a,c)=>({id:a.id,order:c}))}):null};function kS({id:e,title:t,isActive:n=!1,children:r}){const{attributes:o,listeners:s,setNodeRef:i,setActivatorNodeRef:a,transform:c,transition:l,isDragging:f}=gS({id:e}),d={transform:jr.Transform.toString(c),transition:l,opacity:f?.5:1};return g.jsxs("div",{ref:i,style:d,className:xe("group flex min-h-[38px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n?"bg-hover-subtle":"hover:bg-hover-subtle/70"),children:[g.jsx("button",{type:"button",ref:a,"aria-label":`Reorder note ${t??"Untitled"}`,title:"Drag to reorder",...o,...s,className:xe(NS,f?"cursor-grabbing":"cursor-grab"),children:g.jsx(oy,{className:"size-4"})}),g.jsx(Re,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:r})]})}function DS({notes:e,pathname:t,pinnedItems:n,setPinnedItems:r,handleDragEnd:o,sensors:s}){u.useEffect(()=>{r(e)},[e,r]);const i=n.length>0?n:e;return i.length===0?null:g.jsx(K_,{sensors:s,collisionDetection:KE,onDragEnd:o,modifiers:[nS],children:g.jsx(lS,{items:i.map(a=>a.id),strategy:iS,children:i.map(a=>g.jsx(kS,{id:a.id,title:a.title||"Untitled",isActive:t===`/${a.id}`,children:g.jsx(Wt,{"aria-current":t===`/${a.id}`?"page":void 0,className:xe(OS,t===`/${a.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:or,params:{id:a.id},children:a.title||"Untitled"})},a.id))})})}const LS=()=>{const e=ds({select:a=>a.pathname}),t=er(),[n,r]=u.useState([]),o=s2({mutationFn:TS,onSuccess:()=>{t.invalidateQueries({queryKey:Me.notes.pinned(),exact:!0})}}),s=WE(zl(dc,{activationConstraint:{distance:8}}),zl(lc,{coordinateGetter:bS})),i=a=>{const{active:c,over:l}=a;l&&c.id!==l.id&&r(f=>{const d=IS(f,String(c.id),String(l.id));return d?(o.mutate(d.orders),d.nextItems):f})};return g.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:g.jsx(Cp,{fallback:g.jsxs("div",{className:"space-y-1",children:[g.jsx(Lt,{height:"40px",opacity:.4}),g.jsx(Lt,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:a,retry:c})=>g.jsx(rc,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:a,onRetry:c,showBackAction:!1,showHomeAction:!1}),children:g.jsx(MS,{render:a=>a.length>0?g.jsx(DS,{notes:a,pathname:e,pinnedItems:n,setPinnedItems:r,handleDragEnd:i,sensors:s}):g.jsx(Re,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note from the note toolbar to keep it here."})})})})},jS=()=>g.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:g.jsx(LS,{})});function yo(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pa={exports:{}};var tu;function FS(){return tu||(tu=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,s){function i(l,f){if(!o[l]){if(!r[l]){var d=typeof yo=="function"&&yo;if(!f&&d)return d(l,!0);if(a)return a(l,!0);var p=new Error("Cannot find module '"+l+"'");throw p.code="MODULE_NOT_FOUND",p}var h=o[l]={exports:{}};r[l][0].call(h.exports,function(y){var m=r[l][1][y];return i(m||y)},h,h.exports,n,r,o,s)}return o[l].exports}for(var a=typeof yo=="function"&&yo,c=0;c<s.length;c++)i(s[c]);return i})({1:[function(n,r,o){var s=n("./utils"),i=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(c){for(var l,f,d,p,h,y,m,v=[],b=0,w=c.length,_=w,S=s.getTypeOf(c)!=="string";b<c.length;)_=w-b,d=S?(l=c[b++],f=b<w?c[b++]:0,b<w?c[b++]:0):(l=c.charCodeAt(b++),f=b<w?c.charCodeAt(b++):0,b<w?c.charCodeAt(b++):0),p=l>>2,h=(3&l)<<4|f>>4,y=1<_?(15&f)<<2|d>>6:64,m=2<_?63&d:64,v.push(a.charAt(p)+a.charAt(h)+a.charAt(y)+a.charAt(m));return v.join("")},o.decode=function(c){var l,f,d,p,h,y,m=0,v=0,b="data:";if(c.substr(0,b.length)===b)throw new Error("Invalid base64 input, it looks like a data url.");var w,_=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===a.charAt(64)&&_--,c.charAt(c.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(w=i.uint8array?new Uint8Array(0|_):new Array(0|_);m<c.length;)l=a.indexOf(c.charAt(m++))<<2|(p=a.indexOf(c.charAt(m++)))>>4,f=(15&p)<<4|(h=a.indexOf(c.charAt(m++)))>>2,d=(3&h)<<6|(y=a.indexOf(c.charAt(m++))),w[v++]=l,h!==64&&(w[v++]=f),y!==64&&(w[v++]=d);return w}},{"./support":30,"./utils":32}],2:[function(n,r,o){var s=n("./external"),i=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function l(f,d,p,h,y){this.compressedSize=f,this.uncompressedSize=d,this.crc32=p,this.compression=h,this.compressedContent=y}l.prototype={getContentWorker:function(){var f=new i(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return f.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new i(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(f,d,p){return f.pipe(new a).pipe(new c("uncompressedSize")).pipe(d.compressWorker(p)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},r.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var s=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var s=n("./utils"),i=(function(){for(var a,c=[],l=0;l<256;l++){a=l;for(var f=0;f<8;f++)a=1&a?3988292384^a>>>1:a>>>1;c[l]=a}return c})();r.exports=function(a,c){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?(function(l,f,d,p){var h=i,y=p+d;l^=-1;for(var m=p;m<y;m++)l=l>>>8^h[255&(l^f[m])];return-1^l})(0|c,a,a.length,0):(function(l,f,d,p){var h=i,y=p+d;l^=-1;for(var m=p;m<y;m++)l=l>>>8^h[255&(l^f.charCodeAt(m))];return-1^l})(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),l=s?"uint8array":"array";function f(d,p){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(f,c),f.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(l,d.data),!1)},f.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(p){d.push({data:p,meta:d.meta})}},o.compressWorker=function(d){return new f("Deflate",d)},o.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function s(h,y){var m,v="";for(m=0;m<y;m++)v+=String.fromCharCode(255&h),h>>>=8;return v}function i(h,y,m,v,b,w){var _,S,C=h.file,O=h.compression,T=w!==l.utf8encode,P=a.transformTo("string",w(C.name)),N=a.transformTo("string",l.utf8encode(C.name)),F=C.comment,z=a.transformTo("string",w(F)),R=a.transformTo("string",l.utf8encode(F)),H=N.length!==C.name.length,x=R.length!==F.length,I="",$="",D="",q=C.dir,k=C.date,Y={crc32:0,compressedSize:0,uncompressedSize:0};y&&!m||(Y.crc32=h.crc32,Y.compressedSize=h.compressedSize,Y.uncompressedSize=h.uncompressedSize);var L=0;y&&(L|=8),T||!H&&!x||(L|=2048);var j=0,K=0;q&&(j|=16),b==="UNIX"?(K=798,j|=(function(Z,le){var te=Z;return Z||(te=le?16893:33204),(65535&te)<<16})(C.unixPermissions,q)):(K=20,j|=(function(Z){return 63&(Z||0)})(C.dosPermissions)),_=k.getUTCHours(),_<<=6,_|=k.getUTCMinutes(),_<<=5,_|=k.getUTCSeconds()/2,S=k.getUTCFullYear()-1980,S<<=4,S|=k.getUTCMonth()+1,S<<=5,S|=k.getUTCDate(),H&&($=s(1,1)+s(f(P),4)+N,I+="up"+s($.length,2)+$),x&&(D=s(1,1)+s(f(z),4)+R,I+="uc"+s(D.length,2)+D);var G="";return G+=`
|
|
342
|
-
\0`,G+=s(L,2),G+=O.magic,G+=s(_,2),G+=s(S,2),G+=s(Y.crc32,4),G+=s(Y.compressedSize,4),G+=s(Y.uncompressedSize,4),G+=s(P.length,2),G+=s(I.length,2),{fileRecord:d.LOCAL_FILE_HEADER+G+P+I,dirRecord:d.CENTRAL_FILE_HEADER+s(K,2)+G+s(z.length,2)+"\0\0\0\0"+s(j,4)+s(v,4)+P+I+z}}var a=n("../utils"),c=n("../stream/GenericWorker"),l=n("../utf8"),f=n("../crc32"),d=n("../signature");function p(h,y,m,v){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=m,this.encodeFileName=v,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,c),p.prototype.push=function(h){var y=h.meta.percent||0,m=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,c.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(y+100*(m-v-1))/m:100}}))},p.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var y=this.streamFiles&&!h.file.dir;if(y){var m=i(h,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(h){this.accumulate=!1;var y=this.streamFiles&&!h.file.dir,m=i(h,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),y)this.push({data:(function(v){return d.DATA_DESCRIPTOR+s(v.crc32,4)+s(v.compressedSize,4)+s(v.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var h=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var m=this.bytesWritten-h,v=(function(b,w,_,S,C){var O=a.transformTo("string",C(S));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(b,2)+s(b,2)+s(w,4)+s(_,4)+s(O.length,2)+O})(this.dirRecords.length,m,h,this.zipComment,this.encodeFileName);this.push({data:v,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(h){this._sources.push(h);var y=this;return h.on("data",function(m){y.processChunk(m)}),h.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),h.on("error",function(m){y.error(m)}),this},p.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(h){var y=this._sources;if(!c.prototype.error.call(this,h))return!1;for(var m=0;m<y.length;m++)try{y[m].error(h)}catch{}return!0},p.prototype.lock=function(){c.prototype.lock.call(this);for(var h=this._sources,y=0;y<h.length;y++)h[y].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var s=n("../compressions"),i=n("./ZipFileWorker");o.generateWorker=function(a,c,l){var f=new i(c.streamFiles,l,c.platform,c.encodeFileName),d=0;try{a.forEach(function(p,h){d++;var y=(function(w,_){var S=w||_,C=s[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(h.options.compression,c.compression),m=h.options.compressionOptions||c.compressionOptions||{},v=h.dir,b=h.date;h._compressWorker(y,m).withStreamInfo("file",{name:p,dir:v,date:b,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(f)}),f.entriesCount=d}catch(p){f.error(p)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new s;for(var a in this)typeof this[a]!="function"&&(i[a]=this[a]);return i}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(i,a){return new s().loadAsync(i,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var s=n("./utils"),i=n("./external"),a=n("./utf8"),c=n("./zipEntries"),l=n("./stream/Crc32Probe"),f=n("./nodejsUtils");function d(p){return new i.Promise(function(h,y){var m=p.decompressed.getContentWorker().pipe(new l);m.on("error",function(v){y(v)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}r.exports=function(p,h){var y=this;return h=s.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),f.isNode&&f.isStream(p)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,h.optimizedBinaryString,h.base64).then(function(m){var v=new c(h);return v.load(m),v}).then(function(m){var v=[i.Promise.resolve(m)],b=m.files;if(h.checkCRC32)for(var w=0;w<b.length;w++)v.push(d(b[w]));return i.Promise.all(v)}).then(function(m){for(var v=m.shift(),b=v.files,w=0;w<b.length;w++){var _=b[w],S=_.fileNameStr,C=s.resolve(_.fileNameStr);y.file(C,_.decompressed,{binary:!0,optimizedBinaryString:!0,date:_.date,dir:_.dir,comment:_.fileCommentStr.length?_.fileCommentStr:null,unixPermissions:_.unixPermissions,dosPermissions:_.dosPermissions,createFolders:h.createFolders}),_.dir||(y.file(C).unsafeOriginalName=S)}return v.zipComment.length&&(y.comment=v.zipComment),y})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var s=n("../utils"),i=n("../stream/GenericWorker");function a(c,l){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(l)}s.inherits(a,i),a.prototype._bindStream=function(c){var l=this;(this._stream=c).pause(),c.on("data",function(f){l.push({data:f,meta:{percent:0}})}).on("error",function(f){l.isPaused?this.generatedError=f:l.error(f)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var s=n("readable-stream").Readable;function i(a,c,l){s.call(this,c),this._helper=a;var f=this;a.on("data",function(d,p){f.push(d)||f._helper.pause(),l&&l(p)}).on("error",function(d){f.emit("error",d)}).on("end",function(){f.push(null)})}n("../utils").inherits(i,s),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,i);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,i)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var i=new Buffer(s);return i.fill(0),i},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,o){function s(C,O,T){var P,N=a.getTypeOf(O),F=a.extend(T||{},f);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(C=b(C)),F.createFolders&&(P=v(C))&&w.call(this,P,!0);var z=N==="string"&&F.binary===!1&&F.base64===!1;T&&T.binary!==void 0||(F.binary=!z),(O instanceof d&&O.uncompressedSize===0||F.dir||!O||O.length===0)&&(F.base64=!1,F.binary=!0,O="",F.compression="STORE",N="string");var R=null;R=O instanceof d||O instanceof c?O:y.isNode&&y.isStream(O)?new m(C,O):a.prepareContent(C,O,F.binary,F.optimizedBinaryString,F.base64);var H=new p(C,R,F);this.files[C]=H}var i=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),l=n("./stream/StreamHelper"),f=n("./defaults"),d=n("./compressedObject"),p=n("./zipObject"),h=n("./generate"),y=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),v=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var O=C.lastIndexOf("/");return 0<O?C.substring(0,O):""},b=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},w=function(C,O){return O=O!==void 0?O:f.createFolders,C=b(C),this.files[C]||s.call(this,C,null,{dir:!0,createFolders:O}),this.files[C]};function _(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var O,T,P;for(O in this.files)P=this.files[O],(T=O.slice(this.root.length,O.length))&&O.slice(0,this.root.length)===this.root&&C(T,P)},filter:function(C){var O=[];return this.forEach(function(T,P){C(T,P)&&O.push(P)}),O},file:function(C,O,T){if(arguments.length!==1)return C=this.root+C,s.call(this,C,O,T),this;if(_(C)){var P=C;return this.filter(function(F,z){return!z.dir&&P.test(F)})}var N=this.files[this.root+C];return N&&!N.dir?N:null},folder:function(C){if(!C)return this;if(_(C))return this.filter(function(N,F){return F.dir&&C.test(N)});var O=this.root+C,T=w.call(this,O),P=this.clone();return P.root=T.name,P},remove:function(C){C=this.root+C;var O=this.files[C];if(O||(C.slice(-1)!=="/"&&(C+="/"),O=this.files[C]),O&&!O.dir)delete this.files[C];else for(var T=this.filter(function(N,F){return F.name.slice(0,C.length)===C}),P=0;P<T.length;P++)delete this.files[T[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var O,T={};try{if((T=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=T.type.toLowerCase(),T.compression=T.compression.toUpperCase(),T.type==="binarystring"&&(T.type="string"),!T.type)throw new Error("No output type specified.");a.checkSupport(T.type),T.platform!=="darwin"&&T.platform!=="freebsd"&&T.platform!=="linux"&&T.platform!=="sunos"||(T.platform="UNIX"),T.platform==="win32"&&(T.platform="DOS");var P=T.comment||this.comment||"";O=h.generateWorker(this,T,P)}catch(N){(O=new c("error")).error(N)}return new l(O,T.type||"string",T.mimeType)},generateAsync:function(C,O){return this.generateInternalStream(C).accumulate(O)},generateNodeStream:function(C,O){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(O)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data[this.zero+a]},i.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),l=a.charCodeAt(1),f=a.charCodeAt(2),d=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===l&&this.data[p+2]===f&&this.data[p+3]===d)return p-this.zero;return-1},i.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),l=a.charCodeAt(1),f=a.charCodeAt(2),d=a.charCodeAt(3),p=this.readData(4);return c===p[0]&&l===p[1]&&f===p[2]&&d===p[3]},i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var s=n("../utils");function i(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,l=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)l=(l<<8)+this.byteAt(c);return this.index+=a,l},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=i},{"../utils":32}],19:[function(n,r,o){var s=n("./Uint8ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var s=n("./ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var s=n("../utils"),i=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),l=n("./NodeBufferReader"),f=n("./Uint8ArrayReader");r.exports=function(d){var p=s.getTypeOf(d);return s.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new l(d):i.uint8array?new f(s.transformTo("uint8array",d)):new a(s.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var s=n("./GenericWorker"),i=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var s=n("./GenericWorker"),i=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,i),a.prototype.processChunk=function(c){if(c){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(f){l.dataIsReady=!0,l.data=f,l.max=f&&f.length||0,l.type=s.getTypeOf(f),l.isPaused||l._tickAndRepeat()},function(f){l.error(f)})}s.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,l);break;case"uint8array":c=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":c=this.data.slice(this.index,l)}return this.index=l,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function s(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,a)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var a=this;return i.on("data",function(c){a.processChunk(c)}),i.on("end",function(){a.end()}),i.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,a){return this.extraStreamInfo[i]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=s},{}],29:[function(n,r,o){var s=n("../utils"),i=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),l=n("../support"),f=n("../external"),d=null;if(l.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,m){return new f.Promise(function(v,b){var w=[],_=y._internalType,S=y._outputType,C=y._mimeType;y.on("data",function(O,T){w.push(O),m&&m(T)}).on("error",function(O){w=[],b(O)}).on("end",function(){try{var O=(function(T,P,N){switch(T){case"blob":return s.newBlob(s.transformTo("arraybuffer",P),N);case"base64":return c.encode(P);default:return s.transformTo(T,P)}})(S,(function(T,P){var N,F=0,z=null,R=0;for(N=0;N<P.length;N++)R+=P[N].length;switch(T){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(z=new Uint8Array(R),N=0;N<P.length;N++)z.set(P[N],F),F+=P[N].length;return z;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+T+"'")}})(_,w),C);v(O)}catch(T){b(T)}w=[]}).resume()})}function h(y,m,v){var b=m;switch(m){case"blob":case"arraybuffer":b="uint8array";break;case"base64":b="string"}try{this._internalType=b,this._outputType=m,this._mimeType=v,s.checkSupport(b),this._worker=y.pipe(new i(b)),y.lock()}catch(w){this._worker=new a("error"),this._worker.error(w)}}h.prototype={accumulate:function(y){return p(this,y)},on:function(y,m){var v=this;return y==="data"?this._worker.on(y,function(b){m.call(v,b.data,b.meta)}):this._worker.on(y,function(){s.delay(m,arguments,v)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},y)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var s=new ArrayBuffer(0);try{o.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(s),o.blob=i.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var s=n("./utils"),i=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),l=new Array(256),f=0;f<256;f++)l[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;l[254]=l[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}o.utf8encode=function(h){return i.nodebuffer?a.newBufferFrom(h,"utf-8"):(function(y){var m,v,b,w,_,S=y.length,C=0;for(w=0;w<S;w++)(64512&(v=y.charCodeAt(w)))==55296&&w+1<S&&(64512&(b=y.charCodeAt(w+1)))==56320&&(v=65536+(v-55296<<10)+(b-56320),w++),C+=v<128?1:v<2048?2:v<65536?3:4;for(m=i.uint8array?new Uint8Array(C):new Array(C),w=_=0;_<C;w++)(64512&(v=y.charCodeAt(w)))==55296&&w+1<S&&(64512&(b=y.charCodeAt(w+1)))==56320&&(v=65536+(v-55296<<10)+(b-56320),w++),v<128?m[_++]=v:(v<2048?m[_++]=192|v>>>6:(v<65536?m[_++]=224|v>>>12:(m[_++]=240|v>>>18,m[_++]=128|v>>>12&63),m[_++]=128|v>>>6&63),m[_++]=128|63&v);return m})(h)},o.utf8decode=function(h){return i.nodebuffer?s.transformTo("nodebuffer",h).toString("utf-8"):(function(y){var m,v,b,w,_=y.length,S=new Array(2*_);for(m=v=0;m<_;)if((b=y[m++])<128)S[v++]=b;else if(4<(w=l[b]))S[v++]=65533,m+=w-1;else{for(b&=w===2?31:w===3?15:7;1<w&&m<_;)b=b<<6|63&y[m++],w--;1<w?S[v++]=65533:b<65536?S[v++]=b:(b-=65536,S[v++]=55296|b>>10&1023,S[v++]=56320|1023&b)}return S.length!==v&&(S.subarray?S=S.subarray(0,v):S.length=v),s.applyFromCharCode(S)})(h=s.transformTo(i.uint8array?"uint8array":"array",h))},s.inherits(d,c),d.prototype.processChunk=function(h){var y=s.transformTo(i.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=y;(y=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),y.set(m,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var v=(function(w,_){var S;for((_=_||w.length)>w.length&&(_=w.length),S=_-1;0<=S&&(192&w[S])==128;)S--;return S<0||S===0?_:S+l[w[S]]>_?S:_})(y),b=y;v!==y.length&&(i.uint8array?(b=y.subarray(0,v),this.leftOver=y.subarray(v,y.length)):(b=y.slice(0,v),this.leftOver=y.slice(v,y.length))),this.push({data:o.utf8decode(b),meta:h.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=d,s.inherits(p,c),p.prototype.processChunk=function(h){this.push({data:o.utf8encode(h.data),meta:h.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var s=n("./support"),i=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function l(m){return m}function f(m,v){for(var b=0;b<m.length;++b)v[b]=255&m.charCodeAt(b);return v}n("setimmediate"),o.newBlob=function(m,v){o.checkSupport("blob");try{return new Blob([m],{type:v})}catch{try{var b=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return b.append(m),b.getBlob(v)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(m,v,b){var w=[],_=0,S=m.length;if(S<=b)return String.fromCharCode.apply(null,m);for(;_<S;)v==="array"||v==="nodebuffer"?w.push(String.fromCharCode.apply(null,m.slice(_,Math.min(_+b,S)))):w.push(String.fromCharCode.apply(null,m.subarray(_,Math.min(_+b,S)))),_+=b;return w.join("")},stringifyByChar:function(m){for(var v="",b=0;b<m.length;b++)v+=String.fromCharCode(m[b]);return v},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var v=65536,b=o.getTypeOf(m),w=!0;if(b==="uint8array"?w=d.applyCanBeUsed.uint8array:b==="nodebuffer"&&(w=d.applyCanBeUsed.nodebuffer),w)for(;1<v;)try{return d.stringifyByChunk(m,b,v)}catch{v=Math.floor(v/2)}return d.stringifyByChar(m)}function h(m,v){for(var b=0;b<m.length;b++)v[b]=m[b];return v}o.applyFromCharCode=p;var y={};y.string={string:l,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return y.string.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:function(m){return f(m,a.allocBuffer(m.length))}},y.array={string:p,array:l,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},y.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return h(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:l,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},y.uint8array={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:l,nodebuffer:function(m){return a.newBufferFrom(m)}},y.nodebuffer={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return y.nodebuffer.uint8array(m).buffer},uint8array:function(m){return h(m,new Uint8Array(m.length))},nodebuffer:l},o.transformTo=function(m,v){if(v=v||"",!m)return v;o.checkSupport(m);var b=o.getTypeOf(v);return y[b][m](v)},o.resolve=function(m){for(var v=m.split("/"),b=[],w=0;w<v.length;w++){var _=v[w];_==="."||_===""&&w!==0&&w!==v.length-1||(_===".."?b.pop():b.push(_))}return b.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(m)?"nodebuffer":s.uint8array&&m instanceof Uint8Array?"uint8array":s.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!s[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var v,b,w="";for(b=0;b<(m||"").length;b++)w+="\\x"+((v=m.charCodeAt(b))<16?"0":"")+v.toString(16).toUpperCase();return w},o.delay=function(m,v,b){setImmediate(function(){m.apply(b||null,v||[])})},o.inherits=function(m,v){function b(){}b.prototype=v.prototype,m.prototype=new b},o.extend=function(){var m,v,b={};for(m=0;m<arguments.length;m++)for(v in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],v)&&b[v]===void 0&&(b[v]=arguments[m][v]);return b},o.prepareContent=function(m,v,b,w,_){return c.Promise.resolve(v).then(function(S){return s.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new c.Promise(function(C,O){var T=new FileReader;T.onload=function(P){C(P.target.result)},T.onerror=function(P){O(P.target.error)},T.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(_?S=i.decode(S):b&&w!==!0&&(S=(function(O){return f(O,s.uint8array?new Uint8Array(O.length):new Array(O.length))})(S))),S):c.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./signature"),c=n("./zipEntry"),l=n("./support");function f(d){this.files=[],this.loadOptions=d}f.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(p)+", expected "+i.pretty(d)+")")}},isSignature:function(d,p){var h=this.reader.index;this.reader.setIndex(d);var y=this.reader.readString(4)===p;return this.reader.setIndex(h),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),p=l.uint8array?"uint8array":"array",h=i.transformTo(p,d);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,p,h,y=this.zip64EndOfCentralSize-44;0<y;)d=this.reader.readInt(2),p=this.reader.readInt(4),h=this.reader.readData(p),this.zip64ExtensibleData[d]={id:d,length:p,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,p;for(d=0;d<this.files.length;d++)p=this.files[d],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var p=d;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var y=p-h;if(0<y)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=f},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),l=n("./utf8"),f=n("./compressions"),d=n("./support");function p(h,y){this.options=h,this.loadOptions=y}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var y,m;if(h.skip(22),this.fileNameLength=h.readInt(2),m=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((y=(function(v){for(var b in f)if(Object.prototype.hasOwnProperty.call(f,b)&&f[b].magic===v)return f[b];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,y,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var y=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(y),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=s(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var y,m,v,b=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<b;)y=h.readInt(2),m=h.readInt(2),v=h.readData(m),this.extraFields[y]={id:y,length:m,value:v};h.setIndex(b)},handleUTF8:function(){var h=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var m=i.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var v=this.findExtraFieldUnicodeComment();if(v!==null)this.fileCommentStr=v;else{var b=i.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(b)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var y=s(h.value);return y.readInt(1)!==1||c(this.fileName)!==y.readInt(4)?null:l.utf8decode(y.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var y=s(h.value);return y.readInt(1)!==1||c(this.fileComment)!==y.readInt(4)?null:l.utf8decode(y.readData(h.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function s(y,m,v){this.name=y,this.dir=v.dir,this.date=v.date,this.comment=v.comment,this.unixPermissions=v.unixPermissions,this.dosPermissions=v.dosPermissions,this._data=m,this._dataBinary=v.binary,this.options={compression:v.compression,compressionOptions:v.compressionOptions}}var i=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),l=n("./compressedObject"),f=n("./stream/GenericWorker");s.prototype={internalStream:function(y){var m=null,v="string";try{if(!y)throw new Error("No output type specified.");var b=(v=y.toLowerCase())==="string"||v==="text";v!=="binarystring"&&v!=="text"||(v="string"),m=this._decompressWorker();var w=!this._dataBinary;w&&!b&&(m=m.pipe(new c.Utf8EncodeWorker)),!w&&b&&(m=m.pipe(new c.Utf8DecodeWorker))}catch(_){(m=new f("error")).error(_)}return new i(m,v,"")},async:function(y,m){return this.internalStream(y).accumulate(m)},nodeStream:function(y,m){return this.internalStream(y||"nodebuffer").toNodejsStream(m)},_compressWorker:function(y,m){if(this._data instanceof l&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var v=this._decompressWorker();return this._dataBinary||(v=v.pipe(new c.Utf8EncodeWorker)),l.createWorkerFrom(v,y,m)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof f?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<d.length;h++)s.prototype[d[h]]=p;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(s){var i,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var l=0,f=new c(y),d=s.document.createTextNode("");f.observe(d,{characterData:!0}),i=function(){d.data=l=++l%2}}else if(s.setImmediate||s.MessageChannel===void 0)i="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var m=s.document.createElement("script");m.onreadystatechange=function(){y(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},s.document.documentElement.appendChild(m)}:function(){setTimeout(y,0)};else{var p=new s.MessageChannel;p.port1.onmessage=y,i=function(){p.port2.postMessage(0)}}var h=[];function y(){var m,v;a=!0;for(var b=h.length;b;){for(v=h,h=[],m=-1;++m<b;)v[m]();b=h.length}a=!1}r.exports=function(m){h.push(m)!==1||a||i()}}).call(this,typeof ro<"u"?ro:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var s=n("immediate");function i(){}var a={},c=["REJECTED"],l=["FULFILLED"],f=["PENDING"];function d(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,b!==i&&m(this,b)}function p(b,w,_){this.promise=b,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}function h(b,w,_){s(function(){var S;try{S=w(_)}catch(C){return a.reject(b,C)}S===b?a.reject(b,new TypeError("Cannot resolve promise with itself")):a.resolve(b,S)})}function y(b){var w=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof w=="function")return function(){w.apply(b,arguments)}}function m(b,w){var _=!1;function S(T){_||(_=!0,a.reject(b,T))}function C(T){_||(_=!0,a.resolve(b,T))}var O=v(function(){w(C,S)});O.status==="error"&&S(O.value)}function v(b,w){var _={};try{_.value=b(w),_.status="success"}catch(S){_.status="error",_.value=S}return _}(r.exports=d).prototype.finally=function(b){if(typeof b!="function")return this;var w=this.constructor;return this.then(function(_){return w.resolve(b()).then(function(){return _})},function(_){return w.resolve(b()).then(function(){throw _})})},d.prototype.catch=function(b){return this.then(null,b)},d.prototype.then=function(b,w){if(typeof b!="function"&&this.state===l||typeof w!="function"&&this.state===c)return this;var _=new this.constructor(i);return this.state!==f?h(_,this.state===l?b:w,this.outcome):this.queue.push(new p(_,b,w)),_},p.prototype.callFulfilled=function(b){a.resolve(this.promise,b)},p.prototype.otherCallFulfilled=function(b){h(this.promise,this.onFulfilled,b)},p.prototype.callRejected=function(b){a.reject(this.promise,b)},p.prototype.otherCallRejected=function(b){h(this.promise,this.onRejected,b)},a.resolve=function(b,w){var _=v(y,w);if(_.status==="error")return a.reject(b,_.value);var S=_.value;if(S)m(b,S);else{b.state=l,b.outcome=w;for(var C=-1,O=b.queue.length;++C<O;)b.queue[C].callFulfilled(w)}return b},a.reject=function(b,w){b.state=c,b.outcome=w;for(var _=-1,S=b.queue.length;++_<S;)b.queue[_].callRejected(w);return b},d.resolve=function(b){return b instanceof this?b:a.resolve(new this(i),b)},d.reject=function(b){var w=new this(i);return a.reject(w,b)},d.all=function(b){var w=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=b.length,S=!1;if(!_)return this.resolve([]);for(var C=new Array(_),O=0,T=-1,P=new this(i);++T<_;)N(b[T],T);return P;function N(F,z){w.resolve(F).then(function(R){C[z]=R,++O!==_||S||(S=!0,a.resolve(P,C))},function(R){S||(S=!0,a.reject(P,R))})}},d.race=function(b){var w=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=b.length,S=!1;if(!_)return this.resolve([]);for(var C=-1,O=new this(i);++C<_;)T=b[C],w.resolve(T).then(function(P){S||(S=!0,a.resolve(O,P))},function(P){S||(S=!0,a.reject(O,P))});var T;return O}},{immediate:36}],38:[function(n,r,o){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var s=n("./zlib/deflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),l=n("./zlib/zstream"),f=Object.prototype.toString,d=0,p=-1,h=0,y=8;function m(b){if(!(this instanceof m))return new m(b);this.options=i.assign({level:p,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},b||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var _=s.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(_!==d)throw new Error(c[_]);if(w.header&&s.deflateSetHeader(this.strm,w.header),w.dictionary){var S;if(S=typeof w.dictionary=="string"?a.string2buf(w.dictionary):f.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(_=s.deflateSetDictionary(this.strm,S))!==d)throw new Error(c[_]);this._dict_set=!0}}function v(b,w){var _=new m(w);if(_.push(b,!0),_.err)throw _.msg||c[_.err];return _.result}m.prototype.push=function(b,w){var _,S,C=this.strm,O=this.options.chunkSize;if(this.ended)return!1;S=w===~~w?w:w===!0?4:0,typeof b=="string"?C.input=a.string2buf(b):f.call(b)==="[object ArrayBuffer]"?C.input=new Uint8Array(b):C.input=b,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new i.Buf8(O),C.next_out=0,C.avail_out=O),(_=s.deflate(C,S))!==1&&_!==d)return this.onEnd(_),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(i.shrinkBuf(C.output,C.next_out))):this.onData(i.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&_!==1);return S===4?(_=s.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===d):S!==2||(this.onEnd(d),!(C.avail_out=0))},m.prototype.onData=function(b){this.chunks.push(b)},m.prototype.onEnd=function(b){b===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},o.Deflate=m,o.deflate=v,o.deflateRaw=function(b,w){return(w=w||{}).raw=!0,v(b,w)},o.gzip=function(b,w){return(w=w||{}).gzip=!0,v(b,w)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var s=n("./zlib/inflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),l=n("./zlib/messages"),f=n("./zlib/zstream"),d=n("./zlib/gzheader"),p=Object.prototype.toString;function h(m){if(!(this instanceof h))return new h(m);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},m||{});var v=this.options;v.raw&&0<=v.windowBits&&v.windowBits<16&&(v.windowBits=-v.windowBits,v.windowBits===0&&(v.windowBits=-15)),!(0<=v.windowBits&&v.windowBits<16)||m&&m.windowBits||(v.windowBits+=32),15<v.windowBits&&v.windowBits<48&&(15&v.windowBits)==0&&(v.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var b=s.inflateInit2(this.strm,v.windowBits);if(b!==c.Z_OK)throw new Error(l[b]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function y(m,v){var b=new h(v);if(b.push(m,!0),b.err)throw b.msg||l[b.err];return b.result}h.prototype.push=function(m,v){var b,w,_,S,C,O,T=this.strm,P=this.options.chunkSize,N=this.options.dictionary,F=!1;if(this.ended)return!1;w=v===~~v?v:v===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof m=="string"?T.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?T.input=new Uint8Array(m):T.input=m,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new i.Buf8(P),T.next_out=0,T.avail_out=P),(b=s.inflate(T,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&N&&(O=typeof N=="string"?a.string2buf(N):p.call(N)==="[object ArrayBuffer]"?new Uint8Array(N):N,b=s.inflateSetDictionary(this.strm,O)),b===c.Z_BUF_ERROR&&F===!0&&(b=c.Z_OK,F=!1),b!==c.Z_STREAM_END&&b!==c.Z_OK)return this.onEnd(b),!(this.ended=!0);T.next_out&&(T.avail_out!==0&&b!==c.Z_STREAM_END&&(T.avail_in!==0||w!==c.Z_FINISH&&w!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(_=a.utf8border(T.output,T.next_out),S=T.next_out-_,C=a.buf2string(T.output,_),T.next_out=S,T.avail_out=P-S,S&&i.arraySet(T.output,T.output,_,S,0),this.onData(C)):this.onData(i.shrinkBuf(T.output,T.next_out)))),T.avail_in===0&&T.avail_out===0&&(F=!0)}while((0<T.avail_in||T.avail_out===0)&&b!==c.Z_STREAM_END);return b===c.Z_STREAM_END&&(w=c.Z_FINISH),w===c.Z_FINISH?(b=s.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===c.Z_OK):w!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(T.avail_out=0))},h.prototype.onData=function(m){this.chunks.push(m)},h.prototype.onEnd=function(m){m===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=h,o.inflate=y,o.inflateRaw=function(m,v){return(v=v||{}).raw=!0,y(m,v)},o.ungzip=y},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(c){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var f=l.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var d in f)f.hasOwnProperty(d)&&(c[d]=f[d])}}return c},o.shrinkBuf=function(c,l){return c.length===l?c:c.subarray?c.subarray(0,l):(c.length=l,c)};var i={arraySet:function(c,l,f,d,p){if(l.subarray&&c.subarray)c.set(l.subarray(f,f+d),p);else for(var h=0;h<d;h++)c[p+h]=l[f+h]},flattenChunks:function(c){var l,f,d,p,h,y;for(l=d=0,f=c.length;l<f;l++)d+=c[l].length;for(y=new Uint8Array(d),l=p=0,f=c.length;l<f;l++)h=c[l],y.set(h,p),p+=h.length;return y}},a={arraySet:function(c,l,f,d,p){for(var h=0;h<d;h++)c[p+h]=l[f+h]},flattenChunks:function(c){return[].concat.apply([],c)}};o.setTyped=function(c){c?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,i)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(s)},{}],42:[function(n,r,o){var s=n("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),l=0;l<256;l++)c[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function f(d,p){if(p<65537&&(d.subarray&&a||!d.subarray&&i))return String.fromCharCode.apply(null,s.shrinkBuf(d,p));for(var h="",y=0;y<p;y++)h+=String.fromCharCode(d[y]);return h}c[254]=c[254]=1,o.string2buf=function(d){var p,h,y,m,v,b=d.length,w=0;for(m=0;m<b;m++)(64512&(h=d.charCodeAt(m)))==55296&&m+1<b&&(64512&(y=d.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(y-56320),m++),w+=h<128?1:h<2048?2:h<65536?3:4;for(p=new s.Buf8(w),m=v=0;v<w;m++)(64512&(h=d.charCodeAt(m)))==55296&&m+1<b&&(64512&(y=d.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(y-56320),m++),h<128?p[v++]=h:(h<2048?p[v++]=192|h>>>6:(h<65536?p[v++]=224|h>>>12:(p[v++]=240|h>>>18,p[v++]=128|h>>>12&63),p[v++]=128|h>>>6&63),p[v++]=128|63&h);return p},o.buf2binstring=function(d){return f(d,d.length)},o.binstring2buf=function(d){for(var p=new s.Buf8(d.length),h=0,y=p.length;h<y;h++)p[h]=d.charCodeAt(h);return p},o.buf2string=function(d,p){var h,y,m,v,b=p||d.length,w=new Array(2*b);for(h=y=0;h<b;)if((m=d[h++])<128)w[y++]=m;else if(4<(v=c[m]))w[y++]=65533,h+=v-1;else{for(m&=v===2?31:v===3?15:7;1<v&&h<b;)m=m<<6|63&d[h++],v--;1<v?w[y++]=65533:m<65536?w[y++]=m:(m-=65536,w[y++]=55296|m>>10&1023,w[y++]=56320|1023&m)}return f(w,y)},o.utf8border=function(d,p){var h;for((p=p||d.length)>d.length&&(p=d.length),h=p-1;0<=h&&(192&d[h])==128;)h--;return h<0||h===0?p:h+c[d[h]]>p?h:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(s,i,a,c){for(var l=65535&s|0,f=s>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;f=f+(l=l+i[c++]|0)|0,--d;);l%=65521,f%=65521}return l|f<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var s=(function(){for(var i,a=[],c=0;c<256;c++){i=c;for(var l=0;l<8;l++)i=1&i?3988292384^i>>>1:i>>>1;a[c]=i}return a})();r.exports=function(i,a,c,l){var f=s,d=l+c;i^=-1;for(var p=l;p<d;p++)i=i>>>8^f[255&(i^a[p])];return-1^i}},{}],46:[function(n,r,o){var s,i=n("../utils/common"),a=n("./trees"),c=n("./adler32"),l=n("./crc32"),f=n("./messages"),d=0,p=4,h=0,y=-2,m=-1,v=4,b=2,w=8,_=9,S=286,C=30,O=19,T=2*S+1,P=15,N=3,F=258,z=F+N+1,R=42,H=113,x=1,I=2,$=3,D=4;function q(E,J){return E.msg=f[J],J}function k(E){return(E<<1)-(4<E?9:0)}function Y(E){for(var J=E.length;0<=--J;)E[J]=0}function L(E){var J=E.state,W=J.pending;W>E.avail_out&&(W=E.avail_out),W!==0&&(i.arraySet(E.output,J.pending_buf,J.pending_out,W,E.next_out),E.next_out+=W,J.pending_out+=W,E.total_out+=W,E.avail_out-=W,J.pending-=W,J.pending===0&&(J.pending_out=0))}function j(E,J){a._tr_flush_block(E,0<=E.block_start?E.block_start:-1,E.strstart-E.block_start,J),E.block_start=E.strstart,L(E.strm)}function K(E,J){E.pending_buf[E.pending++]=J}function G(E,J){E.pending_buf[E.pending++]=J>>>8&255,E.pending_buf[E.pending++]=255&J}function Z(E,J){var W,M,A=E.max_chain_length,B=E.strstart,ee=E.prev_length,ne=E.nice_match,U=E.strstart>E.w_size-z?E.strstart-(E.w_size-z):0,oe=E.window,ue=E.w_mask,se=E.prev,ae=E.strstart+F,ge=oe[B+ee-1],pe=oe[B+ee];E.prev_length>=E.good_match&&(A>>=2),ne>E.lookahead&&(ne=E.lookahead);do if(oe[(W=J)+ee]===pe&&oe[W+ee-1]===ge&&oe[W]===oe[B]&&oe[++W]===oe[B+1]){B+=2,W++;do;while(oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&B<ae);if(M=F-(ae-B),B=ae-F,ee<M){if(E.match_start=J,ne<=(ee=M))break;ge=oe[B+ee-1],pe=oe[B+ee]}}while((J=se[J&ue])>U&&--A!=0);return ee<=E.lookahead?ee:E.lookahead}function le(E){var J,W,M,A,B,ee,ne,U,oe,ue,se=E.w_size;do{if(A=E.window_size-E.lookahead-E.strstart,E.strstart>=se+(se-z)){for(i.arraySet(E.window,E.window,se,se,0),E.match_start-=se,E.strstart-=se,E.block_start-=se,J=W=E.hash_size;M=E.head[--J],E.head[J]=se<=M?M-se:0,--W;);for(J=W=se;M=E.prev[--J],E.prev[J]=se<=M?M-se:0,--W;);A+=se}if(E.strm.avail_in===0)break;if(ee=E.strm,ne=E.window,U=E.strstart+E.lookahead,oe=A,ue=void 0,ue=ee.avail_in,oe<ue&&(ue=oe),W=ue===0?0:(ee.avail_in-=ue,i.arraySet(ne,ee.input,ee.next_in,ue,U),ee.state.wrap===1?ee.adler=c(ee.adler,ne,ue,U):ee.state.wrap===2&&(ee.adler=l(ee.adler,ne,ue,U)),ee.next_in+=ue,ee.total_in+=ue,ue),E.lookahead+=W,E.lookahead+E.insert>=N)for(B=E.strstart-E.insert,E.ins_h=E.window[B],E.ins_h=(E.ins_h<<E.hash_shift^E.window[B+1])&E.hash_mask;E.insert&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[B+N-1])&E.hash_mask,E.prev[B&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=B,B++,E.insert--,!(E.lookahead+E.insert<N)););}while(E.lookahead<z&&E.strm.avail_in!==0)}function te(E,J){for(var W,M;;){if(E.lookahead<z){if(le(E),E.lookahead<z&&J===d)return x;if(E.lookahead===0)break}if(W=0,E.lookahead>=N&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),W!==0&&E.strstart-W<=E.w_size-z&&(E.match_length=Z(E,W)),E.match_length>=N)if(M=a._tr_tally(E,E.strstart-E.match_start,E.match_length-N),E.lookahead-=E.match_length,E.match_length<=E.max_lazy_match&&E.lookahead>=N){for(E.match_length--;E.strstart++,E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart,--E.match_length!=0;);E.strstart++}else E.strstart+=E.match_length,E.match_length=0,E.ins_h=E.window[E.strstart],E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+1])&E.hash_mask;else M=a._tr_tally(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++;if(M&&(j(E,!1),E.strm.avail_out===0))return x}return E.insert=E.strstart<N-1?E.strstart:N-1,J===p?(j(E,!0),E.strm.avail_out===0?$:D):E.last_lit&&(j(E,!1),E.strm.avail_out===0)?x:I}function Q(E,J){for(var W,M,A;;){if(E.lookahead<z){if(le(E),E.lookahead<z&&J===d)return x;if(E.lookahead===0)break}if(W=0,E.lookahead>=N&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),E.prev_length=E.match_length,E.prev_match=E.match_start,E.match_length=N-1,W!==0&&E.prev_length<E.max_lazy_match&&E.strstart-W<=E.w_size-z&&(E.match_length=Z(E,W),E.match_length<=5&&(E.strategy===1||E.match_length===N&&4096<E.strstart-E.match_start)&&(E.match_length=N-1)),E.prev_length>=N&&E.match_length<=E.prev_length){for(A=E.strstart+E.lookahead-N,M=a._tr_tally(E,E.strstart-1-E.prev_match,E.prev_length-N),E.lookahead-=E.prev_length-1,E.prev_length-=2;++E.strstart<=A&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),--E.prev_length!=0;);if(E.match_available=0,E.match_length=N-1,E.strstart++,M&&(j(E,!1),E.strm.avail_out===0))return x}else if(E.match_available){if((M=a._tr_tally(E,0,E.window[E.strstart-1]))&&j(E,!1),E.strstart++,E.lookahead--,E.strm.avail_out===0)return x}else E.match_available=1,E.strstart++,E.lookahead--}return E.match_available&&(M=a._tr_tally(E,0,E.window[E.strstart-1]),E.match_available=0),E.insert=E.strstart<N-1?E.strstart:N-1,J===p?(j(E,!0),E.strm.avail_out===0?$:D):E.last_lit&&(j(E,!1),E.strm.avail_out===0)?x:I}function ie(E,J,W,M,A){this.good_length=E,this.max_lazy=J,this.nice_length=W,this.max_chain=M,this.func=A}function re(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=w,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*T),this.dyn_dtree=new i.Buf16(2*(2*C+1)),this.bl_tree=new i.Buf16(2*(2*O+1)),Y(this.dyn_ltree),Y(this.dyn_dtree),Y(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(P+1),this.heap=new i.Buf16(2*S+1),Y(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*S+1),Y(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ce(E){var J;return E&&E.state?(E.total_in=E.total_out=0,E.data_type=b,(J=E.state).pending=0,J.pending_out=0,J.wrap<0&&(J.wrap=-J.wrap),J.status=J.wrap?R:H,E.adler=J.wrap===2?0:1,J.last_flush=d,a._tr_init(J),h):q(E,y)}function fe(E){var J=ce(E);return J===h&&(function(W){W.window_size=2*W.w_size,Y(W.head),W.max_lazy_match=s[W.level].max_lazy,W.good_match=s[W.level].good_length,W.nice_match=s[W.level].nice_length,W.max_chain_length=s[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=N-1,W.match_available=0,W.ins_h=0})(E.state),J}function ve(E,J,W,M,A,B){if(!E)return y;var ee=1;if(J===m&&(J=6),M<0?(ee=0,M=-M):15<M&&(ee=2,M-=16),A<1||_<A||W!==w||M<8||15<M||J<0||9<J||B<0||v<B)return q(E,y);M===8&&(M=9);var ne=new re;return(E.state=ne).strm=E,ne.wrap=ee,ne.gzhead=null,ne.w_bits=M,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=A+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+N-1)/N),ne.window=new i.Buf8(2*ne.w_size),ne.head=new i.Buf16(ne.hash_size),ne.prev=new i.Buf16(ne.w_size),ne.lit_bufsize=1<<A+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new i.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=J,ne.strategy=B,ne.method=W,fe(E)}s=[new ie(0,0,0,0,function(E,J){var W=65535;for(W>E.pending_buf_size-5&&(W=E.pending_buf_size-5);;){if(E.lookahead<=1){if(le(E),E.lookahead===0&&J===d)return x;if(E.lookahead===0)break}E.strstart+=E.lookahead,E.lookahead=0;var M=E.block_start+W;if((E.strstart===0||E.strstart>=M)&&(E.lookahead=E.strstart-M,E.strstart=M,j(E,!1),E.strm.avail_out===0)||E.strstart-E.block_start>=E.w_size-z&&(j(E,!1),E.strm.avail_out===0))return x}return E.insert=0,J===p?(j(E,!0),E.strm.avail_out===0?$:D):(E.strstart>E.block_start&&(j(E,!1),E.strm.avail_out),x)}),new ie(4,4,8,4,te),new ie(4,5,16,8,te),new ie(4,6,32,32,te),new ie(4,4,16,16,Q),new ie(8,16,32,32,Q),new ie(8,16,128,128,Q),new ie(8,32,128,256,Q),new ie(32,128,258,1024,Q),new ie(32,258,258,4096,Q)],o.deflateInit=function(E,J){return ve(E,J,w,15,8,0)},o.deflateInit2=ve,o.deflateReset=fe,o.deflateResetKeep=ce,o.deflateSetHeader=function(E,J){return E&&E.state?E.state.wrap!==2?y:(E.state.gzhead=J,h):y},o.deflate=function(E,J){var W,M,A,B;if(!E||!E.state||5<J||J<0)return E?q(E,y):y;if(M=E.state,!E.output||!E.input&&E.avail_in!==0||M.status===666&&J!==p)return q(E,E.avail_out===0?-5:y);if(M.strm=E,W=M.last_flush,M.last_flush=J,M.status===R)if(M.wrap===2)E.adler=0,K(M,31),K(M,139),K(M,8),M.gzhead?(K(M,(M.gzhead.text?1:0)+(M.gzhead.hcrc?2:0)+(M.gzhead.extra?4:0)+(M.gzhead.name?8:0)+(M.gzhead.comment?16:0)),K(M,255&M.gzhead.time),K(M,M.gzhead.time>>8&255),K(M,M.gzhead.time>>16&255),K(M,M.gzhead.time>>24&255),K(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),K(M,255&M.gzhead.os),M.gzhead.extra&&M.gzhead.extra.length&&(K(M,255&M.gzhead.extra.length),K(M,M.gzhead.extra.length>>8&255)),M.gzhead.hcrc&&(E.adler=l(E.adler,M.pending_buf,M.pending,0)),M.gzindex=0,M.status=69):(K(M,0),K(M,0),K(M,0),K(M,0),K(M,0),K(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),K(M,3),M.status=H);else{var ee=w+(M.w_bits-8<<4)<<8;ee|=(2<=M.strategy||M.level<2?0:M.level<6?1:M.level===6?2:3)<<6,M.strstart!==0&&(ee|=32),ee+=31-ee%31,M.status=H,G(M,ee),M.strstart!==0&&(G(M,E.adler>>>16),G(M,65535&E.adler)),E.adler=1}if(M.status===69)if(M.gzhead.extra){for(A=M.pending;M.gzindex<(65535&M.gzhead.extra.length)&&(M.pending!==M.pending_buf_size||(M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),L(E),A=M.pending,M.pending!==M.pending_buf_size));)K(M,255&M.gzhead.extra[M.gzindex]),M.gzindex++;M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),M.gzindex===M.gzhead.extra.length&&(M.gzindex=0,M.status=73)}else M.status=73;if(M.status===73)if(M.gzhead.name){A=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),L(E),A=M.pending,M.pending===M.pending_buf_size)){B=1;break}B=M.gzindex<M.gzhead.name.length?255&M.gzhead.name.charCodeAt(M.gzindex++):0,K(M,B)}while(B!==0);M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),B===0&&(M.gzindex=0,M.status=91)}else M.status=91;if(M.status===91)if(M.gzhead.comment){A=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),L(E),A=M.pending,M.pending===M.pending_buf_size)){B=1;break}B=M.gzindex<M.gzhead.comment.length?255&M.gzhead.comment.charCodeAt(M.gzindex++):0,K(M,B)}while(B!==0);M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),B===0&&(M.status=103)}else M.status=103;if(M.status===103&&(M.gzhead.hcrc?(M.pending+2>M.pending_buf_size&&L(E),M.pending+2<=M.pending_buf_size&&(K(M,255&E.adler),K(M,E.adler>>8&255),E.adler=0,M.status=H)):M.status=H),M.pending!==0){if(L(E),E.avail_out===0)return M.last_flush=-1,h}else if(E.avail_in===0&&k(J)<=k(W)&&J!==p)return q(E,-5);if(M.status===666&&E.avail_in!==0)return q(E,-5);if(E.avail_in!==0||M.lookahead!==0||J!==d&&M.status!==666){var ne=M.strategy===2?(function(U,oe){for(var ue;;){if(U.lookahead===0&&(le(U),U.lookahead===0)){if(oe===d)return x;break}if(U.match_length=0,ue=a._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++,ue&&(j(U,!1),U.strm.avail_out===0))return x}return U.insert=0,oe===p?(j(U,!0),U.strm.avail_out===0?$:D):U.last_lit&&(j(U,!1),U.strm.avail_out===0)?x:I})(M,J):M.strategy===3?(function(U,oe){for(var ue,se,ae,ge,pe=U.window;;){if(U.lookahead<=F){if(le(U),U.lookahead<=F&&oe===d)return x;if(U.lookahead===0)break}if(U.match_length=0,U.lookahead>=N&&0<U.strstart&&(se=pe[ae=U.strstart-1])===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]){ge=U.strstart+F;do;while(se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&ae<ge);U.match_length=F-(ge-ae),U.match_length>U.lookahead&&(U.match_length=U.lookahead)}if(U.match_length>=N?(ue=a._tr_tally(U,1,U.match_length-N),U.lookahead-=U.match_length,U.strstart+=U.match_length,U.match_length=0):(ue=a._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++),ue&&(j(U,!1),U.strm.avail_out===0))return x}return U.insert=0,oe===p?(j(U,!0),U.strm.avail_out===0?$:D):U.last_lit&&(j(U,!1),U.strm.avail_out===0)?x:I})(M,J):s[M.level].func(M,J);if(ne!==$&&ne!==D||(M.status=666),ne===x||ne===$)return E.avail_out===0&&(M.last_flush=-1),h;if(ne===I&&(J===1?a._tr_align(M):J!==5&&(a._tr_stored_block(M,0,0,!1),J===3&&(Y(M.head),M.lookahead===0&&(M.strstart=0,M.block_start=0,M.insert=0))),L(E),E.avail_out===0))return M.last_flush=-1,h}return J!==p?h:M.wrap<=0?1:(M.wrap===2?(K(M,255&E.adler),K(M,E.adler>>8&255),K(M,E.adler>>16&255),K(M,E.adler>>24&255),K(M,255&E.total_in),K(M,E.total_in>>8&255),K(M,E.total_in>>16&255),K(M,E.total_in>>24&255)):(G(M,E.adler>>>16),G(M,65535&E.adler)),L(E),0<M.wrap&&(M.wrap=-M.wrap),M.pending!==0?h:1)},o.deflateEnd=function(E){var J;return E&&E.state?(J=E.state.status)!==R&&J!==69&&J!==73&&J!==91&&J!==103&&J!==H&&J!==666?q(E,y):(E.state=null,J===H?q(E,-3):h):y},o.deflateSetDictionary=function(E,J){var W,M,A,B,ee,ne,U,oe,ue=J.length;if(!E||!E.state||(B=(W=E.state).wrap)===2||B===1&&W.status!==R||W.lookahead)return y;for(B===1&&(E.adler=c(E.adler,J,ue,0)),W.wrap=0,ue>=W.w_size&&(B===0&&(Y(W.head),W.strstart=0,W.block_start=0,W.insert=0),oe=new i.Buf8(W.w_size),i.arraySet(oe,J,ue-W.w_size,W.w_size,0),J=oe,ue=W.w_size),ee=E.avail_in,ne=E.next_in,U=E.input,E.avail_in=ue,E.next_in=0,E.input=J,le(W);W.lookahead>=N;){for(M=W.strstart,A=W.lookahead-(N-1);W.ins_h=(W.ins_h<<W.hash_shift^W.window[M+N-1])&W.hash_mask,W.prev[M&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=M,M++,--A;);W.strstart=M,W.lookahead=N-1,le(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=N-1,W.match_available=0,E.next_in=ne,E.input=U,E.avail_in=ee,W.wrap=B,h},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(s,i){var a,c,l,f,d,p,h,y,m,v,b,w,_,S,C,O,T,P,N,F,z,R,H,x,I;a=s.state,c=s.next_in,x=s.input,l=c+(s.avail_in-5),f=s.next_out,I=s.output,d=f-(i-s.avail_out),p=f+(s.avail_out-257),h=a.dmax,y=a.wsize,m=a.whave,v=a.wnext,b=a.window,w=a.hold,_=a.bits,S=a.lencode,C=a.distcode,O=(1<<a.lenbits)-1,T=(1<<a.distbits)-1;e:do{_<15&&(w+=x[c++]<<_,_+=8,w+=x[c++]<<_,_+=8),P=S[w&O];t:for(;;){if(w>>>=N=P>>>24,_-=N,(N=P>>>16&255)===0)I[f++]=65535&P;else{if(!(16&N)){if((64&N)==0){P=S[(65535&P)+(w&(1<<N)-1)];continue t}if(32&N){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}F=65535&P,(N&=15)&&(_<N&&(w+=x[c++]<<_,_+=8),F+=w&(1<<N)-1,w>>>=N,_-=N),_<15&&(w+=x[c++]<<_,_+=8,w+=x[c++]<<_,_+=8),P=C[w&T];n:for(;;){if(w>>>=N=P>>>24,_-=N,!(16&(N=P>>>16&255))){if((64&N)==0){P=C[(65535&P)+(w&(1<<N)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(z=65535&P,_<(N&=15)&&(w+=x[c++]<<_,(_+=8)<N&&(w+=x[c++]<<_,_+=8)),h<(z+=w&(1<<N)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(w>>>=N,_-=N,(N=f-d)<z){if(m<(N=z-N)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(H=b,(R=0)===v){if(R+=y-N,N<F){for(F-=N;I[f++]=b[R++],--N;);R=f-z,H=I}}else if(v<N){if(R+=y+v-N,(N-=v)<F){for(F-=N;I[f++]=b[R++],--N;);if(R=0,v<F){for(F-=N=v;I[f++]=b[R++],--N;);R=f-z,H=I}}}else if(R+=v-N,N<F){for(F-=N;I[f++]=b[R++],--N;);R=f-z,H=I}for(;2<F;)I[f++]=H[R++],I[f++]=H[R++],I[f++]=H[R++],F-=3;F&&(I[f++]=H[R++],1<F&&(I[f++]=H[R++]))}else{for(R=f-z;I[f++]=I[R++],I[f++]=I[R++],I[f++]=I[R++],2<(F-=3););F&&(I[f++]=I[R++],1<F&&(I[f++]=I[R++]))}break}}break}}while(c<l&&f<p);c-=F=_>>3,w&=(1<<(_-=F<<3))-1,s.next_in=c,s.next_out=f,s.avail_in=c<l?l-c+5:5-(c-l),s.avail_out=f<p?p-f+257:257-(f-p),a.hold=w,a.bits=_}},{}],49:[function(n,r,o){var s=n("../utils/common"),i=n("./adler32"),a=n("./crc32"),c=n("./inffast"),l=n("./inftrees"),f=1,d=2,p=0,h=-2,y=1,m=852,v=592;function b(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(R){var H;return R&&R.state?(H=R.state,R.total_in=R.total_out=H.total=0,R.msg="",H.wrap&&(R.adler=1&H.wrap),H.mode=y,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new s.Buf32(m),H.distcode=H.distdyn=new s.Buf32(v),H.sane=1,H.back=-1,p):h}function S(R){var H;return R&&R.state?((H=R.state).wsize=0,H.whave=0,H.wnext=0,_(R)):h}function C(R,H){var x,I;return R&&R.state?(I=R.state,H<0?(x=0,H=-H):(x=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?h:(I.window!==null&&I.wbits!==H&&(I.window=null),I.wrap=x,I.wbits=H,S(R))):h}function O(R,H){var x,I;return R?(I=new w,(R.state=I).window=null,(x=C(R,H))!==p&&(R.state=null),x):h}var T,P,N=!0;function F(R){if(N){var H;for(T=new s.Buf32(512),P=new s.Buf32(32),H=0;H<144;)R.lens[H++]=8;for(;H<256;)R.lens[H++]=9;for(;H<280;)R.lens[H++]=7;for(;H<288;)R.lens[H++]=8;for(l(f,R.lens,0,288,T,0,R.work,{bits:9}),H=0;H<32;)R.lens[H++]=5;l(d,R.lens,0,32,P,0,R.work,{bits:5}),N=!1}R.lencode=T,R.lenbits=9,R.distcode=P,R.distbits=5}function z(R,H,x,I){var $,D=R.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new s.Buf8(D.wsize)),I>=D.wsize?(s.arraySet(D.window,H,x-D.wsize,D.wsize,0),D.wnext=0,D.whave=D.wsize):(I<($=D.wsize-D.wnext)&&($=I),s.arraySet(D.window,H,x-I,$,D.wnext),(I-=$)?(s.arraySet(D.window,H,x-I,I,0),D.wnext=I,D.whave=D.wsize):(D.wnext+=$,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=$))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=_,o.inflateInit=function(R){return O(R,15)},o.inflateInit2=O,o.inflate=function(R,H){var x,I,$,D,q,k,Y,L,j,K,G,Z,le,te,Q,ie,re,ce,fe,ve,E,J,W,M,A=0,B=new s.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return h;(x=R.state).mode===12&&(x.mode=13),q=R.next_out,$=R.output,Y=R.avail_out,D=R.next_in,I=R.input,k=R.avail_in,L=x.hold,j=x.bits,K=k,G=Y,J=p;e:for(;;)switch(x.mode){case y:if(x.wrap===0){x.mode=13;break}for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(2&x.wrap&&L===35615){B[x.check=0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0),j=L=0,x.mode=2;break}if(x.flags=0,x.head&&(x.head.done=!1),!(1&x.wrap)||(((255&L)<<8)+(L>>8))%31){R.msg="incorrect header check",x.mode=30;break}if((15&L)!=8){R.msg="unknown compression method",x.mode=30;break}if(j-=4,E=8+(15&(L>>>=4)),x.wbits===0)x.wbits=E;else if(E>x.wbits){R.msg="invalid window size",x.mode=30;break}x.dmax=1<<E,R.adler=x.check=1,x.mode=512&L?10:12,j=L=0;break;case 2:for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(x.flags=L,(255&x.flags)!=8){R.msg="unknown compression method",x.mode=30;break}if(57344&x.flags){R.msg="unknown header flags set",x.mode=30;break}x.head&&(x.head.text=L>>8&1),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0)),j=L=0,x.mode=3;case 3:for(;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.head&&(x.head.time=L),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,B[2]=L>>>16&255,B[3]=L>>>24&255,x.check=a(x.check,B,4,0)),j=L=0,x.mode=4;case 4:for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.head&&(x.head.xflags=255&L,x.head.os=L>>8),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0)),j=L=0,x.mode=5;case 5:if(1024&x.flags){for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.length=L,x.head&&(x.head.extra_len=L),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0)),j=L=0}else x.head&&(x.head.extra=null);x.mode=6;case 6:if(1024&x.flags&&(k<(Z=x.length)&&(Z=k),Z&&(x.head&&(E=x.head.extra_len-x.length,x.head.extra||(x.head.extra=new Array(x.head.extra_len)),s.arraySet(x.head.extra,I,D,Z,E)),512&x.flags&&(x.check=a(x.check,I,Z,D)),k-=Z,D+=Z,x.length-=Z),x.length))break e;x.length=0,x.mode=7;case 7:if(2048&x.flags){if(k===0)break e;for(Z=0;E=I[D+Z++],x.head&&E&&x.length<65536&&(x.head.name+=String.fromCharCode(E)),E&&Z<k;);if(512&x.flags&&(x.check=a(x.check,I,Z,D)),k-=Z,D+=Z,E)break e}else x.head&&(x.head.name=null);x.length=0,x.mode=8;case 8:if(4096&x.flags){if(k===0)break e;for(Z=0;E=I[D+Z++],x.head&&E&&x.length<65536&&(x.head.comment+=String.fromCharCode(E)),E&&Z<k;);if(512&x.flags&&(x.check=a(x.check,I,Z,D)),k-=Z,D+=Z,E)break e}else x.head&&(x.head.comment=null);x.mode=9;case 9:if(512&x.flags){for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(L!==(65535&x.check)){R.msg="header crc mismatch",x.mode=30;break}j=L=0}x.head&&(x.head.hcrc=x.flags>>9&1,x.head.done=!0),R.adler=x.check=0,x.mode=12;break;case 10:for(;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}R.adler=x.check=b(L),j=L=0,x.mode=11;case 11:if(x.havedict===0)return R.next_out=q,R.avail_out=Y,R.next_in=D,R.avail_in=k,x.hold=L,x.bits=j,2;R.adler=x.check=1,x.mode=12;case 12:if(H===5||H===6)break e;case 13:if(x.last){L>>>=7&j,j-=7&j,x.mode=27;break}for(;j<3;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}switch(x.last=1&L,j-=1,3&(L>>>=1)){case 0:x.mode=14;break;case 1:if(F(x),x.mode=20,H!==6)break;L>>>=2,j-=2;break e;case 2:x.mode=17;break;case 3:R.msg="invalid block type",x.mode=30}L>>>=2,j-=2;break;case 14:for(L>>>=7&j,j-=7&j;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if((65535&L)!=(L>>>16^65535)){R.msg="invalid stored block lengths",x.mode=30;break}if(x.length=65535&L,j=L=0,x.mode=15,H===6)break e;case 15:x.mode=16;case 16:if(Z=x.length){if(k<Z&&(Z=k),Y<Z&&(Z=Y),Z===0)break e;s.arraySet($,I,D,Z,q),k-=Z,D+=Z,Y-=Z,q+=Z,x.length-=Z;break}x.mode=12;break;case 17:for(;j<14;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(x.nlen=257+(31&L),L>>>=5,j-=5,x.ndist=1+(31&L),L>>>=5,j-=5,x.ncode=4+(15&L),L>>>=4,j-=4,286<x.nlen||30<x.ndist){R.msg="too many length or distance symbols",x.mode=30;break}x.have=0,x.mode=18;case 18:for(;x.have<x.ncode;){for(;j<3;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.lens[ee[x.have++]]=7&L,L>>>=3,j-=3}for(;x.have<19;)x.lens[ee[x.have++]]=0;if(x.lencode=x.lendyn,x.lenbits=7,W={bits:x.lenbits},J=l(0,x.lens,0,19,x.lencode,0,x.work,W),x.lenbits=W.bits,J){R.msg="invalid code lengths set",x.mode=30;break}x.have=0,x.mode=19;case 19:for(;x.have<x.nlen+x.ndist;){for(;ie=(A=x.lencode[L&(1<<x.lenbits)-1])>>>16&255,re=65535&A,!((Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(re<16)L>>>=Q,j-=Q,x.lens[x.have++]=re;else{if(re===16){for(M=Q+2;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(L>>>=Q,j-=Q,x.have===0){R.msg="invalid bit length repeat",x.mode=30;break}E=x.lens[x.have-1],Z=3+(3&L),L>>>=2,j-=2}else if(re===17){for(M=Q+3;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}j-=Q,E=0,Z=3+(7&(L>>>=Q)),L>>>=3,j-=3}else{for(M=Q+7;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}j-=Q,E=0,Z=11+(127&(L>>>=Q)),L>>>=7,j-=7}if(x.have+Z>x.nlen+x.ndist){R.msg="invalid bit length repeat",x.mode=30;break}for(;Z--;)x.lens[x.have++]=E}}if(x.mode===30)break;if(x.lens[256]===0){R.msg="invalid code -- missing end-of-block",x.mode=30;break}if(x.lenbits=9,W={bits:x.lenbits},J=l(f,x.lens,0,x.nlen,x.lencode,0,x.work,W),x.lenbits=W.bits,J){R.msg="invalid literal/lengths set",x.mode=30;break}if(x.distbits=6,x.distcode=x.distdyn,W={bits:x.distbits},J=l(d,x.lens,x.nlen,x.ndist,x.distcode,0,x.work,W),x.distbits=W.bits,J){R.msg="invalid distances set",x.mode=30;break}if(x.mode=20,H===6)break e;case 20:x.mode=21;case 21:if(6<=k&&258<=Y){R.next_out=q,R.avail_out=Y,R.next_in=D,R.avail_in=k,x.hold=L,x.bits=j,c(R,G),q=R.next_out,$=R.output,Y=R.avail_out,D=R.next_in,I=R.input,k=R.avail_in,L=x.hold,j=x.bits,x.mode===12&&(x.back=-1);break}for(x.back=0;ie=(A=x.lencode[L&(1<<x.lenbits)-1])>>>16&255,re=65535&A,!((Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(ie&&(240&ie)==0){for(ce=Q,fe=ie,ve=re;ie=(A=x.lencode[ve+((L&(1<<ce+fe)-1)>>ce)])>>>16&255,re=65535&A,!(ce+(Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}L>>>=ce,j-=ce,x.back+=ce}if(L>>>=Q,j-=Q,x.back+=Q,x.length=re,ie===0){x.mode=26;break}if(32&ie){x.back=-1,x.mode=12;break}if(64&ie){R.msg="invalid literal/length code",x.mode=30;break}x.extra=15&ie,x.mode=22;case 22:if(x.extra){for(M=x.extra;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.length+=L&(1<<x.extra)-1,L>>>=x.extra,j-=x.extra,x.back+=x.extra}x.was=x.length,x.mode=23;case 23:for(;ie=(A=x.distcode[L&(1<<x.distbits)-1])>>>16&255,re=65535&A,!((Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if((240&ie)==0){for(ce=Q,fe=ie,ve=re;ie=(A=x.distcode[ve+((L&(1<<ce+fe)-1)>>ce)])>>>16&255,re=65535&A,!(ce+(Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}L>>>=ce,j-=ce,x.back+=ce}if(L>>>=Q,j-=Q,x.back+=Q,64&ie){R.msg="invalid distance code",x.mode=30;break}x.offset=re,x.extra=15&ie,x.mode=24;case 24:if(x.extra){for(M=x.extra;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.offset+=L&(1<<x.extra)-1,L>>>=x.extra,j-=x.extra,x.back+=x.extra}if(x.offset>x.dmax){R.msg="invalid distance too far back",x.mode=30;break}x.mode=25;case 25:if(Y===0)break e;if(Z=G-Y,x.offset>Z){if((Z=x.offset-Z)>x.whave&&x.sane){R.msg="invalid distance too far back",x.mode=30;break}le=Z>x.wnext?(Z-=x.wnext,x.wsize-Z):x.wnext-Z,Z>x.length&&(Z=x.length),te=x.window}else te=$,le=q-x.offset,Z=x.length;for(Y<Z&&(Z=Y),Y-=Z,x.length-=Z;$[q++]=te[le++],--Z;);x.length===0&&(x.mode=21);break;case 26:if(Y===0)break e;$[q++]=x.length,Y--,x.mode=21;break;case 27:if(x.wrap){for(;j<32;){if(k===0)break e;k--,L|=I[D++]<<j,j+=8}if(G-=Y,R.total_out+=G,x.total+=G,G&&(R.adler=x.check=x.flags?a(x.check,$,G,q-G):i(x.check,$,G,q-G)),G=Y,(x.flags?L:b(L))!==x.check){R.msg="incorrect data check",x.mode=30;break}j=L=0}x.mode=28;case 28:if(x.wrap&&x.flags){for(;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(L!==(4294967295&x.total)){R.msg="incorrect length check",x.mode=30;break}j=L=0}x.mode=29;case 29:J=1;break e;case 30:J=-3;break e;case 31:return-4;default:return h}return R.next_out=q,R.avail_out=Y,R.next_in=D,R.avail_in=k,x.hold=L,x.bits=j,(x.wsize||G!==R.avail_out&&x.mode<30&&(x.mode<27||H!==4))&&z(R,R.output,R.next_out,G-R.avail_out)?(x.mode=31,-4):(K-=R.avail_in,G-=R.avail_out,R.total_in+=K,R.total_out+=G,x.total+=G,x.wrap&&G&&(R.adler=x.check=x.flags?a(x.check,$,G,R.next_out-G):i(x.check,$,G,R.next_out-G)),R.data_type=x.bits+(x.last?64:0)+(x.mode===12?128:0)+(x.mode===20||x.mode===15?256:0),(K==0&&G===0||H===4)&&J===p&&(J=-5),J)},o.inflateEnd=function(R){if(!R||!R.state)return h;var H=R.state;return H.window&&(H.window=null),R.state=null,p},o.inflateGetHeader=function(R,H){var x;return R&&R.state?(2&(x=R.state).wrap)==0?h:((x.head=H).done=!1,p):h},o.inflateSetDictionary=function(R,H){var x,I=H.length;return R&&R.state?(x=R.state).wrap!==0&&x.mode!==11?h:x.mode===11&&i(1,H,I,0)!==x.check?-3:z(R,H,I,I)?(x.mode=31,-4):(x.havedict=1,p):h},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var s=n("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(f,d,p,h,y,m,v,b){var w,_,S,C,O,T,P,N,F,z=b.bits,R=0,H=0,x=0,I=0,$=0,D=0,q=0,k=0,Y=0,L=0,j=null,K=0,G=new s.Buf16(16),Z=new s.Buf16(16),le=null,te=0;for(R=0;R<=15;R++)G[R]=0;for(H=0;H<h;H++)G[d[p+H]]++;for($=z,I=15;1<=I&&G[I]===0;I--);if(I<$&&($=I),I===0)return y[m++]=20971520,y[m++]=20971520,b.bits=1,0;for(x=1;x<I&&G[x]===0;x++);for($<x&&($=x),R=k=1;R<=15;R++)if(k<<=1,(k-=G[R])<0)return-1;if(0<k&&(f===0||I!==1))return-1;for(Z[1]=0,R=1;R<15;R++)Z[R+1]=Z[R]+G[R];for(H=0;H<h;H++)d[p+H]!==0&&(v[Z[d[p+H]]++]=H);if(T=f===0?(j=le=v,19):f===1?(j=i,K-=257,le=a,te-=257,256):(j=c,le=l,-1),R=x,O=m,q=H=L=0,S=-1,C=(Y=1<<(D=$))-1,f===1&&852<Y||f===2&&592<Y)return 1;for(;;){for(P=R-q,F=v[H]<T?(N=0,v[H]):v[H]>T?(N=le[te+v[H]],j[K+v[H]]):(N=96,0),w=1<<R-q,x=_=1<<D;y[O+(L>>q)+(_-=w)]=P<<24|N<<16|F|0,_!==0;);for(w=1<<R-1;L&w;)w>>=1;if(w!==0?(L&=w-1,L+=w):L=0,H++,--G[R]==0){if(R===I)break;R=d[p+v[H]]}if($<R&&(L&C)!==S){for(q===0&&(q=$),O+=x,k=1<<(D=R-q);D+q<I&&!((k-=G[D+q])<=0);)D++,k<<=1;if(Y+=1<<D,f===1&&852<Y||f===2&&592<Y)return 1;y[S=L&C]=$<<24|D<<16|O-m|0}}return L!==0&&(y[O+L]=R-q<<24|64<<16|0),b.bits=$,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var s=n("../utils/common"),i=0,a=1;function c(A){for(var B=A.length;0<=--B;)A[B]=0}var l=0,f=29,d=256,p=d+1+f,h=30,y=19,m=2*p+1,v=15,b=16,w=7,_=256,S=16,C=17,O=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],z=new Array(2*(p+2));c(z);var R=new Array(2*h);c(R);var H=new Array(512);c(H);var x=new Array(256);c(x);var I=new Array(f);c(I);var $,D,q,k=new Array(h);function Y(A,B,ee,ne,U){this.static_tree=A,this.extra_bits=B,this.extra_base=ee,this.elems=ne,this.max_length=U,this.has_stree=A&&A.length}function L(A,B){this.dyn_tree=A,this.max_code=0,this.stat_desc=B}function j(A){return A<256?H[A]:H[256+(A>>>7)]}function K(A,B){A.pending_buf[A.pending++]=255&B,A.pending_buf[A.pending++]=B>>>8&255}function G(A,B,ee){A.bi_valid>b-ee?(A.bi_buf|=B<<A.bi_valid&65535,K(A,A.bi_buf),A.bi_buf=B>>b-A.bi_valid,A.bi_valid+=ee-b):(A.bi_buf|=B<<A.bi_valid&65535,A.bi_valid+=ee)}function Z(A,B,ee){G(A,ee[2*B],ee[2*B+1])}function le(A,B){for(var ee=0;ee|=1&A,A>>>=1,ee<<=1,0<--B;);return ee>>>1}function te(A,B,ee){var ne,U,oe=new Array(v+1),ue=0;for(ne=1;ne<=v;ne++)oe[ne]=ue=ue+ee[ne-1]<<1;for(U=0;U<=B;U++){var se=A[2*U+1];se!==0&&(A[2*U]=le(oe[se]++,se))}}function Q(A){var B;for(B=0;B<p;B++)A.dyn_ltree[2*B]=0;for(B=0;B<h;B++)A.dyn_dtree[2*B]=0;for(B=0;B<y;B++)A.bl_tree[2*B]=0;A.dyn_ltree[2*_]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function ie(A){8<A.bi_valid?K(A,A.bi_buf):0<A.bi_valid&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function re(A,B,ee,ne){var U=2*B,oe=2*ee;return A[U]<A[oe]||A[U]===A[oe]&&ne[B]<=ne[ee]}function ce(A,B,ee){for(var ne=A.heap[ee],U=ee<<1;U<=A.heap_len&&(U<A.heap_len&&re(B,A.heap[U+1],A.heap[U],A.depth)&&U++,!re(B,ne,A.heap[U],A.depth));)A.heap[ee]=A.heap[U],ee=U,U<<=1;A.heap[ee]=ne}function fe(A,B,ee){var ne,U,oe,ue,se=0;if(A.last_lit!==0)for(;ne=A.pending_buf[A.d_buf+2*se]<<8|A.pending_buf[A.d_buf+2*se+1],U=A.pending_buf[A.l_buf+se],se++,ne===0?Z(A,U,B):(Z(A,(oe=x[U])+d+1,B),(ue=T[oe])!==0&&G(A,U-=I[oe],ue),Z(A,oe=j(--ne),ee),(ue=P[oe])!==0&&G(A,ne-=k[oe],ue)),se<A.last_lit;);Z(A,_,B)}function ve(A,B){var ee,ne,U,oe=B.dyn_tree,ue=B.stat_desc.static_tree,se=B.stat_desc.has_stree,ae=B.stat_desc.elems,ge=-1;for(A.heap_len=0,A.heap_max=m,ee=0;ee<ae;ee++)oe[2*ee]!==0?(A.heap[++A.heap_len]=ge=ee,A.depth[ee]=0):oe[2*ee+1]=0;for(;A.heap_len<2;)oe[2*(U=A.heap[++A.heap_len]=ge<2?++ge:0)]=1,A.depth[U]=0,A.opt_len--,se&&(A.static_len-=ue[2*U+1]);for(B.max_code=ge,ee=A.heap_len>>1;1<=ee;ee--)ce(A,oe,ee);for(U=ae;ee=A.heap[1],A.heap[1]=A.heap[A.heap_len--],ce(A,oe,1),ne=A.heap[1],A.heap[--A.heap_max]=ee,A.heap[--A.heap_max]=ne,oe[2*U]=oe[2*ee]+oe[2*ne],A.depth[U]=(A.depth[ee]>=A.depth[ne]?A.depth[ee]:A.depth[ne])+1,oe[2*ee+1]=oe[2*ne+1]=U,A.heap[1]=U++,ce(A,oe,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(pe,Ne){var tt,Fe,nt,Oe,Gt,Ot,rt=Ne.dyn_tree,On=Ne.max_code,Yt=Ne.stat_desc.static_tree,bt=Ne.stat_desc.has_stree,lr=Ne.stat_desc.extra_bits,In=Ne.stat_desc.extra_base,Ie=Ne.stat_desc.max_length,$e=0;for(Oe=0;Oe<=v;Oe++)pe.bl_count[Oe]=0;for(rt[2*pe.heap[pe.heap_max]+1]=0,tt=pe.heap_max+1;tt<m;tt++)Ie<(Oe=rt[2*rt[2*(Fe=pe.heap[tt])+1]+1]+1)&&(Oe=Ie,$e++),rt[2*Fe+1]=Oe,On<Fe||(pe.bl_count[Oe]++,Gt=0,In<=Fe&&(Gt=lr[Fe-In]),Ot=rt[2*Fe],pe.opt_len+=Ot*(Oe+Gt),bt&&(pe.static_len+=Ot*(Yt[2*Fe+1]+Gt)));if($e!==0){do{for(Oe=Ie-1;pe.bl_count[Oe]===0;)Oe--;pe.bl_count[Oe]--,pe.bl_count[Oe+1]+=2,pe.bl_count[Ie]--,$e-=2}while(0<$e);for(Oe=Ie;Oe!==0;Oe--)for(Fe=pe.bl_count[Oe];Fe!==0;)On<(nt=pe.heap[--tt])||(rt[2*nt+1]!==Oe&&(pe.opt_len+=(Oe-rt[2*nt+1])*rt[2*nt],rt[2*nt+1]=Oe),Fe--)}})(A,B),te(oe,ge,A.bl_count)}function E(A,B,ee){var ne,U,oe=-1,ue=B[1],se=0,ae=7,ge=4;for(ue===0&&(ae=138,ge=3),B[2*(ee+1)+1]=65535,ne=0;ne<=ee;ne++)U=ue,ue=B[2*(ne+1)+1],++se<ae&&U===ue||(se<ge?A.bl_tree[2*U]+=se:U!==0?(U!==oe&&A.bl_tree[2*U]++,A.bl_tree[2*S]++):se<=10?A.bl_tree[2*C]++:A.bl_tree[2*O]++,oe=U,ge=(se=0)===ue?(ae=138,3):U===ue?(ae=6,3):(ae=7,4))}function J(A,B,ee){var ne,U,oe=-1,ue=B[1],se=0,ae=7,ge=4;for(ue===0&&(ae=138,ge=3),ne=0;ne<=ee;ne++)if(U=ue,ue=B[2*(ne+1)+1],!(++se<ae&&U===ue)){if(se<ge)for(;Z(A,U,A.bl_tree),--se!=0;);else U!==0?(U!==oe&&(Z(A,U,A.bl_tree),se--),Z(A,S,A.bl_tree),G(A,se-3,2)):se<=10?(Z(A,C,A.bl_tree),G(A,se-3,3)):(Z(A,O,A.bl_tree),G(A,se-11,7));oe=U,ge=(se=0)===ue?(ae=138,3):U===ue?(ae=6,3):(ae=7,4)}}c(k);var W=!1;function M(A,B,ee,ne){G(A,(l<<1)+(ne?1:0),3),(function(U,oe,ue,se){ie(U),K(U,ue),K(U,~ue),s.arraySet(U.pending_buf,U.window,oe,ue,U.pending),U.pending+=ue})(A,B,ee)}o._tr_init=function(A){W||((function(){var B,ee,ne,U,oe,ue=new Array(v+1);for(U=ne=0;U<f-1;U++)for(I[U]=ne,B=0;B<1<<T[U];B++)x[ne++]=U;for(x[ne-1]=U,U=oe=0;U<16;U++)for(k[U]=oe,B=0;B<1<<P[U];B++)H[oe++]=U;for(oe>>=7;U<h;U++)for(k[U]=oe<<7,B=0;B<1<<P[U]-7;B++)H[256+oe++]=U;for(ee=0;ee<=v;ee++)ue[ee]=0;for(B=0;B<=143;)z[2*B+1]=8,B++,ue[8]++;for(;B<=255;)z[2*B+1]=9,B++,ue[9]++;for(;B<=279;)z[2*B+1]=7,B++,ue[7]++;for(;B<=287;)z[2*B+1]=8,B++,ue[8]++;for(te(z,p+1,ue),B=0;B<h;B++)R[2*B+1]=5,R[2*B]=le(B,5);$=new Y(z,T,d+1,p,v),D=new Y(R,P,0,h,v),q=new Y(new Array(0),N,0,y,w)})(),W=!0),A.l_desc=new L(A.dyn_ltree,$),A.d_desc=new L(A.dyn_dtree,D),A.bl_desc=new L(A.bl_tree,q),A.bi_buf=0,A.bi_valid=0,Q(A)},o._tr_stored_block=M,o._tr_flush_block=function(A,B,ee,ne){var U,oe,ue=0;0<A.level?(A.strm.data_type===2&&(A.strm.data_type=(function(se){var ae,ge=4093624447;for(ae=0;ae<=31;ae++,ge>>>=1)if(1&ge&&se.dyn_ltree[2*ae]!==0)return i;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(ae=32;ae<d;ae++)if(se.dyn_ltree[2*ae]!==0)return a;return i})(A)),ve(A,A.l_desc),ve(A,A.d_desc),ue=(function(se){var ae;for(E(se,se.dyn_ltree,se.l_desc.max_code),E(se,se.dyn_dtree,se.d_desc.max_code),ve(se,se.bl_desc),ae=y-1;3<=ae&&se.bl_tree[2*F[ae]+1]===0;ae--);return se.opt_len+=3*(ae+1)+5+5+4,ae})(A),U=A.opt_len+3+7>>>3,(oe=A.static_len+3+7>>>3)<=U&&(U=oe)):U=oe=ee+5,ee+4<=U&&B!==-1?M(A,B,ee,ne):A.strategy===4||oe===U?(G(A,2+(ne?1:0),3),fe(A,z,R)):(G(A,4+(ne?1:0),3),(function(se,ae,ge,pe){var Ne;for(G(se,ae-257,5),G(se,ge-1,5),G(se,pe-4,4),Ne=0;Ne<pe;Ne++)G(se,se.bl_tree[2*F[Ne]+1],3);J(se,se.dyn_ltree,ae-1),J(se,se.dyn_dtree,ge-1)})(A,A.l_desc.max_code+1,A.d_desc.max_code+1,ue+1),fe(A,A.dyn_ltree,A.dyn_dtree)),Q(A),ne&&ie(A)},o._tr_tally=function(A,B,ee){return A.pending_buf[A.d_buf+2*A.last_lit]=B>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&B,A.pending_buf[A.l_buf+A.last_lit]=255&ee,A.last_lit++,B===0?A.dyn_ltree[2*ee]++:(A.matches++,B--,A.dyn_ltree[2*(x[ee]+d+1)]++,A.dyn_dtree[2*j(B)]++),A.last_lit===A.lit_bufsize-1},o._tr_align=function(A){G(A,2,3),Z(A,_,z),(function(B){B.bi_valid===16?(K(B,B.bi_buf),B.bi_buf=0,B.bi_valid=0):8<=B.bi_valid&&(B.pending_buf[B.pending++]=255&B.bi_buf,B.bi_buf>>=8,B.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(s){(function(i,a){if(!i.setImmediate){var c,l,f,d,p=1,h={},y=!1,m=i.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(i);v=v&&v.setTimeout?v:i,c={}.toString.call(i.process)==="[object process]"?function(S){process.nextTick(function(){w(S)})}:(function(){if(i.postMessage&&!i.importScripts){var S=!0,C=i.onmessage;return i.onmessage=function(){S=!1},i.postMessage("","*"),i.onmessage=C,S}})()?(d="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(S){i.postMessage(d+S,"*")}):i.MessageChannel?((f=new MessageChannel).port1.onmessage=function(S){w(S.data)},function(S){f.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(l=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){w(S),C.onreadystatechange=null,l.removeChild(C),C=null},l.appendChild(C)}):function(S){setTimeout(w,0,S)},v.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),O=0;O<C.length;O++)C[O]=arguments[O+1];var T={callback:S,args:C};return h[p]=T,c(p),p++},v.clearImmediate=b}function b(S){delete h[S]}function w(S){if(y)setTimeout(w,0,S);else{var C=h[S];if(C){y=!0;try{(function(O){var T=O.callback,P=O.args;switch(P.length){case 0:T();break;case 1:T(P[0]);break;case 2:T(P[0],P[1]);break;case 3:T(P[0],P[1],P[2]);break;default:T.apply(a,P)}})(C)}finally{b(S),y=!1}}}}function _(S){S.source===i&&typeof S.data=="string"&&S.data.indexOf(d)===0&&w(+S.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof ro<"u"?ro:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(pa)),pa.exports}var BS=FS();const YC=Xn(BS),ni=6e4,bo=6e4,Bn=(e,t)=>`${e} ${t}${e===1?"":"s"} ago`;function n1(e,t=Date.now()){const n=new Date(e),r=Math.max(0,Math.floor((t-n.getTime())/1e3));let o=Math.floor(r/31536e3);return o>=1?Bn(o,"year"):(o=Math.floor(r/2592e3),o>=1?Bn(o,"month"):(o=Math.floor(r/86400),o>=1?Bn(o,"day"):(o=Math.floor(r/3600),o>=1?Bn(o,"hour"):(o=Math.floor(r/60),o>=1?Bn(o,"minute"):Bn(Math.floor(r),"second")))))}function QC(e,t=Date.now()){return e===null||t-e<ni?"just now":n1(e,t)}function XC(e,t=Date.now()){if(e===null)return bo;const n=Math.max(0,t-e);if(n<ni)return ni-n;const r=n%bo;return r===0?bo:bo-r}function $S({id:e,title:t,tags:n,pinned:r,updatedAt:o,onPinned:s,onDelete:i}){const a=n1(Number(o));return g.jsxs("div",{className:xe("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[r&&g.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:g.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[g.jsx(dy,{className:"h-3.5 w-3.5",weight:"fill"}),g.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),g.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[g.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:g.jsxs(Re,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",a]})}),g.jsx(mw,{button:g.jsx(xw,{label:"Note actions",size:"sm"}),items:[{name:r?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>i?.()}]})]}),g.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[g.jsx(Re,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:g.jsx(Wt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:or,params:{id:e},children:t||"Untitled"})}),n.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(c=>g.jsx(Wt,{to:Ep,params:{id:c.id},search:{page:1},children:g.jsx(Re,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:c.name})},c.id))})]})]})]},e)}function HS({isOpen:e,title:t,description:n,references:r,confirmLabel:o,onClose:s,onConfirm:i,confirmVariant:a="primary",isConfirming:c=!1}){return g.jsxs(Vt,{isOpen:e,onClose:s,variant:"inspect",children:[g.jsx(Vt.Header,{title:t,onClose:s}),g.jsx(Vt.Body,{children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Vt.Description,{className:"text-meta font-normal text-fg-secondary",children:n}),g.jsxs("div",{className:"overflow-hidden rounded-[16px] border border-border-subtle bg-hover-subtle/40",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border-subtle px-4 py-3",children:[g.jsx(Re,{as:"p",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:"Referenced notes"}),g.jsxs(Re,{as:"p",variant:"label",tone:"tertiary",children:[r.length," ",r.length===1?"note":"notes"]})]}),g.jsx("ul",{className:"flex flex-col",children:r.map((l,f)=>g.jsx("li",{className:f>0?"border-t border-border-subtle":void 0,children:g.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsx(Re,{as:"p",variant:"body",weight:"medium",className:"min-w-0 flex-1 break-words",children:l.title||"Untitled note"}),g.jsx(At,{asChild:!0,variant:"ghost",size:"sm",className:"self-start sm:self-auto",children:g.jsx(Wt,{to:or,params:{id:l.id},children:"Open note"})})]})},l.id))})]})]})}),g.jsx(Vt.Footer,{children:g.jsxs(i3,{children:[g.jsx(At,{variant:"ghost",size:"sm",onClick:s,disabled:c,children:"Cancel"}),g.jsx(At,{variant:a,size:"sm",onClick:i,isLoading:c,children:o})]})})]})}var Po={exports:{}},zS=Po.exports,nu;function US(){return nu||(nu=1,(function(e,t){(function(n,r){e.exports=r()})(zS,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",f="week",d="month",p="quarter",h="year",y="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(x){var I=["th","st","nd","rd"],$=x%100;return"["+x+(I[($-20)%10]||I[$]||I[0])+"]"}},_=function(x,I,$){var D=String(x);return!D||D.length>=I?x:""+Array(I+1-D.length).join($)+x},S={s:_,z:function(x){var I=-x.utcOffset(),$=Math.abs(I),D=Math.floor($/60),q=$%60;return(I<=0?"+":"-")+_(D,2,"0")+":"+_(q,2,"0")},m:function x(I,$){if(I.date()<$.date())return-x($,I);var D=12*($.year()-I.year())+($.month()-I.month()),q=I.clone().add(D,d),k=$-q<0,Y=I.clone().add(D+(k?-1:1),d);return+(-(D+($-q)/(k?q-Y:Y-q))||0)},a:function(x){return x<0?Math.ceil(x)||0:Math.floor(x)},p:function(x){return{M:d,y:h,w:f,d:l,D:y,h:c,m:a,s:i,ms:s,Q:p}[x]||String(x||"").toLowerCase().replace(/s$/,"")},u:function(x){return x===void 0}},C="en",O={};O[C]=w;var T="$isDayjsObject",P=function(x){return x instanceof R||!(!x||!x[T])},N=function x(I,$,D){var q;if(!I)return C;if(typeof I=="string"){var k=I.toLowerCase();O[k]&&(q=k),$&&(O[k]=$,q=k);var Y=I.split("-");if(!q&&Y.length>1)return x(Y[0])}else{var L=I.name;O[L]=I,q=L}return!D&&q&&(C=q),q||!D&&C},F=function(x,I){if(P(x))return x.clone();var $=typeof I=="object"?I:{};return $.date=x,$.args=arguments,new R($)},z=S;z.l=N,z.i=P,z.w=function(x,I){return F(x,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var R=(function(){function x($){this.$L=N($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[T]=!0}var I=x.prototype;return I.parse=function($){this.$d=(function(D){var q=D.date,k=D.utc;if(q===null)return new Date(NaN);if(z.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var Y=q.match(v);if(Y){var L=Y[2]-1||0,j=(Y[7]||"0").substring(0,3);return k?new Date(Date.UTC(Y[1],L,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)):new Date(Y[1],L,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)}}return new Date(q)})($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return z},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function($,D){var q=F($);return this.startOf(D)<=q&&q<=this.endOf(D)},I.isAfter=function($,D){return F($)<this.startOf(D)},I.isBefore=function($,D){return this.endOf(D)<F($)},I.$g=function($,D,q){return z.u($)?this[D]:this.set(q,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,D){var q=this,k=!!z.u(D)||D,Y=z.p($),L=function(ie,re){var ce=z.w(q.$u?Date.UTC(q.$y,re,ie):new Date(q.$y,re,ie),q);return k?ce:ce.endOf(l)},j=function(ie,re){return z.w(q.toDate()[ie].apply(q.toDate("s"),(k?[0,0,0,0]:[23,59,59,999]).slice(re)),q)},K=this.$W,G=this.$M,Z=this.$D,le="set"+(this.$u?"UTC":"");switch(Y){case h:return k?L(1,0):L(31,11);case d:return k?L(1,G):L(0,G+1);case f:var te=this.$locale().weekStart||0,Q=(K<te?K+7:K)-te;return L(k?Z-Q:Z+(6-Q),G);case l:case y:return j(le+"Hours",0);case c:return j(le+"Minutes",1);case a:return j(le+"Seconds",2);case i:return j(le+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,D){var q,k=z.p($),Y="set"+(this.$u?"UTC":""),L=(q={},q[l]=Y+"Date",q[y]=Y+"Date",q[d]=Y+"Month",q[h]=Y+"FullYear",q[c]=Y+"Hours",q[a]=Y+"Minutes",q[i]=Y+"Seconds",q[s]=Y+"Milliseconds",q)[k],j=k===l?this.$D+(D-this.$W):D;if(k===d||k===h){var K=this.clone().set(y,1);K.$d[L](j),K.init(),this.$d=K.set(y,Math.min(this.$D,K.daysInMonth())).$d}else L&&this.$d[L](j);return this.init(),this},I.set=function($,D){return this.clone().$set($,D)},I.get=function($){return this[z.p($)]()},I.add=function($,D){var q,k=this;$=Number($);var Y=z.p(D),L=function(G){var Z=F(k);return z.w(Z.date(Z.date()+Math.round(G*$)),k)};if(Y===d)return this.set(d,this.$M+$);if(Y===h)return this.set(h,this.$y+$);if(Y===l)return L(1);if(Y===f)return L(7);var j=(q={},q[a]=r,q[c]=o,q[i]=n,q)[Y]||1,K=this.$d.getTime()+$*j;return z.w(K,this)},I.subtract=function($,D){return this.add(-1*$,D)},I.format=function($){var D=this,q=this.$locale();if(!this.isValid())return q.invalidDate||m;var k=$||"YYYY-MM-DDTHH:mm:ssZ",Y=z.z(this),L=this.$H,j=this.$m,K=this.$M,G=q.weekdays,Z=q.months,le=q.meridiem,te=function(re,ce,fe,ve){return re&&(re[ce]||re(D,k))||fe[ce].slice(0,ve)},Q=function(re){return z.s(L%12||12,re,"0")},ie=le||function(re,ce,fe){var ve=re<12?"AM":"PM";return fe?ve.toLowerCase():ve};return k.replace(b,(function(re,ce){return ce||(function(fe){switch(fe){case"YY":return String(D.$y).slice(-2);case"YYYY":return z.s(D.$y,4,"0");case"M":return K+1;case"MM":return z.s(K+1,2,"0");case"MMM":return te(q.monthsShort,K,Z,3);case"MMMM":return te(Z,K);case"D":return D.$D;case"DD":return z.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return te(q.weekdaysMin,D.$W,G,2);case"ddd":return te(q.weekdaysShort,D.$W,G,3);case"dddd":return G[D.$W];case"H":return String(L);case"HH":return z.s(L,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return ie(L,j,!0);case"A":return ie(L,j,!1);case"m":return String(j);case"mm":return z.s(j,2,"0");case"s":return String(D.$s);case"ss":return z.s(D.$s,2,"0");case"SSS":return z.s(D.$ms,3,"0");case"Z":return Y}return null})(re)||Y.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,D,q){var k,Y=this,L=z.p(D),j=F($),K=(j.utcOffset()-this.utcOffset())*r,G=this-j,Z=function(){return z.m(Y,j)};switch(L){case h:k=Z()/12;break;case d:k=Z();break;case p:k=Z()/3;break;case f:k=(G-K)/6048e5;break;case l:k=(G-K)/864e5;break;case c:k=G/o;break;case a:k=G/r;break;case i:k=G/n;break;default:k=G}return q?k:z.a(k)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return O[this.$L]},I.locale=function($,D){if(!$)return this.$L;var q=this.clone(),k=N($,D,!0);return k&&(q.$L=k),q},I.clone=function(){return z.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},x})(),H=R.prototype;return F.prototype=H,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",d],["$y",h],["$D",y]].forEach((function(x){H[x[1]]=function(I){return this.$g(I,x[0],x[1])}})),F.extend=function(x,I){return x.$i||(x(I,R,F),x.$i=!0),F},F.locale=N,F.isDayjs=P,F.unix=function(x){return F(1e3*x)},F.en=O[C],F.Ls=O,F.p={},F}))})(Po)),Po.exports}var VS=US();const Ye=Xn(VS),ZS=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear(),s=new Date(r,n,1).getDay();return Math.ceil((t+s)/7)},WS=()=>[{name:"Year",template:"year",replacement:Ye().format("YYYY")},{name:"Month",template:"month",replacement:Ye().format("MM")},{name:"Short Month",template:"mon",replacement:Ye().format("M")},{name:"Day",template:"day",replacement:Ye().format("DD")},{name:"Short Day",template:"d",replacement:Ye().format("D")},{name:"Week of Month",template:"week_of_month",replacement:ZS().toString()},{name:"Hour 24",template:"hour",replacement:Ye().format("HH")},{name:"Hour 12",template:"hour_12",replacement:Ye().format("hh")},{name:"Short Hour 24",template:"h",replacement:Ye().format("H")},{name:"Short Hour 12",template:"h_12",replacement:Ye().format("h")},{name:"AM/PM",template:"ampm",replacement:Ye().format("A")},{name:"Minute",template:"minute",replacement:Ye().format("mm")},{name:"Short Minute",template:"m",replacement:Ye().format("m")},{name:"Second",template:"second",replacement:Ye().format("ss")},{name:"Short Second",template:"s",replacement:Ye().format("s")}],qS="{%",KS="%}",ru=e=>e.replace(new RegExp(`${qS}([^}]+)${KS}`,"g"),(t,n)=>WS().find(o=>o.template===n)?.replacement||t),wo={title:"Move note to Trash?",description:"This note is referenced by the notes below. Those links may stop opening while this note stays in Trash. If you restore this note later, the links will work again.",confirmLabel:"Move to Trash",confirmVariant:"soft-danger"},r1=()=>{const e=mf(),t=vf(),n=er(),r=Pn(),[o,s]=u.useState(null),i=async(d="",p="",h)=>{const y=ru(d),m=ru(p),v=await CS({title:y,content:m,...h&&{layout:h}});return v.type==="error"?(t(v.errors[0].message),null):(r({to:or,params:{id:v.createNote.id}}),v.createNote.id)},a=async(d,p,h)=>{try{const y=await RS(d,!p);if(y.type==="error"){t(y.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:Me.notes.listAll(),exact:!1}),n.invalidateQueries({queryKey:Me.notes.tagListAll(),exact:!1}),n.invalidateQueries({queryKey:Me.notes.pinned(),exact:!0})]),h?.()}catch{t("Failed to update note pin status")}},c=async(d,p)=>{const h=await AS(d);if(h.type==="error"){t(h.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:Me.notes.all(),exact:!1}),n.invalidateQueries({queryKey:Me.tags.all(),exact:!1}),n.invalidateQueries({queryKey:Me.reminders.all(),exact:!1}),n.invalidateQueries({queryKey:Me.images.all(),exact:!1}),n.invalidateQueries({queryKey:["calendar"],exact:!1})]),t("The note has been moved to trash."),p?.()},l=async()=>{if(!o)return;const{id:d,callback:p}=o;s(null),await c(d,p)};return{onCreate:i,onPinned:a,onDelete:async(d,p)=>{const h=await SS(d);if(h.type==="error"){t("Failed to check linked notes before moving this note to Trash.");return}if(n.setQueryData(Me.notes.backReferences(d),h.backReferences),h.backReferences.length>0){s({id:d,callback:p,backReferences:h.backReferences});return}await e("Move this note to trash?")&&await c(d,p)},deleteWarningDialog:g.jsx(HS,{isOpen:!!o,title:wo.title,description:wo.description,references:o?.backReferences??[],confirmLabel:wo.confirmLabel,confirmVariant:wo.confirmVariant,onClose:()=>s(null),onConfirm:()=>{l()}})}},GS="p-3 pb-0",YS="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",QS="flex items-center gap-2.5",XS="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",JS="flex flex-col",e5="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",t5=()=>{const{onCreate:e}=r1();return g.jsx("div",{className:GS,children:g.jsxs("button",{type:"button",className:YS,onClick:()=>e(),children:[g.jsxs("span",{className:QS,children:[g.jsx("span",{className:XS,children:g.jsx(uy,{className:"h-4.5 w-4.5",weight:"bold"})}),g.jsxs("span",{className:JS,children:[g.jsx(Re,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),g.jsx(Re,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),g.jsx(_r,{className:e5,weight:"bold"})]})})},n5=e=>{const[t,n]=u.useState(!1),r=u.useRef(null),o=u.useRef(!0),s=u.useRef(0),i=u.useCallback(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);u.useEffect(()=>(o.current=!0,()=>{o.current=!1,i()}),[i]);const a=u.useCallback(c=>{s.current+=1;const l=s.current;i(),o.current&&n(!0),r.current=setTimeout(()=>{r.current=null,Promise.resolve().then(c).catch(()=>{}).finally(()=>{o.current&&s.current===l&&n(!1)})},e)},[i,e]);return[t,a]},r5="flex flex-col gap-2.5",o5="overflow-hidden rounded-[14px] border border-border-subtle bg-elevated transition-colors focus-within:border-border-focus focus-within:shadow-[0_0_0_4px_color-mix(in_srgb,var(--accent-soft-primary)_90%,transparent)]",s5="grid-search-bar grid items-center border-b border-transparent px-2.5 py-1.5 transition-colors",a5="border-border-subtle/70",i5="",ou="flex h-10 items-center justify-center text-fg-tertiary transition-colors hover:text-fg-default sm:h-8",c5="h-10 w-full bg-transparent py-2 text-meta text-fg-default outline-none placeholder:text-fg-placeholder sm:h-8 sm:py-1.5",l5="max-h-[min(48vh,320px)] overflow-y-auto px-1 py-1.5",su="focus-ring-soft flex min-h-10 items-center gap-2 rounded-[10px] px-2.5 py-2 outline-none transition-colors hover:bg-hover-subtle sm:min-h-0 sm:px-2 sm:py-1.5",u5="min-w-0 flex-1",d5="mt-1 border-t border-border-subtle/50 px-2 pb-0.5 pt-1.5",f5="focus-ring-soft flex min-h-9 items-center gap-1.5 rounded-[10px] text-fg-secondary outline-none transition-colors hover:text-fg-default",h5=()=>{const e=Pn(),[t,n]=u.useState(""),[r,o]=u.useState([]),[s,i]=u.useState(!1),a=u.useRef(0),[,c]=n5(500);u.useEffect(()=>{const m=t.trim();if(m.length<=0){a.current+=1,c(()=>{}),o([]),i(!1);return}const v=a.current+1;a.current=v,o([]),i(!0),c(()=>{t1({query:m,limit:5}).then(b=>{a.current===v&&(o(b.type==="success"?b.allNotes.notes:[]),i(!1))},()=>{a.current===v&&(o([]),i(!1))})})},[t,c]);const l=m=>{m?.preventDefault();const v=t.trim();v.length<=0||e({to:wp,search:{query:v,page:1}})},f=()=>{n("")},d=t.trim().length>0,p=r.length>0,h=d,y=d&&!s&&!p;return g.jsx("div",{className:"p-3",children:g.jsx("form",{className:r5,onSubmit:l,children:g.jsxs("div",{className:o5,children:[g.jsxs("div",{className:`${s5} ${p?a5:i5}`,children:[g.jsx("button",{type:"submit","aria-label":"Search notes",className:ou,children:g.jsx(ly,{className:"h-4.5 w-4.5",weight:"bold"})}),g.jsx("input",{type:"text",placeholder:"Search notes",value:t,onChange:m=>n(m.target.value),className:c5}),t&&g.jsx("button",{type:"button","aria-label":"Clear search",className:ou,onClick:f,children:g.jsx(Ci,{className:"h-4 w-4",weight:"bold"})})]}),(h||y)&&g.jsxs("div",{className:l5,children:[s&&g.jsx("div",{children:[.34,.3,.26,.22,.18].map(m=>g.jsxs("div",{className:su,"aria-hidden":"true",children:[g.jsx(tl,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary opacity-50"}),g.jsx(Lt,{height:"21px",opacity:m,className:"min-w-0 flex-1"})]},m))}),y&&g.jsx(Re,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2",children:"No quick matches."}),r.length>0&&g.jsx("div",{children:r.map(({id:m,title:v})=>g.jsxs(Wt,{to:or,params:{id:m},className:su,children:[g.jsx(tl,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),g.jsx(Re,{as:"span",truncate:!0,variant:"meta",weight:"medium",className:u5,children:v||"Untitled"})]},m))}),g.jsx("div",{className:d5,children:g.jsxs("button",{type:"submit",className:f5,children:[g.jsx(Re,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"View all results"}),g.jsx(_r,{className:"h-3.5 w-3.5",weight:"bold"})]})})]})]})})})},p5=[{name:"Notes",path:Jr,icon:of},{name:"Views",path:gp,icon:ay},{name:"Graph",path:bp,icon:my},{name:"Calendar",path:vp,icon:ty},{name:"Reminders",path:yp,icon:ey},{name:"Tags",path:xp,icon:py},{name:"Setting",path:_p,icon:iy}],m5=()=>{const e=ds({select:t=>t.pathname});return g.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:p5.map((t,n)=>{const r=e===t.path||t.path!==Jr&&e.startsWith(`${t.path}/`);return g.jsxs(u.Fragment,{children:[n>0&&g.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),g.jsx(Wt,{to:t.path,children:g.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[g.jsx(t.icon,{className:"size-5",weight:r?"fill":"regular"}),g.jsx(Re,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:t.name})]})})]},t.path)})})},g5=({children:e})=>g.jsx(_E,{sidebar:g.jsxs(g.Fragment,{children:[g.jsx(NE,{}),g.jsx(t5,{}),g.jsx(h5,{}),g.jsx(jS,{}),g.jsx(hE,{})]}),topNavigation:g.jsx(m5,{}),children:e}),o1=100,s1=[50,o1,200];function JC(e){return s1.includes(e)}const v5=["updatedAt","createdAt"],y5=["referenceCount","name"],a1=["asc","desc"],b5=["create","update"],Ls=e=>Array.isArray(e)?e[0]:e,cn=(e,t,{min:n=1,max:r=Number.MAX_SAFE_INTEGER}={})=>{const o=Ls(e),s=typeof o=="number"?o:typeof o=="string"?Number(o):Number.NaN;return!Number.isInteger(s)||s<n||s>r?t:s},i1=(e,t,n)=>{const r=cn(e,Number.NaN);return t.includes(r)?r:n},w5=(e,t=!1)=>{const n=Ls(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},js=(e,t="")=>{const n=Ls(e);return typeof n=="string"?n:t},Br=(e,t,n)=>{const r=Ls(e);return typeof r!="string"?n:t.includes(r)?r:n},x5=e=>({page:cn(e.page,1),limit:i1(e.limit,nc,Ms),sortBy:Br(e.sortBy,v5,"updatedAt"),sortOrder:Br(e.sortOrder,a1,"desc"),pinnedFirst:w5(e.pinnedFirst,!1)}),cr=e=>({page:cn(e.page,1)}),E5=e=>({page:cn(e.page,1),query:js(e.query,"")}),_5=e=>({page:cn(e.page,1),query:js(e.query,""),limit:i1(e.limit,s1,o1),sortBy:Br(e.sortBy,y5,"referenceCount"),sortOrder:Br(e.sortOrder,a1,"desc")}),S5=e=>({year:cn(e.year,Ye().year(),{min:1970,max:9999}),month:cn(e.month,Ye().month()+1,{min:1,max:12}),type:Br(e.type,b5,"create")}),C5=e=>{const t=js(e.selected,"").trim();return t?{selected:t}:{}},R5=e=>({page:cn(e.page,1),sectionId:js(e.sectionId,"")}),au=cg(Jr);function A5(){const e=au.useNavigate(),{limit:t,page:n,sortBy:r,sortOrder:o,pinnedFirst:s}=au.useSearch(),{onDelete:i,onPinned:a,deleteWarningDialog:c}=r1(),l=f=>{e({search:d=>({...d,...f})})};return g.jsxs(Ns,{title:"",variant:"none",children:[g.jsxs("div",{className:"flex flex-col gap-5",children:[g.jsx(l3,{itemsPerPage:t,onItemsPerPageChange:f=>l({limit:f,page:1}),sortBy:r,onSortByChange:f=>l({sortBy:f,page:1}),sortOrder:o,onSortOrderChange:f=>l({sortOrder:f,page:1}),pinnedFirst:s,onPinnedFirstChange:f=>l({pinnedFirst:f,page:1})}),g.jsx(Cp,{fallback:g.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[g.jsx(Lt,{height:"112px"}),g.jsx(Lt,{height:"112px"}),g.jsx(Lt,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,r,o,s],children:g.jsx(PS,{searchParams:{offset:(n-1)*t,limit:t,sortBy:r,sortOrder:o,pinnedFirst:s},render:({notes:f,totalCount:d})=>g.jsx(Tl,{fallback:g.jsx(y0,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:f.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid-auto-cards grid gap-5",children:f.map(p=>g.jsx($S,{...p,onPinned:()=>a(p.id,p.pinned),onDelete:()=>i(p.id)},p.id))}),g.jsx(Tl,{fallback:null,children:d&&t<d&&g.jsx(w0,{page:n,last:Math.ceil(d/t),onChange:p=>{l({page:p})}})})]})})})})]}),c]})}const qe=fg({component:()=>g.jsx(g5,{children:g.jsx(Iu,{})}),errorComponent:eE,notFoundComponent:tE}),T5=We({getParentRoute:()=>qe,path:Jr,component:A5,validateSearch:x5}),P5=We({getParentRoute:()=>qe,path:vp,component:et(()=>Je(()=>import("./Calendar-COrN6Hjv.js"),__vite__mapDeps([0,1,2,3,4]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:S5}),M5=We({getParentRoute:()=>qe,path:gp,component:et(()=>Je(()=>import("./Views-DR5jT23G.js"),__vite__mapDeps([5,1,2,3,6,7,8,9,10]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading views",description:"Preparing your saved dashboards."})}),N5=We({getParentRoute:()=>qe,path:yp,component:et(()=>Je(()=>import("./Reminders-BYG5rz1M.js"),__vite__mapDeps([11,1,2,3,12]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:cr}),O5=We({getParentRoute:()=>qe,path:bp,component:et(()=>Je(()=>import("./Graph-BH1fzhue.js"),__vite__mapDeps([13,1,2,3,9]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:C5}),I5=We({getParentRoute:()=>qe,path:wp,component:et(()=>Je(()=>import("./Search-DBWsIMDP.js"),__vite__mapDeps([14,1,2,3]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:E5}),k5=We({getParentRoute:()=>qe,path:xp,component:et(()=>Je(()=>import("./Tag-5aCfSO8Y.js"),__vite__mapDeps([15,1,2,3,6]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:_5}),D5=We({getParentRoute:()=>qe,path:or,component:et(()=>Je(()=>import("./Note-C143cKKw.js"),__vite__mapDeps([16,1,2,3,4,8,12,10,17,18,6]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading note",description:"Preparing the editor and note content."})}),L5=We({getParentRoute:()=>qe,path:Ep,component:et(()=>Je(()=>import("./TagNotes-BPZjN-6l.js"),__vite__mapDeps([19,1,2,3]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:cr}),j5=We({getParentRoute:()=>qe,path:Z3,component:et(()=>Je(()=>import("./ViewNotes-DGLNF96x.js"),__vite__mapDeps([20,1,2,3,6,7]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:R5}),F5=We({getParentRoute:()=>qe,path:_p,component:et(()=>Je(()=>import("./index-DGIAh3ZY.js"),__vite__mapDeps([21,1,2,3,22,23,24]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading settings",description:"Preparing workspace preferences."})}),B5=We({getParentRoute:()=>qe,path:W3,component:et(()=>Je(()=>import("./mcp-EDurbggR.js"),__vite__mapDeps([25,1,2,3,22,18]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),$5=We({getParentRoute:()=>qe,path:q3,component:et(()=>Je(()=>import("./trash-C5ntddLu.js"),__vite__mapDeps([26,1,2,3,8]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:cr}),H5=We({getParentRoute:()=>qe,path:K3,component:et(()=>Je(()=>import("./manage-image-RqtWKas2.js"),__vite__mapDeps([27,1,2,3,17,28,8,24]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:cr}),z5=We({getParentRoute:()=>qe,path:G3,component:et(()=>Je(()=>import("./manage-image-detail-BTSIbLlQ.js"),__vite__mapDeps([29,1,2,3,17,28,8,24,23]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading image detail",description:"Preparing references for the selected image."})}),U5=We({getParentRoute:()=>qe,path:Q3,component:et(()=>Je(()=>import("./properties-BjrZvOYn.js"),__vite__mapDeps([30,1,2,3]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:cr}),V5=We({getParentRoute:()=>qe,path:Y3,component:et(()=>Je(()=>import("./placeholder-DeKgSBnC.js"),__vite__mapDeps([31,1,2,3,8,10]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:cr}),Z5=qe.addChildren([T5,M5,P5,N5,O5,I5,k5,D5,L5,j5,F5,B5,$5,H5,z5,V5,U5]),W5=wg({routeTree:Z5,defaultPendingComponent:()=>g.jsx(Ge,{title:"Loading page",description:"Preparing the next route."})});function q5(){const e=Qo(n=>n.setSystemTheme),t=Qo(n=>n.setTheme);return u.useEffect(()=>{const n=Yo();return n&&t(n),C1.listenThemeChange(r=>{Yo()||e(r?"dark":"light")},n==null)},[e,t]),g.jsx(h8,{children:g.jsx(_g,{router:W5})})}const c1="__oceanBrainCsrfRetry";let ma;const K5=e=>!Se.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",l1=e=>{if(!K5(e)||!Se.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[c1])},G5=()=>(ma??=Vo().finally(()=>{ma=void 0}),ma),iu=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Y5=e=>{iu(e.headers,"X-XSRF-TOKEN"),iu(e.headers,"x-xsrf-token")},Q5=async e=>{if(!l1(e)||!Se.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[c1]=!0,await G5()!=="active"?Promise.reject(e):(Y5(t),Se.request(t))};let cu;const X5=()=>{cu===void 0&&(cu=Se.interceptors.response.use(e=>e,e=>{if(Z6(e))Bf();else if(l1(e))return Q5(e);return Promise.reject(e)}))};Qo.setState({theme:fE()});X5();Vo();x1.createRoot(document.getElementById("root")).render(g.jsx(X.StrictMode,{children:g.jsx(q5,{})}));export{Qo as $,jr as A,At as B,vp as C,mw as D,b0 as E,i3 as F,mf as G,bS as H,vw as I,dc as J,lc as K,Wt as L,Vt as M,or as N,DC as O,Ns as P,y0 as Q,nS as R,Ao as S,Re as T,iS as U,Z3 as V,oy as W,Wf as X,Cp as Y,w0 as Z,yp as _,ey as a,yx as a$,my as a0,ly as a1,Ci as a2,bp as a3,rc as a4,Ku as a5,GC as a6,ze as a7,PS as a8,wp as a9,AC as aA,IC as aB,XC as aC,u8 as aD,r1 as aE,q3 as aF,dy as aG,QC as aH,CS as aI,ru as aJ,BC as aK,cw as aL,lw as aM,m0 as aN,pw as aO,v0 as aP,g0 as aQ,Q3 as aR,iy as aS,py as aT,OC as aU,$S as aV,gp as aW,Y3 as aX,uy as aY,K3 as aZ,W3 as a_,n5 as aa,of as ab,s1 as ac,o1 as ad,JC as ae,fy as af,Tl as ag,Ep as ah,xp as ai,it as aj,SS as ak,YC as al,PC as am,HC as an,s2 as ao,VC as ap,UC as aq,zC as ar,wx as as,Nx as at,Ox as au,ny as av,cy as aw,t1 as ax,Pn as ay,$C as az,ty as b,Se as b0,ZC as b1,qC as b2,KC as b3,HS as b4,WC as b5,G3 as b6,Ga as b7,kC as b8,ME as b9,LC as ba,jC as bb,FC as bc,WS as bd,qS as be,KS as bf,Ke as bg,xe as c,Ye as d,zn as e,Xs as f,_r as g,Pe as h,Lt as i,cg as j,er as k,xw as l,vf as m,WE as n,zl as o,b_ as p,Me as q,K_ as r,tl as s,n1 as t,o2 as u,MC as v,KE as w,lS as x,NC as y,gS as z};
|
|
342
|
+
\0`,G+=s(L,2),G+=O.magic,G+=s(_,2),G+=s(S,2),G+=s(Y.crc32,4),G+=s(Y.compressedSize,4),G+=s(Y.uncompressedSize,4),G+=s(P.length,2),G+=s(I.length,2),{fileRecord:d.LOCAL_FILE_HEADER+G+P+I,dirRecord:d.CENTRAL_FILE_HEADER+s(K,2)+G+s(z.length,2)+"\0\0\0\0"+s(j,4)+s(v,4)+P+I+z}}var a=n("../utils"),c=n("../stream/GenericWorker"),l=n("../utf8"),f=n("../crc32"),d=n("../signature");function p(h,y,m,v){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=m,this.encodeFileName=v,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,c),p.prototype.push=function(h){var y=h.meta.percent||0,m=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,c.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(y+100*(m-v-1))/m:100}}))},p.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var y=this.streamFiles&&!h.file.dir;if(y){var m=i(h,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(h){this.accumulate=!1;var y=this.streamFiles&&!h.file.dir,m=i(h,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),y)this.push({data:(function(v){return d.DATA_DESCRIPTOR+s(v.crc32,4)+s(v.compressedSize,4)+s(v.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var h=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var m=this.bytesWritten-h,v=(function(b,w,_,S,C){var O=a.transformTo("string",C(S));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(b,2)+s(b,2)+s(w,4)+s(_,4)+s(O.length,2)+O})(this.dirRecords.length,m,h,this.zipComment,this.encodeFileName);this.push({data:v,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(h){this._sources.push(h);var y=this;return h.on("data",function(m){y.processChunk(m)}),h.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),h.on("error",function(m){y.error(m)}),this},p.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(h){var y=this._sources;if(!c.prototype.error.call(this,h))return!1;for(var m=0;m<y.length;m++)try{y[m].error(h)}catch{}return!0},p.prototype.lock=function(){c.prototype.lock.call(this);for(var h=this._sources,y=0;y<h.length;y++)h[y].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var s=n("../compressions"),i=n("./ZipFileWorker");o.generateWorker=function(a,c,l){var f=new i(c.streamFiles,l,c.platform,c.encodeFileName),d=0;try{a.forEach(function(p,h){d++;var y=(function(w,_){var S=w||_,C=s[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(h.options.compression,c.compression),m=h.options.compressionOptions||c.compressionOptions||{},v=h.dir,b=h.date;h._compressWorker(y,m).withStreamInfo("file",{name:p,dir:v,date:b,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(f)}),f.entriesCount=d}catch(p){f.error(p)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new s;for(var a in this)typeof this[a]!="function"&&(i[a]=this[a]);return i}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(i,a){return new s().loadAsync(i,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var s=n("./utils"),i=n("./external"),a=n("./utf8"),c=n("./zipEntries"),l=n("./stream/Crc32Probe"),f=n("./nodejsUtils");function d(p){return new i.Promise(function(h,y){var m=p.decompressed.getContentWorker().pipe(new l);m.on("error",function(v){y(v)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}r.exports=function(p,h){var y=this;return h=s.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),f.isNode&&f.isStream(p)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,h.optimizedBinaryString,h.base64).then(function(m){var v=new c(h);return v.load(m),v}).then(function(m){var v=[i.Promise.resolve(m)],b=m.files;if(h.checkCRC32)for(var w=0;w<b.length;w++)v.push(d(b[w]));return i.Promise.all(v)}).then(function(m){for(var v=m.shift(),b=v.files,w=0;w<b.length;w++){var _=b[w],S=_.fileNameStr,C=s.resolve(_.fileNameStr);y.file(C,_.decompressed,{binary:!0,optimizedBinaryString:!0,date:_.date,dir:_.dir,comment:_.fileCommentStr.length?_.fileCommentStr:null,unixPermissions:_.unixPermissions,dosPermissions:_.dosPermissions,createFolders:h.createFolders}),_.dir||(y.file(C).unsafeOriginalName=S)}return v.zipComment.length&&(y.comment=v.zipComment),y})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var s=n("../utils"),i=n("../stream/GenericWorker");function a(c,l){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(l)}s.inherits(a,i),a.prototype._bindStream=function(c){var l=this;(this._stream=c).pause(),c.on("data",function(f){l.push({data:f,meta:{percent:0}})}).on("error",function(f){l.isPaused?this.generatedError=f:l.error(f)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var s=n("readable-stream").Readable;function i(a,c,l){s.call(this,c),this._helper=a;var f=this;a.on("data",function(d,p){f.push(d)||f._helper.pause(),l&&l(p)}).on("error",function(d){f.emit("error",d)}).on("end",function(){f.push(null)})}n("../utils").inherits(i,s),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,i);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,i)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var i=new Buffer(s);return i.fill(0),i},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,o){function s(C,O,T){var P,N=a.getTypeOf(O),F=a.extend(T||{},f);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(C=b(C)),F.createFolders&&(P=v(C))&&w.call(this,P,!0);var z=N==="string"&&F.binary===!1&&F.base64===!1;T&&T.binary!==void 0||(F.binary=!z),(O instanceof d&&O.uncompressedSize===0||F.dir||!O||O.length===0)&&(F.base64=!1,F.binary=!0,O="",F.compression="STORE",N="string");var R=null;R=O instanceof d||O instanceof c?O:y.isNode&&y.isStream(O)?new m(C,O):a.prepareContent(C,O,F.binary,F.optimizedBinaryString,F.base64);var H=new p(C,R,F);this.files[C]=H}var i=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),l=n("./stream/StreamHelper"),f=n("./defaults"),d=n("./compressedObject"),p=n("./zipObject"),h=n("./generate"),y=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),v=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var O=C.lastIndexOf("/");return 0<O?C.substring(0,O):""},b=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},w=function(C,O){return O=O!==void 0?O:f.createFolders,C=b(C),this.files[C]||s.call(this,C,null,{dir:!0,createFolders:O}),this.files[C]};function _(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var O,T,P;for(O in this.files)P=this.files[O],(T=O.slice(this.root.length,O.length))&&O.slice(0,this.root.length)===this.root&&C(T,P)},filter:function(C){var O=[];return this.forEach(function(T,P){C(T,P)&&O.push(P)}),O},file:function(C,O,T){if(arguments.length!==1)return C=this.root+C,s.call(this,C,O,T),this;if(_(C)){var P=C;return this.filter(function(F,z){return!z.dir&&P.test(F)})}var N=this.files[this.root+C];return N&&!N.dir?N:null},folder:function(C){if(!C)return this;if(_(C))return this.filter(function(N,F){return F.dir&&C.test(N)});var O=this.root+C,T=w.call(this,O),P=this.clone();return P.root=T.name,P},remove:function(C){C=this.root+C;var O=this.files[C];if(O||(C.slice(-1)!=="/"&&(C+="/"),O=this.files[C]),O&&!O.dir)delete this.files[C];else for(var T=this.filter(function(N,F){return F.name.slice(0,C.length)===C}),P=0;P<T.length;P++)delete this.files[T[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var O,T={};try{if((T=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=T.type.toLowerCase(),T.compression=T.compression.toUpperCase(),T.type==="binarystring"&&(T.type="string"),!T.type)throw new Error("No output type specified.");a.checkSupport(T.type),T.platform!=="darwin"&&T.platform!=="freebsd"&&T.platform!=="linux"&&T.platform!=="sunos"||(T.platform="UNIX"),T.platform==="win32"&&(T.platform="DOS");var P=T.comment||this.comment||"";O=h.generateWorker(this,T,P)}catch(N){(O=new c("error")).error(N)}return new l(O,T.type||"string",T.mimeType)},generateAsync:function(C,O){return this.generateInternalStream(C).accumulate(O)},generateNodeStream:function(C,O){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(O)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data[this.zero+a]},i.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),l=a.charCodeAt(1),f=a.charCodeAt(2),d=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===l&&this.data[p+2]===f&&this.data[p+3]===d)return p-this.zero;return-1},i.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),l=a.charCodeAt(1),f=a.charCodeAt(2),d=a.charCodeAt(3),p=this.readData(4);return c===p[0]&&l===p[1]&&f===p[2]&&d===p[3]},i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var s=n("../utils");function i(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,l=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)l=(l<<8)+this.byteAt(c);return this.index+=a,l},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=i},{"../utils":32}],19:[function(n,r,o){var s=n("./Uint8ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var s=n("./ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var s=n("../utils"),i=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),l=n("./NodeBufferReader"),f=n("./Uint8ArrayReader");r.exports=function(d){var p=s.getTypeOf(d);return s.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new l(d):i.uint8array?new f(s.transformTo("uint8array",d)):new a(s.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var s=n("./GenericWorker"),i=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var s=n("./GenericWorker"),i=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,i),a.prototype.processChunk=function(c){if(c){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(f){l.dataIsReady=!0,l.data=f,l.max=f&&f.length||0,l.type=s.getTypeOf(f),l.isPaused||l._tickAndRepeat()},function(f){l.error(f)})}s.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,l);break;case"uint8array":c=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":c=this.data.slice(this.index,l)}return this.index=l,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function s(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,a)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var a=this;return i.on("data",function(c){a.processChunk(c)}),i.on("end",function(){a.end()}),i.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,a){return this.extraStreamInfo[i]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=s},{}],29:[function(n,r,o){var s=n("../utils"),i=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),l=n("../support"),f=n("../external"),d=null;if(l.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,m){return new f.Promise(function(v,b){var w=[],_=y._internalType,S=y._outputType,C=y._mimeType;y.on("data",function(O,T){w.push(O),m&&m(T)}).on("error",function(O){w=[],b(O)}).on("end",function(){try{var O=(function(T,P,N){switch(T){case"blob":return s.newBlob(s.transformTo("arraybuffer",P),N);case"base64":return c.encode(P);default:return s.transformTo(T,P)}})(S,(function(T,P){var N,F=0,z=null,R=0;for(N=0;N<P.length;N++)R+=P[N].length;switch(T){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(z=new Uint8Array(R),N=0;N<P.length;N++)z.set(P[N],F),F+=P[N].length;return z;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+T+"'")}})(_,w),C);v(O)}catch(T){b(T)}w=[]}).resume()})}function h(y,m,v){var b=m;switch(m){case"blob":case"arraybuffer":b="uint8array";break;case"base64":b="string"}try{this._internalType=b,this._outputType=m,this._mimeType=v,s.checkSupport(b),this._worker=y.pipe(new i(b)),y.lock()}catch(w){this._worker=new a("error"),this._worker.error(w)}}h.prototype={accumulate:function(y){return p(this,y)},on:function(y,m){var v=this;return y==="data"?this._worker.on(y,function(b){m.call(v,b.data,b.meta)}):this._worker.on(y,function(){s.delay(m,arguments,v)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},y)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var s=new ArrayBuffer(0);try{o.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(s),o.blob=i.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var s=n("./utils"),i=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),l=new Array(256),f=0;f<256;f++)l[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;l[254]=l[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}o.utf8encode=function(h){return i.nodebuffer?a.newBufferFrom(h,"utf-8"):(function(y){var m,v,b,w,_,S=y.length,C=0;for(w=0;w<S;w++)(64512&(v=y.charCodeAt(w)))==55296&&w+1<S&&(64512&(b=y.charCodeAt(w+1)))==56320&&(v=65536+(v-55296<<10)+(b-56320),w++),C+=v<128?1:v<2048?2:v<65536?3:4;for(m=i.uint8array?new Uint8Array(C):new Array(C),w=_=0;_<C;w++)(64512&(v=y.charCodeAt(w)))==55296&&w+1<S&&(64512&(b=y.charCodeAt(w+1)))==56320&&(v=65536+(v-55296<<10)+(b-56320),w++),v<128?m[_++]=v:(v<2048?m[_++]=192|v>>>6:(v<65536?m[_++]=224|v>>>12:(m[_++]=240|v>>>18,m[_++]=128|v>>>12&63),m[_++]=128|v>>>6&63),m[_++]=128|63&v);return m})(h)},o.utf8decode=function(h){return i.nodebuffer?s.transformTo("nodebuffer",h).toString("utf-8"):(function(y){var m,v,b,w,_=y.length,S=new Array(2*_);for(m=v=0;m<_;)if((b=y[m++])<128)S[v++]=b;else if(4<(w=l[b]))S[v++]=65533,m+=w-1;else{for(b&=w===2?31:w===3?15:7;1<w&&m<_;)b=b<<6|63&y[m++],w--;1<w?S[v++]=65533:b<65536?S[v++]=b:(b-=65536,S[v++]=55296|b>>10&1023,S[v++]=56320|1023&b)}return S.length!==v&&(S.subarray?S=S.subarray(0,v):S.length=v),s.applyFromCharCode(S)})(h=s.transformTo(i.uint8array?"uint8array":"array",h))},s.inherits(d,c),d.prototype.processChunk=function(h){var y=s.transformTo(i.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=y;(y=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),y.set(m,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var v=(function(w,_){var S;for((_=_||w.length)>w.length&&(_=w.length),S=_-1;0<=S&&(192&w[S])==128;)S--;return S<0||S===0?_:S+l[w[S]]>_?S:_})(y),b=y;v!==y.length&&(i.uint8array?(b=y.subarray(0,v),this.leftOver=y.subarray(v,y.length)):(b=y.slice(0,v),this.leftOver=y.slice(v,y.length))),this.push({data:o.utf8decode(b),meta:h.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=d,s.inherits(p,c),p.prototype.processChunk=function(h){this.push({data:o.utf8encode(h.data),meta:h.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var s=n("./support"),i=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function l(m){return m}function f(m,v){for(var b=0;b<m.length;++b)v[b]=255&m.charCodeAt(b);return v}n("setimmediate"),o.newBlob=function(m,v){o.checkSupport("blob");try{return new Blob([m],{type:v})}catch{try{var b=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return b.append(m),b.getBlob(v)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(m,v,b){var w=[],_=0,S=m.length;if(S<=b)return String.fromCharCode.apply(null,m);for(;_<S;)v==="array"||v==="nodebuffer"?w.push(String.fromCharCode.apply(null,m.slice(_,Math.min(_+b,S)))):w.push(String.fromCharCode.apply(null,m.subarray(_,Math.min(_+b,S)))),_+=b;return w.join("")},stringifyByChar:function(m){for(var v="",b=0;b<m.length;b++)v+=String.fromCharCode(m[b]);return v},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var v=65536,b=o.getTypeOf(m),w=!0;if(b==="uint8array"?w=d.applyCanBeUsed.uint8array:b==="nodebuffer"&&(w=d.applyCanBeUsed.nodebuffer),w)for(;1<v;)try{return d.stringifyByChunk(m,b,v)}catch{v=Math.floor(v/2)}return d.stringifyByChar(m)}function h(m,v){for(var b=0;b<m.length;b++)v[b]=m[b];return v}o.applyFromCharCode=p;var y={};y.string={string:l,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return y.string.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:function(m){return f(m,a.allocBuffer(m.length))}},y.array={string:p,array:l,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},y.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return h(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:l,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},y.uint8array={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:l,nodebuffer:function(m){return a.newBufferFrom(m)}},y.nodebuffer={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return y.nodebuffer.uint8array(m).buffer},uint8array:function(m){return h(m,new Uint8Array(m.length))},nodebuffer:l},o.transformTo=function(m,v){if(v=v||"",!m)return v;o.checkSupport(m);var b=o.getTypeOf(v);return y[b][m](v)},o.resolve=function(m){for(var v=m.split("/"),b=[],w=0;w<v.length;w++){var _=v[w];_==="."||_===""&&w!==0&&w!==v.length-1||(_===".."?b.pop():b.push(_))}return b.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(m)?"nodebuffer":s.uint8array&&m instanceof Uint8Array?"uint8array":s.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!s[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var v,b,w="";for(b=0;b<(m||"").length;b++)w+="\\x"+((v=m.charCodeAt(b))<16?"0":"")+v.toString(16).toUpperCase();return w},o.delay=function(m,v,b){setImmediate(function(){m.apply(b||null,v||[])})},o.inherits=function(m,v){function b(){}b.prototype=v.prototype,m.prototype=new b},o.extend=function(){var m,v,b={};for(m=0;m<arguments.length;m++)for(v in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],v)&&b[v]===void 0&&(b[v]=arguments[m][v]);return b},o.prepareContent=function(m,v,b,w,_){return c.Promise.resolve(v).then(function(S){return s.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new c.Promise(function(C,O){var T=new FileReader;T.onload=function(P){C(P.target.result)},T.onerror=function(P){O(P.target.error)},T.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(_?S=i.decode(S):b&&w!==!0&&(S=(function(O){return f(O,s.uint8array?new Uint8Array(O.length):new Array(O.length))})(S))),S):c.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./signature"),c=n("./zipEntry"),l=n("./support");function f(d){this.files=[],this.loadOptions=d}f.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(p)+", expected "+i.pretty(d)+")")}},isSignature:function(d,p){var h=this.reader.index;this.reader.setIndex(d);var y=this.reader.readString(4)===p;return this.reader.setIndex(h),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),p=l.uint8array?"uint8array":"array",h=i.transformTo(p,d);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,p,h,y=this.zip64EndOfCentralSize-44;0<y;)d=this.reader.readInt(2),p=this.reader.readInt(4),h=this.reader.readData(p),this.zip64ExtensibleData[d]={id:d,length:p,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,p;for(d=0;d<this.files.length;d++)p=this.files[d],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var p=d;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var y=p-h;if(0<y)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=f},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),l=n("./utf8"),f=n("./compressions"),d=n("./support");function p(h,y){this.options=h,this.loadOptions=y}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var y,m;if(h.skip(22),this.fileNameLength=h.readInt(2),m=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((y=(function(v){for(var b in f)if(Object.prototype.hasOwnProperty.call(f,b)&&f[b].magic===v)return f[b];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,y,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var y=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(y),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=s(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var y,m,v,b=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<b;)y=h.readInt(2),m=h.readInt(2),v=h.readData(m),this.extraFields[y]={id:y,length:m,value:v};h.setIndex(b)},handleUTF8:function(){var h=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var m=i.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var v=this.findExtraFieldUnicodeComment();if(v!==null)this.fileCommentStr=v;else{var b=i.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(b)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var y=s(h.value);return y.readInt(1)!==1||c(this.fileName)!==y.readInt(4)?null:l.utf8decode(y.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var y=s(h.value);return y.readInt(1)!==1||c(this.fileComment)!==y.readInt(4)?null:l.utf8decode(y.readData(h.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function s(y,m,v){this.name=y,this.dir=v.dir,this.date=v.date,this.comment=v.comment,this.unixPermissions=v.unixPermissions,this.dosPermissions=v.dosPermissions,this._data=m,this._dataBinary=v.binary,this.options={compression:v.compression,compressionOptions:v.compressionOptions}}var i=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),l=n("./compressedObject"),f=n("./stream/GenericWorker");s.prototype={internalStream:function(y){var m=null,v="string";try{if(!y)throw new Error("No output type specified.");var b=(v=y.toLowerCase())==="string"||v==="text";v!=="binarystring"&&v!=="text"||(v="string"),m=this._decompressWorker();var w=!this._dataBinary;w&&!b&&(m=m.pipe(new c.Utf8EncodeWorker)),!w&&b&&(m=m.pipe(new c.Utf8DecodeWorker))}catch(_){(m=new f("error")).error(_)}return new i(m,v,"")},async:function(y,m){return this.internalStream(y).accumulate(m)},nodeStream:function(y,m){return this.internalStream(y||"nodebuffer").toNodejsStream(m)},_compressWorker:function(y,m){if(this._data instanceof l&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var v=this._decompressWorker();return this._dataBinary||(v=v.pipe(new c.Utf8EncodeWorker)),l.createWorkerFrom(v,y,m)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof f?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<d.length;h++)s.prototype[d[h]]=p;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(s){var i,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var l=0,f=new c(y),d=s.document.createTextNode("");f.observe(d,{characterData:!0}),i=function(){d.data=l=++l%2}}else if(s.setImmediate||s.MessageChannel===void 0)i="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var m=s.document.createElement("script");m.onreadystatechange=function(){y(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},s.document.documentElement.appendChild(m)}:function(){setTimeout(y,0)};else{var p=new s.MessageChannel;p.port1.onmessage=y,i=function(){p.port2.postMessage(0)}}var h=[];function y(){var m,v;a=!0;for(var b=h.length;b;){for(v=h,h=[],m=-1;++m<b;)v[m]();b=h.length}a=!1}r.exports=function(m){h.push(m)!==1||a||i()}}).call(this,typeof ro<"u"?ro:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var s=n("immediate");function i(){}var a={},c=["REJECTED"],l=["FULFILLED"],f=["PENDING"];function d(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,b!==i&&m(this,b)}function p(b,w,_){this.promise=b,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}function h(b,w,_){s(function(){var S;try{S=w(_)}catch(C){return a.reject(b,C)}S===b?a.reject(b,new TypeError("Cannot resolve promise with itself")):a.resolve(b,S)})}function y(b){var w=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof w=="function")return function(){w.apply(b,arguments)}}function m(b,w){var _=!1;function S(T){_||(_=!0,a.reject(b,T))}function C(T){_||(_=!0,a.resolve(b,T))}var O=v(function(){w(C,S)});O.status==="error"&&S(O.value)}function v(b,w){var _={};try{_.value=b(w),_.status="success"}catch(S){_.status="error",_.value=S}return _}(r.exports=d).prototype.finally=function(b){if(typeof b!="function")return this;var w=this.constructor;return this.then(function(_){return w.resolve(b()).then(function(){return _})},function(_){return w.resolve(b()).then(function(){throw _})})},d.prototype.catch=function(b){return this.then(null,b)},d.prototype.then=function(b,w){if(typeof b!="function"&&this.state===l||typeof w!="function"&&this.state===c)return this;var _=new this.constructor(i);return this.state!==f?h(_,this.state===l?b:w,this.outcome):this.queue.push(new p(_,b,w)),_},p.prototype.callFulfilled=function(b){a.resolve(this.promise,b)},p.prototype.otherCallFulfilled=function(b){h(this.promise,this.onFulfilled,b)},p.prototype.callRejected=function(b){a.reject(this.promise,b)},p.prototype.otherCallRejected=function(b){h(this.promise,this.onRejected,b)},a.resolve=function(b,w){var _=v(y,w);if(_.status==="error")return a.reject(b,_.value);var S=_.value;if(S)m(b,S);else{b.state=l,b.outcome=w;for(var C=-1,O=b.queue.length;++C<O;)b.queue[C].callFulfilled(w)}return b},a.reject=function(b,w){b.state=c,b.outcome=w;for(var _=-1,S=b.queue.length;++_<S;)b.queue[_].callRejected(w);return b},d.resolve=function(b){return b instanceof this?b:a.resolve(new this(i),b)},d.reject=function(b){var w=new this(i);return a.reject(w,b)},d.all=function(b){var w=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=b.length,S=!1;if(!_)return this.resolve([]);for(var C=new Array(_),O=0,T=-1,P=new this(i);++T<_;)N(b[T],T);return P;function N(F,z){w.resolve(F).then(function(R){C[z]=R,++O!==_||S||(S=!0,a.resolve(P,C))},function(R){S||(S=!0,a.reject(P,R))})}},d.race=function(b){var w=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=b.length,S=!1;if(!_)return this.resolve([]);for(var C=-1,O=new this(i);++C<_;)T=b[C],w.resolve(T).then(function(P){S||(S=!0,a.resolve(O,P))},function(P){S||(S=!0,a.reject(O,P))});var T;return O}},{immediate:36}],38:[function(n,r,o){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var s=n("./zlib/deflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),l=n("./zlib/zstream"),f=Object.prototype.toString,d=0,p=-1,h=0,y=8;function m(b){if(!(this instanceof m))return new m(b);this.options=i.assign({level:p,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},b||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var _=s.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(_!==d)throw new Error(c[_]);if(w.header&&s.deflateSetHeader(this.strm,w.header),w.dictionary){var S;if(S=typeof w.dictionary=="string"?a.string2buf(w.dictionary):f.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(_=s.deflateSetDictionary(this.strm,S))!==d)throw new Error(c[_]);this._dict_set=!0}}function v(b,w){var _=new m(w);if(_.push(b,!0),_.err)throw _.msg||c[_.err];return _.result}m.prototype.push=function(b,w){var _,S,C=this.strm,O=this.options.chunkSize;if(this.ended)return!1;S=w===~~w?w:w===!0?4:0,typeof b=="string"?C.input=a.string2buf(b):f.call(b)==="[object ArrayBuffer]"?C.input=new Uint8Array(b):C.input=b,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new i.Buf8(O),C.next_out=0,C.avail_out=O),(_=s.deflate(C,S))!==1&&_!==d)return this.onEnd(_),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(i.shrinkBuf(C.output,C.next_out))):this.onData(i.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&_!==1);return S===4?(_=s.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===d):S!==2||(this.onEnd(d),!(C.avail_out=0))},m.prototype.onData=function(b){this.chunks.push(b)},m.prototype.onEnd=function(b){b===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},o.Deflate=m,o.deflate=v,o.deflateRaw=function(b,w){return(w=w||{}).raw=!0,v(b,w)},o.gzip=function(b,w){return(w=w||{}).gzip=!0,v(b,w)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var s=n("./zlib/inflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),l=n("./zlib/messages"),f=n("./zlib/zstream"),d=n("./zlib/gzheader"),p=Object.prototype.toString;function h(m){if(!(this instanceof h))return new h(m);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},m||{});var v=this.options;v.raw&&0<=v.windowBits&&v.windowBits<16&&(v.windowBits=-v.windowBits,v.windowBits===0&&(v.windowBits=-15)),!(0<=v.windowBits&&v.windowBits<16)||m&&m.windowBits||(v.windowBits+=32),15<v.windowBits&&v.windowBits<48&&(15&v.windowBits)==0&&(v.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var b=s.inflateInit2(this.strm,v.windowBits);if(b!==c.Z_OK)throw new Error(l[b]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function y(m,v){var b=new h(v);if(b.push(m,!0),b.err)throw b.msg||l[b.err];return b.result}h.prototype.push=function(m,v){var b,w,_,S,C,O,T=this.strm,P=this.options.chunkSize,N=this.options.dictionary,F=!1;if(this.ended)return!1;w=v===~~v?v:v===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof m=="string"?T.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?T.input=new Uint8Array(m):T.input=m,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new i.Buf8(P),T.next_out=0,T.avail_out=P),(b=s.inflate(T,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&N&&(O=typeof N=="string"?a.string2buf(N):p.call(N)==="[object ArrayBuffer]"?new Uint8Array(N):N,b=s.inflateSetDictionary(this.strm,O)),b===c.Z_BUF_ERROR&&F===!0&&(b=c.Z_OK,F=!1),b!==c.Z_STREAM_END&&b!==c.Z_OK)return this.onEnd(b),!(this.ended=!0);T.next_out&&(T.avail_out!==0&&b!==c.Z_STREAM_END&&(T.avail_in!==0||w!==c.Z_FINISH&&w!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(_=a.utf8border(T.output,T.next_out),S=T.next_out-_,C=a.buf2string(T.output,_),T.next_out=S,T.avail_out=P-S,S&&i.arraySet(T.output,T.output,_,S,0),this.onData(C)):this.onData(i.shrinkBuf(T.output,T.next_out)))),T.avail_in===0&&T.avail_out===0&&(F=!0)}while((0<T.avail_in||T.avail_out===0)&&b!==c.Z_STREAM_END);return b===c.Z_STREAM_END&&(w=c.Z_FINISH),w===c.Z_FINISH?(b=s.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===c.Z_OK):w!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(T.avail_out=0))},h.prototype.onData=function(m){this.chunks.push(m)},h.prototype.onEnd=function(m){m===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=h,o.inflate=y,o.inflateRaw=function(m,v){return(v=v||{}).raw=!0,y(m,v)},o.ungzip=y},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(c){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var f=l.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var d in f)f.hasOwnProperty(d)&&(c[d]=f[d])}}return c},o.shrinkBuf=function(c,l){return c.length===l?c:c.subarray?c.subarray(0,l):(c.length=l,c)};var i={arraySet:function(c,l,f,d,p){if(l.subarray&&c.subarray)c.set(l.subarray(f,f+d),p);else for(var h=0;h<d;h++)c[p+h]=l[f+h]},flattenChunks:function(c){var l,f,d,p,h,y;for(l=d=0,f=c.length;l<f;l++)d+=c[l].length;for(y=new Uint8Array(d),l=p=0,f=c.length;l<f;l++)h=c[l],y.set(h,p),p+=h.length;return y}},a={arraySet:function(c,l,f,d,p){for(var h=0;h<d;h++)c[p+h]=l[f+h]},flattenChunks:function(c){return[].concat.apply([],c)}};o.setTyped=function(c){c?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,i)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(s)},{}],42:[function(n,r,o){var s=n("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),l=0;l<256;l++)c[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function f(d,p){if(p<65537&&(d.subarray&&a||!d.subarray&&i))return String.fromCharCode.apply(null,s.shrinkBuf(d,p));for(var h="",y=0;y<p;y++)h+=String.fromCharCode(d[y]);return h}c[254]=c[254]=1,o.string2buf=function(d){var p,h,y,m,v,b=d.length,w=0;for(m=0;m<b;m++)(64512&(h=d.charCodeAt(m)))==55296&&m+1<b&&(64512&(y=d.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(y-56320),m++),w+=h<128?1:h<2048?2:h<65536?3:4;for(p=new s.Buf8(w),m=v=0;v<w;m++)(64512&(h=d.charCodeAt(m)))==55296&&m+1<b&&(64512&(y=d.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(y-56320),m++),h<128?p[v++]=h:(h<2048?p[v++]=192|h>>>6:(h<65536?p[v++]=224|h>>>12:(p[v++]=240|h>>>18,p[v++]=128|h>>>12&63),p[v++]=128|h>>>6&63),p[v++]=128|63&h);return p},o.buf2binstring=function(d){return f(d,d.length)},o.binstring2buf=function(d){for(var p=new s.Buf8(d.length),h=0,y=p.length;h<y;h++)p[h]=d.charCodeAt(h);return p},o.buf2string=function(d,p){var h,y,m,v,b=p||d.length,w=new Array(2*b);for(h=y=0;h<b;)if((m=d[h++])<128)w[y++]=m;else if(4<(v=c[m]))w[y++]=65533,h+=v-1;else{for(m&=v===2?31:v===3?15:7;1<v&&h<b;)m=m<<6|63&d[h++],v--;1<v?w[y++]=65533:m<65536?w[y++]=m:(m-=65536,w[y++]=55296|m>>10&1023,w[y++]=56320|1023&m)}return f(w,y)},o.utf8border=function(d,p){var h;for((p=p||d.length)>d.length&&(p=d.length),h=p-1;0<=h&&(192&d[h])==128;)h--;return h<0||h===0?p:h+c[d[h]]>p?h:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(s,i,a,c){for(var l=65535&s|0,f=s>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;f=f+(l=l+i[c++]|0)|0,--d;);l%=65521,f%=65521}return l|f<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var s=(function(){for(var i,a=[],c=0;c<256;c++){i=c;for(var l=0;l<8;l++)i=1&i?3988292384^i>>>1:i>>>1;a[c]=i}return a})();r.exports=function(i,a,c,l){var f=s,d=l+c;i^=-1;for(var p=l;p<d;p++)i=i>>>8^f[255&(i^a[p])];return-1^i}},{}],46:[function(n,r,o){var s,i=n("../utils/common"),a=n("./trees"),c=n("./adler32"),l=n("./crc32"),f=n("./messages"),d=0,p=4,h=0,y=-2,m=-1,v=4,b=2,w=8,_=9,S=286,C=30,O=19,T=2*S+1,P=15,N=3,F=258,z=F+N+1,R=42,H=113,x=1,I=2,$=3,D=4;function q(E,J){return E.msg=f[J],J}function k(E){return(E<<1)-(4<E?9:0)}function Y(E){for(var J=E.length;0<=--J;)E[J]=0}function L(E){var J=E.state,W=J.pending;W>E.avail_out&&(W=E.avail_out),W!==0&&(i.arraySet(E.output,J.pending_buf,J.pending_out,W,E.next_out),E.next_out+=W,J.pending_out+=W,E.total_out+=W,E.avail_out-=W,J.pending-=W,J.pending===0&&(J.pending_out=0))}function j(E,J){a._tr_flush_block(E,0<=E.block_start?E.block_start:-1,E.strstart-E.block_start,J),E.block_start=E.strstart,L(E.strm)}function K(E,J){E.pending_buf[E.pending++]=J}function G(E,J){E.pending_buf[E.pending++]=J>>>8&255,E.pending_buf[E.pending++]=255&J}function Z(E,J){var W,M,A=E.max_chain_length,B=E.strstart,ee=E.prev_length,ne=E.nice_match,U=E.strstart>E.w_size-z?E.strstart-(E.w_size-z):0,oe=E.window,ue=E.w_mask,se=E.prev,ae=E.strstart+F,ge=oe[B+ee-1],pe=oe[B+ee];E.prev_length>=E.good_match&&(A>>=2),ne>E.lookahead&&(ne=E.lookahead);do if(oe[(W=J)+ee]===pe&&oe[W+ee-1]===ge&&oe[W]===oe[B]&&oe[++W]===oe[B+1]){B+=2,W++;do;while(oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&oe[++B]===oe[++W]&&B<ae);if(M=F-(ae-B),B=ae-F,ee<M){if(E.match_start=J,ne<=(ee=M))break;ge=oe[B+ee-1],pe=oe[B+ee]}}while((J=se[J&ue])>U&&--A!=0);return ee<=E.lookahead?ee:E.lookahead}function le(E){var J,W,M,A,B,ee,ne,U,oe,ue,se=E.w_size;do{if(A=E.window_size-E.lookahead-E.strstart,E.strstart>=se+(se-z)){for(i.arraySet(E.window,E.window,se,se,0),E.match_start-=se,E.strstart-=se,E.block_start-=se,J=W=E.hash_size;M=E.head[--J],E.head[J]=se<=M?M-se:0,--W;);for(J=W=se;M=E.prev[--J],E.prev[J]=se<=M?M-se:0,--W;);A+=se}if(E.strm.avail_in===0)break;if(ee=E.strm,ne=E.window,U=E.strstart+E.lookahead,oe=A,ue=void 0,ue=ee.avail_in,oe<ue&&(ue=oe),W=ue===0?0:(ee.avail_in-=ue,i.arraySet(ne,ee.input,ee.next_in,ue,U),ee.state.wrap===1?ee.adler=c(ee.adler,ne,ue,U):ee.state.wrap===2&&(ee.adler=l(ee.adler,ne,ue,U)),ee.next_in+=ue,ee.total_in+=ue,ue),E.lookahead+=W,E.lookahead+E.insert>=N)for(B=E.strstart-E.insert,E.ins_h=E.window[B],E.ins_h=(E.ins_h<<E.hash_shift^E.window[B+1])&E.hash_mask;E.insert&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[B+N-1])&E.hash_mask,E.prev[B&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=B,B++,E.insert--,!(E.lookahead+E.insert<N)););}while(E.lookahead<z&&E.strm.avail_in!==0)}function te(E,J){for(var W,M;;){if(E.lookahead<z){if(le(E),E.lookahead<z&&J===d)return x;if(E.lookahead===0)break}if(W=0,E.lookahead>=N&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),W!==0&&E.strstart-W<=E.w_size-z&&(E.match_length=Z(E,W)),E.match_length>=N)if(M=a._tr_tally(E,E.strstart-E.match_start,E.match_length-N),E.lookahead-=E.match_length,E.match_length<=E.max_lazy_match&&E.lookahead>=N){for(E.match_length--;E.strstart++,E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart,--E.match_length!=0;);E.strstart++}else E.strstart+=E.match_length,E.match_length=0,E.ins_h=E.window[E.strstart],E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+1])&E.hash_mask;else M=a._tr_tally(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++;if(M&&(j(E,!1),E.strm.avail_out===0))return x}return E.insert=E.strstart<N-1?E.strstart:N-1,J===p?(j(E,!0),E.strm.avail_out===0?$:D):E.last_lit&&(j(E,!1),E.strm.avail_out===0)?x:I}function Q(E,J){for(var W,M,A;;){if(E.lookahead<z){if(le(E),E.lookahead<z&&J===d)return x;if(E.lookahead===0)break}if(W=0,E.lookahead>=N&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),E.prev_length=E.match_length,E.prev_match=E.match_start,E.match_length=N-1,W!==0&&E.prev_length<E.max_lazy_match&&E.strstart-W<=E.w_size-z&&(E.match_length=Z(E,W),E.match_length<=5&&(E.strategy===1||E.match_length===N&&4096<E.strstart-E.match_start)&&(E.match_length=N-1)),E.prev_length>=N&&E.match_length<=E.prev_length){for(A=E.strstart+E.lookahead-N,M=a._tr_tally(E,E.strstart-1-E.prev_match,E.prev_length-N),E.lookahead-=E.prev_length-1,E.prev_length-=2;++E.strstart<=A&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,W=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),--E.prev_length!=0;);if(E.match_available=0,E.match_length=N-1,E.strstart++,M&&(j(E,!1),E.strm.avail_out===0))return x}else if(E.match_available){if((M=a._tr_tally(E,0,E.window[E.strstart-1]))&&j(E,!1),E.strstart++,E.lookahead--,E.strm.avail_out===0)return x}else E.match_available=1,E.strstart++,E.lookahead--}return E.match_available&&(M=a._tr_tally(E,0,E.window[E.strstart-1]),E.match_available=0),E.insert=E.strstart<N-1?E.strstart:N-1,J===p?(j(E,!0),E.strm.avail_out===0?$:D):E.last_lit&&(j(E,!1),E.strm.avail_out===0)?x:I}function ie(E,J,W,M,A){this.good_length=E,this.max_lazy=J,this.nice_length=W,this.max_chain=M,this.func=A}function re(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=w,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*T),this.dyn_dtree=new i.Buf16(2*(2*C+1)),this.bl_tree=new i.Buf16(2*(2*O+1)),Y(this.dyn_ltree),Y(this.dyn_dtree),Y(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(P+1),this.heap=new i.Buf16(2*S+1),Y(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*S+1),Y(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ce(E){var J;return E&&E.state?(E.total_in=E.total_out=0,E.data_type=b,(J=E.state).pending=0,J.pending_out=0,J.wrap<0&&(J.wrap=-J.wrap),J.status=J.wrap?R:H,E.adler=J.wrap===2?0:1,J.last_flush=d,a._tr_init(J),h):q(E,y)}function fe(E){var J=ce(E);return J===h&&(function(W){W.window_size=2*W.w_size,Y(W.head),W.max_lazy_match=s[W.level].max_lazy,W.good_match=s[W.level].good_length,W.nice_match=s[W.level].nice_length,W.max_chain_length=s[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=N-1,W.match_available=0,W.ins_h=0})(E.state),J}function ve(E,J,W,M,A,B){if(!E)return y;var ee=1;if(J===m&&(J=6),M<0?(ee=0,M=-M):15<M&&(ee=2,M-=16),A<1||_<A||W!==w||M<8||15<M||J<0||9<J||B<0||v<B)return q(E,y);M===8&&(M=9);var ne=new re;return(E.state=ne).strm=E,ne.wrap=ee,ne.gzhead=null,ne.w_bits=M,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=A+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+N-1)/N),ne.window=new i.Buf8(2*ne.w_size),ne.head=new i.Buf16(ne.hash_size),ne.prev=new i.Buf16(ne.w_size),ne.lit_bufsize=1<<A+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new i.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=J,ne.strategy=B,ne.method=W,fe(E)}s=[new ie(0,0,0,0,function(E,J){var W=65535;for(W>E.pending_buf_size-5&&(W=E.pending_buf_size-5);;){if(E.lookahead<=1){if(le(E),E.lookahead===0&&J===d)return x;if(E.lookahead===0)break}E.strstart+=E.lookahead,E.lookahead=0;var M=E.block_start+W;if((E.strstart===0||E.strstart>=M)&&(E.lookahead=E.strstart-M,E.strstart=M,j(E,!1),E.strm.avail_out===0)||E.strstart-E.block_start>=E.w_size-z&&(j(E,!1),E.strm.avail_out===0))return x}return E.insert=0,J===p?(j(E,!0),E.strm.avail_out===0?$:D):(E.strstart>E.block_start&&(j(E,!1),E.strm.avail_out),x)}),new ie(4,4,8,4,te),new ie(4,5,16,8,te),new ie(4,6,32,32,te),new ie(4,4,16,16,Q),new ie(8,16,32,32,Q),new ie(8,16,128,128,Q),new ie(8,32,128,256,Q),new ie(32,128,258,1024,Q),new ie(32,258,258,4096,Q)],o.deflateInit=function(E,J){return ve(E,J,w,15,8,0)},o.deflateInit2=ve,o.deflateReset=fe,o.deflateResetKeep=ce,o.deflateSetHeader=function(E,J){return E&&E.state?E.state.wrap!==2?y:(E.state.gzhead=J,h):y},o.deflate=function(E,J){var W,M,A,B;if(!E||!E.state||5<J||J<0)return E?q(E,y):y;if(M=E.state,!E.output||!E.input&&E.avail_in!==0||M.status===666&&J!==p)return q(E,E.avail_out===0?-5:y);if(M.strm=E,W=M.last_flush,M.last_flush=J,M.status===R)if(M.wrap===2)E.adler=0,K(M,31),K(M,139),K(M,8),M.gzhead?(K(M,(M.gzhead.text?1:0)+(M.gzhead.hcrc?2:0)+(M.gzhead.extra?4:0)+(M.gzhead.name?8:0)+(M.gzhead.comment?16:0)),K(M,255&M.gzhead.time),K(M,M.gzhead.time>>8&255),K(M,M.gzhead.time>>16&255),K(M,M.gzhead.time>>24&255),K(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),K(M,255&M.gzhead.os),M.gzhead.extra&&M.gzhead.extra.length&&(K(M,255&M.gzhead.extra.length),K(M,M.gzhead.extra.length>>8&255)),M.gzhead.hcrc&&(E.adler=l(E.adler,M.pending_buf,M.pending,0)),M.gzindex=0,M.status=69):(K(M,0),K(M,0),K(M,0),K(M,0),K(M,0),K(M,M.level===9?2:2<=M.strategy||M.level<2?4:0),K(M,3),M.status=H);else{var ee=w+(M.w_bits-8<<4)<<8;ee|=(2<=M.strategy||M.level<2?0:M.level<6?1:M.level===6?2:3)<<6,M.strstart!==0&&(ee|=32),ee+=31-ee%31,M.status=H,G(M,ee),M.strstart!==0&&(G(M,E.adler>>>16),G(M,65535&E.adler)),E.adler=1}if(M.status===69)if(M.gzhead.extra){for(A=M.pending;M.gzindex<(65535&M.gzhead.extra.length)&&(M.pending!==M.pending_buf_size||(M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),L(E),A=M.pending,M.pending!==M.pending_buf_size));)K(M,255&M.gzhead.extra[M.gzindex]),M.gzindex++;M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),M.gzindex===M.gzhead.extra.length&&(M.gzindex=0,M.status=73)}else M.status=73;if(M.status===73)if(M.gzhead.name){A=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),L(E),A=M.pending,M.pending===M.pending_buf_size)){B=1;break}B=M.gzindex<M.gzhead.name.length?255&M.gzhead.name.charCodeAt(M.gzindex++):0,K(M,B)}while(B!==0);M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),B===0&&(M.gzindex=0,M.status=91)}else M.status=91;if(M.status===91)if(M.gzhead.comment){A=M.pending;do{if(M.pending===M.pending_buf_size&&(M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),L(E),A=M.pending,M.pending===M.pending_buf_size)){B=1;break}B=M.gzindex<M.gzhead.comment.length?255&M.gzhead.comment.charCodeAt(M.gzindex++):0,K(M,B)}while(B!==0);M.gzhead.hcrc&&M.pending>A&&(E.adler=l(E.adler,M.pending_buf,M.pending-A,A)),B===0&&(M.status=103)}else M.status=103;if(M.status===103&&(M.gzhead.hcrc?(M.pending+2>M.pending_buf_size&&L(E),M.pending+2<=M.pending_buf_size&&(K(M,255&E.adler),K(M,E.adler>>8&255),E.adler=0,M.status=H)):M.status=H),M.pending!==0){if(L(E),E.avail_out===0)return M.last_flush=-1,h}else if(E.avail_in===0&&k(J)<=k(W)&&J!==p)return q(E,-5);if(M.status===666&&E.avail_in!==0)return q(E,-5);if(E.avail_in!==0||M.lookahead!==0||J!==d&&M.status!==666){var ne=M.strategy===2?(function(U,oe){for(var ue;;){if(U.lookahead===0&&(le(U),U.lookahead===0)){if(oe===d)return x;break}if(U.match_length=0,ue=a._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++,ue&&(j(U,!1),U.strm.avail_out===0))return x}return U.insert=0,oe===p?(j(U,!0),U.strm.avail_out===0?$:D):U.last_lit&&(j(U,!1),U.strm.avail_out===0)?x:I})(M,J):M.strategy===3?(function(U,oe){for(var ue,se,ae,ge,pe=U.window;;){if(U.lookahead<=F){if(le(U),U.lookahead<=F&&oe===d)return x;if(U.lookahead===0)break}if(U.match_length=0,U.lookahead>=N&&0<U.strstart&&(se=pe[ae=U.strstart-1])===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]){ge=U.strstart+F;do;while(se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&se===pe[++ae]&&ae<ge);U.match_length=F-(ge-ae),U.match_length>U.lookahead&&(U.match_length=U.lookahead)}if(U.match_length>=N?(ue=a._tr_tally(U,1,U.match_length-N),U.lookahead-=U.match_length,U.strstart+=U.match_length,U.match_length=0):(ue=a._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++),ue&&(j(U,!1),U.strm.avail_out===0))return x}return U.insert=0,oe===p?(j(U,!0),U.strm.avail_out===0?$:D):U.last_lit&&(j(U,!1),U.strm.avail_out===0)?x:I})(M,J):s[M.level].func(M,J);if(ne!==$&&ne!==D||(M.status=666),ne===x||ne===$)return E.avail_out===0&&(M.last_flush=-1),h;if(ne===I&&(J===1?a._tr_align(M):J!==5&&(a._tr_stored_block(M,0,0,!1),J===3&&(Y(M.head),M.lookahead===0&&(M.strstart=0,M.block_start=0,M.insert=0))),L(E),E.avail_out===0))return M.last_flush=-1,h}return J!==p?h:M.wrap<=0?1:(M.wrap===2?(K(M,255&E.adler),K(M,E.adler>>8&255),K(M,E.adler>>16&255),K(M,E.adler>>24&255),K(M,255&E.total_in),K(M,E.total_in>>8&255),K(M,E.total_in>>16&255),K(M,E.total_in>>24&255)):(G(M,E.adler>>>16),G(M,65535&E.adler)),L(E),0<M.wrap&&(M.wrap=-M.wrap),M.pending!==0?h:1)},o.deflateEnd=function(E){var J;return E&&E.state?(J=E.state.status)!==R&&J!==69&&J!==73&&J!==91&&J!==103&&J!==H&&J!==666?q(E,y):(E.state=null,J===H?q(E,-3):h):y},o.deflateSetDictionary=function(E,J){var W,M,A,B,ee,ne,U,oe,ue=J.length;if(!E||!E.state||(B=(W=E.state).wrap)===2||B===1&&W.status!==R||W.lookahead)return y;for(B===1&&(E.adler=c(E.adler,J,ue,0)),W.wrap=0,ue>=W.w_size&&(B===0&&(Y(W.head),W.strstart=0,W.block_start=0,W.insert=0),oe=new i.Buf8(W.w_size),i.arraySet(oe,J,ue-W.w_size,W.w_size,0),J=oe,ue=W.w_size),ee=E.avail_in,ne=E.next_in,U=E.input,E.avail_in=ue,E.next_in=0,E.input=J,le(W);W.lookahead>=N;){for(M=W.strstart,A=W.lookahead-(N-1);W.ins_h=(W.ins_h<<W.hash_shift^W.window[M+N-1])&W.hash_mask,W.prev[M&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=M,M++,--A;);W.strstart=M,W.lookahead=N-1,le(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=N-1,W.match_available=0,E.next_in=ne,E.input=U,E.avail_in=ee,W.wrap=B,h},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(s,i){var a,c,l,f,d,p,h,y,m,v,b,w,_,S,C,O,T,P,N,F,z,R,H,x,I;a=s.state,c=s.next_in,x=s.input,l=c+(s.avail_in-5),f=s.next_out,I=s.output,d=f-(i-s.avail_out),p=f+(s.avail_out-257),h=a.dmax,y=a.wsize,m=a.whave,v=a.wnext,b=a.window,w=a.hold,_=a.bits,S=a.lencode,C=a.distcode,O=(1<<a.lenbits)-1,T=(1<<a.distbits)-1;e:do{_<15&&(w+=x[c++]<<_,_+=8,w+=x[c++]<<_,_+=8),P=S[w&O];t:for(;;){if(w>>>=N=P>>>24,_-=N,(N=P>>>16&255)===0)I[f++]=65535&P;else{if(!(16&N)){if((64&N)==0){P=S[(65535&P)+(w&(1<<N)-1)];continue t}if(32&N){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}F=65535&P,(N&=15)&&(_<N&&(w+=x[c++]<<_,_+=8),F+=w&(1<<N)-1,w>>>=N,_-=N),_<15&&(w+=x[c++]<<_,_+=8,w+=x[c++]<<_,_+=8),P=C[w&T];n:for(;;){if(w>>>=N=P>>>24,_-=N,!(16&(N=P>>>16&255))){if((64&N)==0){P=C[(65535&P)+(w&(1<<N)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(z=65535&P,_<(N&=15)&&(w+=x[c++]<<_,(_+=8)<N&&(w+=x[c++]<<_,_+=8)),h<(z+=w&(1<<N)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(w>>>=N,_-=N,(N=f-d)<z){if(m<(N=z-N)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(H=b,(R=0)===v){if(R+=y-N,N<F){for(F-=N;I[f++]=b[R++],--N;);R=f-z,H=I}}else if(v<N){if(R+=y+v-N,(N-=v)<F){for(F-=N;I[f++]=b[R++],--N;);if(R=0,v<F){for(F-=N=v;I[f++]=b[R++],--N;);R=f-z,H=I}}}else if(R+=v-N,N<F){for(F-=N;I[f++]=b[R++],--N;);R=f-z,H=I}for(;2<F;)I[f++]=H[R++],I[f++]=H[R++],I[f++]=H[R++],F-=3;F&&(I[f++]=H[R++],1<F&&(I[f++]=H[R++]))}else{for(R=f-z;I[f++]=I[R++],I[f++]=I[R++],I[f++]=I[R++],2<(F-=3););F&&(I[f++]=I[R++],1<F&&(I[f++]=I[R++]))}break}}break}}while(c<l&&f<p);c-=F=_>>3,w&=(1<<(_-=F<<3))-1,s.next_in=c,s.next_out=f,s.avail_in=c<l?l-c+5:5-(c-l),s.avail_out=f<p?p-f+257:257-(f-p),a.hold=w,a.bits=_}},{}],49:[function(n,r,o){var s=n("../utils/common"),i=n("./adler32"),a=n("./crc32"),c=n("./inffast"),l=n("./inftrees"),f=1,d=2,p=0,h=-2,y=1,m=852,v=592;function b(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(R){var H;return R&&R.state?(H=R.state,R.total_in=R.total_out=H.total=0,R.msg="",H.wrap&&(R.adler=1&H.wrap),H.mode=y,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new s.Buf32(m),H.distcode=H.distdyn=new s.Buf32(v),H.sane=1,H.back=-1,p):h}function S(R){var H;return R&&R.state?((H=R.state).wsize=0,H.whave=0,H.wnext=0,_(R)):h}function C(R,H){var x,I;return R&&R.state?(I=R.state,H<0?(x=0,H=-H):(x=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?h:(I.window!==null&&I.wbits!==H&&(I.window=null),I.wrap=x,I.wbits=H,S(R))):h}function O(R,H){var x,I;return R?(I=new w,(R.state=I).window=null,(x=C(R,H))!==p&&(R.state=null),x):h}var T,P,N=!0;function F(R){if(N){var H;for(T=new s.Buf32(512),P=new s.Buf32(32),H=0;H<144;)R.lens[H++]=8;for(;H<256;)R.lens[H++]=9;for(;H<280;)R.lens[H++]=7;for(;H<288;)R.lens[H++]=8;for(l(f,R.lens,0,288,T,0,R.work,{bits:9}),H=0;H<32;)R.lens[H++]=5;l(d,R.lens,0,32,P,0,R.work,{bits:5}),N=!1}R.lencode=T,R.lenbits=9,R.distcode=P,R.distbits=5}function z(R,H,x,I){var $,D=R.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new s.Buf8(D.wsize)),I>=D.wsize?(s.arraySet(D.window,H,x-D.wsize,D.wsize,0),D.wnext=0,D.whave=D.wsize):(I<($=D.wsize-D.wnext)&&($=I),s.arraySet(D.window,H,x-I,$,D.wnext),(I-=$)?(s.arraySet(D.window,H,x-I,I,0),D.wnext=I,D.whave=D.wsize):(D.wnext+=$,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=$))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=_,o.inflateInit=function(R){return O(R,15)},o.inflateInit2=O,o.inflate=function(R,H){var x,I,$,D,q,k,Y,L,j,K,G,Z,le,te,Q,ie,re,ce,fe,ve,E,J,W,M,A=0,B=new s.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return h;(x=R.state).mode===12&&(x.mode=13),q=R.next_out,$=R.output,Y=R.avail_out,D=R.next_in,I=R.input,k=R.avail_in,L=x.hold,j=x.bits,K=k,G=Y,J=p;e:for(;;)switch(x.mode){case y:if(x.wrap===0){x.mode=13;break}for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(2&x.wrap&&L===35615){B[x.check=0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0),j=L=0,x.mode=2;break}if(x.flags=0,x.head&&(x.head.done=!1),!(1&x.wrap)||(((255&L)<<8)+(L>>8))%31){R.msg="incorrect header check",x.mode=30;break}if((15&L)!=8){R.msg="unknown compression method",x.mode=30;break}if(j-=4,E=8+(15&(L>>>=4)),x.wbits===0)x.wbits=E;else if(E>x.wbits){R.msg="invalid window size",x.mode=30;break}x.dmax=1<<E,R.adler=x.check=1,x.mode=512&L?10:12,j=L=0;break;case 2:for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(x.flags=L,(255&x.flags)!=8){R.msg="unknown compression method",x.mode=30;break}if(57344&x.flags){R.msg="unknown header flags set",x.mode=30;break}x.head&&(x.head.text=L>>8&1),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0)),j=L=0,x.mode=3;case 3:for(;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.head&&(x.head.time=L),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,B[2]=L>>>16&255,B[3]=L>>>24&255,x.check=a(x.check,B,4,0)),j=L=0,x.mode=4;case 4:for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.head&&(x.head.xflags=255&L,x.head.os=L>>8),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0)),j=L=0,x.mode=5;case 5:if(1024&x.flags){for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.length=L,x.head&&(x.head.extra_len=L),512&x.flags&&(B[0]=255&L,B[1]=L>>>8&255,x.check=a(x.check,B,2,0)),j=L=0}else x.head&&(x.head.extra=null);x.mode=6;case 6:if(1024&x.flags&&(k<(Z=x.length)&&(Z=k),Z&&(x.head&&(E=x.head.extra_len-x.length,x.head.extra||(x.head.extra=new Array(x.head.extra_len)),s.arraySet(x.head.extra,I,D,Z,E)),512&x.flags&&(x.check=a(x.check,I,Z,D)),k-=Z,D+=Z,x.length-=Z),x.length))break e;x.length=0,x.mode=7;case 7:if(2048&x.flags){if(k===0)break e;for(Z=0;E=I[D+Z++],x.head&&E&&x.length<65536&&(x.head.name+=String.fromCharCode(E)),E&&Z<k;);if(512&x.flags&&(x.check=a(x.check,I,Z,D)),k-=Z,D+=Z,E)break e}else x.head&&(x.head.name=null);x.length=0,x.mode=8;case 8:if(4096&x.flags){if(k===0)break e;for(Z=0;E=I[D+Z++],x.head&&E&&x.length<65536&&(x.head.comment+=String.fromCharCode(E)),E&&Z<k;);if(512&x.flags&&(x.check=a(x.check,I,Z,D)),k-=Z,D+=Z,E)break e}else x.head&&(x.head.comment=null);x.mode=9;case 9:if(512&x.flags){for(;j<16;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(L!==(65535&x.check)){R.msg="header crc mismatch",x.mode=30;break}j=L=0}x.head&&(x.head.hcrc=x.flags>>9&1,x.head.done=!0),R.adler=x.check=0,x.mode=12;break;case 10:for(;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}R.adler=x.check=b(L),j=L=0,x.mode=11;case 11:if(x.havedict===0)return R.next_out=q,R.avail_out=Y,R.next_in=D,R.avail_in=k,x.hold=L,x.bits=j,2;R.adler=x.check=1,x.mode=12;case 12:if(H===5||H===6)break e;case 13:if(x.last){L>>>=7&j,j-=7&j,x.mode=27;break}for(;j<3;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}switch(x.last=1&L,j-=1,3&(L>>>=1)){case 0:x.mode=14;break;case 1:if(F(x),x.mode=20,H!==6)break;L>>>=2,j-=2;break e;case 2:x.mode=17;break;case 3:R.msg="invalid block type",x.mode=30}L>>>=2,j-=2;break;case 14:for(L>>>=7&j,j-=7&j;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if((65535&L)!=(L>>>16^65535)){R.msg="invalid stored block lengths",x.mode=30;break}if(x.length=65535&L,j=L=0,x.mode=15,H===6)break e;case 15:x.mode=16;case 16:if(Z=x.length){if(k<Z&&(Z=k),Y<Z&&(Z=Y),Z===0)break e;s.arraySet($,I,D,Z,q),k-=Z,D+=Z,Y-=Z,q+=Z,x.length-=Z;break}x.mode=12;break;case 17:for(;j<14;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(x.nlen=257+(31&L),L>>>=5,j-=5,x.ndist=1+(31&L),L>>>=5,j-=5,x.ncode=4+(15&L),L>>>=4,j-=4,286<x.nlen||30<x.ndist){R.msg="too many length or distance symbols",x.mode=30;break}x.have=0,x.mode=18;case 18:for(;x.have<x.ncode;){for(;j<3;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.lens[ee[x.have++]]=7&L,L>>>=3,j-=3}for(;x.have<19;)x.lens[ee[x.have++]]=0;if(x.lencode=x.lendyn,x.lenbits=7,W={bits:x.lenbits},J=l(0,x.lens,0,19,x.lencode,0,x.work,W),x.lenbits=W.bits,J){R.msg="invalid code lengths set",x.mode=30;break}x.have=0,x.mode=19;case 19:for(;x.have<x.nlen+x.ndist;){for(;ie=(A=x.lencode[L&(1<<x.lenbits)-1])>>>16&255,re=65535&A,!((Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(re<16)L>>>=Q,j-=Q,x.lens[x.have++]=re;else{if(re===16){for(M=Q+2;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(L>>>=Q,j-=Q,x.have===0){R.msg="invalid bit length repeat",x.mode=30;break}E=x.lens[x.have-1],Z=3+(3&L),L>>>=2,j-=2}else if(re===17){for(M=Q+3;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}j-=Q,E=0,Z=3+(7&(L>>>=Q)),L>>>=3,j-=3}else{for(M=Q+7;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}j-=Q,E=0,Z=11+(127&(L>>>=Q)),L>>>=7,j-=7}if(x.have+Z>x.nlen+x.ndist){R.msg="invalid bit length repeat",x.mode=30;break}for(;Z--;)x.lens[x.have++]=E}}if(x.mode===30)break;if(x.lens[256]===0){R.msg="invalid code -- missing end-of-block",x.mode=30;break}if(x.lenbits=9,W={bits:x.lenbits},J=l(f,x.lens,0,x.nlen,x.lencode,0,x.work,W),x.lenbits=W.bits,J){R.msg="invalid literal/lengths set",x.mode=30;break}if(x.distbits=6,x.distcode=x.distdyn,W={bits:x.distbits},J=l(d,x.lens,x.nlen,x.ndist,x.distcode,0,x.work,W),x.distbits=W.bits,J){R.msg="invalid distances set",x.mode=30;break}if(x.mode=20,H===6)break e;case 20:x.mode=21;case 21:if(6<=k&&258<=Y){R.next_out=q,R.avail_out=Y,R.next_in=D,R.avail_in=k,x.hold=L,x.bits=j,c(R,G),q=R.next_out,$=R.output,Y=R.avail_out,D=R.next_in,I=R.input,k=R.avail_in,L=x.hold,j=x.bits,x.mode===12&&(x.back=-1);break}for(x.back=0;ie=(A=x.lencode[L&(1<<x.lenbits)-1])>>>16&255,re=65535&A,!((Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(ie&&(240&ie)==0){for(ce=Q,fe=ie,ve=re;ie=(A=x.lencode[ve+((L&(1<<ce+fe)-1)>>ce)])>>>16&255,re=65535&A,!(ce+(Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}L>>>=ce,j-=ce,x.back+=ce}if(L>>>=Q,j-=Q,x.back+=Q,x.length=re,ie===0){x.mode=26;break}if(32&ie){x.back=-1,x.mode=12;break}if(64&ie){R.msg="invalid literal/length code",x.mode=30;break}x.extra=15&ie,x.mode=22;case 22:if(x.extra){for(M=x.extra;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.length+=L&(1<<x.extra)-1,L>>>=x.extra,j-=x.extra,x.back+=x.extra}x.was=x.length,x.mode=23;case 23:for(;ie=(A=x.distcode[L&(1<<x.distbits)-1])>>>16&255,re=65535&A,!((Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if((240&ie)==0){for(ce=Q,fe=ie,ve=re;ie=(A=x.distcode[ve+((L&(1<<ce+fe)-1)>>ce)])>>>16&255,re=65535&A,!(ce+(Q=A>>>24)<=j);){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}L>>>=ce,j-=ce,x.back+=ce}if(L>>>=Q,j-=Q,x.back+=Q,64&ie){R.msg="invalid distance code",x.mode=30;break}x.offset=re,x.extra=15&ie,x.mode=24;case 24:if(x.extra){for(M=x.extra;j<M;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}x.offset+=L&(1<<x.extra)-1,L>>>=x.extra,j-=x.extra,x.back+=x.extra}if(x.offset>x.dmax){R.msg="invalid distance too far back",x.mode=30;break}x.mode=25;case 25:if(Y===0)break e;if(Z=G-Y,x.offset>Z){if((Z=x.offset-Z)>x.whave&&x.sane){R.msg="invalid distance too far back",x.mode=30;break}le=Z>x.wnext?(Z-=x.wnext,x.wsize-Z):x.wnext-Z,Z>x.length&&(Z=x.length),te=x.window}else te=$,le=q-x.offset,Z=x.length;for(Y<Z&&(Z=Y),Y-=Z,x.length-=Z;$[q++]=te[le++],--Z;);x.length===0&&(x.mode=21);break;case 26:if(Y===0)break e;$[q++]=x.length,Y--,x.mode=21;break;case 27:if(x.wrap){for(;j<32;){if(k===0)break e;k--,L|=I[D++]<<j,j+=8}if(G-=Y,R.total_out+=G,x.total+=G,G&&(R.adler=x.check=x.flags?a(x.check,$,G,q-G):i(x.check,$,G,q-G)),G=Y,(x.flags?L:b(L))!==x.check){R.msg="incorrect data check",x.mode=30;break}j=L=0}x.mode=28;case 28:if(x.wrap&&x.flags){for(;j<32;){if(k===0)break e;k--,L+=I[D++]<<j,j+=8}if(L!==(4294967295&x.total)){R.msg="incorrect length check",x.mode=30;break}j=L=0}x.mode=29;case 29:J=1;break e;case 30:J=-3;break e;case 31:return-4;default:return h}return R.next_out=q,R.avail_out=Y,R.next_in=D,R.avail_in=k,x.hold=L,x.bits=j,(x.wsize||G!==R.avail_out&&x.mode<30&&(x.mode<27||H!==4))&&z(R,R.output,R.next_out,G-R.avail_out)?(x.mode=31,-4):(K-=R.avail_in,G-=R.avail_out,R.total_in+=K,R.total_out+=G,x.total+=G,x.wrap&&G&&(R.adler=x.check=x.flags?a(x.check,$,G,R.next_out-G):i(x.check,$,G,R.next_out-G)),R.data_type=x.bits+(x.last?64:0)+(x.mode===12?128:0)+(x.mode===20||x.mode===15?256:0),(K==0&&G===0||H===4)&&J===p&&(J=-5),J)},o.inflateEnd=function(R){if(!R||!R.state)return h;var H=R.state;return H.window&&(H.window=null),R.state=null,p},o.inflateGetHeader=function(R,H){var x;return R&&R.state?(2&(x=R.state).wrap)==0?h:((x.head=H).done=!1,p):h},o.inflateSetDictionary=function(R,H){var x,I=H.length;return R&&R.state?(x=R.state).wrap!==0&&x.mode!==11?h:x.mode===11&&i(1,H,I,0)!==x.check?-3:z(R,H,I,I)?(x.mode=31,-4):(x.havedict=1,p):h},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var s=n("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(f,d,p,h,y,m,v,b){var w,_,S,C,O,T,P,N,F,z=b.bits,R=0,H=0,x=0,I=0,$=0,D=0,q=0,k=0,Y=0,L=0,j=null,K=0,G=new s.Buf16(16),Z=new s.Buf16(16),le=null,te=0;for(R=0;R<=15;R++)G[R]=0;for(H=0;H<h;H++)G[d[p+H]]++;for($=z,I=15;1<=I&&G[I]===0;I--);if(I<$&&($=I),I===0)return y[m++]=20971520,y[m++]=20971520,b.bits=1,0;for(x=1;x<I&&G[x]===0;x++);for($<x&&($=x),R=k=1;R<=15;R++)if(k<<=1,(k-=G[R])<0)return-1;if(0<k&&(f===0||I!==1))return-1;for(Z[1]=0,R=1;R<15;R++)Z[R+1]=Z[R]+G[R];for(H=0;H<h;H++)d[p+H]!==0&&(v[Z[d[p+H]]++]=H);if(T=f===0?(j=le=v,19):f===1?(j=i,K-=257,le=a,te-=257,256):(j=c,le=l,-1),R=x,O=m,q=H=L=0,S=-1,C=(Y=1<<(D=$))-1,f===1&&852<Y||f===2&&592<Y)return 1;for(;;){for(P=R-q,F=v[H]<T?(N=0,v[H]):v[H]>T?(N=le[te+v[H]],j[K+v[H]]):(N=96,0),w=1<<R-q,x=_=1<<D;y[O+(L>>q)+(_-=w)]=P<<24|N<<16|F|0,_!==0;);for(w=1<<R-1;L&w;)w>>=1;if(w!==0?(L&=w-1,L+=w):L=0,H++,--G[R]==0){if(R===I)break;R=d[p+v[H]]}if($<R&&(L&C)!==S){for(q===0&&(q=$),O+=x,k=1<<(D=R-q);D+q<I&&!((k-=G[D+q])<=0);)D++,k<<=1;if(Y+=1<<D,f===1&&852<Y||f===2&&592<Y)return 1;y[S=L&C]=$<<24|D<<16|O-m|0}}return L!==0&&(y[O+L]=R-q<<24|64<<16|0),b.bits=$,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var s=n("../utils/common"),i=0,a=1;function c(A){for(var B=A.length;0<=--B;)A[B]=0}var l=0,f=29,d=256,p=d+1+f,h=30,y=19,m=2*p+1,v=15,b=16,w=7,_=256,S=16,C=17,O=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],z=new Array(2*(p+2));c(z);var R=new Array(2*h);c(R);var H=new Array(512);c(H);var x=new Array(256);c(x);var I=new Array(f);c(I);var $,D,q,k=new Array(h);function Y(A,B,ee,ne,U){this.static_tree=A,this.extra_bits=B,this.extra_base=ee,this.elems=ne,this.max_length=U,this.has_stree=A&&A.length}function L(A,B){this.dyn_tree=A,this.max_code=0,this.stat_desc=B}function j(A){return A<256?H[A]:H[256+(A>>>7)]}function K(A,B){A.pending_buf[A.pending++]=255&B,A.pending_buf[A.pending++]=B>>>8&255}function G(A,B,ee){A.bi_valid>b-ee?(A.bi_buf|=B<<A.bi_valid&65535,K(A,A.bi_buf),A.bi_buf=B>>b-A.bi_valid,A.bi_valid+=ee-b):(A.bi_buf|=B<<A.bi_valid&65535,A.bi_valid+=ee)}function Z(A,B,ee){G(A,ee[2*B],ee[2*B+1])}function le(A,B){for(var ee=0;ee|=1&A,A>>>=1,ee<<=1,0<--B;);return ee>>>1}function te(A,B,ee){var ne,U,oe=new Array(v+1),ue=0;for(ne=1;ne<=v;ne++)oe[ne]=ue=ue+ee[ne-1]<<1;for(U=0;U<=B;U++){var se=A[2*U+1];se!==0&&(A[2*U]=le(oe[se]++,se))}}function Q(A){var B;for(B=0;B<p;B++)A.dyn_ltree[2*B]=0;for(B=0;B<h;B++)A.dyn_dtree[2*B]=0;for(B=0;B<y;B++)A.bl_tree[2*B]=0;A.dyn_ltree[2*_]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function ie(A){8<A.bi_valid?K(A,A.bi_buf):0<A.bi_valid&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function re(A,B,ee,ne){var U=2*B,oe=2*ee;return A[U]<A[oe]||A[U]===A[oe]&&ne[B]<=ne[ee]}function ce(A,B,ee){for(var ne=A.heap[ee],U=ee<<1;U<=A.heap_len&&(U<A.heap_len&&re(B,A.heap[U+1],A.heap[U],A.depth)&&U++,!re(B,ne,A.heap[U],A.depth));)A.heap[ee]=A.heap[U],ee=U,U<<=1;A.heap[ee]=ne}function fe(A,B,ee){var ne,U,oe,ue,se=0;if(A.last_lit!==0)for(;ne=A.pending_buf[A.d_buf+2*se]<<8|A.pending_buf[A.d_buf+2*se+1],U=A.pending_buf[A.l_buf+se],se++,ne===0?Z(A,U,B):(Z(A,(oe=x[U])+d+1,B),(ue=T[oe])!==0&&G(A,U-=I[oe],ue),Z(A,oe=j(--ne),ee),(ue=P[oe])!==0&&G(A,ne-=k[oe],ue)),se<A.last_lit;);Z(A,_,B)}function ve(A,B){var ee,ne,U,oe=B.dyn_tree,ue=B.stat_desc.static_tree,se=B.stat_desc.has_stree,ae=B.stat_desc.elems,ge=-1;for(A.heap_len=0,A.heap_max=m,ee=0;ee<ae;ee++)oe[2*ee]!==0?(A.heap[++A.heap_len]=ge=ee,A.depth[ee]=0):oe[2*ee+1]=0;for(;A.heap_len<2;)oe[2*(U=A.heap[++A.heap_len]=ge<2?++ge:0)]=1,A.depth[U]=0,A.opt_len--,se&&(A.static_len-=ue[2*U+1]);for(B.max_code=ge,ee=A.heap_len>>1;1<=ee;ee--)ce(A,oe,ee);for(U=ae;ee=A.heap[1],A.heap[1]=A.heap[A.heap_len--],ce(A,oe,1),ne=A.heap[1],A.heap[--A.heap_max]=ee,A.heap[--A.heap_max]=ne,oe[2*U]=oe[2*ee]+oe[2*ne],A.depth[U]=(A.depth[ee]>=A.depth[ne]?A.depth[ee]:A.depth[ne])+1,oe[2*ee+1]=oe[2*ne+1]=U,A.heap[1]=U++,ce(A,oe,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(pe,Ne){var tt,Fe,nt,Oe,Gt,Ot,rt=Ne.dyn_tree,On=Ne.max_code,Yt=Ne.stat_desc.static_tree,bt=Ne.stat_desc.has_stree,lr=Ne.stat_desc.extra_bits,In=Ne.stat_desc.extra_base,Ie=Ne.stat_desc.max_length,$e=0;for(Oe=0;Oe<=v;Oe++)pe.bl_count[Oe]=0;for(rt[2*pe.heap[pe.heap_max]+1]=0,tt=pe.heap_max+1;tt<m;tt++)Ie<(Oe=rt[2*rt[2*(Fe=pe.heap[tt])+1]+1]+1)&&(Oe=Ie,$e++),rt[2*Fe+1]=Oe,On<Fe||(pe.bl_count[Oe]++,Gt=0,In<=Fe&&(Gt=lr[Fe-In]),Ot=rt[2*Fe],pe.opt_len+=Ot*(Oe+Gt),bt&&(pe.static_len+=Ot*(Yt[2*Fe+1]+Gt)));if($e!==0){do{for(Oe=Ie-1;pe.bl_count[Oe]===0;)Oe--;pe.bl_count[Oe]--,pe.bl_count[Oe+1]+=2,pe.bl_count[Ie]--,$e-=2}while(0<$e);for(Oe=Ie;Oe!==0;Oe--)for(Fe=pe.bl_count[Oe];Fe!==0;)On<(nt=pe.heap[--tt])||(rt[2*nt+1]!==Oe&&(pe.opt_len+=(Oe-rt[2*nt+1])*rt[2*nt],rt[2*nt+1]=Oe),Fe--)}})(A,B),te(oe,ge,A.bl_count)}function E(A,B,ee){var ne,U,oe=-1,ue=B[1],se=0,ae=7,ge=4;for(ue===0&&(ae=138,ge=3),B[2*(ee+1)+1]=65535,ne=0;ne<=ee;ne++)U=ue,ue=B[2*(ne+1)+1],++se<ae&&U===ue||(se<ge?A.bl_tree[2*U]+=se:U!==0?(U!==oe&&A.bl_tree[2*U]++,A.bl_tree[2*S]++):se<=10?A.bl_tree[2*C]++:A.bl_tree[2*O]++,oe=U,ge=(se=0)===ue?(ae=138,3):U===ue?(ae=6,3):(ae=7,4))}function J(A,B,ee){var ne,U,oe=-1,ue=B[1],se=0,ae=7,ge=4;for(ue===0&&(ae=138,ge=3),ne=0;ne<=ee;ne++)if(U=ue,ue=B[2*(ne+1)+1],!(++se<ae&&U===ue)){if(se<ge)for(;Z(A,U,A.bl_tree),--se!=0;);else U!==0?(U!==oe&&(Z(A,U,A.bl_tree),se--),Z(A,S,A.bl_tree),G(A,se-3,2)):se<=10?(Z(A,C,A.bl_tree),G(A,se-3,3)):(Z(A,O,A.bl_tree),G(A,se-11,7));oe=U,ge=(se=0)===ue?(ae=138,3):U===ue?(ae=6,3):(ae=7,4)}}c(k);var W=!1;function M(A,B,ee,ne){G(A,(l<<1)+(ne?1:0),3),(function(U,oe,ue,se){ie(U),K(U,ue),K(U,~ue),s.arraySet(U.pending_buf,U.window,oe,ue,U.pending),U.pending+=ue})(A,B,ee)}o._tr_init=function(A){W||((function(){var B,ee,ne,U,oe,ue=new Array(v+1);for(U=ne=0;U<f-1;U++)for(I[U]=ne,B=0;B<1<<T[U];B++)x[ne++]=U;for(x[ne-1]=U,U=oe=0;U<16;U++)for(k[U]=oe,B=0;B<1<<P[U];B++)H[oe++]=U;for(oe>>=7;U<h;U++)for(k[U]=oe<<7,B=0;B<1<<P[U]-7;B++)H[256+oe++]=U;for(ee=0;ee<=v;ee++)ue[ee]=0;for(B=0;B<=143;)z[2*B+1]=8,B++,ue[8]++;for(;B<=255;)z[2*B+1]=9,B++,ue[9]++;for(;B<=279;)z[2*B+1]=7,B++,ue[7]++;for(;B<=287;)z[2*B+1]=8,B++,ue[8]++;for(te(z,p+1,ue),B=0;B<h;B++)R[2*B+1]=5,R[2*B]=le(B,5);$=new Y(z,T,d+1,p,v),D=new Y(R,P,0,h,v),q=new Y(new Array(0),N,0,y,w)})(),W=!0),A.l_desc=new L(A.dyn_ltree,$),A.d_desc=new L(A.dyn_dtree,D),A.bl_desc=new L(A.bl_tree,q),A.bi_buf=0,A.bi_valid=0,Q(A)},o._tr_stored_block=M,o._tr_flush_block=function(A,B,ee,ne){var U,oe,ue=0;0<A.level?(A.strm.data_type===2&&(A.strm.data_type=(function(se){var ae,ge=4093624447;for(ae=0;ae<=31;ae++,ge>>>=1)if(1&ge&&se.dyn_ltree[2*ae]!==0)return i;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(ae=32;ae<d;ae++)if(se.dyn_ltree[2*ae]!==0)return a;return i})(A)),ve(A,A.l_desc),ve(A,A.d_desc),ue=(function(se){var ae;for(E(se,se.dyn_ltree,se.l_desc.max_code),E(se,se.dyn_dtree,se.d_desc.max_code),ve(se,se.bl_desc),ae=y-1;3<=ae&&se.bl_tree[2*F[ae]+1]===0;ae--);return se.opt_len+=3*(ae+1)+5+5+4,ae})(A),U=A.opt_len+3+7>>>3,(oe=A.static_len+3+7>>>3)<=U&&(U=oe)):U=oe=ee+5,ee+4<=U&&B!==-1?M(A,B,ee,ne):A.strategy===4||oe===U?(G(A,2+(ne?1:0),3),fe(A,z,R)):(G(A,4+(ne?1:0),3),(function(se,ae,ge,pe){var Ne;for(G(se,ae-257,5),G(se,ge-1,5),G(se,pe-4,4),Ne=0;Ne<pe;Ne++)G(se,se.bl_tree[2*F[Ne]+1],3);J(se,se.dyn_ltree,ae-1),J(se,se.dyn_dtree,ge-1)})(A,A.l_desc.max_code+1,A.d_desc.max_code+1,ue+1),fe(A,A.dyn_ltree,A.dyn_dtree)),Q(A),ne&&ie(A)},o._tr_tally=function(A,B,ee){return A.pending_buf[A.d_buf+2*A.last_lit]=B>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&B,A.pending_buf[A.l_buf+A.last_lit]=255&ee,A.last_lit++,B===0?A.dyn_ltree[2*ee]++:(A.matches++,B--,A.dyn_ltree[2*(x[ee]+d+1)]++,A.dyn_dtree[2*j(B)]++),A.last_lit===A.lit_bufsize-1},o._tr_align=function(A){G(A,2,3),Z(A,_,z),(function(B){B.bi_valid===16?(K(B,B.bi_buf),B.bi_buf=0,B.bi_valid=0):8<=B.bi_valid&&(B.pending_buf[B.pending++]=255&B.bi_buf,B.bi_buf>>=8,B.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(s){(function(i,a){if(!i.setImmediate){var c,l,f,d,p=1,h={},y=!1,m=i.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(i);v=v&&v.setTimeout?v:i,c={}.toString.call(i.process)==="[object process]"?function(S){process.nextTick(function(){w(S)})}:(function(){if(i.postMessage&&!i.importScripts){var S=!0,C=i.onmessage;return i.onmessage=function(){S=!1},i.postMessage("","*"),i.onmessage=C,S}})()?(d="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(S){i.postMessage(d+S,"*")}):i.MessageChannel?((f=new MessageChannel).port1.onmessage=function(S){w(S.data)},function(S){f.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(l=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){w(S),C.onreadystatechange=null,l.removeChild(C),C=null},l.appendChild(C)}):function(S){setTimeout(w,0,S)},v.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),O=0;O<C.length;O++)C[O]=arguments[O+1];var T={callback:S,args:C};return h[p]=T,c(p),p++},v.clearImmediate=b}function b(S){delete h[S]}function w(S){if(y)setTimeout(w,0,S);else{var C=h[S];if(C){y=!0;try{(function(O){var T=O.callback,P=O.args;switch(P.length){case 0:T();break;case 1:T(P[0]);break;case 2:T(P[0],P[1]);break;case 3:T(P[0],P[1],P[2]);break;default:T.apply(a,P)}})(C)}finally{b(S),y=!1}}}}function _(S){S.source===i&&typeof S.data=="string"&&S.data.indexOf(d)===0&&w(+S.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof ro<"u"?ro:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(pa)),pa.exports}var BS=FS();const YC=Xn(BS),ni=6e4,bo=6e4,Bn=(e,t)=>`${e} ${t}${e===1?"":"s"} ago`;function n1(e,t=Date.now()){const n=new Date(e),r=Math.max(0,Math.floor((t-n.getTime())/1e3));let o=Math.floor(r/31536e3);return o>=1?Bn(o,"year"):(o=Math.floor(r/2592e3),o>=1?Bn(o,"month"):(o=Math.floor(r/86400),o>=1?Bn(o,"day"):(o=Math.floor(r/3600),o>=1?Bn(o,"hour"):(o=Math.floor(r/60),o>=1?Bn(o,"minute"):Bn(Math.floor(r),"second")))))}function QC(e,t=Date.now()){return e===null||t-e<ni?"just now":n1(e,t)}function XC(e,t=Date.now()){if(e===null)return bo;const n=Math.max(0,t-e);if(n<ni)return ni-n;const r=n%bo;return r===0?bo:bo-r}function $S({id:e,title:t,tags:n,pinned:r,updatedAt:o,onPinned:s,onDelete:i}){const a=n1(Number(o));return g.jsxs("div",{className:xe("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[r&&g.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:g.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[g.jsx(dy,{className:"h-3.5 w-3.5",weight:"fill"}),g.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),g.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[g.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:g.jsxs(Re,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",a]})}),g.jsx(mw,{button:g.jsx(xw,{label:"Note actions",size:"sm"}),items:[{name:r?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>i?.()}]})]}),g.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[g.jsx(Re,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:g.jsx(Wt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:or,params:{id:e},children:t||"Untitled"})}),n.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(c=>g.jsx(Wt,{to:Ep,params:{id:c.id},search:{page:1},children:g.jsx(Re,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:c.name})},c.id))})]})]})]},e)}function HS({isOpen:e,title:t,description:n,references:r,confirmLabel:o,onClose:s,onConfirm:i,confirmVariant:a="primary",isConfirming:c=!1}){return g.jsxs(Vt,{isOpen:e,onClose:s,variant:"inspect",children:[g.jsx(Vt.Header,{title:t,onClose:s}),g.jsx(Vt.Body,{children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Vt.Description,{className:"text-meta font-normal text-fg-secondary",children:n}),g.jsxs("div",{className:"overflow-hidden rounded-[16px] border border-border-subtle bg-hover-subtle/40",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border-subtle px-4 py-3",children:[g.jsx(Re,{as:"p",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:"Referenced notes"}),g.jsxs(Re,{as:"p",variant:"label",tone:"tertiary",children:[r.length," ",r.length===1?"note":"notes"]})]}),g.jsx("ul",{className:"flex flex-col",children:r.map((l,f)=>g.jsx("li",{className:f>0?"border-t border-border-subtle":void 0,children:g.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsx(Re,{as:"p",variant:"body",weight:"medium",className:"min-w-0 flex-1 break-words",children:l.title||"Untitled note"}),g.jsx(At,{asChild:!0,variant:"ghost",size:"sm",className:"self-start sm:self-auto",children:g.jsx(Wt,{to:or,params:{id:l.id},children:"Open note"})})]})},l.id))})]})]})}),g.jsx(Vt.Footer,{children:g.jsxs(i3,{children:[g.jsx(At,{variant:"ghost",size:"sm",onClick:s,disabled:c,children:"Cancel"}),g.jsx(At,{variant:a,size:"sm",onClick:i,isLoading:c,children:o})]})})]})}var Po={exports:{}},zS=Po.exports,nu;function US(){return nu||(nu=1,(function(e,t){(function(n,r){e.exports=r()})(zS,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",f="week",d="month",p="quarter",h="year",y="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(x){var I=["th","st","nd","rd"],$=x%100;return"["+x+(I[($-20)%10]||I[$]||I[0])+"]"}},_=function(x,I,$){var D=String(x);return!D||D.length>=I?x:""+Array(I+1-D.length).join($)+x},S={s:_,z:function(x){var I=-x.utcOffset(),$=Math.abs(I),D=Math.floor($/60),q=$%60;return(I<=0?"+":"-")+_(D,2,"0")+":"+_(q,2,"0")},m:function x(I,$){if(I.date()<$.date())return-x($,I);var D=12*($.year()-I.year())+($.month()-I.month()),q=I.clone().add(D,d),k=$-q<0,Y=I.clone().add(D+(k?-1:1),d);return+(-(D+($-q)/(k?q-Y:Y-q))||0)},a:function(x){return x<0?Math.ceil(x)||0:Math.floor(x)},p:function(x){return{M:d,y:h,w:f,d:l,D:y,h:c,m:a,s:i,ms:s,Q:p}[x]||String(x||"").toLowerCase().replace(/s$/,"")},u:function(x){return x===void 0}},C="en",O={};O[C]=w;var T="$isDayjsObject",P=function(x){return x instanceof R||!(!x||!x[T])},N=function x(I,$,D){var q;if(!I)return C;if(typeof I=="string"){var k=I.toLowerCase();O[k]&&(q=k),$&&(O[k]=$,q=k);var Y=I.split("-");if(!q&&Y.length>1)return x(Y[0])}else{var L=I.name;O[L]=I,q=L}return!D&&q&&(C=q),q||!D&&C},F=function(x,I){if(P(x))return x.clone();var $=typeof I=="object"?I:{};return $.date=x,$.args=arguments,new R($)},z=S;z.l=N,z.i=P,z.w=function(x,I){return F(x,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var R=(function(){function x($){this.$L=N($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[T]=!0}var I=x.prototype;return I.parse=function($){this.$d=(function(D){var q=D.date,k=D.utc;if(q===null)return new Date(NaN);if(z.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var Y=q.match(v);if(Y){var L=Y[2]-1||0,j=(Y[7]||"0").substring(0,3);return k?new Date(Date.UTC(Y[1],L,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)):new Date(Y[1],L,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)}}return new Date(q)})($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return z},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function($,D){var q=F($);return this.startOf(D)<=q&&q<=this.endOf(D)},I.isAfter=function($,D){return F($)<this.startOf(D)},I.isBefore=function($,D){return this.endOf(D)<F($)},I.$g=function($,D,q){return z.u($)?this[D]:this.set(q,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,D){var q=this,k=!!z.u(D)||D,Y=z.p($),L=function(ie,re){var ce=z.w(q.$u?Date.UTC(q.$y,re,ie):new Date(q.$y,re,ie),q);return k?ce:ce.endOf(l)},j=function(ie,re){return z.w(q.toDate()[ie].apply(q.toDate("s"),(k?[0,0,0,0]:[23,59,59,999]).slice(re)),q)},K=this.$W,G=this.$M,Z=this.$D,le="set"+(this.$u?"UTC":"");switch(Y){case h:return k?L(1,0):L(31,11);case d:return k?L(1,G):L(0,G+1);case f:var te=this.$locale().weekStart||0,Q=(K<te?K+7:K)-te;return L(k?Z-Q:Z+(6-Q),G);case l:case y:return j(le+"Hours",0);case c:return j(le+"Minutes",1);case a:return j(le+"Seconds",2);case i:return j(le+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,D){var q,k=z.p($),Y="set"+(this.$u?"UTC":""),L=(q={},q[l]=Y+"Date",q[y]=Y+"Date",q[d]=Y+"Month",q[h]=Y+"FullYear",q[c]=Y+"Hours",q[a]=Y+"Minutes",q[i]=Y+"Seconds",q[s]=Y+"Milliseconds",q)[k],j=k===l?this.$D+(D-this.$W):D;if(k===d||k===h){var K=this.clone().set(y,1);K.$d[L](j),K.init(),this.$d=K.set(y,Math.min(this.$D,K.daysInMonth())).$d}else L&&this.$d[L](j);return this.init(),this},I.set=function($,D){return this.clone().$set($,D)},I.get=function($){return this[z.p($)]()},I.add=function($,D){var q,k=this;$=Number($);var Y=z.p(D),L=function(G){var Z=F(k);return z.w(Z.date(Z.date()+Math.round(G*$)),k)};if(Y===d)return this.set(d,this.$M+$);if(Y===h)return this.set(h,this.$y+$);if(Y===l)return L(1);if(Y===f)return L(7);var j=(q={},q[a]=r,q[c]=o,q[i]=n,q)[Y]||1,K=this.$d.getTime()+$*j;return z.w(K,this)},I.subtract=function($,D){return this.add(-1*$,D)},I.format=function($){var D=this,q=this.$locale();if(!this.isValid())return q.invalidDate||m;var k=$||"YYYY-MM-DDTHH:mm:ssZ",Y=z.z(this),L=this.$H,j=this.$m,K=this.$M,G=q.weekdays,Z=q.months,le=q.meridiem,te=function(re,ce,fe,ve){return re&&(re[ce]||re(D,k))||fe[ce].slice(0,ve)},Q=function(re){return z.s(L%12||12,re,"0")},ie=le||function(re,ce,fe){var ve=re<12?"AM":"PM";return fe?ve.toLowerCase():ve};return k.replace(b,(function(re,ce){return ce||(function(fe){switch(fe){case"YY":return String(D.$y).slice(-2);case"YYYY":return z.s(D.$y,4,"0");case"M":return K+1;case"MM":return z.s(K+1,2,"0");case"MMM":return te(q.monthsShort,K,Z,3);case"MMMM":return te(Z,K);case"D":return D.$D;case"DD":return z.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return te(q.weekdaysMin,D.$W,G,2);case"ddd":return te(q.weekdaysShort,D.$W,G,3);case"dddd":return G[D.$W];case"H":return String(L);case"HH":return z.s(L,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return ie(L,j,!0);case"A":return ie(L,j,!1);case"m":return String(j);case"mm":return z.s(j,2,"0");case"s":return String(D.$s);case"ss":return z.s(D.$s,2,"0");case"SSS":return z.s(D.$ms,3,"0");case"Z":return Y}return null})(re)||Y.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,D,q){var k,Y=this,L=z.p(D),j=F($),K=(j.utcOffset()-this.utcOffset())*r,G=this-j,Z=function(){return z.m(Y,j)};switch(L){case h:k=Z()/12;break;case d:k=Z();break;case p:k=Z()/3;break;case f:k=(G-K)/6048e5;break;case l:k=(G-K)/864e5;break;case c:k=G/o;break;case a:k=G/r;break;case i:k=G/n;break;default:k=G}return q?k:z.a(k)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return O[this.$L]},I.locale=function($,D){if(!$)return this.$L;var q=this.clone(),k=N($,D,!0);return k&&(q.$L=k),q},I.clone=function(){return z.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},x})(),H=R.prototype;return F.prototype=H,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",d],["$y",h],["$D",y]].forEach((function(x){H[x[1]]=function(I){return this.$g(I,x[0],x[1])}})),F.extend=function(x,I){return x.$i||(x(I,R,F),x.$i=!0),F},F.locale=N,F.isDayjs=P,F.unix=function(x){return F(1e3*x)},F.en=O[C],F.Ls=O,F.p={},F}))})(Po)),Po.exports}var VS=US();const Ye=Xn(VS),ZS=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear(),s=new Date(r,n,1).getDay();return Math.ceil((t+s)/7)},WS=()=>[{name:"Year",template:"year",replacement:Ye().format("YYYY")},{name:"Month",template:"month",replacement:Ye().format("MM")},{name:"Short Month",template:"mon",replacement:Ye().format("M")},{name:"Day",template:"day",replacement:Ye().format("DD")},{name:"Short Day",template:"d",replacement:Ye().format("D")},{name:"Week of Month",template:"week_of_month",replacement:ZS().toString()},{name:"Hour 24",template:"hour",replacement:Ye().format("HH")},{name:"Hour 12",template:"hour_12",replacement:Ye().format("hh")},{name:"Short Hour 24",template:"h",replacement:Ye().format("H")},{name:"Short Hour 12",template:"h_12",replacement:Ye().format("h")},{name:"AM/PM",template:"ampm",replacement:Ye().format("A")},{name:"Minute",template:"minute",replacement:Ye().format("mm")},{name:"Short Minute",template:"m",replacement:Ye().format("m")},{name:"Second",template:"second",replacement:Ye().format("ss")},{name:"Short Second",template:"s",replacement:Ye().format("s")}],qS="{%",KS="%}",ru=e=>e.replace(new RegExp(`${qS}([^}]+)${KS}`,"g"),(t,n)=>WS().find(o=>o.template===n)?.replacement||t),wo={title:"Move note to Trash?",description:"This note is referenced by the notes below. Those links may stop opening while this note stays in Trash. If you restore this note later, the links will work again.",confirmLabel:"Move to Trash",confirmVariant:"soft-danger"},r1=()=>{const e=mf(),t=vf(),n=er(),r=Pn(),[o,s]=u.useState(null),i=async(d="",p="",h)=>{const y=ru(d),m=ru(p),v=await CS({title:y,content:m,...h&&{layout:h}});return v.type==="error"?(t(v.errors[0].message),null):(r({to:or,params:{id:v.createNote.id}}),v.createNote.id)},a=async(d,p,h)=>{try{const y=await RS(d,!p);if(y.type==="error"){t(y.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:Me.notes.listAll(),exact:!1}),n.invalidateQueries({queryKey:Me.notes.tagListAll(),exact:!1}),n.invalidateQueries({queryKey:Me.notes.pinned(),exact:!0})]),h?.()}catch{t("Failed to update note pin status")}},c=async(d,p)=>{const h=await AS(d);if(h.type==="error"){t(h.errors[0].message);return}await Promise.all([n.invalidateQueries({queryKey:Me.notes.all(),exact:!1}),n.invalidateQueries({queryKey:Me.tags.all(),exact:!1}),n.invalidateQueries({queryKey:Me.reminders.all(),exact:!1}),n.invalidateQueries({queryKey:Me.images.all(),exact:!1}),n.invalidateQueries({queryKey:["calendar"],exact:!1})]),t("The note has been moved to trash."),p?.()},l=async()=>{if(!o)return;const{id:d,callback:p}=o;s(null),await c(d,p)};return{onCreate:i,onPinned:a,onDelete:async(d,p)=>{const h=await SS(d);if(h.type==="error"){t("Failed to check linked notes before moving this note to Trash.");return}if(n.setQueryData(Me.notes.backReferences(d),h.backReferences),h.backReferences.length>0){s({id:d,callback:p,backReferences:h.backReferences});return}await e("Move this note to trash?")&&await c(d,p)},deleteWarningDialog:g.jsx(HS,{isOpen:!!o,title:wo.title,description:wo.description,references:o?.backReferences??[],confirmLabel:wo.confirmLabel,confirmVariant:wo.confirmVariant,onClose:()=>s(null),onConfirm:()=>{l()}})}},GS="p-3 pb-0",YS="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",QS="flex items-center gap-2.5",XS="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",JS="flex flex-col",e5="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",t5=()=>{const{onCreate:e}=r1();return g.jsx("div",{className:GS,children:g.jsxs("button",{type:"button",className:YS,onClick:()=>e(),children:[g.jsxs("span",{className:QS,children:[g.jsx("span",{className:XS,children:g.jsx(uy,{className:"h-4.5 w-4.5",weight:"bold"})}),g.jsxs("span",{className:JS,children:[g.jsx(Re,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),g.jsx(Re,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),g.jsx(_r,{className:e5,weight:"bold"})]})})},n5=e=>{const[t,n]=u.useState(!1),r=u.useRef(null),o=u.useRef(!0),s=u.useRef(0),i=u.useCallback(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);u.useEffect(()=>(o.current=!0,()=>{o.current=!1,i()}),[i]);const a=u.useCallback(c=>{s.current+=1;const l=s.current;i(),o.current&&n(!0),r.current=setTimeout(()=>{r.current=null,Promise.resolve().then(c).catch(()=>{}).finally(()=>{o.current&&s.current===l&&n(!1)})},e)},[i,e]);return[t,a]},r5="flex flex-col gap-2.5",o5="overflow-hidden rounded-[14px] border border-border-subtle bg-elevated transition-colors focus-within:border-border-focus focus-within:shadow-[0_0_0_4px_color-mix(in_srgb,var(--accent-soft-primary)_90%,transparent)]",s5="grid-search-bar grid items-center border-b border-transparent px-2.5 py-1.5 transition-colors",a5="border-border-subtle/70",i5="",ou="flex h-10 items-center justify-center text-fg-tertiary transition-colors hover:text-fg-default sm:h-8",c5="h-10 w-full bg-transparent py-2 text-meta text-fg-default outline-none placeholder:text-fg-placeholder sm:h-8 sm:py-1.5",l5="max-h-[min(48vh,320px)] overflow-y-auto px-1 py-1.5",su="focus-ring-soft flex min-h-10 items-center gap-2 rounded-[10px] px-2.5 py-2 outline-none transition-colors hover:bg-hover-subtle sm:min-h-0 sm:px-2 sm:py-1.5",u5="min-w-0 flex-1",d5="mt-1 border-t border-border-subtle/50 px-2 pb-0.5 pt-1.5",f5="focus-ring-soft flex min-h-9 items-center gap-1.5 rounded-[10px] text-fg-secondary outline-none transition-colors hover:text-fg-default",h5=()=>{const e=Pn(),[t,n]=u.useState(""),[r,o]=u.useState([]),[s,i]=u.useState(!1),a=u.useRef(0),[,c]=n5(500);u.useEffect(()=>{const m=t.trim();if(m.length<=0){a.current+=1,c(()=>{}),o([]),i(!1);return}const v=a.current+1;a.current=v,o([]),i(!0),c(()=>{t1({query:m,limit:5}).then(b=>{a.current===v&&(o(b.type==="success"?b.allNotes.notes:[]),i(!1))},()=>{a.current===v&&(o([]),i(!1))})})},[t,c]);const l=m=>{m?.preventDefault();const v=t.trim();v.length<=0||e({to:wp,search:{query:v,page:1}})},f=()=>{n("")},d=t.trim().length>0,p=r.length>0,h=d,y=d&&!s&&!p;return g.jsx("div",{className:"p-3",children:g.jsx("form",{className:r5,onSubmit:l,children:g.jsxs("div",{className:o5,children:[g.jsxs("div",{className:`${s5} ${p?a5:i5}`,children:[g.jsx("button",{type:"submit","aria-label":"Search notes",className:ou,children:g.jsx(ly,{className:"h-4.5 w-4.5",weight:"bold"})}),g.jsx("input",{type:"text",placeholder:"Search notes",value:t,onChange:m=>n(m.target.value),className:c5}),t&&g.jsx("button",{type:"button","aria-label":"Clear search",className:ou,onClick:f,children:g.jsx(Ci,{className:"h-4 w-4",weight:"bold"})})]}),(h||y)&&g.jsxs("div",{className:l5,children:[s&&g.jsx("div",{children:[.34,.3,.26,.22,.18].map(m=>g.jsxs("div",{className:su,"aria-hidden":"true",children:[g.jsx(tl,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary opacity-50"}),g.jsx(Lt,{height:"21px",opacity:m,className:"min-w-0 flex-1"})]},m))}),y&&g.jsx(Re,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2",children:"No quick matches."}),r.length>0&&g.jsx("div",{children:r.map(({id:m,title:v})=>g.jsxs(Wt,{to:or,params:{id:m},className:su,children:[g.jsx(tl,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),g.jsx(Re,{as:"span",truncate:!0,variant:"meta",weight:"medium",className:u5,children:v||"Untitled"})]},m))}),g.jsx("div",{className:d5,children:g.jsxs("button",{type:"submit",className:f5,children:[g.jsx(Re,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:"View all results"}),g.jsx(_r,{className:"h-3.5 w-3.5",weight:"bold"})]})})]})]})})})},p5=[{name:"Notes",path:Jr,icon:of},{name:"Views",path:gp,icon:ay},{name:"Graph",path:bp,icon:my},{name:"Calendar",path:vp,icon:ty},{name:"Reminders",path:yp,icon:ey},{name:"Tags",path:xp,icon:py},{name:"Setting",path:_p,icon:iy}],m5=()=>{const e=ds({select:t=>t.pathname});return g.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:p5.map((t,n)=>{const r=e===t.path||t.path!==Jr&&e.startsWith(`${t.path}/`);return g.jsxs(u.Fragment,{children:[n>0&&g.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),g.jsx(Wt,{to:t.path,children:g.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[g.jsx(t.icon,{className:"size-5",weight:r?"fill":"regular"}),g.jsx(Re,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:t.name})]})})]},t.path)})})},g5=({children:e})=>g.jsx(_E,{sidebar:g.jsxs(g.Fragment,{children:[g.jsx(NE,{}),g.jsx(t5,{}),g.jsx(h5,{}),g.jsx(jS,{}),g.jsx(hE,{})]}),topNavigation:g.jsx(m5,{}),children:e}),o1=100,s1=[50,o1,200];function JC(e){return s1.includes(e)}const v5=["updatedAt","createdAt"],y5=["referenceCount","name"],a1=["asc","desc"],b5=["create","update"],Ls=e=>Array.isArray(e)?e[0]:e,cn=(e,t,{min:n=1,max:r=Number.MAX_SAFE_INTEGER}={})=>{const o=Ls(e),s=typeof o=="number"?o:typeof o=="string"?Number(o):Number.NaN;return!Number.isInteger(s)||s<n||s>r?t:s},i1=(e,t,n)=>{const r=cn(e,Number.NaN);return t.includes(r)?r:n},w5=(e,t=!1)=>{const n=Ls(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},js=(e,t="")=>{const n=Ls(e);return typeof n=="string"?n:t},Br=(e,t,n)=>{const r=Ls(e);return typeof r!="string"?n:t.includes(r)?r:n},x5=e=>({page:cn(e.page,1),limit:i1(e.limit,nc,Ms),sortBy:Br(e.sortBy,v5,"updatedAt"),sortOrder:Br(e.sortOrder,a1,"desc"),pinnedFirst:w5(e.pinnedFirst,!1)}),cr=e=>({page:cn(e.page,1)}),E5=e=>({page:cn(e.page,1),query:js(e.query,"")}),_5=e=>({page:cn(e.page,1),query:js(e.query,""),limit:i1(e.limit,s1,o1),sortBy:Br(e.sortBy,y5,"referenceCount"),sortOrder:Br(e.sortOrder,a1,"desc")}),S5=e=>({year:cn(e.year,Ye().year(),{min:1970,max:9999}),month:cn(e.month,Ye().month()+1,{min:1,max:12}),type:Br(e.type,b5,"create")}),C5=e=>{const t=js(e.selected,"").trim();return t?{selected:t}:{}},R5=e=>({page:cn(e.page,1),sectionId:js(e.sectionId,"")}),au=cg(Jr);function A5(){const e=au.useNavigate(),{limit:t,page:n,sortBy:r,sortOrder:o,pinnedFirst:s}=au.useSearch(),{onDelete:i,onPinned:a,deleteWarningDialog:c}=r1(),l=f=>{e({search:d=>({...d,...f})})};return g.jsxs(Ns,{title:"",variant:"none",children:[g.jsxs("div",{className:"flex flex-col gap-5",children:[g.jsx(l3,{itemsPerPage:t,onItemsPerPageChange:f=>l({limit:f,page:1}),sortBy:r,onSortByChange:f=>l({sortBy:f,page:1}),sortOrder:o,onSortOrderChange:f=>l({sortOrder:f,page:1}),pinnedFirst:s,onPinnedFirstChange:f=>l({pinnedFirst:f,page:1})}),g.jsx(Cp,{fallback:g.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[g.jsx(Lt,{height:"112px"}),g.jsx(Lt,{height:"112px"}),g.jsx(Lt,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,r,o,s],children:g.jsx(PS,{searchParams:{offset:(n-1)*t,limit:t,sortBy:r,sortOrder:o,pinnedFirst:s},render:({notes:f,totalCount:d})=>g.jsx(Tl,{fallback:g.jsx(y0,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:f.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid-auto-cards grid gap-5",children:f.map(p=>g.jsx($S,{...p,onPinned:()=>a(p.id,p.pinned),onDelete:()=>i(p.id)},p.id))}),g.jsx(Tl,{fallback:null,children:d&&t<d&&g.jsx(w0,{page:n,last:Math.ceil(d/t),onChange:p=>{l({page:p})}})})]})})})})]}),c]})}const qe=fg({component:()=>g.jsx(g5,{children:g.jsx(Iu,{})}),errorComponent:eE,notFoundComponent:tE}),T5=We({getParentRoute:()=>qe,path:Jr,component:A5,validateSearch:x5}),P5=We({getParentRoute:()=>qe,path:vp,component:et(()=>Je(()=>import("./Calendar-CgWgr1BV.js"),__vite__mapDeps([0,1,2,3,4]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:S5}),M5=We({getParentRoute:()=>qe,path:gp,component:et(()=>Je(()=>import("./Views-B_wsb-XJ.js"),__vite__mapDeps([5,1,2,3,6,7,8,9,10]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading views",description:"Preparing your saved dashboards."})}),N5=We({getParentRoute:()=>qe,path:yp,component:et(()=>Je(()=>import("./Reminders-C10fHQcl.js"),__vite__mapDeps([11,1,2,3,12]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:cr}),O5=We({getParentRoute:()=>qe,path:bp,component:et(()=>Je(()=>import("./Graph-kCltGRlY.js"),__vite__mapDeps([13,1,2,3,9]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:C5}),I5=We({getParentRoute:()=>qe,path:wp,component:et(()=>Je(()=>import("./Search-tf2nV4v0.js"),__vite__mapDeps([14,1,2,3]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:E5}),k5=We({getParentRoute:()=>qe,path:xp,component:et(()=>Je(()=>import("./Tag-uCoYbISy.js"),__vite__mapDeps([15,1,2,3,6]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:_5}),D5=We({getParentRoute:()=>qe,path:or,component:et(()=>Je(()=>import("./Note-BW6Np_5g.js"),__vite__mapDeps([16,1,2,3,4,10,8,12,17,18,6]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading note",description:"Preparing the editor and note content."})}),L5=We({getParentRoute:()=>qe,path:Ep,component:et(()=>Je(()=>import("./TagNotes-CqOcQiRw.js"),__vite__mapDeps([19,1,2,3]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:cr}),j5=We({getParentRoute:()=>qe,path:Z3,component:et(()=>Je(()=>import("./ViewNotes-slPXXoOY.js"),__vite__mapDeps([20,1,2,3,6,7]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:R5}),F5=We({getParentRoute:()=>qe,path:_p,component:et(()=>Je(()=>import("./index-D83QbOcw.js"),__vite__mapDeps([21,1,2,3,22,23,24]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading settings",description:"Preparing workspace preferences."})}),B5=We({getParentRoute:()=>qe,path:W3,component:et(()=>Je(()=>import("./mcp-Dd98N9Hq.js"),__vite__mapDeps([25,1,2,3,22,18]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),$5=We({getParentRoute:()=>qe,path:q3,component:et(()=>Je(()=>import("./trash-wojQBK9Z.js"),__vite__mapDeps([26,1,2,3,8]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:cr}),H5=We({getParentRoute:()=>qe,path:K3,component:et(()=>Je(()=>import("./manage-image-BYIhWu56.js"),__vite__mapDeps([27,1,2,3,17,28,8,24]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:cr}),z5=We({getParentRoute:()=>qe,path:G3,component:et(()=>Je(()=>import("./manage-image-detail-6KgmQvbN.js"),__vite__mapDeps([29,1,2,3,17,28,8,24,23]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading image detail",description:"Preparing references for the selected image."})}),U5=We({getParentRoute:()=>qe,path:Q3,component:et(()=>Je(()=>import("./properties-CyVRKgcT.js"),__vite__mapDeps([30,1,2,3]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:cr}),V5=We({getParentRoute:()=>qe,path:Y3,component:et(()=>Je(()=>import("./placeholder-siHGg9aK.js"),__vite__mapDeps([31,1,2,3,8,10]))),pendingComponent:()=>g.jsx(Ge,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:cr}),Z5=qe.addChildren([T5,M5,P5,N5,O5,I5,k5,D5,L5,j5,F5,B5,$5,H5,z5,V5,U5]),W5=wg({routeTree:Z5,defaultPendingComponent:()=>g.jsx(Ge,{title:"Loading page",description:"Preparing the next route."})});function q5(){const e=Qo(n=>n.setSystemTheme),t=Qo(n=>n.setTheme);return u.useEffect(()=>{const n=Yo();return n&&t(n),C1.listenThemeChange(r=>{Yo()||e(r?"dark":"light")},n==null)},[e,t]),g.jsx(h8,{children:g.jsx(_g,{router:W5})})}const c1="__oceanBrainCsrfRetry";let ma;const K5=e=>!Se.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",l1=e=>{if(!K5(e)||!Se.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[c1])},G5=()=>(ma??=Vo().finally(()=>{ma=void 0}),ma),iu=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Y5=e=>{iu(e.headers,"X-XSRF-TOKEN"),iu(e.headers,"x-xsrf-token")},Q5=async e=>{if(!l1(e)||!Se.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[c1]=!0,await G5()!=="active"?Promise.reject(e):(Y5(t),Se.request(t))};let cu;const X5=()=>{cu===void 0&&(cu=Se.interceptors.response.use(e=>e,e=>{if(Z6(e))Bf();else if(l1(e))return Q5(e);return Promise.reject(e)}))};Qo.setState({theme:fE()});X5();Vo();x1.createRoot(document.getElementById("root")).render(g.jsx(X.StrictMode,{children:g.jsx(q5,{})}));export{Qo as $,jr as A,At as B,vp as C,mw as D,b0 as E,i3 as F,mf as G,bS as H,vw as I,dc as J,lc as K,Wt as L,Vt as M,or as N,DC as O,Ns as P,y0 as Q,nS as R,Ao as S,Re as T,iS as U,Z3 as V,oy as W,Wf as X,Cp as Y,w0 as Z,yp as _,ey as a,yx as a$,my as a0,ly as a1,Ci as a2,bp as a3,rc as a4,Ku as a5,GC as a6,ze as a7,PS as a8,wp as a9,UC as aA,zC as aB,wx as aC,Nx as aD,Ox as aE,ny as aF,cy as aG,t1 as aH,Pn as aI,$C as aJ,AC as aK,IC as aL,XC as aM,u8 as aN,r1 as aO,q3 as aP,dy as aQ,QC as aR,CS as aS,ru as aT,OC as aU,$S as aV,gp as aW,Y3 as aX,uy as aY,K3 as aZ,W3 as a_,n5 as aa,of as ab,s1 as ac,o1 as ad,JC as ae,fy as af,Tl as ag,Ep as ah,xp as ai,it as aj,SS as ak,YC as al,PC as am,BC as an,cw as ao,lw as ap,m0 as aq,pw as ar,v0 as as,g0 as at,Q3 as au,iy as av,py as aw,HC as ax,s2 as ay,VC as az,ty as b,Se as b0,ZC as b1,qC as b2,KC as b3,HS as b4,WC as b5,G3 as b6,Ga as b7,kC as b8,ME as b9,LC as ba,jC as bb,FC as bc,WS as bd,qS as be,KS as bf,Ke as bg,xe as c,Ye as d,zn as e,Xs as f,_r as g,Pe as h,Lt as i,cg as j,er as k,xw as l,vf as m,WE as n,zl as o,b_ as p,Me as q,K_ as r,tl as s,n1 as t,o2 as u,MC as v,KE as w,lS as x,NC as y,gS as z};
|