From 692801e9c6c9c41c7e14038ce7759595c2115847 Mon Sep 17 00:00:00 2001 From: cybaka520 Date: Wed, 21 Oct 2026 23:29:15 +0800 Subject: [PATCH 01/35] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=20Android=20?= =?UTF-8?q?=E5=8E=9F=E7=94=9F=E5=BA=94=E7=94=A8=E6=A0=B8=E5=BF=83=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/README.md | 60 +- android/app/build.gradle.kts | 5 + android/app/src/main/AndroidManifest.xml | 14 + .../assets/lyrics/assets/index-BNskd8AZ.css | 1 + .../assets/lyrics/assets/index-BTu8M9aj.js | 817 ++++++++++++++ android/app/src/main/assets/lyrics/index.html | 13 + .../amll/hub/android/data/lyric/TtmlParser.kt | 189 ++++ .../hub/android/data/remote/ContentApi.kt | 82 ++ .../hub/android/data/remote/ContentDto.kt | 177 ++++ .../hub/android/data/remote/NetworkModule.kt | 13 +- .../amll/hub/android/data/remote/RawApi.kt | 23 + .../android/data/repo/ContentRepository.kt | 100 ++ .../dev/amll/hub/android/nav/AmllNavGraph.kt | 159 ++- .../hub/android/playback/PlaybackService.kt | 54 + .../hub/android/playback/PlayerController.kt | 143 +++ .../java/dev/amll/hub/android/ui/AppNav.kt | 17 + .../dev/amll/hub/android/ui/AppViewModel.kt | 302 ++++++ .../amll/hub/android/ui/component/Common.kt | 451 ++++++++ .../hub/android/ui/component/SearchSheet.kt | 250 +++++ .../amll/hub/android/ui/screen/FlowScreens.kt | 987 +++++++++++++++++ .../amll/hub/android/ui/screen/HomeScreen.kt | 133 --- .../amll/hub/android/ui/screen/MainScreens.kt | 993 ++++++++++++++++++ .../dev/amll/hub/android/ui/theme/Color.kt | 13 +- .../dev/amll/hub/android/ui/theme/Dimens.kt | 132 +++ .../dev/amll/hub/android/ui/theme/Palette.kt | 77 ++ .../res/drawable/ic_launcher_foreground.xml | 39 +- android/gradle/libs.versions.toml | 5 + android/lyrics-web/.gitignore | 2 + android/lyrics-web/index.html | 12 + android/lyrics-web/package.json | 10 + android/lyrics-web/pnpm-lock.yaml | 9 + android/lyrics-web/src/main.tsx | 109 ++ android/lyrics-web/src/page.css | 31 + android/lyrics-web/vite.config.ts | 18 + frontend/src/components/LyricsPage.tsx | 144 ++- frontend/src/lib/motion.ts | 2 +- 36 files changed, 5364 insertions(+), 222 deletions(-) create mode 100644 android/app/src/main/assets/lyrics/assets/index-BNskd8AZ.css create mode 100644 android/app/src/main/assets/lyrics/assets/index-BTu8M9aj.js create mode 100644 android/app/src/main/assets/lyrics/index.html create mode 100644 android/app/src/main/java/dev/amll/hub/android/data/lyric/TtmlParser.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/data/remote/ContentApi.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/data/remote/ContentDto.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/data/remote/RawApi.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/data/repo/ContentRepository.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/playback/PlaybackService.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/playback/PlayerController.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/AppNav.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/AppViewModel.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/component/Common.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/component/SearchSheet.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/screen/FlowScreens.kt delete mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/screen/HomeScreen.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/screen/MainScreens.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/theme/Dimens.kt create mode 100644 android/app/src/main/java/dev/amll/hub/android/ui/theme/Palette.kt create mode 100644 android/lyrics-web/.gitignore create mode 100644 android/lyrics-web/index.html create mode 100644 android/lyrics-web/package.json create mode 100644 android/lyrics-web/pnpm-lock.yaml create mode 100644 android/lyrics-web/src/main.tsx create mode 100644 android/lyrics-web/src/page.css create mode 100644 android/lyrics-web/vite.config.ts diff --git a/android/README.md b/android/README.md index 2ff5cc4..08defe6 100644 --- a/android/README.md +++ b/android/README.md @@ -78,20 +78,60 @@ PR 与 push 到 `main` / `master` 时触发,仅在 `android/**` 有变更时 ``` app/src/main/java/dev/amll/hub/android/ -├── MainActivity.kt # 入口,处理 amllhub:// deep link +├── MainActivity.kt # 入口,处理 amllhub:// deep link ├── data/ -│ ├── local/AuthStore.kt # DataStore 存 token -│ └── remote/ # Retrofit API、DTO、错误映射 -├── di/AppModule.kt # Hilt 模块 -├── nav/AmllNavGraph.kt # 登录 / 首页 / 扫码 +│ ├── local/AuthStore.kt # DataStore 存 token +│ ├── lyric/TtmlParser.kt # TTML → 逐字行(翻译 / 音译 / 背景行) +│ ├── remote/ # Retrofit API、DTO、错误映射 +│ └── repo/ContentRepository.kt# 内容仓库,接口失败降级为空 +├── playback/ +│ ├── PlayerController.kt # Media3 ExoPlayer + 播放状态 StateFlow +│ └── PlaybackService.kt # MediaSessionService,后台播放与通知栏 +├── di/AppModule.kt # Hilt 模块 +├── nav/AmllNavGraph.kt # 登录态 → 5 Tab + 二级页 + 启动页 └── ui/ - ├── component/ # QrScannerView、ErrorBanner - ├── screen/ # Login / Home / Scan + ViewModel - └── theme/ # 颜色与字体,对齐网页端 token + ├── AppNav.kt # 页面跳转集合 + ├── AppViewModel.kt # Activity 级共享状态(首页/榜单/歌词/播放) + ├── component/Common.kt # TopBar / PillTabBar / SongRow / EmptyState… + ├── screen/ + │ ├── MainScreens.kt # 首页 / 发现 / 排行榜 / 每日推荐 / 消息 / 我的 + │ └── FlowScreens.kt # 歌词详情 / 沉浸播放 / 创作 / 投稿 / 稿件 / 审核 + └── theme/ # Palette(6 组语义色)+ Dimens(1:1 token) ``` +## 沉浸播放的歌词页(react-full) + +全屏沉浸播放用 WebView 承载网页端同款歌词渲染(`@applemusic-like-lyrics/react-full` 的 +`PrebuiltLyricPlayer` + jotai atoms),源码在 `android/lyrics-web/`,构建产物直接落到 +`app/src/main/assets/lyrics/`,APK 内离线可用。 + +```bash +cd android/lyrics-web + +# 复用 frontend 已装好的依赖(避免重复下载) +# Windows: New-Item -ItemType Junction -Path node_modules -Target ../../frontend/node_modules +# macOS/Linux: ln -s ../../frontend/node_modules node_modules + +node ../../frontend/node_modules/vite/bin/vite.js build +``` + +原生侧通过 `WebViewAssetLoader` 以 `https://appassets.androidplatform.net/assets/lyrics/index.html` +加载,避免 `file://` 下 ES Module 的跨域限制;进度与播放态由 `PlayerController` 通过 +`window.amllNative` 写入。 + ## 待办 -- 个人中心(资料编辑、头像上传、密码修改) -- 投稿与歌词浏览 +- 游客态浏览:当前沿用登录门禁,未登录只显示登录页 +- 投稿提交:表单已还原,但 TTML 解析与文件上传未接,提交按钮暂未落库 +- 头像上传、审核操作(通过 / 驳回)、每日推荐「下载图片」 +- 稿件详情的「原文件 / 文件效果」对比视图 - 正式签名配置(当前 release 走 debug key) + +## 已接通的交互 + +- 首页 / 发现的搜索框 → 半屏搜索弹层(词库 `/api/v1/search` + 网易云 `/api/v1/ncm/search`) +- 榜单 / 最新收录 / 推荐卡 → 歌词详情;封面点按 → WebView 沉浸播放 +- 每日推荐点赞(乐观更新 + 失败回滚)、消息全部已读 / 单条已读 +- 我的页读 `/api/v1/auth/profile`;编辑资料保存昵称走 `PUT /api/v1/auth/profile` +- 创作中心稿件列表 → 稿件详情(`GET /api/v1/submissions/{id}`) + diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index cb4ddc4..9c58d7c 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -102,6 +102,11 @@ dependencies { implementation(libs.androidx.navigation.compose) + // 播放(Media3)与内嵌歌词页 + implementation(libs.androidx.media3.exoplayer) + implementation(libs.androidx.media3.session) + implementation(libs.androidx.webkit) + // DI implementation(libs.hilt.android) implementation(libs.androidx.hilt.navigation.compose) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9fc101d..a564131 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,10 @@ + + + + @@ -37,5 +41,15 @@ + + + + + + + diff --git a/android/app/src/main/assets/lyrics/assets/index-BNskd8AZ.css b/android/app/src/main/assets/lyrics/assets/index-BNskd8AZ.css new file mode 100644 index 0000000..7efd345 --- /dev/null +++ b/android/app/src/main/assets/lyrics/assets/index-BNskd8AZ.css @@ -0,0 +1 @@ +.amll-lyric-player{width:100%;max-width:100%;height:100%;color:var(--amll-lp-color, white);contain:strict;mix-blend-mode:plus-lighter;font-size:var(--amll-lp-font-size, max(max(5vh, 2.5vw), 12px));overflow:hidden}@media screen and (max-width:768px){.amll-lyric-player{font-size:var(--amll-lp-font-size, max(8vw, 12px))}}.amll-lyric-player.dom{--amll-lp-line-width-aspect: .8;--amll-lp-line-padding-x: 1em;--amll-lp-bg-line-scale: .7;-webkit-user-select:none;user-select:none;box-sizing:content-box;z-index:1;line-height:1.2}@media screen and (max-width:768px){.amll-lyric-player{--amll-lp-line-width-aspect: 1;--amll-lp-line-padding-x: 0}}.FmKaba_lyricLineWrapper{box-sizing:border-box;width:100%;padding:.4em var(--lyric-line-padding-x);will-change:transform,opacity,filter;border-radius:.25em;flex-direction:column;align-items:flex-start;gap:.3em;transition:opacity .4s,filter .4s,background-color .25s;display:flex;position:absolute;top:0;left:0}.FmKaba_lyricLineWrapper:hover{background-color:var(--amll-lp-hover-bg-color, #fff1)}.FmKaba_lyricLineWrapper:active{background-color:var(--amll-lp-hover-bg-color, #ffffff05)}.FmKaba_lyricLine{box-sizing:border-box;width:var(--amll-lp-width, 100%);min-width:var(--amll-lp-width, 100%);max-width:var(--amll-lp-width, 100%);contain:layout style paint;content-visibility:auto;contain-intrinsic-size:auto 40px;backface-visibility:hidden;transform-origin:0;will-change:transform,filter,opacity;height:fit-content;margin:-.2em;padding:.2em;transition:box-shadow .25s;position:relative}.FmKaba_lyricDuetLine{text-align:right;transform-origin:100%}.FmKaba_lyricMainLine{contain:layout style;margin:-1em;padding:1em;transition:opacity .3s .1s}.FmKaba_lyricMainLine span{text-align:start;vertical-align:bottom;display:inline-block}.FmKaba_lyricMainLine .FmKaba_romanWord{padding-inline-end:.3em;font-size:.5em;line-height:1em;display:flex}.FmKaba_lyricMainLine .FmKaba_rubyWord{justify-content:center;min-height:1em;font-size:.5em;line-height:1em;display:flex}.FmKaba_lyricMainLine .FmKaba_wordWithRuby{vertical-align:bottom;flex-direction:column;align-items:center;display:inline-flex}.FmKaba_lyricMainLine .FmKaba_wordBody{flex-direction:column;align-items:center;display:flex}.FmKaba_lyricMainLine>span,.FmKaba_lyricMainLine span.FmKaba_emphasizeWrapper{white-space:pre-wrap;vertical-align:bottom;will-change:transform,text-shadow;contain:layout style;margin:-1em;padding:1em;display:inline-block}:is(.FmKaba_lyricMainLine>span,.FmKaba_lyricMainLine span.FmKaba_emphasizeWrapper).FmKaba_emphasize,:is(.FmKaba_lyricMainLine>span,.FmKaba_lyricMainLine span.FmKaba_emphasizeWrapper) span.FmKaba_emphasize{backface-visibility:hidden;margin:-1em;padding:1em}:is(:is(.FmKaba_lyricMainLine>span,.FmKaba_lyricMainLine span.FmKaba_emphasizeWrapper).FmKaba_emphasize,:is(.FmKaba_lyricMainLine>span,.FmKaba_lyricMainLine span.FmKaba_emphasizeWrapper) span.FmKaba_emphasize)>span{will-change:transform,text-shadow;backface-visibility:hidden;margin:-1em;padding:1em}.FmKaba_lyricBgLine{opacity:.4;font-size:max(calc(1em * var(--amll-lp-bg-line-scale, .7)),10px);transition:background-color .25s,box-shadow .25s}.FmKaba_lyricBgLine .FmKaba_lyricMainLine{padding:1.2em 1em}.FmKaba_lyricBgLine.FmKaba_active{opacity:.4;transition:background-color .25s,box-shadow .25s}.FmKaba_lyricSubLine{opacity:.3;font-size:max(.5em,10px);line-height:1.5em;transition:opacity .2s .25s}@supports (mix-blend-mode: plus-lighter){.FmKaba_lyricSubLine{opacity:.3}}.FmKaba_bottomLine{cursor:default;padding-top:0;padding-bottom:0;line-height:1.8em}.FmKaba_bottomLine:empty{height:0;margin:0;padding:0;display:none}.FmKaba_bgWrapper{top:100%;left:var(--lyric-line-padding-x);z-index:-1;align-items:inherit;width:calc(100% - var(--lyric-line-padding-x) * 2);visibility:visible;pointer-events:auto;opacity:0;transform-origin:0 0;flex-direction:column;transition:opacity .3s;display:flex;position:absolute}.FmKaba_bgWrapperTop{transform-origin:0 100%;width:100%;margin-top:-999px;position:relative;top:auto;bottom:auto;left:0}.FmKaba_bgWrapperActive{opacity:1;width:100%;position:relative;top:auto;bottom:auto;left:0}.FmKaba_bgWrapperHidden{visibility:hidden;pointer-events:none}.FmKaba_interludeDots{opacity:0;transform-origin:center;gap:.25em;width:fit-content;height:clamp(.5em,1vh,3em);padding:2.5% .75em;transition:opacity .25s;display:flex;position:absolute;left:0}.FmKaba_interludeDots.FmKaba_enabled{opacity:1}.FmKaba_interludeDots>*{background-color:var(--amll-lp-color, white);aspect-ratio:1;border-radius:50%;width:clamp(.5em,1vh,3em);height:clamp(.5em,1vh,3em);margin-right:4px;display:inline-block}.FmKaba_interludeDots.FmKaba_duet{transform-origin:center;right:0}.FmKaba_disableSpring>*,.FmKaba_disableSpring .FmKaba_lyricLine{transition:filter .25s,transform .5s,background-color .25s,box-shadow .25s}.FmKaba_tmpDisableTransition{transition:none!important}.amll-lyric-player{--lyric-line-padding-x: 1em}@media screen and (max-width:500px){.amll-lyric-player{--lyric-line-padding-x: 20px}}.amll-lyric-player:hover .FmKaba_lyricLine,.amll-lyric-player:hover .FmKaba_lyricLineWrapper{filter:unset!important}.amll-lyric-player:not(.FmKaba_playing) .FmKaba_bgWrapper{opacity:1;width:100%;position:relative;top:auto;bottom:auto;left:0}.amll-lyric-player.FmKaba_hasDuetLine .FmKaba_lyricLine:not(.FmKaba_lyricDuetLine){padding-right:15%}.amll-lyric-player.FmKaba_hasDuetLine .FmKaba_lyricDuetLine{padding-left:15%}.amll-lyric-player.FmKaba_hasDuetLine .FmKaba_lyricLineWrapper:has(.FmKaba_lyricDuetLine){align-items:flex-end}.amll-lyric-player.FmKaba_hasDuetLine .FmKaba_lyricLineWrapper:has(.FmKaba_lyricDuetLine) .FmKaba_bgWrapper{transform-origin:100% 0}.amll-lyric-player.FmKaba_hasDuetLine .FmKaba_lyricLineWrapper:has(.FmKaba_lyricDuetLine) .FmKaba_bgWrapperTop{transform-origin:100% 100%}.nNqm_a_audioQualityTag{overflow:hidden}@keyframes nNqm_a_dolby-glow{0%{opacity:1}to{opacity:0}}.nNqm_a_dolbyLogoGlow{filter:blur(7px);opacity:1;margin-top:2.5px;animation-name:nNqm_a_dolby-glow;animation-duration:3s;animation-timing-function:ease-in-out;animation-delay:1s;animation-fill-mode:forwards;position:absolute}.nNqm_a_clickable{cursor:pointer}.nNqm_a_commonTag{color:#fff;box-sizing:border-box;align-items:center;padding:2px .52em 2px .1em;display:flex;position:relative}.nNqm_a_commonTag:before{content:"";opacity:.2;border-image-source:url(data:image/svg+xml,%3Csvg%20width%3D%2236%22%20height%3D%2236%22%20viewBox%3D%220%200%2036%2036%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpath%0A%20%20%20%20%20%20%20%20d%3D%22M19.5%200C25.573%200%2028.6095%200%2030.8862%201.27504C32.4953%202.17617%2033.8238%203.50471%2034.725%205.11379C36%207.39054%2036%2010.427%2036%2016.5V19.5C36%2025.573%2036%2028.6095%2034.725%2030.8862C33.8238%2032.4953%2032.4953%2033.8238%2030.8862%2034.725C28.6095%2036%2025.573%2036%2019.5%2036H16.5C10.427%2036%207.39054%2036%205.11379%2034.725C3.50471%2033.8238%202.17617%2032.4953%201.27504%2030.8862C0%2028.6095%200%2025.573%200%2019.5L0%2016.5C0%2010.427%200%207.39054%201.27504%205.11379C2.17617%203.50471%203.50471%202.17617%205.11379%201.27504C7.39054%200%2010.427%200%2016.5%200L19.5%200Z%22%0A%20%20%20%20%20%20%20%20fill%3D%22white%22%20%2F%3E%0A%3C%2Fsvg%3E);border-image-slice:15 fill;border-image-width:8.5px;width:100%;height:100%;position:absolute;top:0;left:0}.nNqm_a_commonTagText{letter-spacing:.01809em;white-space:nowrap;font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,Pingfang SC;font-size:11px;font-weight:500}.ah9gFq_nowPlayingSlider{touch-action:none;cursor:pointer;justify-content:stretch;align-items:center;min-height:24px;display:flex;transform:translateZ(0)}.ah9gFq_nowPlayingSlider>.ah9gFq_inner{background-color:#ffffff26;flex:1;width:100%;height:20px}.ah9gFq_nowPlayingSlider>.ah9gFq_inner>.ah9gFq_thumb{opacity:.4;transform-origin:0;background-color:#fff;width:100%;height:100%}.ah9gFq_nowPlayingSlider .ah9gFq_nowPlayingSlider>svg{opacity:.5}.OWkF6W_controlThumb{mix-blend-mode:plus-lighter;justify-self:center;width:100%;height:100%}.OWkF6W_controlThumb button{touch-action:none;mix-blend-mode:plus-lighter;cursor:none;background-color:#ffffff2d;border:none;border-radius:4px;padding:0;display:block;position:absolute}.OWkF6W_controlThumb button div{background-color:#000;border-radius:10px;position:absolute}.Q2PpKa_cover{--base-box-shadow-v-0: #00000030;--base-box-shadow-y-0: 1em;--base-box-shadow-r-0: 1.2em;aspect-ratio:1;object-fit:cover;object-position:center;width:100%;height:100%;filter:drop-shadow(var(--base-box-shadow-v-0) 0px var(--base-box-shadow-y-0) var(--base-box-shadow-r-0));background-position:center;background-size:cover;transition:background-image .5s linear,filter .5s,transform .5s cubic-bezier(.3,.2,.2,1.4);transform:scale(1)}.Q2PpKa_cover.Q2PpKa_musicPaused{--base-box-shadow-v-0: #00000030;--base-box-shadow-y-0: .8em;--base-box-shadow-r-0: .8em;transform:scale(var(--scale-level));transition:background-image .5s linear,filter .5s,transform .6s cubic-bezier(.4,.2,.1,1)}.Q2PpKa_coverInner{background-color:#000;background-position:center;background-size:cover;width:100%;height:100%;transition:background-image .5s linear}@keyframes _7JvWRa_pressed-animation{0%{transform:scale(1)}20%{transform:scale(.85)}50%{transform:scale(1.1)}to{transform:scale(1)}}._7JvWRa_mediaButton{aspect-ratio:1;background-color:#fff0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:background-color .3s;display:flex;position:relative}._7JvWRa_mediaButton>*{transform-origin:center;transition:transform .5s}._7JvWRa_mediaButton:hover{background-color:#fff2}._7JvWRa_mediaButton._7JvWRa_animate>*{animation-composition:accumulate;animation:.7s _7JvWRa_pressed-animation}._7JvWRa_mediaButton:active{background-color:#fff2}._7JvWRa_mediaButton:active *{animation-name:none}.GOs7HW_menuButton{aspect-ratio:1;background:#ffffff15;border:none;border-radius:50%;justify-content:center;align-self:center;align-items:center;width:3.5vh;margin-left:16px;padding:0;display:flex;position:relative}.GOs7HW_menuButton svg{color:#fff;width:72%;height:auto}@media screen and (max-width:1000px){.GOs7HW_menuButton{width:max(2em,min(5vw,4vh))}}.Dbqjoq_textMarquee{min-width:0;overflow:hidden;-webkit-mask-image:linear-gradient(to right,#000 95%,#0000)}.Dbqjoq_textMarquee.Dbqjoq_animating{-webkit-mask-image:linear-gradient(to left,#0000,#000 5% 95%,#0000)}.Dbqjoq_textMarquee>*{width:fit-content}.XWzuDW_musicInfo{color:#fff;min-width:0;font-size:max(2vh,1em);display:flex}.XWzuDW_info{flex:1;min-width:0;line-height:1.25em;overflow:hidden}.XWzuDW_name{white-space:nowrap;cursor:text;-webkit-user-select:text;user-select:text;letter-spacing:.4px;opacity:.9;mix-blend-mode:normal;min-width:0;font-weight:500}.XWzuDW_artists,.XWzuDW_album{white-space:nowrap;text-align:center;opacity:.45;letter-spacing:.4px;font-weight:400}:is(.XWzuDW_artists,.XWzuDW_album) a{-webkit-user-select:text;user-select:text;text-decoration:none}:is(.XWzuDW_artists,.XWzuDW_album) a:hover{opacity:.75}:is(.XWzuDW_artists,.XWzuDW_album) a:active{opacity:.5}:is(.XWzuDW_artists,.XWzuDW_album) a:after{content:var(--applemusic-like-lyrics-music-artists-separator, ", ")}:is(.XWzuDW_artists,.XWzuDW_album) a:nth-last-child(2):after{content:" & "}:is(.XWzuDW_artists,.XWzuDW_album) a:last-child:after{content:""}._8f42YG_background{width:100%;height:100%;transition:all .5s ease-in-out;position:absolute;left:0%}._8f42YG_background:after{content:"";background-image:linear-gradient(#0000 60%,#0000001a);width:100vw;height:100vh;position:absolute;top:0;left:0}.-DaA0W_thumb{will-change:transform;mix-blend-mode:plus-lighter;grid-area:-DaA0W_thumb / -DaA0W_info-side;justify-self:center;margin:2vh;position:relative}.-DaA0W_cover{aspect-ratio:1;width:var(--horizontal-layout-max-width);height:var(--horizontal-layout-max-width);grid-area:-DaA0W_cover / -DaA0W_info-side;place-self:center;position:relative}.-DaA0W_controls{will-change:transform;mix-blend-mode:plus-lighter;min-width:0;min-height:0;width:var(--horizontal-layout-max-width);flex-direction:column;grid-area:-DaA0W_music-info / -DaA0W_info-side;justify-content:space-between;justify-self:center;margin-top:calc(1.75em - 8px);display:flex;position:relative}.-DaA0W_lyric{box-sizing:border-box;mix-blend-mode:plus-lighter;contain:paint;grid-area:2 / -DaA0W_player-side / 5;width:100%;height:100%;padding-right:15%;transition:opacity .5s cubic-bezier(.5,0,.5,1) .25s;-webkit-mask-image:linear-gradient(#0000,#000 10% 90%,#0000);mask-image:linear-gradient(#0000,#000 10% 90%,#0000)}@media screen and (max-width:1600px),(max-height:1000px){.-DaA0W_lyric{padding-right:8%}}.-DaA0W_bottomControls{mix-blend-mode:plus-lighter;flex-direction:row-reverse;grid-area:-DaA0W_buttom-controls / 1 / -DaA0W_buttom-controls / 4;gap:4em;padding-left:4em;padding-right:4em;display:flex}@media screen and (max-width:1600px),(max-height:1000px){.-DaA0W_bottomControls{gap:2em;padding-left:2em;padding-right:2em}}.-DaA0W_horizontalLayout{--hide-lyric-left: 61.1111%;grid-template-rows:[-DaA0W_drag-area] minmax(30px,.45fr)[-DaA0W_thumb] auto[-DaA0W_cover] auto[-DaA0W_music-info] 3fr[-DaA0W_buttom-controls] 0fr .3fr;grid-template-columns:[-DaA0W_info-side] .45fr[-DaA0W_player-side] .55fr[-DaA0W_side-controls] 0fr;gap:8px;width:100%;height:100%;transition:all .5s ease-in-out;display:grid;position:relative;left:0%;--horizontal-layout-max-width: min(50vh, 38vw)}.-DaA0W_horizontalLayout .-DaA0W_thumb,.-DaA0W_horizontalLayout .-DaA0W_cover,.-DaA0W_horizontalLayout .-DaA0W_controls{transition:left .5s cubic-bezier(.5,0,.5,1);left:0%}.-DaA0W_horizontalLayout.-DaA0W_hideLyric .-DaA0W_lyric{opacity:0;pointer-events:none;transition:opacity .25s cubic-bezier(.5,0,.5,1),transform .5s cubic-bezier(.5,0,.5,1)}.-DaA0W_horizontalLayout.-DaA0W_hideLyric .-DaA0W_thumb,.-DaA0W_horizontalLayout.-DaA0W_hideLyric .-DaA0W_cover,.-DaA0W_horizontalLayout.-DaA0W_hideLyric .-DaA0W_controls{left:var(--hide-lyric-left)}@media screen and (max-height:1000px){.-DaA0W_horizontalLayout{--horizontal-layout-max-width: min(45vh, 38vw)}}@media screen and (max-height:768px){.-DaA0W_horizontalLayout{grid-template-rows:[-DaA0W_drag-area] minmax(30px,.45fr)[-DaA0W_thumb] auto[-DaA0W_cover] auto[-DaA0W_music-info] 3fr[-DaA0W_buttom-controls] 0fr .2fr;gap:2px;font-size:.8em}}.SqBoeq_verticalLayout{grid-template-rows:[SqBoeq_drag-area] 30px[SqBoeq_thumb] 30px[SqBoeq_main-view] 1fr[SqBoeq_control] 0fr;gap:2px;width:100%;min-width:0;height:100%;min-height:0;display:grid;position:relative;overflow:hidden}.SqBoeq_thumb{z-index:1;mix-blend-mode:plus-lighter;grid-row:SqBoeq_thumb;justify-self:center}@media screen and (max-width:768px){.SqBoeq_thumb{margin:4px}}.SqBoeq_coverFrame{width:0;height:0;position:absolute}.SqBoeq_coverFrame.SqBoeq_immerseCover{-webkit-mask-image:linear-gradient(#000 0% 70%,#0000);mask-image:linear-gradient(#000 0% 70%,#0000)}.SqBoeq_cover{aspect-ratio:1;z-index:1;position:absolute;top:0;left:0}.SqBoeq_lyricLayout{mix-blend-mode:plus-lighter;grid-area:SqBoeq_main-view / 1 / SqBoeq_main-view / 2;grid-template-rows:1em[SqBoeq_controls] 0fr[SqBoeq_lyric-view] 1fr[SqBoeq_bottom-controls] 0fr;grid-template-columns:3em[SqBoeq_cover-side] 0fr[SqBoeq_info-side] 1fr 3em;display:grid}@media screen and (max-width:480px){.SqBoeq_lyricLayout{grid-template-columns:20px[SqBoeq_cover-side] 0fr[SqBoeq_info-side] 1fr 20px}}.SqBoeq_noLyricLayout{pointer-events:none;grid-area:SqBoeq_main-view / 1 / SqBoeq_main-view / 2;grid-template-rows:1em[SqBoeq_cover-view] 1fr[SqBoeq_lyric-view] 0fr;grid-template-columns:3em[SqBoeq_main-view] 1fr 3em;display:grid;overflow-y:hidden}@media screen and (max-width:480px){.SqBoeq_noLyricLayout{grid-template-columns:2em[SqBoeq_main-view] 1fr 2em}}.SqBoeq_phonySmallCover{aspect-ratio:1;opacity:0;pointer-events:none;grid-area:SqBoeq_controls / SqBoeq_cover-side;place-self:center;width:6em}@media screen and (max-width:480px){.SqBoeq_phonySmallCover{width:4.5em}}.SqBoeq_phonyBigCover{opacity:0;pointer-events:none;grid-area:SqBoeq_cover-view / 2 / SqBoeq_cover-view / 3}.SqBoeq_smallControls{z-index:1;mix-blend-mode:plus-lighter;grid-area:SqBoeq_controls / SqBoeq_info-side;align-self:center;min-width:0;height:fit-content;padding-left:1em;transition:opacity .25s .25s;overflow:visible}.SqBoeq_lyric{opacity:1;mix-blend-mode:plus-lighter;box-sizing:content-box;grid-area:SqBoeq_lyric-view / 1 / SqBoeq_lyric-view / 5;min-height:0;transition:opacity .5s .5s;-webkit-mask-image:linear-gradient(#0000,#000 10% 100%);mask-image:linear-gradient(#0000,#000 10% 100%)}.SqBoeq_bigControls{opacity:0;mix-blend-mode:plus-lighter;z-index:2;grid-area:SqBoeq_lyric-view / 2 / SqBoeq_lyric-view / 3;min-width:0;transition:opacity .5s}.SqBoeq_hideLyric .SqBoeq_smallControls{opacity:0;pointer-events:none;transition:opacity .5s}.SqBoeq_hideLyric .SqBoeq_noLyricLayout{pointer-events:auto}.SqBoeq_hideLyric .SqBoeq_lyric{opacity:0;pointer-events:none;transition:opacity .5s}.SqBoeq_hideLyric .SqBoeq_bigControls{opacity:1}.SqBoeq_background{width:100%;height:100%;position:absolute}._6-mjea_toggleIconButton{aspect-ratio:1;color:currentColor;opacity:.45;background-color:#0000;border:none;justify-content:center;align-items:center;width:4em;height:4em;display:flex}._6-mjea_toggleIconButton svg{aspect-ratio:1;width:4em;height:4em}@media screen and (max-width:1600px),(max-height:1000px){._6-mjea_toggleIconButton{width:3em;height:3em}._6-mjea_toggleIconButton svg{width:3em;height:3em}}@keyframes LJEMWq_speaker-bounce-part1{to{transform:scale(1.2)}}@keyframes LJEMWq_speaker-bounce-part2{to{transform:scale(.85)}}@keyframes LJEMWq_speaker-bounce-part3{to{transform:scale(1)}}.LJEMWq_volumeControl{flex-direction:row;align-items:center;margin-left:-12px;margin-right:-8px;display:flex}.LJEMWq_volumeControl>svg{opacity:.5}.LJEMWq_speakerAnimate .speaker-bounce-1{transform-origin:center;animation:.2s ease-in-out forwards LJEMWq_speaker-bounce-part1,.2s ease-in-out .2s forwards LJEMWq_speaker-bounce-part2,.2s ease-in-out .4s forwards LJEMWq_speaker-bounce-part3}.LJEMWq_speakerAnimate .speaker-bounce-2{transform-origin:center;animation:.2s ease-in-out 50ms forwards LJEMWq_speaker-bounce-part1,.2s ease-in-out .25s forwards LJEMWq_speaker-bounce-part2,.2s ease-in-out .45s forwards LJEMWq_speaker-bounce-part3}.LJEMWq_speakerAnimate .speaker-bounce-3{transform-origin:center;animation:.2s ease-in-out .1s forwards LJEMWq_speaker-bounce-part1,.2s ease-in-out .3s forwards LJEMWq_speaker-bounce-part2,.2s ease-in-out .5s forwards LJEMWq_speaker-bounce-part3}.LJEMWq_speakerAnimate .speaker-bounce-4{transform-origin:center;animation:.2s ease-in-out .15s forwards LJEMWq_speaker-bounce-part1,.2s ease-in-out .35s forwards LJEMWq_speaker-bounce-part2,.2s ease-in-out .55s forwards LJEMWq_speaker-bounce-part3}.amll-forward-left-arrow{animation:.6s cubic-bezier(.4,1.51,.4,1) forwards amll-forward-left-end}.amll-forward-right-arrow{transform-origin:81%;animation:.2s ease-out forwards amll-forward-right-end}.amll-forward-left-standby{transform-origin:22%;animation:.6s cubic-bezier(.4,1.51,.4,1) forwards amll-forward-left-new}@keyframes amll-forward-left-end{to{transform:translate(40px)}}@keyframes amll-forward-right-end{to{opacity:0;transform:scale(0)}}@keyframes amll-forward-left-new{0%{opacity:0;transform:scale(0) translate(-15px)}to{opacity:1;transform:scale(1) translate(0)}}.amll-rewind-right-arrow{animation:.6s cubic-bezier(.4,1.51,.4,1) forwards amll-rewind-right-end}.amll-rewind-left-arrow{transform-origin:19%;animation:.2s ease-out forwards amll-rewind-left-end}.amll-rewind-right-standby{transform-origin:78%;animation:.6s cubic-bezier(.4,1.51,.4,1) forwards amll-rewind-right-new}@keyframes amll-rewind-right-end{to{transform:translate(-40px)}}@keyframes amll-rewind-left-end{to{opacity:0;transform:scale(0)}}@keyframes amll-rewind-right-new{0%{opacity:0;transform:scale(0) translate(15px)}to{opacity:1;transform:scale(1) translate(0)}}.UjzbJG_horizontalControls{min-width:0;overflow:hidden}@media screen and (max-height:1000px){.UjzbJG_horizontalControls.UjzbJG_horizontalControls{padding:0}}@media screen and (min-height:1000px){.UjzbJG_horizontalControls{padding-top:2vh;padding-bottom:1vh}}.UjzbJG_controls,.UjzbJG_bigControls{justify-content:space-evenly;align-items:center;display:flex}.UjzbJG_controls{justify-content:space-between}.UjzbJG_bigControls{padding:2vh min(2vw,2vh) 0}.UjzbJG_songMediaButton,.UjzbJG_songMediaPlayButton{aspect-ratio:1;width:18%}.UjzbJG_songMediaButton>svg{transition:scale .3s;scale:3}@media screen and (max-height:1080px){.UjzbJG_songMediaButton>svg{scale:2}}@media screen and (max-height:768px){.UjzbJG_songMediaButton>svg{scale:1.5}}@media screen and (max-height:512px){.UjzbJG_songMediaButton>svg{scale:1}}@media screen and (max-width:480px){.UjzbJG_songMediaButton>svg{scale:.5}}.UjzbJG_songMediaPlayButton>svg{transition:scale .3s;scale:2}@media screen and (max-height:1080px){.UjzbJG_songMediaPlayButton>svg{scale:1.1}}@media screen and (max-height:768px){.UjzbJG_songMediaPlayButton>svg{scale:.8}}@media screen and (max-height:512px){.UjzbJG_songMediaPlayButton>svg{scale:.5}}@media screen and (max-width:480px){.UjzbJG_songMediaPlayButton>svg{scale:.5}}.UjzbJG_qualityTag{transition:scale .3s;scale:1.4}@media screen and (max-height:768px){.UjzbJG_qualityTag{scale:.5}}@media screen and (max-height:1080px){.UjzbJG_qualityTag{scale:1}}.UjzbJG_progressBarLabels{opacity:.5;justify-content:space-between;align-items:center;margin-top:4px;font-size:max(1.2vh,.8em);font-weight:500;display:flex}@media screen and (max-height:768px){.UjzbJG_progressBarLabels{margin-top:0}}.UjzbJG_progressBarLabels>*{flex:1}.UjzbJG_progressBarLabels>:nth-child(2){flex:0}.UjzbJG_progressBarLabels>:last-child{text-align:right}.UjzbJG_bigControls>button{width:10vh;height:10vh}.UjzbJG_bigControls>button:nth-child(2)>svg{scale:1.75}@media screen and (max-width:480px){.UjzbJG_bigControls>button:nth-child(2)>svg{scale:1.25}}.UjzbJG_bigControls>button>svg{scale:2.5}@media screen and (max-width:480px){.UjzbJG_bigControls>button>svg{scale:2}}.UjzbJG_autoLyricLayout{--info-timing-func-in: cubic-bezier(.5, 0, .75, 0);--info-timing-func-out: cubic-bezier(.25, 1, .5, 1)}.UjzbJG_bigMusicInfo{transition:transform .3s var(--info-timing-func-in),opacity .3s var(--info-timing-func-in);opacity:0;min-width:0;padding:2em 0;overflow-x:hidden;transform:translateY(-25vh)}@media screen and (max-height:768px){.UjzbJG_bigMusicInfo{padding:1em 0}}@media screen and (max-height:512px){.UjzbJG_bigMusicInfo{padding:.25em 0}}.UjzbJG_bigMusicInfo.UjzbJG_hideLyric{transition:transform .5s .3s var(--info-timing-func-out),opacity .5s .3s var(--info-timing-func-out);opacity:1;transform:translateY(0)}.UjzbJG_smallMusicInfo{transition:transform .5s .3s var(--info-timing-func-out),opacity .3s .3s var(--info-timing-func-out);opacity:1;font-size:clamp(1em,2vh,1.25em);transform:translateY(0)}.UjzbJG_smallMusicInfo.UjzbJG_hideLyric{transition:transform .3s var(--info-timing-func-in),opacity .3s var(--info-timing-func-in);opacity:0;transform:translateY(25vh)}.UjzbJG_bigVolumeControl{padding-bottom:4em}@media screen and (max-height:768px){.UjzbJG_bigVolumeControl{padding-bottom:2em}}@media screen and (max-height:512px){.UjzbJG_bigVolumeControl{padding-bottom:1em}}html,body,#root{height:100%;margin:0;padding:0;background:#0b0b0f;overflow:hidden;-webkit-tap-highlight-color:transparent}body{font-family:Noto Sans SC,-apple-system,PingFang SC,system-ui,sans-serif}.stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center}#amll-lyric-player{padding:0 8px}#amll-lyric-player ::-webkit-scrollbar{display:none} diff --git a/android/app/src/main/assets/lyrics/assets/index-BTu8M9aj.js b/android/app/src/main/assets/lyrics/assets/index-BTu8M9aj.js new file mode 100644 index 0000000..f12bf8e --- /dev/null +++ b/android/app/src/main/assets/lyrics/assets/index-BTu8M9aj.js @@ -0,0 +1,817 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function e(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(a){if(a.ep)return;a.ep=!0;const o=e(a);fetch(a.href,o)}})();var Lu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g2(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function fC(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var t=n.default;if(typeof t=="function"){var e=function i(){var a=!1;try{a=this instanceof i}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var a=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:function(){return n[i]}})}),e}var w1={exports:{}},Uo={};var yy;function dC(){if(yy)return Uo;yy=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function e(i,a,o){var c=null;if(o!==void 0&&(c=""+o),a.key!==void 0&&(c=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:n,type:i,key:c,ref:a!==void 0?a:null,props:o}}return Uo.Fragment=t,Uo.jsx=e,Uo.jsxs=e,Uo}var gy;function mC(){return gy||(gy=1,w1.exports=dC()),w1.exports}var Y=mC(),M1={exports:{}},ko={},R1={exports:{}},L1={};var vy;function pC(){return vy||(vy=1,(function(n){function t(A,I){var O=A.length;A.push(I);t:for(;0>>1,V=A[j];if(0>>1;ja(H,O))Wa(st,H)?(A[j]=st,A[W]=O,j=W):(A[j]=H,A[z]=O,j=z);else if(Wa(st,O))A[j]=st,A[W]=O,j=W;else break t}}return I}function a(A,I){var O=A.sortIndex-I.sortIndex;return O!==0?O:A.id-I.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();n.unstable_now=function(){return c.now()-u}}var f=[],d=[],m=1,y=null,v=3,x=!1,b=!1,T=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function P(A){for(var I=e(d);I!==null;){if(I.callback===null)i(d);else if(I.startTime<=A)i(d),I.sortIndex=I.expirationTime,t(f,I);else break;I=e(d)}}function w(A){if(T=!1,P(A),!b)if(e(f)!==null)b=!0,F||(F=!0,G());else{var I=e(d);I!==null&&K(w,I.startTime-A)}}var F=!1,E=-1,N=5,D=-1;function k(){return C?!0:!(n.unstable_now()-DA&&k());){var j=y.callback;if(typeof j=="function"){y.callback=null,v=y.priorityLevel;var V=j(y.expirationTime<=A);if(A=n.unstable_now(),typeof V=="function"){y.callback=V,P(A),I=!0;break e}y===e(f)&&i(f),P(A)}else i(f);y=e(f)}if(y!==null)I=!0;else{var M=e(d);M!==null&&K(w,M.startTime-A),I=!1}}break t}finally{y=null,v=O,x=!1}I=void 0}}finally{I?G():F=!1}}}var G;if(typeof L=="function")G=function(){L(U)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,tt=J.port2;J.port1.onmessage=U,G=function(){tt.postMessage(null)}}else G=function(){_(U,0)};function K(A,I){E=_(function(){A(n.unstable_now())},I)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125j?(A.sortIndex=O,t(d,A),e(f)===null&&A===e(d)&&(T?(R(E),E=-1):T=!0,K(w,O-j))):(A.sortIndex=V,t(f,A),b||x||(b=!0,F||(F=!0,G()))),A},n.unstable_shouldYield=k,n.unstable_wrapCallback=function(A){var I=v;return function(){var O=v;v=I;try{return A.apply(this,arguments)}finally{v=O}}}})(L1)),L1}var by;function yC(){return by||(by=1,R1.exports=pC()),R1.exports}var O1={exports:{}},Bt={};var xy;function gC(){if(xy)return Bt;xy=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,C={};function _(M,z,H){this.props=M,this.context=z,this.refs=C,this.updater=H||b}_.prototype.isReactComponent={},_.prototype.setState=function(M,z){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,z,"setState")},_.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function R(){}R.prototype=_.prototype;function L(M,z,H){this.props=M,this.context=z,this.refs=C,this.updater=H||b}var P=L.prototype=new R;P.constructor=L,T(P,_.prototype),P.isPureReactComponent=!0;var w=Array.isArray;function F(){}var E={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function D(M,z,H){var W=H.ref;return{$$typeof:n,type:M,key:z,ref:W!==void 0?W:null,props:H}}function k(M,z){return D(M.type,z,M.props)}function U(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function G(M){var z={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(H){return z[H]})}var J=/\/+/g;function tt(M,z){return typeof M=="object"&&M!==null&&M.key!=null?G(""+M.key):z.toString(36)}function K(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(F,F):(M.status="pending",M.then(function(z){M.status==="pending"&&(M.status="fulfilled",M.value=z)},function(z){M.status==="pending"&&(M.status="rejected",M.reason=z)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function A(M,z,H,W,st){var ct=typeof M;(ct==="undefined"||ct==="boolean")&&(M=null);var ft=!1;if(M===null)ft=!0;else switch(ct){case"bigint":case"string":case"number":ft=!0;break;case"object":switch(M.$$typeof){case n:case t:ft=!0;break;case m:return ft=M._init,A(ft(M._payload),z,H,W,st)}}if(ft)return st=st(M),ft=W===""?"."+tt(M,0):W,w(st)?(H="",ft!=null&&(H=ft.replace(J,"$&/")+"/"),A(st,z,H,"",function(dt){return dt})):st!=null&&(U(st)&&(st=k(st,H+(st.key==null||M&&M.key===st.key?"":(""+st.key).replace(J,"$&/")+"/")+ft)),z.push(st)),1;ft=0;var pt=W===""?".":W+":";if(w(M))for(var mt=0;mt"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),N1.exports=vC(),N1.exports}var _y;function bC(){if(_y)return ko;_y=1;var n=yC(),t=Ku(),e=n8();function i(s){var r="https://react.dev/errors/"+s;if(1V||(s.current=j[V],j[V]=null,V--)}function H(s,r){V++,j[V]=s.current,s.current=r}var W=M(null),st=M(null),ct=M(null),ft=M(null);function pt(s,r){switch(H(ct,r),H(st,s),H(W,null),r.nodeType){case 9:case 11:s=(s=r.documentElement)&&(s=s.namespaceURI)?k4(s):0;break;default:if(s=r.tagName,r=r.namespaceURI)r=k4(r),s=z4(r,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}z(W),H(W,s)}function mt(){z(W),z(st),z(ct)}function dt(s){s.memoizedState!==null&&H(ft,s);var r=W.current,l=z4(r,s.type);r!==l&&(H(st,s),H(W,l))}function St(s){st.current===s&&(z(W),z(st)),ft.current===s&&(z(ft),Bo._currentValue=O)}var bt,Lt;function wt(s){if(bt===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);bt=r&&r[1]||"",Lt=-1)":-1p||q[h]!==nt[p]){var lt=` +`+q[h].replace(" at new "," at ");return s.displayName&<.includes("")&&(lt=lt.replace("",s.displayName)),lt}while(1<=h&&0<=p);break}}}finally{gt=!1,Error.prepareStackTrace=l}return(l=s?s.displayName||s.name:"")?wt(l):""}function Jt(s,r){switch(s.tag){case 26:case 27:case 5:return wt(s.type);case 16:return wt("Lazy");case 13:return s.child!==r&&r!==null?wt("Suspense Fallback"):wt("Suspense");case 19:return wt("SuspenseList");case 0:case 15:return xt(s.type,!1);case 11:return xt(s.type.render,!1);case 1:return xt(s.type,!0);case 31:return wt("Activity");default:return""}}function Re(s){try{var r="",l=null;do r+=Jt(s,l),l=s,s=s.return;while(s);return r}catch(h){return` +Error generating stack: `+h.message+` +`+h.stack}}var bn=Object.prototype.hasOwnProperty,Ln=n.unstable_scheduleCallback,sn=n.unstable_cancelCallback,Ki=n.unstable_shouldYield,Qi=n.unstable_requestPaint,Le=n.unstable_now,yh=n.unstable_getCurrentPriorityLevel,Ll=n.unstable_ImmediatePriority,Ha=n.unstable_UserBlockingPriority,wr=n.unstable_NormalPriority,Fs=n.unstable_LowPriority,Mr=n.unstable_IdlePriority,Ol=n.log,gh=n.unstable_setDisableYieldValue,Ps=null,Xe=null;function xn(s){if(typeof Ol=="function"&&gh(s),Xe&&typeof Xe.setStrictMode=="function")try{Xe.setStrictMode(Ps,s)}catch{}}var Q=Math.clz32?Math.clz32:le,rt=Math.log,Wt=Math.LN2;function le(s){return s>>>=0,s===0?32:31-(rt(s)/Wt|0)|0}var ie=256,Dt=262144,Cn=4194304;function rn(s){var r=s&42;if(r!==0)return r;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ge(s,r,l){var h=s.pendingLanes;if(h===0)return 0;var p=0,g=s.suspendedLanes,S=s.pingedLanes;s=s.warmLanes;var B=h&134217727;return B!==0?(h=B&~g,h!==0?p=rn(h):(S&=B,S!==0?p=rn(S):l||(l=B&~s,l!==0&&(p=rn(l))))):(B=h&~g,B!==0?p=rn(B):S!==0?p=rn(S):l||(l=h&~s,l!==0&&(p=rn(l)))),p===0?0:r!==0&&r!==p&&(r&g)===0&&(g=p&-p,l=r&-r,g>=l||g===32&&(l&4194048)!==0)?r:p}function hn(s,r){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&r)===0}function ja(s,r){switch(s){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Si(){var s=Cn;return Cn<<=1,(Cn&62914560)===0&&(Cn=4194304),s}function an(s){for(var r=[],l=0;31>l;l++)r.push(s);return r}function Ji(s,r){s.pendingLanes|=r,r!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Nl(s,r,l,h,p,g){var S=s.pendingLanes;s.pendingLanes=l,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=l,s.entangledLanes&=l,s.errorRecoveryDisabledLanes&=l,s.shellSuspendCounter=0;var B=s.entanglements,q=s.expirationTimes,nt=s.hiddenUpdates;for(l=S&~l;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var ab=/[\n"\\]/g;function Nn(s){return s.replace(ab,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function xh(s,r,l,h,p,g,S,B){s.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?s.type=S:s.removeAttribute("type"),r!=null?S==="number"?(r===0&&s.value===""||s.value!=r)&&(s.value=""+On(r)):s.value!==""+On(r)&&(s.value=""+On(r)):S!=="submit"&&S!=="reset"||s.removeAttribute("value"),r!=null?Ch(s,S,On(r)):l!=null?Ch(s,S,On(l)):h!=null&&s.removeAttribute("value"),p==null&&g!=null&&(s.defaultChecked=!!g),p!=null&&(s.checked=p&&typeof p!="function"&&typeof p!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?s.name=""+On(B):s.removeAttribute("name")}function Dm(s,r,l,h,p,g,S,B){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(s.type=g),r!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){bh(s);return}l=l!=null?""+On(l):"",r=r!=null?""+On(r):l,B||r===s.value||(s.value=r),s.defaultValue=r}h=h??p,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=B?s.checked:!!h,s.defaultChecked=!!h,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(s.name=S),bh(s)}function Ch(s,r,l){r==="number"&&Il(s.ownerDocument)===s||s.defaultValue===""+l||(s.defaultValue=""+l)}function Ir(s,r,l,h){if(s=s.options,r){r={};for(var p=0;p"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eh=!1;if(Mi)try{var Ka={};Object.defineProperty(Ka,"passive",{get:function(){Eh=!0}}),window.addEventListener("test",Ka,Ka),window.removeEventListener("test",Ka,Ka)}catch{Eh=!1}var ns=null,wh=null,Pl=null;function zm(){if(Pl)return Pl;var s,r=wh,l=r.length,h,p="value"in ns?ns.value:ns.textContent,g=p.length;for(s=0;s=to),Xm=" ",Ym=!1;function $m(s,r){switch(s){case"keyup":return Bb.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wm(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var kr=!1;function Fb(s,r){switch(s){case"compositionend":return Wm(r);case"keypress":return r.which!==32?null:(Ym=!0,Xm);case"textInput":return s=r.data,s===Xm&&Ym?null:s;default:return null}}function Pb(s,r){if(kr)return s==="compositionend"||!Nh&&$m(s,r)?(s=zm(),Pl=wh=ns=null,kr=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:l,offset:r-s};s=h}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=i3(l)}}function r3(s,r){return s&&r?s===r?!0:s&&s.nodeType===3?!1:r&&r.nodeType===3?r3(s,r.parentNode):"contains"in s?s.contains(r):s.compareDocumentPosition?!!(s.compareDocumentPosition(r)&16):!1:!1}function a3(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var r=Il(s.document);r instanceof s.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)s=r.contentWindow;else break;r=Il(s.document)}return r}function Ih(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r&&(r==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||r==="textarea"||s.contentEditable==="true")}var qb=Mi&&"documentMode"in document&&11>=document.documentMode,zr=null,Fh=null,so=null,Ph=!1;function o3(s,r,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ph||zr==null||zr!==Il(h)||(h=zr,"selectionStart"in h&&Ih(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),so&&io(so,h)||(so=h,h=Lc(Fh,"onSelect"),0>=S,p-=S,ci=1<<32-Q(r)+p|l<Ft?(Xt=At,At=null):Xt=At.sibling;var Kt=it(Z,At,et[Ft],ut);if(Kt===null){At===null&&(At=Xt);break}s&&At&&Kt.alternate===null&&r(Z,At),$=g(Kt,$,Ft),Zt===null?Et=Kt:Zt.sibling=Kt,Zt=Kt,At=Xt}if(Ft===et.length)return l(Z,At),Yt&&Li(Z,Ft),Et;if(At===null){for(;FtFt?(Xt=At,At=null):Xt=At.sibling;var _s=it(Z,At,Kt.value,ut);if(_s===null){At===null&&(At=Xt);break}s&&At&&_s.alternate===null&&r(Z,At),$=g(_s,$,Ft),Zt===null?Et=_s:Zt.sibling=_s,Zt=_s,At=Xt}if(Kt.done)return l(Z,At),Yt&&Li(Z,Ft),Et;if(At===null){for(;!Kt.done;Ft++,Kt=et.next())Kt=ht(Z,Kt.value,ut),Kt!==null&&($=g(Kt,$,Ft),Zt===null?Et=Kt:Zt.sibling=Kt,Zt=Kt);return Yt&&Li(Z,Ft),Et}for(At=h(At);!Kt.done;Ft++,Kt=et.next())Kt=at(At,Z,Ft,Kt.value,ut),Kt!==null&&(s&&Kt.alternate!==null&&At.delete(Kt.key===null?Ft:Kt.key),$=g(Kt,$,Ft),Zt===null?Et=Kt:Zt.sibling=Kt,Zt=Kt);return s&&At.forEach(function(hC){return r(Z,hC)}),Yt&&Li(Z,Ft),Et}function he(Z,$,et,ut){if(typeof et=="object"&&et!==null&&et.type===T&&et.key===null&&(et=et.props.children),typeof et=="object"&&et!==null){switch(et.$$typeof){case x:t:{for(var Et=et.key;$!==null;){if($.key===Et){if(Et=et.type,Et===T){if($.tag===7){l(Z,$.sibling),ut=p($,et.props.children),ut.return=Z,Z=ut;break t}}else if($.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===N&&Ws(Et)===$.type){l(Z,$.sibling),ut=p($,et.props),uo(ut,et),ut.return=Z,Z=ut;break t}l(Z,$);break}else r(Z,$);$=$.sibling}et.type===T?(ut=js(et.props.children,Z.mode,ut,et.key),ut.return=Z,Z=ut):(ut=Yl(et.type,et.key,et.props,null,Z.mode,ut),uo(ut,et),ut.return=Z,Z=ut)}return S(Z);case b:t:{for(Et=et.key;$!==null;){if($.key===Et)if($.tag===4&&$.stateNode.containerInfo===et.containerInfo&&$.stateNode.implementation===et.implementation){l(Z,$.sibling),ut=p($,et.children||[]),ut.return=Z,Z=ut;break t}else{l(Z,$);break}else r(Z,$);$=$.sibling}ut=jh(et,Z.mode,ut),ut.return=Z,Z=ut}return S(Z);case N:return et=Ws(et),he(Z,$,et,ut)}if(K(et))return Tt(Z,$,et,ut);if(G(et)){if(Et=G(et),typeof Et!="function")throw Error(i(150));return et=Et.call(et),Mt(Z,$,et,ut)}if(typeof et.then=="function")return he(Z,$,tc(et),ut);if(et.$$typeof===L)return he(Z,$,Zl(Z,et),ut);ec(Z,et)}return typeof et=="string"&&et!==""||typeof et=="number"||typeof et=="bigint"?(et=""+et,$!==null&&$.tag===6?(l(Z,$.sibling),ut=p($,et),ut.return=Z,Z=ut):(l(Z,$),ut=Hh(et,Z.mode,ut),ut.return=Z,Z=ut),S(Z)):l(Z,$)}return function(Z,$,et,ut){try{co=0;var Et=he(Z,$,et,ut);return Kr=null,Et}catch(At){if(At===Zr||At===Ql)throw At;var Zt=Sn(29,At,null,Z.mode);return Zt.lanes=ut,Zt.return=Z,Zt}}}var Ks=L3(!0),O3=L3(!1),os=!1;function nf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sf(s,r){s=s.updateQueue,r.updateQueue===s&&(r.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ls(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function cs(s,r,l){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(te&2)!==0){var p=h.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),h.pending=r,r=Xl(s),m3(s,null,l),r}return ql(s,h,r,l),Xl(s)}function ho(s,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var h=r.lanes;h&=s.pendingLanes,l|=h,r.lanes=l,ts(s,l)}}function rf(s,r){var l=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var p=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?p=g=S:g=g.next=S,l=l.next}while(l!==null);g===null?p=g=r:g=g.next=r}else p=g=r;l={baseState:h.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:h.shared,callbacks:h.callbacks},s.updateQueue=l;return}s=l.lastBaseUpdate,s===null?l.firstBaseUpdate=r:s.next=r,l.lastBaseUpdate=r}var af=!1;function fo(){if(af){var s=Wr;if(s!==null)throw s}}function mo(s,r,l,h){af=!1;var p=s.updateQueue;os=!1;var g=p.firstBaseUpdate,S=p.lastBaseUpdate,B=p.shared.pending;if(B!==null){p.shared.pending=null;var q=B,nt=q.next;q.next=null,S===null?g=nt:S.next=nt,S=q;var lt=s.alternate;lt!==null&&(lt=lt.updateQueue,B=lt.lastBaseUpdate,B!==S&&(B===null?lt.firstBaseUpdate=nt:B.next=nt,lt.lastBaseUpdate=q))}if(g!==null){var ht=p.baseState;S=0,lt=nt=q=null,B=g;do{var it=B.lane&-536870913,at=it!==B.lane;if(at?(qt&it)===it:(h&it)===it){it!==0&&it===$r&&(af=!0),lt!==null&&(lt=lt.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});t:{var Tt=s,Mt=B;it=r;var he=l;switch(Mt.tag){case 1:if(Tt=Mt.payload,typeof Tt=="function"){ht=Tt.call(he,ht,it);break t}ht=Tt;break t;case 3:Tt.flags=Tt.flags&-65537|128;case 0:if(Tt=Mt.payload,it=typeof Tt=="function"?Tt.call(he,ht,it):Tt,it==null)break t;ht=y({},ht,it);break t;case 2:os=!0}}it=B.callback,it!==null&&(s.flags|=64,at&&(s.flags|=8192),at=p.callbacks,at===null?p.callbacks=[it]:at.push(it))}else at={lane:it,tag:B.tag,payload:B.payload,callback:B.callback,next:null},lt===null?(nt=lt=at,q=ht):lt=lt.next=at,S|=it;if(B=B.next,B===null){if(B=p.shared.pending,B===null)break;at=B,B=at.next,at.next=null,p.lastBaseUpdate=at,p.shared.pending=null}}while(!0);lt===null&&(q=ht),p.baseState=q,p.firstBaseUpdate=nt,p.lastBaseUpdate=lt,g===null&&(p.shared.lanes=0),ms|=S,s.lanes=S,s.memoizedState=ht}}function N3(s,r){if(typeof s!="function")throw Error(i(191,s));s.call(r)}function D3(s,r){var l=s.callbacks;if(l!==null)for(s.callbacks=null,s=0;sg?g:8;var S=A.T,B={};A.T=B,Af(s,!1,r,l);try{var q=p(),nt=A.S;if(nt!==null&&nt(B,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var lt=tx(q,h);go(s,r,lt,Mn(s))}else go(s,r,h,Mn(s))}catch(ht){go(s,r,{then:function(){},status:"rejected",reason:ht},Mn())}finally{I.p=g,S!==null&&B.types!==null&&(S.types=B.types),A.T=S}}function ax(){}function Sf(s,r,l,h){if(s.tag!==5)throw Error(i(476));var p=hp(s).queue;up(s,p,r,O,l===null?ax:function(){return fp(s),l(h)})}function hp(s){var r=s.memoizedState;if(r!==null)return r;r={memoizedState:O,baseState:O,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:O},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:l},next:null},s.memoizedState=r,s=s.alternate,s!==null&&(s.memoizedState=r),r}function fp(s){var r=hp(s);r.next===null&&(r=s.alternate.memoizedState),go(s,r.next.queue,{},Mn())}function _f(){return We(Bo)}function dp(){return Me().memoizedState}function mp(){return Me().memoizedState}function ox(s){for(var r=s.return;r!==null;){switch(r.tag){case 24:case 3:var l=Mn();s=ls(l);var h=cs(r,s,l);h!==null&&(gn(h,r,l),ho(h,r,l)),r={cache:Qh()},s.payload=r;return}r=r.return}}function lx(s,r,l){var h=Mn();l={lane:h,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},hc(s)?yp(r,l):(l=Vh(s,r,l,h),l!==null&&(gn(l,s,h),gp(l,r,h)))}function pp(s,r,l){var h=Mn();go(s,r,l,h)}function go(s,r,l,h){var p={lane:h,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(hc(s))yp(r,p);else{var g=s.alternate;if(s.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,B=g(S,l);if(p.hasEagerState=!0,p.eagerState=B,Tn(B,S))return ql(s,r,p,0),me===null&&jl(),!1}catch{}if(l=Vh(s,r,p,h),l!==null)return gn(l,s,h),gp(l,r,h),!0}return!1}function Af(s,r,l,h){if(h={lane:2,revertLane:i1(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},hc(s)){if(r)throw Error(i(479))}else r=Vh(s,l,h,2),r!==null&&gn(r,s,2)}function hc(s){var r=s.alternate;return s===It||r!==null&&r===It}function yp(s,r){Jr=sc=!0;var l=s.pending;l===null?r.next=r:(r.next=l.next,l.next=r),s.pending=r}function gp(s,r,l){if((l&4194048)!==0){var h=r.lanes;h&=s.pendingLanes,l|=h,r.lanes=l,ts(s,l)}}var vo={readContext:We,use:oc,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useLayoutEffect:Te,useInsertionEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useSyncExternalStore:Te,useId:Te,useHostTransitionStatus:Te,useFormState:Te,useActionState:Te,useOptimistic:Te,useMemoCache:Te,useCacheRefresh:Te};vo.useEffectEvent=Te;var vp={readContext:We,use:oc,useCallback:function(s,r){return on().memoizedState=[s,r===void 0?null:r],s},useContext:We,useEffect:ep,useImperativeHandle:function(s,r,l){l=l!=null?l.concat([s]):null,cc(4194308,4,rp.bind(null,r,s),l)},useLayoutEffect:function(s,r){return cc(4194308,4,s,r)},useInsertionEffect:function(s,r){cc(4,2,s,r)},useMemo:function(s,r){var l=on();r=r===void 0?null:r;var h=s();if(Qs){xn(!0);try{s()}finally{xn(!1)}}return l.memoizedState=[h,r],h},useReducer:function(s,r,l){var h=on();if(l!==void 0){var p=l(r);if(Qs){xn(!0);try{l(r)}finally{xn(!1)}}}else p=r;return h.memoizedState=h.baseState=p,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:p},h.queue=s,s=s.dispatch=lx.bind(null,It,s),[h.memoizedState,s]},useRef:function(s){var r=on();return s={current:s},r.memoizedState=s},useState:function(s){s=vf(s);var r=s.queue,l=pp.bind(null,It,r);return r.dispatch=l,[s.memoizedState,l]},useDebugValue:Cf,useDeferredValue:function(s,r){var l=on();return Tf(l,s,r)},useTransition:function(){var s=vf(!1);return s=up.bind(null,It,s.queue,!0,!1),on().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,r,l){var h=It,p=on();if(Yt){if(l===void 0)throw Error(i(407));l=l()}else{if(l=r(),me===null)throw Error(i(349));(qt&127)!==0||k3(h,r,l)}p.memoizedState=l;var g={value:l,getSnapshot:r};return p.queue=g,ep(V3.bind(null,h,g,s),[s]),h.flags|=2048,ea(9,{destroy:void 0},z3.bind(null,h,g,l,r),null),l},useId:function(){var s=on(),r=me.identifierPrefix;if(Yt){var l=ui,h=ci;l=(h&~(1<<32-Q(h)-1)).toString(32)+l,r="_"+r+"R_"+l,l=rc++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof h.is=="string"?S.createElement("select",{is:h.is}):S.createElement("select"),h.multiple?g.multiple=!0:h.size&&(g.size=h.size);break;default:g=typeof h.is=="string"?S.createElement(p,{is:h.is}):S.createElement(p)}}g[Ee]=r,g[Ye]=h;t:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break t;for(;S.sibling===null;){if(S.return===null||S.return===r)break t;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=g;t:switch(Ke(g,p,h),p){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break t;case"img":h=!0;break t;default:h=!1}h&&Fi(r)}}return ve(r),kf(r,r.type,s===null?null:s.memoizedProps,r.pendingProps,l),null;case 6:if(s&&r.stateNode!=null)s.memoizedProps!==h&&Fi(r);else{if(typeof h!="string"&&r.stateNode===null)throw Error(i(166));if(s=ct.current,Xr(r)){if(s=r.stateNode,l=r.memoizedProps,h=null,p=$e,p!==null)switch(p.tag){case 27:case 5:h=p.memoizedProps}s[Ee]=r,s=!!(s.nodeValue===l||h!==null&&h.suppressHydrationWarning===!0||P4(s.nodeValue,l)),s||rs(r,!0)}else s=Oc(s).createTextNode(h),s[Ee]=r,r.stateNode=s}return ve(r),null;case 31:if(l=r.memoizedState,s===null||s.memoizedState!==null){if(h=Xr(r),l!==null){if(s===null){if(!h)throw Error(i(318));if(s=r.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Ee]=r}else qs(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ve(r),s=!1}else l=$h(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=l),s=!0;if(!s)return r.flags&256?(An(r),r):(An(r),null);if((r.flags&128)!==0)throw Error(i(558))}return ve(r),null;case 13:if(h=r.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(p=Xr(r),h!==null&&h.dehydrated!==null){if(s===null){if(!p)throw Error(i(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[Ee]=r}else qs(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ve(r),p=!1}else p=$h(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(An(r),r):(An(r),null)}return An(r),(r.flags&128)!==0?(r.lanes=l,r):(l=h!==null,s=s!==null&&s.memoizedState!==null,l&&(h=r.child,p=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(p=h.alternate.memoizedState.cachePool.pool),g=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(g=h.memoizedState.cachePool.pool),g!==p&&(h.flags|=2048)),l!==s&&l&&(r.child.flags|=8192),yc(r,r.updateQueue),ve(r),null);case 4:return mt(),s===null&&o1(r.stateNode.containerInfo),ve(r),null;case 10:return Ni(r.type),ve(r),null;case 19:if(z(we),h=r.memoizedState,h===null)return ve(r),null;if(p=(r.flags&128)!==0,g=h.rendering,g===null)if(p)xo(h,!1);else{if(Se!==0||s!==null&&(s.flags&128)!==0)for(s=r.child;s!==null;){if(g=ic(s),g!==null){for(r.flags|=128,xo(h,!1),s=g.updateQueue,r.updateQueue=s,yc(r,s),r.subtreeFlags=0,s=l,l=r.child;l!==null;)p3(l,s),l=l.sibling;return H(we,we.current&1|2),Yt&&Li(r,h.treeForkCount),r.child}s=s.sibling}h.tail!==null&&Le()>Cc&&(r.flags|=128,p=!0,xo(h,!1),r.lanes=4194304)}else{if(!p)if(s=ic(g),s!==null){if(r.flags|=128,p=!0,s=s.updateQueue,r.updateQueue=s,yc(r,s),xo(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!Yt)return ve(r),null}else 2*Le()-h.renderingStartTime>Cc&&l!==536870912&&(r.flags|=128,p=!0,xo(h,!1),r.lanes=4194304);h.isBackwards?(g.sibling=r.child,r.child=g):(s=h.last,s!==null?s.sibling=g:r.child=g,h.last=g)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=Le(),s.sibling=null,l=we.current,H(we,p?l&1|2:l&1),Yt&&Li(r,h.treeForkCount),s):(ve(r),null);case 22:case 23:return An(r),lf(),h=r.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(r.flags|=8192):h&&(r.flags|=8192),h?(l&536870912)!==0&&(r.flags&128)===0&&(ve(r),r.subtreeFlags&6&&(r.flags|=8192)):ve(r),l=r.updateQueue,l!==null&&yc(r,l.retryQueue),l=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==l&&(r.flags|=2048),s!==null&&z($s),null;case 24:return l=null,s!==null&&(l=s.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ni(Oe),ve(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function dx(s,r){switch(Xh(r),r.tag){case 1:return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 3:return Ni(Oe),mt(),s=r.flags,(s&65536)!==0&&(s&128)===0?(r.flags=s&-65537|128,r):null;case 26:case 27:case 5:return St(r),null;case 31:if(r.memoizedState!==null){if(An(r),r.alternate===null)throw Error(i(340));qs()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 13:if(An(r),s=r.memoizedState,s!==null&&s.dehydrated!==null){if(r.alternate===null)throw Error(i(340));qs()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 19:return z(we),null;case 4:return mt(),null;case 10:return Ni(r.type),null;case 22:case 23:return An(r),lf(),s!==null&&z($s),s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 24:return Ni(Oe),null;case 25:return null;default:return null}}function Gp(s,r){switch(Xh(r),r.tag){case 3:Ni(Oe),mt();break;case 26:case 27:case 5:St(r);break;case 4:mt();break;case 31:r.memoizedState!==null&&An(r);break;case 13:An(r);break;case 19:z(we);break;case 10:Ni(r.type);break;case 22:case 23:An(r),lf(),s!==null&&z($s);break;case 24:Ni(Oe)}}function Co(s,r){try{var l=r.updateQueue,h=l!==null?l.lastEffect:null;if(h!==null){var p=h.next;l=p;do{if((l.tag&s)===s){h=void 0;var g=l.create,S=l.inst;h=g(),S.destroy=h}l=l.next}while(l!==p)}}catch(B){ae(r,r.return,B)}}function fs(s,r,l){try{var h=r.updateQueue,p=h!==null?h.lastEffect:null;if(p!==null){var g=p.next;h=g;do{if((h.tag&s)===s){var S=h.inst,B=S.destroy;if(B!==void 0){S.destroy=void 0,p=r;var q=l,nt=B;try{nt()}catch(lt){ae(p,q,lt)}}}h=h.next}while(h!==g)}}catch(lt){ae(r,r.return,lt)}}function Hp(s){var r=s.updateQueue;if(r!==null){var l=s.stateNode;try{D3(r,l)}catch(h){ae(s,s.return,h)}}}function jp(s,r,l){l.props=Js(s.type,s.memoizedProps),l.state=s.memoizedState;try{l.componentWillUnmount()}catch(h){ae(s,r,h)}}function To(s,r){try{var l=s.ref;if(l!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof l=="function"?s.refCleanup=l(h):l.current=h}}catch(p){ae(s,r,p)}}function hi(s,r){var l=s.ref,h=s.refCleanup;if(l!==null)if(typeof h=="function")try{h()}catch(p){ae(s,r,p)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){ae(s,r,p)}else l.current=null}function qp(s){var r=s.type,l=s.memoizedProps,h=s.stateNode;try{t:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&h.focus();break t;case"img":l.src?h.src=l.src:l.srcSet&&(h.srcset=l.srcSet)}}catch(p){ae(s,s.return,p)}}function zf(s,r,l){try{var h=s.stateNode;Ix(h,s.type,l,r),h[Ye]=r}catch(p){ae(s,s.return,p)}}function Xp(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&bs(s.type)||s.tag===4}function Vf(s){t:for(;;){for(;s.sibling===null;){if(s.return===null||Xp(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&bs(s.type)||s.flags&2||s.child===null||s.tag===4)continue t;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Gf(s,r,l){var h=s.tag;if(h===5||h===6)s=s.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(s,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(s),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=wi));else if(h!==4&&(h===27&&bs(s.type)&&(l=s.stateNode,r=null),s=s.child,s!==null))for(Gf(s,r,l),s=s.sibling;s!==null;)Gf(s,r,l),s=s.sibling}function gc(s,r,l){var h=s.tag;if(h===5||h===6)s=s.stateNode,r?l.insertBefore(s,r):l.appendChild(s);else if(h!==4&&(h===27&&bs(s.type)&&(l=s.stateNode),s=s.child,s!==null))for(gc(s,r,l),s=s.sibling;s!==null;)gc(s,r,l),s=s.sibling}function Yp(s){var r=s.stateNode,l=s.memoizedProps;try{for(var h=s.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Ke(r,h,l),r[Ee]=s,r[Ye]=l}catch(g){ae(s,s.return,g)}}var Pi=!1,Be=!1,Hf=!1,$p=typeof WeakSet=="function"?WeakSet:Set,je=null;function mx(s,r){if(s=s.containerInfo,u1=Uc,s=a3(s),Ih(s)){if("selectionStart"in s)var l={start:s.selectionStart,end:s.selectionEnd};else t:{l=(l=s.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var p=h.anchorOffset,g=h.focusNode;h=h.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break t}var S=0,B=-1,q=-1,nt=0,lt=0,ht=s,it=null;e:for(;;){for(var at;ht!==l||p!==0&&ht.nodeType!==3||(B=S+p),ht!==g||h!==0&&ht.nodeType!==3||(q=S+h),ht.nodeType===3&&(S+=ht.nodeValue.length),(at=ht.firstChild)!==null;)it=ht,ht=at;for(;;){if(ht===s)break e;if(it===l&&++nt===p&&(B=S),it===g&&++lt===h&&(q=S),(at=ht.nextSibling)!==null)break;ht=it,it=ht.parentNode}ht=at}l=B===-1||q===-1?null:{start:B,end:q}}else l=null}l=l||{start:0,end:0}}else l=null;for(h1={focusedElem:s,selectionRange:l},Uc=!1,je=r;je!==null;)if(r=je,s=r.child,(r.subtreeFlags&1028)!==0&&s!==null)s.return=r,je=s;else for(;je!==null;){switch(r=je,g=r.alternate,s=r.flags,r.tag){case 0:if((s&4)!==0&&(s=r.updateQueue,s=s!==null?s.events:null,s!==null))for(l=0;l title"))),Ke(g,h,l),g[Ee]=s,He(g),h=g;break t;case"link":var S=ty("link","href",p).get(h+(l.href||""));if(S){for(var B=0;Bhe&&(S=he,he=Mt,Mt=S);var Z=s3(B,Mt),$=s3(B,he);if(Z&&$&&(at.rangeCount!==1||at.anchorNode!==Z.node||at.anchorOffset!==Z.offset||at.focusNode!==$.node||at.focusOffset!==$.offset)){var et=ht.createRange();et.setStart(Z.node,Z.offset),at.removeAllRanges(),Mt>he?(at.addRange(et),at.extend($.node,$.offset)):(et.setEnd($.node,$.offset),at.addRange(et))}}}}for(ht=[],at=B;at=at.parentNode;)at.nodeType===1&&ht.push({element:at,left:at.scrollLeft,top:at.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;Bl?32:l,A.T=null,l=Zf,Zf=null;var g=ys,S=Gi;if(ke=0,aa=ys=null,Gi=0,(te&6)!==0)throw Error(i(331));var B=te;if(te|=4,r4(g.current),n4(g,g.current,S,l),te=B,Mo(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(Ps,g)}catch{}return!0}finally{I.p=p,A.T=h,S4(s,r)}}function A4(s,r,l){r=Bn(l,r),r=Rf(s.stateNode,r,2),s=cs(s,r,2),s!==null&&(Ji(s,2),fi(s))}function ae(s,r,l){if(s.tag===3)A4(s,s,l);else for(;r!==null;){if(r.tag===3){A4(r,s,l);break}else if(r.tag===1){var h=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ps===null||!ps.has(h))){s=Bn(l,s),l=Ep(2),h=cs(r,l,2),h!==null&&(wp(l,h,r,s),Ji(h,2),fi(h));break}}r=r.return}}function t1(s,r,l){var h=s.pingCache;if(h===null){h=s.pingCache=new gx;var p=new Set;h.set(r,p)}else p=h.get(r),p===void 0&&(p=new Set,h.set(r,p));p.has(l)||(Xf=!0,p.add(l),s=Tx.bind(null,s,r,l),r.then(s,s))}function Tx(s,r,l){var h=s.pingCache;h!==null&&h.delete(r),s.pingedLanes|=s.suspendedLanes&l,s.warmLanes&=~l,me===s&&(qt&l)===l&&(Se===4||Se===3&&(qt&62914560)===qt&&300>Le()-xc?(te&2)===0&&oa(s,0):Yf|=l,ra===qt&&(ra=0)),fi(s)}function E4(s,r){r===0&&(r=Si()),s=Hs(s,r),s!==null&&(Ji(s,r),fi(s))}function Sx(s){var r=s.memoizedState,l=0;r!==null&&(l=r.retryLane),E4(s,l)}function _x(s,r){var l=0;switch(s.tag){case 31:case 13:var h=s.stateNode,p=s.memoizedState;p!==null&&(l=p.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(r),E4(s,l)}function Ax(s,r){return Ln(s,r)}var wc=null,ca=null,e1=!1,Mc=!1,n1=!1,vs=0;function fi(s){s!==ca&&s.next===null&&(ca===null?wc=ca=s:ca=ca.next=s),Mc=!0,e1||(e1=!0,wx())}function Mo(s,r){if(!n1&&Mc){n1=!0;do for(var l=!1,h=wc;h!==null;){if(s!==0){var p=h.pendingLanes;if(p===0)var g=0;else{var S=h.suspendedLanes,B=h.pingedLanes;g=(1<<31-Q(42|s)+1)-1,g&=p&~(S&~B),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,L4(h,g))}else g=qt,g=Ge(h,h===me?g:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(g&3)===0||hn(h,g)||(l=!0,L4(h,g));h=h.next}while(l);n1=!1}}function Ex(){w4()}function w4(){Mc=e1=!1;var s=0;vs!==0&&Px()&&(s=vs);for(var r=Le(),l=null,h=wc;h!==null;){var p=h.next,g=M4(h,r);g===0?(h.next=null,l===null?wc=p:l.next=p,p===null&&(ca=l)):(l=h,(s!==0||(g&3)!==0)&&(Mc=!0)),h=p}ke!==0&&ke!==5||Mo(s),vs!==0&&(vs=0)}function M4(s,r){for(var l=s.suspendedLanes,h=s.pingedLanes,p=s.expirationTimes,g=s.pendingLanes&-62914561;0B)break;var lt=q.transferSize,ht=q.initiatorType;lt&&U4(ht)&&(q=q.responseEnd,S+=lt*(q"u"?null:document;function Z4(s,r,l){var h=ua;if(h&&typeof r=="string"&&r){var p=Nn(r);p='link[rel="'+s+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),W4.has(p)||(W4.add(p),s={rel:s,crossOrigin:l,href:r},h.querySelector(p)===null&&(r=h.createElement("link"),Ke(r,"link",s),He(r),h.head.appendChild(r)))}}function Xx(s){Hi.D(s),Z4("dns-prefetch",s,null)}function Yx(s,r){Hi.C(s,r),Z4("preconnect",s,r)}function $x(s,r,l){Hi.L(s,r,l);var h=ua;if(h&&s&&r){var p='link[rel="preload"][as="'+Nn(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Nn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Nn(l.imageSizes)+'"]')):p+='[href="'+Nn(s)+'"]';var g=p;switch(r){case"style":g=ha(s);break;case"script":g=fa(s)}zn.has(g)||(s=y({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:s,as:r},l),zn.set(g,s),h.querySelector(p)!==null||r==="style"&&h.querySelector(No(g))||r==="script"&&h.querySelector(Do(g))||(r=h.createElement("link"),Ke(r,"link",s),He(r),h.head.appendChild(r)))}}function Wx(s,r){Hi.m(s,r);var l=ua;if(l&&s){var h=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Nn(h)+'"][href="'+Nn(s)+'"]',g=p;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=fa(s)}if(!zn.has(g)&&(s=y({rel:"modulepreload",href:s},r),zn.set(g,s),l.querySelector(p)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Do(g)))return}h=l.createElement("link"),Ke(h,"link",s),He(h),l.head.appendChild(h)}}}function Zx(s,r,l){Hi.S(s,r,l);var h=ua;if(h&&s){var p=Dr(h).hoistableStyles,g=ha(s);r=r||"default";var S=p.get(g);if(!S){var B={loading:0,preload:null};if(S=h.querySelector(No(g)))B.loading=5;else{s=y({rel:"stylesheet",href:s,"data-precedence":r},l),(l=zn.get(g))&&v1(s,l);var q=S=h.createElement("link");He(q),Ke(q,"link",s),q._p=new Promise(function(nt,lt){q.onload=nt,q.onerror=lt}),q.addEventListener("load",function(){B.loading|=1}),q.addEventListener("error",function(){B.loading|=2}),B.loading|=4,Dc(S,r,h)}S={type:"stylesheet",instance:S,count:1,state:B},p.set(g,S)}}}function Kx(s,r){Hi.X(s,r);var l=ua;if(l&&s){var h=Dr(l).hoistableScripts,p=fa(s),g=h.get(p);g||(g=l.querySelector(Do(p)),g||(s=y({src:s,async:!0},r),(r=zn.get(p))&&b1(s,r),g=l.createElement("script"),He(g),Ke(g,"link",s),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(p,g))}}function Qx(s,r){Hi.M(s,r);var l=ua;if(l&&s){var h=Dr(l).hoistableScripts,p=fa(s),g=h.get(p);g||(g=l.querySelector(Do(p)),g||(s=y({src:s,async:!0,type:"module"},r),(r=zn.get(p))&&b1(s,r),g=l.createElement("script"),He(g),Ke(g,"link",s),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(p,g))}}function K4(s,r,l,h){var p=(p=ct.current)?Nc(p):null;if(!p)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=ha(l.href),l=Dr(p).hoistableStyles,h=l.get(r),h||(h={type:"style",instance:null,count:0,state:null},l.set(r,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){s=ha(l.href);var g=Dr(p).hoistableStyles,S=g.get(s);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(s,S),(g=p.querySelector(No(s)))&&!g._p&&(S.instance=g,S.state.loading=5),zn.has(s)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},zn.set(s,l),g||Jx(p,s,l,S.state))),r&&h===null)throw Error(i(528,""));return S}if(r&&h!==null)throw Error(i(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=fa(l),l=Dr(p).hoistableScripts,h=l.get(r),h||(h={type:"script",instance:null,count:0,state:null},l.set(r,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function ha(s){return'href="'+Nn(s)+'"'}function No(s){return'link[rel="stylesheet"]['+s+"]"}function Q4(s){return y({},s,{"data-precedence":s.precedence,precedence:null})}function Jx(s,r,l,h){s.querySelector('link[rel="preload"][as="style"]['+r+"]")?h.loading=1:(r=s.createElement("link"),h.preload=r,r.addEventListener("load",function(){return h.loading|=1}),r.addEventListener("error",function(){return h.loading|=2}),Ke(r,"link",l),He(r),s.head.appendChild(r))}function fa(s){return'[src="'+Nn(s)+'"]'}function Do(s){return"script[async]"+s}function J4(s,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var h=s.querySelector('style[data-href~="'+Nn(l.href)+'"]');if(h)return r.instance=h,He(h),h;var p=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),He(h),Ke(h,"style",p),Dc(h,l.precedence,s),r.instance=h;case"stylesheet":p=ha(l.href);var g=s.querySelector(No(p));if(g)return r.state.loading|=4,r.instance=g,He(g),g;h=Q4(l),(p=zn.get(p))&&v1(h,p),g=(s.ownerDocument||s).createElement("link"),He(g);var S=g;return S._p=new Promise(function(B,q){S.onload=B,S.onerror=q}),Ke(g,"link",h),r.state.loading|=4,Dc(g,l.precedence,s),r.instance=g;case"script":return g=fa(l.src),(p=s.querySelector(Do(g)))?(r.instance=p,He(p),p):(h=l,(p=zn.get(g))&&(h=y({},l),b1(h,p)),s=s.ownerDocument||s,p=s.createElement("script"),He(p),Ke(p,"link",h),s.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(h=r.instance,r.state.loading|=4,Dc(h,l.precedence,s));return r.instance}function Dc(s,r,l){for(var h=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=h.length?h[h.length-1]:null,g=p,S=0;S title"):null)}function tC(s,r,l){if(l===1||r.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(s=r.disabled,typeof r.precedence=="string"&&s==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ny(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function eC(s,r,l,h){if(l.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=ha(h.href),g=r.querySelector(No(p));if(g){r=g._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(s.count++,s=Ic.bind(s),r.then(s,s)),l.state.loading|=4,l.instance=g,He(g);return}g=r.ownerDocument||r,h=Q4(h),(p=zn.get(p))&&v1(h,p),g=g.createElement("link"),He(g);var S=g;S._p=new Promise(function(B,q){S.onload=B,S.onerror=q}),Ke(g,"link",h),l.instance=g}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(s.count++,l=Ic.bind(s),r.addEventListener("load",l),r.addEventListener("error",l))}}var x1=0;function nC(s,r){return s.stylesheets&&s.count===0&&Pc(s,s.stylesheets),0x1?50:800)+r);return s.unsuspend=l,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(p)}}:null}function Ic(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pc(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Fc=null;function Pc(s,r){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Fc=new Map,r.forEach(iC,s),Fc=null,Ic.call(s))}function iC(s,r){if(!(r.state.loading&4)){var l=Fc.get(s);if(l)var h=l.get(null);else{l=new Map,Fc.set(s,l);for(var p=s.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),M1.exports=bC(),M1.exports}var CC=xC();const Yi={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function i8(n){return"init"in n}function v0(n){return typeof n.write=="function"}function TC(n){return!!n.onMount}function Ey(n){return"v"in n||"e"in n}function Ou(n){if("e"in n)throw n.e;if((Yi?"production":void 0)!=="production"&&!("v"in n))throw new Error("[Bug] atom state is not initialized");return n.v}function Nu(n){return typeof n?.then=="function"}function SC(n){if(!(n instanceof Error))return!1;const t=n.name,e=n.message.toLowerCase();return(t==="RangeError"||t==="InternalError")&&(e.includes("call stack")||e.includes("too much recursion")||e.includes("stack overflow"))}function s8(n,t,e){if(!e.p.has(n)){e.p.add(n);const i=()=>e.p.delete(n);t.then(i,i)}}function r8(n,t,e){const i=e.get(n),a=i?.t,o=t.p;if(!a?.size)return o;if(!o.size)return a;const c=new Set(a);for(const u of o)c.add(u);return c}function _C(n){return!!n.INTERNAL_onInit}const AC=(n,t,e,...i)=>e.read(...i),EC=(n,t,e,...i)=>e.write(...i),wC=(n,t,e)=>e.INTERNAL_onInit(t),MC=(n,t,e,i)=>{var a;return(a=e.onMount)==null?void 0:a.call(e,i)},RC=(n,t,e)=>{var i;const a=n[0];let o=a.get(e);if(!o){const c=n[6],u=n[9];o={d:new Map,p:new Set,n:0},a.set(e,o),(i=c.i)==null||i.call(c,e),_C(e)&&u(n,t,e)}return o},LC=(n,t)=>{var e;const i=n[1],a=n[3],o=n[4],c=n[5],u=n[6],f=n[13];if(!u.f&&!a.size&&!o.size&&!c.size)return;const d=[],m=y=>{try{y()}catch(v){d.push(v)}};do{u.f&&m(u.f);const y=new Set;for(const v of a){const x=(e=i.get(v))==null?void 0:e.l;if(x)for(const b of x)y.add(b)}a.clear();for(const v of c)y.add(v);c.clear();for(const v of o)y.add(v);o.clear();for(const v of y)m(v);a.size&&f(n,t)}while(a.size||c.size||o.size);if(d.length)throw new AggregateError(d)},OC=(n,t)=>{const e=n[1],i=n[2],a=n[3],o=n[11],c=n[14],u=n[17];if(!a.size)return;const f=[],d=[],m=new WeakSet,y=new WeakSet,v=[],x=[];for(const b of a)v.push(b),x.push(o(n,t,b));for(;v.length;){const b=v.length-1,T=v[b],C=x[b];if(y.has(T)){v.pop(),x.pop();continue}if(m.has(T)){if(i.get(T)===C.n)f.push(T),d.push(C);else if((Yi?"production":void 0)!=="production"&&i.has(T))throw new Error("[Bug] invalidated atom exists");y.add(T),v.pop(),x.pop();continue}m.add(T);for(const _ of r8(T,C,e))m.has(_)||(v.push(_),x.push(o(n,t,_)))}for(let b=f.length-1;b>=0;--b){const T=f[b],C=d[b];let _=!1;for(const R of C.d.keys())if(R!==T&&a.has(R)){_=!0;break}_&&(i.set(T,C.n),c(n,t,T),u(n,t,T)),i.delete(T)}},b0=new WeakSet,NC=(n,t,e)=>{var i,a;const o=n[1],c=n[2],u=n[3],f=n[6],d=n[7],m=n[11],y=n[12],v=n[13],x=n[14],b=n[16],T=n[17],C=n[20],_=n[26],R=n[28],L=m(n,t,e),P=R[0];if(Ey(L)){if(o.has(e)&&c.get(e)!==L.n||L.m===P)return L.m=P,L;let K=!1;for(const[A,I]of L.d)if(x(n,t,A).n!==I){K=!0;break}if(!K)return L.m=P,L}let w=!0;const F=new Set(L.d.keys()),E=()=>{for(const K of F)L.d.delete(K)},N=()=>{if(o.has(e)){const K=!u.size;T(n,t,e),K&&(v(n,t),y(n,t))}},D=K=>{var A;if(K===e){const O=m(n,t,K);if(!Ey(O))if(i8(K))C(n,t,K,K.init);else throw new Error("no atom init");return Ou(O)}const I=x(n,t,K);try{return Ou(I)}finally{F.delete(K),L.d.set(K,I.n),Nu(L.v)&&s8(e,L.v,I),o.has(e)&&((A=o.get(K))==null||A.t.add(e)),w||N()}};let k,U;const G={get signal(){return k||(k=new AbortController),k.signal},get setSelf(){return(Yi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Yi?"production":void 0)!=="production"&&!v0(e)&&console.warn("setSelf function cannot be used with read-only atom"),!U&&v0(e)&&(U=(...K)=>{if((Yi?"production":void 0)!=="production"&&w&&console.warn("setSelf function cannot be called in sync"),!w)try{return b(n,t,e,K)}finally{v(n,t),y(n,t)}}),U}},J=L.n,tt=c.get(e)===J;try{(Yi?"production":void 0)!=="production"&&b0.delete(t);const K=d(n,t,e,D,G);if((Yi?"production":void 0)!=="production"&&b0.has(t)&&console.warn("Detected store mutation during atom read. This is not supported."),C(n,t,e,K),Nu(K)){_(n,t,K,()=>k?.abort());const A=()=>{E(),N()};K.then(A,A)}else E();return(i=f.r)==null||i.call(f,e),L.m=P,L}catch(K){if(SC(K))throw K;return delete L.v,L.e=K,++L.n,L.m=P,L}finally{w=!1,L.n!==J&&tt&&(c.set(e,L.n),u.add(e),(a=f.c)==null||a.call(f,e))}},DC=(n,t,e)=>{const i=n[1],a=n[2],o=n[11],c=[e];for(;c.length;){const u=c.pop(),f=o(n,t,u);for(const d of r8(u,f,i)){const m=o(n,t,d);a.get(d)!==m.n&&(a.set(d,m.n),c.push(d))}}},BC=(n,t,e,i)=>{const a=n[3],o=n[6],c=n[8],u=n[11],f=n[12],d=n[13],m=n[14],y=n[15],v=n[16],x=n[17],b=n[20],T=n[28];let C=!0;const _=L=>Ou(m(n,t,L)),R=(L,...P)=>{var w;const F=u(n,t,L);try{if(L===e){if(!i8(L))throw new Error("atom not writable");(Yi?"production":void 0)!=="production"&&b0.add(t);const E=F.n,N=P[0];b(n,t,L,N),x(n,t,L),E!==F.n&&(++T[0],a.add(L),y(n,t,L),(w=o.c)==null||w.call(o,L));return}else return v(n,t,L,P)}finally{C||(d(n,t),f(n,t))}};try{return c(n,t,e,_,R,...i)}finally{C=!1}},IC=(n,t,e)=>{var i;const a=n[1],o=n[3],c=n[6],u=n[11],f=n[15],d=n[18],m=n[19],y=u(n,t,e),v=a.get(e);if(v&&y.d.size>0){for(const[x,b]of y.d)if(!v.d.has(x)){const T=u(n,t,x);d(n,t,x).t.add(e),v.d.add(x),b!==T.n&&(o.add(x),f(n,t,x),(i=c.c)==null||i.call(c,x))}for(const x of v.d)if(!y.d.has(x)){v.d.delete(x);const b=m(n,t,x);b?.t.delete(e)}}},FC=(n,t,e)=>{var i;const a=n[1],o=n[4],c=n[6],u=n[10],f=n[11],d=n[12],m=n[13],y=n[14],v=n[16],x=n[18],b=f(n,t,e);let T=a.get(e);if(!T){y(n,t,e);for(const C of b.d.keys())x(n,t,C).t.add(e);if(T={l:new Set,d:new Set(b.d.keys()),t:new Set},a.set(e,T),v0(e)&&TC(e)){const C=()=>{let _=!0;const R=(...L)=>{try{return v(n,t,e,L)}finally{_||(m(n,t),d(n,t))}};try{const L=u(n,t,e,R);L&&(T.u=()=>{_=!0;try{L()}finally{_=!1}})}finally{_=!1}};o.add(C)}(i=c.m)==null||i.call(c,e)}return T},PC=(n,t,e)=>{var i,a;const o=n[1],c=n[5],u=n[6],f=n[11],d=n[19],m=f(n,t,e);let y=o.get(e);if(!y||y.l.size)return y;let v=!1;for(const x of y.t)if((i=o.get(x))!=null&&i.d.has(e)){v=!0;break}if(!v){y.u&&c.add(y.u),y=void 0,o.delete(e);for(const x of m.d.keys()){const b=d(n,t,x);b?.t.delete(e)}(a=u.u)==null||a.call(u,e);return}return y},UC=(n,t,e,i)=>{const a=n[11],o=n[27],c=a(n,t,e),u="v"in c,f=c.v;if(Nu(i))for(const d of c.d.keys())s8(e,i,a(n,t,d));c.v=i,delete c.e,(!u||!Object.is(f,c.v))&&(++c.n,Nu(f)&&o(n,t,f))},kC=(n,t,e)=>{const i=n[14];return Ou(i(n,t,e))},zC=(n,t,e,...i)=>{const a=n[3],o=n[12],c=n[13],u=n[16],f=a.size;try{return u(n,t,e,i)}finally{a.size!==f&&(c(n,t),o(n,t))}},VC=(n,t,e,i)=>{const a=n[12],o=n[13],c=n[18],u=n[19],d=c(n,t,e).l;return d.add(i),o(n,t),a(n,t),()=>{d.delete(i),u(n,t,e),o(n,t),a(n,t)}},GC=(n,t,e,i)=>{const a=n[25];let o=a.get(e);if(!o){o=new Set,a.set(e,o);const c=()=>a.delete(e);e.then(c,c)}o.add(i)},HC=(n,t,e)=>{const a=n[25].get(e);a?.forEach(o=>o())},a8=new WeakMap;function jC(n){const t=a8.get(n);if((Yi?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");const e=t[24];return e?e(t,n):t}function qC(...n){const t={get(c){return i(e,t,c)},set(c,...u){return a(e,t,c,...u)},sub(c,u){return o(e,t,c,u)}},e=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},AC,EC,wC,MC,RC,LC,OC,NC,DC,BC,IC,FC,PC,UC,kC,zC,VC,void 0,new WeakMap,GC,HC,[0]].map((c,u)=>n[u]||c);a8.set(t,Object.freeze(e));const i=e[21],a=e[22],o=e[23];return t}const o8={};let XC=0;function zt(n,t){const e=`atom${++XC}`,i={toString(){return(o8?"production":void 0)!=="production"&&this.debugLabel?e+":"+this.debugLabel:e}};return typeof n=="function"?i.read=n:(i.init=n,i.read=YC,i.write=$C),t&&(i.write=t),i}function YC(n){return n(this)}function $C(n,t,e){return t(this,typeof e=="function"?e(n(this)):e)}function v2(){return qC()}let zo;function WC(){return zo||(zo=v2(),(o8?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=zo),globalThis.__JOTAI_DEFAULT_STORE__!==zo&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),zo}var X=Ku();const Qu=g2(X),ZC={},x0=X.createContext(void 0);function l8(n){return X.useContext(x0)||WC()}function KC({children:n,store:t}){const e=X.useRef(null);return t?X.createElement(x0.Provider,{value:t},n):(e.current===null&&(e.current=v2()),X.createElement(x0.Provider,{value:e.current},n))}const C0=n=>typeof n?.then=="function",T0=n=>{n.status||(n.status="pending",n.then(t=>{n.status="fulfilled",n.value=t},t=>{n.status="rejected",n.reason=t}))},QC=Qu.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(T0(n),n)}),D1=new WeakMap,wy=(n,t,e)=>{const i=jC(n),a=i[26];let o=D1.get(t);return o||(o=new Promise((c,u)=>{let f=t;const d=v=>x=>{f===v&&c(x)},m=v=>x=>{f===v&&u(x)},y=()=>{try{const v=e();C0(v)?(D1.set(v,o),f=v,v.then(d(v),m(v)),a(i,n,v,y)):c(v)}catch(v){u(v)}};t.then(d(t),m(t)),a(i,n,t,y)}),D1.set(t,o)),o};function Ct(n,t){const{delay:e,unstable_promiseStatus:i=!Qu.use}={},a=l8(),[[o,c,u],f]=X.useReducer(m=>{const y=a.get(n);return Object.is(m[0],y)&&m[1]===a&&m[2]===n?m:[y,a,n]},void 0,()=>[a.get(n),a,n]);let d=o;if((c!==a||u!==n)&&(f(),d=a.get(n)),X.useEffect(()=>{const m=a.sub(n,()=>{if(i)try{const y=a.get(n);C0(y)&&T0(wy(a,y,()=>a.get(n)))}catch{}if(typeof e=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3. + +Migration guide: + +Create a custom hook like the following. + +function useAtomValueWithDelay( + atom: Atom, + options: { delay: number }, +): Value { + const { delay } = options + const store = useStore(options) + const [value, setValue] = useState(() => store.get(atom)) + useEffect(() => { + const unsub = store.sub(atom, () => { + setTimeout(() => setValue(store.get(atom)), delay) + }) + return unsub + }, [store, atom, delay]) + return value +} +`),setTimeout(f,e);return}f()});return f(),m},[a,n,e,i]),X.useDebugValue(d),C0(d)){const m=wy(a,d,()=>a.get(n));return i&&T0(m),QC(m)}return d}function Du(n,t){const e=l8();return X.useCallback((...a)=>{if((ZC?"production":void 0)!=="production"&&!("write"in n))throw new Error("not writable atom");return e.set(n,...a)},[e,n])}function c8(n,t){return[Ct(n),Du(n)]}var B1={exports:{}},I1={};var My;function JC(){if(My)return I1;My=1;var n=Ku().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return I1.c=function(t){return n.H.useMemoCache(t)},I1}var Ry;function tT(){return Ry||(Ry=1,B1.exports=JC()),B1.exports}var Ae=tT(),F1={exports:{}};var Ly;function eT(){return Ly||(Ly=1,(function(n){(function(){var t={}.hasOwnProperty;function e(){for(var o="",c=0;c-1&&n.splice(e,1)}const Ci=(n,t,e)=>e>t?t:e{};const Ns={},u8=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),h8=n=>typeof n=="object"&&n!==null,f8=n=>/^0[^.\s]+$/u.test(n);function d8(n){let t;return()=>(t===void 0&&(t=n()),t)}const Xn=n=>n,_l=(...n)=>n.reduce((t,e)=>i=>e(t(i))),Na=(n,t,e)=>{const i=t-n;return i?(e-n)/i:1};class x2{constructor(){this.subscriptions=[]}add(t){return b2(this.subscriptions,t),()=>Oa(this.subscriptions,t)}notify(t,e,i){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,e,i);else for(let o=0;on*1e3,Gn=n=>n/1e3,m8=(n,t)=>t?n*(1e3/t):0,sT=(n,t,e)=>{const i=t-n;return((e-n)%i+i)%i+n},p8=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n,rT=1e-7,aT=12;function oT(n,t,e,i,a){let o,c,u=0;do c=t+(e-t)/2,o=p8(c,i,a)-n,o>0?e=c:t=c;while(Math.abs(o)>rT&&++uoT(o,0,1,n,e);return o=>o===0||o===1?o:p8(a(o),t,i)}const y8=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,C2=n=>t=>1-n(1-t),g8=Al(.33,1.53,.69,.99),T2=C2(g8),v8=y8(T2),b8=n=>n>=1?1:(n*=2)<1?.5*T2(n):.5*(2-Math.pow(2,-10*(n-1))),S2=n=>1-Math.sin(Math.acos(n)),x8=C2(S2),C8=y8(S2),lT=Al(.42,0,1,1),cT=Al(0,0,.58,1),T8=Al(.42,0,.58,1),S8=n=>Array.isArray(n)&&typeof n[0]!="number";function _8(n,t){return S8(n)?n[sT(0,n.length,t)]:n}const A8=n=>Array.isArray(n)&&typeof n[0]=="number",uT={linear:Xn,easeIn:lT,easeInOut:T8,easeOut:cT,circIn:S2,circInOut:C8,circOut:x8,backIn:T2,backInOut:v8,backOut:g8,anticipate:b8},hT=n=>typeof n=="string",Oy=n=>{if(A8(n)){th(n.length===4);const[t,e,i,a]=n;return Al(t,e,i,a)}else if(hT(n))return uT[n];return n},qc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function fT(n){let t=new Set,e=new Set,i=!1,a=!1;const o=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function u(d){o.has(d)&&(f.schedule(d),n()),d(c)}const f={schedule:(d,m=!1,y=!1)=>{const x=y&&i?t:e;return m&&o.add(d),x.add(d),d},cancel:d=>{e.delete(d),o.delete(d)},process:d=>{if(c=d,i){a=!0;return}i=!0;const m=t;t=e,e=m,t.forEach(u),t.clear(),i=!1,a&&(a=!1,f.process(d))}};return f}const dT=40;function E8(n,t){let e=!1,i=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>e=!0,c=qc.reduce((L,P)=>(L[P]=fT(o),L),{}),{setup:u,read:f,resolveKeyframes:d,preUpdate:m,update:y,preRender:v,render:x,postRender:b}=c,T=()=>{const L=Ns.useManualTiming,P=L?a.timestamp:performance.now();e=!1,L||(a.delta=i?1e3/60:Math.max(Math.min(P-a.timestamp,dT),1)),a.timestamp=P,a.isProcessing=!0,u.process(a),f.process(a),d.process(a),m.process(a),y.process(a),v.process(a),x.process(a),b.process(a),a.isProcessing=!1,e&&t&&(i=!1,n(T))},C=()=>{e=!0,i=!0,a.isProcessing||n(T)};return{schedule:qc.reduce((L,P)=>{const w=c[P];return L[P]=(F,E=!1,N=!1)=>(e||C(),w.schedule(F,E,N)),L},{}),cancel:L=>{for(let P=0;P(pu===void 0&&cn.set(Qe.isProcessing||Ns.useManualTiming?Qe.timestamp:performance.now()),pu),set:n=>{pu=n,queueMicrotask(mT)}},w8=n=>t=>typeof t=="string"&&t.startsWith(n),M8=w8("--"),pT=w8("var(--"),_2=n=>pT(n)?yT.test(n.split("/*")[0].trim()):!1,yT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ny(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const Fa={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},dl={...Fa,transform:n=>Ci(0,1,n)},Xc={...Fa,default:1},sl=n=>Math.round(n*1e5)/1e5,A2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gT(n){return n==null}const vT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,E2=(n,t)=>e=>!!(typeof e=="string"&&vT.test(e)&&e.startsWith(n)||t&&!gT(e)&&Object.prototype.hasOwnProperty.call(e,t)),R8=(n,t,e)=>i=>{if(typeof i!="string")return i;const[a,o,c,u]=i.match(A2);return{[n]:parseFloat(a),[t]:parseFloat(o),[e]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},bT=n=>Ci(0,255,n),U1={...Fa,transform:n=>Math.round(bT(n))},pr={test:E2("rgb","red"),parse:R8("red","green","blue"),transform:({red:n,green:t,blue:e,alpha:i=1})=>"rgba("+U1.transform(n)+", "+U1.transform(t)+", "+U1.transform(e)+", "+sl(dl.transform(i))+")"};function xT(n){let t="",e="",i="",a="";return n.length>5?(t=n.substring(1,3),e=n.substring(3,5),i=n.substring(5,7),a=n.substring(7,9)):(t=n.substring(1,2),e=n.substring(2,3),i=n.substring(3,4),a=n.substring(4,5),t+=t,e+=e,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}}const S0={test:E2("#"),parse:xT,transform:pr.transform},El=n=>({test:t=>typeof t=="string"&&t.endsWith(n)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${n}`}),Xi=El("deg"),vi=El("%"),_t=El("px"),CT=El("vh"),TT=El("vw"),Dy={...vi,parse:n=>vi.parse(n)/100,transform:n=>vi.transform(n*100)},Sa={test:E2("hsl","hue"),parse:R8("hue","saturation","lightness"),transform:({hue:n,saturation:t,lightness:e,alpha:i=1})=>"hsla("+Math.round(n)+", "+vi.transform(sl(t))+", "+vi.transform(sl(e))+", "+sl(dl.transform(i))+")"},Fe={test:n=>pr.test(n)||S0.test(n)||Sa.test(n),parse:n=>pr.test(n)?pr.parse(n):Sa.test(n)?Sa.parse(n):S0.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?pr.transform(n):Sa.transform(n),getAnimatableNone:n=>{const t=Fe.parse(n);return t.alpha=0,Fe.transform(t)}},ST=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _T(n){return isNaN(n)&&typeof n=="string"&&(n.match(A2)?.length||0)+(n.match(ST)?.length||0)>0}const L8="number",O8="color",AT="var",ET="var(",By="${}",wT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Da(n){const t=n.toString(),e=[],i={color:[],number:[],var:[]},a=[];let o=0;const u=t.replace(wT,f=>(Fe.test(f)?(i.color.push(o),a.push(O8),e.push(Fe.parse(f))):f.startsWith(ET)?(i.var.push(o),a.push(AT),e.push(f)):(i.number.push(o),a.push(L8),e.push(parseFloat(f))),++o,By)).split(By);return{values:e,split:u,indexes:i,types:a}}function MT(n){return Da(n).values}function N8({split:n,types:t}){const e=n.length;return i=>{let a="";for(let o=0;otypeof n=="number"?0:Fe.test(n)?Fe.getAnimatableNone(n):n,OT=(n,t)=>typeof n=="number"?t?.trim().endsWith("/")?n:0:LT(n);function NT(n){const t=Da(n);return N8(t)(t.values.map((i,a)=>OT(i,t.split[a])))}const ri={test:_T,parse:MT,createTransformer:RT,getAnimatableNone:NT};function k1(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function DT({hue:n,saturation:t,lightness:e,alpha:i}){n/=360,t/=100,e/=100;let a=0,o=0,c=0;if(!t)a=o=c=e;else{const u=e<.5?e*(1+t):e+t-e*t,f=2*e-u;a=k1(f,u,n+1/3),o=k1(f,u,n),c=k1(f,u,n-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(c*255),alpha:i}}function Bu(n,t){return e=>e>0?t:n}const de=(n,t,e)=>n+(t-n)*e,z1=(n,t,e)=>{const i=n*n,a=e*(t*t-i)+i;return a<0?0:Math.sqrt(a)},BT=[S0,pr,Sa],IT=n=>BT.find(t=>t.test(n));function Iy(n){const t=IT(n);if(!t)return!1;let e=t.parse(n);return t===Sa&&(e=DT(e)),e}const Fy=(n,t)=>{const e=Iy(n),i=Iy(t);if(!e||!i)return Bu(n,t);const a={...e};return o=>(a.red=z1(e.red,i.red,o),a.green=z1(e.green,i.green,o),a.blue=z1(e.blue,i.blue,o),a.alpha=de(e.alpha,i.alpha,o),pr.transform(a))},_0=new Set(["none","hidden"]);function FT(n,t){return _0.has(n)?e=>e<=0?n:t:e=>e>=1?t:n}function PT(n,t){return e=>de(n,t,e)}function w2(n){return typeof n=="number"?PT:typeof n=="string"?_2(n)?Bu:Fe.test(n)?Fy:zT:Array.isArray(n)?D8:typeof n=="object"?Fe.test(n)?Fy:UT:Bu}function D8(n,t){const e=[...n],i=e.length,a=n.map((o,c)=>w2(o)(o,t[c]));return o=>{for(let c=0;c{for(const o in i)e[o]=i[o](a);return e}}function kT(n,t){const e=[],i={color:0,var:0,number:0};for(let a=0;a{const e=ri.createTransformer(t),i=Da(n),a=Da(t);return i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length?_0.has(n)&&!a.values.length||_0.has(t)&&!i.values.length?FT(n,t):_l(D8(kT(i,a),a.values),e):Bu(n,t)};function B8(n,t,e){return typeof n=="number"&&typeof t=="number"&&typeof e=="number"?de(n,t,e):w2(n)(n,t)}const VT=n=>{const t=({timestamp:e})=>n(e);return{start:(e=!0)=>ee.update(t,e),stop:()=>Ti(t),now:()=>Qe.isProcessing?Qe.timestamp:cn.now()}},I8=(n,t,e=10)=>{let i="";const a=Math.max(Math.round(t/e),2);for(let o=0;o=Iu?1/0:t}function F8(n,t=100,e){const i=e({...n,keyframes:[0,t]}),a=Math.min(M2(i),Iu);return{type:"keyframes",ease:o=>i.next(a*o).value/t,duration:Gn(a)}}const _e={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function A0(n,t){return n*Math.sqrt(1-t*t)}const GT=12;function HT(n,t,e){let i=e;for(let a=1;a{const m=d*c,y=m*n,v=m-e,x=A0(d,c),b=Math.exp(-y);return V1-v/x*b},o=d=>{const y=d*c*n,v=y*e+e,x=Math.pow(c,2)*Math.pow(d,2)*n,b=Math.exp(-y),T=A0(Math.pow(d,2),c);return(-a(d)+V1>0?-1:1)*((v-x)*b)/T}):(a=d=>{const m=Math.exp(-d*n),y=(d-e)*n+1;return-V1+m*y},o=d=>{const m=Math.exp(-d*n),y=(e-d)*(n*n);return m*y});const u=5/n,f=HT(a,o,u);if(n=vn(n),isNaN(f))return{stiffness:_e.stiffness,damping:_e.damping,duration:n};{const d=Math.pow(f,2)*i;return{stiffness:d,damping:c*2*Math.sqrt(i*d),duration:n}}}const qT=["duration","bounce"],XT=["stiffness","damping","mass"];function Py(n,t){return t.some(e=>n[e]!==void 0)}function YT(n){let t={velocity:_e.velocity,stiffness:_e.stiffness,damping:_e.damping,mass:_e.mass,isResolvedFromDuration:!1,...n};if(!Py(n,XT)&&Py(n,qT))if(t.velocity=0,n.visualDuration){const e=n.visualDuration,i=2*Math.PI/(e*1.2),a=i*i,o=2*Ci(.05,1,1-(n.bounce||0))*Math.sqrt(a);t={...t,mass:_e.mass,stiffness:a,damping:o}}else{const e=jT({...n,velocity:0});t={...t,...e,mass:_e.mass},t.isResolvedFromDuration=!0}return t}function ml(n=_e.visualDuration,t=_e.bounce){const e=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:t}:n;let{restSpeed:i,restDelta:a}=e;const o=e.keyframes[0],c=e.keyframes[e.keyframes.length-1],u={done:!1,value:o},{stiffness:f,damping:d,mass:m,duration:y,velocity:v,isResolvedFromDuration:x}=YT({...e,velocity:-Gn(e.velocity||0)}),b=v||0,T=d/(2*Math.sqrt(f*m)),C=c-o,_=Gn(Math.sqrt(f/m)),R=Math.abs(C)<5;i||(i=R?_e.restSpeed.granular:_e.restSpeed.default),a||(a=R?_e.restDelta.granular:_e.restDelta.default);let L,P,w,F,E,N;if(T<1)w=A0(_,T),F=(b+T*_*C)/w,L=k=>{const U=Math.exp(-T*_*k);return c-U*(F*Math.sin(w*k)+C*Math.cos(w*k))},E=T*_*F+C*w,N=T*_*C-F*w,P=k=>Math.exp(-T*_*k)*(E*Math.sin(w*k)+N*Math.cos(w*k));else if(T===1){L=U=>c-Math.exp(-_*U)*(C+(b+_*C)*U);const k=b+_*C;P=U=>Math.exp(-_*U)*(_*k*U-b)}else{const k=_*Math.sqrt(T*T-1);L=tt=>{const K=Math.exp(-T*_*tt),A=Math.min(k*tt,300);return c-K*((b+T*_*C)*Math.sinh(A)+k*C*Math.cosh(A))/k};const U=(b+T*_*C)/k,G=T*_*U-C*k,J=T*_*C-U*k;P=tt=>{const K=Math.exp(-T*_*tt),A=Math.min(k*tt,300);return K*(G*Math.sinh(A)+J*Math.cosh(A))}}const D={calculatedDuration:x&&y||null,velocity:k=>vn(P(k)),next:k=>{if(!x&&T<1){const G=Math.exp(-T*_*k),J=Math.sin(w*k),tt=Math.cos(w*k),K=c-G*(F*J+C*tt),A=vn(G*(E*J+N*tt));return u.done=Math.abs(A)<=i&&Math.abs(c-K)<=a,u.value=u.done?c:K,u}const U=L(k);if(x)u.done=k>=y;else{const G=vn(P(k));u.done=Math.abs(G)<=i&&Math.abs(c-U)<=a}return u.value=u.done?c:U,u},toString:()=>{const k=Math.min(M2(D),Iu),U=I8(G=>D.next(k*G).value,k,30);return k+"ms "+U},toTransition:()=>{}};return D}ml.applyToOptions=n=>{const t=F8(n,100,ml);return n.ease=t.ease,n.duration=vn(t.duration),n.type="keyframes",n};const $T=5;function P8(n,t,e){const i=Math.max(t-$T,0);return m8(e-n(i),t-i)}function E0({keyframes:n,velocity:t=0,power:e=.8,timeConstant:i=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:c,min:u,max:f,restDelta:d=.5,restSpeed:m}){const y=n[0],v={done:!1,value:y},x=N=>u!==void 0&&Nf,b=N=>u===void 0?f:f===void 0||Math.abs(u-N)-T*Math.exp(-N/i),L=N=>_+R(N),P=N=>{const D=R(N),k=L(N);v.done=Math.abs(D)<=d,v.value=v.done?_:k};let w,F;const E=N=>{x(v.value)&&(w=N,F=ml({keyframes:[v.value,b(v.value)],velocity:P8(L,N,v.value),damping:a,stiffness:o,restDelta:d,restSpeed:m}))};return E(0),{calculatedDuration:null,next:N=>{let D=!1;return!F&&w===void 0&&(D=!0,P(N),E(N)),w!==void 0&&N>=w?F.next(N-w):(!D&&P(N),v)}}}function WT(n,t,e){const i=[],a=e||Ns.mix||B8,o=n.length-1;for(let c=0;ct[0];if(o===2&&t[0]===t[1])return()=>t[1];const c=n[0]===n[1];n[0]>n[o-1]&&(n=[...n].reverse(),t=[...t].reverse());const u=WT(t,i,a),f=u.length,d=m=>{if(c&&m1)for(;yd(Ci(n[0],n[o-1],m)):d}function k8(n,t){const e=n[n.length-1];for(let i=1;i<=t;i++){const a=Na(0,t,i);n.push(de(e,1,a))}}function z8(n){const t=[0];return k8(t,n.length-1),t}function ZT(n,t){return n.map(e=>e*t)}function KT(n,t){return n.map(()=>t||T8).splice(0,n.length-1)}function rl({duration:n=300,keyframes:t,times:e,ease:i="easeInOut"}){const a=S8(i)?i.map(Oy):Oy(i),o={done:!1,value:t[0]},c=ZT(e&&e.length===t.length?e:z8(t),n),u=U8(c,t,{ease:Array.isArray(a)?a:KT(t,a)});return{calculatedDuration:n,next:f=>(o.value=u(f),o.done=f>=n,o)}}const QT=n=>n!==null;function eh(n,{repeat:t,repeatType:e="loop"},i,a=1){const o=n.filter(QT),u=a<0||t&&e!=="loop"&&t%2===1?0:o.length-1;return!u||i===void 0?o[u]:i}const JT={decay:E0,inertia:E0,tween:rl,keyframes:rl,spring:ml};function V8(n){typeof n.type=="string"&&(n.type=JT[n.type])}class R2{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const tS=n=>n/100;class pl extends R2{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==cn.now()&&this.tick(cn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;V8(t);const{type:e=rl,repeat:i=0,repeatDelay:a=0,repeatType:o,velocity:c=0}=t;let{keyframes:u}=t;const f=e||rl;f!==rl&&typeof u[0]!="number"&&(this.mixKeyframes=_l(tS,B8(u[0],u[1])),u=[0,100]);const d=f({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...u].reverse(),velocity:-c})),d.calculatedDuration===null&&(d.calculatedDuration=M2(d));const{calculatedDuration:m}=d;this.calculatedDuration=m,this.resolvedDuration=m+a,this.totalDuration=this.resolvedDuration*(i+1)-a,this.generator=d}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:a,mixKeyframes:o,mirroredGenerator:c,resolvedDuration:u,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:d=0,keyframes:m,repeat:y,repeatType:v,repeatDelay:x,type:b,onUpdate:T,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const _=this.currentTime-d*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?_<0:_>a;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let L=this.currentTime,P=i;if(y){const N=Math.min(this.currentTime,a)/u;let D=Math.floor(N),k=N%1;!k&&N>=1&&(k=1),k===1&&D--,D=Math.min(D,y+1),D%2&&(v==="reverse"?(k=1-k,x&&(k-=x/u)):v==="mirror"&&(P=c)),L=Ci(0,1,k)*u}let w;R?(this.delayState.value=m[0],w=this.delayState):w=P.next(L),o&&!R&&(w.value=o(w.value));let{done:F}=w;!R&&f!==null&&(F=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return E&&b!==E0&&(w.value=eh(m,this.options,C,this.speed)),T&&T(w.value),E&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return Gn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Gn(t)}get time(){return Gn(this.currentTime)}set time(t){t=vn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const e=this.generator.next(t).value;return P8(i=>this.generator.next(i).value,t,e)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(cn.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=Gn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=VT,startTime:e}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(cn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function eS(n){for(let t=1;tn*180/Math.PI,w0=n=>{const t=yr(Math.atan2(n[1],n[0]));return M0(t)},nS={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:w0,rotateZ:w0,skewX:n=>yr(Math.atan(n[1])),skewY:n=>yr(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},M0=n=>(n=n%360,n<0&&(n+=360),n),Uy=w0,ky=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),zy=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),iS={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ky,scaleY:zy,scale:n=>(ky(n)+zy(n))/2,rotateX:n=>M0(yr(Math.atan2(n[6],n[5]))),rotateY:n=>M0(yr(Math.atan2(-n[2],n[0]))),rotateZ:Uy,rotate:Uy,skewX:n=>yr(Math.atan(n[4])),skewY:n=>yr(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function R0(n){return n.includes("scale")?1:0}function L0(n,t){if(!n||n==="none")return R0(t);const e=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,a;if(e)i=iS,a=e;else{const u=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=nS,a=u}if(!a)return R0(t);const o=i[t],c=a[1].split(",").map(rS);return typeof o=="function"?o(c):c[o]}const sS=(n,t)=>{const{transform:e="none"}=getComputedStyle(n);return L0(e,t)};function rS(n){return parseFloat(n.trim())}const Pa=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ua=new Set([...Pa,"pathRotation"]),Vy=n=>n===Fa||n===_t,aS=new Set(["x","y","z"]),oS=Pa.filter(n=>!aS.has(n));function lS(n){const t=[];return oS.forEach(e=>{const i=n.getValue(e);i!==void 0&&(t.push([e,i.get()]),i.set(e.startsWith("scale")?1:0))}),t}const Ms={width:({x:n},{paddingLeft:t="0",paddingRight:e="0",boxSizing:i})=>{const a=n.max-n.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(e)},height:({y:n},{paddingTop:t="0",paddingBottom:e="0",boxSizing:i})=>{const a=n.max-n.min;return i==="border-box"?a:a-parseFloat(t)-parseFloat(e)},top:(n,{top:t})=>parseFloat(t),left:(n,{left:t})=>parseFloat(t),bottom:({y:n},{top:t})=>parseFloat(t)+(n.max-n.min),right:({x:n},{left:t})=>parseFloat(t)+(n.max-n.min),x:(n,{transform:t})=>L0(t,"x"),y:(n,{transform:t})=>L0(t,"y")};Ms.translateX=Ms.x;Ms.translateY=Ms.y;const br=new Set;let O0=!1,N0=!1,D0=!1;function G8(){if(N0){const n=Array.from(br).filter(i=>i.needsMeasurement),t=new Set(n.map(i=>i.element)),e=new Map;t.forEach(i=>{const a=lS(i);a.length&&(e.set(i,a),i.render())}),n.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const a=e.get(i);a&&a.forEach(([o,c])=>{i.getValue(o)?.set(c)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}N0=!1,O0=!1,br.forEach(n=>n.complete(D0)),br.clear()}function H8(){br.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(N0=!0)})}function cS(){D0=!0,H8(),G8(),D0=!1}class L2{constructor(t,e,i,a,o,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=a,this.element=o,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(br.add(this),O0||(O0=!0,ee.read(H8),ee.resolveKeyframes(G8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:a}=this;if(t[0]===null){const o=a?.get(),c=t[t.length-1];if(o!==void 0)t[0]=o;else if(i&&e){const u=i.readValue(e,c);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=c),a&&o===void 0&&a.set(t[0])}eS(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),br.delete(this)}cancel(){this.state==="scheduled"&&(br.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const uS=n=>n.startsWith("--");function j8(n,t,e){uS(t)?n.style.setProperty(t,e):n.style[t]=e}const hS={};function q8(n,t){const e=d8(n);return()=>hS[t]??e()}const fS=q8(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),X8=q8(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ko=([n,t,e,i])=>`cubic-bezier(${n}, ${t}, ${e}, ${i})`,Gy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ko([0,.65,.55,1]),circOut:Ko([.55,0,1,.45]),backIn:Ko([.31,.01,.66,-.59]),backOut:Ko([.33,1.53,.69,.99])};function Y8(n,t){if(n)return typeof n=="function"?X8()?I8(n,t):"ease-out":A8(n)?Ko(n):Array.isArray(n)?n.map(e=>Y8(e,t)||Gy.easeOut):Gy[n]}function dS(n,t,e,{delay:i=0,duration:a=300,repeat:o=0,repeatType:c="loop",ease:u="easeOut",times:f}={},d=void 0){const m={[t]:e};f&&(m.offset=f);const y=Y8(u,a);Array.isArray(y)&&(m.easing=y);const v={delay:i,duration:a,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:o+1,direction:c==="reverse"?"alternate":"normal"};return d&&(v.pseudoElement=d),n.animate(m,v)}function O2(n){return typeof n=="function"&&"applyToOptions"in n}function mS({type:n,...t}){return O2(n)&&X8()?n.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class $8 extends R2{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:a,pseudoElement:o,allowFlatten:c=!1,finalKeyframe:u,onComplete:f}=t;this.isPseudoElement=!!o,this.allowFlatten=c,this.options=t,th(typeof t.type!="string");const d=mS(t);this.animation=dS(e,i,a,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=eh(a,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(m),j8(e,i,m),this.animation.cancel()}f?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Gn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Gn(t)}get time(){return Gn(Number(this.animation.currentTime)||0)}set time(t){const e=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=vn(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:i,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&fS()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),i&&(this.animation.rangeEnd=i),Xn):a(this)}}const W8={anticipate:b8,backInOut:v8,circInOut:C8};function pS(n){return n in W8}function yS(n){typeof n.ease=="string"&&pS(n.ease)&&(n.ease=W8[n.ease])}const G1=10;class gS extends $8{constructor(t){yS(t),V8(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:i,onComplete:a,element:o,...c}=this.options;if(!e)return;if(t!==void 0){e.set(t);return}const u=new pl({...c,autoplay:!1}),f=Math.max(G1,cn.now()-this.startTime),d=Ci(0,G1,f-G1),m=u.sample(f).value,{name:y}=this.options;o&&y&&j8(o,y,m),e.setWithVelocity(u.sample(Math.max(0,f-d)).value,m,d),u.stop()}}const Hy=(n,t)=>t==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(ri.test(n)||n==="0")&&!n.startsWith("url("));function vS(n){const t=n[0];if(n.length===1)return!0;for(let e=0;eObject.hasOwnProperty.call(Element.prototype,"animate"));function _S(n){const{motionValue:t,name:e,repeatDelay:i,repeatType:a,damping:o,type:c,keyframes:u}=n,f=t?.owner?.current;if(!(f instanceof HTMLElement)&&!(f instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:m}=t.owner.getProps();return SS()&&e&&(Z8.has(e)||TS.has(e)&&CS(u))&&(e!=="transform"||!m)&&!d&&!i&&a!=="mirror"&&o!==0&&c!=="inertia"}const AS=40;class ES extends R2{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:c="loop",keyframes:u,name:f,motionValue:d,element:m,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=cn.now();const v={autoplay:t,delay:e,type:i,repeat:a,repeatDelay:o,repeatType:c,name:f,motionValue:d,element:m,...y},x=m?.KeyframeResolver||L2;this.keyframeResolver=new x(u,(b,T,C)=>this.onKeyframesResolved(b,T,v,!C),f,d,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,a){this.keyframeResolver=void 0;const{name:o,type:c,velocity:u,delay:f,isHandoff:d,onUpdate:m}=i;this.resolvedAt=cn.now();let y=!0;bS(t,o,c,u)||(y=!1,(Ns.instantAnimations||!f)&&m?.(eh(t,i,e)),t[0]=t[t.length-1],B0(i),i.repeat=0);const x={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>AS?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},b=y&&!d&&_S(x),T=x.motionValue?.owner?.current;let C;if(b)try{C=new gS({...x,element:T})}catch{C=new pl(x)}else C=new pl(x);C.finished.then(()=>{this.notifyFinished()}).catch(Xn),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),cS()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class wS{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let i=0;ii.attachTimeline(t));return()=>{e.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return jy(this.animations,"duration")}get iterationDuration(){return jy(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function jy(n,t){let e=0;for(let i=0;ie&&(e=a)}return e}class MS extends wS{then(t,e){return this.finished.finally(t).then(()=>{})}}function K8(n,t,e,i=0,a=1){const o=Array.from(n).sort((d,m)=>d.sortNodePosition(m)).indexOf(t),c=n.size,u=(c-1)*i;return typeof e=="function"?e(o,c):a===1?o*i:u-o*i}const qy=30,RS=n=>!isNaN(parseFloat(n)),al={current:void 0};class LS{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const a=cn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=cn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=RS(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new x2);const i=this.events[t].add(e);return t==="change"?()=>{i(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return al.current&&al.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=cn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>qy)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,qy);return m8(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ds(n,t){return new LS(n,t)}function Q8(n,t){if(n?.inherit&&t){const{inherit:e,...i}=n;return{...t,...i}}return n}function N2(n,t){const e=n?.[t]??n?.default??n;return e!==n?Q8(e,n):e}const OS={type:"spring",stiffness:500,damping:25,restSpeed:10},NS=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),DS={type:"keyframes",duration:.8},BS={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IS=(n,{keyframes:t})=>t.length>2?DS:Ua.has(n)?n.startsWith("scale")?NS(t[1]):OS:BS,FS=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function PS(n){for(const t in n)if(!FS.has(t))return!0;return!1}const D2=(n,t,e,i={},a,o)=>c=>{const u=N2(i,n)||{},f=u.delay||i.delay||0;let{elapsed:d=0}=i;d=d-vn(f);const m={keyframes:Array.isArray(e)?e:[null,e],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-d,onUpdate:v=>{t.set(v),u.onUpdate&&u.onUpdate(v)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:n,motionValue:t,element:o?void 0:a};PS(u)||Object.assign(m,IS(n,m)),m.duration&&(m.duration=vn(m.duration)),m.repeatDelay&&(m.repeatDelay=vn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let y=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(B0(m),m.delay===0&&(y=!0)),(Ns.instantAnimations||Ns.skipAnimations||a?.shouldSkipAnimations||u.skipAnimations)&&(y=!0,B0(m),m.delay=0),m.allowFlatten=!u.type&&!u.ease,y&&!o&&t.get()!==void 0){const v=eh(m.keyframes,u);if(v!==void 0){ee.update(()=>{m.onUpdate(v),m.onComplete()});return}}return u.isSync?new pl(m):new ES(m)},US=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function kS(n){const t=US.exec(n);if(!t)return[,];const[,e,i,a]=t;return[`--${e??i}`,a]}function J8(n,t,e=1){const[i,a]=kS(n);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const c=o.trim();return u8(c)?parseFloat(c):c}return _2(a)?J8(a,t,e+1):a}function Xy(n){const t=[{},{}];return n?.values.forEach((e,i)=>{t[0][i]=e.get(),t[1][i]=e.getVelocity()}),t}function B2(n,t,e,i){if(typeof t=="function"){const[a,o]=Xy(i);t=t(e!==void 0?e:n.custom,a,o)}if(typeof t=="string"&&(t=n.variants&&n.variants[t]),typeof t=="function"){const[a,o]=Xy(i);t=t(e!==void 0?e:n.custom,a,o)}return t}function xr(n,t,e){const i=n.getProps();return B2(i,t,e!==void 0?e:i.custom,n)}const t7=new Set(["width","height","top","left","right","bottom",...Pa]),I0=n=>Array.isArray(n);function zS(n,t,e){n.hasValue(t)?n.getValue(t).set(e):n.addValue(t,Ds(e))}function VS(n){return I0(n)?n[n.length-1]||0:n}function GS(n,t){const e=xr(n,t);let{transitionEnd:i={},transition:a={},...o}=e||{};o={...o,...i};for(const c in o){const u=VS(o[c]);zS(n,c,u)}}const Ce=n=>!!(n&&n.getVelocity);function HS(n){return!!(Ce(n)&&n.add)}function F0(n,t){const e=n.getValue("willChange");if(HS(e))return e.add(t);if(!e&&Ns.WillChange){const i=new Ns.WillChange("auto");n.addValue("willChange",i),i.add(t)}}function I2(n){return n.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const jS="framerAppearId",e7="data-"+I2(jS);function n7(n){return n.props[e7]}function qS({protectedKeys:n,needsAnimating:t},e){const i=n.hasOwnProperty(e)&&t[e]!==!0;return t[e]=!1,i}function F2(n,t,{delay:e=0,transitionOverride:i,type:a}={}){let{transition:o,transitionEnd:c,...u}=t;const f=n.getDefaultTransition();o=o?Q8(o,f):f;const d=o?.reduceMotion,m=o?.skipAnimations;i&&(o=i);const y=[],v=a&&n.animationState&&n.animationState.getState()[a],x=o?.path;x&&x.animateVisualElement(n,u,o,e,y);for(const b in u){const T=n.getValue(b,n.latestValues[b]??null),C=u[b];if(C===void 0||v&&qS(v,b))continue;const _={delay:e,...N2(o||{},b)};m&&(_.skipAnimations=!0);const R=T.get();if(R!==void 0&&!T.isAnimating()&&!Array.isArray(C)&&C===R&&!_.velocity){ee.update(()=>T.set(C));continue}let L=!1;if(window.MotionHandoffAnimation){const F=n7(n);if(F){const E=window.MotionHandoffAnimation(F,b,ee);E!==null&&(_.startTime=E,L=!0)}}F0(n,b);const P=d??n.shouldReduceMotion;T.start(D2(b,T,C,P&&t7.has(b)?{type:!1}:_,n,L));const w=T.animation;w&&y.push(w)}if(c){const b=()=>ee.update(()=>{c&&GS(n,c)});y.length?Promise.all(y).then(b):b()}return y}function P0(n,t,e={}){const i=xr(n,t,e.type==="exit"?n.presenceContext?.custom:void 0);let{transition:a=n.getDefaultTransition()||{}}=i||{};e.transitionOverride&&(a=e.transitionOverride);const o=i?()=>Promise.all(F2(n,i,e)):()=>Promise.resolve(),c=n.variantChildren&&n.variantChildren.size?(f=0)=>{const{delayChildren:d=0,staggerChildren:m,staggerDirection:y}=a;return XS(n,t,f,d,m,y,e)}:()=>Promise.resolve(),{when:u}=a;if(u){const[f,d]=u==="beforeChildren"?[o,c]:[c,o];return f().then(()=>d())}else return Promise.all([o(),c(e.delay)])}function XS(n,t,e=0,i=0,a=0,o=1,c){const u=[];for(const f of n.variantChildren)f.notify("AnimationStart",t),u.push(P0(f,t,{...c,delay:e+(typeof i=="function"?0:i)+K8(n.variantChildren,f,i,a,o)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(u)}function YS(n,t,e={}){n.notify("AnimationStart",t);let i;if(Array.isArray(t)){const a=t.map(o=>P0(n,o,e));i=Promise.all(a)}else if(typeof t=="string")i=P0(n,t,e);else{const a=typeof t=="function"?xr(n,t,e.custom):t;i=Promise.all(F2(n,a,e))}return i.then(()=>{n.notify("AnimationComplete",t)})}const $S={test:n=>n==="auto",parse:n=>n},i7=n=>t=>t.test(n),s7=[Fa,_t,vi,Xi,TT,CT,$S],Yy=n=>s7.find(i7(n));function WS(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||f8(n):!0}const ZS=new Set(["brightness","contrast","saturate","opacity"]);function KS(n){const[t,e]=n.slice(0,-1).split("(");if(t==="drop-shadow")return n;const[i]=e.match(A2)||[];if(!i)return n;const a=e.replace(i,"");let o=ZS.has(t)?1:0;return i!==e&&(o*=100),t+"("+o+a+")"}const QS=/\b([a-z-]*)\(.*?\)/gu,U0={...ri,getAnimatableNone:n=>{const t=n.match(QS);return t?t.map(KS).join(" "):n}},k0={...ri,getAnimatableNone:n=>{const t=ri.parse(n);return ri.createTransformer(n)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},$y={...Fa,transform:Math.round},JS={rotate:Xi,pathRotation:Xi,rotateX:Xi,rotateY:Xi,rotateZ:Xi,scale:Xc,scaleX:Xc,scaleY:Xc,scaleZ:Xc,skew:Xi,skewX:Xi,skewY:Xi,distance:_t,translateX:_t,translateY:_t,translateZ:_t,x:_t,y:_t,z:_t,perspective:_t,transformPerspective:_t,opacity:dl,originX:Dy,originY:Dy,originZ:_t},Fu={borderWidth:_t,borderTopWidth:_t,borderRightWidth:_t,borderBottomWidth:_t,borderLeftWidth:_t,borderRadius:_t,borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomRightRadius:_t,borderBottomLeftRadius:_t,width:_t,maxWidth:_t,height:_t,maxHeight:_t,top:_t,right:_t,bottom:_t,left:_t,inset:_t,insetBlock:_t,insetBlockStart:_t,insetBlockEnd:_t,insetInline:_t,insetInlineStart:_t,insetInlineEnd:_t,padding:_t,paddingTop:_t,paddingRight:_t,paddingBottom:_t,paddingLeft:_t,paddingBlock:_t,paddingBlockStart:_t,paddingBlockEnd:_t,paddingInline:_t,paddingInlineStart:_t,paddingInlineEnd:_t,margin:_t,marginTop:_t,marginRight:_t,marginBottom:_t,marginLeft:_t,marginBlock:_t,marginBlockStart:_t,marginBlockEnd:_t,marginInline:_t,marginInlineStart:_t,marginInlineEnd:_t,fontSize:_t,backgroundPositionX:_t,backgroundPositionY:_t,...JS,zIndex:$y,fillOpacity:dl,strokeOpacity:dl,numOctaves:$y},t_={...Fu,color:Fe,backgroundColor:Fe,outlineColor:Fe,fill:Fe,stroke:Fe,borderColor:Fe,borderTopColor:Fe,borderRightColor:Fe,borderBottomColor:Fe,borderLeftColor:Fe,filter:U0,WebkitFilter:U0,mask:k0,WebkitMask:k0},r7=n=>t_[n],e_=new Set([U0,k0]);function a7(n,t){let e=r7(n);return e_.has(e)||(e=ri),e.getAnimatableNone?e.getAnimatableNone(t):void 0}const n_=new Set(["auto","none","0"]);function i_(n,t,e){let i=0,a;for(;i{t.getValue(u).set(f)}),this.resolveNoneKeyframes()}}const P2=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function U2(n,t,e){if(n==null)return[];if(n instanceof EventTarget)return[n];if(typeof n=="string"){let i=document;t&&(i=t.current);const a=e?.[n]??i.querySelectorAll(n);return a?Array.from(a):[]}return Array.from(n).filter(i=>i!=null)}const z0=(n,t)=>t&&typeof n=="number"?t.transform(n):n;function yu(n){return h8(n)&&"offsetHeight"in n&&!("ownerSVGElement"in n)}const{schedule:k2}=E8(queueMicrotask,!1),ii={x:!1,y:!1};function o7(){return ii.x||ii.y}function r_(n){return n==="x"||n==="y"?ii[n]?null:(ii[n]=!0,()=>{ii[n]=!1}):ii.x||ii.y?null:(ii.x=ii.y=!0,()=>{ii.x=ii.y=!1})}function l7(n,t){const e=U2(n),i=new AbortController,a={passive:!0,...t,signal:i.signal};return[e,a,()=>i.abort()]}function a_(n){return!(n.pointerType==="touch"||o7())}function o_(n,t,e={}){const[i,a,o]=l7(n,e);return i.forEach(c=>{let u=!1,f=!1,d;const m=()=>{c.removeEventListener("pointerleave",b)},y=C=>{d&&(d(C),d=void 0),m()},v=C=>{u=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),f&&(f=!1,y(C))},x=()=>{u=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},b=C=>{if(C.pointerType!=="touch"){if(u){f=!0;return}y(C)}},T=C=>{if(!a_(C))return;f=!1;const _=t(c,C);typeof _=="function"&&(d=_,c.addEventListener("pointerleave",b,a))};c.addEventListener("pointerenter",T,a),c.addEventListener("pointerdown",x,a)}),o}const c7=(n,t)=>t?n===t?!0:c7(n,t.parentElement):!1,z2=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,l_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function c_(n){return l_.has(n.tagName)||n.isContentEditable===!0}const u_=new Set(["INPUT","SELECT","TEXTAREA"]);function h_(n){return u_.has(n.tagName)||n.isContentEditable===!0}const gu=new WeakSet;function Wy(n){return t=>{t.key==="Enter"&&n(t)}}function H1(n,t){n.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const f_=(n,t)=>{const e=n.currentTarget;if(!e)return;const i=Wy(()=>{if(gu.has(e))return;H1(e,"down");const a=Wy(()=>{H1(e,"up")}),o=()=>H1(e,"cancel");e.addEventListener("keyup",a,t),e.addEventListener("blur",o,t)});e.addEventListener("keydown",i,t),e.addEventListener("blur",()=>e.removeEventListener("keydown",i),t)};function Zy(n){return z2(n)&&!o7()}const Ky=new WeakSet;function d_(n,t,e={}){const[i,a,o]=l7(n,e),c=u=>{const f=u.currentTarget;if(!Zy(u)||Ky.has(u))return;gu.add(f),e.stopPropagation&&Ky.add(u);const d=t(f,u),m={...a,capture:!0},y=(b,T)=>{window.removeEventListener("pointerup",v,m),window.removeEventListener("pointercancel",x,m),gu.has(f)&&gu.delete(f),Zy(b)&&typeof d=="function"&&d(b,{success:T})},v=b=>{y(b,f===window||f===document||e.useGlobalTarget||c7(f,b.target))},x=b=>{y(b,!1)};window.addEventListener("pointerup",v,m),window.addEventListener("pointercancel",x,m)};return i.forEach(u=>{(e.useGlobalTarget?window:u).addEventListener("pointerdown",c,a),yu(u)&&(u.addEventListener("focus",d=>f_(d,a)),!c_(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}function nh(n){return h8(n)&&"ownerSVGElement"in n}const vu=new WeakMap;let bu;const u7=(n,t,e)=>(i,a)=>a&&a[0]?a[0][n+"Size"]:nh(i)&&"getBBox"in i?i.getBBox()[t]:i[e],m_=u7("inline","width","offsetWidth"),p_=u7("block","height","offsetHeight");function y_({target:n,borderBoxSize:t}){vu.get(n)?.forEach(e=>{e(n,{get width(){return m_(n,t)},get height(){return p_(n,t)}})})}function g_(n){n.forEach(y_)}function v_(){typeof ResizeObserver>"u"||(bu=new ResizeObserver(g_))}function b_(n,t){bu||v_();const e=U2(n);return e.forEach(i=>{let a=vu.get(i);a||(a=new Set,vu.set(i,a)),a.add(t),bu?.observe(i)}),()=>{e.forEach(i=>{const a=vu.get(i);a?.delete(t),a?.size||bu?.unobserve(i)})}}const xu=new Set;let _a;function x_(){_a=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};xu.forEach(t=>t(n))},window.addEventListener("resize",_a)}function C_(n){return xu.add(n),_a||x_(),()=>{xu.delete(n),!xu.size&&typeof _a=="function"&&(window.removeEventListener("resize",_a),_a=void 0)}}function Qy(n,t){return typeof n=="function"?C_(n):b_(n,t)}function h7(n){return nh(n)&&n.tagName==="svg"}function T_(...n){const t=!Array.isArray(n[0]),e=t?0:-1,i=n[0+e],a=n[1+e],o=n[2+e],c=n[3+e],u=U8(a,o,c);return t?u(i):u}function S_(n,t,e={}){const i=n.get();let a=null,o=i,c;const u=typeof i=="string"?i.replace(/[\d.-]/g,""):void 0,f=()=>{a&&(a.stop(),a=null),n.animation=void 0},d=()=>{const y=Jy(n.get()),v=Jy(o);if(y===v){f();return}const x=a?a.getGeneratorVelocity():n.getVelocity();f(),a=new pl({keyframes:[y,v],velocity:x,type:"spring",restDelta:.001,restSpeed:.01,...e,onUpdate:c})},m=()=>{d(),n.animation=a??void 0,n.events.animationStart?.notify(),a?.then(()=>{n.animation=void 0,n.events.animationComplete?.notify()})};if(n.attach((y,v)=>{o=y,c=x=>v(j1(x,u)),ee.postRender(m)},f),Ce(t)){let y=e.skipInitialAnimation===!0;const v=t.on("change",b=>{y?(y=!1,n.jump(j1(b,u),!1)):n.set(j1(b,u))}),x=n.on("destroy",v);return()=>{v(),x()}}return f}function j1(n,t){return t?n+t:n}function Jy(n){return typeof n=="number"?n:parseFloat(n)}const __=[...s7,Fe,ri],A_=n=>__.find(i7(n)),tg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Aa=()=>({x:tg(),y:tg()}),eg=()=>({min:0,max:0}),Ie=()=>({x:eg(),y:eg()}),yl=new WeakMap;function ih(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function gl(n){return typeof n=="string"||Array.isArray(n)}const V2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],G2=["initial",...V2];function sh(n){return ih(n.animate)||G2.some(t=>gl(n[t]))}function f7(n){return!!(sh(n)||n.variants)}function E_(n,t,e){for(const i in t){const a=t[i],o=e[i];if(Ce(a))n.addValue(i,a);else if(Ce(o))n.addValue(i,Ds(a,{owner:n}));else if(o!==a)if(n.hasValue(i)){const c=n.getValue(i);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=n.getStaticValue(i);n.addValue(i,Ds(c!==void 0?c:a,{owner:n}))}}for(const i in e)t[i]===void 0&&n.removeValue(i);return t}const V0={current:null},d7={current:!1},w_=typeof window<"u";function M_(){if(d7.current=!0,!!w_)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),t=()=>V0.current=n.matches;n.addEventListener("change",t),t()}else V0.current=!1}const ng=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Pu={};function m7(n){Pu=n}function R_(){return Pu}class p7{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:a,skipAnimations:o,blockInitialAnimation:c,visualState:u},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=L2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=cn.now();this.renderScheduledAtthis.bindToMotionValue(i,e)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(d7.current||M_(),this.shouldReduceMotion=V0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ti(this.notifyUpdate),Ti(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Z8.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:u,times:f,ease:d,duration:m}=e.accelerate,y=new $8({element:this.current,name:t,keyframes:u,times:f,ease:d,duration:vn(m)}),v=c(y);this.valueSubscriptions.set(t,()=>{v(),y.cancel()});return}const i=Ua.has(t);i&&this.onBindTransform&&this.onBindTransform();const a=e.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&ee.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{a(),o&&o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Pu){const e=Pu[t];if(!e)continue;const{isEnabled:i,Feature:a}=e;if(!this.features[t]&&a&&i(this.props)&&(this.features[t]=new a(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ie()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let i=0;ie.variantChildren.delete(t)}addValue(t,e){const i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&e!==void 0&&(i=Ds(e===null?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(u8(i)||f8(i))?i=parseFloat(i):!A_(i)&&ri.test(e)&&(i=a7(t,e)),this.setBaseTarget(t,Ce(i)?i.get():i)),Ce(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let i;if(typeof e=="string"||typeof e=="object"){const o=B2(this.props,e,this.presenceContext?.custom);o&&(i=o[t])}if(e&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ce(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,e){return this.events[t]||(this.events[t]=new x2),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){k2.render(this.render)}}class y7 extends p7{constructor(){super(...arguments),this.KeyframeResolver=s_}sortInstanceNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ce(t)&&(this.childSubscription=t.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Is{constructor(t){this.isMounted=!1,this.node=t}update(){}}function g7({top:n,left:t,right:e,bottom:i}){return{x:{min:t,max:e},y:{min:n,max:i}}}function L_({x:n,y:t}){return{top:t.min,right:n.max,bottom:t.max,left:n.min}}function O_(n,t){if(!t)return n;const e=t({x:n.left,y:n.top}),i=t({x:n.right,y:n.bottom});return{top:e.y,left:e.x,bottom:i.y,right:i.x}}function q1(n){return n===void 0||n===1}function G0({scale:n,scaleX:t,scaleY:e}){return!q1(n)||!q1(t)||!q1(e)}function ar(n){return G0(n)||v7(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function v7(n){return ig(n.x)||ig(n.y)}function ig(n){return n&&n!=="0%"}function Uu(n,t,e){const i=n-e,a=t*i;return e+a}function sg(n,t,e,i,a){return a!==void 0&&(n=Uu(n,a,i)),Uu(n,e,i)+t}function H0(n,t=0,e=1,i,a){n.min=sg(n.min,t,e,i,a),n.max=sg(n.max,t,e,i,a)}function b7(n,{x:t,y:e}){H0(n.x,t.translate,t.scale,t.originPoint),H0(n.y,e.translate,e.scale,e.originPoint)}const rg=.999999999999,ag=1.0000000000001;function N_(n,t,e,i=!1){const a=e.length;if(!a)return;t.x=t.y=1;let o,c;for(let u=0;urg&&(t.x=1),t.yrg&&(t.y=1)}function yi(n,t){n.min+=t,n.max+=t}function og(n,t,e,i,a=.5){const o=de(n.min,n.max,a);H0(n,t,e,o,i)}function lg(n,t){return typeof n=="string"?parseFloat(n)/100*(t.max-t.min):n}function Cu(n,t,e){const i=e??n;og(n.x,lg(t.x,i.x),t.scaleX,t.scale,t.originX),og(n.y,lg(t.y,i.y),t.scaleY,t.scale,t.originY)}function x7(n,t){return g7(O_(n.getBoundingClientRect(),t))}function D_(n,t,e){const i=x7(n,e),{scroll:a}=t;return a&&(yi(i.x,a.offset.x),yi(i.y,a.offset.y)),i}const B_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},I_=Pa.length;function F_(n,t,e){let i="",a=!0;for(let c=0;c{if(!t.target)return n;if(typeof n=="string")if(_t.test(n))n=parseFloat(n);else return n;const e=cg(n,t.target.x),i=cg(n,t.target.y);return`${e}% ${i}%`}},P_={correct:(n,{treeScale:t,projectionDelta:e})=>{const i=n,a=ri.parse(n);if(a.length>5)return i;const o=ri.createTransformer(n),c=typeof a[0]!="number"?1:0,u=e.x.scale*t.x,f=e.y.scale*t.y;a[0+c]/=u,a[1+c]/=f;const d=de(u,f,.5);return typeof a[2+c]=="number"&&(a[2+c]/=d),typeof a[3+c]=="number"&&(a[3+c]/=d),o(a)}},j0={borderRadius:{...Vo,applyTo:[...P2]},borderTopLeftRadius:Vo,borderTopRightRadius:Vo,borderBottomLeftRadius:Vo,borderBottomRightRadius:Vo,boxShadow:P_};function T7(n,{layout:t,layoutId:e}){return Ua.has(n)||n.startsWith("origin")||(t||e!==void 0)&&(!!j0[n]||n==="opacity")}function j2(n,t,e){const i=n.style,a=t?.style,o={};if(!i)return o;for(const c in i)(Ce(i[c])||a&&Ce(a[c])||T7(c,n)||e?.getValue(c)?.liveStyle!==void 0)&&(o[c]=i[c]);return o}function U_(n){return window.getComputedStyle(n)}class S7 extends y7{constructor(){super(...arguments),this.type="html",this.renderInstance=C7}mount(t){th(!!t.style),super.mount(t)}readValueFromInstance(t,e){if(Ua.has(e))return this.projection?.isProjecting?R0(e):sS(t,e);{const i=U_(t),a=(M8(e)?i.getPropertyValue(e):i[e])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:e}){return x7(t,e)}build(t,e,i){H2(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return j2(t,e,i)}}function k_(n,t){return n in t}class z_ extends p7{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(k_(e,t)){const i=t[e];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return Ie()}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const V_={offset:"stroke-dashoffset",array:"stroke-dasharray"},G_={offset:"strokeDashoffset",array:"strokeDasharray"};function H_(n,t,e=1,i=0,a=!0){n.pathLength=1;const o=a?V_:G_;n[o.offset]=`${-i}`,n[o.array]=`${t} ${e}`}const j_=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _7(n,{attrX:t,attrY:e,attrScale:i,pathLength:a,pathSpacing:o=1,pathOffset:c=0,...u},f,d,m){if(H2(n,u,d),f){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:y,style:v}=n;y.transform&&(v.transform=y.transform,delete y.transform),(v.transform||y.transformOrigin)&&(v.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),v.transform&&(v.transformBox=m?.transformBox??"fill-box",delete y.transformBox);for(const x of j_)y[x]!==void 0&&(v[x]=y[x],delete y[x]);t!==void 0&&(y.x=t),e!==void 0&&(y.y=e),i!==void 0&&(y.scale=i),a!==void 0&&H_(y,a,o,c,!1)}const A7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),E7=n=>typeof n=="string"&&n.toLowerCase()==="svg";function q_(n,t,e,i){C7(n,t,void 0,i);for(const a in t.attrs)n.setAttribute(A7.has(a)?a:I2(a),t.attrs[a])}function w7(n,t,e){const i=j2(n,t,e);for(const a in n)if(Ce(n[a])||Ce(t[a])){const o=Pa.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;i[o]=n[a]}return i}class M7 extends y7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ie}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ua.has(e)){const i=r7(e);return i&&i.default||0}return e=A7.has(e)?e:I2(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return w7(t,e,i)}build(t,e,i){_7(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,a){q_(t,e,i,a)}mount(t){this.isSVGTag=E7(t.tagName),super.mount(t)}}const X_=G2.length;function R7(n){if(!n)return;if(!n.isControllingVariants){const e=n.parent?R7(n.parent)||{}:{};return n.props.initial!==void 0&&(e.initial=n.props.initial),e}const t={};for(let e=0;ePromise.all(t.map(({animation:e,options:i})=>YS(n,e,i)))}function Z_(n){let t=W_(n),e=ug(),i=!0,a=!1;const o=d=>(m,y)=>{const v=xr(n,y,d==="exit"?n.presenceContext?.custom:void 0);if(v){const{transition:x,transitionEnd:b,...T}=v;m={...m,...T,...b}}return m};function c(d){t=d(n)}function u(d){const{props:m}=n,y=R7(n.parent)||{},v=[],x=new Set;let b={},T=1/0;for(let _=0;_<$_;_++){const R=Y_[_],L=e[R],P=m[R]!==void 0?m[R]:y[R],w=gl(P),F=R===d?L.isActive:null;F===!1&&(T=_);let E=P===y[R]&&P!==m[R]&&w;if(E&&(i||a)&&n.manuallyAnimateOnMount&&(E=!1),L.protectedKeys={...b},!L.isActive&&F===null||!P&&!L.prevProp||ih(P)||typeof P=="boolean")continue;if(R==="exit"&&L.isActive&&F!==!0){L.prevResolvedValues&&(b={...b,...L.prevResolvedValues});continue}const N=K_(L.prevProp,P);let D=N||R===d&&L.isActive&&!E&&w||_>T&&w,k=!1;const U=Array.isArray(P)?P:[P];let G=U.reduce(o(R),{});F===!1&&(G={});const{prevResolvedValues:J={}}=L,tt={...J,...G},K=O=>{D=!0,x.has(O)&&(k=!0,x.delete(O)),L.needsAnimating[O]=!0;const j=n.getValue(O);j&&(j.liveStyle=!1)};for(const O in tt){const j=G[O],V=J[O];if(b.hasOwnProperty(O))continue;let M=!1;I0(j)&&I0(V)?M=!L7(j,V)||N:M=j!==V,M?j!=null?K(O):x.add(O):j!==void 0&&x.has(O)?K(O):L.protectedKeys[O]=!0}L.prevProp=P,L.prevResolvedValues=G,L.isActive&&(b={...b,...G}),(i||a)&&n.blockInitialAnimation&&(D=!1);const A=E&&N;D&&(!A||k)&&v.push(...U.map(O=>{const j={type:R};if(typeof O=="string"&&(i||a)&&!A&&n.manuallyAnimateOnMount&&n.parent){const{parent:V}=n,M=xr(V,O);if(V.enteringChildren&&M){const{delayChildren:z}=M.transition||{};j.delay=K8(V.enteringChildren,n,z)}}return{animation:O,options:j}}))}if(x.size){const _={};if(typeof m.initial!="boolean"){const R=xr(n,Array.isArray(m.initial)?m.initial[0]:m.initial);R&&R.transition&&(_.transition=R.transition)}x.forEach(R=>{const L=n.getBaseTarget(R),P=n.getValue(R);P&&(P.liveStyle=!0),_[R]=L??null}),v.push({animation:_})}let C=!!v.length;return i&&(m.initial===!1||m.initial===m.animate)&&!n.manuallyAnimateOnMount&&(C=!1),i=!1,a=!1,C?t(v):Promise.resolve()}function f(d,m){if(e[d].isActive===m)return Promise.resolve();n.variantChildren?.forEach(v=>v.animationState?.setActive(d,m)),e[d].isActive=m;const y=u(d);for(const v in e)e[v].protectedKeys={};return y}return{animateChanges:u,setActive:f,setAnimateFunction:c,getState:()=>e,reset:()=>{e=ug(),a=!0}}}function K_(n,t){return typeof t=="string"?t!==n:Array.isArray(t)?!L7(t,n):!1}function nr(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ug(){return{animate:nr(!0),whileInView:nr(),whileHover:nr(),whileTap:nr(),whileDrag:nr(),whileFocus:nr(),exit:nr()}}function q0(n,t){n.min=t.min,n.max=t.max}function Jn(n,t){q0(n.x,t.x),q0(n.y,t.y)}function hg(n,t){n.translate=t.translate,n.scale=t.scale,n.originPoint=t.originPoint,n.origin=t.origin}const O7=1e-4,Q_=1-O7,J_=1+O7,N7=.01,tA=0-N7,eA=0+N7;function un(n){return n.max-n.min}function nA(n,t,e){return Math.abs(n-t)<=e}function fg(n,t,e,i=.5){n.origin=i,n.originPoint=de(t.min,t.max,n.origin),n.scale=un(e)/un(t),n.translate=de(e.min,e.max,n.origin)-n.originPoint,(n.scale>=Q_&&n.scale<=J_||isNaN(n.scale))&&(n.scale=1),(n.translate>=tA&&n.translate<=eA||isNaN(n.translate))&&(n.translate=0)}function ol(n,t,e,i){fg(n.x,t.x,e.x,i?i.originX:void 0),fg(n.y,t.y,e.y,i?i.originY:void 0)}function dg(n,t,e,i=0){const a=i?de(e.min,e.max,i):e.min;n.min=a+t.min,n.max=n.min+un(t)}function iA(n,t,e,i){dg(n.x,t.x,e.x,i?.x),dg(n.y,t.y,e.y,i?.y)}function mg(n,t,e,i=0){const a=i?de(e.min,e.max,i):e.min;n.min=t.min-a,n.max=n.min+un(t)}function ku(n,t,e,i){mg(n.x,t.x,e.x,i?.x),mg(n.y,t.y,e.y,i?.y)}function pg(n,t,e,i,a){return n-=t,n=Uu(n,1/e,i),a!==void 0&&(n=Uu(n,1/a,i)),n}function sA(n,t=0,e=1,i=.5,a,o=n,c=n){if(vi.test(t)&&(t=parseFloat(t),t=de(c.min,c.max,t/100)-c.min),typeof t!="number")return;let u=de(o.min,o.max,i);n===o&&(u-=t),n.min=pg(n.min,t,e,u,a),n.max=pg(n.max,t,e,u,a)}function yg(n,t,[e,i,a],o,c){sA(n,t[e],t[i],t[a],t.scale,o,c)}const rA=["x","scaleX","originX"],aA=["y","scaleY","originY"];function gg(n,t,e,i){yg(n.x,t,rA,e?e.x:void 0,i?i.x:void 0),yg(n.y,t,aA,e?e.y:void 0,i?i.y:void 0)}function vg(n){return n.translate===0&&n.scale===1}function D7(n){return vg(n.x)&&vg(n.y)}function bg(n,t){return n.min===t.min&&n.max===t.max}function oA(n,t){return bg(n.x,t.x)&&bg(n.y,t.y)}function xg(n,t){return Math.round(n.min)===Math.round(t.min)&&Math.round(n.max)===Math.round(t.max)}function B7(n,t){return xg(n.x,t.x)&&xg(n.y,t.y)}function Cg(n){return un(n.x)/un(n.y)}function Tg(n,t){return n.translate===t.translate&&n.scale===t.scale&&n.originPoint===t.originPoint}function pi(n){return[n("x"),n("y")]}function lA(n,t,e){let i="";const a=n.x.translate/t.x,o=n.y.translate/t.y,c=e?.z||0;if((a||o||c)&&(i=`translate3d(${a}px, ${o}px, ${c}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),e){const{transformPerspective:d,rotate:m,pathRotation:y,rotateX:v,rotateY:x,skewX:b,skewY:T}=e;d&&(i=`perspective(${d}px) ${i}`),m&&(i+=`rotate(${m}deg) `),y&&(i+=`rotate(${y}deg) `),v&&(i+=`rotateX(${v}deg) `),x&&(i+=`rotateY(${x}deg) `),b&&(i+=`skewX(${b}deg) `),T&&(i+=`skewY(${T}deg) `)}const u=n.x.scale*t.x,f=n.y.scale*t.y;return(u!==1||f!==1)&&(i+=`scale(${u}, ${f})`),i||"none"}const cA=P2.length,Sg=n=>typeof n=="string"?parseFloat(n):n,_g=n=>typeof n=="number"||_t.test(n);function uA(n,t,e,i,a,o){a?(n.opacity=de(0,e.opacity??1,hA(i)),n.opacityExit=de(t.opacity??1,0,fA(i))):o&&(n.opacity=de(t.opacity??1,e.opacity??1,i));for(let c=0;cit?1:e(Na(n,t,i))}function F7(n,t,e){const i=Ce(n)?n:Ds(n);return i.start(D2("",i,t,e)),i.animation}function vl(n,t,e,i={passive:!0}){return n.addEventListener(t,e,i),()=>n.removeEventListener(t,e,i)}const dA=(n,t)=>n.depth-t.depth;class mA{constructor(){this.children=[],this.isDirty=!1}add(t){b2(this.children,t),this.isDirty=!0}remove(t){Oa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(dA),this.isDirty=!1,this.children.forEach(t)}}function pA(n,t){const e=cn.now(),i=({timestamp:a})=>{const o=a-e;o>=t&&(Ti(i),n(o-t))};return ee.setup(i,!0),()=>Ti(i)}function Tu(n){return Ce(n)?n.get():n}class yA{constructor(){this.members=[]}add(t){b2(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const a=i.instance;(!a||a.isConnected===!1)&&!i.snapshot&&(Oa(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(Oa(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const i=this.members[e];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=i.options,{layoutDependency:o}=t.options;(a===void 0||a!==o)&&(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Su={hasAnimatedSinceResize:!0,hasEverUpdated:!1},X1=["","X","Y","Z"],gA=1e3;let vA=0;function Y1(n,t,e,i){const{latestValues:a}=t;a[n]&&(e[n]=a[n],t.setStaticValue(n,0),i&&(i[n]=0))}function P7(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:t}=n.options;if(!t)return;const e=n7(t);if(window.MotionHasOptimisedAnimation(e,"transform")){const{layout:a,layoutId:o}=n.options;window.MotionCancelOptimisedAnimation(e,"transform",ee,!(a||o))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&P7(i)}function U7({attachResizeListener:n,defaultParent:t,measureScroll:e,checkIsScrollRoot:i,resetTransform:a}){return class{constructor(c={},u=t?.()){this.id=vA++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(CA),this.nodes.forEach(wA),this.nodes.forEach(MA),this.nodes.forEach(TA)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let f=0;fthis.root.updateBlockedByResize=!1;ee.read(()=>{y=window.innerWidth}),n(c,()=>{const x=window.innerWidth;x!==y&&(y=x,this.root.updateBlockedByResize=!0,m&&m(),m=pA(v,250),Su.hasAnimatedSinceResize&&(Su.hasAnimatedSinceResize=!1,this.nodes.forEach(Mg)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||f)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||DA,{onLayoutAnimationStart:T,onLayoutAnimationComplete:C}=d.getProps(),_=!this.targetLayout||!B7(this.targetLayout,x),R=!y&&v;if(this.options.layoutRoot||this.resumeFrom||R||y&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...N2(b,"layout"),onPlay:T,onComplete:C};(d.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(m,R,L.path)}else y||Mg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ti(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(RA),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&P7(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!un(this.snapshot.measuredBox.x)&&!un(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f{const E=F/1e3,N=w?.(E);N?(v.x.translate=N.x,v.x.scale=de(c.x.scale,1,E),v.x.origin=c.x.origin,v.x.originPoint=c.x.originPoint,v.y.translate=N.y,v.y.scale=de(c.y.scale,1,E),v.y.origin=c.y.origin,v.y.originPoint=c.y.originPoint):(Rg(v.x,c.x,E),Rg(v.y,c.y,E)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ku(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),OA(this.relativeTarget,this.relativeTargetOrigin,x,E),P&&oA(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=Ie()),Jn(P,this.relativeTarget)),C&&(this.animationValues=y,uA(y,m,this.latestValues,E,L,R)),N&&N.rotate!==void 0&&(this.animationValues||(this.animationValues=y),this.animationValues.pathRotation=N.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ti(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{Su.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ds(0)),this.motionValue.jump(0,!1),this.currentAnimation=F7(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),c.onUpdate&&c.onUpdate(u)},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(gA),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:u,target:f,layout:d,latestValues:m}=c;if(!(!u||!f||!d)){if(this!==c&&this.layout&&d&&k7(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Ie();const y=un(this.layout.layoutBox.x);f.x.min=c.target.x.min,f.x.max=f.x.min+y;const v=un(this.layout.layoutBox.y);f.y.min=c.target.y.min,f.y.max=f.y.min+v}Jn(u,f),Cu(u,m),ol(this.projectionDeltaWithTransform,this.layoutCorrected,u,m)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new yA),this.sharedNodes.get(c).add(u);const d=u.options.initialPromotionConfig;u.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(u):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:u,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),c&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let u=!1;const{latestValues:f}=c;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(u=!0),!u)return;const d={};f.z&&Y1("z",c,d,this.animationValues);for(let m=0;mc.currentAnimation?.stop()),this.root.nodes.forEach(Eg),this.root.sharedNodes.clear()}}}function bA(n){n.updateLayout()}function xA(n){const t=n.resumeFrom?.snapshot||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=n.layout,{animationType:a}=n.options,o=t.source!==n.layout.source;if(a==="size")pi(m=>{const y=o?t.measuredBox[m]:t.layoutBox[m],v=un(y);y.min=e[m].min,y.max=y.min+v});else if(a==="x"||a==="y"){const m=a==="x"?"y":"x";q0(o?t.measuredBox[m]:t.layoutBox[m],e[m])}else k7(a,t.layoutBox,e)&&pi(m=>{const y=o?t.measuredBox[m]:t.layoutBox[m],v=un(e[m]);y.max=y.min+v,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[m].max=n.relativeTarget[m].min+v)});const c=Aa();ol(c,e,t.layoutBox);const u=Aa();o?ol(u,n.applyTransform(i,!0),t.measuredBox):ol(u,e,t.layoutBox);const f=!D7(c);let d=!1;if(!n.resumeFrom){const m=n.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:v}=m;if(y&&v){const x=n.options.layoutAnchor||void 0,b=Ie();ku(b,t.layoutBox,y.layoutBox,x);const T=Ie();ku(T,e,v.layoutBox,x),B7(b,T)||(d=!0),m.options.layoutRoot&&(n.relativeTarget=T,n.relativeTargetOrigin=b,n.relativeParent=m)}}}n.notifyListeners("didUpdate",{layout:e,snapshot:t,delta:u,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:d})}else if(n.isLead()){const{onExitComplete:e}=n.options;e&&e()}n.options.transition=void 0}function CA(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function TA(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function SA(n){n.clearSnapshot()}function Eg(n){n.clearMeasurements()}function _A(n){n.isLayoutDirty=!0,n.updateLayout()}function wg(n){n.isLayoutDirty=!1}function AA(n){n.isAnimationBlocked&&n.layout&&!n.isLayoutDirty&&(n.snapshot=n.layout,n.isLayoutDirty=!0)}function EA(n){const{visualElement:t}=n.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),n.resetTransform()}function Mg(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function wA(n){n.resolveTargetDelta()}function MA(n){n.calcProjection()}function RA(n){n.resetSkewAndRotation()}function LA(n){n.removeLeadSnapshot()}function Rg(n,t,e){n.translate=de(t.translate,0,e),n.scale=de(t.scale,1,e),n.origin=t.origin,n.originPoint=t.originPoint}function Lg(n,t,e,i){n.min=de(t.min,e.min,i),n.max=de(t.max,e.max,i)}function OA(n,t,e,i){Lg(n.x,t.x,e.x,i),Lg(n.y,t.y,e.y,i)}function NA(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const DA={duration:.45,ease:[.4,0,.1,1]},Og=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),Ng=Og("applewebkit/")&&!Og("chrome/")?Math.round:Xn;function Dg(n){n.min=Ng(n.min),n.max=Ng(n.max)}function BA(n){Dg(n.x),Dg(n.y)}function k7(n,t,e){return n==="position"||n==="preserve-aspect"&&!nA(Cg(t),Cg(e),.2)}function IA(n){return n!==n.root&&n.scroll?.wasRoot}const FA=U7({attachResizeListener:(n,t)=>vl(n,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),PA=n=>!n.isLayoutDirty&&n.willUpdate(!1);function Bg(){const n=new Set,t=new WeakMap,e=()=>n.forEach(PA);return{add:i=>{n.add(i),t.set(i,i.addEventListener("willUpdate",e))},remove:i=>{n.delete(i);const a=t.get(i);a&&(a(),t.delete(i)),e()},dirty:e}}const $1={current:void 0},z7=U7({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!$1.current){const n=new FA({});n.mount(window),n.setOptions({layoutScroll:!0}),$1.current=n}return $1.current},resetTransform:(n,t)=>{n.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),ka=X.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function Ig(n,t){if(typeof n=="function")return n(t);n!=null&&(n.current=t)}function UA(...n){return t=>{let e=!1;const i=n.map(a=>{const o=Ig(a,t);return!e&&typeof o=="function"&&(e=!0),o});if(e)return()=>{for(let a=0;a{const{width:v,height:x,top:b,left:T,right:C,bottom:_,direction:R}=f.current;if(t||o===!1||!u.current||!v||!x)return;const L=R==="rtl",P=e==="left"?L?`right: ${C}`:`left: ${T}`:L?`left: ${T}`:`right: ${C}`,w=i==="bottom"?`bottom: ${_}`:`top: ${b}`;u.current.dataset.motionPopId=c;const F=document.createElement("style");d&&(F.nonce=d);const E=a??document.head;return E.appendChild(F),F.sheet&&F.sheet.insertRule(` + [data-motion-pop-id="${c}"] { + position: absolute !important; + width: ${v}px !important; + height: ${x}px !important; + ${P}px !important; + ${w}px !important; + } + `),()=>{u.current?.removeAttribute("data-motion-pop-id"),E.contains(F)&&E.removeChild(F)}},[t]),Y.jsx(zA,{isPresent:t,childRef:u,sizeRef:f,pop:o,children:o===!1?n:X.cloneElement(n,{ref:y})})}const GA=({children:n,initial:t,isPresent:e,onExitComplete:i,custom:a,presenceAffectsLayout:o,mode:c,anchorX:u,anchorY:f,root:d})=>{const m=Cr(HA),y=X.useId(),v=X.useRef(e),x=X.useRef(i);Sl(()=>{v.current=e,x.current=i});let b=!0,T=X.useMemo(()=>(b=!1,{id:y,initial:t,isPresent:e,custom:a,onExitComplete:C=>{m.set(C,!0);for(const _ of m.values())if(!_)return;i&&i()},register:C=>(m.set(C,!1),()=>{m.delete(C),!v.current&&!m.size&&x.current?.()})}),[e,m,i]);return o&&b&&(T={...T}),X.useMemo(()=>{m.forEach((C,_)=>m.set(_,!1))},[e]),X.useEffect(()=>{!e&&!m.size&&i&&i()},[e]),n=Y.jsx(VA,{pop:c==="popLayout",isPresent:e,anchorX:u,anchorY:f,root:d,children:n}),Y.jsx(Ju.Provider,{value:T,children:n})};function HA(){return new Map}function V7(n=!0){const t=X.useContext(Ju);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:i,register:a}=t,o=X.useId();X.useEffect(()=>{if(n)return a(o)},[n]);const c=X.useCallback(()=>n&&i&&i(o),[o,i,n]);return!e&&i?[!1,c]:[!0]}const Yc=n=>n.key||"";function Fg(n){const t=[];return X.Children.forEach(n,e=>{X.isValidElement(e)&&t.push(e)}),t}const jA=({children:n,custom:t,initial:e=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:o="sync",propagate:c=!1,anchorX:u="left",anchorY:f="top",root:d})=>{const[m,y]=V7(c),v=X.useMemo(()=>Fg(n),[n]),x=c&&!m?[]:v.map(Yc),b=X.useRef(!0),T=X.useRef(v),C=Cr(()=>new Map),_=X.useRef(new Set),[R,L]=X.useState(v),[P,w]=X.useState(v);Sl(()=>{b.current=!1,T.current=v;for(let N=0;N{const D=Yc(N),k=c&&!m?!1:v===P||x.includes(D),U=()=>{if(_.current.has(D))return;if(C.has(D))_.current.add(D),C.set(D,!0);else return;let G=!0;C.forEach(J=>{J||(G=!1)}),G&&(E?.(),w(T.current),c&&y?.(),i&&i())};return Y.jsx(GA,{isPresent:k,initial:!b.current||e?void 0:!1,custom:t,presenceAffectsLayout:a,mode:o,root:d,onExitComplete:k?void 0:U,anchorX:u,anchorY:f,children:N},D)})})},qA=X.createContext(null);function XA(){const n=X.useRef(!1);return Sl(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function YA(){const n=XA(),[t,e]=X.useState(0),i=X.useCallback(()=>{n.current&&e(t+1)},[t]);return[X.useCallback(()=>ee.postRender(i),[i]),t]}const G7=n=>n===!0,$A=n=>G7(n===!0)||n==="id",WA=({children:n,id:t,inherit:e=!0})=>{const i=X.useContext(fl),a=X.useContext(qA),[o,c]=YA(),u=X.useRef(null),f=i.id||a;u.current===null&&($A(e)&&f&&(t=t?f+"-"+t:f),u.current={id:t,group:G7(e)&&i.group||Bg()});const d=X.useMemo(()=>({...u.current,forceRender:o}),[c]);return Y.jsx(fl.Provider,{value:d,children:n})},H7=X.createContext({strict:!1}),Pg={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ug=!1;function ZA(){if(Ug)return;const n={};for(const t in Pg)n[t]={isEnabled:e=>Pg[t].some(i=>!!e[i])};m7(n),Ug=!0}function j7(){return ZA(),R_()}function KA(n){const t=j7();for(const e in n)t[e]={...t[e],...n[e]};m7(t)}const QA=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function zu(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||QA.has(n)}let q7=n=>!zu(n);function JA(n){typeof n=="function"&&(q7=t=>t.startsWith("on")?!zu(t):n(t))}try{JA(require("@emotion/is-prop-valid").default)}catch{}function tE(n,t,e){const i={};for(const a in n)a==="values"&&typeof n.values=="object"||Ce(n[a])||(q7(a)||e===!0&&zu(a)||!t&&!zu(a)||n.draggable&&a.startsWith("onDrag"))&&(i[a]=n[a]);return i}const rh=X.createContext({});function eE(n,t){if(sh(n)){const{initial:e,animate:i}=n;return{initial:e===!1||gl(e)?e:void 0,animate:gl(i)?i:void 0}}return n.inherit!==!1?t:{}}function nE(n){const{initial:t,animate:e}=eE(n,X.useContext(rh));return X.useMemo(()=>({initial:t,animate:e}),[kg(t),kg(e)])}function kg(n){return Array.isArray(n)?n.join(" "):n}const q2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function X7(n,t,e){for(const i in t)!Ce(t[i])&&!T7(i,e)&&(n[i]=t[i])}function iE({transformTemplate:n},t){return X.useMemo(()=>{const e=q2();return H2(e,t,n),Object.assign({},e.vars,e.style)},[t])}function sE(n,t){const e=n.style||{},i={};return X7(i,e,n),Object.assign(i,iE(n,t)),i}function rE(n,t){const e={},i=sE(n,t);return n.drag&&n.dragListener!==!1&&(e.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(e.tabIndex=0),e.style=i,e}const Y7=()=>({...q2(),attrs:{}});function aE(n,t,e,i){const a=X.useMemo(()=>{const o=Y7();return _7(o,t,E7(i),n.transformTemplate,n.style),{...o.attrs,style:{...o.style}}},[t]);if(n.style){const o={};X7(o,n.style,n),a.style={...o,...a.style}}return a}const oE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function X2(n){return typeof n!="string"||n.includes("-")?!1:!!(oE.indexOf(n)>-1||/[A-Z]/u.test(n))}function lE(n,t,e,{latestValues:i},a,o=!1,c){const f=(c??X2(n)?aE:rE)(t,i,a,n),d=tE(t,typeof n=="string",o),m=n!==X.Fragment?{...d,...f,ref:e}:{},{children:y}=t,v=X.useMemo(()=>Ce(y)?y.get():y,[y]);return X.createElement(n,{...m,children:v})}function cE({scrapeMotionValuesFromProps:n,createRenderState:t},e,i,a){return{latestValues:uE(e,i,a,n),renderState:t()}}function uE(n,t,e,i){const a={},o=i(n,{});for(const v in o)a[v]=Tu(o[v]);let{initial:c,animate:u}=n;const f=sh(n),d=f7(n);t&&d&&!f&&n.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=e?e.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!ih(y)){const v=Array.isArray(y)?y:[y];for(let x=0;x(t,e)=>{const i=X.useContext(rh),a=X.useContext(Ju),o=()=>cE(n,t,i,a);return e?o():Cr(o)},hE=$7({scrapeMotionValuesFromProps:j2,createRenderState:q2}),fE=$7({scrapeMotionValuesFromProps:w7,createRenderState:Y7}),dE=Symbol.for("motionComponentSymbol");function mE(n,t,e){const i=X.useRef(e);X.useInsertionEffect(()=>{i.current=e});const a=X.useRef(null);return X.useCallback(o=>{o&&n.onMount?.(o),t&&(o?t.mount(o):t.unmount());const c=i.current;if(typeof c=="function")if(o){const u=c(o);typeof u=="function"&&(a.current=u)}else a.current?(a.current(),a.current=null):c(o);else c&&(c.current=o)},[t])}const W7=X.createContext({});function va(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function pE(n,t,e,i,a,o){const{visualElement:c}=X.useContext(rh),u=X.useContext(H7),f=X.useContext(Ju),d=X.useContext(ka),m=d.reducedMotion,y=d.skipAnimations,v=X.useRef(null),x=X.useRef(!1);i=i||u.renderer,!v.current&&i&&(v.current=i(n,{visualState:t,parent:c,props:e,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:o}),x.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const b=v.current,T=X.useContext(W7);b&&!b.projection&&a&&(b.type==="html"||b.type==="svg")&&yE(v.current,e,a,T);const C=X.useRef(!1);X.useInsertionEffect(()=>{b&&C.current&&b.update(e,f)});const _=e[e7],R=X.useRef(!!_&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Sl(()=>{x.current=!0,b&&(C.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),R.current&&b.animationState&&b.animationState.animateChanges())}),X.useEffect(()=>{b&&(!R.current&&b.animationState&&b.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),R.current=!1),b.enteringChildren=void 0)}),b}function yE(n,t,e,i){const{layoutId:a,layout:o,drag:c,dragConstraints:u,layoutScroll:f,layoutRoot:d,layoutAnchor:m,layoutCrossfade:y}=t;n.projection=new e(n.latestValues,t["data-framer-portal-id"]?void 0:Z7(n.parent)),n.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!c||u&&va(u),visualElement:n,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:y,layoutScroll:f,layoutRoot:d,layoutAnchor:m})}function Z7(n){if(n)return n.options.allowProjection!==!1?n.projection:Z7(n.parent)}function W1(n,{forwardMotionProps:t=!1,type:e}={},i,a){i&&KA(i);const o=e?e==="svg":X2(n),c=o?fE:hE;function u(d,m){let y;const v={...X.useContext(ka),...d,layoutId:gE(d)},{isStatic:x}=v,b=nE(d),T=c(d,x);if(!x&&typeof window<"u"){vE();const C=bE(v);y=C.MeasureLayout,b.visualElement=pE(n,T,v,a,C.ProjectionNode,o)}return Y.jsxs(rh.Provider,{value:b,children:[y&&b.visualElement?Y.jsx(y,{visualElement:b.visualElement,...v}):null,lE(n,d,mE(T,b.visualElement,m),T,x,t,o)]})}u.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const f=X.forwardRef(u);return f[dE]=n,f}function gE({layoutId:n}){const t=X.useContext(fl).id;return t&&n!==void 0?t+"-"+n:n}function vE(n,t){X.useContext(H7).strict}function bE(n){const t=j7(),{drag:e,layout:i}=t;if(!e&&!i)return{};const a={...e,...i};return{MeasureLayout:e?.isEnabled(n)||i?.isEnabled(n)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function xE(n,t){if(typeof Proxy>"u")return W1;const e=new Map,i=(o,c)=>W1(o,c,n,t),a=(o,c)=>i(o,c);return new Proxy(a,{get:(o,c)=>c==="create"?i:(e.has(c)||e.set(c,W1(c,void 0,n,t)),e.get(c))})}const CE=(n,t)=>t.isSVG??X2(n)?new M7(t):new S7(t,{allowProjection:n!==X.Fragment});class TE extends Is{constructor(t){super(t),t.animationState||(t.animationState=Z_(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ih(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let SE=0;class _E extends Is{constructor(){super(...arguments),this.id=SE++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){const{initial:o,custom:c}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=xr(this.node,o,c);if(u){const{transition:f,transitionEnd:d,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const a=this.node.animationState.setActive("exit",!t);e&&!t&&a.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const AE={animation:{Feature:TE},exit:{Feature:_E}};function wl(n){return{point:{x:n.pageX,y:n.pageY}}}const EE=n=>t=>z2(t)&&n(t,wl(t));function ll(n,t,e,i){return vl(n,t,EE(e),i)}const K7=({current:n})=>n?n.ownerDocument.defaultView:null,zg=(n,t)=>Math.abs(n-t);function wE(n,t){const e=zg(n.x,t.x),i=zg(n.y,t.y);return Math.sqrt(e**2+i**2)}const Vg=new Set(["auto","scroll"]);class Q7{constructor(t,e,{transformPagePoint:i,contextWindow:a=window,dragSnapToOrigin:o=!1,distanceThreshold:c=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=$c(this.lastRawMoveEventInfo,this.transformPagePoint));const b=Z1(this.lastMoveEventInfo,this.history),T=this.startEvent!==null,C=wE(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!T&&!C)return;const{point:_}=b,{timestamp:R}=Qe;this.history.push({..._,timestamp:R});const{onStart:L,onMove:P}=this.handlers;T||(L&&L(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,b)},this.handlePointerMove=(b,T)=>{this.lastMoveEvent=b,this.lastRawMoveEventInfo=T,this.lastMoveEventInfo=$c(T,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(b,T)=>{this.end();const{onEnd:C,onSessionEnd:_,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Z1(b.type==="pointercancel"?this.lastMoveEventInfo:$c(T,this.transformPagePoint),this.history);this.startEvent&&C&&C(b,L),_&&_(b,L)},!z2(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=c,this.contextWindow=a||window;const f=wl(t),d=$c(f,this.transformPagePoint),{point:m}=d,{timestamp:y}=Qe;this.history=[{...m,timestamp:y}];const{onSessionStart:v}=e;v&&v(t,Z1(d,this.history));const x={passive:!0,capture:!0};this.removeListeners=_l(ll(this.contextWindow,"pointermove",this.handlePointerMove,x),ll(this.contextWindow,"pointerup",this.handlePointerUp,x),ll(this.contextWindow,"pointercancel",this.handlePointerUp,x)),u&&this.startScrollTracking(u)}startScrollTracking(t){let e=t.parentElement;for(;e;){const i=getComputedStyle(e);(Vg.has(i.overflowX)||Vg.has(i.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const i=t===window,a=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:a.x-e.x,y:a.y-e.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,a),ee.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ti(this.updatePoint)}}function $c(n,t){return t?{point:t(n.point)}:n}function Gg(n,t){return{x:n.x-t.x,y:n.y-t.y}}function Z1({point:n},t){return{point:n,delta:Gg(n,J7(t)),offset:Gg(n,ME(t)),velocity:RE(t,.1)}}function ME(n){return n[0]}function J7(n){return n[n.length-1]}function RE(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,i=null;const a=J7(n);for(;e>=0&&(i=n[e],!(a.timestamp-i.timestamp>vn(t)));)e--;if(!i)return{x:0,y:0};i===n[0]&&n.length>2&&a.timestamp-i.timestamp>vn(t)*2&&(i=n[1]);const o=Gn(a.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const c={x:(a.x-i.x)/o,y:(a.y-i.y)/o};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function LE(n,{min:t,max:e},i){return t!==void 0&&ne&&(n=i?de(e,n,i.max):Math.min(n,e)),n}function Hg(n,t,e){return{min:t!==void 0?n.min+t:void 0,max:e!==void 0?n.max+e-(n.max-n.min):void 0}}function OE(n,{top:t,left:e,bottom:i,right:a}){return{x:Hg(n.x,e,a),y:Hg(n.y,t,i)}}function jg(n,t){let e=t.min-n.min,i=t.max-n.max;return t.max-t.mini?e=Na(t.min,t.max-i,n.min):i>a&&(e=Na(n.min,n.max-a,t.min)),Ci(0,1,e)}function BE(n,t){const e={};return t.min!==void 0&&(e.min=t.min-n.min),t.max!==void 0&&(e.max=t.max-n.min),e}const X0=.35;function IE(n=X0){return n===!1?n=0:n===!0&&(n=X0),{x:qg(n,"left","right"),y:qg(n,"top","bottom")}}function qg(n,t,e){return{min:Xg(n,t),max:Xg(n,e)}}function Xg(n,t){return typeof n=="number"?n:n[t]||0}const FE=new WeakMap;class PE{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ie(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:i}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=y=>{e&&this.snapToCursor(wl(y).point),this.stopAnimation()},c=(y,v)=>{const{drag:x,dragPropagation:b,onDragStart:T}=this.getProps();if(x&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=r_(x),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pi(_=>{let R=this.getAxisMotionValue(_).get()||0;if(vi.test(R)){const{projection:L}=this.visualElement;if(L&&L.layout){const P=L.layout.layoutBox[_];P&&(R=un(P)*(parseFloat(R)/100))}}this.originPoint[_]=R}),T&&ee.update(()=>T(y,v),!1,!0),F0(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},u=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:b,onDirectionLock:T,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:_}=v;if(b&&this.currentDirection===null){this.currentDirection=kE(_),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",v.point,_),this.updateAxis("y",v.point,_),this.visualElement.render(),C&&ee.update(()=>C(y,v),!1,!0)},f=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new Q7(t,{onSessionStart:o,onStart:c,onMove:u,onSessionEnd:f,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:K7(this.visualElement),element:this.visualElement.current})}stop(t,e){const i=t||this.latestPointerEvent,a=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!i)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&ee.postRender(()=>u(i,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){const{drag:a}=this.getProps();if(!i||!Wc(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let c=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(c=LE(c,this.constraints[t],this.elastic[t])),o.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;t&&va(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=OE(i.layoutBox,t):this.constraints=!1,this.elastic=IE(e),a!==this.constraints&&!va(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&pi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=BE(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!va(t))return!1;const i=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;a.root&&(a.root.scroll=void 0,a.root.updateScroll());const o=D_(i,a.root,this.visualElement.getTransformPagePoint());let c=NE(a.layout.layoutBox,o);if(e){const u=e(L_(c));this.hasMutatedConstraints=!!u,u&&(c=g7(u))}return c}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:a,dragTransition:o,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),f=this.constraints||{},d=pi(m=>{if(!Wc(m,e,this.currentDirection))return;let y=f&&f[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const v=a?200:1e6,x=a?40:1e7,b={type:"inertia",velocity:i?t[m]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...o,...y};return this.startAxisValueAnimation(m,b)});return Promise.all(d).then(u)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return F0(this.visualElement,t),i.start(D2(t,i,0,e,this.visualElement,!1))}stopAnimation(){pi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps()[e];return a||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){pi(e=>{const{drag:i}=this.getProps();if(!Wc(e,i,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(e);if(a&&a.layout){const{min:c,max:u}=a.layout.layoutBox[e],f=o.get()||0;o.set(t[e]-de(c,u,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!va(e)||!i||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};pi(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const f=u.get();a[c]=DE({min:f,max:f},this.constraints[c])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),pi(c=>{if(!Wc(c,t,null))return;const u=this.getAxisMotionValue(c),{min:f,max:d}=this.constraints[c];u.set(de(f,d,a[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;FE.set(this.visualElement,this);const t=this.visualElement.current,e=ll(t,"pointerdown",d=>{const{drag:m,dragListener:y=!0}=this.getProps(),v=d.target,x=v!==t&&h_(v);m&&y&&!x&&this.start(d)});let i;const a=()=>{const{dragConstraints:d}=this.getProps();va(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),i||(i=UE(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,c=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ee.read(a);const u=vl(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:m})=>{this.isDragging&&m&&(pi(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=d[y].translate,v.set(v.get()+d[y].translate))}),this.visualElement.render())}));return()=>{u(),e(),c(),f&&f(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:c=X0,dragMomentum:u=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:a,dragConstraints:o,dragElastic:c,dragMomentum:u}}}function Yg(n){let t=!0;return()=>{if(t){t=!1;return}n()}}function UE(n,t,e){const i=Qy(n,Yg(e)),a=Qy(t,Yg(e));return()=>{i(),a()}}function Wc(n,t,e){return(t===!0||t===n)&&(e===null||e===n)}function kE(n,t=10){let e=null;return Math.abs(n.y)>t?e="y":Math.abs(n.x)>t&&(e="x"),e}class zE extends Is{constructor(t){super(t),this.removeGroupControls=Xn,this.removeListeners=Xn,this.controls=new PE(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const K1=n=>(t,e)=>{n&&ee.update(()=>n(t,e),!1,!0)};class VE extends Is{constructor(){super(...arguments),this.removePointerDownListener=Xn}onPointerDown(t){this.session=new Q7(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:K7(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:a}=this.node.getProps();return{onSessionStart:K1(t),onStart:K1(e),onMove:K1(i),onEnd:(o,c)=>{delete this.session,a&&ee.postRender(()=>a(o,c))}}}mount(){this.removePointerDownListener=ll(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Q1=!1;class GE extends X.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:a}=this.props,{projection:o}=t;o&&(e.group&&e.group.add(o),i&&i.register&&a&&i.register(o),Q1&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Su.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:a,isPresent:o}=this.props,{projection:c}=i;return c&&(c.isPresent=o,t.layoutDependency!==e&&c.setOptions({...c.options,layoutDependency:e}),Q1=!0,a||t.layoutDependency!==e||e===void 0||t.isPresent!==o?c.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?c.promote():c.relegate()||ee.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=e,i.root.didUpdate(),k2.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:a}=t;Q1=!0,a&&(a.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(a),i&&i.deregister&&i.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function t9(n){const[t,e]=V7(),i=X.useContext(fl);return Y.jsx(GE,{...n,layoutGroup:i,switchLayoutGroup:X.useContext(W7),isPresent:t,safeToRemove:e})}const HE={pan:{Feature:VE},drag:{Feature:zE,ProjectionNode:z7,MeasureLayout:t9}};function $g(n,t,e){const{props:i}=n;n.animationState&&i.whileHover&&n.animationState.setActive("whileHover",e==="Start");const a="onHover"+e,o=i[a];o&&ee.postRender(()=>o(t,wl(t)))}class jE extends Is{mount(){const{current:t}=this.node;t&&(this.unmount=o_(t,(e,i)=>($g(this.node,i,"Start"),a=>$g(this.node,a,"End"))))}unmount(){}}class qE extends Is{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_l(vl(this.node.current,"focus",()=>this.onFocus()),vl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wg(n,t,e){const{props:i}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&i.whileTap&&n.animationState.setActive("whileTap",e==="Start");const a="onTap"+(e==="End"?"":e),o=i[a];o&&ee.postRender(()=>o(t,wl(t)))}class XE extends Is{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=d_(t,(a,o)=>(Wg(this.node,o,"Start"),(c,{success:u})=>Wg(this.node,c,u?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:i?.tap===!1})}unmount(){}}const Y0=new WeakMap,J1=new WeakMap,YE=n=>{const t=Y0.get(n.target);t&&t(n)},$E=n=>{n.forEach(YE)};function WE({root:n,...t}){const e=n||document;J1.has(e)||J1.set(e,{});const i=J1.get(e),a=JSON.stringify(t);return i[a]||(i[a]=new IntersectionObserver($E,{root:n,...t})),i[a]}function ZE(n,t,e){const i=WE(t);return Y0.set(n,e),i.observe(n),()=>{Y0.delete(n),i.unobserve(n)}}const KE={some:0,all:1};class QE extends Is{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:a="some",once:o}=t,c={root:e?e.current:void 0,rootMargin:i,threshold:typeof a=="number"?a:KE[a]},u=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),v=d?m:y;v&&v(f)};this.stopObserver=ZE(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(JE(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function JE({viewport:n={}},{viewport:t={}}={}){return e=>n[e]!==t[e]}const tw={inView:{Feature:QE},tap:{Feature:XE},focus:{Feature:qE},hover:{Feature:jE}},ew={layout:{ProjectionNode:z7,MeasureLayout:t9}},nw={...AE,...tw,...HE,...ew},Yn=xE(nw,CE);function Vu(n){const t=Cr(()=>Ds(n)),{isStatic:e}=X.useContext(ka);if(e){const[,i]=X.useState(n);X.useEffect(()=>t.on("change",i),[])}return t}function Y2(n,t){const e=Vu(t()),i=()=>e.set(t());return i(),Sl(()=>{const a=()=>ee.preRender(i,!1,!0),o=n.map(c=>c.on("change",a));return()=>{o.forEach(c=>c()),Ti(i)}}),e}function iw(n,...t){const e=n.length;function i(){let a="";for(let o=0;oc(d)),f=Array.isArray(n)?void 0:n.accelerate;return f&&!f.isTransformed&&typeof t!="function"&&Array.isArray(e)&&i?.clamp!==!1&&(u.accelerate={...f,times:t,keyframes:e,isTransformed:!0}),u}function Zg(n,t){const e=Cr(()=>[]);return Y2(n,()=>{e.length=0;const i=n.length;for(let a=0;aObject.keys(e)),o=Cr(()=>({}));for(const c of a)o[c]=$2(n,t,e[c],i);return o}function aw(n,t={}){const{isStatic:e}=X.useContext(ka),i=()=>Ce(n)?n.get():n;if(e)return $2(i);const a=Vu(i());return X.useInsertionEffect(()=>S_(a,n,t),[a,JSON.stringify(t)]),a}function ow(n,t={}){return aw(n,{type:"spring",...t})}function lw(n){const t=X.useRef(0),{isStatic:e}=X.useContext(ka);X.useEffect(()=>{if(e)return;const i=({timestamp:a,delta:o})=>{t.current||(t.current=a),n(a-t.current,o)};return ee.update(i,!0),()=>Ti(i)},[n])}function W2(n){return typeof n=="object"&&!Array.isArray(n)}function e9(n,t,e,i){return n==null?[]:typeof n=="string"&&W2(t)?U2(n,e,i):n instanceof NodeList?Array.from(n):Array.isArray(n)?n.filter(a=>a!=null):[n]}function cw(n,t,e){return n*(t+1)+e*t}function Kg(n,t,e,i){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,n+parseFloat(t)):t==="<"?e:t.startsWith("<")?Math.max(0,e+parseFloat(t.slice(1))):i.get(t)??n}function uw(n,t,e){for(let i=0;it&&a.at{const D=gw(P),{delay:k=0,times:U=z8(D),type:G=t.type||"keyframes",repeat:J,repeatType:tt,repeatDelay:K=0,...A}=w;let{ease:I=t.ease||"easeOut",duration:O}=w;const j=typeof k=="function"?k(E,N):k,V=D.length,M=O2(G)?G:a?.[G||"keyframes"];if(V<=2&&M){let st=100;if(V===2&&xw(D)){const pt=D[1]-D[0];st=Math.abs(pt)}const ct={...t,...A};O!==void 0&&(ct.duration=vn(O));const ft=F8(ct,st,M);I=ft.ease,O=ft.duration}O??(O=o);const z=y+j;U.length===1&&U[0]===0&&(U[1]=1);const H=U.length-D.length;if(H>0&&k8(U,H),D.length===1&&D.unshift(null),J&&J0?K/O:0;O=cw(O,J,K);const ct=[...D],ft=[...U];I=Array.isArray(I)?[...I]:[I];const pt=[...I],mt=tt==="reverse"||tt==="mirror";let dt=ct,St=pt;mt&&(dt=[...ct].reverse(),tt==="reverse"&&(St=[...pt].reverse().map(bt=>typeof bt=="function"?C2(bt):bt)));for(let bt=0;bt0&&(D.push(D[D.length-1]),U.push(xt),I.push("linear")),D.push(...wt);for(let Jt=0;Jt{for(const T in x){const C=x[T];C.sort(dw);const _=[],R=[],L=[];for(let E=0;Etypeof n=="number",xw=n=>n.every(bw);function Cw(n){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},e=nh(n)&&!h7(n)?new M7(t):new S7(t);e.mount(n),yl.set(n,e)}function Tw(n){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},e=new z_(t);e.mount(n),yl.set(n,e)}function Sw(n,t){return Ce(n)||typeof n=="number"||typeof n=="string"&&!W2(t)}function n9(n,t,e,i){const a=[];if(Sw(n,t))a.push(F7(n,W2(t)&&t.default||t,e&&(e.default||e)));else{if(n==null)return a;const o=e9(n,t,i),c=o.length;for(let u=0;u{if(Array.isArray(c)&&typeof c[0]=="function"){const u=c[0],f=Ds(0);return f.on("change",u),c.length===1?[f,[0,1]]:c.length===2?[f,[0,1],c[1]]:[f,c[1],c[2]]}return c});return yw(a,t,e,{spring:ml}).forEach(({keyframes:c,transition:u},f)=>{i.push(...n9(f,c,u))}),i}function Aw(n){return Array.isArray(n)&&n.some(Array.isArray)}function Ew(n={}){const{scope:t,reduceMotion:e,skipAnimations:i}=n;function a(o,c,u){let f=[],d;const m={};if(e!==void 0&&(m.reduceMotion=e),i!==void 0&&(m.skipAnimations=i),Aw(o)){const{onComplete:v,...x}=c||{};typeof v=="function"&&(d=v),f=_w(o,{...m,...x},t)}else{const{onComplete:v,...x}=u||{};typeof v=="function"&&(d=v),f=n9(o,c,{...m,...x},t)}const y=new MS(f);return d&&y.finished.then(d),t&&(t.animations.push(y),y.finished.then(()=>{Oa(t.animations,y)})),y}return a}const t5=Ew();function ww({topLeftCornerRadius:n,topRightCornerRadius:t,bottomRightCornerRadius:e,bottomLeftCornerRadius:i,width:a,height:o}){const c={topLeft:-1,topRight:-1,bottomLeft:-1,bottomRight:-1},u={topLeft:n,topRight:t,bottomLeft:i,bottomRight:e};return Object.entries(u).sort(([,f],[,d])=>d-f).forEach(([f,d])=>{const m=f,y=Mw[m],v=Math.min(...y.map(x=>{const b=u[x.corner];if(d===0&&b===0)return 0;const T=c[x.corner],C=x.side==="top"||x.side==="bottom"?a:o;return T>=0?C-c[x.corner]:d/(d+b)*C}));c[m]=v,u[m]=Math.min(d,v)}),{topLeft:{radius:u.topLeft,roundingAndSmoothingBudget:c.topLeft},topRight:{radius:u.topRight,roundingAndSmoothingBudget:c.topRight},bottomLeft:{radius:u.bottomLeft,roundingAndSmoothingBudget:c.bottomLeft},bottomRight:{radius:u.bottomRight,roundingAndSmoothingBudget:c.bottomRight}}}const Mw={topLeft:[{corner:"topRight",side:"top"},{corner:"bottomLeft",side:"left"}],topRight:[{corner:"topLeft",side:"top"},{corner:"bottomRight",side:"right"}],bottomLeft:[{corner:"bottomRight",side:"bottom"},{corner:"topLeft",side:"left"}],bottomRight:[{corner:"bottomLeft",side:"bottom"},{corner:"topRight",side:"right"}]};function Go({cornerRadius:n,cornerSmoothing:t,preserveSmoothing:e,roundingAndSmoothingBudget:i}){let a=(1+t)*n;if(!e){const b=i/n-1;t=Math.min(t,b),a=Math.min(a,i)}const o=90*(1-t),c=Math.sin(Zc(o/2))*n*Math.sqrt(2),u=(90-o)/2,f=n*Math.tan(Zc(u/2)),d=45*t,m=f*Math.cos(Zc(d)),y=m*Math.tan(Zc(d));let v=(a-c-m-y)/3,x=2*v;if(e&&a>i){const b=i-y-c-m,T=b/6,C=b-T;v=Math.min(v,C),x=b-v,a=Math.min(a,i)}return{a:x,b:v,c:m,d:y,p:a,arcSectionLength:c,cornerRadius:n}}function e5({width:n,height:t,topLeftPathParams:e,topRightPathParams:i,bottomLeftPathParams:a,bottomRightPathParams:o}){return` + M ${n-i.p} 0 + ${Rw(i)} + L ${n} ${t-o.p} + ${Lw(o)} + L ${a.p} ${t} + ${Ow(a)} + L 0 ${e.p} + ${Nw(e)} + Z + `.replace(/[\t\s\n]+/g," ").trim()}function Rw({cornerRadius:n,a:t,b:e,c:i,d:a,p:o,arcSectionLength:c}){return n?Bs` + c ${t} 0 ${t+e} 0 ${t+e+i} ${a} + a ${n} ${n} 0 0 1 ${c} ${c} + c ${a} ${i} + ${a} ${e+i} + ${a} ${t+e+i}`:Bs`l ${o} 0`}function Lw({cornerRadius:n,a:t,b:e,c:i,d:a,p:o,arcSectionLength:c}){return n?Bs` + c 0 ${t} + 0 ${t+e} + ${-a} ${t+e+i} + a ${n} ${n} 0 0 1 -${c} ${c} + c ${-i} ${a} + ${-(e+i)} ${a} + ${-(t+e+i)} ${a}`:Bs`l 0 ${o}`}function Ow({cornerRadius:n,a:t,b:e,c:i,d:a,p:o,arcSectionLength:c}){return n?Bs` + c ${-t} 0 + ${-(t+e)} 0 + ${-(t+e+i)} ${-a} + a ${n} ${n} 0 0 1 -${c} -${c} + c ${-a} ${-i} + ${-a} ${-(e+i)} + ${-a} ${-(t+e+i)}`:Bs`l ${-o} 0`}function Nw({cornerRadius:n,a:t,b:e,c:i,d:a,p:o,arcSectionLength:c}){return n?Bs` + c 0 ${-t} + 0 ${-(t+e)} + ${a} ${-(t+e+i)} + a ${n} ${n} 0 0 1 ${c} -${c} + c ${i} ${-a} + ${e+i} ${-a} + ${t+e+i} ${-a}`:Bs`l 0 ${-o}`}function Zc(n){return n*Math.PI/180}function Bs(n,...t){return n.reduce((e,i,a)=>{let o=t[a];return typeof o=="number"?e+i+o.toFixed(4):e+i+(o??"")},"")}function td({cornerRadius:n=0,topLeftCornerRadius:t,topRightCornerRadius:e,bottomRightCornerRadius:i,bottomLeftCornerRadius:a,cornerSmoothing:o,width:c,height:u,preserveSmoothing:f=!1}){if(t=t??n,e=e??n,a=a??n,i=i??n,t===e&&e===i&&i===a&&a===t){const x=Math.min(c,u)/2,b=Math.min(t,x),T=Go({cornerRadius:b,cornerSmoothing:o,preserveSmoothing:f,roundingAndSmoothingBudget:x});return e5({width:c,height:u,topLeftPathParams:T,topRightPathParams:T,bottomLeftPathParams:T,bottomRightPathParams:T})}const{topLeft:d,topRight:m,bottomLeft:y,bottomRight:v}=ww({topLeftCornerRadius:t,topRightCornerRadius:e,bottomRightCornerRadius:i,bottomLeftCornerRadius:a,width:c,height:u});return e5({width:c,height:u,topLeftPathParams:Go({cornerSmoothing:o,preserveSmoothing:f,cornerRadius:d.radius,roundingAndSmoothingBudget:d.roundingAndSmoothingBudget}),topRightPathParams:Go({cornerSmoothing:o,preserveSmoothing:f,cornerRadius:m.radius,roundingAndSmoothingBudget:m.roundingAndSmoothingBudget}),bottomRightPathParams:Go({cornerSmoothing:o,preserveSmoothing:f,cornerRadius:v.radius,roundingAndSmoothingBudget:v.roundingAndSmoothingBudget}),bottomLeftPathParams:Go({cornerSmoothing:o,preserveSmoothing:f,cornerRadius:y.radius,roundingAndSmoothingBudget:y.roundingAndSmoothingBudget})})}const Dw=(n=8)=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let e="";for(let i=0;i{let e=document.getElementById(t);e||(e=document.createElement("style"),e.id=t,document.head.appendChild(e)),e.textContent=n},Iw=(n,t,e)=>{const i=n.clientWidth,a=n.clientHeight,o={preserveSmoothing:!0,cornerSmoothing:1,width:i,height:a,...t};t.borderWidth?(n.classList.add(e),Bw(` + .${e} { + position: relative; + clip-path: path('${td(o)}'); + } + + .${e}::before { + content: ''; + display: block; + position: absolute; + inset: ${t.borderWidth}px; + z-index: -1; + clip-path: path('${td({...o,width:i-t.borderWidth*2,height:a-t.borderWidth*2,cornerRadius:t.cornerRadius-t.borderWidth})}'); + } + `,`style-${e}`)):n.style.clipPath=`path('${td(o)}')`},Fw=(n,t)=>{const e=Dw();let i;const a=c=>(c!==void 0&&(t=c),Iw(n,t,e)),o=new ResizeObserver(()=>{const c=i;i=[n.clientWidth,n.clientHeight],(c?.[0]!==i[0]||c?.[1]!==i[1])&&a()});return o.observe(n),a.disconnect=()=>{n.classList.remove(e),document.querySelector(`#style-${e}`)?.remove(),o.disconnect()},a},Pw=n=>{const t={};for(const e in n)n[e]!==void 0&&(t[e]=n[e]);return t},Uw=X.forwardRef(({children:n,as:t="div",cornerRadius:e,topLeftCornerRadius:i,topRightCornerRadius:a,bottomRightCornerRadius:o,bottomLeftCornerRadius:c,cornerSmoothing:u,preserveSmoothing:f,borderWidth:d,...m},y)=>{const v=X.useRef(),x=X.useCallback(b=>{const T=Pw({cornerRadius:e,topLeftCornerRadius:i,topRightCornerRadius:a,bottomRightCornerRadius:o,bottomLeftCornerRadius:c,cornerSmoothing:u,preserveSmoothing:f,borderWidth:d});v.current?.disconnect(),b&&(v.current=Fw(b,T)),typeof y=="function"?y(b):y&&(y.current=b)},[e,i,a,o,c,u,f,d]);return Qu.createElement(t,{ref:x,...m},n)}),se=1e-6,n5=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class Rt extends Float32Array{static BYTE_LENGTH=16*Float32Array.BYTES_PER_ELEMENT;constructor(...t){switch(t.length){case 16:super(t);break;case 2:super(t[0],t[1],16);break;case 1:const e=t[0];typeof e=="number"?super([e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e]):super(e,0,16);break;default:super(n5);break}}get str(){return Rt.str(this)}copy(t){return this.set(t),this}identity(){return this.set(n5),this}multiply(t){return Rt.multiply(this,this,t)}mul(t){return this}transpose(){return Rt.transpose(this,this)}invert(){return Rt.invert(this,this)}translate(t){return Rt.translate(this,this,t)}rotate(t,e){return Rt.rotate(this,this,t,e)}scale(t){return Rt.scale(this,this,t)}rotateX(t){return Rt.rotateX(this,this,t)}rotateY(t){return Rt.rotateY(this,this,t)}rotateZ(t){return Rt.rotateZ(this,this,t)}perspectiveNO(t,e,i,a){return Rt.perspectiveNO(this,t,e,i,a)}perspectiveZO(t,e,i,a){return Rt.perspectiveZO(this,t,e,i,a)}orthoNO(t,e,i,a,o,c){return Rt.orthoNO(this,t,e,i,a,o,c)}orthoZO(t,e,i,a,o,c){return Rt.orthoZO(this,t,e,i,a,o,c)}static create(){return new Rt}static clone(t){return new Rt(t)}static copy(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}static fromValues(...t){return new Rt(...t)}static set(t,...e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}static transpose(t,e){if(t===e){const i=e[1],a=e[2],o=e[3],c=e[6],u=e[7],f=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=a,t[9]=c,t[11]=e[14],t[12]=o,t[13]=u,t[14]=f}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}static invert(t,e){const i=e[0],a=e[1],o=e[2],c=e[3],u=e[4],f=e[5],d=e[6],m=e[7],y=e[8],v=e[9],x=e[10],b=e[11],T=e[12],C=e[13],_=e[14],R=e[15],L=i*f-a*u,P=i*d-o*u,w=i*m-c*u,F=a*d-o*f,E=a*m-c*f,N=o*m-c*d,D=y*C-v*T,k=y*_-x*T,U=y*R-b*T,G=v*_-x*C,J=v*R-b*C,tt=x*R-b*_;let K=L*tt-P*J+w*G+F*U-E*k+N*D;return K?(K=1/K,t[0]=(f*tt-d*J+m*G)*K,t[1]=(o*J-a*tt-c*G)*K,t[2]=(C*N-_*E+R*F)*K,t[3]=(x*E-v*N-b*F)*K,t[4]=(d*U-u*tt-m*k)*K,t[5]=(i*tt-o*U+c*k)*K,t[6]=(_*w-T*N-R*P)*K,t[7]=(y*N-x*w+b*P)*K,t[8]=(u*J-f*U+m*D)*K,t[9]=(a*U-i*J-c*D)*K,t[10]=(T*E-C*w+R*L)*K,t[11]=(v*w-y*E-b*L)*K,t[12]=(f*k-u*G-d*D)*K,t[13]=(i*G-a*k+o*D)*K,t[14]=(C*P-T*F-_*L)*K,t[15]=(y*F-v*P+x*L)*K,t):null}static adjoint(t,e){const i=e[0],a=e[1],o=e[2],c=e[3],u=e[4],f=e[5],d=e[6],m=e[7],y=e[8],v=e[9],x=e[10],b=e[11],T=e[12],C=e[13],_=e[14],R=e[15],L=i*f-a*u,P=i*d-o*u,w=i*m-c*u,F=a*d-o*f,E=a*m-c*f,N=o*m-c*d,D=y*C-v*T,k=y*_-x*T,U=y*R-b*T,G=v*_-x*C,J=v*R-b*C,tt=x*R-b*_;return t[0]=f*tt-d*J+m*G,t[1]=o*J-a*tt-c*G,t[2]=C*N-_*E+R*F,t[3]=x*E-v*N-b*F,t[4]=d*U-u*tt-m*k,t[5]=i*tt-o*U+c*k,t[6]=_*w-T*N-R*P,t[7]=y*N-x*w+b*P,t[8]=u*J-f*U+m*D,t[9]=a*U-i*J-c*D,t[10]=T*E-C*w+R*L,t[11]=v*w-y*E-b*L,t[12]=f*k-u*G-d*D,t[13]=i*G-a*k+o*D,t[14]=C*P-T*F-_*L,t[15]=y*F-v*P+x*L,t}static determinant(t){const e=t[0],i=t[1],a=t[2],o=t[3],c=t[4],u=t[5],f=t[6],d=t[7],m=t[8],y=t[9],v=t[10],x=t[11],b=t[12],T=t[13],C=t[14],_=t[15],R=e*u-i*c,L=e*f-a*c,P=i*f-a*u,w=m*T-y*b,F=m*C-v*b,E=y*C-v*T,N=e*E-i*F+a*w,D=c*E-u*F+f*w,k=m*P-y*L+v*R,U=b*P-T*L+C*R;return d*N-o*D+_*k-x*U}static multiply(t,e,i){const a=e[0],o=e[1],c=e[2],u=e[3],f=e[4],d=e[5],m=e[6],y=e[7],v=e[8],x=e[9],b=e[10],T=e[11],C=e[12],_=e[13],R=e[14],L=e[15];let P=i[0],w=i[1],F=i[2],E=i[3];return t[0]=P*a+w*f+F*v+E*C,t[1]=P*o+w*d+F*x+E*_,t[2]=P*c+w*m+F*b+E*R,t[3]=P*u+w*y+F*T+E*L,P=i[4],w=i[5],F=i[6],E=i[7],t[4]=P*a+w*f+F*v+E*C,t[5]=P*o+w*d+F*x+E*_,t[6]=P*c+w*m+F*b+E*R,t[7]=P*u+w*y+F*T+E*L,P=i[8],w=i[9],F=i[10],E=i[11],t[8]=P*a+w*f+F*v+E*C,t[9]=P*o+w*d+F*x+E*_,t[10]=P*c+w*m+F*b+E*R,t[11]=P*u+w*y+F*T+E*L,P=i[12],w=i[13],F=i[14],E=i[15],t[12]=P*a+w*f+F*v+E*C,t[13]=P*o+w*d+F*x+E*_,t[14]=P*c+w*m+F*b+E*R,t[15]=P*u+w*y+F*T+E*L,t}static mul(t,e,i){return t}static translate(t,e,i){const a=i[0],o=i[1],c=i[2];if(e===t)t[12]=e[0]*a+e[4]*o+e[8]*c+e[12],t[13]=e[1]*a+e[5]*o+e[9]*c+e[13],t[14]=e[2]*a+e[6]*o+e[10]*c+e[14],t[15]=e[3]*a+e[7]*o+e[11]*c+e[15];else{const u=e[0],f=e[1],d=e[2],m=e[3],y=e[4],v=e[5],x=e[6],b=e[7],T=e[8],C=e[9],_=e[10],R=e[11];t[0]=u,t[1]=f,t[2]=d,t[3]=m,t[4]=y,t[5]=v,t[6]=x,t[7]=b,t[8]=T,t[9]=C,t[10]=_,t[11]=R,t[12]=u*a+y*o+T*c+e[12],t[13]=f*a+v*o+C*c+e[13],t[14]=d*a+x*o+_*c+e[14],t[15]=m*a+b*o+R*c+e[15]}return t}static scale(t,e,i){const a=i[0],o=i[1],c=i[2];return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}static rotate(t,e,i,a){let o=a[0],c=a[1],u=a[2],f=Math.sqrt(o*o+c*c+u*u);if(f0?(ti[0]=(u*c+m*i+f*o-d*a)*2/y,ti[1]=(f*c+m*a+d*i-u*o)*2/y,ti[2]=(d*c+m*o+u*a-f*i)*2/y):(ti[0]=(u*c+m*i+f*o-d*a)*2,ti[1]=(f*c+m*a+d*i-u*o)*2,ti[2]=(d*c+m*o+u*a-f*i)*2),Rt.fromRotationTranslation(t,e,ti),t}static normalFromMat4(t,e){const i=e[0],a=e[1],o=e[2],c=e[3],u=e[4],f=e[5],d=e[6],m=e[7],y=e[8],v=e[9],x=e[10],b=e[11],T=e[12],C=e[13],_=e[14],R=e[15],L=i*f-a*u,P=i*d-o*u,w=i*m-c*u,F=a*d-o*f,E=a*m-c*f,N=o*m-c*d,D=y*C-v*T,k=y*_-x*T,U=y*R-b*T,G=v*_-x*C,J=v*R-b*C,tt=x*R-b*_;let K=L*tt-P*J+w*G+F*U-E*k+N*D;return K?(K=1/K,t[0]=(f*tt-d*J+m*G)*K,t[1]=(d*U-u*tt-m*k)*K,t[2]=(u*J-f*U+m*D)*K,t[3]=0,t[4]=(o*J-a*tt-c*G)*K,t[5]=(i*tt-o*U+c*k)*K,t[6]=(a*U-i*J-c*D)*K,t[7]=0,t[8]=(C*N-_*E+R*F)*K,t[9]=(_*w-T*N-R*P)*K,t[10]=(T*E-C*w+R*L)*K,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):null}static normalFromMat4Fast(t,e){const i=e[0],a=e[1],o=e[2],c=e[4],u=e[5],f=e[6],d=e[8],m=e[9],y=e[10];return t[0]=u*y-y*m,t[1]=f*d-d*y,t[2]=c*m-m*d,t[3]=0,t[4]=m*o-y*a,t[5]=y*i-d*o,t[6]=d*a-m*i,t[7]=0,t[8]=a*f-o*u,t[9]=o*c-i*f,t[10]=i*u-a*c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}static getTranslation(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}static getScaling(t,e){const i=e[0],a=e[1],o=e[2],c=e[4],u=e[5],f=e[6],d=e[8],m=e[9],y=e[10];return t[0]=Math.sqrt(i*i+a*a+o*o),t[1]=Math.sqrt(c*c+u*u+f*f),t[2]=Math.sqrt(d*d+m*m+y*y),t}static getRotation(t,e){Rt.getScaling(ti,e);const i=1/ti[0],a=1/ti[1],o=1/ti[2],c=e[0]*i,u=e[1]*a,f=e[2]*o,d=e[4]*i,m=e[5]*a,y=e[6]*o,v=e[8]*i,x=e[9]*a,b=e[10]*o,T=c+m+b;let C=0;return T>0?(C=Math.sqrt(T+1)*2,t[3]=.25*C,t[0]=(y-x)/C,t[1]=(v-f)/C,t[2]=(u-d)/C):c>m&&c>b?(C=Math.sqrt(1+c-m-b)*2,t[3]=(y-x)/C,t[0]=.25*C,t[1]=(u+d)/C,t[2]=(v+f)/C):m>b?(C=Math.sqrt(1+m-c-b)*2,t[3]=(v-f)/C,t[0]=(u+d)/C,t[1]=.25*C,t[2]=(y+x)/C):(C=Math.sqrt(1+b-c-m)*2,t[3]=(u-d)/C,t[0]=(v+f)/C,t[1]=(y+x)/C,t[2]=.25*C),t}static decompose(t,e,i,a){e[0]=a[12],e[1]=a[13],e[2]=a[14];const o=a[0],c=a[1],u=a[2],f=a[4],d=a[5],m=a[6],y=a[8],v=a[9],x=a[10];i[0]=Math.sqrt(o*o+c*c+u*u),i[1]=Math.sqrt(f*f+d*d+m*m),i[2]=Math.sqrt(y*y+v*v+x*x);const b=1/i[0],T=1/i[1],C=1/i[2],_=o*b,R=c*T,L=u*C,P=f*b,w=d*T,F=m*C,E=y*b,N=v*T,D=x*C,k=_+w+D;let U=0;return k>0?(U=Math.sqrt(k+1)*2,t[3]=.25*U,t[0]=(F-N)/U,t[1]=(E-L)/U,t[2]=(R-P)/U):_>w&&_>D?(U=Math.sqrt(1+_-w-D)*2,t[3]=(F-N)/U,t[0]=.25*U,t[1]=(R+P)/U,t[2]=(E+L)/U):w>D?(U=Math.sqrt(1+w-_-D)*2,t[3]=(E-L)/U,t[0]=(R+P)/U,t[1]=.25*U,t[2]=(F+N)/U):(U=Math.sqrt(1+D-_-w)*2,t[3]=(R-P)/U,t[0]=(E+L)/U,t[1]=(F+N)/U,t[2]=.25*U),t}static fromRotationTranslationScale(t,e,i,a){const o=e[0],c=e[1],u=e[2],f=e[3],d=o+o,m=c+c,y=u+u,v=o*d,x=o*m,b=o*y,T=c*m,C=c*y,_=u*y,R=f*d,L=f*m,P=f*y,w=a[0],F=a[1],E=a[2];return t[0]=(1-(T+_))*w,t[1]=(x+P)*w,t[2]=(b-L)*w,t[3]=0,t[4]=(x-P)*F,t[5]=(1-(v+_))*F,t[6]=(C+R)*F,t[7]=0,t[8]=(b+L)*E,t[9]=(C-R)*E,t[10]=(1-(v+T))*E,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t}static fromRotationTranslationScaleOrigin(t,e,i,a,o){const c=e[0],u=e[1],f=e[2],d=e[3],m=c+c,y=u+u,v=f+f,x=c*m,b=c*y,T=c*v,C=u*y,_=u*v,R=f*v,L=d*m,P=d*y,w=d*v,F=a[0],E=a[1],N=a[2],D=o[0],k=o[1],U=o[2],G=(1-(C+R))*F,J=(b+w)*F,tt=(T-P)*F,K=(b-w)*E,A=(1-(x+R))*E,I=(_+L)*E,O=(T+P)*N,j=(_-L)*N,V=(1-(x+C))*N;return t[0]=G,t[1]=J,t[2]=tt,t[3]=0,t[4]=K,t[5]=A,t[6]=I,t[7]=0,t[8]=O,t[9]=j,t[10]=V,t[11]=0,t[12]=i[0]+D-(G*D+K*k+O*U),t[13]=i[1]+k-(J*D+A*k+j*U),t[14]=i[2]+U-(tt*D+I*k+V*U),t[15]=1,t}static fromQuat(t,e){const i=e[0],a=e[1],o=e[2],c=e[3],u=i+i,f=a+a,d=o+o,m=i*u,y=a*u,v=a*f,x=o*u,b=o*f,T=o*d,C=c*u,_=c*f,R=c*d;return t[0]=1-v-T,t[1]=y+R,t[2]=x-_,t[3]=0,t[4]=y-R,t[5]=1-m-T,t[6]=b+C,t[7]=0,t[8]=x+_,t[9]=b-C,t[10]=1-m-v,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}static frustumNO(t,e,i,a,o,c,u=1/0){const f=1/(i-e),d=1/(o-a);if(t[0]=c*2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c*2*d,t[6]=0,t[7]=0,t[8]=(i+e)*f,t[9]=(o+a)*d,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,u!=null&&u!==1/0){const m=1/(c-u);t[10]=(u+c)*m,t[14]=2*u*c*m}else t[10]=-1,t[14]=-2*c;return t}static frustum(t,e,i,a,o,c,u=1/0){return t}static frustumZO(t,e,i,a,o,c,u=1/0){const f=1/(i-e),d=1/(o-a);if(t[0]=c*2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c*2*d,t[6]=0,t[7]=0,t[8]=(i+e)*f,t[9]=(o+a)*d,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,u!=null&&u!==1/0){const m=1/(c-u);t[10]=u*m,t[14]=u*c*m}else t[10]=-1,t[14]=-c;return t}static perspectiveNO(t,e,i,a,o=1/0){const c=1/Math.tan(e/2);if(t[0]=c/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){const u=1/(a-o);t[10]=(o+a)*u,t[14]=2*o*a*u}else t[10]=-1,t[14]=-2*a;return t}static perspective(t,e,i,a,o=1/0){return t}static perspectiveZO(t,e,i,a,o=1/0){const c=1/Math.tan(e/2);if(t[0]=c/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){const u=1/(a-o);t[10]=o*u,t[14]=o*a*u}else t[10]=-1,t[14]=-a;return t}static perspectiveFromFieldOfView(t,e,i,a){const o=Math.tan(e.upDegrees*Math.PI/180),c=Math.tan(e.downDegrees*Math.PI/180),u=Math.tan(e.leftDegrees*Math.PI/180),f=Math.tan(e.rightDegrees*Math.PI/180),d=2/(u+f),m=2/(o+c);return t[0]=d,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=m,t[6]=0,t[7]=0,t[8]=-((u-f)*d*.5),t[9]=(o-c)*m*.5,t[10]=a/(i-a),t[11]=-1,t[12]=0,t[13]=0,t[14]=a*i/(i-a),t[15]=0,t}static orthoNO(t,e,i,a,o,c,u){const f=1/(e-i),d=1/(a-o),m=1/(c-u);return t[0]=-2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*m,t[11]=0,t[12]=(e+i)*f,t[13]=(o+a)*d,t[14]=(u+c)*m,t[15]=1,t}static ortho(t,e,i,a,o,c,u){return t}static orthoZO(t,e,i,a,o,c,u){const f=1/(e-i),d=1/(a-o),m=1/(c-u);return t[0]=-2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=m,t[11]=0,t[12]=(e+i)*f,t[13]=(o+a)*d,t[14]=c*m,t[15]=1,t}static lookAt(t,e,i,a){const o=e[0],c=e[1],u=e[2],f=a[0],d=a[1],m=a[2],y=i[0],v=i[1],x=i[2];if(Math.abs(o-y)0&&(b=1/Math.sqrt(b),y*=b,v*=b,x*=b);let T=d*x-m*v,C=m*y-f*x,_=f*v-d*y;return b=T*T+C*C+_*_,b>0&&(b=1/Math.sqrt(b),T*=b,C*=b,_*=b),t[0]=T,t[1]=C,t[2]=_,t[3]=0,t[4]=v*_-x*C,t[5]=x*T-y*_,t[6]=y*C-v*T,t[7]=0,t[8]=y,t[9]=v,t[10]=x,t[11]=0,t[12]=o,t[13]=c,t[14]=u,t[15]=1,t}static frob(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}static add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t[9]=e[9]+i[9],t[10]=e[10]+i[10],t[11]=e[11]+i[11],t[12]=e[12]+i[12],t[13]=e[13]+i[13],t[14]=e[14]+i[14],t[15]=e[15]+i[15],t}static subtract(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t[9]=e[9]-i[9],t[10]=e[10]-i[10],t[11]=e[11]-i[11],t[12]=e[12]-i[12],t[13]=e[13]-i[13],t[14]=e[14]-i[14],t[15]=e[15]-i[15],t}static sub(t,e,i){return t}static multiplyScalar(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t}static multiplyScalarAndAdd(t,e,i,a){return t[0]=e[0]+i[0]*a,t[1]=e[1]+i[1]*a,t[2]=e[2]+i[2]*a,t[3]=e[3]+i[3]*a,t[4]=e[4]+i[4]*a,t[5]=e[5]+i[5]*a,t[6]=e[6]+i[6]*a,t[7]=e[7]+i[7]*a,t[8]=e[8]+i[8]*a,t[9]=e[9]+i[9]*a,t[10]=e[10]+i[10]*a,t[11]=e[11]+i[11]*a,t[12]=e[12]+i[12]*a,t[13]=e[13]+i[13]*a,t[14]=e[14]+i[14]*a,t[15]=e[15]+i[15]*a,t}static exactEquals(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}static equals(t,e){const i=t[0],a=t[1],o=t[2],c=t[3],u=t[4],f=t[5],d=t[6],m=t[7],y=t[8],v=t[9],x=t[10],b=t[11],T=t[12],C=t[13],_=t[14],R=t[15],L=e[0],P=e[1],w=e[2],F=e[3],E=e[4],N=e[5],D=e[6],k=e[7],U=e[8],G=e[9],J=e[10],tt=e[11],K=e[12],A=e[13],I=e[14],O=e[15];return Math.abs(i-L)<=se*Math.max(1,Math.abs(i),Math.abs(L))&&Math.abs(a-P)<=se*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(o-w)<=se*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(c-F)<=se*Math.max(1,Math.abs(c),Math.abs(F))&&Math.abs(u-E)<=se*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(f-N)<=se*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(d-D)<=se*Math.max(1,Math.abs(d),Math.abs(D))&&Math.abs(m-k)<=se*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(y-U)<=se*Math.max(1,Math.abs(y),Math.abs(U))&&Math.abs(v-G)<=se*Math.max(1,Math.abs(v),Math.abs(G))&&Math.abs(x-J)<=se*Math.max(1,Math.abs(x),Math.abs(J))&&Math.abs(b-tt)<=se*Math.max(1,Math.abs(b),Math.abs(tt))&&Math.abs(T-K)<=se*Math.max(1,Math.abs(T),Math.abs(K))&&Math.abs(C-A)<=se*Math.max(1,Math.abs(C),Math.abs(A))&&Math.abs(_-I)<=se*Math.max(1,Math.abs(_),Math.abs(I))&&Math.abs(R-O)<=se*Math.max(1,Math.abs(R),Math.abs(O))}static str(t){return`Mat4(${t.join(", ")})`}}const ti=new Float32Array(3);Rt.prototype.mul=Rt.prototype.multiply;Rt.sub=Rt.subtract;Rt.mul=Rt.multiply;Rt.frustum=Rt.frustumNO;Rt.perspective=Rt.perspectiveNO;Rt.ortho=Rt.orthoNO;class kt extends Float32Array{static BYTE_LENGTH=3*Float32Array.BYTES_PER_ELEMENT;constructor(...t){switch(t.length){case 3:super(t);break;case 2:super(t[0],t[1],3);break;case 1:{const e=t[0];typeof e=="number"?super([e,e,e]):super(e,0,3);break}default:super(3);break}}get x(){return this[0]}set x(t){this[0]=t}get y(){return this[1]}set y(t){this[1]=t}get z(){return this[2]}set z(t){this[2]=t}get r(){return this[0]}set r(t){this[0]=t}get g(){return this[1]}set g(t){this[1]=t}get b(){return this[2]}set b(t){this[2]=t}get magnitude(){const t=this[0],e=this[1],i=this[2];return Math.sqrt(t*t+e*e+i*i)}get mag(){return this.magnitude}get squaredMagnitude(){const t=this[0],e=this[1],i=this[2];return t*t+e*e+i*i}get sqrMag(){return this.squaredMagnitude}get str(){return kt.str(this)}copy(t){return this.set(t),this}add(t){return this[0]+=t[0],this[1]+=t[1],this[2]+=t[2],this}subtract(t){return this[0]-=t[0],this[1]-=t[1],this[2]-=t[2],this}sub(t){return this}multiply(t){return this[0]*=t[0],this[1]*=t[1],this[2]*=t[2],this}mul(t){return this}divide(t){return this[0]/=t[0],this[1]/=t[1],this[2]/=t[2],this}div(t){return this}scale(t){return this[0]*=t,this[1]*=t,this[2]*=t,this}scaleAndAdd(t,e){return this[0]+=t[0]*e,this[1]+=t[1]*e,this[2]+=t[2]*e,this}distance(t){return kt.distance(this,t)}dist(t){return 0}squaredDistance(t){return kt.squaredDistance(this,t)}sqrDist(t){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(t){return this[0]*t[0]+this[1]*t[1]+this[2]*t[2]}normalize(){return kt.normalize(this,this)}static create(){return new kt}static clone(t){return new kt(t)}static magnitude(t){let e=t[0],i=t[1],a=t[2];return Math.sqrt(e*e+i*i+a*a)}static mag(t){return 0}static length(t){return 0}static len(t){return 0}static fromValues(t,e,i){return new kt(t,e,i)}static copy(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}static set(t,e,i,a){return t[0]=e,t[1]=i,t[2]=a,t}static add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}static subtract(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}static sub(t,e,i){return[0,0,0]}static multiply(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}static mul(t,e,i){return[0,0,0]}static divide(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t}static div(t,e,i){return[0,0,0]}static ceil(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}static floor(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}static min(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}static max(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}static scale(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}static scaleAndAdd(t,e,i,a){return t[0]=e[0]+i[0]*a,t[1]=e[1]+i[1]*a,t[2]=e[2]+i[2]*a,t}static distance(t,e){const i=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(i*i+a*a+o*o)}static dist(t,e){return 0}static squaredDistance(t,e){const i=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2];return i*i+a*a+o*o}static sqrDist(t,e){return 0}static squaredLength(t){const e=t[0],i=t[1],a=t[2];return e*e+i*i+a*a}static sqrLen(t,e){return 0}static negate(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}static inverse(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}static abs(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t}static normalize(t,e){const i=e[0],a=e[1],o=e[2];let c=i*i+a*a+o*o;return c>0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}static dot(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}static cross(t,e,i){const a=e[0],o=e[1],c=e[2],u=i[0],f=i[1],d=i[2];return t[0]=o*d-c*f,t[1]=c*u-a*d,t[2]=a*f-o*u,t}static lerp(t,e,i,a){const o=e[0],c=e[1],u=e[2];return t[0]=o+a*(i[0]-o),t[1]=c+a*(i[1]-c),t[2]=u+a*(i[2]-u),t}static slerp(t,e,i,a){const o=Math.acos(Math.min(Math.max(kt.dot(e,i),-1),1)),c=Math.sin(o),u=Math.sin((1-a)*o)/c,f=Math.sin(a*o)/c;return t[0]=u*e[0]+f*i[0],t[1]=u*e[1]+f*i[1],t[2]=u*e[2]+f*i[2],t}static hermite(t,e,i,a,o,c){const u=c*c,f=u*(2*c-3)+1,d=u*(c-2)+c,m=u*(c-1),y=u*(3-2*c);return t[0]=e[0]*f+i[0]*d+a[0]*m+o[0]*y,t[1]=e[1]*f+i[1]*d+a[1]*m+o[1]*y,t[2]=e[2]*f+i[2]*d+a[2]*m+o[2]*y,t}static bezier(t,e,i,a,o,c){const u=1-c,f=u*u,d=c*c,m=f*u,y=3*c*f,v=3*d*u,x=d*c;return t[0]=e[0]*m+i[0]*y+a[0]*v+o[0]*x,t[1]=e[1]*m+i[1]*y+a[1]*v+o[1]*x,t[2]=e[2]*m+i[2]*y+a[2]*v+o[2]*x,t}static transformMat4(t,e,i){const a=e[0],o=e[1],c=e[2],u=i[3]*a+i[7]*o+i[11]*c+i[15]||1;return t[0]=(i[0]*a+i[4]*o+i[8]*c+i[12])/u,t[1]=(i[1]*a+i[5]*o+i[9]*c+i[13])/u,t[2]=(i[2]*a+i[6]*o+i[10]*c+i[14])/u,t}static transformMat3(t,e,i){let a=e[0],o=e[1],c=e[2];return t[0]=a*i[0]+o*i[3]+c*i[6],t[1]=a*i[1]+o*i[4]+c*i[7],t[2]=a*i[2]+o*i[5]+c*i[8],t}static transformQuat(t,e,i){const a=i[0],o=i[1],c=i[2],u=i[3]*2,f=e[0],d=e[1],m=e[2],y=o*m-c*d,v=c*f-a*m,x=a*d-o*f,b=(o*x-c*v)*2,T=(c*y-a*x)*2,C=(a*v-o*y)*2;return t[0]=f+y*u+b,t[1]=d+v*u+T,t[2]=m+x*u+C,t}static rotateX(t,e,i,a){const o=i[1],c=i[2],u=e[1]-o,f=e[2]-c;return t[0]=e[0],t[1]=u*Math.cos(a)-f*Math.sin(a)+o,t[2]=u*Math.sin(a)+f*Math.cos(a)+c,t}static rotateY(t,e,i,a){const o=i[0],c=i[2],u=e[0]-o,f=e[2]-c;return t[0]=f*Math.sin(a)+u*Math.cos(a)+o,t[1]=e[1],t[2]=f*Math.cos(a)-u*Math.sin(a)+c,t}static rotateZ(t,e,i,a){const o=i[0],c=i[1],u=e[0]-o,f=e[1]-c;return t[0]=u*Math.cos(a)-f*Math.sin(a)+o,t[1]=u*Math.sin(a)+f*Math.cos(a)+c,t[2]=i[2],t}static angle(t,e){const i=t[0],a=t[1],o=t[2],c=e[0],u=e[1],f=e[2],d=Math.sqrt((i*i+a*a+o*o)*(c*c+u*u+f*f)),m=d&&kt.dot(t,e)/d;return Math.acos(Math.min(Math.max(m,-1),1))}static zero(t){return t[0]=0,t[1]=0,t[2]=0,t}static str(t){return`Vec3(${t.join(", ")})`}static exactEquals(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}static equals(t,e){const i=t[0],a=t[1],o=t[2],c=e[0],u=e[1],f=e[2];return Math.abs(i-c)<=se*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-u)<=se*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-f)<=se*Math.max(1,Math.abs(o),Math.abs(f))}}kt.prototype.sub=kt.prototype.subtract;kt.prototype.mul=kt.prototype.multiply;kt.prototype.div=kt.prototype.divide;kt.prototype.dist=kt.prototype.distance;kt.prototype.sqrDist=kt.prototype.squaredDistance;kt.sub=kt.subtract;kt.mul=kt.multiply;kt.div=kt.divide;kt.dist=kt.distance;kt.sqrDist=kt.squaredDistance;kt.sqrLen=kt.squaredLength;kt.mag=kt.magnitude;kt.length=kt.magnitude;kt.len=kt.magnitude;class Nt extends Float32Array{static BYTE_LENGTH=4*Float32Array.BYTES_PER_ELEMENT;constructor(...t){switch(t.length){case 4:super(t);break;case 2:super(t[0],t[1],4);break;case 1:{const e=t[0];typeof e=="number"?super([e,e,e,e]):super(e,0,4);break}default:super(4);break}}get x(){return this[0]}set x(t){this[0]=t}get y(){return this[1]}set y(t){this[1]=t}get z(){return this[2]}set z(t){this[2]=t}get w(){return this[3]}set w(t){this[3]=t}get r(){return this[0]}set r(t){this[0]=t}get g(){return this[1]}set g(t){this[1]=t}get b(){return this[2]}set b(t){this[2]=t}get a(){return this[3]}set a(t){this[3]=t}get magnitude(){const t=this[0],e=this[1],i=this[2],a=this[3];return Math.sqrt(t*t+e*e+i*i+a*a)}get mag(){return this.magnitude}get str(){return Nt.str(this)}copy(t){return super.set(t),this}add(t){return this[0]+=t[0],this[1]+=t[1],this[2]+=t[2],this[3]+=t[3],this}subtract(t){return this[0]-=t[0],this[1]-=t[1],this[2]-=t[2],this[3]-=t[3],this}sub(t){return this}multiply(t){return this[0]*=t[0],this[1]*=t[1],this[2]*=t[2],this[3]*=t[3],this}mul(t){return this}divide(t){return this[0]/=t[0],this[1]/=t[1],this[2]/=t[2],this[3]/=t[3],this}div(t){return this}scale(t){return this[0]*=t,this[1]*=t,this[2]*=t,this[3]*=t,this}scaleAndAdd(t,e){return this[0]+=t[0]*e,this[1]+=t[1]*e,this[2]+=t[2]*e,this[3]+=t[3]*e,this}distance(t){return Nt.distance(this,t)}dist(t){return 0}squaredDistance(t){return Nt.squaredDistance(this,t)}sqrDist(t){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(t){return this[0]*t[0]+this[1]*t[1]+this[2]*t[2]+this[3]*t[3]}normalize(){return Nt.normalize(this,this)}static create(){return new Nt}static clone(t){return new Nt(t)}static fromValues(t,e,i,a){return new Nt(t,e,i,a)}static copy(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}static set(t,e,i,a,o){return t[0]=e,t[1]=i,t[2]=a,t[3]=o,t}static add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}static subtract(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}static sub(t,e,i){return t}static multiply(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}static mul(t,e,i){return t}static divide(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3],t}static div(t,e,i){return t}static ceil(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}static floor(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}static min(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t[3]=Math.min(e[3],i[3]),t}static max(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t[3]=Math.max(e[3],i[3]),t}static round(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}static scale(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}static scaleAndAdd(t,e,i,a){return t[0]=e[0]+i[0]*a,t[1]=e[1]+i[1]*a,t[2]=e[2]+i[2]*a,t[3]=e[3]+i[3]*a,t}static distance(t,e){const i=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],c=e[3]-t[3];return Math.hypot(i,a,o,c)}static dist(t,e){return 0}static squaredDistance(t,e){const i=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],c=e[3]-t[3];return i*i+a*a+o*o+c*c}static sqrDist(t,e){return 0}static magnitude(t){const e=t[0],i=t[1],a=t[2],o=t[3];return Math.sqrt(e*e+i*i+a*a+o*o)}static mag(t){return 0}static length(t){return 0}static len(t){return 0}static squaredLength(t){const e=t[0],i=t[1],a=t[2],o=t[3];return e*e+i*i+a*a+o*o}static sqrLen(t){return 0}static negate(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}static inverse(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}static abs(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t}static normalize(t,e){const i=e[0],a=e[1],o=e[2],c=e[3];let u=i*i+a*a+o*o+c*c;return u>0&&(u=1/Math.sqrt(u)),t[0]=i*u,t[1]=a*u,t[2]=o*u,t[3]=c*u,t}static dot(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}static cross(t,e,i,a){const o=i[0]*a[1]-i[1]*a[0],c=i[0]*a[2]-i[2]*a[0],u=i[0]*a[3]-i[3]*a[0],f=i[1]*a[2]-i[2]*a[1],d=i[1]*a[3]-i[3]*a[1],m=i[2]*a[3]-i[3]*a[2],y=e[0],v=e[1],x=e[2],b=e[3];return t[0]=v*m-x*d+b*f,t[1]=-(y*m)+x*u-b*c,t[2]=y*d-v*u+b*o,t[3]=-(y*f)+v*c-x*o,t}static lerp(t,e,i,a){const o=e[0],c=e[1],u=e[2],f=e[3];return t[0]=o+a*(i[0]-o),t[1]=c+a*(i[1]-c),t[2]=u+a*(i[2]-u),t[3]=f+a*(i[3]-f),t}static transformMat4(t,e,i){const a=e[0],o=e[1],c=e[2],u=e[3];return t[0]=i[0]*a+i[4]*o+i[8]*c+i[12]*u,t[1]=i[1]*a+i[5]*o+i[9]*c+i[13]*u,t[2]=i[2]*a+i[6]*o+i[10]*c+i[14]*u,t[3]=i[3]*a+i[7]*o+i[11]*c+i[15]*u,t}static transformQuat(t,e,i){const a=e[0],o=e[1],c=e[2],u=i[0],f=i[1],d=i[2],m=i[3],y=m*a+f*c-d*o,v=m*o+d*a-u*c,x=m*c+u*o-f*a,b=-u*a-f*o-d*c;return t[0]=y*m+b*-u+v*-d-x*-f,t[1]=v*m+b*-f+x*-u-y*-d,t[2]=x*m+b*-d+y*-f-v*-u,t[3]=e[3],t}static zero(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}static str(t){return`Vec4(${t.join(", ")})`}static exactEquals(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}static equals(t,e){const i=t[0],a=t[1],o=t[2],c=t[3],u=e[0],f=e[1],d=e[2],m=e[3];return Math.abs(i-u)<=se*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=se*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(o-d)<=se*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(c-m)<=se*Math.max(1,Math.abs(c),Math.abs(m))}}Nt.prototype.sub=Nt.prototype.subtract;Nt.prototype.mul=Nt.prototype.multiply;Nt.prototype.div=Nt.prototype.divide;Nt.prototype.dist=Nt.prototype.distance;Nt.prototype.sqrDist=Nt.prototype.squaredDistance;Nt.sub=Nt.subtract;Nt.mul=Nt.multiply;Nt.div=Nt.divide;Nt.dist=Nt.distance;Nt.sqrDist=Nt.squaredDistance;Nt.sqrLen=Nt.squaredLength;Nt.mag=Nt.magnitude;Nt.length=Nt.magnitude;Nt.len=Nt.magnitude;class Pt extends Float32Array{static BYTE_LENGTH=2*Float32Array.BYTES_PER_ELEMENT;constructor(...t){switch(t.length){case 2:{const e=t[0];typeof e=="number"?super([e,t[1]]):super(e,t[1],2);break}case 1:{const e=t[0];typeof e=="number"?super([e,e]):super(e,0,2);break}default:super(2);break}}get x(){return this[0]}set x(t){this[0]=t}get y(){return this[1]}set y(t){this[1]=t}get r(){return this[0]}set r(t){this[0]=t}get g(){return this[1]}set g(t){this[1]=t}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){const t=this[0],e=this[1];return t*t+e*e}get sqrMag(){return this.squaredMagnitude}get str(){return Pt.str(this)}copy(t){return this.set(t),this}add(t){return this[0]+=t[0],this[1]+=t[1],this}subtract(t){return this[0]-=t[0],this[1]-=t[1],this}sub(t){return this}multiply(t){return this[0]*=t[0],this[1]*=t[1],this}mul(t){return this}divide(t){return this[0]/=t[0],this[1]/=t[1],this}div(t){return this}scale(t){return this[0]*=t,this[1]*=t,this}scaleAndAdd(t,e){return this[0]+=t[0]*e,this[1]+=t[1]*e,this}distance(t){return Pt.distance(this,t)}dist(t){return 0}squaredDistance(t){return Pt.squaredDistance(this,t)}sqrDist(t){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(t){return this[0]*t[0]+this[1]*t[1]}normalize(){return Pt.normalize(this,this)}static create(){return new Pt}static clone(t){return new Pt(t)}static fromValues(t,e){return new Pt(t,e)}static copy(t,e){return t[0]=e[0],t[1]=e[1],t}static set(t,e,i){return t[0]=e,t[1]=i,t}static add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}static subtract(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}static sub(t,e,i){return[0,0]}static multiply(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}static mul(t,e,i){return[0,0]}static divide(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}static div(t,e,i){return[0,0]}static ceil(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}static floor(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}static min(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}static max(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}static round(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}static scale(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}static scaleAndAdd(t,e,i,a){return t[0]=e[0]+i[0]*a,t[1]=e[1]+i[1]*a,t}static distance(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1])}static dist(t,e){return 0}static squaredDistance(t,e){const i=e[0]-t[0],a=e[1]-t[1];return i*i+a*a}static sqrDist(t,e){return 0}static magnitude(t){let e=t[0],i=t[1];return Math.sqrt(e*e+i*i)}static mag(t){return 0}static length(t){return 0}static len(t){return 0}static squaredLength(t){const e=t[0],i=t[1];return e*e+i*i}static sqrLen(t,e){return 0}static negate(t,e){return t[0]=-e[0],t[1]=-e[1],t}static inverse(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}static abs(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t}static normalize(t,e){const i=e[0],a=e[1];let o=i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t}static dot(t,e){return t[0]*e[0]+t[1]*e[1]}static cross(t,e,i){const a=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=a,t}static lerp(t,e,i,a){const o=e[0],c=e[1];return t[0]=o+a*(i[0]-o),t[1]=c+a*(i[1]-c),t}static transformMat2(t,e,i){const a=e[0],o=e[1];return t[0]=i[0]*a+i[2]*o,t[1]=i[1]*a+i[3]*o,t}static transformMat2d(t,e,i){const a=e[0],o=e[1];return t[0]=i[0]*a+i[2]*o+i[4],t[1]=i[1]*a+i[3]*o+i[5],t}static transformMat3(t,e,i){const a=e[0],o=e[1];return t[0]=i[0]*a+i[3]*o+i[6],t[1]=i[1]*a+i[4]*o+i[7],t}static transformMat4(t,e,i){const a=e[0],o=e[1];return t[0]=i[0]*a+i[4]*o+i[12],t[1]=i[1]*a+i[5]*o+i[13],t}static rotate(t,e,i,a){const o=e[0]-i[0],c=e[1]-i[1],u=Math.sin(a),f=Math.cos(a);return t[0]=o*f-c*u+i[0],t[1]=o*u+c*f+i[1],t}static angle(t,e){const i=t[0],a=t[1],o=e[0],c=e[1],u=Math.sqrt(i*i+a*a)*Math.sqrt(o*o+c*c),f=u&&(i*o+a*c)/u;return Math.acos(Math.min(Math.max(f,-1),1))}static zero(t){return t[0]=0,t[1]=0,t}static exactEquals(t,e){return t[0]===e[0]&&t[1]===e[1]}static equals(t,e){const i=t[0],a=t[1],o=e[0],c=e[1];return Math.abs(i-o)<=se*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-c)<=se*Math.max(1,Math.abs(a),Math.abs(c))}static str(t){return`Vec2(${t.join(", ")})`}}Pt.prototype.sub=Pt.prototype.subtract;Pt.prototype.mul=Pt.prototype.multiply;Pt.prototype.div=Pt.prototype.divide;Pt.prototype.dist=Pt.prototype.distance;Pt.prototype.sqrDist=Pt.prototype.squaredDistance;Pt.sub=Pt.subtract;Pt.mul=Pt.multiply;Pt.div=Pt.divide;Pt.dist=Pt.distance;Pt.sqrDist=Pt.squaredDistance;Pt.sqrLen=Pt.squaredLength;Pt.mag=Pt.magnitude;Pt.length=Pt.magnitude;Pt.len=Pt.magnitude;var Ar=(n=>(n[n.WEBGL_LEGACY=0]="WEBGL_LEGACY",n[n.WEBGL=1]="WEBGL",n[n.WEBGL2=2]="WEBGL2",n))(Ar||{}),i9=(n=>(n[n.UNKNOWN=0]="UNKNOWN",n[n.WEBGL=1]="WEBGL",n[n.CANVAS=2]="CANVAS",n))(i9||{}),$0=(n=>(n[n.COLOR=16384]="COLOR",n[n.DEPTH=256]="DEPTH",n[n.STENCIL=1024]="STENCIL",n))($0||{}),Ot=(n=>(n[n.NORMAL=0]="NORMAL",n[n.ADD=1]="ADD",n[n.MULTIPLY=2]="MULTIPLY",n[n.SCREEN=3]="SCREEN",n[n.OVERLAY=4]="OVERLAY",n[n.DARKEN=5]="DARKEN",n[n.LIGHTEN=6]="LIGHTEN",n[n.COLOR_DODGE=7]="COLOR_DODGE",n[n.COLOR_BURN=8]="COLOR_BURN",n[n.HARD_LIGHT=9]="HARD_LIGHT",n[n.SOFT_LIGHT=10]="SOFT_LIGHT",n[n.DIFFERENCE=11]="DIFFERENCE",n[n.EXCLUSION=12]="EXCLUSION",n[n.HUE=13]="HUE",n[n.SATURATION=14]="SATURATION",n[n.COLOR=15]="COLOR",n[n.LUMINOSITY=16]="LUMINOSITY",n[n.NORMAL_NPM=17]="NORMAL_NPM",n[n.ADD_NPM=18]="ADD_NPM",n[n.SCREEN_NPM=19]="SCREEN_NPM",n[n.NONE=20]="NONE",n[n.SRC_OVER=0]="SRC_OVER",n[n.SRC_IN=21]="SRC_IN",n[n.SRC_OUT=22]="SRC_OUT",n[n.SRC_ATOP=23]="SRC_ATOP",n[n.DST_OVER=24]="DST_OVER",n[n.DST_IN=25]="DST_IN",n[n.DST_OUT=26]="DST_OUT",n[n.DST_ATOP=27]="DST_ATOP",n[n.ERASE=26]="ERASE",n[n.SUBTRACT=28]="SUBTRACT",n[n.XOR=29]="XOR",n))(Ot||{}),Gu=(n=>(n[n.POINTS=0]="POINTS",n[n.LINES=1]="LINES",n[n.LINE_LOOP=2]="LINE_LOOP",n[n.LINE_STRIP=3]="LINE_STRIP",n[n.TRIANGLES=4]="TRIANGLES",n[n.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",n[n.TRIANGLE_FAN=6]="TRIANGLE_FAN",n))(Gu||{}),yt=(n=>(n[n.RGBA=6408]="RGBA",n[n.RGB=6407]="RGB",n[n.RG=33319]="RG",n[n.RED=6403]="RED",n[n.RGBA_INTEGER=36249]="RGBA_INTEGER",n[n.RGB_INTEGER=36248]="RGB_INTEGER",n[n.RG_INTEGER=33320]="RG_INTEGER",n[n.RED_INTEGER=36244]="RED_INTEGER",n[n.ALPHA=6406]="ALPHA",n[n.LUMINANCE=6409]="LUMINANCE",n[n.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",n[n.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",n[n.DEPTH_STENCIL=34041]="DEPTH_STENCIL",n))(yt||{}),Ra=(n=>(n[n.TEXTURE_2D=3553]="TEXTURE_2D",n[n.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",n[n.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",n[n.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",n[n.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",n[n.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",n[n.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",n))(Ra||{}),Ht=(n=>(n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",n[n.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",n[n.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",n[n.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",n[n.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",n[n.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",n[n.BYTE=5120]="BYTE",n[n.SHORT=5122]="SHORT",n[n.INT=5124]="INT",n[n.FLOAT=5126]="FLOAT",n[n.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",n[n.HALF_FLOAT=36193]="HALF_FLOAT",n))(Ht||{}),vt=(n=>(n[n.FLOAT=0]="FLOAT",n[n.INT=1]="INT",n[n.UINT=2]="UINT",n))(vt||{}),$i=(n=>(n[n.NEAREST=0]="NEAREST",n[n.LINEAR=1]="LINEAR",n))($i||{}),Z2=(n=>(n[n.CLAMP=33071]="CLAMP",n[n.REPEAT=10497]="REPEAT",n[n.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",n))(Z2||{}),Tr=(n=>(n[n.OFF=0]="OFF",n[n.POW2=1]="POW2",n[n.ON=2]="ON",n[n.ON_MANUAL=3]="ON_MANUAL",n))(Tr||{}),Er=(n=>(n[n.NPM=0]="NPM",n[n.UNPACK=1]="UNPACK",n[n.PMA=2]="PMA",n[n.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",n[n.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",n[n.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",n))(Er||{}),gi=(n=>(n[n.NO=0]="NO",n[n.YES=1]="YES",n[n.AUTO=2]="AUTO",n[n.BLEND=0]="BLEND",n[n.CLEAR=1]="CLEAR",n[n.BLIT=2]="BLIT",n))(gi||{}),K2=(n=>(n[n.AUTO=0]="AUTO",n[n.MANUAL=1]="MANUAL",n))(K2||{}),Hn=(n=>(n.LOW="lowp",n.MEDIUM="mediump",n.HIGH="highp",n))(Hn||{}),ze=(n=>(n[n.NONE=0]="NONE",n[n.SCISSOR=1]="SCISSOR",n[n.STENCIL=2]="STENCIL",n[n.SPRITE=3]="SPRITE",n[n.COLOR=4]="COLOR",n))(ze||{}),Pe=(n=>(n[n.NONE=0]="NONE",n[n.LOW=2]="LOW",n[n.MEDIUM=4]="MEDIUM",n[n.HIGH=8]="HIGH",n))(Pe||{}),bi=(n=>(n[n.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",n[n.ARRAY_BUFFER=34962]="ARRAY_BUFFER",n[n.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",n))(bi||{});const kw={createCanvas:(n,t)=>{const e=document.createElement("canvas");return e.width=n,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(n,t)=>fetch(n,t),parseXML:n=>new DOMParser().parseFromString(n,"text/xml")},$t={ADAPTER:kw,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var ed=/iPhone/i,i5=/iPod/i,s5=/iPad/i,r5=/\biOS-universal(?:.+)Mac\b/i,nd=/\bAndroid(?:.+)Mobile\b/i,a5=/Android/i,ma=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Kc=/Silk/i,ji=/Windows Phone/i,o5=/\bWindows(?:.+)ARM\b/i,l5=/BlackBerry/i,c5=/BB10/i,u5=/Opera Mini/i,h5=/\b(CriOS|Chrome)(?:.+)Mobile/i,f5=/Mobile(?:.+)Firefox\b/i,d5=function(n){return typeof n<"u"&&n.platform==="MacIntel"&&typeof n.maxTouchPoints=="number"&&n.maxTouchPoints>1&&typeof MSStream>"u"};function zw(n){return function(t){return t.test(n)}}function m5(n){var t={userAgent:"",platform:"",maxTouchPoints:0};!n&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof n=="string"?t.userAgent=n:n&&n.userAgent&&(t={userAgent:n.userAgent,platform:n.platform,maxTouchPoints:n.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var a=zw(e),o={apple:{phone:a(ed)&&!a(ji),ipod:a(i5),tablet:!a(ed)&&(a(s5)||d5(t))&&!a(ji),universal:a(r5),device:(a(ed)||a(i5)||a(s5)||a(r5)||d5(t))&&!a(ji)},amazon:{phone:a(ma),tablet:!a(ma)&&a(Kc),device:a(ma)||a(Kc)},android:{phone:!a(ji)&&a(ma)||!a(ji)&&a(nd),tablet:!a(ji)&&!a(ma)&&!a(nd)&&(a(Kc)||a(a5)),device:!a(ji)&&(a(ma)||a(Kc)||a(nd)||a(a5))||a(/\bokhttp\b/i)},windows:{phone:a(ji),tablet:a(o5),device:a(ji)||a(o5)},other:{blackberry:a(l5),blackberry10:a(c5),opera:a(u5),firefox:a(f5),chrome:a(h5),device:a(l5)||a(c5)||a(u5)||a(f5)||a(h5)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}const Vw=m5.default??m5,Ea=Vw(globalThis.navigator);$t.RETINA_PREFIX=/@([0-9\.]+)x/;$t.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var id={exports:{}},p5;function Gw(){return p5||(p5=1,(function(n){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function a(f,d,m){this.fn=f,this.context=d,this.once=m||!1}function o(f,d,m,y,v){if(typeof m!="function")throw new TypeError("The listener must be a function");var x=new a(m,y||f,v),b=e?e+d:d;return f._events[b]?f._events[b].fn?f._events[b]=[f._events[b],x]:f._events[b].push(x):(f._events[b]=x,f._eventsCount++),f}function c(f,d){--f._eventsCount===0?f._events=new i:delete f._events[d]}function u(){this._events=new i,this._eventsCount=0}u.prototype.eventNames=function(){var d=[],m,y;if(this._eventsCount===0)return d;for(y in m=this._events)t.call(m,y)&&d.push(e?y.slice(1):y);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},u.prototype.listeners=function(d){var m=e?e+d:d,y=this._events[m];if(!y)return[];if(y.fn)return[y.fn];for(var v=0,x=y.length,b=new Array(x);v80*O){H=st=A[0],W=ct=A[1];for(var dt=O;dtst&&(st=ft),pt>ct&&(ct=pt);mt=Math.max(st-H,ct-W),mt=mt!==0?32767/mt:0}return i(M,z,O,H,W,mt,0),z}function t(A,I,O,j,V){var M,z;if(V===K(A,I,O,j)>0)for(M=I;M=I;M-=j)z=G(M,A[M],A[M+1],z);return z&&P(z,z.next)&&(J(z),z=z.next),z}function e(A,I){if(!A)return A;I||(I=A);var O=A,j;do if(j=!1,!O.steiner&&(P(O,O.next)||L(O.prev,O,O.next)===0)){if(J(O),O=I=O.prev,O===O.next)break;j=!0}else O=O.next;while(j||O!==I);return I}function i(A,I,O,j,V,M,z){if(A){!z&&M&&x(A,j,V,M);for(var H=A,W,st;A.prev!==A.next;){if(W=A.prev,st=A.next,M?o(A,j,V,M):a(A)){I.push(W.i/O|0),I.push(A.i/O|0),I.push(st.i/O|0),J(A),A=st.next,H=st.next;continue}if(A=st,A===H){z?z===1?(A=c(e(A),I,O),i(A,I,O,j,V,M,2)):z===2&&u(A,I,O,j,V,M):i(e(A),I,O,j,V,M,1);break}}}}function a(A){var I=A.prev,O=A,j=A.next;if(L(I,O,j)>=0)return!1;for(var V=I.x,M=O.x,z=j.x,H=I.y,W=O.y,st=j.y,ct=VM?V>z?V:z:M>z?M:z,mt=H>W?H>st?H:st:W>st?W:st,dt=j.next;dt!==I;){if(dt.x>=ct&&dt.x<=pt&&dt.y>=ft&&dt.y<=mt&&_(V,H,M,W,z,st,dt.x,dt.y)&&L(dt.prev,dt,dt.next)>=0)return!1;dt=dt.next}return!0}function o(A,I,O,j){var V=A.prev,M=A,z=A.next;if(L(V,M,z)>=0)return!1;for(var H=V.x,W=M.x,st=z.x,ct=V.y,ft=M.y,pt=z.y,mt=HW?H>st?H:st:W>st?W:st,bt=ct>ft?ct>pt?ct:pt:ft>pt?ft:pt,Lt=T(mt,dt,I,O,j),wt=T(St,bt,I,O,j),gt=A.prevZ,xt=A.nextZ;gt&>.z>=Lt&&xt&&xt.z<=wt;){if(gt.x>=mt&>.x<=St&>.y>=dt&>.y<=bt&>!==V&>!==z&&_(H,ct,W,ft,st,pt,gt.x,gt.y)&&L(gt.prev,gt,gt.next)>=0||(gt=gt.prevZ,xt.x>=mt&&xt.x<=St&&xt.y>=dt&&xt.y<=bt&&xt!==V&&xt!==z&&_(H,ct,W,ft,st,pt,xt.x,xt.y)&&L(xt.prev,xt,xt.next)>=0))return!1;xt=xt.nextZ}for(;gt&>.z>=Lt;){if(gt.x>=mt&>.x<=St&>.y>=dt&>.y<=bt&>!==V&>!==z&&_(H,ct,W,ft,st,pt,gt.x,gt.y)&&L(gt.prev,gt,gt.next)>=0)return!1;gt=gt.prevZ}for(;xt&&xt.z<=wt;){if(xt.x>=mt&&xt.x<=St&&xt.y>=dt&&xt.y<=bt&&xt!==V&&xt!==z&&_(H,ct,W,ft,st,pt,xt.x,xt.y)&&L(xt.prev,xt,xt.next)>=0)return!1;xt=xt.nextZ}return!0}function c(A,I,O){var j=A;do{var V=j.prev,M=j.next.next;!P(V,M)&&w(V,j,j.next,M)&&D(V,M)&&D(M,V)&&(I.push(V.i/O|0),I.push(j.i/O|0),I.push(M.i/O|0),J(j),J(j.next),j=A=M),j=j.next}while(j!==A);return e(j)}function u(A,I,O,j,V,M){var z=A;do{for(var H=z.next.next;H!==z.prev;){if(z.i!==H.i&&R(z,H)){var W=U(z,H);z=e(z,z.next),W=e(W,W.next),i(z,I,O,j,V,M,0),i(W,I,O,j,V,M,0);return}H=H.next}z=z.next}while(z!==A)}function f(A,I,O,j){var V=[],M,z,H,W,st;for(M=0,z=I.length;M=O.next.y&&O.next.y!==O.y){var H=O.x+(V-O.y)*(O.next.x-O.x)/(O.next.y-O.y);if(H<=j&&H>M&&(M=H,z=O.x=O.x&&O.x>=st&&j!==O.x&&_(Vz.x||O.x===z.x&&v(z,O)))&&(z=O,ft=pt)),O=O.next;while(O!==W);return z}function v(A,I){return L(A.prev,A,I.prev)<0&&L(I.next,A,A.next)<0}function x(A,I,O,j){var V=A;do V.z===0&&(V.z=T(V.x,V.y,I,O,j)),V.prevZ=V.prev,V.nextZ=V.next,V=V.next;while(V!==A);V.prevZ.nextZ=null,V.prevZ=null,b(V)}function b(A){var I,O,j,V,M,z,H,W,st=1;do{for(O=A,A=null,M=null,z=0;O;){for(z++,j=O,H=0,I=0;I0||W>0&&j;)H!==0&&(W===0||!j||O.z<=j.z)?(V=O,O=O.nextZ,H--):(V=j,j=j.nextZ,W--),M?M.nextZ=V:A=V,V.prevZ=M,M=V;O=j}M.nextZ=null,st*=2}while(z>1);return A}function T(A,I,O,j,V){return A=(A-O)*V|0,I=(I-j)*V|0,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,I=(I|I<<8)&16711935,I=(I|I<<4)&252645135,I=(I|I<<2)&858993459,I=(I|I<<1)&1431655765,A|I<<1}function C(A){var I=A,O=A;do(I.x=(A-z)*(M-H)&&(A-z)*(j-H)>=(O-z)*(I-H)&&(O-z)*(M-H)>=(V-z)*(j-H)}function R(A,I){return A.next.i!==I.i&&A.prev.i!==I.i&&!N(A,I)&&(D(A,I)&&D(I,A)&&k(A,I)&&(L(A.prev,A,I.prev)||L(A,I.prev,I))||P(A,I)&&L(A.prev,A,A.next)>0&&L(I.prev,I,I.next)>0)}function L(A,I,O){return(I.y-A.y)*(O.x-I.x)-(I.x-A.x)*(O.y-I.y)}function P(A,I){return A.x===I.x&&A.y===I.y}function w(A,I,O,j){var V=E(L(A,I,O)),M=E(L(A,I,j)),z=E(L(O,j,A)),H=E(L(O,j,I));return!!(V!==M&&z!==H||V===0&&F(A,O,I)||M===0&&F(A,j,I)||z===0&&F(O,A,j)||H===0&&F(O,I,j))}function F(A,I,O){return I.x<=Math.max(A.x,O.x)&&I.x>=Math.min(A.x,O.x)&&I.y<=Math.max(A.y,O.y)&&I.y>=Math.min(A.y,O.y)}function E(A){return A>0?1:A<0?-1:0}function N(A,I){var O=A;do{if(O.i!==A.i&&O.next.i!==A.i&&O.i!==I.i&&O.next.i!==I.i&&w(O,O.next,A,I))return!0;O=O.next}while(O!==A);return!1}function D(A,I){return L(A.prev,A,A.next)<0?L(A,I,A.next)>=0&&L(A,A.prev,I)>=0:L(A,I,A.prev)<0||L(A,A.next,I)<0}function k(A,I){var O=A,j=!1,V=(A.x+I.x)/2,M=(A.y+I.y)/2;do O.y>M!=O.next.y>M&&O.next.y!==O.y&&V<(O.next.x-O.x)*(M-O.y)/(O.next.y-O.y)+O.x&&(j=!j),O=O.next;while(O!==A);return j}function U(A,I){var O=new tt(A.i,A.x,A.y),j=new tt(I.i,I.x,I.y),V=A.next,M=I.prev;return A.next=I,I.prev=A,O.next=V,V.prev=O,j.next=O,O.prev=j,M.next=j,j.prev=M,j}function G(A,I,O,j){var V=new tt(A,I,O);return j?(V.next=j.next,V.prev=j,j.next.prev=V,j.next=V):(V.prev=V,V.next=V),V}function J(A){A.next.prev=A.prev,A.prev.next=A.next,A.prevZ&&(A.prevZ.nextZ=A.nextZ),A.nextZ&&(A.nextZ.prevZ=A.prevZ)}function tt(A,I,O){this.i=A,this.x=I,this.y=O,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(A,I,O,j){var V=I&&I.length,M=V?I[0]*O:A.length,z=Math.abs(K(A,0,M,O));if(V)for(var H=0,W=I.length;H0&&(j+=A[V-1].length,O.holes.push(j))}return O},Qc.exports}jw();var ir={},Qo={exports:{}};var qw=Qo.exports,g5;function Xw(){return g5||(g5=1,(function(n,t){(function(e){var i=t&&!t.nodeType&&t,a=n&&!n.nodeType&&n,o=typeof Lu=="object"&&Lu;(o.global===o||o.window===o||o.self===o)&&(e=o);var c,u=2147483647,f=36,d=1,m=26,y=38,v=700,x=72,b=128,T="-",C=/^xn--/,_=/[^\x20-\x7E]/,R=/[\x2E\u3002\uFF0E\uFF61]/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=f-d,w=Math.floor,F=String.fromCharCode,E;function N(V){throw new RangeError(L[V])}function D(V,M){for(var z=V.length,H=[];z--;)H[z]=M(V[z]);return H}function k(V,M){var z=V.split("@"),H="";z.length>1&&(H=z[0]+"@",V=z[1]),V=V.replace(R,".");var W=V.split("."),st=D(W,M).join(".");return H+st}function U(V){for(var M=[],z=0,H=V.length,W,st;z=55296&&W<=56319&&z65535&&(M-=65536,z+=F(M>>>10&1023|55296),M=56320|M&1023),z+=F(M),z}).join("")}function J(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:f}function tt(V,M){return V+22+75*(V<26)-((M!=0)<<5)}function K(V,M,z){var H=0;for(V=z?w(V/v):V>>1,V+=w(V/M);V>P*m>>1;H+=f)V=w(V/P);return w(H+(P+1)*V/(V+y))}function A(V){var M=[],z=V.length,H,W=0,st=b,ct=x,ft,pt,mt,dt,St,bt,Lt,wt,gt;for(ft=V.lastIndexOf(T),ft<0&&(ft=0),pt=0;pt=128&&N("not-basic"),M.push(V.charCodeAt(pt));for(mt=ft>0?ft+1:0;mt=z&&N("invalid-input"),Lt=J(V.charCodeAt(mt++)),(Lt>=f||Lt>w((u-W)/St))&&N("overflow"),W+=Lt*St,wt=bt<=ct?d:bt>=ct+m?m:bt-ct,!(Ltw(u/gt)&&N("overflow"),St*=gt;H=M.length+1,ct=K(W-dt,H,dt==0),w(W/H)>u-st&&N("overflow"),st+=w(W/H),W%=H,M.splice(W++,0,st)}return G(M)}function I(V){var M,z,H,W,st,ct,ft,pt,mt,dt,St,bt=[],Lt,wt,gt,xt;for(V=U(V),Lt=V.length,M=b,z=0,st=x,ct=0;ct=M&&Stw((u-z)/wt)&&N("overflow"),z+=(ft-M)*wt,M=ft,ct=0;ctu&&N("overflow"),St==M){for(pt=z,mt=f;dt=mt<=st?d:mt>=st+m?m:mt-st,!(pt-1e3&&Q<1e3||F.call(/e/,rt))return rt;var Wt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Q=="number"){var le=Q<0?-k(-Q):k(Q);if(le!==Q){var ie=String(le),Dt=R.call(rt,ie.length+1);return L.call(ie,Wt,"$&_")+"."+L.call(L.call(Dt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return L.call(rt,Wt,"$&_")}var j=Ww,V=j.custom,M=wt(V)?V:null,z={__proto__:null,double:'"',single:"'"},H={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};rd=function Q(rt,Wt,le,ie){var Dt=Wt||{};if(Jt(Dt,"quoteStyle")&&!Jt(z,Dt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Jt(Dt,"maxStringLength")&&(typeof Dt.maxStringLength=="number"?Dt.maxStringLength<0&&Dt.maxStringLength!==1/0:Dt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Cn=Jt(Dt,"customInspect")?Dt.customInspect:!0;if(typeof Cn!="boolean"&&Cn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Jt(Dt,"indent")&&Dt.indent!==null&&Dt.indent!==" "&&!(parseInt(Dt.indent,10)===Dt.indent&&Dt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Jt(Dt,"numericSeparator")&&typeof Dt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var rn=Dt.numericSeparator;if(typeof rt>"u")return"undefined";if(rt===null)return"null";if(typeof rt=="boolean")return rt?"true":"false";if(typeof rt=="string")return Ha(rt,Dt);if(typeof rt=="number"){if(rt===0)return 1/0/rt>0?"0":"-0";var Ge=String(rt);return rn?O(rt,Ge):Ge}if(typeof rt=="bigint"){var hn=String(rt)+"n";return rn?O(rt,hn):hn}var ja=typeof Dt.depth>"u"?5:Dt.depth;if(typeof le>"u"&&(le=0),le>=ja&&ja>0&&typeof rt=="object")return ft(rt)?"[Array]":"[Object]";var Si=Ps(Dt,le);if(typeof ie>"u")ie=[];else if(Ln(ie,rt)>=0)return"[Circular]";function an(_i,li,$a){if(li&&(ie=D.call(ie),ie.push(li)),$a){var Ai={depth:Dt.depth};return Jt(Dt,"quoteStyle")&&(Ai.quoteStyle=Dt.quoteStyle),Q(_i,Ai,le+1,ie)}return Q(_i,Dt,le+1,ie)}if(typeof rt=="function"&&!mt(rt)){var Ji=bn(rt),Nl=xn(rt,an);return"[Function"+(Ji?": "+Ji:" (anonymous)")+"]"+(Nl.length>0?" { "+N.call(Nl,", ")+" }":"")}if(wt(rt)){var qa=tt?L.call(String(rt),/^(Symbol\(.*\))_[^)]*$/,"$1"):J.call(rt);return typeof rt=="object"&&!tt?Fs(qa):qa}if(Ll(rt)){for(var ts="<"+w.call(String(rt.nodeName)),Rr=rt.attributes||[],es=0;es",ts}if(ft(rt)){if(rt.length===0)return"[]";var Us=xn(rt,an);return Si&&!gh(Us)?"["+Xe(Us,Si)+"]":"[ "+N.call(Us,", ")+" ]"}if(dt(rt)){var Lr=xn(rt,an);return!("cause"in Error.prototype)&&"cause"in rt&&!A.call(rt,"cause")?"{ ["+String(rt)+"] "+N.call(E.call("[cause]: "+an(rt.cause),Lr),", ")+" }":Lr.length===0?"["+String(rt)+"]":"{ ["+String(rt)+"] "+N.call(Lr,", ")+" }"}if(typeof rt=="object"&&Cn){if(M&&typeof rt[M]=="function"&&j)return j(rt,{depth:ja-le});if(Cn!=="symbol"&&typeof rt.inspect=="function")return rt.inspect()}if(sn(rt)){var Xa=[];return i&&i.call(rt,function(_i,li){Xa.push(an(li,rt,!0)+" => "+an(_i,rt))}),Ol("Map",e.call(rt),Xa,Si)}if(Le(rt)){var Wn=[];return u&&u.call(rt,function(_i){Wn.push(an(_i,rt))}),Ol("Set",c.call(rt),Wn,Si)}if(Ki(rt))return Mr("WeakMap");if(yh(rt))return Mr("WeakSet");if(Qi(rt))return Mr("WeakRef");if(bt(rt))return Fs(an(Number(rt)));if(gt(rt))return Fs(an(U.call(rt)));if(Lt(rt))return Fs(b.call(rt));if(St(rt))return Fs(an(String(rt)));if(typeof window<"u"&&rt===window)return"{ [object Window] }";if(typeof globalThis<"u"&&rt===globalThis||typeof Lu<"u"&&rt===Lu)return"{ [object globalThis] }";if(!pt(rt)&&!mt(rt)){var Ee=xn(rt,an),Ye=I?I(rt)===Object.prototype:rt instanceof Object||rt.constructor===Object,oi=rt instanceof Object?"":"null prototype",Or=!Ye&&K&&Object(rt)===rt&&K in rt?R.call(Re(rt),8,-1):oi?"Object":"",vh=Ye||typeof rt.constructor!="function"?"":rt.constructor.name?rt.constructor.name+" ":"",Ya=vh+(Or||oi?"["+N.call(E.call([],Or||[],oi||[]),": ")+"] ":"");return Ee.length===0?Ya+"{}":Si?Ya+"{"+Xe(Ee,Si)+"}":Ya+"{ "+N.call(Ee,", ")+" }"}return String(rt)};function W(Q,rt,Wt){var le=Wt.quoteStyle||rt,ie=z[le];return ie+Q+ie}function st(Q){return L.call(String(Q),/"/g,""")}function ct(Q){return!K||!(typeof Q=="object"&&(K in Q||typeof Q[K]<"u"))}function ft(Q){return Re(Q)==="[object Array]"&&ct(Q)}function pt(Q){return Re(Q)==="[object Date]"&&ct(Q)}function mt(Q){return Re(Q)==="[object RegExp]"&&ct(Q)}function dt(Q){return Re(Q)==="[object Error]"&&ct(Q)}function St(Q){return Re(Q)==="[object String]"&&ct(Q)}function bt(Q){return Re(Q)==="[object Number]"&&ct(Q)}function Lt(Q){return Re(Q)==="[object Boolean]"&&ct(Q)}function wt(Q){if(tt)return Q&&typeof Q=="object"&&Q instanceof Symbol;if(typeof Q=="symbol")return!0;if(!Q||typeof Q!="object"||!J)return!1;try{return J.call(Q),!0}catch{}return!1}function gt(Q){if(!Q||typeof Q!="object"||!U)return!1;try{return U.call(Q),!0}catch{}return!1}var xt=Object.prototype.hasOwnProperty||function(Q){return Q in this};function Jt(Q,rt){return xt.call(Q,rt)}function Re(Q){return T.call(Q)}function bn(Q){if(Q.name)return Q.name;var rt=_.call(C.call(Q),/^function\s*([\w$]+)/);return rt?rt[1]:null}function Ln(Q,rt){if(Q.indexOf)return Q.indexOf(rt);for(var Wt=0,le=Q.length;Wtrt.maxStringLength){var Wt=Q.length-rt.maxStringLength,le="... "+Wt+" more character"+(Wt>1?"s":"");return Ha(R.call(Q,0,rt.maxStringLength),rt)+le}var ie=H[rt.quoteStyle||"single"];ie.lastIndex=0;var Dt=L.call(L.call(Q,ie,"\\$1"),/[\x00-\x1f]/g,wr);return W(Dt,"single",rt)}function wr(Q){var rt=Q.charCodeAt(0),Wt={8:"b",9:"t",10:"n",12:"f",13:"r"}[rt];return Wt?"\\"+Wt:"\\x"+(rt<16?"0":"")+P.call(rt.toString(16))}function Fs(Q){return"Object("+Q+")"}function Mr(Q){return Q+" { ? }"}function Ol(Q,rt,Wt,le){var ie=le?Xe(Wt,le):N.call(Wt,", ");return Q+" ("+rt+") {"+ie+"}"}function gh(Q){for(var rt=0;rt=0)return!1;return!0}function Ps(Q,rt){var Wt;if(Q.indent===" ")Wt=" ";else if(typeof Q.indent=="number"&&Q.indent>0)Wt=N.call(Array(Q.indent+1)," ");else return null;return{base:Wt,prev:N.call(Array(rt+1),Wt)}}function Xe(Q,rt){if(Q.length===0)return"";var Wt=` +`+rt.prev+rt.base;return Wt+N.call(Q,","+Wt)+` +`+rt.prev}function xn(Q,rt){var Wt=ft(Q),le=[];if(Wt){le.length=Q.length;for(var ie=0;ie"u"||!E?n:E(Uint8Array),tt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":F&&E?E([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":G,"%AsyncGenerator%":G,"%AsyncGeneratorFunction%":G,"%AsyncIteratorPrototype%":G,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?n:Float16Array,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":C,"%GeneratorFunction%":G,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":F&&E?E(E([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!F||!E?n:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":R,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":a,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!F||!E?n:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":F&&E?E(""[Symbol.iterator]()):n,"%Symbol%":F?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":w,"%TypedArray%":J,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":f,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":U,"%Function.prototype.apply%":k,"%Object.defineProperty%":L,"%Object.getPrototypeOf%":N,"%Math.abs%":d,"%Math.floor%":m,"%Math.max%":y,"%Math.min%":v,"%Math.pow%":x,"%Math.round%":b,"%Math.sign%":T,"%Reflect.getPrototypeOf%":D};if(E)try{null.error}catch(mt){var K=E(E(mt));tt["%Error.prototype%"]=K}var A=function mt(dt){var St;if(dt==="%AsyncFunction%")St=_("async function () {}");else if(dt==="%GeneratorFunction%")St=_("function* () {}");else if(dt==="%AsyncGeneratorFunction%")St=_("async function* () {}");else if(dt==="%AsyncGenerator%"){var bt=mt("%AsyncGeneratorFunction%");bt&&(St=bt.prototype)}else if(dt==="%AsyncIteratorPrototype%"){var Lt=mt("%AsyncGenerator%");Lt&&E&&(St=E(Lt.prototype))}return tt[dt]=St,St},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=lh(),j=bM(),V=O.call(U,Array.prototype.concat),M=O.call(k,Array.prototype.splice),z=O.call(U,String.prototype.replace),H=O.call(U,String.prototype.slice),W=O.call(U,RegExp.prototype.exec),st=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ct=/\\(\\)?/g,ft=function(dt){var St=H(dt,0,1),bt=H(dt,-1);if(St==="%"&&bt!=="%")throw new c("invalid intrinsic syntax, expected closing `%`");if(bt==="%"&&St!=="%")throw new c("invalid intrinsic syntax, expected opening `%`");var Lt=[];return z(dt,st,function(wt,gt,xt,Jt){Lt[Lt.length]=xt?z(Jt,ct,"$1"):gt||wt}),Lt},pt=function(dt,St){var bt=dt,Lt;if(j(I,bt)&&(Lt=I[bt],bt="%"+Lt[0]+"%"),j(tt,bt)){var wt=tt[bt];if(wt===G&&(wt=A(bt)),typeof wt>"u"&&!St)throw new u("intrinsic "+dt+" exists, but is not available. Please file an issue!");return{alias:Lt,name:bt,value:wt}}throw new c("intrinsic "+dt+" does not exist!")};return kd=function(dt,St){if(typeof dt!="string"||dt.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof St!="boolean")throw new u('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,dt)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var bt=ft(dt),Lt=bt.length>0?bt[0]:"",wt=pt("%"+Lt+"%",St),gt=wt.name,xt=wt.value,Jt=!1,Re=wt.alias;Re&&(Lt=Re[0],M(bt,V([0,1],Re)));for(var bn=1,Ln=!0;bn=bt.length){var Le=R(xt,sn);Ln=!!Le,Ln&&"get"in Le&&!("originalValue"in Le.get)?xt=Le.get:xt=xt[sn]}else Ln=j(xt,sn),xt=xt[sn];Ln&&!Jt&&(tt[gt]=xt)}}return xt},kd}var zd,t6;function h9(){if(t6)return zd;t6=1;var n=J2(),t=u9(),e=t([n("%String.prototype.indexOf%")]);return zd=function(a,o){var c=n(a,!!o);return typeof c=="function"&&e(a,".prototype.")>-1?t([c]):c},zd}var Vd,e6;function f9(){if(e6)return Vd;e6=1;var n=J2(),t=h9(),e=oh(),i=za(),a=n("%Map%",!0),o=t("Map.prototype.get",!0),c=t("Map.prototype.set",!0),u=t("Map.prototype.has",!0),f=t("Map.prototype.delete",!0),d=t("Map.prototype.size",!0);return Vd=!!a&&function(){var y,v={assert:function(x){if(!v.has(x))throw new i("Side channel does not contain "+e(x))},delete:function(x){if(y){var b=f(y,x);return d(y)===0&&(y=void 0),b}return!1},get:function(x){if(y)return o(y,x)},has:function(x){return y?u(y,x):!1},set:function(x,b){y||(y=new a),c(y,x,b)}};return v},Vd}var Gd,n6;function xM(){if(n6)return Gd;n6=1;var n=J2(),t=h9(),e=oh(),i=f9(),a=za(),o=n("%WeakMap%",!0),c=t("WeakMap.prototype.get",!0),u=t("WeakMap.prototype.set",!0),f=t("WeakMap.prototype.has",!0),d=t("WeakMap.prototype.delete",!0);return Gd=o?function(){var y,v,x={assert:function(b){if(!x.has(b))throw new a("Side channel does not contain "+e(b))},delete:function(b){if(o&&b&&(typeof b=="object"||typeof b=="function")){if(y)return d(y,b)}else if(i&&v)return v.delete(b);return!1},get:function(b){return o&&b&&(typeof b=="object"||typeof b=="function")&&y?c(y,b):v&&v.get(b)},has:function(b){return o&&b&&(typeof b=="object"||typeof b=="function")&&y?f(y,b):!!v&&v.has(b)},set:function(b,T){o&&b&&(typeof b=="object"||typeof b=="function")?(y||(y=new o),u(y,b,T)):i&&(v||(v=i()),v.set(b,T))}};return x}:i,Gd}var Hd,i6;function d9(){if(i6)return Hd;i6=1;var n=za(),t=oh(),e=Zw(),i=f9(),a=xM(),o=a||i||e;return Hd=function(){var u,f={assert:function(d){if(!f.has(d)){var m=d&&Object(d)===d?"the given object key":t(d);throw new n("Side channel does not contain "+m)}},delete:function(d){return!!u&&u.delete(d)},get:function(d){return u&&u.get(d)},has:function(d){return!!u&&u.has(d)},set:function(d,m){u||(u=o()),u.set(d,m)}};return f},Hd}var jd,s6;function tm(){if(s6)return jd;s6=1;var n=String.prototype.replace,t=/%20/g,e={RFC1738:"RFC1738",RFC3986:"RFC3986"};return jd={default:e.RFC3986,formatters:{RFC1738:function(i){return n.call(i,t,"+")},RFC3986:function(i){return String(i)}},RFC1738:e.RFC1738,RFC3986:e.RFC3986},jd}var qd,r6;function m9(){if(r6)return qd;r6=1;var n=tm(),t=d9(),e=a9(),i=Object.prototype.hasOwnProperty,a=Array.isArray,o=t(),c=function(D,k){return o.set(D,k),D},u=function(D){return o.has(D)},f=function(D){return o.get(D)},d=function(D,k){o.set(D,k)},m=(function(){for(var N=[],D=0;D<256;++D)N[N.length]="%"+((D<16?"0":"")+D.toString(16)).toUpperCase();return N})(),y=function(D){for(;D.length>1;){var k=D.pop(),U=k.obj[k.prop];if(a(U)){for(var G=[],J=0;J=U.arrayLimit){if(U.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+U.arrayLimit+" element"+(U.arrayLimit===1?"":"s")+" allowed in an array.");return c(v(D.concat(k),U),G)}D[G]=k}else if(D&&typeof D=="object")if(u(D)){var J=f(D)+1;D[J]=k,d(D,J)}else{if(U&&U.strictMerge)return[D,k];(U&&(U.plainObjects||U.allowPrototypes)||!i.call(Object.prototype,k))&&(D[k]=!0)}else return[D,k];return D}if(!D||typeof D!="object"){if(u(k)){for(var tt=Object.keys(k),K=U&&U.plainObjects?{__proto__:null,0:D}:{0:D},A=0;AU.arrayLimit){if(U.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+U.arrayLimit+" element"+(U.arrayLimit===1?"":"s")+" allowed in an array.");return c(v(O,U),O.length-1)}return O}var j=D;if(a(D)&&!a(k)&&(j=v(D,U)),a(D)&&a(k)){if(k.forEach(function(V,M){if(i.call(D,M)){var z=D[M];z&&typeof z=="object"&&V&&typeof V=="object"?D[M]=N(z,V,U):D[D.length]=V}else D[M]=V}),U&&typeof U.arrayLimit=="number"&&D.length>U.arrayLimit){if(U.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+U.arrayLimit+" element"+(U.arrayLimit===1?"":"s")+" allowed in an array.");return c(v(D,U),D.length-1)}return D}return Object.keys(k).reduce(function(V,M){var z=k[M];if(i.call(V,M)?x(V,M,N(V[M],z,U)):x(V,M,z),u(k)&&!u(V)&&c(V,f(k)),u(V)){var H=parseInt(M,10);String(H)===M&&H>=0&&H>f(V)&&d(V,H)}return V},j)},T=function(D,k){return Object.keys(k).reduce(function(U,G){return x(U,G,k[G]),U},D)},C=function(N,D,k){var U=N.replace(/\+/g," ");if(k==="iso-8859-1")return U.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(U)}catch{return U}},_=1024,R=function(D,k,U,G,J){if(D.length===0)return D;var tt=D;if(typeof D=="symbol"?tt=Symbol.prototype.toString.call(D):typeof D!="string"&&(tt=String(D)),U==="iso-8859-1")return escape(tt).replace(/%u[0-9a-f]{4}/gi,function(z){return"%26%23"+parseInt(z.slice(2),16)+"%3B"});for(var K="",A=0;A=_?tt.slice(A,A+_):tt;if(A+_=55296&&O<=56319&&(I=I.slice(0,-1),A-=1)}for(var j=[],V=0;V=48&&M<=57||M>=65&&M<=90||M>=97&&M<=122||J===n.RFC1738&&(M===40||M===41)){j[j.length]=I.charAt(V);continue}if(M<128){j[j.length]=m[M];continue}if(M<2048){j[j.length]=m[192|M>>6]+m[128|M&63];continue}if(M<55296||M>=57344){j[j.length]=m[224|M>>12]+m[128|M>>6&63]+m[128|M&63];continue}V+=1,M=65536+((M&1023)<<10|I.charCodeAt(V)&1023),j[j.length]=m[240|M>>18]+m[128|M>>12&63]+m[128|M>>6&63]+m[128|M&63]}K+=j.join("")}return K},L=function(D){for(var k=[{obj:{o:D},prop:"o"}],U=t(),G=0;GU){if(J)throw new RangeError("Array limit exceeded. Only "+U+" element"+(U===1?"":"s")+" allowed in an array.");return c(v(K,{plainObjects:G}),K.length-1)}return K},E=function(D,k){if(a(D)){for(var U=[],G=0;G"u"&&(V=0)}if(typeof D=="function"?O=D(_,O):O instanceof Date?O=G(O):R==="comma"&&o(O)&&(O=t.maybeMap(O,function(gt){return gt instanceof Date?G(gt):gt})),O===null){if(w)return tt(N&&!K?N(_,m.encoder,A,"key",J):_);O=""}if(y(O)||t.isBuffer(O)){if(N){var H=K?_:N(_,m.encoder,A,"key",J);return[tt(H)+"="+tt(N(O,m.encoder,A,"value",J))]}return[tt(_)+"="+tt(String(O))]}var W=[];if(typeof O>"u")return W;var st;if(R==="comma"&&o(O))K&&N&&(O=t.maybeMap(O,function(gt){return gt==null?gt:N(gt)})),st=[{value:O.length>0?O.join(",")||null:void 0}];else if(o(D))st=D;else{var ct=Object.keys(O);st=k?ct.sort(k):ct}var ft=E?String(_).replace(/\./g,"%2E"):String(_),pt=L&&o(O)&&O.length===1?ft+"[]":ft;if(P&&o(O)&&O.length===0)return pt+"[]";for(var mt=0;mt"u"?C.encodeDotInKeys===!0?!0:m.allowDots:!!C.allowDots;return{addQueryPrefix:typeof C.addQueryPrefix=="boolean"?C.addQueryPrefix:m.addQueryPrefix,allowDots:F,allowEmptyArrays:typeof C.allowEmptyArrays=="boolean"?!!C.allowEmptyArrays:m.allowEmptyArrays,arrayFormat:w,charset:_,charsetSentinel:typeof C.charsetSentinel=="boolean"?C.charsetSentinel:m.charsetSentinel,commaRoundTrip:!!C.commaRoundTrip,delimiter:typeof C.delimiter>"u"?m.delimiter:C.delimiter,encode:typeof C.encode=="boolean"?C.encode:m.encode,encodeDotInKeys:typeof C.encodeDotInKeys=="boolean"?C.encodeDotInKeys:m.encodeDotInKeys,encoder:typeof C.encoder=="function"?C.encoder:m.encoder,encodeValuesOnly:typeof C.encodeValuesOnly=="boolean"?C.encodeValuesOnly:m.encodeValuesOnly,filter:P,format:R,formatter:L,serializeDate:typeof C.serializeDate=="function"?C.serializeDate:m.serializeDate,skipNulls:typeof C.skipNulls=="boolean"?C.skipNulls:m.skipNulls,sort:typeof C.sort=="function"?C.sort:null,strictNullHandling:typeof C.strictNullHandling=="boolean"?C.strictNullHandling:m.strictNullHandling}};return Xd=function(T,C){var _=T,R=b(C),L,P;typeof R.filter=="function"?(P=R.filter,_=P("",_)):o(R.filter)&&(P=R.filter,L=P);var w=[];if(typeof _!="object"||_===null)return"";var F=a[R.arrayFormat],E=F==="comma"&&R.commaRoundTrip;L||(L=Object.keys(_)),R.sort&&L.sort(R.sort);for(var N=n(),D=0;D"u"||k===null)){var U=_[k];R.skipNulls&&U===null||u(w,x(U,k,F,E,R.allowEmptyArrays,R.strictNullHandling,R.skipNulls,R.encodeDotInKeys,R.encode?R.encoder:null,R.filter,R.sort,R.allowDots,R.serializeDate,R.format,R.formatter,R.encodeValuesOnly,R.charset,N))}}var G=w.join(R.delimiter),J=R.addQueryPrefix===!0?"?":"";return R.charsetSentinel&&(R.charset==="iso-8859-1"?J+="utf8=%26%2310003%3B"+R.delimiter:J+="utf8=%E2%9C%93"+R.delimiter),G.length>0?J+G:""},Xd}var Yd,o6;function TM(){if(o6)return Yd;o6=1;var n=m9(),t=Object.prototype.hasOwnProperty,e=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(x){return x.replace(/&#(\d+);/g,function(b,T){return String.fromCharCode(parseInt(T,10))})},o=function(x,b,T,C){if(x&&typeof x=="string"&&b.comma&&x.indexOf(",")>-1){if(C&&b.throwOnLimitExceeded)for(var _=0,R=x.indexOf(",");R>-1;){if(_+=1,_>=b.arrayLimit)throw new RangeError("Array limit exceeded. Only "+b.arrayLimit+" element"+(b.arrayLimit===1?"":"s")+" allowed in an array.");R=x.indexOf(",",R+1)}return x.split(",")}if(b.throwOnLimitExceeded&&T>=b.arrayLimit)throw new RangeError("Array limit exceeded. Only "+b.arrayLimit+" element"+(b.arrayLimit===1?"":"s")+" allowed in an array.");return x},c="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",f=function(b,T){var C={__proto__:null},_=T.ignoreQueryPrefix?b.replace(/^\?/,""):b;_=_.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var R=T.parameterLimit===1/0?void 0:T.parameterLimit,L=_.split(T.delimiter,T.throwOnLimitExceeded&&typeof R<"u"?R+1:R);if(T.throwOnLimitExceeded&&typeof R<"u"&&L.length>R)throw new RangeError("Parameter limit exceeded. Only "+R+" parameter"+(R===1?"":"s")+" allowed.");var P=-1,w,F=T.charset;if(T.charsetSentinel)for(w=0;w-1&&(U=e(U)?[U]:U),T.comma&&e(U)&&U.length>T.arrayLimit&&(U=n.combine([],U,T.arrayLimit,T.plainObjects,T.throwOnLimitExceeded)),k!==null){var G=t.call(C,k);G&&(T.duplicates==="combine"||E.indexOf("[]=")>-1)?C[k]=n.combine(C[k],U,T.arrayLimit,T.plainObjects,T.throwOnLimitExceeded):(!G||T.duplicates==="last")&&(C[k]=U)}}return C},d=function(x,b,T,C){var _=0;if(x.length>0&&x[x.length-1]==="[]"){var R=x.slice(0,-1).join("");_=Array.isArray(b)&&b[R]?b[R].length:0}for(var L=C?b:o(b,T,_),P=x.length-1;P>=0;--P){var w,F=x[P];if(F==="[]"&&T.parseArrays)n.isOverflow(L)?w=L:w=T.allowEmptyArrays&&(L===""||T.strictNullHandling&&L===null)?[]:n.combine([],L,T.arrayLimit,T.plainObjects,T.throwOnLimitExceeded);else{w=T.plainObjects?{__proto__:null}:{};var E=F.charAt(0)==="["&&F.charAt(F.length-1)==="]"?F.slice(1,-1):F,N=T.decodeDotInKeys?E.replace(/%2E/g,"."):E,D=parseInt(N,10),k=!isNaN(D)&&F!==N&&String(D)===N&&D>=0&&T.parseArrays;if(!T.parseArrays&&N==="")w={0:L};else if(k&&D=0?C.slice(0,R):C;if(L){if(!T.plainObjects&&t.call(Object.prototype,L)&&!T.allowPrototypes)return;_[_.length]=L}for(var P=C.length,w=R,F=0;w>=0&&F=0){if(T.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+T.depth+" and strictDepth is true");_[_.length]="["+C.slice(w)+"]"}return _},y=function(b,T,C,_){if(b){var R=m(b,C);if(R)return d(R,T,C,_)}},v=function(b){if(!b)return i;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.decodeDotInKeys<"u"&&typeof b.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(b.decoder!==null&&typeof b.decoder<"u"&&typeof b.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof b.throwOnLimitExceeded<"u"&&typeof b.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var T=typeof b.charset>"u"?i.charset:b.charset,C=typeof b.duplicates>"u"?i.duplicates:b.duplicates;if(C!=="combine"&&C!=="first"&&C!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var _=typeof b.allowDots>"u"?b.decodeDotInKeys===!0?!0:i.allowDots:!!b.allowDots;return{allowDots:_,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof b.allowPrototypes=="boolean"?b.allowPrototypes:i.allowPrototypes,allowSparse:typeof b.allowSparse=="boolean"?b.allowSparse:i.allowSparse,arrayLimit:typeof b.arrayLimit=="number"?b.arrayLimit:i.arrayLimit,charset:T,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:i.charsetSentinel,comma:typeof b.comma=="boolean"?b.comma:i.comma,decodeDotInKeys:typeof b.decodeDotInKeys=="boolean"?b.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof b.decoder=="function"?b.decoder:i.decoder,delimiter:typeof b.delimiter=="string"||n.isRegExp(b.delimiter)?b.delimiter:i.delimiter,depth:typeof b.depth=="number"||b.depth===!1?+b.depth:i.depth,duplicates:C,ignoreQueryPrefix:b.ignoreQueryPrefix===!0,interpretNumericEntities:typeof b.interpretNumericEntities=="boolean"?b.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof b.parameterLimit=="number"?b.parameterLimit:i.parameterLimit,parseArrays:b.parseArrays!==!1,plainObjects:typeof b.plainObjects=="boolean"?b.plainObjects:i.plainObjects,strictDepth:typeof b.strictDepth=="boolean"?!!b.strictDepth:i.strictDepth,strictMerge:typeof b.strictMerge=="boolean"?!!b.strictMerge:i.strictMerge,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof b.throwOnLimitExceeded=="boolean"?b.throwOnLimitExceeded:!1}};return Yd=function(x,b){var T=v(b);if(x===""||x===null||typeof x>"u")return T.plainObjects?{__proto__:null}:{};for(var C=typeof x=="string"?f(x,T):x,_=T.plainObjects?{__proto__:null}:{},R=Object.keys(C),L=0;L",'"',"`"," ","\r",` +`," "],c=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(c),f=["%","/","?",";","#"].concat(u),d=["/","?","#"],m=255,y=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},T={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=SM();function _(w,F,E){if(w&&typeof w=="object"&&w instanceof t)return w;var N=new t;return N.parse(w,F,E),N}t.prototype.parse=function(w,F,E){if(typeof w!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof w);var N=w.indexOf("?"),D=N!==-1&&N127?ct+="x":ct+=st[ft];if(!ct.match(y)){var mt=H.slice(0,O),dt=H.slice(O+1),St=st.match(v);St&&(mt.push(St[1]),dt.unshift(St[2])),dt.length&&(G="/"+dt.join(".")+G),this.hostname=mt.join(".");break}}}this.hostname.length>m?this.hostname="":this.hostname=this.hostname.toLowerCase(),z||(this.hostname=n.toASCII(this.hostname));var bt=this.port?":"+this.port:"",Lt=this.hostname||"";this.host=Lt+bt,this.href+=this.host,z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),G[0]!=="/"&&(G="/"+G))}if(!x[K])for(var O=0,W=u.length;O0?E.host.split("@"):!1;ct&&(E.auth=ct.shift(),E.hostname=ct.shift(),E.host=E.hostname)}return E.search=w.search,E.query=w.query,(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.href=E.format(),E}if(!H.length)return E.pathname=null,E.search?E.path="/"+E.search:E.path=null,E.href=E.format(),E;for(var ft=H.slice(-1)[0],pt=(E.host||w.host||H.length>1)&&(ft==="."||ft==="..")||ft==="",mt=0,dt=H.length;dt>=0;dt--)ft=H[dt],ft==="."?H.splice(dt,1):ft===".."?(H.splice(dt,1),mt++):mt&&(H.splice(dt,1),mt--);if(!M&&!z)for(;mt--;mt)H.unshift("..");M&&H[0]!==""&&(!H[0]||H[0].charAt(0)!=="/")&&H.unshift(""),pt&&H.join("/").substr(-1)!=="/"&&H.push("");var St=H[0]===""||H[0]&&H[0].charAt(0)==="/";if(st){E.hostname=St?"":H.length?H.shift():"",E.host=E.hostname;var ct=E.host&&E.host.indexOf("@")>0?E.host.split("@"):!1;ct&&(E.auth=ct.shift(),E.hostname=ct.shift(),E.host=E.hostname)}return M=M||E.host&&H.length,M&&!St&&H.unshift(""),H.length>0?E.pathname=H.join("/"):(E.pathname=null,E.path=null),(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.auth=w.auth||E.auth,E.slashes=E.slashes||w.slashes,E.href=E.format(),E},t.prototype.parseHost=function(){var w=this.host,F=i.exec(w);F&&(F=F[0],F!==":"&&(this.port=F.substr(1)),w=w.substr(0,w.length-F.length)),w&&(this.hostname=w)},ir.parse=_,ir.resolve=L,ir.resolveObject=P,ir.format=R,ir.Url=t,ir}_M();const u6={};function oe(n,t,e=3){if(u6[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} +Deprecated since v${n}`):(i=i.split(` +`).splice(e).join(` +`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} +Deprecated since v${n}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} +Deprecated since v${n}`),console.warn(i))),u6[t]=!0}let Wd;function AM(){return typeof Wd>"u"&&(Wd=(function(){const n={stencil:!0,failIfMajorPerformanceCaveat:$t.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!$t.ADAPTER.getWebGLRenderingContext())return!1;const t=$t.ADAPTER.createCanvas();let e=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);const i=!!e?.getContextAttributes()?.stencil;if(e){const a=e.getExtension("WEBGL_lose_context");a&&a.loseContext()}return e=null,i}catch{return!1}})()),Wd}var EM={grad:.9,turn:360,rad:360/(2*Math.PI)},qi=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},qe=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*n)/e+0},jn=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),n>e?e:n>t?n:t},p9=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},h6=function(n){return{r:jn(n.r,0,255),g:jn(n.g,0,255),b:jn(n.b,0,255),a:jn(n.a)}},Zd=function(n){return{r:qe(n.r),g:qe(n.g),b:qe(n.b),a:qe(n.a,3)}},wM=/^#([0-9a-f]{3,8})$/i,Jc=function(n){var t=n.toString(16);return t.length<2?"0"+t:t},y9=function(n){var t=n.r,e=n.g,i=n.b,a=n.a,o=Math.max(t,e,i),c=o-Math.min(t,e,i),u=c?o===t?(e-i)/c:o===e?2+(i-t)/c:4+(t-e)/c:0;return{h:60*(u<0?u+6:u),s:o?c/o*100:0,v:o/255*100,a}},g9=function(n){var t=n.h,e=n.s,i=n.v,a=n.a;t=t/360*6,e/=100,i/=100;var o=Math.floor(t),c=i*(1-e),u=i*(1-(t-o)*e),f=i*(1-(1-t+o)*e),d=o%6;return{r:255*[i,u,c,c,f,i][d],g:255*[f,i,i,u,c,c][d],b:255*[c,c,f,i,i,u][d],a}},f6=function(n){return{h:p9(n.h),s:jn(n.s,0,100),l:jn(n.l,0,100),a:jn(n.a)}},d6=function(n){return{h:qe(n.h),s:qe(n.s),l:qe(n.l),a:qe(n.a,3)}},m6=function(n){return g9((e=(t=n).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},cl=function(n){return{h:(t=y9(n)).h,s:(a=(200-(e=t.s))*(i=t.v)/100)>0&&a<200?e*i/100/(a<=100?a:200-a)*100:0,l:a/2,a:t.a};var t,e,i,a},MM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,RM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,LM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,OM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,W0={string:[[function(n){var t=wM.exec(n);return t?(n=t[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?qe(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?qe(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var t=LM.exec(n)||OM.exec(n);return t?t[2]!==t[4]||t[4]!==t[6]?null:h6({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(n){var t=MM.exec(n)||RM.exec(n);if(!t)return null;var e,i,a=f6({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(EM[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return m6(a)},"hsl"]],object:[[function(n){var t=n.r,e=n.g,i=n.b,a=n.a,o=a===void 0?1:a;return qi(t)&&qi(e)&&qi(i)?h6({r:Number(t),g:Number(e),b:Number(i),a:Number(o)}):null},"rgb"],[function(n){var t=n.h,e=n.s,i=n.l,a=n.a,o=a===void 0?1:a;if(!qi(t)||!qi(e)||!qi(i))return null;var c=f6({h:Number(t),s:Number(e),l:Number(i),a:Number(o)});return m6(c)},"hsl"],[function(n){var t=n.h,e=n.s,i=n.v,a=n.a,o=a===void 0?1:a;if(!qi(t)||!qi(e)||!qi(i))return null;var c=(function(u){return{h:p9(u.h),s:jn(u.s,0,100),v:jn(u.v,0,100),a:jn(u.a)}})({h:Number(t),s:Number(e),v:Number(i),a:Number(o)});return g9(c)},"hsv"]]},p6=function(n,t){for(var e=0;e=.5},n.prototype.toHex=function(){return t=Zd(this.rgba),e=t.r,i=t.g,a=t.b,c=(o=t.a)<1?Jc(qe(255*o)):"","#"+Jc(e)+Jc(i)+Jc(a)+c;var t,e,i,a,o,c},n.prototype.toRgb=function(){return Zd(this.rgba)},n.prototype.toRgbString=function(){return t=Zd(this.rgba),e=t.r,i=t.g,a=t.b,(o=t.a)<1?"rgba("+e+", "+i+", "+a+", "+o+")":"rgb("+e+", "+i+", "+a+")";var t,e,i,a,o},n.prototype.toHsl=function(){return d6(cl(this.rgba))},n.prototype.toHslString=function(){return t=d6(cl(this.rgba)),e=t.h,i=t.s,a=t.l,(o=t.a)<1?"hsla("+e+", "+i+"%, "+a+"%, "+o+")":"hsl("+e+", "+i+"%, "+a+"%)";var t,e,i,a,o},n.prototype.toHsv=function(){return t=y9(this.rgba),{h:qe(t.h),s:qe(t.s),v:qe(t.v),a:qe(t.a,3)};var t},n.prototype.invert=function(){return di({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},n.prototype.saturate=function(t){return t===void 0&&(t=.1),di(Kd(this.rgba,t))},n.prototype.desaturate=function(t){return t===void 0&&(t=.1),di(Kd(this.rgba,-t))},n.prototype.grayscale=function(){return di(Kd(this.rgba,-1))},n.prototype.lighten=function(t){return t===void 0&&(t=.1),di(y6(this.rgba,t))},n.prototype.darken=function(t){return t===void 0&&(t=.1),di(y6(this.rgba,-t))},n.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},n.prototype.alpha=function(t){return typeof t=="number"?di({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):qe(this.rgba.a,3);var e},n.prototype.hue=function(t){var e=cl(this.rgba);return typeof t=="number"?di({h:t,s:e.s,l:e.l,a:e.a}):qe(e.h)},n.prototype.isEqual=function(t){return this.toHex()===di(t).toHex()},n})(),di=function(n){return n instanceof Z0?n:new Z0(n)},g6=[],DM=function(n){n.forEach(function(t){g6.indexOf(t)<0&&(t(Z0,W0),g6.push(t))})};function BM(n,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var a in e)i[e[a]]=a;var o={};n.prototype.toName=function(c){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var u,f,d=i[this.toHex()];if(d)return d;if(c?.closest){var m=this.toRgb(),y=1/0,v="black";if(!o.length)for(var x in e)o[x]=new n(e[x]).toRgb();for(var b in e){var T=(u=m,f=o[b],Math.pow(u.r-f.r,2)+Math.pow(u.g-f.g,2)+Math.pow(u.b-f.b,2));Ta===e[o]);if(t!==null&&e!==null){const a=Object.keys(t),o=Object.keys(e);return a.length!==o.length?!1:a.every(c=>t[c]===e[c])}return t===e}toRgba(){const[t,e,i,a]=this._components;return{r:t,g:e,b:i,a}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,a]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(a*255),t}toRgbArray(t){t=t??[];const[e,i,a]=this._components;return t[0]=e,t[1]=i,t[2]=a,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,i,a,o]=_u.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,this._components[2]*=a,this._components[3]*=o,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let i=this._int>>16&255,a=this._int>>8&255,o=this._int&255;return e&&(i=i*t+.5|0,a=a*t+.5|0,o=o*t+.5|0),(t*255<<24)+(i<<16)+(a<<8)+o}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,i,a]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(i*t)/t,this._components[2]=Math.round(a*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,i,a,o]=this._components;return t[0]=e,t[1]=i,t[2]=a,t[3]=o,t}normalize(t){let e,i,a,o;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const c=t;e=(c>>16&255)/255,i=(c>>8&255)/255,a=(c&255)/255,o=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,i,a,o=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,i,a,o=255]=t,e/=255,i/=255,a/=255,o/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const u=_u.HEX_PATTERN.exec(t);u&&(t=`#${u[2]}`)}const c=di(t);c.isValid()&&({r:e,g:i,b:a,a:o}=c.rgba,e/=255,i/=255,a/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,this._components[2]=a,this._components[3]=o,this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((a,o)=>{t[o]=Math.min(Math.max(a,e),i)}),t)}};ba.shared=new ba,ba.temp=new ba,ba.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Sr=ba;function IM(){const n=[],t=[];for(let i=0;i<32;i++)n[i]=i,t[i]=i;n[Ot.NORMAL_NPM]=Ot.NORMAL,n[Ot.ADD_NPM]=Ot.ADD,n[Ot.SCREEN_NPM]=Ot.SCREEN,t[Ot.NORMAL]=Ot.NORMAL_NPM,t[Ot.ADD]=Ot.ADD_NPM,t[Ot.SCREEN]=Ot.SCREEN_NPM;const e=[];return e.push(t),e.push(n),e}const FM=IM();function v9(n){if(n.BYTES_PER_ELEMENT===4)return n instanceof Float32Array?"Float32Array":n instanceof Uint32Array?"Uint32Array":"Int32Array";if(n.BYTES_PER_ELEMENT===2){if(n instanceof Uint16Array)return"Uint16Array"}else if(n.BYTES_PER_ELEMENT===1&&n instanceof Uint8Array)return"Uint8Array";return null}function Hu(n){return n+=n===0?1:0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function v6(n){return!(n&n-1)&&!!n}function b6(n){let t=(n>65535?1:0)<<4;n>>>=t;let e=(n>255?1:0)<<3;return n>>>=e,t|=e,e=(n>15?1:0)<<2,n>>>=e,t|=e,e=(n>3?1:0)<<1,n>>>=e,t|=e,t|n>>1}function Au(n,t,e){const i=n.length;let a;if(t>=i||e===0)return;e=t+e>i?i-t:e;const o=i-e;for(a=t;a(n.Renderer="renderer",n.Application="application",n.RendererSystem="renderer-webgl-system",n.RendererPlugin="renderer-webgl-plugin",n.CanvasRendererSystem="renderer-canvas-system",n.CanvasRendererPlugin="renderer-canvas-plugin",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n))(jt||{});const K0=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},T6=(n,t)=>K0(n).priority??t,ne={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map(K0).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...n){return n.map(K0).forEach(t=>{t.type.forEach(e=>{const i=this._addHandlers,a=this._queue;i[e]?i[e]?.(t):(a[e]=a[e]||[],a[e]?.push(t))})}),this},handle(n,t,e){const i=this._addHandlers,a=this._removeHandlers;if(i[n]||a[n])throw new Error(`Extension type ${n} already has a handler`);i[n]=t,a[n]=e;const o=this._queue;return o[n]&&(o[n]?.forEach(c=>t(c)),delete o[n]),this},handleByMap(n,t){return this.handle(n,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByList(n,t,e=-1){return this.handle(n,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((a,o)=>T6(o,e)-T6(a,e)))},i=>{const a=t.indexOf(i.ref);a!==-1&&t.splice(a,1)})}};class kM{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const zM=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +`);function VM(n){let t="";for(let e=0;e0&&(t+=` +else `),e=0;--i){const a=Q0[i];if(a.test&&a.test(n,e))return new a(n,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class ai{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,i,a,o,c,u,f){if(arguments.length>8)throw new Error("max arguments reached");const{name:d,items:m}=this;this._aliasCount++;for(let y=0,v=m.length;y0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(ai.prototype,{dispatch:{value:ai.prototype.emit},run:{value:ai.prototype.emit}});class xl{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new ai("setRealSize"),this.onUpdate=new ai("update"),this.onError=new ai("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class x9 extends xl{constructor(t,e){const{width:i,height:a}=e||{};if(!i||!a)throw new Error("BufferResource width or height invalid");super(i,a),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,i){const a=t.gl;a.pixelStorei(a.UNPACK_ALIGNMENT,this.unpackAlignment),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Er.UNPACK);const o=e.realWidth,c=e.realHeight;return i.width===o&&i.height===c?a.texSubImage2D(e.target,0,0,0,o,c,e.format,i.type,this.data):(i.width=o,i.height=c,a.texImage2D(e.target,0,i.internalFormat,o,c,0,e.format,i.type,this.data)),!0}dispose(){this.data=null}static test(t){return t===null||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const HM={scaleMode:$i.NEAREST,alphaMode:Er.NPM},J0=class xa extends ah{constructor(t=null,e=null){super(),e=Object.assign({},xa.defaultOptions,e);const{alphaMode:i,mipmap:a,anisotropicLevel:o,scaleMode:c,width:u,height:f,wrapMode:d,format:m,type:y,target:v,resolution:x,resourceOptions:b}=e;t&&!(t instanceof xl)&&(t=b9(t,b),t.internal=!0),this.resolution=x||$t.RESOLUTION,this.width=Math.round((u||0)*this.resolution)/this.resolution,this.height=Math.round((f||0)*this.resolution)/this.resolution,this._mipmap=a,this.anisotropicLevel=o,this._wrapMode=d,this._scaleMode=c,this.format=m,this.type=y,this.target=v,this.alphaMode=i,this.uid=bl(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=u>0&&f>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this}setSize(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)}setRealSize(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=v6(this.realWidth)&&v6(this.realHeight)}setResolution(t){const e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete As[this.cacheId],delete mi[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),xa.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,i=$t.STRICT_TEXTURE_CACHE){const a=typeof t=="string";let o=null;if(a)o=t;else{if(!t._pixiId){const u=e?.pixiIdPrefix||"pixiid";t._pixiId=`${u}_${bl()}`}o=t._pixiId}let c=As[o];if(a&&i&&!c)throw new Error(`The cacheId "${o}" does not exist in BaseTextureCache.`);return c||(c=new xa(t,e),c.cacheId=o,xa.addToCache(c,o)),c}static fromBuffer(t,e,i,a){t=t||new Float32Array(e*i*4);const o=new x9(t,{width:e,height:i,...a?.resourceOptions});let c,u;return t instanceof Float32Array?(c=yt.RGBA,u=Ht.FLOAT):t instanceof Int32Array?(c=yt.RGBA_INTEGER,u=Ht.INT):t instanceof Uint32Array?(c=yt.RGBA_INTEGER,u=Ht.UNSIGNED_INT):t instanceof Int16Array?(c=yt.RGBA_INTEGER,u=Ht.SHORT):t instanceof Uint16Array?(c=yt.RGBA_INTEGER,u=Ht.UNSIGNED_SHORT):t instanceof Int8Array?(c=yt.RGBA,u=Ht.BYTE):(c=yt.RGBA,u=Ht.UNSIGNED_BYTE),o.internal=!0,new xa(o,Object.assign({},HM,{type:u,format:c},a))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),As[e]&&As[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),As[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=As[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete As[t],e}}else if(t?.textureCacheIds){for(let e=0;e1){for(let y=0;y(n[n.POLY=0]="POLY",n[n.RECT=1]="RECT",n[n.CIRC=2]="CIRC",n[n.ELIP=3]="ELIP",n[n.RREC=4]="RREC",n))(C9||{});class en{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new en(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}en.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const eu=[new en,new en,new en,new en];class pe{constructor(t=0,e=0,i=0,a=0){this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(a),this.type=C9.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new pe(0,0,0,0)}clone(){return new pe(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&et.right?t.right:this.right)<=N)return!1;const D=this.yt.bottom?t.bottom:this.bottom)>D}const i=this.left,a=this.right,o=this.top,c=this.bottom;if(a<=i||c<=o)return!1;const u=eu[0].set(t.left,t.top),f=eu[1].set(t.left,t.bottom),d=eu[2].set(t.right,t.top),m=eu[3].set(t.right,t.bottom);if(d.x<=u.x||f.y<=u.y)return!1;const y=Math.sign(e.a*e.d-e.b*e.c);if(y===0||(e.apply(u,u),e.apply(f,f),e.apply(d,d),e.apply(m,m),Math.max(u.x,f.x,d.x,m.x)<=i||Math.min(u.x,f.x,d.x,m.x)>=a||Math.max(u.y,f.y,d.y,m.y)<=o||Math.min(u.y,f.y,d.y,m.y)>=c))return!1;const v=y*(f.y-u.y),x=y*(u.x-f.x),b=v*i+x*o,T=v*a+x*o,C=v*i+x*c,_=v*a+x*c;if(Math.max(b,T,C,_)<=v*u.x+x*u.y||Math.min(b,T,C,_)>=v*m.x+x*m.y)return!1;const R=y*(u.y-d.y),L=y*(d.x-u.x),P=R*i+L*o,w=R*a+L*o,F=R*i+L*c,E=R*a+L*c;return!(Math.max(P,w,F,E)<=R*u.x+L*u.y||Math.min(P,w,F,E)>=R*m.x+L*m.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),a=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=a,this.height=Math.max(o-a,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,a=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=a-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),a=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=a,this.height=o-a,this}}pe.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Ve{constructor(t=1,e=0,i=0,a=1,o=0,c=0){this.array=null,this.a=t,this.b=e,this.c=i,this.d=a,this.tx=o,this.ty=c}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,i,a,o,c){return this.a=t,this.b=e,this.c=i,this.d=a,this.tx=o,this.ty=c,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,e){e=e||new en;const i=t.x,a=t.y;return e.x=this.a*i+this.c*a+this.tx,e.y=this.b*i+this.d*a+this.ty,e}applyInverse(t,e){e=e||new en;const i=1/(this.a*this.d+this.c*-this.b),a=t.x,o=t.y;return e.x=this.d*i*a+-this.c*i*o+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*o+-this.b*i*a+(-this.ty*this.a+this.tx*this.b)*i,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),a=this.a,o=this.c,c=this.tx;return this.a=a*e-this.b*i,this.b=a*i+this.b*e,this.c=o*e-this.d*i,this.d=o*i+this.d*e,this.tx=c*e-this.ty*i,this.ty=c*i+this.ty*e,this}append(t){const e=this.a,i=this.b,a=this.c,o=this.d;return this.a=t.a*e+t.b*a,this.b=t.a*i+t.b*o,this.c=t.c*e+t.d*a,this.d=t.c*i+t.d*o,this.tx=t.tx*e+t.ty*a+this.tx,this.ty=t.tx*i+t.ty*o+this.ty,this}setTransform(t,e,i,a,o,c,u,f,d){return this.a=Math.cos(u+d)*o,this.b=Math.sin(u+d)*o,this.c=-Math.sin(u-f)*c,this.d=Math.cos(u-f)*c,this.tx=t-(i*this.a+a*this.c),this.ty=e-(i*this.b+a*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const i=this.a,a=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=a*t.a+this.d*t.c,this.d=a*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,i=this.b,a=this.c,o=this.d,c=t.pivot,u=-Math.atan2(-a,o),f=Math.atan2(i,e),d=Math.abs(u+f);return d<1e-5||Math.abs(KM-d)<1e-5?(t.rotation=f,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=u,t.skew.y=f),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(a*a+o*o),t.position.x=this.tx+(c.x*e+c.y*a),t.position.y=this.ty+(c.x*i+c.y*o),t}invert(){const t=this.a,e=this.b,i=this.c,a=this.d,o=this.tx,c=t*a-e*i;return this.a=a/c,this.b=-e/c,this.c=-i/c,this.d=t/c,this.tx=(i*this.ty-a*o)/c,this.ty=-(t*this.ty-e*o)/c,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new Ve;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new Ve}static get TEMP_MATRIX(){return new Ve}}Ve.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const or=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],lr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],cr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ur=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],t2=[],T9=[],nu=Math.sign;function tR(){for(let n=0;n<16;n++){const t=[];t2.push(t);for(let e=0;e<16;e++){const i=nu(or[n]*or[e]+cr[n]*lr[e]),a=nu(lr[n]*or[e]+ur[n]*lr[e]),o=nu(or[n]*cr[e]+cr[n]*ur[e]),c=nu(lr[n]*cr[e]+ur[n]*ur[e]);for(let u=0;u<16;u++)if(or[u]===i&&lr[u]===a&&cr[u]===o&&ur[u]===c){t.push(u);break}}}for(let n=0;n<16;n++){const t=new Ve;t.set(or[n],lr[n],cr[n],ur[n],0,0),T9.push(t)}}tR();const xe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:n=>or[n],uY:n=>lr[n],vX:n=>cr[n],vY:n=>ur[n],inv:n=>n&8?n&15:-n&7,add:(n,t)=>t2[n][t],sub:(n,t)=>t2[n][xe.inv(t)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,t)=>Math.abs(n)*2<=Math.abs(t)?t>=0?xe.S:xe.N:Math.abs(t)*2<=Math.abs(n)?n>0?xe.E:xe.W:t>0?n>0?xe.SE:xe.SW:n>0?xe.NE:xe.NW,matrixAppendRotationInv:(n,t,e=0,i=0)=>{const a=T9[xe.inv(t)];a.tx=e,a.ty=i,n.append(a)}};class Rs{constructor(t,e,i=0,a=0){this._x=i,this._y=a,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new Rs(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}Rs.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const e2=class{constructor(){this.worldTransform=new Ve,this.localTransform=new Ve,this.position=new Rs(this.onChange,this,0,0),this.scale=new Rs(this.onChange,this,1,1),this.pivot=new Rs(this.onChange,this,0,0),this.skew=new Rs(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const n=this.localTransform;this._localID!==this._currentLocalID&&(n.a=this._cx*this.scale.x,n.b=this._sx*this.scale.x,n.c=this._cy*this.scale.y,n.d=this._sy*this.scale.y,n.tx=this.position.x-(this.pivot.x*n.a+this.pivot.y*n.c),n.ty=this.position.y-(this.pivot.x*n.b+this.pivot.y*n.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(n){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==n._worldID){const e=n.worldTransform,i=this.worldTransform;i.a=t.a*e.a+t.b*e.c,i.b=t.a*e.b+t.b*e.d,i.c=t.c*e.a+t.d*e.c,i.d=t.c*e.b+t.d*e.d,i.tx=t.tx*e.a+t.ty*e.c+e.tx,i.ty=t.tx*e.b+t.ty*e.d+e.ty,this._parentID=n._worldID,this._worldID++}}setFromMatrix(n){n.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(n){this._rotation!==n&&(this._rotation=n,this.updateSkew())}};e2.IDENTITY=new e2;let em=e2;em.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var eR=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; + +void main(void){ + gl_FragColor *= texture2D(uSampler, vTextureCoord); +}`,nR=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void){ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +} +`;function _6(n,t,e){const i=n.createShader(t);return n.shaderSource(i,e),n.compileShader(i),i}function r0(n){const t=new Array(n);for(let e=0;en.type==="float"&&n.size===1&&!n.isArray,code:n=>` + if(uv["${n}"] !== ud["${n}"].value) + { + ud["${n}"].value = uv["${n}"] + gl.uniform1f(ud["${n}"].location, uv["${n}"]) + } + `},{test:(n,t)=>(n.type==="sampler2D"||n.type==="samplerCube"||n.type==="sampler2DArray")&&n.size===1&&!n.isArray&&(t==null||t.castToBaseTexture!==void 0),code:n=>`t = syncData.textureCount++; + + renderer.texture.bind(uv["${n}"], t); + + if(ud["${n}"].value !== t) + { + ud["${n}"].value = t; + gl.uniform1i(ud["${n}"].location, t); +; // eslint-disable-line max-len + }`},{test:(n,t)=>n.type==="mat3"&&n.size===1&&!n.isArray&&t.a!==void 0,code:n=>` + gl.uniformMatrix3fv(ud["${n}"].location, false, uv["${n}"].toArray(true)); + `,codeUbo:n=>` + var ${n}_matrix = uv.${n}.toArray(true); + + data[offset] = ${n}_matrix[0]; + data[offset+1] = ${n}_matrix[1]; + data[offset+2] = ${n}_matrix[2]; + + data[offset + 4] = ${n}_matrix[3]; + data[offset + 5] = ${n}_matrix[4]; + data[offset + 6] = ${n}_matrix[5]; + + data[offset + 8] = ${n}_matrix[6]; + data[offset + 9] = ${n}_matrix[7]; + data[offset + 10] = ${n}_matrix[8]; + `},{test:(n,t)=>n.type==="vec2"&&n.size===1&&!n.isArray&&t.x!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.x || cv[1] !== v.y) + { + cv[0] = v.x; + cv[1] = v.y; + gl.uniform2f(ud["${n}"].location, v.x, v.y); + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.x; + data[offset+1] = v.y; + `},{test:n=>n.type==="vec2"&&n.size===1&&!n.isArray,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + gl.uniform2f(ud["${n}"].location, v[0], v[1]); + } + `},{test:(n,t)=>n.type==="vec4"&&n.size===1&&!n.isArray&&t.width!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) + { + cv[0] = v.x; + cv[1] = v.y; + cv[2] = v.width; + cv[3] = v.height; + gl.uniform4f(ud["${n}"].location, v.x, v.y, v.width, v.height) + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.x; + data[offset+1] = v.y; + data[offset+2] = v.width; + data[offset+3] = v.height; + `},{test:(n,t)=>n.type==="vec4"&&n.size===1&&!n.isArray&&t.red!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + cv[3] = v.alpha; + gl.uniform4f(ud["${n}"].location, v.red, v.green, v.blue, v.alpha) + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + data[offset+3] = v.alpha; + `},{test:(n,t)=>n.type==="vec3"&&n.size===1&&!n.isArray&&t.red!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + + gl.uniform3f(ud["${n}"].location, v.red, v.green, v.blue) + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + `},{test:n=>n.type==="vec4"&&n.size===1&&!n.isArray,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(ud["${n}"].location, v[0], v[1], v[2], v[3]) + }`}],iR={float:` + if (cv !== v) + { + cu.value = v; + gl.uniform1f(location, v); + }`,vec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2f(location, v[0], v[1]) + }`,vec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3f(location, v[0], v[1], v[2]) + }`,vec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(location, v[0], v[1], v[2], v[3]); + }`,int:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,ivec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,ivec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,ivec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,uint:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1ui(location, v); + }`,uvec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2ui(location, v[0], v[1]); + }`,uvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3ui(location, v[0], v[1], v[2]); + }`,uvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4ui(location, v[0], v[1], v[2], v[3]); + }`,bool:` + if (cv !== v) + { + cu.value = v; + gl.uniform1i(location, v); + }`,bvec2:` + if (cv[0] != v[0] || cv[1] != v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,bvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,bvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,samplerCube:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,sampler2DArray:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`},sR={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function rR(n,t){const e=[` + var v = null; + var cv = null; + var cu = null; + var t = 0; + var gl = renderer.gl; + `];for(const i in n.uniforms){const a=t[i];if(!a){n.uniforms[i]?.group===!0&&(n.uniforms[i].ubo?e.push(` + renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}'); + `):e.push(` + renderer.shader.syncUniformGroup(uv.${i}, syncData); + `));continue}const o=n.uniforms[i];let c=!1;for(let u=0;u=Ar.WEBGL2&&(t=n.getContext("webgl2",{})),t||(t=n.getContext("webgl",{})||n.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),iu=t}return iu}let su;function oR(){if(!su){su=Hn.MEDIUM;const n=aR();if(n&&n.getShaderPrecisionFormat){const t=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT);t&&(su=t.precision?Hn.HIGH:Hn.MEDIUM)}}return su}function A6(n,t){const e=n.getShaderSource(t).split(` +`).map((d,m)=>`${m}: ${d}`),i=n.getShaderInfoLog(t),a=i.split(` +`),o={},c=a.map(d=>parseFloat(d.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(d=>d&&!o[d]?(o[d]=!0,!0):!1),u=[""];c.forEach(d=>{e[d-1]=`%c${e[d-1]}%c`,u.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const f=e.join(` +`);u[0]=f,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...u),console.groupEnd()}function lR(n,t,e,i){n.getProgramParameter(t,n.LINK_STATUS)||(n.getShaderParameter(e,n.COMPILE_STATUS)||A6(n,e),n.getShaderParameter(i,n.COMPILE_STATUS)||A6(n,i),console.error("PixiJS Error: Could not initialize shader."),n.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(t)))}const cR={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function A9(n){return cR[n]}let ru=null;const E6={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function E9(n,t){if(!ru){const e=Object.keys(E6);ru={};for(let i=0;i0&&(e+=` +else `),ithis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,i=ni._textureArrayPool,a=this.renderer.batch,o=this._tempBoundTextures,c=this.renderer.textureGC.count;let u=++fe._globalBatch,f=0,d=i[0],m=0;a.copyBoundTextures(o,e);for(let y=0;y=e&&(a.boundArray(d,o,u,e),this.buildDrawCalls(d,m,y),m=y,d=i[++f],++u),v._batchEnabled=u,v.touched=c,d.elements[d.count++]=v)}d.count>0&&(a.boundArray(d,o,u,e),this.buildDrawCalls(d,m,this._bufferSize),++f,++u);for(let y=0;y0);for(let T=0;T=0;--a)t[a]=i[a]||null,t[a]&&(t[a]._batchLocation=a)}boundArray(t,e,i,a){const{elements:o,ids:c,count:u}=t;let f=0;for(let d=0;d=0&&y=Ar.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const a=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=a,a||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Xu.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Xu.extension={type:jt.RendererSystem,name:"context"};ne.add(Xu);class s2{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new ai("disposeFramebuffer"),this.multisample=Pe.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new fe(null,{scaleMode:$i.NEAREST,resolution:1,mipmap:Tr.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new fe(null,{scaleMode:$i.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Tr.OFF,format:yt.DEPTH_COMPONENT,type:Ht.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let i=0;i{const a=this.source;this.url=a.src;const o=()=>{this.destroyed||(a.onload=null,a.onerror=null,this.update(),this._load=null,this.createBitmap?e(this.process()):e(this))};a.complete&&a.src?o():(a.onload=o,a.onerror=c=>{i(c),this.onError.emit(c)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,i=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:i?"cors":"no-cors"}).then(a=>a.blob()).then(a=>e(a,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Er.UNPACK?"premultiply":"none"})).then(a=>this.destroyed?Promise.reject():(this.bitmap=a,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,e,i){if(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,i,this.bitmap),!this.preserveBitmap){let a=!0;const o=e._glTextures;for(const c in o){const u=o[c];if(u!==i&&u.dirtyId!==e.dirtyId){a=!1;break}}a&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class nm{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,i){const a=e.width,o=e.height;if(i){const c=t.width/2/a,u=t.height/2/o,f=t.x/a+c,d=t.y/o+u;i=xe.add(i,xe.NW),this.x0=f+c*xe.uX(i),this.y0=d+u*xe.uY(i),i=xe.add(i,2),this.x1=f+c*xe.uX(i),this.y1=d+u*xe.uY(i),i=xe.add(i,2),this.x2=f+c*xe.uX(i),this.y2=d+u*xe.uY(i),i=xe.add(i,2),this.x3=f+c*xe.uX(i),this.y3=d+u*xe.uY(i)}else this.x0=t.x/a,this.y0=t.y/o,this.x1=(t.x+t.width)/a,this.y1=t.y/o,this.x2=(t.x+t.width)/a,this.y2=(t.y+t.height)/o,this.x3=t.x/a,this.y3=(t.y+t.height)/o;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}nm.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const R6=new nm;function ou(n){n.destroy=function(){},n.on=function(){},n.once=function(){},n.emit=function(){}}class Qt extends ah{constructor(t,e,i,a,o,c,u){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new pe(0,0,1,1)),t instanceof Qt&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=a,this.valid=!1,this.destroyed=!1,this._uvs=R6,this.uvMatrix=null,this.orig=i||e,this._rotate=Number(o||0),o===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=c?new en(c.x,c.y):new en(0,0),this.defaultBorders=u,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:e}=this.baseTexture;e?.url&&mi[e.url]&&Qt.removeFromCache(e.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Qt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),i=new Qt(this.baseTexture,!this.noFrame&&t,e,this.trim?.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=t),i}updateUvs(){this._uvs===R6&&(this._uvs=new nm),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},i=$t.STRICT_TEXTURE_CACHE){const a=typeof t=="string";let o=null;if(a)o=t;else if(t instanceof fe){if(!t.cacheId){const u=e?.pixiIdPrefix||"pixiid";t.cacheId=`${u}-${bl()}`,fe.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){const u=e?.pixiIdPrefix||"pixiid";t._pixiId=`${u}_${bl()}`}o=t._pixiId}let c=mi[o];if(a&&i&&!c)throw new Error(`The cacheId "${o}" does not exist in TextureCache.`);return!c&&!(t instanceof fe)?(e.resolution||(e.resolution=C6(t)),c=new Qt(new fe(t,e)),c.baseTexture.cacheId=o,fe.addToCache(c.baseTexture,o),Qt.addToCache(c,o)):!c&&t instanceof fe&&(c=new Qt(t),Qt.addToCache(c,o)),c}static fromURL(t,e){const i=Object.assign({autoLoad:!1},e?.resourceOptions),a=Qt.from(t,Object.assign({resourceOptions:i},e),!1),o=a.baseTexture.resource;return a.baseTexture.valid?Promise.resolve(a):o.load().then(()=>Promise.resolve(a))}static fromBuffer(t,e,i,a){return new Qt(fe.fromBuffer(t,e,i,a))}static fromLoader(t,e,i,a){const o=new fe(t,Object.assign({scaleMode:fe.defaultOptions.scaleMode,resolution:C6(e)},a)),{resource:c}=o;c instanceof L9&&(c.url=e);const u=new Qt(o);return i||(i=e),fe.addToCache(u.baseTexture,i),Qt.addToCache(u,i),i!==e&&(fe.addToCache(u.baseTexture,e),Qt.addToCache(u,e)),u.baseTexture.valid?Promise.resolve(u):new Promise(f=>{u.baseTexture.once("loaded",()=>f(u))})}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),mi[e]&&mi[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),mi[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=mi[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete mi[t],e}}else if(t?.textureCacheIds){for(let e=0;ethis.baseTexture.width,u=i+o>this.baseTexture.height;if(c||u){const f=c&&u?"and":"or",d=`X: ${e} + ${a} = ${e+a} > ${this.baseTexture.width}`,m=`Y: ${i} + ${o} = ${i+o} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${d} ${f} ${m}`)}this.valid=a&&o&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Qt._EMPTY||(Qt._EMPTY=new Qt(new fe),ou(Qt._EMPTY),ou(Qt._EMPTY.baseTexture)),Qt._EMPTY}static get WHITE(){if(!Qt._WHITE){const t=$t.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),Qt._WHITE=new Qt(fe.from(t)),ou(Qt._WHITE),ou(Qt._WHITE.baseTexture)}return Qt._WHITE}}class uh extends Qt{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,i=!0){const a=this.baseTexture.resolution,o=Math.round(t*a)/a,c=Math.round(e*a)/a;this.valid=o>0&&c>0,this._frame.width=this.orig.width=o,this._frame.height=this.orig.height=c,i&&this.baseTexture.resize(o,c),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new uh(new R9(t))}}class O9{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,i=Pe.NONE){const a=new R9(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new uh(a)}getOptimalTexture(t,e,i=1,a=Pe.NONE){let o;t=Math.max(Math.ceil(t*i-1e-6),1),e=Math.max(Math.ceil(e*i-1e-6),1),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=Hu(t),e=Hu(e),o=((t&65535)<<16|e&65535)>>>0,a>1&&(o+=a*4294967296)):o=a>1?-a:-1,this.texturePool[o]||(this.texturePool[o]=[]);let c=this.texturePool[o].pop();return c||(c=this.createTexture(t,e,a)),c.filterPoolKey=o,c.setResolution(i),c}getFilterTexture(t,e,i){const a=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||Pe.NONE);return a.filterFrame=t.filterFrame,a}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const e in this.texturePool){const i=this.texturePool[e];if(i)for(let a=0;a0&&t.height>0;for(const e in this.texturePool){if(!(Number(e)<0))continue;const i=this.texturePool[e];if(i)for(let a=0;a1&&(m=this.getOptimalFilterTexture(d.width,d.height,e.resolution),m.filterFrame=d.filterFrame),i[y].apply(this,d,m,gi.CLEAR,e);const v=d;d=m,m=v}i[y].apply(this,d,f.renderTexture,gi.BLEND,e),y>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(d),this.returnFilterTexture(m)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=gi.CLEAR){const{renderTexture:i,state:a}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t?.filterFrame){const c=this.tempRect;c.x=0,c.y=0,c.width=t.filterFrame.width,c.height=t.filterFrame.height,i.bind(t,t.filterFrame,c)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const o=a.stateId&1||this.forceClear;(e===gi.CLEAR||e===gi.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,i,a){const o=this.renderer;o.state.set(t.state),this.bindAndClear(i,a),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(Gu.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(Gu.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:i,destinationFrame:a}=this.activeState,{orig:o}=e._texture,c=t.set(a.width,0,0,a.height,i.x,i.y),u=e.worldTransform.copyTo(Ve.TEMP_MATRIX);return u.invert(),c.prepend(u),c.scale(1/o.width,1/o.height),c.translate(e.anchor.x,e.anchor.y),c}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,i=1,a=Pe.NONE){return this.texturePool.getOptimalTexture(t,e,i,a)}getFilterTexture(t,e,i){if(typeof t=="number"){const o=t;t=e,e=o}t=t||this.activeState.renderTexture;const a=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||Pe.NONE);return a.filterFrame=t.filterFrame,a}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const i=lu[0],a=lu[1],o=lu[2],c=lu[3];i.set(e.left,e.top),a.set(e.left,e.bottom),o.set(e.right,e.top),c.set(e.right,e.bottom),t.apply(i,i),t.apply(a,a),t.apply(o,o),t.apply(c,c);const u=Math.min(i.x,a.x,o.x,c.x),f=Math.min(i.y,a.y,o.y,c.y),d=Math.max(i.x,a.x,o.x,c.x),m=Math.max(i.y,a.y,o.y,c.y);e.x=u,e.y=f,e.width=d-u,e.height=m-f}roundFrame(t,e,i,a,o){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(o){const{a:c,b:u,c:f,d}=o;if((Math.abs(u)>1e-4||Math.abs(f)>1e-4)&&(Math.abs(c)>1e-4||Math.abs(d)>1e-4))return}o=o?a0.copyFrom(o):a0.identity(),o.translate(-i.x,-i.y).scale(a.width/i.width,a.height/i.height).translate(a.x,a.y),this.transformAABB(o,t),t.ceil(e),this.transformAABB(o.invert(),t)}}}N9.extension={type:jt.RendererSystem,name:"filter"};ne.add(N9);class _R{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Pe.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const AR=new pe;class D9{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new s2(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new pe,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;$t.PREFER_ENV===Ar.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=a=>e.drawBuffersWEBGL(a):(this.hasMRT=!1,t.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,i=0){const{gl:a}=this;if(t){const o=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,a.bindFramebuffer(a.FRAMEBUFFER,o.framebuffer)),o.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,o.mipLevel=i),o.dirtyId!==t.dirtyId&&(o.dirtyId=t.dirtyId,o.dirtyFormat!==t.dirtyFormat?(o.dirtyFormat=t.dirtyFormat,o.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):o.dirtySize!==t.dirtySize&&(o.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let c=0;c>i,u=e.height>>i,f=c/e.width;this.setViewport(e.x*f,e.y*f,c,u)}else{const c=t.width>>i,u=t.height>>i;this.setViewport(0,0,c,u)}}else this.current&&(this.current=null,a.bindFramebuffer(a.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,i,a){const o=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),a=Math.round(a),(o.width!==i||o.height!==a||o.x!==t||o.y!==e)&&(o.x=t,o.y=e,o.width=i,o.height=a,this.gl.viewport(t,e,i,a))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,i,a,o=$0.COLOR|$0.DEPTH){const{gl:c}=this;c.clearColor(t,e,i,a),c.clear(o)}initFramebuffer(t){const{gl:e}=this,i=new _R(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i}resizeFramebuffer(t){const{gl:e}=this,i=t.glFramebuffers[this.CONTEXT_UID];if(i.stencil){e.bindRenderbuffer(e.RENDERBUFFER,i.stencil);let c;this.renderer.context.webGLVersion===1?c=e.DEPTH_STENCIL:t.depth&&t.stencil?c=e.DEPTH24_STENCIL8:t.depth?c=e.DEPTH_COMPONENT24:c=e.STENCIL_INDEX8,i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,c,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,c,t.width,t.height)}const a=t.colorTextures;let o=a.length;e.drawBuffers||(o=Math.min(o,1));for(let c=0;c1&&this.canMultisampleFramebuffer(t)?a.msaaBuffer=a.msaaBuffer||i.createRenderbuffer():a.msaaBuffer&&(i.deleteRenderbuffer(a.msaaBuffer),a.msaaBuffer=null,a.blitFramebuffer&&(a.blitFramebuffer.dispose(),a.blitFramebuffer=null));const u=[];for(let f=0;f1&&i.drawBuffers(u),t.depthTexture&&this.writeDepthTexture){const f=t.depthTexture;this.renderer.texture.bind(f,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,f._glTextures[this.CONTEXT_UID].texture,e)}if((t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)){a.stencil=a.stencil||i.createRenderbuffer();let f,d;this.renderer.context.webGLVersion===1?(f=i.DEPTH_STENCIL_ATTACHMENT,d=i.DEPTH_STENCIL):t.depth&&t.stencil?(f=i.DEPTH_STENCIL_ATTACHMENT,d=i.DEPTH24_STENCIL8):t.depth?(f=i.DEPTH_ATTACHMENT,d=i.DEPTH_COMPONENT24):(f=i.STENCIL_ATTACHMENT,d=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,a.stencil),a.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,a.multisample,d,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,d,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,f,i.RENDERBUFFER,a.stencil)}else a.stencil&&(i.deleteRenderbuffer(a.stencil),a.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let i=Pe.NONE;if(t<=1||e===null)return i;for(let a=0;a=0&&this.managedFramebuffers.splice(o,1),t.disposeRunner.remove(this),e||(a.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&a.deleteRenderbuffer(i.msaaBuffer),i.stencil&&a.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;ii.createVertexArrayOES(),t.bindVertexArray=a=>i.bindVertexArrayOES(a),t.deleteVertexArray=a=>i.deleteVertexArrayOES(a)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(e.webGLVersion!==2){const i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=(a,o)=>i.vertexAttribDivisorANGLE(a,o),t.drawElementsInstanced=(a,o,c,u,f)=>i.drawElementsInstancedANGLE(a,o,c,u,f),t.drawArraysInstanced=(a,o,c,u)=>i.drawArraysInstancedANGLE(a,o,c,u)):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:i}=this;let a=t.glVertexArrayObjects[this.CONTEXT_UID],o=!1;a||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=a={},o=!0);const c=a[e.program.id]||this.initGeometryVao(t,e,o);this._activeGeometry=t,this._activeVao!==c&&(this._activeVao=c,this.hasVao?i.bindVertexArray(c):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let i=0;i"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){e===void 0&&(e=t);const i=this.mapCoord;for(let a=0;a0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}I9.extension={type:jt.RendererSystem,name:"mask"};ne.add(I9);class F9{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,i=this.getStackLength();this.maskStack=t;const a=this.getStackLength();a!==i&&(a===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const O6=new Ve,N6=[],P9=class Eu extends F9{constructor(t){super(t),this.glConst=$t.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:i}=t,{renderer:a}=this,o=a.renderTexture,c=i.getBounds(!0,N6.pop()??new pe);this.roundFrameToPixels(c,o.current?o.current.resolution:a.resolution,o.sourceFrame,o.destinationFrame,a.projection.transform),e&&c.fit(e),t._scissorRectLocal=c}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:i,c:a,d:o}=t;return(Math.abs(i)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(o)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||Eu.isMatrixRotated(e.worldTransform)||Eu.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const i=t._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(t,e,i,a,o){Eu.isMatrixRotated(o)||(o=o?O6.copyFrom(o):O6.identity(),o.translate(-i.x,-i.y).scale(a.width/i.width,a.height/i.height).translate(a.x,a.y),this.renderer.filter.transformAABB(o,t),t.fit(a),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&N6.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;this.renderer.renderTexture.current?e=t.y:e=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};P9.extension={type:jt.RendererSystem,name:"scissor"};let OR=P9;ne.add(OR);class U9 extends F9{constructor(t){super(t),this.glConst=$t.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:i}=this.renderer,a=t._stencilCounter;a===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;const o=t._colorMask;o!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,a,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,o!==0&&(t._colorMask=o,i.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&8)!==0)),this._useCurrent()}pop(t){const e=this.renderer.gl;if(this.getStackLength()===0)e.disable(e.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,a=i?i._colorMask:15;a!==0&&(i._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,a!==0&&(i._colorMask=a,e.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}U9.extension={type:jt.RendererSystem,name:"stencil"};ne.add(U9);class k9{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return oe("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return oe("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return oe("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}k9.extension={type:[jt.RendererSystem,jt.CanvasRendererSystem],name:"_plugin"};ne.add(k9);class z9{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ve,this.transform=null}update(t,e,i,a){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,a),this.transform&&this.projectionMatrix.append(this.transform);const o=this.renderer;o.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,o.globalUniforms.update(),o.shader.shader&&o.shader.syncUniformGroup(o.shader.shader.uniforms.globals)}calculateProjection(t,e,i,a){const o=this.projectionMatrix,c=a?-1:1;o.identity(),o.a=1/e.width*2,o.d=c*(1/e.height*2),o.tx=-1-e.x*o.a,o.ty=-c-e.y*o.d}setTransform(t){}destroy(){this.renderer=null}}z9.extension={type:jt.RendererSystem,name:"projection"};ne.add(z9);const NR=new em,D6=new pe;class V9{constructor(t){this.renderer=t,this._tempMatrix=new Ve}generateTexture(t,e){const{region:i,...a}=e||{},o=i?.copyTo(D6)||t.getLocalBounds(D6,!0),c=a.resolution||this.renderer.resolution;o.width=Math.max(o.width,1/c),o.height=Math.max(o.height,1/c),a.width=o.width,a.height=o.height,a.resolution=c,a.multisample??(a.multisample=this.renderer.multisample);const u=uh.create(a);this._tempMatrix.tx=-o.x,this._tempMatrix.ty=-o.y;const f=t.transform;return t.transform=NR,this.renderer.render(t,{renderTexture:u,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=f,u}destroy(){}}V9.extension={type:[jt.RendererSystem,jt.CanvasRendererSystem],name:"textureGenerator"};ne.add(V9);const sr=new pe,jo=new pe;class G9{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new pe,this.destinationFrame=new pe,this.viewportFrame=new pe}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,i){const a=this.renderer;this.current=t;let o,c,u;t?(o=t.baseTexture,u=o.resolution,e||(sr.width=t.frame.width,sr.height=t.frame.height,e=sr),i||(jo.x=t.frame.x,jo.y=t.frame.y,jo.width=e.width,jo.height=e.height,i=jo),c=o.framebuffer):(u=a.resolution,e||(sr.width=a._view.screen.width,sr.height=a._view.screen.height,e=sr),i||(i=sr,i.width=e.width,i.height=e.height));const f=this.viewportFrame;f.x=i.x*u,f.y=i.y*u,f.width=i.width*u,f.height=i.height*u,t||(f.y=a.view.height-(f.y+f.height)),f.ceil(),this.renderer.framebuffer.bind(c,f),this.renderer.projection.update(i,e,u,!c),t?this.renderer.mask.setMaskStack(o.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)}clear(t,e){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,a=Sr.shared.setValue(t||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&a.premultiply(a.alpha);const o=this.destinationFrame,c=this.current?this.current.baseTexture:this.renderer._view.screen,u=o.width!==c.width||o.height!==c.height;if(u){let{x:f,y:d,width:m,height:y}=this.viewportFrame;f=Math.round(f),d=Math.round(d),m=Math.round(m),y=Math.round(y),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(f,d,m,y)}this.renderer.framebuffer.clear(a.red,a.green,a.blue,a.alpha,e),u&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}G9.extension={type:jt.RendererSystem,name:"renderTexture"};ne.add(G9);let DR=class{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}};function BR(n,t){const e={},i=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES);for(let a=0;af>d?1:-1);for(let f=0;f({data:o,offset:0,dataLen:0,dirty:0}));let e=0,i=0,a=0;for(let o=0;o1&&(e=Math.max(e,16)*c.data.size),c.dataLen=e,i%e!==0&&i<16){const u=i%e%16;i+=u,a+=u}i+e>16?(a=Math.ceil(a/16)*16,c.offset=a,a+=e,i=e):(c.offset=a,i+=e,a+=e)}return a=Math.ceil(a/16)*16,{uboElements:t,size:a}}function zR(n,t){const e=[];for(const i in n)t[i]&&e.push(t[i]);return e.sort((i,a)=>i.index-a.index),e}function VR(n,t){if(!n.autoManage)return{size:0,syncFunc:PR};const e=zR(n.uniforms,t),{uboElements:i,size:a}=kR(e),o=[` + var v = null; + var v2 = null; + var cv = null; + var t = 0; + var gl = renderer.gl + var index = 0; + var data = buffer.data; + `];for(let c=0;c1){const y=A9(u.data.type),v=Math.max(H9[u.data.type]/16,1),x=y/v,b=(4-x%4)%4;o.push(` + cv = ud.${d}.value; + v = uv.${d}; + offset = ${u.offset/4}; + + t = 0; + + for(var i=0; i < ${u.data.size*v}; i++) + { + for(var j = 0; j < ${x}; j++) + { + data[offset++] = v[t++]; + } + offset += ${b}; + } + + `)}else{const y=UR[u.data.type];o.push(` + cv = ud.${d}.value; + v = uv.${d}; + offset = ${u.offset/4}; + ${y}; + `)}}return o.push(` + renderer.buffer.update(buffer); + `),{size:a,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join(` +`))}}let GR=0;const cu={textureCount:0,uboCount:0};class j9{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=GR++}systemCheck(){if(!uR())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const i=t.program,a=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(a.program)),e||(cu.textureCount=0,cu.uboCount=0,this.syncUniformGroup(t.uniformGroup,cu)),a}setUniforms(t){const e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)}syncUniformGroup(t,e){const i=this.getGlProgram();(!t.static||t.dirtyId!==i.uniformDirtyGroups[t.id])&&(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))}syncUniforms(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=rR(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const i=this.getGlProgram();if(!t.static||t.dirtyId!==0||!i.uniformGroups[t.id]){t.dirtyId=0;const a=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),a(i.uniformData,t.uniforms,this.renderer,cu,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])}createSyncBufferGroup(t,e,i){const{gl:a}=this.renderer;this.renderer.buffer.bind(t.buffer);const o=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,a.uniformBlockBinding(e.program,o,this.shader.uniformBindCount),this.shader.uniformBindCount++;const c=this.getSignature(t,this.shader.program.uniformData,"ubo");let u=this._uboCache[c];if(u||(u=this._uboCache[c]=VR(t,this.shader.program.uniformData)),t.autoManage){const f=new Float32Array(u.size/4);t.buffer.update(f)}return e.uniformGroups[t.id]=u.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,i){const a=t.uniforms,o=[`${i}-`];for(const c in a)o.push(c),e[c]&&o.push(e[c].type);return o.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,i=t.program,a=FR(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=a,a}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}j9.extension={type:jt.RendererSystem,name:"shader"};ne.add(j9);class Yu{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.3 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}Yu.defaultOptions={hello:!1},Yu.extension={type:[jt.RendererSystem,jt.CanvasRendererSystem],name:"startup"};ne.add(Yu);function HR(n,t=[]){return t[Ot.NORMAL]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.ADD]=[n.ONE,n.ONE],t[Ot.MULTIPLY]=[n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.SCREEN]=[n.ONE,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.OVERLAY]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.DARKEN]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.LIGHTEN]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.COLOR_DODGE]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.COLOR_BURN]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.HARD_LIGHT]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.SOFT_LIGHT]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.DIFFERENCE]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.EXCLUSION]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.HUE]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.SATURATION]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.COLOR]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.LUMINOSITY]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.NONE]=[0,0],t[Ot.NORMAL_NPM]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.ADD_NPM]=[n.SRC_ALPHA,n.ONE,n.ONE,n.ONE],t[Ot.SCREEN_NPM]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],t[Ot.SRC_IN]=[n.DST_ALPHA,n.ZERO],t[Ot.SRC_OUT]=[n.ONE_MINUS_DST_ALPHA,n.ZERO],t[Ot.SRC_ATOP]=[n.DST_ALPHA,n.ONE_MINUS_SRC_ALPHA],t[Ot.DST_OVER]=[n.ONE_MINUS_DST_ALPHA,n.ONE],t[Ot.DST_IN]=[n.ZERO,n.SRC_ALPHA],t[Ot.DST_OUT]=[n.ZERO,n.ONE_MINUS_SRC_ALPHA],t[Ot.DST_ATOP]=[n.ONE_MINUS_DST_ALPHA,n.SRC_ALPHA],t[Ot.XOR]=[n.ONE_MINUS_DST_ALPHA,n.ONE_MINUS_SRC_ALPHA],t[Ot.SUBTRACT]=[n.ONE,n.ONE,n.ONE,n.ONE,n.FUNC_REVERSE_SUBTRACT,n.FUNC_ADD],t}const jR=0,qR=1,XR=2,YR=3,$R=4,WR=5,q9=class r2{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=Ot.NONE,this._blendEq=!1,this.map=[],this.map[jR]=this.setBlend,this.map[qR]=this.setOffset,this.map[XR]=this.setCullFace,this.map[YR]=this.setDepthTest,this.map[$R]=this.setFrontFace,this.map[WR]=this.setDepthMask,this.checks=[],this.defaultState=new Va,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=HR(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<>1,i++;this.stateId=t.data}for(let e=0;et.systems[a]),i=[...e,...Object.keys(t.systems).filter(a=>!e.includes(a))];for(const a of i)this.addSystem(t.systems[a],a)}addRunners(...t){t.forEach(e=>{this.runners[e]=new ai(e)})}addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const a in this.runners)this.runners[a].add(i);return this}emitWithCustomOptions(t,e){const i=Object.keys(this._systemsHash);t.items.forEach(a=>{const o=i.find(c=>this._systemsHash[c]===a);a[t.name](e[o])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const el=class wu{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=wu.defaultMaxIdle,this.checkCountMax=wu.defaultCheckCountMax,this.mode=wu.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==K2.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let i=!1;for(let a=0;athis.maxIdle&&(t.destroyTexture(o,!0),e[a]=null,i=!0)}if(i){let a=0;for(let o=0;o=0;a--)this.unload(t.children[a])}destroy(){this.renderer=null}};el.defaultMode=K2.AUTO,el.defaultMaxIdle=3600,el.defaultCheckCountMax=600,el.extension={type:jt.RendererSystem,name:"textureGC"};let fr=el;ne.add(fr);let l0=class{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=Ht.UNSIGNED_BYTE,this.internalFormat=yt.RGBA,this.samplerType=0}};function QR(n){let t;return"WebGL2RenderingContext"in globalThis&&n instanceof globalThis.WebGL2RenderingContext?t={[n.RGB]:vt.FLOAT,[n.RGBA]:vt.FLOAT,[n.ALPHA]:vt.FLOAT,[n.LUMINANCE]:vt.FLOAT,[n.LUMINANCE_ALPHA]:vt.FLOAT,[n.R8]:vt.FLOAT,[n.R8_SNORM]:vt.FLOAT,[n.RG8]:vt.FLOAT,[n.RG8_SNORM]:vt.FLOAT,[n.RGB8]:vt.FLOAT,[n.RGB8_SNORM]:vt.FLOAT,[n.RGB565]:vt.FLOAT,[n.RGBA4]:vt.FLOAT,[n.RGB5_A1]:vt.FLOAT,[n.RGBA8]:vt.FLOAT,[n.RGBA8_SNORM]:vt.FLOAT,[n.RGB10_A2]:vt.FLOAT,[n.RGB10_A2UI]:vt.FLOAT,[n.SRGB8]:vt.FLOAT,[n.SRGB8_ALPHA8]:vt.FLOAT,[n.R16F]:vt.FLOAT,[n.RG16F]:vt.FLOAT,[n.RGB16F]:vt.FLOAT,[n.RGBA16F]:vt.FLOAT,[n.R32F]:vt.FLOAT,[n.RG32F]:vt.FLOAT,[n.RGB32F]:vt.FLOAT,[n.RGBA32F]:vt.FLOAT,[n.R11F_G11F_B10F]:vt.FLOAT,[n.RGB9_E5]:vt.FLOAT,[n.R8I]:vt.INT,[n.R8UI]:vt.UINT,[n.R16I]:vt.INT,[n.R16UI]:vt.UINT,[n.R32I]:vt.INT,[n.R32UI]:vt.UINT,[n.RG8I]:vt.INT,[n.RG8UI]:vt.UINT,[n.RG16I]:vt.INT,[n.RG16UI]:vt.UINT,[n.RG32I]:vt.INT,[n.RG32UI]:vt.UINT,[n.RGB8I]:vt.INT,[n.RGB8UI]:vt.UINT,[n.RGB16I]:vt.INT,[n.RGB16UI]:vt.UINT,[n.RGB32I]:vt.INT,[n.RGB32UI]:vt.UINT,[n.RGBA8I]:vt.INT,[n.RGBA8UI]:vt.UINT,[n.RGBA16I]:vt.INT,[n.RGBA16UI]:vt.UINT,[n.RGBA32I]:vt.INT,[n.RGBA32UI]:vt.UINT,[n.DEPTH_COMPONENT16]:vt.FLOAT,[n.DEPTH_COMPONENT24]:vt.FLOAT,[n.DEPTH_COMPONENT32F]:vt.FLOAT,[n.DEPTH_STENCIL]:vt.FLOAT,[n.DEPTH24_STENCIL8]:vt.FLOAT,[n.DEPTH32F_STENCIL8]:vt.FLOAT}:t={[n.RGB]:vt.FLOAT,[n.RGBA]:vt.FLOAT,[n.ALPHA]:vt.FLOAT,[n.LUMINANCE]:vt.FLOAT,[n.LUMINANCE_ALPHA]:vt.FLOAT,[n.DEPTH_STENCIL]:vt.FLOAT},t}function JR(n){let t;return"WebGL2RenderingContext"in globalThis&&n instanceof globalThis.WebGL2RenderingContext?t={[Ht.UNSIGNED_BYTE]:{[yt.RGBA]:n.RGBA8,[yt.RGB]:n.RGB8,[yt.RG]:n.RG8,[yt.RED]:n.R8,[yt.RGBA_INTEGER]:n.RGBA8UI,[yt.RGB_INTEGER]:n.RGB8UI,[yt.RG_INTEGER]:n.RG8UI,[yt.RED_INTEGER]:n.R8UI,[yt.ALPHA]:n.ALPHA,[yt.LUMINANCE]:n.LUMINANCE,[yt.LUMINANCE_ALPHA]:n.LUMINANCE_ALPHA},[Ht.BYTE]:{[yt.RGBA]:n.RGBA8_SNORM,[yt.RGB]:n.RGB8_SNORM,[yt.RG]:n.RG8_SNORM,[yt.RED]:n.R8_SNORM,[yt.RGBA_INTEGER]:n.RGBA8I,[yt.RGB_INTEGER]:n.RGB8I,[yt.RG_INTEGER]:n.RG8I,[yt.RED_INTEGER]:n.R8I},[Ht.UNSIGNED_SHORT]:{[yt.RGBA_INTEGER]:n.RGBA16UI,[yt.RGB_INTEGER]:n.RGB16UI,[yt.RG_INTEGER]:n.RG16UI,[yt.RED_INTEGER]:n.R16UI,[yt.DEPTH_COMPONENT]:n.DEPTH_COMPONENT16},[Ht.SHORT]:{[yt.RGBA_INTEGER]:n.RGBA16I,[yt.RGB_INTEGER]:n.RGB16I,[yt.RG_INTEGER]:n.RG16I,[yt.RED_INTEGER]:n.R16I},[Ht.UNSIGNED_INT]:{[yt.RGBA_INTEGER]:n.RGBA32UI,[yt.RGB_INTEGER]:n.RGB32UI,[yt.RG_INTEGER]:n.RG32UI,[yt.RED_INTEGER]:n.R32UI,[yt.DEPTH_COMPONENT]:n.DEPTH_COMPONENT24},[Ht.INT]:{[yt.RGBA_INTEGER]:n.RGBA32I,[yt.RGB_INTEGER]:n.RGB32I,[yt.RG_INTEGER]:n.RG32I,[yt.RED_INTEGER]:n.R32I},[Ht.FLOAT]:{[yt.RGBA]:n.RGBA32F,[yt.RGB]:n.RGB32F,[yt.RG]:n.RG32F,[yt.RED]:n.R32F,[yt.DEPTH_COMPONENT]:n.DEPTH_COMPONENT32F},[Ht.HALF_FLOAT]:{[yt.RGBA]:n.RGBA16F,[yt.RGB]:n.RGB16F,[yt.RG]:n.RG16F,[yt.RED]:n.R16F},[Ht.UNSIGNED_SHORT_5_6_5]:{[yt.RGB]:n.RGB565},[Ht.UNSIGNED_SHORT_4_4_4_4]:{[yt.RGBA]:n.RGBA4},[Ht.UNSIGNED_SHORT_5_5_5_1]:{[yt.RGBA]:n.RGB5_A1},[Ht.UNSIGNED_INT_2_10_10_10_REV]:{[yt.RGBA]:n.RGB10_A2,[yt.RGBA_INTEGER]:n.RGB10_A2UI},[Ht.UNSIGNED_INT_10F_11F_11F_REV]:{[yt.RGB]:n.R11F_G11F_B10F},[Ht.UNSIGNED_INT_5_9_9_9_REV]:{[yt.RGB]:n.RGB9_E5},[Ht.UNSIGNED_INT_24_8]:{[yt.DEPTH_STENCIL]:n.DEPTH24_STENCIL8},[Ht.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[yt.DEPTH_STENCIL]:n.DEPTH32F_STENCIL8}}:t={[Ht.UNSIGNED_BYTE]:{[yt.RGBA]:n.RGBA,[yt.RGB]:n.RGB,[yt.ALPHA]:n.ALPHA,[yt.LUMINANCE]:n.LUMINANCE,[yt.LUMINANCE_ALPHA]:n.LUMINANCE_ALPHA},[Ht.UNSIGNED_SHORT_5_6_5]:{[yt.RGB]:n.RGB},[Ht.UNSIGNED_SHORT_4_4_4_4]:{[yt.RGBA]:n.RGBA},[Ht.UNSIGNED_SHORT_5_5_5_1]:{[yt.RGBA]:n.RGBA}},t}class X9{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new fe,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=JR(t),this.samplerTypes=QR(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let a=0;a=0;--o){const c=e[o];c&&c._glTextures[a].samplerType!==vt.FLOAT&&this.renderer.texture.unbind(c)}}initTexture(t){const e=new l0(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){e.internalFormat=this.internalFormats[t.type]?.[t.format]??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??vt.FLOAT,this.webGLVersion===2&&t.type===Ht.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const i=this.renderer;if(this.initTextureType(t,e),t.resource?.upload(i,t,e))e.samplerType!==vt.FLOAT&&(this.hasIntegerTextures=!0);else{const a=t.realWidth,o=t.realHeight,c=i.gl;(e.width!==a||e.height!==o||e.dirtyId<0)&&(e.width=a,e.height=o,c.texImage2D(t.target,0,e.internalFormat,a,o,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:i}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const a=this.managedTextures.indexOf(t);a!==-1&&Au(this.managedTextures,a,1)}}updateTextureStyle(t){const e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===Tr.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Z2.CLAMP:e.wrapMode=t.wrapMode,t.resource?.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const i=this.gl;if(e.mipmap&&t.mipmap!==Tr.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===$i.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const a=this.renderer.context.extensions.anisotropicFiltering;if(a&&t.anisotropicLevel>0&&t.scaleMode===$i.LINEAR){const o=Math.min(t.anisotropicLevel,i.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,a.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===$i.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===$i.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}X9.extension={type:jt.RendererSystem,name:"texture"};ne.add(X9);class Y9{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,a=t._glTransformFeedbacks[i]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,a)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:i,renderer:a}=this;e&&a.shader.bind(e),i.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:i,CONTEXT_UID:a}=this,o=e.createTransformFeedback();t._glTransformFeedbacks[a]=o,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,o);for(let c=0;c(n[n.INTERACTION=50]="INTERACTION",n[n.HIGH=25]="HIGH",n[n.NORMAL=0]="NORMAL",n[n.LOW=-25]="LOW",n[n.UTILITY=-50]="UTILITY",n))(Wu||{});class c0{constructor(t,e=null,i=0,a=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=a}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const $9=class Rn{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new c0(null,null,1/0),this.deltaMS=1/Rn.targetFPMS,this.elapsedMS=1/Rn.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=Wu.NORMAL){return this._addListener(new c0(t,e,i))}addOnce(t,e,i=Wu.NORMAL){return this._addListener(new c0(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const o=t-this._lastFrame|0;if(o{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ls.shared:new Ls,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}W9.extension=jt.Application;ne.add(W9);const Z9=[];ne.handleByList(jt.Renderer,Z9);function tL(n){for(const t of Z9)if(t.test(n))return new t(n);throw new Error("Unable to auto-detect a suitable renderer.")}var eL=`attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aVertexPosition * (outputFrame.zw * inputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); +} +`;const nL=eL;class K9{constructor(t){this.renderer=t}contextChange(t){let e;if(this.renderer.context.webGLVersion===1){const i=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,i)}else{const i=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,i)}e>=Pe.HIGH?this.multisample=Pe.HIGH:e>=Pe.MEDIUM?this.multisample=Pe.MEDIUM:e>=Pe.LOW?this.multisample=Pe.LOW:this.multisample=Pe.NONE}destroy(){}}K9.extension={type:jt.RendererSystem,name:"_multisample"};ne.add(K9);class iL{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Q9{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,a=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,a.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:i,CONTEXT_UID:a}=this;if(this.boundBufferBases[e]!==t){const o=t._glBuffers[a]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,o.buffer)}}bindBufferRange(t,e,i){const{gl:a,CONTEXT_UID:o}=this;i=i||0;const c=t._glBuffers[o]||this.createGLBuffer(t);a.bindBufferRange(a.UNIFORM_BUFFER,e||0,c.buffer,i*256,256)}update(t){const{gl:e,CONTEXT_UID:i}=this,a=t._glBuffers[i]||this.createGLBuffer(t);if(t._updateID!==a.updateID)if(a.updateID=t._updateID,e.bindBuffer(t.type,a.buffer),a.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const o=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;a.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,o)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const i=t._glBuffers[this.CONTEXT_UID],a=this.gl;t.disposeRunner.remove(this),i&&(e||a.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let i=0;ie.resource).filter(e=>e).map(e=>e.load());return this._load=Promise.all(t).then(()=>{const{realWidth:e,realHeight:i}=this.items[0];return this.resize(e,i),this.update(),Promise.resolve(this)}),this._load}}class sL extends tv{constructor(t,e){const{width:i,height:a}=e||{};let o,c;Array.isArray(t)?(o=t,c=t.length):c=t,super(c,{width:i,height:a}),o&&this.initFromArray(o,e)}addBaseTextureAt(t,e){if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=Ra.TEXTURE_2D_ARRAY}upload(t,e,i){const{length:a,itemDirtyIds:o,items:c}=this,{gl:u}=t;i.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,a,0,e.format,i.type,null);for(let f=0;f0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=Ra.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,i){const a=this.itemDirtyIds;for(let o=0;o{if(this.url===null){t(this);return}try{const i=await $t.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const a=await i.blob();if(this.destroyed)return;const o=await createImageBitmap(a,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Er.UNPACK?"premultiply":"none"});if(this.destroyed){o.close();return}this.source=o,this.update(),t(this)}catch(i){if(this.destroyed)return;e(i),this.onError.emit(i)}}),this._load)}upload(t,e,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),super.upload(t,e,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return wa._EMPTY=wa._EMPTY??$t.ADAPTER.createCanvas(0,0),wa._EMPTY}}const o2=class Ru extends Zi{constructor(t,e){e=e||{},super($t.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(t=>{if(this._resolve=()=>{this.update(),t(this)},Ru.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const t=new Image;Zi.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,i=t.height;if(!e||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let a=e*this.scale,o=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(a=this._overrideWidth||this._overrideHeight/i*e,o=this._overrideHeight||this._overrideWidth/e*i),a=Math.round(a),o=Math.round(o);const c=this.source;c.width=a,c.height=o,c._pixiId=`canvas_${bl()}`,c.getContext("2d").drawImage(t,0,0,e,i,0,0,a,o),this._resolve(),this._resolve=null}}static getSize(t){const e=Ru.SVG_SIZE.exec(t),i={};return e&&(i[e[1]]=Math.round(parseFloat(e[3])),i[e[5]]=Math.round(parseFloat(e[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&Ru.SVG_XML.test(t)}};o2.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let oL=o2;class lL extends Zi{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}}const l2=class c2 extends Zi{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const i=document.createElement("video");e.autoLoad!==!1&&i.setAttribute("preload","auto"),e.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),e.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),e.loop===!0&&i.setAttribute("loop",""),e.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof t=="string"&&(t=[t]);const a=t[0].src||t[0];Zi.crossOrigin(i,a,e.crossorigin);for(let o=0;o{this.valid?e(this):(this._resolve=e,this._reject=i,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ls.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ls.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ls.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||c2.TYPES.includes(e)}};l2.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],l2.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let cL=l2;Q0.push(wa,L9,rL,cL,lL,oL,x9,aL,sL);class u2{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?pe.EMPTY:(t=t||new pe(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:i,b:a,c:o,d:c,tx:u,ty:f}=t,d=i*e.x+o*e.y+u,m=a*e.x+c*e.y+f;this.minX=Math.min(this.minX,d),this.maxX=Math.max(this.maxX,d),this.minY=Math.min(this.minY,m),this.maxY=Math.max(this.maxY,m)}addQuad(t){let e=this.minX,i=this.minY,a=this.maxX,o=this.maxY,c=t[0],u=t[1];e=ca?c:a,o=u>o?u:o,c=t[2],u=t[3],e=ca?c:a,o=u>o?u:o,c=t[4],u=t[5],e=ca?c:a,o=u>o?u:o,c=t[6],u=t[7],e=ca?c:a,o=u>o?u:o,this.minX=e,this.minY=i,this.maxX=a,this.maxY=o}addFrame(t,e,i,a,o){this.addFrameMatrix(t.worldTransform,e,i,a,o)}addFrameMatrix(t,e,i,a,o){const c=t.a,u=t.b,f=t.c,d=t.d,m=t.tx,y=t.ty;let v=this.minX,x=this.minY,b=this.maxX,T=this.maxY,C=c*e+f*i+m,_=u*e+d*i+y;v=Cb?C:b,T=_>T?_:T,C=c*a+f*i+m,_=u*a+d*i+y,v=Cb?C:b,T=_>T?_:T,C=c*e+f*o+m,_=u*e+d*o+y,v=Cb?C:b,T=_>T?_:T,C=c*a+f*o+m,_=u*a+d*o+y,v=Cb?C:b,T=_>T?_:T,this.minX=v,this.minY=x,this.maxX=b,this.maxY=T}addVertexData(t,e,i){let a=this.minX,o=this.minY,c=this.maxX,u=this.maxY;for(let f=e;fc?d:c,u=m>u?m:u}this.minX=a,this.minY=o,this.maxX=c,this.maxY=u}addVertices(t,e,i,a){this.addVerticesMatrix(t.worldTransform,e,i,a)}addVerticesMatrix(t,e,i,a,o=0,c=o){const u=t.a,f=t.b,d=t.c,m=t.d,y=t.tx,v=t.ty;let x=this.minX,b=this.minY,T=this.maxX,C=this.maxY;for(let _=i;_a?t.maxX:a,this.maxY=t.maxY>o?t.maxY:o}addBoundsMask(t,e){const i=t.minX>e.minX?t.minX:e.minX,a=t.minY>e.minY?t.minY:e.minY,o=t.maxXd?o:d,this.maxY=c>m?c:m}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const i=t.minX>e.x?t.minX:e.x,a=t.minY>e.y?t.minY:e.y,o=t.maxXd?o:d,this.maxY=c>m?c:m}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,i,a,o,c){t-=o,e-=c,i+=o,a+=c,this.minX=this.minXi?this.maxX:i,this.minY=this.minYa?this.maxY:a}}class Ia extends ah{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new em,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new u2,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let i=0;i1)for(let e=0;ethis.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const i=this.getChildIndex(t),a=this.getChildIndex(e);this.children[i]=e,this.children[a]=t,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(t);Au(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e0&&o<=a){c=this.children.splice(i,o);for(let u=0;u1&&this.children.sort(fL),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t0&&e.height>0))return;let i,a;this.cullArea?(i=this.cullArea,a=this.worldTransform):this._render!==h2.prototype._render&&(i=this.getBounds(!0));const o=t.projection.transform;if(o&&(a?(a=hL.copyFrom(a),a.prepend(o)):a=o),i&&e.intersects(i,a))this._render(t);else if(this.cullArea)return;for(let c=0,u=this.children.length;c{e.init.call(this,t)})}render(){this.renderer.render(this.stage)}get view(){return this.renderer?.view}get screen(){return this.renderer?.screen}destroy(t,e){const i=f2._plugins.slice(0);i.reverse(),i.forEach(a=>{a.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};iv._plugins=[];let sv=iv;ne.handleByList(jt.Application,sv._plugins);class rv{static init(t){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let e,i;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:a,clientHeight:o}=this._resizeTo;e=a,i=o}this.renderer.resize(e,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}rv.extension=jt.Application;ne.add(rv);const dL={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},mL=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(` +`);function pL(n){const t=dL[n],e=t.length;let i=mL,a="";const o="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;";let c;for(let u=0;u=e&&(c=n-u-1),f=f.replace("%value%",t[c].toString()),a+=f,a+=` +`}return i=i.replace("%blur%",a),i=i.replace("%size%",n.toString()),i}const yL=` + attribute vec2 aVertexPosition; + + uniform mat3 projectionMatrix; + + uniform float strength; + + varying vec2 vBlurTexCoords[%size%]; + + uniform vec4 inputSize; + uniform vec4 outputFrame; + + vec4 filterVertexPosition( void ) + { + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); + } + + vec2 filterTextureCoord( void ) + { + return aVertexPosition * (outputFrame.zw * inputSize.zw); + } + + void main(void) + { + gl_Position = filterVertexPosition(); + + vec2 textureCoord = filterTextureCoord(); + %blur% + }`;function gL(n,t){const e=Math.ceil(n/2);let i=yL,a="",o;t?o="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":o="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let c=0;c 0.0) { + coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); + } else { + coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); + } + } + coord += center * dimensions.xy; + coord /= filterArea.xy; + vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); + vec4 color = texture2D(uSampler, clampedCoord); + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + gl_FragColor = color; +} +`;const av=class extends qn{constructor(n){super(vL,bL),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,av.defaults,n)}apply(n,t,e,i){const{width:a,height:o}=t.filterFrame;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=o,n.applyFilter(this,t,e,i)}get radius(){return this.uniforms.radius}set radius(n){this.uniforms.radius=n}get strength(){return this.uniforms.strength}set strength(n){this.uniforms.strength=n}get center(){return this.uniforms.center}set center(n){this.uniforms.center=n}};let il=av;il.defaults={center:[.5,.5],radius:100,strength:1};var xL=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform float m[20]; +uniform float uAlpha; + +void main(void) +{ + vec4 c = texture2D(uSampler, vTextureCoord); + + if (uAlpha == 0.0) { + gl_FragColor = c; + return; + } + + // Un-premultiply alpha before applying the color matrix. See issue #3539. + if (c.a > 0.0) { + c.rgb /= c.a; + } + + vec4 result; + + result.r = (m[0] * c.r); + result.r += (m[1] * c.g); + result.r += (m[2] * c.b); + result.r += (m[3] * c.a); + result.r += m[4]; + + result.g = (m[5] * c.r); + result.g += (m[6] * c.g); + result.g += (m[7] * c.b); + result.g += (m[8] * c.a); + result.g += m[9]; + + result.b = (m[10] * c.r); + result.b += (m[11] * c.g); + result.b += (m[12] * c.b); + result.b += (m[13] * c.a); + result.b += m[14]; + + result.a = (m[15] * c.r); + result.a += (m[16] * c.g); + result.a += (m[17] * c.b); + result.a += (m[18] * c.a); + result.a += m[19]; + + vec3 rgb = mix(c.rgb, result.rgb, uAlpha); + + // Premultiply alpha again. + rgb *= result.a; + + gl_FragColor = vec4(rgb, result.a); +} +`;class ul extends qn{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(nL,xL,t),this.alpha=1}_loadMatrix(t,e=!1){let i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)}tint(t,e){const[i,a,o]=Sr.shared.setValue(t).toArray(),c=[i,0,0,0,0,0,a,0,0,0,0,0,o,0,0,0,0,0,1,0];this._loadMatrix(c,e)}greyscale(t,e){const i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)}blackAndWhite(t){const e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)}hue(t,e){t=(t||0)/180*Math.PI;const i=Math.cos(t),a=Math.sin(t),o=Math.sqrt,c=1/3,u=o(c),f=i+(1-i)*c,d=c*(1-i)-u*a,m=c*(1-i)+u*a,y=c*(1-i)+u*a,v=i+c*(1-i),x=c*(1-i)-u*a,b=c*(1-i)-u*a,T=c*(1-i)+u*a,C=i+c*(1-i),_=[f,d,m,0,0,y,v,x,0,0,b,T,C,0,0,0,0,0,1,0];this._loadMatrix(_,e)}contrast(t,e){const i=(t||0)+1,a=-.5*(i-1),o=[i,0,0,0,a,0,i,0,0,a,0,0,i,0,a,0,0,0,1,0];this._loadMatrix(o,e)}saturate(t=0,e){const i=t*2/3+1,a=(i-1)*-.5,o=[i,a,a,0,0,a,i,a,0,0,a,a,i,0,0,0,0,0,1,0];this._loadMatrix(o,e)}desaturate(){this.saturate(-1)}negative(t){const e=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(e,t)}sepia(t){const e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)}technicolor(t){const e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(e,t)}polaroid(t){const e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)}toBGR(t){const e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)}kodachrome(t){const e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(e,t)}browni(t){const e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(e,t)}vintage(t){const e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(e,t)}colorTone(t,e,i,a,o){t=t||.2,e=e||.15,i=i||16770432,a=a||3375104;const c=Sr.shared,[u,f,d]=c.setValue(i).toArray(),[m,y,v]=c.setValue(a).toArray(),x=[.3,.59,.11,0,0,u,f,d,t,0,m,y,v,e,0,u-m,f-y,d-v,0,0];this._loadMatrix(x,o)}night(t,e){t=t||.1;const i=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(i,e)}predator(t,e){const i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)}lsd(t){const e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)}reset(){const t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}ul.prototype.grayscale=ul.prototype.greyscale;const qo=new en,CL=new Uint16Array([0,1,2,0,2,3]);class Ma extends _r{constructor(t){super(),this._anchor=new Rs(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Sr(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=Ot.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||Qt.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=CL,this.pluginName="batch",this.isSprite=!0,this._roundPixels=$t.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=tu(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=tu(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,i=e.a,a=e.b,o=e.c,c=e.d,u=e.tx,f=e.ty,d=this.vertexData,m=t.trim,y=t.orig,v=this._anchor;let x=0,b=0,T=0,C=0;if(m?(b=m.x-v._x*y.width,x=b+m.width,C=m.y-v._y*y.height,T=C+m.height):(b=-v._x*y.width,x=b+y.width,C=-v._y*y.height,T=C+y.height),d[0]=i*b+o*C+u,d[1]=c*C+a*b+f,d[2]=i*x+o*C+u,d[3]=c*C+a*x+f,d[4]=i*x+o*T+u,d[5]=c*T+a*x+f,d[6]=i*b+o*T+u,d[7]=c*T+a*b+f,this._roundPixels){const _=$t.RESOLUTION;for(let R=0;R=a&&qo.x=o&&qo.y{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new uv[n](t)},TL=(n,t)=>{const e=(a,o)=>(n.set(o,a),a),i=a=>{if(n.has(a))return n.get(a);const[o,c]=t[a];switch(o){case hh:case ov:return e(c,a);case hl:{const u=e([],a);for(const f of c)u.push(i(f));return u}case Zu:{const u=e({},a);for(const[f,d]of c)u[i(f)]=i(d);return u}case sm:return e(new Date(c),a);case rm:{const{source:u,flags:f}=c;return e(new RegExp(u,f),a)}case am:{const u=e(new Map,a);for(const[f,d]of c)u.set(i(f),i(d));return u}case om:{const u=e(new Set,a);for(const f of c)u.add(i(f));return u}case lv:{const{name:u,message:f}=c;return e(typeof uv[u]=="function"?I6(u,f):new Error(f),a)}case cv:return e(BigInt(c),a);case"BigInt":return e(Object(BigInt(c)),a);case"ArrayBuffer":return e(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:u}=new Uint8Array(c);return e(new DataView(u),c)}}return e(I6(o,c),a)};return i},F6=n=>TL(new Map,n)(0),dr="",{toString:SL}={},{keys:_L}=Object,Xo=n=>{const t=typeof n;if(t!=="object"||!n)return[hh,t];const e=SL.call(n).slice(8,-1);switch(e){case"Array":return[hl,dr];case"Object":return[Zu,dr];case"Date":return[sm,dr];case"RegExp":return[rm,dr];case"Map":return[am,dr];case"Set":return[om,dr];case"DataView":return[hl,e]}return e.includes("Array")?[hl,e]:n instanceof Error?[lv,n.name||"Error"]:[Zu,e]},uu=([n,t])=>n===hh&&(t==="function"||t==="symbol"),AL=(n,t,e,i)=>{const a=(c,u)=>{const f=i.push(c)-1;return e.set(u,f),f},o=c=>{if(e.has(c))return e.get(c);let[u,f]=Xo(c);switch(u){case hh:{let m=c;switch(f){case"bigint":u=cv,m=c.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([ov],c)}return a([u,m],c)}case hl:{if(f){let v=c;return f==="DataView"?v=new Uint8Array(c.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(c)),a([f,[...v]],c)}const m=[],y=a([u,m],c);for(const v of c)m.push(o(v));return y}case Zu:{if(f)switch(f){case"BigInt":return a([f,c.toString()],c);case"Boolean":case"Number":case"String":return a([f,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const m=[],y=a([u,m],c);for(const v of _L(c))(n||!uu(Xo(c[v])))&&m.push([o(v),o(c[v])]);return y}case sm:return a([u,isNaN(c.getTime())?dr:c.toISOString()],c);case rm:{const{source:m,flags:y}=c;return a([u,{source:m,flags:y}],c)}case am:{const m=[],y=a([u,m],c);for(const[v,x]of c)(n||!(uu(Xo(v))||uu(Xo(x))))&&m.push([o(v),o(x)]);return y}case om:{const m=[],y=a([u,m],c);for(const v of c)(n||!uu(Xo(v)))&&m.push(o(v));return y}}const{message:d}=c;return a([u,{name:f,message:d}],c)};return o},P6=(n,{json:t,lossy:e}={})=>{const i=[];return AL(!(t||e),!!t,new Map,i)(n),i},d2=typeof structuredClone=="function"?(n,t)=>t&&("json"in t||"lossy"in t)?F6(P6(n,t)):structuredClone(n):(n,t)=>F6(P6(n,t));function U6(n){return n}const{cbrt:u0,sqrt:h0,PI:pa}=Math,EL=(n,t,e,i,a)=>{const o=t+e*n,c=o**2+i;if(c>0){const m=h0(c);return u0(o+m)+u0(o-m)-a}const u=u0(h0(o*o-c)),f=o?Math.atan(h0(-c)/o):-pa/2;let d;return e<0?d=(o>0?2*pa:pa)-f:a<0?d=(o>0?2*pa:-3*pa)+f:d=(o>0?0:pa)+f,2*u*Math.cos(d/3)-a},wL=(n,t,e,i)=>((t*n+3*e)*n+i)*n;function hv(n,t,e,i){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===i)return U6;const a=6*(3*n-3*e+1),o=6*(e-2*n),c=3*n,u=a*a,f=o*o,d=o/a,m=3*o*c/u-f*o/(u*a),y=2*c/a-f/u,v=y*y*y,x=3/a,b=3*t-3*i+1,T=i-2*t,C=3*t,_=a?EL:U6;return function(L){return L===0||L===1?L:wL(_(L,m,x,v,d),b,T,C)}}var ML=class{};function k6(n){return Math.max(1,n)}var fv=class extends ML{canvas;observer;flowSpeed=1;currerntRenderScale=.75;constructor(n){super(),this.canvas=n,this.observer=new ResizeObserver(()=>{const t=k6(n.clientWidth*window.devicePixelRatio*this.currerntRenderScale),e=k6(n.clientHeight*window.devicePixelRatio*this.currerntRenderScale);this.onResize(t,e)}),this.observer.observe(n)}setRenderScale(n){this.currerntRenderScale=n,this.onResize(this.canvas.clientWidth*window.devicePixelRatio*this.currerntRenderScale,this.canvas.clientHeight*window.devicePixelRatio*this.currerntRenderScale)}onResize(n,t){this.canvas.width=n,this.canvas.height=t}setFlowSpeed(n){this.flowSpeed=n}dispose(){this.observer.disconnect(),this.canvas.remove()}getElement(){return this.canvas}};function RL(n){return new Promise((t,e)=>{const i=document.createElement("img");i.onload=()=>t(i),i.onerror=e,i.src=n,i.crossOrigin="anonymous",i.loading="eager"})}function LL(n){return new Promise((t,e)=>{const i=document.createElement("video");let a=!1,o=!1,c=!1;i.addEventListener("playing",()=>{a=!0,u()},!0),i.addEventListener("timeupdate",()=>{o=!0,u()},!0),i.addEventListener("error",f=>{c=!0,e(f)},!0);function u(){a&&o&&!c&&t(i)}i.src=n,i.playsInline=!0,i.crossOrigin="anonymous",i.autoplay=!0,i.loop=!0,i.muted=!0,i.play()})}function m2(n,t=!1){return t?LL(n):RL(n)}function dv(n){return new Promise((t,e)=>{(n instanceof HTMLImageElement?n.complete:n.readyState>=3)?t(n):(n.onload=()=>t(n),n.onerror=e)})}function OL(n,t,e){const i=n.data,a=n.width,o=n.height;let c,u,f,d,m,y,v,x,b,T,C,_,R;const L=a-1,P=o-1,w=t+1,F=t+w,E=t+1,N=1/(F*(t+E)),D=[],k=[],U=[],G=[],J=[],tt=[];for(;e-- >0;){for(R=_=0,y=0;yL?L:v)<<2),c+=i[x++],u+=i[x++],f+=i[x++],d+=i[x];for(m=0;mP?0:a,c+=D[C],u+=k[C],f+=U[C],d+=G[C];for(_=m<<2,y=0;yObject.freeze({cx:n,cy:t,x:e,y:i,ur:a,vr:o,up:c,vp:u}),mr=(n,t,e)=>Object.freeze({width:n,height:t,conf:e}),z6=[mr(5,5,[ot(0,0,-1,-1,0,0,1,1),ot(1,0,-.5,-1,0,0,1,1),ot(2,0,0,-1,0,0,1,1),ot(3,0,.5,-1,0,0,1,1),ot(4,0,1,-1,0,0,1,1),ot(0,1,-1,-.5,0,0,1,1),ot(1,1,-.5,-.5,0,0,1,1),ot(2,1,-.0052029684413368305,-.6131420587090777,0,0,1,1),ot(3,1,.5884227308309977,-.3990805107556692,0,0,1,1),ot(4,1,1,-.5,0,0,1,1),ot(0,2,-1,0,0,0,1,1),ot(1,2,-.4210024670505933,-.11895058380429502,0,0,1,1),ot(2,2,-.1019613423315412,-.023812118047224606,0,-47,.629,.849),ot(3,2,.40275125660925437,-.06345314544600389,0,0,1,1),ot(4,2,1,0,0,0,1,1),ot(0,3,-1,.5,0,0,1,1),ot(1,3,.06801958477287173,.5205913248960121,-31,-45,1,1),ot(2,3,.21446469120128908,.29331610114301043,6,-56,.566,1.321),ot(3,3,.5,.5,0,0,1,1),ot(4,3,1,.5,0,0,1,1),ot(0,4,-1,1,0,0,1,1),ot(1,4,-.31378372841550195,1,0,0,1,1),ot(2,4,.26153633255328046,1,0,0,1,1),ot(3,4,.5,1,0,0,1,1),ot(4,4,1,1,0,0,1,1)]),mr(4,4,[ot(0,0,-1,-1,0,0,1,1),ot(1,0,-.33333333333333337,-1,0,0,1,1),ot(2,0,.33333333333333326,-1,0,0,1,1),ot(3,0,1,-1,0,0,1,1),ot(0,1,-1,-.04495399932657351,0,0,1,1),ot(1,1,-.24056117520129328,-.22465999020104,0,0,1,1),ot(2,1,.334758885767489,-.00531297192779423,0,0,1,1),ot(3,1,.9989920470678106,-.3382976020775408,8,0,.566,1.792),ot(0,2,-1,.33333333333333326,0,0,1,1),ot(1,2,-.3425497314639411,-27501607956947893e-21,0,0,1,1),ot(2,2,.3321437945812673,.1981776353859399,0,0,1,1),ot(3,2,1,.0766118180296832,0,0,1,1),ot(0,3,-1,1,0,0,1,1),ot(1,3,-.33333333333333337,1,0,0,1,1),ot(2,3,.33333333333333326,1,0,0,1,1),ot(3,3,1,1,0,0,1,1)]),mr(4,4,[ot(0,0,-1,-1,0,0,1,2.075),ot(1,0,-.33333333333333337,-1,0,0,1,1),ot(2,0,.33333333333333326,-1,0,0,1,1),ot(3,0,1,-1,0,0,1,1),ot(0,1,-1,-.4545779491139603,0,0,1,1),ot(1,1,-.33333333333333337,-.33333333333333337,0,0,1,1),ot(2,1,.0889403142626457,-.6025711180694033,-32,45,1,1),ot(3,1,1,-.33333333333333337,0,0,1,1),ot(0,2,-1,-.07402408608567845,1,0,1,.094),ot(1,2,-.2719422694359541,.09775369930903222,25,-18,1.321,0),ot(2,2,.19877414408395877,.4307383294587789,48,-40,.755,.975),ot(3,2,1,.33333333333333326,-37,0,1,1),ot(0,3,-1,1,0,0,1,1),ot(1,3,-.33333333333333337,1,0,0,1,1),ot(2,3,.5125850864305672,1,-20,-18,0,1.604),ot(3,3,1,1,0,0,1,1)]),mr(5,5,[ot(0,0,-1,-1,0,0,1,1),ot(1,0,-.4501953125,-1,0,55,1,2.075),ot(2,0,.1953125,-1,0,0,1,1),ot(3,0,.4580078125,-1,0,-25,1,1),ot(4,0,1,-1,0,0,1,1),ot(0,1,-1,-.2514475377525607,-16,0,2.327,.943),ot(1,1,-.55859375,-.6609325945787148,47,0,2.358,.377),ot(2,1,.232421875,-.5244375756366635,-66,-25,1.855,1.164),ot(3,1,.685546875,-.3753706470552125,0,0,1,1),ot(4,1,1,-.6699125300354287,0,0,1,1),ot(0,2,-1,.035910396862284255,0,0,1,1),ot(1,2,-.4921875,.005378616309457018,90,23,1,1.981),ot(2,2,.021484375,-.1365043639066228,0,42,1,1),ot(3,2,.4765625,.05925822904974043,-30,0,1.95,.44),ot(4,2,1,.251428847823418,0,0,1,1),ot(0,3,-1,.6968336464764276,-68,0,1,.786),ot(1,3,-.6904296875,.5890744209958608,-68,0,1,1),ot(2,3,.1845703125,.3879238667654693,61,0,1,1),ot(3,3,.60546875,.4633553246018661,-47,-59,.849,1.73),ot(4,3,1,.6214021886400309,-33,0,.377,1.604),ot(0,4,-1,1,0,0,1,1),ot(1,4,-.5,1,0,-73,1,1),ot(2,4,-.3271484375,1,0,-24,.314,2.704),ot(3,4,.5,1,0,0,1,1),ot(4,4,1,1,0,0,1,1)]),mr(5,5,[ot(0,0,-1,-1),ot(1,0,-.6393,-1,0,0,1,2.3884),ot(2,0,0,-1),ot(3,0,.5,-1),ot(4,0,1,-1),ot(0,1,-1,-.2301),ot(1,1,-.6934,-.331,0,-.7188,1,1.063),ot(2,1,-.0082,-.6814,-.2583,0,1.0964,1),ot(3,1,.5836,-.531,.7029,0,1.5466,1),ot(4,1,1,-.6407),ot(0,2,-1,.2973,0,0,1.8352,1),ot(1,2,-.4082,.0602),ot(2,2,-.1803,-.3646,-.2998,0,1.1513,1),ot(3,2,.477,-.1027,.8903,-.1882,1.0807,.8551),ot(4,2,1,-.2973),ot(0,3,-1,.7628,0,0,2.3868,1),ot(1,3,-.2525,.4814,-.8406,-1.6199,1.4093,1.2215),ot(2,3,.3607,.2814,-1.0713,-.0529,1.0025,.7611),ot(3,3,.4885,.623,0,.8184,1,1.2876),ot(4,3,1,.5),ot(0,4,-1,1),ot(1,4,-.4033,1),ot(2,4,.2672,1),ot(3,4,.5967,1),ot(4,4,1,1)]),mr(5,5,[ot(0,0,-1,-1),ot(1,0,-.2197,-1),ot(2,0,.0197,-1),ot(3,0,.8033,-1),ot(4,0,1,-1),ot(0,1,-1,-.5451),ot(1,1,-.4885,-.4035,-1.0246,-.2268,1.1936,.8005),ot(2,1,-.1213,-.2867,0,-.6981,1,.809),ot(3,1,.3246,-.5628,0,-1.2188,1,1.044),ot(4,1,1,-.3292),ot(0,2,-1,.1416),ot(1,2,-.341,-.0142,0,-.4004,1,1.1293),ot(2,2,-.0393,-.023,.2915,-.373,1.044,.9879),ot(3,2,.3148,-.0673,-.7853,-.8962,1.4709,1.0247),ot(4,2,1,.1912),ot(0,3,-1,.5),ot(1,3,-.2689,.2743,.3404,-.5248,1.0184,.4391),ot(2,3,.0721,.269,.5302,.1244,.6723,.3225),ot(3,3,.4148,.3894,-.6977,-.6783,.8094,.9247),ot(4,3,1,.446),ot(0,4,-1,1),ot(1,4,-.7311,1),ot(2,4,.323,1),ot(3,4,.6393,1),ot(4,4,1,1)])],ei=(n,t)=>Math.random()*(t-n)+n;function NL(n,t,e){const i=si((e-n)/(t-n));return i*i*(3-2*i)}function DL(n,t,e,i=2,a=.5,o=.1){let c=[],u=a;for(let m=0;m 1.0) { + pos.y *= u_aspect; + } else { + pos.x /= u_aspect; + } + gl_Position = vec4(pos, 0.0, 1.0); +} +`;const zL=` +attribute vec2 a_pos; +varying vec2 v_uv; +void main() { + gl_Position = vec4(a_pos, 0.0, 1.0); + v_uv = a_pos * 0.5 + 0.5; +} +`,VL=` +precision mediump float; +varying vec2 v_uv; +uniform sampler2D u_texture; +uniform float u_alpha; +void main() { + vec4 color = texture2D(u_texture, v_uv); + gl_FragColor = vec4(color.rgb, color.a * u_alpha); +} +`;function GL(n){return-(Math.cos(Math.PI*n)-1)/2}var V6=class{label;gl;program;vertexShader;fragmentShader;attrs;constructor(n,t,e,i="unknown"){this.label=i,this.gl=n,this.vertexShader=this.createShader(n.VERTEX_SHADER,t),this.fragmentShader=this.createShader(n.FRAGMENT_SHADER,e),this.program=this.createProgram();const a=n.getProgramParameter(this.program,n.ACTIVE_ATTRIBUTES),o={};for(let c=0;c=this.vertexData.length-1){console.warn("Vertex position out of range",a,this.vertexData.length);return}this.vertexData[a]=e,this.vertexData[a+1]=i}setVertexColor(n,t,e,i,a){const o=(n+t*this.vertexWidth)*7+2;if(o>=this.vertexData.length-2){console.warn("Vertex color out of range",o,this.vertexData.length);return}this.vertexData[o]=e,this.vertexData[o+1]=i,this.vertexData[o+2]=a}setVertexUV(n,t,e,i){const a=(n+t*this.vertexWidth)*7+5;if(a>=this.vertexData.length-1){console.warn("Vertex UV out of range",a,this.vertexData.length);return}this.vertexData[a]=e,this.vertexData[a+1]=i}setVertexData(n,t,e,i,a,o,c,u,f){const d=(n+t*this.vertexWidth)*7;if(d>=this.vertexData.length-6){console.warn("Vertex data out of range",d,this.vertexData.length);return}const m=this.vertexData;m[d]=e,m[d+1]=i,m[d+2]=a,m[d+3]=o,m[d+4]=c,m[d+5]=u,m[d+6]=f}getVertexIndexLength(){return this.vertexIndexLength}draw(){const n=this.gl;this.wireFrame?n.drawElements(n.LINES,this.vertexIndexLength,n.UNSIGNED_SHORT,0):n.drawElements(n.TRIANGLES,this.vertexIndexLength,n.UNSIGNED_SHORT,0)}resize(n,t){this.vertexWidth=n,this.vertexHeight=t,this.vertexIndexLength=n*t*6,this.wireFrame&&(this.vertexIndexLength=n*t*10);const e=new Float32Array(n*t*7),i=new Uint16Array(this.vertexIndexLength);this.vertexData=e,this.indexData=i;for(let o=0;od.location[a],u=d=>d.uTangent[a],f=d=>d.vTangent[a];return o[0]=c(n),o[1]=c(t),o[2]=f(n),o[3]=f(t),o[4]=c(e),o[5]=c(i),o[6]=f(e),o[7]=f(i),o[8]=u(n),o[9]=u(t),o[10]=0,o[11]=0,o[12]=u(e),o[13]=u(i),o[14]=0,o[15]=0,o}function f0(n,t,e,i,a,o=Rt.create()){const c=u=>u.color[a];return o.fill(0),o[0]=c(n),o[1]=c(t),o[4]=c(e),o[5]=c(i),o}var XL=class{_width=0;_height=0;_data=[];constructor(n,t){this.resize(n,t),Object.seal(this)}resize(n,t){this._width=n,this._height=t,this._data=new Array(n*t).fill(0)}set(n,t,e){this._data[n+t*this._width]=e}get(n,t){return this._data[n+t*this._width]}get width(){return this._width}get height(){return this._height}},YL=class extends HL{_subDivisions=10;_controlPoints=new XL(3,3);constructor(n,t,e,i){super(n,t,e,i),this.resizeControlPoints(3,3),Object.seal(this)}setWireFrame(n){super.setWireFrame(n),this.updateMesh()}resetSubdivition(n){this._subDivisions=n,super.resize((this._controlPoints.width-1)*n,(this._controlPoints.height-1)*n)}resizeControlPoints(n,t){if(!(n>=2&&t>=2))throw new Error("Control points must be larger than 3x3 or equal");this._controlPoints.resize(n,t);for(let e=0;e0&&t>0&&this.updateFBO(n,t)}}updateFBO(n,t){const e=this.gl;this.fbo&&e.deleteFramebuffer(this.fbo),this.fboTexture&&e.deleteTexture(this.fboTexture),this.fboTexture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.fboTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,t,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.fbo=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,this.fbo),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.fboTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}onRedraw(n,t){const e=this.meshStates[this.meshStates.length-1];let i=!1;const a=t/500;if(e)if(e.mesh.bind(),this.manualControl&&e.mesh.updateMesh(),this.isNoCover){let u=!1;for(let f=this.meshStates.length-1;f>=0;f--){const d=this.meshStates[f];d.alpha<=-.1?(d.mesh.dispose(),d.texture.dispose(),this.meshStates.splice(f,1)):(d.alpha=Math.max(-.1,d.alpha-a),u=!0)}i=!u}else{if(e.alpha>=1.1){const u=this.meshStates.splice(0,this.meshStates.length-1);for(const f of u)f.mesh.dispose(),f.texture.dispose()}else e.alpha=Math.min(1.1,e.alpha+a);i=this.meshStates.length===1&&e.alpha>=1.1}const o=this.gl;if(this.checkIfResize(),!this.fbo)return i;o.bindFramebuffer(o.FRAMEBUFFER,null),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT);const c=Math.min(1,t/100);this.smoothedVolume+=(this.volume-this.smoothedVolume)*c;for(const u of this.meshStates){o.bindFramebuffer(o.FRAMEBUFFER,this.fbo),o.disable(o.BLEND),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),this.mainProgram.use(),o.activeTexture(o.TEXTURE0);const f=n/1e4;this.mainProgram.setUniform1f("u_aspect",this.manualControl?1:this.canvas.width/this.canvas.height),this.mainProgram.setUniform1i("u_texture",0),this.mainProgram.setUniform1f("u_volume",this.volume),this.mainProgram.setUniform1f("u_alpha",1);const d=(f+this.volume)*2;this.mainProgram.setUniform1f("u_sinAngle",Math.sin(d)),this.mainProgram.setUniform1f("u_cosAngle",Math.cos(d)),u.texture.bind(),u.mesh.bind(),u.mesh.draw(),o.bindFramebuffer(o.FRAMEBUFFER,null),o.enable(o.BLEND),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA),this.quadProgram.use(),this.quadProgram.setUniform1i("u_texture",0),this.quadProgram.setUniform1f("u_alpha",GL(si(u.alpha))),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.fboTexture),o.bindBuffer(o.ARRAY_BUFFER,this.quadBuffer);const m=this.quadProgram.attrs.a_pos;o.vertexAttribPointer(m,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(m),o.drawArrays(o.TRIANGLES,0,6),o.disableVertexAttribArray(m)}return o.flush(),i}onTickBinded=this.onTick.bind(this);requestTick(){this._disposed||this.tickHandle===0&&(this.tickHandle=requestAnimationFrame(this.onTickBinded))}constructor(n){super(n);const t=n.getContext("webgl",{antialias:!0});if(!t)throw new Error("WebGL not supported");t.getExtension("EXT_color_buffer_float")||console.warn("EXT_color_buffer_float not supported"),t.getExtension("EXT_float_blend")||console.warn("EXT_float_blend not supported"),t.getExtension("OES_texture_float_linear")||console.warn("OES_texture_float_linear not supported"),t.getExtension("OES_texture_float")||console.warn("OES_texture_float not supported"),this.gl=t,t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.DEPTH_TEST),t.depthFunc(t.ALWAYS),this.mainProgram=new V6(t,kL,UL,"main-program-mg"),this.quadProgram=new V6(t,zL,VL,"quad-program");const e=t.createBuffer();if(!e)throw new Error("Failed to create quad buffer");this.quadBuffer=e,t.bindBuffer(t.ARRAY_BUFFER,this.quadBuffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),this.requestTick()}onResize(n,t){this.targetSize.x=Math.ceil(n),this.targetSize.y=Math.ceil(t),this.requestTick()}setStaticMode(n){this.staticMode=n,this.lastFrameTime=performance.now(),this.requestTick()}setFPS(n){this.maxFPS=n}pause(){this.tickHandle&&(cancelAnimationFrame(this.tickHandle),this.tickHandle=0),this.paused=!0}resume(){this.paused=!1,this.requestTick()}async setAlbum(n,t){if(n===void 0||typeof n=="string"&&n.trim().length===0){this.isNoCover=!0;return}let e=null,i=null,a=5;for(;!e&&a>0;)try{typeof n=="string"?!t&&"createImageBitmap"in window?(i=await(await fetch(n)).blob(),e=await m2(URL.createObjectURL(i),!1)):e=await m2(n,t):e=await dv(n)}catch(v){console.warn(`failed on loading album resource, retrying (${a})`,{albumSource:n,error:v}),a--}if(!e){console.error("Failed to load album resource",n),this.isNoCover=!0;return}this.isNoCover=!1;const o=this.reduceImageSizeCanvas,c=o.getContext("2d",{willReadFrequently:!0});if(!c)throw new Error("Failed to create canvas context");c.clearRect(0,0,o.width,o.height);const u=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,f=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;if(u*f===0)throw new Error("Invalid image size");let d=null;try{"createImageBitmap"in window&&(i?(d=await createImageBitmap(i,{resizeWidth:o.width,resizeHeight:o.height,resizeQuality:"low"}),URL.revokeObjectURL(e.src)):d=await createImageBitmap(e,{resizeWidth:o.width,resizeHeight:o.height,resizeQuality:"low"}))}catch(v){console.warn("createImageBitmap failed",v)}d?(c.drawImage(d,0,0),d.close()):c.drawImage(e,0,0,u,f,0,0,o.width,o.height);const m=c.getImageData(0,0,o.width,o.height),y=m.data;for(let v=0;v0)this.meshStates[0].texture.dispose(),this.meshStates[0].texture=new H6(this.gl,m);else{const v=new YL(this.gl,this.mainProgram.attrs.a_pos,this.mainProgram.attrs.a_color,this.mainProgram.attrs.a_uv);v.resetSubdivition(50);const x=Math.random()>.8?PL(6,6):z6[Math.floor(Math.random()*z6.length)];v.resizeControlPoints(x.width,x.height);const b=2/(x.width-1),T=2/(x.height-1);for(const _ of x.conf){const R=v.getControlPoint(_.cx,_.cy);R.location.x=_.x,R.location.y=_.y,R.uRot=_.ur*Math.PI/180,R.vRot=_.vr*Math.PI/180,R.uScale=b*_.up,R.vScale=T*_.vp}v.updateMesh();const C={mesh:v,texture:new H6(this.gl,m),alpha:0};this.meshStates.push(C)}this.requestTick()}setLowFreqVolume(n){this.volume=n/10}setHasLyric(n){}dispose(){super.dispose(),this.tickHandle&&(cancelAnimationFrame(this.tickHandle),this.tickHandle=0),this._disposed=!0,this.mainProgram.dispose(),this.quadProgram.dispose(),this.gl.deleteBuffer(this.quadBuffer),this.fbo&&this.gl.deleteFramebuffer(this.fbo),this.fboTexture&&this.gl.deleteTexture(this.fboTexture);for(const n of this.meshStates)n.mesh.dispose(),n.texture.dispose()}enablePerformanceMonitor(n){this.enablePerformanceMonitoring=n,n&&(this.frameCount=0,this.lastFPSUpdate=performance.now())}getCurrentFPS(){return this.currentFPS}updatePerformanceStats(n){this.enablePerformanceMonitoring&&(this.frameCount++,n-this.lastFPSUpdate>1e3&&(this.currentFPS=this.frameCount,this.frameCount=0,this.lastFPSUpdate=n))}},WL=class extends _r{time=0},pv=class extends fv{canvas;app;curContainer;staticMode=!1;lastContainer=new Set;onTick=n=>{for(const t of this.lastContainer)t.alpha=Wi(t.alpha-n/60),t.alpha<=0&&(this.app.stage.removeChild(t),this.lastContainer.delete(t),t.destroy(!0));if(this.curContainer){this.curContainer.alpha=Math.min(1,this.curContainer.alpha+n/60);const[t,e,i,a]=this.curContainer.children,o=Math.max(this.app.screen.width,this.app.screen.height);t.position.set(this.app.screen.width/2,this.app.screen.height/2),e.position.set(this.app.screen.width/2.5,this.app.screen.height/2.5),i.position.set(this.app.screen.width/2,this.app.screen.height/2),a.position.set(this.app.screen.width/2,this.app.screen.height/2),t.width=o*Math.sqrt(2),t.height=t.width,e.width=o*.8,e.height=e.width,i.width=o*.5,i.height=i.width,a.width=o*.25,a.height=a.width,this.curContainer.time+=n*this.flowSpeed,t.rotation+=n/1e3*this.flowSpeed,e.rotation-=n/500*this.flowSpeed,i.rotation+=n/1e3*this.flowSpeed,a.rotation-=n/750*this.flowSpeed,i.x=this.app.screen.width/2+this.app.screen.width/4*Math.cos(this.curContainer.time/1e3*.75),i.y=this.app.screen.height/2+this.app.screen.width/4*Math.cos(this.curContainer.time/1e3*.75),a.x=this.app.screen.width/2+this.app.screen.width/4*.1+Math.cos(this.curContainer.time*.006*.75),a.y=this.app.screen.height/2+this.app.screen.width/4*.1+Math.cos(this.curContainer.time*.006*.75),this.curContainer.alpha>=1&&this.lastContainer.size===0&&this.staticMode&&this.app.ticker.stop()}};constructor(n){super(n),this.canvas=n,this.app=new sv({view:n,resizeTo:this.canvas,powerPreference:"low-power",backgroundAlpha:1}),this.rebuildFilters(),this.app.ticker.maxFPS=30,this.app.ticker.add(this.onTick),this.app.ticker.start()}onResize(n,t){super.onResize(n,t),this.app.resize(),this.rebuildFilters()}setRenderScale(n){super.setRenderScale(n),this.rebuildFilters()}rebuildFilters(){const n=Math.min(this.canvas.width,this.canvas.height),t=Math.max(this.canvas.width,this.canvas.height),e=new ul;e.saturate(1.2,!1);const i=new ul;i.brightness(.6,!1);const a=new ul;a.contrast(.3,!0);for(const o of this.app.stage.filters??[])o.destroy();this.app.stage.filters=[],this.app.stage.filters.push(new Es(5,1)),this.app.stage.filters.push(new Es(10,1)),this.app.stage.filters.push(new Es(20,2)),this.app.stage.filters.push(new Es(40,2)),this.app.stage.filters.push(new Es(80,2)),n>768&&this.app.stage.filters.push(new Es(160,4)),n>768*2&&this.app.stage.filters.push(new Es(320,4)),this.app.stage.filters.push(e,i,a),this.app.stage.filters.push(new Es(5,1)),Math.random()>.5?(this.app.stage.filters.push(new il({radius:(t+n)/2,strength:1,center:[.25,1]})),this.app.stage.filters.push(new il({radius:(t+n)/2,strength:1,center:[.75,0]}))):(this.app.stage.filters.push(new il({radius:(t+n)/2,strength:1,center:[.75,1]})),this.app.stage.filters.push(new il({radius:(t+n)/2,strength:1,center:[.25,0]})))}setStaticMode(n=!1){this.staticMode=n,this.app.ticker.start()}setFPS(n){this.app.ticker.maxFPS=n}pause(){this.app.ticker.stop(),this.app.render()}resume(){this.app.ticker.start()}setLowFreqVolume(n){}setHasLyric(n){}async setAlbum(n,t){if(!n||typeof n=="string"&&n.trim().length===0)return;let e=null,i=5,a=null;for(;!a?.baseTexture?.resource?.valid&&i>0;)try{typeof n=="string"?e=await m2(n,t):e=await dv(n),a=Qt.from(e,{resourceOptions:{autoLoad:!1}}),await a.baseTexture.resource.load()}catch(m){console.warn(`failed on loading album image, retrying (${i})`,n,m),a=null,i--}if(!a)return;const o=new WL,c=new Ma(a),u=new Ma(a),f=new Ma(a),d=new Ma(a);c.anchor.set(.5,.5),u.anchor.set(.5,.5),f.anchor.set(.5,.5),d.anchor.set(.5,.5),c.rotation=Math.random()*Math.PI*2,u.rotation=Math.random()*Math.PI*2,f.rotation=Math.random()*Math.PI*2,d.rotation=Math.random()*Math.PI*2,o.addChild(c,u,f,d),this.curContainer&&this.lastContainer.add(this.curContainer),this.curContainer=o,this.app.stage.addChild(o),this.curContainer.alpha=0,this.app.ticker.start()}dispose(){super.dispose(),this.app.ticker.remove(this.onTick),this.app.destroy(!0)}getElement(){return this.canvas}},ZL=class yv{element;renderer;constructor(t,e){this.renderer=t,this.element=e,e.style.pointerEvents="none",e.style.zIndex="-1",e.style.contain="strict"}static new(t){const e=document.createElement("canvas");return new yv(new t(e),e)}setRenderScale(t){this.renderer.setRenderScale(t)}setFlowSpeed(t){this.renderer.setFlowSpeed(t)}setStaticMode(t){this.renderer.setStaticMode(t)}setFPS(t){this.renderer.setFPS(t)}pause(){this.renderer.pause()}resume(){this.renderer.resume()}setLowFreqVolume(t){this.renderer.setLowFreqVolume(t)}setHasLyric(t){this.renderer.setHasLyric(t)}setAlbum(t,e){return this.renderer.setAlbum(t,e)}getElement(){return this.element}dispose(){this.renderer.dispose(),this.element.remove()}},Ut={active:"FmKaba_active",bgWrapper:"FmKaba_bgWrapper",bgWrapperActive:"FmKaba_bgWrapperActive",bgWrapperHidden:"FmKaba_bgWrapperHidden",bgWrapperTop:"FmKaba_bgWrapperTop",bottomLine:"FmKaba_bottomLine",disableSpring:"FmKaba_disableSpring",emphasize:"FmKaba_emphasize",emphasizeWrapper:"FmKaba_emphasizeWrapper",enabled:"FmKaba_enabled",hasDuetLine:"FmKaba_hasDuetLine",interludeDots:"FmKaba_interludeDots",lyricBgLine:"FmKaba_lyricBgLine",lyricDuetLine:"FmKaba_lyricDuetLine",lyricLine:"FmKaba_lyricLine",lyricLineWrapper:"FmKaba_lyricLineWrapper",lyricMainLine:"FmKaba_lyricMainLine",lyricSubLine:"FmKaba_lyricSubLine",playing:"FmKaba_playing",romanWord:"FmKaba_romanWord",rubyWord:"FmKaba_rubyWord",tmpDisableTransition:"FmKaba_tmpDisableTransition",wordBody:"FmKaba_wordBody",wordWithRuby:"FmKaba_wordWithRuby"};const KL={normalizeSpaces:!0,resetLineTimestamps:!0,convertExcessiveBackgroundLines:!0,syncMainAndBackgroundLines:!0,cleanUnintentionalOverlaps:!0,tryAdvanceStartTime:!0};function QL(n){for(const t of n)for(const e of t.words)e.word=e.word.replace(/\s+/g," ")}function JL(n){for(const t of n)if(t.words.length===1&&t.words[0].startTime===0&&t.words[0].endTime===0&&(t.startTime!==0||t.endTime!==0))t.words[0].startTime=t.startTime,t.words[0].endTime=t.endTime;else if(t.words.length>0){const e=t.words[0],i=t.words[t.words.length-1];t.startTime=e.startTime,t.endTime=i.endTime}}function tO(n){let t=0;for(const e of n)e.isBG?(t++,t>1&&(e.isBG=!1)):t=0}function eO(n){for(let t=n.length-1;t>=0;t--){const e=n[t];if(e.isBG)continue;const i=n[t+1];if(i?.isBG){const a=[...e.words,...i.words].filter(o=>o.word.trim().length>0);if(a.length>0){const o=Math.min(...a.map(d=>d.startTime)),c=Math.max(...a.map(d=>d.endTime)),u=Math.min(o,e.startTime,i.startTime),f=Math.max(c,e.endTime,i.endTime);e.startTime=u,e.endTime=f,i.startTime=u,i.endTime=f}}}}function nO(n){for(let t=0;t0){const c=(a.endTime-a.startTime)*.1;if(!(o>100&&o>c)){e.endTime=a.startTime;const u=n[t+1];u?.isBG&&(u.endTime=a.startTime)}}}}}function iO(n){let a=0,o=0,c=0,u=0,f=!1;for(let d=0;d=o)x=600,b=u;else{x=400;const R=o-a;b=a+R*.3}else x=600,b=0;const T=m.startTime-x,C=Math.max(b,T);Cc?(c=Math.min(c,y),u=Math.max(u,v)):(c=y,u=v),a=y,o=v,f=!0}}function sO(n,t){const e={...KL,...t};e.normalizeSpaces&&QL(n),e.resetLineTimestamps&&JL(n),e.convertExcessiveBackgroundLines&&tO(n),e.syncMainAndBackgroundLines&&eO(n),e.cleanUnintentionalOverlaps&&nO(n),e.tryAdvanceStartTime&&iO(n)}function rO(n){const t=2.5949095;return n<.5?(2*n)**2*((t+1)*2*n-t)/2:((2*n-2)**2*((t+1)*(n*2-2)+t)+2)/2}function aO(n){return n===1?1:1-2**(-10*n)}var oO=class{element=document.createElement("div");dot0=document.createElement("span");dot1=document.createElement("span");dot2=document.createElement("span");left=0;top=0;playing=!0;lastStyle="";currentInterlude;currentTime=0;targetBreatheDuration=1500;constructor(){this.element.className=Ut.interludeDots,this.element.appendChild(this.dot0),this.element.appendChild(this.dot1),this.element.appendChild(this.dot2)}getElement(){return this.element}setTransform(n=this.left,t=this.top){this.left=n,this.top=t,this.update()}setInterlude(n){this.currentInterlude=n,this.currentTime=n?.[0]??0,n?this.element.classList.add(Ut.enabled):this.element.classList.remove(Ut.enabled)}pause(){this.playing=!1,this.element.classList.remove(Ut.playing)}resume(){this.playing=!0,this.element.classList.add(Ut.playing)}update(n=0){if(!this.playing)return;this.currentTime+=n;let t="";if(t+=`transform:translate(${this.left.toFixed(2)}px, ${this.top.toFixed(2)}px)`,this.currentInterlude){const e=this.currentInterlude[1]-this.currentInterlude[0],i=this.currentTime-this.currentInterlude[0];if(i<=e){const a=e/Math.ceil(e/this.targetBreatheDuration);let o=1,c=1;o*=Math.sin(1.5*Math.PI-i/a*2)/20+1,i<2e3&&(o*=aO(i/2e3)),i<500?c=0:i<1e3&&(c*=(i-500)/500),e-i<750&&(o*=1-rO((750-(e-i))/750/2)),e-i<375&&(c*=si((e-i)/375));const u=Wi(e-750);o=Wi(o)*.7,t+=` scale(${o})`;const f=Os(.25,i*3/u*.75,1),d=Os(.25,(i-u/3)*3/u*.75,1),m=Os(.25,(i-u/3*2)*3/u*.75,1);this.dot0.style.opacity=`${si(c*f)}`,this.dot1.style.opacity=`${si(c*d)}`,this.dot2.style.opacity=`${si(c*m)}`}else t+=" scale(0)",this.dot0.style.opacity="0",this.dot1.style.opacity="0",this.dot2.style.opacity="0";t+=";",this.lastStyle!==t&&(this.element.setAttribute("style",t),this.lastStyle=t)}}dispose(){this.element.remove()}};const p2=[],j6=[];let y2=!1;function lO(){let n=j6.shift();for(;n;){try{n.resolve(n.task())}catch(t){n.reject(t)}n=j6.shift()}for(n=p2.shift();n;){try{n.resolve(n.task())}catch(t){n.reject(t)}n=p2.shift()}y2=!1}function cO(){y2||(y2=!0,requestAnimationFrame(lO))}function uO(n){const t={task:n,resolve:()=>{},reject:()=>{}},e=new Promise((i,a)=>{t.resolve=i,t.reject=a});return p2.push(t),cO(),e}function hO(n){return e=>(n(e+.001)-n(e-.001))/(2*.001)}function q6(n){return hO(n)}var Cl=class{currentPosition=0;targetPosition=0;currentTime=0;params={};currentSolver;getV;getV2;queueParams;queuePosition;constructor(n=0){this.targetPosition=n,this.currentPosition=this.targetPosition,this.currentSolver=()=>this.targetPosition,this.getV=()=>0,this.getV2=()=>0}resetSolver(){const n=this.getV(this.currentTime);this.currentTime=0,this.currentSolver=fO(this.currentPosition,n,this.targetPosition,0,this.params),this.getV=q6(this.currentSolver),this.getV2=q6(this.getV)}arrived(){return Math.abs(this.targetPosition-this.currentPosition)<.01&&this.getV(this.currentTime)<.01&&this.getV2(this.currentTime)<.01&&this.queueParams===void 0&&this.queuePosition===void 0}setPosition(n){this.targetPosition=n,this.currentPosition=n,this.currentSolver=()=>this.targetPosition,this.getV=()=>0,this.getV2=()=>0}update(n=0){this.currentTime+=n,this.currentPosition=this.currentSolver(this.currentTime),this.queueParams&&(this.queueParams.time-=n,this.queueParams.time<=0&&this.updateParams({...this.queueParams})),this.queuePosition&&(this.queuePosition.time-=n,this.queuePosition.time<=0&&this.setTargetPosition(this.queuePosition.position)),this.arrived()&&this.setPosition(this.targetPosition)}updateParams(n,t=0){t>0?this.queueParams={...this.queuePosition??{},...n,time:t}:(this.queuePosition=void 0,this.params={...this.params,...n},this.resetSolver())}setTargetPosition(n,t=0){t>0?this.queuePosition={...this.queuePosition??{},position:n,time:t}:(this.queuePosition=void 0,this.targetPosition=n,this.resetSolver())}getCurrentPosition(){return this.currentPosition}};function fO(n,t,e,i=0,a){const o=a?.soft??!1,c=a?.stiffness??100,u=a?.damping??10,f=a?.mass??1,d=e-n;if(o||1<=u/(2*Math.sqrt(c*f))){const b=-Math.sqrt(c/f),T=-b*d-t;return C=>(C-=i,C<0?n:e-(d+C*T)*Math.E**(C*b))}const m=Math.sqrt(4*f*c-u**2),y=(u*d-2*f*t)/m,v=.5*m/f,x=-(.5*u)/f;return b=>(b-=i,b<0?n:e-(Math.cos(b*v)*d+Math.sin(b*v)*y)*Math.E**(b*x))}var dO=class{lyricPlayer;element=document.createElement("div");left=0;top=0;delay=0;lineSize=[0,0];lineTransforms={posX:new Cl(0),posY:new Cl(0)};isFocused=!1;blur=0;constructor(n){this.lyricPlayer=n,this.element.setAttribute("class",`${Ut.lyricLine} ${Ut.bottomLine}`),this.element.dataset.bottomLine="true",this.rebuildStyle()}async measureSize(){return await uO(()=>[this.element.clientWidth,this.element.clientHeight])}lastStyle="";show(){this.rebuildStyle()}hide(){this.rebuildStyle()}setFocused(n){this.isFocused!==n&&(this.isFocused=n,n?this.element.dataset.focused="true":delete this.element.dataset.focused)}rebuildStyle(){let n=`transform:translate(${this.lineTransforms.posX.getCurrentPosition().toFixed(2)}px,${this.lineTransforms.posY.getCurrentPosition().toFixed(2)}px);`;!this.lyricPlayer.getEnableSpring()&&this.isInSight&&(n+=`transition-delay:${this.delay}ms;`),n+=`filter:blur(${Math.min(5,this.blur)}px);`,n!==this.lastStyle&&(this.lastStyle=n,this.element.setAttribute("style",n))}getElement(){return this.element}setTransform(n=this.left,t=this.top,e=0,i=!1,a=0){this.left=n,this.top=t,this.delay=a*1e3|0,i||!this.lyricPlayer.getEnableSpring()?(this.blur=Math.min(32,e),i&&this.element.classList.add(Ut.tmpDisableTransition),this.lineTransforms.posX.setPosition(n),this.lineTransforms.posY.setPosition(t),this.lyricPlayer.getEnableSpring()?this.rebuildStyle():this.show(),i&&requestAnimationFrame(()=>{this.element.classList.remove(Ut.tmpDisableTransition)})):(this.blur=Math.min(5,e),this.lineTransforms.posX.setTargetPosition(n,a),this.lineTransforms.posY.setTargetPosition(t,a))}update(n=0){this.lyricPlayer.getEnableSpring()&&(this.lineTransforms.posX.update(n),this.lineTransforms.posY.update(n),this.isInSight?this.show():this.hide())}get isInSight(){const n=this.lineTransforms.posX.getCurrentPosition(),t=this.lineTransforms.posY.getCurrentPosition(),e=n+this.lineSize[0],i=t+this.lineSize[1],a=this.lyricPlayer.size[0],o=this.lyricPlayer.size[1];return!(n>a||t>o||e<0||i<0)}dispose(){this.element.remove()}};const Ta={Disabled:"",FullMask:"full-mask",PartialMask:"partial-mask"},vr={SOLID:0,GRADIENT:1},d0={Center:"center",Bottom:"bottom"};function mO(n){const t=n.currentTime+20,e=n.scrollToIndex,i=n.currentGroups,a=o=>{if(o<-1||o>=i.length-1)return;const c=o===-1?null:i[o],u=i[o+1],f=c?c.endTime:0,d=Math.max(f,u.startTime-250);if(!(d-f<4e3)&&d>t&&f=e&&t{e.onBeginScroll()&&(t.isUserScrolling=!0,y.preventDefault(),i=t.scrollOffset,a=y.touches[0].screenY,u=a,o=y.touches[0].screenX,c=y.touches[0].screenY,f=Date.now(),d=0,e.onLayout(!0,!0))}),n.addEventListener("touchmove",y=>{if(e.onBeginScroll()){y.preventDefault();const v=y.touches[0].screenY,x=v-a;t.scrollOffset=i-x,fu(t);const b=Date.now(),T=b-f;T>0&&(d=(v-u)/T),u=v,f=b,e.onLayout(!0,!0)}}),n.addEventListener("touchend",y=>{if(e.onBeginScroll()){y.preventDefault();const v=y.changedTouches[0],x=Math.abs(v.screenX-o),b=Math.abs(v.screenY-c);if(x<10&&b<10){const R=document.elementFromPoint(v.clientX,v.clientY);R instanceof HTMLElement&&e.containsTarget(R)&&e.clickTarget(R),t.isUserScrolling=!1,e.onEndScroll();return}a=0;const T=++m;Math.abs(d)<.1&&(d=0);let C=performance.now();const _=R=>{if(T!==m)return;const L=R-C;if(C=R,L<=0||L>100){requestAnimationFrame(_);return}if(Math.abs(d)>.05){t.scrollOffset-=d*L,fu(t);const P=.95**(L/16);d*=P,e.onLayout(!0,!0),requestAnimationFrame(_)}else t.isUserScrolling=!1,e.onEndScroll()};requestAnimationFrame(_)}else t.isUserScrolling=!1}),n.addEventListener("wheel",y=>{e.onBeginScroll()&&(y.preventDefault(),y.deltaMode===y.DOM_DELTA_PIXEL?(t.scrollOffset+=y.deltaY,fu(t),e.onLayout(!0,!1)):(t.scrollOffset+=y.deltaY*50,fu(t),e.onLayout(!1,!1)))},{passive:!1})}const bO=(n,t)=>n.size===t.size&&[...n].every(e=>t.has(e));function xO(n){const{time:t,currentGroups:e,timelineState:{hotGroups:i,bufferedGroups:a}}=n,o=new Set(i),c=new Set,u=new Set,f=new Set;for(const d of i){const m=e[d];(!m||tt&&!o.has(d)&&(o.add(d),c.add(d))}for(const d of a)o.has(d)||f.add(d);return{nextHotGroups:o,addedIds:c,removedHotIds:u,removedBufferedIds:f}}function CO(n,t,e){if(e.size>0)return Math.min(...e);const i=t.findIndex(a=>a.startTime>=n);return i===-1?t.length:i}function TO(n){const{timelineState:t,time:e,currentGroups:i,hasBottomContent:a,stateResult:o}=n,{addedIds:c,removedHotIds:u,removedBufferedIds:f}=o,{isSeeking:d}=t;t.currentTime=e,t.hotGroups=o.nextHotGroups;let m=!1,y=!1;const v=[],x=new Set;if(d){t.bufferedGroups=new Set([...t.hotGroups]),t.scrollToIndex=CO(e,i,t.bufferedGroups);for(const b of u)x.add(b);for(const b of t.hotGroups)v.push(b);for(const b of f)x.add(b);y=!0,m=!0}else if(c.size>0){for(const b of c)t.bufferedGroups.add(b),v.push(b);for(const b of f)t.bufferedGroups.delete(b),x.add(b);t.bufferedGroups.size>0&&(t.scrollToIndex=Math.min(...t.bufferedGroups)),m=!0}else if(f.size>0&&bO(f,t.bufferedGroups)){for(const b of t.bufferedGroups)t.hotGroups.has(b)||(t.bufferedGroups.delete(b),x.add(b));m=!0}if(t.bufferedGroups.size===0&&i.length>0&&e>=i[i.length-1].endTime){const b=a?i.length:i.length-1;t.scrollToIndex!==b&&(t.scrollToIndex=b,m=!0)}return t.lastCurrentTime=e,{shouldLayout:m,shouldResetScroll:y,groupsToEnable:v,groupsToDisable:[...x]}}var SO=class extends EventTarget{element=document.createElement("div");timelineState={currentTime:0,lastCurrentTime:0,hotGroups:new Set,bufferedGroups:new Set,scrollToIndex:0,isSeeking:!1,isPlaying:!0,initialLayoutFinished:!1};lyricGroupElementMap=new WeakMap;currentLyricLines=[];processedLines=[];lyricLinesIndexes=new WeakMap;isNonDynamic=!1;hasDuetLine=!1;disableSpring=!1;layoutState={interludeDotsSize:[0,0],targetAlignIndex:0,lastInterludeState:!1,alignAnchor:d0.Center,alignPosition:.35,overscanPx:300};interludeDots=new oO;bottomLine=new dO(this);enableBlur=!0;enableScale=!0;maskObsceneWords=Ta.Disabled;maskObsceneWordChar="*";hidePassedLines=!1;scrollState={scrollBoundary:{minOffset:0,maxOffset:0},scrollOffset:0,allowScroll:!0,isScrolled:!1,isUserScrolling:!1};currentLyricGroups=[];lyricGroupSize=new WeakMap;size=[0,0];isPageVisible=!0;optimizeOptions={};alwaysPostpositionBackground=!1;posXSpringParams={mass:1,damping:10,stiffness:100};posYSpringParams={mass:.9,damping:15,stiffness:90};scaleSpringParams={mass:2,damping:25,stiffness:100};scaleForBGSpringParams={mass:1,damping:20,stiffness:50};onPageShow=()=>{this.isPageVisible=!0,this.setCurrentTime(this.timelineState.currentTime,!0)};onPageHide=()=>{this.isPageVisible=!1};scrolledHandler;resizeObserver=new ResizeObserver((n=>{let t=!1,e=!1;for(const i of n)if(i.target===this.element){const a=i.contentRect;this.size[0]=a.width,this.size[1]=a.height,e=!0}else if(i.target===this.interludeDots.getElement())this.layoutState.interludeDotsSize[0]=i.target.clientWidth,this.layoutState.interludeDotsSize[1]=i.target.clientHeight,t=!0;else if(i.target===this.bottomLine.getElement()){const a=[i.target.clientWidth,i.target.clientHeight],o=this.bottomLine.lineSize;(a[0]!==o[0]||a[1]!==o[1])&&(this.bottomLine.lineSize=a,t=!0)}else{const a=this.lyricGroupElementMap.get(i.target);if(a){const o=[i.target.clientWidth,i.target.clientHeight],c=this.lyricGroupSize.get(a)??[0,0];(o[0]!==c[0]||o[1]!==c[1])&&(this.lyricGroupSize.set(a,o),a.onLineSizeChange(o),t=!0)}}t&&this.calcLayout(!0),e&&this.onResize()}));wordFadeWidth=.5;constructor(n){super(),n&&(this.element=n),this.element.classList.add("amll-lyric-player"),this.resizeObserver.observe(this.element),this.resizeObserver.observe(this.interludeDots.getElement()),this.element.appendChild(this.interludeDots.getElement()),this.element.appendChild(this.bottomLine.getElement()),this.interludeDots.setTransform(0,200),window.addEventListener("pageshow",this.onPageShow),window.addEventListener("pagehide",this.onPageHide),vO(this.element,this.scrollState,{onBeginScroll:()=>this.beginScrollHandler(),onEndScroll:()=>this.endScrollHandler(),onLayout:(t,e)=>this.calcLayout(t,e),containsTarget:t=>this.element.contains(t),clickTarget:t=>t.click()})}beginScrollHandler(){const n=this.scrollState.allowScroll;return n&&(this.scrollState.isScrolled=!0,clearTimeout(this.scrolledHandler),this.scrolledHandler=setTimeout(()=>{this.scrollState.isScrolled=!1,this.scrollState.scrollOffset=0},5e3)),n}endScrollHandler(){}setWordFadeWidth(n=.5){this.wordFadeWidth=Math.max(1e-4,n)}setEnableScale(n=!0){this.enableScale=n,this.calcLayout()}getEnableScale(){return this.enableScale}getWordFadeWidth(){return this.wordFadeWidth}setIsSeeking(n){this.timelineState.isSeeking=n}setHidePassedLines(n){this.hidePassedLines=n,this.calcLayout()}setEnableBlur(n){this.enableBlur!==n&&(this.enableBlur=n,this.calcLayout())}setMaskObsceneWords(n){this.maskObsceneWords!==n&&(this.maskObsceneWords=n,this.rebuildLyricLines(),this.calcLayout())}setMaskObsceneWordChar(n){const t=n.charAt(0)||"*";this.maskObsceneWordChar!==t&&(this.maskObsceneWordChar=t,this.maskObsceneWords!==Ta.Disabled&&(this.rebuildLyricLines(),this.calcLayout()))}rebuildLyricLines(){for(const n of this.currentLyricGroups)n.rebuildAllLines()}processObsceneWord(n){const t=n.word;if(!n.obscene||this.maskObsceneWords===Ta.Disabled)return t;const e=this.maskObsceneWordChar;if(this.maskObsceneWords===Ta.FullMask)return t.replace(/\S/g,e);if(this.maskObsceneWords===Ta.PartialMask){const i=t.trim();if(i.length<=2)return t.replace(/\S/g,e);const a=t.indexOf(i),o=a+i.length-1;return t.slice(0,a+1)+t.slice(a+1,o).replace(/\S/g,e)+t.slice(o)}return t}setAlignAnchor(n){this.layoutState.alignAnchor=n}setAlignPosition(n){this.layoutState.alignPosition=n}setOverscanPx(n){this.layoutState.overscanPx=Wi(n|0)}getOverscanPx(){return this.layoutState.overscanPx}setEnableSpring(n=!0){this.disableSpring=!n,n?this.element.classList.remove(Ut.disableSpring):this.element.classList.add(Ut.disableSpring),this.calcLayout(!0)}getEnableSpring(){return!this.disableSpring}setOptimizeOptions(n){this.optimizeOptions={...this.optimizeOptions,...n}}setLyricLines(n,t=0){this.timelineState.initialLayoutFinished=!0,this.timelineState.lastCurrentTime=t,this.timelineState.currentTime=t,this.currentLyricLines=d2(n),this.processedLines=d2(this.currentLyricLines),sO(this.processedLines,this.optimizeOptions),this.isNonDynamic=!0;for(const e of this.processedLines)if(e.words.length>1){this.isNonDynamic=!1;break}this.hasDuetLine=this.processedLines.some(e=>e.isDuet);for(const e of this.currentLyricGroups)e.dispose();this.currentLyricGroups=[],this.interludeDots.setInterlude(void 0),this.timelineState.hotGroups.clear(),this.timelineState.bufferedGroups.clear()}getIsPlaying(){return this.timelineState.isPlaying}setCurrentTime(n,t=!1){n=Math.round(n);const{timelineState:e}=this;if(e.isSeeking=!!t,e.currentTime=n,!e.initialLayoutFinished&&!e.isSeeking)return;const i=xO({time:n,currentGroups:this.currentLyricGroups,timelineState:e}),a=this.bottomLine.getElement().innerHTML.trim().length>0,o=TO({timelineState:e,time:n,currentGroups:this.currentLyricGroups,hasBottomContent:a,stateResult:i});for(const c of o.groupsToDisable)this.currentLyricGroups[c]?.disable();for(const c of o.groupsToEnable)this.currentLyricGroups[c]?.enable();o.shouldResetScroll&&this.resetScroll(),o.shouldLayout&&this.calcLayout()}async calcLayout(n=!1,t=!1){const e=mO({currentTime:this.timelineState.currentTime,scrollToIndex:this.timelineState.scrollToIndex,currentGroups:this.currentLyricGroups}),i=!!e;if(this.layoutState.targetAlignIndex!==this.timelineState.scrollToIndex||this.layoutState.lastInterludeState!==i){this.layoutState.lastInterludeState=i;const P=pO({enabled:this.getEnableSpring(),currentGroups:this.currentLyricGroups,scrollToIndex:this.timelineState.scrollToIndex,isSeeking:this.timelineState.isSeeking,isInterludeActive:i});P.shouldUpdate&&P.params&&this.setLinePosYSpringParams(P.params)}let a=-this.scrollState.scrollOffset;const o=this.timelineState.scrollToIndex;let c=!1;e?c=e.isNextDuet:this.interludeDots.setInterlude(void 0);const u=(this.baseFontSize||24)*.4,f=this.layoutState.interludeDotsSize[1]+u*2;e&&e.anchorLineIndex!==-1&&(a-=f);const d=this.size[1]/5,m=this.currentLyricGroups.slice(0,o).reduce((P,w)=>P+(this.lyricGroupSize.get(w)?.[1]??d),0);this.scrollState.scrollBoundary.minOffset=-m,a-=m,a+=this.size[1]*this.layoutState.alignPosition;const y=this.currentLyricGroups[o];this.layoutState.targetAlignIndex=o;const v=o===this.currentLyricGroups.length;this.bottomLine.setFocused(v);const x=y?this.lyricGroupSize.get(y)?.[1]??d:v?this.bottomLine.lineSize[1]:0;if(x>0)switch(this.layoutState.alignAnchor){case d0.Bottom:a-=x;break;case d0.Center:a-=x/2;break}const b=Math.max(...this.timelineState.bufferedGroups);let T=0,C=n?0:.05,_=!1;this.currentLyricGroups.forEach((P,w)=>{const F=this.timelineState.bufferedGroups.has(w),E=e&&w===e.anchorLineIndex+1;if(!_&&E){_=!0,a+=u;let D=0;e&&c&&(D=this.size[0]-this.layoutState.interludeDotsSize[0]),this.interludeDots.setTransform(D,a),e&&this.interludeDots.setInterlude([e.startTime,e.endTime]),a+=this.layoutState.interludeDotsSize[1],a+=u}const N=yO({groupIndex:w,scrollToIndex:this.timelineState.scrollToIndex,latestIndex:b,hasBuffered:F,hidePassedLines:this.hidePassedLines,isPlaying:this.timelineState.isPlaying,isNonDynamic:this.isNonDynamic,enableBlur:this.enableBlur,isUserScrolling:this.scrollState.isUserScrolling,isCompact:window.innerWidth<=1024,interlude:e});P.setTransform(a,t,T,N.isActive,N.targetOpacity,N.blurLevel),a+=this.lyricGroupSize.get(P)?.[1]??d,a>=0&&!this.timelineState.isSeeking&&(T+=C,w>=this.timelineState.scrollToIndex&&(C/=1.05))}),this.scrollState.scrollBoundary.maxOffset=a+this.scrollState.scrollOffset-this.size[1]/2;const R=this.currentLyricGroups.length,L=gv({enableBlur:this.enableBlur,isUserScrolling:this.scrollState.isUserScrolling,isActive:v,itemIndex:R,scrollToIndex:this.timelineState.scrollToIndex,latestIndex:b,isCompact:window.innerWidth<=1024});this.bottomLine.setTransform(0,a,L,t,T)}setLinePosXSpringParams(n={}){}setLinePosYSpringParams(n={}){this.posYSpringParams={...this.posYSpringParams,...n},this.bottomLine.lineTransforms.posY.updateParams(this.posYSpringParams);for(const t of this.currentLyricGroups)t.posY.updateParams(this.posYSpringParams),t.bgSlideY.updateParams(this.posYSpringParams)}setLineScaleSpringParams(n={}){this.scaleSpringParams={...this.scaleSpringParams,...n},this.scaleForBGSpringParams={...this.scaleForBGSpringParams,...n};for(const t of this.currentLyricGroups)t.mainLine.lineTransforms.scale.updateParams(this.scaleSpringParams),t.bgLine?.lineTransforms.scale.updateParams(this.scaleForBGSpringParams)}pause(){this.interludeDots.pause(),this.timelineState.isPlaying&&(this.timelineState.isPlaying=!1,this.calcLayout())}resume(){this.interludeDots.resume(),this.timelineState.isPlaying||(this.timelineState.isPlaying=!0,this.calcLayout())}update(n=0){this.bottomLine.update(n/1e3),this.interludeDots.update(n)}onResize(){}getBottomLineElement(){return this.bottomLine.getElement()}resetScroll(){gO(this.scrollState),clearTimeout(this.scrolledHandler)}getLyricLines(){return this.currentLyricLines}getCurrentTime(){return this.timelineState.currentTime}setAlwaysPostpositionBackground(n){this.alwaysPostpositionBackground!==n&&(this.alwaysPostpositionBackground=n,this.rebuildLyricLines(),this.calcLayout())}getAlwaysPostpositionBackground(){return this.alwaysPostpositionBackground}getElement(){return this.element}dispose(){this.element.remove(),window.removeEventListener("pageshow",this.onPageShow),window.removeEventListener("pagehide",this.onPageHide)}},_O=class{mainLine;bgLine;posY=new Cl(0);bgSlideY=new Cl(-80);top=0;delay=0;isActive=!1;opacity=1;blur=0;isBgFirst=!1;constructor(n,t){this.mainLine=n,this.bgLine=t}get startTime(){return this.mainLine.getLine().startTime}get endTime(){return this.mainLine.getLine().endTime}onLineSizeChange(n){this.mainLine.onLineSizeChange(n),this.bgLine?.onLineSizeChange(n)}setTransform(n,t,e,i,a,o){this.top=n,this.delay=e,this.isActive=i,this.opacity=a,this.blur=o,this.setLineTransformations(t,e);const c=this.lyricPlayer.getEnableSpring(),u=!this.lyricPlayer.getAlwaysPostpositionBackground()&&this.isBgFirst?80:-80,f=this.lyricPlayer.getIsPlaying(),d=i||!f?0:u;t||!c?(this.posY.setPosition(n),this.bgSlideY.setPosition(d),this.renderStyles()):(this.posY.setTargetPosition(n,e),this.bgSlideY.setTargetPosition(d,e))}setLineTransformations(n,t){const e=this.lyricPlayer.getEnableScale(),i=this.lyricPlayer.getIsPlaying(),a=this.isActive?vr.GRADIENT:vr.SOLID,o=e?97:100;let c=100;!this.isActive&&i&&(c=o),this.mainLine.setTransform(c,1,0,n,t,a);let u=100;!this.isActive&&i&&(u=75),this.bgLine?.setTransform(u,1,0,n,t,a)}update(n){this.lyricPlayer.getEnableSpring()&&(this.posY.update(n),this.bgSlideY.update(n),this.renderStyles()),this.mainLine.update(n),this.bgLine?.update(n)}rebuildAllLines(){this.mainLine.rebuildElement(),this.bgLine?.rebuildElement()}enable(n,t){this.mainLine.enable(n,t),this.bgLine?.enable(n,t)}disable(){this.mainLine.disable(),this.bgLine?.disable()}dispose(){this.mainLine.dispose(),this.bgLine?.dispose()}},AO=class extends _O{lyricPlayer;element;bgWrapper;lastIsActive;constructor(n,t){super(t),this.lyricPlayer=n,this.element=document.createElement("div"),this.element.className=Ut.lyricLineWrapper,this.element.appendChild(t.getElement()),this.posY.setPosition(window.innerHeight*2),n.resizeObserver.observe(this.element)}get isInSight(){const n=this.posY.getCurrentPosition();let t=this.lyricPlayer.lyricGroupSize?.get(this)?.[1];(t===void 0||t===0)&&(t=this.element.clientHeight||0);const e=this.lyricPlayer.size[1],i=this.lyricPlayer.getOverscanPx();return!(n>e+t+i||n<-t-i)}show(){if(!this.element.parentElement){const n=this.lyricPlayer.getElement(),t=this.lyricPlayer.currentLyricGroups,e=t.indexOf(this);let i=null;if(e!==-1){for(let a=e+1;a/^[\p{Unified_Ideograph}\u0800-\u9FFC]+$/u.test(n);var ws=class extends EventTarget{top=0;scale=1;blur=0;opacity=1;delay=0;lineTransforms={scale:new Cl(100)};static wordSegmenter=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;static graphemeSegmenter=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null;setTransform(n=this.scale,t=this.opacity,e=this.blur,i=!1,a=0,o=vr.SOLID){this.scale=n,this.opacity=t,this.blur=e,this.delay=a}rebuildElement(){}static shouldEmphasize(n){return Tl(n.word)?n.endTime-n.startTime>=1e3:n.endTime-n.startTime>=1e3&&n.word.trim().length<=7&&n.word.trim().length>1}dispose(){}};const EO=1e3,wO=.15,MO=.5,RO=.4,LO=.6,OO=/[,.;:!?,。;:!?、)】》」』’”)[\]}>~…]$/;function NO(n,t,e,i){const a=n.length;if(a===0||t<=0)return[];const o=new Set;let c=0;for(const{segment:T,isWordLike:C}of i.segment(e))c>0&&C&&[...T].some(_=>Tl(_))&&o.add(c),c+=T.length;const u=new Int32Array(a+1),f=new Float64Array(a+1);for(let T=0;T=0;T--)for(let C=T+1;C<=a;C++){const _=f[C]-f[T];let R=0;if(_>t)if(C===T+1)R=(_-t)**2*EO;else continue;else R=(t-_)**2;let L=0;if(C0&&b0)return;t.resetDOM();const a=this.mainElement.style.whiteSpace;this.mainElement.style.whiteSpace="nowrap";const o=this.mainElement.parentElement;let c="",u=!1;o&&(c=o.style.transform,c&&c!=="none"&&(o.style.transform="none",u=!0));let f=!1;try{const{childInfos:d,fullText:m}=t.buildChildInfos();let y=d.reduce((b,T)=>b+T.width,0);if(t.needsCalibration){const b=document.createRange();b.selectNodeContents(this.mainElement);const T=b.getBoundingClientRect().width;if(y>0&&T>0){const C=T/y;for(const _ of d)_.width*=C}y=T}const v=Math.max(1,n);if(y<=v){this.lastBalancedContainerWidth=n;return}const x=NO(d,v,m,e);if(x.length===0){this.lastBalancedContainerWidth=n;return}this.isBalancing=!0,f=!0,t.applyBreaks(x,d),this.lastBalancedContainerWidth=n,this.isBalancing=!1}finally{this.mainElement.style.whiteSpace=a,u&&o&&(o.style.transform=c),f&&(this.isBalancing=!1)}}balanceDynamicLineBreaks(n,t){const e=[];this.executeLineBalance(n,{resetDOM:()=>{this.mainElement.querySelectorAll("br").forEach(i=>{i.remove()})},buildChildInfos:()=>{e.length=0;const i=Array.from(this.mainElement.childNodes),a=[],o=document.createRange();for(const c of i)if(c.nodeType===Node.TEXT_NODE){const u=c.textContent??"";if(u.length===0)continue;o.selectNodeContents(c),a.push({width:o.getBoundingClientRect().width,text:u,isSpace:u.trim().length===0}),e.push(c)}else if(c.nodeType===Node.ELEMENT_NODE){const u=c,f=u.getBoundingClientRect(),d=getComputedStyle(u),m=Number.parseFloat(d.marginLeft)||0,y=Number.parseFloat(d.marginRight)||0;a.push({width:Wi(f.width+m+y),text:u.textContent??"",isSpace:!1}),e.push(c)}return{childInfos:a,fullText:a.map(c=>c.text).join("")}},applyBreaks:i=>{for(let a=i.length-1;a>=0;a--){const o=i[a];o>=0&&o{this.mainElement.innerHTML="",this.mainElement.textContent=i},buildChildInfos:()=>{const a=DO();if(!a)return console.debug("Canvas 2D context is not supported, skipping line balancing"),{childInfos:[],fullText:i};a.font=`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`,"letterSpacing"in a&&(a.letterSpacing=t.letterSpacing!=="normal"?t.letterSpacing:"0px"),"wordSpacing"in a&&(a.wordSpacing=t.wordSpacing!=="normal"?t.wordSpacing:"0px");const o=[];for(const{segment:c}of e.segment(i))o.push({width:a.measureText(c).width,text:c,isSpace:c.trim().length===0});return{childInfos:o,fullText:i}},applyBreaks:(a,o)=>{this.mainElement.innerHTML="";const c=new Set(a),u=document.createDocumentFragment();for(let f=0;f{e.length>0&&(t.push(e.length===1?e[0]:[...e]),e=[])},a=o=>{const c=o.word.trim().length===0,u=(o.ruby?.length??0)>0,f=Tl(o.word);!c&&!u&&!f?e.push(o):(i(),t.push(o))};for(const o of n){const c=o.word.trim().length===0,u=o.romanWord??"",f=o.obscene??!1,d=(o.ruby?.length??0)>0;if(c||d){a({...o});continue}const m=o.word.split(IO).filter(b=>b.length>0),y=o.word.replace(FO,"").length||1,v=(o.endTime-o.startTime)/y;let x=0;for(const b of m){if(!b.trim()){const T=o.startTime+x*v;a({word:b,romanWord:"",startTime:T,endTime:T,obscene:f});continue}if(Tl(b)&&b.length>1&&u.trim().length===0){const T=b.split("");for(const C of T){const _=o.startTime+x*v;a({word:C,romanWord:"",startTime:_,endTime:_+v,obscene:f}),x+=1}}else{const T=b.length,C=o.startTime+x*v;a({word:b,romanWord:u,startTime:C,endTime:C+T*v,obscene:f}),x+=T}}}return i(),t}function UO(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function kO(n,t=1,e={x:0,y:0}){const[i,a]=[e.x,e.y];return[n[0]*t,n[1]*t,n[2]*t,n[3],n[4]*t,n[5]*t,n[6]*t,n[7],n[8]*t,n[9]*t,n[10]*t,n[11],n[12]-i*t+i,n[13]-a*t+a,n[14],n[15]]}function zO(n,t=4){const e=(i,a)=>i.toFixed(t);return`matrix3d(${n.map(e).join(", ")})`}const du=32,vv=(n,t)=>e=>si((e-n)/(t-n)),cm=.5,VO=vv(0,cm),GO=vv(cm,1),HO=hv(.2,.4,.58,1),jO=hv(.3,0,.58,1),qO=n=>t=>t=0&&tthis.lyricPlayer.processObsceneWord(c)).join(""),this.setSubLinesText(t,e);return}const i=PO(this.lyricLine.words),a=this.lyricLine.words.some(c=>(c.ruby?.length??0)>0),o=this.lyricLine.words.some(c=>(c.romanWord?.trim().length??0)>0);n.innerHTML="";for(const c of i)this.buildWord(c,n,a,o);this.setSubLinesText(t,e)}setSubLinesText(n,t){n.textContent=this.lyricLine.translatedLyric,t.textContent=this.lyricLine.romanLyric}getRubyCharCount(n){return(n.ruby??[]).reduce((t,e)=>t+e.word.length,0)}getRubySegments(n){return(n.ruby??[]).filter(t=>(t?.word?.trim().length??0)>0)}createWord(n,t,e,i){const a=document.createElement("span"),o=[],c=n.romanWord?.trim()??"",u=e?document.createElement("div"):a;if(e){const d=document.createElement("div"),m=this.getRubySegments(n);for(const y of m){const v=document.createElement("span");v.textContent=y.word,v.dataset.startTime=String(y.startTime),v.dataset.endTime=String(y.endTime),d.appendChild(v)}d.classList.add(Ut.rubyWord),a.classList.add(Ut.wordWithRuby),u.classList.add(Ut.wordBody),a.appendChild(d),a.appendChild(u)}const f=this.lyricPlayer.processObsceneWord(n);if(t){a.classList.add(Ut.emphasize);const d=f.trim();if(ws.graphemeSegmenter)for(const{segment:m}of ws.graphemeSegmenter.segment(d)){const y=document.createElement("span");y.textContent=m,o.push(y),u.appendChild(y)}else for(const m of Array.from(d)){const y=document.createElement("span");y.textContent=m,o.push(y),u.appendChild(y)}}else if(i){const d=document.createElement("div");d.textContent=f.trim(),u.appendChild(d)}else c.length===0&&(u.textContent=f.trim());if(i){const d=document.createElement("div");d.textContent=c.length>0?c:" ",d.classList.add(Ut.romanWord),u.appendChild(d)}return{...n,mainElement:a,subElements:o,elementAnimations:[this.initFloatAnimation(n,a)],maskAnimations:[],width:0,height:0,padding:0,shouldEmphasize:t}}buildWord(n,t,e,i){const a=Array.isArray(n)?n:[n];if(a.length===0)return;if(a.every(d=>!d.word.trim())){const d=a.map(m=>m.word).join("");t.appendChild(document.createTextNode(d));return}const o=a.reduce((d,m)=>(d.endTime=Math.max(d.endTime,m.endTime),d.startTime=Math.min(d.startTime,m.startTime),d.word+=m.word,d),{word:"",romanWord:"",startTime:Number.POSITIVE_INFINITY,endTime:Number.NEGATIVE_INFINITY,wordType:"normal",obscene:!1});let c=a.some(d=>ws.shouldEmphasize(d));Tl(o.word)||(c=c||ws.shouldEmphasize(o));const u=document.createElement("span");u.classList.add(Ut.emphasizeWrapper);const f=[];for(const d of a){if(!d.word.trim()){u.appendChild(document.createTextNode(d.word));continue}const m=this.createWord(d,c,e,i);c&&f.push(...m.subElements),this.splittedWords.push(m),u.appendChild(m.mainElement)}if(c&&this.splittedWords.length>0){const d=this.splittedWords[this.splittedWords.length-1],m=a.reduce((y,v)=>y+this.getRubyCharCount(v),0);d.elementAnimations.push(...this.initEmphasizeAnimation(o,f,o.endTime-o.startTime,o.startTime-this.lyricLine.startTime,m))}t.appendChild(u)}initFloatAnimation(n,t){const e=n.startTime-this.lyricLine.startTime,i=Math.max(1e3,n.endTime-n.startTime);let a=.05;this.lyricLine.isBG&&(a*=2);const o=t.animate([{transform:"translateY(0px)"},{transform:`translateY(${-a}em)`}],{duration:Number.isFinite(i)?i:0,delay:Number.isFinite(e)?e:0,id:"float-word",composite:"add",fill:"both",easing:"ease-out"});return o.pause(),o}initEmphasizeAnimation(n,t,e,i,a){const o=Wi(i);let c=Math.max(1e3,e);const u=a>0?a:Math.max(1,t.length);let f=[],d=c/2e3;d=d>1?Math.sqrt(d):d**3;let m=c/3e3;m=m>1?Math.sqrt(m):m**3,d*=.6,m*=.5,this.lyricLine.words.length>0&&n.word.includes(this.lyricLine.words[this.lyricLine.words.length-1].word)&&(d*=1.6,m*=1.5,c*=1.2),d=Math.min(1.2,d),m=Math.min(.8,m);const y=Number.isFinite(c)?c:0,v=qO(cm);return f=t.flatMap((x,b,T)=>{const C=o+c/2.5/u*b,_=[],R=new Array(du).fill(0).map((F,E)=>{const N=(E+1)/du,D=v(N),k=v(N)*m,U=kO(UO(),1+D*.1*d),G=-D*.03*d*(T.length/2-b),J=-D*.025*d;return{offset:N,transform:`${zO(U,4)} translate(${G}em, ${J}em)`,textShadow:`0 0 ${Math.min(.3,m*.3)}em rgba(255, 255, 255, ${k})`}}),L=x.animate(R,{duration:y,delay:Number.isFinite(C)?C:0,id:`emphasize-word-${x.textContent}-${b}`,iterations:1,composite:"replace",fill:"both"});L.onfinish=()=>{L.pause()},L.pause(),_.push(L);const P=new Array(du).fill(0).map((F,E)=>{const N=(E+1)/du;let D=Math.sin(N*Math.PI);return this.lyricLine.isBG&&(D*=2),{offset:N,transform:`translateY(${-D*.05}em)`}}),w=x.animate(P,{duration:y*1.4,delay:Number.isFinite(C)?C-400:0,id:"emphasize-word-float",iterations:1,composite:"add",fill:"both"});return w.onfinish=()=>{w.pause()},w.pause(),_.push(w),_}),f}get totalDuration(){return this.lyricLine.endTime-this.lyricLine.startTime}onLineSizeChange(n){this.updateMaskImageSync()}updateMaskImageSync(){for(const n of this.splittedWords){const t=n.mainElement;t?(n.padding=Number.parseFloat(getComputedStyle(t).paddingLeft),n.width=t.clientWidth-n.padding*2,n.height=t.clientHeight-n.padding*2):(n.width=0,n.height=0,n.padding=0)}if(this.balancer&&ws.wordSegmenter&&this.balancer.balanceLineBreaks(this.lyricPlayer._getIsNonDynamic(),this.splittedWords.length>0,ws.wordSegmenter),this.lyricPlayer.supportMaskImage?this.generateWebAnimationBasedMaskImage():this.generateCalcBasedMaskImage(),this.isEnabled){const n=this.lyricPlayer.getIsPlaying?.()??!0;this.enable(this.lyricPlayer.getCurrentTime(),n)}}generateCalcBasedMaskImage(){for(const n of this.splittedWords){const t=n.mainElement;if(t){n.width=t.clientWidth,n.height=t.clientHeight;const e=n.height*this.lyricPlayer.getWordFadeWidth(),[i,a]=X6(e/n.width),o=`${a*100}% 100%`;this.lyricPlayer.supportMaskImage?(t.style.maskImage=i,t.style.maskRepeat="no-repeat",t.style.maskOrigin="left",t.style.maskSize=o):(t.style.webkitMaskImage=i,t.style.webkitMaskRepeat="no-repeat",t.style.webkitMaskOrigin="left",t.style.webkitMaskSize=o);const c=n.width+e,u=`clamp(${-c}px,calc(${-c}px + (var(--amll-player-time) - ${n.startTime})*${c/Math.abs(n.endTime-n.startTime)}px),0px) 0px, left top`;t.style.maskPosition=u,t.style.webkitMaskPosition=u}}}generateWebAnimationBasedMaskImage(){const n=Math.max(0,...this.splittedWords.map(t=>t.endTime),this.lyricLine.endTime)-this.lyricLine.startTime;this.splittedWords.forEach((t,e)=>{const i=t.mainElement;if(i){const a=t.height*this.lyricPlayer.getWordFadeWidth(),[o,c]=X6(a/(t.width+t.padding*2)),u=`${c*100}% 100%`;this.lyricPlayer.supportMaskImage?(i.style.maskImage=o,i.style.maskRepeat="no-repeat",i.style.maskOrigin="left",i.style.maskSize=u):(i.style.webkitMaskImage=o,i.style.webkitMaskRepeat="no-repeat",i.style.webkitMaskOrigin="left",i.style.webkitMaskSize=u);const f=this.splittedWords.slice(0,e).reduce((R,L)=>R+L.width,0)+(this.splittedWords[0]?a:0),d=-(t.width+t.padding*2+a),m=R=>Os(R,d,0);let y=-f-t.width-t.padding-a,v=0;const x=[];let b=y,T=0;const C=()=>{const R=y-b,L=si(v),P=L-T,w=Math.abs(P/R);if(y>d&&b0&&b<0){const E=Math.abs(b)*w,N=`${m(y)}px 0`,D={offset:T+E,maskPosition:N};x.push(D)}const F={offset:L,maskPosition:`${m(y)}px 0`};x.push(F),b=y,T=L};C();let _=0;this.splittedWords.forEach((R,L)=>{{const P=R.startTime-this.lyricLine.startTime,w=P-_;v+=w/n,w>0&&C(),_=P}{const P=Wi(R.endTime-R.startTime),w=this.getRubySegments(R),F=w.reduce((E,N)=>E+N.word.length,0);if(F>0){const E=R.width/F;let N=0;for(const U of w){const G=Number.isFinite(U.startTime)?U.startTime:R.startTime,J=Number.isFinite(U.endTime)?U.endTime:R.endTime,tt=Math.max(G,R.startTime),K=Math.min(Math.max(J,tt),R.endTime),A=tt-this.lyricLine.startTime,I=A-_;v+=I/n,I>0&&C(),_=A;const O=Wi(K-tt)/U.word.length;for(let j=0;j0&&C(),_+=O,N++}const D=Math.max(R.endTime-this.lyricLine.startTime,_),k=D-_;v+=k/n,k>0&&C(),_=D}else{const N=R.width/1,D=P/1;for(let k=0;k<1;k++)v+=D/n,y+=N,L===0&&k===0&&(y+=a*1.5),L===this.splittedWords.length-1&&k===0&&(y+=a*.5),D>0&&C(),_+=D}}});for(const R of t.maskAnimations)R.cancel();try{const R=i.animate(x,{duration:n||1,id:`fade-word-${t.word}-${e}`,fill:"both"});R.pause(),t.maskAnimations=[R]}catch(R){console.warn("应用渐变动画发生错误",x,n,R)}}})}getElement(){return this.element}updateMaskAlphaTargets(n){const t=si((n-.97)/.03),e=t*.2+.2,i=t*.8+.2;this.renderMode===vr.SOLID?(this.targetBrightAlpha=e,this.targetDarkAlpha=e):(this.targetBrightAlpha=i,this.targetDarkAlpha=e)}applyAlphaToDom(n){const t=n||.016,e=50,i=7,a=u=>1-Math.exp(-u*t),o=a(this.targetBrightAlpha>this.currentBrightAlpha?e:i);Math.abs(this.targetBrightAlpha-this.currentBrightAlpha)<.001?this.currentBrightAlpha=this.targetBrightAlpha:this.currentBrightAlpha+=(this.targetBrightAlpha-this.currentBrightAlpha)*o;const c=a(this.targetDarkAlpha>this.currentDarkAlpha?e:i);Math.abs(this.targetDarkAlpha-this.currentDarkAlpha)<.001?this.currentDarkAlpha=this.targetDarkAlpha:this.currentDarkAlpha+=(this.targetDarkAlpha-this.currentDarkAlpha)*c,this.element.style.setProperty("--bright-mask-alpha",this.currentBrightAlpha.toFixed(3)),this.element.style.setProperty("--dark-mask-alpha",this.currentDarkAlpha.toFixed(3))}setTransform(n=this.scale,t=1,e=0,i=!1,a=0,o=vr.SOLID){super.setTransform(n,t,e,i,a),this.renderMode=o;const c=this.lyricPlayer.getEnableSpring();this.top=0,this.scale=n,this.delay=a*1e3|0;const u=this.element.children[0];if(u.style.opacity=`${t}`,i||!c){this.blur=Math.min(32,e),this.lineTransforms.scale.setPosition(n),this.rebuildStyle();const f=this.lineTransforms.scale.getCurrentPosition();this.updateMaskAlphaTargets(f/100),this.currentBrightAlpha=this.targetBrightAlpha,this.currentDarkAlpha=this.targetDarkAlpha,this.element.style.setProperty("--bright-mask-alpha",String(this.currentBrightAlpha)),this.element.style.setProperty("--dark-mask-alpha",String(this.currentDarkAlpha))}else this.lineTransforms.scale.setTargetPosition(n),this.blur!==Math.min(5,e)&&(this.blur=Math.min(5,e),this.element.style.filter=`blur(${e.toFixed(3)}px)`)}update(n=0){if(!this.lyricPlayer.getEnableSpring()||(this.lineTransforms.scale.update(n),this.rebuildStyle(),!this.built))return;const t=this.lineTransforms.scale.getCurrentPosition()/100;this.updateMaskAlphaTargets(t),this.applyAlphaToDom(n)}_getDebugTargetPos(){return`[位移: ${this.top}; 缩放: ${this.scale}; 延时: ${this.delay}]`}teardownContent(){this.built&&(this.disposeElements(),this.built=!1)}disposeElements(){this.balancer?.reset();for(const i of this.splittedWords){for(const a of i.elementAnimations)a.cancel();for(const a of i.maskAnimations)a.cancel();for(const a of i.subElements)a.remove(),a.parentNode?.removeChild(a);i.elementAnimations=[],i.maskAnimations=[],i.subElements=[],i.mainElement?.parentNode&&i.mainElement.parentNode.removeChild(i.mainElement)}this.splittedWords=[];const n=this.element.children[0],t=this.element.children[1],e=this.element.children[2];n&&(n.innerHTML=""),t&&(t.innerHTML=""),e&&(e.innerHTML="")}dispose(){this.disposeElements(),this.lyricPlayer.resizeObserver.unobserve(this.element),this.element.remove()}},YO=class extends MouseEvent{lineIndex;line;bgLine;isPropagationStopped=!1;constructor(n,t,e,i){super(`line-${i.type}`,i),this.lineIndex=n,this.line=t,this.bgLine=e}stopPropagation(){this.isPropagationStopped=!0,super.stopPropagation()}stopImmediatePropagation(){this.isPropagationStopped=!0,super.stopImmediatePropagation()}},bv=class extends SO{abortController=new AbortController;currentLyricGroups=[];onResize(){const n=getComputedStyle(this.element);this._baseFontSize=Number.parseFloat(n.fontSize),this.rebuildStyle()}supportPlusLighter=CSS.supports("mix-blend-mode","plus-lighter");supportMaskImage=CSS.supports("mask-image","none");innerSize=[0,0];onMouseEventHandler=n=>{const t=n.target;if(!(t instanceof Element))return;const e=t.closest(`.${Ut.lyricLineWrapper}`);if(!e)return;const i=this.lyricGroupElementMap.get(e);if(!i)return;const a=i.mainLine,o=i.bgLine,c=new YO(this.lyricLinesIndexes.get(a)??-1,a,o,n);(!this.dispatchEvent(c)||c.defaultPrevented)&&n.preventDefault(),c.isPropagationStopped&&(n.stopPropagation(),n.stopImmediatePropagation())};_getIsNonDynamic(){return this.isNonDynamic}_baseFontSize=Number.parseFloat(getComputedStyle(this.element).fontSize);get baseFontSize(){return this._baseFontSize}constructor(){super(),this.onResize(),this.element.classList.add("amll-lyric-player","dom"),this.disableSpring&&this.element.classList.add(Ut.disableSpring),this.element.addEventListener("click",this.onMouseEventHandler,{signal:this.abortController.signal}),this.element.addEventListener("contextmenu",this.onMouseEventHandler,{signal:this.abortController.signal})}rebuildStyle(){}setWordFadeWidth(n=.5){super.setWordFadeWidth(n);for(const t of this.currentLyricGroups)t.mainLine.updateMaskImageSync(),t.bgLine?.updateMaskImageSync()}setLyricLines(n,t=0){super.setLyricLines(n,t),this.hasDuetLine?this.element.classList.add(Ut.hasDuetLine):this.element.classList.remove(Ut.hasDuetLine),this.supportMaskImage||this.element.style.setProperty("--amll-player-time",`${t}`);for(const i of this.currentLyricGroups)i.dispose();this.currentLyricGroups=[];let e=null;for(let i=0;i{const x=X.useRef(null),b=X.useRef(null),T=X.useRef(null),C=d??lm;return X.useEffect(()=>{(T.current!==C||x.current===void 0)&&(T.current=C,x.current?.dispose(),x.current=ZL.new(C))},[C]),X.useEffect(()=>{C&&n&&x.current?.setAlbum(n,t)},[C,n,t]),X.useEffect(()=>{C&&e&&x.current?.setFPS(e)},[C,e]),X.useEffect(()=>{C&&(i===void 0||i?x.current?.resume():x.current?.pause())},[C,i]),X.useEffect(()=>{C&&a&&x.current?.setFlowSpeed(a)},[C,a]),X.useEffect(()=>{C&&x.current?.setStaticMode(c??!1)},[C,c]),X.useEffect(()=>{C&&o&&x.current?.setRenderScale(o??.5)},[C,o]),X.useEffect(()=>{C&&u&&x.current?.setLowFreqVolume(u??1)},[C,u]),X.useEffect(()=>{C&&f!==void 0&&x.current?.setHasLyric(f??!0)},[C,f]),X.useEffect(()=>{if(x.current){const _=x.current.getElement();_.style.width="100%",_.style.height="100%",_.style.minHeight="0",_.style.minWidth="0",_.style.overflow="hidden",b.current?.appendChild(_)}},[x.current]),X.useImperativeHandle(v,()=>({wrapperEl:b.current,bgRender:x.current}),[b.current,x.current]),Y.jsx("div",{style:{display:"contents",...m},...y,ref:b})}),ZO=X.forwardRef(({disabled:n,playing:t,alignAnchor:e,alignPosition:i,enableSpring:a,enableBlur:o,enableScale:c,maskObsceneWordsMode:u,maskObsceneWordChar:f,hidePassedLines:d,optimizeOptions:m,lyricLines:y,currentTime:v,isSeeking:x,wordFadeWidth:b,linePosXSpringParams:T,linePosYSpringParams:C,lineScaleSpringParams:_,bottomLine:R,lyricPlayer:L,onLyricLineClick:P,onLyricLineContextMenu:w,...F},E)=>{const[N,D]=X.useState(),k=X.useRef(null),U=X.useRef(v);return X.useLayoutEffect(()=>{const G=new(L??bv);return D(G),k.current?.appendChild(G.getElement()),()=>{G?.dispose(),D(void 0)}},[L]),X.useLayoutEffect(()=>{m!==void 0&&N?.setOptimizeOptions(m),y!==void 0?(N?.setLyricLines(y,U.current),U.current!==void 0&&N?.setCurrentTime(U.current,!0),N?.update()):(N?.setLyricLines([]),N?.update())},[N,y,m]),X.useEffect(()=>{if(!n){let G=!1,J=-1;const tt=K=>{G||(J===-1&&(J=K),N?.update(K-J),J=K,requestAnimationFrame(tt))};return N?.calcLayout(),requestAnimationFrame(tt),()=>{G=!0}}},[N,n]),X.useEffect(()=>{t!==void 0?t?N?.resume():N?.pause():N?.resume()},[N,t]),X.useEffect(()=>{e!==void 0&&N?.setAlignAnchor(e)},[N,e]),X.useEffect(()=>{d!==void 0&&N?.setHidePassedLines(d)},[N,d]),X.useEffect(()=>{i!==void 0&&N?.setAlignPosition(i)},[N,i]),X.useEffect(()=>{a!==void 0?N?.setEnableSpring(a):N?.setEnableSpring(!0)},[N,a]),X.useEffect(()=>{c!==void 0?N?.setEnableScale(c):N?.setEnableScale(!0)},[N,c]),X.useEffect(()=>{N?.setEnableBlur(o??!0)},[N,o]),X.useLayoutEffect(()=>{v!==void 0?(N?.setCurrentTime(v,x),U.current=v):(N?.setCurrentTime(0),U.current=0)},[N,v,x]),X.useEffect(()=>{N?.setIsSeeking(!!x)},[N,x]),X.useEffect(()=>{N?.setWordFadeWidth(b)},[N,b]),X.useEffect(()=>{T!==void 0&&N?.setLinePosXSpringParams(T)},[N,T]),X.useEffect(()=>{C!==void 0&&N?.setLinePosYSpringParams(C)},[N,C]),X.useEffect(()=>{_!==void 0&&N?.setLineScaleSpringParams(_)},[N,_]),X.useEffect(()=>{u!==void 0?N?.setMaskObsceneWords(u):N?.setMaskObsceneWords(Ta.Disabled)},[N,u]),X.useEffect(()=>{f!==void 0&&N?.setMaskObsceneWordChar(f)},[N,f]),X.useEffect(()=>{if(P){const G=J=>P(J);return N?.addEventListener("line-click",G),()=>N?.removeEventListener("line-click",G)}},[N,P]),X.useEffect(()=>{if(w){const G=J=>w(J);return N?.addEventListener("line-contextmenu",G),()=>N?.removeEventListener("line-contextmenu",G)}},[N,w]),X.useImperativeHandle(E,()=>({wrapperEl:k.current,lyricPlayer:N}),[N]),Y.jsxs(Y.Fragment,{children:[Y.jsx("div",{...F,ref:k}),N?.getBottomLineElement()&&R?$O.createPortal(R,N?.getBottomLineElement()):null]})}),um={},KO=Symbol((um?"production":void 0)!=="production"?"RESET":""),xv=n=>typeof n?.then=="function";function QO(n=()=>{try{return window.localStorage}catch(e){(um?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(e);return}},t){var e;let i,a;const o={getItem:(f,d)=>{var m,y;const v=b=>{if(b=b||"",i!==b){try{a=JSON.parse(b,t?.reviver)}catch{return d}i=b}return a},x=(y=(m=n())==null?void 0:m.getItem(f))!=null?y:null;return xv(x)?x.then(v):v(x)},setItem:(f,d)=>{var m;return(m=n())==null?void 0:m.setItem(f,JSON.stringify(d,void 0))},removeItem:f=>{var d;return(d=n())==null?void 0:d.removeItem(f)}},c=f=>(d,m,y)=>f(d,v=>{let x;try{x=JSON.parse(v||"",t?.reviver)}catch{x=y}m(x)});let u;try{u=(e=n())==null?void 0:e.subscribe}catch{}return!u&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(u=(f,d)=>{if(!(n()instanceof window.Storage))return()=>{};const m=y=>{y.storageArea===n()&&y.key===f&&d(y.newValue)};return window.addEventListener("storage",m),()=>{window.removeEventListener("storage",m)}}),u&&(o.subscribe=c(u)),o}const JO=QO();function ye(n,t,e=JO,i){const a=i?.getOnInit,o=zt(a?e.getItem(n,t):t);return(um?"production":void 0)!=="production"&&(o.debugPrivate=!0),o.onMount=u=>{var f;return u(e.getItem(n,t)),(f=e.subscribe)==null?void 0:f.call(e,n,u,t)},zt(u=>u(o),(u,f,d)=>{const m=typeof d=="function"?d(u(o)):d;return m===KO?(f(o,t),e.removeItem(n)):xv(m)?m.then(y=>(f(o,y),e.setItem(n,y))):(f(o,m),e.setItem(n,m))})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const tN=n=>{const t=Ae.c(10);let e,i;t[0]!==n?({fftData:e,...i}=n,t[0]=n,t[1]=e,t[2]=i):(e=t[1],i=t[2]);const a=X.useRef(null),o=X.useRef(void 0);o.current===void 0&&(o.current=e);let c,u;t[3]!==e?(c=()=>{o.current=e},u=[e],t[3]=e,t[4]=c,t[5]=u):(c=t[4],u=t[5]),X.useEffect(c,u);let f,d;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{const y=a.current;if(y){const x=y.getContext("2d");if(x){let P=function(){if(!(y&&x)||_)return;const w=y.width,F=y.height;(b.width!==w||b.height!==F)&&(y.width=b.width,y.height=b.height);const E=o.current??[];if(R.length!==E.length)R=[...E];else for(let A=0;A0?Math.min(R.length,k):0,G=U>0?L(R,U):[],J=G.length>0?Math.max.apply(Math,G):0;C=Math.max(J*.1+C*.9,100);const tt=w/Math.max(1,G.length);x.strokeStyle="white",x.lineWidth=4*N,x.lineCap="round",x.lineJoin="round";const K=F-tt;for(let A=0;A{for(const F of w)b={width:F.contentRect.width*window.devicePixelRatio,height:F.contentRect.height*window.devicePixelRatio}});T.observe(y);let C=100,_=!1,R=[];const L=function(F,E){const N=F.length;if(E<=0||N===0)return[];if(N===E)return F.slice();const D=new Array(E),k=(N-1)/Math.max(1,E-1);for(let U=0;U{T.disconnect(),_=!0}}}},d=[],t[6]=f,t[7]=d):(f=t[6],d=t[7]),X.useLayoutEffect(f,d);let m;return t[8]!==i?(m=Y.jsx("canvas",{ref:a,...i}),t[8]=i,t[9]=m):m=t[9],m},eN=(n,t)=>Y.jsx("svg",{width:192,height:36,viewBox:"0 0 192 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M139.11 15.884H135.582V23.8C135.582 24.6027 135.732 25.1814 136.03 25.536C136.329 25.872 136.805 26.04 137.458 26.04C137.701 26.04 137.962 26.012 138.242 25.956C138.522 25.9 138.774 25.816 138.998 25.704L139.082 27.86C138.765 27.972 138.41 28.056 138.018 28.112C137.645 28.1867 137.253 28.224 136.842 28.224C135.592 28.224 134.63 27.8787 133.958 27.188C133.305 26.4974 132.978 25.4614 132.978 24.08V15.884H130.43V13.728H132.978V7.92004H135.582V13.728H139.11V15.884ZM117.188 20.692H124.608L120.912 11.396L117.188 20.692ZM114.22 28H111.14L119.736 8.17604H122.256L130.768 28H127.632L125.616 23.128H116.208L114.22 28ZM145.441 15.12C144.713 15.6054 144.181 16.2027 143.845 16.912H143.761C143.761 16.632 143.752 16.2867 143.733 15.876C143.715 15.4467 143.687 15.064 143.649 14.728H141.157C141.195 15.1574 141.223 15.652 141.241 16.212C141.26 16.772 141.269 17.2294 141.269 17.584V28H143.901V20.944C143.901 19.6187 144.219 18.564 144.853 17.78C145.507 16.9774 146.319 16.576 147.289 16.576C147.812 16.576 148.251 16.6694 148.605 16.856C148.96 17.024 149.249 17.2667 149.473 17.584C149.697 17.8827 149.856 18.2467 149.949 18.676C150.043 19.1054 150.089 19.5814 150.089 20.104V28H152.721V20.832C152.721 20.3094 152.777 19.796 152.889 19.292C153.02 18.788 153.216 18.34 153.477 17.948C153.757 17.5374 154.112 17.2107 154.541 16.968C154.971 16.7067 155.484 16.576 156.081 16.576C156.66 16.576 157.136 16.688 157.509 16.912C157.883 17.136 158.181 17.4347 158.405 17.808C158.629 18.1814 158.788 18.6107 158.881 19.096C158.975 19.5814 159.021 20.0947 159.021 20.636V28H161.653V19.768C161.653 19.0214 161.551 18.3214 161.345 17.668C161.159 17.0147 160.86 16.4454 160.449 15.96C160.039 15.4747 159.525 15.092 158.909 14.812C158.293 14.5134 157.556 14.364 156.697 14.364C155.745 14.364 154.868 14.5974 154.065 15.064C153.263 15.512 152.637 16.1654 152.189 17.024C151.779 16.072 151.209 15.3907 150.481 14.98C149.772 14.5694 148.969 14.364 148.073 14.364C147.065 14.364 146.188 14.616 145.441 15.12ZM176.233 21.336C176.233 20.7014 176.131 20.0947 175.925 19.516C175.739 18.9374 175.459 18.4334 175.085 18.004C174.712 17.556 174.245 17.2014 173.685 16.94C173.144 16.6787 172.519 16.548 171.809 16.548C171.1 16.548 170.465 16.6787 169.905 16.94C169.364 17.2014 168.907 17.556 168.533 18.004C168.16 18.4334 167.871 18.9374 167.665 19.516C167.479 20.0947 167.385 20.7014 167.385 21.336C167.385 21.9707 167.479 22.5774 167.665 23.156C167.871 23.7347 168.16 24.248 168.533 24.696C168.907 25.144 169.364 25.4987 169.905 25.76C170.465 26.0214 171.1 26.152 171.809 26.152C172.519 26.152 173.144 26.0214 173.685 25.76C174.245 25.4987 174.712 25.144 175.085 24.696C175.459 24.248 175.739 23.7347 175.925 23.156C176.131 22.5774 176.233 21.9707 176.233 21.336ZM178.977 21.336C178.977 22.3627 178.791 23.3054 178.417 24.164C178.063 25.0227 177.559 25.7694 176.905 26.404C176.271 27.02 175.515 27.5054 174.637 27.86C173.76 28.196 172.817 28.364 171.809 28.364C170.801 28.364 169.859 28.196 168.981 27.86C168.104 27.5054 167.348 27.02 166.713 26.404C166.079 25.7694 165.575 25.0227 165.201 24.164C164.847 23.3054 164.669 22.3627 164.669 21.336C164.669 20.3094 164.847 19.376 165.201 18.536C165.575 17.6774 166.079 16.94 166.713 16.324C167.348 15.708 168.104 15.232 168.981 14.896C169.859 14.5414 170.801 14.364 171.809 14.364C172.817 14.364 173.76 14.5414 174.637 14.896C175.515 15.232 176.271 15.708 176.905 16.324C177.559 16.94 178.063 17.6774 178.417 18.536C178.791 19.376 178.977 20.3094 178.977 21.336ZM187.975 16.912C188.517 17.2107 188.937 17.6027 189.235 18.088L191.055 16.548C190.57 15.8387 189.879 15.2974 188.983 14.924C188.106 14.5507 187.191 14.364 186.239 14.364C185.605 14.364 184.989 14.448 184.391 14.616C183.794 14.7654 183.262 15.008 182.795 15.344C182.329 15.6614 181.946 16.0814 181.647 16.604C181.367 17.108 181.227 17.7147 181.227 18.424C181.227 19.04 181.339 19.5627 181.563 19.992C181.806 20.4027 182.114 20.748 182.487 21.028C182.861 21.308 183.271 21.532 183.719 21.7C184.186 21.8494 184.643 21.98 185.091 22.092C186.23 22.3534 187.089 22.6334 187.667 22.932C188.265 23.2307 188.563 23.688 188.563 24.304C188.563 24.6774 188.489 24.9854 188.339 25.228C188.19 25.4707 187.985 25.6667 187.723 25.816C187.481 25.9654 187.201 26.0774 186.883 26.152C186.585 26.208 186.267 26.236 185.931 26.236C185.185 26.236 184.494 26.0587 183.859 25.704C183.243 25.3494 182.758 24.9107 182.403 24.388L180.527 25.984C181.162 26.7867 181.955 27.384 182.907 27.776C183.878 28.168 184.867 28.364 185.875 28.364C186.547 28.364 187.201 28.2894 187.835 28.14C188.47 27.9907 189.03 27.748 189.515 27.412C190.019 27.0574 190.421 26.6094 190.719 26.068C191.018 25.5267 191.167 24.864 191.167 24.08C191.167 23.5014 191.055 22.9974 190.831 22.568C190.607 22.1387 190.29 21.7747 189.879 21.476C189.487 21.1587 189.021 20.8974 188.479 20.692C187.938 20.4867 187.35 20.3094 186.715 20.16C185.707 19.936 184.951 19.6934 184.447 19.432C183.943 19.152 183.691 18.732 183.691 18.172C183.691 17.8547 183.757 17.5934 183.887 17.388C184.037 17.164 184.223 16.9867 184.447 16.856C184.69 16.7067 184.961 16.604 185.259 16.548C185.558 16.4734 185.857 16.436 186.155 16.436C186.827 16.436 187.434 16.5947 187.975 16.912ZM2.95973 27.9533H0V7.93701H2.95973C8.48624 7.93701 12.9927 12.4323 12.9927 17.9451C12.9927 23.4579 8.48624 27.9533 2.95973 27.9533ZM25.5841 7.93701H28.5439V27.9533H25.5841C20.0576 27.9533 15.5511 23.4579 15.5511 17.9451C15.5511 12.4323 20.0576 7.93701 25.5841 7.93701ZM34.6222 7.93701H41.8682C47.4003 7.93701 51.9012 12.4268 51.9012 17.9451C51.9012 23.4635 47.4003 27.9533 41.8682 27.9533H34.6222V7.93701ZM37.6627 24.9175H41.8682C45.717 24.9175 48.8579 21.7871 48.8579 17.9424C48.8579 14.1031 45.7198 10.97 41.8682 10.97H37.6627V24.9175ZM53.4424 21.0365C53.4424 17.2112 56.561 14.1003 60.3958 14.1003C64.2307 14.1003 67.3492 17.2112 67.3492 21.0365C67.3492 24.8619 64.2307 27.9727 60.3958 27.9727C56.561 27.9727 53.4424 24.8619 53.4424 21.0365ZM56.2043 21.0115C56.2043 23.305 58.0687 25.1927 60.3958 25.1927C62.6978 25.1927 64.5874 23.3301 64.5874 21.0115C64.5874 18.718 62.695 16.8303 60.3958 16.8303C58.0966 16.8303 56.2043 18.6902 56.2043 21.0115ZM73.3574 27.9755H70.3168V7.93979H73.3574V27.9755ZM79.9647 15.3514C81.0906 14.5646 82.4618 14.1003 83.9389 14.1003C87.7709 14.1003 90.8895 17.2112 90.8923 21.0365C90.8923 24.8619 87.7737 27.9727 83.9389 27.9727C82.4618 27.9727 81.0934 27.5084 79.9647 26.7217V27.9755H76.9158V7.93979H79.9647V15.3514ZM79.9647 22.3292C80.5165 23.9861 82.08 25.1927 83.9389 25.1927C86.2381 25.1927 88.1304 23.3328 88.1304 21.0115C88.1304 18.718 86.2381 16.8303 83.9389 16.8303C82.0995 16.8303 80.5221 18.023 79.9647 19.691C79.8254 20.1052 79.7473 20.55 79.7473 21.0115C79.7473 21.473 79.8254 21.915 79.9647 22.3292ZM99.0715 22.9937L103.035 14.1059H106.357C105.983 14.9363 103.631 20.1804 101.593 24.7238C99.933 28.4242 98.4816 31.6599 98.4778 31.6674C97.5944 33.6468 95.2589 34.5419 93.283 33.6607L92.2295 33.1908L92.224 33.1881L93.453 30.4386L93.8905 30.6332C94.7043 30.9974 95.6658 30.6276 96.0309 29.8131C96.0337 29.8048 97.4104 26.7161 97.4104 26.7161L91.7864 14.1059H95.1084L99.0715 22.9937Z",fill:"currentColor"})}),Y6=X.forwardRef(eN),nN=(n,t)=>Y.jsxs("svg",{width:30,height:20,viewBox:"0 0 30 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:[Y.jsx("g",{clipPath:"url(#clip0_207_8)",children:Y.jsx("path",{d:"M16.0117 1.81812C18.4258 1.81812 19.8776 4.78099 20.958 7.92092L21.0631 8.23024L21.1659 8.54011L21.2666 8.84995C21.5987 9.88202 21.8972 10.9037 22.1828 11.8167C22.839 8.96008 22.4949 8.34671 23.1979 8.34671C23.4594 8.34671 23.724 8.53256 23.724 8.87123C23.724 9.0083 23.5105 10.461 23.2136 11.9166L23.1588 12.1809L23.1023 12.4436C23.0068 12.8791 22.9051 13.3002 22.8009 13.6704C25.8224 21.9469 28.0659 11.0453 28.3194 8.81691C28.3564 8.49556 28.5879 8.34672 28.8219 8.34672C29.1344 8.34672 29.3907 8.59283 29.3418 8.96318C28.8009 12.5671 27.9689 18.1818 24.5482 18.1818C22.6604 18.1818 21.5992 16.6374 20.7611 14.8678C20.179 13.6722 19.6841 12.2511 19.2288 10.8221L19.1203 10.4791C19.0844 10.3648 19.0487 10.2505 19.0132 10.1364L18.9073 9.79479C17.8713 6.44275 16.9926 3.33702 15.6457 3.33702C14.9875 3.33702 14.4995 4.05555 14.4657 4.05555C14.4036 4.05555 14.3548 3.76279 13.7401 2.96069C14.3251 2.26231 15.1314 1.81812 16.0117 1.81812ZM4.80934 1.82692C10.1957 1.82692 10.6747 16.6849 13.7232 16.6849C14.0811 16.6849 14.4669 16.4581 14.8886 15.9443C15.122 16.3577 15.3613 16.7247 15.6089 17.0478C15.0004 17.774 14.2433 18.1812 13.2952 18.1812C9.88906 18.1807 8.42559 12.2177 7.16605 8.19178C6.86941 9.48319 6.71544 10.6519 6.65516 11.1766C6.61775 11.5101 6.38397 11.662 6.14846 11.662C5.88728 11.662 5.62398 11.4752 5.62398 11.1416C5.62398 11.1167 5.62545 11.091 5.62848 11.0646C5.80292 9.74118 6.15443 7.73614 6.54802 6.3382C6.02411 4.90309 5.36971 3.33458 4.40561 3.33458C2.45924 3.33458 1.34461 8.44844 1.03117 11.1766C0.993764 11.5101 0.759979 11.662 0.524468 11.662C0.263303 11.662 0 11.4752 0 11.1416C0 11.1167 0.00146422 11.091 0.00449843 11.0646C0.0496669 10.7219 0.0980906 10.373 0.15073 10.0213L0.196904 9.71916C0.204779 9.66871 0.212746 9.61823 0.220807 9.56772L0.27033 9.26437C0.887195 5.57133 2.03712 1.82692 4.80934 1.82692ZM10.3981 1.81878C11.3654 1.81878 12.4031 2.34503 13.2976 3.57969C13.3476 3.63964 13.849 4.45427 14.0072 4.73669C14.554 5.77231 15.0302 7.038 15.4694 8.354L15.5832 8.69833C16.8447 12.5534 17.8174 16.7028 19.3326 16.7028C19.6918 16.7028 20.0814 16.4697 20.5126 15.9442C20.746 16.3575 20.9852 16.7245 21.2329 17.0476C20.6259 17.7724 19.8691 18.1812 18.9192 18.1812C13.565 18.1804 12.983 3.3313 10.0333 3.3313C9.36758 3.3313 8.87559 4.05559 8.84162 4.05559C8.7795 4.05559 8.7307 3.76287 8.11611 2.96083C8.7168 2.24348 9.52906 1.81878 10.3981 1.81878Z",fill:"currentColor"})}),Y.jsx("defs",{children:Y.jsx("clipPath",{id:"clip0_207_8",children:Y.jsx("rect",{width:30,height:20,fill:"currentColor"})})})]}),iN=X.forwardRef(nN);var ya={audioQualityTag:"nNqm_a_audioQualityTag",clickable:"nNqm_a_clickable",commonTag:"nNqm_a_commonTag",commonTagText:"nNqm_a_commonTagText",dolbyLogoGlow:"nNqm_a_dolbyLogoGlow"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const sN={hide:{opacity:0,scale:.8,transition:{duration:.25,ease:"circIn"}},show:{opacity:1,scale:1,transition:{duration:1,ease:[0,.71,.2,1.01]}},hover:{scale:.95},active:{scale:.9}},rN={hide:{opacity:0,scale:.8,transition:{duration:.25,ease:"circIn"}},show:{opacity:[0,1],scale:1,transition:{duration:1,ease:[0,.71,.2,1.01]}},hover:{scale:.95},active:{scale:.9}},aN=X.memo(X.forwardRef((n,t)=>{const e=Ae.c(21);let i,a,o,c,u,f;e[0]!==n?({tagText:f,tagIcon:u,isDolbyAtmos:a,className:i,onClick:o,...c}=n,e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=c,e[5]=u,e[6]=f):(i=e[1],a=e[2],o=e[3],c=e[4],u=e[5],f=e[6]);const d=o&&ya.clickable;let m;e[7]!==i||e[8]!==d?(m=nn(i,ya.audioQualityTag,d),e[7]=i,e[8]=d,e[9]=m):m=e[9];let y;e[10]!==a||e[11]!==o||e[12]!==u||e[13]!==f?(y=a?Y.jsxs(Yn.div,{initial:"hide",animate:"show",whileHover:o?"hover":void 0,whileTap:o?"active":void 0,exit:"hide",className:ya.dolbyLogo,variants:rN,children:[Y.jsx(Y6,{className:ya.dolbyLogoGlow}),Y.jsx(Y6,{})]},"dolby-atmos"):Y.jsx(Yn.div,{initial:"hide",animate:"show",whileHover:o?"hover":void 0,whileTap:o?"active":void 0,exit:"hide",variants:sN,children:Y.jsxs("div",{className:ya.commonTag,children:[u&&Y.jsx(iN,{height:"11px"}),f&&Y.jsx("div",{className:ya.commonTagText,children:f})]})},`common-tag-${u}-${f}`),e[10]=a,e[11]=o,e[12]=u,e[13]=f,e[14]=y):y=e[14];let v;return e[15]!==o||e[16]!==t||e[17]!==c||e[18]!==m||e[19]!==y?(v=Y.jsx("div",{className:m,onClick:o,ref:t,...c,children:y}),e[15]=o,e[16]=t,e[17]=c,e[18]=m,e[19]=y,e[20]=v):v=e[20],v}));var p0={inner:"ah9gFq_inner",nowPlayingSlider:"ah9gFq_nowPlayingSlider",thumb:"ah9gFq_thumb"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const $6=12/2,W6=12,Cv=({className:n,style:t,value:e,min:i,max:a,isPlaying:o=!1,onChange:c,onAfterChange:u,onBeforeChange:f,onSeeking:d,beforeIcon:m,afterIcon:y,changeOnDrag:v=!1})=>{const x=X.useRef(null),b=X.useRef(null),T=X.useRef(null),C=X.useRef(!1),_=Vu(0),R=$2(_,[0,1],[0,1]),L=Vu($6),P=iw`inset(${L}px 0px round 100px)`,w=ow(0,{damping:12,stiffness:300}),F=X.useRef(!1),E=X.useRef(e);X.useEffect(()=>{if(F.current)return;E.current=e;const A=Math.max(0,Math.min(1,(e-i)/(a-i)));_.set(A)},[e,i,a,_]),lw((A,I)=>{if(o&&!F.current){E.current+=I,E.current>a&&(E.current=a);const O=Math.max(0,Math.min(1,(E.current-i)/(a-i)));_.set(O)}});const N=()=>{t5(L,0,{type:"tween",ease:"easeOut",duration:.28})},D=()=>{t5(L,$6,{type:"spring",damping:12,stiffness:200})},k=A=>{F.current=!0,b.current&&(T.current=b.current.getBoundingClientRect()),N(),f?.(),d?.(!0)},U=(A,I)=>{const O=T.current;if(!O)return;const j=(I.point.x-O.left)/O.width;j<0?w.set(Math.tanh(j*2)*W6):j>1?w.set(Math.tanh((j-1)*2)*W6):w.set(0);const V=Math.max(0,Math.min(1,j)),M=i+V*(a-i);E.current=M,_.set(V),v&&c?.(M)},G=()=>{F.current=!1,T.current=null,C.current?N():D(),w.set(0),d?.(!1),c?.(E.current),u?.(E.current)},J=()=>{C.current=!0,F.current||N()},tt=()=>{C.current=!1,F.current||D()},K=(A,I)=>{const O=b.current?.getBoundingClientRect();if(!O)return;const j=Math.max(0,Math.min(1,(I.point.x-O.left)/O.width)),V=i+j*(a-i);E.current=V,_.set(j),f?.(),c?.(V),u?.(V)};return Y.jsxs(Yn.div,{ref:x,className:nn(p0.nowPlayingSlider,n),style:{...t,x:w},onPanStart:k,onPan:U,onPanEnd:G,onTap:K,onHoverStart:J,onHoverEnd:tt,children:[m,Y.jsx(Yn.div,{ref:b,className:p0.inner,style:{clipPath:P},children:Y.jsx(Yn.div,{className:p0.thumb,style:{scaleX:R,originX:0}})}),y]})};var oN={controlThumb:"OWkF6W_controlThumb"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const lN=n=>{const t=Ae.c(25);let e,i,a;t[0]!==n?({onClick:i,className:e,...a}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a):(e=t[1],i=t[2],a=t[3]);const o=X.useRef(null),c=X.useRef(!1);let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u={x:-25,y:-4},t[4]=u):u=t[4];const[f,d]=X.useState(u);let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=N=>{const D=o.current;if(D&&c.current){const k=D.getBoundingClientRect(),U=(N.clientX-k.left)/2,G=(N.clientY-k.top)/2;Math.abs(U)>25||Math.abs(G)>25?d({x:-25,y:-4}):d({x:U-12.5,y:G-12.5})}},t[5]=m):m=t[5];const y=m;let v;t[6]!==e?(v=nn(oN.controlThumb,e),t[6]=e,t[7]=v):v=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x={rest:{width:50,height:8},hover:{width:25,height:25}},t[8]=x):x=t[8];let b;t[9]!==f?(b={...f},t[9]=f,t[10]=b):b=t[10];let T;t[11]===Symbol.for("react.memo_cache_sentinel")?(T={scale:.9},t[11]=T):T=t[11];let C,_,R,L;t[12]===Symbol.for("react.memo_cache_sentinel")?(_={type:"spring",duration:.5},R=N=>{y(N.nativeEvent)},L=N=>{y(N),c.current=!0},C=()=>{c.current=!1,d({x:-25,y:-4})},t[12]=C,t[13]=_,t[14]=R,t[15]=L):(C=t[12],_=t[13],R=t[14],L=t[15]);let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=Y.jsx(Yn.div,{variants:{rest:{height:0,width:0,marginTop:0,marginLeft:25,rotate:0},hover:{height:2,width:15,marginTop:-1,marginLeft:5,rotate:45}},transition:{type:"spring",duration:.5}}),t[16]=P):P=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=Y.jsx(Yn.div,{variants:{rest:{height:0,width:0,marginTop:0,marginLeft:25,rotate:0},hover:{height:2,width:15,marginTop:-1,marginLeft:5,rotate:-45}},transition:{type:"spring",duration:.5}}),t[17]=w):w=t[17];let F;t[18]!==i||t[19]!==b?(F=Y.jsxs(Yn.button,{type:"button",variants:x,animate:b,whileTap:T,whileHover:"hover",initial:"rest",transition:_,onMouseMove:R,onHoverStart:L,onHoverEnd:C,onClick:i,children:[P,w]}),t[18]=i,t[19]=b,t[20]=F):F=t[20];let E;return t[21]!==a||t[22]!==F||t[23]!==v?(E=Y.jsx("div",{className:v,ref:o,...a,children:F}),t[21]=a,t[22]=F,t[23]=v,t[24]=E):E=t[24],E};var Yo={cover:"Q2PpKa_cover",coverInner:"Q2PpKa_coverInner",musicPaused:"Q2PpKa_musicPaused"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const cN=X.forwardRef((n,t)=>{const e=Ae.c(33);let i,a,o,c,u,f,d;e[0]!==n?({coverUrl:o,coverIsVideo:a,coverVideoPaused:c,className:i,musicPaused:u,pauseShrinkAspect:f,...d}=n,e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=c,e[5]=u,e[6]=f,e[7]=d):(i=e[1],a=e[2],o=e[3],c=e[4],u=e[5],f=e[6],d=e[7]);const m=X.useRef(null),y=u&&Yo.musicPaused;let v;e[8]!==i||e[9]!==y?(v=nn(Yo.cover,y,i),e[8]=i,e[9]=y,e[10]=v):v=e[10];const x=v,b=X.useRef(null);let T,C;e[11]!==c?(T=()=>{const G=b.current;G&&(c?G.pause():G.play())},C=[c],e[11]=c,e[12]=T,e[13]=C):(T=e[12],C=e[13]),X.useEffect(T,C);const[_,R]=X.useState(20);let L,P;e[14]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{const G=m.current;if(G){const J=()=>{const K=Math.min(G.clientWidth,G.clientHeight);R(Math.max(K*.02,window.innerHeight*.007))},tt=new ResizeObserver(J);return J(),tt.observe(G),()=>{tt.disconnect()}}},P=[],e[14]=L,e[15]=P):(L=e[14],P=e[15]),X.useLayoutEffect(L,P);const w=f??.75;let F;e[16]!==w?(F={"--scale-level":w},e[16]=w,e[17]=F):F=e[17];const E=F;let N;e[18]!==t?(N=G=>{m.current=G,typeof t=="function"?t(G):t&&(t.current=G)},e[18]=t,e[19]=N):N=e[19];let D;e[20]!==a||e[21]!==o||e[22]!==f?(D=a?Y.jsx("video",{className:Yo.coverInner,src:o,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,crossOrigin:"anonymous",ref:b}):Y.jsx("div",{className:Yo.coverInner,style:{backgroundImage:`url(${o})`,"--scale-level":f??.75}}),e[20]=a,e[21]=o,e[22]=f,e[23]=D):D=e[23];let k;e[24]!==_||e[25]!==D?(k=Y.jsx(Uw,{cornerRadius:_,cornerSmoothing:.7,className:Yo.coverInner,children:D}),e[24]=_,e[25]=D,e[26]=k):k=e[26];let U;return e[27]!==x||e[28]!==d||e[29]!==N||e[30]!==k||e[31]!==E?(U=Y.jsx("div",{className:x,style:E,ref:N,...d,children:k}),e[27]=x,e[28]=d,e[29]=N,e[30]=k,e[31]=E,e[32]=U):U=e[32],U});var Z6={animate:"_7JvWRa_animate",mediaButton:"_7JvWRa_mediaButton"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const $o=X.memo(n=>{const t=Ae.c(21);let e,i,a,o,c,u;t[0]!==n?({className:i,children:e,type:u,onClick:o,onAnimationEnd:a,...c}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a,t[4]=o,t[5]=c,t[6]=u):(e=t[1],i=t[2],a=t[3],o=t[4],c=t[5],u=t[6]);const f=u===void 0?"button":u,[d,m]=X.useState(!1);let y;t[7]!==o?(y=_=>{m(!0),o?.(_)},t[7]=o,t[8]=y):y=t[8];const v=y;let x;t[9]!==a?(x=_=>{m(!1),a?.(_)},t[9]=a,t[10]=x):x=t[10];const b=x;let T;t[11]!==i||t[12]!==d?(T=nn(Z6.mediaButton,{[Z6.animate]:d},i),t[11]=i,t[12]=d,t[13]=T):T=t[13];let C;return t[14]!==e||t[15]!==b||t[16]!==v||t[17]!==c||t[18]!==T||t[19]!==f?(C=Y.jsx("button",{className:T,type:f,onClick:v,onAnimationEnd:b,...c,children:e}),t[14]=e,t[15]=b,t[16]=v,t[17]=c,t[18]=T,t[19]=f,t[20]=C):C=t[20],C}),uN=(n,t)=>Y.jsx("svg",{id:"vector",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",ref:t,...n,children:Y.jsx("path",{d:"M5.5161,14.1665C5.8687,14.1665 6.1856,14.083 6.467,13.916C6.7485,13.749 6.9742,13.5264 7.1443,13.248C7.3144,12.9697 7.3994,12.6574 7.3994,12.311C7.3994,11.7977 7.217,11.3601 6.8521,10.9983C6.4871,10.6365 6.0418,10.4556 5.5161,10.4556C5.1759,10.4556 4.8652,10.5391 4.5837,10.7061C4.3023,10.873 4.0781,11.0972 3.9111,11.3787C3.7441,11.6601 3.6606,11.9709 3.6606,12.311C3.6606,12.6574 3.7441,12.9697 3.9111,13.248C4.0781,13.5264 4.3023,13.749 4.5837,13.916C4.8652,14.083 5.1759,14.1665 5.5161,14.1665ZM12.4092,14.1665C12.7555,14.1665 13.0679,14.083 13.3462,13.916C13.6245,13.749 13.8472,13.5264 14.0142,13.248C14.1812,12.9697 14.2646,12.6574 14.2646,12.311C14.2646,11.7977 14.0837,11.3601 13.7219,10.9983C13.3601,10.6365 12.9225,10.4556 12.4092,10.4556C12.069,10.4556 11.7582,10.5391 11.4768,10.7061C11.1954,10.873 10.9727,11.0972 10.8088,11.3787C10.6449,11.6601 10.563,11.9709 10.563,12.311C10.563,12.6574 10.6449,12.9697 10.8088,13.248C10.9727,13.5264 11.1954,13.749 11.4768,13.916C11.7582,14.083 12.069,14.1665 12.4092,14.1665ZM19.3022,14.1665C19.6424,14.1665 19.9532,14.083 20.2346,13.916C20.516,13.749 20.7402,13.5264 20.9072,13.248C21.0742,12.9697 21.1577,12.6574 21.1577,12.311C21.1577,11.7977 20.9768,11.3601 20.615,10.9983C20.2532,10.6365 19.8156,10.4556 19.3022,10.4556C18.9559,10.4556 18.6405,10.5391 18.356,10.7061C18.0715,10.873 17.8457,11.0972 17.6787,11.3787C17.5117,11.6601 17.4282,11.9709 17.4282,12.311C17.4282,12.6574 17.5117,12.9697 17.6787,13.248C17.8457,13.5264 18.0715,13.749 18.356,13.916C18.6405,14.083 18.9559,14.1665 19.3022,14.1665Z",fill:"currentColor",fillRule:"nonzero",id:"path_0"})}),hN=X.forwardRef(uN);var fN={menuButton:"GOs7HW_menuButton"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const dN=X.memo(n=>{const t=Ae.c(9);let e,i;if(t[0]!==n){const{className:u,type:f,...d}=n;e=u,i=d,t[0]=n,t[1]=e,t[2]=i}else e=t[1],i=t[2];let a;t[3]!==e?(a=nn(fN.menuButton,e),t[3]=e,t[4]=a):a=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=Y.jsx(hN,{}),t[5]=o):o=t[5];let c;return t[6]!==i||t[7]!==a?(c=Y.jsx("button",{className:a,type:"button",...i,children:o}),t[6]=i,t[7]=a,t[8]=c):c=t[8],c});var mu={animating:"Dbqjoq_animating",textMarquee:"Dbqjoq_textMarquee"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const y0=X.memo(n=>{const t=Ae.c(15);let e,i,a;t[0]!==n?({children:e,className:i,...a}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a):(e=t[1],i=t[2],a=t[3]);const o=X.useRef(null),c=X.useRef(null);let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,t[4]=u):u=t[4];const f=X.useRef(u);let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{if(c.current&&o.current){const C=o.current.clientWidth,_=c.current.clientWidth;if(_<=C*.95)return;o.current?.classList.add(mu.animating);const R=_-C*.95,L=c.current.animate([{transform:"translateX(0px)"},{transform:`translateX(${-R}px)`}],{iterations:2,direction:"alternate",easing:"linear",duration:Math.max(0,R*2/64*1e3)});L.finished.then(()=>{o.current?.classList.remove(mu.animating)}),f.current.add(L)}},t[5]=d):d=t[5];const m=d;let y;t[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{for(const C of f.current)C.finish();o.current?.classList.remove(mu.animating),f.current.clear()},t[6]=y):y=t[6];const v=y;let x;t[7]!==i?(x=nn(mu.textMarquee,i),t[7]=i,t[8]=x):x=t[8];let b;t[9]!==e?(b=Y.jsx("div",{ref:c,children:e}),t[9]=e,t[10]=b):b=t[10];let T;return t[11]!==a||t[12]!==x||t[13]!==b?(T=Y.jsx("div",{ref:o,className:x,onMouseEnter:m,onMouseLeave:v,...a,children:b}),t[11]=a,t[12]=x,t[13]=b,t[14]=T):T=t[14],T});var Wo={album:"XWzuDW_album",artists:"XWzuDW_artists",info:"XWzuDW_info",musicInfo:"XWzuDW_musicInfo",name:"XWzuDW_name"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const mN=X.memo(n=>{const t=Ae.c(26);let e,i,a,o,c,u;if(t[0]!==n){const{name:T,artists:C,album:_,onArtistClicked:R,onAlbumClicked:L,onMenuButtonClicked:P,className:w,...F}=n;o=T,i=C,e=_,c=P,a=w,u=F,t[0]=n,t[1]=e,t[2]=i,t[3]=a,t[4]=o,t[5]=c,t[6]=u}else e=t[1],i=t[2],a=t[3],o=t[4],c=t[5],u=t[6];let f;t[7]!==a?(f=nn(Wo.musicInfo,a),t[7]=a,t[8]=f):f=t[8];let d;t[9]!==o?(d=o!==void 0&&Y.jsx(y0,{className:Wo.name,children:o}),t[9]=o,t[10]=d):d=t[10];let m;t[11]!==i?(m=i!==void 0&&Y.jsx(y0,{className:Wo.artists,children:i.map(pN)}),t[11]=i,t[12]=m):m=t[12];let y;t[13]!==e?(y=e!==void 0&&Y.jsx(y0,{className:Wo.album,children:e}),t[13]=e,t[14]=y):y=t[14];let v;t[15]!==d||t[16]!==m||t[17]!==y?(v=Y.jsxs("div",{className:Wo.info,children:[d,m,y]}),t[15]=d,t[16]=m,t[17]=y,t[18]=v):v=t[18];let x;t[19]!==c?(x=Y.jsx(dN,{onClick:c}),t[19]=c,t[20]=x):x=t[20];let b;return t[21]!==u||t[22]!==f||t[23]!==v||t[24]!==x?(b=Y.jsxs("div",{className:f,...u,children:[v,x]}),t[21]=u,t[22]=f,t[23]=v,t[24]=x,t[25]=b):b=t[25],b});function pN(n){return Y.jsx("a",{children:n},`artist-${n}`)}var yN={background:"_8f42YG_background"},rr={bottomControls:"-DaA0W_bottomControls",controls:"-DaA0W_controls",cover:"-DaA0W_cover",hideLyric:"-DaA0W_hideLyric",horizontalLayout:"-DaA0W_horizontalLayout",lyric:"-DaA0W_lyric",thumb:"-DaA0W_thumb"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const gN=n=>{const t=Ae.c(32);let e,i,a,o,c,u,f,d,m;t[0]!==n?({thumbSlot:m,coverSlot:c,controlsSlot:o,lyricSlot:f,bottomControls:i,hideLyric:u,className:a,asChild:e,...d}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a,t[4]=o,t[5]=c,t[6]=u,t[7]=f,t[8]=d,t[9]=m):(e=t[1],i=t[2],a=t[3],o=t[4],c=t[5],u=t[6],f=t[7],d=t[8],m=t[9]);const y=!e&&rr.horizontalLayout,v=!e&&u&&rr.hideLyric;let x;t[10]!==a||t[11]!==y||t[12]!==v?(x=nn(a,y,v),t[10]=a,t[11]=y,t[12]=v,t[13]=x):x=t[13];let b;t[14]!==m?(b=Y.jsx(Yn.div,{layout:!0,layoutId:"amll-player-thumb",className:rr.thumb,children:m}),t[14]=m,t[15]=b):b=t[15];let T;t[16]!==c?(T=Y.jsx(Yn.div,{layout:!0,layoutId:"amll-player-cover",className:rr.cover,children:c}),t[16]=c,t[17]=T):T=t[17];let C;t[18]!==o?(C=Y.jsx(Yn.div,{layout:!0,layoutId:"amll-player-controls",className:rr.controls,children:o}),t[18]=o,t[19]=C):C=t[19];let _;t[20]!==f?(_=Y.jsx("div",{className:rr.lyric,children:f}),t[20]=f,t[21]=_):_=t[21];let R;t[22]!==i?(R=Y.jsx("div",{className:rr.bottomControls,children:i}),t[22]=i,t[23]=R):R=t[23];let L;return t[24]!==d||t[25]!==x||t[26]!==b||t[27]!==T||t[28]!==C||t[29]!==_||t[30]!==R?(L=Y.jsxs("div",{className:x,...d,children:[b,T,C,_,R]}),t[24]=d,t[25]=x,t[26]=b,t[27]=T,t[28]=C,t[29]=_,t[30]=R,t[31]=L):L=t[31],L};var Vn={bigControls:"SqBoeq_bigControls",coverFrame:"SqBoeq_coverFrame",hideLyric:"SqBoeq_hideLyric",immerseCover:"SqBoeq_immerseCover",lyric:"SqBoeq_lyric",lyricLayout:"SqBoeq_lyricLayout",noLyricLayout:"SqBoeq_noLyricLayout",phonyBigCover:"SqBoeq_phonyBigCover",phonySmallCover:"SqBoeq_phonySmallCover",smallControls:"SqBoeq_smallControls",thumb:"SqBoeq_thumb",verticalLayout:"SqBoeq_verticalLayout"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const vN=({thumbSlot:n,coverSlot:t,smallControlsSlot:e,bigControlsSlot:i,lyricSlot:a,hideLyric:o,asChild:c,className:u,immerseCover:f,...d})=>{const m=X.useRef(null),y=X.useRef(null),v=X.useRef(null),x=X.useRef(null),b=X.useRef(o??!1),T=X.useRef(f??!1),[C,_]=X.useState(void 0),R=X.useCallback((L=b.current)=>{if(!m.current)return;let P=m.current;const w=L?y.current:v.current;if(!w||!P)return;const F=T.current;for(;getComputedStyle(P).display==="contents";){const k=P.parentElement;if(!k)return;P=k}const E=P.getBoundingClientRect(),N=w.getBoundingClientRect();if(F){const k=N.top-E.top+N.height/2,U=Math.max(k*2.4,E.width*1.2,Math.min(w.clientWidth,w.clientHeight));return{width:U,height:U,left:N.x-E.x+(N.width-U)/2,top:N.y-E.y+(N.height-U)/2}}const D=Math.min(w.clientWidth,w.clientHeight);return{width:D,height:D,left:N.x-E.x+(N.width-D)/2,top:N.y-E.y+(N.height-D)/2}},[]);return X.useLayoutEffect(()=>{b.current=o??!1,T.current=f??!1,_(R(b.current))},[o,f,R]),X.useLayoutEffect(()=>{const L=y.current,P=v.current;if(!L||!P)return;const w=new ResizeObserver(()=>{_(R(b.current))});return w.observe(L),w.observe(P),_(R(b.current)),()=>{w.disconnect()}},[R]),Y.jsxs("div",{className:nn(u,!c&&Vn.verticalLayout,!c&&o&&Vn.hideLyric),ref:m,...d,children:[Y.jsx("div",{className:Vn.thumb,children:n}),Y.jsxs("div",{className:Vn.lyricLayout,children:[Y.jsx("div",{className:Vn.phonySmallCover,ref:v}),Y.jsx("div",{className:Vn.smallControls,children:e}),Y.jsx("div",{className:Vn.lyric,children:a})]}),Y.jsxs("div",{className:Vn.noLyricLayout,children:[Y.jsx("div",{className:Vn.phonyBigCover,ref:y}),Y.jsx("div",{className:Vn.bigControls,children:i})]}),C&&Y.jsx(Yn.div,{className:nn(Vn.coverFrame,f&&Vn.immerseCover),animate:C,initial:!1,transition:{type:"spring",stiffness:200,damping:30},ref:x,children:t})]})};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const bN=n=>{const t=Ae.c(40);let e,i,a,o,c,u,f,d,m,y,v,x,b;t[0]!==n?({thumbSlot:x,controlsSlot:a,horizontalBottomControls:u,smallControlsSlot:v,bigControlsSlot:i,coverSlot:o,lyricSlot:f,backgroundSlot:e,hideLyric:c,verticalImmerseCover:b,onLayoutChange:m,onElementMounted:d,...y}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a,t[4]=o,t[5]=c,t[6]=u,t[7]=f,t[8]=d,t[9]=m,t[10]=y,t[11]=v,t[12]=x,t[13]=b):(e=t[1],i=t[2],a=t[3],o=t[4],c=t[5],u=t[6],f=t[7],d=t[8],m=t[9],y=t[10],v=t[11],x=t[12],b=t[13]);const[T,C]=X.useState(!1),_=X.useRef(null);let R;t[14]!==d?(R=U=>{_.current=U,d&&d(U)},t[14]=d,t[15]=R):R=t[15];const L=R;let P,w;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{const U=_.current;if(!U)return;C(U.clientWidth{const J=U.getBoundingClientRect();C(J.widthG.disconnect()},w=[],t[16]=P,t[17]=w):(P=t[16],w=t[17]),X.useLayoutEffect(P,w);let F,E;t[18]!==T||t[19]!==m?(F=()=>{m?.(T)},E=[T,m],t[18]=T,t[19]=m,t[20]=F,t[21]=E):(F=t[20],E=t[21]),X.useLayoutEffect(F,E);let N;t[22]!==e?(N=Y.jsx("div",{className:yN.background,children:e}),t[22]=e,t[23]=N):N=t[23];let D;t[24]!==i||t[25]!==a||t[26]!==o||t[27]!==c||t[28]!==u||t[29]!==T||t[30]!==f||t[31]!==v||t[32]!==x||t[33]!==b?(D=T?Y.jsx(vN,{thumbSlot:x,smallControlsSlot:v,bigControlsSlot:i,coverSlot:o,lyricSlot:f,hideLyric:c,immerseCover:b}):Y.jsx(gN,{thumbSlot:x,controlsSlot:a,coverSlot:o,lyricSlot:f,bottomControls:u,hideLyric:c}),t[24]=i,t[25]=a,t[26]=o,t[27]=c,t[28]=u,t[29]=T,t[30]=f,t[31]=v,t[32]=x,t[33]=b,t[34]=D):D=t[34];let k;return t[35]!==y||t[36]!==L||t[37]!==N||t[38]!==D?(k=Y.jsxs("div",{...y,ref:L,children:[N,D]}),t[35]=y,t[36]=L,t[37]=N,t[38]=D,t[39]=k):k=t[39],k};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};function Tv(n){const t=n<0,e=Math.abs(n|0),i=e%60,a=Math.floor((e-i)/60),o="0".repeat(2-i.toString().length)+i;return`${t?"-":""}${a}:${o}`}const xN=(n,t)=>Y.jsx("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M11.8633 31.8984C11.8633 29.138 12.3841 26.5469 13.4258 24.125C14.4674 21.6901 15.9128 19.5482 17.7617 17.6992C19.6107 15.8372 21.7526 14.3854 24.1875 13.3438C26.6224 12.2891 29.2266 11.7617 32 11.7617C34.7734 11.7617 37.3776 12.2891 39.8125 13.3438C42.2474 14.3854 44.3893 15.8372 46.2383 17.6992C48.0872 19.5482 49.5326 21.6901 50.5742 24.125C51.6159 26.5469 52.1367 29.138 52.1367 31.8984C52.1367 34.6719 51.6029 37.2826 50.5352 39.7305C49.4674 42.1784 48.0156 44.3073 46.1797 46.1172C46.0365 46.2604 45.8802 46.332 45.7109 46.332C45.5547 46.332 45.4049 46.2539 45.2617 46.0977L44.3438 45.0625C44.0964 44.763 44.1094 44.4635 44.3828 44.1641C45.9453 42.6016 47.1823 40.7656 48.0938 38.6562C49.0182 36.5339 49.4805 34.2812 49.4805 31.8984C49.4805 29.5026 49.0247 27.2565 48.1133 25.1602C47.2018 23.0508 45.9388 21.1953 44.3242 19.5938C42.7227 17.9792 40.8672 16.7161 38.7578 15.8047C36.6484 14.8932 34.3958 14.4375 32 14.4375C29.6042 14.4375 27.3516 14.8932 25.2422 15.8047C23.1328 16.7161 21.2708 17.9792 19.6562 19.5938C18.0547 21.1953 16.7982 23.0508 15.8867 25.1602C14.9753 27.2565 14.5195 29.5026 14.5195 31.8984C14.5195 34.2812 14.9753 36.5273 15.8867 38.6367C16.7982 40.7461 18.0417 42.5885 19.6172 44.1641C19.8776 44.4635 19.8841 44.7565 19.6367 45.043L18.7188 46.0781C18.5885 46.2344 18.4323 46.3125 18.25 46.3125C18.0807 46.3125 17.9245 46.2409 17.7812 46.0977C15.9583 44.2878 14.513 42.1654 13.4453 39.7305C12.3906 37.2826 11.8633 34.6719 11.8633 31.8984ZM17.5469 31.8984C17.5469 29.9193 17.918 28.0573 18.6602 26.3125C19.4154 24.5677 20.457 23.0312 21.7852 21.7031C23.1133 20.375 24.6497 19.3333 26.3945 18.5781C28.1393 17.8229 30.0078 17.4453 32 17.4453C33.9792 17.4453 35.8411 17.8229 37.5859 18.5781C39.3438 19.3333 40.8867 20.375 42.2148 21.7031C43.543 23.0312 44.5781 24.5677 45.3203 26.3125C46.0755 28.0573 46.4531 29.9193 46.4531 31.8984C46.4531 33.8255 46.0885 35.6419 45.3594 37.3477C44.6432 39.0404 43.6667 40.5312 42.4297 41.8203C42.2865 41.9766 42.1237 42.0547 41.9414 42.0547C41.7721 42.0547 41.6224 41.9766 41.4922 41.8203L40.5547 40.7852C40.3073 40.5117 40.3073 40.2122 40.5547 39.8867C41.5573 38.8581 42.3451 37.6602 42.918 36.293C43.4909 34.9128 43.7773 33.4479 43.7773 31.8984C43.7773 30.2839 43.4714 28.7669 42.8594 27.3477C42.2474 25.9284 41.3945 24.6784 40.3008 23.5977C39.2201 22.5169 37.9701 21.6706 36.5508 21.0586C35.1315 20.4336 33.6146 20.1211 32 20.1211C30.3724 20.1211 28.849 20.4336 27.4297 21.0586C26.0104 21.6706 24.7604 22.5169 23.6797 23.5977C22.599 24.6784 21.7526 25.9284 21.1406 27.3477C20.5286 28.7669 20.2227 30.2839 20.2227 31.8984C20.2227 33.4349 20.5026 34.8932 21.0625 36.2734C21.6354 37.6536 22.4232 38.8581 23.4258 39.8867C23.6732 40.2122 23.6732 40.5117 23.4258 40.7852L22.5078 41.8008C22.3776 41.957 22.2214 42.0417 22.0391 42.0547C21.8568 42.0547 21.694 41.9701 21.5508 41.8008C20.3138 40.5117 19.3372 39.0208 18.6211 37.3281C17.9049 35.6224 17.5469 33.8125 17.5469 31.8984ZM23.2305 31.8984C23.2305 30.2969 23.6276 28.832 24.4219 27.5039C25.2161 26.1758 26.2708 25.1146 27.5859 24.3203C28.9141 23.526 30.3854 23.1289 32 23.1289C33.6146 23.1289 35.0794 23.526 36.3945 24.3203C37.7227 25.1146 38.7839 26.1758 39.5781 27.5039C40.3724 28.832 40.7695 30.2969 40.7695 31.8984C40.7695 32.9661 40.5807 33.9753 40.2031 34.9258C39.8255 35.8633 39.3047 36.7031 38.6406 37.4453C38.5104 37.6276 38.3542 37.7188 38.1719 37.7188C38.0026 37.7188 37.8398 37.6406 37.6836 37.4844L36.7266 36.4688C36.4792 36.2214 36.4596 35.9414 36.668 35.6289C37.1237 35.1341 37.4753 34.5677 37.7227 33.9297C37.9701 33.2917 38.0938 32.6146 38.0938 31.8984C38.0938 30.7917 37.8138 29.776 37.2539 28.8516C36.707 27.9271 35.9714 27.1914 35.0469 26.6445C34.1224 26.0846 33.1068 25.8047 32 25.8047C30.8932 25.8047 29.8776 26.0846 28.9531 26.6445C28.0286 27.1914 27.2865 27.9271 26.7266 28.8516C26.1797 29.776 25.9062 30.7917 25.9062 31.8984C25.9062 32.6016 26.0299 33.2721 26.2773 33.9102C26.5247 34.5482 26.8698 35.1146 27.3125 35.6094C27.5078 35.9219 27.4883 36.2018 27.2539 36.4492L26.2969 37.4648C26.1406 37.6211 25.9714 37.6992 25.7891 37.6992C25.6198 37.6992 25.4701 37.6146 25.3398 37.4453C24.6758 36.7031 24.1549 35.8568 23.7773 34.9062C23.4128 33.9557 23.2305 32.9531 23.2305 31.8984ZM19.8906 51.3711C19.4089 51.3711 19.0898 51.1758 18.9336 50.7852C18.7773 50.3945 18.8555 50.0299 19.168 49.6914L31.1016 36.1758C31.3359 35.9023 31.6289 35.7656 31.9805 35.7656C32.332 35.7656 32.625 35.9023 32.8594 36.1758L44.8125 49.6914C45.112 50.0299 45.1836 50.3945 45.0273 50.7852C44.8711 51.1758 44.5586 51.3711 44.0898 51.3711H19.8906Z",fill:"currentColor"})}),K6=X.forwardRef(xN);var CN={toggleIconButton:"_6-mjea_toggleIconButton"};const TN=(n,t)=>Y.jsx("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M22.8594 53.9102C22 53.9102 21.3229 53.6302 20.8281 53.0703C20.3464 52.5104 20.1055 51.7617 20.1055 50.8242V46.1953H18.9727C17.1237 46.1953 15.5156 45.8242 14.1484 45.082C12.7812 44.3398 11.7201 43.2721 10.9648 41.8789C10.2227 40.4857 9.85156 38.8125 9.85156 36.8594V21.5664C9.85156 19.6133 10.2161 17.9401 10.9453 16.5469C11.6875 15.1536 12.7552 14.0859 14.1484 13.3438C15.5417 12.5885 17.2214 12.2109 19.1875 12.2109H44.793C46.7721 12.2109 48.4518 12.5885 49.832 13.3438C51.2253 14.0859 52.2865 15.1536 53.0156 16.5469C53.7578 17.9401 54.1289 19.6133 54.1289 21.5664V36.8594C54.1289 38.8125 53.7578 40.4857 53.0156 41.8789C52.2865 43.2721 51.2253 44.3398 49.832 45.082C48.4518 45.8242 46.7721 46.1953 44.793 46.1953H33.0742L26.4336 52.0547C25.7044 52.6927 25.0729 53.1615 24.5391 53.4609C24.0182 53.7604 23.4583 53.9102 22.8594 53.9102ZM23.9141 49.0469L30.0859 42.9727C30.5156 42.5299 30.9193 42.237 31.2969 42.0938C31.6745 41.9375 32.1758 41.8594 32.8008 41.8594H44.5977C46.3424 41.8594 47.6445 41.4232 48.5039 40.5508C49.3633 39.6784 49.793 38.3828 49.793 36.6641V21.7422C49.793 20.0365 49.3633 18.7474 48.5039 17.875C47.6445 17.0026 46.3424 16.5664 44.5977 16.5664H19.3828C17.625 16.5664 16.3164 17.0026 15.457 17.875C14.6107 18.7474 14.1875 20.0365 14.1875 21.7422V36.6641C14.1875 38.3828 14.6107 39.6784 15.457 40.5508C16.3164 41.4232 17.625 41.8594 19.3828 41.8594H22.2344C22.8073 41.8594 23.2305 41.9896 23.5039 42.25C23.7773 42.4974 23.9141 42.9271 23.9141 43.5391V49.0469ZM22.4492 27.1914C22.4492 25.9935 22.8529 25.0104 23.6602 24.2422C24.4674 23.474 25.4701 23.0898 26.668 23.0898C28.0221 23.0898 29.1029 23.5716 29.9102 24.5352C30.7305 25.4857 31.1406 26.6576 31.1406 28.0508C31.1406 29.2096 30.9323 30.2383 30.5156 31.1367C30.112 32.0221 29.5911 32.7708 28.9531 33.3828C28.3281 33.9948 27.6771 34.457 27 34.7695C26.3229 35.082 25.7174 35.2383 25.1836 35.2383C24.8841 35.2383 24.6367 35.1536 24.4414 34.9844C24.2461 34.8151 24.1484 34.5938 24.1484 34.3203C24.1484 34.0859 24.2135 33.8906 24.3438 33.7344C24.487 33.5651 24.7214 33.4414 25.0469 33.3633C25.5677 33.2331 26.0625 33.0312 26.5312 32.7578C27.013 32.4714 27.4362 32.1328 27.8008 31.7422C28.1654 31.3385 28.4453 30.8828 28.6406 30.375H28.3867C28.1263 30.7005 27.7943 30.9284 27.3906 31.0586C26.987 31.1758 26.5573 31.2344 26.1016 31.2344C25.0078 31.2344 24.1224 30.8503 23.4453 30.082C22.7812 29.3008 22.4492 28.3372 22.4492 27.1914ZM33.0742 27.1914C33.0742 25.9935 33.4714 25.0104 34.2656 24.2422C35.0729 23.474 36.082 23.0898 37.293 23.0898C38.6471 23.0898 39.7279 23.5716 40.5352 24.5352C41.3555 25.4857 41.7656 26.6576 41.7656 28.0508C41.7656 29.2096 41.5573 30.2383 41.1406 31.1367C40.737 32.0221 40.2161 32.7708 39.5781 33.3828C38.9531 33.9948 38.2956 34.457 37.6055 34.7695C36.9284 35.082 36.3294 35.2383 35.8086 35.2383C35.5091 35.2383 35.2617 35.1536 35.0664 34.9844C34.8711 34.8151 34.7734 34.5938 34.7734 34.3203C34.7734 34.0859 34.8385 33.8906 34.9688 33.7344C35.112 33.5651 35.3529 33.4414 35.6914 33.3633C36.1992 33.2331 36.6875 33.0312 37.1562 32.7578C37.638 32.4714 38.0612 32.1328 38.4258 31.7422C38.7904 31.3385 39.0703 30.8828 39.2656 30.375H39.0117C38.7513 30.7005 38.4193 30.9284 38.0156 31.0586C37.612 31.1758 37.1823 31.2344 36.7266 31.2344C35.6328 31.2344 34.7474 30.8503 34.0703 30.082C33.4062 29.3008 33.0742 28.3372 33.0742 27.1914Z",fill:"currentColor"})}),SN=X.forwardRef(TN),_N=(n,t)=>Y.jsxs("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:[Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.91256 7.67068C0 11.0858 0 15.6405 0 24.75V39.25C0 48.3595 0 52.9142 1.91256 56.3293C3.26425 58.7429 5.25707 60.7357 7.67068 62.0874C11.0858 64 15.6405 64 24.75 64H39.25C48.3595 64 52.9142 64 56.3293 62.0874C58.7429 60.7357 60.7357 58.7429 62.0874 56.3293C64 52.9142 64 48.3595 64 39.25V24.75C64 15.6405 64 11.0858 62.0874 7.67068C60.7357 5.25707 58.7429 3.26425 56.3293 1.91256C52.9142 0 48.3595 0 39.25 0H24.75C15.6405 0 11.0858 0 7.67068 1.91256C5.25707 3.26425 3.26425 5.25707 1.91256 7.67068ZM20.8281 53.0703C21.3229 53.6302 22 53.9102 22.8594 53.9102C23.4583 53.9102 24.0182 53.7604 24.5391 53.4609C25.0729 53.1615 25.7044 52.6927 26.4336 52.0547L33.0742 46.1953H44.793C46.7721 46.1953 48.4518 45.8242 49.832 45.082C51.2253 44.3398 52.2865 43.2721 53.0156 41.8789C53.7578 40.4857 54.1289 38.8125 54.1289 36.8594V21.5664C54.1289 19.6133 53.7578 17.9401 53.0156 16.5469C52.2865 15.1536 51.2253 14.0859 49.832 13.3438C48.4518 12.5885 46.7721 12.2109 44.793 12.2109H19.1875C17.2214 12.2109 15.5417 12.5885 14.1484 13.3438C12.7552 14.0859 11.6875 15.1536 10.9453 16.5469C10.2161 17.9401 9.85156 19.6133 9.85156 21.5664V36.8594C9.85156 38.8125 10.2227 40.4857 10.9648 41.8789C11.7201 43.2721 12.7812 44.3398 14.1484 45.082C15.5156 45.8242 17.1237 46.1953 18.9727 46.1953H20.1055V50.8242C20.1055 51.7617 20.3464 52.5104 20.8281 53.0703Z",fill:"currentColor"}),Y.jsx("path",{d:"M22.4492 27.1914C22.4492 25.9935 22.8529 25.0104 23.6602 24.2422C24.4674 23.474 25.4701 23.0898 26.668 23.0898C28.0221 23.0898 29.1029 23.5716 29.9102 24.5352C30.7305 25.4857 31.1406 26.6576 31.1406 28.0508C31.1406 29.2096 30.9323 30.2383 30.5156 31.1367C30.112 32.0221 29.5911 32.7708 28.9531 33.3828C28.3281 33.9948 27.6771 34.457 27 34.7695C26.3229 35.082 25.7174 35.2383 25.1836 35.2383C24.8841 35.2383 24.6367 35.1536 24.4414 34.9844C24.2461 34.8151 24.1484 34.5938 24.1484 34.3203C24.1484 34.0859 24.2135 33.8906 24.3438 33.7344C24.487 33.5651 24.7214 33.4414 25.0469 33.3633C25.5677 33.2331 26.0625 33.0312 26.5312 32.7578C27.013 32.4714 27.4362 32.1328 27.8008 31.7422C28.1654 31.3385 28.4453 30.8828 28.6406 30.375H28.3867C28.1263 30.7005 27.7943 30.9284 27.3906 31.0586C26.987 31.1758 26.5573 31.2344 26.1016 31.2344C25.0078 31.2344 24.1224 30.8503 23.4453 30.082C22.7812 29.3008 22.4492 28.3372 22.4492 27.1914ZM33.0742 27.1914C33.0742 25.9935 33.4714 25.0104 34.2656 24.2422C35.0729 23.474 36.082 23.0898 37.293 23.0898C38.6471 23.0898 39.7279 23.5716 40.5352 24.5352C41.3555 25.4857 41.7656 26.6576 41.7656 28.0508C41.7656 29.2096 41.5573 30.2383 41.1406 31.1367C40.737 32.0221 40.2161 32.7708 39.5781 33.3828C38.9531 33.9948 38.2956 34.457 37.6055 34.7695C36.9284 35.082 36.3294 35.2383 35.8086 35.2383C35.5091 35.2383 35.2617 35.1536 35.0664 34.9844C34.8711 34.8151 34.7734 34.5938 34.7734 34.3203C34.7734 34.0859 34.8385 33.8906 34.9688 33.7344C35.112 33.5651 35.3529 33.4414 35.6914 33.3633C36.1992 33.2331 36.6875 33.0312 37.1562 32.7578C37.638 32.4714 38.0612 32.1328 38.4258 31.7422C38.7904 31.3385 39.0703 30.8828 39.2656 30.375H39.0117C38.7513 30.7005 38.4193 30.9284 38.0156 31.0586C37.612 31.1758 37.1823 31.2344 36.7266 31.2344C35.6328 31.2344 34.7474 30.8503 34.0703 30.082C33.4062 29.3008 33.0742 28.3372 33.0742 27.1914Z",fill:"currentColor"})]}),AN=X.forwardRef(_N),EN=(n,t)=>Y.jsx("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M23.9922 21.8594C23.4062 21.8594 22.9115 21.6641 22.5078 21.2734C22.1172 20.8698 21.9219 20.375 21.9219 19.7891C21.9219 19.2161 22.1172 18.7279 22.5078 18.3242C22.9115 17.9206 23.4062 17.7188 23.9922 17.7188H50.418C50.9909 17.7188 51.4792 17.9206 51.8828 18.3242C52.2865 18.7279 52.4883 19.2161 52.4883 19.7891C52.4883 20.375 52.2865 20.8698 51.8828 21.2734C51.4792 21.6641 50.9909 21.8594 50.418 21.8594H23.9922ZM23.9922 33.9883C23.4062 33.9883 22.9115 33.7865 22.5078 33.3828C22.1172 32.9792 21.9219 32.4909 21.9219 31.918C21.9219 31.3451 22.1172 30.8633 22.5078 30.4727C22.9115 30.069 23.4062 29.8672 23.9922 29.8672H50.418C50.9909 29.8672 51.4792 30.069 51.8828 30.4727C52.2865 30.8633 52.4883 31.3451 52.4883 31.918C52.4883 32.5039 52.2865 32.9987 51.8828 33.4023C51.4792 33.793 50.9909 33.9883 50.418 33.9883H23.9922ZM23.9922 46.1172C23.4062 46.1172 22.9115 45.9219 22.5078 45.5312C22.1172 45.1276 21.9219 44.6328 21.9219 44.0469C21.9219 43.474 22.1172 42.9857 22.5078 42.582C22.9115 42.1784 23.4062 41.9766 23.9922 41.9766H50.418C50.9909 41.9766 51.4792 42.1784 51.8828 42.582C52.2865 42.9857 52.4883 43.474 52.4883 44.0469C52.4883 44.6328 52.2865 45.1276 51.8828 45.5312C51.4792 45.9219 50.9909 46.1172 50.418 46.1172H23.9922ZM14.4805 22.7383C13.6602 22.7383 12.957 22.4518 12.3711 21.8789C11.7982 21.306 11.5117 20.6094 11.5117 19.7891C11.5117 18.9688 11.7982 18.2721 12.3711 17.6992C12.957 17.1263 13.6602 16.8398 14.4805 16.8398C15.2878 16.8398 15.9844 17.1263 16.5703 17.6992C17.1562 18.2721 17.4492 18.9688 17.4492 19.7891C17.4492 20.6094 17.1562 21.306 16.5703 21.8789C15.9844 22.4518 15.2878 22.7383 14.4805 22.7383ZM14.4805 34.8867C13.6602 34.8867 12.957 34.5938 12.3711 34.0078C11.7982 33.4219 11.5117 32.7253 11.5117 31.918C11.5117 31.1107 11.7982 30.4141 12.3711 29.8281C12.957 29.2422 13.6602 28.9492 14.4805 28.9492C15.2878 28.9492 15.9844 29.2422 16.5703 29.8281C17.1562 30.4141 17.4492 31.1107 17.4492 31.918C17.4492 32.7253 17.1562 33.4219 16.5703 34.0078C15.9844 34.5938 15.2878 34.8867 14.4805 34.8867ZM14.4805 47.0156C13.6602 47.0156 12.957 46.7227 12.3711 46.1367C11.7982 45.5638 11.5117 44.8672 11.5117 44.0469C11.5117 43.2266 11.7982 42.5299 12.3711 41.957C12.957 41.3841 13.6602 41.0977 14.4805 41.0977C15.2878 41.0977 15.9844 41.3841 16.5703 41.957C17.1562 42.5299 17.4492 43.2266 17.4492 44.0469C17.4492 44.8672 17.1562 45.5638 16.5703 46.1367C15.9844 46.7227 15.2878 47.0156 14.4805 47.0156Z",fill:"currentColor"})}),wN=X.forwardRef(EN),MN=(n,t)=>Y.jsx("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.91256 7.67068C0 11.0858 0 15.6405 0 24.75V39.25C0 48.3595 0 52.9142 1.91256 56.3293C3.26425 58.7429 5.25707 60.7357 7.67068 62.0874C11.0858 64 15.6405 64 24.75 64H39.25C48.3595 64 52.9142 64 56.3293 62.0874C58.7429 60.7357 60.7357 58.7429 62.0874 56.3293C64 52.9142 64 48.3595 64 39.25V24.75C64 15.6405 64 11.0858 62.0874 7.67068C60.7357 5.25706 58.7429 3.26425 56.3293 1.91256C52.9142 0 48.3595 0 39.25 0H24.75C15.6405 0 11.0858 0 7.67068 1.91256C5.25707 3.26425 3.26425 5.25706 1.91256 7.67068ZM22.5078 21.2734C22.9115 21.6641 23.4062 21.8594 23.9922 21.8594H50.418C50.9909 21.8594 51.4792 21.6641 51.8828 21.2734C52.2865 20.8698 52.4883 20.375 52.4883 19.7891C52.4883 19.2161 52.2865 18.7279 51.8828 18.3242C51.4792 17.9206 50.9909 17.7188 50.418 17.7188H23.9922C23.4062 17.7188 22.9115 17.9206 22.5078 18.3242C22.1172 18.7279 21.9219 19.2161 21.9219 19.7891C21.9219 20.375 22.1172 20.8698 22.5078 21.2734ZM22.5078 33.3828C22.9115 33.7865 23.4062 33.9883 23.9922 33.9883H50.418C50.9909 33.9883 51.4792 33.793 51.8828 33.4023C52.2865 32.9987 52.4883 32.5039 52.4883 31.918C52.4883 31.3451 52.2865 30.8633 51.8828 30.4727C51.4792 30.069 50.9909 29.8672 50.418 29.8672H23.9922C23.4062 29.8672 22.9115 30.069 22.5078 30.4727C22.1172 30.8633 21.9219 31.3451 21.9219 31.918C21.9219 32.4909 22.1172 32.9792 22.5078 33.3828ZM22.5078 45.5312C22.9115 45.9219 23.4062 46.1172 23.9922 46.1172H50.418C50.9909 46.1172 51.4792 45.9219 51.8828 45.5312C52.2865 45.1276 52.4883 44.6328 52.4883 44.0469C52.4883 43.474 52.2865 42.9857 51.8828 42.582C51.4792 42.1784 50.9909 41.9766 50.418 41.9766H23.9922C23.4062 41.9766 22.9115 42.1784 22.5078 42.582C22.1172 42.9857 21.9219 43.474 21.9219 44.0469C21.9219 44.6328 22.1172 45.1276 22.5078 45.5312ZM12.3711 21.8789C12.957 22.4518 13.6602 22.7383 14.4805 22.7383C15.2878 22.7383 15.9844 22.4518 16.5703 21.8789C17.1562 21.306 17.4492 20.6094 17.4492 19.7891C17.4492 18.9688 17.1562 18.2721 16.5703 17.6992C15.9844 17.1263 15.2878 16.8398 14.4805 16.8398C13.6602 16.8398 12.957 17.1263 12.3711 17.6992C11.7982 18.2721 11.5117 18.9688 11.5117 19.7891C11.5117 20.6094 11.7982 21.306 12.3711 21.8789ZM12.3711 34.0078C12.957 34.5938 13.6602 34.8867 14.4805 34.8867C15.2878 34.8867 15.9844 34.5938 16.5703 34.0078C17.1562 33.4219 17.4492 32.7253 17.4492 31.918C17.4492 31.1107 17.1562 30.4141 16.5703 29.8281C15.9844 29.2422 15.2878 28.9492 14.4805 28.9492C13.6602 28.9492 12.957 29.2422 12.3711 29.8281C11.7982 30.4141 11.5117 31.1107 11.5117 31.918C11.5117 32.7253 11.7982 33.4219 12.3711 34.0078ZM12.3711 46.1367C12.957 46.7227 13.6602 47.0156 14.4805 47.0156C15.2878 47.0156 15.9844 46.7227 16.5703 46.1367C17.1562 45.5638 17.4492 44.8672 17.4492 44.0469C17.4492 43.2266 17.1562 42.5299 16.5703 41.957C15.9844 41.3841 15.2878 41.0977 14.4805 41.0977C13.6602 41.0977 12.957 41.3841 12.3711 41.957C11.7982 42.5299 11.5117 43.2266 11.5117 44.0469C11.5117 44.8672 11.7982 45.5638 12.3711 46.1367Z",fill:"currentColor"})}),RN=X.forwardRef(MN);globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const LN=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M13.0293 28.9805C12.4727 28.9805 12.0039 28.79 11.623 28.4092C11.2422 28.0186 11.0518 27.5498 11.0518 27.0029V25.3623C11.0518 23.7998 11.4033 22.457 12.1064 21.334C12.8096 20.2109 13.8057 19.3516 15.0947 18.7559C16.3838 18.1504 17.9219 17.8477 19.709 17.8477H30.6367V14.7422C30.6367 14.2832 30.7637 13.9268 31.0176 13.6729C31.2715 13.4092 31.623 13.2773 32.0723 13.2773C32.2871 13.2773 32.4775 13.3115 32.6436 13.3799C32.8193 13.4482 32.9805 13.541 33.127 13.6582L39.2354 18.8145C39.5869 19.0977 39.7578 19.4443 39.748 19.8545C39.748 20.2549 39.5771 20.5967 39.2354 20.8799L33.127 26.0361C32.9805 26.1533 32.8193 26.2461 32.6436 26.3145C32.4775 26.3828 32.2871 26.417 32.0723 26.417C31.623 26.417 31.2715 26.29 31.0176 26.0361C30.7637 25.7725 30.6367 25.416 30.6367 24.9668V21.6855H19.4893C18.1025 21.6855 17.0039 22.0615 16.1934 22.8135C15.3926 23.5557 14.9922 24.5713 14.9922 25.8604V27.0029C14.9922 27.5498 14.8018 28.0186 14.4209 28.4092C14.04 28.79 13.5762 28.9805 13.0293 28.9805ZM42.9707 26.959C43.5176 26.959 43.9814 27.1494 44.3623 27.5303C44.7529 27.9111 44.9482 28.3799 44.9482 28.9365V30.5771C44.9482 32.1299 44.5967 33.4727 43.8936 34.6055C43.1904 35.7285 42.1895 36.5928 40.8906 37.1982C39.6016 37.7939 38.0684 38.0918 36.291 38.0918H25.3633V41.1973C25.3633 41.6465 25.2363 41.998 24.9824 42.252C24.7285 42.5156 24.377 42.6475 23.9277 42.6475C23.7129 42.6475 23.5176 42.6133 23.3418 42.5449C23.166 42.4766 23.0098 42.3838 22.873 42.2666L16.75 37.1104C16.418 36.8271 16.252 36.4854 16.252 36.085C16.252 35.6846 16.418 35.3379 16.75 35.0449L22.873 29.8887C23.0098 29.7715 23.166 29.6787 23.3418 29.6104C23.5176 29.542 23.7129 29.5078 23.9277 29.5078C24.377 29.5078 24.7285 29.6396 24.9824 29.9033C25.2363 30.1572 25.3633 30.5137 25.3633 30.9727V34.2393H36.5107C37.8975 34.2393 38.9912 33.8682 39.792 33.126C40.6025 32.3838 41.0078 31.3682 41.0078 30.0791V28.9365C41.0078 28.3799 41.1934 27.9111 41.5645 27.5303C41.9453 27.1494 42.4141 26.959 42.9707 26.959Z",fill:"currentColor"})}),ON=X.forwardRef(LN),NN=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.65755 6.64792C0 9.6077 0 13.5551 0 21.45V34.55C0 42.4449 0 46.3923 1.65755 49.3521C2.82902 51.4439 4.55612 53.171 6.64792 54.3424C9.6077 56 13.5551 56 21.45 56H34.55C42.4449 56 46.3923 56 49.3521 54.3424C51.4439 53.171 53.171 51.4439 54.3424 49.3521C56 46.3923 56 42.4449 56 34.55V21.45C56 13.5551 56 9.6077 54.3424 6.64792C53.171 4.55612 51.4439 2.82902 49.3521 1.65755C46.3923 0 42.4449 0 34.55 0H21.45C13.5551 0 9.6077 0 6.64792 1.65755C4.55612 2.82902 2.82902 4.55612 1.65755 6.64792ZM11.623 28.4092C12.0039 28.79 12.4727 28.9805 13.0293 28.9805C13.5762 28.9805 14.04 28.79 14.4209 28.4092C14.8018 28.0186 14.9922 27.5498 14.9922 27.0029V25.8604C14.9922 24.5713 15.3926 23.5557 16.1934 22.8135C17.0039 22.0615 18.1025 21.6855 19.4893 21.6855H30.6367V24.9668C30.6367 25.416 30.7637 25.7725 31.0176 26.0361C31.2715 26.29 31.623 26.417 32.0723 26.417C32.2871 26.417 32.4775 26.3828 32.6436 26.3145C32.8193 26.2461 32.9805 26.1533 33.127 26.0361L39.2354 20.8799C39.5771 20.5967 39.748 20.2549 39.748 19.8545C39.7578 19.4443 39.5869 19.0977 39.2354 18.8145L33.127 13.6582C32.9805 13.541 32.8193 13.4482 32.6436 13.3799C32.4775 13.3115 32.2871 13.2773 32.0723 13.2773C31.623 13.2773 31.2715 13.4092 31.0176 13.6729C30.7637 13.9268 30.6367 14.2832 30.6367 14.7422V17.8477H19.709C17.9219 17.8477 16.3838 18.1504 15.0947 18.7559C13.8057 19.3516 12.8096 20.2109 12.1064 21.334C11.4033 22.457 11.0518 23.7998 11.0518 25.3623V27.0029C11.0518 27.5498 11.2422 28.0186 11.623 28.4092ZM44.3623 27.5303C43.9814 27.1494 43.5176 26.959 42.9707 26.959C42.4141 26.959 41.9453 27.1494 41.5645 27.5303C41.1934 27.9111 41.0078 28.3799 41.0078 28.9365V30.0791C41.0078 31.3682 40.6025 32.3838 39.792 33.126C38.9912 33.8682 37.8975 34.2393 36.5107 34.2393H25.3633V30.9727C25.3633 30.5137 25.2363 30.1572 24.9824 29.9033C24.7285 29.6396 24.377 29.5078 23.9277 29.5078C23.7129 29.5078 23.5176 29.542 23.3418 29.6104C23.166 29.6787 23.0098 29.7715 22.873 29.8887L16.75 35.0449C16.418 35.3379 16.252 35.6846 16.252 36.085C16.252 36.4854 16.418 36.8271 16.75 37.1104L22.873 42.2666C23.0098 42.3838 23.166 42.4766 23.3418 42.5449C23.5176 42.6133 23.7129 42.6475 23.9277 42.6475C24.377 42.6475 24.7285 42.5156 24.9824 42.252C25.2363 41.998 25.3633 41.6465 25.3633 41.1973V38.0918H36.291C38.0684 38.0918 39.6016 37.7939 40.8906 37.1982C42.1895 36.5928 43.1904 35.7285 43.8936 34.6055C44.5967 33.4727 44.9482 32.1299 44.9482 30.5771V28.9365C44.9482 28.3799 44.7529 27.9111 44.3623 27.5303Z",fill:"currentColor"})}),DN=X.forwardRef(NN),BN=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M9.55762 36.7148C9.55762 36.1777 9.74316 35.7285 10.1143 35.3672C10.4951 35.0059 10.9639 34.8252 11.5205 34.8252H14.7285C15.6562 34.8252 16.4375 34.6592 17.0723 34.3271C17.707 33.9951 18.3369 33.4434 18.9619 32.6719L27.7656 21.8613C28.8008 20.5918 29.8457 19.7275 30.9004 19.2686C31.9551 18.7998 33.2051 18.5654 34.6504 18.5654H37.3311V15.1963C37.3311 14.7471 37.458 14.3955 37.7119 14.1416C37.9658 13.8779 38.3174 13.7461 38.7666 13.7461C38.9814 13.7461 39.1719 13.7803 39.3379 13.8486C39.5137 13.917 39.6748 14.0098 39.8213 14.127L45.9297 19.2832C46.2715 19.5664 46.4424 19.9131 46.4424 20.3232C46.4424 20.7236 46.2715 21.0654 45.9297 21.3486L39.8213 26.5049C39.6748 26.6221 39.5137 26.7148 39.3379 26.7832C39.1719 26.8516 38.9814 26.8857 38.7666 26.8857C38.3174 26.8857 37.9658 26.7588 37.7119 26.5049C37.458 26.2412 37.3311 25.8848 37.3311 25.4355V22.3447H34.4746C33.8496 22.3447 33.3076 22.4131 32.8486 22.5498C32.3896 22.6768 31.96 22.8965 31.5596 23.209C31.1689 23.5215 30.7588 23.9414 30.3291 24.4688L21.1006 35.748C20.2607 36.7539 19.3916 37.4814 18.4932 37.9307C17.5947 38.3701 16.4766 38.5898 15.1387 38.5898H11.5205C10.9639 38.5898 10.4951 38.4092 10.1143 38.0479C9.74316 37.6865 9.55762 37.2422 9.55762 36.7148ZM9.55762 20.4551C9.55762 19.918 9.74316 19.4688 10.1143 19.1074C10.4951 18.7461 10.9639 18.5654 11.5205 18.5654H14.8896C16.2178 18.5654 17.375 18.79 18.3613 19.2393C19.3477 19.6787 20.2607 20.4062 21.1006 21.4219L30.2998 32.6719C30.9248 33.4336 31.5742 33.9854 32.248 34.3271C32.9219 34.6592 33.7373 34.8252 34.6943 34.8252H37.3311V31.7344C37.3311 31.2852 37.458 30.9287 37.7119 30.665C37.9658 30.4014 38.3174 30.2695 38.7666 30.2695C38.9814 30.2695 39.1719 30.3086 39.3379 30.3867C39.5137 30.4551 39.6748 30.5479 39.8213 30.665L45.9297 35.8066C46.2715 36.0996 46.4424 36.4463 46.4424 36.8467C46.4424 37.2471 46.2715 37.5938 45.9297 37.8867L39.8213 43.0283C39.6748 43.1455 39.5137 43.2383 39.3379 43.3066C39.1719 43.375 38.9814 43.4092 38.7666 43.4092C38.3174 43.4092 37.9658 43.2822 37.7119 43.0283C37.458 42.7744 37.3311 42.418 37.3311 41.959V38.5898H34.6211C33.2832 38.5898 32.0723 38.3652 30.9883 37.916C29.9141 37.457 28.9229 36.6758 28.0146 35.5723L18.9619 24.498C18.3369 23.7266 17.6631 23.1748 16.9404 22.8428C16.2275 22.5107 15.4023 22.3447 14.4648 22.3447H11.5205C10.9639 22.3447 10.4951 22.1641 10.1143 21.8027C9.74316 21.4316 9.55762 20.9824 9.55762 20.4551Z",fill:"currentColor"})}),IN=X.forwardRef(BN),FN=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.65755 6.64792C0 9.6077 0 13.5551 0 21.45V34.55C0 42.4449 0 46.3923 1.65755 49.3521C2.82902 51.4439 4.55612 53.171 6.64792 54.3424C9.6077 56 13.5551 56 21.45 56H34.55C42.4449 56 46.3923 56 49.3521 54.3424C51.4439 53.171 53.171 51.4439 54.3424 49.3521C56 46.3923 56 42.4449 56 34.55V21.45C56 13.5551 56 9.6077 54.3424 6.64792C53.171 4.55612 51.4439 2.82902 49.3521 1.65755C46.3923 0 42.4449 0 34.55 0H21.45C13.5551 0 9.6077 0 6.64792 1.65755C4.55612 2.82902 2.82902 4.55612 1.65755 6.64792ZM10.1143 35.3672C9.74316 35.7285 9.55762 36.1777 9.55762 36.7148C9.55762 37.2422 9.74316 37.6865 10.1143 38.0479C10.4951 38.4092 10.9639 38.5898 11.5205 38.5898H15.1387C16.4766 38.5898 17.5947 38.3701 18.4932 37.9307C19.3916 37.4814 20.2607 36.7539 21.1006 35.748L24.631 31.4331L28.0146 35.5723C28.9229 36.6758 29.9141 37.457 30.9883 37.916C32.0723 38.3652 33.2832 38.5898 34.6211 38.5898H37.3311V41.959C37.3311 42.418 37.458 42.7744 37.7119 43.0283C37.9658 43.2822 38.3174 43.4092 38.7666 43.4092C38.9814 43.4092 39.1719 43.375 39.3379 43.3066C39.5137 43.2383 39.6748 43.1455 39.8213 43.0283L45.9297 37.8867C46.2715 37.5938 46.4424 37.2471 46.4424 36.8467C46.4424 36.4463 46.2715 36.0996 45.9297 35.8066L39.8213 30.665C39.6748 30.5479 39.5137 30.4551 39.3379 30.3867C39.1719 30.3086 38.9814 30.2695 38.7666 30.2695C38.3174 30.2695 37.9658 30.4014 37.7119 30.665C37.458 30.9287 37.3311 31.2852 37.3311 31.7344V34.8252H34.6943C33.7373 34.8252 32.9219 34.6592 32.248 34.3271C31.5742 33.9854 30.9248 33.4336 30.2998 32.6719L26.9596 28.587L30.3291 24.4688C30.7588 23.9414 31.1689 23.5215 31.5596 23.209C31.96 22.8965 32.3896 22.6768 32.8486 22.5498C33.3076 22.4131 33.8496 22.3447 34.4746 22.3447H37.3311V25.4355C37.3311 25.8848 37.458 26.2412 37.7119 26.5049C37.9658 26.7588 38.3174 26.8857 38.7666 26.8857C38.9814 26.8857 39.1719 26.8516 39.3379 26.7832C39.5137 26.7148 39.6748 26.6221 39.8213 26.5049L45.9297 21.3486C46.2715 21.0654 46.4424 20.7236 46.4424 20.3232C46.4424 19.9131 46.2715 19.5664 45.9297 19.2832L39.8213 14.127C39.6748 14.0098 39.5137 13.917 39.3379 13.8486C39.1719 13.7803 38.9814 13.7461 38.7666 13.7461C38.3174 13.7461 37.9658 13.8779 37.7119 14.1416C37.458 14.3955 37.3311 14.7471 37.3311 15.1963V18.5654H34.6504C33.2051 18.5654 31.9551 18.7998 30.9004 19.2686C29.8457 19.7275 28.8008 20.5918 27.7656 21.8613L24.6192 25.7249L21.1006 21.4219C20.2607 20.4062 19.3477 19.6787 18.3613 19.2393C17.375 18.79 16.2178 18.5654 14.8896 18.5654H11.5205C10.9639 18.5654 10.4951 18.7461 10.1143 19.1074C9.74316 19.4688 9.55762 19.918 9.55762 20.4551C9.55762 20.9824 9.74316 21.4316 10.1143 21.8027C10.4951 22.1641 10.9639 22.3447 11.5205 22.3447H14.4648C15.4023 22.3447 16.2275 22.5107 16.9404 22.8428C17.6631 23.1748 18.3369 23.7266 18.9619 24.498L22.2965 28.5772L18.9619 32.6719C18.3369 33.4434 17.707 33.9951 17.0723 34.3271C16.4375 34.6592 15.6562 34.8252 14.7285 34.8252H11.5205C10.9639 34.8252 10.4951 35.0059 10.1143 35.3672Z",fill:"currentColor"})}),PN=X.forwardRef(FN),UN=(n,t)=>Y.jsx("svg",{width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M7.83396 32.7793C7.49216 32.5254 7.2822 32.1836 7.20407 31.7539C7.13571 31.334 7.19919 30.8359 7.3945 30.2598L10.4121 21.3096L2.72165 15.7871C2.2236 15.4355 1.87692 15.0693 1.68161 14.6885C1.4863 14.2979 1.457 13.8975 1.59372 13.4873C1.73044 13.0869 1.98923 12.7891 2.37009 12.5938C2.75095 12.3887 3.24899 12.291 3.86423 12.3008L13.2832 12.3594L16.1543 3.36523C16.3398 2.7793 16.584 2.33496 16.8867 2.03223C17.1992 1.71973 17.5654 1.56348 17.9853 1.56348C18.415 1.56348 18.7812 1.71973 19.084 2.03223C19.3965 2.33496 19.6455 2.7793 19.831 3.36523L22.7021 12.3594L32.1211 12.3008C32.7363 12.291 33.2343 12.3887 33.6152 12.5938C33.9961 12.7891 34.2549 13.0869 34.3916 13.4873C34.5283 13.8975 34.499 14.2979 34.3037 14.6885C34.1084 15.0693 33.7617 15.4355 33.2636 15.7871L25.5732 21.3096L28.5908 30.2598C28.7861 30.8359 28.8447 31.334 28.7666 31.7539C28.6982 32.1836 28.4931 32.5254 28.1513 32.7793C27.8095 33.0527 27.4238 33.1504 26.9941 33.0723C26.5644 32.9941 26.1054 32.7793 25.6172 32.4277L17.9853 26.8174L10.3681 32.4277C9.87985 32.7793 9.42087 32.9941 8.99118 33.0723C8.56149 33.1504 8.17575 33.0527 7.83396 32.7793ZM10.4121 29.2344C10.4316 29.2637 10.4707 29.2588 10.5293 29.2197L17.1357 24.1221C17.4287 23.8877 17.7119 23.7705 17.9853 23.7705C18.2685 23.7705 18.5566 23.8877 18.8496 24.1221L25.456 29.2197C25.5146 29.2588 25.5537 29.2637 25.5732 29.2344C25.583 29.2148 25.583 29.1758 25.5732 29.1172L22.79 21.2656C22.7119 21.0312 22.6679 20.8213 22.6582 20.6357C22.6582 20.4404 22.707 20.2646 22.8047 20.1084C22.9121 19.9521 23.0732 19.8008 23.2881 19.6543L30.1728 14.9521C30.2314 14.9131 30.2558 14.874 30.2461 14.835C30.2363 14.8057 30.1924 14.791 30.1142 14.791L21.7939 14.9961C21.4131 15.0059 21.1152 14.9424 20.9004 14.8057C20.6855 14.6592 20.5244 14.3955 20.417 14.0146L18.0732 6.03125C18.0537 5.96289 18.0244 5.92871 17.9853 5.92871C17.956 5.92871 17.9316 5.96289 17.9121 6.03125L15.5683 14.0146C15.4609 14.3955 15.2998 14.6592 15.0849 14.8057C14.8701 14.9424 14.5722 15.0059 14.1914 14.9961L5.87107 14.791C5.79294 14.791 5.74899 14.8057 5.73923 14.835C5.72946 14.874 5.75388 14.9131 5.81247 14.9521L12.6972 19.6543C12.9121 19.8008 13.0683 19.9521 13.166 20.1084C13.2734 20.2646 13.3222 20.4404 13.3125 20.6357C13.3125 20.8213 13.2734 21.0312 13.1953 21.2656L10.4121 29.1172C10.3925 29.1758 10.3925 29.2148 10.4121 29.2344Z",fill:"currentColor"})}),kN=X.forwardRef(UN),zN=(n,t)=>Y.jsx("svg",{width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M7.83396 32.7793C7.49216 32.5254 7.2822 32.1836 7.20407 31.7539C7.13571 31.334 7.19919 30.8359 7.3945 30.2598L10.4121 21.3096L2.72165 15.7871C2.2236 15.4355 1.87692 15.0693 1.68161 14.6885C1.4863 14.2979 1.457 13.8975 1.59372 13.4873C1.73044 13.0869 1.98923 12.7891 2.37009 12.5938C2.75095 12.3984 3.24899 12.3008 3.86423 12.3008H13.2832L16.1543 3.36523C16.3398 2.7793 16.584 2.33496 16.8867 2.03223C17.1992 1.71973 17.5654 1.56348 17.9853 1.56348C18.415 1.56348 18.7812 1.71973 19.084 2.03223C19.3965 2.33496 19.6455 2.7793 19.831 3.36523L22.7021 12.3008H32.1211C32.7363 12.3008 33.2343 12.3984 33.6152 12.5938C33.9961 12.7891 34.2549 13.0869 34.3916 13.4873C34.5283 13.8975 34.499 14.2979 34.3037 14.6885C34.1084 15.0693 33.7617 15.4355 33.2636 15.7871L25.5732 21.3096L28.5908 30.2598C28.7861 30.8359 28.8447 31.334 28.7666 31.7539C28.6982 32.1836 28.4931 32.5254 28.1513 32.7793C27.8095 33.0527 27.4238 33.1504 26.9941 33.0723C26.5644 32.9941 26.1054 32.7793 25.6172 32.4277L17.9853 26.8174L10.3681 32.4277C9.87985 32.7793 9.42087 32.9941 8.99118 33.0723C8.56149 33.1504 8.17575 33.0527 7.83396 32.7793Z",fill:"currentColor"})}),VN=X.forwardRef(zN);globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const GN=X.memo(n=>{const t=Ae.c(12);let e,i,a,o,c;t[0]!==n?({uncheckedIcon:c,checkedIcon:i,checked:e,className:a,...o}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a,t[4]=o,t[5]=c):(e=t[1],i=t[2],a=t[3],o=t[4],c=t[5]);let u;t[6]!==a?(u=nn(a,CN.toggleIconButton),t[6]=a,t[7]=u):u=t[7];const f=e?i:c;let d;return t[8]!==o||t[9]!==u||t[10]!==f?(d=Y.jsx("button",{className:u,type:"button",...o,children:f}),t[8]=o,t[9]=u,t[10]=f,t[11]=d):d=t[11],d}),HN={lyrics:[SN,AN],playlist:[wN,RN],repeat:[ON,DN],shuffle:[IN,PN],star:[kN,VN],airplay:[K6,K6]},ga=X.memo(n=>{const t=Ae.c(15);let e,i,a,o;t[0]!==n?({type:o,checked:e,onClick:i,...a}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a,t[4]=o):(e=t[1],i=t[2],a=t[3],o=t[4]);const[c,u]=HN[o];let f;t[5]!==c?(f=Y.jsx(c,{}),t[5]=c,t[6]=f):f=t[6];let d;t[7]!==u?(d=Y.jsx(u,{}),t[7]=u,t[8]=d):d=t[8];const m=e??!1;let y;return t[9]!==i||t[10]!==a||t[11]!==f||t[12]!==d||t[13]!==m?(y=Y.jsx(GN,{uncheckedIcon:f,checkedIcon:d,checked:m,onClick:i,...a}),t[9]=i,t[10]=a,t[11]=f,t[12]=d,t[13]=m,t[14]=y):y=t[14],y}),jN=(n,t)=>Y.jsx("svg",{width:32,height:40,viewBox:"0 0 32 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M14.9042 27.1802C14.4202 27.1802 14.0473 26.9897 13.595 26.5612L10.3815 23.5461C10.3339 23.5065 10.2863 23.4906 10.2228 23.4906H8.01703C6.70778 23.4906 5.99365 22.7527 5.99365 21.38V18.4442C5.99365 17.0715 6.70778 16.3257 8.01703 16.3257H10.2307C10.2863 16.3257 10.3418 16.3019 10.3815 16.2622L13.595 13.2709C14.079 12.8107 14.4361 12.6282 14.8883 12.6282C15.6104 12.6282 16.142 13.1915 16.142 13.8977V25.9344C16.142 26.6406 15.6104 27.1802 14.9042 27.1802Z",className:"speaker-bounce-1"})}),qN=X.forwardRef(jN),XN=(n,t)=>Y.jsxs("svg",{width:43,height:40,viewBox:"0 0 43 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:[Y.jsx("path",{d:"M24.0403 27.1802C23.5642 27.1802 23.1913 26.9897 22.739 26.5612L19.5176 23.5461C19.4779 23.5065 19.4224 23.4906 19.3668 23.4906H17.161C15.8518 23.4906 15.1377 22.7527 15.1377 21.38V18.4442C15.1377 17.0715 15.8518 16.3257 17.161 16.3257H19.3668C19.4303 16.3257 19.4779 16.3019 19.5255 16.2622L22.739 13.2709C23.223 12.8107 23.5721 12.6282 24.0324 12.6282C24.7544 12.6282 25.286 13.1915 25.286 13.8977V25.9344C25.286 26.6406 24.7544 27.1802 24.0403 27.1802Z",className:"speaker-bounce-1"}),Y.jsx("path",{d:"M28.0948 23.6653C27.6028 23.3559 27.4996 22.7687 27.8964 22.1101C28.2931 21.4991 28.5232 20.7136 28.5232 19.8964C28.5232 19.0712 28.301 18.2856 27.8964 17.6826C27.4917 17.032 27.6028 16.4369 28.0948 16.1274C28.547 15.8418 29.1104 15.9529 29.404 16.3576C30.0863 17.3097 30.491 18.5713 30.491 19.8964C30.491 21.2214 30.0863 22.4831 29.404 23.4273C29.1104 23.8399 28.547 23.943 28.0948 23.6653Z",className:"speaker-bounce-2"}),Y.jsx("path",{d:"M31.6733 25.8711C31.1576 25.5696 31.0942 24.9428 31.4432 24.3794C32.2526 23.1257 32.7207 21.5468 32.7207 19.8964C32.7207 18.2459 32.2605 16.6591 31.4432 15.4133C31.0942 14.8499 31.1576 14.2231 31.6733 13.9137C32.1415 13.6439 32.7128 13.755 33.0143 14.2152C34.0855 15.7783 34.6885 17.8016 34.6885 19.8964C34.6885 21.9911 34.0775 23.9985 33.0143 25.5775C32.7128 26.0377 32.1415 26.1488 31.6733 25.8711Z",className:"speaker-bounce-3"}),Y.jsx("path",{d:"M35.2362 28.1007C34.7363 27.7992 34.6569 27.1803 34.9981 26.6249C36.1883 24.7286 36.9104 22.4196 36.9104 19.9122C36.9104 17.397 36.1883 15.0881 34.9981 13.1917C34.6569 12.6362 34.7363 12.0174 35.2362 11.7159C35.7123 11.4302 36.3073 11.5651 36.6088 12.0571C38.0133 14.2866 38.8702 16.9765 38.8702 19.9122C38.8702 22.8401 38.0291 25.5379 36.6088 27.7675C36.3073 28.2515 35.7123 28.3864 35.2362 28.1007Z",className:"speaker-bounce-4"})]}),YN=X.forwardRef(XN);var Zo={speakerAnimate:"LJEMWq_speakerAnimate",volumeControl:"LJEMWq_volumeControl"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const $N=n=>{const t=Ae.c(9),e=X.useRef(n.value),i=X.useRef(null),a=X.useRef(null);let o,c;t[0]!==n.max||t[1]!==n.min||t[2]!==n.value?(o=()=>{e.current!==n.value&&(e.current=n.value,n.value<=n.min&&i.current?(i.current.classList.remove(Zo.speakerAnimate),requestAnimationFrame(()=>{i.current?.classList?.add(Zo.speakerAnimate)})):n.value>=n.max&&a.current&&(a.current.classList.remove(Zo.speakerAnimate),requestAnimationFrame(()=>{a.current?.classList?.add(Zo.speakerAnimate)})))},c=[n.value,n.min,n.max],t[0]=n.max,t[1]=n.min,t[2]=n.value,t[3]=o,t[4]=c):(o=t[3],c=t[4]),X.useEffect(o,c);let u,f;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=Y.jsx(qN,{ref:i,color:"#FFFFFF"}),f=Y.jsx(YN,{ref:a,color:"#FFFFFF"}),t[5]=u,t[6]=f):(u=t[5],f=t[6]);let d;return t[7]!==n?(d=Y.jsx(Cv,{className:Zo.volumeControl,beforeIcon:u,afterIcon:f,changeOnDrag:!0,...n}),t[7]=n,t[8]=d):d=t[8],d},WN=(n,t)=>Y.jsxs("svg",{id:"vector",xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 134 134",fill:"currentColor",ref:t,...n,children:[Y.jsx("path",{d:"M62 60.0717C65.938 62.3453 67.9069 63.4821 68.5677 64.9662C69.1441 66.2608 69.1441 67.7391 68.5677 69.0336C67.9069 70.5177 65.938 71.6545 62 73.9281L41 86.0525C37.062 88.326 35.0931 89.4628 33.4774 89.293C32.0681 89.1449 30.7878 88.4057 29.9549 87.2593C29 85.945 29 83.6714 29 79.1243V54.8755C29 50.3284 29 48.0548 29.9549 46.7405C30.7878 45.5941 32.0681 44.8549 33.4774 44.7068C35.0931 44.537 37.062 45.6738 41 47.9473L62 60.0717Z",className:"amll-forward-left-arrow"}),Y.jsx("path",{d:"M62 60.0717C65.938 62.3453 67.9069 63.4821 68.5677 64.9662C69.1441 66.2608 69.1441 67.7391 68.5677 69.0336C67.9069 70.5177 65.938 71.6545 62 73.9281L41 86.0525C37.062 88.326 35.0931 89.4628 33.4774 89.293C32.0681 89.1449 30.7878 88.4057 29.9549 87.2593C29 85.945 29 83.6714 29 79.1243V54.8755C29 50.3284 29 48.0548 29.9549 46.7405C30.7878 45.5941 32.0681 44.8549 33.4774 44.7068C35.0931 44.537 37.062 45.6738 41 47.9473L62 60.0717Z",className:"amll-forward-left-standby"}),Y.jsx("path",{d:"M102 60.0717C105.938 62.3453 107.907 63.4821 108.568 64.9662C109.144 66.2608 109.144 67.7391 108.568 69.0336C107.907 70.5177 105.938 71.6545 102 73.9281L81 86.0525C77.062 88.326 75.0931 89.4628 73.4774 89.293C72.0681 89.1449 70.7878 88.4057 69.9549 87.2593C69 85.945 69 83.6714 69 79.1243V54.8755C69 50.3284 69 48.0548 69.9549 46.7405C70.7878 45.5941 72.0681 44.8549 73.4774 44.7068C75.0931 44.537 77.062 45.6738 81 47.9473L102 60.0717Z",className:"amll-forward-right-arrow"})]}),ZN=X.forwardRef(WN),KN=(n,t)=>Y.jsx("svg",{id:"vector",width:38,height:38,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M8.46953 37C7.37801 37 6.56603 36.7271 6.03359 36.1814C5.51445 35.6489 5.25488 34.8502 5.25488 33.7854V4.21464C5.25488 3.14975 5.52111 2.35108 6.05355 1.81864C6.59931 1.27288 7.40463 1 8.46953 1H13.3813C14.4329 1 15.2249 1.27288 15.7574 1.81864C16.3031 2.35108 16.576 3.14975 16.576 4.21464V33.7854C16.576 34.8502 16.3031 35.6489 15.7574 36.1814C15.2249 36.7271 14.4329 37 13.3813 37H8.46953ZM24.6426 37C23.5644 37 22.759 36.7271 22.2266 36.1814C21.6942 35.6489 21.4279 34.8502 21.4279 33.7854V4.21464C21.4279 3.14975 21.6942 2.35108 22.2266 1.81864C22.7724 1.27288 23.5777 1 24.6426 1H29.5544C30.6193 1 31.4179 1.27288 31.9504 1.81864C32.4828 2.35108 32.7491 3.14975 32.7491 4.21464V33.7854C32.7491 34.8502 32.4828 35.6489 31.9504 36.1814C31.4179 36.7271 30.6193 37 29.5544 37H24.6426Z",fill:"currentColor",fillRule:"nonzero",id:"path_0"})}),QN=X.forwardRef(KN),JN=(n,t)=>Y.jsx("svg",{id:"vector",width:38,height:38,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M5.80762 32.4896V5.4925C5.80762 4.305 6.12305 3.41438 6.75391 2.82063C7.38477 2.22688 8.13932 1.93 9.01758 1.93C9.78451 1.93 10.5391 2.14029 11.2812 2.56086L33.7324 15.6605C34.5859 16.1553 35.223 16.6562 35.6436 17.1634C36.0641 17.6582 36.2744 18.2705 36.2744 19.0003C36.2744 19.7054 36.0641 20.3177 35.6436 20.8372C35.223 21.3444 34.5859 21.8392 33.7324 22.3216L11.2812 35.4212C10.5391 35.8542 9.78451 36.0706 9.01758 36.0706C8.13932 36.0706 7.38477 35.7676 6.75391 35.1614C6.12305 34.5677 5.80762 33.6771 5.80762 32.4896Z",fill:"currentColor",fillRule:"nonzero"})}),tD=X.forwardRef(JN),eD=(n,t)=>Y.jsxs("svg",{id:"vector",xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 134 134",fill:"currentColor",ref:t,...n,children:[Y.jsx("path",{d:"M72 60.0717C68.062 62.3453 66.0931 63.4821 65.4323 64.9662C64.8559 66.2608 64.8559 67.7391 65.4323 69.0336C66.0931 70.5177 68.062 71.6545 72 73.9281L93 86.0525C96.938 88.326 98.9069 89.4628 100.523 89.293C101.932 89.1449 103.212 88.4057 104.045 87.2593C105 85.945 105 83.6714 105 79.1243V54.8755C105 50.3284 105 48.0548 104.045 46.7405C103.212 45.5941 101.932 44.8549 100.523 44.7068C98.9069 44.537 96.938 45.6738 93 47.9473L72 60.0717Z",className:"amll-rewind-right-arrow"}),Y.jsx("path",{d:"M72 60.0717C68.062 62.3453 66.0931 63.4821 65.4323 64.9662C64.8559 66.2608 64.8559 67.7391 65.4323 69.0336C66.0931 70.5177 68.062 71.6545 72 73.9281L93 86.0525C96.938 88.326 98.9069 89.4628 100.523 89.293C101.932 89.1449 103.212 88.4057 104.045 87.2593C105 85.945 105 83.6714 105 79.1243V54.8755C105 50.3284 105 48.0548 104.045 46.7405C103.212 45.5941 101.932 44.8549 100.523 44.7068C98.9069 44.537 96.938 45.6738 93 47.9473L72 60.0717Z",className:"amll-rewind-right-standby"}),Y.jsx("path",{d:"M32 60.0717C28.062 62.3453 26.0931 63.4821 25.4323 64.9662C24.8559 66.2608 24.8559 67.7391 25.4323 69.0336C26.0931 70.5177 28.062 71.6545 32 73.9281L53 86.0525C56.938 88.326 58.9069 89.4628 60.5226 89.293C61.9319 89.1449 63.2122 88.4057 64.0451 87.2593C65 85.945 65 83.6714 65 79.1243V54.8755C65 50.3284 65 48.0548 64.0451 46.7405C63.2122 45.5941 61.9319 44.8549 60.5226 44.7068C58.9069 44.537 56.938 45.6738 53 47.9473L32 60.0717Z",className:"amll-rewind-left-arrow"})]}),nD=X.forwardRef(eD),iD=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M14.2495 28.9956C13.6519 28.9956 13.1465 28.7891 12.7334 28.376C12.3203 27.9541 12.1138 27.4531 12.1138 26.873V25.3438C12.1138 23.832 12.4565 22.5312 13.1421 21.4414C13.8276 20.3516 14.8076 19.5166 16.082 18.9365C17.3564 18.3477 18.877 18.0532 20.6436 18.0532H30.3599V15.4033C30.3599 14.9111 30.4961 14.5288 30.7686 14.2563C31.041 13.9751 31.4146 13.8345 31.8892 13.8345C32.1177 13.8345 32.3198 13.874 32.4956 13.9531C32.6714 14.0234 32.8296 14.1113 32.9702 14.2168L38.7578 19.1343C39.1182 19.4331 39.2939 19.7979 39.2852 20.2285C39.2852 20.6504 39.1094 21.0107 38.7578 21.3096L32.9702 26.2271C32.8296 26.3501 32.6714 26.4468 32.4956 26.5171C32.3198 26.5874 32.1177 26.6226 31.8892 26.6226C31.4146 26.6226 31.041 26.4819 30.7686 26.2007C30.4961 25.9194 30.3599 25.5415 30.3599 25.0669V22.1929H20.459C19.1846 22.1929 18.1826 22.5269 17.4531 23.1948C16.7236 23.8628 16.3589 24.7812 16.3589 25.9502V26.873C16.3589 27.4531 16.1523 27.9541 15.7393 28.376C15.3262 28.7891 14.8296 28.9956 14.2495 28.9956ZM41.7505 26.7017C42.3306 26.7017 42.8271 26.9082 43.2402 27.3213C43.6621 27.7344 43.873 28.2354 43.873 28.8242V30.3535C43.873 31.8652 43.5303 33.166 42.8447 34.2559C42.1592 35.3457 41.1792 36.1851 39.9048 36.7739C38.6304 37.354 37.1055 37.644 35.3301 37.644H25.627V40.2676C25.627 40.751 25.4907 41.1333 25.2183 41.4146C24.9458 41.6958 24.5723 41.8364 24.0977 41.8364C23.8691 41.8364 23.6626 41.7969 23.478 41.7178C23.3022 41.6475 23.1484 41.5552 23.0166 41.4409L17.2158 36.5366C16.873 36.2466 16.6973 35.8862 16.6885 35.4556C16.6885 35.0249 16.8643 34.6558 17.2158 34.3481L23.0166 29.4307C23.1484 29.3164 23.3022 29.2241 23.478 29.1538C23.6626 29.0835 23.8691 29.0483 24.0977 29.0483C24.5723 29.0483 24.9458 29.189 25.2183 29.4702C25.4907 29.7427 25.627 30.125 25.627 30.6172V33.4912H35.5278C36.8022 33.4912 37.8042 33.1616 38.5337 32.5024C39.2632 31.8345 39.6279 30.916 39.6279 29.7471V28.8242C39.6279 28.2354 39.8301 27.7344 40.2344 27.3213C40.6475 26.9082 41.1528 26.7017 41.7505 26.7017Z",fill:"white"})}),sD=X.forwardRef(iD),rD=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.5805 0H18.4195C12.0146 0 9.69208 0.666878 7.35056 1.91914C5.00904 3.1714 3.1714 5.00904 1.91914 7.35056C0.666879 9.69208 0 12.0146 0 18.4195V37.5805C0 43.9854 0.666879 46.3079 1.91914 48.6494C3.1714 50.991 5.00904 52.8286 7.35056 54.0809C9.69208 55.3331 12.0146 56 18.4195 56H37.5805C43.9854 56 46.3079 55.3331 48.6495 54.0809C50.991 52.8286 52.8286 50.991 54.0809 48.6494C55.3331 46.3079 56 43.9854 56 37.5805V18.4195C56 12.0146 55.3331 9.69208 54.0809 7.35056C52.8286 5.00904 50.991 3.1714 48.6495 1.91914C46.3079 0.666878 43.9854 0 37.5805 0ZM12.7334 28.376C13.1465 28.7891 13.6519 28.9956 14.2495 28.9956C14.8296 28.9956 15.3262 28.7891 15.7393 28.376C16.1523 27.9541 16.3589 27.4531 16.3589 26.873V25.9502C16.3589 24.7812 16.7236 23.8628 17.4531 23.1948C18.1826 22.5269 19.1846 22.1929 20.459 22.1929H30.3599V25.0669C30.3599 25.5415 30.4961 25.9194 30.7686 26.2007C31.041 26.4819 31.4146 26.6226 31.8892 26.6226C32.1177 26.6226 32.3198 26.5874 32.4956 26.5171C32.6714 26.4468 32.8296 26.3501 32.9702 26.2271L38.7578 21.3096C39.1094 21.0107 39.2852 20.6504 39.2852 20.2285C39.2939 19.7979 39.1182 19.4331 38.7578 19.1343L32.9702 14.2168C32.8296 14.1113 32.6714 14.0234 32.4956 13.9531C32.3198 13.874 32.1177 13.8345 31.8892 13.8345C31.4146 13.8345 31.041 13.9751 30.7686 14.2563C30.4961 14.5288 30.3599 14.9111 30.3599 15.4033V18.0532H20.6436C18.877 18.0532 17.3564 18.3477 16.082 18.9365C14.8076 19.5166 13.8276 20.3516 13.1421 21.4414C12.4565 22.5312 12.1138 23.832 12.1138 25.3438V26.873C12.1138 27.4531 12.3203 27.9541 12.7334 28.376ZM43.2402 27.3213C42.8271 26.9082 42.3306 26.7017 41.7505 26.7017C41.1528 26.7017 40.6475 26.9082 40.2344 27.3213C39.8301 27.7344 39.6279 28.2354 39.6279 28.8242V29.7471C39.6279 30.916 39.2632 31.8345 38.5337 32.5024C37.8042 33.1616 36.8022 33.4912 35.5278 33.4912H25.627V30.6172C25.627 30.125 25.4907 29.7427 25.2183 29.4702C24.9458 29.189 24.5723 29.0483 24.0977 29.0483C23.8691 29.0483 23.6626 29.0835 23.478 29.1538C23.3022 29.2241 23.1484 29.3164 23.0166 29.4307L17.2158 34.3481C16.8643 34.6558 16.6885 35.0249 16.6885 35.4556C16.6973 35.8862 16.873 36.2466 17.2158 36.5366L23.0166 41.4409C23.1484 41.5552 23.3022 41.6475 23.478 41.7178C23.6626 41.7969 23.8691 41.8364 24.0977 41.8364C24.5723 41.8364 24.9458 41.6958 25.2183 41.4146C25.4907 41.1333 25.627 40.751 25.627 40.2676V37.644H35.3301C37.1055 37.644 38.6304 37.354 39.9048 36.7739C41.1792 36.1851 42.1592 35.3457 42.8447 34.2559C43.5303 33.166 43.873 31.8652 43.873 30.3535V28.8242C43.873 28.2354 43.6621 27.7344 43.2402 27.3213Z",fill:"white"})}),aD=X.forwardRef(rD),oD=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.5805 0H18.4195C12.0146 0 9.69208 0.666878 7.35056 1.91914C5.00904 3.1714 3.1714 5.00904 1.91914 7.35056C0.666879 9.69208 0 12.0146 0 18.4195V37.5805C0 43.9854 0.666879 46.3079 1.91914 48.6494C3.1714 50.991 5.00904 52.8286 7.35056 54.0809C9.69208 55.3331 12.0146 56 18.4195 56H37.5805C43.9854 56 46.3079 55.3331 48.6495 54.0809C50.991 52.8286 52.8286 50.991 54.0809 48.6494C55.3331 46.3079 56 43.9854 56 37.5805V18.4195C56 12.0146 55.3331 9.69208 54.0809 7.35056C52.8286 5.00904 50.991 3.1714 48.6495 1.91914C46.3079 0.666878 43.9854 0 37.5805 0ZM13.2212 28.4946C13.5552 28.8198 13.9858 28.9824 14.5132 28.9824C15.0405 28.9824 15.4668 28.8198 15.792 28.4946C16.1172 28.1606 16.2798 27.73 16.2798 27.2026V26.1743C16.2798 25.0142 16.6401 24.1001 17.3608 23.4321C18.0903 22.7554 19.0791 22.417 20.3271 22.417H26.5103V25.3701C26.5103 25.7744 26.6245 26.0952 26.853 26.3325C27.0903 26.561 27.4111 26.6753 27.8154 26.6753C28 26.6753 28.1714 26.6445 28.3296 26.583C28.4878 26.5215 28.6284 26.438 28.7515 26.3325L34.2622 21.6919C34.5698 21.437 34.7236 21.1294 34.7236 20.769C34.7236 20.3999 34.5698 20.0879 34.2622 19.833L28.7515 15.1924C28.6284 15.0869 28.4878 15.0034 28.3296 14.9419C28.1714 14.8804 28 14.8496 27.8154 14.8496C27.4111 14.8496 27.0903 14.9683 26.853 15.2056C26.6245 15.4341 26.5103 15.7549 26.5103 16.168V18.9629H20.5249C18.9165 18.9629 17.5322 19.2354 16.3721 19.7803C15.2119 20.3164 14.3154 21.0898 13.6826 22.1006C13.0498 23.1113 12.7334 24.3198 12.7334 25.7261V27.2026C12.7334 27.73 12.896 28.1606 13.2212 28.4946ZM42.7393 27.6509C42.4141 27.3257 41.9878 27.1631 41.4604 27.1631C40.9331 27.1631 40.5068 27.3257 40.1816 27.6509C39.8564 27.9761 39.6938 28.4067 39.6938 28.9429V29.9712C39.6938 31.1313 39.3291 32.0454 38.5996 32.7134C37.8789 33.3813 36.8945 33.7153 35.6465 33.7153H25.6138V30.7754C25.6138 30.3623 25.4995 30.0415 25.271 29.813C25.0425 29.5757 24.7261 29.457 24.3218 29.457C24.1284 29.457 23.9526 29.4878 23.7944 29.5493C23.6362 29.6108 23.4956 29.6943 23.3726 29.7998L17.8618 34.4404C17.563 34.7041 17.4136 35.0161 17.4136 35.3765C17.4136 35.7368 17.563 36.0444 17.8618 36.2993L23.3726 40.9399C23.4956 41.0454 23.6362 41.1289 23.7944 41.1904C23.9526 41.252 24.1284 41.2827 24.3218 41.2827C24.7261 41.2827 25.0425 41.1641 25.271 40.9268C25.4995 40.6982 25.6138 40.3818 25.6138 39.9775V37.1826H35.4487C37.0483 37.1826 38.4282 36.9146 39.5884 36.3784C40.7573 35.8335 41.6582 35.0557 42.291 34.0449C42.9238 33.0254 43.2402 31.8169 43.2402 30.4194V28.9429C43.2402 28.4067 43.0732 27.9761 42.7393 27.6509ZM40.2871 24.1968C40.6035 24.4868 41.021 24.6318 41.5396 24.6318C42.0669 24.6318 42.4844 24.4868 42.792 24.1968C43.1084 23.9067 43.2666 23.4629 43.2666 22.8652V16.603C43.2666 16.0142 43.0776 15.5396 42.6997 15.1792C42.3306 14.8188 41.856 14.6387 41.2759 14.6387C40.8188 14.6387 40.4189 14.709 40.0762 14.8496C39.7422 14.9902 39.3994 15.188 39.0479 15.4429L37.2812 16.7612C37.0176 16.9458 36.8374 17.1216 36.7407 17.2886C36.644 17.4556 36.5957 17.6533 36.5957 17.8818C36.5957 18.207 36.7012 18.4707 36.9121 18.6729C37.123 18.875 37.3911 18.9761 37.7163 18.9761C38.0151 18.9761 38.2832 18.8838 38.5205 18.6992L39.707 17.7632H39.8125V22.8652C39.8125 23.4629 39.9707 23.9067 40.2871 24.1968Z",fill:"white"})}),lD=X.forwardRef(oD),cD=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{d:"M10.624 36.3125C10.624 35.75 10.8218 35.2754 11.2173 34.8887C11.6216 34.4932 12.1094 34.2954 12.6807 34.2954H15.4756C16.3896 34.2954 17.1455 34.1372 17.7432 33.8208C18.3496 33.5044 18.9341 32.9946 19.4966 32.2915L27.3936 22.3379C28.3955 21.0811 29.4282 20.2285 30.4917 19.7803C31.5552 19.332 32.79 19.1079 34.1963 19.1079H36.4243V16.1548C36.4243 15.6714 36.5605 15.2935 36.833 15.021C37.1055 14.7397 37.479 14.5991 37.9536 14.5991C38.1821 14.5991 38.3843 14.6343 38.5601 14.7046C38.7446 14.7749 38.9072 14.8672 39.0479 14.9814L44.8223 19.8857C45.1826 20.1846 45.3628 20.5493 45.3628 20.98C45.3628 21.4106 45.1826 21.7754 44.8223 22.0742L39.0479 26.9917C38.9072 27.106 38.7446 27.2026 38.5601 27.2817C38.3843 27.3521 38.1821 27.3872 37.9536 27.3872C37.479 27.3872 37.1055 27.2466 36.833 26.9653C36.5605 26.6841 36.4243 26.3018 36.4243 25.8184V23.1421H33.9194C33.3218 23.1421 32.8076 23.2036 32.377 23.3267C31.9551 23.4497 31.564 23.6562 31.2036 23.9463C30.8521 24.2275 30.4829 24.6143 30.0962 25.1064L21.606 35.7061C20.8853 36.6113 20.0986 37.2749 19.2461 37.6968C18.3936 38.1099 17.3389 38.3164 16.082 38.3164H12.6807C12.1094 38.3164 11.6216 38.123 11.2173 37.7363C10.8218 37.3496 10.624 36.875 10.624 36.3125ZM10.624 21.125C10.624 20.5625 10.8218 20.0879 11.2173 19.7012C11.6216 19.3057 12.1094 19.1079 12.6807 19.1079H15.7261C16.9829 19.1079 18.0947 19.3188 19.0615 19.7407C20.0371 20.1538 20.8853 20.8174 21.606 21.7314L30.0435 32.2783C30.5972 32.9727 31.1992 33.4824 31.8496 33.8076C32.5 34.1328 33.291 34.2954 34.2227 34.2954H36.4243V31.5664C36.4243 31.083 36.5605 30.7007 36.833 30.4194C37.1055 30.1382 37.479 29.9976 37.9536 29.9976C38.1821 29.9976 38.3843 30.0371 38.5601 30.1162C38.7446 30.1865 38.9072 30.2832 39.0479 30.4062L44.8223 35.2974C45.1826 35.5962 45.3628 35.9609 45.3628 36.3916C45.3628 36.8223 45.1826 37.187 44.8223 37.4858L39.0479 42.3901C38.9072 42.5132 38.7446 42.6099 38.5601 42.6802C38.3843 42.7593 38.1821 42.7988 37.9536 42.7988C37.479 42.7988 37.1055 42.6582 36.833 42.377C36.5605 42.0957 36.4243 41.7134 36.4243 41.23V38.3164H34.1699C32.9043 38.3164 31.7222 38.1011 30.6235 37.6704C29.5249 37.231 28.5625 36.4927 27.7363 35.4556L19.4966 25.146C18.9341 24.4429 18.2925 23.9331 17.5718 23.6167C16.8599 23.3003 16.0381 23.1421 15.1064 23.1421H12.6807C12.1094 23.1421 11.6216 22.9443 11.2173 22.5488C10.8218 22.1533 10.624 21.6787 10.624 21.125Z",fill:"white"})}),uD=X.forwardRef(cD),hD=(n,t)=>Y.jsx("svg",{width:56,height:56,viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...n,children:Y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.5805 0H18.4195C12.0146 0 9.69208 0.666878 7.35056 1.91914C5.00904 3.1714 3.1714 5.00904 1.91914 7.35056C0.666879 9.69208 0 12.0146 0 18.4195V37.5805C0 43.9854 0.666879 46.3079 1.91914 48.6494C3.1714 50.991 5.00904 52.8286 7.35056 54.0809C9.69208 55.3331 12.0146 56 18.4195 56H37.5805C43.9854 56 46.3079 55.3331 48.6495 54.0809C50.991 52.8286 52.8286 50.991 54.0809 48.6494C55.3331 46.3079 56 43.9854 56 37.5805V18.4195C56 12.0146 55.3331 9.69208 54.0809 7.35056C52.8286 5.00904 50.991 3.1714 48.6495 1.91914C46.3079 0.666878 43.9854 0 37.5805 0ZM11.2173 34.8887C10.8218 35.2754 10.624 35.75 10.624 36.3125C10.624 36.875 10.8218 37.3496 11.2173 37.7363C11.6216 38.123 12.1094 38.3164 12.6807 38.3164H16.082C17.3389 38.3164 18.3936 38.1099 19.2461 37.6968C20.0986 37.2749 20.8853 36.6113 21.606 35.7061L24.7747 31.75L27.7363 35.4556C28.5625 36.4927 29.5249 37.231 30.6235 37.6704C31.7222 38.1011 32.9043 38.3164 34.1699 38.3164H36.4243V41.23C36.4243 41.7134 36.5605 42.0957 36.833 42.377C37.1055 42.6582 37.479 42.7988 37.9536 42.7988C38.1821 42.7988 38.3843 42.7593 38.5601 42.6802C38.7446 42.6099 38.9072 42.5132 39.0479 42.3901L44.8223 37.4858C45.1826 37.187 45.3628 36.8223 45.3628 36.3916C45.3628 35.9609 45.1826 35.5962 44.8223 35.2974L39.0479 30.4062C38.9072 30.2832 38.7446 30.1865 38.5601 30.1162C38.3843 30.0371 38.1821 29.9976 37.9536 29.9976C37.479 29.9976 37.1055 30.1382 36.833 30.4194C36.5605 30.7007 36.4243 31.083 36.4243 31.5664V34.2954H34.2227C33.291 34.2954 32.5 34.1328 31.8496 33.8076C31.1992 33.4824 30.5972 32.9727 30.0435 32.2783L27.1993 28.7231L30.0962 25.1064C30.4829 24.6143 30.8521 24.2275 31.2036 23.9463C31.564 23.6562 31.9551 23.4497 32.377 23.3267C32.8076 23.2036 33.3218 23.1421 33.9194 23.1421H36.4243V25.8184C36.4243 26.3018 36.5605 26.6841 36.833 26.9653C37.1055 27.2466 37.479 27.3872 37.9536 27.3872C38.1821 27.3872 38.3843 27.3521 38.5601 27.2817C38.7446 27.2026 38.9072 27.106 39.0479 26.9917L44.8223 22.0742C45.1826 21.7754 45.3628 21.4106 45.3628 20.98C45.3628 20.5493 45.1826 20.1846 44.8223 19.8857L39.0479 14.9814C38.9072 14.8672 38.7446 14.7749 38.5601 14.7046C38.3843 14.6343 38.1821 14.5991 37.9536 14.5991C37.479 14.5991 37.1055 14.7397 36.833 15.021C36.5605 15.2935 36.4243 15.6714 36.4243 16.1548V19.1079H34.1963C32.79 19.1079 31.5552 19.332 30.4917 19.7803C29.4282 20.2285 28.3955 21.0811 27.3936 22.3379L24.7534 25.6657L21.606 21.7314C20.8853 20.8174 20.0371 20.1538 19.0615 19.7407C18.0947 19.3188 16.9829 19.1079 15.7261 19.1079H12.6807C12.1094 19.1079 11.6216 19.3057 11.2173 19.7012C10.8218 20.0879 10.624 20.5625 10.624 21.125C10.624 21.6787 10.8218 22.1533 11.2173 22.5488C11.6216 22.9443 12.1094 23.1421 12.6807 23.1421H15.1064C16.0381 23.1421 16.8599 23.3003 17.5718 23.6167C18.2925 23.9331 18.9341 24.4429 19.4966 25.146L22.3415 28.7056L19.4966 32.2915C18.9341 32.9946 18.3496 33.5044 17.7432 33.8208C17.1455 34.1372 16.3896 34.2954 15.4756 34.2954H12.6807C12.1094 34.2954 11.6216 34.4932 11.2173 34.8887Z",fill:"white"})}),fD=X.forwardRef(hD);globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const $n=n=>({}),Sv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onClickControlThumbAtom",zt($n()));Sv.debugLabel="onClickControlThumbAtom";const _v=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onClickAudioQualityTagAtom",zt($n()));_v.debugLabel="onClickAudioQualityTagAtom";const Av=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onRequestOpenMenuAtom",zt($n()));Av.debugLabel="onRequestOpenMenuAtom";const Ev=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onPlayOrResumeAtom",zt($n()));Ev.debugLabel="onPlayOrResumeAtom";const wv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onRequestPrevSongAtom",zt($n()));wv.debugLabel="onRequestPrevSongAtom";const Mv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onRequestNextSongAtom",zt($n()));Mv.debugLabel="onRequestNextSongAtom";const Rv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onSeekPositionAtom",zt($n()));Rv.debugLabel="onSeekPositionAtom";const Lv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onLyricLineClickAtom",zt($n()));Lv.debugLabel="onLyricLineClickAtom";const Ov=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onLyricLineContextMenuAtom",zt($n()));Ov.debugLabel="onLyricLineContextMenuAtom";const Nv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onChangeVolumeAtom",zt($n()));Nv.debugLabel="onChangeVolumeAtom";const Dv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onToggleShuffleAtom",zt($n()));Dv.debugLabel="onToggleShuffleAtom";const Bv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/callbacks.ts/onCycleRepeatModeAtom",zt($n()));Bv.debugLabel="onCycleRepeatModeAtom";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const dD=()=>{switch(localStorage.getItem("amll-react-full.lyricPlayerImplementation")){default:return{lyricPlayer:bv}}},Iv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricPlayerImplementationAtom",zt(dD()));Iv.debugLabel="lyricPlayerImplementationAtom";const hm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/enableLyricLineBlurEffectAtom",ye("amll-react-full.enableLyricLineBlurEffect",!0));hm.debugLabel="enableLyricLineBlurEffectAtom";const fm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/enableLyricLineScaleEffectAtom",ye("amll-react-full.enableLyricLineScaleEffect",!0));fm.debugLabel="enableLyricLineScaleEffectAtom";const dm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/enableLyricLineSpringAnimationAtom",ye("amll-react-full.enableLyricLineSpringAnimation",!0));dm.debugLabel="enableLyricLineSpringAnimationAtom";const mm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/enableLyricTranslationLineAtom",ye("amll-react-full.enableLyricTranslationLine",!0));mm.debugLabel="enableLyricTranslationLineAtom";const pm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/enableLyricRomanLineAtom",ye("amll-react-full.enableLyricRomanLine",!0));pm.debugLabel="enableLyricRomanLineAtom";const Fv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/enableLyricSwapTransRomanLineAtom",ye("amll-react-full.enableLyricSwapTransRomanLine",!1));Fv.debugLabel="enableLyricSwapTransRomanLineAtom";const Pv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricWordFadeWidthAtom",ye("amll-react-full.lyricWordFadeWidth",.5));Pv.debugLabel="lyricWordFadeWidthAtom";const fh=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricFontFamilyAtom",ye("amll-react-full.lyricFontFamily",""));fh.debugLabel="lyricFontFamilyAtom";const dh=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricFontWeightAtom",ye("amll-react-full.lyricFontWeight",600));dh.debugLabel="lyricFontWeightAtom";const mh=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricLetterSpacingAtom",ye("amll-react-full.lyricLetterSpacing","normal"));mh.debugLabel="lyricLetterSpacingAtom";const Uv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricSizePresetAtom",ye("amll-react-full.lyricSizePreset","medium"));Uv.debugLabel="lyricSizePresetAtom";const kv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/playerControlsTypeAtom",ye("amll-react-full.playerControlsType","controls"));kv.debugLabel="playerControlsTypeAtom";const ym=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/showMusicNameAtom",ye("amll-react-full.showMusicName",!0));ym.debugLabel="showMusicNameAtom";const zv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/verticalCoverLayoutAtom",ye("amll-react-full.verticalCoverLayout","auto"));zv.debugLabel="verticalCoverLayoutAtom";const gm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/showMusicArtistsAtom",ye("amll-react-full.showMusicArtists",!0));gm.debugLabel="showMusicArtistsAtom";const vm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/showMusicAlbumAtom",ye("amll-react-full.showMusicAlbum",!1));vm.debugLabel="showMusicAlbumAtom";const bm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/showVolumeControlAtom",ye("amll-react-full.showVolumeControl",!0));bm.debugLabel="showVolumeControlAtom";const xm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/showBottomControlAtom",ye("amll-react-full.showBottomControl",!0));xm.debugLabel="showBottomControlAtom";const mD=()=>{switch(localStorage.getItem("amll-react-full.lyricBackgroundRenderer")){case"pixi":return{renderer:pv};case"css-bg":return{renderer:"css-bg"};default:return{renderer:lm}}},Vv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricBackgroundRendererAtom",zt(mD()));Vv.debugLabel="lyricBackgroundRendererAtom";const Gv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/cssBackgroundPropertyAtom",ye("amll-player.cssBackgroundProperty","#111111"));Gv.debugLabel="cssBackgroundPropertyAtom";const Cm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricBackgroundFPSAtom",ye("amll-react-full.lyricBackgroundFPS",60));Cm.debugLabel="lyricBackgroundFPSAtom";const Hv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricBackgroundRenderScaleAtom",ye("amll-react-full.lyricBackgroundRenderScale",1));Hv.debugLabel="lyricBackgroundRenderScaleAtom";const jv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricBackgroundStaticModeAtom",ye("amll-react-full.lyricBackgroundStaticMode",!1));jv.debugLabel="lyricBackgroundStaticModeAtom";const ph=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/isLyricPageOpenedAtom",zt(!1));ph.debugLabel="isLyricPageOpenedAtom";const qv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/hideLyricViewAtom",ye("amll-react-full.hideLyricView",!1));qv.debugLabel="hideLyricViewAtom";const Tm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/showRemainingTimeAtom",ye("amll-react-full.showRemainingTime",!0));Tm.debugLabel="showRemainingTimeAtom";const pD=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/fftDataRangeAtom",ye("amll-react-full.fftDataRange",[80,2e3]));pD.debugLabel="fftDataRangeAtom";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const Xv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/controlsAtoms.ts/isShuffleActiveAtom",zt(!1));Xv.debugLabel="isShuffleActiveAtom";const Yv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/controlsAtoms.ts/repeatModeAtom",zt("off"));Yv.debugLabel="repeatModeAtom";const yD=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/controlsAtoms.ts/isShuffleEnabledAtom",zt(!0));yD.debugLabel="isShuffleEnabledAtom";const gD=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/controlsAtoms.ts/isRepeatEnabledAtom",zt(!0));gD.debugLabel="isRepeatEnabledAtom";const $v=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/controlsAtoms.ts/toggleShuffleActionAtom",zt(null,n=>{n(Dv).onEmit?.()}));$v.debugLabel="toggleShuffleActionAtom";const Wv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/controlsAtoms.ts/cycleRepeatModeActionAtom",zt(null,n=>{n(Bv).onEmit?.()}));Wv.debugLabel="cycleRepeatModeActionAtom";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const vD=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicIdAtom",zt(""));vD.debugLabel="musicIdAtom";const Sm=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicNameAtom",zt("未知歌曲"));Sm.debugLabel="musicNameAtom";const _m=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicArtistsAtom",zt([{name:"未知创作者",id:"unknown"}]));_m.debugLabel="musicArtistsAtom";const Zv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicAlbumNameAtom",zt("未知专辑"));Zv.debugLabel="musicAlbumNameAtom";const Kv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicCoverAtom",zt(""));Kv.debugLabel="musicCoverAtom";const Qv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicCoverIsVideoAtom",zt(!1));Qv.debugLabel="musicCoverIsVideoAtom";const Ml=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicDurationAtom",zt(0));Ml.debugLabel="musicDurationAtom";const Ga=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicPlayingAtom",zt(!1));Ga.debugLabel="musicPlayingAtom";const Rl=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicPlayingPositionAtom",zt(0));Rl.debugLabel="musicPlayingPositionAtom";const Jv=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicVolumeAtom",ye("amll-react-full.musicVolumeAtom",.5,void 0,{getOnInit:!0}));Jv.debugLabel="musicVolumeAtom";const Am=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicLyricLinesAtom",zt([]));Am.debugLabel="musicLyricLinesAtom";const bD=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicQualityAtom",zt({type:"none",codec:"unknown",channels:2,sampleRate:44100,sampleFormat:"s16"}));bD.debugLabel="musicQualityAtom";const tb=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/musicQualityTagAtom",zt(null));tb.debugLabel="musicQualityTagAtom";const eb=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/fftDataAtom",zt([]));eb.debugLabel="fftDataAtom";const nb=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/dataAtoms.ts/lowFreqVolumeAtom",zt(1));nb.debugLabel="lowFreqVolumeAtom";var Je={autoLyricLayout:"UjzbJG_autoLyricLayout",bigControls:"UjzbJG_bigControls",bigMusicInfo:"UjzbJG_bigMusicInfo",bigVolumeControl:"UjzbJG_bigVolumeControl",controls:"UjzbJG_controls",hideLyric:"UjzbJG_hideLyric",horizontalControls:"UjzbJG_horizontalControls",progressBarLabels:"UjzbJG_progressBarLabels",qualityTag:"UjzbJG_qualityTag",smallMusicInfo:"UjzbJG_smallMusicInfo",songMediaButton:"UjzbJG_songMediaButton",songMediaPlayButton:"UjzbJG_songMediaPlayButton"};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const g0=n=>{const t=Ae.c(15),{className:e,style:i}=n,a=Ct(Sm),o=Ct(_m),c=Ct(Zv),u=Ct(Av).onEmit,f=Ct(ym),d=Ct(gm),m=Ct(vm),y=Ct(fh),v=Ct(dh),x=Ct(mh),b=y||void 0,T=v||void 0,C=x||void 0;let _;t[0]!==i||t[1]!==b||t[2]!==T||t[3]!==C?(_={...i,fontFamily:b,fontWeight:T,letterSpacing:C},t[0]=i,t[1]=b,t[2]=T,t[3]=C,t[4]=_):_=t[4];const R=_,L=f?a:void 0;let P;t[5]!==o||t[6]!==d?(P=d?o.map(AD):void 0,t[5]=o,t[6]=d,t[7]=P):P=t[7];const w=m?c:void 0;let F;return t[8]!==e||t[9]!==R||t[10]!==u||t[11]!==L||t[12]!==P||t[13]!==w?(F=Y.jsx(mN,{className:e,style:R,name:L,artists:P,album:w,onMenuButtonClicked:u}),t[8]=e,t[9]=R,t[10]=u,t[11]=L,t[12]=P,t[13]=w,t[14]=F):F=t[14],F},xD=n=>{const t=Ae.c(28),{showOtherButtons:e}=n,i=Ct(Ga),a=Ct(wv).onEmit,o=Ct(Mv).onEmit,c=Ct(Ev).onEmit,u=Ct(Xv),f=Ct(Yv),d=Du($v),m=Du(Wv);let y;t[0]===Symbol.for("react.memo_cache_sentinel")?(y={width:"1.3em",height:"1.3em"},t[0]=y):y=t[0];const v=y;let x;t[1]!==f?(x=()=>{switch(f){case"one":return Y.jsx(lD,{color:"#ffffffff",style:v});case"all":return Y.jsx(aD,{color:"#ffffffff",style:v});default:return Y.jsx(sD,{color:"#ffffffff",style:v})}},t[1]=f,t[2]=x):x=t[2];const b=x;let T;t[3]!==u||t[4]!==e||t[5]!==d?(T=e&&Y.jsx($o,{className:Je.songMediaButton,onClick:d,children:u?Y.jsx(fD,{color:"#ffffffff",style:v}):Y.jsx(uD,{color:"#ffffffff",style:v})}),t[3]=u,t[4]=e,t[5]=d,t[6]=T):T=t[6];let C;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=Y.jsx(nD,{color:"#FFFFFF"}),t[7]=C):C=t[7];let _;t[8]!==a?(_=Y.jsx($o,{className:Je.songMediaButton,onClick:a,children:C}),t[8]=a,t[9]=_):_=t[9];let R;t[10]!==i?(R=i?Y.jsx(QN,{color:"#FFFFFF"}):Y.jsx(tD,{color:"#FFFFFF"}),t[10]=i,t[11]=R):R=t[11];let L;t[12]!==c||t[13]!==R?(L=Y.jsx($o,{className:Je.songMediaPlayButton,onClick:c,children:R}),t[12]=c,t[13]=R,t[14]=L):L=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=Y.jsx(ZN,{color:"#FFFFFF"}),t[15]=P):P=t[15];let w;t[16]!==o?(w=Y.jsx($o,{className:Je.songMediaButton,onClick:o,children:P}),t[16]=o,t[17]=w):w=t[17];let F;t[18]!==m||t[19]!==b||t[20]!==e?(F=e&&Y.jsx($o,{className:Je.songMediaButton,onClick:m,children:b()}),t[18]=m,t[19]=b,t[20]=e,t[21]=F):F=t[21];let E;return t[22]!==F||t[23]!==T||t[24]!==_||t[25]!==L||t[26]!==w?(E=Y.jsxs(Y.Fragment,{children:[T,_,L,w,F]}),t[22]=F,t[23]=T,t[24]=_,t[25]=L,t[26]=w,t[27]=E):E=t[27],E},Q6=n=>{const t=Ae.c(4),{isRemaining:e}=n,i=Ct(Rl),a=Ct(Ml),o=e?(i-a)/1e3:i/1e3;let c;t[0]!==o?(c=Tv(o),t[0]=o,t[1]=c):c=t[1];const u=c;let f;return t[2]!==u?(f=Y.jsx(Y.Fragment,{children:u}),t[2]=u,t[3]=f):f=t[3],f},CD=()=>{const n=Ae.c(4),t=Ct(Ml)/1e3;let e;n[0]!==t?(e=Tv(t),n[0]=t,n[1]=e):e=n[1];const i=e;let a;return n[2]!==i?(a=Y.jsx(Y.Fragment,{children:i}),n[2]=i,n[3]=a):a=n[3],a},Em=globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/components/PrebuiltLyricPlayer/index.tsx/manualSeekTriggerAtom",zt(null));Em.debugLabel="manualSeekTriggerAtom";const J6=Qu.memo(()=>{const n=Ae.c(38),t=Ct(Ml),e=Ct(Rl),i=Ct(Ga),a=Ct(tb),o=Ct(_v).onEmit,c=Ct(Rv).onEmit,u=Du(Em),[f,d]=c8(Tm),m=Ct(fh),y=Ct(dh),v=Ct(mh),x=m||void 0,b=y||void 0,T=v||void 0;let C;n[0]!==x||n[1]!==b||n[2]!==T?(C={fontFamily:x,fontWeight:b,letterSpacing:T},n[0]=x,n[1]=b,n[2]=T,n[3]=C):C=n[3];const _=C;let R;n[4]!==c||n[5]!==u?(R=K=>{c?.(K),u({time:K,timestamp:Date.now()})},n[4]=c,n[5]=u,n[6]=R):R=n[6];const L=R;let P;n[7]!==L||n[8]!==t||n[9]!==i||n[10]!==e?(P=Y.jsx(Cv,{isPlaying:i,min:0,max:t,value:e,onChange:L}),n[7]=L,n[8]=t,n[9]=i,n[10]=e,n[11]=P):P=n[11];let w;n[12]===Symbol.for("react.memo_cache_sentinel")?(w=Y.jsx(Q6,{}),n[12]=w):w=n[12];let F;n[13]!==_?(F=Y.jsx("div",{style:_,children:w}),n[13]=_,n[14]=F):F=n[14];let E;n[15]!==a||n[16]!==o?(E=a&&Y.jsx(aN,{className:Je.qualityTag,isDolbyAtmos:a.isDolbyAtmos,tagText:a.tagText,tagIcon:a.tagIcon,onClick:o}),n[15]=a,n[16]=o,n[17]=E):E=n[17];let N;n[18]!==E?(N=Y.jsx("div",{children:Y.jsx(jA,{mode:"popLayout",children:E})}),n[18]=E,n[19]=N):N=n[19];let D;n[20]!==_?(D={..._,cursor:"pointer",userSelect:"none"},n[20]=_,n[21]=D):D=n[21];let k;n[22]!==d||n[23]!==f?(k=()=>d(!f),n[22]=d,n[23]=f,n[24]=k):k=n[24];let U;n[25]!==f?(U=f?Y.jsx(Q6,{isRemaining:!0}):Y.jsx(CD,{}),n[25]=f,n[26]=U):U=n[26];let G;n[27]!==D||n[28]!==k||n[29]!==U?(G=Y.jsx("div",{style:D,onClick:k,children:U}),n[27]=D,n[28]=k,n[29]=U,n[30]=G):G=n[30];let J;n[31]!==G||n[32]!==F||n[33]!==N?(J=Y.jsxs("div",{className:Je.progressBarLabels,children:[F,N,G]}),n[31]=G,n[32]=F,n[33]=N,n[34]=J):J=n[34];let tt;return n[35]!==J||n[36]!==P?(tt=Y.jsxs("div",{children:[P,J]}),n[35]=J,n[36]=P,n[37]=tt):tt=n[37],tt});function TD(n){switch(n){case"tiny":return"max(max(2.5vh, 1.25vw), 10px)";case"extra-small":return"max(max(3vh, 1.5vw), 10px)";case"small":return"max(max(4vh, 2vw), 12px)";case"large":return"max(max(6vh, 3vw), 16px)";case"extra-large":return"max(max(7vh, 3.5vw), 18px)";case"huge":return"max(max(8vh, 4vw), 20px)";default:return"max(max(5vh, 2.5vw), 14px)"}}const SD=n=>{const t=Ae.c(36),{alignPosition:e,alignAnchor:i,bottomLine:a,optimizeOptions:o}=n,c=X.useRef(null),u=Ct(Ga),f=Ct(Am),d=Ct(ph),m=Ct(Rl),y=Ct(fh),v=Ct(dh),x=Ct(mh),b=Ct(Uv),T=Ct(Iv).lyricPlayer,C=Ct(hm),_=Ct(fm),R=Ct(dm),L=Ct(Pv),P=Ct(mm),w=Ct(pm),F=Ct(Fv),E=Ct(Lv).onEmit,N=Ct(Ov).onEmit,D=Ct(Em);let k;if(t[0]!==w||t[1]!==F||t[2]!==P||t[3]!==f){if(k=d2(f),!P)for(const W of k)W.translatedLyric="";if(!w)for(const W of k)W.romanLyric="";if(F)for(const W of k){const[st,ct]=[W.romanLyric,W.translatedLyric];W.translatedLyric=st,W.romanLyric=ct}t[0]=w,t[1]=F,t[2]=P,t[3]=f,t[4]=k}else k=t[4];const U=k;let G,J;t[5]!==D?(G=()=>{D&&c.current?.lyricPlayer?.setCurrentTime(D.time,!0)},J=[D],t[5]=D,t[6]=G,t[7]=J):(G=t[6],J=t[7]),X.useEffect(G,J);const tt=y||void 0,K=v||void 0,A=x||void 0;let I;t[8]!==b?(I=TD(b),t[8]=b,t[9]=I):I=t[9];let O;t[10]!==tt||t[11]!==K||t[12]!==A||t[13]!==I?(O={width:"100%",height:"100%",fontFamily:tt,fontWeight:K,letterSpacing:A,"--amll-lp-font-size":I},t[10]=tt,t[11]=K,t[12]=A,t[13]=I,t[14]=O):O=t[14];const j=O,V=!d;let M;t[15]!==E?(M=W=>{const st=W.line.getLine().startTime;c.current?.lyricPlayer?.setCurrentTime(st,!0),E?.(W,c.current)},t[15]=E,t[16]=M):M=t[16];let z;t[17]!==N?(z=W=>N?.(W,c.current),t[17]=N,t[18]=z):z=t[18];let H;return t[19]!==i||t[20]!==e||t[21]!==a||t[22]!==C||t[23]!==_||t[24]!==R||t[25]!==T||t[26]!==L||t[27]!==u||t[28]!==m||t[29]!==o||t[30]!==U||t[31]!==M||t[32]!==z||t[33]!==j||t[34]!==V?(H=Y.jsx(ZO,{style:j,ref:c,playing:u,disabled:V,alignPosition:e,alignAnchor:i,currentTime:m,lyricLines:U,optimizeOptions:o,enableBlur:C,enableScale:_,enableSpring:R,wordFadeWidth:L,lyricPlayer:T,onLyricLineClick:M,onLyricLineContextMenu:z,bottomLine:a}),t[19]=i,t[20]=e,t[21]=a,t[22]=C,t[23]=_,t[24]=R,t[25]=T,t[26]=L,t[27]=u,t[28]=m,t[29]=o,t[30]=U,t[31]=M,t[32]=z,t[33]=j,t[34]=V,t[35]=H):H=t[35],H},t8=n=>{const t=Ae.c(5),{style:e,className:i}=n,a=Ct(Jv),o=Ct(Nv).onEmit;if(Ct(bm)){let c;return t[0]!==i||t[1]!==a||t[2]!==o||t[3]!==e?(c=Y.jsx($N,{value:a,min:0,max:1,style:e,className:i,onChange:o}),t[0]=i,t[1]=a,t[2]=o,t[3]=e,t[4]=c):c=t[4],c}return null},e8=n=>{const t=Ae.c(17);let e,i,a;t[0]!==n?({className:e,showOtherButtons:a,...i}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a):(e=t[1],i=t[2],a=t[3]);const o=Ct(kv),c=Ct(eb);let u;t[4]!==e?(u=nn(Je.controls,e),t[4]=e,t[5]=u):u=t[5];let f;t[6]!==o||t[7]!==a?(f=o==="controls"&&Y.jsx(xD,{showOtherButtons:a}),t[6]=o,t[7]=a,t[8]=f):f=t[8];let d;t[9]!==c||t[10]!==o?(d=o==="fft"&&Y.jsx(tN,{style:{width:"100%",height:"8vh"},fftData:c}),t[9]=c,t[10]=o,t[11]=d):d=t[11];let m;return t[12]!==i||t[13]!==u||t[14]!==f||t[15]!==d?(m=Y.jsxs("div",{className:u,...i,children:[f,d]}),t[12]=i,t[13]=u,t[14]=f,t[15]=d,t[16]=m):m=t[16],m},_D=n=>{const t=Ae.c(67);let e,i,a,o;t[0]!==n?({className:i,bottomLineSlot:e,optimizeOptions:a,...o}=n,t[0]=n,t[1]=e,t[2]=i,t[3]=a,t[4]=o):(e=t[1],i=t[2],a=t[3],o=t[4]);const[c,u]=c8(qv),f=Ct(Kv),d=Ct(Qv),m=Ct(Ga),y=Ct(nb),v=Ct(ph),x=Ct(Cm),b=Ct(zv),T=Ct(jv),C=Ct(Hv),_=Ct(Sv).onEmit,[R,L]=X.useState(!1),[P,w]=X.useState(.25),[F,E]=X.useState("top"),N=X.useRef(null),[D,k]=X.useState(null),U=Ct(Vv),G=Ct(xm),J=Ct(Gv);let tt,K;t[5]!==R||t[6]!==D?(tt=()=>{if(!R&&N.current&&D){const Jt=new ResizeObserver(()=>{if(!(N.current&&D))return;const Re=N.current.getBoundingClientRect(),bn=D.getBoundingClientRect();w((Re.top+Re.height/2-bn.top)/bn.height)});return Jt.observe(N.current),Jt.observe(D),E("center"),()=>Jt.disconnect()}R&&(w(.1),E("top"))},K=[R,D],t[5]=R,t[6]=D,t[7]=tt,t[8]=K):(tt=t[7],K=t[8]),X.useLayoutEffect(tt,K);const A=c&&(b==="auto"?d&&R:b==="force-immersive");let I;t[9]!==i?(I=nn(Je.autoLyricLayout,i),t[9]=i,t[10]=I):I=t[10];const O=!m&&!d&&A;let j;t[11]!==f||t[12]!==d||t[13]!==O?(j=Y.jsx(cN,{coverUrl:f,coverIsVideo:d,ref:N,musicPaused:O}),t[11]=f,t[12]=d,t[13]=O,t[14]=j):j=t[14];let V;t[15]!==_?(V=Y.jsx(lN,{onClick:_}),t[15]=_,t[16]=V):V=t[16];const M=c&&Je.hideLyric;let z;t[17]!==M?(z=nn(Je.smallMusicInfo,M),t[17]=M,t[18]=z):z=t[18];let H;t[19]!==z?(H=Y.jsx(g0,{className:z}),t[19]=z,t[20]=H):H=t[20];let W;t[21]!==U.renderer||t[22]!==J||t[23]!==v||t[24]!==y||t[25]!==x||t[26]!==C||t[27]!==T||t[28]!==f||t[29]!==d?(W=typeof U.renderer=="string"&&U.renderer==="css-bg"?Y.jsx("div",{style:{zIndex:-1,width:"100%",height:"100%",minWidth:"0",minHeight:"0",overflow:"hidden",background:J}}):Y.jsx(WO,{album:f,albumIsVideo:d,lowFreqVolume:y,renderScale:C,fps:x,renderer:typeof U.renderer=="string"?U.renderer==="pixi"?pv:lm:U.renderer,staticMode:T||!v,style:{zIndex:-1}}),t[21]=U.renderer,t[22]=J,t[23]=v,t[24]=y,t[25]=x,t[26]=C,t[27]=T,t[28]=f,t[29]=d,t[30]=W):W=t[30];const st=c&&Je.hideLyric;let ct;t[31]!==st?(ct=nn(Je.bigMusicInfo,st),t[31]=st,t[32]=ct):ct=t[32];let ft;t[33]!==ct?(ft=Y.jsx(g0,{className:ct}),t[33]=ct,t[34]=ft):ft=t[34];let pt,mt;t[35]===Symbol.for("react.memo_cache_sentinel")?(pt=Y.jsx(J6,{}),mt=Y.jsx(e8,{className:Je.bigControls}),t[35]=pt,t[36]=mt):(pt=t[35],mt=t[36]);let dt;t[37]!==c||t[38]!==u||t[39]!==G?(dt=G&&Y.jsxs("div",{style:{display:"flex",justifyContent:"space-evenly"},children:[Y.jsx(ga,{type:"lyrics",checked:!c,onClick:()=>u(!c)}),Y.jsx(ga,{type:"airplay"}),Y.jsx(ga,{type:"playlist"})]}),t[37]=c,t[38]=u,t[39]=G,t[40]=dt):dt=t[40];let St;t[41]===Symbol.for("react.memo_cache_sentinel")?(St=Y.jsx(t8,{className:Je.bigVolumeControl}),t[41]=St):St=t[41];let bt;t[42]!==ft||t[43]!==dt?(bt=Y.jsxs(Y.Fragment,{children:[ft,pt,mt,dt,St]}),t[42]=ft,t[43]=dt,t[44]=bt):bt=t[44];let Lt;t[45]===Symbol.for("react.memo_cache_sentinel")?(Lt=Y.jsxs(Y.Fragment,{children:[Y.jsx(g0,{className:Je.horizontalControls}),Y.jsx(J6,{}),Y.jsx(e8,{className:Je.controls,showOtherButtons:!0}),Y.jsx(t8,{})]}),t[45]=Lt):Lt=t[45];let wt;t[46]!==c||t[47]!==u||t[48]!==G?(wt=G&&Y.jsxs(Y.Fragment,{children:[Y.jsx(ga,{type:"playlist"}),Y.jsx(ga,{type:"lyrics",checked:!c,onClick:()=>u(!c)}),Y.jsx("div",{style:{flex:"1"}}),Y.jsx(ga,{type:"airplay"})]}),t[46]=c,t[47]=u,t[48]=G,t[49]=wt):wt=t[49];let gt;t[50]!==F||t[51]!==P||t[52]!==e||t[53]!==a?(gt=Y.jsx(SD,{alignPosition:P,alignAnchor:F,bottomLine:e,optimizeOptions:a}),t[50]=F,t[51]=P,t[52]=e,t[53]=a,t[54]=gt):gt=t[54];let xt;return t[55]!==c||t[56]!==o||t[57]!==W||t[58]!==bt||t[59]!==wt||t[60]!==gt||t[61]!==I||t[62]!==j||t[63]!==V||t[64]!==H||t[65]!==A?(xt=Y.jsx(WA,{children:Y.jsx(bN,{onElementMounted:k,className:I,onLayoutChange:L,verticalImmerseCover:A,coverSlot:j,thumbSlot:V,smallControlsSlot:H,backgroundSlot:W,bigControlsSlot:bt,controlsSlot:Lt,horizontalBottomControls:wt,lyricSlot:gt,hideLyric:c,...o})}),t[55]=c,t[56]=o,t[57]=W,t[58]=bt,t[59]=wt,t[60]=gt,t[61]=I,t[62]=j,t[63]=V,t[64]=H,t[65]=A,t[66]=xt):xt=t[66],xt};function AD(n){return n.name}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const Ue=v2();Ue.set(ph,!0);Ue.set(xm,!1);Ue.set(bm,!1);Ue.set(ym,!1);Ue.set(gm,!1);Ue.set(vm,!1);Ue.set(Tm,!1);Ue.set(hm,!0);Ue.set(fm,!0);Ue.set(dm,!0);Ue.set(mm,!0);Ue.set(pm,!0);Ue.set(Cm,0);function ED(){return Y.jsx("div",{className:"stage",children:Y.jsx(_D,{id:"amll-lyric-player",style:{width:"100%",height:"100%"}})})}window.amllNative={setLines(n){try{const t=JSON.parse(n);Ue.set(Am,t)}catch(t){console.warn("[amll] setLines failed",t)}},setTime(n){Ue.set(Rl,n)},setPlaying(n){Ue.set(Ga,n)},setMeta(n,t,e){Ue.set(Sm,n),Ue.set(_m,[{id:"1",name:t}]),Ue.set(Ml,e)},setTheme(n){document.documentElement.classList.toggle("dark",n),document.body.style.background=n?"#0B0B0F":"#FBFBFD"}};CC.createRoot(document.getElementById("root")).render(Y.jsx(KC,{store:Ue,children:Y.jsx(ED,{})})); diff --git a/android/app/src/main/assets/lyrics/index.html b/android/app/src/main/assets/lyrics/index.html new file mode 100644 index 0000000..c9ba8d3 --- /dev/null +++ b/android/app/src/main/assets/lyrics/index.html @@ -0,0 +1,13 @@ + + + + + + AMLL Lyrics + + + + +
+ + diff --git a/android/app/src/main/java/dev/amll/hub/android/data/lyric/TtmlParser.kt b/android/app/src/main/java/dev/amll/hub/android/data/lyric/TtmlParser.kt new file mode 100644 index 0000000..5606af2 --- /dev/null +++ b/android/app/src/main/java/dev/amll/hub/android/data/lyric/TtmlParser.kt @@ -0,0 +1,189 @@ +package dev.amll.hub.android.data.lyric + +import android.util.Xml +import org.xmlpull.v1.XmlPullParser +import java.io.StringReader + +/** + * 极简 TTML 解析器,只关心 Apple Music 风格歌词里 App 会用到的部分: + * -

一行 + * - 行内 逐字 + * - ttm:role="x-translation" 翻译 + * - ttm:role="x-roman" 音译 + * - ttm:role="x-bg" 背景和声(可含逐字) + * + * 解析失败时退化为「按行纯文本」,保证歌词页永远有东西可显示。 + */ +data class Word( + val text: String, + val startMs: Long, + val endMs: Long, + val roman: String = "", +) + +data class LyricLine( + val text: String, + val startMs: Long, + val endMs: Long, + val translation: String = "", + val romanization: String = "", + val isBackground: Boolean = false, + val words: List = emptyList(), +) + +object TtmlParser { + + fun parse(xml: String): List { + return runCatching { parseInternal(xml) } + .getOrElse { fallback(xml) } + } + + private fun parseInternal(xml: String): List { + val parser = Xml.newPullParser() + parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false) + parser.setInput(StringReader(xml)) + + val lines = mutableListOf() + var event = parser.eventType + while (event != XmlPullParser.END_DOCUMENT) { + if (event == XmlPullParser.START_TAG && parser.name == "p") { + val start = parseTime(attr(parser, "begin")) + val end = parseTime(attr(parser, "end")) + val isBg = attr(parser, "role") == "x-bg" + val line = readParagraph(parser, start, end, isBg) + if (line.text.isNotBlank()) lines += line + } + event = parser.next() + } + return lines.sortedBy { it.startMs } + } + + /** 读到

为止,收集 span 里的逐字、翻译、音译与背景行 */ + private fun readParagraph( + parser: XmlPullParser, + startMs: Long, + endMs: Long, + isBackground: Boolean, + ): LyricLine { + val words = mutableListOf() + val plain = StringBuilder() + var translation = "" + var roman = "" + + var event = parser.next() + while (event != XmlPullParser.END_TAG || parser.name != "p") { + if (event == XmlPullParser.END_DOCUMENT) break + if (event == XmlPullParser.START_TAG && parser.name == "span") { + val role = attr(parser, "role") + val spanStart = parseTime(attr(parser, "begin")) + val spanEnd = parseTime(attr(parser, "end")) + when (role) { + "x-translation" -> translation = readText(parser, "span") + "x-roman" -> roman = readText(parser, "span") + "x-bg" -> readBackground(parser, spanStart, spanEnd) + else -> { + // 逐字 span,内部可能还有嵌套 span(背景行里会出现) + val wordText = readText(parser, "span") + if (wordText.isNotBlank()) { + words += Word( + text = wordText, + startMs = if (spanStart > 0) spanStart else startMs, + endMs = if (spanEnd > 0) spanEnd else endMs, + ) + } + } + } + } + event = parser.next() + } + + val text = if (words.isNotEmpty()) words.joinToString("") { it.text } else plain.toString() + return LyricLine( + text = text, + startMs = startMs, + endMs = if (endMs > startMs) endMs else startMs + 4000, + translation = translation, + romanization = roman, + isBackground = isBackground, + words = words, + ) + } + + private fun readBackground(parser: XmlPullParser, startMs: Long, endMs: Long): LyricLine { + val words = mutableListOf() + var event = parser.next() + while (event != XmlPullParser.END_TAG || parser.name != "span") { + if (event == XmlPullParser.END_DOCUMENT) break + if (event == XmlPullParser.START_TAG && parser.name == "span") { + val text = readText(parser, "span") + if (text.isNotBlank()) { + words += Word(text, startMs, endMs) + } + } + event = parser.next() + } + return LyricLine( + text = words.joinToString("") { it.text }, + startMs = startMs, + endMs = endMs, + isBackground = true, + words = words, + ) + } + + /** 读取当前标签内的纯文本,直到同名结束标签 */ + private fun readText(parser: XmlPullParser, tag: String): String { + val sb = StringBuilder() + var event = parser.next() + while (event != XmlPullParser.END_TAG || parser.name != tag) { + if (event == XmlPullParser.END_DOCUMENT) break + if (event == XmlPullParser.TEXT) sb.append(parser.text) + event = parser.next() + } + return sb.toString().trim() + } + + private fun attr(parser: XmlPullParser, local: String): String { + for (i in 0 until parser.attributeCount) { + val name = parser.getAttributeName(i) + if (name == local || name.endsWith(":$local")) return parser.getAttributeValue(i) + } + return "" + } + + /** 支持 hh:mm:ss.mmm / mm:ss.mmm / 12.5s / 12500 */ + fun parseTime(raw: String): Long { + if (raw.isBlank()) return 0 + val value = raw.trim().removeSuffix("s") + if (!value.contains(":")) { + val seconds = value.toDoubleOrNull() ?: return 0 + return if (seconds > 1000) seconds.toLong() else (seconds * 1000).toLong() + } + val parts = value.split(":") + var hours = 0L + var minutes = 0L + var seconds = 0.0 + when (parts.size) { + 3 -> { + hours = parts[0].toLongOrNull() ?: 0 + minutes = parts[1].toLongOrNull() ?: 0 + seconds = parts[2].toDoubleOrNull() ?: 0.0 + } + 2 -> { + minutes = parts[0].toLongOrNull() ?: 0 + seconds = parts[1].toDoubleOrNull() ?: 0.0 + } + } + return hours * 3600_000 + minutes * 60_000 + (seconds * 1000).toLong() + } + + /** 拿不到结构化 TTML 时,按纯文本切行,至少能滚动 */ + private fun fallback(xml: String): List { + return xml.split("\n") + .map { it.trim() } + .filter { it.isNotEmpty() && !it.startsWith("<") } + .mapIndexed { index, text -> + LyricLine(text = text, startMs = index * 4000L, endMs = index * 4000L + 3800L) + } + } +} diff --git a/android/app/src/main/java/dev/amll/hub/android/data/remote/ContentApi.kt b/android/app/src/main/java/dev/amll/hub/android/data/remote/ContentApi.kt new file mode 100644 index 0000000..f71d846 --- /dev/null +++ b/android/app/src/main/java/dev/amll/hub/android/data/remote/ContentApi.kt @@ -0,0 +1,82 @@ +package dev.amll.hub.android.data.remote + +import retrofit2.http.Body +import retrofit2.http.GET +import retrofit2.http.POST +import retrofit2.http.PUT +import retrofit2.http.Path +import retrofit2.http.Query + +/** + * 内容相关接口,路径与 frontend/src/lib/api.ts 保持一致。 + */ +interface ContentApi { + + @GET("api/v1/stats") + suspend fun stats(): ApiResponse + + @GET("api/v1/latest-songs") + suspend fun latestSongs(): ApiResponse> + + @GET("api/v1/daily-recommendations") + suspend fun dailyRecommendations(): ApiResponse> + + @GET("api/v1/daily-recommendations/today") + suspend fun todayRecommendation(): ApiResponse + + @GET("api/v1/daily-recommendations/like/{id}") + suspend fun dailyLikeStatus(@Path("id") id: Long): ApiResponse + + @POST("api/v1/daily-recommendations/like/{id}") + suspend fun toggleDailyLike(@Path("id") id: Long): ApiResponse + + @GET("api/v1/not-found-ranking") + suspend fun notFoundRanking( + @Query("limit") limit: String = "all", + @Query("days") days: Int = 7, + @Query("platform") platform: String? = null, + ): ApiResponse + + @GET("api/v1/notifications") + suspend fun notifications( + @Query("page") page: Int = 1, + @Query("limit") limit: Int = 20, + @Query("type") type: String? = null, + ): ApiResponse + + @POST("api/v1/notifications/read-all") + suspend fun markAllNotificationsRead(): ApiResponse + + @POST("api/v1/notifications/{id}/read") + suspend fun markNotificationRead(@Path("id") id: Long): ApiResponse + + @GET("api/v1/submissions") + suspend fun submissions( + @Query("page") page: Int = 1, + @Query("limit") limit: Int = 20, + @Query("status") status: String? = null, + @Query("type") type: String? = null, + ): ApiResponse + + @GET("api/v1/submissions/{id}") + suspend fun submission(@Path("id") id: Long): ApiResponse + + @GET("api/v1/search") + suspend fun search( + @Query("q") keyword: String, + @Query("field") field: String = "all", + @Query("limit") limit: Int = 20, + ): ApiResponse + + @GET("api/v1/ncm/search") + suspend fun ncmSearch( + @Query("q") keyword: String, + @Query("limit") limit: Int = 20, + ): ApiResponse + + @GET("api/v1/auth/profile") + suspend fun profile(): ApiResponse + + @PUT("api/v1/auth/profile") + suspend fun updateProfile(@Body body: ProfileUpdateRequest): ApiResponse +} diff --git a/android/app/src/main/java/dev/amll/hub/android/data/remote/ContentDto.kt b/android/app/src/main/java/dev/amll/hub/android/data/remote/ContentDto.kt new file mode 100644 index 0000000..2429001 --- /dev/null +++ b/android/app/src/main/java/dev/amll/hub/android/data/remote/ContentDto.kt @@ -0,0 +1,177 @@ +package dev.amll.hub.android.data.remote + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** 词库统计 GET /api/v1/stats */ +@Serializable +data class StatsDto( + val totalSongs: Long = 0, + val totalArtists: Long = 0, + val totalAlbums: Long = 0, + val totalWords: Long = 0, + val totalLines: Long = 0, + val lastSyncAt: String = "", +) + +/** 最新收录 GET /api/v1/latest-songs */ +@Serializable +data class LatestSongDto( + val id: Long = 0, + val songId: Long = 0, + val ncmId: String = "", + val title: String = "", + val artist: String = "", + val coverUrl: String = "", +) + +/** 每日推荐 GET /api/v1/daily-recommendations */ +@Serializable +data class DailyRecDto( + val id: Long = 0, + val date: String = "", + val songName: String = "", + val artist: String = "", + val coverKey: String = "", + val ncmId: String = "", + val comment: String = "", + val submitter: String = "", + val likeCount: Int = 0, + val status: String = "", +) + +/** 无歌词排行 GET /api/v1/not-found-ranking */ +@Serializable +data class RankingItemDto( + val id: Long = 0, + val platform: String = "", + val platformId: String = "", + val songName: String = "", + val artists: List = emptyList(), + val cover: String = "", + val album: String = "", + val requestCount: Int = 0, + val lastSeenAt: String = "", +) + +@Serializable +data class RankingResultDto( + val total: Int = 0, + val days: Int = 7, + val items: List = emptyList(), +) + +/** 站内消息 GET /api/v1/notifications */ +@Serializable +data class MessageDto( + val id: Long = 0, + val type: String = "", + val title: String = "", + val content: String = "", + val read: Boolean = false, + val createdAt: String = "", +) + +@Serializable +data class NotificationListDto( + val items: List = emptyList(), + val total: Int = 0, + val unread: Int = 0, +) + +@Serializable +data class UnreadDto(val unread: Int = 0) + +/** 投稿列表 GET /api/v1/submissions */ +@Serializable +data class SubmissionDto( + val id: Long = 0, + val songName: String = "", + @SerialName("song_name") val songNameSnake: String = "", + val artist: String = "", + val status: String = "", + val type: String = "", + val createdAt: String = "", + val updatedAt: String = "", +) { + val displayName: String get() = songName.ifBlank { songNameSnake } +} + +@Serializable +data class SubmissionListDto( + val items: List = emptyList(), + val total: Int = 0, +) + +/** 词库搜索 GET /api/v1/search */ +@Serializable +data class SearchHitDto( + val id: String = "", + val musicNames: List = emptyList(), + val artists: List = emptyList(), + val albums: List = emptyList(), + val platformIds: Map> = emptyMap(), + val rawLyricFile: String = "", + val wordCount: Int = 0, + val lineCount: Int = 0, + val lyricSnippet: String = "", +) + +@Serializable +data class SearchResultDto( + val hits: List = emptyList(), + val totalHits: Int = 0, +) + +/** 网易云搜索 GET /api/v1/ncm/search(字段名做兼容) */ +@Serializable +data class NcmSongDto( + val id: String = "", + val songId: String = "", + val name: String = "", + val songName: String = "", + val artist: String = "", + val artists: String = "", + val arName: String = "", + val pic: String = "", + val cover: String = "", + val duration: Long = 0, +) { + val displayName: String get() = name.ifBlank { songName } + val displayArtist: String get() = artist.ifBlank { artists }.ifBlank { arName } + val displayCover: String get() = pic.ifBlank { cover } + val displayId: String get() = id.ifBlank { songId } +} + +@Serializable +data class NcmSearchDto( + val songs: List = emptyList(), + val items: List = emptyList(), + val result: List = emptyList(), +) { + val all: List get() = songs.ifEmpty { items.ifEmpty { result } } +} + +@Serializable +data class LikeStatusDto(val liked: Boolean = false, val likeCount: Int = 0) + +@Serializable +data class UpdatedDto(val updated: Int = 0) + +@Serializable +data class ProfileUpdateRequest( + val displayName: String? = null, + val email: String? = null, + val avatar: String? = null, +) + +/** ncm 解析结果(裸 JSON,非统一包装),字段名做兼容 */ +@Serializable +data class NcmParseDto( + val url: String = "", + val songId: String = "", + val name: String = "", + val artist: String = "", + val pic: String = "", + val level: String = "", +) diff --git a/android/app/src/main/java/dev/amll/hub/android/data/remote/NetworkModule.kt b/android/app/src/main/java/dev/amll/hub/android/data/remote/NetworkModule.kt index 25f0e2c..3cccf78 100644 --- a/android/app/src/main/java/dev/amll/hub/android/data/remote/NetworkModule.kt +++ b/android/app/src/main/java/dev/amll/hub/android/data/remote/NetworkModule.kt @@ -42,11 +42,22 @@ class NetworkModule @Inject constructor( } val authApi: AuthApi by lazy { + retrofit.create(AuthApi::class.java) + } + + val contentApi: ContentApi by lazy { + retrofit.create(ContentApi::class.java) + } + + val rawApi: RawApi by lazy { + retrofit.create(RawApi::class.java) + } + + private val retrofit: Retrofit by lazy { Retrofit.Builder() .baseUrl(BuildConfig.API_BASE_URL.trimEnd('/') + "/") .client(client) .addConverterFactory(json.asConverterFactory("application/json".toMediaType())) .build() - .create(AuthApi::class.java) } } diff --git a/android/app/src/main/java/dev/amll/hub/android/data/remote/RawApi.kt b/android/app/src/main/java/dev/amll/hub/android/data/remote/RawApi.kt new file mode 100644 index 0000000..c546dfe --- /dev/null +++ b/android/app/src/main/java/dev/amll/hub/android/data/remote/RawApi.kt @@ -0,0 +1,23 @@ +package dev.amll.hub.android.data.remote + +import okhttp3.ResponseBody +import retrofit2.http.GET +import retrofit2.http.Path +import retrofit2.http.Query + +/** + * 少数接口不套 {code,message,data} 包装: + * - ncm 解析直接返回 JSON + * - TTML 歌词直接返回字节流 + */ +interface RawApi { + + @GET("api/v1/ncm/parse-music") + suspend fun parseMusicRaw( + @Query("songId") songId: String, + @Query("level") level: String = "exhigh", + ): ResponseBody + + @GET("api/v1/lyrics/ncm-lyrics/{songId}") + suspend fun ncmLyric(@Path("songId") songId: String): ResponseBody +} diff --git a/android/app/src/main/java/dev/amll/hub/android/data/repo/ContentRepository.kt b/android/app/src/main/java/dev/amll/hub/android/data/repo/ContentRepository.kt new file mode 100644 index 0000000..0e5045e --- /dev/null +++ b/android/app/src/main/java/dev/amll/hub/android/data/repo/ContentRepository.kt @@ -0,0 +1,100 @@ +package dev.amll.hub.android.data.repo + +import dev.amll.hub.android.data.remote.ContentApi +import dev.amll.hub.android.data.remote.DailyRecDto +import dev.amll.hub.android.data.remote.LatestSongDto +import dev.amll.hub.android.data.remote.LikeStatusDto +import dev.amll.hub.android.data.remote.MessageDto +import dev.amll.hub.android.data.remote.NcmSongDto +import dev.amll.hub.android.data.remote.ProfileUpdateRequest +import dev.amll.hub.android.data.remote.RankingItemDto +import dev.amll.hub.android.data.remote.RawApi +import dev.amll.hub.android.data.remote.SearchHitDto +import dev.amll.hub.android.data.remote.StatsDto +import dev.amll.hub.android.data.remote.SubmissionDto +import dev.amll.hub.android.data.remote.UserProfile +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import javax.inject.Inject +import javax.inject.Singleton + +/** + * 内容仓库:接口失败一律降级为空,UI 走空态/错误态,不把异常抛到 Composable。 + */ +@Singleton +class ContentRepository @Inject constructor( + private val api: ContentApi, + private val raw: RawApi, +) { + suspend fun stats(): StatsDto? = io { runCatching { api.stats().data }.getOrNull() } + + suspend fun latest(): List = io { + runCatching { api.latestSongs().data.orEmpty() }.getOrDefault(emptyList()) + } + + suspend fun daily(): List = io { + runCatching { api.dailyRecommendations().data.orEmpty() }.getOrDefault(emptyList()) + } + + suspend fun today(): DailyRecDto? = io { runCatching { api.todayRecommendation().data }.getOrNull() } + + suspend fun ranking(days: Int): List = io { + runCatching { api.notFoundRanking(days = days).data?.items.orEmpty() } + .getOrDefault(emptyList()) + } + + suspend fun notifications(type: String? = null): List = io { + runCatching { api.notifications(type = type).data?.items.orEmpty() }.getOrDefault(emptyList()) + } + + suspend fun submissions(status: String? = null): List = io { + runCatching { api.submissions(status = status).data?.items.orEmpty() } + .getOrDefault(emptyList()) + } + + /** TTML 原文,用于歌词页与沉浸页 */ + suspend fun lyricTtml(songId: String): String? = io { + runCatching { raw.ncmLyric(songId).string() }.getOrNull() + } + + /** ncm 解析出的音频直链;接口返回的不是统一包装,用正则兜底 */ + suspend fun audioUrl(songId: String): String? = io { + runCatching { + val body = raw.parseMusicRaw(songId).string() + Regex("\"url\"\\s*:\\s*\"([^\"]+)\"").find(body)?.groupValues?.getOrNull(1) + }.getOrNull() + } + + suspend fun profile(): UserProfile? = io { runCatching { api.profile().data }.getOrNull() } + + suspend fun updateDisplayName(name: String): UserProfile? = io { + runCatching { api.updateProfile(ProfileUpdateRequest(displayName = name)).data }.getOrNull() + } + + suspend fun search(keyword: String): List = io { + runCatching { api.search(keyword).data?.hits.orEmpty() }.getOrDefault(emptyList()) + } + + suspend fun ncmSearch(keyword: String): List = io { + runCatching { api.ncmSearch(keyword).data?.all.orEmpty() }.getOrDefault(emptyList()) + } + + suspend fun submission(id: Long): SubmissionDto? = + io { runCatching { api.submission(id).data }.getOrNull() } + + suspend fun markAllRead() { + io { runCatching { api.markAllNotificationsRead() } } + } + + suspend fun markRead(id: Long) { + io { runCatching { api.markNotificationRead(id) } } + } + + suspend fun toggleLike(id: Long): LikeStatusDto? = + io { runCatching { api.toggleDailyLike(id).data }.getOrNull() } + + suspend fun likeStatus(id: Long): LikeStatusDto? = + io { runCatching { api.dailyLikeStatus(id).data }.getOrNull() } + + private suspend fun io(block: suspend () -> T): T = withContext(Dispatchers.IO) { block() } +} diff --git a/android/app/src/main/java/dev/amll/hub/android/nav/AmllNavGraph.kt b/android/app/src/main/java/dev/amll/hub/android/nav/AmllNavGraph.kt index ab451bf..643f3b0 100644 --- a/android/app/src/main/java/dev/amll/hub/android/nav/AmllNavGraph.kt +++ b/android/app/src/main/java/dev/amll/hub/android/nav/AmllNavGraph.kt @@ -1,15 +1,26 @@ package dev.amll.hub.android.nav +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.CircularProgressIndicator -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Surface +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavType @@ -17,48 +28,68 @@ import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import androidx.navigation.navArgument -import dev.amll.hub.android.data.remote.UserProfile +import dev.amll.hub.android.ui.AppNav +import dev.amll.hub.android.ui.AppViewModel +import dev.amll.hub.android.ui.screen.CreatorCenterScreen +import dev.amll.hub.android.ui.screen.DailyScreen +import dev.amll.hub.android.ui.screen.DiscoverScreen import dev.amll.hub.android.ui.screen.HomeScreen +import dev.amll.hub.android.ui.screen.ImmersiveScreen import dev.amll.hub.android.ui.screen.LoginScreen +import dev.amll.hub.android.ui.screen.LyricDetailScreen +import dev.amll.hub.android.ui.screen.MessagesScreen +import dev.amll.hub.android.ui.screen.ProfileEditScreen +import dev.amll.hub.android.ui.screen.ProfileScreen +import dev.amll.hub.android.ui.screen.RankingScreen +import dev.amll.hub.android.ui.screen.ReviewQueueScreen import dev.amll.hub.android.ui.screen.ScanScreen +import dev.amll.hub.android.ui.screen.SubmissionDetailScreen +import dev.amll.hub.android.ui.screen.SubmitScreen import dev.amll.hub.android.ui.session.SessionState import dev.amll.hub.android.ui.session.SessionViewModel +import dev.amll.hub.android.ui.theme.Amll +import dev.amll.hub.android.ui.theme.Font object Routes { const val HOME = "home" + const val DISCOVER = "discover" + const val CREATOR = "creator" + const val MESSAGES = "messages" + const val PROFILE = "profile" + + const val RANKING = "ranking" + const val DAILY = "daily" + const val LYRIC = "lyric" + const val IMMERSIVE = "immersive" + const val SUBMIT = "submit" + const val SUBMISSION = "submission" + const val PROFILE_EDIT = "profile-edit" + const val REVIEW = "review" - /** 扫码页,ticket 可为空(手动进入扫码器)或由 deep link 带入 */ const val SCAN = "scan?ticket={ticket}" fun scan(ticket: String? = null): String = if (ticket.isNullOrBlank()) "scan" else "scan?ticket=$ticket" + + val tabs = listOf(HOME, DISCOVER, CREATOR, MESSAGES, PROFILE) } /** - * 顶层导航,完全由 [SessionViewModel] 的持久化登录态驱动: - * - Loading:读本地 token 期间的启动占位,避免登录页一闪而过 - * - LoggedIn:首页 + 扫码授权页 - * - LoggedOut:仅登录页,未登录不提供「扫码登录网页端」入口 - * - * 登录 / 登出只更新登录态,分区切换由状态完成,无需手动推栈。 + * 顶层导航:登录态决定进 App 还是登录页,登录后是 5 Tab + 二级页。 */ @Composable fun AmllNavGraph( - /** deep link 带进来的 ticket,非空时登录后直接弹扫码确认页 */ pendingTicket: String? = null, onTicketConsumed: () -> Unit = {}, sessionViewModel: SessionViewModel = hiltViewModel(), ) { val session by sessionViewModel.state.collectAsStateWithLifecycle() - when (val state = session) { - SessionState.Loading -> SplashPane() + when (session) { + SessionState.Loading -> SplashScreen() is SessionState.LoggedIn -> LoggedInNav( - profile = state.profile, pendingTicket = pendingTicket, onTicketConsumed = onTicketConsumed, - onLoggedOut = { sessionViewModel.logout() }, - onRefreshProfile = { sessionViewModel.refreshProfile() }, ) SessionState.LoggedOut -> LoginScreen( @@ -67,33 +98,58 @@ fun AmllNavGraph( } } -/** 登录后的导航分区:首页 + 扫码授权页 */ @Composable private fun LoggedInNav( - profile: UserProfile?, pendingTicket: String?, onTicketConsumed: () -> Unit, - onLoggedOut: () -> Unit, - onRefreshProfile: () -> Unit, + vm: AppViewModel = hiltViewModel(), ) { val navController = rememberNavController() - // 已登录时 deep link 直接进扫码确认页;未登录时 ticket 会被保留,登录后再处理 LaunchedEffect(pendingTicket) { val ticket = pendingTicket?.takeIf { it.isNotBlank() } ?: return@LaunchedEffect onTicketConsumed() navController.navigate(Routes.scan(ticket)) } + val nav = AppNav( + back = { navController.popBackStack() }, + openRanking = { navController.navigate(Routes.RANKING) }, + openDaily = { navController.navigate(Routes.DAILY) }, + openLyric = { songId, title, artist, cover -> + vm.openTrack(songId, title, artist, cover) + navController.navigate(Routes.LYRIC) + }, + openImmersive = { navController.navigate(Routes.IMMERSIVE) }, + openSubmit = { navController.navigate(Routes.SUBMIT) }, + openSubmission = { navController.navigate(Routes.SUBMISSION) }, + openProfileEdit = { navController.navigate(Routes.PROFILE_EDIT) }, + openReview = { navController.navigate(Routes.REVIEW) }, + switchTab = { index -> + if (index in Routes.tabs.indices) { + navController.navigate(Routes.tabs[index]) { + popUpTo(Routes.HOME) { inclusive = false } + launchSingleTop = true + } + } + }, + ) + NavHost(navController = navController, startDestination = Routes.HOME) { - composable(Routes.HOME) { - HomeScreen( - profile = profile, - onScanQr = { navController.navigate(Routes.scan()) }, - onLoggedOut = onLoggedOut, - onRefreshProfile = onRefreshProfile, - ) - } + composable(Routes.HOME) { HomeScreen(vm, nav) } + composable(Routes.DISCOVER) { DiscoverScreen(vm, nav) } + composable(Routes.CREATOR) { CreatorCenterScreen(vm, nav) } + composable(Routes.MESSAGES) { MessagesScreen(vm, nav) } + composable(Routes.PROFILE) { ProfileScreen(vm, nav) } + + composable(Routes.RANKING) { RankingScreen(vm, nav) } + composable(Routes.DAILY) { DailyScreen(vm, nav) } + composable(Routes.LYRIC) { LyricDetailScreen(vm, nav) } + composable(Routes.IMMERSIVE) { ImmersiveScreen(vm, nav) } + composable(Routes.SUBMIT) { SubmitScreen(nav) } + composable(Routes.SUBMISSION) { SubmissionDetailScreen(vm, nav) } + composable(Routes.PROFILE_EDIT) { ProfileEditScreen(vm, nav) } + composable(Routes.REVIEW) { ReviewQueueScreen(vm, nav) } composable( route = Routes.SCAN, @@ -108,25 +164,44 @@ private fun LoggedInNav( ScanScreen( initialTicket = entry.arguments?.getString("ticket"), onBack = { navController.popBackStack() }, - onDone = { - navController.navigate(Routes.HOME) { - popUpTo(Routes.HOME) { inclusive = true } - } - }, + onDone = { navController.popBackStack() }, ) } } } -/** 读取本地登录态期间的启动占位,避免登录页一闪而过 */ +/** 17 启动页:图标 + 字标 + 标语 */ @Composable -private fun SplashPane() { - Surface(color = MaterialTheme.colorScheme.background) { - Box( - contentAlignment = Alignment.Center, - modifier = Modifier.fillMaxSize(), +private fun SplashScreen() { + Box( + Modifier.fillMaxSize().background(Amll.colors.canvas), + contentAlignment = Alignment.Center, + ) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.spacedBy(14.dp), ) { - CircularProgressIndicator() + Box( + Modifier + .size(96.dp) + .clip(RoundedCornerShape(22.dp)) + .background(Amll.colors.primary), + contentAlignment = Alignment.Center, + ) { + Column(verticalArrangement = Arrangement.spacedBy(6.dp)) { + Box(Modifier.width(52.dp).height(8.dp).clip(RoundedCornerShape(4.dp)).background(Color.White)) + Box(Modifier.width(38.dp).height(8.dp).clip(RoundedCornerShape(4.dp)).background(Color.White)) + Box(Modifier.width(26.dp).height(8.dp).clip(RoundedCornerShape(4.dp)).background(Color.White)) + } + } + Text("AMLL Hub", style = Font.pageTitle.copy(fontSize = 26.sp), color = Amll.colors.ink) + Text("让每一句歌词,都跟着唱出来", style = Font.caption, color = Amll.colors.ink3) } + Text( + "逐字歌词 · 社区共建", + style = Font.micro, + color = Amll.colors.ink3.copy(alpha = 0.7f), + modifier = Modifier.align(Alignment.BottomCenter).padding(bottom = 34.dp), + ) } } diff --git a/android/app/src/main/java/dev/amll/hub/android/playback/PlaybackService.kt b/android/app/src/main/java/dev/amll/hub/android/playback/PlaybackService.kt new file mode 100644 index 0000000..fe4dae7 --- /dev/null +++ b/android/app/src/main/java/dev/amll/hub/android/playback/PlaybackService.kt @@ -0,0 +1,54 @@ +package dev.amll.hub.android.playback + +import android.app.PendingIntent +import android.content.Intent +import androidx.media3.session.MediaSession +import androidx.media3.session.MediaSessionService +import dagger.hilt.android.AndroidEntryPoint +import dev.amll.hub.android.MainActivity +import javax.inject.Inject + +/** + * 后台播放:把 [PlayerController] 的 ExoPlayer 挂到 MediaSession 上。 + * + * 作用: + * - 退到后台 / 锁屏后继续播放(前台服务 + 媒体通知) + * - 通知栏、耳机线控、蓝牙控制走 Media3 默认实现 + */ +@AndroidEntryPoint +class PlaybackService : MediaSessionService() { + + @Inject + lateinit var playerController: PlayerController + + private var mediaSession: MediaSession? = null + + override fun onCreate() { + super.onCreate() + val sessionActivity = PendingIntent.getActivity( + this, + 0, + Intent(this, MainActivity::class.java), + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT, + ) + mediaSession = MediaSession.Builder(this, playerController.player) + .setSessionActivity(sessionActivity) + .build() + } + + override fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaSession? = mediaSession + + override fun onTaskRemoved(rootIntent: Intent?) { + val player = playerController.player + if (!player.playWhenReady || player.mediaItemCount == 0) { + stopSelf() + } + } + + override fun onDestroy() { + // ExoPlayer 由 PlayerController 单例持有,这里只释放 session + mediaSession?.release() + mediaSession = null + super.onDestroy() + } +} diff --git a/android/app/src/main/java/dev/amll/hub/android/playback/PlayerController.kt b/android/app/src/main/java/dev/amll/hub/android/playback/PlayerController.kt new file mode 100644 index 0000000..1ff7373 --- /dev/null +++ b/android/app/src/main/java/dev/amll/hub/android/playback/PlayerController.kt @@ -0,0 +1,143 @@ +package dev.amll.hub.android.playback + +import android.content.Context +import androidx.media3.common.AudioAttributes +import androidx.media3.common.C +import androidx.media3.common.MediaItem +import androidx.media3.common.Player +import androidx.media3.exoplayer.ExoPlayer +import dagger.hilt.android.qualifiers.ApplicationContext +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.isActive +import kotlinx.coroutines.launch +import javax.inject.Inject +import javax.inject.Singleton + +/** + * 播放内核:Media3 ExoPlayer。 + * + * 网页端的播放器是 PlayerBoot +