From 443d027e94a7e1fed254607025aa9a0f7b2143e7 Mon Sep 17 00:00:00 2001 From: voltek Date: Sun, 20 Sep 2026 21:10:22 +0200 Subject: [PATCH 1/6] add fr --- package-lock.json | 52 +-- ui-src/locales/fr.json | 828 ++++++++++++++++++++++++++++++++++++++++ ui-src/locales/index.ts | 3 + 3 files changed, 833 insertions(+), 50 deletions(-) create mode 100644 ui-src/locales/fr.json diff --git a/package-lock.json b/package-lock.json index 5dac8e8..2826533 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vice", - "version": "2.9.0", + "version": "2.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vice", - "version": "2.9.0", + "version": "2.10.0", "dependencies": { "@astryxdesign/cli": "^0.4.1", "@astryxdesign/core": "^0.4.1", @@ -812,9 +812,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -832,9 +829,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -852,9 +846,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -872,9 +863,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -892,9 +880,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -912,9 +897,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1093,9 +1075,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -1113,9 +1092,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -1133,9 +1109,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -1153,9 +1126,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -1173,9 +1143,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -1193,9 +1160,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -2218,9 +2182,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2242,9 +2203,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2266,9 +2224,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2290,9 +2245,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ diff --git a/ui-src/locales/fr.json b/ui-src/locales/fr.json new file mode 100644 index 0000000..f206694 --- /dev/null +++ b/ui-src/locales/fr.json @@ -0,0 +1,828 @@ +{ + "app": { + "name": "Vice" + }, + "common": { + "delete": "Delete", + "keepIt": "Keep it", + "cancel": "Cancel", + "save": "Save", + "close": "Close", + "noActions": "No actions", + "untagged": "Untagged", + "create": "Create", + "gotIt": "Got it", + "new": "New", + "dismiss": "Dismiss" + }, + "clips": { + "allClips": "All Clips", + "countClips": { + "one": "{count} clip", + "other": "{count} clips" + }, + "countMatches": { + "one": "{count} match for “{query}”", + "other": "{count} matches for “{query}”" + }, + "playlistOptions": "Playlist options", + "newPlaylist": "New playlist", + "saveClip": "Save clip", + "hotkeysUnavailableTitle": "Global hotkeys are not available.", + "hotkeysUnavailableBody": "Vice cannot read your keyboard, so {hotkey} will not save a clip. The Save clip button above still works. Adding your user to the input group and logging back in usually fixes it.", + "emptySearch": "Nothing matches “{query}”.", + "emptyPlaylist": "This playlist is empty. Drag a clip onto it, or right-click a clip to add it.", + "emptyLibrary": "No clips yet. Press {hotkey} to save the last {duration} seconds.", + "editPlaylist": "Edit playlist", + "deletePlaylist": "Delete playlist", + "confirmDeleteTitle": "Delete this playlist?", + "confirmDeleteBody": "The clips themselves stay put. Only the playlist goes.", + "confirmDeleteAuto": " This one was created automatically, so Vice will not build it again for this game.", + "playlistUpdated": "Playlist updated", + "playlistDeleted": "Playlist deleted", + "playlistCreated": "Playlist “{name}” created", + "errSaveClip": "Could not save a clip", + "errUpdatePlaylist": "Could not update the playlist", + "errCreatePlaylist": "Could not create the playlist", + "errDeletePlaylist": "Could not delete the playlist", + "imagesHeading": { + "one": "{count} screenshot", + "other": "{count} screenshots" + } + }, + "home": { + "greetingMorning": "Good morning", + "greetingAfternoon": "Good afternoon", + "greetingEvening": "Good evening", + "quickSettings": "Quick settings", + "storage": "Storage", + "diskFree": "Free space", + "diskLibrary": "Vice library", + "diskUnknown": "Not measured", + "lastClip": "Last clip", + "lastClipNever": "None yet", + "diskBar": "{used} of {total} used, {library} of it Vice", + "microphone": "Microphone", + "desktopAudio": "Desktop audio", + "publicLink": "Public link", + "on": "On", + "off": "Off", + "active": "Active", + "starting": "Starting", + "connecting": "Connecting", + "localOnly": "Local only", + "tapToCopy": "Tap to copy", + "cloudflaredStarting": "cloudflared is starting up", + "linksWorkOnNetwork": "Links work on this network", + "copyPublicLink": "Copy the public link", + "noPublicLinkYet": "No public link yet", + "saveClipNow": "Save clip now", + "allClips": "All clips", + "settings": "Settings", + "recentClips": "Recent clips", + "seeAll": "See all", + "mostViewed": "Most viewed", + "playlists": "Playlists", + "emptyReel": "No clips yet. Press {hotkey} to start your reel.", + "lede": "The last {duration} of your gameplay are always in the buffer. Press {hotkey} to keep them. Double-tap to start a session.", + "micOn": "Microphone on", + "micOff": "Microphone off", + "micOnDetail": "Included in new clips", + "micOffDetail": "Removed from new clips", + "desktopAudioOn": "Desktop audio on", + "desktopAudioOff": "Desktop audio off", + "publicLinkStarting": "Public link starting", + "publicLinkStopped": "Public link stopped", + "publicLinkCopied": "Public link copied", + "enablePublicLinkFirst": "Enable the public link first", + "savedNotApplied": "Saved, but not applied", + "errMic": "Could not change the microphone setting", + "errDesktopAudio": "Could not change desktop audio", + "errPublicLink": "Could not change the public link", + "errSaveClip": "Could not save a clip", + "wfMicTitle": "How should the microphone be mixed in?", + "wfMicBody": "wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.", + "wfMicBothLabel": "Use a backend that can do both", + "wfMicBothHelp": "Vice records with a compatible backend whenever the microphone is on.", + "wfMicOnlyLabel": "Microphone only", + "wfMicOnlyHelp": "Desktop audio is dropped while the microphone is on.", + "copyLinkTitle": "Copy this link", + "copyLinkBody": "The clipboard was not available, so here is the link to copy by hand.", + "restartTitle": "Restart Vice to finish", + "restartBody": "That setting is saved, but it only takes effect once the daemon restarts.", + "gotIt": "Got it" + }, + "card": { + "unreadable": "Unreadable", + "unreadableNote": "{reason}. The file is still on disk.", + "unreadableFallback": "ffmpeg could not read this file", + "openTitle": "Open {name}", + "renameHint": "{name}, double-click to rename", + "trim": "Trim", + "copyVideo": "Copy video to clipboard", + "copyShareLink": "Copy share link", + "noShareLink": "No share link yet", + "reveal": "Reveal in file manager", + "delete": "Delete", + "open": "Open", + "rename": "Rename", + "copyVideoShort": "Copy video", + "deleteClip": "Delete clip", + "videoCopied": "Video copied, paste it anywhere", + "errCopyVideo": "Could not copy the video", + "renameFailed": "Rename failed", + "savedAs": "Saved as {name}", + "addTo": "Add to {playlist}", + "removeFrom": "Remove from {playlist}", + "addedTo": "Added to {playlist}", + "removedFrom": "Removed from {playlist}", + "playlistUnchanged": "The playlist did not change", + "nameLabel": "Clip name", + "views": { + "one": "{count} view", + "other": "{count} views" + }, + "noShareLinkYet": "No share link for this clip yet", + "linkCopiedLocal": "Link copied, but it is local only", + "linkCopiedLocalDetail": "Install cloudflared for links that work off your network", + "shareLinkCopied": "Share link copied", + "alreadyIn": "Already in {playlist}", + "errAddClip": "Could not add the clip" + }, + "playlistModal": { + "editTitle": "Edit playlist", + "newTitle": "New playlist", + "nameRequired": "Give the playlist a name", + "name": "Name", + "emoji": "Emoji", + "emojiPlaceholder": "Optional", + "colour": "Playlist colour" + }, + "frame": { + "quitConfirm": "Stop Vice and quit? The recording daemon will shut down.", + "minimize": "Minimize", + "quit": "Quit" + }, + "banners": { + "notRecording": "Vice is not recording.", + "cpuFallback": "Recording on the CPU.", + "codecFallback": "Recording with a different codec.", + "cannotPlay": "Clips cannot play inside this window.", + "notRecordingHelp": "Vice keeps retrying on its own. If it is an encoder problem, a reboot after a driver update usually clears it, or pick a different encoder under Settings, Recording.", + "cpuFallbackHelp": "Your GPU encoder would not open, so Vice fell back to CPU encoding to keep clipping. That costs frames in games. This is usually a driver that needs a reboot after an update. Vice tries the GPU first every time it starts, so once that is sorted this goes away on its own.", + "codecFallbackHelp": "Your GPU would not encode the codec picked under Settings, Recording, so gpu-screen-recorder chose one it can handle. Recording is still on the GPU and clips are unaffected. Choosing a different encoder yourself stops this notice, and H.264 in particular tops out at 4096 pixels wide on NVIDIA, so HEVC or AV1 is the one to pick on a wide monitor.", + "cannotPlayHelp": "The installed Qt WebEngine build has no H.264 decoder. Recording still works, and clips open fine in your system player. To fix in-app playback, install your distro's WebEngine package and reinstall Vice:" + }, + "island": { + "cannotReach": "Cannot reach the daemon", + "notRecording": "Not recording", + "keepsRetrying": "Vice keeps retrying", + "sessionRecording": "Session recording", + "bufferRunning": "Buffer running", + "starting": "Starting" + }, + "update": { + "releaseNotes": "Release notes", + "copyCommand": "Copy command", + "commandCopied": "Command copied, paste it into a terminal", + "copyByHand": "The clipboard was not available, so here is the command to copy by hand.", + "later": "Later", + "title": "Vice {version} is available", + "youAreOn": "You are on {version}.", + "olderRelease": "an older release", + "updateWith": " Update with:", + "copyTitle": "Copy this command" + }, + "audioTracks": { + "addTrack": "Add track", + "none": "No separate tracks. Everything is mixed into one, which is what most people want.", + "mixOfAll": "Mix of all tracks", + "trackLabel": "Track {n}", + "sourceToAdd": "Audio source to add as a track", + "refresh": "Refresh the source list", + "moveEarlier": "Move earlier", + "moveLater": "Move later", + "removeTrack": "Remove this track", + "moveEarlierAria": "Move {name} earlier", + "moveLaterAria": "Move {name} later", + "removeAria": "Remove {name}", + "droppedWarning": { + "one": "Capture desktop audio is off, so this track will not be recorded: {list}.", + "other": "Capture desktop audio is off, so these tracks will not be recorded: {list}." + }, + "trimmedWarning": { + "one": "{count} more will keep only its microphone sources.", + "other": "{count} more will keep only their microphone sources." + }, + "turnBackOn": "Turn desktop audio back on above to keep them." + }, + "keyCapture": { + "pressKey": "Press a key", + "setKey": "Set key" + }, + "nav": { + "allClips": "All Clips", + "images": "Images", + "home": "Home", + "editor": "Editor", + "settings": "Settings", + "about": "About", + "playlists": "Playlists", + "newPlaylist": "New playlist", + "search": "Search clips", + "dragToStart": "Drag a clip here to start one.", + "quickStart": "Quick start", + "buffer": "Buffer", + "update": "Update", + "open": "Open", + "useEmoji": "Use {emoji}", + "errSetEmoji": "Could not set the emoji", + "main": "Main" + }, + "viewer": { + "errReveal": "Could not open the file manager", + "errSystemPlayer": "Could not open the system player", + "clipDeleted": "Clip deleted", + "errDelete": "Could not delete the clip", + "confirmDeleteTitle": "Delete this clip?", + "confirmDeleteBody": "{name} will be removed from disk. This cannot be undone.", + "copyLinkTitle": "Copy this link", + "copyLinkBody": "The clipboard was not available, so here is the link to copy by hand.", + "highlight": "Highlight", + "highlightNumbered": "{base} {n}", + "errAddHighlight": "Could not add the highlight", + "errMoveHighlight": "Could not move the highlight", + "errUpdateHighlight": "Could not update the highlight", + "errDeleteHighlight": "Could not delete the highlight", + "daemonNoMark": "The daemon did not return the mark", + "daemonRejectedMove": "The daemon rejected the move", + "daemonRejectedChange": "The daemon rejected the change", + "play": "Play", + "pause": "Pause", + "preparingPreview": "Preparing the H.265 preview", + "openInPlayer": "Open in system player", + "showInFolder": "Show in folder", + "addHighlight": "Add highlight", + "noHighlights": "No highlights yet. Press", + "addHighlightKey": "Add highlight {key}", + "noHighlightsHelp": "No highlights yet. Press {key} to mark the current timestamp.", + "prevClip": "Previous clip", + "nextClip": "Next clip", + "changeColour": "Change colour", + "changeColourAria": "Change the colour of {name}", + "doubleClickRename": "Double-click to rename", + "removeHighlight": "Remove", + "removeHighlightAria": "Remove {name}", + "copyShareLink": "Copy share link", + "closePlayer": "Close the player", + "volume": "Volume", + "mute": "Mute", + "unmute": "Unmute", + "highlightLabel": "Highlight label", + "highlightAt": "{label} at {time}", + "useColour": "Use {color}", + "highlightsHeading": "Highlights", + "trim": "Trim", + "share": "Share", + "reveal": "Reveal", + "delete": "Delete", + "shortcuts": "Left and right step clips · H marks a highlight · Esc closes", + "playbackFailed": "Vice could not play this clip in the app window. The file itself is most likely fine.", + "noH264Decoder": "This Qt WebEngine build has no H.264 decoder, so clips cannot play inside Vice. The file itself is fine.", + "saveFrame": "Save this frame", + "saveFrameHint": "Save the current frame as a screenshot (S)", + "frameSaved": "Frame saved and copied", + "frameSavedNotCopied": "Frame saved, but not copied", + "errSaveFrame": "Could not save the frame", + "muteHint": "Mute (M)", + "unmuteHint": "Unmute (M)", + "expand": "Fill the window", + "shrink": "Back to normal size", + "expandHint": "Fill the window (F, or double-click)", + "shrinkHint": "Back to normal size (F, or Esc)" + }, + "trim": { + "saved": "Clip trimmed and saved", + "failed": "The trim failed", + "errTrim": "Could not trim the clip", + "preview": "Preview", + "stop": "Stop", + "loopHelp": "Loops the selection. Cut bounds are lossless.", + "saving": "Saving", + "saveTrim": "Save trim", + "preparingPreview": "Preparing the H.265 preview", + "openInPlayer": "Open in system player", + "showInFolder": "Show in folder", + "title": "Trim · {name}", + "in": "In", + "out": "Out", + "duration": "Duration", + "startOfSelection": "Start of the selection", + "endOfSelection": "End of the selection", + "trimAria": "Trim {name}", + "heading": "Trim" + }, + "images": { + "heading": "Images", + "countImages": { + "one": "{count} screenshot", + "other": "{count} screenshots" + }, + "countMatches": { + "one": "{count} match for “{query}”", + "other": "{count} matches for “{query}”" + }, + "emptySearch": "Nothing matches “{query}”.", + "emptyLibrary": "No screenshots yet. Press {hotkey} to save what is on screen.", + "emptyNoKey": "No screenshots yet. Set a screenshot key in Settings, or open a clip and save a frame from it.", + "captureMoment": "Keep a moment", + "roomForMore": "Room for your next moment", + "captureHint": "Press {hotkey} to save a screenshot.", + "captureNoKey": "Set a screenshot key in Settings, or save a frame from a clip.", + "openTitle": "Open {name}", + "open": "Open", + "openExternally": "Open in image viewer", + "copy": "Copy image", + "copied": "Image copied", + "errCopy": "Could not copy the image", + "errOpen": "Could not open the image", + "deleteImage": "Delete screenshot", + "deleted": "Screenshot deleted", + "errDelete": "Could not delete the screenshot", + "confirmDeleteTitle": "Delete this screenshot?", + "confirmDeleteBody": "{name} will be moved to the trash. This cannot be undone from here.", + "pen": "Pen", + "penOn": "Pen on", + "penColour": "Pen colour", + "undo": "Undo", + "saveDrawing": "Save drawing", + "saving": "Saving", + "saved": "Drawing saved", + "errSave": "Could not save the drawing", + "errCanvas": "This window could not render the image", + "prev": "Previous image", + "next": "Next image", + "shortcuts": "Arrows step, F fills the window, Ctrl+Z undoes, Esc closes" + }, + "tutorial": { + "pickColour": "Pick a colour", + "startClipping": "Start clipping, then let Vice run", + "playlistsTitle": "Playlists sort the reel", + "colourBody": "Vice takes its colour from one of these. The whole window changes as you pick, so choose the one you want to look at, and change it any time in Settings.", + "quickStartBody": "Vice keeps the buffer live in the background and opens this window only when you need it.", + "playlistsBody": "Every clip can live in any number of playlists, and they keep themselves in order.", + "saveLast": "Save the last {duration}s", + "saveLastHelp": "Press {hotkey} after something worth keeping.", + "sessionTitle": "Double-tap {hotkey} for a session", + "sessionHelp": "Double-tap to start or stop a full recording. Tap once during a session to mark a highlight.", + "reviewTitle": "Review, trim and share", + "reviewHelp": "Open any clip to rename it, trim the best moment, share a link, or press H to add highlights.", + "backgroundTitle": "Close the window safely", + "backgroundHelp": "Minimize or close this window and Vice keeps recording. Discord Rich Presence is on by default and lives in Settings.", + "autoTitle": "Auto playlists", + "autoHelp": "Clips are filed under the game you were playing when you saved them. Vice builds these on its own.", + "customTitle": "Custom playlists", + "customHelp": "Create your own from the sidebar, pick an emoji and a colour, then drag clips onto it or right-click a clip to add it.", + "safeTitle": "Nothing goes stale", + "safeHelp": "Playlists follow clips through renames and trims, and tidy up after deletions.", + "next": "Next", + "back": "Back", + "gotIt": "Got it", + "badgeClip": "Clip", + "badgeBg": "BG", + "badgeAuto": "Auto", + "badgeNew": "New", + "badgeSafe": "Safe", + "accentLabel": "{name} accent", + "bufferTitle": "How far back Vice can reach", + "bufferBody": "Vice is always recording into a buffer it throws away. Pressing the clip key keeps the last stretch of it, and this is how long that stretch is.", + "bufferLabel": "Instant replay length", + "bufferNote": "The buffer holds {buffer} at a time. A longer one costs memory, and Settings has the whole picture, including writing it to disk instead.", + "clipKeyLabel": "Clip key", + "screenshotKeyLabel": "Screenshot key", + "screenshotKeyNote": "The screenshot key is unset until you set one. It saves a picture of the screen to the Images section and puts it on your clipboard.", + "errSave": "Could not save that", + "editorTitle": "The Editor", + "editorHelp": "Put several clips on a timeline, cut them together, add text and transitions, and export one video. It is in the sidebar.", + "badgeEdit": "Edit", + "shareTitle": "Sending a clip to someone", + "shareBody": "Every clip has a link, and copying it is one button on the card.", + "linkTitle": "Copy link", + "linkHelp": "The link button on a clip copies an address that plays the clip in a browser. Paste it into Discord and it embeds.", + "tunnelTitle": "Local, or reachable from anywhere", + "tunnelHelp": "On its own the link only works on this machine. Turn on the Cloudflare tunnel in Settings and it works anywhere, until the daemon restarts and the address changes.", + "badgeLink": "Link", + "badgeTunnel": "Net", + "moreTitle": "The rest lives in Settings", + "moreBody": "That is everything you need. Settings has the parts you only touch once.", + "recTitle": "Recording", + "recHelp": "Encoder, resolution, frame rate, which monitor, and which audio goes on which track.", + "badgeRec": "Rec" + }, + "accents": { + "blue": "Blue", + "purple": "Purple", + "green": "Green", + "red": "Red", + "orange": "Orange", + "customTitle": "Custom colour", + "customBody": "Pick any colour and Vice builds a full Material 3 scheme from it. Only the hue carries over: the surfaces, the buttons and the text tones are worked out from it, the same way the five presets are.", + "useThis": "Use this colour", + "hue": "Hue", + "saturation": "Saturation and brightness", + "hexLabel": "Hex value", + "previewTitle": "Vice_Clip_12", + "previewMeta": "20s · 1920x1080 · 14.2 MB", + "previewPrimary": "Save clip", + "previewQuiet": "Trim", + "previewChip": "Deadlock", + "lowContrast": "This colour does not leave enough contrast to read comfortably. Vice has lightened the accent as far as it can; try something less dark." + }, + "events": { + "clipSaved": "Clip saved", + "savingClip": "Saving clip", + "errSaveClip": "Could not save the clip", + "recorderSilent": "The recorder did not say why", + "publicLinkReady": "Public link ready", + "noPublicLink": "No public link", + "tunnelUnavailable": "The share tunnel is unavailable", + "sessionRecording": "Session recording", + "doubleTapToStop": "Double-tap the clip key to stop", + "sessionSaved": "Session saved", + "highlightMarked": "Highlight marked", + "cannotPlay": "Clips cannot play in this window", + "noH264": "This Qt WebEngine build has no H.264 decoder", + "notSaved": "The change was not saved", + "imageSaved": "Screenshot saved", + "errScreenshot": "Could not take the screenshot", + "screenshotNotCopied": "Screenshot saved, but not copied", + "updating": "Vice is updating to {version}", + "updatingDetail": "The recorder restarts to pick up the new version. This window reconnects on its own." + }, + "about": { + "title": "About", + "subtitle": "Vice, the game clip recorder for Linux", + "tagline": "Linux-first, open source game clipping.", + "waylandAndX11": "Wayland and X11", + "system": "System", + "version": "Version", + "backend": "Backend", + "buffer": "Buffer", + "frameRate": "Frame rate", + "clipsOnDisk": "Clips on disk", + "totalFootage": "Total footage", + "credits": "Credits", + "creator": "Creator and maintainer", + "community": "Community contributors", + "communityHelp": "Bug reports, translations, patches", + "dangerZone": "Danger zone", + "uninstallHelp": "Uninstalling removes Vice, its systemd units and the udev rules. Your clips stay where they are.", + "copy": "Copy", + "commandCopied": "Command copied, paste it into a terminal", + "copyTitle": "Copy this command", + "copyByHand": "The clipboard was not available, so here is the command to copy by hand." + }, + "editor": { + "nothingAtPlayhead": "Nothing at the playhead", + "dragFromLibrary": "Drag a clip from the library onto the timeline below.", + "preparingPreview": "Preparing the H.265 preview", + "removeTitle": "Remove title", + "play": "Play", + "pause": "Pause", + "detachAudio": "Detach audio", + "clearTitle": "Clear the timeline?", + "clearBody": "Every clip, title and transition on the timeline goes. Your clips stay on disk.", + "exportCanceled": "Export canceled", + "exportFailed": "Export failed", + "pickFolder": "Pick a folder for the export", + "exportRefused": "The export was refused", + "errStartExport": "Could not start the export", + "startExport": "Start export", + "cancelExport": "Cancel export", + "saveAs": "Save as", + "viceLibrary": "Vice library (default)", + "customPath": "Custom path", + "alsoAddToLibrary": "Also add to the Vice library", + "encoding": "Encoding H.264. You can leave this open or carry on elsewhere in Vice.", + "videoTrack": "Video track", + "audioTrack": "Audio track", + "tabLibrary": "Library", + "tabEffects": "Effects", + "tabText": "Text", + "searchClips": "Search clips", + "libHintLibrary": "Drag a clip onto the timeline, or double-click to append", + "libHintEffects": "Drag an effect onto a clip, or between two clips", + "libHintText": "Drag a title onto the preview or the T1 lane", + "titleSection": "Title", + "closeInspector": "Close the inspector", + "titleText": "Title text", + "font": "Font", + "size": "Size", + "colour": "Colour", + "titleSize": "Title size", + "useColour": "Use {color}", + "reset": "Reset", + "backToStart": "Back to the start", + "playPause": "Play or pause, space", + "exportBtn": "Export", + "split": "Split", + "duplicate": "Duplicate", + "fit": "Fit", + "zoomOut": "Zoom out", + "zoomIn": "Zoom in", + "addTrack": "Track", + "clear": "Clear", + "exportVideo": "Export video", + "done": "Done", + "exportFilename": "Export filename", + "exportFilenamePlaceholder": "Vice_Edit_1 (automatic if empty)", + "location": "Location", + "exportLocation": "Export location", + "folder": "Folder", + "exportFolder": "Export folder", + "audioDetached": "Audio detached", + "transShorter": "Shorter", + "transLonger": "Longer", + "transRemove": "Remove transition", + "junctionTitle": "{name} · {len}s, click to edit", + "trackOptionsHint": "Right-click for track options", + "libClipHint": "Drag to the timeline, or double-click to append", + "libNoMatch": "No clips match", + "libNoMatchBody": "Try a different search.", + "libEmpty": "No clips yet", + "libEmptyBody": "Save some gameplay first.", + "noReadableDuration": "That clip has no readable duration yet", + "menuSplit": "Split at playhead", + "menuDetach": "Detach audio", + "menuCopy": "Copy", + "menuPaste": "Paste", + "menuDuplicate": "Duplicate", + "menuDelete": "Delete", + "menuAddVideoTrack": "Add video track", + "menuAddAudioTrack": "Add audio track", + "menuRemoveTrack": "Remove track {name}", + "fx": { + "crossfade": { + "name": "Crossfade", + "desc": "Blend outgoing into incoming" + }, + "fadeblack": { + "name": "Fade to black", + "desc": "Dip through pure black" + }, + "fadewhite": { + "name": "Fade to white", + "desc": "Bloom through white" + }, + "dipaccent": { + "name": "Dip to accent", + "desc": "Flash the theme colour" + }, + "blurdis": { + "name": "Blur dissolve", + "desc": "Defocus across the cut" + }, + "slide": { + "name": "Slide", + "desc": "Incoming pushes in from the right" + } + }, + "textPreset": { + "title": { + "name": "Title", + "sample": "Match point" + }, + "subtitle": { + "name": "Subtitle", + "sample": "Ranked grind" + }, + "caption": { + "name": "Caption", + "sample": "1920x1080 · 60 fps" + }, + "lower": { + "name": "Lower third", + "sample": "Player · support" + } + }, + "exported": "Exported.", + "encodingProgress": "{percent}% encoding", + "audioSource": "Recorded source", + "recordedTrack": "Track {number}", + "audioVolume": "Volume", + "audioMuted": "Muted", + "audioPreviewFailed": "Could not play this audio track. Try again or check the log.", + "detachedTracksHelp": "Each recorded source has its own lane. Only track 1 starts enabled, so a combined track is not mixed twice. Unmute the sources you want to hear.", + "preparingMedia": "Preparing preview" + }, + "settings": { + "title": "Settings", + "subtitle": "Tune Vice to the way you play", + "sections": "Settings sections", + "loading": "Loading your settings.", + "secRecording": "Recording", + "secAudio": "Audio", + "secHotkeys": "Hotkeys", + "secStorage": "Storage", + "secSharing": "Sharing", + "secDiscord": "Discord", + "secAppearance": "Appearance", + "secAdvanced": "Advanced", + "cardDiscord": "Discord Rich Presence", + "optAutoRecommended": "Auto (recommended)", + "bufferDuration": "Buffer duration", + "bufferOnDisk": "Buffer is kept on disk, so long durations are fine.", + "bufferPlain": "Seconds of gameplay kept in the rolling buffer", + "bufferRamWarning": "A {length} buffer in RAM uses roughly {gb} GB at typical bitrates. Auto storage moves it to disk.", + "replayStorage": "Replay storage", + "replayStorageHelp": "Where the rolling buffer lives. Auto keeps short buffers in RAM and moves anything over ten minutes to disk.", + "replayRam": "RAM", + "replayDisk": "Disk", + "clipDuration": "Clip duration", + "clipDurationHelp": "Seconds saved when you press the clip key", + "frameRate": "Frame rate", + "frameRateHelp": "Capture frames per second", + "fpsOption": "{fps} fps", + "resolution": "Resolution", + "resolutionHelp": "Auto matches your display", + "resolutionAuto": "Auto", + "resolutionCustom": "Custom", + "customResolution": "Custom resolution", + "customResolutionHelp": "Width by height, for example 1600x900", + "customResolutionWarn": "Write it as width by height, like 1600x900.", + "badResolutionTitle": "That resolution is not a size", + "badResolutionDetail": "Write it as width by height, like 1600x900", + "container": "Container", + "containerHelp": "MKV survives crashes better and suits multi-track audio. Discord embeds and browsers need MP4.", + "containerMp4": "MP4 (best compatibility)", + "containerMkv": "MKV (crash-safe)", + "encoder": "Video encoder", + "encoderHelp": "GPU encoders are faster and use less CPU. Vulkan options require the gpu-screen-recorder backend.", + "encoderH264Vulkan": "H.264 (Vulkan, GSR)", + "encoderHevcVulkan": "HEVC (Vulkan, GSR)", + "encoderAv1Vulkan": "AV1 (Vulkan, GSR)", + "encoderH264Nvenc": "NVIDIA H.264 (NVENC)", + "encoderHevcNvenc": "NVIDIA H.265 (NVENC)", + "encoderH264Vaapi": "AMD or Intel H.264 (VAAPI)", + "encoderHevcVaapi": "AMD or Intel H.265 (VAAPI)", + "encoderAv1Nvenc": "NVIDIA AV1 (NVENC, RTX 40 and up)", + "encoderAv1Vaapi": "AMD or Intel AV1 (VAAPI)", + "encoderX264": "Software H.264 (x264)", + "encoderX265": "Software H.265 (x265)", + "colourDepth": "Colour depth", + "colourDepthHelp": "8-bit suits every player. 10-bit needs an HEVC or AV1 encoder.", + "colour8": "8-bit (standard)", + "colour10": "10-bit (HEVC or AV1)", + "hardwareDecode": "Hardware video decode in previews", + "hardwareDecodeHelp": "Let your GPU decode clips in this window instead of the CPU. Worth turning on if high-resolution AV1 or HEVC previews stutter. It renders video black on some drivers, so if that happens turn it back off. Takes effect next time you open Vice.", + "backend": "Recording backend", + "backendHelp": "Screen capture method", + "backendWf": "wf-recorder (Wayland)", + "backendFfmpeg": "ffmpeg (X11)", + "followMouse": "Follow my mouse", + "followMouseHelp": "Record whichever monitor the pointer is on. Switching monitors restarts the buffer, so a clip taken right after moving will be short.", + "followMouseUnsupported": "Needs X11, Hyprland or Sway. Vice cannot tell where the pointer is on this session.", + "display": "Display", + "displayAuto": "Auto (backend default)", + "savedOption": "{id} (saved)", + "displayMissing": "Display \"{id}\" is not being reported right now. It is still saved and will be used if it comes back.", + "displayWarning": "{warning} Auto will still work.", + "displayNone": "No individual displays were detected. Auto will still work.", + "displayHelp": "Choose which display to record. Auto follows the backend default.", + "displayLoadFailed": "Could not load display options.", + "captureDesktopAudio": "Capture desktop audio", + "captureDesktopAudioHelp": "Include system sound in clips", + "captureMic": "Capture microphone", + "captureMicHelp": "Record your mic into clips. The same switch as the tile on Home, and saved the moment you flip it.", + "micOn": "Microphone on", + "micOff": "Microphone off", + "micOnDetail": "Included in new clips", + "micOffDetail": "Removed from new clips", + "errMic": "Could not change the microphone setting", + "desktopSource": "Desktop audio source", + "desktopSourceIsMic": "This is a microphone input, so clips would have no desktop audio. Pick one under Desktop audio instead.", + "desktopSourceMissing": "That source is not listed right now. It is still saved and will be passed to the recorder.", + "desktopSourceHelp": "Choose what the recorder captures as desktop audio.", + "sourceLoadFailed": "Could not load audio sources.", + "defaultOutput": "Default output", + "defaultInput": "Default input", + "groupDesktopAudio": "Desktop audio", + "groupMicrophones": "Microphones", + "groupApplications": "Applications", + "groupOther": "Other", + "groupSaved": "Saved", + "micSource": "Microphone source", + "micSourceHelp": "Used when mic capture is on. Default input follows the system setting.", + "micMono": "Mono microphone", + "micMonoHelp": "Centres your mic in the clip. Turn this on if your voice only comes out of one ear, which is what most XLR and single-channel interfaces do. Applied when the clip is saved, so it needs mic capture on and no separate audio tracks.", + "desktopVolume": "Desktop audio volume", + "desktopVolumeHelp": "Balanced into new clips as they are saved", + "micVolume": "Microphone volume", + "micVolumeHelp": "Turn this down if your mic overpowers the game. Applies while mic capture is on.", + "notifyVolume": "Notification volume", + "notifyVolumeHelp": "The ping when a clip is saved, and the session start, stop and highlight tones.", + "volumeOff": "Off", + "customSounds": "Custom sounds", + "customSoundsHelp": "Play your own file instead of the built-in tone. Leave blank for the tone. A path that does not exist falls back to the tone, so you never end up with silence.", + "soundClip": "Clip saved", + "soundClipFailed": "Clip failed", + "soundSessionStart": "Session started", + "soundSessionEnd": "Session stopped", + "soundHighlight": "Highlight marked", + "audioTracks": "Separate audio tracks", + "audioTracksHelp": "Each source becomes its own track for editing. Players, Discord and share links use track 1. With mic capture on, your microphone gets its own track.", + "duplicateTrack": "That source is already a track", + "sourcesRefreshed": "Audio sources refreshed", + "mixFirstTrack": "Combined first track", + "mixFirstTrackHelp": "Record an extra track 1 that mixes every source, so players and shared clips carry full audio. Your separate tracks start at 2.", + "wfMicMode": "wf-recorder microphone mode", + "wfMicModeHelp": "How wf-recorder handles desktop audio together with a microphone", + "wfMicPrompt": "Ask when needed", + "wfMicFallback": "Use a compatible backend", + "wfMicOnly": "Mic only on wf-recorder", + "wfMicTitle": "How should the microphone be mixed in?", + "wfMicBody": "wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.", + "wfMicChoiceBoth": "Use a backend that can do both", + "wfMicChoiceBothBody": "Vice records with a compatible backend whenever the microphone is on.", + "wfMicChoiceMic": "Microphone only", + "wfMicChoiceMicBody": "Desktop audio is dropped while the microphone is on.", + "clipKey": "Clip key", + "clipKeyHelp": "Click to rebind, then press a key or a combo like Alt+F9. Escape cancels. Saved the moment you press it.", + "hotkeysUnavailable": "Vice cannot read your keyboard right now, so no hotkey will fire. Adding your user to the input group and logging back in usually fixes it.", + "keyUnsupported": "That key cannot be bound, try another", + "clipKeyNow": "Clip key is now {key}", + "errSaveKey": "The key was captured but not saved", + "clipPresets": "Additional clip hotkeys", + "clipPresetsHelp": "Each key saves its own clip length. Double-tap any clip key to start or stop a session.", + "presetDuration": "Clip length for this key", + "presetRemove": "Remove this hotkey", + "presetAdd": "Add hotkey", + "blocklist": "Ignore hotkeys in these apps", + "blocklistHelp": "One per line. Vice leaves its keys alone while a matching app is focused, for games that clip on the same keys. Matched against the window process and class, for example ggst.exe. Needs X11, Hyprland or Sway.", + "directory": "Save clips to", + "directoryHelp": "Directory where clips are written", + "tagWithGame": "Tag clips with the game", + "tagWithGameHelp": "Append the detected game to clip filenames, like Vice_Clip_4_Overwatch-2.mp4. Uses the same game list as Rich Presence and the auto playlists.", + "autoPlaylist": "Create a playlist per game", + "autoPlaylistHelp": "When a known game is focused, file the clip into an auto playlist for it with its own colour.", + "clipFilename": "Clip filename", + "clipFilenameNext": "Next clip: {name}.mp4", + "clipFilenameEmpty": "That template renders to nothing, so the default naming will be used.", + "port": "HTTP port", + "portHelp": "Port for the local share server", + "publicLink": "Public link", + "publicLinkHelp": "Share links that work outside your own network. Needs the cloudflared binary installed, otherwise links only work on your network.", + "discordEnabled": "Show what you are playing", + "discordCustomGames": "Custom games", + "discordCustomGamesPlaceholder": "My Game | mygame.exe, MyGameClient", + "discordClientId": "Client ID override", + "discordClientIdHelp": "Optional. Leave empty to use Vice's own Discord application, or provide your own Application ID for custom branding.", + "discordClientIdPlaceholder": "Discord Application ID", + "accent": "Accent colour", + "accentHelp": "Tints the controls, the highlights and the ambient wash behind the app. Saved straight away, and shared clips pick it up too.", + "accentAria": "{name} accent", + "effects": "Visual effects", + "effectsHelp": "Motion and depth cost a GPU. Auto measures how fast frames arrive in this window and turns them down when it cannot keep up.", + "effectsAuto": "Auto", + "effectsFull": "Full", + "effectsReduced": "Reduced", + "effectsSoftware": "This window is compositing in software, so effects are reduced.", + "effectsSlow": "Frames are arriving too slowly here, so effects are reduced.", + "effectsKeepingUp": "Frames are keeping up, so the full treatment is on.", + "effectsMeasuring": "Measuring.", + "gsrArgs": "Extra gpu-screen-recorder arguments", + "checkForUpdates": "Check for updates", + "checkForUpdatesHelp": "Ask GitHub once a day whether a newer Vice is out. Nothing about you or your clips is sent.", + "checkNow": "Check now", + "checkNowHelp": "Look straight away, ignoring the daily wait.", + "checking": "Checking", + "updateAvailable": "Vice {version} is available", + "upToDate": "You are on the latest release", + "errCheckUpdate": "Could not reach GitHub", + "savedNotApplied": "Saved, but not applied", + "saved": "Settings saved", + "bufferRaised": "Buffer raised to {length} to cover your longest clip key", + "errSave": "Could not save your settings", + "unsaved": "Unsaved changes", + "allSaved": "Everything saved", + "discard": "Discard", + "saving": "Saving", + "saveSettings": "Save settings", + "restartTitle": "Restart Vice to finish", + "restartBody": "The sharing settings are saved, but the server only picks up a new port or tunnel setting when the daemon restarts.", + "clipFilenameHelp": "Leave empty for the default Vice_Clip_4 naming. Use {n} for the clip number, {date}, {time}, and {game} (needs the toggle above). Clips are never overwritten.", + "discordEnabledHelp": "Puts \"Clipping with Vice\" on your Discord profile while a known game is focused. On by default, and window titles are never sent.", + "discordCustomGamesHelp": "One game per line: {format}. Matches are case-insensitive substrings checked against the focused window's process name and class. The bundled list already covers over 300 games.", + "gsrArgsHelp": "Appended to the recorder command as written. Example: {example}", + "language": "Language", + "languageHelp": "Vice is translated by the people who use it. If yours is missing or half done, the file to fill in is one JSON file: see docs/TRANSLATING.md.", + "screenshotKey": "Screenshot key", + "screenshotKeyHelp": "Saves what is on screen as a picture, in the Images section. Unset by default. Screenshots are copied to the clipboard as well.", + "screenshotKeyNow": "Screenshots are on {key}", + "screenshotKeyCleared": "Screenshot key cleared", + "clearKey": "Clear", + "imageDirectory": "Image folder", + "imageDirectoryHelp": "Where screenshots are written. Kept apart from clips so an image viewer is not indexing a folder of video files.", + "soundScreenshot": "Screenshot" + } +} diff --git a/ui-src/locales/index.ts b/ui-src/locales/index.ts index 9aadd17..580a19a 100644 --- a/ui-src/locales/index.ts +++ b/ui-src/locales/index.ts @@ -1,4 +1,5 @@ import en from './en.json'; +import fr from './fr.json'; /** * Every locale, imported statically. @@ -15,6 +16,7 @@ import en from './en.json'; */ export const LOCALES = { en, + fr: fr, } as const; export type LocaleName = keyof typeof LOCALES; @@ -22,4 +24,5 @@ export type LocaleName = keyof typeof LOCALES; /** What the picker in Settings shows, in the language itself. */ export const LOCALE_LABELS: Record = { en: 'English', + fr: 'fr', }; From 1f7a84eb241616afb9443ba6e83ea56f7314f6a6 Mon Sep 17 00:00:00 2001 From: voltek Date: Sun, 20 Sep 2026 21:11:57 +0200 Subject: [PATCH 2/6] add fr --- ui-src/locales/fr.json | 1410 ++++++++++++++++++++-------------------- 1 file changed, 705 insertions(+), 705 deletions(-) diff --git a/ui-src/locales/fr.json b/ui-src/locales/fr.json index f206694..e0d5957 100644 --- a/ui-src/locales/fr.json +++ b/ui-src/locales/fr.json @@ -3,826 +3,826 @@ "name": "Vice" }, "common": { - "delete": "Delete", - "keepIt": "Keep it", - "cancel": "Cancel", - "save": "Save", - "close": "Close", - "noActions": "No actions", - "untagged": "Untagged", - "create": "Create", - "gotIt": "Got it", - "new": "New", - "dismiss": "Dismiss" + "delete": "Supprimer", + "keepIt": "Le garder", + "cancel": "Annuler", + "save": "Enregistrer", + "close": "Fermer", + "noActions": "Aucune action", + "untagged": "Sans étiquette", + "create": "Créer", + "gotIt": "Compris", + "new": "Nouveau", + "dismiss": "Ignorer" }, "clips": { - "allClips": "All Clips", + "allClips": "Tous les clips", "countClips": { "one": "{count} clip", "other": "{count} clips" }, "countMatches": { - "one": "{count} match for “{query}”", - "other": "{count} matches for “{query}”" + "one": "{count} résultat pour « {query} »", + "other": "{count} résultats pour « {query} »" }, - "playlistOptions": "Playlist options", - "newPlaylist": "New playlist", - "saveClip": "Save clip", - "hotkeysUnavailableTitle": "Global hotkeys are not available.", - "hotkeysUnavailableBody": "Vice cannot read your keyboard, so {hotkey} will not save a clip. The Save clip button above still works. Adding your user to the input group and logging back in usually fixes it.", - "emptySearch": "Nothing matches “{query}”.", - "emptyPlaylist": "This playlist is empty. Drag a clip onto it, or right-click a clip to add it.", - "emptyLibrary": "No clips yet. Press {hotkey} to save the last {duration} seconds.", - "editPlaylist": "Edit playlist", - "deletePlaylist": "Delete playlist", - "confirmDeleteTitle": "Delete this playlist?", - "confirmDeleteBody": "The clips themselves stay put. Only the playlist goes.", - "confirmDeleteAuto": " This one was created automatically, so Vice will not build it again for this game.", - "playlistUpdated": "Playlist updated", - "playlistDeleted": "Playlist deleted", - "playlistCreated": "Playlist “{name}” created", - "errSaveClip": "Could not save a clip", - "errUpdatePlaylist": "Could not update the playlist", - "errCreatePlaylist": "Could not create the playlist", - "errDeletePlaylist": "Could not delete the playlist", + "playlistOptions": "Options de la playlist", + "newPlaylist": "Nouvelle playlist", + "saveClip": "Enregistrer un clip", + "hotkeysUnavailableTitle": "Les raccourcis globaux ne sont pas disponibles.", + "hotkeysUnavailableBody": "Vice ne peut pas lire ton clavier, donc {hotkey} n'enregistrera pas de clip. Le bouton Enregistrer un clip ci-dessus fonctionne toujours. Ajouter ton utilisateur au groupe input puis te reconnecter règle généralement le problème.", + "emptySearch": "Aucun résultat pour « {query} ».", + "emptyPlaylist": "Cette playlist est vide. Glisse un clip dessus, ou fais un clic droit sur un clip pour l'y ajouter.", + "emptyLibrary": "Aucun clip pour l'instant. Appuie sur {hotkey} pour enregistrer les {duration} dernières secondes.", + "editPlaylist": "Modifier la playlist", + "deletePlaylist": "Supprimer la playlist", + "confirmDeleteTitle": "Supprimer cette playlist ?", + "confirmDeleteBody": "Les clips eux-mêmes ne bougent pas. Seule la playlist disparaît.", + "confirmDeleteAuto": " Celle-ci a été créée automatiquement, donc Vice ne la recréera pas pour ce jeu.", + "playlistUpdated": "Playlist mise à jour", + "playlistDeleted": "Playlist supprimée", + "playlistCreated": "Playlist « {name} » créée", + "errSaveClip": "Impossible d'enregistrer un clip", + "errUpdatePlaylist": "Impossible de mettre à jour la playlist", + "errCreatePlaylist": "Impossible de créer la playlist", + "errDeletePlaylist": "Impossible de supprimer la playlist", "imagesHeading": { - "one": "{count} screenshot", - "other": "{count} screenshots" + "one": "{count} capture d'écran", + "other": "{count} captures d'écran" } }, "home": { - "greetingMorning": "Good morning", - "greetingAfternoon": "Good afternoon", - "greetingEvening": "Good evening", - "quickSettings": "Quick settings", - "storage": "Storage", - "diskFree": "Free space", - "diskLibrary": "Vice library", - "diskUnknown": "Not measured", - "lastClip": "Last clip", - "lastClipNever": "None yet", - "diskBar": "{used} of {total} used, {library} of it Vice", + "greetingMorning": "Bonjour", + "greetingAfternoon": "Bon après-midi", + "greetingEvening": "Bonsoir", + "quickSettings": "Réglages rapides", + "storage": "Stockage", + "diskFree": "Espace libre", + "diskLibrary": "Bibliothèque Vice", + "diskUnknown": "Non mesuré", + "lastClip": "Dernier clip", + "lastClipNever": "Aucun pour l'instant", + "diskBar": "{used} utilisés sur {total}, dont {library} pour Vice", "microphone": "Microphone", - "desktopAudio": "Desktop audio", - "publicLink": "Public link", - "on": "On", - "off": "Off", - "active": "Active", - "starting": "Starting", - "connecting": "Connecting", - "localOnly": "Local only", - "tapToCopy": "Tap to copy", - "cloudflaredStarting": "cloudflared is starting up", - "linksWorkOnNetwork": "Links work on this network", - "copyPublicLink": "Copy the public link", - "noPublicLinkYet": "No public link yet", - "saveClipNow": "Save clip now", - "allClips": "All clips", - "settings": "Settings", - "recentClips": "Recent clips", - "seeAll": "See all", - "mostViewed": "Most viewed", + "desktopAudio": "Audio du bureau", + "publicLink": "Lien public", + "on": "Activé", + "off": "Désactivé", + "active": "Actif", + "starting": "Démarrage", + "connecting": "Connexion", + "localOnly": "Local uniquement", + "tapToCopy": "Touche pour copier", + "cloudflaredStarting": "cloudflared démarre", + "linksWorkOnNetwork": "Les liens fonctionnent sur ce réseau", + "copyPublicLink": "Copier le lien public", + "noPublicLinkYet": "Pas encore de lien public", + "saveClipNow": "Enregistrer un clip maintenant", + "allClips": "Tous les clips", + "settings": "Réglages", + "recentClips": "Clips récents", + "seeAll": "Tout voir", + "mostViewed": "Les plus vus", "playlists": "Playlists", - "emptyReel": "No clips yet. Press {hotkey} to start your reel.", - "lede": "The last {duration} of your gameplay are always in the buffer. Press {hotkey} to keep them. Double-tap to start a session.", - "micOn": "Microphone on", - "micOff": "Microphone off", - "micOnDetail": "Included in new clips", - "micOffDetail": "Removed from new clips", - "desktopAudioOn": "Desktop audio on", - "desktopAudioOff": "Desktop audio off", - "publicLinkStarting": "Public link starting", - "publicLinkStopped": "Public link stopped", - "publicLinkCopied": "Public link copied", - "enablePublicLinkFirst": "Enable the public link first", - "savedNotApplied": "Saved, but not applied", - "errMic": "Could not change the microphone setting", - "errDesktopAudio": "Could not change desktop audio", - "errPublicLink": "Could not change the public link", - "errSaveClip": "Could not save a clip", - "wfMicTitle": "How should the microphone be mixed in?", - "wfMicBody": "wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.", - "wfMicBothLabel": "Use a backend that can do both", - "wfMicBothHelp": "Vice records with a compatible backend whenever the microphone is on.", - "wfMicOnlyLabel": "Microphone only", - "wfMicOnlyHelp": "Desktop audio is dropped while the microphone is on.", - "copyLinkTitle": "Copy this link", - "copyLinkBody": "The clipboard was not available, so here is the link to copy by hand.", - "restartTitle": "Restart Vice to finish", - "restartBody": "That setting is saved, but it only takes effect once the daemon restarts.", - "gotIt": "Got it" + "emptyReel": "Aucun clip pour l'instant. Appuie sur {hotkey} pour lancer ta collection.", + "lede": "Les dernières {duration} de ton gameplay sont toujours dans le tampon. Appuie sur {hotkey} pour les garder. Double-appui pour démarrer une session.", + "micOn": "Microphone activé", + "micOff": "Microphone désactivé", + "micOnDetail": "Inclus dans les nouveaux clips", + "micOffDetail": "Retiré des nouveaux clips", + "desktopAudioOn": "Audio du bureau activé", + "desktopAudioOff": "Audio du bureau désactivé", + "publicLinkStarting": "Le lien public démarre", + "publicLinkStopped": "Lien public arrêté", + "publicLinkCopied": "Lien public copié", + "enablePublicLinkFirst": "Active d'abord le lien public", + "savedNotApplied": "Enregistré, mais pas appliqué", + "errMic": "Impossible de modifier le réglage du microphone", + "errDesktopAudio": "Impossible de modifier l'audio du bureau", + "errPublicLink": "Impossible de modifier le lien public", + "errSaveClip": "Impossible d'enregistrer un clip", + "wfMicTitle": "Comment mixer le microphone ?", + "wfMicBody": "wf-recorder n'enregistre qu'une source audio à la fois. Choisis ce qui se passe quand le bureau et le microphone sont tous les deux activés.", + "wfMicBothLabel": "Utiliser un backend qui gère les deux", + "wfMicBothHelp": "Vice enregistre avec un backend compatible dès que le microphone est activé.", + "wfMicOnlyLabel": "Microphone uniquement", + "wfMicOnlyHelp": "L'audio du bureau est coupé tant que le microphone est activé.", + "copyLinkTitle": "Copier ce lien", + "copyLinkBody": "Le presse-papiers n'était pas disponible, voici donc le lien à copier à la main.", + "restartTitle": "Redémarre Vice pour terminer", + "restartBody": "Ce réglage est enregistré, mais il ne prend effet qu'au redémarrage du daemon.", + "gotIt": "Compris" }, "card": { - "unreadable": "Unreadable", - "unreadableNote": "{reason}. The file is still on disk.", - "unreadableFallback": "ffmpeg could not read this file", - "openTitle": "Open {name}", - "renameHint": "{name}, double-click to rename", - "trim": "Trim", - "copyVideo": "Copy video to clipboard", - "copyShareLink": "Copy share link", - "noShareLink": "No share link yet", - "reveal": "Reveal in file manager", - "delete": "Delete", - "open": "Open", - "rename": "Rename", - "copyVideoShort": "Copy video", - "deleteClip": "Delete clip", - "videoCopied": "Video copied, paste it anywhere", - "errCopyVideo": "Could not copy the video", - "renameFailed": "Rename failed", - "savedAs": "Saved as {name}", - "addTo": "Add to {playlist}", - "removeFrom": "Remove from {playlist}", - "addedTo": "Added to {playlist}", - "removedFrom": "Removed from {playlist}", - "playlistUnchanged": "The playlist did not change", - "nameLabel": "Clip name", + "unreadable": "Illisible", + "unreadableNote": "{reason}. Le fichier est toujours sur le disque.", + "unreadableFallback": "ffmpeg n'a pas pu lire ce fichier", + "openTitle": "Ouvrir {name}", + "renameHint": "{name}, double-clic pour renommer", + "trim": "Découper", + "copyVideo": "Copier la vidéo dans le presse-papiers", + "copyShareLink": "Copier le lien de partage", + "noShareLink": "Pas encore de lien de partage", + "reveal": "Afficher dans le gestionnaire de fichiers", + "delete": "Supprimer", + "open": "Ouvrir", + "rename": "Renommer", + "copyVideoShort": "Copier la vidéo", + "deleteClip": "Supprimer le clip", + "videoCopied": "Vidéo copiée, colle-la où tu veux", + "errCopyVideo": "Impossible de copier la vidéo", + "renameFailed": "Échec du renommage", + "savedAs": "Enregistré sous {name}", + "addTo": "Ajouter à {playlist}", + "removeFrom": "Retirer de {playlist}", + "addedTo": "Ajouté à {playlist}", + "removedFrom": "Retiré de {playlist}", + "playlistUnchanged": "La playlist n'a pas changé", + "nameLabel": "Nom du clip", "views": { - "one": "{count} view", - "other": "{count} views" + "one": "{count} vue", + "other": "{count} vues" }, - "noShareLinkYet": "No share link for this clip yet", - "linkCopiedLocal": "Link copied, but it is local only", - "linkCopiedLocalDetail": "Install cloudflared for links that work off your network", - "shareLinkCopied": "Share link copied", - "alreadyIn": "Already in {playlist}", - "errAddClip": "Could not add the clip" + "noShareLinkYet": "Pas encore de lien de partage pour ce clip", + "linkCopiedLocal": "Lien copié, mais il est local uniquement", + "linkCopiedLocalDetail": "Installe cloudflared pour des liens qui fonctionnent hors de ton réseau", + "shareLinkCopied": "Lien de partage copié", + "alreadyIn": "Déjà dans {playlist}", + "errAddClip": "Impossible d'ajouter le clip" }, "playlistModal": { - "editTitle": "Edit playlist", - "newTitle": "New playlist", - "nameRequired": "Give the playlist a name", - "name": "Name", + "editTitle": "Modifier la playlist", + "newTitle": "Nouvelle playlist", + "nameRequired": "Donne un nom à la playlist", + "name": "Nom", "emoji": "Emoji", - "emojiPlaceholder": "Optional", - "colour": "Playlist colour" + "emojiPlaceholder": "Facultatif", + "colour": "Couleur de la playlist" }, "frame": { - "quitConfirm": "Stop Vice and quit? The recording daemon will shut down.", - "minimize": "Minimize", - "quit": "Quit" + "quitConfirm": "Arrêter Vice et quitter ? Le daemon d'enregistrement sera arrêté.", + "minimize": "Réduire", + "quit": "Quitter" }, "banners": { - "notRecording": "Vice is not recording.", - "cpuFallback": "Recording on the CPU.", - "codecFallback": "Recording with a different codec.", - "cannotPlay": "Clips cannot play inside this window.", - "notRecordingHelp": "Vice keeps retrying on its own. If it is an encoder problem, a reboot after a driver update usually clears it, or pick a different encoder under Settings, Recording.", - "cpuFallbackHelp": "Your GPU encoder would not open, so Vice fell back to CPU encoding to keep clipping. That costs frames in games. This is usually a driver that needs a reboot after an update. Vice tries the GPU first every time it starts, so once that is sorted this goes away on its own.", - "codecFallbackHelp": "Your GPU would not encode the codec picked under Settings, Recording, so gpu-screen-recorder chose one it can handle. Recording is still on the GPU and clips are unaffected. Choosing a different encoder yourself stops this notice, and H.264 in particular tops out at 4096 pixels wide on NVIDIA, so HEVC or AV1 is the one to pick on a wide monitor.", - "cannotPlayHelp": "The installed Qt WebEngine build has no H.264 decoder. Recording still works, and clips open fine in your system player. To fix in-app playback, install your distro's WebEngine package and reinstall Vice:" + "notRecording": "Vice n'enregistre pas.", + "cpuFallback": "Enregistrement sur le CPU.", + "codecFallback": "Enregistrement avec un autre codec.", + "cannotPlay": "Les clips ne peuvent pas être lus dans cette fenêtre.", + "notRecordingHelp": "Vice réessaie tout seul. Si c'est un problème d'encodeur, un redémarrage après une mise à jour du pilote suffit généralement, ou choisis un autre encodeur dans Réglages, Enregistrement.", + "cpuFallbackHelp": "Ton encodeur GPU n'a pas voulu s'ouvrir, donc Vice est passé à l'encodage CPU pour continuer à faire des clips. Cela coûte des images par seconde en jeu. C'est généralement un pilote qui a besoin d'un redémarrage après une mise à jour. Vice essaie d'abord le GPU à chaque démarrage, donc une fois le problème réglé, ce message disparaît tout seul.", + "codecFallbackHelp": "Ton GPU n'a pas voulu encoder le codec choisi dans Réglages, Enregistrement, donc gpu-screen-recorder en a choisi un qu'il sait gérer. L'enregistrement reste sur le GPU et les clips ne sont pas affectés. Choisir toi-même un autre encodeur fait disparaître cet avis. Le H.264 en particulier plafonne à 4096 pixels de large sur NVIDIA, donc HEVC ou AV1 est le bon choix sur un moniteur large.", + "cannotPlayHelp": "La version installée de Qt WebEngine n'a pas de décodeur H.264. L'enregistrement fonctionne toujours, et les clips s'ouvrent normalement dans ton lecteur système. Pour réparer la lecture dans l'application, installe le paquet WebEngine de ta distribution puis réinstalle Vice :" }, "island": { - "cannotReach": "Cannot reach the daemon", - "notRecording": "Not recording", - "keepsRetrying": "Vice keeps retrying", - "sessionRecording": "Session recording", - "bufferRunning": "Buffer running", - "starting": "Starting" + "cannotReach": "Impossible de joindre le daemon", + "notRecording": "N'enregistre pas", + "keepsRetrying": "Vice réessaie", + "sessionRecording": "Session en cours", + "bufferRunning": "Tampon actif", + "starting": "Démarrage" }, "update": { - "releaseNotes": "Release notes", - "copyCommand": "Copy command", - "commandCopied": "Command copied, paste it into a terminal", - "copyByHand": "The clipboard was not available, so here is the command to copy by hand.", - "later": "Later", - "title": "Vice {version} is available", - "youAreOn": "You are on {version}.", - "olderRelease": "an older release", - "updateWith": " Update with:", - "copyTitle": "Copy this command" + "releaseNotes": "Notes de version", + "copyCommand": "Copier la commande", + "commandCopied": "Commande copiée, colle-la dans un terminal", + "copyByHand": "Le presse-papiers n'était pas disponible, voici donc la commande à copier à la main.", + "later": "Plus tard", + "title": "Vice {version} est disponible", + "youAreOn": "Tu utilises la version {version}.", + "olderRelease": "une version plus ancienne", + "updateWith": " Mets à jour avec :", + "copyTitle": "Copier cette commande" }, "audioTracks": { - "addTrack": "Add track", - "none": "No separate tracks. Everything is mixed into one, which is what most people want.", - "mixOfAll": "Mix of all tracks", - "trackLabel": "Track {n}", - "sourceToAdd": "Audio source to add as a track", - "refresh": "Refresh the source list", - "moveEarlier": "Move earlier", - "moveLater": "Move later", - "removeTrack": "Remove this track", - "moveEarlierAria": "Move {name} earlier", - "moveLaterAria": "Move {name} later", - "removeAria": "Remove {name}", + "addTrack": "Ajouter une piste", + "none": "Aucune piste séparée. Tout est mixé en une seule, ce que la plupart des gens veulent.", + "mixOfAll": "Mix de toutes les pistes", + "trackLabel": "Piste {n}", + "sourceToAdd": "Source audio à ajouter comme piste", + "refresh": "Actualiser la liste des sources", + "moveEarlier": "Monter", + "moveLater": "Descendre", + "removeTrack": "Supprimer cette piste", + "moveEarlierAria": "Monter {name}", + "moveLaterAria": "Descendre {name}", + "removeAria": "Supprimer {name}", "droppedWarning": { - "one": "Capture desktop audio is off, so this track will not be recorded: {list}.", - "other": "Capture desktop audio is off, so these tracks will not be recorded: {list}." + "one": "La capture de l'audio du bureau est désactivée, donc cette piste ne sera pas enregistrée : {list}.", + "other": "La capture de l'audio du bureau est désactivée, donc ces pistes ne seront pas enregistrées : {list}." }, "trimmedWarning": { - "one": "{count} more will keep only its microphone sources.", - "other": "{count} more will keep only their microphone sources." + "one": "{count} autre ne conservera que ses sources microphone.", + "other": "{count} autres ne conserveront que leurs sources microphone." }, - "turnBackOn": "Turn desktop audio back on above to keep them." + "turnBackOn": "Réactive l'audio du bureau ci-dessus pour les conserver." }, "keyCapture": { - "pressKey": "Press a key", - "setKey": "Set key" + "pressKey": "Appuie sur une touche", + "setKey": "Définir la touche" }, "nav": { - "allClips": "All Clips", + "allClips": "Tous les clips", "images": "Images", - "home": "Home", - "editor": "Editor", - "settings": "Settings", - "about": "About", + "home": "Accueil", + "editor": "Éditeur", + "settings": "Réglages", + "about": "À propos", "playlists": "Playlists", - "newPlaylist": "New playlist", - "search": "Search clips", - "dragToStart": "Drag a clip here to start one.", - "quickStart": "Quick start", - "buffer": "Buffer", - "update": "Update", - "open": "Open", - "useEmoji": "Use {emoji}", - "errSetEmoji": "Could not set the emoji", - "main": "Main" + "newPlaylist": "Nouvelle playlist", + "search": "Rechercher des clips", + "dragToStart": "Glisse un clip ici pour en créer une.", + "quickStart": "Démarrage rapide", + "buffer": "Tampon", + "update": "Mise à jour", + "open": "Ouvrir", + "useEmoji": "Utiliser {emoji}", + "errSetEmoji": "Impossible de définir l'emoji", + "main": "Principal" }, "viewer": { - "errReveal": "Could not open the file manager", - "errSystemPlayer": "Could not open the system player", - "clipDeleted": "Clip deleted", - "errDelete": "Could not delete the clip", - "confirmDeleteTitle": "Delete this clip?", - "confirmDeleteBody": "{name} will be removed from disk. This cannot be undone.", - "copyLinkTitle": "Copy this link", - "copyLinkBody": "The clipboard was not available, so here is the link to copy by hand.", - "highlight": "Highlight", + "errReveal": "Impossible d'ouvrir le gestionnaire de fichiers", + "errSystemPlayer": "Impossible d'ouvrir le lecteur système", + "clipDeleted": "Clip supprimé", + "errDelete": "Impossible de supprimer le clip", + "confirmDeleteTitle": "Supprimer ce clip ?", + "confirmDeleteBody": "{name} sera supprimé du disque. Cette action est irréversible.", + "copyLinkTitle": "Copier ce lien", + "copyLinkBody": "Le presse-papiers n'était pas disponible, voici donc le lien à copier à la main.", + "highlight": "Moment fort", "highlightNumbered": "{base} {n}", - "errAddHighlight": "Could not add the highlight", - "errMoveHighlight": "Could not move the highlight", - "errUpdateHighlight": "Could not update the highlight", - "errDeleteHighlight": "Could not delete the highlight", - "daemonNoMark": "The daemon did not return the mark", - "daemonRejectedMove": "The daemon rejected the move", - "daemonRejectedChange": "The daemon rejected the change", - "play": "Play", + "errAddHighlight": "Impossible d'ajouter le moment fort", + "errMoveHighlight": "Impossible de déplacer le moment fort", + "errUpdateHighlight": "Impossible de modifier le moment fort", + "errDeleteHighlight": "Impossible de supprimer le moment fort", + "daemonNoMark": "Le daemon n'a pas renvoyé le repère", + "daemonRejectedMove": "Le daemon a refusé le déplacement", + "daemonRejectedChange": "Le daemon a refusé la modification", + "play": "Lecture", "pause": "Pause", - "preparingPreview": "Preparing the H.265 preview", - "openInPlayer": "Open in system player", - "showInFolder": "Show in folder", - "addHighlight": "Add highlight", - "noHighlights": "No highlights yet. Press", - "addHighlightKey": "Add highlight {key}", - "noHighlightsHelp": "No highlights yet. Press {key} to mark the current timestamp.", - "prevClip": "Previous clip", - "nextClip": "Next clip", - "changeColour": "Change colour", - "changeColourAria": "Change the colour of {name}", - "doubleClickRename": "Double-click to rename", - "removeHighlight": "Remove", - "removeHighlightAria": "Remove {name}", - "copyShareLink": "Copy share link", - "closePlayer": "Close the player", + "preparingPreview": "Préparation de l'aperçu H.265", + "openInPlayer": "Ouvrir dans le lecteur système", + "showInFolder": "Afficher dans le dossier", + "addHighlight": "Ajouter un moment fort", + "noHighlights": "Aucun moment fort pour l'instant. Appuie sur", + "addHighlightKey": "Ajouter un moment fort {key}", + "noHighlightsHelp": "Aucun moment fort pour l'instant. Appuie sur {key} pour marquer l'instant actuel.", + "prevClip": "Clip précédent", + "nextClip": "Clip suivant", + "changeColour": "Changer la couleur", + "changeColourAria": "Changer la couleur de {name}", + "doubleClickRename": "Double-clic pour renommer", + "removeHighlight": "Retirer", + "removeHighlightAria": "Retirer {name}", + "copyShareLink": "Copier le lien de partage", + "closePlayer": "Fermer le lecteur", "volume": "Volume", - "mute": "Mute", - "unmute": "Unmute", - "highlightLabel": "Highlight label", - "highlightAt": "{label} at {time}", - "useColour": "Use {color}", - "highlightsHeading": "Highlights", - "trim": "Trim", - "share": "Share", - "reveal": "Reveal", - "delete": "Delete", - "shortcuts": "Left and right step clips · H marks a highlight · Esc closes", - "playbackFailed": "Vice could not play this clip in the app window. The file itself is most likely fine.", - "noH264Decoder": "This Qt WebEngine build has no H.264 decoder, so clips cannot play inside Vice. The file itself is fine.", - "saveFrame": "Save this frame", - "saveFrameHint": "Save the current frame as a screenshot (S)", - "frameSaved": "Frame saved and copied", - "frameSavedNotCopied": "Frame saved, but not copied", - "errSaveFrame": "Could not save the frame", - "muteHint": "Mute (M)", - "unmuteHint": "Unmute (M)", - "expand": "Fill the window", - "shrink": "Back to normal size", - "expandHint": "Fill the window (F, or double-click)", - "shrinkHint": "Back to normal size (F, or Esc)" + "mute": "Couper le son", + "unmute": "Rétablir le son", + "highlightLabel": "Nom du moment fort", + "highlightAt": "{label} à {time}", + "useColour": "Utiliser {color}", + "highlightsHeading": "Moments forts", + "trim": "Découper", + "share": "Partager", + "reveal": "Afficher", + "delete": "Supprimer", + "shortcuts": "Gauche et droite : clip précédent ou suivant · H marque un moment fort · Échap ferme", + "playbackFailed": "Vice n'a pas pu lire ce clip dans la fenêtre de l'application. Le fichier lui-même est très probablement intact.", + "noH264Decoder": "Cette version de Qt WebEngine n'a pas de décodeur H.264, donc les clips ne peuvent pas être lus dans Vice. Le fichier lui-même est intact.", + "saveFrame": "Enregistrer cette image", + "saveFrameHint": "Enregistrer l'image actuelle comme capture d'écran (S)", + "frameSaved": "Image enregistrée et copiée", + "frameSavedNotCopied": "Image enregistrée, mais pas copiée", + "errSaveFrame": "Impossible d'enregistrer l'image", + "muteHint": "Couper le son (M)", + "unmuteHint": "Rétablir le son (M)", + "expand": "Remplir la fenêtre", + "shrink": "Revenir à la taille normale", + "expandHint": "Remplir la fenêtre (F, ou double-clic)", + "shrinkHint": "Revenir à la taille normale (F, ou Échap)" }, "trim": { - "saved": "Clip trimmed and saved", - "failed": "The trim failed", - "errTrim": "Could not trim the clip", - "preview": "Preview", - "stop": "Stop", - "loopHelp": "Loops the selection. Cut bounds are lossless.", - "saving": "Saving", - "saveTrim": "Save trim", - "preparingPreview": "Preparing the H.265 preview", - "openInPlayer": "Open in system player", - "showInFolder": "Show in folder", - "title": "Trim · {name}", - "in": "In", - "out": "Out", - "duration": "Duration", - "startOfSelection": "Start of the selection", - "endOfSelection": "End of the selection", - "trimAria": "Trim {name}", - "heading": "Trim" + "saved": "Clip découpé et enregistré", + "failed": "Le découpage a échoué", + "errTrim": "Impossible de découper le clip", + "preview": "Aperçu", + "stop": "Arrêter", + "loopHelp": "Lit la sélection en boucle. Les bornes de coupe sont sans perte.", + "saving": "Enregistrement", + "saveTrim": "Enregistrer la découpe", + "preparingPreview": "Préparation de l'aperçu H.265", + "openInPlayer": "Ouvrir dans le lecteur système", + "showInFolder": "Afficher dans le dossier", + "title": "Découper · {name}", + "in": "Début", + "out": "Fin", + "duration": "Durée", + "startOfSelection": "Début de la sélection", + "endOfSelection": "Fin de la sélection", + "trimAria": "Découper {name}", + "heading": "Découper" }, "images": { "heading": "Images", "countImages": { - "one": "{count} screenshot", - "other": "{count} screenshots" + "one": "{count} capture d'écran", + "other": "{count} captures d'écran" }, "countMatches": { - "one": "{count} match for “{query}”", - "other": "{count} matches for “{query}”" + "one": "{count} résultat pour « {query} »", + "other": "{count} résultats pour « {query} »" }, - "emptySearch": "Nothing matches “{query}”.", - "emptyLibrary": "No screenshots yet. Press {hotkey} to save what is on screen.", - "emptyNoKey": "No screenshots yet. Set a screenshot key in Settings, or open a clip and save a frame from it.", - "captureMoment": "Keep a moment", - "roomForMore": "Room for your next moment", - "captureHint": "Press {hotkey} to save a screenshot.", - "captureNoKey": "Set a screenshot key in Settings, or save a frame from a clip.", - "openTitle": "Open {name}", - "open": "Open", - "openExternally": "Open in image viewer", - "copy": "Copy image", - "copied": "Image copied", - "errCopy": "Could not copy the image", - "errOpen": "Could not open the image", - "deleteImage": "Delete screenshot", - "deleted": "Screenshot deleted", - "errDelete": "Could not delete the screenshot", - "confirmDeleteTitle": "Delete this screenshot?", - "confirmDeleteBody": "{name} will be moved to the trash. This cannot be undone from here.", - "pen": "Pen", - "penOn": "Pen on", - "penColour": "Pen colour", - "undo": "Undo", - "saveDrawing": "Save drawing", - "saving": "Saving", - "saved": "Drawing saved", - "errSave": "Could not save the drawing", - "errCanvas": "This window could not render the image", - "prev": "Previous image", - "next": "Next image", - "shortcuts": "Arrows step, F fills the window, Ctrl+Z undoes, Esc closes" + "emptySearch": "Aucun résultat pour « {query} ».", + "emptyLibrary": "Aucune capture d'écran pour l'instant. Appuie sur {hotkey} pour enregistrer ce qui est à l'écran.", + "emptyNoKey": "Aucune capture d'écran pour l'instant. Définis une touche de capture dans Réglages, ou ouvre un clip et enregistres-en une image.", + "captureMoment": "Garder un instant", + "roomForMore": "De la place pour ton prochain instant", + "captureHint": "Appuie sur {hotkey} pour enregistrer une capture d'écran.", + "captureNoKey": "Définis une touche de capture dans Réglages, ou enregistre une image depuis un clip.", + "openTitle": "Ouvrir {name}", + "open": "Ouvrir", + "openExternally": "Ouvrir dans la visionneuse d'images", + "copy": "Copier l'image", + "copied": "Image copiée", + "errCopy": "Impossible de copier l'image", + "errOpen": "Impossible d'ouvrir l'image", + "deleteImage": "Supprimer la capture d'écran", + "deleted": "Capture d'écran supprimée", + "errDelete": "Impossible de supprimer la capture d'écran", + "confirmDeleteTitle": "Supprimer cette capture d'écran ?", + "confirmDeleteBody": "{name} sera déplacé vers la corbeille. Impossible d'annuler depuis ici.", + "pen": "Stylo", + "penOn": "Stylo activé", + "penColour": "Couleur du stylo", + "undo": "Annuler", + "saveDrawing": "Enregistrer le dessin", + "saving": "Enregistrement", + "saved": "Dessin enregistré", + "errSave": "Impossible d'enregistrer le dessin", + "errCanvas": "Cette fenêtre n'a pas pu afficher l'image", + "prev": "Image précédente", + "next": "Image suivante", + "shortcuts": "Les flèches naviguent, F remplit la fenêtre, Ctrl+Z annule, Échap ferme" }, "tutorial": { - "pickColour": "Pick a colour", - "startClipping": "Start clipping, then let Vice run", - "playlistsTitle": "Playlists sort the reel", - "colourBody": "Vice takes its colour from one of these. The whole window changes as you pick, so choose the one you want to look at, and change it any time in Settings.", - "quickStartBody": "Vice keeps the buffer live in the background and opens this window only when you need it.", - "playlistsBody": "Every clip can live in any number of playlists, and they keep themselves in order.", - "saveLast": "Save the last {duration}s", - "saveLastHelp": "Press {hotkey} after something worth keeping.", - "sessionTitle": "Double-tap {hotkey} for a session", - "sessionHelp": "Double-tap to start or stop a full recording. Tap once during a session to mark a highlight.", - "reviewTitle": "Review, trim and share", - "reviewHelp": "Open any clip to rename it, trim the best moment, share a link, or press H to add highlights.", - "backgroundTitle": "Close the window safely", - "backgroundHelp": "Minimize or close this window and Vice keeps recording. Discord Rich Presence is on by default and lives in Settings.", - "autoTitle": "Auto playlists", - "autoHelp": "Clips are filed under the game you were playing when you saved them. Vice builds these on its own.", - "customTitle": "Custom playlists", - "customHelp": "Create your own from the sidebar, pick an emoji and a colour, then drag clips onto it or right-click a clip to add it.", - "safeTitle": "Nothing goes stale", - "safeHelp": "Playlists follow clips through renames and trims, and tidy up after deletions.", - "next": "Next", - "back": "Back", - "gotIt": "Got it", + "pickColour": "Choisis une couleur", + "startClipping": "Lance-toi dans le clipping, puis laisse Vice tourner", + "playlistsTitle": "Les playlists rangent ta collection", + "colourBody": "Vice prend sa couleur dans l'une de celles-ci. Toute la fenêtre change au fur et à mesure, alors choisis celle que tu as envie de regarder, et change-la quand tu veux dans Réglages.", + "quickStartBody": "Vice garde le tampon actif en arrière-plan et n'ouvre cette fenêtre que quand tu en as besoin.", + "playlistsBody": "Chaque clip peut se trouver dans autant de playlists que tu veux, et elles se tiennent à jour toutes seules.", + "saveLast": "Sauvegarde les {duration} dernières secondes", + "saveLastHelp": "Appuie sur {hotkey} après un moment qui vaut la peine d'être gardé.", + "sessionTitle": "Double-appui sur {hotkey} pour une session", + "sessionHelp": "Double-appui pour démarrer ou arrêter un enregistrement complet. Appuie une fois pendant une session pour marquer un moment fort.", + "reviewTitle": "Revoir, découper et partager", + "reviewHelp": "Ouvre n'importe quel clip pour le renommer, découper le meilleur moment, partager un lien, ou appuie sur H pour ajouter des moments forts.", + "backgroundTitle": "Ferme la fenêtre en toute sécurité", + "backgroundHelp": "Réduis ou ferme cette fenêtre et Vice continue d'enregistrer. Discord Rich Presence est activé par défaut et se règle dans Réglages.", + "autoTitle": "Playlists automatiques", + "autoHelp": "Les clips sont rangés selon le jeu auquel tu jouais quand tu les as enregistrés. Vice les crée tout seul.", + "customTitle": "Playlists personnalisées", + "customHelp": "Crée les tiennes depuis la barre latérale, choisis un emoji et une couleur, puis glisse des clips dessus ou fais un clic droit sur un clip pour l'y ajouter.", + "safeTitle": "Rien n'est jamais périmé", + "safeHelp": "Les playlists suivent les clips à travers les renommages et les découpes, et se nettoient après les suppressions.", + "next": "Suivant", + "back": "Retour", + "gotIt": "Compris", "badgeClip": "Clip", - "badgeBg": "BG", + "badgeBg": "Fond", "badgeAuto": "Auto", - "badgeNew": "New", - "badgeSafe": "Safe", - "accentLabel": "{name} accent", - "bufferTitle": "How far back Vice can reach", - "bufferBody": "Vice is always recording into a buffer it throws away. Pressing the clip key keeps the last stretch of it, and this is how long that stretch is.", - "bufferLabel": "Instant replay length", - "bufferNote": "The buffer holds {buffer} at a time. A longer one costs memory, and Settings has the whole picture, including writing it to disk instead.", - "clipKeyLabel": "Clip key", - "screenshotKeyLabel": "Screenshot key", - "screenshotKeyNote": "The screenshot key is unset until you set one. It saves a picture of the screen to the Images section and puts it on your clipboard.", - "errSave": "Could not save that", - "editorTitle": "The Editor", - "editorHelp": "Put several clips on a timeline, cut them together, add text and transitions, and export one video. It is in the sidebar.", - "badgeEdit": "Edit", - "shareTitle": "Sending a clip to someone", - "shareBody": "Every clip has a link, and copying it is one button on the card.", - "linkTitle": "Copy link", - "linkHelp": "The link button on a clip copies an address that plays the clip in a browser. Paste it into Discord and it embeds.", - "tunnelTitle": "Local, or reachable from anywhere", - "tunnelHelp": "On its own the link only works on this machine. Turn on the Cloudflare tunnel in Settings and it works anywhere, until the daemon restarts and the address changes.", - "badgeLink": "Link", + "badgeNew": "Nouveau", + "badgeSafe": "Sûr", + "accentLabel": "Accent {name}", + "bufferTitle": "Jusqu'où Vice peut remonter", + "bufferBody": "Vice enregistre en permanence dans un tampon qu'il jette au fur et à mesure. Appuyer sur la touche de clip en conserve la dernière portion, et c'est ici que tu règles sa durée.", + "bufferLabel": "Durée du replay instantané", + "bufferNote": "Le tampon contient {buffer} à la fois. Un tampon plus long consomme de la mémoire, et Réglages donne tout le détail, y compris l'écriture sur le disque à la place.", + "clipKeyLabel": "Touche de clip", + "screenshotKeyLabel": "Touche de capture d'écran", + "screenshotKeyNote": "La touche de capture d'écran n'est pas définie tant que tu n'en choisis pas une. Elle enregistre une image de l'écran dans la section Images et la place dans ton presse-papiers.", + "errSave": "Impossible d'enregistrer cela", + "editorTitle": "L'éditeur", + "editorHelp": "Place plusieurs clips sur une timeline, monte-les ensemble, ajoute du texte et des transitions, puis exporte une seule vidéo. Il se trouve dans la barre latérale.", + "badgeEdit": "Montage", + "shareTitle": "Envoyer un clip à quelqu'un", + "shareBody": "Chaque clip a un lien, et le copier tient en un seul bouton sur la carte.", + "linkTitle": "Copier le lien", + "linkHelp": "Le bouton de lien sur un clip copie une adresse qui lit le clip dans un navigateur. Colle-la dans Discord et elle s'intègre.", + "tunnelTitle": "En local, ou accessible de partout", + "tunnelHelp": "Tout seul, le lien ne fonctionne que sur cette machine. Active le tunnel Cloudflare dans Réglages et il fonctionne partout, jusqu'à ce que le daemon redémarre et que l'adresse change.", + "badgeLink": "Lien", "badgeTunnel": "Net", - "moreTitle": "The rest lives in Settings", - "moreBody": "That is everything you need. Settings has the parts you only touch once.", - "recTitle": "Recording", - "recHelp": "Encoder, resolution, frame rate, which monitor, and which audio goes on which track.", - "badgeRec": "Rec" + "moreTitle": "Le reste se trouve dans Réglages", + "moreBody": "C'est tout ce dont tu as besoin. Réglages contient les options que tu ne touches qu'une fois.", + "recTitle": "Enregistrement", + "recHelp": "Encodeur, résolution, fréquence d'images, quel moniteur, et quel audio va sur quelle piste.", + "badgeRec": "Enr." }, "accents": { - "blue": "Blue", - "purple": "Purple", - "green": "Green", - "red": "Red", + "blue": "Bleu", + "purple": "Violet", + "green": "Vert", + "red": "Rouge", "orange": "Orange", - "customTitle": "Custom colour", - "customBody": "Pick any colour and Vice builds a full Material 3 scheme from it. Only the hue carries over: the surfaces, the buttons and the text tones are worked out from it, the same way the five presets are.", - "useThis": "Use this colour", - "hue": "Hue", - "saturation": "Saturation and brightness", - "hexLabel": "Hex value", + "customTitle": "Couleur personnalisée", + "customBody": "Choisis n'importe quelle couleur et Vice construit un schéma Material 3 complet à partir de celle-ci. Seule la teinte est conservée : les surfaces, les boutons et les tons du texte en sont déduits, de la même façon que pour les cinq préréglages.", + "useThis": "Utiliser cette couleur", + "hue": "Teinte", + "saturation": "Saturation et luminosité", + "hexLabel": "Valeur hexadécimale", "previewTitle": "Vice_Clip_12", - "previewMeta": "20s · 1920x1080 · 14.2 MB", - "previewPrimary": "Save clip", - "previewQuiet": "Trim", + "previewMeta": "20 s · 1920x1080 · 14,2 Mo", + "previewPrimary": "Enregistrer un clip", + "previewQuiet": "Découper", "previewChip": "Deadlock", - "lowContrast": "This colour does not leave enough contrast to read comfortably. Vice has lightened the accent as far as it can; try something less dark." + "lowContrast": "Cette couleur ne laisse pas assez de contraste pour lire confortablement. Vice a éclairci l'accent autant que possible ; essaie quelque chose de moins sombre." }, "events": { - "clipSaved": "Clip saved", - "savingClip": "Saving clip", - "errSaveClip": "Could not save the clip", - "recorderSilent": "The recorder did not say why", - "publicLinkReady": "Public link ready", - "noPublicLink": "No public link", - "tunnelUnavailable": "The share tunnel is unavailable", - "sessionRecording": "Session recording", - "doubleTapToStop": "Double-tap the clip key to stop", - "sessionSaved": "Session saved", - "highlightMarked": "Highlight marked", - "cannotPlay": "Clips cannot play in this window", - "noH264": "This Qt WebEngine build has no H.264 decoder", - "notSaved": "The change was not saved", - "imageSaved": "Screenshot saved", - "errScreenshot": "Could not take the screenshot", - "screenshotNotCopied": "Screenshot saved, but not copied", - "updating": "Vice is updating to {version}", - "updatingDetail": "The recorder restarts to pick up the new version. This window reconnects on its own." + "clipSaved": "Clip enregistré", + "savingClip": "Enregistrement du clip", + "errSaveClip": "Impossible d'enregistrer le clip", + "recorderSilent": "L'enregistreur n'a pas dit pourquoi", + "publicLinkReady": "Lien public prêt", + "noPublicLink": "Pas de lien public", + "tunnelUnavailable": "Le tunnel de partage est indisponible", + "sessionRecording": "Session en cours", + "doubleTapToStop": "Double-appui sur la touche de clip pour arrêter", + "sessionSaved": "Session enregistrée", + "highlightMarked": "Moment fort marqué", + "cannotPlay": "Les clips ne peuvent pas être lus dans cette fenêtre", + "noH264": "Cette version de Qt WebEngine n'a pas de décodeur H.264", + "notSaved": "La modification n'a pas été enregistrée", + "imageSaved": "Capture d'écran enregistrée", + "errScreenshot": "Impossible de faire la capture d'écran", + "screenshotNotCopied": "Capture d'écran enregistrée, mais pas copiée", + "updating": "Vice passe à la version {version}", + "updatingDetail": "L'enregistreur redémarre pour prendre en compte la nouvelle version. Cette fenêtre se reconnecte toute seule." }, "about": { - "title": "About", - "subtitle": "Vice, the game clip recorder for Linux", - "tagline": "Linux-first, open source game clipping.", - "waylandAndX11": "Wayland and X11", - "system": "System", + "title": "À propos", + "subtitle": "Vice, l'enregistreur de clips de jeu pour Linux", + "tagline": "Du clipping de jeu open source, pensé d'abord pour Linux.", + "waylandAndX11": "Wayland et X11", + "system": "Système", "version": "Version", "backend": "Backend", - "buffer": "Buffer", - "frameRate": "Frame rate", - "clipsOnDisk": "Clips on disk", - "totalFootage": "Total footage", - "credits": "Credits", - "creator": "Creator and maintainer", - "community": "Community contributors", - "communityHelp": "Bug reports, translations, patches", - "dangerZone": "Danger zone", - "uninstallHelp": "Uninstalling removes Vice, its systemd units and the udev rules. Your clips stay where they are.", - "copy": "Copy", - "commandCopied": "Command copied, paste it into a terminal", - "copyTitle": "Copy this command", - "copyByHand": "The clipboard was not available, so here is the command to copy by hand." + "buffer": "Tampon", + "frameRate": "Fréquence d'images", + "clipsOnDisk": "Clips sur le disque", + "totalFootage": "Durée totale", + "credits": "Crédits", + "creator": "Créateur et mainteneur", + "community": "Contributeurs de la communauté", + "communityHelp": "Rapports de bugs, traductions, correctifs", + "dangerZone": "Zone dangereuse", + "uninstallHelp": "La désinstallation supprime Vice, ses unités systemd et les règles udev. Tes clips restent là où ils sont.", + "copy": "Copier", + "commandCopied": "Commande copiée, colle-la dans un terminal", + "copyTitle": "Copier cette commande", + "copyByHand": "Le presse-papiers n'était pas disponible, voici donc la commande à copier à la main." }, "editor": { - "nothingAtPlayhead": "Nothing at the playhead", - "dragFromLibrary": "Drag a clip from the library onto the timeline below.", - "preparingPreview": "Preparing the H.265 preview", - "removeTitle": "Remove title", - "play": "Play", + "nothingAtPlayhead": "Rien sous la tête de lecture", + "dragFromLibrary": "Glisse un clip de la bibliothèque sur la timeline ci-dessous.", + "preparingPreview": "Préparation de l'aperçu H.265", + "removeTitle": "Supprimer le titre", + "play": "Lecture", "pause": "Pause", - "detachAudio": "Detach audio", - "clearTitle": "Clear the timeline?", - "clearBody": "Every clip, title and transition on the timeline goes. Your clips stay on disk.", - "exportCanceled": "Export canceled", - "exportFailed": "Export failed", - "pickFolder": "Pick a folder for the export", - "exportRefused": "The export was refused", - "errStartExport": "Could not start the export", - "startExport": "Start export", - "cancelExport": "Cancel export", - "saveAs": "Save as", - "viceLibrary": "Vice library (default)", - "customPath": "Custom path", - "alsoAddToLibrary": "Also add to the Vice library", - "encoding": "Encoding H.264. You can leave this open or carry on elsewhere in Vice.", - "videoTrack": "Video track", - "audioTrack": "Audio track", - "tabLibrary": "Library", - "tabEffects": "Effects", - "tabText": "Text", - "searchClips": "Search clips", - "libHintLibrary": "Drag a clip onto the timeline, or double-click to append", - "libHintEffects": "Drag an effect onto a clip, or between two clips", - "libHintText": "Drag a title onto the preview or the T1 lane", - "titleSection": "Title", - "closeInspector": "Close the inspector", - "titleText": "Title text", - "font": "Font", - "size": "Size", - "colour": "Colour", - "titleSize": "Title size", - "useColour": "Use {color}", - "reset": "Reset", - "backToStart": "Back to the start", - "playPause": "Play or pause, space", - "exportBtn": "Export", - "split": "Split", - "duplicate": "Duplicate", - "fit": "Fit", - "zoomOut": "Zoom out", - "zoomIn": "Zoom in", - "addTrack": "Track", - "clear": "Clear", - "exportVideo": "Export video", - "done": "Done", - "exportFilename": "Export filename", - "exportFilenamePlaceholder": "Vice_Edit_1 (automatic if empty)", - "location": "Location", - "exportLocation": "Export location", - "folder": "Folder", - "exportFolder": "Export folder", - "audioDetached": "Audio detached", - "transShorter": "Shorter", - "transLonger": "Longer", - "transRemove": "Remove transition", - "junctionTitle": "{name} · {len}s, click to edit", - "trackOptionsHint": "Right-click for track options", - "libClipHint": "Drag to the timeline, or double-click to append", - "libNoMatch": "No clips match", - "libNoMatchBody": "Try a different search.", - "libEmpty": "No clips yet", - "libEmptyBody": "Save some gameplay first.", - "noReadableDuration": "That clip has no readable duration yet", - "menuSplit": "Split at playhead", - "menuDetach": "Detach audio", - "menuCopy": "Copy", - "menuPaste": "Paste", - "menuDuplicate": "Duplicate", - "menuDelete": "Delete", - "menuAddVideoTrack": "Add video track", - "menuAddAudioTrack": "Add audio track", - "menuRemoveTrack": "Remove track {name}", + "detachAudio": "Détacher l'audio", + "clearTitle": "Vider la timeline ?", + "clearBody": "Chaque clip, titre et transition de la timeline disparaît. Tes clips restent sur le disque.", + "exportCanceled": "Export annulé", + "exportFailed": "Échec de l'export", + "pickFolder": "Choisis un dossier pour l'export", + "exportRefused": "L'export a été refusé", + "errStartExport": "Impossible de lancer l'export", + "startExport": "Lancer l'export", + "cancelExport": "Annuler l'export", + "saveAs": "Enregistrer sous", + "viceLibrary": "Bibliothèque Vice (par défaut)", + "customPath": "Chemin personnalisé", + "alsoAddToLibrary": "Ajouter aussi à la bibliothèque Vice", + "encoding": "Encodage en H.264. Tu peux laisser cette fenêtre ouverte ou continuer ailleurs dans Vice.", + "videoTrack": "Piste vidéo", + "audioTrack": "Piste audio", + "tabLibrary": "Bibliothèque", + "tabEffects": "Effets", + "tabText": "Texte", + "searchClips": "Rechercher des clips", + "libHintLibrary": "Glisse un clip sur la timeline, ou double-clique pour l'ajouter à la fin", + "libHintEffects": "Glisse un effet sur un clip, ou entre deux clips", + "libHintText": "Glisse un titre sur l'aperçu ou sur la piste T1", + "titleSection": "Titre", + "closeInspector": "Fermer l'inspecteur", + "titleText": "Texte du titre", + "font": "Police", + "size": "Taille", + "colour": "Couleur", + "titleSize": "Taille du titre", + "useColour": "Utiliser {color}", + "reset": "Réinitialiser", + "backToStart": "Retour au début", + "playPause": "Lecture ou pause, espace", + "exportBtn": "Exporter", + "split": "Scinder", + "duplicate": "Dupliquer", + "fit": "Ajuster", + "zoomOut": "Zoom arrière", + "zoomIn": "Zoom avant", + "addTrack": "Piste", + "clear": "Vider", + "exportVideo": "Exporter la vidéo", + "done": "Terminé", + "exportFilename": "Nom du fichier exporté", + "exportFilenamePlaceholder": "Vice_Edit_1 (automatique si vide)", + "location": "Emplacement", + "exportLocation": "Emplacement de l'export", + "folder": "Dossier", + "exportFolder": "Dossier d'export", + "audioDetached": "Audio détaché", + "transShorter": "Plus court", + "transLonger": "Plus long", + "transRemove": "Supprimer la transition", + "junctionTitle": "{name} · {len} s, clique pour modifier", + "trackOptionsHint": "Clic droit pour les options de la piste", + "libClipHint": "Glisse sur la timeline, ou double-clique pour l'ajouter à la fin", + "libNoMatch": "Aucun clip ne correspond", + "libNoMatchBody": "Essaie une autre recherche.", + "libEmpty": "Aucun clip pour l'instant", + "libEmptyBody": "Enregistre d'abord du gameplay.", + "noReadableDuration": "Ce clip n'a pas encore de durée lisible", + "menuSplit": "Scinder à la tête de lecture", + "menuDetach": "Détacher l'audio", + "menuCopy": "Copier", + "menuPaste": "Coller", + "menuDuplicate": "Dupliquer", + "menuDelete": "Supprimer", + "menuAddVideoTrack": "Ajouter une piste vidéo", + "menuAddAudioTrack": "Ajouter une piste audio", + "menuRemoveTrack": "Supprimer la piste {name}", "fx": { "crossfade": { - "name": "Crossfade", - "desc": "Blend outgoing into incoming" + "name": "Fondu enchaîné", + "desc": "Fond la sortie dans l'entrée" }, "fadeblack": { - "name": "Fade to black", - "desc": "Dip through pure black" + "name": "Fondu au noir", + "desc": "Passe par le noir complet" }, "fadewhite": { - "name": "Fade to white", - "desc": "Bloom through white" + "name": "Fondu au blanc", + "desc": "Éclosion à travers le blanc" }, "dipaccent": { - "name": "Dip to accent", - "desc": "Flash the theme colour" + "name": "Passage par l'accent", + "desc": "Flash de la couleur du thème" }, "blurdis": { - "name": "Blur dissolve", - "desc": "Defocus across the cut" + "name": "Fondu flou", + "desc": "Défocalise à travers la coupe" }, "slide": { - "name": "Slide", - "desc": "Incoming pushes in from the right" + "name": "Glissement", + "desc": "Le clip entrant arrive par la droite" } }, "textPreset": { "title": { - "name": "Title", - "sample": "Match point" + "name": "Titre", + "sample": "Balle de match" }, "subtitle": { - "name": "Subtitle", - "sample": "Ranked grind" + "name": "Sous-titre", + "sample": "Grind classé" }, "caption": { - "name": "Caption", - "sample": "1920x1080 · 60 fps" + "name": "Légende", + "sample": "1920x1080 · 60 i/s" }, "lower": { - "name": "Lower third", - "sample": "Player · support" + "name": "Bandeau inférieur", + "sample": "Joueur · support" } }, - "exported": "Exported.", - "encodingProgress": "{percent}% encoding", - "audioSource": "Recorded source", - "recordedTrack": "Track {number}", + "exported": "Exporté.", + "encodingProgress": "{percent} % encodé", + "audioSource": "Source enregistrée", + "recordedTrack": "Piste {number}", "audioVolume": "Volume", - "audioMuted": "Muted", - "audioPreviewFailed": "Could not play this audio track. Try again or check the log.", - "detachedTracksHelp": "Each recorded source has its own lane. Only track 1 starts enabled, so a combined track is not mixed twice. Unmute the sources you want to hear.", - "preparingMedia": "Preparing preview" + "audioMuted": "Muet", + "audioPreviewFailed": "Impossible de lire cette piste audio. Réessaie ou consulte le journal.", + "detachedTracksHelp": "Chaque source enregistrée a sa propre piste. Seule la piste 1 est activée au départ, pour qu'une piste combinée ne soit pas mixée deux fois. Réactive le son des sources que tu veux entendre.", + "preparingMedia": "Préparation de l'aperçu" }, "settings": { - "title": "Settings", - "subtitle": "Tune Vice to the way you play", - "sections": "Settings sections", - "loading": "Loading your settings.", - "secRecording": "Recording", + "title": "Réglages", + "subtitle": "Adapte Vice à ta façon de jouer", + "sections": "Sections des réglages", + "loading": "Chargement de tes réglages.", + "secRecording": "Enregistrement", "secAudio": "Audio", - "secHotkeys": "Hotkeys", - "secStorage": "Storage", - "secSharing": "Sharing", + "secHotkeys": "Raccourcis", + "secStorage": "Stockage", + "secSharing": "Partage", "secDiscord": "Discord", - "secAppearance": "Appearance", - "secAdvanced": "Advanced", + "secAppearance": "Apparence", + "secAdvanced": "Avancé", "cardDiscord": "Discord Rich Presence", - "optAutoRecommended": "Auto (recommended)", - "bufferDuration": "Buffer duration", - "bufferOnDisk": "Buffer is kept on disk, so long durations are fine.", - "bufferPlain": "Seconds of gameplay kept in the rolling buffer", - "bufferRamWarning": "A {length} buffer in RAM uses roughly {gb} GB at typical bitrates. Auto storage moves it to disk.", - "replayStorage": "Replay storage", - "replayStorageHelp": "Where the rolling buffer lives. Auto keeps short buffers in RAM and moves anything over ten minutes to disk.", + "optAutoRecommended": "Auto (recommandé)", + "bufferDuration": "Durée du tampon", + "bufferOnDisk": "Le tampon est conservé sur le disque, donc les longues durées ne posent pas de problème.", + "bufferPlain": "Secondes de gameplay conservées dans le tampon glissant", + "bufferRamWarning": "Un tampon de {length} en RAM utilise environ {gb} Go avec des débits typiques. Le stockage Auto le déplace sur le disque.", + "replayStorage": "Stockage du replay", + "replayStorageHelp": "Là où vit le tampon glissant. Auto garde les tampons courts en RAM et déplace sur le disque tout ce qui dépasse dix minutes.", "replayRam": "RAM", - "replayDisk": "Disk", - "clipDuration": "Clip duration", - "clipDurationHelp": "Seconds saved when you press the clip key", - "frameRate": "Frame rate", - "frameRateHelp": "Capture frames per second", - "fpsOption": "{fps} fps", - "resolution": "Resolution", - "resolutionHelp": "Auto matches your display", + "replayDisk": "Disque", + "clipDuration": "Durée du clip", + "clipDurationHelp": "Secondes enregistrées quand tu appuies sur la touche de clip", + "frameRate": "Fréquence d'images", + "frameRateHelp": "Images capturées par seconde", + "fpsOption": "{fps} i/s", + "resolution": "Résolution", + "resolutionHelp": "Auto s'adapte à ton écran", "resolutionAuto": "Auto", - "resolutionCustom": "Custom", - "customResolution": "Custom resolution", - "customResolutionHelp": "Width by height, for example 1600x900", - "customResolutionWarn": "Write it as width by height, like 1600x900.", - "badResolutionTitle": "That resolution is not a size", - "badResolutionDetail": "Write it as width by height, like 1600x900", - "container": "Container", - "containerHelp": "MKV survives crashes better and suits multi-track audio. Discord embeds and browsers need MP4.", - "containerMp4": "MP4 (best compatibility)", - "containerMkv": "MKV (crash-safe)", - "encoder": "Video encoder", - "encoderHelp": "GPU encoders are faster and use less CPU. Vulkan options require the gpu-screen-recorder backend.", + "resolutionCustom": "Personnalisée", + "customResolution": "Résolution personnalisée", + "customResolutionHelp": "Largeur par hauteur, par exemple 1600x900", + "customResolutionWarn": "Écris-la sous la forme largeur par hauteur, comme 1600x900.", + "badResolutionTitle": "Cette résolution n'est pas une taille", + "badResolutionDetail": "Écris-la sous la forme largeur par hauteur, comme 1600x900", + "container": "Conteneur", + "containerHelp": "Le MKV résiste mieux aux plantages et convient à l'audio multipiste. Les intégrations Discord et les navigateurs demandent du MP4.", + "containerMp4": "MP4 (meilleure compatibilité)", + "containerMkv": "MKV (résiste aux plantages)", + "encoder": "Encodeur vidéo", + "encoderHelp": "Les encodeurs GPU sont plus rapides et sollicitent moins le CPU. Les options Vulkan nécessitent le backend gpu-screen-recorder.", "encoderH264Vulkan": "H.264 (Vulkan, GSR)", "encoderHevcVulkan": "HEVC (Vulkan, GSR)", "encoderAv1Vulkan": "AV1 (Vulkan, GSR)", "encoderH264Nvenc": "NVIDIA H.264 (NVENC)", "encoderHevcNvenc": "NVIDIA H.265 (NVENC)", - "encoderH264Vaapi": "AMD or Intel H.264 (VAAPI)", - "encoderHevcVaapi": "AMD or Intel H.265 (VAAPI)", - "encoderAv1Nvenc": "NVIDIA AV1 (NVENC, RTX 40 and up)", - "encoderAv1Vaapi": "AMD or Intel AV1 (VAAPI)", - "encoderX264": "Software H.264 (x264)", - "encoderX265": "Software H.265 (x265)", - "colourDepth": "Colour depth", - "colourDepthHelp": "8-bit suits every player. 10-bit needs an HEVC or AV1 encoder.", - "colour8": "8-bit (standard)", - "colour10": "10-bit (HEVC or AV1)", - "hardwareDecode": "Hardware video decode in previews", - "hardwareDecodeHelp": "Let your GPU decode clips in this window instead of the CPU. Worth turning on if high-resolution AV1 or HEVC previews stutter. It renders video black on some drivers, so if that happens turn it back off. Takes effect next time you open Vice.", - "backend": "Recording backend", - "backendHelp": "Screen capture method", + "encoderH264Vaapi": "AMD ou Intel H.264 (VAAPI)", + "encoderHevcVaapi": "AMD ou Intel H.265 (VAAPI)", + "encoderAv1Nvenc": "NVIDIA AV1 (NVENC, RTX 40 et supérieures)", + "encoderAv1Vaapi": "AMD ou Intel AV1 (VAAPI)", + "encoderX264": "H.264 logiciel (x264)", + "encoderX265": "H.265 logiciel (x265)", + "colourDepth": "Profondeur de couleur", + "colourDepthHelp": "Le 8 bits convient à tous les lecteurs. Le 10 bits nécessite un encodeur HEVC ou AV1.", + "colour8": "8 bits (standard)", + "colour10": "10 bits (HEVC ou AV1)", + "hardwareDecode": "Décodage vidéo matériel dans les aperçus", + "hardwareDecodeHelp": "Laisse ton GPU décoder les clips dans cette fenêtre plutôt que le CPU. À activer si les aperçus AV1 ou HEVC en haute résolution saccadent. Sur certains pilotes, la vidéo s'affiche en noir : si cela arrive, désactive-le. Prend effet à la prochaine ouverture de Vice.", + "backend": "Backend d'enregistrement", + "backendHelp": "Méthode de capture d'écran", "backendWf": "wf-recorder (Wayland)", "backendFfmpeg": "ffmpeg (X11)", - "followMouse": "Follow my mouse", - "followMouseHelp": "Record whichever monitor the pointer is on. Switching monitors restarts the buffer, so a clip taken right after moving will be short.", - "followMouseUnsupported": "Needs X11, Hyprland or Sway. Vice cannot tell where the pointer is on this session.", - "display": "Display", - "displayAuto": "Auto (backend default)", - "savedOption": "{id} (saved)", - "displayMissing": "Display \"{id}\" is not being reported right now. It is still saved and will be used if it comes back.", - "displayWarning": "{warning} Auto will still work.", - "displayNone": "No individual displays were detected. Auto will still work.", - "displayHelp": "Choose which display to record. Auto follows the backend default.", - "displayLoadFailed": "Could not load display options.", - "captureDesktopAudio": "Capture desktop audio", - "captureDesktopAudioHelp": "Include system sound in clips", - "captureMic": "Capture microphone", - "captureMicHelp": "Record your mic into clips. The same switch as the tile on Home, and saved the moment you flip it.", - "micOn": "Microphone on", - "micOff": "Microphone off", - "micOnDetail": "Included in new clips", - "micOffDetail": "Removed from new clips", - "errMic": "Could not change the microphone setting", - "desktopSource": "Desktop audio source", - "desktopSourceIsMic": "This is a microphone input, so clips would have no desktop audio. Pick one under Desktop audio instead.", - "desktopSourceMissing": "That source is not listed right now. It is still saved and will be passed to the recorder.", - "desktopSourceHelp": "Choose what the recorder captures as desktop audio.", - "sourceLoadFailed": "Could not load audio sources.", - "defaultOutput": "Default output", - "defaultInput": "Default input", - "groupDesktopAudio": "Desktop audio", + "followMouse": "Suivre ma souris", + "followMouseHelp": "Enregistre le moniteur sur lequel se trouve le pointeur. Changer de moniteur redémarre le tampon, donc un clip pris juste après un changement sera court.", + "followMouseUnsupported": "Nécessite X11, Hyprland ou Sway. Vice ne peut pas savoir où se trouve le pointeur dans cette session.", + "display": "Écran", + "displayAuto": "Auto (défaut du backend)", + "savedOption": "{id} (enregistré)", + "displayMissing": "L'écran « {id} » n'est pas signalé pour le moment. Il reste enregistré et sera utilisé s'il revient.", + "displayWarning": "{warning} Auto fonctionnera quand même.", + "displayNone": "Aucun écran individuel détecté. Auto fonctionnera quand même.", + "displayHelp": "Choisis l'écran à enregistrer. Auto suit le défaut du backend.", + "displayLoadFailed": "Impossible de charger les options d'écran.", + "captureDesktopAudio": "Capturer l'audio du bureau", + "captureDesktopAudioHelp": "Inclure le son du système dans les clips", + "captureMic": "Capturer le microphone", + "captureMicHelp": "Enregistre ton micro dans les clips. C'est le même interrupteur que la tuile de l'Accueil, enregistré dès que tu le bascules.", + "micOn": "Microphone activé", + "micOff": "Microphone désactivé", + "micOnDetail": "Inclus dans les nouveaux clips", + "micOffDetail": "Retiré des nouveaux clips", + "errMic": "Impossible de modifier le réglage du microphone", + "desktopSource": "Source de l'audio du bureau", + "desktopSourceIsMic": "Il s'agit d'une entrée microphone, donc les clips n'auraient pas d'audio du bureau. Choisis-en une sous Audio du bureau à la place.", + "desktopSourceMissing": "Cette source n'est pas listée pour le moment. Elle reste enregistrée et sera transmise à l'enregistreur.", + "desktopSourceHelp": "Choisis ce que l'enregistreur capture comme audio du bureau.", + "sourceLoadFailed": "Impossible de charger les sources audio.", + "defaultOutput": "Sortie par défaut", + "defaultInput": "Entrée par défaut", + "groupDesktopAudio": "Audio du bureau", "groupMicrophones": "Microphones", "groupApplications": "Applications", - "groupOther": "Other", - "groupSaved": "Saved", - "micSource": "Microphone source", - "micSourceHelp": "Used when mic capture is on. Default input follows the system setting.", - "micMono": "Mono microphone", - "micMonoHelp": "Centres your mic in the clip. Turn this on if your voice only comes out of one ear, which is what most XLR and single-channel interfaces do. Applied when the clip is saved, so it needs mic capture on and no separate audio tracks.", - "desktopVolume": "Desktop audio volume", - "desktopVolumeHelp": "Balanced into new clips as they are saved", - "micVolume": "Microphone volume", - "micVolumeHelp": "Turn this down if your mic overpowers the game. Applies while mic capture is on.", - "notifyVolume": "Notification volume", - "notifyVolumeHelp": "The ping when a clip is saved, and the session start, stop and highlight tones.", - "volumeOff": "Off", - "customSounds": "Custom sounds", - "customSoundsHelp": "Play your own file instead of the built-in tone. Leave blank for the tone. A path that does not exist falls back to the tone, so you never end up with silence.", - "soundClip": "Clip saved", - "soundClipFailed": "Clip failed", - "soundSessionStart": "Session started", - "soundSessionEnd": "Session stopped", - "soundHighlight": "Highlight marked", - "audioTracks": "Separate audio tracks", - "audioTracksHelp": "Each source becomes its own track for editing. Players, Discord and share links use track 1. With mic capture on, your microphone gets its own track.", - "duplicateTrack": "That source is already a track", - "sourcesRefreshed": "Audio sources refreshed", - "mixFirstTrack": "Combined first track", - "mixFirstTrackHelp": "Record an extra track 1 that mixes every source, so players and shared clips carry full audio. Your separate tracks start at 2.", - "wfMicMode": "wf-recorder microphone mode", - "wfMicModeHelp": "How wf-recorder handles desktop audio together with a microphone", - "wfMicPrompt": "Ask when needed", - "wfMicFallback": "Use a compatible backend", - "wfMicOnly": "Mic only on wf-recorder", - "wfMicTitle": "How should the microphone be mixed in?", - "wfMicBody": "wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.", - "wfMicChoiceBoth": "Use a backend that can do both", - "wfMicChoiceBothBody": "Vice records with a compatible backend whenever the microphone is on.", - "wfMicChoiceMic": "Microphone only", - "wfMicChoiceMicBody": "Desktop audio is dropped while the microphone is on.", - "clipKey": "Clip key", - "clipKeyHelp": "Click to rebind, then press a key or a combo like Alt+F9. Escape cancels. Saved the moment you press it.", - "hotkeysUnavailable": "Vice cannot read your keyboard right now, so no hotkey will fire. Adding your user to the input group and logging back in usually fixes it.", - "keyUnsupported": "That key cannot be bound, try another", - "clipKeyNow": "Clip key is now {key}", - "errSaveKey": "The key was captured but not saved", - "clipPresets": "Additional clip hotkeys", - "clipPresetsHelp": "Each key saves its own clip length. Double-tap any clip key to start or stop a session.", - "presetDuration": "Clip length for this key", - "presetRemove": "Remove this hotkey", - "presetAdd": "Add hotkey", - "blocklist": "Ignore hotkeys in these apps", - "blocklistHelp": "One per line. Vice leaves its keys alone while a matching app is focused, for games that clip on the same keys. Matched against the window process and class, for example ggst.exe. Needs X11, Hyprland or Sway.", - "directory": "Save clips to", - "directoryHelp": "Directory where clips are written", - "tagWithGame": "Tag clips with the game", - "tagWithGameHelp": "Append the detected game to clip filenames, like Vice_Clip_4_Overwatch-2.mp4. Uses the same game list as Rich Presence and the auto playlists.", - "autoPlaylist": "Create a playlist per game", - "autoPlaylistHelp": "When a known game is focused, file the clip into an auto playlist for it with its own colour.", - "clipFilename": "Clip filename", - "clipFilenameNext": "Next clip: {name}.mp4", - "clipFilenameEmpty": "That template renders to nothing, so the default naming will be used.", - "port": "HTTP port", - "portHelp": "Port for the local share server", - "publicLink": "Public link", - "publicLinkHelp": "Share links that work outside your own network. Needs the cloudflared binary installed, otherwise links only work on your network.", - "discordEnabled": "Show what you are playing", - "discordCustomGames": "Custom games", + "groupOther": "Autres", + "groupSaved": "Enregistrées", + "micSource": "Source du microphone", + "micSourceHelp": "Utilisée quand la capture du micro est activée. L'entrée par défaut suit le réglage du système.", + "micMono": "Microphone mono", + "micMonoHelp": "Centre ton micro dans le clip. Active-le si ta voix ne sort que d'une oreille, ce que font la plupart des interfaces XLR et monocanal. Appliqué à l'enregistrement du clip, donc il faut que la capture du micro soit activée et qu'il n'y ait pas de pistes audio séparées.", + "desktopVolume": "Volume de l'audio du bureau", + "desktopVolumeHelp": "Équilibré dans les nouveaux clips au moment de leur enregistrement", + "micVolume": "Volume du microphone", + "micVolumeHelp": "Baisse-le si ton micro couvre le jeu. S'applique tant que la capture du micro est activée.", + "notifyVolume": "Volume des notifications", + "notifyVolumeHelp": "Le ping quand un clip est enregistré, et les sons de début, de fin de session et de moment fort.", + "volumeOff": "Désactivé", + "customSounds": "Sons personnalisés", + "customSoundsHelp": "Joue ton propre fichier à la place du son intégré. Laisse vide pour garder le son intégré. Un chemin qui n'existe pas retombe sur le son intégré, donc tu n'auras jamais de silence.", + "soundClip": "Clip enregistré", + "soundClipFailed": "Échec du clip", + "soundSessionStart": "Session démarrée", + "soundSessionEnd": "Session arrêtée", + "soundHighlight": "Moment fort marqué", + "audioTracks": "Pistes audio séparées", + "audioTracksHelp": "Chaque source devient sa propre piste pour le montage. Les lecteurs, Discord et les liens de partage utilisent la piste 1. Avec la capture du micro activée, ton microphone a sa propre piste.", + "duplicateTrack": "Cette source est déjà une piste", + "sourcesRefreshed": "Sources audio actualisées", + "mixFirstTrack": "Première piste combinée", + "mixFirstTrackHelp": "Enregistre une piste 1 supplémentaire qui mixe toutes les sources, pour que les lecteurs et les clips partagés aient tout l'audio. Tes pistes séparées commencent à 2.", + "wfMicMode": "Mode microphone de wf-recorder", + "wfMicModeHelp": "Comment wf-recorder gère l'audio du bureau combiné à un microphone", + "wfMicPrompt": "Demander si besoin", + "wfMicFallback": "Utiliser un backend compatible", + "wfMicOnly": "Micro seul sur wf-recorder", + "wfMicTitle": "Comment mixer le microphone ?", + "wfMicBody": "wf-recorder n'enregistre qu'une source audio à la fois. Choisis ce qui se passe quand le bureau et le microphone sont tous les deux activés.", + "wfMicChoiceBoth": "Utiliser un backend qui gère les deux", + "wfMicChoiceBothBody": "Vice enregistre avec un backend compatible dès que le microphone est activé.", + "wfMicChoiceMic": "Microphone uniquement", + "wfMicChoiceMicBody": "L'audio du bureau est coupé tant que le microphone est activé.", + "clipKey": "Touche de clip", + "clipKeyHelp": "Clique pour réassigner, puis appuie sur une touche ou une combinaison comme Alt+F9. Échap annule. Enregistré dès que tu appuies.", + "hotkeysUnavailable": "Vice ne peut pas lire ton clavier pour le moment, donc aucun raccourci ne fonctionnera. Ajouter ton utilisateur au groupe input puis te reconnecter règle généralement le problème.", + "keyUnsupported": "Cette touche ne peut pas être assignée, essaie-en une autre", + "clipKeyNow": "La touche de clip est maintenant {key}", + "errSaveKey": "La touche a été capturée mais pas enregistrée", + "clipPresets": "Raccourcis de clip supplémentaires", + "clipPresetsHelp": "Chaque touche enregistre sa propre durée de clip. Double-appui sur n'importe quelle touche de clip pour démarrer ou arrêter une session.", + "presetDuration": "Durée du clip pour cette touche", + "presetRemove": "Supprimer ce raccourci", + "presetAdd": "Ajouter un raccourci", + "blocklist": "Ignorer les raccourcis dans ces applications", + "blocklistHelp": "Un par ligne. Vice laisse ses touches tranquilles quand une application correspondante a le focus, pour les jeux qui font des clips avec les mêmes touches. Comparé au processus et à la classe de la fenêtre, par exemple ggst.exe. Nécessite X11, Hyprland ou Sway.", + "directory": "Enregistrer les clips dans", + "directoryHelp": "Dossier où les clips sont écrits", + "tagWithGame": "Étiqueter les clips avec le jeu", + "tagWithGameHelp": "Ajoute le jeu détecté aux noms de fichiers des clips, comme Vice_Clip_4_Overwatch-2.mp4. Utilise la même liste de jeux que Rich Presence et les playlists automatiques.", + "autoPlaylist": "Créer une playlist par jeu", + "autoPlaylistHelp": "Quand un jeu connu a le focus, range le clip dans une playlist automatique qui lui est dédiée, avec sa propre couleur.", + "clipFilename": "Nom de fichier des clips", + "clipFilenameNext": "Prochain clip : {name}.mp4", + "clipFilenameEmpty": "Ce modèle ne produit rien, donc le nom par défaut sera utilisé.", + "port": "Port HTTP", + "portHelp": "Port du serveur de partage local", + "publicLink": "Lien public", + "publicLinkHelp": "Des liens de partage qui fonctionnent hors de ton propre réseau. Nécessite le binaire cloudflared installé, sinon les liens ne fonctionnent que sur ton réseau.", + "discordEnabled": "Afficher à quoi tu joues", + "discordCustomGames": "Jeux personnalisés", "discordCustomGamesPlaceholder": "My Game | mygame.exe, MyGameClient", - "discordClientId": "Client ID override", - "discordClientIdHelp": "Optional. Leave empty to use Vice's own Discord application, or provide your own Application ID for custom branding.", - "discordClientIdPlaceholder": "Discord Application ID", - "accent": "Accent colour", - "accentHelp": "Tints the controls, the highlights and the ambient wash behind the app. Saved straight away, and shared clips pick it up too.", - "accentAria": "{name} accent", - "effects": "Visual effects", - "effectsHelp": "Motion and depth cost a GPU. Auto measures how fast frames arrive in this window and turns them down when it cannot keep up.", + "discordClientId": "Client ID personnalisé", + "discordClientIdHelp": "Facultatif. Laisse vide pour utiliser l'application Discord de Vice, ou fournis ton propre Application ID pour une image de marque personnalisée.", + "discordClientIdPlaceholder": "Application ID Discord", + "accent": "Couleur d'accent", + "accentHelp": "Teinte les contrôles, les surbrillances et le halo d'ambiance derrière l'application. Enregistrée immédiatement, et les clips partagés la reprennent aussi.", + "accentAria": "Accent {name}", + "effects": "Effets visuels", + "effectsHelp": "Le mouvement et la profondeur coûtent du GPU. Auto mesure la vitesse d'arrivée des images dans cette fenêtre et les réduit quand elle n'arrive pas à suivre.", "effectsAuto": "Auto", - "effectsFull": "Full", - "effectsReduced": "Reduced", - "effectsSoftware": "This window is compositing in software, so effects are reduced.", - "effectsSlow": "Frames are arriving too slowly here, so effects are reduced.", - "effectsKeepingUp": "Frames are keeping up, so the full treatment is on.", - "effectsMeasuring": "Measuring.", - "gsrArgs": "Extra gpu-screen-recorder arguments", - "checkForUpdates": "Check for updates", - "checkForUpdatesHelp": "Ask GitHub once a day whether a newer Vice is out. Nothing about you or your clips is sent.", - "checkNow": "Check now", - "checkNowHelp": "Look straight away, ignoring the daily wait.", - "checking": "Checking", - "updateAvailable": "Vice {version} is available", - "upToDate": "You are on the latest release", - "errCheckUpdate": "Could not reach GitHub", - "savedNotApplied": "Saved, but not applied", - "saved": "Settings saved", - "bufferRaised": "Buffer raised to {length} to cover your longest clip key", - "errSave": "Could not save your settings", - "unsaved": "Unsaved changes", - "allSaved": "Everything saved", - "discard": "Discard", - "saving": "Saving", - "saveSettings": "Save settings", - "restartTitle": "Restart Vice to finish", - "restartBody": "The sharing settings are saved, but the server only picks up a new port or tunnel setting when the daemon restarts.", - "clipFilenameHelp": "Leave empty for the default Vice_Clip_4 naming. Use {n} for the clip number, {date}, {time}, and {game} (needs the toggle above). Clips are never overwritten.", - "discordEnabledHelp": "Puts \"Clipping with Vice\" on your Discord profile while a known game is focused. On by default, and window titles are never sent.", - "discordCustomGamesHelp": "One game per line: {format}. Matches are case-insensitive substrings checked against the focused window's process name and class. The bundled list already covers over 300 games.", - "gsrArgsHelp": "Appended to the recorder command as written. Example: {example}", - "language": "Language", - "languageHelp": "Vice is translated by the people who use it. If yours is missing or half done, the file to fill in is one JSON file: see docs/TRANSLATING.md.", - "screenshotKey": "Screenshot key", - "screenshotKeyHelp": "Saves what is on screen as a picture, in the Images section. Unset by default. Screenshots are copied to the clipboard as well.", - "screenshotKeyNow": "Screenshots are on {key}", - "screenshotKeyCleared": "Screenshot key cleared", - "clearKey": "Clear", - "imageDirectory": "Image folder", - "imageDirectoryHelp": "Where screenshots are written. Kept apart from clips so an image viewer is not indexing a folder of video files.", - "soundScreenshot": "Screenshot" + "effectsFull": "Complets", + "effectsReduced": "Réduits", + "effectsSoftware": "Cette fenêtre fait son rendu en logiciel, donc les effets sont réduits.", + "effectsSlow": "Les images arrivent trop lentement ici, donc les effets sont réduits.", + "effectsKeepingUp": "Les images suivent, donc le traitement complet est activé.", + "effectsMeasuring": "Mesure en cours.", + "gsrArgs": "Arguments supplémentaires pour gpu-screen-recorder", + "checkForUpdates": "Rechercher les mises à jour", + "checkForUpdatesHelp": "Demande à GitHub une fois par jour si une version plus récente de Vice est disponible. Rien sur toi ni sur tes clips n'est envoyé.", + "checkNow": "Vérifier maintenant", + "checkNowHelp": "Regarde tout de suite, sans attendre le délai quotidien.", + "checking": "Vérification", + "updateAvailable": "Vice {version} est disponible", + "upToDate": "Tu utilises la dernière version", + "errCheckUpdate": "Impossible de joindre GitHub", + "savedNotApplied": "Enregistré, mais pas appliqué", + "saved": "Réglages enregistrés", + "bufferRaised": "Tampon porté à {length} pour couvrir ta plus longue touche de clip", + "errSave": "Impossible d'enregistrer tes réglages", + "unsaved": "Modifications non enregistrées", + "allSaved": "Tout est enregistré", + "discard": "Abandonner", + "saving": "Enregistrement", + "saveSettings": "Enregistrer les réglages", + "restartTitle": "Redémarre Vice pour terminer", + "restartBody": "Les réglages de partage sont enregistrés, mais le serveur ne prend en compte un nouveau port ou un nouveau réglage de tunnel qu'au redémarrage du daemon.", + "clipFilenameHelp": "Laisse vide pour le nommage par défaut Vice_Clip_4. Utilise {n} pour le numéro du clip, {date}, {time}, et {game} (nécessite l'option ci-dessus). Les clips ne sont jamais écrasés.", + "discordEnabledHelp": "Affiche « Clipping with Vice » sur ton profil Discord quand un jeu connu a le focus. Activé par défaut, et les titres de fenêtre ne sont jamais envoyés.", + "discordCustomGamesHelp": "Un jeu par ligne : {format}. Les correspondances sont des sous-chaînes insensibles à la casse, comparées au nom de processus et à la classe de la fenêtre au premier plan. La liste fournie couvre déjà plus de 300 jeux.", + "gsrArgsHelp": "Ajoutés tels quels à la commande de l'enregistreur. Exemple : {example}", + "language": "Langue", + "languageHelp": "Vice est traduit par les gens qui l'utilisent. Si la tienne manque ou est à moitié faite, le fichier à remplir est un simple fichier JSON : voir docs/TRANSLATING.md.", + "screenshotKey": "Touche de capture d'écran", + "screenshotKeyHelp": "Enregistre ce qui est à l'écran sous forme d'image, dans la section Images. Non définie par défaut. Les captures sont aussi copiées dans le presse-papiers.", + "screenshotKeyNow": "Les captures d'écran sont sur {key}", + "screenshotKeyCleared": "Touche de capture d'écran effacée", + "clearKey": "Effacer", + "imageDirectory": "Dossier des images", + "imageDirectoryHelp": "Là où les captures d'écran sont écrites. Séparé des clips pour qu'une visionneuse d'images n'indexe pas un dossier de fichiers vidéo.", + "soundScreenshot": "Capture d'écran" } -} +} \ No newline at end of file From 61c33adf990c772f78e7c13a3f85871e17692f8d Mon Sep 17 00:00:00 2001 From: voltek Date: Sun, 20 Sep 2026 21:19:28 +0200 Subject: [PATCH 3/6] add fr --- ui-src/locales/index.ts | 2 +- vice/ui/scripts/app.js | 48 ++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ui-src/locales/index.ts b/ui-src/locales/index.ts index 580a19a..3260903 100644 --- a/ui-src/locales/index.ts +++ b/ui-src/locales/index.ts @@ -24,5 +24,5 @@ export type LocaleName = keyof typeof LOCALES; /** What the picker in Settings shows, in the language itself. */ export const LOCALE_LABELS: Record = { en: 'English', - fr: 'fr', + fr: 'Français', }; diff --git a/vice/ui/scripts/app.js b/vice/ui/scripts/app.js index 7cf3663..7585d27 100644 --- a/vice/ui/scripts/app.js +++ b/vice/ui/scripts/app.js @@ -5,8 +5,8 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r= `);for(i=r=0;ri||c[r]!==l[i]){var u=` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` -`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(M)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.textContent,a=i.length;for(e=0;e=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=xn(),bn=yn=vn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=kr(n)}}function jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Pr=M&&`documentMode`in document&&11>=document.documentMode,Fr=null,Ir=null,Lr=null,Rr=!1;function zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rr||Fr==null||Fr!==Ut(r)||(r=Fr,`selectionStart`in r&&Nr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Lr&&Or(Lr,r)||(Lr=r,r=kd(Ir,`onSelect`),0>=o,i-=o,ji=1<<32-We(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Bi&&Ni(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Bi&&Ni(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Bi&&Ni(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Bi&&Ni(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Pa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Va(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=vi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=_i(o.type,o.key,o.props,null,e.mode,c),Va(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=xi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Pa(o),b(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ba(o),c);if(o.$$typeof===C)return b(e,r,ca(e,o),c);Ha(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{za=0;var i=b(e,t,n,r);return Ra=null,i}catch(t){if(t===Oa||t===Aa)throw t;var a=pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Wa=Ua(!0),Ga=Ua(!1),Ka=!1;function qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Bl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ui(e),li(e,null,n),t}return oi(e,r,t,n),ui(e)}function Za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var $a=!1;function eo(){if($a){var e=ya;if(e!==null)throw e}}function to(e,t,n,r){$a=!1;var i=e.updateQueue;Ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(G&f)===f:(r&f)===f){f!==0&&f===va&&($a=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ka=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Yl|=o,e.lanes=o,e.memoizedState=d}}function no(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ro(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=k.T,s={};k.T=s,Fs(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,Sa(c,r),gu(e)):Ps(e,t,r,gu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,se,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:z,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:z,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},gu())}function Os(){return sa(tp)}function ks(){return R().memoizedState}function As(){return R().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Ya(n);var r=Xa(t,e,n);r!==null&&(vu(r,t,n),Za(r,t,n)),t={cache:ma()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=si(e,t,n,r),n!==null&&(vu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,gu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Dr(s,o))return oi(e,t,i,0),Vl===null&&ai(),!1}catch{}if(n=si(e,t,i,r),n!==null)return vu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=si(e,n,r,2),t!==null&&vu(t,e,2)}function Is(e){var t=e.alternate;return e===P||t!==null&&t===P}function Ls(e,t){F=So=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var zs={readContext:sa,use:Ro,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useLayoutEffect:Oo,useInsertionEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useSyncExternalStore:Oo,useId:Oo,useHostTransitionStatus:Oo,useFormState:Oo,useActionState:Oo,useOptimistic:Oo,useMemoCache:Oo,useCacheRefresh:Oo};zs.useEffectEvent=Oo;var Bs={readContext:sa,use:Ro,useCallback:function(e,t){return Fo().memoizedState=[e,t===void 0?null:t],e},useContext:sa,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=Fo();t=t===void 0?null:t;var r=e();if(Co){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Fo();if(n!==void 0){var i=n(t);if(Co){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,P,e),[r.memoizedState,e]},useRef:function(e){var t=Fo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Ns.bind(null,P,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(Fo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Cs.bind(null,P,e.queue,!0,!1),Fo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=P,a=Fo();if(Bi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vl===null)throw Error(i(349));G&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Go.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Fo(),t=Vl.identifierPrefix;if(Bi){var n=Mi,r=ji;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=wo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Rd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Nc(t)}}return Rc(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,qi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ri,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Wi(t,!0)}else e=Wd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Rc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=qi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),e=!1}else n=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(go(t),t):(go(t),null);if(t.flags&128)throw Error(i(558))}return Rc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),a=!1}else a=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(go(t),t):(go(t),null)}return go(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ic(t,t.updateQueue),Rc(t),null);case 4:return _e(),e===null&&Td(t.stateNode.containerInfo),Rc(t),null;case 10:return ta(t.type),Rc(t),null;case 19:if(ue(_o),r=t.memoizedState,r===null)return Rc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Lc(r,!1);else{if(Jl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vo(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gi(n,e),n=n.sibling;return de(_o,_o.current&1|2),Bi&&Ni(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>iu&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Bi)return Rc(t),null}else 2*Me()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Rc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=_o.current,de(_o,a?n&1|2:n&1),Bi&&Ni(t,r.treeForkCount),e);case 22:case 23:return go(t),co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Rc(t),t.subtreeFlags&6&&(t.flags|=8192)):Rc(t),n=t.updateQueue,n!==null&&Ic(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ue(wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(pa),Rc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(pa),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(go(t),t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(go(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(_o),null;case 4:return _e(),null;case 10:return ta(t.type),null;case 22:case 23:return go(t),co(),e!==null&&ue(wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(pa),null;case 25:return null;default:return null}}function Vc(e,t){switch(Ii(t),t.tag){case 3:ta(pa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&go(t);break;case 13:go(t);break;case 19:ue(_o);break;case 10:ta(t.type);break;case 22:case 23:go(t),co(),e!==null&&ue(wa);break;case 24:ta(pa)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ro(t,n)}catch(t){Ju(e,e.return,t)}}}function Gc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[mt]=t}catch(t){Ju(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ef(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[pt]=e,t[mt]=n}catch(t){Ju(e,e.return,t)}}var tl=!1,nl=!1,W=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Hd=up,e=Mr(e),Nr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ud={focusedElem:e,selectionRange:n},up=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Rd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=Wf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Ar(s,h),v=Ar(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,k.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Bl&6)throw Error(i(331));var c=Bl;if(Bl|=4,Fl(o.current),Dl(o,o.current,s,n),Bl=c,sd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{A.p=a,k.T=r,Wu(e,t)}}function qu(e,t,n){t=Ci(n,t),t=$s(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(rt(e,2),od(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=Ci(n,e),n=ec(2),r=Xa(t,n,2),r!==null&&(tc(n,r,t,e),rt(r,2),od(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Kl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(G&n)===n&&(Jl===4||Jl===3&&(G&62914560)===G&&300>Me()-ru?!(Bl&2)&&Tu(e,0):Zl|=n,$l===G&&($l=0)),od(e)}function Zu(e,t){t===0&&(t=tt()),e=ci(e,t),e!==null&&(rt(e,t),od(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return Oe(e,t)}var td=null,nd=null,rd=!1,id=!1,J=!1,ad=0;function od(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,pd())}function sd(e,t){if(!J&&id){J=!0;do for(var n=!1,r=td;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=G,a=Qe(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,fd(r,a))}r=r.next}while(n);J=!1}}function cd(){ld()}function ld(){id=rd=!1;var e=0;ad!==0&&Jd()&&(e=ad);for(var t=Me(),n=null,r=td;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Bd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Nf(e);break;case`script`:a=Lf(e)}_f.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!_f.has(a)&&(e=m({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=Tt(r).hoistableStyles,a=Nf(e);t=t||`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);Et(c),Rd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=Tt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=m({src:e,async:!0},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),Et(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=Tt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),Et(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=me.current)?yf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Nf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Nf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Lf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return`href="`+Gt(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Rd(t,`link`,n),Et(t),e.head.appendChild(t))}function Lf(e){return`[src="`+Gt(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Rd(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,Et(a),a):(r=n,(a=_f.get(o))&&(r=m({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),Rd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Bf(r,n.precedence,e));return t.instance}function Bf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Kf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Jf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Zf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v,y,b=o((()=>{v=l(d(),1),y=typeof window<`u`?v.useLayoutEffect:v.useEffect}));function x(){if(w)return C;w=1,Object.defineProperty(C,"__esModule",{value:!0}),C.styleq=void 0;var e=new WeakMap,t=`$$css`;function n(n){var r,i,a;return n!=null&&(r=n.disableCache===!0,i=n.disableMix===!0,a=n.transform),function(){for(var n=[],o=``,s=null,c=``,l=r?null:e,u=Array(arguments.length),d=0;d0;){var f=u.pop();if(f!=null&&f!==!1){if(Array.isArray(f)){for(var p=0;p0&&(i.style=n),r!=null&&r!==``&&(i[`data-style-src`]=r),i}var C,w,ee,te=o((()=>{C={},ee=x(),Object.freeze({})})),ne,T,re,E,D,ie,ae,O,oe,k,A,se,ce=o((()=>{ne={"--color-accent":`light-dark(#0064E0, #2694FE)`,"--color-accent-muted":`light-dark(#0082FB33, #0082FB3F)`,"--color-on-accent":`light-dark(#FFFFFF, #FFFFFF)`,"--color-neutral":`light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))`,"--color-background-surface":`light-dark(#FFFFFF, #1F1F22)`,"--color-background-body":`light-dark(#F1F4F7, #111112)`,"--color-overlay":`light-dark(#01122866, #11111299)`,"--color-overlay-hover":`light-dark(#0536590C, #FFFFFF0C)`,"--color-overlay-pressed":`light-dark(#05365919, #FFFFFF19)`,"--color-background-muted":`light-dark(#0536590C, #1111127F)`,"--color-text-primary":`light-dark(#0A1317, #DFE2E5)`,"--color-text-secondary":`light-dark(#4E606F, #AAAFB5)`,"--color-text-disabled":`light-dark(#A4B0BC, #6F747C)`,"--color-text-accent":`light-dark(#0064E0, #3E9EFB)`,"--color-on-dark":`light-dark(#FFFFFF, #FFFFFF)`,"--color-on-light":`light-dark(#000000, #000000)`,"--color-icon-accent":`light-dark(#0064E0, #2694FE)`,"--color-icon-primary":`light-dark(#0A1317, #DFE2E5)`,"--color-icon-secondary":`light-dark(#4E606F, #AAAFB5)`,"--color-icon-disabled":`light-dark(#A4B0BC, #6F747C)`,"--color-background-card":`light-dark(#FFFFFF, #1F1F22)`,"--color-background-popover":`light-dark(#FFFFFF, #28292C)`,"--color-background-inverted":`light-dark(#0A1317, #FFFFFF)`,"--color-background-error-inverted":`light-dark(#AA071E, #E3193B)`,"--color-success":`light-dark(#0D8626, #0D8626)`,"--color-success-muted":`light-dark(#0B991F33, #0B991F3F)`,"--color-on-success":`light-dark(#FFFFFF, #FFFFFF)`,"--color-error":`light-dark(#E3193B, #F5394F)`,"--color-error-muted":`light-dark(#E3193B33, #F5394F3F)`,"--color-on-error":`light-dark(#FFFFFF, #FFFFFF)`,"--color-warning":`light-dark(#E9AF08, #F2C00B)`,"--color-warning-muted":`light-dark(#E2A40033, #E2A4003F)`,"--color-on-warning":`light-dark(#0A1317, #0A1317)`,"--color-border":`light-dark(#05365919, #F2F4F619)`,"--color-border-emphasized":`light-dark(#CCD3DB, #494D53)`,"--color-skeleton":`light-dark(#CCD3DB, #5A5E66)`,"--color-track":`light-dark(#CCD3DB, #5A5E66)`,"--color-shadow":`light-dark(rgba(5, 54, 89, 0.1), rgba(0, 0, 0, 0.3))`,"--color-tint-hover":`light-dark(black, white)`,"--color-background-blue":`light-dark(#0171E333, #0171E333)`,"--color-border-blue":`light-dark(#0064E0, #2694FE)`,"--color-icon-blue":`light-dark(#0064E0, #2694FE)`,"--color-text-blue":`light-dark(#042F97, #AFD7FF)`,"--color-background-cyan":`light-dark(#03A7D733, #03A7D733)`,"--color-border-cyan":`light-dark(#089DD0, #0171A4)`,"--color-icon-cyan":`light-dark(#00ACC1, #26C6DA)`,"--color-text-cyan":`light-dark(#014975, #A1EEF9)`,"--color-background-gray":`light-dark(#0A131733, #666A724C)`,"--color-border-gray":`light-dark(#647685, #748695)`,"--color-icon-gray":`light-dark(#4E606F, #AAAFB5)`,"--color-text-gray":`light-dark(#0A1317, #E7EAED)`,"--color-background-green":`light-dark(#24BB5E33, #24BB5E33)`,"--color-border-green":`light-dark(#0D8626, #0B991F)`,"--color-icon-green":`light-dark(#0D8626, #26A756)`,"--color-text-green":`light-dark(#09441F, #A5F690)`,"--color-background-orange":`light-dark(#F2790233, #F2790233)`,"--color-border-orange":`light-dark(#EB6E00, #B34A01)`,"--color-icon-orange":`light-dark(#E9690B, #FB8C00)`,"--color-text-orange":`light-dark(#6B2203, #FDB876)`,"--color-background-pink":`light-dark(#E638B333, #E638B333)`,"--color-border-pink":`light-dark(#F351C0, #C02294)`,"--color-icon-pink":`light-dark(#C2185B, #EC407A)`,"--color-text-pink":`light-dark(#650053, #FEADE3)`,"--color-background-purple":`light-dark(#7952FF33, #7952FF33)`,"--color-border-purple":`light-dark(#9081FF, #7340FE)`,"--color-icon-purple":`light-dark(#5B08D8, #7952FF)`,"--color-text-purple":`light-dark(#3E0697, #B3B0FE)`,"--color-background-red":`light-dark(#E3193B33, #E3193B33)`,"--color-border-red":`light-dark(#E3193B, #F5394F)`,"--color-icon-red":`light-dark(#D31130, #E3193B)`,"--color-text-red":`light-dark(#7B0210, #FFB2B8)`,"--color-background-teal":`light-dark(#0DB7AF33, #0DB7AF33)`,"--color-border-teal":`light-dark(#08A3A3, #08767D)`,"--color-icon-teal":`light-dark(#009688, #26A69A)`,"--color-text-teal":`light-dark(#083943, #40DCCD)`,"--color-background-yellow":`light-dark(#E2A40033, #E2A40033)`,"--color-border-yellow":`light-dark(#C58600, #B47700)`,"--color-icon-yellow":`light-dark(#FBC02D, #FFEE58)`,"--color-text-yellow":`light-dark(#753F07, #FBCE03)`},T={"--spacing-0":`0px`,"--spacing-0-5":`2px`,"--spacing-1":`4px`,"--spacing-1-5":`6px`,"--spacing-2":`8px`,"--spacing-3":`12px`,"--spacing-4":`16px`,"--spacing-5":`20px`,"--spacing-6":`24px`,"--spacing-7":`28px`,"--spacing-8":`32px`,"--spacing-9":`36px`,"--spacing-10":`40px`,"--spacing-11":`44px`,"--spacing-12":`48px`},re={"--size-element-sm":`28px`,"--size-element-md":`32px`,"--size-element-lg":`36px`},E={"--focus-outline-width":`2px`,"--focus-outline-style":`solid`,"--focus-outline-color":`var(--color-accent)`,"--focus-outline-offset":`3px`},D={"--radius-none":`0px`,"--radius-inner":`4px`,"--radius-element":`8px`,"--radius-container":`12px`,"--radius-page":`28px`,"--radius-chat":`28px`,"--radius-full":`9999px`},ie={"--shadow-low":`0px 1px 1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))`,"--shadow-med":`0px 1px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 12px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))`,"--shadow-high":`0px 2px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 8px 24px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3))`,"--shadow-inset-hover":`inset 0px 0px 0px 2px light-dark(rgba(5, 54, 89, 0.15), rgba(223, 226, 229, 0.2))`,"--shadow-inset-selected":`inset 0px 0px 0px 2px rgba(1, 113, 227, 0.5)`,"--shadow-inset-success":`inset 0px 0px 0px 2px rgba(38, 167, 86, 0.3)`,"--shadow-inset-warning":`inset 0px 0px 0px 2px rgba(226, 164, 0, 0.3)`,"--shadow-inset-error":`inset 0px 0px 0px 2px rgba(227, 25, 59, 0.3)`},ae={"--duration-fast-min":`130ms`,"--duration-fast":`175ms`,"--duration-fast-max":`230ms`,"--duration-medium-min":`310ms`,"--duration-medium":`410ms`,"--duration-medium-max":`550ms`,"--duration-slow-min":`730ms`,"--duration-slow":`975ms`,"--duration-slow-max":`1300ms`},O={"--ease-standard":`cubic-bezier(0.24, 1, 0.4, 1)`},oe={"--font-family-body":`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,"--font-family-code":`"SF Mono", Monaco, Consolas, monospace`,"--font-family-heading":`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`},k={"--font-size-4xs":`0.375rem`,"--font-size-3xs":`0.4375rem`,"--font-size-2xs":`0.5rem`,"--font-size-xs":`0.625rem`,"--font-size-sm":`0.75rem`,"--font-size-base":`0.875rem`,"--font-size-lg":`1.0625rem`,"--font-size-xl":`1.25rem`,"--font-size-2xl":`1.5rem`,"--font-size-3xl":`1.8125rem`,"--font-size-4xl":`2.1875rem`,"--font-size-5xl":`2.625rem`},A={"--font-weight-normal":`400`,"--font-weight-medium":`500`,"--font-weight-semibold":`600`,"--font-weight-bold":`700`},se={"--text-heading-1-size":`var(--font-size-2xl)`,"--text-heading-1-weight":`var(--font-weight-semibold)`,"--text-heading-1-leading":`1.3333`,"--text-heading-2-size":`var(--font-size-xl)`,"--text-heading-2-weight":`var(--font-weight-semibold)`,"--text-heading-2-leading":`1.4`,"--text-heading-3-size":`var(--font-size-lg)`,"--text-heading-3-weight":`var(--font-weight-semibold)`,"--text-heading-3-leading":`1.4118`,"--text-heading-4-size":`var(--font-size-base)`,"--text-heading-4-weight":`var(--font-weight-semibold)`,"--text-heading-4-leading":`1.4286`,"--text-heading-5-size":`var(--font-size-sm)`,"--text-heading-5-weight":`var(--font-weight-semibold)`,"--text-heading-5-leading":`1.6667`,"--text-heading-6-size":`var(--font-size-xs)`,"--text-heading-6-weight":`var(--font-weight-semibold)`,"--text-heading-6-leading":`1.6`,"--text-body-size":`var(--font-size-base)`,"--text-body-weight":`var(--font-weight-normal)`,"--text-body-leading":`1.4286`,"--text-large-size":`var(--font-size-lg)`,"--text-large-weight":`var(--font-weight-semibold)`,"--text-large-leading":`1.4118`,"--text-label-size":`var(--font-size-base)`,"--text-label-weight":`var(--font-weight-medium)`,"--text-label-leading":`1.4286`,"--text-code-size":`var(--font-size-base)`,"--text-code-weight":`var(--font-weight-normal)`,"--text-code-leading":`1.4286`,"--text-supporting-size":`var(--font-size-sm)`,"--text-supporting-weight":`var(--font-weight-normal)`,"--text-supporting-leading":`1.6667`,"--text-display-1-size":`var(--font-size-5xl)`,"--text-display-1-weight":`var(--font-weight-normal)`,"--text-display-1-leading":`1.2381`,"--text-display-2-size":`var(--font-size-4xl)`,"--text-display-2-weight":`var(--font-weight-normal)`,"--text-display-2-leading":`1.2571`,"--text-display-3-size":`var(--font-size-3xl)`,"--text-display-3-weight":`var(--font-weight-normal)`,"--text-display-3-leading":`1.2414`}}));function j(e){return Array.isArray(e)?`light-dark(${e[0]}, ${e[1]})`:e}function le(e,t){let n={...e===`dark`?ue:de};if(t?.tokens)for(let[e,r]of Object.entries(t.tokens))r!==void 0&&(n[e]=j(r));return{tokens:n,components:t?.components}}var ue,de,fe=o((()=>{ue={"color-scheme":`dark`,"--color-text-primary":`var(--color-on-dark)`,"--color-icon-primary":`var(--color-on-dark)`,"--color-accent":`var(--color-on-dark)`},de={"color-scheme":`light`,"--color-text-primary":`var(--color-on-light)`,"--color-icon-primary":`var(--color-on-light)`,"--color-accent":`var(--color-on-light)`}}));function pe(e,t,n){return Math.round(e*t**+n)}function me(e){return`${Math.round(e/16*1e4)/1e4}rem`}function he(e){return e<20?1.5:e<32?1.4:1.25}function ge(e){let t=e*he(e),n=Math.max(Math.round(t/4)*4,Math.ceil((e+4)/4)*4);return Math.round(n/e*1e4)/1e4}function _e(e){let{base:t,ratio:n,weights:r}=e,i={},a={...Se,...r?.heading},o={...Ce,...r?.text};for(let e=-5;e<=6;e++){let r=pe(t,n,e);i[ye[e]]=me(r)}for(let[e,r]of Object.entries(be)){let o=Number(e),s=ge(pe(t,n,r));i[`--text-heading-${o}-size`]=`var(${ye[r]})`,i[`--text-heading-${o}-weight`]=a[o],i[`--text-heading-${o}-leading`]=`${s}`}for(let[e,r]of Object.entries(xe)){let a=ge(pe(t,n,r));i[`--text-${e}-size`]=`var(${ye[r]})`,i[`--text-${e}-weight`]=o[e],i[`--text-${e}-leading`]=`${a}`}return i}function ve(e){let t={},n={};for(let e of[1,2,3,4,5,6])n[`level:${e}`]={fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-${e}-size)`,fontWeight:`var(--text-heading-${e}-weight)`,lineHeight:`var(--text-heading-${e}-leading)`};for(let e of[`display-1`,`display-2`,`display-3`])n[`type:${e}`]={fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-${e}-size)`,lineHeight:`var(--text-${e}-leading)`};t.heading=n;let r={};for(let e of[`body`,`large`,`label`,`code`,`supporting`,`display-1`,`display-2`,`display-3`])r[`type:${e}`]={fontFamily:we[e],fontSize:`var(--text-${e}-size)`,lineHeight:`var(--text-${e}-leading)`};return t.text=r,t}var ye,be,xe,Se,Ce,we,Te=o((()=>{ye={[-5]:`--font-size-4xs`,[-4]:`--font-size-3xs`,[-3]:`--font-size-2xs`,[-2]:`--font-size-xs`,[-1]:`--font-size-sm`,0:`--font-size-base`,1:`--font-size-lg`,2:`--font-size-xl`,3:`--font-size-2xl`,4:`--font-size-3xl`,5:`--font-size-4xl`,6:`--font-size-5xl`},be={1:3,2:2,3:1,4:0,5:-1,6:-2},xe={body:0,large:1,label:0,code:0,supporting:-1,"display-1":6,"display-2":5,"display-3":4},Se={1:`var(--font-weight-semibold)`,2:`var(--font-weight-semibold)`,3:`var(--font-weight-semibold)`,4:`var(--font-weight-semibold)`,5:`var(--font-weight-semibold)`,6:`var(--font-weight-semibold)`},Ce={body:`var(--font-weight-normal)`,large:`var(--font-weight-semibold)`,label:`var(--font-weight-medium)`,code:`var(--font-weight-normal)`,supporting:`var(--font-weight-normal)`,"display-1":`var(--font-weight-normal)`,"display-2":`var(--font-weight-normal)`,"display-3":`var(--font-weight-normal)`},we={body:`var(--font-family-body)`,large:`var(--font-family-body)`,label:`var(--font-family-body)`,code:`var(--font-family-code)`,supporting:`var(--font-family-body)`,"display-1":`var(--font-family-heading)`,"display-2":`var(--font-family-heading)`,"display-3":`var(--font-family-heading)`}}));function Ee(e){return Math.round(e/5)*5}function De(e){let{fast:t,medium:n,slow:r,ratio:i,easing:a}=e,o={"--duration-fast-min":`${Ee(t*i)}ms`,"--duration-fast":`${Ee(t)}ms`,"--duration-fast-max":`${Ee(t/i)}ms`,"--duration-medium-min":`${Ee(n*i)}ms`,"--duration-medium":`${Ee(n)}ms`,"--duration-medium-max":`${Ee(n/i)}ms`};return r!=null&&(o[`--duration-slow-min`]=`${Ee(r*i)}ms`,o[`--duration-slow`]=`${Ee(r)}ms`,o[`--duration-slow-max`]=`${Ee(r/i)}ms`),a&&(o[`--ease-standard`]=a),o}var Oe=o((()=>{}));function ke(e){let{base:t,multiplier:n}=e;return{"--radius-none":`0px`,"--radius-inner":`${Math.round(t*1*n)}px`,"--radius-element":`${Math.round(t*2*n)}px`,"--radius-container":`${Math.round(t*3*n)}px`,"--radius-page":`${Math.round(t*7*n)}px`,"--radius-chat":`${Math.round(t*7*n)}px`,"--radius-full":`9999px`}}var Ae=o((()=>{}));function je(e){return e.split(``).map(e=>e+e).join(``)}function Me(e){if(typeof e!=`string`)return null;let t=e.trim().replace(/^#/,``),n=t.length===3||t.length===4?je(t):t;return n.length!==6&&n.length!==8||!/^[0-9a-fA-F]+$/.test(n)?null:{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:n.length===8?parseInt(n.slice(6,8),16)/255:1}}function Ne(e){let t=e.indexOf(`(`);if(t===-1||!e.trim().endsWith(`)`))return null;let n=e.slice(t+1,e.lastIndexOf(`)`)).replace(/\//g,` `).split(/[\s,]+/).map(e=>e.trim()).filter(Boolean);if(n.length<3)return null;let r=e=>{let t=e.endsWith(`%`)?parseFloat(e)/100*255:parseFloat(e);return Le(t,0,255)},i=r(n[0]),a=r(n[1]),o=r(n[2]);if([i,a,o].some(Number.isNaN))return null;let s=1;if(n.length>=4){let e=n[3];if(s=e.endsWith(`%`)?parseFloat(e)/100:parseFloat(e),Number.isNaN(s))return null;s=Le(s,0,1)}return{r:i,g:a,b:o,a:s}}function Pe(e){let t=e.trim(),n=Ie[t.toLowerCase()];return n?{...n}:t.startsWith(`#`)?Me(t):/^rgba?\(/i.test(t)?Ne(t):null}function Fe(e,t,n){let r=e=>Le(Math.round(e),0,255).toString(16).padStart(2,`0`).toUpperCase();return`#${r(e)}${r(t)}${r(n)}`}var Ie,Le,Re=o((()=>{Ie={transparent:{r:0,g:0,b:0,a:0},black:{r:0,g:0,b:0,a:1},white:{r:255,g:255,b:255,a:1}},Le=(e,t,n)=>Math.max(t,Math.min(n,e))}));function ze(e){let t=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function Be(e,t){let n=e.a;return{r:e.r*n+t.r*(1-n),g:e.g*n+t.g*(1-n),b:e.b*n+t.b*(1-n),a:1}}function Ve(e,t){if(typeof e!=`string`)return e;let n=Pe(e);if(n===null)throw TypeError(`contrastRatio: could not parse ${t} "${e}"`);return n}function He(e,t){let n=Ve(t,`background`);if(n.a<1)throw TypeError(`contrastRatio: background must be opaque — composite it over its backdrop first`);let r=Ve(e,`foreground`);r.a<1&&(r=Be(r,n));let i=ze(r),a=ze(n),o=Math.max(i,a),s=Math.min(i,a);return(o+.05)/(s+.05)}var Ue=o((()=>{Re()}));function We(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ge(e){let t=e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055;return Math.round(Math.min(255,Math.max(0,t*255)))}function Ke(e,t,n){return[.4124564*e+.3575761*t+.1804375*n,.2126729*e+.7151522*t+.072175*n,.0193339*e+.119192*t+.9503041*n]}function qe(e,t,n){return[3.2404542*e-1.5371385*t-.4985314*n,-.969266*e+1.8760108*t+.041556*n,.0556434*e-.2040259*t+1.0572252*n]}function Je(e){let t=6/29;return e>t*t*t?Math.cbrt(e):e/(3*t*t)+4/29}function Ye(e){let t=6/29;return e>t?e*e*e:3*t*t*(e-4/29)}function Xe(e,t,n){let r=Je(e/ot[0]),i=Je(t/ot[1]),a=Je(n/ot[2]);return[116*i-16,500*(r-i),200*(i-a)]}function Ze(e,t,n){let r=(e+16)/116,i=t/500+r,a=r-n/200;return[Ye(i)*ot[0],Ye(r)*ot[1],Ye(a)*ot[2]]}function Qe(e){return Ye((e+16)/116)}function $e(e){let t=Me(e);return t===null?[0,0,0]:[t.r,t.g,t.b]}function et(e){let[t,n,r]=$e(e),[i,a,o]=Ke(We(t),We(n),We(r)),[s,c,l]=Xe(i,a,o),u=Math.atan2(l,c)*180/Math.PI;u<0&&(u+=360);let d=Math.sqrt(c*c+l*l);return{hue:u,chroma:d,tone:Math.max(0,Math.min(100,s))}}function tt(e){let{hue:t,chroma:n,tone:r}=e;if(r<=0)return`#000000`;if(r>=100)return`#FFFFFF`;if(n<.5){let e=nt(r);return Fe(e,e,e)}let i=0,a=n,o=`#000000`;for(let e=0;e<16;e++){let e=(i+a)/2,n=rt(t,e,r);n===null?a=e:(o=n,i=e)}return o}function nt(e){return Ge(Qe(e))}function rt(e,t,n){let r=e*Math.PI/180,[i,a,o]=Ze(n,Math.cos(r)*t,Math.sin(r)*t),[s,c,l]=qe(i,a,o),u=Ge(s),d=Ge(c),f=Ge(l),p=We(u),m=We(d),h=We(f),g=.02;return Math.abs(p-s)>g||Math.abs(m-c)>g||Math.abs(h-l)>g||u<0||u>255||d<0||d>255||f<0||f>255?null:Fe(u,d,f)}function it(e,t){let n={};for(let r of st)n[r]=tt({hue:e,chroma:t,tone:r});return n}function at(e,t){return e+Math.round(t*255).toString(16).padStart(2,`0`).toUpperCase()}var ot,st,ct=o((()=>{Re(),ot=[.95047,1,1.08883],st=[0,5,10,20,30,40,50,60,70,80,90,95,99,100]}));function lt(e,t){return`light-dark(${e}, ${t})`}function ut(e){return`color-mix(in srgb, var(--color-accent) ${e*100}%, transparent)`}function dt(e,t,n,r,i,a){let o=n,s=tt({hue:e,chroma:t,tone:o});for(;He(s,i)=0&&o+r<=100;)o+=r,s=tt({hue:e,chroma:t,tone:o});return s}function ft(e){let{accent:t,neutralStyle:n=`cool`,contrast:r=`standard`}=e,i=et(t??ht),a=i.hue,o=Math.max(i.chroma,48),s=pt[n]??5,c=mt[n]??8,l=it(a,o),u=it(a,s),d=it(a,c),f=r===`high`,p=f?0:10,m=f?99:90,h=f?20:30,g=f?80:70,_=f?.2:.1,v=f?50:70,y=f?50:30,b=lt(dt(a,c,v,-1,u[99],gt),dt(a,c,y,1,u[10],gt));return{...t==null?null:{"--color-accent":lt(l[40],l[80]),"--color-accent-muted":lt(ut(.2),ut(.25)),"--color-on-accent":lt(l[100],l[20])},"--color-neutral":lt(at(u[10],.1),at(u[90],.2)),"--color-background-surface":lt(u[99],u[10]),"--color-background-body":lt(u[95],u[5]),"--color-overlay":lt(at(u[10],.4),at(u[10],.6)),"--color-overlay-hover":lt(at(u[10],.05),at(u[100],.05)),"--color-overlay-pressed":lt(at(u[10],.1),at(u[100],.1)),"--color-background-muted":lt(at(u[10],.05),at(u[10],.5)),"--color-text-primary":lt(u[p],u[m]),"--color-text-secondary":lt(d[h],d[g]),"--color-text-disabled":lt(d[60],d[40]),"--color-text-accent":`var(--color-accent)`,"--color-icon-accent":`var(--color-accent)`,"--color-icon-primary":lt(u[p],u[m]),"--color-icon-secondary":lt(d[h],d[g]),"--color-icon-disabled":lt(d[60],d[40]),"--color-background-card":lt(u[99],u[10]),"--color-background-popover":lt(u[99],u[20]),"--color-background-inverted":lt(u[10],u[99]),"--color-border":lt(at(u[10],_),at(u[95],_)),"--color-border-emphasized":b,"--color-skeleton":lt(d[70],d[30]),"--color-track":lt(d[70],d[30]),"--color-shadow":lt(at(u[0],.1),at(u[0],.3)),"--color-tint-hover":lt(`black`,`white`)}}var pt,mt,ht,gt,_t=o((()=>{Ue(),ct(),pt={warm:7,cool:5,neutral:3},mt={warm:10,cool:8,neutral:6},ht=`#0064E0`,gt=3})),vt,yt=o((()=>{vt={"--color-syntax-keyword":`var(--color-text-accent)`,"--color-syntax-string":`var(--color-text-green)`,"--color-syntax-comment":`var(--color-text-secondary)`,"--color-syntax-number":`var(--color-text-orange)`,"--color-syntax-function":`var(--color-text-blue)`,"--color-syntax-type":`var(--color-text-purple)`,"--color-syntax-variable":`var(--color-text-primary)`,"--color-syntax-operator":`var(--color-text-cyan)`,"--color-syntax-constant":`var(--color-text-orange)`,"--color-syntax-tag":`var(--color-text-red)`,"--color-syntax-attribute":`var(--color-text-teal)`,"--color-syntax-property":`var(--color-text-cyan)`,"--color-syntax-punctuation":`var(--color-text-disabled)`,"--color-syntax-background":`var(--color-background-muted)`}})),bt,xt=o((()=>{bt={"--color-data-categorical-blue":`light-dark(#0171E3, #0171E3)`,"--color-data-categorical-orange":`light-dark(#EB6E00, #EB6E00)`,"--color-data-categorical-purple":`light-dark(#6B1EFD, #6B1EFD)`,"--color-data-categorical-green":`light-dark(#0B991F, #0B991F)`,"--color-data-categorical-pink":`light-dark(#F351C0, #F351C0)`,"--color-data-categorical-cyan":`light-dark(#0171A4, #0171A4)`,"--color-data-categorical-red":`light-dark(#F5394F, #F5394F)`,"--color-data-categorical-teal":`light-dark(#08A3A3, #08A3A3)`,"--color-data-categorical-brown":`light-dark(#965E03, #965E03)`,"--color-data-categorical-indigo":`light-dark(#6F8AFF, #6F8AFF)`,"--color-data-neutral":`light-dark(#8494A3, #8C939B)`,"--color-data-blue-5":`light-dark(#02165E, #02165E)`,"--color-data-blue-4":`light-dark(#004CBC, #004CBC)`,"--color-data-blue-3":`light-dark(#2694FE, #2694FE)`,"--color-data-blue-2":`light-dark(#78BEFF, #78BEFF)`,"--color-data-blue-1":`light-dark(#DBECFF, #DBECFF)`,"--color-data-shamrock-5":`light-dark(#0B603D, #0B603D)`,"--color-data-shamrock-4":`light-dark(#138546, #138546)`,"--color-data-shamrock-3":`light-dark(#24BB5E, #24BB5E)`,"--color-data-shamrock-2":`light-dark(#8EF7AA, #8EF7AA)`,"--color-data-shamrock-1":`light-dark(#D6FEE4, #D6FEE4)`,"--color-data-orange-5":`light-dark(#A13F04, #A13F04)`,"--color-data-orange-4":`light-dark(#D66100, #D66100)`,"--color-data-orange-3":`light-dark(#FD9537, #FD9537)`,"--color-data-orange-2":`light-dark(#FDB876, #FDB876)`,"--color-data-orange-1":`light-dark(#FFE6CF, #FFE6CF)`,"--color-data-pink-5":`light-dark(#8E1073, #8E1073)`,"--color-data-pink-4":`light-dark(#D123A1, #D123A1)`,"--color-data-pink-3":`light-dark(#F989D3, #F989D3)`,"--color-data-pink-2":`light-dark(#FEADE3, #FEADE3)`,"--color-data-pink-1":`light-dark(#FCE3F4, #FCE3F4)`,"--color-data-purple-5":`light-dark(#3E0697, #3E0697)`,"--color-data-purple-4":`light-dark(#6B1EFD, #6B1EFD)`,"--color-data-purple-3":`light-dark(#9081FF, #9081FF)`,"--color-data-purple-2":`light-dark(#B3B0FE, #B3B0FE)`,"--color-data-purple-1":`light-dark(#E8E8FB, #E8E8FB)`,"--color-data-red-5":`light-dark(#9D0519, #9D0519)`,"--color-data-red-4":`light-dark(#D31130, #D31130)`,"--color-data-red-3":`light-dark(#FB7D87, #FB7D87)`,"--color-data-red-2":`light-dark(#FFB2B8, #FFB2B8)`,"--color-data-red-1":`light-dark(#FEE4E6, #FEE4E6)`,"--color-data-teal-5":`light-dark(#08767D, #08767D)`,"--color-data-teal-4":`light-dark(#0C9293, #0C9293)`,"--color-data-teal-3":`light-dark(#0DB7AF, #0DB7AF)`,"--color-data-teal-2":`light-dark(#6CE6D8, #6CE6D8)`,"--color-data-teal-1":`light-dark(#D7FCF8, #D7FCF8)`,"--color-data-yellow-5":`light-dark(#8A5001, #8A5001)`,"--color-data-yellow-4":`light-dark(#D69804, #D69804)`,"--color-data-yellow-3":`light-dark(#FBCE03, #FBCE03)`,"--color-data-yellow-2":`light-dark(#FCEC85, #FCEC85)`,"--color-data-yellow-1":`light-dark(#FDF6BA, #FDF6BA)`,"--color-data-gray-5":`light-dark(#25363F, #333338)`,"--color-data-gray-4":`light-dark(#5D6C7B, #666A72)`,"--color-data-gray-3":`light-dark(#AFB9C4, #B2B8BE)`,"--color-data-gray-2":`light-dark(#CCD3DB, #D0D3D6)`,"--color-data-gray-1":`light-dark(#F1F4F7, #F2F4F6)`}})),St,Ct=o((()=>{yt(),xt(),St={...vt,...bt}}));function wt(e){Tt.set(e.name,e)}var Tt,Et=o((()=>{Tt=new Map}));function Dt(e){return e===`base`?``:e.split(`+`).map(e=>{let[t,n]=e.split(`:`);return n===void 0?`.${t}`:/^\d/.test(n)?`.${t}-${n}`:`.${n}`}).join(``)}var Ot=o((()=>{}));function kt(e,t){let n=At[e];return n?n.filter(e=>e.property===t):[]}var At,jt=o((()=>{At={banner:[{property:`borderRadius`,vars:[`--_banner-radius`]}],button:[{property:`borderRadius`,vars:[`--_button-radius`]}],card:[{property:`borderRadius`,vars:[`--_card-radius`]},{property:`padding`,expand:`container`}],chat:[{property:`borderRadius`,vars:[`--_chat-composer-radius`]},{property:`padding`,vars:[`--_chat-composer-padding`]}],dialog:[{property:`borderRadius`,vars:[`--_dialog-radius`]},{property:`padding`,expand:`container`}],"dropdown-menu":[{property:`borderRadius`,vars:[`--_dropdown-menu-radius`]},{property:`padding`,vars:[`--_dropdown-menu-padding`]}],field:[{property:`borderRadius`,vars:[`--_field-radius`]}],hovercard:[{property:`borderRadius`,vars:[`--_hovercard-radius`]}],popover:[{property:`borderRadius`,vars:[`--_popover-radius`]}],"progressbar-mark":[{property:`width`,vars:[`--_progressbar-mark-width`],replaces:!0},{property:`height`,vars:[`--_progressbar-mark-height`],replaces:!0}],section:[{property:`padding`,expand:`container`}],"segmented-control":[{property:`borderRadius`,vars:[`--_segmented-control-radius`]},{property:`padding`,vars:[`--_segmented-control-padding`]}],textarea:[{property:`paddingInline`,vars:[`--_textarea-inline-padding`],replaces:!0}]}}));function Mt(e){return`data-${It}-${e}`}function Nt(e){return`--${Lt}-${e}`}var Pt,Ft,It,Lt,Rt=o((()=>{Pt=`astryx`,Ft=Pt,It=Pt,Lt=Pt}));function zt(e){return`[data-${It}-theme="${e}"]`}function Bt(e){return`[data-${It}-media="${e}"]`}function Vt(e,t){return`.${Ft}-${e}${t}`}function Ht(e,t){let n=[],r=0,i=0;for(let t=0;t`${e}${t}`).join(`, `)}function Ut(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Wt(e){let t={};for(let[n,r]of e)switch(n){case`padding`:{let e=r.trim().split(/\s+/);e.length===1?(t.blockStart=e[0],t.blockEnd=e[0],t.inline=e[0]):e.length===2?(t.blockStart=e[0],t.blockEnd=e[0],t.inline=e[1]):e.length>=3&&(t.blockStart=e[0],t.inline=e[1],t.blockEnd=e[2]);break}case`paddingBlock`:{let e=r.trim().split(/\s+/);t.blockStart=e[0],t.blockEnd=e[1]??e[0];break}case`paddingInline`:{let e=r.trim().split(/\s+/);e.length===1?t.inline=e[0]:(t.inlineStart=e[0],t.inlineEnd=e[1]);break}case`paddingBlockStart`:t.blockStart=r;break;case`paddingBlockEnd`:t.blockEnd=r;break;case`paddingInlineStart`:t.inlineStart=r;break;case`paddingInlineEnd`:t.inlineEnd=r}return t}function Gt(e,t){let n=Nt(`${e}-padding`),r=[],i=t.inlineStart??t.inline,a=t.inlineEnd??t.inline;return i!=null&&a!=null&&i===a&&t.blockStart!=null&&t.blockEnd!=null&&i===t.blockStart&&t.blockStart===t.blockEnd?(r.push([n,i??``]),r):(t.inlineStart!=null||t.inlineEnd!=null?(i!=null&&r.push([`${n}-inline-start`,i]),a!=null&&r.push([`${n}-inline-end`,a])):t.inline!=null&&r.push([`${n}-inline`,t.inline]),t.blockStart!=null&&r.push([`${n}-block-start`,t.blockStart]),t.blockEnd!=null&&r.push([`${n}-block-end`,t.blockEnd]),r)}function Kt(e){let t=[],n=e.tokens,r=e=>n[e]||`var(${e})`,i=Object.entries(n);if(i.length>0){let e=i.map(([e,t])=>` ${e}: ${t};`).join(` +`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(M)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.textContent,a=i.length;for(e=0;e=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=xn(),bn=yn=vn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Fr=M&&`documentMode`in document&&11>=document.documentMode,Ir=null,Lr=null,Rr=null,zr=!1;function Br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zr||Ir==null||Ir!==Ut(r)||(r=Ir,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rr&&kr(Rr,r)||(Rr=r,r=Ad(Lr,`onSelect`),0>=o,i-=o,Ai=1<<32-We(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),zi&&Mi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),zi&&Mi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return zi&&Mi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),zi&&Mi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Na(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ba(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=_i(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=gi(o.type,o.key,o.props,null,e.mode,c),Ba(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=bi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Na(o),b(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,za(o),c);if(o.$$typeof===C)return b(e,r,sa(e,o),c);Va(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ra=0;var i=b(e,t,n,r);return La=null,i}catch(t){if(t===Da||t===ka)throw t;var a=fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ua=Ha(!0),Wa=Ha(!1),Ga=!1;function Ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=li(e),ci(e,null,n),t}return ai(e,r,t,n),li(e)}function Xa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qa=!1;function $a(){if(Qa){var e=va;if(e!==null)throw e}}function eo(e,t,n,r){Qa=!1;var i=e.updateQueue;Ga=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Hl&f)===f:(r&f)===f){f!==0&&f===_a&&(Qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ga=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Xl|=o,e.lanes=o,e.memoizedState=d}}function to(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function no(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=k.T,s={};k.T=s,Ps(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,xa(c,r),_u(e)):Ns(e,t,r,_u(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ts(e).queue;U(e,a,t,se,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},_u())}function Ds(){return oa(tp)}function Os(){return Ro().memoizedState}function ks(){return Ro().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=Ja(n);var r=Ya(t,e,n);r!==null&&(yu(r,t,n),Xa(r,t,n)),t={cache:pa()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=oi(e,t,n,r),n!==null&&(yu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,_u())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o))return ai(e,t,i,0),Bl===null&&ii(),!1}catch{}if(n=oi(e,t,i,r),n!==null)return yu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(i(479))}else t=oi(e,n,r,2),t!==null&&yu(t,e,2)}function Fs(e){var t=e.alternate;return e===F||t!==null&&t===F}function Is(e,t){So=xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Rs={readContext:oa,use:Vo,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useLayoutEffect:Oo,useInsertionEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useSyncExternalStore:Oo,useId:Oo,useHostTransitionStatus:Oo,useFormState:Oo,useActionState:Oo,useOptimistic:Oo,useMemoCache:Oo,useCacheRefresh:Oo};Rs.useEffectEvent=Oo;var zs={readContext:oa,use:Vo,useCallback:function(e,t){return Lo().memoizedState=[e,t===void 0?null:t],e},useContext:oa,useEffect:V,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Lo();t=t===void 0?null:t;var r=e();if(Co){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Lo();if(n!==void 0){var i=n(t);if(Co){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=Lo();return e={current:e},t.memoizedState=e},useState:function(e){e=Qo(e);var t=e.queue,n=Ms.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return xs(Lo(),e,t)},useTransition:function(){var e=Qo(!1);return e=U.bind(null,F,e.queue,!0,!1),Lo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,a=Lo();if(zi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));Hl&127||qo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,V(Yo.bind(null,r,o,e),[e]),r.flags|=2048,B(9,{destroy:void 0},Jo.bind(null,r,o,n,t),null),n},useId:function(){var e=Lo(),t=Bl.identifierPrefix;if(zi){var n=ji,r=Ai;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=wo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Li,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Ui(t,!0)}else e=Wd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ki(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ho(t),t):(ho(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ki(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ho(t),t):(ho(t),null)}return ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return _e(),e===null&&Dd(t.stateNode.containerInfo),Lc(t),null;case 10:return ea(t.type),Lc(t),null;case 19:if(ue(go),r=t.memoizedState,r===null)return Lc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Ic(r,!1);else{if(Yl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=_o(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)hi(n,e),n=n.sibling;return de(go,go.current&1|2),zi&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>ou&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}}else{if(!a){if(e=_o(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!zi)return Lc(t),null}else 2*Me()-r.renderingStartTime>ou&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=go.current,de(go,a?n&1|2:n&1),zi&&Mi(t,r.treeForkCount),e);case 22:case 23:return ho(t),so(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ue(Ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ea(fa),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(fa),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(ho(t),t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(go),null;case 4:return _e(),null;case 10:return ea(t.type),null;case 22:case 23:return ho(t),so(),e!==null&&ue(Ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(fa),null;case 25:return null;default:return null}}function Bc(e,t){switch(Fi(t),t.tag){case 3:ea(fa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&ho(t);break;case 13:ho(t);break;case 19:ue(go);break;case 10:ea(t.type);break;case 22:case 23:ho(t),so(),e!==null&&ue(Ca);break;case 24:ea(fa)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{no(t,n)}catch(t){Ju(e,e.return,t)}}}function Wc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[mt]=t}catch(t){Ju(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[pt]=e,t[mt]=n}catch(t){Ju(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Y=up,e=Nr(e),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ud={focusedElem:e,selectionRange:n},up=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),zd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=Wf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=jr(s,h),v=jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,k.T=null,n=pu,pu=null;var o=uu,s=fu;if(lu=0,du=uu=null,fu=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),El(o,o.current,s,n),zl=c,cd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{A.p=a,k.T=r,Wu(e,t)}}function qu(e,t,n){t=Si(n,t),t=Qs(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(rt(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cu===null||!cu.has(r))){e=Si(n,e),n=$s(2),r=Ya(t,n,2),r!==null&&(ec(n,r,t,e),rt(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ql=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(Hl&n)===n&&(Yl===4||Yl===3&&(Hl&62914560)===Hl&&300>Me()-iu?!(zl&2)&&Eu(e,0):Ql|=n,eu===Hl&&(eu=0)),sd(e)}function Zu(e,t){t===0&&(t=tt()),e=si(e,t),e!==null&&(rt(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return Oe(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Hl,a=Qe(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,pd(r,a))}r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Yd()&&(e=od);for(var t=Me(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}lu!==0&&lu!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),X.has(i)||(X.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Nf(e);break;case`script`:a=Lf(e)}vf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),zd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!vf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=Tt(r).hoistableStyles,a=Nf(e);t=t||`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);Et(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=Tt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=m({src:e,async:!0},t),(t=vf.get(i))&&Hf(e,t),a=n.createElement(`script`),Et(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=Tt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Hf(e,t),a=n.createElement(`script`),Et(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=me.current)?yf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Nf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Nf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vf.set(e,n),o||If(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Lf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return`href="`+Gt(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),Et(t),e.head.appendChild(t))}function Lf(e){return`[src="`+Gt(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),zd(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Ff(n),(a=vf.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,Et(a),a):(r=n,(a=vf.get(o))&&(r=m({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Bf(r,n.precedence,e));return t.instance}function Bf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Kf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Jf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Ff(r),(i=vf.get(i))&&Vf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Zf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v,y,b=o((()=>{v=l(d(),1),y=typeof window<`u`?v.useLayoutEffect:v.useEffect}));function x(){if(w)return C;w=1,Object.defineProperty(C,"__esModule",{value:!0}),C.styleq=void 0;var e=new WeakMap,t=`$$css`;function n(n){var r,i,a;return n!=null&&(r=n.disableCache===!0,i=n.disableMix===!0,a=n.transform),function(){for(var n=[],o=``,s=null,c=``,l=r?null:e,u=Array(arguments.length),d=0;d0;){var f=u.pop();if(f!=null&&f!==!1){if(Array.isArray(f)){for(var p=0;p0&&(i.style=n),r!=null&&r!==``&&(i[`data-style-src`]=r),i}var C,w,ee,te=o((()=>{C={},ee=x(),Object.freeze({})})),ne,T,re,E,D,ie,ae,O,oe,k,A,se,ce=o((()=>{ne={"--color-accent":`light-dark(#0064E0, #2694FE)`,"--color-accent-muted":`light-dark(#0082FB33, #0082FB3F)`,"--color-on-accent":`light-dark(#FFFFFF, #FFFFFF)`,"--color-neutral":`light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))`,"--color-background-surface":`light-dark(#FFFFFF, #1F1F22)`,"--color-background-body":`light-dark(#F1F4F7, #111112)`,"--color-overlay":`light-dark(#01122866, #11111299)`,"--color-overlay-hover":`light-dark(#0536590C, #FFFFFF0C)`,"--color-overlay-pressed":`light-dark(#05365919, #FFFFFF19)`,"--color-background-muted":`light-dark(#0536590C, #1111127F)`,"--color-text-primary":`light-dark(#0A1317, #DFE2E5)`,"--color-text-secondary":`light-dark(#4E606F, #AAAFB5)`,"--color-text-disabled":`light-dark(#A4B0BC, #6F747C)`,"--color-text-accent":`light-dark(#0064E0, #3E9EFB)`,"--color-on-dark":`light-dark(#FFFFFF, #FFFFFF)`,"--color-on-light":`light-dark(#000000, #000000)`,"--color-icon-accent":`light-dark(#0064E0, #2694FE)`,"--color-icon-primary":`light-dark(#0A1317, #DFE2E5)`,"--color-icon-secondary":`light-dark(#4E606F, #AAAFB5)`,"--color-icon-disabled":`light-dark(#A4B0BC, #6F747C)`,"--color-background-card":`light-dark(#FFFFFF, #1F1F22)`,"--color-background-popover":`light-dark(#FFFFFF, #28292C)`,"--color-background-inverted":`light-dark(#0A1317, #FFFFFF)`,"--color-background-error-inverted":`light-dark(#AA071E, #E3193B)`,"--color-success":`light-dark(#0D8626, #0D8626)`,"--color-success-muted":`light-dark(#0B991F33, #0B991F3F)`,"--color-on-success":`light-dark(#FFFFFF, #FFFFFF)`,"--color-error":`light-dark(#E3193B, #F5394F)`,"--color-error-muted":`light-dark(#E3193B33, #F5394F3F)`,"--color-on-error":`light-dark(#FFFFFF, #FFFFFF)`,"--color-warning":`light-dark(#E9AF08, #F2C00B)`,"--color-warning-muted":`light-dark(#E2A40033, #E2A4003F)`,"--color-on-warning":`light-dark(#0A1317, #0A1317)`,"--color-border":`light-dark(#05365919, #F2F4F619)`,"--color-border-emphasized":`light-dark(#CCD3DB, #494D53)`,"--color-skeleton":`light-dark(#CCD3DB, #5A5E66)`,"--color-track":`light-dark(#CCD3DB, #5A5E66)`,"--color-shadow":`light-dark(rgba(5, 54, 89, 0.1), rgba(0, 0, 0, 0.3))`,"--color-tint-hover":`light-dark(black, white)`,"--color-background-blue":`light-dark(#0171E333, #0171E333)`,"--color-border-blue":`light-dark(#0064E0, #2694FE)`,"--color-icon-blue":`light-dark(#0064E0, #2694FE)`,"--color-text-blue":`light-dark(#042F97, #AFD7FF)`,"--color-background-cyan":`light-dark(#03A7D733, #03A7D733)`,"--color-border-cyan":`light-dark(#089DD0, #0171A4)`,"--color-icon-cyan":`light-dark(#00ACC1, #26C6DA)`,"--color-text-cyan":`light-dark(#014975, #A1EEF9)`,"--color-background-gray":`light-dark(#0A131733, #666A724C)`,"--color-border-gray":`light-dark(#647685, #748695)`,"--color-icon-gray":`light-dark(#4E606F, #AAAFB5)`,"--color-text-gray":`light-dark(#0A1317, #E7EAED)`,"--color-background-green":`light-dark(#24BB5E33, #24BB5E33)`,"--color-border-green":`light-dark(#0D8626, #0B991F)`,"--color-icon-green":`light-dark(#0D8626, #26A756)`,"--color-text-green":`light-dark(#09441F, #A5F690)`,"--color-background-orange":`light-dark(#F2790233, #F2790233)`,"--color-border-orange":`light-dark(#EB6E00, #B34A01)`,"--color-icon-orange":`light-dark(#E9690B, #FB8C00)`,"--color-text-orange":`light-dark(#6B2203, #FDB876)`,"--color-background-pink":`light-dark(#E638B333, #E638B333)`,"--color-border-pink":`light-dark(#F351C0, #C02294)`,"--color-icon-pink":`light-dark(#C2185B, #EC407A)`,"--color-text-pink":`light-dark(#650053, #FEADE3)`,"--color-background-purple":`light-dark(#7952FF33, #7952FF33)`,"--color-border-purple":`light-dark(#9081FF, #7340FE)`,"--color-icon-purple":`light-dark(#5B08D8, #7952FF)`,"--color-text-purple":`light-dark(#3E0697, #B3B0FE)`,"--color-background-red":`light-dark(#E3193B33, #E3193B33)`,"--color-border-red":`light-dark(#E3193B, #F5394F)`,"--color-icon-red":`light-dark(#D31130, #E3193B)`,"--color-text-red":`light-dark(#7B0210, #FFB2B8)`,"--color-background-teal":`light-dark(#0DB7AF33, #0DB7AF33)`,"--color-border-teal":`light-dark(#08A3A3, #08767D)`,"--color-icon-teal":`light-dark(#009688, #26A69A)`,"--color-text-teal":`light-dark(#083943, #40DCCD)`,"--color-background-yellow":`light-dark(#E2A40033, #E2A40033)`,"--color-border-yellow":`light-dark(#C58600, #B47700)`,"--color-icon-yellow":`light-dark(#FBC02D, #FFEE58)`,"--color-text-yellow":`light-dark(#753F07, #FBCE03)`},T={"--spacing-0":`0px`,"--spacing-0-5":`2px`,"--spacing-1":`4px`,"--spacing-1-5":`6px`,"--spacing-2":`8px`,"--spacing-3":`12px`,"--spacing-4":`16px`,"--spacing-5":`20px`,"--spacing-6":`24px`,"--spacing-7":`28px`,"--spacing-8":`32px`,"--spacing-9":`36px`,"--spacing-10":`40px`,"--spacing-11":`44px`,"--spacing-12":`48px`},re={"--size-element-sm":`28px`,"--size-element-md":`32px`,"--size-element-lg":`36px`},E={"--focus-outline-width":`2px`,"--focus-outline-style":`solid`,"--focus-outline-color":`var(--color-accent)`,"--focus-outline-offset":`3px`},D={"--radius-none":`0px`,"--radius-inner":`4px`,"--radius-element":`8px`,"--radius-container":`12px`,"--radius-page":`28px`,"--radius-chat":`28px`,"--radius-full":`9999px`},ie={"--shadow-low":`0px 1px 1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))`,"--shadow-med":`0px 1px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 12px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))`,"--shadow-high":`0px 2px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 8px 24px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3))`,"--shadow-inset-hover":`inset 0px 0px 0px 2px light-dark(rgba(5, 54, 89, 0.15), rgba(223, 226, 229, 0.2))`,"--shadow-inset-selected":`inset 0px 0px 0px 2px rgba(1, 113, 227, 0.5)`,"--shadow-inset-success":`inset 0px 0px 0px 2px rgba(38, 167, 86, 0.3)`,"--shadow-inset-warning":`inset 0px 0px 0px 2px rgba(226, 164, 0, 0.3)`,"--shadow-inset-error":`inset 0px 0px 0px 2px rgba(227, 25, 59, 0.3)`},ae={"--duration-fast-min":`130ms`,"--duration-fast":`175ms`,"--duration-fast-max":`230ms`,"--duration-medium-min":`310ms`,"--duration-medium":`410ms`,"--duration-medium-max":`550ms`,"--duration-slow-min":`730ms`,"--duration-slow":`975ms`,"--duration-slow-max":`1300ms`},O={"--ease-standard":`cubic-bezier(0.24, 1, 0.4, 1)`},oe={"--font-family-body":`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,"--font-family-code":`"SF Mono", Monaco, Consolas, monospace`,"--font-family-heading":`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`},k={"--font-size-4xs":`0.375rem`,"--font-size-3xs":`0.4375rem`,"--font-size-2xs":`0.5rem`,"--font-size-xs":`0.625rem`,"--font-size-sm":`0.75rem`,"--font-size-base":`0.875rem`,"--font-size-lg":`1.0625rem`,"--font-size-xl":`1.25rem`,"--font-size-2xl":`1.5rem`,"--font-size-3xl":`1.8125rem`,"--font-size-4xl":`2.1875rem`,"--font-size-5xl":`2.625rem`},A={"--font-weight-normal":`400`,"--font-weight-medium":`500`,"--font-weight-semibold":`600`,"--font-weight-bold":`700`},se={"--text-heading-1-size":`var(--font-size-2xl)`,"--text-heading-1-weight":`var(--font-weight-semibold)`,"--text-heading-1-leading":`1.3333`,"--text-heading-2-size":`var(--font-size-xl)`,"--text-heading-2-weight":`var(--font-weight-semibold)`,"--text-heading-2-leading":`1.4`,"--text-heading-3-size":`var(--font-size-lg)`,"--text-heading-3-weight":`var(--font-weight-semibold)`,"--text-heading-3-leading":`1.4118`,"--text-heading-4-size":`var(--font-size-base)`,"--text-heading-4-weight":`var(--font-weight-semibold)`,"--text-heading-4-leading":`1.4286`,"--text-heading-5-size":`var(--font-size-sm)`,"--text-heading-5-weight":`var(--font-weight-semibold)`,"--text-heading-5-leading":`1.6667`,"--text-heading-6-size":`var(--font-size-xs)`,"--text-heading-6-weight":`var(--font-weight-semibold)`,"--text-heading-6-leading":`1.6`,"--text-body-size":`var(--font-size-base)`,"--text-body-weight":`var(--font-weight-normal)`,"--text-body-leading":`1.4286`,"--text-large-size":`var(--font-size-lg)`,"--text-large-weight":`var(--font-weight-semibold)`,"--text-large-leading":`1.4118`,"--text-label-size":`var(--font-size-base)`,"--text-label-weight":`var(--font-weight-medium)`,"--text-label-leading":`1.4286`,"--text-code-size":`var(--font-size-base)`,"--text-code-weight":`var(--font-weight-normal)`,"--text-code-leading":`1.4286`,"--text-supporting-size":`var(--font-size-sm)`,"--text-supporting-weight":`var(--font-weight-normal)`,"--text-supporting-leading":`1.6667`,"--text-display-1-size":`var(--font-size-5xl)`,"--text-display-1-weight":`var(--font-weight-normal)`,"--text-display-1-leading":`1.2381`,"--text-display-2-size":`var(--font-size-4xl)`,"--text-display-2-weight":`var(--font-weight-normal)`,"--text-display-2-leading":`1.2571`,"--text-display-3-size":`var(--font-size-3xl)`,"--text-display-3-weight":`var(--font-weight-normal)`,"--text-display-3-leading":`1.2414`}}));function j(e){return Array.isArray(e)?`light-dark(${e[0]}, ${e[1]})`:e}function le(e,t){let n={...e===`dark`?ue:de};if(t?.tokens)for(let[e,r]of Object.entries(t.tokens))r!==void 0&&(n[e]=j(r));return{tokens:n,components:t?.components}}var ue,de,fe=o((()=>{ue={"color-scheme":`dark`,"--color-text-primary":`var(--color-on-dark)`,"--color-icon-primary":`var(--color-on-dark)`,"--color-accent":`var(--color-on-dark)`},de={"color-scheme":`light`,"--color-text-primary":`var(--color-on-light)`,"--color-icon-primary":`var(--color-on-light)`,"--color-accent":`var(--color-on-light)`}}));function pe(e,t,n){return Math.round(e*t**+n)}function me(e){return`${Math.round(e/16*1e4)/1e4}rem`}function he(e){return e<20?1.5:e<32?1.4:1.25}function ge(e){let t=e*he(e),n=Math.max(Math.round(t/4)*4,Math.ceil((e+4)/4)*4);return Math.round(n/e*1e4)/1e4}function _e(e){let{base:t,ratio:n,weights:r}=e,i={},a={...Se,...r?.heading},o={...Ce,...r?.text};for(let e=-5;e<=6;e++){let r=pe(t,n,e);i[ye[e]]=me(r)}for(let[e,r]of Object.entries(be)){let o=Number(e),s=ge(pe(t,n,r));i[`--text-heading-${o}-size`]=`var(${ye[r]})`,i[`--text-heading-${o}-weight`]=a[o],i[`--text-heading-${o}-leading`]=`${s}`}for(let[e,r]of Object.entries(xe)){let a=ge(pe(t,n,r));i[`--text-${e}-size`]=`var(${ye[r]})`,i[`--text-${e}-weight`]=o[e],i[`--text-${e}-leading`]=`${a}`}return i}function ve(e){let t={},n={};for(let e of[1,2,3,4,5,6])n[`level:${e}`]={fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-${e}-size)`,fontWeight:`var(--text-heading-${e}-weight)`,lineHeight:`var(--text-heading-${e}-leading)`};for(let e of[`display-1`,`display-2`,`display-3`])n[`type:${e}`]={fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-${e}-size)`,lineHeight:`var(--text-${e}-leading)`};t.heading=n;let r={};for(let e of[`body`,`large`,`label`,`code`,`supporting`,`display-1`,`display-2`,`display-3`])r[`type:${e}`]={fontFamily:we[e],fontSize:`var(--text-${e}-size)`,lineHeight:`var(--text-${e}-leading)`};return t.text=r,t}var ye,be,xe,Se,Ce,we,Te=o((()=>{ye={[-5]:`--font-size-4xs`,[-4]:`--font-size-3xs`,[-3]:`--font-size-2xs`,[-2]:`--font-size-xs`,[-1]:`--font-size-sm`,0:`--font-size-base`,1:`--font-size-lg`,2:`--font-size-xl`,3:`--font-size-2xl`,4:`--font-size-3xl`,5:`--font-size-4xl`,6:`--font-size-5xl`},be={1:3,2:2,3:1,4:0,5:-1,6:-2},xe={body:0,large:1,label:0,code:0,supporting:-1,"display-1":6,"display-2":5,"display-3":4},Se={1:`var(--font-weight-semibold)`,2:`var(--font-weight-semibold)`,3:`var(--font-weight-semibold)`,4:`var(--font-weight-semibold)`,5:`var(--font-weight-semibold)`,6:`var(--font-weight-semibold)`},Ce={body:`var(--font-weight-normal)`,large:`var(--font-weight-semibold)`,label:`var(--font-weight-medium)`,code:`var(--font-weight-normal)`,supporting:`var(--font-weight-normal)`,"display-1":`var(--font-weight-normal)`,"display-2":`var(--font-weight-normal)`,"display-3":`var(--font-weight-normal)`},we={body:`var(--font-family-body)`,large:`var(--font-family-body)`,label:`var(--font-family-body)`,code:`var(--font-family-code)`,supporting:`var(--font-family-body)`,"display-1":`var(--font-family-heading)`,"display-2":`var(--font-family-heading)`,"display-3":`var(--font-family-heading)`}}));function Ee(e){return Math.round(e/5)*5}function De(e){let{fast:t,medium:n,slow:r,ratio:i,easing:a}=e,o={"--duration-fast-min":`${Ee(t*i)}ms`,"--duration-fast":`${Ee(t)}ms`,"--duration-fast-max":`${Ee(t/i)}ms`,"--duration-medium-min":`${Ee(n*i)}ms`,"--duration-medium":`${Ee(n)}ms`,"--duration-medium-max":`${Ee(n/i)}ms`};return r!=null&&(o[`--duration-slow-min`]=`${Ee(r*i)}ms`,o[`--duration-slow`]=`${Ee(r)}ms`,o[`--duration-slow-max`]=`${Ee(r/i)}ms`),a&&(o[`--ease-standard`]=a),o}var Oe=o((()=>{}));function ke(e){let{base:t,multiplier:n}=e;return{"--radius-none":`0px`,"--radius-inner":`${Math.round(t*1*n)}px`,"--radius-element":`${Math.round(t*2*n)}px`,"--radius-container":`${Math.round(t*3*n)}px`,"--radius-page":`${Math.round(t*7*n)}px`,"--radius-chat":`${Math.round(t*7*n)}px`,"--radius-full":`9999px`}}var Ae=o((()=>{}));function je(e){return e.split(``).map(e=>e+e).join(``)}function Me(e){if(typeof e!=`string`)return null;let t=e.trim().replace(/^#/,``),n=t.length===3||t.length===4?je(t):t;return n.length!==6&&n.length!==8||!/^[0-9a-fA-F]+$/.test(n)?null:{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:n.length===8?parseInt(n.slice(6,8),16)/255:1}}function Ne(e){let t=e.indexOf(`(`);if(t===-1||!e.trim().endsWith(`)`))return null;let n=e.slice(t+1,e.lastIndexOf(`)`)).replace(/\//g,` `).split(/[\s,]+/).map(e=>e.trim()).filter(Boolean);if(n.length<3)return null;let r=e=>{let t=e.endsWith(`%`)?parseFloat(e)/100*255:parseFloat(e);return Le(t,0,255)},i=r(n[0]),a=r(n[1]),o=r(n[2]);if([i,a,o].some(Number.isNaN))return null;let s=1;if(n.length>=4){let e=n[3];if(s=e.endsWith(`%`)?parseFloat(e)/100:parseFloat(e),Number.isNaN(s))return null;s=Le(s,0,1)}return{r:i,g:a,b:o,a:s}}function Pe(e){let t=e.trim(),n=Ie[t.toLowerCase()];return n?{...n}:t.startsWith(`#`)?Me(t):/^rgba?\(/i.test(t)?Ne(t):null}function Fe(e,t,n){let r=e=>Le(Math.round(e),0,255).toString(16).padStart(2,`0`).toUpperCase();return`#${r(e)}${r(t)}${r(n)}`}var Ie,Le,Re=o((()=>{Ie={transparent:{r:0,g:0,b:0,a:0},black:{r:0,g:0,b:0,a:1},white:{r:255,g:255,b:255,a:1}},Le=(e,t,n)=>Math.max(t,Math.min(n,e))}));function ze(e){let t=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function Be(e,t){let n=e.a;return{r:e.r*n+t.r*(1-n),g:e.g*n+t.g*(1-n),b:e.b*n+t.b*(1-n),a:1}}function Ve(e,t){if(typeof e!=`string`)return e;let n=Pe(e);if(n===null)throw TypeError(`contrastRatio: could not parse ${t} "${e}"`);return n}function He(e,t){let n=Ve(t,`background`);if(n.a<1)throw TypeError(`contrastRatio: background must be opaque — composite it over its backdrop first`);let r=Ve(e,`foreground`);r.a<1&&(r=Be(r,n));let i=ze(r),a=ze(n),o=Math.max(i,a),s=Math.min(i,a);return(o+.05)/(s+.05)}var Ue=o((()=>{Re()}));function We(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ge(e){let t=e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055;return Math.round(Math.min(255,Math.max(0,t*255)))}function Ke(e,t,n){return[.4124564*e+.3575761*t+.1804375*n,.2126729*e+.7151522*t+.072175*n,.0193339*e+.119192*t+.9503041*n]}function qe(e,t,n){return[3.2404542*e-1.5371385*t-.4985314*n,-.969266*e+1.8760108*t+.041556*n,.0556434*e-.2040259*t+1.0572252*n]}function Je(e){let t=6/29;return e>t*t*t?Math.cbrt(e):e/(3*t*t)+4/29}function Ye(e){let t=6/29;return e>t?e*e*e:3*t*t*(e-4/29)}function Xe(e,t,n){let r=Je(e/ot[0]),i=Je(t/ot[1]),a=Je(n/ot[2]);return[116*i-16,500*(r-i),200*(i-a)]}function Ze(e,t,n){let r=(e+16)/116,i=t/500+r,a=r-n/200;return[Ye(i)*ot[0],Ye(r)*ot[1],Ye(a)*ot[2]]}function Qe(e){return Ye((e+16)/116)}function $e(e){let t=Me(e);return t===null?[0,0,0]:[t.r,t.g,t.b]}function et(e){let[t,n,r]=$e(e),[i,a,o]=Ke(We(t),We(n),We(r)),[s,c,l]=Xe(i,a,o),u=Math.atan2(l,c)*180/Math.PI;u<0&&(u+=360);let d=Math.sqrt(c*c+l*l);return{hue:u,chroma:d,tone:Math.max(0,Math.min(100,s))}}function tt(e){let{hue:t,chroma:n,tone:r}=e;if(r<=0)return`#000000`;if(r>=100)return`#FFFFFF`;if(n<.5){let e=nt(r);return Fe(e,e,e)}let i=0,a=n,o=`#000000`;for(let e=0;e<16;e++){let e=(i+a)/2,n=rt(t,e,r);n===null?a=e:(o=n,i=e)}return o}function nt(e){return Ge(Qe(e))}function rt(e,t,n){let r=e*Math.PI/180,[i,a,o]=Ze(n,Math.cos(r)*t,Math.sin(r)*t),[s,c,l]=qe(i,a,o),u=Ge(s),d=Ge(c),f=Ge(l),p=We(u),m=We(d),h=We(f),g=.02;return Math.abs(p-s)>g||Math.abs(m-c)>g||Math.abs(h-l)>g||u<0||u>255||d<0||d>255||f<0||f>255?null:Fe(u,d,f)}function it(e,t){let n={};for(let r of st)n[r]=tt({hue:e,chroma:t,tone:r});return n}function at(e,t){return e+Math.round(t*255).toString(16).padStart(2,`0`).toUpperCase()}var ot,st,ct=o((()=>{Re(),ot=[.95047,1,1.08883],st=[0,5,10,20,30,40,50,60,70,80,90,95,99,100]}));function lt(e,t){return`light-dark(${e}, ${t})`}function ut(e){return`color-mix(in srgb, var(--color-accent) ${e*100}%, transparent)`}function dt(e,t,n,r,i,a){let o=n,s=tt({hue:e,chroma:t,tone:o});for(;He(s,i)=0&&o+r<=100;)o+=r,s=tt({hue:e,chroma:t,tone:o});return s}function ft(e){let{accent:t,neutralStyle:n=`cool`,contrast:r=`standard`}=e,i=et(t??ht),a=i.hue,o=Math.max(i.chroma,48),s=pt[n]??5,c=mt[n]??8,l=it(a,o),u=it(a,s),d=it(a,c),f=r===`high`,p=f?0:10,m=f?99:90,h=f?20:30,g=f?80:70,_=f?.2:.1,v=f?50:70,y=f?50:30,b=lt(dt(a,c,v,-1,u[99],gt),dt(a,c,y,1,u[10],gt));return{...t==null?null:{"--color-accent":lt(l[40],l[80]),"--color-accent-muted":lt(ut(.2),ut(.25)),"--color-on-accent":lt(l[100],l[20])},"--color-neutral":lt(at(u[10],.1),at(u[90],.2)),"--color-background-surface":lt(u[99],u[10]),"--color-background-body":lt(u[95],u[5]),"--color-overlay":lt(at(u[10],.4),at(u[10],.6)),"--color-overlay-hover":lt(at(u[10],.05),at(u[100],.05)),"--color-overlay-pressed":lt(at(u[10],.1),at(u[100],.1)),"--color-background-muted":lt(at(u[10],.05),at(u[10],.5)),"--color-text-primary":lt(u[p],u[m]),"--color-text-secondary":lt(d[h],d[g]),"--color-text-disabled":lt(d[60],d[40]),"--color-text-accent":`var(--color-accent)`,"--color-icon-accent":`var(--color-accent)`,"--color-icon-primary":lt(u[p],u[m]),"--color-icon-secondary":lt(d[h],d[g]),"--color-icon-disabled":lt(d[60],d[40]),"--color-background-card":lt(u[99],u[10]),"--color-background-popover":lt(u[99],u[20]),"--color-background-inverted":lt(u[10],u[99]),"--color-border":lt(at(u[10],_),at(u[95],_)),"--color-border-emphasized":b,"--color-skeleton":lt(d[70],d[30]),"--color-track":lt(d[70],d[30]),"--color-shadow":lt(at(u[0],.1),at(u[0],.3)),"--color-tint-hover":lt(`black`,`white`)}}var pt,mt,ht,gt,_t=o((()=>{Ue(),ct(),pt={warm:7,cool:5,neutral:3},mt={warm:10,cool:8,neutral:6},ht=`#0064E0`,gt=3})),vt,yt=o((()=>{vt={"--color-syntax-keyword":`var(--color-text-accent)`,"--color-syntax-string":`var(--color-text-green)`,"--color-syntax-comment":`var(--color-text-secondary)`,"--color-syntax-number":`var(--color-text-orange)`,"--color-syntax-function":`var(--color-text-blue)`,"--color-syntax-type":`var(--color-text-purple)`,"--color-syntax-variable":`var(--color-text-primary)`,"--color-syntax-operator":`var(--color-text-cyan)`,"--color-syntax-constant":`var(--color-text-orange)`,"--color-syntax-tag":`var(--color-text-red)`,"--color-syntax-attribute":`var(--color-text-teal)`,"--color-syntax-property":`var(--color-text-cyan)`,"--color-syntax-punctuation":`var(--color-text-disabled)`,"--color-syntax-background":`var(--color-background-muted)`}})),bt,xt=o((()=>{bt={"--color-data-categorical-blue":`light-dark(#0171E3, #0171E3)`,"--color-data-categorical-orange":`light-dark(#EB6E00, #EB6E00)`,"--color-data-categorical-purple":`light-dark(#6B1EFD, #6B1EFD)`,"--color-data-categorical-green":`light-dark(#0B991F, #0B991F)`,"--color-data-categorical-pink":`light-dark(#F351C0, #F351C0)`,"--color-data-categorical-cyan":`light-dark(#0171A4, #0171A4)`,"--color-data-categorical-red":`light-dark(#F5394F, #F5394F)`,"--color-data-categorical-teal":`light-dark(#08A3A3, #08A3A3)`,"--color-data-categorical-brown":`light-dark(#965E03, #965E03)`,"--color-data-categorical-indigo":`light-dark(#6F8AFF, #6F8AFF)`,"--color-data-neutral":`light-dark(#8494A3, #8C939B)`,"--color-data-blue-5":`light-dark(#02165E, #02165E)`,"--color-data-blue-4":`light-dark(#004CBC, #004CBC)`,"--color-data-blue-3":`light-dark(#2694FE, #2694FE)`,"--color-data-blue-2":`light-dark(#78BEFF, #78BEFF)`,"--color-data-blue-1":`light-dark(#DBECFF, #DBECFF)`,"--color-data-shamrock-5":`light-dark(#0B603D, #0B603D)`,"--color-data-shamrock-4":`light-dark(#138546, #138546)`,"--color-data-shamrock-3":`light-dark(#24BB5E, #24BB5E)`,"--color-data-shamrock-2":`light-dark(#8EF7AA, #8EF7AA)`,"--color-data-shamrock-1":`light-dark(#D6FEE4, #D6FEE4)`,"--color-data-orange-5":`light-dark(#A13F04, #A13F04)`,"--color-data-orange-4":`light-dark(#D66100, #D66100)`,"--color-data-orange-3":`light-dark(#FD9537, #FD9537)`,"--color-data-orange-2":`light-dark(#FDB876, #FDB876)`,"--color-data-orange-1":`light-dark(#FFE6CF, #FFE6CF)`,"--color-data-pink-5":`light-dark(#8E1073, #8E1073)`,"--color-data-pink-4":`light-dark(#D123A1, #D123A1)`,"--color-data-pink-3":`light-dark(#F989D3, #F989D3)`,"--color-data-pink-2":`light-dark(#FEADE3, #FEADE3)`,"--color-data-pink-1":`light-dark(#FCE3F4, #FCE3F4)`,"--color-data-purple-5":`light-dark(#3E0697, #3E0697)`,"--color-data-purple-4":`light-dark(#6B1EFD, #6B1EFD)`,"--color-data-purple-3":`light-dark(#9081FF, #9081FF)`,"--color-data-purple-2":`light-dark(#B3B0FE, #B3B0FE)`,"--color-data-purple-1":`light-dark(#E8E8FB, #E8E8FB)`,"--color-data-red-5":`light-dark(#9D0519, #9D0519)`,"--color-data-red-4":`light-dark(#D31130, #D31130)`,"--color-data-red-3":`light-dark(#FB7D87, #FB7D87)`,"--color-data-red-2":`light-dark(#FFB2B8, #FFB2B8)`,"--color-data-red-1":`light-dark(#FEE4E6, #FEE4E6)`,"--color-data-teal-5":`light-dark(#08767D, #08767D)`,"--color-data-teal-4":`light-dark(#0C9293, #0C9293)`,"--color-data-teal-3":`light-dark(#0DB7AF, #0DB7AF)`,"--color-data-teal-2":`light-dark(#6CE6D8, #6CE6D8)`,"--color-data-teal-1":`light-dark(#D7FCF8, #D7FCF8)`,"--color-data-yellow-5":`light-dark(#8A5001, #8A5001)`,"--color-data-yellow-4":`light-dark(#D69804, #D69804)`,"--color-data-yellow-3":`light-dark(#FBCE03, #FBCE03)`,"--color-data-yellow-2":`light-dark(#FCEC85, #FCEC85)`,"--color-data-yellow-1":`light-dark(#FDF6BA, #FDF6BA)`,"--color-data-gray-5":`light-dark(#25363F, #333338)`,"--color-data-gray-4":`light-dark(#5D6C7B, #666A72)`,"--color-data-gray-3":`light-dark(#AFB9C4, #B2B8BE)`,"--color-data-gray-2":`light-dark(#CCD3DB, #D0D3D6)`,"--color-data-gray-1":`light-dark(#F1F4F7, #F2F4F6)`}})),St,Ct=o((()=>{yt(),xt(),St={...vt,...bt}}));function wt(e){Tt.set(e.name,e)}var Tt,Et=o((()=>{Tt=new Map}));function Dt(e){return e===`base`?``:e.split(`+`).map(e=>{let[t,n]=e.split(`:`);return n===void 0?`.${t}`:/^\d/.test(n)?`.${t}-${n}`:`.${n}`}).join(``)}var Ot=o((()=>{}));function kt(e,t){let n=At[e];return n?n.filter(e=>e.property===t):[]}var At,jt=o((()=>{At={banner:[{property:`borderRadius`,vars:[`--_banner-radius`]}],button:[{property:`borderRadius`,vars:[`--_button-radius`]}],card:[{property:`borderRadius`,vars:[`--_card-radius`]},{property:`padding`,expand:`container`}],chat:[{property:`borderRadius`,vars:[`--_chat-composer-radius`]},{property:`padding`,vars:[`--_chat-composer-padding`]}],dialog:[{property:`borderRadius`,vars:[`--_dialog-radius`]},{property:`padding`,expand:`container`}],"dropdown-menu":[{property:`borderRadius`,vars:[`--_dropdown-menu-radius`]},{property:`padding`,vars:[`--_dropdown-menu-padding`]}],field:[{property:`borderRadius`,vars:[`--_field-radius`]}],hovercard:[{property:`borderRadius`,vars:[`--_hovercard-radius`]}],popover:[{property:`borderRadius`,vars:[`--_popover-radius`]}],"progressbar-mark":[{property:`width`,vars:[`--_progressbar-mark-width`],replaces:!0},{property:`height`,vars:[`--_progressbar-mark-height`],replaces:!0}],section:[{property:`padding`,expand:`container`}],"segmented-control":[{property:`borderRadius`,vars:[`--_segmented-control-radius`]},{property:`padding`,vars:[`--_segmented-control-padding`]}],textarea:[{property:`paddingInline`,vars:[`--_textarea-inline-padding`],replaces:!0}]}}));function Mt(e){return`data-${It}-${e}`}function Nt(e){return`--${Lt}-${e}`}var Pt,Ft,It,Lt,Rt=o((()=>{Pt=`astryx`,Ft=Pt,It=Pt,Lt=Pt}));function zt(e){return`[data-${It}-theme="${e}"]`}function Bt(e){return`[data-${It}-media="${e}"]`}function Vt(e,t){return`.${Ft}-${e}${t}`}function Ht(e,t){let n=[],r=0,i=0;for(let t=0;t`${e}${t}`).join(`, `)}function Ut(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Wt(e){let t={};for(let[n,r]of e)switch(n){case`padding`:{let e=r.trim().split(/\s+/);e.length===1?(t.blockStart=e[0],t.blockEnd=e[0],t.inline=e[0]):e.length===2?(t.blockStart=e[0],t.blockEnd=e[0],t.inline=e[1]):e.length>=3&&(t.blockStart=e[0],t.inline=e[1],t.blockEnd=e[2]);break}case`paddingBlock`:{let e=r.trim().split(/\s+/);t.blockStart=e[0],t.blockEnd=e[1]??e[0];break}case`paddingInline`:{let e=r.trim().split(/\s+/);e.length===1?t.inline=e[0]:(t.inlineStart=e[0],t.inlineEnd=e[1]);break}case`paddingBlockStart`:t.blockStart=r;break;case`paddingBlockEnd`:t.blockEnd=r;break;case`paddingInlineStart`:t.inlineStart=r;break;case`paddingInlineEnd`:t.inlineEnd=r}return t}function Gt(e,t){let n=Nt(`${e}-padding`),r=[],i=t.inlineStart??t.inline,a=t.inlineEnd??t.inline;return i!=null&&a!=null&&i===a&&t.blockStart!=null&&t.blockEnd!=null&&i===t.blockStart&&t.blockStart===t.blockEnd?(r.push([n,i??``]),r):(t.inlineStart!=null||t.inlineEnd!=null?(i!=null&&r.push([`${n}-inline-start`,i]),a!=null&&r.push([`${n}-inline-end`,a])):t.inline!=null&&r.push([`${n}-inline`,t.inline]),t.blockStart!=null&&r.push([`${n}-block-start`,t.blockStart]),t.blockEnd!=null&&r.push([`${n}-block-end`,t.blockEnd]),r)}function Kt(e){let t=[],n=e.tokens,r=e=>n[e]||`var(${e})`,i=Object.entries(n);if(i.length>0){let e=i.map(([e,t])=>` ${e}: ${t};`).join(` `);t.push(` :scope {\n${e}\n }`)}return e.components&&qt(e.components,t),Jt(r,t),Yt(e.components||{},t),Xt(e.components||{},t),t}function qt(e,t){for(let[n,r]of Object.entries(e))for(let[e,i]of Object.entries(r)){let r=Object.entries(i);if(r.length===0)continue;let a=Vt(n,Dt(e)),o=[],s=[];for(let[e,t]of r)e.startsWith(`:`)&&typeof t==`object`?s.push([e,t]):o.push([e,t]);let c=o,l=[],u=!1,d=new Set;for(let[e,t]of o){let r=kt(n,e),i=tn.has(e)&&e!==`padding`?kt(n,`padding`):[];for(let n of[...r,...i])if(n.expand===`container`&&tn.has(e)&&(u=!0),n.replaces&&d.add(e),n.vars)for(let e of n.vars)l.push([e,t])}if(u){let e=o.filter(([e])=>tn.has(e)),t=o.filter(([e])=>!tn.has(e)),r=Gt(n,Wt(e));c=[...t,...r]}if(d.size>0&&(c=c.filter(([e])=>!d.has(e))),l.length>0&&(c=[...c,...l]),c.length>0){let e=c.map(([e,t])=>` ${Ut(e)}: ${t};`).join(` `);t.push(` ${a} {\n${e}\n }`)}for(let[e,n]of s){let r=Object.entries(n);if(r.length>0){let n=r.map(([e,t])=>` ${Ut(e)}: ${t};`).join(` `);t.push(` ${Ht(a,e)} {\n${n}\n }`)}}}}function Jt(e,t){t.push(` :where(h1, h2, h3, h4, h5, h6) { @@ -43,17 +43,17 @@ Error generating stack: `+e.message+` `)}\n}`);let o=``;t.length>0&&(o=`@scope (${r}) to (${i}) {\n${t.join(` -`)}\n}`);let s=Qt(e);return s&&(o=o?`${o}\n\n${s}`:s),{prose:a,component:o}}var en,tn,nn,rn=o((()=>{Ot(),jt(),Rt(),en=`[data-${It}-theme]`,tn=new Set([`padding`,`paddingBlock`,`paddingInline`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInlineStart`,`paddingInlineEnd`]),nn={"4xs":`var(--font-size-4xs)`,"3xs":`var(--font-size-3xs)`,"2xs":`var(--font-size-2xs)`,xsm:`var(--font-size-xs)`,sm:`var(--font-size-sm)`,base:`var(--font-size-base)`,lg:`var(--font-size-lg)`,xl:`var(--font-size-xl)`,"2xl":`var(--font-size-2xl)`,"3xl":`var(--font-size-3xl)`,"4xl":`var(--font-size-4xl)`}}));function an(e){return Array.isArray(e)?`light-dark(${e[0]}, ${e[1]})`:e}function on(e,t){if(!e&&!t)return;if(!e)return t;if(!t)return e;let n={};for(let[t,r]of Object.entries(e))n[t]={...r};for(let[e,r]of Object.entries(t))if(!n[e])n[e]={...r};else for(let[t,i]of Object.entries(r))n[e][t]={...n[e][t],...i};return n}function sn(e){return{normal:`var(--font-weight-normal)`,medium:`var(--font-weight-medium)`,semibold:`var(--font-weight-semibold)`,bold:`var(--font-weight-bold)`}[e]??e}function cn(e,t){if(!e)return;let n=e.includes(` `)?`"${e}"`:e;return t?`${n}, ${t}`:n}function ln(e){let t={},n=e.extends;if(n)for(let[e,r]of Object.entries(n.tokens))t[e]=r;let r=e.typography,i;if(r?.scale){let e={},t=r.heading;if(t?.weights)for(let[n,r]of Object.entries(t.weights))r&&(e[Number(n)]=sn(r));let n=t?.weight?sn(t.weight):void 0;if(n)for(let t=1;t<=6;t++)t in e||(e[t]=n);let a={};r.body?.weight&&(a.body=sn(r.body.weight)),r.code?.weight&&(a.code=sn(r.code.weight)),i={base:r.scale.base,ratio:r.scale.ratio,weights:{...Object.keys(e).length>0?{heading:e}:{},...Object.keys(a).length>0?{text:a}:{}}}}if(e.color){let n=ft(e.color);for(let[e,r]of Object.entries(n))t[e]=r}if(i){let e=_e(i);for(let[n,r]of Object.entries(e))t[n]=r}if(e.radius){let n=ke(e.radius);for(let[e,r]of Object.entries(n))t[e]=r}if(e.motion){let n=De(e.motion);for(let[e,r]of Object.entries(n))t[e]=r}if(r){let e=cn(r.body?.family,r.body?.fallbacks),n=cn(r.heading?.family,r.heading?.fallbacks)??e,i=cn(r.code?.family,r.code?.fallbacks);e&&(t[`--font-family-body`]=e),n&&(t[`--font-family-heading`]=n),i&&(t[`--font-family-code`]=i)}if(e.syntax){let n=e.syntax.tokens;for(let[e,r]of Object.entries(n))t[`--color-syntax-`+e]=r}if(e.tokens)for(let[n,r]of Object.entries(e.tokens))r!==void 0&&(t[n]=an(r));let a=e.components;i&&(a=on(ve(i),e.components)),n?.components&&(a=on(n.components,a));let o=le(`dark`,e.onDark),s=le(`light`,e.onLight),c=e.icons&&n?.icons?{...n.icons,...e.icons}:e.icons??n?.icons,l=e.indicators&&n?.indicators?{...n.indicators,...e.indicators}:e.indicators??n?.indicators,u={name:e.name,tokens:t,components:a,icons:c,indicators:l,__inputTokens:e.tokens,__onDark:o,__onLight:s};return wt(u),u}var un=o((()=>{fe(),ce(),Te(),Oe(),Ae(),_t(),Ct(),Et(),rn(),{...ne,...T,...re,...E,...D,...ie,...ae,...O,...oe,...k,...A,...se,...St}})),dn,fn,pn=o((()=>{dn=l(d(),1),fn=(0,dn.createContext)(null),fn.displayName=`ThemeContext`})),mn=o((()=>{})),hn=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=s(((e,t)=>{t.exports=hn()}));function gn(e){let t=(0,yn.useId)();(0,yn.useInsertionEffect)(()=>{if(e.__built)return;let n=`astryx-theme-${e.name}`;if(Cn.has(n))return;`${e.name}`,`${e.name}${e.name}${e.name}${e.name}`;let{prose:r,component:i}=$t(e);if(!(!r&&!i)){if(r){let n=document.createElement(`style`);n.setAttribute(Mt(`theme-prose`),e.name),n.setAttribute(Mt(`id`),t),n.textContent=`@layer reset {\n${r}\n}`,document.head.appendChild(n)}if(i){let n=document.createElement(`style`);n.setAttribute(Mt(`theme`),e.name),n.setAttribute(Mt(`id`),t),n.textContent=`@layer astryx-theme {\n${i}\n}`,document.head.appendChild(n)}return Cn.add(n),()=>{let r=document.querySelector(`style[${Mt(`theme-prose`)}="${e.name}"][${Mt(`id`)}="${t}"]`),i=document.querySelector(`style[${Mt(`theme`)}="${e.name}"][${Mt(`id`)}="${t}"]`);r?.remove(),i?.remove(),Cn.delete(n)}}},[e,t])}function _n(e,t,n){y(()=>{if(!e&&!(typeof document>`u`))return t===`light`||t===`dark`?document.documentElement.setAttribute(`data-theme`,t):document.documentElement.removeAttribute(`data-theme`),document.documentElement.setAttribute(Mt(`theme`),n),()=>{document.documentElement.removeAttribute(`data-theme`),document.documentElement.removeAttribute(Mt(`theme`))}},[e,t,n])}function vn({theme:e,mode:t=`system`,children:n}){let r=(0,yn.use)(Sn);wt(e),gn(e),_n(r,t,e.name);let i=t===`dark`?xn.dark:t===`light`?xn.light:xn.system,a=(0,yn.useMemo)(()=>({theme:e,mode:t}),[e,t]);return(0,bn.jsx)(fn,{value:a,children:(0,bn.jsx)(Sn,{value:!0,children:(0,bn.jsx)(`div`,{...S(xn.base,i),"data-astryx-theme":e.name,"data-theme":t===`system`?void 0:t,children:n})})})}var yn,bn,xn,Sn,Cn,wn=o((()=>{yn=l(d(),1),b(),te(),un(),Et(),Rt(),pn(),mn(),bn=M(),xn={base:{k1xSpc:`xjp7ctv`,kMwMTN:`x1tgivj0`,kMv6JI:`x9ynric`,$$css:!0},light:{kQNsl9:`x19aimcq`,$$css:!0},dark:{kQNsl9:`xntwwlm`,$$css:!0},system:{kQNsl9:`x108lcm5`,$$css:!0}},Sn=yn.createContext(!1),Sn.displayName=`ThemeNestingContext`,Cn=new Set,vn.displayName=`Theme`}));function Tn(e){return Array.isArray(e)?`light-dark(${e[0]}, ${e[1]})`:e}function En(e){let t=On.filter(t=>!(t in e.tokens));t.length>0&&`${e.name}${t.join(`, `)}`;let n={};for(let t of On)n[t]=Tn(e.tokens[t]);return{name:e.name,tokens:n,__inputTokens:{...e.tokens}}}var Dn,On,kn=o((()=>{yt(),mn(),Dn=`--color-syntax-`,On=Object.keys(vt).map(e=>e.replace(Dn,``))})),An=o((()=>{yt(),kn()})),jn=o((()=>{wn(),te(),ce(),Rt(),un(),Et(),Ct(),An(),Te(),_t(),pn(),Re()})),Mn=o((()=>{})),Nn=o((()=>{})),Pn=o((()=>{})),Fn=o((()=>{})),In=o((()=>{})),Ln=o((()=>{})),Rn=o((()=>{})),zn=o((()=>{})),Bn=o((()=>{})),Vn=o((()=>{})),Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr=o((()=>{Hn={name:`Vice`},Un={delete:`Delete`,keepIt:`Keep it`,cancel:`Cancel`,save:`Save`,close:`Close`,noActions:`No actions`,untagged:`Untagged`,create:`Create`,gotIt:`Got it`,new:`New`,dismiss:`Dismiss`},Wn={allClips:`All Clips`,countClips:{one:`{count} clip`,other:`{count} clips`},countMatches:{one:`{count} match for “{query}”`,other:`{count} matches for “{query}”`},playlistOptions:`Playlist options`,newPlaylist:`New playlist`,saveClip:`Save clip`,hotkeysUnavailableTitle:`Global hotkeys are not available.`,hotkeysUnavailableBody:`Vice cannot read your keyboard, so {hotkey} will not save a clip. The Save clip button above still works. Adding your user to the input group and logging back in usually fixes it.`,emptySearch:`Nothing matches “{query}”.`,emptyPlaylist:`This playlist is empty. Drag a clip onto it, or right-click a clip to add it.`,emptyLibrary:`No clips yet. Press {hotkey} to save the last {duration} seconds.`,editPlaylist:`Edit playlist`,deletePlaylist:`Delete playlist`,confirmDeleteTitle:`Delete this playlist?`,confirmDeleteBody:`The clips themselves stay put. Only the playlist goes.`,confirmDeleteAuto:` This one was created automatically, so Vice will not build it again for this game.`,playlistUpdated:`Playlist updated`,playlistDeleted:`Playlist deleted`,playlistCreated:`Playlist “{name}” created`,errSaveClip:`Could not save a clip`,errUpdatePlaylist:`Could not update the playlist`,errCreatePlaylist:`Could not create the playlist`,errDeletePlaylist:`Could not delete the playlist`,imagesHeading:{one:`{count} screenshot`,other:`{count} screenshots`}},Gn={greetingMorning:`Good morning`,greetingAfternoon:`Good afternoon`,greetingEvening:`Good evening`,quickSettings:`Quick settings`,storage:`Storage`,diskFree:`Free space`,diskLibrary:`Vice library`,diskUnknown:`Not measured`,lastClip:`Last clip`,lastClipNever:`None yet`,diskBar:`{used} of {total} used, {library} of it Vice`,microphone:`Microphone`,desktopAudio:`Desktop audio`,publicLink:`Public link`,on:`On`,off:`Off`,active:`Active`,starting:`Starting`,connecting:`Connecting`,localOnly:`Local only`,tapToCopy:`Tap to copy`,cloudflaredStarting:`cloudflared is starting up`,linksWorkOnNetwork:`Links work on this network`,copyPublicLink:`Copy the public link`,noPublicLinkYet:`No public link yet`,saveClipNow:`Save clip now`,allClips:`All clips`,settings:`Settings`,recentClips:`Recent clips`,seeAll:`See all`,mostViewed:`Most viewed`,playlists:`Playlists`,emptyReel:`No clips yet. Press {hotkey} to start your reel.`,lede:`The last {duration} of your gameplay are always in the buffer. Press {hotkey} to keep them. Double-tap to start a session.`,micOn:`Microphone on`,micOff:`Microphone off`,micOnDetail:`Included in new clips`,micOffDetail:`Removed from new clips`,desktopAudioOn:`Desktop audio on`,desktopAudioOff:`Desktop audio off`,publicLinkStarting:`Public link starting`,publicLinkStopped:`Public link stopped`,publicLinkCopied:`Public link copied`,enablePublicLinkFirst:`Enable the public link first`,savedNotApplied:`Saved, but not applied`,errMic:`Could not change the microphone setting`,errDesktopAudio:`Could not change desktop audio`,errPublicLink:`Could not change the public link`,errSaveClip:`Could not save a clip`,wfMicTitle:`How should the microphone be mixed in?`,wfMicBody:`wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.`,wfMicBothLabel:`Use a backend that can do both`,wfMicBothHelp:`Vice records with a compatible backend whenever the microphone is on.`,wfMicOnlyLabel:`Microphone only`,wfMicOnlyHelp:`Desktop audio is dropped while the microphone is on.`,copyLinkTitle:`Copy this link`,copyLinkBody:`The clipboard was not available, so here is the link to copy by hand.`,restartTitle:`Restart Vice to finish`,restartBody:`That setting is saved, but it only takes effect once the daemon restarts.`,gotIt:`Got it`},Kn={unreadable:`Unreadable`,unreadableNote:`{reason}. The file is still on disk.`,unreadableFallback:`ffmpeg could not read this file`,openTitle:`Open {name}`,renameHint:`{name}, double-click to rename`,trim:`Trim`,copyVideo:`Copy video to clipboard`,copyShareLink:`Copy share link`,noShareLink:`No share link yet`,reveal:`Reveal in file manager`,delete:`Delete`,open:`Open`,rename:`Rename`,copyVideoShort:`Copy video`,deleteClip:`Delete clip`,videoCopied:`Video copied, paste it anywhere`,errCopyVideo:`Could not copy the video`,renameFailed:`Rename failed`,savedAs:`Saved as {name}`,addTo:`Add to {playlist}`,removeFrom:`Remove from {playlist}`,addedTo:`Added to {playlist}`,removedFrom:`Removed from {playlist}`,playlistUnchanged:`The playlist did not change`,nameLabel:`Clip name`,views:{one:`{count} view`,other:`{count} views`},noShareLinkYet:`No share link for this clip yet`,linkCopiedLocal:`Link copied, but it is local only`,linkCopiedLocalDetail:`Install cloudflared for links that work off your network`,shareLinkCopied:`Share link copied`,alreadyIn:`Already in {playlist}`,errAddClip:`Could not add the clip`},qn={editTitle:`Edit playlist`,newTitle:`New playlist`,nameRequired:`Give the playlist a name`,name:`Name`,emoji:`Emoji`,emojiPlaceholder:`Optional`,colour:`Playlist colour`},Jn={quitConfirm:`Stop Vice and quit? The recording daemon will shut down.`,minimize:`Minimize`,quit:`Quit`},Yn={notRecording:`Vice is not recording.`,cpuFallback:`Recording on the CPU.`,codecFallback:`Recording with a different codec.`,cannotPlay:`Clips cannot play inside this window.`,notRecordingHelp:`Vice keeps retrying on its own. If it is an encoder problem, a reboot after a driver update usually clears it, or pick a different encoder under Settings, Recording.`,cpuFallbackHelp:`Your GPU encoder would not open, so Vice fell back to CPU encoding to keep clipping. That costs frames in games. This is usually a driver that needs a reboot after an update. Vice tries the GPU first every time it starts, so once that is sorted this goes away on its own.`,codecFallbackHelp:`Your GPU would not encode the codec picked under Settings, Recording, so gpu-screen-recorder chose one it can handle. Recording is still on the GPU and clips are unaffected. Choosing a different encoder yourself stops this notice, and H.264 in particular tops out at 4096 pixels wide on NVIDIA, so HEVC or AV1 is the one to pick on a wide monitor.`,cannotPlayHelp:`The installed Qt WebEngine build has no H.264 decoder. Recording still works, and clips open fine in your system player. To fix in-app playback, install your distro's WebEngine package and reinstall Vice:`},Xn={cannotReach:`Cannot reach the daemon`,notRecording:`Not recording`,keepsRetrying:`Vice keeps retrying`,sessionRecording:`Session recording`,bufferRunning:`Buffer running`,starting:`Starting`},Zn={releaseNotes:`Release notes`,copyCommand:`Copy command`,commandCopied:`Command copied, paste it into a terminal`,copyByHand:`The clipboard was not available, so here is the command to copy by hand.`,later:`Later`,title:`Vice {version} is available`,youAreOn:`You are on {version}.`,olderRelease:`an older release`,updateWith:` Update with:`,copyTitle:`Copy this command`},Qn={addTrack:`Add track`,none:`No separate tracks. Everything is mixed into one, which is what most people want.`,mixOfAll:`Mix of all tracks`,trackLabel:`Track {n}`,sourceToAdd:`Audio source to add as a track`,refresh:`Refresh the source list`,moveEarlier:`Move earlier`,moveLater:`Move later`,removeTrack:`Remove this track`,moveEarlierAria:`Move {name} earlier`,moveLaterAria:`Move {name} later`,removeAria:`Remove {name}`,droppedWarning:{one:`Capture desktop audio is off, so this track will not be recorded: {list}.`,other:`Capture desktop audio is off, so these tracks will not be recorded: {list}.`},trimmedWarning:{one:`{count} more will keep only its microphone sources.`,other:`{count} more will keep only their microphone sources.`},turnBackOn:`Turn desktop audio back on above to keep them.`},$n={pressKey:`Press a key`,setKey:`Set key`},er={allClips:`All Clips`,images:`Images`,home:`Home`,editor:`Editor`,settings:`Settings`,about:`About`,playlists:`Playlists`,newPlaylist:`New playlist`,search:`Search clips`,dragToStart:`Drag a clip here to start one.`,quickStart:`Quick start`,buffer:`Buffer`,update:`Update`,open:`Open`,useEmoji:`Use {emoji}`,errSetEmoji:`Could not set the emoji`,main:`Main`},tr={errReveal:`Could not open the file manager`,errSystemPlayer:`Could not open the system player`,clipDeleted:`Clip deleted`,errDelete:`Could not delete the clip`,confirmDeleteTitle:`Delete this clip?`,confirmDeleteBody:`{name} will be removed from disk. This cannot be undone.`,copyLinkTitle:`Copy this link`,copyLinkBody:`The clipboard was not available, so here is the link to copy by hand.`,highlight:`Highlight`,highlightNumbered:`{base} {n}`,errAddHighlight:`Could not add the highlight`,errMoveHighlight:`Could not move the highlight`,errUpdateHighlight:`Could not update the highlight`,errDeleteHighlight:`Could not delete the highlight`,daemonNoMark:`The daemon did not return the mark`,daemonRejectedMove:`The daemon rejected the move`,daemonRejectedChange:`The daemon rejected the change`,play:`Play`,pause:`Pause`,preparingPreview:`Preparing the H.265 preview`,openInPlayer:`Open in system player`,showInFolder:`Show in folder`,addHighlight:`Add highlight`,noHighlights:`No highlights yet. Press`,addHighlightKey:`Add highlight {key}`,noHighlightsHelp:`No highlights yet. Press {key} to mark the current timestamp.`,prevClip:`Previous clip`,nextClip:`Next clip`,changeColour:`Change colour`,changeColourAria:`Change the colour of {name}`,doubleClickRename:`Double-click to rename`,removeHighlight:`Remove`,removeHighlightAria:`Remove {name}`,copyShareLink:`Copy share link`,closePlayer:`Close the player`,volume:`Volume`,mute:`Mute`,unmute:`Unmute`,highlightLabel:`Highlight label`,highlightAt:`{label} at {time}`,useColour:`Use {color}`,highlightsHeading:`Highlights`,trim:`Trim`,share:`Share`,reveal:`Reveal`,delete:`Delete`,shortcuts:`Left and right step clips · H marks a highlight · Esc closes`,playbackFailed:`Vice could not play this clip in the app window. The file itself is most likely fine.`,noH264Decoder:`This Qt WebEngine build has no H.264 decoder, so clips cannot play inside Vice. The file itself is fine.`,saveFrame:`Save this frame`,saveFrameHint:`Save the current frame as a screenshot (S)`,frameSaved:`Frame saved and copied`,frameSavedNotCopied:`Frame saved, but not copied`,errSaveFrame:`Could not save the frame`,muteHint:`Mute (M)`,unmuteHint:`Unmute (M)`,expand:`Fill the window`,shrink:`Back to normal size`,expandHint:`Fill the window (F, or double-click)`,shrinkHint:`Back to normal size (F, or Esc)`},nr={saved:`Clip trimmed and saved`,failed:`The trim failed`,errTrim:`Could not trim the clip`,preview:`Preview`,stop:`Stop`,loopHelp:`Loops the selection. Cut bounds are lossless.`,saving:`Saving`,saveTrim:`Save trim`,preparingPreview:`Preparing the H.265 preview`,openInPlayer:`Open in system player`,showInFolder:`Show in folder`,title:`Trim · {name}`,in:`In`,out:`Out`,duration:`Duration`,startOfSelection:`Start of the selection`,endOfSelection:`End of the selection`,trimAria:`Trim {name}`,heading:`Trim`},rr={heading:`Images`,countImages:{one:`{count} screenshot`,other:`{count} screenshots`},countMatches:{one:`{count} match for “{query}”`,other:`{count} matches for “{query}”`},emptySearch:`Nothing matches “{query}”.`,emptyLibrary:`No screenshots yet. Press {hotkey} to save what is on screen.`,emptyNoKey:`No screenshots yet. Set a screenshot key in Settings, or open a clip and save a frame from it.`,captureMoment:`Keep a moment`,roomForMore:`Room for your next moment`,captureHint:`Press {hotkey} to save a screenshot.`,captureNoKey:`Set a screenshot key in Settings, or save a frame from a clip.`,openTitle:`Open {name}`,open:`Open`,openExternally:`Open in image viewer`,copy:`Copy image`,copied:`Image copied`,errCopy:`Could not copy the image`,errOpen:`Could not open the image`,deleteImage:`Delete screenshot`,deleted:`Screenshot deleted`,errDelete:`Could not delete the screenshot`,confirmDeleteTitle:`Delete this screenshot?`,confirmDeleteBody:`{name} will be moved to the trash. This cannot be undone from here.`,pen:`Pen`,penOn:`Pen on`,penColour:`Pen colour`,undo:`Undo`,saveDrawing:`Save drawing`,saving:`Saving`,saved:`Drawing saved`,errSave:`Could not save the drawing`,errCanvas:`This window could not render the image`,prev:`Previous image`,next:`Next image`,shortcuts:`Arrows step, F fills the window, Ctrl+Z undoes, Esc closes`},ir={pickColour:`Pick a colour`,startClipping:`Start clipping, then let Vice run`,playlistsTitle:`Playlists sort the reel`,colourBody:`Vice takes its colour from one of these. The whole window changes as you pick, so choose the one you want to look at, and change it any time in Settings.`,quickStartBody:`Vice keeps the buffer live in the background and opens this window only when you need it.`,playlistsBody:`Every clip can live in any number of playlists, and they keep themselves in order.`,saveLast:`Save the last {duration}s`,saveLastHelp:`Press {hotkey} after something worth keeping.`,sessionTitle:`Double-tap {hotkey} for a session`,sessionHelp:`Double-tap to start or stop a full recording. Tap once during a session to mark a highlight.`,reviewTitle:`Review, trim and share`,reviewHelp:`Open any clip to rename it, trim the best moment, share a link, or press H to add highlights.`,backgroundTitle:`Close the window safely`,backgroundHelp:`Minimize or close this window and Vice keeps recording. Discord Rich Presence is on by default and lives in Settings.`,autoTitle:`Auto playlists`,autoHelp:`Clips are filed under the game you were playing when you saved them. Vice builds these on its own.`,customTitle:`Custom playlists`,customHelp:`Create your own from the sidebar, pick an emoji and a colour, then drag clips onto it or right-click a clip to add it.`,safeTitle:`Nothing goes stale`,safeHelp:`Playlists follow clips through renames and trims, and tidy up after deletions.`,next:`Next`,back:`Back`,gotIt:`Got it`,badgeClip:`Clip`,badgeBg:`BG`,badgeAuto:`Auto`,badgeNew:`New`,badgeSafe:`Safe`,accentLabel:`{name} accent`,bufferTitle:`How far back Vice can reach`,bufferBody:`Vice is always recording into a buffer it throws away. Pressing the clip key keeps the last stretch of it, and this is how long that stretch is.`,bufferLabel:`Instant replay length`,bufferNote:`The buffer holds {buffer} at a time. A longer one costs memory, and Settings has the whole picture, including writing it to disk instead.`,clipKeyLabel:`Clip key`,screenshotKeyLabel:`Screenshot key`,screenshotKeyNote:`The screenshot key is unset until you set one. It saves a picture of the screen to the Images section and puts it on your clipboard.`,errSave:`Could not save that`,editorTitle:`The Editor`,editorHelp:`Put several clips on a timeline, cut them together, add text and transitions, and export one video. It is in the sidebar.`,badgeEdit:`Edit`,shareTitle:`Sending a clip to someone`,shareBody:`Every clip has a link, and copying it is one button on the card.`,linkTitle:`Copy link`,linkHelp:`The link button on a clip copies an address that plays the clip in a browser. Paste it into Discord and it embeds.`,tunnelTitle:`Local, or reachable from anywhere`,tunnelHelp:`On its own the link only works on this machine. Turn on the Cloudflare tunnel in Settings and it works anywhere, until the daemon restarts and the address changes.`,badgeLink:`Link`,badgeTunnel:`Net`,moreTitle:`The rest lives in Settings`,moreBody:`That is everything you need. Settings has the parts you only touch once.`,recTitle:`Recording`,recHelp:`Encoder, resolution, frame rate, which monitor, and which audio goes on which track.`,badgeRec:`Rec`},ar={blue:`Blue`,purple:`Purple`,green:`Green`,red:`Red`,orange:`Orange`,customTitle:`Custom colour`,customBody:`Pick any colour and Vice builds a full Material 3 scheme from it. Only the hue carries over: the surfaces, the buttons and the text tones are worked out from it, the same way the five presets are.`,useThis:`Use this colour`,hue:`Hue`,saturation:`Saturation and brightness`,hexLabel:`Hex value`,previewTitle:`Vice_Clip_12`,previewMeta:`20s · 1920x1080 · 14.2 MB`,previewPrimary:`Save clip`,previewQuiet:`Trim`,previewChip:`Deadlock`,lowContrast:`This colour does not leave enough contrast to read comfortably. Vice has lightened the accent as far as it can; try something less dark.`},or={clipSaved:`Clip saved`,savingClip:`Saving clip`,errSaveClip:`Could not save the clip`,recorderSilent:`The recorder did not say why`,publicLinkReady:`Public link ready`,noPublicLink:`No public link`,tunnelUnavailable:`The share tunnel is unavailable`,sessionRecording:`Session recording`,doubleTapToStop:`Double-tap the clip key to stop`,sessionSaved:`Session saved`,highlightMarked:`Highlight marked`,cannotPlay:`Clips cannot play in this window`,noH264:`This Qt WebEngine build has no H.264 decoder`,notSaved:`The change was not saved`,imageSaved:`Screenshot saved`,errScreenshot:`Could not take the screenshot`,screenshotNotCopied:`Screenshot saved, but not copied`,updating:`Vice is updating to {version}`,updatingDetail:`The recorder restarts to pick up the new version. This window reconnects on its own.`},sr={title:`About`,subtitle:`Vice, the game clip recorder for Linux`,tagline:`Linux-first, open source game clipping.`,waylandAndX11:`Wayland and X11`,system:`System`,version:`Version`,backend:`Backend`,buffer:`Buffer`,frameRate:`Frame rate`,clipsOnDisk:`Clips on disk`,totalFootage:`Total footage`,credits:`Credits`,creator:`Creator and maintainer`,community:`Community contributors`,communityHelp:`Bug reports, translations, patches`,dangerZone:`Danger zone`,uninstallHelp:`Uninstalling removes Vice, its systemd units and the udev rules. Your clips stay where they are.`,copy:`Copy`,commandCopied:`Command copied, paste it into a terminal`,copyTitle:`Copy this command`,copyByHand:`The clipboard was not available, so here is the command to copy by hand.`},cr={nothingAtPlayhead:`Nothing at the playhead`,dragFromLibrary:`Drag a clip from the library onto the timeline below.`,preparingPreview:`Preparing the H.265 preview`,removeTitle:`Remove title`,play:`Play`,pause:`Pause`,detachAudio:`Detach audio`,clearTitle:`Clear the timeline?`,clearBody:`Every clip, title and transition on the timeline goes. Your clips stay on disk.`,exportCanceled:`Export canceled`,exportFailed:`Export failed`,pickFolder:`Pick a folder for the export`,exportRefused:`The export was refused`,errStartExport:`Could not start the export`,startExport:`Start export`,cancelExport:`Cancel export`,saveAs:`Save as`,viceLibrary:`Vice library (default)`,customPath:`Custom path`,alsoAddToLibrary:`Also add to the Vice library`,encoding:`Encoding H.264. You can leave this open or carry on elsewhere in Vice.`,videoTrack:`Video track`,audioTrack:`Audio track`,tabLibrary:`Library`,tabEffects:`Effects`,tabText:`Text`,searchClips:`Search clips`,libHintLibrary:`Drag a clip onto the timeline, or double-click to append`,libHintEffects:`Drag an effect onto a clip, or between two clips`,libHintText:`Drag a title onto the preview or the T1 lane`,titleSection:`Title`,closeInspector:`Close the inspector`,titleText:`Title text`,font:`Font`,size:`Size`,colour:`Colour`,titleSize:`Title size`,useColour:`Use {color}`,reset:`Reset`,backToStart:`Back to the start`,playPause:`Play or pause, space`,exportBtn:`Export`,split:`Split`,duplicate:`Duplicate`,fit:`Fit`,zoomOut:`Zoom out`,zoomIn:`Zoom in`,addTrack:`Track`,clear:`Clear`,exportVideo:`Export video`,done:`Done`,exportFilename:`Export filename`,exportFilenamePlaceholder:`Vice_Edit_1 (automatic if empty)`,location:`Location`,exportLocation:`Export location`,folder:`Folder`,exportFolder:`Export folder`,audioDetached:`Audio detached`,transShorter:`Shorter`,transLonger:`Longer`,transRemove:`Remove transition`,junctionTitle:`{name} · {len}s, click to edit`,trackOptionsHint:`Right-click for track options`,libClipHint:`Drag to the timeline, or double-click to append`,libNoMatch:`No clips match`,libNoMatchBody:`Try a different search.`,libEmpty:`No clips yet`,libEmptyBody:`Save some gameplay first.`,noReadableDuration:`That clip has no readable duration yet`,menuSplit:`Split at playhead`,menuDetach:`Detach audio`,menuCopy:`Copy`,menuPaste:`Paste`,menuDuplicate:`Duplicate`,menuDelete:`Delete`,menuAddVideoTrack:`Add video track`,menuAddAudioTrack:`Add audio track`,menuRemoveTrack:`Remove track {name}`,fx:{crossfade:{name:`Crossfade`,desc:`Blend outgoing into incoming`},fadeblack:{name:`Fade to black`,desc:`Dip through pure black`},fadewhite:{name:`Fade to white`,desc:`Bloom through white`},dipaccent:{name:`Dip to accent`,desc:`Flash the theme colour`},blurdis:{name:`Blur dissolve`,desc:`Defocus across the cut`},slide:{name:`Slide`,desc:`Incoming pushes in from the right`}},textPreset:{title:{name:`Title`,sample:`Match point`},subtitle:{name:`Subtitle`,sample:`Ranked grind`},caption:{name:`Caption`,sample:`1920x1080 · 60 fps`},lower:{name:`Lower third`,sample:`Player · support`}},exported:`Exported.`,encodingProgress:`{percent}% encoding`,audioSource:`Recorded source`,recordedTrack:`Track {number}`,audioVolume:`Volume`,audioMuted:`Muted`,audioPreviewFailed:`Could not play this audio track. Try again or check the log.`,detachedTracksHelp:`Each recorded source has its own lane. Only track 1 starts enabled, so a combined track is not mixed twice. Unmute the sources you want to hear.`,preparingMedia:`Preparing preview`},lr=JSON.parse(`{"title":"Settings","subtitle":"Tune Vice to the way you play","sections":"Settings sections","loading":"Loading your settings.","secRecording":"Recording","secAudio":"Audio","secHotkeys":"Hotkeys","secStorage":"Storage","secSharing":"Sharing","secDiscord":"Discord","secAppearance":"Appearance","secAdvanced":"Advanced","cardDiscord":"Discord Rich Presence","optAutoRecommended":"Auto (recommended)","bufferDuration":"Buffer duration","bufferOnDisk":"Buffer is kept on disk, so long durations are fine.","bufferPlain":"Seconds of gameplay kept in the rolling buffer","bufferRamWarning":"A {length} buffer in RAM uses roughly {gb} GB at typical bitrates. Auto storage moves it to disk.","replayStorage":"Replay storage","replayStorageHelp":"Where the rolling buffer lives. Auto keeps short buffers in RAM and moves anything over ten minutes to disk.","replayRam":"RAM","replayDisk":"Disk","clipDuration":"Clip duration","clipDurationHelp":"Seconds saved when you press the clip key","frameRate":"Frame rate","frameRateHelp":"Capture frames per second","fpsOption":"{fps} fps","resolution":"Resolution","resolutionHelp":"Auto matches your display","resolutionAuto":"Auto","resolutionCustom":"Custom","customResolution":"Custom resolution","customResolutionHelp":"Width by height, for example 1600x900","customResolutionWarn":"Write it as width by height, like 1600x900.","badResolutionTitle":"That resolution is not a size","badResolutionDetail":"Write it as width by height, like 1600x900","container":"Container","containerHelp":"MKV survives crashes better and suits multi-track audio. Discord embeds and browsers need MP4.","containerMp4":"MP4 (best compatibility)","containerMkv":"MKV (crash-safe)","encoder":"Video encoder","encoderHelp":"GPU encoders are faster and use less CPU. Vulkan options require the gpu-screen-recorder backend.","encoderH264Vulkan":"H.264 (Vulkan, GSR)","encoderHevcVulkan":"HEVC (Vulkan, GSR)","encoderAv1Vulkan":"AV1 (Vulkan, GSR)","encoderH264Nvenc":"NVIDIA H.264 (NVENC)","encoderHevcNvenc":"NVIDIA H.265 (NVENC)","encoderH264Vaapi":"AMD or Intel H.264 (VAAPI)","encoderHevcVaapi":"AMD or Intel H.265 (VAAPI)","encoderAv1Nvenc":"NVIDIA AV1 (NVENC, RTX 40 and up)","encoderAv1Vaapi":"AMD or Intel AV1 (VAAPI)","encoderX264":"Software H.264 (x264)","encoderX265":"Software H.265 (x265)","colourDepth":"Colour depth","colourDepthHelp":"8-bit suits every player. 10-bit needs an HEVC or AV1 encoder.","colour8":"8-bit (standard)","colour10":"10-bit (HEVC or AV1)","hardwareDecode":"Hardware video decode in previews","hardwareDecodeHelp":"Let your GPU decode clips in this window instead of the CPU. Worth turning on if high-resolution AV1 or HEVC previews stutter. It renders video black on some drivers, so if that happens turn it back off. Takes effect next time you open Vice.","backend":"Recording backend","backendHelp":"Screen capture method","backendWf":"wf-recorder (Wayland)","backendFfmpeg":"ffmpeg (X11)","followMouse":"Follow my mouse","followMouseHelp":"Record whichever monitor the pointer is on. Switching monitors restarts the buffer, so a clip taken right after moving will be short.","followMouseUnsupported":"Needs X11, Hyprland or Sway. Vice cannot tell where the pointer is on this session.","display":"Display","displayAuto":"Auto (backend default)","savedOption":"{id} (saved)","displayMissing":"Display \\"{id}\\" is not being reported right now. It is still saved and will be used if it comes back.","displayWarning":"{warning} Auto will still work.","displayNone":"No individual displays were detected. Auto will still work.","displayHelp":"Choose which display to record. Auto follows the backend default.","displayLoadFailed":"Could not load display options.","captureDesktopAudio":"Capture desktop audio","captureDesktopAudioHelp":"Include system sound in clips","captureMic":"Capture microphone","captureMicHelp":"Record your mic into clips. The same switch as the tile on Home, and saved the moment you flip it.","micOn":"Microphone on","micOff":"Microphone off","micOnDetail":"Included in new clips","micOffDetail":"Removed from new clips","errMic":"Could not change the microphone setting","desktopSource":"Desktop audio source","desktopSourceIsMic":"This is a microphone input, so clips would have no desktop audio. Pick one under Desktop audio instead.","desktopSourceMissing":"That source is not listed right now. It is still saved and will be passed to the recorder.","desktopSourceHelp":"Choose what the recorder captures as desktop audio.","sourceLoadFailed":"Could not load audio sources.","defaultOutput":"Default output","defaultInput":"Default input","groupDesktopAudio":"Desktop audio","groupMicrophones":"Microphones","groupApplications":"Applications","groupOther":"Other","groupSaved":"Saved","micSource":"Microphone source","micSourceHelp":"Used when mic capture is on. Default input follows the system setting.","micMono":"Mono microphone","micMonoHelp":"Centres your mic in the clip. Turn this on if your voice only comes out of one ear, which is what most XLR and single-channel interfaces do. Applied when the clip is saved, so it needs mic capture on and no separate audio tracks.","desktopVolume":"Desktop audio volume","desktopVolumeHelp":"Balanced into new clips as they are saved","micVolume":"Microphone volume","micVolumeHelp":"Turn this down if your mic overpowers the game. Applies while mic capture is on.","notifyVolume":"Notification volume","notifyVolumeHelp":"The ping when a clip is saved, and the session start, stop and highlight tones.","volumeOff":"Off","customSounds":"Custom sounds","customSoundsHelp":"Play your own file instead of the built-in tone. Leave blank for the tone. A path that does not exist falls back to the tone, so you never end up with silence.","soundClip":"Clip saved","soundClipFailed":"Clip failed","soundSessionStart":"Session started","soundSessionEnd":"Session stopped","soundHighlight":"Highlight marked","audioTracks":"Separate audio tracks","audioTracksHelp":"Each source becomes its own track for editing. Players, Discord and share links use track 1. With mic capture on, your microphone gets its own track.","duplicateTrack":"That source is already a track","sourcesRefreshed":"Audio sources refreshed","mixFirstTrack":"Combined first track","mixFirstTrackHelp":"Record an extra track 1 that mixes every source, so players and shared clips carry full audio. Your separate tracks start at 2.","wfMicMode":"wf-recorder microphone mode","wfMicModeHelp":"How wf-recorder handles desktop audio together with a microphone","wfMicPrompt":"Ask when needed","wfMicFallback":"Use a compatible backend","wfMicOnly":"Mic only on wf-recorder","wfMicTitle":"How should the microphone be mixed in?","wfMicBody":"wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.","wfMicChoiceBoth":"Use a backend that can do both","wfMicChoiceBothBody":"Vice records with a compatible backend whenever the microphone is on.","wfMicChoiceMic":"Microphone only","wfMicChoiceMicBody":"Desktop audio is dropped while the microphone is on.","clipKey":"Clip key","clipKeyHelp":"Click to rebind, then press a key or a combo like Alt+F9. Escape cancels. Saved the moment you press it.","hotkeysUnavailable":"Vice cannot read your keyboard right now, so no hotkey will fire. Adding your user to the input group and logging back in usually fixes it.","keyUnsupported":"That key cannot be bound, try another","clipKeyNow":"Clip key is now {key}","errSaveKey":"The key was captured but not saved","clipPresets":"Additional clip hotkeys","clipPresetsHelp":"Each key saves its own clip length. Double-tap any clip key to start or stop a session.","presetDuration":"Clip length for this key","presetRemove":"Remove this hotkey","presetAdd":"Add hotkey","blocklist":"Ignore hotkeys in these apps","blocklistHelp":"One per line. Vice leaves its keys alone while a matching app is focused, for games that clip on the same keys. Matched against the window process and class, for example ggst.exe. Needs X11, Hyprland or Sway.","directory":"Save clips to","directoryHelp":"Directory where clips are written","tagWithGame":"Tag clips with the game","tagWithGameHelp":"Append the detected game to clip filenames, like Vice_Clip_4_Overwatch-2.mp4. Uses the same game list as Rich Presence and the auto playlists.","autoPlaylist":"Create a playlist per game","autoPlaylistHelp":"When a known game is focused, file the clip into an auto playlist for it with its own colour.","clipFilename":"Clip filename","clipFilenameNext":"Next clip: {name}.mp4","clipFilenameEmpty":"That template renders to nothing, so the default naming will be used.","port":"HTTP port","portHelp":"Port for the local share server","publicLink":"Public link","publicLinkHelp":"Share links that work outside your own network. Needs the cloudflared binary installed, otherwise links only work on your network.","discordEnabled":"Show what you are playing","discordCustomGames":"Custom games","discordCustomGamesPlaceholder":"My Game | mygame.exe, MyGameClient","discordClientId":"Client ID override","discordClientIdHelp":"Optional. Leave empty to use Vice's own Discord application, or provide your own Application ID for custom branding.","discordClientIdPlaceholder":"Discord Application ID","accent":"Accent colour","accentHelp":"Tints the controls, the highlights and the ambient wash behind the app. Saved straight away, and shared clips pick it up too.","accentAria":"{name} accent","effects":"Visual effects","effectsHelp":"Motion and depth cost a GPU. Auto measures how fast frames arrive in this window and turns them down when it cannot keep up.","effectsAuto":"Auto","effectsFull":"Full","effectsReduced":"Reduced","effectsSoftware":"This window is compositing in software, so effects are reduced.","effectsSlow":"Frames are arriving too slowly here, so effects are reduced.","effectsKeepingUp":"Frames are keeping up, so the full treatment is on.","effectsMeasuring":"Measuring.","gsrArgs":"Extra gpu-screen-recorder arguments","checkForUpdates":"Check for updates","checkForUpdatesHelp":"Ask GitHub once a day whether a newer Vice is out. Nothing about you or your clips is sent.","checkNow":"Check now","checkNowHelp":"Look straight away, ignoring the daily wait.","checking":"Checking","updateAvailable":"Vice {version} is available","upToDate":"You are on the latest release","errCheckUpdate":"Could not reach GitHub","savedNotApplied":"Saved, but not applied","saved":"Settings saved","bufferRaised":"Buffer raised to {length} to cover your longest clip key","errSave":"Could not save your settings","unsaved":"Unsaved changes","allSaved":"Everything saved","discard":"Discard","saving":"Saving","saveSettings":"Save settings","restartTitle":"Restart Vice to finish","restartBody":"The sharing settings are saved, but the server only picks up a new port or tunnel setting when the daemon restarts.","clipFilenameHelp":"Leave empty for the default Vice_Clip_4 naming. Use {n} for the clip number, {date}, {time}, and {game} (needs the toggle above). Clips are never overwritten.","discordEnabledHelp":"Puts \\"Clipping with Vice\\" on your Discord profile while a known game is focused. On by default, and window titles are never sent.","discordCustomGamesHelp":"One game per line: {format}. Matches are case-insensitive substrings checked against the focused window's process name and class. The bundled list already covers over 300 games.","gsrArgsHelp":"Appended to the recorder command as written. Example: {example}","language":"Language","languageHelp":"Vice is translated by the people who use it. If yours is missing or half done, the file to fill in is one JSON file: see docs/TRANSLATING.md.","screenshotKey":"Screenshot key","screenshotKeyHelp":"Saves what is on screen as a picture, in the Images section. Unset by default. Screenshots are copied to the clipboard as well.","screenshotKeyNow":"Screenshots are on {key}","screenshotKeyCleared":"Screenshot key cleared","clearKey":"Clear","imageDirectory":"Image folder","imageDirectoryHelp":"Where screenshots are written. Kept apart from clips so an image viewer is not indexing a folder of video files.","soundScreenshot":"Screenshot"}`),ur={app:Hn,common:Un,clips:Wn,home:Gn,card:Kn,playlistModal:qn,frame:Jn,banners:Yn,island:Xn,update:Zn,audioTracks:Qn,keyCapture:$n,nav:er,viewer:tr,trim:nr,images:rr,tutorial:ir,accents:ar,events:or,about:sr,editor:cr,settings:lr}})),fr,pr,mr=o((()=>{dr(),fr={en:ur},pr={en:`English`}}));function hr(e){return kr.add(e),()=>kr.delete(e)}function gr(e,t){let n=e;for(let e of t.split(`.`))if(typeof n!=`object`||!n||Array.isArray(n)||(n=n[e],n===void 0))return;return typeof n==`object`&&!_r(n)?void 0:n}function _r(e){return typeof e==`object`&&!!e&&`other`in e}function vr(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):e}function N(e,t){let n=gr(fr[Dr],e)??gr(fr[Tr],e);if(n===void 0)return e;if(typeof n==`string`)return vr(n,t);let r=typeof t?.count==`number`?t.count:0;return vr(n[Or.select(r)]??n.other??e,t)}function yr(e,t){let n=gr(fr[Dr],e)??gr(fr[Tr],e)??e,r=typeof n==`string`?n:e,i=[],a=/\{(\w+)\}/g,o=0,s;for(;(s=a.exec(r))!==null;)s.index>o&&i.push(r.slice(o,s.index)),i.push(s[1]in t?t[s[1]]:s[0]),o=s.index+s[0].length;return oe.toLowerCase()===n.toLowerCase());if(r)return r;let i=n.split(`-`)[0].toLowerCase();return t.find(e=>e.split(`-`)[0].toLowerCase()===i)??Tr}function Cr(e){Dr=e,Or=new Intl.PluralRules(e);try{localStorage.setItem(Er,e)}catch{}document.documentElement.lang=e;for(let e of kr)e()}function wr(){let e=null;try{e=localStorage.getItem(Er)}catch{e=null}let t=Sr(e||navigator.language);return Dr=t,Or=new Intl.PluralRules(t),document.documentElement.lang=t,t}var Tr,Er,Dr,Or,kr,Ar=o((()=>{mr(),Tr=`en`,Er=`vice-locale`,Dr=Tr,Or=new Intl.PluralRules(Tr),kr=new Set})),jr,Mr=o((()=>{jr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim()})),Nr,Pr=o((()=>{Nr=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()})),Fr,Ir=o((()=>{Fr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase())})),Lr,Rr=o((()=>{Ir(),Lr=e=>{let t=Fr(e);return t.charAt(0).toUpperCase()+t.slice(1)}})),zr,Br=o((()=>{zr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`}})),Vr,Hr=o((()=>{Vr=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1}})),Ur,Wr,Gr,Kr=o((()=>{Ur=l(d(),1),Wr=(0,Ur.createContext)({}),Gr=()=>(0,Ur.useContext)(Wr)})),qr,Jr,Yr=o((()=>{qr=l(d(),1),Br(),Hr(),Mr(),Kr(),Jr=(0,qr.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Gr()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,qr.createElement)(`svg`,{ref:c,...zr,width:t??l??zr.width,height:t??l??zr.height,stroke:e??f,strokeWidth:m,className:jr(`lucide`,p,i),...!a&&!Vr(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,qr.createElement)(e,t)),...Array.isArray(a)?a:[a]])})})),Xr,Zr,Qr=o((()=>{Xr=l(d(),1),Mr(),Pr(),Rr(),Yr(),Zr=(e,t)=>{let n=(0,Xr.forwardRef)(({className:n,...r},i)=>(0,Xr.createElement)(Jr,{ref:i,iconNode:t,className:jr(`lucide-${Nr(Lr(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Lr(e),n}})),$r,ei,ti=o((()=>{Qr(),$r=[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]],ei=Zr(`arrow-down`,$r)})),ni,ri,ii=o((()=>{Qr(),ni=[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]],ri=Zr(`arrow-up-down`,ni)})),ai,oi,si=o((()=>{Qr(),ai=[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]],oi=Zr(`arrow-up`,ai)})),ci,li,ui=o((()=>{Qr(),ci=[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]],li=Zr(`calendar`,ci)})),di,fi,pi=o((()=>{Qr(),di=[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]],fi=Zr(`check-check`,di)})),mi,hi,gi=o((()=>{Qr(),mi=[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]],hi=Zr(`check`,mi)})),_i,vi,yi=o((()=>{Qr(),_i=[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]],vi=Zr(`chevron-down`,_i)})),bi,xi,Si=o((()=>{Qr(),bi=[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]],xi=Zr(`chevron-left`,bi)})),Ci,wi,Ti=o((()=>{Qr(),Ci=[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]],wi=Zr(`chevron-right`,Ci)})),Ei,Di,Oi=o((()=>{Qr(),Ei=[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]],Di=Zr(`chevrons-left`,Ei)})),ki,Ai,ji=o((()=>{Qr(),ki=[[`path`,{d:`m6 17 5-5-5-5`,key:`xnjwq`}],[`path`,{d:`m13 17 5-5-5-5`,key:`17xmmf`}]],Ai=Zr(`chevrons-right`,ki)})),Mi,Ni,Pi=o((()=>{Qr(),Mi=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],Ni=Zr(`circle-check-big`,Mi)})),Fi,Ii,Li=o((()=>{Qr(),Fi=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],Ii=Zr(`circle-x`,Fi)})),Ri,zi,Bi=o((()=>{Qr(),Ri=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]],zi=Zr(`clock`,Ri)})),Vi,Hi,Ui=o((()=>{Qr(),Vi=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],Hi=Zr(`columns-2`,Vi)})),Wi,Gi,Ki=o((()=>{Qr(),Wi=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]],Gi=Zr(`copy`,Wi)})),qi,Ji,Yi=o((()=>{Qr(),qi=[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],Ji=Zr(`ellipsis`,qi)})),Xi,Zi,Qi=o((()=>{Qr(),Xi=[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]],Zi=Zr(`external-link`,Xi)})),$i,ea,ta=o((()=>{Qr(),$i=[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]],ea=Zr(`eye-off`,$i)})),na,ra,ia=o((()=>{Qr(),na=[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]],ra=Zr(`funnel`,na)})),aa,oa,sa=o((()=>{Qr(),aa=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]],oa=Zr(`info`,aa)})),ca,la,ua=o((()=>{Qr(),ca=[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]],la=Zr(`menu`,ca)})),da,fa,pa=o((()=>{Qr(),da=[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]],fa=Zr(`mic`,da)})),ma,ha,ga=o((()=>{Qr(),ma=[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]],ha=Zr(`search`,ma)})),_a,va,ya=o((()=>{Qr(),_a=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]],va=Zr(`square`,_a)})),ba,xa,Sa=o((()=>{Qr(),ba=[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],xa=Zr(`triangle-alert`,ba)})),Ca,wa,Ta=o((()=>{Qr(),Ca=[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]],wa=Zr(`wrench`,Ca)})),Ea,Da,Oa=o((()=>{Qr(),Ea=[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]],Da=Zr(`x`,Ea)})),ka=o((()=>{Qr(),Pi(),Li(),Ui(),Yi(),ia(),Sa(),ti(),ii(),si(),ui(),pi(),gi(),yi(),Si(),Ti(),Oi(),ji(),Bi(),Ki(),Qi(),ta(),sa(),ua(),pa(),ga(),ya(),Ta(),Oa(),Kr(),Yr()})),Aa,ja,Ma,Na=o((()=>{ka(),Aa=M(),ja={size:`1em`,"aria-hidden":!0},Ma={close:(0,Aa.jsx)(Da,{...ja}),chevronDown:(0,Aa.jsx)(vi,{...ja}),chevronLeft:(0,Aa.jsx)(xi,{...ja}),chevronRight:(0,Aa.jsx)(wi,{...ja}),chevronsLeft:(0,Aa.jsx)(Di,{...ja}),chevronsRight:(0,Aa.jsx)(Ai,{...ja}),check:(0,Aa.jsx)(hi,{...ja}),success:(0,Aa.jsx)(Ni,{...ja}),error:(0,Aa.jsx)(Ii,{...ja}),warning:(0,Aa.jsx)(xa,{...ja}),info:(0,Aa.jsx)(oa,{...ja}),calendar:(0,Aa.jsx)(li,{...ja}),clock:(0,Aa.jsx)(zi,{...ja}),externalLink:(0,Aa.jsx)(Zi,{...ja}),menu:(0,Aa.jsx)(la,{...ja}),moreHorizontal:(0,Aa.jsx)(Ji,{...ja}),search:(0,Aa.jsx)(ha,{...ja}),arrowUp:(0,Aa.jsx)(oi,{...ja}),arrowDown:(0,Aa.jsx)(ei,{...ja}),arrowsUpDown:(0,Aa.jsx)(ri,{...ja}),funnel:(0,Aa.jsx)(ra,{...ja}),eyeSlash:(0,Aa.jsx)(ea,{...ja}),viewColumns:(0,Aa.jsx)(Hi,{...ja}),copy:(0,Aa.jsx)(Gi,{...ja}),checkDouble:(0,Aa.jsx)(fi,{...ja}),wrench:(0,Aa.jsx)(wa,{...ja}),stop:(0,Aa.jsx)(va,{...ja}),microphone:(0,Aa.jsx)(fa,{...ja})}})),Pa,Fa,Ia=o((()=>{jn(),Na(),Pa=En({name:`xds-neutral`,tokens:{keyword:[`#700084`,`#efa8ff`],string:[`#005600`,`#a6d2a2`],comment:[`#737373`,`#a3a3a3`],number:[`#6e3500`,`#ffb37f`],function:[`#00458c`,`#a0caff`],type:[`#700084`,`#efa8ff`],variable:[`#171717`,`#e5e5e5`],operator:[`#737373`,`#a3a3a3`],constant:[`#6e3500`,`#ffb37f`],tag:[`#89001a`,`#ffaeaa`],attribute:[`#584400`,`#eec12f`],property:[`#005348`,`#83dac9`],punctuation:[`#a3a3a3`,`#525252`],background:[`#fafafa`,`#0a0a0a`]}}),Fa=ln({name:`neutral`,typography:{scale:{base:14,ratio:1.2},body:{family:`Figtree`,fallbacks:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`},heading:{family:`Figtree`,fallbacks:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,weights:{3:`bold`,4:`bold`}},code:{family:`ui-monospace`,fallbacks:`"SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace`}},motion:{fast:125,medium:300,slow:700,ratio:.75},syntax:Pa,tokens:{"--color-background-surface":[`#ffffff`,`#262626`],"--color-background-body":[`#f1f1f1`,`#1b1b1b`],"--color-background-card":[`#ffffff`,`#1b1b1b`],"--color-background-popover":[`#ffffff`,`#1b1b1b`],"--color-background-muted":[`#f1f1f1`,`#1b1b1b`],"--color-accent":[`#262626`,`#ebebeb`],"--color-accent-muted":[`#f1f1f1`,`#262626`],"--color-neutral":[`#0000000F`,`#FFFFFF1A`],"--color-overlay":[`#00000080`,`#000000CC`],"--color-overlay-hover":[`#0000000D`,`#FFFFFF0D`],"--color-overlay-pressed":[`#0000001A`,`#FFFFFF1A`],"--color-text-primary":[`#171717`,`#fafafa`],"--color-text-secondary":[`#525252`,`#a3a3a3`],"--color-text-disabled":[`#a3a3a3`,`#525252`],"--color-text-accent":[`#262626`,`#ebebeb`],"--color-on-dark":`#ffffff`,"--color-on-light":`#171717`,"--color-on-accent":[`#ffffff`,`#171717`],"--color-on-success":[`#ffffff`,`#171717`],"--color-on-error":[`#ffffff`,`#171717`],"--color-on-warning":`#171717`,"--color-icon-accent":[`#262626`,`#ebebeb`],"--color-icon-primary":[`#171717`,`#fafafa`],"--color-icon-secondary":[`#737373`,`#a3a3a3`],"--color-icon-disabled":[`#a3a3a3`,`#525252`],"--color-success":[`#007004`,`#9fe59b`],"--color-error":[`#a50c25`,`#ffc6c1`],"--color-warning":[`#745b00`,`#fdcf4f`],"--color-success-muted":[`#c5e5c0`,`#84c9803D`],"--color-error-muted":[`#facecb`,`#ff9e973D`],"--color-warning-muted":[`#f8da9d`,`#deb4333D`],"--color-border":[`#00000014`,`#FFFFFF1A`],"--color-border-emphasized":[`#d4d4d4`,`#525252`],"--color-skeleton":[`#ebebeb`,`#525252`],"--color-shadow":[`#0000001A`,`#0000004D`],"--color-tint-hover":[`black`,`white`],"--color-background-red":[`#facecb`,`#ff9e973D`],"--color-border-red":[`#e6bab8`,`#ff6f6c`],"--color-icon-red":[`#89001a`,`#ff9e97`],"--color-text-red":[`#89001a`,`#ffc6c1`],"--color-background-orange":[`#fad0b5`,`#ffa2583D`],"--color-border-orange":[`#e6bda2`,`#e2883e`],"--color-icon-orange":[`#6e3500`,`#ffa258`],"--color-text-orange":[`#6e3500`,`#ffc9a2`],"--color-background-yellow":[`#f8da9d`,`#deb4333D`],"--color-border-yellow":[`#e4c279`,`#c0990e`],"--color-icon-yellow":[`#584400`,`#deb433`],"--color-text-yellow":[`#584400`,`#fdcf4f`],"--color-background-green":[`#c5e5c0`,`#84c9803D`],"--color-border-green":[`#b2d1ac`,`#69ad67`],"--color-icon-green":[`#0c5700`,`#84c980`],"--color-text-green":[`#0c5700`,`#9fe59b`],"--color-background-teal":[`#a5e3d6`,`#7ec6b83D`],"--color-border-teal":[`#94d6c8`,`#63ab9d`],"--color-icon-teal":[`#005348`,`#7ec6b8`],"--color-text-teal":[`#005348`,`#99e2d3`],"--color-background-cyan":[`#a3e0ef`,`#83c2d43D`],"--color-border-cyan":[`#91d3e3`,`#67a7b8`],"--color-icon-cyan":[`#00505f`,`#83c2d4`],"--color-text-cyan":[`#00505f`,`#9edef0`],"--color-background-blue":[`#c4ddfb`,`#9eb7ff3D`],"--color-border-blue":[`#b1c9e7`,`#6d9cfe`],"--color-icon-blue":[`#00458c`,`#9eb7ff`],"--color-text-blue":[`#00458c`,`#c7d3ff`],"--color-background-purple":[`#eccef3`,`#f297ff3D`],"--color-border-purple":[`#d8bbdf`,`#dd74f0`],"--color-icon-purple":[`#700084`,`#f297ff`],"--color-text-purple":[`#700084`,`#fac1ff`],"--color-background-pink":[`#fccadc`,`#ff99c33D`],"--color-border-pink":[`#e7b7c8`,`#f273aa`],"--color-icon-pink":[`#83004b`,`#ff99c3`],"--color-text-pink":[`#83004b`,`#ffc3da`],"--color-background-gray":[`#e5e5e5`,`var(--color-neutral)`],"--color-border-gray":[`#d4d4d4`,`#262626`],"--color-icon-gray":[`#525252`,`#a3a3a3`],"--color-text-gray":[`#262626`,`#e5e5e5`],"--radius-none":`0px`,"--radius-inner":`0.375rem`,"--radius-element":`0.625rem`,"--radius-container":`0.75rem`,"--radius-page":`1.75rem`,"--radius-full":`9999px`,"--shadow-low":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 8%))`,"--shadow-med":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 12%))`,"--shadow-high":`0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 15%))`,"--shadow-inset-hover":`inset 0px 0px 0px 2px #0074e24D`,"--shadow-inset-selected":`inset 0px 0px 0px 2px #0074e280`,"--shadow-inset-success":`inset 0px 0px 0px 2px #1981004D`,"--shadow-inset-warning":`inset 0px 0px 0px 2px #ffce2f4D`,"--shadow-inset-error":`inset 0px 0px 0px 2px #e33f4a4D`},components:{button:{"variant:destructive":{backgroundColor:`var(--color-error-muted)`,color:`var(--color-error)`}},badge:{"variant:info":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`,color:`light-dark(#ffffff, #171717)`},"variant:neutral":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`},"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`,color:`light-dark(#ffffff, #171717)`},"variant:warning":{backgroundColor:`#ffce2f`,color:`#171717`},"variant:error":{backgroundColor:`light-dark(#e33f4a, #ff705d)`,color:`light-dark(#ffffff, #171717)`},"variant:red":{backgroundColor:`var(--color-background-red)`,color:`var(--color-text-red)`},"variant:orange":{backgroundColor:`var(--color-background-orange)`,color:`var(--color-text-orange)`},"variant:yellow":{backgroundColor:`var(--color-background-yellow)`,color:`var(--color-text-yellow)`},"variant:green":{backgroundColor:`var(--color-background-green)`,color:`var(--color-text-green)`},"variant:teal":{backgroundColor:`var(--color-background-teal)`,color:`var(--color-text-teal)`},"variant:cyan":{backgroundColor:`var(--color-background-cyan)`,color:`var(--color-text-cyan)`},"variant:blue":{backgroundColor:`var(--color-background-blue)`,color:`var(--color-text-blue)`},"variant:purple":{backgroundColor:`var(--color-background-purple)`,color:`var(--color-text-purple)`},"variant:pink":{backgroundColor:`var(--color-background-pink)`,color:`var(--color-text-pink)`},"variant:gray":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`}},statusdot:{"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`},"variant:warning":{backgroundColor:`#ffce2f`},"variant:error":{backgroundColor:`light-dark(#e33f4a, #ff705d)`},"variant:accent":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`}},banner:{"status:info":{backgroundColor:`var(--color-background-blue)`,"--color-accent-muted":`transparent`,"--color-text-primary":`var(--color-text-blue)`,"--color-text-secondary":`var(--color-text-blue)`,"--color-accent":`var(--color-text-blue)`},"status:success":{"--color-text-primary":`var(--color-text-green)`,"--color-text-secondary":`var(--color-text-green)`,"--color-success":`var(--color-text-green)`},"status:warning":{"--color-text-primary":`var(--color-text-yellow)`,"--color-text-secondary":`var(--color-text-yellow)`,"--color-warning":`var(--color-text-yellow)`},"status:error":{"--color-text-primary":`var(--color-text-red)`,"--color-text-secondary":`var(--color-text-red)`,"--color-error":`var(--color-text-red)`}},switch:{base:{"--color-background-gray":`var(--color-border-emphasized)`}},progressbar:{base:{"--color-background-muted":`var(--color-border-emphasized)`},"variant:accent":{"--color-accent":`#0074e2`},"variant:success":{"--color-success":`#198100`},"variant:warning":{"--color-warning":`#ffce2f`},"variant:error":{"--color-error":`#e33f4a`}},card:{base:{padding:`var(--spacing-3)`}},section:{base:{padding:`var(--spacing-3)`}}},icons:Ma})})),La,Ra,za,Ba=o((()=>{La={blue:{base:`#8ab9f3`,onBase:`#003259`,hover:`#9fcaff`,active:`#79a9e2`,bg:`#11131a`,surfaceLowest:`#0c0e15`,surfaceLow:`#191b23`,surface:`#1d1f27`,surfaceHigh:`#272a31`,surfaceHighest:`#32343c`,onSurface:`#e1e2ec`,onSurfaceVariant:`#c2c6d6`,primaryContainer:`#08497c`,onPrimaryContainer:`#d2e4ff`,secondaryContainer:`#324862`,onSecondaryContainer:`#d2e4ff`,tertiaryContainer:`#563c69`,onTertiaryContainer:`#f3daff`,outline:`#8c909f`,outlineVariant:`#424654`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#003660`},purple:{base:`#d0bcff`,onBase:`#372463`,hover:`#dfd0ff`,active:`#c0abf4`,bg:`#161219`,surfaceLowest:`#110c14`,surfaceLow:`#1f1a21`,surface:`#231e25`,surfaceHigh:`#2e2830`,surfaceHighest:`#39333b`,onSurface:`#eadfea`,onSurfaceVariant:`#d0c2d3`,primaryContainer:`#4e3b7c`,onPrimaryContainer:`#e9ddff`,secondaryContainer:`#4b4163`,onSecondaryContainer:`#e9ddff`,tertiaryContainer:`#6c3648`,onTertiaryContainer:`#ffd9e2`,outline:`#998d9d`,outlineVariant:`#4d4351`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#3c2968`},green:{base:`#85d7ae`,onBase:`#003824`,hover:`#95e8be`,active:`#74c69e`,bg:`#0c1513`,surfaceLowest:`#07100e`,surfaceLow:`#141d1b`,surface:`#18211f`,surfaceHigh:`#232c29`,surfaceHighest:`#2d3734`,onSurface:`#dbe5e0`,onSurfaceVariant:`#b8cbc4`,primaryContainer:`#005236`,onPrimaryContainer:`#a0f4c9`,secondaryContainer:`#284e3c`,onSecondaryContainer:`#c2ecd3`,tertiaryContainer:`#004d61`,onTertiaryContainer:`#b9eaff`,outline:`#83958f`,outlineVariant:`#3a4a45`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#003d28`},red:{base:`#ffb3ad`,onBase:`#5a1b19`,hover:`#ffcbc6`,active:`#fd9c95`,bg:`#1c110d`,surfaceLowest:`#160c08`,surfaceLow:`#251915`,surface:`#291d19`,surfaceHigh:`#342723`,surfaceHighest:`#40322d`,onSurface:`#f5ded7`,onSurfaceVariant:`#dfc0b6`,primaryContainer:`#77302d`,onPrimaryContainer:`#ffdad7`,secondaryContainer:`#663b38`,onSecondaryContainer:`#ffdad7`,tertiaryContainer:`#5d4202`,onTertiaryContainer:`#ffdea6`,outline:`#a78b81`,outlineVariant:`#58423a`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#5f1f1d`},orange:{base:`#ffb690`,onBase:`#552100`,hover:`#ffcdb4`,active:`#f9a171`,bg:`#1b120a`,surfaceLowest:`#150c06`,surfaceLow:`#231a11`,surface:`#281e15`,surfaceHigh:`#33281f`,surfaceHighest:`#3e3329`,onSurface:`#f2dfd1`,onSurfaceVariant:`#dcc2ad`,primaryContainer:`#73350e`,onPrimaryContainer:`#ffdbca`,secondaryContainer:`#653d27`,onSecondaryContainer:`#ffdbca`,tertiaryContainer:`#4d4808`,onTertiaryContainer:`#ede596`,outline:`#a48c7a`,outlineVariant:`#554334`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#5b2400`}},Ra=`blue`,za=Object.keys(La)}));function Va(e){return e<0?-1:e===0?0:1}function Ha(e,t,n){return(1-n)*e+n*t}function Ua(e,t,n){return nt?t:n}function Wa(e,t,n){return nt?t:n}function Ga(e){return e%=360,e<0&&(e+=360),e}function Ka(e){return e%=360,e<0&&(e+=360),e}function qa(e,t){return 180-Math.abs(Math.abs(e-t)-180)}function Ja(e,t){return[e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2],e[0]*t[1][0]+e[1]*t[1][1]+e[2]*t[1][2],e[0]*t[2][0]+e[1]*t[2][1]+e[2]*t[2][2]]}var Ya=o((()=>{}));function Xa(e,t,n){return(255<<24|(e&255)<<16|(t&255)<<8|n&255)>>>0}function Za(e){return Xa(lo(e[0]),lo(e[1]),lo(e[2]))}function Qa(e){return e>>16&255}function $a(e){return e>>8&255}function eo(e){return e&255}function to(e,t,n){let r=ho,i=r[0][0]*e+r[0][1]*t+r[0][2]*n,a=r[1][0]*e+r[1][1]*t+r[1][2]*n,o=r[2][0]*e+r[2][1]*t+r[2][2]*n;return Xa(lo(i),lo(a),lo(o))}function no(e){return Ja([co(Qa(e)),co($a(e)),co(eo(e))],mo)}function ro(e){let t=co(Qa(e)),n=co($a(e)),r=co(eo(e)),i=mo,a=i[0][0]*t+i[0][1]*n+i[0][2]*r,o=i[1][0]*t+i[1][1]*n+i[1][2]*r,s=i[2][0]*t+i[2][1]*n+i[2][2]*r,c=go,l=a/c[0],u=o/c[1],d=s/c[2],f=fo(l),p=fo(u),m=fo(d);return[116*p-16,500*(f-p),200*(p-m)]}function io(e){let t=lo(oo(e));return Xa(t,t,t)}function ao(e){let t=no(e)[1];return 116*fo(t/100)-16}function oo(e){return 100*po((e+16)/116)}function so(e){return fo(e/100)*116-16}function co(e){let t=e/255;return t<=.040449936?t/12.92*100:((t+.055)/1.055)**2.4*100}function lo(e){let t=e/100,n=0;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,Ua(0,255,Math.round(n*255))}function uo(){return go}function fo(e){return e>.008856451679035631?e**(1/3):(903.2962962962963*e+16)/116}function po(e){let t=e*e*e;return t>.008856451679035631?t:(116*e-16)/903.2962962962963}var mo,ho,go,_o=o((()=>{Ya(),mo=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],ho=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],go=[95.047,100,108.883]})),vo,yo=o((()=>{_o(),Ya(),vo=class e{static make(t=uo(),n=200/Math.PI*oo(50)/100,r=50,i=2,a=!1){let o=t,s=o[0]*.401288+o[1]*.650173+o[2]*-.051461,c=o[0]*-.250268+o[1]*1.204414+o[2]*.045854,l=o[0]*-.002079+o[1]*.048952+o[2]*.953127,u=.8+i/10,d=u>=.9?Ha(.59,.69,(u-.9)*10):Ha(.525,.59,(u-.8)*10),f=a?1:u*(1-1/3.6*Math.exp((-n-42)/92));f=f>1?1:f<0?0:f;let p=u,m=[100/s*f+1-f,100/c*f+1-f,100/l*f+1-f],h=1/(5*n+1),g=h*h*h*h,_=1-g,v=g*n+.1*_*_*Math.cbrt(5*n),y=oo(r)/t[1],b=1.48+Math.sqrt(y),x=.725/y**.2,S=x,C=[(v*m[0]*s/100)**.42,(v*m[1]*c/100)**.42,(v*m[2]*l/100)**.42],w=[400*C[0]/(C[0]+27.13),400*C[1]/(C[1]+27.13),400*C[2]/(C[2]+27.13)],ee=(2*w[0]+w[1]+.05*w[2])*x;return new e(y,ee,x,S,d,p,m,v,v**.25,b)}constructor(e,t,n,r,i,a,o,s,c,l){this.n=e,this.aw=t,this.nbb=n,this.ncb=r,this.c=i,this.nc=a,this.rgbD=o,this.fl=s,this.fLRoot=c,this.z=l}},vo.DEFAULT=vo.make()})),P,bo=o((()=>{_o(),Ya(),yo(),P=class e{constructor(e,t,n,r,i,a,o,s,c){this.hue=e,this.chroma=t,this.j=n,this.q=r,this.m=i,this.s=a,this.jstar=o,this.astar=s,this.bstar=c}distance(e){let t=this.jstar-e.jstar,n=this.astar-e.astar,r=this.bstar-e.bstar;return 1.41*Math.sqrt(t*t+n*n+r*r)**.63}static fromInt(t){return e.fromIntInViewingConditions(t,vo.DEFAULT)}static fromIntInViewingConditions(t,n){let r=(t&16711680)>>16,i=(t&65280)>>8,a=t&255,o=co(r),s=co(i),c=co(a),l=.41233895*o+.35762064*s+.18051042*c,u=.2126*o+.7152*s+.0722*c,d=.01932141*o+.11916382*s+.95034478*c,f=.401288*l+.650173*u-.051461*d,p=-.250268*l+1.204414*u+.045854*d,m=-.002079*l+.048952*u+.953127*d,h=n.rgbD[0]*f,g=n.rgbD[1]*p,_=n.rgbD[2]*m,v=(n.fl*Math.abs(h)/100)**.42,y=(n.fl*Math.abs(g)/100)**.42,b=(n.fl*Math.abs(_)/100)**.42,x=Va(h)*400*v/(v+27.13),S=Va(g)*400*y/(y+27.13),C=Va(_)*400*b/(b+27.13),w=(11*x+-12*S+C)/11,ee=(x+S-2*C)/9,te=(20*x+20*S+21*C)/20,ne=(40*x+20*S+C)/20,T=Ka(Math.atan2(ee,w)*180/Math.PI),re=T*Math.PI/180,E=100*(ne*n.nbb/n.aw)**+(n.c*n.z),D=4/n.c*Math.sqrt(E/100)*(n.aw+4)*n.fLRoot,ie=T<20.14?T+360:T,ae=(5e4/13*(.25*(Math.cos(ie*Math.PI/180+2)+3.8))*n.nc*n.ncb*Math.sqrt(w*w+ee*ee)/(te+.305))**.9*(1.64-.29**n.n)**.73,O=ae*Math.sqrt(E/100),oe=O*n.fLRoot,k=50*Math.sqrt(ae*n.c/(n.aw+4)),A=(1+100*.007)*E/(1+.007*E),se=1/.0228*Math.log(1+.0228*oe),ce=se*Math.cos(re),j=se*Math.sin(re);return new e(T,O,E,D,oe,k,A,ce,j)}static fromJch(t,n,r){return e.fromJchInViewingConditions(t,n,r,vo.DEFAULT)}static fromJchInViewingConditions(t,n,r,i){let a=4/i.c*Math.sqrt(t/100)*(i.aw+4)*i.fLRoot,o=n*i.fLRoot,s=n/Math.sqrt(t/100),c=50*Math.sqrt(s*i.c/(i.aw+4)),l=r*Math.PI/180,u=(1+100*.007)*t/(1+.007*t),d=1/.0228*Math.log(1+.0228*o),f=d*Math.cos(l),p=d*Math.sin(l);return new e(r,n,t,a,o,c,u,f,p)}static fromUcs(t,n,r){return e.fromUcsInViewingConditions(t,n,r,vo.DEFAULT)}static fromUcsInViewingConditions(t,n,r,i){let a=n,o=r,s=Math.sqrt(a*a+o*o),c=(Math.exp(s*.0228)-1)/.0228/i.fLRoot,l=180/Math.PI*Math.atan2(o,a);l<0&&(l+=360);let u=t/(1-(t-100)*.007);return e.fromJchInViewingConditions(u,c,l,i)}toInt(){return this.viewed(vo.DEFAULT)}viewed(e){let t=((this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100))/(1.64-.29**e.n)**.73)**(1/.9),n=this.hue*Math.PI/180,r=.25*(Math.cos(n+2)+3.8),i=e.aw*(this.j/100)**(1/e.c/e.z),a=5e4/13*r*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(n),c=Math.cos(n),l=23*(o+.305)*t/(23*a+11*t*c+108*t*s),u=l*c,d=l*s,f=(460*o+451*u+288*d)/1403,p=(460*o-891*u-261*d)/1403,m=(460*o-220*u-6300*d)/1403,h=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),g=Va(f)*(100/e.fl)*h**(1/.42),_=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),v=Va(p)*(100/e.fl)*_**(1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=Va(m)*(100/e.fl)*y**(1/.42),x=g/e.rgbD[0],S=v/e.rgbD[1],C=b/e.rgbD[2];return to(1.86206786*x-1.01125463*S+.14918677*C,.38752654*x+.62144744*S-.00897398*C,-.0158415*x-.03412294*S+1.04996444*C)}static fromXyzInViewingConditions(t,n,r,i){let a=.401288*t+.650173*n-.051461*r,o=-.250268*t+1.204414*n+.045854*r,s=-.002079*t+.048952*n+.953127*r,c=i.rgbD[0]*a,l=i.rgbD[1]*o,u=i.rgbD[2]*s,d=(i.fl*Math.abs(c)/100)**.42,f=(i.fl*Math.abs(l)/100)**.42,p=(i.fl*Math.abs(u)/100)**.42,m=Va(c)*400*d/(d+27.13),h=Va(l)*400*f/(f+27.13),g=Va(u)*400*p/(p+27.13),_=(11*m+-12*h+g)/11,v=(m+h-2*g)/9,y=(20*m+20*h+21*g)/20,b=(40*m+20*h+g)/20,x=Math.atan2(v,_)*180/Math.PI,S=x<0?x+360:x>=360?x-360:x,C=S*Math.PI/180,w=100*(b*i.nbb/i.aw)**+(i.c*i.z),ee=4/i.c*Math.sqrt(w/100)*(i.aw+4)*i.fLRoot,te=S<20.14?S+360:S,ne=(5e4/13*(1/4*(Math.cos(te*Math.PI/180+2)+3.8))*i.nc*i.ncb*Math.sqrt(_*_+v*v)/(y+.305))**.9*(1.64-.29**i.n)**.73,T=ne*Math.sqrt(w/100),re=T*i.fLRoot,E=50*Math.sqrt(ne*i.c/(i.aw+4)),D=(1+100*.007)*w/(1+.007*w),ie=Math.log(1+.0228*re)/.0228,ae=ie*Math.cos(C),O=ie*Math.sin(C);return new e(S,T,w,ee,re,E,D,ae,O)}xyzInViewingConditions(e){let t=((this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100))/(1.64-.29**e.n)**.73)**(1/.9),n=this.hue*Math.PI/180,r=.25*(Math.cos(n+2)+3.8),i=e.aw*(this.j/100)**(1/e.c/e.z),a=5e4/13*r*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(n),c=Math.cos(n),l=23*(o+.305)*t/(23*a+11*t*c+108*t*s),u=l*c,d=l*s,f=(460*o+451*u+288*d)/1403,p=(460*o-891*u-261*d)/1403,m=(460*o-220*u-6300*d)/1403,h=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),g=Va(f)*(100/e.fl)*h**(1/.42),_=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),v=Va(p)*(100/e.fl)*_**(1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=Va(m)*(100/e.fl)*y**(1/.42),x=g/e.rgbD[0],S=v/e.rgbD[1],C=b/e.rgbD[2];return[1.86206786*x-1.01125463*S+.14918677*C,.38752654*x+.62144744*S-.00897398*C,-.0158415*x-.03412294*S+1.04996444*C]}}})),xo,So=o((()=>{_o(),Ya(),bo(),yo(),xo=class e{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){let t=e/100,n=0;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,n*255}static chromaticAdaptation(e){let t=Math.abs(e)**.42;return Va(e)*400*t/(t+27.13)}static hueOf(t){let n=Ja(t,e.SCALED_DISCOUNT_FROM_LINRGB),r=e.chromaticAdaptation(n[0]),i=e.chromaticAdaptation(n[1]),a=e.chromaticAdaptation(n[2]),o=(11*r+-12*i+a)/11,s=(r+i-2*a)/9;return Math.atan2(s,o)}static areInCyclicOrder(t,n,r){return e.sanitizeRadians(n-t)100.01||y[1]>100.01||y[2]>100.01?0:Za(y);i-=(C-r)*i/(2*C)}return 0}static solveToInt(t,n,r){if(n<1e-4||r<1e-4||r>99.9999)return io(r);t=Ka(t);let i=t/180*Math.PI,a=oo(r),o=e.findResultByJ(i,n,a);return o===0?Za(e.bisectToLimit(a,i)):o}static solveToCam(t,n,r){return P.fromInt(e.solveToInt(t,n,r))}},xo.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],xo.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],xo.Y_FROM_LINRGB=[.2126,.7152,.0722],xo.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776]})),F,Co=o((()=>{_o(),bo(),So(),yo(),F=class e{static from(t,n,r){return new e(xo.solveToInt(t,n,r))}static fromInt(t){return new e(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(xo.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(xo.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(xo.solveToInt(this.internalHue,this.internalChroma,e))}setValue(e,t){this[e]=t}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(e){return e>=250&&e<270}static isYellow(e){return e>=105&&e<125}static isCyan(e){return e>=170&&e<207}constructor(e){this.argb=e;let t=P.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=ao(e),this.argb=e}setInternalState(e){let t=P.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=ao(e),this.argb=e}inViewingConditions(t){let n=P.fromInt(this.toInt()).xyzInViewingConditions(t),r=P.fromXyzInViewingConditions(n[0],n[1],n[2],vo.make());return e.from(r.hue,r.chroma,so(n[1]))}}})),wo=o((()=>{bo(),Co()})),To,Eo=o((()=>{_o(),Ya(),To=class e{static ratioOfTones(t,n){return t=Wa(0,100,t),n=Wa(0,100,n),e.ratioOfYs(oo(t),oo(n))}static ratioOfYs(e,t){let n=e>t?e:t,r=n===t?e:t;return(n+5)/(r+5)}static lighter(t,n){if(t<0||t>100)return-1;let r=oo(t),i=n*(r+5)-5,a=e.ratioOfYs(i,r),o=Math.abs(a-n);if(a.04)return-1;let s=so(i)+.4;return s<0||s>100?-1:s}static darker(t,n){if(t<0||t>100)return-1;let r=oo(t),i=(r+5)/n-5,a=e.ratioOfYs(r,i),o=Math.abs(a-n);if(a.04)return-1;let s=so(i)-.4;return s<0||s>100?-1:s}static lighterUnsafe(t,n){let r=e.lighter(t,n);return r<0?100:r}static darkerUnsafe(t,n){let r=e.darker(t,n);return r<0?0:r}}})),Do,Oo=o((()=>{Co(),Do=class e{static isDisliked(e){let t=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,n=Math.round(e.chroma)>16,r=Math.round(e.tone)<65;return t&&n&&r}static fixIfDisliked(t){return e.isDisliked(t)?F.from(t.hue,t.chroma,70):t}}}));function ko(e,t,n){if(e.name!==n.name)throw Error(`Attempting to extend color ${e.name} with color ${n.name} of different name for spec version ${t}.`);if(e.isBackground!==n.isBackground)throw Error(`Attempting to extend color ${e.name} as a ${e.isBackground?`background`:`foreground`} with color ${n.name} as a ${n.isBackground?`background`:`foreground`} for spec version ${t}.`)}function I(e,t,n){return ko(e,t,n),L.fromPalette({name:e.name,palette:r=>r.specVersion===t?n.palette(r):e.palette(r),tone:r=>r.specVersion===t?n.tone(r):e.tone(r),isBackground:e.isBackground,chromaMultiplier:r=>{let i=r.specVersion===t?n.chromaMultiplier:e.chromaMultiplier;return i===void 0?1:i(r)},background:r=>{let i=r.specVersion===t?n.background:e.background;return i===void 0?void 0:i(r)},secondBackground:r=>{let i=r.specVersion===t?n.secondBackground:e.secondBackground;return i===void 0?void 0:i(r)},contrastCurve:r=>{let i=r.specVersion===t?n.contrastCurve:e.contrastCurve;return i===void 0?void 0:i(r)},toneDeltaPair:r=>{let i=r.specVersion===t?n.toneDeltaPair:e.toneDeltaPair;return i===void 0?void 0:i(r)}})}function Ao(e){return e===`2025`?Po:No}var L,jo,Mo,No,Po,Fo=o((()=>{Eo(),Co(),Ya(),L=class e{static fromPalette(t){return new e(t.name??``,t.palette,t.tone??e.getInitialToneFromBackground(t.background),t.isBackground??!1,t.chromaMultiplier,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}static getInitialToneFromBackground(e){return e===void 0?e=>50:t=>e(t)?e(t).getTone(t):50}constructor(e,t,n,r,i,a,o,s,c){if(this.name=e,this.palette=t,this.tone=n,this.isBackground=r,this.chromaMultiplier=i,this.background=a,this.secondBackground=o,this.contrastCurve=s,this.toneDeltaPair=c,this.hctCache=new Map,!a&&o)throw Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!a&&s)throw Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(a&&!s)throw Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return e.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(e){return this.getHct(e).toInt()}getHct(e){let t=this.hctCache.get(e);if(t!=null)return t;let n=Ao(e.specVersion).getHct(e,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n}getTone(e){return Ao(e.specVersion).getTone(e,this)}static foregroundTone(t,n){let r=To.lighterUnsafe(t,n),i=To.darkerUnsafe(t,n),a=To.ratioOfTones(r,t),o=To.ratioOfTones(i,t);if(e.tonePrefersLightForeground(t)){let e=Math.abs(a-o)<.1&&a=n||a>=o||e?r:i}return o>=n||o>=a?i:r}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(t){return e.tonePrefersLightForeground(t)&&!e.toneAllowsLightForeground(t)?49:t}},jo=class{getHct(e,t){let n=t.getTone(e);return t.palette(e).getHct(n)}getTone(e,t){let n=e.contrastLevel<0,r=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(r){let i=r.roleA,a=r.roleB,o=r.delta,s=r.polarity,c=r.stayTogether,l=s===`nearer`||s===`lighter`&&!e.isDark||s===`darker`&&e.isDark,u=l?i:a,d=l?a:i,f=t.name===u.name,p=e.isDark?1:-1,m=u.tone(e),h=d.tone(e);if(t.background&&u.contrastCurve&&d.contrastCurve){let r=t.background(e),i=u.contrastCurve(e),a=d.contrastCurve(e);if(r&&i&&a){let t=r.getTone(e),o=i.get(e.contrastLevel),s=a.get(e.contrastLevel);To.ratioOfTones(t,m)=o||(m=Wa(0,100,h-o*p))),50<=m&&m<60?p>0?(m=60,h=Math.max(h,m+o*p)):(m=49,h=Math.min(h,m+o*p)):50<=h&&h<60&&(c?p>0?(m=60,h=Math.max(h,m+o*p)):(m=49,h=Math.min(h,m+o*p)):h=p>0?60:49),f?m:h}{let r=t.tone(e);if(t.background==null||t.background(e)===void 0||t.contrastCurve==null||t.contrastCurve(e)===void 0)return r;let i=t.background(e).getTone(e),a=t.contrastCurve(e).get(e.contrastLevel);if(To.ratioOfTones(i,r)>=a||(r=L.foregroundTone(i,a)),n&&(r=L.foregroundTone(i,a)),t.isBackground&&50<=r&&r<60&&(r=To.ratioOfTones(49,i)>=a?49:60),t.secondBackground==null||t.secondBackground(e)===void 0)return r;let[o,s]=[t.background,t.secondBackground],[c,l]=[o(e).getTone(e),s(e).getTone(e)],[u,d]=[Math.max(c,l),Math.min(c,l)];if(To.ratioOfTones(u,r)>=a&&To.ratioOfTones(d,r)>=a)return r;let f=To.lighter(u,a),p=To.darker(d,a),m=[];return f!==-1&&m.push(f),p!==-1&&m.push(p),L.tonePrefersLightForeground(c)||L.tonePrefersLightForeground(l)?f<0?100:f:m.length===1?m[0]:p<0?0:p}}},Mo=class{getHct(e,t){let n=t.palette(e),r=t.getTone(e),i=n.hue,a=n.chroma*(t.chromaMultiplier?t.chromaMultiplier(e):1);return F.from(i,a,r)}getTone(e,t){let n=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(n){let r=n.roleA,i=n.roleB,a=n.polarity,o=n.constraint,s=a===`darker`||a===`relative_lighter`&&e.isDark||a===`relative_darker`&&!e.isDark?-n.delta:n.delta,c=t.name===r.name,l=c?r:i,u=c?i:r,d=l.tone(e),f=u.getTone(e),p=s*(c?1:-1);if(o===`exact`?d=Wa(0,100,f+p):o===`nearer`?d=p>0?Wa(0,100,Wa(f,f+p,d)):Wa(0,100,Wa(f+p,f,d)):o===`farther`&&(d=p>0?Wa(f+p,100,d):Wa(0,f+p,d)),t.background&&t.contrastCurve){let n=t.background(e),r=t.contrastCurve(e);if(n&&r){let t=n.getTone(e),i=r.get(e.contrastLevel);d=To.ratioOfTones(t,d)>=i&&e.contrastLevel>=0?d:L.foregroundTone(t,i)}}return t.isBackground&&!t.name.endsWith(`_fixed_dim`)&&(d=d>=57?Wa(65,100,d):Wa(0,49,d)),d}{let n=t.tone(e);if(t.background==null||t.background(e)===void 0||t.contrastCurve==null||t.contrastCurve(e)===void 0)return n;let r=t.background(e).getTone(e),i=t.contrastCurve(e).get(e.contrastLevel);if(n=To.ratioOfTones(r,n)>=i&&e.contrastLevel>=0?n:L.foregroundTone(r,i),t.isBackground&&!t.name.endsWith(`_fixed_dim`)&&(n=n>=57?Wa(65,100,n):Wa(0,49,n)),t.secondBackground==null||t.secondBackground(e)===void 0)return n;let[a,o]=[t.background,t.secondBackground],[s,c]=[a(e).getTone(e),o(e).getTone(e)],[l,u]=[Math.max(s,c),Math.min(s,c)];if(To.ratioOfTones(l,n)>=i&&To.ratioOfTones(u,n)>=i)return n;let d=To.lighter(l,i),f=To.darker(u,i),p=[];return d!==-1&&p.push(d),f!==-1&&p.push(f),L.tonePrefersLightForeground(s)||L.tonePrefersLightForeground(c)?d<0?100:d:p.length===1?p[0]:f<0?0:f}}},No=new jo,Po=new Mo})),R,Io,Lo=o((()=>{Co(),R=class e{static fromInt(t){let n=F.fromInt(t);return e.fromHct(n)}static fromHct(t){return new e(t.hue,t.chroma,t)}static fromHueAndChroma(t,n){let r=new Io(t,n).create();return new e(t,n,r)}constructor(e,t,n){this.hue=e,this.chroma=t,this.keyColor=n,this.cache=new Map}tone(e){let t=this.cache.get(e);return t===void 0&&(t=e==99&&F.isYellow(this.hue)?this.averageArgb(this.tone(98),this.tone(100)):F.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,t)),t}getHct(e){return F.fromInt(this.tone(e))}averageArgb(e,t){let n=e>>>16&255,r=e>>>8&255,i=e&255,a=t>>>16&255,o=t>>>8&255,s=t&255,c=Math.round((n+a)/2),l=Math.round((r+o)/2),u=Math.round((i+s)/2);return(255<<24|(c&255)<<16|(l&255)<<8|u&255)>>>0}},Io=class{constructor(e,t){this.hue=e,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let e=0,t=100;for(;e=this.requestedChroma-.01){if(Math.abs(e-50){Co(),_o(),Ya(),Ro=class e{constructor(e){this.input=e,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;let e=this.hctsByHue.concat([this.input]),t=this.tempsByHct;return e.sort((e,n)=>t.get(e)-t.get(n)),this.hctsByTempCache=e,e}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(e=5,t=12){let n=Math.round(this.input.hue),r=this.hctsByHue[n],i=this.relativeTemperature(r),a=[r],o=0;for(let e=0;e<360;e++){let t=Ga(n+e),r=this.hctsByHue[t],a=this.relativeTemperature(r),s=Math.abs(a-i);i=a,o+=s}let s=1,c=o/t,l=0;for(i=this.relativeTemperature(r);a.length=d,p=1;for(;f&&a.length=e,p++}if(i=o,s++,s>360){for(;a.length=a.length&&(t%=a.length),u.splice(0,0,a[t])}let f=e-d-1;for(let e=1;e=a.length&&(t%=a.length),u.push(a[t])}return u}get complement(){if(this.complementCache!=null)return this.complementCache;let t=this.coldest.hue,n=this.tempsByHct.get(this.coldest),r=this.warmest.hue,i=this.tempsByHct.get(this.warmest)-n,a=e.isBetween(this.input.hue,t,r),o=a?r:t,s=a?t:r,c=1e3,l=this.hctsByHue[Math.round(this.input.hue)],u=1-this.inputRelativeTemperature;for(let t=0;t<=360;t+=1){let r=Ka(o+1*t);if(!e.isBetween(r,o,s))continue;let a=this.hctsByHue[Math.round(r)],d=(this.tempsByHct.get(a)-n)/i,f=Math.abs(u-d);f=0||(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input)),this.inputRelativeTemperatureCache}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;let t=this.hctsByHue.concat([this.input]),n=new Map;for(let r of t)n.set(r,e.rawTemperature(r));return this.tempsByHctCache=n,n}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;let e=[];for(let t=0;t<=360;t+=1){let n=F.from(t,this.input.chroma,this.input.tone);e.push(n)}return this.hctsByHueCache=e,this.hctsByHueCache}static isBetween(e,t,n){return t{Ya(),z=class{constructor(e,t,n,r){this.low=e,this.normal=t,this.medium=n,this.high=r}get(e){return e<=-1?this.low:e<0?Ha(this.low,this.normal,(e- -1)/1):e<.5?Ha(this.normal,this.medium,(e-0)/.5):e<1?Ha(this.medium,this.high,(e-.5)/.5):this.high}}})),Vo,Ho=o((()=>{Vo=class{constructor(e,t,n,r,i,a){this.roleA=e,this.roleB=t,this.delta=n,this.polarity=r,this.stayTogether=i,this.constraint=a,this.constraint=a??`exact`}}})),B,Uo=o((()=>{(function(e){e[e.MONOCHROME=0]=`MONOCHROME`,e[e.NEUTRAL=1]=`NEUTRAL`,e[e.TONAL_SPOT=2]=`TONAL_SPOT`,e[e.VIBRANT=3]=`VIBRANT`,e[e.EXPRESSIVE=4]=`EXPRESSIVE`,e[e.FIDELITY=5]=`FIDELITY`,e[e.CONTENT=6]=`CONTENT`,e[e.RAINBOW=7]=`RAINBOW`,e[e.FRUIT_SALAD=8]=`FRUIT_SALAD`})(B||(B={}))}));function Wo(e){return e.variant===B.FIDELITY||e.variant===B.CONTENT}function Go(e){return e.variant===B.MONOCHROME}function Ko(e,t,n,r){let i=n,a=F.from(e,t,n);if(a.chromao.chroma||Math.abs(o.chroma-t)<.4)break;Math.abs(o.chroma-t){Oo(),Co(),Bo(),Fo(),Ho(),Uo(),qo=class{primaryPaletteKeyColor(){return L.fromPalette({name:`primary_palette_key_color`,palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone})}secondaryPaletteKeyColor(){return L.fromPalette({name:`secondary_palette_key_color`,palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone})}tertiaryPaletteKeyColor(){return L.fromPalette({name:`tertiary_palette_key_color`,palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone})}neutralPaletteKeyColor(){return L.fromPalette({name:`neutral_palette_key_color`,palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone})}neutralVariantPaletteKeyColor(){return L.fromPalette({name:`neutral_variant_palette_key_color`,palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone})}errorPaletteKeyColor(){return L.fromPalette({name:`error_palette_key_color`,palette:e=>e.errorPalette,tone:e=>e.errorPalette.keyColor.tone})}background(){return L.fromPalette({name:`background`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}onBackground(){return L.fromPalette({name:`on_background`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.background(),contrastCurve:e=>new z(3,3,4.5,7)})}surface(){return L.fromPalette({name:`surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}surfaceDim(){return L.fromPalette({name:`surface_dim`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new z(87,87,80,75).get(e.contrastLevel),isBackground:!0})}surfaceBright(){return L.fromPalette({name:`surface_bright`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new z(24,24,29,34).get(e.contrastLevel):98,isBackground:!0})}surfaceContainerLowest(){return L.fromPalette({name:`surface_container_lowest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new z(4,4,2,0).get(e.contrastLevel):100,isBackground:!0})}surfaceContainerLow(){return L.fromPalette({name:`surface_container_low`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new z(10,10,11,12).get(e.contrastLevel):new z(96,96,96,95).get(e.contrastLevel),isBackground:!0})}surfaceContainer(){return L.fromPalette({name:`surface_container`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new z(12,12,16,20).get(e.contrastLevel):new z(94,94,92,90).get(e.contrastLevel),isBackground:!0})}surfaceContainerHigh(){return L.fromPalette({name:`surface_container_high`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new z(17,17,21,25).get(e.contrastLevel):new z(92,92,88,85).get(e.contrastLevel),isBackground:!0})}surfaceContainerHighest(){return L.fromPalette({name:`surface_container_highest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new z(22,22,26,30).get(e.contrastLevel):new z(90,90,84,80).get(e.contrastLevel),isBackground:!0})}onSurface(){return L.fromPalette({name:`on_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.highestSurface(e),contrastCurve:e=>new z(4.5,7,11,21)})}surfaceVariant(){return L.fromPalette({name:`surface_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0})}onSurfaceVariant(){return L.fromPalette({name:`on_surface_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>this.highestSurface(e),contrastCurve:e=>new z(3,4.5,7,11)})}inverseSurface(){return L.fromPalette({name:`inverse_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20,isBackground:!0})}inverseOnSurface(){return L.fromPalette({name:`inverse_on_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>this.inverseSurface(),contrastCurve:e=>new z(4.5,7,11,21)})}outline(){return L.fromPalette({name:`outline`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1.5,3,4.5,7)})}outlineVariant(){return L.fromPalette({name:`outline_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5)})}shadow(){return L.fromPalette({name:`shadow`,palette:e=>e.neutralPalette,tone:e=>0})}scrim(){return L.fromPalette({name:`scrim`,palette:e=>e.neutralPalette,tone:e=>0})}surfaceTint(){return L.fromPalette({name:`surface_tint`,palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0})}primary(){return L.fromPalette({name:`primary`,palette:e=>e.primaryPalette,tone:e=>Go(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(3,4.5,7,7),toneDeltaPair:e=>new Vo(this.primaryContainer(),this.primary(),10,`nearer`,!1)})}primaryDim(){}onPrimary(){return L.fromPalette({name:`on_primary`,palette:e=>e.primaryPalette,tone:e=>Go(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.primary(),contrastCurve:e=>new z(4.5,7,11,21)})}primaryContainer(){return L.fromPalette({name:`primary_container`,palette:e=>e.primaryPalette,tone:e=>Wo(e)?e.sourceColorHct.tone:Go(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.primaryContainer(),this.primary(),10,`nearer`,!1)})}onPrimaryContainer(){return L.fromPalette({name:`on_primary_container`,palette:e=>e.primaryPalette,tone:e=>Wo(e)?L.foregroundTone(this.primaryContainer().tone(e),4.5):Go(e)?e.isDark?0:100:e.isDark?90:30,background:e=>this.primaryContainer(),contrastCurve:e=>new z(3,4.5,7,11)})}inversePrimary(){return L.fromPalette({name:`inverse_primary`,palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>this.inverseSurface(),contrastCurve:e=>new z(3,4.5,7,7)})}secondary(){return L.fromPalette({name:`secondary`,palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(3,4.5,7,7),toneDeltaPair:e=>new Vo(this.secondaryContainer(),this.secondary(),10,`nearer`,!1)})}secondaryDim(){}onSecondary(){return L.fromPalette({name:`on_secondary`,palette:e=>e.secondaryPalette,tone:e=>Go(e)?e.isDark?10:100:e.isDark?20:100,background:e=>this.secondary(),contrastCurve:e=>new z(4.5,7,11,21)})}secondaryContainer(){return L.fromPalette({name:`secondary_container`,palette:e=>e.secondaryPalette,tone:e=>{let t=e.isDark?30:90;return Go(e)?e.isDark?30:85:Wo(e)?Ko(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark):t},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.secondaryContainer(),this.secondary(),10,`nearer`,!1)})}onSecondaryContainer(){return L.fromPalette({name:`on_secondary_container`,palette:e=>e.secondaryPalette,tone:e=>Go(e)?e.isDark?90:10:Wo(e)?L.foregroundTone(this.secondaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.secondaryContainer(),contrastCurve:e=>new z(3,4.5,7,11)})}tertiary(){return L.fromPalette({name:`tertiary`,palette:e=>e.tertiaryPalette,tone:e=>Go(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(3,4.5,7,7),toneDeltaPair:e=>new Vo(this.tertiaryContainer(),this.tertiary(),10,`nearer`,!1)})}tertiaryDim(){}onTertiary(){return L.fromPalette({name:`on_tertiary`,palette:e=>e.tertiaryPalette,tone:e=>Go(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.tertiary(),contrastCurve:e=>new z(4.5,7,11,21)})}tertiaryContainer(){return L.fromPalette({name:`tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>{if(Go(e))return e.isDark?60:49;if(!Wo(e))return e.isDark?30:90;let t=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return Do.fixIfDisliked(t).tone},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.tertiaryContainer(),this.tertiary(),10,`nearer`,!1)})}onTertiaryContainer(){return L.fromPalette({name:`on_tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>Go(e)?e.isDark?0:100:Wo(e)?L.foregroundTone(this.tertiaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.tertiaryContainer(),contrastCurve:e=>new z(3,4.5,7,11)})}error(){return L.fromPalette({name:`error`,palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(3,4.5,7,7),toneDeltaPair:e=>new Vo(this.errorContainer(),this.error(),10,`nearer`,!1)})}errorDim(){}onError(){return L.fromPalette({name:`on_error`,palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>this.error(),contrastCurve:e=>new z(4.5,7,11,21)})}errorContainer(){return L.fromPalette({name:`error_container`,palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.errorContainer(),this.error(),10,`nearer`,!1)})}onErrorContainer(){return L.fromPalette({name:`on_error_container`,palette:e=>e.errorPalette,tone:e=>Go(e)?e.isDark?90:10:e.isDark?90:30,background:e=>this.errorContainer(),contrastCurve:e=>new z(3,4.5,7,11)})}primaryFixed(){return L.fromPalette({name:`primary_fixed`,palette:e=>e.primaryPalette,tone:e=>Go(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.primaryFixed(),this.primaryFixedDim(),10,`lighter`,!0)})}primaryFixedDim(){return L.fromPalette({name:`primary_fixed_dim`,palette:e=>e.primaryPalette,tone:e=>Go(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.primaryFixed(),this.primaryFixedDim(),10,`lighter`,!0)})}onPrimaryFixed(){return L.fromPalette({name:`on_primary_fixed`,palette:e=>e.primaryPalette,tone:e=>Go(e)?100:10,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new z(4.5,7,11,21)})}onPrimaryFixedVariant(){return L.fromPalette({name:`on_primary_fixed_variant`,palette:e=>e.primaryPalette,tone:e=>Go(e)?90:30,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new z(3,4.5,7,11)})}secondaryFixed(){return L.fromPalette({name:`secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>Go(e)?80:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.secondaryFixed(),this.secondaryFixedDim(),10,`lighter`,!0)})}secondaryFixedDim(){return L.fromPalette({name:`secondary_fixed_dim`,palette:e=>e.secondaryPalette,tone:e=>Go(e)?70:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.secondaryFixed(),this.secondaryFixedDim(),10,`lighter`,!0)})}onSecondaryFixed(){return L.fromPalette({name:`on_secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>10,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new z(4.5,7,11,21)})}onSecondaryFixedVariant(){return L.fromPalette({name:`on_secondary_fixed_variant`,palette:e=>e.secondaryPalette,tone:e=>Go(e)?25:30,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new z(3,4.5,7,11)})}tertiaryFixed(){return L.fromPalette({name:`tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>Go(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.tertiaryFixed(),this.tertiaryFixedDim(),10,`lighter`,!0)})}tertiaryFixedDim(){return L.fromPalette({name:`tertiary_fixed_dim`,palette:e=>e.tertiaryPalette,tone:e=>Go(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new z(1,1,3,4.5),toneDeltaPair:e=>new Vo(this.tertiaryFixed(),this.tertiaryFixedDim(),10,`lighter`,!0)})}onTertiaryFixed(){return L.fromPalette({name:`on_tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>Go(e)?100:10,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new z(4.5,7,11,21)})}onTertiaryFixedVariant(){return L.fromPalette({name:`on_tertiary_fixed_variant`,palette:e=>e.tertiaryPalette,tone:e=>Go(e)?90:30,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new z(3,4.5,7,11)})}highestSurface(e){return e.isDark?this.surfaceBright():this.surfaceDim()}}}));function Yo(e,t=0,n=100,r=1){return Wa(t,n,Zo(e.hue,e.chroma*r,100,!0))}function Xo(e,t=0,n=100){return Wa(t,n,Zo(e.hue,e.chroma,0,!1))}function Zo(e,t,n,r){let i=n,a=F.from(e,t,i);for(;a.chroma100);){n+=r?-1:1;let o=F.from(e,t,n);a.chroma{Co(),Ya(),Jo(),Bo(),Fo(),Ho(),Uo(),Qo=class extends qo{surface(){let e=L.fromPalette({name:`surface`,palette:e=>e.neutralPalette,tone:e=>(super.surface().tone(e),e.platform===`phone`?e.isDark?4:F.isYellow(e.neutralPalette.hue)?99:e.variant===B.VIBRANT?97:98:0),isBackground:!0});return I(super.surface(),`2025`,e)}surfaceDim(){let e=L.fromPalette({name:`surface_dim`,palette:e=>e.neutralPalette,tone:e=>e.isDark?4:F.isYellow(e.neutralPalette.hue)?90:e.variant===B.VIBRANT?85:87,isBackground:!0,chromaMultiplier:e=>{if(!e.isDark){if(e.variant===B.NEUTRAL)return 2.5;if(e.variant===B.TONAL_SPOT)return 1.7;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===B.VIBRANT)return 1.36}return 1}});return I(super.surfaceDim(),`2025`,e)}surfaceBright(){let e=L.fromPalette({name:`surface_bright`,palette:e=>e.neutralPalette,tone:e=>e.isDark?18:F.isYellow(e.neutralPalette.hue)?99:e.variant===B.VIBRANT?97:98,isBackground:!0,chromaMultiplier:e=>{if(e.isDark){if(e.variant===B.NEUTRAL)return 2.5;if(e.variant===B.TONAL_SPOT)return 1.7;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===B.VIBRANT)return 1.36}return 1}});return I(super.surfaceBright(),`2025`,e)}surfaceContainerLowest(){let e=L.fromPalette({name:`surface_container_lowest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?0:100,isBackground:!0});return I(super.surfaceContainerLowest(),`2025`,e)}surfaceContainerLow(){let e=L.fromPalette({name:`surface_container_low`,palette:e=>e.neutralPalette,tone:e=>e.platform===`phone`?e.isDark?6:F.isYellow(e.neutralPalette.hue)?98:e.variant===B.VIBRANT?95:96:15,isBackground:!0,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===B.NEUTRAL)return 1.3;if(e.variant===B.TONAL_SPOT)return 1.25;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?1.3:1.15;if(e.variant===B.VIBRANT)return 1.08}return 1}});return I(super.surfaceContainerLow(),`2025`,e)}surfaceContainer(){let e=L.fromPalette({name:`surface_container`,palette:e=>e.neutralPalette,tone:e=>e.platform===`phone`?e.isDark?9:F.isYellow(e.neutralPalette.hue)?96:e.variant===B.VIBRANT?92:94:20,isBackground:!0,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===B.NEUTRAL)return 1.6;if(e.variant===B.TONAL_SPOT)return 1.4;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?1.6:1.3;if(e.variant===B.VIBRANT)return 1.15}return 1}});return I(super.surfaceContainer(),`2025`,e)}surfaceContainerHigh(){let e=L.fromPalette({name:`surface_container_high`,palette:e=>e.neutralPalette,tone:e=>e.platform===`phone`?e.isDark?12:F.isYellow(e.neutralPalette.hue)?94:e.variant===B.VIBRANT?90:92:25,isBackground:!0,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===B.NEUTRAL)return 1.9;if(e.variant===B.TONAL_SPOT)return 1.5;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?1.95:1.45;if(e.variant===B.VIBRANT)return 1.22}return 1}});return I(super.surfaceContainerHigh(),`2025`,e)}surfaceContainerHighest(){let e=L.fromPalette({name:`surface_container_highest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?15:F.isYellow(e.neutralPalette.hue)?92:e.variant===B.VIBRANT?88:90,isBackground:!0,chromaMultiplier:e=>e.variant===B.NEUTRAL?2.2:e.variant===B.TONAL_SPOT?1.7:e.variant===B.EXPRESSIVE?F.isYellow(e.neutralPalette.hue)?2.3:1.6:e.variant===B.VIBRANT?1.29:1});return I(super.surfaceContainerHighest(),`2025`,e)}onSurface(){let e=L.fromPalette({name:`on_surface`,palette:e=>e.neutralPalette,tone:e=>e.variant===B.VIBRANT?Yo(e.neutralPalette,0,100,1.1):L.getInitialToneFromBackground(e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh())(e),chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===B.NEUTRAL)return 2.2;if(e.variant===B.TONAL_SPOT)return 1.7;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.isDark&&e.platform===`phone`?V(11):V(9)});return I(super.onSurface(),`2025`,e)}onSurfaceVariant(){let e=L.fromPalette({name:`on_surface_variant`,palette:e=>e.neutralPalette,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===B.NEUTRAL)return 2.2;if(e.variant===B.TONAL_SPOT)return 1.7;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?e.isDark?V(6):V(4.5):V(7)});return I(super.onSurfaceVariant(),`2025`,e)}outline(){let e=L.fromPalette({name:`outline`,palette:e=>e.neutralPalette,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===B.NEUTRAL)return 2.2;if(e.variant===B.TONAL_SPOT)return 1.7;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?V(3):V(4.5)});return I(super.outline(),`2025`,e)}outlineVariant(){let e=L.fromPalette({name:`outline_variant`,palette:e=>e.neutralPalette,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===B.NEUTRAL)return 2.2;if(e.variant===B.TONAL_SPOT)return 1.7;if(e.variant===B.EXPRESSIVE)return F.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?V(1.5):V(3)});return I(super.outlineVariant(),`2025`,e)}inverseSurface(){let e=L.fromPalette({name:`inverse_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?98:4,isBackground:!0});return I(super.inverseSurface(),`2025`,e)}inverseOnSurface(){let e=L.fromPalette({name:`inverse_on_surface`,palette:e=>e.neutralPalette,background:e=>this.inverseSurface(),contrastCurve:e=>V(7)});return I(super.inverseOnSurface(),`2025`,e)}primary(){let e=L.fromPalette({name:`primary`,palette:e=>e.primaryPalette,tone:e=>e.variant===B.NEUTRAL?e.platform===`phone`?e.isDark?80:40:90:e.variant===B.TONAL_SPOT?e.platform===`phone`?e.isDark?80:Yo(e.primaryPalette):Yo(e.primaryPalette,0,90):e.variant===B.EXPRESSIVE?e.platform===`phone`?Yo(e.primaryPalette,0,F.isYellow(e.primaryPalette.hue)?25:F.isCyan(e.primaryPalette.hue)?88:98):Yo(e.primaryPalette):e.platform===`phone`?Yo(e.primaryPalette,0,F.isCyan(e.primaryPalette.hue)?88:98):Yo(e.primaryPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?V(4.5):V(7),toneDeltaPair:e=>e.platform===`phone`?new Vo(this.primaryContainer(),this.primary(),5,`relative_lighter`,!0,`farther`):void 0});return I(super.primary(),`2025`,e)}primaryDim(){return L.fromPalette({name:`primary_dim`,palette:e=>e.primaryPalette,tone:e=>e.variant===B.NEUTRAL?85:e.variant===B.TONAL_SPOT?Yo(e.primaryPalette,0,90):Yo(e.primaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>V(4.5),toneDeltaPair:e=>new Vo(this.primaryDim(),this.primary(),5,`darker`,!0,`farther`)})}onPrimary(){let e=L.fromPalette({name:`on_primary`,palette:e=>e.primaryPalette,background:e=>e.platform===`phone`?this.primary():this.primaryDim(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.onPrimary(),`2025`,e)}primaryContainer(){let e=L.fromPalette({name:`primary_container`,palette:e=>e.primaryPalette,tone:e=>e.platform===`watch`?30:e.variant===B.NEUTRAL?e.isDark?30:90:e.variant===B.TONAL_SPOT?e.isDark?Xo(e.primaryPalette,35,93):Yo(e.primaryPalette,0,90):e.variant===B.EXPRESSIVE?e.isDark?Yo(e.primaryPalette,30,93):Yo(e.primaryPalette,78,F.isCyan(e.primaryPalette.hue)?88:90):e.isDark?Xo(e.primaryPalette,66,93):Yo(e.primaryPalette,66,F.isCyan(e.primaryPalette.hue)?88:93),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`phone`?void 0:new Vo(this.primaryContainer(),this.primaryDim(),10,`darker`,!0,`farther`),contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?V(1.5):void 0});return I(super.primaryContainer(),`2025`,e)}onPrimaryContainer(){let e=L.fromPalette({name:`on_primary_container`,palette:e=>e.primaryPalette,background:e=>this.primaryContainer(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.onPrimaryContainer(),`2025`,e)}primaryFixed(){let e=L.fromPalette({name:`primary_fixed`,palette:e=>e.primaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(t)},isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?V(1.5):void 0});return I(super.primaryFixed(),`2025`,e)}primaryFixedDim(){let e=L.fromPalette({name:`primary_fixed_dim`,palette:e=>e.primaryPalette,tone:e=>this.primaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new Vo(this.primaryFixedDim(),this.primaryFixed(),5,`darker`,!0,`exact`)});return I(super.primaryFixedDim(),`2025`,e)}onPrimaryFixed(){let e=L.fromPalette({name:`on_primary_fixed`,palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>V(7)});return I(super.onPrimaryFixed(),`2025`,e)}onPrimaryFixedVariant(){let e=L.fromPalette({name:`on_primary_fixed_variant`,palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>V(4.5)});return I(super.onPrimaryFixedVariant(),`2025`,e)}inversePrimary(){let e=L.fromPalette({name:`inverse_primary`,palette:e=>e.primaryPalette,tone:e=>Yo(e.primaryPalette),background:e=>this.inverseSurface(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.inversePrimary(),`2025`,e)}secondary(){let e=L.fromPalette({name:`secondary`,palette:e=>e.secondaryPalette,tone:e=>e.platform===`watch`?e.variant===B.NEUTRAL?90:Yo(e.secondaryPalette,0,90):e.variant===B.NEUTRAL?e.isDark?Xo(e.secondaryPalette,0,98):Yo(e.secondaryPalette):e.variant===B.VIBRANT?Yo(e.secondaryPalette,0,e.isDark?90:98):e.isDark?80:Yo(e.secondaryPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?V(4.5):V(7),toneDeltaPair:e=>e.platform===`phone`?new Vo(this.secondaryContainer(),this.secondary(),5,`relative_lighter`,!0,`farther`):void 0});return I(super.secondary(),`2025`,e)}secondaryDim(){return L.fromPalette({name:`secondary_dim`,palette:e=>e.secondaryPalette,tone:e=>e.variant===B.NEUTRAL?85:Yo(e.secondaryPalette,0,90),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>V(4.5),toneDeltaPair:e=>new Vo(this.secondaryDim(),this.secondary(),5,`darker`,!0,`farther`)})}onSecondary(){let e=L.fromPalette({name:`on_secondary`,palette:e=>e.secondaryPalette,background:e=>e.platform===`phone`?this.secondary():this.secondaryDim(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.onSecondary(),`2025`,e)}secondaryContainer(){let e=L.fromPalette({name:`secondary_container`,palette:e=>e.secondaryPalette,tone:e=>e.platform===`watch`?30:e.variant===B.VIBRANT?e.isDark?Xo(e.secondaryPalette,30,40):Yo(e.secondaryPalette,84,90):e.variant===B.EXPRESSIVE?e.isDark?15:Yo(e.secondaryPalette,90,95):e.isDark?25:90,isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`watch`?new Vo(this.secondaryContainer(),this.secondaryDim(),10,`darker`,!0,`farther`):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?V(1.5):void 0});return I(super.secondaryContainer(),`2025`,e)}onSecondaryContainer(){let e=L.fromPalette({name:`on_secondary_container`,palette:e=>e.secondaryPalette,background:e=>this.secondaryContainer(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.onSecondaryContainer(),`2025`,e)}secondaryFixed(){let e=L.fromPalette({name:`secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(t)},isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?V(1.5):void 0});return I(super.secondaryFixed(),`2025`,e)}secondaryFixedDim(){let e=L.fromPalette({name:`secondary_fixed_dim`,palette:e=>e.secondaryPalette,tone:e=>this.secondaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new Vo(this.secondaryFixedDim(),this.secondaryFixed(),5,`darker`,!0,`exact`)});return I(super.secondaryFixedDim(),`2025`,e)}onSecondaryFixed(){let e=L.fromPalette({name:`on_secondary_fixed`,palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>V(7)});return I(super.onSecondaryFixed(),`2025`,e)}onSecondaryFixedVariant(){let e=L.fromPalette({name:`on_secondary_fixed_variant`,palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>V(4.5)});return I(super.onSecondaryFixedVariant(),`2025`,e)}tertiary(){let e=L.fromPalette({name:`tertiary`,palette:e=>e.tertiaryPalette,tone:e=>e.platform===`watch`?e.variant===B.TONAL_SPOT?Yo(e.tertiaryPalette,0,90):Yo(e.tertiaryPalette):e.variant===B.EXPRESSIVE||e.variant===B.VIBRANT?Yo(e.tertiaryPalette,0,F.isCyan(e.tertiaryPalette.hue)?88:e.isDark?98:100):e.isDark?Yo(e.tertiaryPalette,0,98):Yo(e.tertiaryPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?V(4.5):V(7),toneDeltaPair:e=>e.platform===`phone`?new Vo(this.tertiaryContainer(),this.tertiary(),5,`relative_lighter`,!0,`farther`):void 0});return I(super.tertiary(),`2025`,e)}tertiaryDim(){return L.fromPalette({name:`tertiary_dim`,palette:e=>e.tertiaryPalette,tone:e=>e.variant===B.TONAL_SPOT?Yo(e.tertiaryPalette,0,90):Yo(e.tertiaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>V(4.5),toneDeltaPair:e=>new Vo(this.tertiaryDim(),this.tertiary(),5,`darker`,!0,`farther`)})}onTertiary(){let e=L.fromPalette({name:`on_tertiary`,palette:e=>e.tertiaryPalette,background:e=>e.platform===`phone`?this.tertiary():this.tertiaryDim(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.onTertiary(),`2025`,e)}tertiaryContainer(){let e=L.fromPalette({name:`tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>e.platform===`watch`?e.variant===B.TONAL_SPOT?Yo(e.tertiaryPalette,0,90):Yo(e.tertiaryPalette):e.variant===B.NEUTRAL?e.isDark?Yo(e.tertiaryPalette,0,93):Yo(e.tertiaryPalette,0,96):e.variant===B.TONAL_SPOT?Yo(e.tertiaryPalette,0,e.isDark?93:100):e.variant===B.EXPRESSIVE?Yo(e.tertiaryPalette,75,F.isCyan(e.tertiaryPalette.hue)?88:e.isDark?93:100):e.isDark?Yo(e.tertiaryPalette,0,93):Yo(e.tertiaryPalette,72,100),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`watch`?new Vo(this.tertiaryContainer(),this.tertiaryDim(),10,`darker`,!0,`farther`):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?V(1.5):void 0});return I(super.tertiaryContainer(),`2025`,e)}onTertiaryContainer(){let e=L.fromPalette({name:`on_tertiary_container`,palette:e=>e.tertiaryPalette,background:e=>this.tertiaryContainer(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.onTertiaryContainer(),`2025`,e)}tertiaryFixed(){let e=L.fromPalette({name:`tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(t)},isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?V(1.5):void 0});return I(super.tertiaryFixed(),`2025`,e)}tertiaryFixedDim(){let e=L.fromPalette({name:`tertiary_fixed_dim`,palette:e=>e.tertiaryPalette,tone:e=>this.tertiaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new Vo(this.tertiaryFixedDim(),this.tertiaryFixed(),5,`darker`,!0,`exact`)});return I(super.tertiaryFixedDim(),`2025`,e)}onTertiaryFixed(){let e=L.fromPalette({name:`on_tertiary_fixed`,palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>V(7)});return I(super.onTertiaryFixed(),`2025`,e)}onTertiaryFixedVariant(){let e=L.fromPalette({name:`on_tertiary_fixed_variant`,palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>V(4.5)});return I(super.onTertiaryFixedVariant(),`2025`,e)}error(){let e=L.fromPalette({name:`error`,palette:e=>e.errorPalette,tone:e=>e.platform===`phone`?e.isDark?Xo(e.errorPalette,0,98):Yo(e.errorPalette):Xo(e.errorPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?V(4.5):V(7),toneDeltaPair:e=>e.platform===`phone`?new Vo(this.errorContainer(),this.error(),5,`relative_lighter`,!0,`farther`):void 0});return I(super.error(),`2025`,e)}errorDim(){return L.fromPalette({name:`error_dim`,palette:e=>e.errorPalette,tone:e=>Xo(e.errorPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>V(4.5),toneDeltaPair:e=>new Vo(this.errorDim(),this.error(),5,`darker`,!0,`farther`)})}onError(){let e=L.fromPalette({name:`on_error`,palette:e=>e.errorPalette,background:e=>e.platform===`phone`?this.error():this.errorDim(),contrastCurve:e=>e.platform===`phone`?V(6):V(7)});return I(super.onError(),`2025`,e)}errorContainer(){let e=L.fromPalette({name:`error_container`,palette:e=>e.errorPalette,tone:e=>e.platform===`watch`?30:e.isDark?Xo(e.errorPalette,30,93):Yo(e.errorPalette,0,90),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`watch`?new Vo(this.errorContainer(),this.errorDim(),10,`darker`,!0,`farther`):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?V(1.5):void 0});return I(super.errorContainer(),`2025`,e)}onErrorContainer(){let e=L.fromPalette({name:`on_error_container`,palette:e=>e.errorPalette,background:e=>this.errorContainer(),contrastCurve:e=>e.platform===`phone`?V(4.5):V(7)});return I(super.onErrorContainer(),`2025`,e)}surfaceVariant(){let e=Object.assign(this.surfaceContainerHighest().clone(),{name:`surface_variant`});return I(super.surfaceVariant(),`2025`,e)}surfaceTint(){let e=Object.assign(this.primary().clone(),{name:`surface_tint`});return I(super.surfaceTint(),`2025`,e)}background(){let e=Object.assign(this.surface().clone(),{name:`background`});return I(super.background(),`2025`,e)}onBackground(){let e=Object.assign(this.onSurface().clone(),{name:`on_background`,tone:e=>e.platform===`watch`?100:this.onSurface().getTone(e)});return I(super.onBackground(),`2025`,e)}}})),H,es=o((()=>{$o(),H=class e{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(e=>e!==void 0)}highestSurface(t){return e.colorSpec.highestSurface(t)}primaryPaletteKeyColor(){return e.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return e.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return e.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return e.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return e.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return e.colorSpec.errorPaletteKeyColor()}background(){return e.colorSpec.background()}onBackground(){return e.colorSpec.onBackground()}surface(){return e.colorSpec.surface()}surfaceDim(){return e.colorSpec.surfaceDim()}surfaceBright(){return e.colorSpec.surfaceBright()}surfaceContainerLowest(){return e.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return e.colorSpec.surfaceContainerLow()}surfaceContainer(){return e.colorSpec.surfaceContainer()}surfaceContainerHigh(){return e.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return e.colorSpec.surfaceContainerHighest()}onSurface(){return e.colorSpec.onSurface()}surfaceVariant(){return e.colorSpec.surfaceVariant()}onSurfaceVariant(){return e.colorSpec.onSurfaceVariant()}outline(){return e.colorSpec.outline()}outlineVariant(){return e.colorSpec.outlineVariant()}inverseSurface(){return e.colorSpec.inverseSurface()}inverseOnSurface(){return e.colorSpec.inverseOnSurface()}shadow(){return e.colorSpec.shadow()}scrim(){return e.colorSpec.scrim()}surfaceTint(){return e.colorSpec.surfaceTint()}primary(){return e.colorSpec.primary()}primaryDim(){return e.colorSpec.primaryDim()}onPrimary(){return e.colorSpec.onPrimary()}primaryContainer(){return e.colorSpec.primaryContainer()}onPrimaryContainer(){return e.colorSpec.onPrimaryContainer()}inversePrimary(){return e.colorSpec.inversePrimary()}primaryFixed(){return e.colorSpec.primaryFixed()}primaryFixedDim(){return e.colorSpec.primaryFixedDim()}onPrimaryFixed(){return e.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return e.colorSpec.onPrimaryFixedVariant()}secondary(){return e.colorSpec.secondary()}secondaryDim(){return e.colorSpec.secondaryDim()}onSecondary(){return e.colorSpec.onSecondary()}secondaryContainer(){return e.colorSpec.secondaryContainer()}onSecondaryContainer(){return e.colorSpec.onSecondaryContainer()}secondaryFixed(){return e.colorSpec.secondaryFixed()}secondaryFixedDim(){return e.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return e.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return e.colorSpec.onSecondaryFixedVariant()}tertiary(){return e.colorSpec.tertiary()}tertiaryDim(){return e.colorSpec.tertiaryDim()}onTertiary(){return e.colorSpec.onTertiary()}tertiaryContainer(){return e.colorSpec.tertiaryContainer()}onTertiaryContainer(){return e.colorSpec.onTertiaryContainer()}tertiaryFixed(){return e.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return e.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return e.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return e.colorSpec.onTertiaryFixedVariant()}error(){return e.colorSpec.error()}errorDim(){return e.colorSpec.errorDim()}onError(){return e.colorSpec.onError()}errorContainer(){return e.colorSpec.errorContainer()}onErrorContainer(){return e.colorSpec.onErrorContainer()}static highestSurface(t){return e.colorSpec.highestSurface(t)}},H.contentAccentToneDelta=15,H.colorSpec=new Qo,H.primaryPaletteKeyColor=H.colorSpec.primaryPaletteKeyColor(),H.secondaryPaletteKeyColor=H.colorSpec.secondaryPaletteKeyColor(),H.tertiaryPaletteKeyColor=H.colorSpec.tertiaryPaletteKeyColor(),H.neutralPaletteKeyColor=H.colorSpec.neutralPaletteKeyColor(),H.neutralVariantPaletteKeyColor=H.colorSpec.neutralVariantPaletteKeyColor(),H.background=H.colorSpec.background(),H.onBackground=H.colorSpec.onBackground(),H.surface=H.colorSpec.surface(),H.surfaceDim=H.colorSpec.surfaceDim(),H.surfaceBright=H.colorSpec.surfaceBright(),H.surfaceContainerLowest=H.colorSpec.surfaceContainerLowest(),H.surfaceContainerLow=H.colorSpec.surfaceContainerLow(),H.surfaceContainer=H.colorSpec.surfaceContainer(),H.surfaceContainerHigh=H.colorSpec.surfaceContainerHigh(),H.surfaceContainerHighest=H.colorSpec.surfaceContainerHighest(),H.onSurface=H.colorSpec.onSurface(),H.surfaceVariant=H.colorSpec.surfaceVariant(),H.onSurfaceVariant=H.colorSpec.onSurfaceVariant(),H.inverseSurface=H.colorSpec.inverseSurface(),H.inverseOnSurface=H.colorSpec.inverseOnSurface(),H.outline=H.colorSpec.outline(),H.outlineVariant=H.colorSpec.outlineVariant(),H.shadow=H.colorSpec.shadow(),H.scrim=H.colorSpec.scrim(),H.surfaceTint=H.colorSpec.surfaceTint(),H.primary=H.colorSpec.primary(),H.onPrimary=H.colorSpec.onPrimary(),H.primaryContainer=H.colorSpec.primaryContainer(),H.onPrimaryContainer=H.colorSpec.onPrimaryContainer(),H.inversePrimary=H.colorSpec.inversePrimary(),H.secondary=H.colorSpec.secondary(),H.onSecondary=H.colorSpec.onSecondary(),H.secondaryContainer=H.colorSpec.secondaryContainer(),H.onSecondaryContainer=H.colorSpec.onSecondaryContainer(),H.tertiary=H.colorSpec.tertiary(),H.onTertiary=H.colorSpec.onTertiary(),H.tertiaryContainer=H.colorSpec.tertiaryContainer(),H.onTertiaryContainer=H.colorSpec.onTertiaryContainer(),H.error=H.colorSpec.error(),H.onError=H.colorSpec.onError(),H.errorContainer=H.colorSpec.errorContainer(),H.onErrorContainer=H.colorSpec.onErrorContainer(),H.primaryFixed=H.colorSpec.primaryFixed(),H.primaryFixedDim=H.colorSpec.primaryFixedDim(),H.onPrimaryFixed=H.colorSpec.onPrimaryFixed(),H.onPrimaryFixedVariant=H.colorSpec.onPrimaryFixedVariant(),H.secondaryFixed=H.colorSpec.secondaryFixed(),H.secondaryFixedDim=H.colorSpec.secondaryFixedDim(),H.onSecondaryFixed=H.colorSpec.onSecondaryFixed(),H.onSecondaryFixedVariant=H.colorSpec.onSecondaryFixedVariant(),H.tertiaryFixed=H.colorSpec.tertiaryFixed(),H.tertiaryFixedDim=H.colorSpec.tertiaryFixedDim(),H.onTertiaryFixed=H.colorSpec.onTertiaryFixed(),H.onTertiaryFixedVariant=H.colorSpec.onTertiaryFixedVariant()}));function ts(e){return e===`2025`?os:as}var ns,rs,is,as,os,ss=o((()=>{Oo(),Co(),Lo(),zo(),Ya(),es(),Uo(),ns=class e{static maybeFallbackSpecVersion(e,t){switch(t){case B.EXPRESSIVE:case B.VIBRANT:case B.TONAL_SPOT:case B.NEUTRAL:return e;default:return`2021`}}constructor(t){this.sourceColorArgb=t.sourceColorHct.toInt(),this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.platform=t.platform??`phone`,this.specVersion=e.maybeFallbackSpecVersion(t.specVersion??`2021`,this.variant),this.sourceColorHct=t.sourceColorHct,this.primaryPalette=t.primaryPalette??ts(this.specVersion).getPrimaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.secondaryPalette=t.secondaryPalette??ts(this.specVersion).getSecondaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.tertiaryPalette=t.tertiaryPalette??ts(this.specVersion).getTertiaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralPalette=t.neutralPalette??ts(this.specVersion).getNeutralPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralVariantPalette=t.neutralVariantPalette??ts(this.specVersion).getNeutralVariantPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.errorPalette=t.errorPalette??ts(this.specVersion).getErrorPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel)??R.fromHueAndChroma(25,84),this.colors=new H}toString(){return`Scheme: variant=${B[this.variant]}, mode=${this.isDark?`dark`:`light`}, platform=${this.platform}, contrastLevel=${this.contrastLevel.toFixed(1)}, seed=${this.sourceColorHct.toString()}, specVersion=${this.specVersion}`}static getPiecewiseHue(e,t,n){let r=Math.min(t.length-1,n.length),i=e.hue;for(let e=0;e=t[e]&&i=105&&o<125?1.6:2.3));case B.VIBRANT:let c=e.getVibrantNeutralHue(n),l=e.getVibrantNeutralChroma(n,i);return R.fromHueAndChroma(c,l*1.29);default:return super.getNeutralVariantPalette(t,n,r,i,a)}}getErrorPalette(e,t,n,r,i){let a=ns.getPiecewiseHue(t,[0,3,13,23,33,43,153,273,360],[12,22,32,12,22,32,22,12]);switch(e){case B.NEUTRAL:return R.fromHueAndChroma(a,r===`phone`?50:40);case B.TONAL_SPOT:return R.fromHueAndChroma(a,r===`phone`?60:48);case B.EXPRESSIVE:return R.fromHueAndChroma(a,r===`phone`?64:48);case B.VIBRANT:return R.fromHueAndChroma(a,r===`phone`?80:60);default:return super.getErrorPalette(e,t,n,r,i)}}},as=new rs,os=new is})),cs=o((()=>{Co(),Lo()})),ls=o((()=>{})),us=o((()=>{})),ds=o((()=>{})),fs=o((()=>{})),ps=o((()=>{cs()})),ms=o((()=>{cs()})),hs=o((()=>{ss(),Uo()})),gs=o((()=>{ss(),Uo()})),_s=o((()=>{ss(),Uo()})),vs=o((()=>{ss(),Uo()})),ys=o((()=>{ss(),Uo()})),bs=o((()=>{ss(),Uo()})),xs=o((()=>{ss(),Uo()})),Ss=o((()=>{ss(),Uo()})),Cs=o((()=>{ss(),Uo()}));function ws(e,t){return e.score>t.score?-1:+(e.score{Co(),Ya(),Ts={desired:4,fallbackColorARGB:4282549748,filter:!0},Es=class e{constructor(){}static score(t,n){let{desired:r,fallbackColorARGB:i,filter:a}={...Ts,...n},o=[],s=Array(360).fill(0),c=0;for(let[e,n]of t.entries()){let t=F.fromInt(e);o.push(t);let r=Math.floor(t.hue);s[r]+=n,c+=n}let l=Array(360).fill(0);for(let e=0;e<360;e++){let t=s[e]/c;for(let n=e-14;n=15;e--){d.length=0;for(let{hct:t}of u)if(d.find(n=>qa(t.hue,n.hue)=r)break;if(d.length>=r)break}let f=[];d.length===0&&f.push(i);for(let e of d)f.push(e.toInt());return f}},Es.TARGET_CHROMA=48,Es.WEIGHT_PROPORTION=.7,Es.WEIGHT_CHROMA_ABOVE=.3,Es.WEIGHT_CHROMA_BELOW=.1,Es.CUTOFF_CHROMA=5,Es.CUTOFF_EXCITED_PROPORTION=.01}));function Os(e){let t=Qa(e),n=$a(e),r=eo(e),i=[t.toString(16),n.toString(16),r.toString(16)];for(let[e,t]of i.entries())t.length===1&&(i[e]=`0`+t);return`#`+i.join(``)}function ks(e){e=e.replace(`#`,``);let t=e.length===3,n=e.length===6,r=e.length===8;if(!t&&!n&&!r)throw Error(`unexpected hex `+e);let i=0,a=0,o=0;return t?(i=As(e.slice(0,1).repeat(2)),a=As(e.slice(1,2).repeat(2)),o=As(e.slice(2,3).repeat(2))):n?(i=As(e.slice(0,2)),a=As(e.slice(2,4)),o=As(e.slice(4,6))):r&&(i=As(e.slice(2,4)),a=As(e.slice(4,6)),o=As(e.slice(6,8))),(255<<24|(i&255)<<16|(a&255)<<8|o&255)>>>0}function As(e){return parseInt(e,16)}var js=o((()=>{_o()})),Ms=o((()=>{Ds()})),Ns=o((()=>{wo(),cs(),ps(),Ms()})),Ps=o((()=>{wo(),Eo(),Oo(),Fo(),ss(),es(),Uo(),bo(),Co(),yo(),cs(),Lo(),fs(),us(),ls(),ds(),ps(),ms(),hs(),gs(),_s(),vs(),ys(),bs(),xs(),Ss(),Cs(),Ds(),zo(),_o(),Ya(),js(),Ms(),Ns()}));function Fs(e){let t=e.hue;return new ns({sourceColorHct:e,variant:B.EXPRESSIVE,contrastLevel:0,isDark:!0,specVersion:`2021`,primaryPalette:R.fromHueAndChroma(t,Vs.primary),secondaryPalette:R.fromHueAndChroma(t,Vs.secondary),tertiaryPalette:R.fromHueAndChroma((t+Us)%360,Vs.tertiary),neutralPalette:R.fromHueAndChroma((t+Hs)%360,Vs.neutral),neutralVariantPalette:R.fromHueAndChroma((t+Hs)%360,Vs.neutralVariant)})}function Is(e,t){let[n,r]=[Ks(e),Ks(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Ls(e){let t=[];for(let[n,r]of qs){let i=Is(e[n],e[r]);i<4.5&&t.push(`${r} on ${n} is ${i.toFixed(2)}`)}for(let n of[`bg`,`surfaceLow`,`surface`]){let r=Is(e[n],e.base);r<4.5&&t.push(`accent text on ${n} is ${r.toFixed(2)}`)}for(let n of[`bg`,`surfaceLowest`])e[n]===`#000000`&&t.push(`${n} is pure black`);return t}function Rs(e,t){let n=Fs(e),r=e=>Os(e.getArgb(n)),i=e=>Os(n.primaryPalette.tone(e));return{base:i(t),onBase:r(H.onPrimary),hover:i(Math.min(t+6,100)),active:i(Math.max(t-6,0)),bg:r(H.surface),surfaceLowest:r(H.surfaceContainerLowest),surfaceLow:r(H.surfaceContainerLow),surface:r(H.surfaceContainer),surfaceHigh:r(H.surfaceContainerHigh),surfaceHighest:r(H.surfaceContainerHighest),onSurface:r(H.onSurface),onSurfaceVariant:r(H.onSurfaceVariant),primaryContainer:r(H.primaryContainer),onPrimaryContainer:r(H.onPrimaryContainer),secondaryContainer:r(H.secondaryContainer),onSecondaryContainer:r(H.onSecondaryContainer),tertiaryContainer:r(H.tertiaryContainer),onTertiaryContainer:r(H.onTertiaryContainer),outline:r(H.outline),outlineVariant:r(H.outlineVariant),error:r(H.error),onError:r(H.onError),errorContainer:r(H.errorContainer),onErrorContainer:r(H.onErrorContainer),ambient:i(22)}}function zs(e,t){let n=F.fromInt(ks(e)),r=t??Ws,i=Rs(n,r),a=Ls(i);for(let e=r+2;a.length&&e<=92;e+=2){let t=Rs(n,e),r=Ls(t);r.lengthe+e):t;return/^[0-9a-fA-F]{6}$/.test(n)?`#${n.toLowerCase()}`:null}var Vs,Hs,Us,Ws,Gs,Ks,qs,Js=o((()=>{Ps(),Vs={primary:40,secondary:24,tertiary:32,neutral:8,neutralVariant:12},Hs=15,Us=60,Ws=80,Gs=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,Ks=e=>{let[t,n,r]=[0,2,4].map(t=>parseInt(e.slice(1+t,3+t),16)/255),[i,a,o]=[t,n,r].map(Gs);return .2126*i+.7152*a+.0722*o},qs=[[`base`,`onBase`],[`primaryContainer`,`onPrimaryContainer`],[`secondaryContainer`,`onSecondaryContainer`],[`tertiaryContainer`,`onTertiaryContainer`],[`errorContainer`,`onErrorContainer`],[`bg`,`onSurface`],[`surfaceLow`,`onSurface`],[`surface`,`onSurface`],[`surfaceHigh`,`onSurface`],[`surfaceLowest`,`onSurface`],[`bg`,`onSurfaceVariant`],[`surfaceLow`,`onSurfaceVariant`],[`surface`,`onSurfaceVariant`]]}));function Ys(e,t){return ln({name:`vice-${e}`,extends:tc,tokens:{"--color-accent":[t.base,t.base],"--color-text-accent":[t.base,t.base],"--color-icon-accent":[t.base,t.base],"--color-on-accent":[t.onBase,t.onBase],"--color-background-body":[t.bg,t.bg],"--color-background-surface":[t.surfaceLow,t.surfaceLow],"--color-background-popover":[t.surfaceHigh,t.surfaceHigh],"--color-text-primary":[t.onSurface,t.onSurface],"--color-text-secondary":[t.onSurfaceVariant,t.onSurfaceVariant],"--color-text-disabled":[`color-mix(in srgb, ${t.onSurface} 38%, transparent)`,`color-mix(in srgb, ${t.onSurface} 38%, transparent)`],"--color-border":[t.outlineVariant,t.outlineVariant],"--color-error":[t.error,t.error],"--color-on-error":[t.onError,t.onError],"--color-accent-muted":[t.secondaryContainer,t.secondaryContainer],"--shadow-inset-hover":`inset 0px 0px 0px 2px ${t.base}4D`,"--shadow-inset-selected":`inset 0px 0px 0px 2px ${t.base}80`},components:{statusdot:{"variant:accent":{backgroundColor:t.base}},progressbar:{"variant:accent":{"--color-accent":t.base}},button:{"variant:primary":{backgroundColor:t.base,color:t.onBase}},link:{base:{color:t.base}}}})}function Xs(e){return{"--vice-accent-hover":e.hover,"--vice-accent-active":e.active,"--vice-ambient":e.ambient,"--vice-bg":e.bg,"--vice-surface-lowest":e.surfaceLowest,"--vice-surface-low":e.surfaceLow,"--vice-surface":e.surface,"--vice-surface-high":e.surfaceHigh,"--vice-surface-highest":e.surfaceHighest,"--vice-secondary-container":e.secondaryContainer,"--vice-on-secondary-container":e.onSecondaryContainer,"--vice-primary-container":e.primaryContainer,"--vice-on-primary-container":e.onPrimaryContainer,"--vice-tertiary-container":e.tertiaryContainer,"--vice-on-tertiary-container":e.onTertiaryContainer,"--vice-outline":e.outline,"--vice-outline-variant":e.outlineVariant,"--vice-error-container":e.errorContainer,"--vice-on-error-container":e.onErrorContainer,"--vice-ease-spring":ec}}function Zs(e){if(rc?.seed===e)return{ramp:rc.ramp,theme:rc.theme,failures:[]};let{ramp:t,failures:n}=zs(e),r=Ys(`custom`,t);return rc={seed:e,ramp:t,theme:r},{ramp:t,theme:r,failures:n}}function Qs(e,t){if(e===`custom`&&t){let{ramp:e,theme:n}=Zs(t);return{ramp:e,theme:n}}let n=e===`custom`?`blue`:e;return{ramp:La[n],theme:nc[n]}}var $s,ec,tc,nc,rc,ic=o((()=>{jn(),Ia(),Ba(),Js(),$s={"--radius-inner":`0.75rem`,"--radius-element":`1.25rem`,"--radius-container":`1.75rem`,"--radius-page":`2.25rem`},ec=`cubic-bezier(.34, 1.56, .64, 1)`,tc=ln({name:`vice-base`,extends:Fa,motion:{fast:140,medium:320,slow:700,ratio:.75,easing:ec},tokens:{...$s}}),nc={blue:Ys(`blue`,La.blue),purple:Ys(`purple`,La.purple),green:Ys(`green`,La.green),red:Ys(`red`,La.red),orange:Ys(`orange`,La.orange)},rc=null}));async function ac(e,t){let n=await fetch(e,{...t,headers:t?.body?{"Content-Type":`application/json`,...t?.headers}:t?.headers});if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();t.error&&(e=t.error)}catch{}throw Error(e)}if(n.status!==204)return await n.json()}var oc,sc,U,cc=o((()=>{oc=(e,t)=>ac(e,{method:`POST`,body:t===void 0?void 0:JSON.stringify(t)}),sc=e=>encodeURIComponent(e),U={status:()=>ac(`/api/status`),getConfig:()=>ac(`/api/config`),saveConfig:e=>oc(`/api/config`,e),getAppState:()=>ac(`/api/app-state`),setAppState:e=>oc(`/api/app-state`,e),clips:async()=>(await ac(`/api/clips`)).clips,deleteClip:e=>ac(`/api/clips/${sc(e)}`,{method:`DELETE`}),renameClip:(e,t)=>oc(`/api/clips/${sc(e)}/rename`,{name:t}),revealClip:e=>oc(`/api/clips/${sc(e)}/reveal`),openClip:e=>oc(`/api/clips/${sc(e)}/open`),copyClipFile:e=>oc(`/api/clips/${sc(e)}/copy-file`),trimClip:(e,t,n)=>oc(`/api/clips/${sc(e)}/trim`,{start:t,end:n}),markViewed:e=>oc(`/api/clips/${sc(e)}/view`),saveFrame:(e,t)=>oc(`/api/clips/${sc(e)}/frame`,{time:t}),images:async()=>(await ac(`/api/images`)).images,deleteImage:e=>ac(`/api/images/${sc(e)}`,{method:`DELETE`}),renameImage:(e,t)=>oc(`/api/images/${sc(e)}/rename`,{name:t}),revealImage:e=>oc(`/api/images/${sc(e)}/reveal`),openImage:e=>oc(`/api/images/${sc(e)}/open`),copyImage:e=>oc(`/api/images/${sc(e)}/copy`),annotateImage:(e,t)=>ac(`/api/images/${sc(e)}/annotate`,{method:`POST`,headers:{"Content-Type":`image/png`},body:t}),highlights:async e=>(await ac(`/api/clips/${sc(e)}/highlights`)).highlights??[],addHighlight:(e,t)=>oc(`/api/clips/${sc(e)}/highlights`,t),updateHighlight:(e,t,n)=>ac(`/api/clips/${sc(e)}/highlights/${sc(t)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}),deleteHighlight:(e,t)=>ac(`/api/clips/${sc(e)}/highlights/${sc(t)}`,{method:`DELETE`}),triggerClip:()=>oc(`/api/trigger`),playlists:async()=>(await ac(`/api/playlists`)).playlists,createPlaylist:e=>oc(`/api/playlists`,e),updatePlaylist:(e,t)=>ac(`/api/playlists/${sc(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),deletePlaylist:e=>ac(`/api/playlists/${sc(e)}`,{method:`DELETE`}),addClipToPlaylist:(e,t)=>oc(`/api/playlists/${sc(e)}/clips`,{slug:t}),removeClipFromPlaylist:(e,t)=>ac(`/api/playlists/${sc(e)}/clips/${sc(t)}`,{method:`DELETE`}),displays:e=>ac(`/api/displays${e?`?backend=${encodeURIComponent(e)}`:``}`),audioSources:()=>ac(`/api/audio-sources`),editorProject:()=>ac(`/api/editor/project`),saveEditorProject:e=>oc(`/api/editor/project`,e),startExport:e=>oc(`/api/editor/export`,e),cancelExport:e=>oc(`/api/editor/export/${sc(e)}/cancel`),checkUpdate:()=>oc(`/api/update/check`)}}));function lc(e){return dc.add(e),()=>dc.delete(e)}function uc(e){let t=null,n,r=!1,i=()=>{if(!r)try{t=new WebSocket(`ws://${location.host}/ws`),t.onmessage=t=>{try{let n=JSON.parse(t.data);e(n),dc.forEach(e=>e(n))}catch(e){console.warn(`Ignored an unreadable WebSocket frame`,e)}},t.onclose=()=>{r||(n=window.setTimeout(i,3e3))},t.onerror=()=>{}}catch(e){console.warn(`WebSocket could not be opened, retrying`,e),r||(n=window.setTimeout(i,3e3))}};return i(),()=>{r=!0,window.clearTimeout(n),t?.close()}}var dc,fc=o((()=>{dc=new Set}));function pc(e,t=!1){if(!Number.isFinite(e)||e<0)return t?`0s`:`0:00`;let n=Math.floor(e);if(t&&e<60)return`${e.toFixed(e%1?1:0)}s`;let r=Math.floor(n/60),i=n%60;return r>=60?`${Math.floor(r/60)}:${String(r%60).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`}function mc(e){if(!Number.isFinite(e)||e<0)return`0 s`;if(e<60)return`${Math.round(e)} s`;let t=Math.floor(e/60),n=Math.round(e%60);return n===0?`${t} min`:`${t}:${String(n).padStart(2,`0`)} min`}function hc(e){if(!Number.isFinite(e)||e<=0)return`0 MB`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r>=10||n===0?Math.round(r):r.toFixed(1)} ${t[n]}`}function gc(e){return e?e.replace(/^KEY_/,``).toLowerCase().replace(/^left/,`left `).replace(/^right/,`right `).replace(/\b\w/g,e=>e.toUpperCase()):`the clip key`}function _c(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=(Date.now()-t)/1e3;return n<60?`just now`:n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:new Date(t).toLocaleDateString()}var vc=o((()=>{}));function yc(e){console.debug(`[vice]`,e);try{let t=window.pywebview;Cc&&t?.api?.log_debug&&t.api.log_debug(String(e))}catch(e){console.debug(`The native log bridge threw`,e)}}function bc(e){if(e){try{let t=window.pywebview;if(Cc&&t?.api?.open_url){t.api.open_url(String(e));return}}catch(e){console.debug(`The native open_url bridge threw`,e)}window.open(e,`_blank`,`noopener`)}}function xc(){Cc&&window.pywebview.api.keep_running()}function Sc(){Cc?window.pywebview.api.quit_app():fetch(`/api/quit`,{method:`POST`}).catch(()=>{})}var Cc,wc,Tc,Ec,Dc=o((()=>{Cc=(()=>{try{if(new URLSearchParams(location.search).get(`native`)===`1`)return!0}catch{}return window.pywebview!==void 0})(),wc=(()=>{try{return new URLSearchParams(location.search).get(`sw`)===`1`}catch{return!1}})(),Tc=(()=>{try{return document.createElement(`video`).canPlayType(`video/mp4; codecs="avc1.640028"`)!==``}catch{return!0}})(),Ec=(()=>{try{let e=document.createElement(`video`);return e.canPlayType(`video/mp4; codecs="hev1.1.6.L93.B0"`)!==``||e.canPlayType(`video/mp4; codecs="hvc1.1.6.L93.B0"`)!==``}catch{return!1}})()}));function Oc(e){return e.name.replace(/\.(mp4|mkv|mov|webm)$/i,``)}function kc(e){return e.name.replace(/\.(png|jpe?g)$/i,``)}var Ac,jc,Mc=o((()=>{Ac=`img:`,jc=e=>`${Ac}${e}`}));function Nc(e,t){return{...e,event:{...t,id:++Hc}}}function Pc(e,t){switch(t.type){case`loaded`:return{...e,ready:!0,loadError:null,config:t.config,clips:t.clips,images:t.images,playlists:t.playlists,status:t.status,tunnelUrl:t.status.public_url??null,update:t.status.update??null,sessionStartedAt:t.status.session_active?Date.now():null};case`loadFailed`:return{...e,ready:!0,loadError:t.error};case`setView`:return{...e,view:t.view,currentPlaylistId:t.playlistId===void 0?t.view===`clips`?e.currentPlaylistId:null:t.playlistId};case`setSearch`:return{...e,searchQuery:t.query};case`setAccent`:return{...e,accent:t.accent,customAccent:t.custom===void 0?e.customAccent:t.custom};case`setConfig`:return{...e,config:t.config};case`mergeConfig`:{if(!e.config)return e;let n={...e.config};for(let[e,r]of Object.entries(t.patch))n[e]={...n[e]??{},...r};return{...e,config:n}}case`setClips`:return{...e,clips:t.clips};case`setImages`:return{...e,images:t.images};case`setPlaylists`:return{...e,playlists:t.playlists};case`event`:return Nc(e,t.event);case`clearEvent`:return e.event?.id===t.id?{...e,event:null}:e;case`dismiss`:return e.dismissed.includes(t.banner)?e:{...e,dismissed:[...e.dismissed,t.banner]};case`clearUpdate`:return{...e,update:null};case`ws`:return Fc(e,t.msg);default:return e}}function Fc(e,t){switch(t.type){case`clip_saved`:{let n=e.clips.some(e=>e.slug===t.clip.slug),r=n?e.clips.map(e=>e.slug===t.clip.slug?{...e,...t.clip}:e):[t.clip,...e.clips],i={...e,clips:r,recentNew:n?e.recentNew:[...e.recentNew,t.clip.slug]};return n?i:Nc(i,{kind:`saved`,title:N(`events.clipSaved`),detail:[Oc(t.clip),t.clip.game].filter(Boolean).join(` · `),tone:`accent`,holdMs:4e3})}case`clip_deleted`:return{...e,clips:e.clips.filter(e=>e.slug!==t.slug),recentNew:e.recentNew.filter(e=>e!==t.slug)};case`image_saved`:{let n=e.images.some(e=>e.slug===t.image.slug),r=n?e.images.map(e=>e.slug===t.image.slug?{...e,...t.image}:e):[t.image,...e.images],i={...e,images:r};return n?i:Nc(i,{kind:`saved`,title:N(`events.imageSaved`),detail:[kc(t.image),t.image.game].filter(Boolean).join(` · `),tone:`accent`,holdMs:4e3})}case`image_deleted`:return{...e,images:e.images.filter(e=>e.slug!==t.slug)};case`image_error`:return Nc(e,{kind:`error`,title:N(`events.errScreenshot`),detail:t.error||void 0,tone:`error`,holdMs:9e3});case`image_copy_failed`:return Nc(e,{kind:`info`,title:N(`events.screenshotNotCopied`),detail:t.error||void 0,tone:`neutral`,holdMs:6e3});case`playlists_changed`:return{...e,playlists:t.playlists??[]};case`clip_saving`:return Nc(e,{kind:`saving`,title:N(`events.savingClip`),tone:`neutral`,holdMs:3e4});case`clip_error`:return Nc(e,{kind:`error`,title:N(`events.errSaveClip`),detail:t.error||N(`events.recorderSilent`),tone:`error`,holdMs:9e3});case`status`:{let{type:n,...r}=t,i={...e.status,...r};return{...e,status:i,sessionStartedAt:i.session_active?e.sessionStartedAt??Date.now():null,update:r.update??e.update}}case`tunnel_url`:return Nc({...e,tunnelUrl:t.url},{kind:`info`,title:N(`events.publicLinkReady`),detail:t.url,tone:`accent`,holdMs:6e3});case`tunnel_error`:return Nc({...e,tunnelUrl:null},{kind:`error`,title:N(`events.noPublicLink`),detail:t.error||N(`events.tunnelUnavailable`),tone:`error`,holdMs:9e3});case`session_start`:return Nc({...e,status:{...e.status,recording:!0,session_active:!0},sessionStartedAt:Date.now()},{kind:`info`,title:N(`events.sessionRecording`),detail:N(`events.doubleTapToStop`),tone:`live`,holdMs:5e3});case`session_stop`:return Nc({...e,status:{...e.status,session_active:!1},sessionStartedAt:null},{kind:`saved`,title:N(`events.sessionSaved`),tone:`accent`,holdMs:4e3});case`session_highlight`:return Nc(e,{kind:`info`,title:N(`events.highlightMarked`),detail:typeof t.time==`number`?pc(t.time):void 0,tone:`accent`,holdMs:3e3});case`update_available`:{let{type:n,...r}=t;return{...e,update:r}}case`editor_project_changed`:return{...e,editorProjectRevision:e.editorProjectRevision+1};case`daemon_upgrading`:return Nc(e,{kind:`info`,title:N(`events.updating`,{version:t.version??``}),detail:N(`events.updatingDetail`),tone:`accent`,holdMs:12e3});case`export_progress`:case`export_done`:case`export_error`:return e;default:return e}}function Ic({children:e}){let[t,n]=(0,Rc.useReducer)(Pc,Vc);(0,Rc.useEffect)(()=>{let e=!1;return(async()=>{try{let[t,r,i,a,o]=await Promise.all([U.getConfig(),U.clips(),U.images(),U.playlists(),U.status()]);e||n({type:`loaded`,config:t,clips:r,images:i,playlists:a,status:o})}catch(t){e||n({type:`loadFailed`,error:t.message})}})(),()=>{e=!0}},[]),(0,Rc.useEffect)(()=>{let e=null;try{let t=localStorage.getItem(Bc);e=t&&/^#[0-9a-f]{6}$/i.test(t)?t.toLowerCase():null}catch(e){console.debug(`Reading the custom accent failed`,e)}let t=localStorage.getItem(`vice-theme`);t&&za.includes(t)||t===`custom`&&e?n({type:`setAccent`,accent:t,custom:e}):e&&n({type:`setAccent`,accent:Ra,custom:e})},[]);let r=(0,Rc.useRef)(0);(0,Rc.useEffect)(()=>uc(e=>{(e.type===`image_saved`||e.type===`image_deleted`)&&(r.current+=1),n({type:`ws`,msg:e})}),[]),(0,Rc.useEffect)(()=>{if(!t.event)return;let{id:e,holdMs:r}=t.event,i=window.setTimeout(()=>n({type:`clearEvent`,id:e}),r);return()=>window.clearTimeout(i)},[t.event]),(0,Rc.useEffect)(()=>{t.ready&&!Tc&&n({type:`event`,event:{kind:`error`,title:N(`events.cannotPlay`),detail:N(`events.noH264`),tone:`error`,holdMs:1e4}})},[t.ready]);let i=(0,Rc.useCallback)(async()=>{n({type:`setClips`,clips:await U.clips()})},[]),a=(0,Rc.useCallback)(async()=>{let e=r.current,t=await U.images();r.current===e&&n({type:`setImages`,images:t})},[]),o=(0,Rc.useCallback)(async()=>{n({type:`setPlaylists`,playlists:await U.playlists()})},[]),s=(0,Rc.useCallback)(e=>{n({type:`event`,event:e})},[]),c=(0,Rc.useCallback)(async e=>{let t=await U.saveConfig(e);if(t.ok===!1)throw Error(t.error||N(`events.notSaved`));return n({type:`mergeConfig`,patch:e}),t},[]),l=(0,Rc.useMemo)(()=>{let e=t.searchQuery.trim().toLowerCase(),n=t.currentPlaylistId?t.playlists.find(e=>e.id===t.currentPlaylistId):null,r=t.clips;if(n){let e=new Set(n.clip_slugs??[]);r=r.filter(t=>e.has(t.slug))}return e&&(r=r.filter(t=>t.name.toLowerCase().includes(e)||(t.game??``).toLowerCase().includes(e))),r},[t.clips,t.playlists,t.currentPlaylistId,t.searchQuery]),u=(0,Rc.useMemo)(()=>{let e=t.searchQuery.trim().toLowerCase(),n=t.currentPlaylistId?t.playlists.find(e=>e.id===t.currentPlaylistId):null,r=t.images;if(n){let e=new Set(n.clip_slugs??[]);r=r.filter(t=>e.has(jc(t.slug)))}return e&&(r=r.filter(t=>t.name.toLowerCase().includes(e)||(t.game??``).toLowerCase().includes(e))),r},[t.images,t.playlists,t.currentPlaylistId,t.searchQuery]),d=(0,Rc.useMemo)(()=>gc(t.config?.hotkeys?.clip),[t.config]),f=(0,Rc.useMemo)(()=>({state:t,dispatch:n,visibleClips:l,visibleImages:u,hotkey:d,refreshClips:i,refreshImages:a,refreshPlaylists:o,notify:s,saveConfig:c}),[t,l,u,d,i,a,o,s,c]);return(0,zc.jsx)(Uc.Provider,{value:f,children:e})}function Lc(){let e=(0,Rc.useContext)(Uc);if(!e)throw Error(`useStore was called outside the provider`);return e}var Rc,zc,Bc,Vc,Hc,Uc,Wc=o((()=>{Rc=l(d()),cc(),fc(),vc(),Dc(),Ba(),Mc(),Ar(),zc=M(),Bc=`vice-custom-accent`,Vc={ready:!1,loadError:null,config:null,clips:[],images:[],playlists:[],status:{running:!1,version:``,clips:0,local_url:``,public_url:null,base_url:``,public_is_tunnel:!1,recording:!1,backend:`auto`,session_active:!1,hotkeys_available:!0,ready:!0,recorder_error:null,cpu_fallback:!1,codec_fallback:!1},tunnelUrl:null,update:null,recentNew:[],view:`home`,currentPlaylistId:null,searchQuery:``,accent:Ra,customAccent:null,event:null,sessionStartedAt:null,dismissed:[],editorProjectRevision:0},Hc=0,Uc=(0,Rc.createContext)(null)}));async function Gc(e){if(!e)return!1;let t=window.pywebview;if(Cc&&t?.api?.copy_to_clipboard)try{return!!await t.api.copy_to_clipboard(String(e))}catch(e){console.warn(`Native clipboard bridge failed, falling back`,e)}try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch(e){console.warn(`Clipboard API failed, falling back`,e)}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch(e){return console.warn(`Clipboard fallback failed`,e),!1}}var Kc=o((()=>{Dc()}));async function qc(e,t,n){if(!e.share_url){t({kind:`error`,title:N(`card.noShareLinkYet`),tone:`error`,holdMs:4e3});return}if(!await Gc(e.share_url)){n(e.share_url);return}e.share_is_public===!1?t({kind:`info`,title:N(`card.linkCopiedLocal`),detail:N(`card.linkCopiedLocalDetail`),tone:`neutral`,holdMs:8e3}):t({kind:`info`,title:N(`card.shareLinkCopied`),tone:`accent`,holdMs:3e3})}var Jc=o((()=>{Kc(),Ar()}));function Yc(e){if(e.key!==`Escape`||Qc.length===0)return;let t=e.target?.tagName;t!==`INPUT`&&t!==`TEXTAREA`&&t!==`SELECT`&&(e.preventDefault(),e.stopPropagation(),Qc[Qc.length-1]?.())}function Xc(e,t){(0,Zc.useEffect)(()=>{if(e)return Qc.length===0&&document.addEventListener(`keydown`,Yc,!0),Qc.push(t),()=>{let e=Qc.lastIndexOf(t);e>=0&&Qc.splice(e,1),Qc.length===0&&document.removeEventListener(`keydown`,Yc,!0)}},[e,t])}var Zc,Qc,$c=o((()=>{Zc=l(d()),Qc=[]}));function el(e,t){let[n,r]=(0,tl.useState)(e),[i,a]=(0,tl.useState)(!1);return e&&!n&&(r(!0),a(!1)),(0,tl.useEffect)(()=>{if(e){a(!1);return}if(!n)return;if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||document.documentElement.classList.contains(`perf-low`)){r(!1);return}a(!0);let i=window.setTimeout(()=>{r(!1),a(!1)},t);return()=>window.clearTimeout(i)},[e,n,t]),{mounted:n,closing:i}}var tl,nl=o((()=>{tl=l(d())})),W,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl=o((()=>{W=M(),rl=e=>({width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`}),il=({size:e=18,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M3 10.5 12 3l9 7.5`}),(0,W.jsx)(`path`,{d:`M5 9.5V21h14V9.5`})]}),al=({size:e=18,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`3`}),(0,W.jsx)(`path`,{d:`M10 9.5v5l4-2.5z`})]}),ol=({size:e=18,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`3`}),(0,W.jsx)(`circle`,{cx:`8.5`,cy:`9.5`,r:`1.6`}),(0,W.jsx)(`path`,{d:`m4 17 4.5-4.5 3.5 3.5 3-2.5L20 18`})]}),sl=({size:e=18,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`6`,cy:`7`,r:`3`}),(0,W.jsx)(`circle`,{cx:`6`,cy:`17`,r:`3`}),(0,W.jsx)(`path`,{d:`M20 5 9 15M20 19 9 9`})]}),cl=({size:e=18,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M4 7h8M16 7h4M4 12h4M12 12h8M4 17h10M18 17h2`}),(0,W.jsx)(`circle`,{cx:`14`,cy:`7`,r:`2`}),(0,W.jsx)(`circle`,{cx:`8`,cy:`12`,r:`2`}),(0,W.jsx)(`circle`,{cx:`16`,cy:`17`,r:`2`})]}),ll=({size:e=18,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,W.jsx)(`path`,{d:`M12 11v5M12 8h.01`})]}),ul=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,W.jsx)(`path`,{d:`m20 20-3.5-3.5`})]}),dl=({size:e=18,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,W.jsx)(`path`,{d:`M12 8v4.5M12 16h.01`})]}),fl=({size:e=15,className:t})=>(0,W.jsx)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),pl=({size:e=15,className:t})=>(0,W.jsx)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M5 12h14`})}),ml=({size:e=15,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M12 4v8`}),(0,W.jsx)(`path`,{d:`M7.5 7a7 7 0 1 0 9 0`})]}),hl=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M4 7h11M4 12h11M4 17h7`}),(0,W.jsx)(`path`,{d:`M18 11v7`}),(0,W.jsx)(`circle`,{cx:`16.5`,cy:`18`,r:`1.6`})]}),gl=({size:e=20,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.25,className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9.5`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`,fill:`currentColor`})]}),_l=({size:e=14,className:t})=>(0,W.jsx)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`m4 12.5 5 5L20 6.5`})}),vl=({size:e=14,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9.5`}),(0,W.jsx)(`path`,{d:`M9.4 9.2a2.7 2.7 0 0 1 5.2.9c0 1.8-2.6 2.7-2.6 2.7`}),(0,W.jsx)(`path`,{d:`M12 17h.01`})]}),yl=({size:e=12,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,W.jsx)(`path`,{d:`m7 10 5 5 5-5`}),(0,W.jsx)(`path`,{d:`M12 15V3`})]}),bl=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1.4`,fill:`currentColor`,stroke:`none`})]}),xl=({size:e=14,className:t})=>(0,W.jsx)(`svg`,{...rl(e),className:t,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M12 5v14M5 12h14`})}),Sl=({collapse:e,size:t=15})=>(0,W.jsx)(`svg`,{...rl(t),"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:e?`M9 3v4a2 2 0 0 1-2 2H3M15 3v4a2 2 0 0 0 2 2h4M9 21v-4a2 2 0 0 0-2-2H3M15 21v-4a2 2 0 0 1 2-2h4`:`M3 9V5a2 2 0 0 1 2-2h4M21 9V5a2 2 0 0 0-2-2h-4M3 15v4a2 2 0 0 0 2 2h4M21 15v4a2 2 0 0 1-2 2h-4`})})}));function wl({open:e,title:t,onClose:n,children:r,footer:i,wide:a}){let o=(0,Tl.useRef)(null),s=(0,Tl.useRef)(null),c=(0,Tl.useRef)(null);Xc(e,n);let{mounted:l,closing:u}=el(e,320);(0,Tl.useEffect)(()=>{if(e)return c.current=document.activeElement,o.current?.focus(),()=>{c.current?.focus?.()}},[e]);let d=(0,Tl.useRef)(t);return(0,Tl.useLayoutEffect)(()=>{d.current!==t&&(d.current=t,s.current?.animate?.([{opacity:0,transform:`translateY(-5px)`},{opacity:1,transform:`none`}],{duration:220,easing:`cubic-bezier(0.2, 0, 0, 1)`}))},[t]),l?(0,El.jsx)(`div`,{className:`scrim`,"data-closing":u||void 0,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,El.jsxs)(`div`,{className:`modal`,"data-closing":u||void 0,"data-wide":a||void 0,role:`dialog`,"aria-modal":`true`,"aria-label":t,tabIndex:-1,ref:o,children:[(0,El.jsxs)(`div`,{className:`modal-head`,children:[(0,El.jsx)(`h2`,{ref:s,children:t}),(0,El.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:n,"aria-label":`Close`,children:(0,El.jsx)(fl,{size:15})})]}),(0,El.jsx)(`div`,{className:`modal-body`,children:r}),i?(0,El.jsx)(`div`,{className:`modal-foot`,children:i}):null]})}):null}var Tl,El,Dl=o((()=>{Tl=l(d()),$c(),nl(),Cl(),El=M()}));function Ol(e){let t=(e?.vcodec??``).toLowerCase();return(t===`hevc`||t===`h265`)&&!Ec}function kl(e){return e?.video_url?Ol(e)?`${e.video_url}&proxy=1`:e.video_url:``}function Al(e,t){if(!e)return;let n=Math.max(0,Number(t)||0);try{typeof e.fastSeek==`function`?e.fastSeek(n):e.currentTime=n}catch{e.currentTime=n}}function jl(e){e?.play().catch(()=>{})}function Ml(e){let t=Math.max(0,Number(e)||0),n=e=>String(Math.floor(e)).padStart(2,`0`),r=String(Math.round(t%1*1e3)).padStart(3,`0`);return`${n(t/3600)}:${n(t%3600/60)}:${n(t%60)}.${r}`}function Nl(e){return e?{1:`ABORTED`,2:`NETWORK`,3:`DECODE`,4:`SRC_NOT_SUPPORTED`}[e.code]??`code ${e.code}`:`unknown`}function Pl(){return N(Tc?`viewer.playbackFailed`:`viewer.noH264Decoder`)}function Fl(e){let[t,n]=(0,Il.useState)(!1);return(0,Il.useEffect)(()=>{let t=e.current;if(!t)return;let r=()=>!!t.getAttribute(`src`),i=e=>yc(`video failed: ${e} h264=${Tc} hevc=${Ec} src=${(t.currentSrc||``).slice(-80)}`),a=()=>{r()&&(i(Nl(t.error)),n(!0))},o=()=>{r()&&(t.videoWidth===0&&i(`NO_VIDEO_TRACK`),n(t.videoWidth===0))},s=()=>r()&&n(!1);return t.addEventListener(`error`,a),t.addEventListener(`loadeddata`,o),t.addEventListener(`loadstart`,s),()=>{t.removeEventListener(`error`,a),t.removeEventListener(`loadeddata`,o),t.removeEventListener(`loadstart`,s)}},[e]),t}var Il,Ll=o((()=>{Il=l(d()),Dc(),Ar()}));function Rl({initial:e,onSubmit:t,onCancel:n,className:r,label:i,emptyFallback:a,stopPropagation:o}){let[s,c]=(0,zl.useState)(e),l=(0,zl.useRef)(!1),u=()=>{if(l.current)return;l.current=!0;let r=s.trim()||a||``;!r||r===e?n():t(r)};return(0,Bl.jsx)(`input`,{className:r,value:s,autoFocus:!0,"aria-label":i,onClick:o?e=>e.stopPropagation():void 0,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),onBlur:u,onKeyDown:e=>{o&&e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),u()),e.key===`Escape`&&(l.current=!0,n())}})}var zl,Bl,Vl=o((()=>{zl=l(d()),Bl=M()}));function Hl({clip:e,highlights:t,onClose:n,onSaved:r,notify:i,onRename:a,onReveal:o,onOpenExternally:s}){let c=(0,G.useRef)(null),l=(0,G.useRef)(null),[u,d]=(0,G.useState)(0),[f,p]=(0,G.useState)({start:0,end:0}),[m,h]=(0,G.useState)(0),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(null),[S,C]=(0,G.useState)(!1),[w,ee]=(0,G.useState)(null),[te,ne]=(0,G.useState)(!1),T=Fl(c),re=(0,G.useRef)(!1);re.current=g;let E=(0,G.useRef)(f);if(E.current=f,Xc(e!==null,n),(0,G.useEffect)(()=>{let t=c.current;if(!(!t||!e))return d(0),p({start:0,end:0}),h(0),_(!1),C(!1),ee(null),y(Ol(e)),t.src=kl(e),t.load(),()=>{t.pause(),t.removeAttribute(`src`),t.load()}},[e]),!e)return null;let D=()=>{_(!1),re.current=!1,c.current?.pause()},ie=()=>{let e=c.current;if(!(!u||!e)){if(g){D();return}_(!0),re.current=!0,e.currentTime=f.start,jl(e)}},ae=()=>{let e=c.current;if(!e||(h(e.currentTime),!re.current||!u))return;let{start:t,end:n}=E.current;(e.currentTime>=n-.05||e.currentTimet=>{if(t.button!==0||!u)return;t.preventDefault(),x(e),re.current&&D();let n=t=>{let n=l.current?.getBoundingClientRect(),r=c.current;if(!n||!r)return;let i=Math.max(0,Math.min(n.width,t-n.left))/n.width*u;p(t=>{let n=e===`start`?{...t,start:Math.max(0,Math.min(i,t.end-Ul))}:{...t,end:Math.min(u,Math.max(i,t.start+Ul))};return E.current=n,r.currentTime=e===`start`?n.start:n.end,n})},r=e=>n(e.clientX),i=()=>{window.removeEventListener(`pointermove`,r,!0),window.removeEventListener(`pointerup`,i,!0),window.removeEventListener(`pointercancel`,i,!0),x(null)};n(t.clientX),window.addEventListener(`pointermove`,r,!0),window.addEventListener(`pointerup`,i,!0),window.addEventListener(`pointercancel`,i,!0)},oe=async()=>{g&&D(),C(!0),ee(null);try{await U.trimClip(e.slug,f.start,f.end),i(N(`trim.saved`),Oc(e),`accent`),n(),await r()}catch(e){let t=e.message||N(`trim.failed`);ee(t),i(N(`trim.errTrim`),t,`error`),C(!1)}},k=e=>u?e/u*100:0,A=k(f.start),se=k(f.end);return(0,K.jsx)(`div`,{className:`scrim`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,K.jsxs)(`div`,{className:`modal trim-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":N(`trim.trimAria`,{name:Oc(e)}),children:[(0,K.jsxs)(`div`,{className:`modal-head`,children:[(0,K.jsxs)(`h2`,{className:`trim-head`,children:[(0,K.jsx)(`span`,{className:`trim-head-label`,children:N(`trim.heading`)}),te?(0,K.jsx)(Rl,{className:`trim-rename`,label:N(`card.nameLabel`),initial:Oc(e),onCancel:()=>ne(!1),onSubmit:t=>{ne(!1),a(e,t)}}):(0,K.jsx)(`span`,{className:`trim-head-name`,title:N(`viewer.doubleClickRename`),onDoubleClick:()=>ne(!0),children:Oc(e)})]}),(0,K.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:n,"aria-label":N(`common.close`),children:(0,K.jsx)(fl,{size:15})})]}),(0,K.jsxs)(`div`,{className:`modal-body`,children:[(0,K.jsxs)(`div`,{className:`trim-stage`,children:[(0,K.jsx)(`video`,{ref:c,className:`trim-video`,controls:!0,playsInline:!0,onLoadedMetadata:e=>{let t=Number.isFinite(e.currentTarget.duration)?e.currentTarget.duration:0;d(t);let n={start:0,end:t};p(n),E.current=n,y(!1)},onTimeUpdate:ae,onEnded:()=>{let e=c.current;!re.current||!e||(e.currentTime=E.current.start,jl(e))},onCanPlay:()=>y(!1),onError:()=>y(!1)}),v?(0,K.jsxs)(`div`,{className:`video-overlay`,children:[(0,K.jsx)(`span`,{className:`video-spinner`,"aria-hidden":`true`}),(0,K.jsx)(`p`,{children:N(`trim.preparingPreview`)})]}):null,T?(0,K.jsxs)(`div`,{className:`video-overlay`,children:[(0,K.jsx)(`p`,{children:Pl()}),(0,K.jsxs)(`div`,{className:`video-overlay-actions`,children:[(0,K.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(e),children:N(`trim.openInPlayer`)}),(0,K.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>o(e),children:N(`trim.showInFolder`)})]})]}):null]}),(0,K.jsxs)(`div`,{className:`trim-readout`,children:[(0,K.jsxs)(`span`,{children:[N(`trim.in`),` `,(0,K.jsx)(`b`,{className:`mono`,children:pc(f.start,!0)})]}),(0,K.jsxs)(`span`,{children:[N(`trim.duration`),` `,(0,K.jsx)(`b`,{className:`mono trim-readout-dur`,children:pc(Math.max(0,f.end-f.start),!0)})]}),(0,K.jsxs)(`span`,{children:[N(`trim.out`),` `,(0,K.jsx)(`b`,{className:`mono`,children:pc(f.end,!0)})]})]}),(0,K.jsxs)(`div`,{className:`trim-timeline`,ref:l,children:[(0,K.jsx)(`div`,{className:`trim-track`}),(0,K.jsx)(`div`,{className:`trim-selection`,style:{left:`${A}%`,width:`${se-A}%`}}),t.map(e=>(0,K.jsx)(`div`,{className:`trim-hl`,style:{left:`${k(e.time)}%`,background:e.color||`#f59e0b`},title:e.label},e.id)),(0,K.jsx)(`div`,{className:`trim-playhead`,style:{left:`${k(m)}%`}}),(0,K.jsx)(`button`,{type:`button`,className:`trim-handle`,"data-dragging":b===`start`||void 0,style:{left:`${A}%`},"aria-label":N(`trim.startOfSelection`),onPointerDown:O(`start`)}),(0,K.jsx)(`button`,{type:`button`,className:`trim-handle`,"data-dragging":b===`end`||void 0,style:{left:`${se}%`},"aria-label":N(`trim.endOfSelection`),onPointerDown:O(`end`)})]}),(0,K.jsxs)(`div`,{className:`trim-tc mono`,children:[(0,K.jsxs)(`span`,{children:[`start `,Ml(f.start)]}),(0,K.jsxs)(`span`,{children:[`end `,Ml(f.end)]})]})]}),(0,K.jsxs)(`div`,{className:`modal-foot trim-foot`,children:[(0,K.jsx)(`button`,{type:`button`,className:g?`btn btn-sm`:`btn btn-quiet btn-sm`,onClick:ie,disabled:!u,children:N(g?`trim.stop`:`trim.preview`)}),(0,K.jsx)(`span`,{className:`trim-status`,children:w??N(`trim.loopHelp`)}),(0,K.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:n,children:N(`common.cancel`)}),(0,K.jsx)(`button`,{type:`button`,className:`btn btn-sm`,onClick:()=>void oe(),disabled:S||!u,children:N(S?`trim.saving`:`trim.saveTrim`)})]})]})})}var G,K,Ul,Wl=o((()=>{G=l(d()),cc(),$c(),vc(),Ll(),Mc(),Cl(),Vl(),Ar(),K=M(),Ul=.5})),Gl,Kl,ql=o((()=>{Gl=[`#f59e0b`,`#ef4444`,`#22c55e`,`#3b82f6`,`#ec4899`,`#8b5cf6`,`#06b6d4`,`#f97316`],Kl=Gl[0]}));function Jl(){try{let e=Number(localStorage.getItem(ou));return Number.isFinite(e)&&e>=0&&e<=1?e:1}catch{return 1}}function Yl(){try{return localStorage.getItem(su)===`1`}catch{return!1}}function Xl(e,t){try{localStorage.setItem(e,t)}catch{}}function Zl(e){let{clips:t,highlights:n,onHighlightsChange:r,onSelect:i,onClose:a}=e,{mounted:o,closing:s}=el(e.clip!==null,320),c=(0,ru.useRef)(e.clip);e.clip&&(c.current=e.clip);let l=e.clip??c.current,u=(0,ru.useRef)(null),d=(0,ru.useRef)(null),f=(0,ru.useRef)(null),[p,m]=(0,ru.useState)({current:0,duration:0}),[h,g]=(0,ru.useState)(!0),[_,v]=(0,ru.useState)(!1),[y,b]=(0,ru.useState)(null),[x,S]=(0,ru.useState)(null),[C,w]=(0,ru.useState)(null),[ee,te]=(0,ru.useState)(!1),[ne,T]=(0,ru.useState)(Jl),[re,E]=(0,ru.useState)(Yl),[D,ie]=(0,ru.useState)(!1),[ae,O]=(0,ru.useState)(!1),[oe,k]=(0,ru.useState)(!1),A=Fl(u),se=l?t.findIndex(e=>e.slug===l.slug):-1,ce=e.clip!==null,j=e.trimOpen;(0,ru.useLayoutEffect)(()=>{let e=u.current;if(!e||!l)return;let t=kl(l);if(e.getAttribute(`src`)===t){j||jl(e);return}e.pause(),e.src=t,e.load(),v(Ol(l)),m({current:0,duration:0}),j||jl(e),U.markViewed(l.slug).catch(e=>console.debug(`Recording the view failed`,e))},[l,j]),(0,ru.useEffect)(()=>{if(ce)return;let e=u.current;e?.getAttribute(`src`)&&(e.pause(),e.removeAttribute(`src`),e.load())},[ce]),(0,ru.useEffect)(()=>{let e=u.current;e&&(e.volume=ne,e.muted=re)}),(0,ru.useEffect)(()=>{ce||ie(!1)},[ce]),(0,ru.useEffect)(()=>{if(!D){O(!1);return}let e=0,t=()=>{O(!1),window.clearTimeout(e),e=window.setTimeout(()=>O(!0),3e3)};return t(),window.addEventListener(`pointermove`,t),window.addEventListener(`pointerdown`,t),()=>{window.clearTimeout(e),window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerdown`,t)}},[D]);let le=(0,ru.useRef)(null),ue=(0,ru.useCallback)(()=>{let e=f.current;le.current=e?{rect:e.getBoundingClientRect(),radius:getComputedStyle(e).borderTopLeftRadius}:null,ie(e=>!e)},[]);(0,ru.useLayoutEffect)(()=>{let e=f.current,t=le.current;if(le.current=null,!e||!t||typeof e.animate!=`function`)return;let n=t.rect,r=e.getBoundingClientRect();if(!n.width||!r.width)return;let i=n.left-r.left,a=n.top-r.top,o=n.width/r.width,s=n.height/r.height;Math.abs(i)<1&&Math.abs(a)<1&&Math.abs(o-1)<.01||e.animate([{transform:`translate(${i}px, ${a}px) scale(${o}, ${s})`,borderRadius:t.radius},{transform:`none`,borderRadius:getComputedStyle(e).borderTopLeftRadius}],{duration:280,easing:`cubic-bezier(0.2, 0, 0, 1)`})},[D]);let de=(0,ru.useCallback)(e=>{let t=lu(cu(e));T(t),Xl(ou,String(t)),t>0&&(E(!1),Xl(su,`0`))},[]),fe=(0,ru.useCallback)(()=>{E(e=>(Xl(su,e?`0`:`1`),!e))},[]),pe=(0,ru.useCallback)(async()=>{let t=u.current;if(!(!l||!t||oe)){k(!0);try{let n=await U.saveFrame(l.slug,t.currentTime);if(n.ok===!1)throw Error(n.error||N(`viewer.errSaveFrame`));e.notify(n.copied===!1?N(`viewer.frameSavedNotCopied`):N(`viewer.frameSaved`),n.copy_error||kc(n),`accent`)}catch(t){e.notify(N(`viewer.errSaveFrame`),t.message,`error`)}finally{k(!1)}}},[l,oe,e]),me=(0,ru.useCallback)(e=>{if(se<0)return;let n=t[se+e];n&&i(n.slug)},[t,se,i]),he=(0,ru.useCallback)(async()=>{let t=u.current;if(!l||!t)return;let i=t.currentTime,a=nu(n),o=iu[n.length%iu.length];try{let t=await U.addHighlight(l.slug,{time:i,label:a,color:o});if(!t.highlight)throw Error(t.error||N(`viewer.daemonNoMark`));r(uu([...n,t.highlight])),e.notify(`${a} at ${pc(i,!0)}`,void 0,`accent`)}catch(t){e.notify(N(`viewer.errAddHighlight`),t.message,`error`)}},[l,n,r,e]);Xc(ce,(0,ru.useCallback)(()=>{if(D){ie(!1);return}a()},[D,a])),(0,ru.useEffect)(()=>{s&&u.current?.pause()},[s]),(0,ru.useEffect)(()=>{j&&u.current?.pause()},[j,l]);let ge=(0,ru.useCallback)(()=>{let e=u.current;e?.getAttribute(`src`)&&(e.paused?jl(e):e.pause())},[]);if((0,ru.useEffect)(()=>{if(!ce||s||j)return;let e=e=>{if(e.defaultPrevented||e.ctrlKey||e.altKey||e.metaKey)return;let t=e.target instanceof HTMLElement?e.target:null;if(!(t?.closest(`input, textarea, select`)||t?.isContentEditable)){if(e.code===`Space`||e.key===` `){if(t?.closest(`button, a, [role="button"], [role="switch"]`))return;e.preventDefault(),e.repeat||ge();return}e.key===`ArrowLeft`?(e.preventDefault(),me(-1)):e.key===`ArrowRight`?(e.preventDefault(),me(1)):e.key===`h`||e.key===`H`?(e.preventDefault(),he()):e.key===`f`||e.key===`F`?(e.preventDefault(),ue()):e.key===`s`||e.key===`S`?(e.preventDefault(),pe()):(e.key===`m`||e.key===`M`)&&(e.preventDefault(),fe())}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[ce,s,j,me,he,ue,pe,fe,ge]),!o||!l)return null;let _e=p.duration,ve=_e>0?p.current/_e*100:0,ye=e=>{let t=d.current;if(!t||!_e)return;let n=t.getBoundingClientRect();Al(u.current,cu((e-n.left)/n.width)*_e)},be=(t,i)=>{if(t.button!==0||!_e)return;t.preventDefault(),t.stopPropagation(),b(i.id);let a=e=>{let t=d.current?.getBoundingClientRect();return t?cu((e-t.left)/t.width)*_e:null},o=i.time,s=e=>{let t=a(e.clientX);t!=null&&(o=t,r(uu(du(n,i.id,lu(t)))))},c=async t=>{window.removeEventListener(`pointermove`,s,!0),window.removeEventListener(`pointerup`,c,!0),window.removeEventListener(`pointercancel`,c,!0),b(null);let u=lu(a(t.clientX)??o);r(uu(du(n,i.id,u)));try{let t=await U.updateHighlight(l.slug,i.id,{time:u});if(t.ok===!1)throw Error(t.error||N(`viewer.daemonRejectedMove`));e.notify(`Highlight moved to ${pc(u,!0)}`,void 0,`accent`)}catch(t){r(uu(du(n,i.id,i.time))),e.notify(N(`viewer.errMoveHighlight`),t.message,`error`)}};window.addEventListener(`pointermove`,s,!0),window.addEventListener(`pointerup`,c,!0),window.addEventListener(`pointercancel`,c,!0)},xe=async(t,i)=>{try{let e=await U.updateHighlight(l.slug,t,i);if(e.ok===!1)throw Error(e.error||N(`viewer.daemonRejectedChange`));r(uu(n.map(e=>e.id===t?{...e,...i}:e)))}catch(t){e.notify(N(`viewer.errUpdateHighlight`),t.message,`error`)}},Se=async t=>{try{await U.deleteHighlight(l.slug,t),r(n.filter(e=>e.id!==t))}catch(t){e.notify(N(`viewer.errDeleteHighlight`),t.message,`error`)}},Ce=[l.duration?pc(Math.round(l.duration),!0):``,l.width?`${l.width}x${l.height}`:``,l.size?hc(l.size):``].filter(Boolean).join(` · `);return(0,q.jsxs)(`div`,{className:`scrim viewer-scrim`,"data-closing":s||void 0,onMouseDown:e=>e.target===e.currentTarget&&a(),children:[(0,q.jsxs)(`div`,{className:`viewer-stack`,children:[(0,q.jsxs)(`div`,{className:`modal viewer`,"data-closing":s||void 0,role:`dialog`,"aria-modal":`true`,"aria-label":Oc(l),children:[(0,q.jsxs)(`header`,{className:`viewer-head`,children:[(0,q.jsxs)(`div`,{className:`viewer-heading`,children:[ee?(0,q.jsx)(Rl,{className:`viewer-rename`,label:N(`card.nameLabel`),initial:Oc(l),onCancel:()=>te(!1),onSubmit:t=>{te(!1),e.onRename(l,t)}}):(0,q.jsx)(`h2`,{title:N(`viewer.doubleClickRename`),onDoubleClick:()=>te(!0),children:Oc(l)}),(0,q.jsx)(`p`,{className:`mono`,children:Ce})]}),t.length>1?(0,q.jsxs)(`span`,{className:`viewer-count mono`,children:[se+1,` / `,t.length]}):null,(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>me(-1),disabled:se<=0,"aria-label":N(`viewer.prevClip`),children:(0,q.jsx)(pu,{dir:`left`})}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>me(1),disabled:se<0||se>=t.length-1,"aria-label":N(`viewer.nextClip`),children:(0,q.jsx)(pu,{dir:`right`})}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>void pe(),disabled:oe||l.unreadable,title:N(`viewer.saveFrameHint`),"aria-label":N(`viewer.saveFrame`),children:(0,q.jsx)(_u,{})}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:ue,"aria-pressed":D,title:N(D?`viewer.shrinkHint`:`viewer.expandHint`),"aria-label":N(D?`viewer.shrink`:`viewer.expand`),children:(0,q.jsx)(Sl,{collapse:D})}),(0,q.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:a,"aria-label":N(`common.close`),children:(0,q.jsx)(fl,{size:15})})]}),(0,q.jsxs)(`div`,{className:`viewer-stage`,ref:f,"data-expanded":D||void 0,"data-idle":D&&ae||void 0,onClick:ge,onDoubleClick:ue,children:[(0,q.jsx)(`video`,{ref:u,className:`viewer-video`,playsInline:!0,onTimeUpdate:e=>m({current:e.currentTarget.currentTime,duration:Number.isFinite(e.currentTarget.duration)?e.currentTarget.duration:0}),onLoadedMetadata:e=>m({current:e.currentTarget.currentTime,duration:Number.isFinite(e.currentTarget.duration)?e.currentTarget.duration:0}),onPlay:()=>g(!1),onPause:()=>g(!0),onCanPlay:()=>v(!1),onLoadedData:()=>v(!1),onError:()=>v(!1)}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-play`,"data-paused":h||void 0,"aria-label":N(h?`viewer.play`:`viewer.pause`),children:h?(0,q.jsx)(mu,{}):(0,q.jsx)(hu,{})}),(0,q.jsxs)(`span`,{className:`viewer-timebadge mono`,children:[pc(p.current,!0),` / `,pc(_e,!0)]}),_?(0,q.jsxs)(`div`,{className:`video-overlay`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(`span`,{className:`video-spinner`,"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:N(`viewer.preparingPreview`)})]}):null,D?(0,q.jsxs)(`div`,{className:`viewer-expanded-bar`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:[(0,q.jsx)(`span`,{className:`mono player-tc`,children:pc(p.current,!0)}),(0,q.jsx)($l,{percent:ve,onSeek:e=>Al(u.current,e*_e)}),(0,q.jsx)(`span`,{className:`mono player-tc`,children:pc(_e,!0)}),(0,q.jsx)(eu,{volume:ne,muted:re,onChange:de,onToggleMute:fe}),(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:ue,"aria-label":N(`viewer.shrink`),children:(0,q.jsx)(Sl,{collapse:!0})})]}):null,A?(0,q.jsxs)(`div`,{className:`video-overlay`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(`p`,{children:Pl()}),(0,q.jsxs)(`div`,{className:`video-overlay-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>e.onOpenExternally(l),children:N(`viewer.openInPlayer`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>e.onReveal(l),children:N(`viewer.showInFolder`)})]})]}):null]}),(0,q.jsxs)(`div`,{className:`viewer-bottom`,children:[(0,q.jsxs)(`div`,{className:`viewer-timeline`,ref:d,onClick:e=>ye(e.clientX),children:[(0,q.jsx)(`div`,{className:`viewer-progress`,style:{width:`${ve}%`}}),(0,q.jsx)(`div`,{className:`viewer-playhead`,style:{left:`${ve}%`}}),n.map(e=>(0,q.jsx)(`button`,{type:`button`,className:`hl-marker`,"data-dragging":y===e.id||void 0,style:{left:`${_e?e.time/_e*100:0}%`,background:e.color||au},title:`${e.label}, ${pc(e.time,!0)}, drag to move`,"aria-label":N(`viewer.highlightAt`,{label:e.label,time:pc(e.time,!0)}),onPointerDown:t=>be(t,e),onClick:t=>{t.stopPropagation(),y||Al(u.current,e.time)}},e.id))]}),(0,q.jsxs)(`div`,{className:`viewer-hl-head`,children:[(0,q.jsx)(`span`,{className:`eyebrow`,children:N(`viewer.highlightsHeading`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>void he(),children:yr(`viewer.addHighlightKey`,{key:(0,q.jsx)(`kbd`,{children:`H`},`k`)})})]}),(0,q.jsx)(`div`,{className:`viewer-hl-list`,children:n.length===0?(0,q.jsx)(`p`,{className:`viewer-hl-empty`,children:yr(`viewer.noHighlightsHelp`,{key:(0,q.jsx)(`kbd`,{children:`H`},`k`)})}):n.map(e=>(0,q.jsxs)(`div`,{className:`hl-item`,onClick:()=>Al(u.current,e.time),children:[(0,q.jsx)(`button`,{type:`button`,className:`hl-swatch`,style:{background:e.color||au},title:N(`viewer.changeColour`),"aria-label":N(`viewer.changeColourAria`,{name:e.label}),onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();S({id:e.id,color:e.color||au,at:{x:n.left,y:n.bottom+6}})}}),(0,q.jsx)(`span`,{className:`hl-time mono`,children:pc(e.time,!0)}),C===e.id?(0,q.jsx)(Rl,{className:`hl-rename`,label:N(`viewer.highlightLabel`),initial:e.label,emptyFallback:N(`viewer.highlight`),stopPropagation:!0,onCancel:()=>w(null),onSubmit:t=>{w(null),xe(e.id,{label:t})}}):(0,q.jsx)(`span`,{className:`hl-label`,title:N(`viewer.doubleClickRename`),onDoubleClick:t=>{t.stopPropagation(),w(e.id)},children:e.label}),(0,q.jsx)(`button`,{type:`button`,className:`hl-del`,title:N(`viewer.removeHighlight`),"aria-label":N(`viewer.removeHighlightAria`,{name:e.label}),onClick:t=>{t.stopPropagation(),Se(e.id)},children:(0,q.jsx)(fl,{size:12})})]},e.id))}),(0,q.jsxs)(`footer`,{className:`viewer-foot`,children:[(0,q.jsx)(`span`,{className:`viewer-shortcuts mono`,children:N(`viewer.shortcuts`)}),(0,q.jsxs)(`div`,{className:`viewer-foot-btns`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onTrim(l),children:N(`viewer.trim`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onShare(l),children:N(`viewer.share`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onReveal(l),children:N(`viewer.reveal`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>e.onDelete(l),children:N(`viewer.delete`)})]})]})]})]}),(0,q.jsx)(Ql,{clip:l,paused:h,current:p.current,duration:_e,volume:ne,muted:re,canStepBack:se>0,canStepForward:se>=0&&see.onShare(l),onClose:a})]}),x?(0,q.jsx)(tu,{at:x.at,current:x.color,onClose:()=>S(null),onPick:e=>{S(null),xe(x.id,{color:e})}}):null]})}function Ql({clip:e,paused:t,current:n,duration:r,volume:i,muted:a,canStepBack:o,canStepForward:s,onToggle:c,onStep:l,onVolume:u,onToggleMute:d,onShare:f,onClose:p}){return(0,q.jsxs)(`div`,{className:`player-bar`,children:[(0,q.jsxs)(`div`,{className:`player-clip`,children:[e.thumb_url?(0,q.jsx)(`img`,{src:e.thumb_url,alt:``}):(0,q.jsx)(`span`,{className:`player-thumb-empty`}),(0,q.jsxs)(`div`,{className:`player-titles`,children:[(0,q.jsx)(`b`,{children:Oc(e)}),(0,q.jsx)(`span`,{className:`mono`,children:e.game||``})]})]}),(0,q.jsxs)(`div`,{className:`player-controls`,children:[(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:()=>l(-1),disabled:!o,"aria-label":N(`viewer.prevClip`),children:(0,q.jsx)(gu,{dir:`back`})}),(0,q.jsx)(`button`,{type:`button`,className:`player-main`,onClick:c,"aria-label":N(t?`viewer.play`:`viewer.pause`),children:t?(0,q.jsx)(mu,{}):(0,q.jsx)(hu,{})}),(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:()=>l(1),disabled:!s,"aria-label":N(`viewer.nextClip`),children:(0,q.jsx)(gu,{dir:`forward`})})]}),(0,q.jsxs)(`div`,{className:`player-audio`,children:[(0,q.jsxs)(`span`,{className:`mono player-tc`,children:[pc(n,!0),` / `,pc(r,!0)]}),(0,q.jsx)(eu,{volume:i,muted:a,onChange:u,onToggleMute:d})]}),(0,q.jsxs)(`div`,{className:`player-extra`,children:[(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:f,"aria-label":N(`viewer.copyShareLink`),children:(0,q.jsx)(yu,{})}),(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:p,"aria-label":N(`viewer.closePlayer`),children:(0,q.jsx)(fl,{size:15})})]})]})}function $l({percent:e,onSeek:t}){let n=(0,ru.useRef)(null),r=e=>{let t=n.current?.getBoundingClientRect();return!t||!t.width?null:cu((e-t.left)/t.width)};return(0,q.jsxs)(`div`,{className:`player-track`,ref:n,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault();let n=r(e.clientX);n!==null&&t(n);let i=e=>{let n=r(e.clientX);n!==null&&t(n)},a=()=>{window.removeEventListener(`pointermove`,i,!0),window.removeEventListener(`pointerup`,a,!0),window.removeEventListener(`pointercancel`,a,!0)};window.addEventListener(`pointermove`,i,!0),window.addEventListener(`pointerup`,a,!0),window.addEventListener(`pointercancel`,a,!0)},children:[(0,q.jsx)(`div`,{className:`player-fill`,style:{width:`${e}%`}}),(0,q.jsx)(`div`,{className:`player-knob`,style:{left:`${e}%`}})]})}function eu({volume:e,muted:t,onChange:n,onToggleMute:r}){let i=t?0:e;return(0,q.jsxs)(`div`,{className:`player-volume`,children:[(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:r,"aria-pressed":t,title:N(t?`viewer.unmuteHint`:`viewer.muteHint`),"aria-label":N(t?`viewer.unmute`:`viewer.mute`),children:(0,q.jsx)(vu,{level:i})}),(0,q.jsx)(`input`,{type:`range`,className:`player-volume-range`,min:0,max:1,step:.01,value:i,"aria-label":N(`viewer.volume`),style:{"--filled":`${i*100}%`},onChange:e=>n(Number(e.target.value))})]})}function tu({at:e,current:t,onPick:n,onClose:r}){let i=(0,ru.useRef)(null);return(0,ru.useEffect)(()=>{let e=e=>{i.current?.contains(e.target)||r()},t=window.setTimeout(()=>document.addEventListener(`pointerdown`,e,!0),0);return()=>{window.clearTimeout(t),document.removeEventListener(`pointerdown`,e,!0)}},[r]),(0,q.jsx)(`div`,{className:`hl-picker`,ref:i,style:{left:e.x,top:e.y},role:`menu`,children:iu.map(e=>(0,q.jsx)(`button`,{type:`button`,className:`hl-picker-dot`,"data-active":e===t||void 0,style:{background:e},title:e,"aria-label":N(`viewer.useColour`,{color:e}),onClick:()=>n(e)},e))})}function nu(e){let t=N(`viewer.highlight`),n=new Set(e.map(e=>e.label));if(!n.has(t))return t;let r=1;for(;n.has(N(`viewer.highlightNumbered`,{base:t,n:r}));)r++;return N(`viewer.highlightNumbered`,{base:t,n:r})}var ru,q,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu=o((()=>{ru=l(d()),cc(),$c(),ql(),nl(),vc(),Ll(),Mc(),Cl(),Vl(),Ar(),q=M(),iu=Gl,au=Kl,ou=`vice-volume`,su=`vice-muted`,cu=e=>Math.max(0,Math.min(1,e)),lu=e=>Number(e.toFixed(3)),uu=e=>[...e].sort((e,t)=>e.time-t.time),du=(e,t,n)=>e.map(e=>e.id===t?{...e,time:n}:e),fu={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},pu=({dir:e})=>(0,q.jsx)(`svg`,{...fu,width:16,height:16,children:(0,q.jsx)(`path`,{d:e===`left`?`M15 6 9 12l6 6`:`M9 6l6 6-6 6`})}),mu=()=>(0,q.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`currentColor`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:`M7 4l13 8-13 8z`})}),hu=()=>(0,q.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`currentColor`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:`M7 4h3.5v16H7zM13.5 4H17v16h-3.5z`})}),gu=({dir:e})=>(0,q.jsx)(`svg`,{viewBox:`0 0 24 24`,width:13,height:13,fill:`currentColor`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:e===`back`?`M6 4h2v16H6zM20 4 9.5 12 20 20z`:`M18 4h-2v16h2zM4 4l10.5 8L4 20z`})}),_u=()=>(0,q.jsxs)(`svg`,{...fu,width:15,height:15,strokeWidth:2,children:[(0,q.jsx)(`path`,{d:`M3 8.5A1.5 1.5 0 0 1 4.5 7h2L8 4.5h8L17.5 7h2A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`13`,r:`3.4`})]}),vu=({level:e})=>(0,q.jsxs)(`svg`,{...fu,width:15,height:15,strokeWidth:2,children:[(0,q.jsx)(`path`,{d:`M4 9.5h3L11 6v12L7 14.5H4z`}),e<=0?(0,q.jsx)(`path`,{d:`m15 9.5 4.5 5M19.5 9.5l-4.5 5`}):e<.55?(0,q.jsx)(`path`,{d:`M14.8 9.8a3 3 0 0 1 0 4.4`}):(0,q.jsx)(`path`,{d:`M14.8 9.8a3 3 0 0 1 0 4.4M17.3 7.6a6.5 6.5 0 0 1 0 8.8`})]}),yu=()=>(0,q.jsxs)(`svg`,{...fu,width:15,height:15,strokeWidth:2,children:[(0,q.jsx)(`circle`,{cx:`18`,cy:`5`,r:`3`}),(0,q.jsx)(`circle`,{cx:`6`,cy:`12`,r:`3`}),(0,q.jsx)(`circle`,{cx:`18`,cy:`19`,r:`3`}),(0,q.jsx)(`path`,{d:`m8.6 13.5 6.8 4M15.4 6.5l-6.8 4`})]})}));function xu({at:e,heading:t,items:n,quick:r,emptyLabel:i,onClose:a}){let o=(0,Su.useRef)(null),[s,c]=(0,Su.useState)(e);(0,Su.useLayoutEffect)(()=>{let t=o.current;t&&c({x:Math.max(8,Math.min(e.x,window.innerWidth-t.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-t.offsetHeight-8))})},[e]),(0,Su.useEffect)(()=>{let e=e=>{e.type===`pointerdown`&&o.current?.contains(e.target)||a()},t=e=>e.key===`Escape`&&a();return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`keydown`,t,!0),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`keydown`,t,!0),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[a]);let l=n.filter(e=>!e.separator);return(0,Cu.jsxs)(`div`,{className:`ctx-menu`,ref:o,style:{left:s.x,top:s.y},role:`menu`,children:[(0,Cu.jsx)(`p`,{className:`ctx-heading`,children:t}),r?.length?(0,Cu.jsx)(`div`,{className:`ctx-quick`,children:r.map(e=>(0,Cu.jsx)(`button`,{type:`button`,className:`ctx-quick-btn`,"data-active":e.active||void 0,title:e.title,"aria-label":e.title,onClick:()=>{e.onSelect(),a()},children:e.glyph},e.id))}):null,l.length===0?(0,Cu.jsx)(`p`,{className:`ctx-empty`,children:i}):n.map(e=>e.separator?(0,Cu.jsx)(`div`,{className:`ctx-sep`,role:`separator`},e.id):(0,Cu.jsxs)(`button`,{type:`button`,className:`ctx-item`,"data-danger":e.danger||void 0,role:`menuitem`,disabled:e.disabled,onClick:()=>{e.onSelect?.(),a()},children:[(0,Cu.jsx)(`span`,{className:`ctx-mark`,children:e.mark??``}),(0,Cu.jsx)(`span`,{children:e.label})]},e.id))]})}var Su,Cu,wu=o((()=>{Su=l(d()),Cu=M()}));function Tu(){let{notify:e,refreshClips:t}=Lc();return(0,Du.useCallback)(async(n,r)=>{try{let i=await U.renameClip(n.slug,r);return await t(),i?.name&&Oc(i)!==r&&e({kind:`info`,title:N(`card.savedAs`,{name:Oc(i)}),tone:`neutral`,holdMs:4e3}),i??null}catch(t){return e({kind:`error`,title:N(`card.renameFailed`),detail:t.message,tone:`error`,holdMs:7e3}),null}},[e,t])}function Eu(){let{state:e,notify:t,refreshPlaylists:n}=Lc(),{openViewer:r,openTrim:i}=ju(),{playlists:a}=e,[o,s]=(0,Du.useState)(null),[c,l]=(0,Du.useState)(null),[u,d]=(0,Du.useState)(null),[f,p]=(0,Du.useState)(null),m=(0,Du.useCallback)(e=>n=>t({kind:`error`,title:e,detail:n.message,tone:`error`,holdMs:7e3}),[t]),h=(0,Du.useCallback)((e,n)=>t({kind:`info`,title:e,detail:n,tone:`accent`,holdMs:3500}),[t]),g=(0,Du.useCallback)(e=>void qc(e,t,d),[t]),_=(0,Du.useCallback)(e=>void U.revealClip(e.slug).catch(m(N(`viewer.errReveal`))),[m]),v=(0,Du.useCallback)(e=>void U.copyClipFile(e.slug).then(()=>h(N(`card.videoCopied`))).catch(m(N(`card.errCopyVideo`))),[m,h]),y=Tu(),b=(0,Du.useCallback)(async(e,t)=>{await y(e,t)},[y]),x=(0,Du.useMemo)(()=>({onOpen:e=>r(e.slug),onTrim:e=>i(e.slug),onCopyLink:g,onCopyFile:v,onReveal:_,onDelete:l,onRename:b,onContextMenu:(e,t)=>s({clip:e,at:t}),renamingSlug:f,onRenameDone:()=>p(null)}),[r,i,g,v,_,b,f]),S=o?.clip;return{actions:x,overlays:(0,Ou.jsxs)(Ou.Fragment,{children:[o&&S?(0,Ou.jsx)(xu,{at:o.at,heading:Oc(S),emptyLabel:N(`common.noActions`),onClose:()=>s(null),items:[{id:`open`,label:N(`card.open`),onSelect:()=>r(S.slug)},{id:`trim`,label:N(`card.trim`),onSelect:()=>i(S.slug)},{id:`rename`,label:N(`card.rename`),onSelect:()=>p(S.slug)},{id:`copy-link`,label:S.share_url?N(`card.copyShareLink`):N(`card.noShareLink`),disabled:!S.share_url,onSelect:()=>g(S)},{id:`copy-file`,label:N(`card.copyVideoShort`),onSelect:()=>v(S)},{id:`reveal`,label:N(`card.reveal`),onSelect:()=>_(S)},...a.length?[{id:`sep-playlists`,separator:!0}]:[],...a.map(e=>{let t=e.clip_slugs?.includes(S.slug)??!1;return{id:e.id,label:N(t?`card.removeFrom`:`card.addTo`,{playlist:e.name}),mark:t?`✓`:e.emoji??void 0,onSelect:()=>{(t?U.removeClipFromPlaylist(e.id,S.slug):U.addClipToPlaylist(e.id,S.slug)).then(async r=>{if(r?.ok===!1)throw Error(r.error||N(`card.playlistUnchanged`));await n(),h(N(t?`card.removedFrom`:`card.addedTo`,{playlist:e.name}))}).catch(m(N(`clips.errUpdatePlaylist`)))}}}),{id:`sep-delete`,separator:!0},{id:`delete`,label:N(`card.deleteClip`),danger:!0,onSelect:()=>l(S)}]}):null,(0,Ou.jsx)(wl,{open:c!==null,title:N(`viewer.confirmDeleteTitle`),onClose:()=>l(null),footer:(0,Ou.jsxs)(Ou.Fragment,{children:[(0,Ou.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>l(null),children:N(`common.keepIt`)}),(0,Ou.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=c;l(null),e&&U.deleteClip(e.slug).then(()=>h(N(`viewer.clipDeleted`))).catch(m(N(`viewer.errDelete`)))},children:N(`common.delete`)})]}),children:(0,Ou.jsx)(`p`,{children:N(`viewer.confirmDeleteBody`,{name:c?Oc(c):``})})}),(0,Ou.jsxs)(wl,{open:u!==null,title:N(`viewer.copyLinkTitle`),onClose:()=>d(null),children:[(0,Ou.jsx)(`p`,{children:N(`viewer.copyLinkBody`)}),(0,Ou.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:u??``,rows:3})]})]})}}var Du,Ou,ku=o((()=>{Du=l(d()),cc(),Jc(),Mc(),wu(),Dl(),Wc(),Fu(),Ar(),Ou=M()}));function Au({children:e}){let{state:t,notify:n,refreshClips:r}=Lc(),{clips:i}=t,[a,o]=(0,Mu.useState)(null),[s,c]=(0,Mu.useState)(null),[l,u]=(0,Mu.useState)([]),[d,f]=(0,Mu.useState)(null),[p,m]=(0,Mu.useState)(null),h=i.find(e=>e.slug===a)??null,g=i.find(e=>e.slug===s)??null,_=(0,Mu.useCallback)(e=>{document.querySelectorAll(`video.clip-preview`).forEach(e=>e.pause()),o(e)},[]),v=(0,Mu.useCallback)(e=>c(e),[]);(0,Mu.useEffect)(()=>{if(!a){u([]);return}let e=!1;return U.highlights(a).then(t=>!e&&u(t)).catch(t=>{console.debug(`Loading highlights failed`,t),e||u([])}),()=>{e=!0}},[a]);let y=(0,Mu.useRef)(null);(0,Mu.useEffect)(()=>{let e=e=>e!==y.current&&!i.some(t=>t.slug===e);a&&e(a)&&o(null),s&&e(s)&&c(null)},[i,a,s]);let b=Tu(),x=(0,Mu.useCallback)((e,t)=>{y.current=e.slug,b(e,t).then(t=>{t?.slug&&(o(n=>n===e.slug?t.slug:n),c(n=>n===e.slug?t.slug:n))}).finally(()=>{y.current=null})},[b]),S=(0,Mu.useCallback)(e=>t=>n({kind:`error`,title:e,detail:t.message,tone:`error`,holdMs:7e3}),[n]),C=(0,Mu.useCallback)((e,t,r=`accent`)=>n({kind:r===`error`?`error`:`info`,title:e,detail:t,tone:r,holdMs:r===`error`?7e3:3500}),[n]),w=(0,Mu.useCallback)(e=>void U.revealClip(e.slug).catch(S(N(`viewer.errReveal`))),[S]),ee=(0,Mu.useCallback)(e=>void U.openClip(e.slug).catch(S(N(`viewer.errSystemPlayer`))),[S]),te=(0,Mu.useCallback)(e=>void qc(e,n,m),[n]),ne=(0,Mu.useMemo)(()=>({openViewer:_,openTrim:v}),[_,v]);return(0,Nu.jsxs)(Pu.Provider,{value:ne,children:[e,(0,Nu.jsx)(Zl,{clip:h,clips:i,highlights:l,onHighlightsChange:u,onSelect:o,onClose:()=>o(null),onTrim:e=>c(e.slug),trimOpen:s!==null,onRename:x,onShare:te,onReveal:w,onOpenExternally:ee,onDelete:f,notify:C}),(0,Nu.jsx)(Hl,{clip:g,highlights:s&&s===a?l:[],onClose:()=>c(null),onSaved:r,notify:C,onRename:x,onReveal:w,onOpenExternally:ee}),(0,Nu.jsx)(wl,{open:d!==null,title:N(`viewer.confirmDeleteTitle`),onClose:()=>f(null),footer:(0,Nu.jsxs)(Nu.Fragment,{children:[(0,Nu.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>f(null),children:N(`common.keepIt`)}),(0,Nu.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=d;f(null),e&&(o(null),U.deleteClip(e.slug).then(()=>C(N(`viewer.clipDeleted`))).catch(S(N(`viewer.errDelete`))))},children:N(`common.delete`)})]}),children:(0,Nu.jsx)(`p`,{children:N(`viewer.confirmDeleteBody`,{name:d?Oc(d):``})})}),(0,Nu.jsxs)(wl,{open:p!==null,title:N(`viewer.copyLinkTitle`),onClose:()=>m(null),children:[(0,Nu.jsx)(`p`,{children:N(`viewer.copyLinkBody`)}),(0,Nu.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:p??``,rows:3})]})]})}function ju(){let e=(0,Mu.useContext)(Pu);if(!e)throw Error(`usePlayback was called outside the provider`);return e}var Mu,Nu,Pu,Fu=o((()=>{Mu=l(d()),cc(),Jc(),Mc(),Dl(),Wl(),bu(),ku(),Wc(),Ar(),Nu=M(),Pu=(0,Mu.createContext)(null)}));function Iu(e,t,n){let r=r=>{let i=(r+e/60)%6,a=n-n*t*Math.max(0,Math.min(i,4-i,1));return Math.round(a*255)};return`#${[r(5),r(3),r(1)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function Lu(e){let[t,n,r]=[0,2,4].map(t=>parseInt(e.slice(1+t,3+t),16)/255),i=Math.max(t,n,r),a=i-Math.min(t,n,r),o=0;return a&&(o=i===t?(n-r)/a%6:i===n?(r-t)/a+2:(t-n)/a+4,o*=60,o<0&&(o+=360)),{h:o,s:i?a/i:0,v:i}}function Ru({open:e,initial:t,onCancel:n,onConfirm:r}){let[i,a]=(0,Bu.useState)(()=>Lu(t??`#0099ff`)),[o,s]=(0,Bu.useState)(null),c=(0,Bu.useRef)(null),l=(0,Bu.useRef)(null);(0,Bu.useEffect)(()=>{e&&(a(Lu(t??`#0099ff`)),s(null))},[e,t]);let u=(0,Bu.useMemo)(()=>Iu(i.h,i.s,i.v),[i]),d=(0,Bu.useMemo)(()=>zs(u),[u]),f=(0,Bu.useCallback)((e,t)=>n=>{if(n.button!==0)return;n.preventDefault();let r=(n,r)=>{let i=e.current?.getBoundingClientRect();i?.width&&t(Uu((n-i.left)/i.width),Uu((r-i.top)/i.height))};r(n.clientX,n.clientY);let i=e=>r(e.clientX,e.clientY),a=()=>{window.removeEventListener(`pointermove`,i,!0),window.removeEventListener(`pointerup`,a,!0),window.removeEventListener(`pointercancel`,a,!0)};window.addEventListener(`pointermove`,i,!0),window.addEventListener(`pointerup`,a,!0),window.addEventListener(`pointercancel`,a,!0)},[]),p=f(c,(e,t)=>{s(null),a(n=>({...n,s:e,v:1-t}))}),m=f(l,e=>{s(null),a(t=>({...t,h:e*360}))}),h=(e,t)=>{let n=e.shiftKey?.1:.02,r={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,1],ArrowDown:[0,-1]}[e.key];r&&(e.preventDefault(),s(null),a(i=>t===`h`?{...i,h:(i.h+r[0]*(e.shiftKey?30:6)+360)%360}:{...i,s:Uu(i.s+r[0]*n),v:Uu(i.v+r[1]*n)}))},g=Iu(i.h,1,1),_=o??u.toUpperCase();return(0,Vu.jsxs)(wl,{open:e,title:N(`accents.customTitle`),onClose:n,footer:(0,Vu.jsxs)(Vu.Fragment,{children:[(0,Vu.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:n,children:N(`common.cancel`)}),(0,Vu.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(u),children:N(`accents.useThis`)})]}),children:[(0,Vu.jsx)(`p`,{className:`ap-lede`,children:N(`accents.customBody`)}),(0,Vu.jsxs)(`div`,{className:`ap-square`,ref:c,style:{background:g,height:Hu},role:`slider`,tabIndex:0,"aria-label":N(`accents.saturation`),"aria-valuetext":_,onKeyDown:e=>h(e,`sv`),onPointerDown:p,children:[(0,Vu.jsx)(`div`,{className:`ap-square-white`}),(0,Vu.jsx)(`div`,{className:`ap-square-black`}),(0,Vu.jsx)(`div`,{className:`ap-knob`,style:{left:`${i.s*100}%`,top:`${(1-i.v)*100}%`,background:u}})]}),(0,Vu.jsx)(`div`,{className:`ap-hue`,ref:l,role:`slider`,tabIndex:0,"aria-label":N(`accents.hue`),"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Math.round(i.h),onKeyDown:e=>h(e,`h`),onPointerDown:m,children:(0,Vu.jsx)(`div`,{className:`ap-knob ap-hue-knob`,style:{left:`${i.h/360*100}%`,background:g}})}),(0,Vu.jsxs)(`div`,{className:`ap-row`,children:[(0,Vu.jsx)(`span`,{className:`ap-chip`,style:{background:u},"aria-hidden":`true`}),(0,Vu.jsx)(`input`,{className:`ap-hex mono`,value:_,"aria-label":N(`accents.hexLabel`),spellCheck:!1,onChange:e=>{s(e.target.value);let t=Bs(e.target.value);t&&a(Lu(t))},onBlur:()=>s(null)})]}),(0,Vu.jsx)(zu,{ramp:d.ramp}),d.failures.length?(0,Vu.jsx)(`p`,{className:`ap-warning`,children:N(`accents.lowContrast`)}):null]})}function zu({ramp:e}){return(0,Vu.jsx)(`div`,{className:`ap-preview`,style:{background:e.bg},children:(0,Vu.jsxs)(`div`,{className:`ap-preview-card`,style:{background:e.surfaceLow},children:[(0,Vu.jsx)(`span`,{className:`ap-preview-title`,style:{color:e.onSurface},children:N(`accents.previewTitle`)}),(0,Vu.jsx)(`span`,{className:`ap-preview-meta`,style:{color:e.onSurfaceVariant},children:N(`accents.previewMeta`)}),(0,Vu.jsxs)(`div`,{className:`ap-preview-row`,children:[(0,Vu.jsx)(`span`,{className:`ap-preview-btn`,style:{background:e.base,color:e.onBase},children:N(`accents.previewPrimary`)}),(0,Vu.jsx)(`span`,{className:`ap-preview-btn`,style:{background:e.secondaryContainer,color:e.onSecondaryContainer},children:N(`accents.previewQuiet`)}),(0,Vu.jsx)(`span`,{className:`ap-preview-chip`,style:{background:e.primaryContainer,color:e.onPrimaryContainer},children:N(`accents.previewChip`)})]})]})})}var Bu,Vu,Hu,Uu,Wu=o((()=>{Bu=l(d()),Dl(),Js(),Ar(),Vu=M(),Hu=168,Uu=e=>Math.max(0,Math.min(1,e))}));function Gu(){let{state:e,dispatch:t}=Lc(),n=(0,Ku.useCallback)((e,t)=>{try{localStorage.setItem(e,t)}catch(e){console.debug(`Saving the accent failed`,e)}},[]),r=(0,Ku.useCallback)(e=>{U.saveConfig({sharing:{embed_color:e}}).catch(e=>console.debug(`Saving the embed colour failed`,e))},[]),i=(0,Ku.useCallback)(e=>{t({type:`setAccent`,accent:e}),n(`vice-theme`,e),r(La[e].base)},[t,n,r]),a=(0,Ku.useCallback)(e=>{let{ramp:i}=Zs(e);t({type:`setAccent`,accent:`custom`,custom:e}),n(`vice-theme`,`custom`),n(Bc,e),n(`vice-custom-bg`,i.bg),n(`vice-custom-base`,i.base),r(i.base)},[t,n,r]);return{accent:e.accent,seed:e.customAccent,choose:i,chooseCustom:a}}var Ku,qu=o((()=>{Ku=l(d()),cc(),Wc(),Ba(),ic()}));function Ju(e){let t=/^F(\d+)$/.exec(e);if(t)return`KEY_F${t[1]}`;let n=/^Key([A-Z])$/.exec(e);if(n)return`KEY_${n[1]}`;let r=/^Digit(\d)$/.exec(e);return r?`KEY_${r[1]}`:Xu[e]??Zu[e]??null}function Yu(e,t){return[...Qu.filter(([t])=>e[t]).map(([,e])=>e),t].join(`+`)}var Xu,Zu,Qu,$u,ed=o((()=>{Xu={Numpad0:`KEY_KP0`,Numpad1:`KEY_KP1`,Numpad2:`KEY_KP2`,Numpad3:`KEY_KP3`,Numpad4:`KEY_KP4`,Numpad5:`KEY_KP5`,Numpad6:`KEY_KP6`,Numpad7:`KEY_KP7`,Numpad8:`KEY_KP8`,Numpad9:`KEY_KP9`,NumpadAdd:`KEY_KPPLUS`,NumpadSubtract:`KEY_KPMINUS`,NumpadMultiply:`KEY_KPASTERISK`,NumpadDivide:`KEY_KPSLASH`,NumpadEnter:`KEY_KPENTER`,NumpadDecimal:`KEY_KPDOT`},Zu={Insert:`KEY_INSERT`,Delete:`KEY_DELETE`,Home:`KEY_HOME`,End:`KEY_END`,PageUp:`KEY_PAGEUP`,PageDown:`KEY_PAGEDOWN`,ScrollLock:`KEY_SCROLLLOCK`,Pause:`KEY_PAUSE`,PrintScreen:`KEY_SYSRQ`,Tab:`KEY_TAB`,CapsLock:`KEY_CAPSLOCK`,NumLock:`KEY_NUMLOCK`,ArrowUp:`KEY_UP`,ArrowDown:`KEY_DOWN`,ArrowLeft:`KEY_LEFT`,ArrowRight:`KEY_RIGHT`,Backspace:`KEY_BACKSPACE`,Enter:`KEY_ENTER`,Space:`KEY_SPACE`,Minus:`KEY_MINUS`,Equal:`KEY_EQUAL`,BracketLeft:`KEY_LEFTBRACE`,BracketRight:`KEY_RIGHTBRACE`,Backslash:`KEY_BACKSLASH`,Semicolon:`KEY_SEMICOLON`,Quote:`KEY_APOSTROPHE`,Backquote:`KEY_GRAVE`,Comma:`KEY_COMMA`,Period:`KEY_DOT`,Slash:`KEY_SLASH`},Qu=[[`ctrlKey`,`KEY_LEFTCTRL`],[`altKey`,`KEY_LEFTALT`],[`shiftKey`,`KEY_LEFTSHIFT`],[`metaKey`,`KEY_LEFTMETA`]],$u=new Set([`ShiftLeft`,`ShiftRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`MetaLeft`,`MetaRight`])}));function td({value:e,onCapture:t,onUnsupported:n,compact:r}){let[i,a]=(0,nd.useState)(!1);return(0,nd.useEffect)(()=>{if(!i)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),$u.has(e.code))return;if(e.code===`Escape`){a(!1);return}let r=Ju(e.code);if(!r){n();return}a(!1),t(Yu(e,r))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[i,t,n]),(0,rd.jsx)(`button`,{type:`button`,className:`key-capture mono`,"data-listening":i||void 0,"data-compact":r||void 0,onClick:()=>a(!0),children:i?N(`keyCapture.pressKey`):e||N(`keyCapture.setKey`)})}var nd,rd,id=o((()=>{nd=l(d()),ed(),Ar(),rd=M()}));function J({label:e,help:t,note:n,stack:r,children:i}){return(0,fd.jsxs)(`div`,{className:`srow`,"data-stack":r||void 0,children:[(0,fd.jsxs)(`div`,{className:`srow-label`,children:[(0,fd.jsx)(`strong`,{children:e}),t?(0,fd.jsx)(`span`,{children:t}):null,n?.text?(0,fd.jsx)(`span`,{className:`srow-note`,"data-tone":n.tone??`plain`,children:n.text}):null]}),(0,fd.jsx)(`div`,{className:`srow-control`,children:i})]})}function ad({checked:e,onChange:t,disabled:n,label:r}){return(0,fd.jsx)(`button`,{type:`button`,className:`switch`,role:`switch`,"aria-checked":e,"aria-label":r,disabled:n,onClick:()=>t(!e),children:(0,fd.jsx)(`span`,{className:`switch-thumb`})})}function od({value:e,onChange:t,options:n,disabled:r,label:i}){let a=n.length>0&&!Array.isArray(n[0]);return(0,fd.jsxs)(`div`,{className:`select-wrap`,children:[(0,fd.jsx)(`select`,{className:`select`,value:e,"aria-label":i,disabled:r,onChange:e=>t(e.target.value),children:a?n.map(e=>(0,fd.jsx)(`optgroup`,{label:e.group,children:e.options.map(([e,t])=>(0,fd.jsx)(`option`,{value:e,children:t},e))},e.group)):n.map(([e,t])=>(0,fd.jsx)(`option`,{value:e,children:t},e))}),(0,fd.jsx)(pd,{})]})}function sd({value:e,min:t,max:n,step:r,onChange:i,format:a,label:o}){let s=(e-t)/(n-t)*100;return(0,fd.jsxs)(`div`,{className:`slider`,children:[(0,fd.jsx)(`input`,{type:`range`,value:e,min:t,max:n,step:r,"aria-label":o,style:{"--filled":`${s}%`},onChange:e=>i(Number(e.target.value))}),(0,fd.jsx)(`span`,{className:`slider-value mono`,children:a(e)})]})}function cd({value:e,onChange:t,placeholder:n,label:r,mono:i,wide:a,type:o=`text`,min:s,max:c}){return(0,fd.jsx)(`input`,{className:`text-input`,"data-mono":i||void 0,"data-wide":a||void 0,type:o,min:s,max:c,value:e,placeholder:n,"aria-label":r,spellCheck:!1,onChange:e=>t(e.target.value)})}function ld({value:e,onChange:t,placeholder:n,label:r,rows:i=3}){return(0,fd.jsx)(`textarea`,{className:`text-area mono`,rows:i,value:e,placeholder:n,"aria-label":r,spellCheck:!1,onChange:e=>t(e.target.value)})}function ud({fields:e,values:t,onChange:n}){let r=(0,dd.useId)();return(0,fd.jsx)(`div`,{className:`sound-grid`,children:e.map(([e,i,a])=>(0,fd.jsxs)(`label`,{htmlFor:`${r}-${e}`,children:[(0,fd.jsx)(`span`,{children:N(i)}),(0,fd.jsx)(`input`,{id:`${r}-${e}`,className:`text-input`,"data-mono":!0,value:t[e]??``,placeholder:a,spellCheck:!1,onChange:t=>n(e,t.target.value)})]},e))})}var dd,fd,pd,md=o((()=>{dd=l(d()),Ar(),fd=M(),pd=()=>(0,fd.jsx)(`svg`,{className:`select-chevron`,width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,fd.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}));function hd({open:e,onClose:t}){let{state:n,hotkey:r,notify:i,saveConfig:a}=Lc(),{choose:o,chooseCustom:s,seed:c}=Gu(),[l,u]=(0,_d.useState)(1),[d,f]=(0,_d.useState)(!1),p=(0,_d.useRef)(null),m=(0,_d.useRef)(null),h=(0,_d.useRef)([]),g=(0,_d.useRef)(l),_=(0,_d.useCallback)(e=>{let t=Math.min(Math.max(g.current+e,1),yd.length);if(t===g.current)return;g.current=t;let n=p.current,r=m.current;if(!n||!r||typeof r.animate!=`function`){u(t);return}for(let e of h.current)e.cancel();h.current=[];let i=e>0?1:-1,a=n.offsetHeight,o=r.animate([{opacity:1,transform:`none`},{opacity:0,transform:`translateX(${-i*18}px)`}],{duration:140,easing:`cubic-bezier(0.3, 0, 1, 1)`,fill:`forwards`});h.current.push(o),o.onfinish=()=>{(0,vd.flushSync)(()=>u(t));let e=n.offsetHeight;n.style.overflow=`hidden`;let s=n.animate([{height:`${a}px`},{height:`${e}px`}],{duration:280,easing:`cubic-bezier(0.2, 0, 0, 1)`});s.onfinish=s.oncancel=()=>{n.style.overflow=``},o.cancel();let c=r.animate([{opacity:0,transform:`translateX(${i*18}px)`},{opacity:1,transform:`none`}],{duration:240,delay:40,easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`backwards`});h.current=[s,c]}},[]);(0,_d.useLayoutEffect)(()=>{if(!e){for(let e of h.current)e.cancel();h.current=[],g.current=1,p.current&&(p.current.style.overflow=``)}},[e]);let v=c?Zs(c).ramp.base:null,y=n.config?.recording?.clip_duration??20,b=n.config?.recording?.buffer_duration??60,x=n.config?.recording?.clip_duration??20,S=n.config?.hotkeys?.clip??``,C=n.config?.hotkeys?.screenshot??``,w=n.accent,ee=e=>{a(e).catch(e=>i({kind:`error`,title:N(`tutorial.errSave`),detail:e.message,tone:`error`,holdMs:7e3}))},te=()=>{localStorage.setItem(`vice_tutorial_shown`,`1`),U.setAppState({tutorial_seen:!0}).catch(e=>{console.debug(`Recording that the tutorial was seen failed`,e)}),u(1),g.current=1,t()},ne=()=>i({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3});return(0,Y.jsxs)(wl,{open:e,title:N(yd[l-1]),wide:!0,onClose:te,footer:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`tut-dots`,"aria-hidden":`true`,children:yd.map((e,t)=>(0,Y.jsx)(`i`,{"data-active":l===t+1||void 0},e))}),l>1?(0,Y.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>_(-1),children:N(`tutorial.back`)}):null,l_(1),children:N(`tutorial.next`)}):(0,Y.jsx)(`button`,{type:`button`,className:`btn`,onClick:te,children:N(`tutorial.gotIt`)})]}),children:[(0,Y.jsx)(`div`,{className:`tut-pages`,ref:p,children:(0,Y.jsx)(`div`,{className:`tut-page`,ref:m,children:l===1?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.colourBody`)}),(0,Y.jsxs)(`div`,{className:`tut-accents`,children:[za.map(e=>(0,Y.jsx)(`button`,{type:`button`,className:`swatch swatch-lg`,"data-active":w===e||void 0,style:{background:La[e].base},title:N(`accents.${e}`),"aria-label":N(`tutorial.accentLabel`,{name:N(`accents.${e}`)}),"aria-pressed":w===e,onClick:()=>o(e),children:w===e?(0,Y.jsx)(_l,{size:16}):null},e)),(0,Y.jsx)(`button`,{type:`button`,className:`swatch swatch-lg swatch-custom`,"data-active":w===`custom`||void 0,style:v?{background:v}:void 0,title:N(`accents.customTitle`),"aria-label":N(`accents.customTitle`),"aria-pressed":w===`custom`,onClick:()=>f(!0),children:w===`custom`?(0,Y.jsx)(_l,{size:16}):(0,Y.jsx)(xl,{size:16})})]})]}):l===2?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.quickStartBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(gd,{badge:r,title:N(`tutorial.saveLast`,{duration:y}),children:N(`tutorial.saveLastHelp`,{hotkey:r})}),(0,Y.jsx)(gd,{badge:`·${r}·`,title:N(`tutorial.sessionTitle`,{hotkey:r}),children:N(`tutorial.sessionHelp`)})]}),(0,Y.jsxs)(`div`,{className:`tut-keys`,children:[(0,Y.jsxs)(`label`,{className:`tut-key`,children:[(0,Y.jsx)(`span`,{children:N(`tutorial.clipKeyLabel`)}),(0,Y.jsx)(td,{value:S,onUnsupported:ne,onCapture:e=>ee({hotkeys:{clip:e}})})]}),(0,Y.jsxs)(`label`,{className:`tut-key`,children:[(0,Y.jsx)(`span`,{children:N(`tutorial.screenshotKeyLabel`)}),(0,Y.jsx)(td,{value:C,onUnsupported:ne,onCapture:e=>ee({hotkeys:{screenshot:e}})})]})]}),(0,Y.jsx)(`p`,{className:`tut-note`,children:N(`tutorial.screenshotKeyNote`)})]}):l===3?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.bufferBody`)}),(0,Y.jsx)(`div`,{className:`tut-buffer`,children:(0,Y.jsx)(sd,{label:N(`tutorial.bufferLabel`),value:x,min:5,max:300,step:5,onChange:e=>ee({recording:{clip_duration:e,buffer_duration:Math.max(b,e)}}),format:e=>pc(e,!0)})}),(0,Y.jsx)(`p`,{className:`tut-note`,children:N(`tutorial.bufferNote`,{buffer:pc(Math.max(b,x),!0)})})]}):l===4?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.playlistsBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(gd,{badge:N(`tutorial.badgeClip`),title:N(`tutorial.reviewTitle`),children:N(`tutorial.reviewHelp`)}),(0,Y.jsx)(gd,{badge:N(`tutorial.badgeEdit`),title:N(`tutorial.editorTitle`),children:N(`tutorial.editorHelp`)}),(0,Y.jsx)(gd,{badge:N(`tutorial.badgeAuto`),title:N(`tutorial.autoTitle`),children:N(`tutorial.autoHelp`)}),(0,Y.jsx)(gd,{badge:N(`tutorial.badgeNew`),title:N(`tutorial.customTitle`),children:N(`tutorial.customHelp`)})]})]}):l===5?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.shareBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(gd,{badge:N(`tutorial.badgeLink`),title:N(`tutorial.linkTitle`),children:N(`tutorial.linkHelp`)}),(0,Y.jsx)(gd,{badge:N(`tutorial.badgeTunnel`),title:N(`tutorial.tunnelTitle`),children:N(`tutorial.tunnelHelp`)})]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.moreBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(gd,{badge:N(`tutorial.badgeRec`),title:N(`tutorial.recTitle`),children:N(`tutorial.recHelp`)}),(0,Y.jsx)(gd,{badge:N(`tutorial.badgeBg`),title:N(`tutorial.backgroundTitle`),children:N(`tutorial.backgroundHelp`)}),(0,Y.jsx)(gd,{badge:N(`tutorial.badgeSafe`),title:N(`tutorial.safeTitle`),children:N(`tutorial.safeHelp`)})]})]})})}),(0,Y.jsx)(Ru,{open:d,initial:c,onCancel:()=>f(!1),onConfirm:e=>{s(e),f(!1)}})]})}function gd({badge:e,title:t,children:n}){return(0,Y.jsxs)(`div`,{className:`tut-step`,children:[(0,Y.jsx)(`span`,{className:`tut-badge mono`,children:e}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`b`,{children:t}),(0,Y.jsx)(`span`,{children:n})]})]})}var _d,vd,Y,yd,bd=o((()=>{_d=l(d()),vd=h(),cc(),Wc(),Dl(),vc(),Ar(),Cl(),Wu(),qu(),ic(),id(),md(),Ba(),Y=M(),yd=[`tutorial.pickColour`,`tutorial.startClipping`,`tutorial.bufferTitle`,`tutorial.playlistsTitle`,`tutorial.shareTitle`,`tutorial.moreTitle`]}));function xd({forceOpen:e,onClose:t}){let{state:n,notify:r}=Lc(),i=n.update,[a,o]=(0,Sd.useState)(!1),[s,c]=(0,Sd.useState)(null);if((0,Sd.useEffect)(()=>{if(!i?.version)return;let e=!1;if(localStorage.getItem(wd)!==i.version)return U.getAppState().then(t=>{if(!e){if(t.update_dismissed_version===i.version){localStorage.setItem(wd,i.version);return}o(!0)}}).catch(()=>!e&&o(!0)),()=>{e=!0}},[i?.version]),!i?.version)return null;let l=i.install?.command??``,u=a||e,d=()=>{o(!1),t()},f=()=>{localStorage.setItem(wd,i.version),U.setAppState({update_dismissed_version:i.version}).catch(e=>{console.debug(`Recording the dismissed update failed`,e)}),d()},p=async()=>{l&&(await Gc(l)?r({kind:`info`,title:N(`update.commandCopied`),tone:`accent`,holdMs:4e3}):c(l))};return(0,Cd.jsxs)(Cd.Fragment,{children:[(0,Cd.jsxs)(wl,{open:u,title:N(`update.title`,{version:i.version}),onClose:d,footer:(0,Cd.jsxs)(Cd.Fragment,{children:[(0,Cd.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:f,children:N(`update.later`)}),(0,Cd.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>bc(i.url),children:N(`update.releaseNotes`)}),l?(0,Cd.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void p(),children:N(`update.copyCommand`)}):null]}),children:[(0,Cd.jsxs)(`p`,{children:[N(`update.youAreOn`,{version:n.status.version||N(`update.olderRelease`)}),l?N(`update.updateWith`):``]}),l?(0,Cd.jsx)(`code`,{className:`update-cmd mono`,children:l}):null,i.notes?.length?(0,Cd.jsx)(`ul`,{className:`update-notes`,children:i.notes.map(e=>(0,Cd.jsx)(`li`,{children:e},e))}):null]}),(0,Cd.jsxs)(wl,{open:s!==null,title:N(`update.copyTitle`),onClose:()=>c(null),children:[(0,Cd.jsx)(`p`,{children:N(`update.copyByHand`)}),(0,Cd.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:s??``,rows:2})]})]})}var Sd,Cd,wd,Td=o((()=>{Sd=l(d()),cc(),Kc(),Dc(),Wc(),Dl(),Ar(),Cd=M(),wd=`vice_update_dismissed`}));function Ed(e,t){Od(e,t.slug,Oc(t),t.thumb_url)}function Dd(e,t){Od(e,jc(t.slug),kc(t),t.thumb_url??t.image_url)}function Od(e,t,n,r){e.dataTransfer.effectAllowed=`copy`,e.dataTransfer.setData(`text/plain`,t),Ad();let i=document.createElement(`div`);if(i.className=`clip-drag-ghost`,r){let e=document.createElement(`img`);e.src=r,e.alt=``,i.appendChild(e)}let a=document.createElement(`span`);a.className=`clip-drag-ghost-name`,a.textContent=n,i.appendChild(a),document.body.appendChild(i),Pd=i,e.dataTransfer.setDragImage(i,24,20)}function kd(){Ad()}function Ad(){Pd?.remove(),Pd=null}function jd(e,t){let[n,r]=(0,Md.useState)(!1),[i,a]=(0,Md.useState)(!1),o=(0,Md.useRef)(void 0);(0,Md.useEffect)(()=>()=>window.clearTimeout(o.current),[]);let s=(0,Md.useCallback)(()=>{a(!0),window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),Nd)},[]);return{over:n,caught:i,props:{onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`,r(!0)},onDragLeave:()=>r(!1),onDrop:(0,Md.useCallback)(n=>{n.preventDefault(),r(!1);let i=n.dataTransfer.getData(`text/plain`);if(i){if(e.clip_slugs?.includes(i)){s(),t(N(`card.alreadyIn`,{playlist:e.name}),`accent`);return}U.addClipToPlaylist(e.id,i).then(n=>{if(n.ok===!1)throw Error(n.error||N(`card.errAddClip`));s(),t(N(`card.addedTo`,{playlist:e.name}),`accent`)}).catch(e=>t(e.message,`error`))}},[e.id,e.name,e.clip_slugs,s,t])}}}var Md,Nd,Pd,Fd=o((()=>{Md=l(d()),cc(),Mc(),Ar(),Nd=600,Pd=null}));function Id({open:e,editing:t,onClose:n,onSubmit:r}){let[i,a]=(0,Ld.useState)(``),[o,s]=(0,Ld.useState)(``),[c,l]=(0,Ld.useState)(Bd),[u,d]=(0,Ld.useState)(null),[f,p]=(0,Ld.useState)(!1);(0,Ld.useEffect)(()=>{if(e){if(d(null),p(!1),t){a(t.name),s(t.emoji??``);let e=zd.findIndex(([e,n])=>e===t.color1&&n===t.color2);l(e>=0?e:Bd)}else a(``),s(``),l(Bd)}},[e,t]);let[m,h]=zd[c],g=async()=>{let e=i.trim();if(!e){d(N(`playlistModal.nameRequired`));return}p(!0);try{await r({name:e,emoji:o.trim(),color1:m,color2:h})}catch(e){d(e.message)}finally{p(!1)}};return(0,Rd.jsxs)(wl,{open:e,title:N(t?`playlistModal.editTitle`:`playlistModal.newTitle`),onClose:n,footer:(0,Rd.jsxs)(Rd.Fragment,{children:[(0,Rd.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:n,children:N(`common.cancel`)}),(0,Rd.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void g(),disabled:f,children:N(t?`common.save`:`common.create`)})]}),children:[(0,Rd.jsxs)(`div`,{className:`npl-head`,children:[(0,Rd.jsx)(`span`,{className:`npl-preview`,style:{background:`linear-gradient(150deg, ${m}, ${h})`},"aria-hidden":`true`,children:o.trim()}),(0,Rd.jsxs)(`div`,{className:`npl-fields`,children:[(0,Rd.jsxs)(`label`,{className:`field`,children:[(0,Rd.jsx)(`span`,{children:N(`playlistModal.name`)}),(0,Rd.jsx)(`input`,{value:i,autoFocus:!0,onChange:e=>{a(e.target.value),d(null)},onKeyDown:e=>e.key===`Enter`&&void g()})]}),(0,Rd.jsxs)(`label`,{className:`field field-narrow`,children:[(0,Rd.jsx)(`span`,{children:N(`playlistModal.emoji`)}),(0,Rd.jsx)(`input`,{value:o,maxLength:4,placeholder:N(`playlistModal.emojiPlaceholder`),onChange:e=>s(e.target.value)})]})]})]}),(0,Rd.jsx)(`div`,{className:`npl-colors`,role:`radiogroup`,"aria-label":N(`playlistModal.colour`),children:zd.map(([e,t],n)=>(0,Rd.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":n===c,"aria-label":`Colour ${n+1}`,className:`npl-color`,"data-active":n===c||void 0,style:{background:`linear-gradient(150deg, ${e}, ${t})`},onClick:()=>l(n)},e))}),u?(0,Rd.jsx)(`p`,{className:`field-error`,children:u}):null]})}var Ld,Rd,zd,Bd,Vd=o((()=>{Ld=l(d()),Dl(),Ar(),Rd=M(),zd=[[`#ff7a45`,`#9a3412`],[`#f0b429`,`#7c4a03`],[`#34d399`,`#064e3b`],[`#38bdf8`,`#075985`],[`#8b5cf6`,`#3b0a74`],[`#f472b6`,`#831843`],[`#ef4444`,`#7f1d1d`],[`#a3e635`,`#3f6212`]],Bd=4}));function Hd({height:e=20,className:t}){return(0,Ud.jsx)(`span`,{className:t?`wordmark ${t}`:`wordmark`,style:{fontSize:e},children:`VICE`})}var Ud,Wd=o((()=>{Ud=M()}));function Gd({onShowTutorial:e,onShowUpdate:t}){let{state:n,dispatch:r,notify:i,refreshPlaylists:a}=Lc(),[o,s]=(0,qd.useState)(!1),[c,l]=(0,qd.useState)(null),[u,d]=(0,qd.useState)(null),[f,p]=(0,qd.useState)(null),{view:m,currentPlaylistId:h,searchQuery:g,playlists:_,clips:v,images:y,config:b}=n,x=b?.recording?.buffer_duration;return(0,X.jsxs)(`nav`,{className:`sidenav`,"aria-label":N(`nav.main`),children:[(0,X.jsxs)(`div`,{className:`sidenav-brand`,children:[(0,X.jsx)(gl,{size:19,className:`sidenav-mark`}),(0,X.jsx)(Hd,{height:15})]}),(0,X.jsxs)(`div`,{className:`sidenav-search`,children:[(0,X.jsx)(ul,{size:15}),(0,X.jsx)(`input`,{type:`search`,value:g,placeholder:N(`nav.search`),"aria-label":N(`nav.search`),onChange:e=>{r({type:`setSearch`,query:e.target.value}),e.target.value&&m!==`clips`&&r({type:`setView`,view:`clips`})}})]}),(0,X.jsx)(`ul`,{className:`sidenav-list`,children:Jd.map(({view:e,labelKey:t,Icon:n})=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:`nav-item`,"aria-current":m===e&&!(e===`clips`&&h)?`page`:void 0,onClick:()=>r({type:`setView`,view:e,playlistId:e===`clips`?null:void 0}),children:[(0,X.jsx)(n,{size:17}),(0,X.jsx)(`span`,{children:N(t)}),e===`clips`&&v.length>0?(0,X.jsx)(`span`,{className:`nav-count`,children:v.length}):null,e===`images`&&y.length>0?(0,X.jsx)(`span`,{className:`nav-count`,children:y.length}):null]})},e))}),(0,X.jsxs)(`div`,{className:`sidenav-heading`,children:[(0,X.jsx)(`span`,{children:N(`nav.playlists`)}),(0,X.jsx)(`button`,{type:`button`,className:`sidenav-add`,title:N(`nav.newPlaylist`),"aria-label":N(`nav.newPlaylist`),onClick:()=>s(!0),children:(0,X.jsx)(xl,{size:13})})]}),_.length>0?(0,X.jsx)(`ul`,{className:`sidenav-list sidenav-playlists`,children:_.map(e=>(0,X.jsx)(Kd,{playlist:e,active:h===e.id,onOpen:()=>r({type:`setView`,view:`clips`,playlistId:e.id}),onContextMenu:t=>l({playlist:e,at:t}),onDone:(e,t)=>i({kind:t===`error`?`error`:`info`,title:e,tone:t,holdMs:t===`error`?7e3:3e3})},e.id))}):(0,X.jsx)(`p`,{className:`sidenav-empty`,children:N(`nav.dragToStart`)}),(0,X.jsxs)(`div`,{className:`sidenav-foot`,children:[n.update?.version?(0,X.jsxs)(`button`,{type:`button`,className:`update-chip`,onClick:t,title:`Vice ${n.update.version} is available`,children:[(0,X.jsx)(yl,{size:12}),(0,X.jsx)(`span`,{children:N(`nav.update`)})]}):null,(0,X.jsxs)(`div`,{className:`sidenav-foot-row`,children:[x?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sidenav-foot-key`,children:N(`nav.buffer`)}),(0,X.jsx)(`span`,{className:`sidenav-foot-value`,children:pc(x,!0)})]}):null,(0,X.jsx)(`button`,{type:`button`,className:`sidenav-help`,onClick:e,title:N(`nav.quickStart`),"aria-label":N(`nav.quickStart`),children:(0,X.jsx)(vl,{size:14})})]})]}),(0,X.jsx)(Id,{open:o,editing:null,onClose:()=>s(!1),onSubmit:async e=>{let t=await U.createPlaylist(e);if(t.ok===!1)throw Error(t.error||N(`clips.errCreatePlaylist`));await a(),r({type:`setView`,view:`clips`,playlistId:t.playlist.id}),i({kind:`info`,title:`Playlist "${e.name}" created`,tone:`accent`,holdMs:3500}),s(!1)}}),c?(0,X.jsx)(xu,{at:c.at,heading:c.playlist.name,emptyLabel:N(`common.noActions`),onClose:()=>l(null),quick:Yd.map(e=>({id:e,glyph:e,title:N(`nav.useEmoji`,{emoji:e}),active:c.playlist.emoji===e,onSelect:()=>{let t=c.playlist;U.updatePlaylist(t.id,{emoji:e}).then(async e=>{if(e?.ok===!1)throw Error(e.error||N(`nav.errSetEmoji`));await a()}).catch(e=>i({kind:`error`,title:N(`nav.errSetEmoji`),detail:e.message,tone:`error`,holdMs:7e3}))}})),items:[{id:`open`,label:N(`nav.open`),onSelect:()=>r({type:`setView`,view:`clips`,playlistId:c.playlist.id})},{id:`edit`,label:N(`clips.editPlaylist`),onSelect:()=>d(c.playlist)},{id:`sep`,separator:!0},{id:`delete`,label:N(`clips.deletePlaylist`),danger:!0,onSelect:()=>p(c.playlist)}]}):null,(0,X.jsx)(Id,{open:u!==null,editing:u,onClose:()=>d(null),onSubmit:async e=>{if(!u)return;let t=await U.updatePlaylist(u.id,e);if(t.ok===!1)throw Error(t.error||N(`clips.errUpdatePlaylist`));await a(),i({kind:`info`,title:N(`clips.playlistUpdated`),tone:`accent`,holdMs:3e3}),d(null)}}),(0,X.jsx)(wl,{open:f!==null,title:N(`clips.confirmDeleteTitle`),onClose:()=>p(null),footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>p(null),children:N(`common.keepIt`)}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=f;p(null),e&&U.deletePlaylist(e.id).then(async()=>{await a(),h===e.id&&r({type:`setView`,view:`clips`,playlistId:null}),i({kind:`info`,title:N(`clips.playlistDeleted`),tone:`neutral`,holdMs:3e3})}).catch(e=>i({kind:`error`,title:N(`clips.errDeletePlaylist`),detail:e.message,tone:`error`,holdMs:7e3}))},children:N(`common.delete`)})]}),children:(0,X.jsxs)(`p`,{children:[N(`clips.confirmDeleteBody`),f?.kind===`auto`?N(`clips.confirmDeleteAuto`):``]})})]})}function Kd({playlist:e,active:t,onOpen:n,onContextMenu:r,onDone:i}){let a=jd(e,i);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:`nav-item`,"data-drop-over":a.over||void 0,"data-received":a.caught||void 0,"aria-current":t?`page`:void 0,onClick:n,onContextMenu:e=>{e.preventDefault(),r({x:e.clientX,y:e.clientY})},...a.props,children:[(0,X.jsx)(`span`,{className:`playlist-mark`,"aria-hidden":`true`,children:e.emoji||(0,X.jsx)(hl,{size:14})}),(0,X.jsx)(`span`,{className:`nav-label`,children:e.name}),(0,X.jsx)(`span`,{className:`nav-count`,children:e.clip_slugs?.length??0})]})})}var qd,X,Jd,Yd,Xd=o((()=>{qd=l(d()),Wc(),cc(),Fd(),vc(),Vd(),Ar(),wu(),Dl(),Wd(),Cl(),X=M(),Jd=[{view:`home`,labelKey:`nav.home`,Icon:il},{view:`clips`,labelKey:`nav.allClips`,Icon:al},{view:`images`,labelKey:`nav.images`,Icon:ol},{view:`editor`,labelKey:`nav.editor`,Icon:sl},{view:`settings`,labelKey:`nav.settings`,Icon:cl},{view:`about`,labelKey:`nav.about`,Icon:ll}],Yd=[`🎮`,`🕹️`,`🏆`,`⚔️`,`💥`,`🏎️`,`🚀`,`👾`]}));function Zd(){let{state:e}=Lc(),{status:t,event:n,sessionStartedAt:r,ready:i,loadError:a}=e,[o,s]=(0,$d.useState)(0);(0,$d.useEffect)(()=>{if(!r){s(0);return}let e=()=>s(Math.floor((Date.now()-r)/1e3));e();let t=window.setInterval(e,1e3);return()=>window.clearInterval(t)},[r]);let c=e.config?.recording?.buffer_duration??null,l=`neutral`,u,d,f=`idle`;n?(f=n.kind,l=n.tone,u=n.title,d=n.detail):a?(f=`error`,l=`error`,u=N(`island.cannotReach`),d=a):i?t.ready===!1&&t.recorder_error?(f=`error`,l=`error`,u=N(`island.notRecording`),d=N(`island.keepsRetrying`)):t.session_active?(f=`session`,l=`live`,u=N(`island.sessionRecording`),d=pc(o)):t.recording?(f=`buffer`,l=`accent`,u=N(`island.bufferRunning`),d=c?pc(c,!0):void 0):(f=`idle`,u=N(`island.notRecording`)):(f=`idle`,u=N(`island.starting`));let p=(0,$d.useRef)(null),[m,h]=(0,$d.useState)(null);return(0,$d.useLayoutEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let t=e.offsetWidth,n=e.offsetHeight;h(e=>e&&e.w===t&&e.h===n?e:{w:t,h:n})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[u,d,f]),(0,ef.jsx)(`div`,{className:`island`,"data-tone":l,"data-wide":f===`saved`||f===`error`||f===`info`||void 0,style:m?{width:m.w,height:m.h}:void 0,role:`status`,"aria-live":`polite`,children:(0,ef.jsxs)(`div`,{className:`island-content`,ref:p,children:[(0,ef.jsx)(Qd,{kind:f}),(0,ef.jsxs)(`div`,{className:`island-text`,children:[(0,ef.jsx)(`span`,{className:`island-title`,children:u}),d?(0,ef.jsx)(`span`,{className:`island-detail`,children:d}):null]})]},`${f}-${u}`)})}function Qd({kind:e}){return e===`saving`?(0,ef.jsx)(`span`,{className:`island-spinner`,"aria-hidden":`true`}):e===`saved`?(0,ef.jsx)(`span`,{className:`island-badge`,"aria-hidden":`true`,children:(0,ef.jsx)(_l,{size:13})}):e===`error`?(0,ef.jsx)(`span`,{className:`island-glyph`,"aria-hidden":`true`,children:(0,ef.jsx)(dl,{size:17})}):e===`idle`?(0,ef.jsx)(`span`,{className:`island-dot`,"data-idle":`true`,"aria-hidden":`true`}):(0,ef.jsx)(`span`,{className:`island-dot`,"data-live":e===`session`||void 0,"aria-hidden":`true`})}var $d,ef,tf=o((()=>{$d=l(d()),Wc(),vc(),Cl(),Ar(),ef=M()}));function nf(){let{state:e,dispatch:t}=Lc(),{status:n,dismissed:r}=e,i=e=>!r.includes(e),a=e=>()=>t({type:`dismiss`,banner:e}),o=n.ready===!1&&!!n.recorder_error;return(0,af.jsxs)(`div`,{className:`banners`,children:[o?(0,af.jsxs)(rf,{tone:`error`,children:[(0,af.jsx)(`strong`,{children:N(`banners.notRecording`)}),(0,af.jsx)(`span`,{className:`banner-mono`,children:n.recorder_error}),(0,af.jsx)(`span`,{children:N(`banners.notRecordingHelp`)})]}):null,n.cpu_fallback&&i(`cpu`)?(0,af.jsxs)(rf,{tone:`warning`,onDismiss:a(`cpu`),children:[(0,af.jsx)(`strong`,{children:N(`banners.cpuFallback`)}),(0,af.jsx)(`span`,{children:N(`banners.cpuFallbackHelp`)})]}):null,n.codec_fallback&&i(`codec-gpu`)?(0,af.jsxs)(rf,{tone:`warning`,onDismiss:a(`codec-gpu`),children:[(0,af.jsx)(`strong`,{children:N(`banners.codecFallback`)}),(0,af.jsx)(`span`,{children:N(`banners.codecFallbackHelp`)})]}):null,!Tc&&i(`codec-h264`)?(0,af.jsxs)(rf,{tone:`warning`,onDismiss:a(`codec-h264`),children:[(0,af.jsx)(`strong`,{children:N(`banners.cannotPlay`)}),(0,af.jsx)(`span`,{children:N(`banners.cannotPlayHelp`)}),(0,af.jsx)(`span`,{className:`banner-mono`,children:`sudo apt install python3-pyqt6.qtwebengine`}),(0,af.jsx)(`span`,{className:`banner-mono`,children:`sudo dnf install python3-pyqt6-webengine`}),(0,af.jsx)(`span`,{className:`banner-mono`,children:`sudo zypper install python3-qt6-webengine`})]}):null]})}function rf({tone:e,onDismiss:t,children:n}){return(0,af.jsxs)(`div`,{className:`banner`,"data-tone":e,role:e===`error`?`alert`:`status`,children:[(0,af.jsx)(dl,{size:17,className:`banner-icon`}),(0,af.jsx)(`div`,{className:`banner-text`,children:n}),t?(0,af.jsx)(`button`,{type:`button`,className:`banner-close`,onClick:t,"aria-label":N(`common.dismiss`),children:(0,af.jsx)(fl,{size:14})}):null]})}var af,of=o((()=>{Wc(),Dc(),Cl(),Ar(),af=M()}));function sf({children:e}){let{state:t}=Lc(),n=t.view===`editor`||t.view===`settings`,[r,i]=(0,df.useState)(!1),[a,o]=(0,df.useState)(!1),s=(0,df.useRef)(null),[c,l]=(0,df.useState)(`narrow`);return(0,df.useLayoutEffect)(()=>{let e=s.current;if(!e||t.view!==`home`)return;let n=()=>{let t=getComputedStyle(e),n=e.offsetWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);l(n>=hf?`rail`:n>=mf?`wide`:`narrow`)},r=new ResizeObserver(n);return r.observe(e),n(),()=>r.disconnect()},[t.view]),(0,df.useEffect)(()=>{if(localStorage.getItem(`vice_tutorial_shown`))return;let e=!1;return U.getAppState().then(t=>{e||(t.tutorial_seen?localStorage.setItem(`vice_tutorial_shown`,`1`):i(!0))}).catch(()=>!e&&i(!0)),()=>{e=!0}},[]),(0,ff.jsxs)(`div`,{className:`frame`,children:[(0,ff.jsx)(Gd,{onShowTutorial:()=>i(!0),onShowUpdate:()=>o(!0)}),(0,ff.jsx)(cf,{}),(0,ff.jsxs)(`div`,{className:`frame-content`,ref:s,"data-home-wide":t.view===`home`&&c!==`narrow`||void 0,"data-home-rail":t.view===`home`&&c===`rail`||void 0,"data-native":Cc||void 0,children:[(0,ff.jsx)(nf,{}),(0,ff.jsx)(gf.Provider,{value:c,children:e})]}),(0,ff.jsx)(Zd,{}),Cc?(0,ff.jsx)(uf,{hidden:n}):null,(0,ff.jsx)(hd,{open:r,onClose:()=>i(!1)}),(0,ff.jsx)(xd,{forceOpen:a,onClose:()=>o(!1)})]})}function cf(){return(0,ff.jsxs)(`div`,{className:`melt-group`,"aria-hidden":`true`,children:[(0,ff.jsx)(`svg`,{width:`0`,height:`0`,className:`melt-defs`,children:(0,ff.jsx)(`defs`,{children:(0,ff.jsxs)(`linearGradient`,{id:`vice-melt-fade`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,ff.jsx)(`stop`,{offset:`0`,stopColor:`#fff`,stopOpacity:`0`}),(0,ff.jsx)(`stop`,{offset:`.55`,stopColor:`#fff`,stopOpacity:`.05`}),(0,ff.jsx)(`stop`,{offset:`1`,stopColor:`#fff`,stopOpacity:`.10`})]})})}),(0,ff.jsx)(`div`,{className:`melt melt-top`,children:(0,ff.jsx)(lf,{})}),(0,ff.jsx)(`div`,{className:`melt-line`}),(0,ff.jsx)(`div`,{className:`melt melt-bottom`,children:(0,ff.jsx)(lf,{})})]})}function lf(){return(0,ff.jsxs)(`svg`,{width:pf,height:pf,viewBox:`0 0 ${pf} ${pf}`,children:[(0,ff.jsx)(`path`,{d:`M${pf} 0 A${pf} ${pf} 0 0 0 0 ${pf} L0 0 Z`,fill:`var(--vice-nav-tint)`}),(0,ff.jsx)(`path`,{d:`M${pf} 0 A${pf} ${pf} 0 0 0 0 ${pf}`,fill:`none`,stroke:`url(#vice-melt-fade)`,strokeWidth:`1`})]})}function uf({hidden:e}){return(0,ff.jsxs)(`div`,{className:`quit-row`,"data-hidden":e||void 0,"aria-hidden":e,children:[(0,ff.jsxs)(`button`,{type:`button`,className:`quit-btn`,onClick:xc,children:[(0,ff.jsx)(pl,{size:14}),(0,ff.jsx)(`span`,{children:N(`frame.minimize`)})]}),(0,ff.jsxs)(`button`,{type:`button`,className:`quit-btn quit-btn-danger`,onClick:()=>{window.confirm(N(`frame.quitConfirm`))&&Sc()},children:[(0,ff.jsx)(ml,{size:14}),(0,ff.jsx)(`span`,{children:N(`frame.quit`)})]})]})}var df,ff,pf,mf,hf,gf,_f,vf=o((()=>{df=l(d()),cc(),Dc(),bd(),Td(),Cl(),Wc(),Xd(),tf(),of(),Ar(),ff=M(),pf=32,mf=1580,hf=2368,gf=(0,df.createContext)(`narrow`),_f=()=>(0,df.useContext)(gf)}));function yf({children:e}){let[t,n]=(0,xf.useState)(null);return(0,Cf.jsxs)(wf.Provider,{value:t,children:[e,(0,Cf.jsx)(`div`,{ref:n,className:`overlay-root`})]})}function bf({children:e}){let t=(0,xf.useContext)(wf);return t?(0,Sf.createPortal)(e,t):null}var xf,Sf,Cf,wf,Tf=o((()=>{xf=l(d()),Sf=h(),Cf=M(),wf=(0,xf.createContext)(null)}));function Ef(e){let{images:t,onSelect:n,onClose:r}=e,{mounted:i,closing:a}=el(e.image!==null,320),o=(0,Of.useRef)(e.image);e.image&&(o.current=e.image);let s=e.image??o.current,c=(0,Of.useRef)(null),l=(0,Of.useRef)(null),u=(0,Of.useRef)(null),d=(0,Of.useRef)(null),f=(0,Of.useRef)(null),p=(0,Of.useRef)(null),m=(0,Of.useRef)(null),h=(0,Of.useRef)(null),g=(0,Of.useRef)(!1),_=(0,Of.useRef)(null),[v,y]=(0,Of.useState)([]),[b,x]=(0,Of.useState)(Kl),[S,C]=(0,Of.useState)(!1),[w,ee]=(0,Of.useState)(!1),[te,ne]=(0,Of.useState)(!1),[T,re]=(0,Of.useState)(!1),E=s?t.findIndex(e=>e.slug===s.slug):-1,D=e.image!==null,ie=v.length>0,ae=(0,Of.useCallback)(()=>{let e=f.current,t=m.current;if(!e||!t)return;if(!g.current){t.style.width=``,t.style.height=``;return}let n=c.current,r=n?.naturalWidth||s?.width||0,i=n?.naturalHeight||s?.height||0,a=e.getBoundingClientRect();if(!r||!i||!a.width||!a.height)return;let o=Math.min(a.width/r,a.height/i);t.style.width=`${r*o}px`,t.style.height=`${i*o}px`},[s?.width,s?.height]);(0,Of.useLayoutEffect)(()=>{let e=f.current;if(!e||!D)return;let t=new ResizeObserver(ae);return t.observe(e),()=>t.disconnect()},[D,ae]);let O=(0,Of.useCallback)(()=>{let e=_.current;if(_.current=null,e){for(let t of e.animations)t.cancel();for(let t of e.ghosts)t.remove();delete e.scrim.dataset.morphing}},[]);(0,Of.useEffect)(()=>O,[O]);let oe=(0,Of.useCallback)(()=>{let e=d.current,t=f.current,n=m.current,[r,i]=_.current?.ghosts??[],a=r??e,o=i??t;h.current=a&&o&&n?{dialog:a.getBoundingClientRect(),dialogRadius:getComputedStyle(a).borderTopLeftRadius,stage:o.getBoundingClientRect(),stageRadius:getComputedStyle(o).borderTopLeftRadius,frame:n.getBoundingClientRect()}:null,re(e=>!e)},[]);(0,Of.useLayoutEffect)(()=>{let e=h.current;h.current=null,g.current=T,ae(),O();let t=d.current,n=f.current,r=m.current,i=t?.closest(`.scrim`),a=t?.parentElement;if(!e||!t||!n||!r||!i||!a||typeof r.animate!=`function`||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||document.documentElement.classList.contains(`perf-low`))return;let o=r.getBoundingClientRect();if(!e.frame.width||!o.width)return;let s=(e,t)=>({left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,borderRadius:t}),c={scrim:i,ghosts:[],animations:[]},l=(e,t,n,r)=>{let o=document.createElement(`div`);o.className=`image-morph image-morph-${e}`,o.setAttribute(`aria-hidden`,`true`),i.insertBefore(o,a),c.ghosts.push(o);let l=r.getBoundingClientRect();c.animations.push(o.animate([s(t,n),s(l,getComputedStyle(r).borderTopLeftRadius)],{...jf,fill:`forwards`}))};if(l(`surface`,e.dialog,e.dialogRadius,t),l(`stage`,e.stage,e.stageRadius,n),i.dataset.morphing=``,T){let n=t.getBoundingClientRect(),r=(e,t)=>`inset(${e.top-n.top}px ${n.right-e.right}px ${n.bottom-e.bottom}px ${e.left-n.left}px round ${t})`;c.animations.push(t.animate([{clipPath:r(e.dialog,e.dialogRadius)},{clipPath:r(n,getComputedStyle(t).borderTopLeftRadius)}],jf))}c.animations.push(r.animate([{transformOrigin:`0 0`,transform:`translate(${e.frame.left-o.left}px, ${e.frame.top-o.top}px) scale(${e.frame.width/o.width}, ${e.frame.height/o.height})`},{transformOrigin:`0 0`,transform:`none`}],jf));let u=T?.35:.6;for(let e of t.querySelectorAll(`:scope > .viewer-head, :scope > .viewer-bottom`))c.animations.push(e.animate([{opacity:0},{opacity:0,offset:u},{opacity:1}],jf));_.current=c,Promise.all(c.animations.map(e=>e.finished)).then(()=>{_.current===c&&O()},()=>void 0)},[T,ae,O]),(0,Of.useEffect)(()=>{if(!D){O(),re(!1),ne(!1);return}let e=document.activeElement;return p.current?.focus({preventScroll:!0}),()=>{e?.isConnected&&e.focus({preventScroll:!0})}},[D,O]),(0,Of.useEffect)(()=>{y([]),u.current=null},[s?.slug]);let k=(0,Of.useCallback)(e=>{if(E<0)return;let r=t[E+e];r&&n(r.slug)},[t,E,n]),A=(0,Of.useCallback)(()=>{let e=l.current,t=c.current;if(!e||!t)return;let n=t.naturalWidth||s?.width||0,r=t.naturalHeight||s?.height||0;!n||!r||(ae(),(e.width!==n||e.height!==r)&&(e.width=n,e.height=r))},[s?.width,s?.height,ae]);if((0,Of.useLayoutEffect)(A,[A,s?.slug]),(0,Of.useEffect)(()=>{let e=l.current,t=e?.getContext(`2d`);if(!(!e||!t)){t.clearRect(0,0,e.width,e.height),t.lineCap=`round`,t.lineJoin=`round`,t.lineWidth=Af;for(let e of v)Df(t,e)}},[v]),Xc(D&&!e.shortcutsBlocked,(0,Of.useCallback)(()=>{T?oe():r()},[T,r,oe])),(0,Of.useEffect)(()=>{if(!D||a||e.shortcutsBlocked)return;let t=e=>{if(e.defaultPrevented)return;let t=e.target instanceof HTMLElement?e.target:null;if(e.key===`Tab`){let n=d.current?.querySelectorAll(`button:not(:disabled), input, textarea, [tabindex="0"]`),r=n?.[0],i=n?.[n.length-1];e.shiftKey&&t===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&t===i&&(e.preventDefault(),r?.focus());return}if(!(t?.closest(`input, textarea, select`)||t?.isContentEditable||e.repeat)){if(e.key.toLowerCase()===`z`&&(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey){e.preventDefault(),y(e=>e.slice(0,-1));return}e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||(e.key===`ArrowLeft`?(e.preventDefault(),k(-1)):e.key===`ArrowRight`?(e.preventDefault(),k(1)):e.key.toLowerCase()===`f`&&(e.preventDefault(),oe()))}};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[D,a,e.shortcutsBlocked,k,oe]),!i||!s)return null;let se=e=>{let t=l.current;if(!t)return null;let n=t.getBoundingClientRect();return!n.width||!n.height?null:{x:(e.clientX-n.left)/n.width*t.width,y:(e.clientY-n.top)/n.height*t.height}},ce=e=>{if(!S||e.button!==0)return;let t=se(e);if(!t)return;e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){console.debug(`Capturing the pointer failed`,e)}let n={color:b,points:[t]};u.current=n,y(e=>[...e,n])},j=e=>{let t=u.current;if(!t)return;let n=se(e);n&&(t.points.push(n),y(e=>[...e]))},le=()=>{u.current=null},ue=async()=>{let t=l.current,n=c.current;if(!(!t||!n||!ie)){ee(!0);try{let r=document.createElement(`canvas`);r.width=t.width,r.height=t.height;let i=r.getContext(`2d`);if(!i)throw Error(N(`images.errCanvas`));i.drawImage(n,0,0,r.width,r.height),i.drawImage(t,0,0);let a=await new Promise(e=>r.toBlob(e,`image/png`));if(!a)throw Error(N(`images.errCanvas`));await U.annotateImage(s.slug,a),y([]),e.notify(N(`images.saved`),void 0,`accent`)}catch(t){e.notify(N(`images.errSave`),t.message,`error`)}finally{ee(!1)}}},de=[s.width?`${s.width}x${s.height}`:``,s.size?hc(s.size):``].filter(Boolean).join(` · `);return(0,kf.jsx)(`div`,{className:`scrim viewer-scrim image-viewer-scrim`,"data-expanded":T||void 0,"data-closing":a||void 0,onMouseDown:e=>e.target===e.currentTarget&&r(),children:(0,kf.jsx)(`div`,{className:`viewer-stack`,children:(0,kf.jsxs)(`div`,{className:`modal viewer image-viewer`,ref:d,"data-closing":a||void 0,role:`dialog`,"aria-modal":`true`,"aria-label":kc(s),children:[(0,kf.jsxs)(`header`,{className:`viewer-head`,children:[(0,kf.jsxs)(`div`,{className:`viewer-heading`,children:[te?(0,kf.jsx)(Rl,{className:`viewer-rename`,label:N(`card.nameLabel`),initial:kc(s),onCancel:()=>ne(!1),onSubmit:t=>{ne(!1),e.onRename(s,t)}}):(0,kf.jsx)(`h2`,{title:N(`viewer.doubleClickRename`),onDoubleClick:()=>ne(!0),children:kc(s)}),(0,kf.jsx)(`p`,{className:`mono`,children:de})]}),t.length>1?(0,kf.jsxs)(`span`,{className:`viewer-count mono`,children:[E+1,` / `,t.length]}):null,(0,kf.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>k(-1),disabled:E<=0,"aria-label":N(`images.prev`),children:(0,kf.jsx)(Mf,{dir:`left`})}),(0,kf.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>k(1),disabled:E<0||E>=t.length-1,"aria-label":N(`images.next`),children:(0,kf.jsx)(Mf,{dir:`right`})}),(0,kf.jsx)(`button`,{ref:p,type:`button`,className:`viewer-nav image-expand`,onClick:oe,"aria-label":N(T?`viewer.shrink`:`viewer.expand`),title:N(T?`viewer.shrinkHint`:`viewer.expandHint`),"aria-pressed":T,children:(0,kf.jsx)(Sl,{collapse:T})}),(0,kf.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:r,"aria-label":N(`common.close`),children:(0,kf.jsx)(fl,{size:15})})]}),(0,kf.jsx)(`div`,{className:`image-stage`,ref:f,onDoubleClick:()=>{S||oe()},children:(0,kf.jsxs)(`div`,{className:`image-frame`,ref:m,children:[(0,kf.jsx)(`img`,{ref:c,className:`image-full`,src:s.image_url,alt:kc(s),draggable:!1,onLoad:A}),(0,kf.jsx)(`canvas`,{ref:l,className:`image-ink`,"data-pen":S||void 0,onPointerDown:ce,onPointerMove:j,onPointerUp:le,onPointerCancel:le})]})}),(0,kf.jsxs)(`div`,{className:`viewer-bottom`,children:[(0,kf.jsxs)(`div`,{className:`image-tools`,children:[(0,kf.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,"aria-pressed":S,"data-active":S||void 0,onClick:()=>C(e=>!e),children:N(S?`images.penOn`:`images.pen`)}),(0,kf.jsx)(`div`,{className:`image-swatches`,role:`group`,"aria-label":N(`images.penColour`),children:Gl.map(e=>(0,kf.jsx)(`button`,{type:`button`,className:`hl-picker-dot`,"data-active":e===b||void 0,style:{background:e},title:e,"aria-label":N(`viewer.useColour`,{color:e}),onClick:()=>{x(e),C(!0)}},e))}),(0,kf.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!ie,onClick:()=>y(e=>e.slice(0,-1)),children:N(`images.undo`)}),(0,kf.jsx)(`button`,{type:`button`,className:`btn btn-sm`,disabled:!ie||w,onClick:()=>void ue(),children:N(w?`images.saving`:`images.saveDrawing`)})]}),(0,kf.jsxs)(`footer`,{className:`viewer-foot`,children:[(0,kf.jsx)(`span`,{className:`viewer-shortcuts mono`,children:N(`images.shortcuts`)}),(0,kf.jsxs)(`div`,{className:`viewer-foot-btns`,children:[(0,kf.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onCopy(s),children:N(`images.copy`)}),(0,kf.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onReveal(s),children:N(`viewer.reveal`)}),(0,kf.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>e.onDelete(s),children:N(`viewer.delete`)})]})]})]})]})})})}function Df(e,t){let{points:n}=t;if(n.length!==0){if(e.strokeStyle=t.color,n.length===1){e.fillStyle=t.color,e.beginPath(),e.arc(n[0].x,n[0].y,Af/2,0,Math.PI*2),e.fill();return}e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let t=1;t{Of=l(d()),cc(),$c(),nl(),vc(),ql(),Mc(),Cl(),Vl(),Ar(),kf=M(),Af=6,jf={duration:280,easing:`cubic-bezier(0.2, 0, 0, 1)`},Mf=({dir:e})=>(0,kf.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,kf.jsx)(`path`,{d:e===`left`?`m15 6-6 6 6 6`:`m9 6 6 6-6 6`})})}));function Pf(e){let{state:t,visibleImages:n,notify:r,refreshImages:i,refreshPlaylists:a}=Lc(),{playlists:o}=t,[s,c]=(0,Ff.useState)(null),[l,u]=(0,Ff.useState)(null),[d,f]=(0,Ff.useState)(null),[p,m]=(0,Ff.useState)(null),[h,g]=(0,Ff.useState)(null),[_,v]=(0,Ff.useState)(null),y=(0,Ff.useMemo)(()=>h===null?n:h.map(e=>t.images.find(t=>t.slug===e)).filter(e=>!!e),[h,n,t.images]),b=y.find(e=>e.slug===s)??(_?.slug===s?_:null),x=(0,Ff.useCallback)(t=>{g(e?e.map(e=>e.slug):null),c(t.slug)},[e]),S=(0,Ff.useCallback)(()=>c(null),[]),C=(0,Ff.useCallback)(e=>t=>r({kind:`error`,title:e,detail:t.message,tone:`error`,holdMs:7e3}),[r]),w=(0,Ff.useCallback)((e,t,n=`accent`)=>r({kind:n===`error`?`error`:`info`,title:e,detail:t,tone:n,holdMs:n===`error`?7e3:3500}),[r]),ee=(0,Ff.useCallback)(e=>void U.copyImage(e.slug).then(e=>{if(e?.ok===!1)throw Error(e.error||N(`images.errCopy`));w(N(`images.copied`))}).catch(C(N(`images.errCopy`))),[C,w]),te=(0,Ff.useCallback)(e=>void U.revealImage(e.slug).catch(C(N(`viewer.errReveal`))),[C]),ne=(0,Ff.useCallback)(e=>void U.openImage(e.slug).catch(C(N(`images.errOpen`))),[C]),T=(0,Ff.useCallback)(async(e,t)=>{v(e);try{let n=await U.renameImage(e.slug,t);n?.slug&&(v(n),c(t=>t===e.slug?n.slug:t),g(t=>t?.map(t=>t===e.slug?n.slug:t)??null),kc(n)!==t&&r({kind:`info`,title:N(`card.savedAs`,{name:kc(n)}),tone:`neutral`,holdMs:4e3})),await i()}catch(e){r({kind:`error`,title:N(`card.renameFailed`),detail:e.message,tone:`error`,holdMs:7e3})}finally{v(null)}},[r,i]),re=(0,Ff.useMemo)(()=>({onOpen:x,onCopy:ee,onReveal:te,onDelete:f,onRename:T,onContextMenu:(e,t)=>u({image:e,at:t}),renamingSlug:p,onRenameDone:()=>m(null)}),[x,ee,te,T,p]),E=l?.image;return{actions:re,overlays:(0,If.jsxs)(If.Fragment,{children:[(0,If.jsx)(Ef,{image:b,images:y,onSelect:c,onClose:S,shortcutsBlocked:d!==null||l!==null,onRename:T,onCopy:ee,onReveal:te,onDelete:f,notify:w}),l&&E?(0,If.jsx)(xu,{at:l.at,heading:kc(E),emptyLabel:N(`common.noActions`),onClose:()=>u(null),items:[{id:`open`,label:N(`images.open`),onSelect:()=>x(E)},{id:`rename`,label:N(`card.rename`),onSelect:()=>m(E.slug)},{id:`copy`,label:N(`images.copy`),onSelect:()=>ee(E)},{id:`reveal`,label:N(`card.reveal`),onSelect:()=>te(E)},{id:`open-external`,label:N(`images.openExternally`),onSelect:()=>ne(E)},...o.length?[{id:`sep-playlists`,separator:!0}]:[],...o.map(e=>{let t=jc(E.slug),n=e.clip_slugs?.includes(t)??!1;return{id:e.id,label:N(n?`card.removeFrom`:`card.addTo`,{playlist:e.name}),mark:n?`✓`:e.emoji??void 0,onSelect:()=>{(n?U.removeClipFromPlaylist(e.id,t):U.addClipToPlaylist(e.id,t)).then(async t=>{if(t?.ok===!1)throw Error(t.error||N(`card.playlistUnchanged`));await a(),w(N(n?`card.removedFrom`:`card.addedTo`,{playlist:e.name}))}).catch(C(N(`clips.errUpdatePlaylist`)))}}}),{id:`sep-delete`,separator:!0},{id:`delete`,label:N(`images.deleteImage`),danger:!0,onSelect:()=>f(E)}]}):null,(0,If.jsx)(wl,{open:d!==null,title:N(`images.confirmDeleteTitle`),onClose:()=>f(null),footer:(0,If.jsxs)(If.Fragment,{children:[(0,If.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>f(null),children:N(`common.keepIt`)}),(0,If.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=d;f(null),e&&(c(t=>t===e.slug?null:t),U.deleteImage(e.slug).then(()=>w(N(`images.deleted`))).catch(C(N(`images.errDelete`))))},children:N(`common.delete`)})]}),children:(0,If.jsx)(`p`,{children:N(`images.confirmDeleteBody`,{name:d?kc(d):``})})})]})}}var Ff,If,Lf=o((()=>{Ff=l(d()),cc(),Mc(),wu(),Nf(),Dl(),Wc(),Ar(),If=M()}));function Rf({image:e,isNew:t,actions:n={},draggable:r}){let[i,a]=(0,Bf.useState)(!1),[o,s]=(0,Bf.useState)(null),c=i||n.renamingSlug===e.slug,l=()=>{a(!1),n.onRenameDone?.()},u=[e.created_at?new Date(e.created_at).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,e.width?`${e.width}x${e.height}`:``,e.size?hc(e.size):``].filter(Boolean).join(` · `);return(0,Vf.jsxs)(`article`,{className:`clip-card image-card`,"data-renaming":c||void 0,draggable:r&&!c,onDragStart:t=>Dd(t,e),onDragEnd:kd,onContextMenu:t=>{n.onContextMenu&&(t.preventDefault(),n.onContextMenu(e,{x:t.clientX,y:t.clientY}))},onClick:t=>{c||t.target.closest(`button, a, input, textarea, .clip-name`)||n.onOpen?.(e)},children:[(0,Vf.jsxs)(`button`,{type:`button`,className:`clip-thumb`,onClick:()=>n.onOpen?.(e),"aria-label":N(`images.openTitle`,{name:kc(e)}),children:[e.thumb_url&&o!==e.thumb_url?(0,Vf.jsx)(`img`,{src:e.thumb_url,loading:`lazy`,alt:``,draggable:!1,onError:()=>s(e.thumb_url??null)}):(0,Vf.jsx)(`span`,{className:`clip-thumb-empty`,"aria-hidden":`true`,children:(0,Vf.jsx)(ol,{size:32})}),(0,Vf.jsx)(`span`,{className:`clip-badges`,children:t?(0,Vf.jsx)(`span`,{className:`clip-badge clip-badge-new`,children:N(`common.new`)}):null})]}),(0,Vf.jsxs)(`div`,{className:`clip-body`,children:[c?(0,Vf.jsx)(Rl,{className:`clip-rename`,label:N(`card.nameLabel`),initial:kc(e),onCancel:l,onSubmit:async t=>{l(),await n.onRename?.(e,t)}}):(0,Vf.jsx)(`h3`,{className:`clip-name`,title:N(`card.renameHint`,{name:kc(e)}),onDoubleClick:()=>n.onRename&&a(!0),children:kc(e)}),(0,Vf.jsx)(`p`,{className:`clip-meta`,children:u}),(0,Vf.jsx)(`span`,{className:`clip-game`,"data-untagged":!e.game||void 0,children:e.game||N(`common.untagged`)}),Hf(n)?(0,Vf.jsxs)(`div`,{className:`clip-actions`,children:[n.onCopy?(0,Vf.jsx)(zf,{label:N(`images.copy`),onClick:()=>n.onCopy?.(e),children:(0,Vf.jsx)(Wf,{})}):null,n.onReveal?(0,Vf.jsx)(zf,{label:N(`card.reveal`),onClick:()=>n.onReveal?.(e),children:(0,Vf.jsx)(Gf,{})}):null,n.onDelete?(0,Vf.jsx)(zf,{label:N(`card.delete`),danger:!0,onClick:()=>n.onDelete?.(e),children:(0,Vf.jsx)(Kf,{})}):null]}):null]})]})}function zf({label:e,onClick:t,danger:n,children:r}){return(0,Vf.jsx)(`button`,{type:`button`,className:`clip-icon-btn`,"data-danger":n||void 0,title:e,"aria-label":e,onClick:e=>{e.stopPropagation(),t()},children:r})}var Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf=o((()=>{Bf=l(d()),Fd(),vc(),Mc(),Ar(),Vl(),Cl(),Vf=M(),Hf=e=>!!(e.onCopy||e.onReveal||e.onDelete),Uf={width:13,height:13,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},Wf=()=>(0,Vf.jsxs)(`svg`,{...Uf,children:[(0,Vf.jsx)(`rect`,{x:`8`,y:`8`,width:`13`,height:`13`,rx:`2`}),(0,Vf.jsx)(`path`,{d:`M4 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2`})]}),Gf=()=>(0,Vf.jsx)(`svg`,{...Uf,children:(0,Vf.jsx)(`path`,{d:`M3 7h6l2 2h10v10H3z`})}),Kf=()=>(0,Vf.jsx)(`svg`,{...Uf,children:(0,Vf.jsx)(`path`,{d:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`})})}));function Jf(e,t,n,r){let i=(e-n*(r-1))/r,a=i/ep,o=Math.max(0,Math.floor((t+n)/(a+n))),s={rows:o,cardHeight:a,off:1/0};for(let e of[o,o+1]){if(e<1)continue;let r=(t-n*(e-1))/e,a=i/r,o=Math.abs(Math.log(a/ep));a>=tp&&a<=np&&o{let e=n.current;if(!e)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect(),r=parseFloat(getComputedStyle(e).columnGap)||0,a=Math.max(1,Math.min($f,Math.floor((t+r)/(Qf+r)))),{rows:o,cardHeight:s}=t>0?Jf(t,n,r,a):{rows:0,cardHeight:0};i(e=>e.columns===a&&e.rows===o&&e.height===n&&e.cardHeight===s&&e.gap===r?e:{columns:a,rows:o,height:n,cardHeight:s,gap:r})},r=new ResizeObserver(t);return r.observe(e),t(),()=>r.disconnect()},[]);let a=r.columns*r.rows,o=(0,Xf.useMemo)(()=>e.images.slice(0,a),[e.images,a]),{actions:s,overlays:c}=Pf(o),l=Math.ceil(o.length/r.columns),u=l{t({type:`setSearch`,query:``}),t({type:`setView`,view:`images`,playlistId:null})},children:N(`home.seeAll`)})]}),(0,Zf.jsxs)(`div`,{className:`home-images-grid`,ref:n,style:{gridTemplateColumns:`repeat(${r.columns}, minmax(0, 1fr))`,gridTemplateRows:r.rows?`repeat(${r.rows}, ${r.cardHeight}px)`:`minmax(0, 1fr)`},children:[o.map(e=>(0,Zf.jsx)(Rf,{image:e,draggable:!0,actions:s},e.slug)),d?(0,Zf.jsxs)(`div`,{className:`home-images-placeholder`,"data-compact":r.height<240||!u||void 0,style:{gridColumn:u?`1 / -1`:`${o.length%r.columns+1} / -1`,gridRow:u?`${l+1} / -1`:void 0,height:u?Math.max(0,r.height-l*(r.cardHeight+r.gap)):void 0},children:[(0,Zf.jsxs)(`svg`,{className:`home-images-art`,viewBox:`0 0 280 180`,"aria-hidden":`true`,children:[(0,Zf.jsx)(`rect`,{className:`image-art-capsule`,x:`26`,y:`85`,width:`230`,height:`72`,rx:`36`,transform:`rotate(-12 140 120)`}),(0,Zf.jsx)(`path`,{className:`image-art-burst`,d:`m225 17 12 12 17-1 1 17 12 12-12 12-1 17-17-1-12 12-12-12-17 1-1-17-12-12 12-12 1-17 17 1z`}),(0,Zf.jsxs)(`g`,{transform:`rotate(8 135 90)`,children:[(0,Zf.jsx)(`rect`,{className:`image-art-picture`,x:`63`,y:`26`,width:`146`,height:`120`,rx:`32`}),(0,Zf.jsx)(`circle`,{className:`image-art-ink`,cx:`104`,cy:`65`,r:`12`}),(0,Zf.jsx)(`path`,{className:`image-art-ink`,d:`m82 119 32-35q5-5 10 0l17 19 17-15q5-5 10 1l24 30z`})]})]}),(0,Zf.jsxs)(`div`,{children:[(0,Zf.jsx)(`h3`,{children:N(e.images.length?`images.roomForMore`:`images.captureMoment`)}),(0,Zf.jsx)(`p`,{children:f?N(`images.captureHint`,{hotkey:gc(f)}):N(`images.captureNoKey`)}),f?null:(0,Zf.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>t({type:`setView`,view:`settings`}),children:N(`home.settings`)})]})]}):null]})]}),(0,Zf.jsx)(bf,{children:c})]})}var Xf,Zf,Qf,$f,ep,tp,np,rp=o((()=>{Xf=l(d()),vc(),Ar(),Lf(),Wc(),qf(),Tf(),Zf=M(),Qf=230,$f=4,ep=16/9,tp=1.45,np=2.2}));function ip({clip:e,isNew:t,actions:n={},draggable:r}){let i=(0,op.useRef)(null),a=(0,op.useRef)(void 0),[o,s]=(0,op.useState)(!1),[c,l]=(0,op.useState)(!1),u=c||n.renamingSlug===e.slug,d=()=>{l(!1),n.onRenameDone?.()},f=e.unreadable,p=Tc&&!f&&!o&&!!e.thumb_url;(0,op.useEffect)(()=>()=>window.clearTimeout(a.current),[]);let m=()=>{let t=i.current;!t||!p||(window.clearTimeout(a.current),t.getAttribute(`src`)||(t.src=kl(e)),t.play().catch(()=>s(!0)))},h=()=>{let e=i.current;e&&(e.pause(),window.clearTimeout(a.current),a.current=window.setTimeout(()=>{if(e.getAttribute(`src`)){e.removeAttribute(`src`);try{e.load()}catch(e){console.debug(`Releasing the preview buffer failed`,e)}}},cp))},g=[e.created_at?new Date(e.created_at).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,!f&&e.width?`${e.width}x${e.height}`:``,e.size?hc(e.size):``,e.views?N(`card.views`,{count:e.views}):``].filter(Boolean).join(` · `);return(0,sp.jsxs)(`article`,{className:`clip-card`,"data-broken":f||void 0,draggable:r&&!u,onDragStart:t=>Ed(t,e),onDragEnd:kd,onContextMenu:t=>{n.onContextMenu&&(t.preventDefault(),n.onContextMenu(e,{x:t.clientX,y:t.clientY}))},onClick:t=>{u||t.target.closest(`button, a, input, textarea, .clip-name`)||n.onOpen?.(e)},children:[(0,sp.jsxs)(`button`,{type:`button`,className:`clip-thumb`,onClick:()=>n.onOpen?.(e),onPointerEnter:m,onPointerLeave:h,"aria-label":N(`card.openTitle`,{name:Oc(e)}),children:[e.thumb_url?(0,sp.jsx)(`img`,{src:e.thumb_url,loading:`lazy`,alt:``,draggable:!1}):(0,sp.jsx)(`span`,{className:`clip-thumb-empty`,"aria-hidden":`true`}),p?(0,sp.jsx)(`video`,{ref:i,className:`clip-preview`,muted:!0,loop:!0,playsInline:!0,preload:`none`,onError:()=>s(!0)}):null,(0,sp.jsxs)(`span`,{className:`clip-badges`,children:[f?(0,sp.jsx)(`span`,{className:`clip-badge clip-badge-broken`,title:e.unreadable_reason,children:N(`card.unreadable`)}):null,t?(0,sp.jsx)(`span`,{className:`clip-badge clip-badge-new`,children:N(`common.new`)}):null]}),e.duration&&!f?(0,sp.jsx)(`span`,{className:`clip-duration`,children:pc(Math.round(e.duration),!0)}):null]}),(0,sp.jsxs)(`div`,{className:`clip-body`,children:[u?(0,sp.jsx)(Rl,{className:`clip-rename`,label:N(`card.nameLabel`),initial:Oc(e),onCancel:d,onSubmit:async t=>{d(),await n.onRename?.(e,t)}}):(0,sp.jsx)(`h3`,{className:`clip-name`,title:N(`card.renameHint`,{name:Oc(e)}),onDoubleClick:()=>n.onRename&&l(!0),children:Oc(e)}),(0,sp.jsx)(`p`,{className:`clip-meta`,children:g}),f?(0,sp.jsx)(`p`,{className:`clip-broken-note`,children:N(`card.unreadableNote`,{reason:e.unreadable_reason||N(`card.unreadableFallback`)})}):null,(0,sp.jsx)(`span`,{className:`clip-game`,"data-untagged":!e.game||void 0,children:e.game||N(`common.untagged`)}),lp(n)?(0,sp.jsxs)(`div`,{className:`clip-actions`,children:[n.onTrim?(0,sp.jsx)(ap,{label:N(`card.trim`),onClick:()=>n.onTrim?.(e),children:(0,sp.jsx)(dp,{})}):null,n.onCopyFile?(0,sp.jsx)(ap,{label:N(`card.copyVideo`),onClick:()=>n.onCopyFile?.(e),children:(0,sp.jsx)(fp,{})}):null,n.onCopyLink?(0,sp.jsx)(ap,{label:e.share_url?N(`card.copyShareLink`):N(`card.noShareLink`),disabled:!e.share_url,onClick:()=>n.onCopyLink?.(e),children:(0,sp.jsx)(pp,{})}):null,n.onReveal?(0,sp.jsx)(ap,{label:N(`card.reveal`),onClick:()=>n.onReveal?.(e),children:(0,sp.jsx)(mp,{})}):null,n.onDelete?(0,sp.jsx)(ap,{label:N(`card.delete`),danger:!0,onClick:()=>n.onDelete?.(e),children:(0,sp.jsx)(hp,{})}):null]}):null]})]})}function ap({label:e,onClick:t,danger:n,disabled:r,children:i}){return(0,sp.jsx)(`button`,{type:`button`,className:`clip-icon-btn`,"data-danger":n||void 0,title:e,"aria-label":e,disabled:r,onClick:e=>{e.stopPropagation(),t()},children:i})}var op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp=o((()=>{op=l(d()),Fd(),vc(),Mc(),Dc(),Ll(),Ar(),Vl(),sp=M(),cp=4e3,lp=e=>!!(e.onTrim||e.onCopyFile||e.onCopyLink||e.onReveal||e.onDelete),up={width:13,height:13,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},dp=()=>(0,sp.jsxs)(`svg`,{...up,children:[(0,sp.jsx)(`circle`,{cx:`6`,cy:`7`,r:`3`}),(0,sp.jsx)(`circle`,{cx:`6`,cy:`17`,r:`3`}),(0,sp.jsx)(`path`,{d:`M20 5 9 15M20 19 9 9`})]}),fp=()=>(0,sp.jsxs)(`svg`,{...up,children:[(0,sp.jsx)(`rect`,{x:`8`,y:`8`,width:`13`,height:`13`,rx:`2`}),(0,sp.jsx)(`path`,{d:`M4 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2`})]}),pp=()=>(0,sp.jsxs)(`svg`,{...up,children:[(0,sp.jsx)(`path`,{d:`M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1`}),(0,sp.jsx)(`path`,{d:`M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1`})]}),mp=()=>(0,sp.jsx)(`svg`,{...up,children:(0,sp.jsx)(`path`,{d:`M3 7h6l2 2h10v10H3z`})}),hp=()=>(0,sp.jsx)(`svg`,{...up,children:(0,sp.jsx)(`path`,{d:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`})})}));function _p({label:e,detail:t,icon:n,on:r,busy:i,onToggle:a}){return(0,yp.jsxs)(`button`,{type:`button`,className:`tile`,"aria-pressed":r,"aria-busy":i||void 0,disabled:i,onClick:a,children:[(0,yp.jsx)(`span`,{className:`tile-badge`,"aria-hidden":`true`,children:n}),(0,yp.jsxs)(`span`,{className:`tile-text`,children:[(0,yp.jsx)(`b`,{children:e}),t?(0,yp.jsx)(`span`,{children:t}):null]})]})}function vp({label:e,icon:t,onClick:n,disabled:r}){return(0,yp.jsxs)(`button`,{type:`button`,className:`tile tile-action`,onClick:n,disabled:r,title:e,"aria-label":e,children:[(0,yp.jsx)(`span`,{className:`tile-badge`,"aria-hidden":`true`,children:t}),(0,yp.jsx)(`span`,{className:`tile-action-label`,children:e})]})}var yp,bp=o((()=>{yp=M()}));function xp(e){try{return new URL(e).hostname.replace(/\.trycloudflare\.com$/,``)}catch{return e}}function Sp(){let e=new Date().getHours();return N(e<12?`home.greetingMorning`:e<18?`home.greetingAfternoon`:`home.greetingEvening`)}function Cp(){let{state:e,dispatch:t,hotkey:n,saveConfig:r,notify:i}=Lc(),{clips:a,playlists:o,config:s,tunnelUrl:c,recentNew:l,status:u}=e,{actions:d,overlays:f}=Eu(),p=_f(),[m,h]=(0,Dp.useState)(null),[g,_]=(0,Dp.useState)(null),[v,y]=(0,Dp.useState)(!1),[b,x]=(0,Dp.useState)(!1),S=s?.recording?.clip_duration??20,C=s?.recording?.capture_audio!==!1,w=!!s?.recording?.capture_microphone,ee=!!s?.sharing?.cloudflare_tunnel,te=(0,Dp.useMemo)(()=>a.slice(0,Op),[a]),ne=(0,Dp.useMemo)(()=>a.filter(e=>(e.views??0)>0).sort((e,t)=>(t.views??0)-(e.views??0)).slice(0,Op),[a]),T=!w&&C&&(s?.recording?.wf_microphone_strategy??`prompt`)===`prompt`&&(s?.recording?.backend===`wf-recorder`||u.backend===`wf-recorder`),re=async(e,t,n,a)=>{h(e);try{let e=await r(t);e.applied===!1&&e.warning?i({kind:`error`,title:N(`home.savedNotApplied`),detail:e.warning,tone:`error`,holdMs:8e3}):n(e),e.restart_required&&y(!0)}catch(e){i({kind:`error`,title:a,detail:e.message,tone:`error`,holdMs:7e3})}finally{h(null)}},E=(e,t)=>re(`mic`,{recording:{capture_microphone:e,...t?{wf_microphone_strategy:t}:{}}},()=>i({kind:`info`,title:N(e?`home.micOn`:`home.micOff`),detail:N(e?`home.micOnDetail`:`home.micOffDetail`),tone:`accent`,holdMs:3e3}),N(`home.errMic`)),D=async()=>{if(!c){i({kind:`error`,title:N(`home.enablePublicLinkFirst`),tone:`error`,holdMs:4e3});return}await Gc(c)?i({kind:`info`,title:N(`home.publicLinkCopied`),tone:`accent`,holdMs:3e3}):_(c)},ie=()=>{U.triggerClip().catch(e=>i({kind:`error`,title:N(`home.errSaveClip`),detail:e.message,tone:`error`,holdMs:7e3}))},ae=(0,Z.jsx)(_p,{label:N(`home.microphone`),detail:N(w?`home.on`:`home.off`),on:w,busy:m===`mic`,icon:(0,Z.jsx)(Mp,{}),onToggle:()=>{T?x(!0):E(!w)}}),O=(0,Z.jsx)(_p,{label:N(`home.desktopAudio`),detail:N(C?`home.on`:`home.off`),on:C,busy:m===`audio`,icon:(0,Z.jsx)(Np,{}),onToggle:()=>void re(`audio`,{recording:{capture_audio:!C}},()=>i({kind:`info`,title:N(C?`home.desktopAudioOff`:`home.desktopAudioOn`),tone:`accent`,holdMs:3e3}),N(`home.errDesktopAudio`))}),oe=(0,Z.jsx)(_p,{label:N(`home.publicLink`),detail:N(ee?c?`home.active`:`home.starting`:`home.off`),on:ee,busy:m===`tunnel`,icon:(0,Z.jsx)(Pp,{}),onToggle:()=>void re(`tunnel`,{sharing:{cloudflare_tunnel:!ee}},()=>i({kind:`info`,title:N(ee?`home.publicLinkStopped`:`home.publicLinkStarting`),tone:`accent`,holdMs:3500}),N(`home.errPublicLink`))}),k=(0,Z.jsxs)(`button`,{type:`button`,className:`tile tile-readout`,onClick:D,disabled:!c,"aria-label":N(c?`home.copyPublicLink`:`home.noPublicLinkYet`),children:[(0,Z.jsx)(`span`,{className:`tile-badge`,"aria-hidden":`true`,children:(0,Z.jsx)(Ap,{})}),(0,Z.jsxs)(`span`,{className:`tile-text`,children:[(0,Z.jsx)(`b`,{children:c?xp(c):N(ee?`home.connecting`:`home.localOnly`)}),(0,Z.jsx)(`span`,{className:`tile-mono`,children:N(c?`home.tapToCopy`:ee?`home.cloudflaredStarting`:`home.linksWorkOnNetwork`)})]})]}),A=(0,Z.jsx)(vp,{label:N(`home.allClips`),icon:(0,Z.jsx)(al,{size:19}),onClick:()=>t({type:`setView`,view:`clips`,playlistId:null})}),se=(0,Z.jsx)(vp,{label:N(`home.settings`),icon:(0,Z.jsx)(cl,{size:19}),onClick:()=>t({type:`setView`,view:`settings`})});return(0,Z.jsx)(`div`,{className:`home-layout`,children:(0,Z.jsxs)(`div`,{className:`home-columns`,children:[(0,Z.jsxs)(`div`,{className:`home`,children:[(0,Z.jsxs)(`header`,{className:`home-hero`,children:[(0,Z.jsx)(`h1`,{children:Sp()}),(0,Z.jsx)(`p`,{children:yr(`home.lede`,{duration:(0,Z.jsx)(`b`,{children:pc(S,!0)},`d`),hotkey:(0,Z.jsx)(`kbd`,{children:n},`k`)})})]}),p===`rail`?null:(0,Z.jsxs)(`section`,{className:`tiles`,"aria-label":N(`home.quickSettings`),children:[(0,Z.jsxs)(`div`,{className:`tile-row tile-row-2`,children:[ae,O]}),(0,Z.jsxs)(`div`,{className:`tile-row tile-row-2`,children:[oe,k]}),(0,Z.jsxs)(`div`,{className:`tile-row tile-row-3`,children:[(0,Z.jsx)(vp,{label:N(`home.saveClipNow`),icon:(0,Z.jsx)(Fp,{}),onClick:ie}),A,se]})]}),(0,Z.jsx)(Ep,{title:N(`home.recentClips`),action:{label:N(`home.seeAll`),onClick:()=>t({type:`setView`,view:`clips`,playlistId:null})},clips:te,recentNew:l,actions:d,empty:N(`home.emptyReel`,{hotkey:n})}),o.length>0?(0,Z.jsxs)(`section`,{className:`home-section`,children:[(0,Z.jsx)(`div`,{className:`home-section-head`,children:(0,Z.jsx)(`h2`,{children:N(`home.playlists`)})}),(0,Z.jsx)(`div`,{className:`playlist-row`,children:o.map(e=>(0,Z.jsx)(Tp,{playlist:e,onOpen:()=>t({type:`setView`,view:`clips`,playlistId:e.id}),onDone:(e,t)=>i({kind:t===`error`?`error`:`info`,title:e,tone:t,holdMs:t===`error`?7e3:3e3})},e.id))})]}):null,ne.length>0?(0,Z.jsx)(Ep,{title:N(`home.mostViewed`),clips:ne,recentNew:l,actions:d}):null,(0,Z.jsxs)(bf,{children:[f,(0,Z.jsxs)(wl,{open:b,title:N(`home.wfMicTitle`),onClose:()=>x(!1),children:[(0,Z.jsx)(`p`,{children:N(`home.wfMicBody`)}),(0,Z.jsxs)(`div`,{className:`choice-list`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{x(!1),E(!0,`backend_fallback`)},children:[(0,Z.jsx)(`b`,{children:N(`home.wfMicBothLabel`)}),(0,Z.jsx)(`span`,{children:N(`home.wfMicBothHelp`)})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{x(!1),E(!0,`mic_only`)},children:[(0,Z.jsx)(`b`,{children:N(`home.wfMicOnlyLabel`)}),(0,Z.jsx)(`span`,{children:N(`home.wfMicOnlyHelp`)})]})]})]}),(0,Z.jsxs)(wl,{open:g!==null,title:N(`home.copyLinkTitle`),onClose:()=>_(null),children:[(0,Z.jsx)(`p`,{children:N(`home.copyLinkBody`)}),(0,Z.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:g??``,rows:3})]}),(0,Z.jsx)(wl,{open:v,title:N(`home.restartTitle`),onClose:()=>y(!1),footer:(0,Z.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>y(!1),children:N(`home.gotIt`)}),children:(0,Z.jsx)(`p`,{children:N(`home.restartBody`)})})]})]}),(0,Z.jsx)(Yf,{}),p===`rail`?(0,Z.jsxs)(`aside`,{className:`home-rail`,"aria-label":N(`home.quickSettings`),children:[(0,Z.jsx)(`h2`,{children:N(`home.quickSettings`)}),(0,Z.jsxs)(`button`,{type:`button`,className:`rail-save`,onClick:ie,children:[(0,Z.jsxs)(`span`,{className:`rail-save-burst`,"aria-hidden":`true`,children:[(0,Z.jsx)(`svg`,{viewBox:`0 0 100 100`,children:(0,Z.jsx)(`path`,{d:kp})}),(0,Z.jsx)(Fp,{size:40,weight:1.4})]}),(0,Z.jsx)(`span`,{className:`rail-save-label`,children:N(`home.saveClipNow`)}),(0,Z.jsx)(`kbd`,{children:n})]}),(0,Z.jsxs)(`div`,{className:`rail-pair`,children:[ae,O]}),(0,Z.jsxs)(`div`,{className:`rail-group`,children:[oe,k]}),(0,Z.jsxs)(`div`,{className:`rail-group rail-nav`,children:[A,se]}),(0,Z.jsx)(wp,{})]}):null]})})}function wp(){let{state:e}=Lc(),t=e.status.disk,n=(0,Dp.useMemo)(()=>e.clips.reduce((e,t)=>e+(t.size??0),0)+e.images.reduce((e,t)=>e+(t.size??0),0),[e.clips,e.images]),r=t?.total??0,i=t?.free??0,a=Math.max(0,r-i),o=e.clips[0]?.created_at;return(0,Z.jsxs)(`section`,{className:`rail-storage`,"aria-label":N(`home.storage`),children:[r>0?(0,Z.jsxs)(`div`,{className:`rail-meter`,role:`img`,"aria-label":N(`home.diskBar`,{used:hc(a),total:hc(r),library:hc(n)}),children:[(0,Z.jsx)(`span`,{className:`rail-meter-fill`,style:{width:`${a/r*100}%`}}),(0,Z.jsx)(`span`,{className:`rail-meter-vice`,style:{width:`${Math.min(n,r)/r*100}%`}})]}):null,(0,Z.jsxs)(`dl`,{className:`rail-stats`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:N(`home.diskFree`)}),(0,Z.jsx)(`dd`,{children:r>0?hc(i):N(`home.diskUnknown`)})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:N(`home.diskLibrary`)}),(0,Z.jsx)(`dd`,{children:hc(n)})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:N(`home.lastClip`)}),(0,Z.jsx)(`dd`,{children:o?_c(o):N(`home.lastClipNever`)})]})]})]})}function Tp({playlist:e,onOpen:t,onDone:n}){let r=jd(e,n),i=e.clip_slugs.length;return(0,Z.jsxs)(`button`,{type:`button`,className:`playlist-chip`,"data-drop-over":r.over||void 0,"data-received":r.caught||void 0,style:e.color1?{"--chip":e.color1}:void 0,onClick:t,...r.props,children:[(0,Z.jsx)(`span`,{className:`playlist-chip-mark`,"aria-hidden":`true`,children:e.emoji||(0,Z.jsx)(hl,{size:15})}),(0,Z.jsxs)(`span`,{className:`playlist-chip-text`,children:[(0,Z.jsx)(`b`,{children:e.name}),(0,Z.jsx)(`span`,{children:N(`clips.countClips`,{count:i})})]})]})}function Ep({title:e,clips:t,recentNew:n,actions:r,action:i,empty:a}){return(0,Z.jsxs)(`section`,{className:`home-section`,children:[(0,Z.jsxs)(`div`,{className:`home-section-head`,children:[(0,Z.jsx)(`h2`,{children:e}),i?(0,Z.jsx)(`button`,{type:`button`,className:`section-link`,onClick:i.onClick,children:i.label}):null]}),t.length===0&&a?(0,Z.jsx)(`p`,{className:`home-empty`,children:a}):(0,Z.jsx)(`div`,{className:`clip-row`,children:t.map(e=>(0,Z.jsx)(ip,{clip:e,draggable:!0,isNew:n.includes(e.slug),actions:r},e.slug))})]})}var Dp,Z,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip=o((()=>{Dp=l(d()),Wc(),ku(),vf(),rp(),Tf(),Fd(),cc(),Kc(),vc(),Ar(),gp(),bp(),Dl(),Cl(),Z=M(),Op=8,kp=(()=>{let e=[];for(let t=0;t<96;t++){let n=t/96*Math.PI*2,r=46+4*Math.cos(n*12);e.push(`${(50+r*Math.cos(n)).toFixed(2)} ${(50+r*Math.sin(n)).toFixed(2)}`)}return`M${e.join(`L`)}Z`})(),Ap=()=>(0,Z.jsxs)(`svg`,{...jp,width:19,height:19,viewBox:`0 0 24 24`,children:[(0,Z.jsx)(`path`,{d:`M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1`}),(0,Z.jsx)(`path`,{d:`M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1`})]}),jp={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Mp=()=>(0,Z.jsxs)(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,...jp,"aria-hidden":`true`,children:[(0,Z.jsx)(`rect`,{x:`9`,y:`2`,width:`6`,height:`12`,rx:`3`}),(0,Z.jsx)(`path`,{d:`M5 11a7 7 0 0 0 14 0M12 18v4`})]}),Np=()=>(0,Z.jsxs)(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,...jp,"aria-hidden":`true`,children:[(0,Z.jsx)(`path`,{d:`M4 9v6h4l5 4V5L8 9H4z`}),(0,Z.jsx)(`path`,{d:`M17 8.5a5 5 0 0 1 0 7`})]}),Pp=()=>(0,Z.jsxs)(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,...jp,"aria-hidden":`true`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,Z.jsx)(`path`,{d:`M3 12h18M12 3a15 15 0 0 1 0 18a15 15 0 0 1 0-18`})]}),Fp=({size:e=19,weight:t=2}={})=>(0,Z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...jp,strokeWidth:t,"aria-hidden":`true`,children:[(0,Z.jsx)(`path`,{d:`M5 3h11l3 3v15H5z`}),(0,Z.jsx)(`path`,{d:`M9 3v6h6`})]})}));function Lp(){let{state:e,dispatch:t,visibleClips:n,visibleImages:r,hotkey:i,notify:a,refreshPlaylists:o}=Lc(),{playlists:s,currentPlaylistId:c,searchQuery:l,recentNew:u,status:d,config:f}=e,p=c?s.find(e=>e.id===c)??null:null,{actions:m,overlays:h}=Eu(),g=p?r:[],{actions:_,overlays:v}=Pf(),[y,b]=(0,Rp.useState)(null),[x,S]=(0,Rp.useState)(!1),[C,w]=(0,Rp.useState)(null),ee=e=>t=>a({kind:`error`,title:e,detail:t.message,tone:`error`,holdMs:7e3}),te=async e=>{if(y===`edit`&&p){let t=await U.updatePlaylist(p.id,e);if(t.ok===!1)throw Error(t.error||N(`clips.errUpdatePlaylist`));await o(),a({kind:`info`,title:N(`clips.playlistUpdated`),tone:`accent`,holdMs:3e3})}else{let n=await U.createPlaylist(e);if(n.ok===!1)throw Error(n.error||N(`clips.errCreatePlaylist`));await o(),t({type:`setView`,view:`clips`,playlistId:n.playlist.id}),a({kind:`info`,title:N(`clips.playlistCreated`,{name:e.name}),tone:`accent`,holdMs:3500})}b(null)},ne=p?p.name:N(`clips.allClips`),T=n.length,re=l.trim(),E=re?N(`clips.countMatches`,{count:T,query:re}):N(`clips.countClips`,{count:T}),D=T===0&&g.length===0,ie=p?.kind===`auto`;return(0,zp.jsxs)(`div`,{className:`clips`,children:[(0,zp.jsxs)(`header`,{className:`clips-head`,children:[(0,zp.jsxs)(`div`,{className:`clips-title`,children:[(0,zp.jsxs)(`h1`,{children:[p?.emoji?(0,zp.jsx)(`span`,{className:`clips-emoji`,children:p.emoji}):null,ne]}),(0,zp.jsx)(`p`,{children:E})]}),(0,zp.jsxs)(`div`,{className:`clips-tools`,children:[p?(0,zp.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-icon-only`,title:N(`clips.playlistOptions`),"aria-label":N(`clips.playlistOptions`),onClick:e=>{let t=e.currentTarget.getBoundingClientRect();w({x:t.right-200,y:t.bottom+6})},children:(0,zp.jsx)(bl,{size:16})}):null,(0,zp.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>b(`new`),children:N(`clips.newPlaylist`)}),(0,zp.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void U.triggerClip().catch(ee(N(`clips.errSaveClip`))),children:N(`clips.saveClip`)})]})]}),d.hotkeys_available===!1?(0,zp.jsxs)(`div`,{className:`banner`,"data-tone":`warning`,role:`status`,children:[(0,zp.jsx)(dl,{size:17,className:`banner-icon`}),(0,zp.jsxs)(`div`,{className:`banner-text`,children:[(0,zp.jsx)(`strong`,{children:N(`clips.hotkeysUnavailableTitle`)}),(0,zp.jsx)(`span`,{children:N(`clips.hotkeysUnavailableBody`,{hotkey:i})})]})]}):null,D?(0,zp.jsx)(`p`,{className:`home-empty`,children:re?N(`clips.emptySearch`,{query:re}):p?N(`clips.emptyPlaylist`):N(`clips.emptyLibrary`,{hotkey:i,duration:f?.recording?.clip_duration??20})}):null,T>0?(0,zp.jsx)(`div`,{className:`clip-grid`,children:n.map(e=>(0,zp.jsx)(ip,{clip:e,draggable:!0,isNew:u.includes(e.slug),actions:m},e.slug))}):null,g.length>0?(0,zp.jsxs)(zp.Fragment,{children:[(0,zp.jsx)(`h2`,{className:`clips-section`,children:N(`clips.imagesHeading`,{count:g.length})}),(0,zp.jsx)(`div`,{className:`clip-grid`,children:g.map(e=>(0,zp.jsx)(Rf,{image:e,draggable:!0,actions:_},e.slug))})]}):null,C&&p?(0,zp.jsx)(xu,{at:C,heading:p.name,emptyLabel:N(`common.noActions`),onClose:()=>w(null),items:[{id:`edit`,label:N(`clips.editPlaylist`),onSelect:()=>b(`edit`)},{id:`delete`,label:N(`clips.deletePlaylist`),danger:!0,onSelect:()=>S(!0)}]}):null,(0,zp.jsx)(Id,{open:y!==null,editing:y===`edit`?p:null,onClose:()=>b(null),onSubmit:te}),(0,zp.jsx)(wl,{open:x,title:N(`clips.confirmDeleteTitle`),onClose:()=>S(!1),footer:(0,zp.jsxs)(zp.Fragment,{children:[(0,zp.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>S(!1),children:N(`common.keepIt`)}),(0,zp.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{S(!1),p&&U.deletePlaylist(p.id).then(async()=>{await o(),t({type:`setView`,view:`clips`,playlistId:null}),a({kind:`info`,title:N(`clips.playlistDeleted`),tone:`neutral`,holdMs:3e3})}).catch(ee(N(`clips.errDeletePlaylist`)))},children:N(`common.delete`)})]}),children:(0,zp.jsxs)(`p`,{children:[N(`clips.confirmDeleteBody`),ie?N(`clips.confirmDeleteAuto`):``]})}),h,v]})}var Rp,zp,Bp=o((()=>{Rp=l(d()),Wc(),ku(),Lf(),cc(),Ar(),gp(),qf(),wu(),Vd(),Dl(),Cl(),zp=M()}));function Vp(){let{state:e,visibleImages:t}=Lc(),{searchQuery:n,config:r}=e,{actions:i,overlays:a}=Pf(),o=t.length,s=n.trim(),c=r?.hotkeys?.screenshot||``;return(0,Hp.jsxs)(`div`,{className:`clips`,children:[(0,Hp.jsx)(`header`,{className:`clips-head`,children:(0,Hp.jsxs)(`div`,{className:`clips-title`,children:[(0,Hp.jsx)(`h1`,{children:N(`images.heading`)}),(0,Hp.jsx)(`p`,{children:s?N(`images.countMatches`,{count:o,query:s}):N(`images.countImages`,{count:o})})]})}),o===0?(0,Hp.jsx)(`p`,{className:`home-empty`,children:s?N(`images.emptySearch`,{query:s}):c?N(`images.emptyLibrary`,{hotkey:gc(c)}):N(`images.emptyNoKey`)}):(0,Hp.jsx)(`div`,{className:`clip-grid`,children:t.map(e=>(0,Hp.jsx)(Rf,{image:e,draggable:!0,actions:i},e.slug))}),a]})}var Hp,Up=o((()=>{Wc(),Lf(),Ar(),vc(),qf(),Hp=M()}));function Wp(e){return typeof e==`string`&&$p.includes(e)}function Gp(e){return nm.add(e),()=>nm.delete(e)}function Kp(e){return e===`reduced`?!0:e===`full`?!1:wc||em===`reduced`}function qp(e){return e===`auto`?N(wc?`settings.effectsSoftware`:em===`reduced`?`settings.effectsSlow`:em===`full`?`settings.effectsKeepingUp`:`settings.effectsMeasuring`):``}function Jp(e){document.documentElement.classList.toggle(`perf-low`,Kp(e)),e===`auto`&&em===null&&Yp()}function Yp(){if(tm||wc)return;tm=!0,document.documentElement.classList.remove(`perf-low`);let e=[],t=0,n=Qp,r=i=>{if(n>0){n--,t=i,requestAnimationFrame(r);return}if(t&&e.push(i-t),t=i,e.lengthe-t);let a=e[e.length>>1];em=a>Xp?`reduced`:`full`,tm=!1,console.debug(`compositor probe: median frame ${a.toFixed(1)}ms, effects ${em}`),nm.forEach(e=>e())};requestAnimationFrame(r)}var Xp,Zp,Qp,$p,em,tm,nm,rm=o((()=>{Dc(),Ar(),Xp=42,Zp=48,Qp=4,$p=[`auto`,`full`,`reduced`],em=null,tm=!1,nm=new Set}));function im(e){let t=e.recording??{},n=e.hotkeys??{},r=e.output??{},i=e.sharing??{},a=e.discord??{},o=e.updates??{},s=e.notifications??{},c=e.ui??{},l=bm(t.resolution,``),u=mm.some(([e])=>e===l);return{bufferDuration:ym(t.buffer_duration,120),clipDuration:ym(t.clip_duration,20),fps:String(ym(t.fps,60)),resolution:u?l:`custom`,customResolution:u?``:l,container:bm(t.container,`mp4`),encoder:bm(t.encoder,`auto`),colorDepth:String(t.color_depth??`8`),backend:bm(t.backend,`auto`),replayStorage:bm(t.gsr_replay_storage,`auto`),display:bm(t.display,``),followMouse:!!t.follow_mouse_display,hardwareDecode:!!c.hardware_video_decode,captureAudio:t.capture_audio!==!1,captureMic:!!t.capture_microphone,desktopSource:bm(t.gsr_audio_source,`default_output`),micSource:bm(t.microphone_source,`default_input`),micMono:!!t.microphone_mono,desktopVolume:Math.round(ym(t.desktop_volume,1)*100),micVolume:Math.round(ym(t.microphone_volume,1)*100),notifyVolume:Math.round(ym(s.sound_volume,1)*100),sounds:Object.fromEntries(pm.map(([e])=>[e,bm(s[e],``)])),audioTracks:Array.isArray(t.audio_tracks)?t.audio_tracks.map(String):[],mixFirstTrack:!!t.audio_tracks_mix_first,wfMicStrategy:bm(t.wf_microphone_strategy,`prompt`),clipKey:bm(n.clip,`KEY_F9`),screenshotKey:bm(n.screenshot,``),clipPresets:(Array.isArray(n.clip_presets)?n.clip_presets:[]).map(e=>{let t=e??{};return{uid:gm(),key:bm(t.key,``),duration:ym(t.duration,60)}}),hotkeyBlocklist:(Array.isArray(n.disable_while_focused)?n.disable_while_focused:[]).join(` -`),directory:bm(r.directory,``),imageDirectory:bm(r.image_directory,``),tagWithGame:r.tag_clips_with_game!==!1,autoPlaylist:r.auto_playlist_by_game!==!1,clipNameTemplate:bm(r.clip_name_template,``),port:ym(i.port,8765),cloudflareTunnel:i.cloudflare_tunnel!==!1,discordEnabled:!!a.enabled,discordClientId:bm(a.client_id_override,``),discordCustomGames:(Array.isArray(a.custom_games)?a.custom_games:[]).map(e=>{let t=e??{};return`${t.name??``} | ${(t.matches??[]).join(`, `)}`}).join(` -`),gsrArgs:bm(t.gsr_args,``),checkForUpdates:o.check_on_start!==!1}}function am(e){if(e.resolution!==`custom`)return e.resolution||null;let t=e.customResolution.trim().toLowerCase().replace(`×`,`x`);return t?/^\d{2,5}x\d{2,5}$/.test(t)?t:!1:null}function om(e){let t=Math.max(e.clipDuration,...e.clipPresets.map(e=>Number(e.duration)||0));return Math.max(e.bufferDuration,t)}function sm(e){let t=am(e);return{recording:{buffer_duration:om(e),clip_duration:e.clipDuration,fps:Number(e.fps),display:e.display||null,follow_mouse_display:e.followMouse,resolution:t===!1?null:t,container:e.container,encoder:e.encoder,color_depth:e.colorDepth,backend:e.backend,capture_audio:e.captureAudio,gsr_replay_storage:e.replayStorage,capture_microphone:e.captureMic,microphone_source:e.micSource||`default_input`,microphone_mono:e.micMono,desktop_volume:e.desktopVolume/100,microphone_volume:e.micVolume/100,wf_microphone_strategy:e.wfMicStrategy,gsr_audio_source:e.desktopSource||`default_output`,audio_tracks:[...e.audioTracks],audio_tracks_mix_first:e.mixFirstTrack,gsr_args:e.gsrArgs.trim()},hotkeys:{clip:e.clipKey,screenshot:e.screenshotKey.trim(),clip_presets:e.clipPresets.map(e=>({key:e.key.trim(),duration:Number(e.duration)||60})).filter(e=>e.key||e.duration),disable_while_focused:vm(e.hotkeyBlocklist)},output:{directory:e.directory,image_directory:e.imageDirectory,tag_clips_with_game:e.tagWithGame,auto_playlist_by_game:e.autoPlaylist,clip_name_template:e.clipNameTemplate.trim()},sharing:{port:Number(e.port),cloudflare_tunnel:e.cloudflareTunnel},updates:{check_on_start:e.checkForUpdates},notifications:{sound_volume:e.notifyVolume/100,...Object.fromEntries(pm.map(([t])=>[t,e.sounds[t]?.trim()||null]))},ui:{hardware_video_decode:e.hardwareDecode},discord:{enabled:e.discordEnabled,client_id_override:e.discordClientId.trim()||null,custom_games:cm(e.discordCustomGames)}}}function cm(e){let t=[];for(let n of(e||``).split(` -`)){let e=n.trim();if(!e)continue;let[r,i=``]=e.split(`|`),a=(r||``).trim(),o=i.split(`,`).map(e=>e.trim()).filter(Boolean);!a||o.length===0||t.push({name:a,matches:o})}return t}function lm(e,t,n,r){let i=e=>String(e).padStart(2,`0`),a=(e,t,n)=>e.split(t).join(n),o=a(e,`$n`,String(t));return o=a(o,`$date`,`${r.getFullYear()}-${i(r.getMonth()+1)}-${i(r.getDate())}`),o=a(o,`$time`,i(r.getHours())+i(r.getMinutes())),o=a(o,`$game`,n||``),o.replace(/[/\\\x00-\x1f]/g,``).replace(/[_-]{2,}/g,e=>e[0]).replace(/^[_\-. ]+|[_\-. ]+$/g,``)}function um(e){let t=e.replayStorage===`ram`||e.replayStorage===`auto`&&e.bufferDuration<=600;if(t&&e.bufferDuration>600){let t=(e.bufferDuration*1.5/1024).toFixed(1);return{text:N(`settings.bufferRamWarning`,{length:mc(e.bufferDuration),gb:t}),tone:`warning`}}return t?{text:N(`settings.bufferPlain`),tone:`plain`}:{text:N(`settings.bufferOnDisk`),tone:`plain`}}function dm(e){let t=(e||``).trim();return t===`default_output`?`monitor`:t===`default_input`?`input`:t.startsWith(`app:`)||t.startsWith(`app-inverse:`)?`app`:t.startsWith(`device:`)?t.endsWith(`.monitor`)?`monitor`:`input`:`unknown`}function fm(e){let t=[],n=[];for(let r of e){let e=String(r).split(`|`).filter(Boolean),i=e.filter(e=>dm(e)===`input`);i.length?i.length!==e.length&&n.push(r):t.push(r)}return{dropped:t,trimmed:n}}var pm,mm,hm,gm,_m,vm,ym,bm,xm=o((()=>{vc(),Ar(),pm=[[`clip_sound`,`settings.soundClip`,`~/sounds/clip.wav`],[`clip_failed_sound`,`settings.soundClipFailed`,`~/sounds/failed.wav`],[`session_start_sound`,`settings.soundSessionStart`,`~/sounds/start.wav`],[`session_end_sound`,`settings.soundSessionEnd`,`~/sounds/stop.wav`],[`highlight_sound`,`settings.soundHighlight`,`~/sounds/highlight.wav`],[`screenshot_sound`,`settings.soundScreenshot`,`~/sounds/shutter.wav`]],mm=[[``,`Auto`],[`960x540`,`960x540 (540p)`],[`1280x720`,`1280x720 (720p)`],[`1920x1080`,`1920x1080 (1080p)`],[`2560x1440`,`2560x1440 (1440p)`],[`3840x2160`,`3840x2160 (4K)`]],hm=0,gm=()=>`preset-${++hm}`,_m=()=>({uid:gm(),key:``,duration:60}),vm=e=>e.split(` -`).map(e=>e.trim()).filter(Boolean),ym=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,bm=(e,t)=>typeof e==`string`&&e?e:t}));function Sm({tracks:e,sources:t,mixFirst:n,desktopAudioOn:r,pick:i,onPickChange:a,onChange:o,onRefresh:s,refreshing:c,onDuplicate:l}){let u=e=>t.find(t=>t.id===e)?.label||e,d=()=>{if(i){if(e.includes(i)){l();return}o([...e,i])}},f=(t,n)=>{let r=t+n;if(r<0||r>=e.length)return;let i=[...e];[i[t],i[r]]=[i[r],i[t]],o(i)},p=n&&e.length>1,m=p?2:1,{dropped:h,trimmed:g}=fm(e),_=!r&&(h.length>0||g.length>0);return(0,Cm.jsxs)(`div`,{className:`tracks`,children:[(0,Cm.jsxs)(`div`,{className:`tracks-add`,children:[(0,Cm.jsx)(`div`,{className:`select-wrap`,children:(0,Cm.jsx)(`select`,{className:`select`,value:i,"aria-label":N(`audioTracks.sourceToAdd`),onChange:e=>a(e.target.value),children:t.map(e=>(0,Cm.jsx)(`option`,{value:e.id,children:e.label||e.id},e.id))})}),(0,Cm.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:d,disabled:!i,children:N(`audioTracks.addTrack`)}),(0,Cm.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm btn-icon`,title:N(`audioTracks.refresh`),"aria-label":N(`audioTracks.refresh`),disabled:c,onClick:s,children:(0,Cm.jsx)(wm,{spinning:c})})]}),e.length===0?(0,Cm.jsx)(`p`,{className:`tracks-empty`,children:N(`audioTracks.none`)}):(0,Cm.jsxs)(`div`,{className:`track-list`,children:[p?(0,Cm.jsxs)(`span`,{className:`track track-mix`,children:[(0,Cm.jsx)(`span`,{className:`track-num`,children:`1`}),(0,Cm.jsx)(`span`,{className:`track-id`,children:N(`audioTracks.mixOfAll`)})]}):null,e.map((t,n)=>(0,Cm.jsxs)(`span`,{className:`track`,title:t,children:[(0,Cm.jsx)(`span`,{className:`track-num`,children:n+m}),(0,Cm.jsx)(`span`,{className:`track-id`,children:u(t)}),(0,Cm.jsx)(`button`,{type:`button`,className:`track-btn`,title:N(`audioTracks.moveEarlier`),"aria-label":N(`audioTracks.moveEarlierAria`,{name:u(t)}),disabled:n===0,onClick:()=>f(n,-1),children:(0,Cm.jsx)(Tm,{dir:`up`})}),(0,Cm.jsx)(`button`,{type:`button`,className:`track-btn`,title:N(`audioTracks.moveLater`),"aria-label":N(`audioTracks.moveLaterAria`,{name:u(t)}),disabled:n===e.length-1,onClick:()=>f(n,1),children:(0,Cm.jsx)(Tm,{dir:`down`})}),(0,Cm.jsx)(`button`,{type:`button`,className:`track-btn track-btn-remove`,title:N(`audioTracks.removeTrack`),"aria-label":N(`audioTracks.removeAria`,{name:u(t)}),onClick:()=>o(e.filter((e,t)=>t!==n)),children:(0,Cm.jsx)(fl,{size:11})})]},`${t}-${n}`))]}),_?(0,Cm.jsxs)(`p`,{className:`tracks-warning`,role:`status`,children:[h.length?`${N(`audioTracks.droppedWarning`,{count:h.length,list:h.map(u).join(`, `)})} `:``,g.length?`${N(`audioTracks.trimmedWarning`,{count:g.length})} `:``,N(`audioTracks.turnBackOn`)]}):null]})}var Cm,wm,Tm,Em=o((()=>{Cl(),xm(),Ar(),Cm=M(),wm=({spinning:e})=>(0,Cm.jsxs)(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:e?`spin`:void 0,"aria-hidden":`true`,children:[(0,Cm.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,Cm.jsx)(`path`,{d:`M21 3v5h-5`}),(0,Cm.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,Cm.jsx)(`path`,{d:`M8 16H3v5`})]}),Tm=({dir:e})=>(0,Cm.jsx)(`svg`,{width:11,height:11,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,Cm.jsx)(`path`,{d:e===`up`?`M12 19V5M6 11l6-6 6 6`:`M12 5v14M6 13l6 6 6-6`})})}));function Dm(){let{state:e,saveConfig:t,notify:n}=Lc(),{choose:r,chooseCustom:i,seed:a}=Gu(),[o,s]=(0,zm.useState)(!1),c=a?Zs(a).ramp.base:null,{config:l,accent:u,status:d}=e,[f,p]=(0,zm.useState)(null),[m,h]=(0,zm.useState)(``),[g,_]=(0,zm.useState)({displays:[],warning:null}),[v,y]=(0,zm.useState)({sources:[]}),[b,x]=(0,zm.useState)(``),[S,C]=(0,zm.useState)(!1),[w,ee]=(0,zm.useState)(!1),[te,ne]=(0,zm.useState)(`recording`),[T,re]=(0,zm.useState)(!1),[E,D]=(0,zm.useState)(!1),[ie,ae]=(0,zm.useState)(`auto`),[,O]=(0,zm.useState)(0),[oe,k]=(0,zm.useState)(!1),A=(0,zm.useRef)(null),se=(0,zm.useRef)(new Map),ce=(0,zm.useRef)(null),j=(0,zm.useCallback)(e=>p(t=>t&&{...t,...e}),[]);(0,zm.useEffect)(()=>{if(!l||f)return;let e=im(l);p(e),h(JSON.stringify(sm(e)))},[l,f]),(0,zm.useEffect)(()=>(U.getAppState().then(e=>{let t=Wp(e.effects_mode)?e.effects_mode:`auto`;ae(t),Jp(t)}).catch(()=>Jp(`auto`)),Gp(()=>O(e=>e+1))),[]);let le=(0,zm.useCallback)(async e=>{try{let t=await U.displays(e||`auto`);_(t)}catch{_({displays:[],warning:N(`settings.displayLoadFailed`)})}},[]),ue=(0,zm.useCallback)(async()=>{try{let e=await U.audioSources();y(e),x(t=>t||e.sources[0]?.id||``)}catch{y({sources:[{id:`default_output`,label:N(`settings.defaultOutput`)}],warning:N(`settings.sourceLoadFailed`)})}},[]);(0,zm.useEffect)(()=>{f&&le(f.backend)},[f?.backend,le]),(0,zm.useEffect)(()=>{ue()},[ue]),(0,zm.useEffect)(()=>{let e=A.current;if(!e||!f)return;let t=()=>{if(ce.current)return;let t=e.getBoundingClientRect().top+96,n=Bm[0][0];for(let[e]of Bm){let r=se.current.get(e);r&&r.getBoundingClientRect().top<=t&&(n=e)}ne(n)};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>e.removeEventListener(`scroll`,t)},[f]);let de=e=>{ne(e),ce.current=e,se.current.get(e)?.scrollIntoView({behavior:`smooth`,block:`start`}),window.setTimeout(()=>{ce.current=null},600)},fe=(0,zm.useMemo)(()=>f?JSON.stringify(sm(f))!==m:!1,[f,m]);if((0,zm.useEffect)(()=>{if(!fe)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[fe]),!f)return(0,Q.jsx)(`div`,{className:`settings`,children:(0,Q.jsx)(`p`,{className:`home-empty`,children:N(`settings.loading`)})});let pe=(e,t)=>n({kind:`error`,title:e,detail:t?.message,tone:`error`,holdMs:7e3}),me=(e,t)=>n({kind:`info`,title:e,detail:t,tone:`accent`,holdMs:3500}),he=async(e,r,i)=>{try{let i=await t(e);i.applied===!1&&i.warning?n({kind:`error`,title:N(`settings.savedNotApplied`),detail:i.warning,tone:`error`,holdMs:8e3}):r(),h(t=>{let n={...JSON.parse(t)};for(let[t,r]of Object.entries(e))n[t]={...n[t]??{},...r};return JSON.stringify(n)})}catch(e){pe(i,e)}},ge=!f.captureMic&&f.captureAudio&&f.wfMicStrategy===`prompt`&&(f.backend===`wf-recorder`||d.backend===`wf-recorder`),_e=async(e,t)=>{j({captureMic:e,...t?{wfMicStrategy:t}:{}}),await he({recording:{capture_microphone:e,...t?{wf_microphone_strategy:t}:{}}},()=>me(N(e?`settings.micOn`:`settings.micOff`),N(e?`settings.micOnDetail`:`settings.micOffDetail`)),N(`settings.errMic`))},ve=async()=>{if(am(f)===!1){n({kind:`error`,title:N(`settings.badResolutionTitle`),detail:N(`settings.badResolutionDetail`),tone:`error`,holdMs:6e3}),de(`recording`);return}let e=om(f),r=e!==f.bufferDuration;r&&j({bufferDuration:e});let i=sm({...f,bufferDuration:e}),a=Number(i.sharing.port)!==Number(l?.sharing?.port??8765)||!!i.sharing.cloudflare_tunnel!=(l?.sharing?.cloudflare_tunnel!==!1);ee(!0);try{let o=await t(i);o.applied===!1&&o.warning?n({kind:`error`,title:N(`settings.savedNotApplied`),detail:o.warning,tone:`error`,holdMs:9e3}):me(N(`settings.saved`),r?N(`settings.bufferRaised`,{length:mc(e)}):void 0),o.restart_required&&a&&re(!0),h(JSON.stringify(i))}catch(e){pe(N(`settings.errSave`),e)}finally{ee(!1)}},ye=()=>{if(!l)return;let e=im(l);p(e),h(JSON.stringify(sm(e)))},be=e=>{ae(e),Jp(e),U.setAppState({effects_mode:e}).catch(e=>console.debug(`Saving the effects mode failed`,e))},xe=e=>t=>{t?se.current.set(e,t):se.current.delete(e)},Se=um(f),Ce=g.follow_mouse_supported!==!1;return(0,Q.jsxs)(`div`,{className:`settings`,children:[(0,Q.jsx)(`header`,{className:`settings-head`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{children:N(`settings.title`)}),(0,Q.jsx)(`p`,{children:N(`settings.subtitle`)})]})}),(0,Q.jsx)(`nav`,{className:`settings-rail`,"aria-label":N(`settings.sections`),children:Bm.map(([e,t])=>(0,Q.jsx)(`button`,{type:`button`,className:`rail-chip`,"aria-current":te===e?`true`:void 0,onClick:()=>de(e),children:N(t)},e))}),(0,Q.jsxs)(`div`,{className:`settings-body`,ref:A,children:[(0,Q.jsxs)(Om,{id:`recording`,title:N(`settings.secRecording`),register:xe(`recording`),children:[(0,Q.jsx)(J,{label:N(`settings.bufferDuration`),note:Se,children:(0,Q.jsx)(sd,{label:N(`settings.bufferDuration`),value:f.bufferDuration,min:30,max:1800,step:30,onChange:e=>j({bufferDuration:e}),format:mc})}),(0,Q.jsx)(J,{label:N(`settings.replayStorage`),help:N(`settings.replayStorageHelp`),children:(0,Q.jsx)(od,{label:N(`settings.replayStorage`),value:f.replayStorage,onChange:e=>j({replayStorage:e}),options:[[`auto`,N(`settings.optAutoRecommended`)],[`ram`,N(`settings.replayRam`)],[`disk`,N(`settings.replayDisk`)]]})}),(0,Q.jsx)(J,{label:N(`settings.clipDuration`),help:N(`settings.clipDurationHelp`),children:(0,Q.jsx)(sd,{label:N(`settings.clipDuration`),value:f.clipDuration,min:5,max:1800,step:5,onChange:e=>j({clipDuration:e}),format:mc})}),(0,Q.jsx)(J,{label:N(`settings.frameRate`),help:N(`settings.frameRateHelp`),children:(0,Q.jsx)(od,{label:N(`settings.frameRate`),value:f.fps,onChange:e=>j({fps:e}),options:[`24`,`30`,`50`,`60`,`120`,`144`].map(e=>[e,N(`settings.fpsOption`,{fps:e})])})}),(0,Q.jsx)(J,{label:N(`settings.resolution`),help:N(`settings.resolutionHelp`),children:(0,Q.jsx)(od,{label:N(`settings.resolution`),value:f.resolution,onChange:e=>j({resolution:e}),options:[...Am(),[`custom`,N(`settings.resolutionCustom`)]]})}),f.resolution===`custom`?(0,Q.jsx)(J,{label:N(`settings.customResolution`),note:am(f)===!1?{text:N(`settings.customResolutionWarn`),tone:`warning`}:null,help:N(`settings.customResolutionHelp`),children:(0,Q.jsx)(cd,{label:N(`settings.customResolution`),mono:!0,value:f.customResolution,placeholder:`1600x900`,onChange:e=>j({customResolution:e})})}):null,(0,Q.jsx)(J,{label:N(`settings.container`),help:N(`settings.containerHelp`),children:(0,Q.jsx)(od,{label:N(`settings.container`),value:f.container,onChange:e=>j({container:e}),options:[[`mp4`,N(`settings.containerMp4`)],[`mkv`,N(`settings.containerMkv`)]]})}),(0,Q.jsx)(J,{label:N(`settings.encoder`),help:N(`settings.encoderHelp`),children:(0,Q.jsx)(od,{label:N(`settings.encoder`),value:f.encoder,onChange:e=>j({encoder:e}),options:[[`auto`,N(`settings.optAutoRecommended`)],[`h264_nvenc`,N(`settings.encoderH264Nvenc`)],[`hevc_nvenc`,N(`settings.encoderHevcNvenc`)],[`h264_vaapi`,N(`settings.encoderH264Vaapi`)],[`hevc_vaapi`,N(`settings.encoderHevcVaapi`)],[`av1_nvenc`,N(`settings.encoderAv1Nvenc`)],[`av1_vaapi`,N(`settings.encoderAv1Vaapi`)],[`h264_vulkan`,N(`settings.encoderH264Vulkan`)],[`hevc_vulkan`,N(`settings.encoderHevcVulkan`)],[`av1_vulkan`,N(`settings.encoderAv1Vulkan`)],[`libx264`,N(`settings.encoderX264`)],[`libx265`,N(`settings.encoderX265`)]]})}),(0,Q.jsx)(J,{label:N(`settings.colourDepth`),help:N(`settings.colourDepthHelp`),children:(0,Q.jsx)(od,{label:N(`settings.colourDepth`),value:f.colorDepth,onChange:e=>j({colorDepth:e}),options:[[`8`,N(`settings.colour8`)],[`10`,N(`settings.colour10`)]]})}),(0,Q.jsx)(J,{label:N(`settings.hardwareDecode`),help:N(`settings.hardwareDecodeHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.hardwareDecode`),checked:f.hardwareDecode,onChange:e=>j({hardwareDecode:e})})}),(0,Q.jsx)(J,{label:N(`settings.backend`),help:N(`settings.backendHelp`),children:(0,Q.jsx)(od,{label:N(`settings.backend`),value:f.backend,onChange:e=>j({backend:e}),options:[[`auto`,N(`settings.optAutoRecommended`)],[`gsr`,`gpu-screen-recorder`],[`wf-recorder`,N(`settings.backendWf`)],[`ffmpeg`,N(`settings.backendFfmpeg`)]]})}),(0,Q.jsx)(J,{label:N(`settings.followMouse`),note:Ce?null:{text:N(`settings.followMouseUnsupported`),tone:`warning`},help:N(`settings.followMouseHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.followMouse`),checked:Ce&&f.followMouse,disabled:!Ce,onChange:e=>j({followMouse:e})})}),(0,Q.jsx)(J,{label:N(`settings.display`),note:Mm(f,g),children:(0,Q.jsx)(od,{label:N(`settings.display`),value:f.display,disabled:f.followMouse&&Ce,onChange:e=>j({display:e}),options:jm(f,g)})})]}),(0,Q.jsxs)(Om,{id:`audio`,title:N(`settings.secAudio`),register:xe(`audio`),children:[(0,Q.jsx)(J,{label:N(`settings.captureDesktopAudio`),help:N(`settings.captureDesktopAudioHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.captureDesktopAudio`),checked:f.captureAudio,onChange:e=>j({captureAudio:e})})}),(0,Q.jsx)(J,{label:N(`settings.captureMic`),help:N(`settings.captureMicHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.captureMic`),checked:f.captureMic,onChange:e=>{e&&ge?D(!0):_e(e)}})}),(0,Q.jsx)(J,{label:N(`settings.desktopSource`),note:Lm(f,v),children:(0,Q.jsx)(od,{label:N(`settings.desktopSource`),value:f.desktopSource,onChange:e=>j({desktopSource:e}),options:Fm(f.desktopSource,v.sources)})}),(0,Q.jsx)(J,{label:N(`settings.micSource`),help:N(`settings.micSourceHelp`),children:(0,Q.jsx)(od,{label:N(`settings.micSource`),value:f.micSource,onChange:e=>j({micSource:e}),options:Im(f.micSource,v.sources)})}),(0,Q.jsx)(J,{label:N(`settings.micMono`),help:N(`settings.micMonoHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.micMono`),checked:f.micMono,onChange:e=>j({micMono:e})})}),f.audioTracks.length===0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(J,{label:N(`settings.desktopVolume`),help:N(`settings.desktopVolumeHelp`),children:(0,Q.jsx)(sd,{label:N(`settings.desktopVolume`),value:f.desktopVolume,min:0,max:200,step:5,onChange:e=>j({desktopVolume:e}),format:e=>`${e}%`})}),(0,Q.jsx)(J,{label:N(`settings.micVolume`),help:N(`settings.micVolumeHelp`),children:(0,Q.jsx)(sd,{label:N(`settings.micVolume`),value:f.micVolume,min:0,max:200,step:5,onChange:e=>j({micVolume:e}),format:e=>`${e}%`})})]}):null,(0,Q.jsx)(J,{label:N(`settings.notifyVolume`),help:N(`settings.notifyVolumeHelp`),children:(0,Q.jsx)(sd,{label:N(`settings.notifyVolume`),value:f.notifyVolume,min:0,max:100,step:5,onChange:e=>j({notifyVolume:e}),format:e=>e>0?`${e}%`:N(`settings.volumeOff`)})}),(0,Q.jsx)(J,{label:N(`settings.customSounds`),stack:!0,help:N(`settings.customSoundsHelp`),children:(0,Q.jsx)(ud,{fields:pm,values:f.sounds,onChange:(e,t)=>j({sounds:{...f.sounds,[e]:t}})})}),(0,Q.jsx)(J,{label:N(`settings.audioTracks`),stack:!0,help:N(`settings.audioTracksHelp`),children:(0,Q.jsx)(Sm,{tracks:f.audioTracks,sources:v.sources,mixFirst:f.mixFirstTrack,desktopAudioOn:f.captureAudio,pick:b,onPickChange:x,onChange:e=>j({audioTracks:e}),refreshing:S,onDuplicate:()=>n({kind:`error`,title:N(`settings.duplicateTrack`),tone:`error`,holdMs:3500}),onRefresh:()=>{C(!0),ue().then(()=>me(N(`settings.sourcesRefreshed`))).finally(()=>C(!1))}})}),(0,Q.jsx)(J,{label:N(`settings.mixFirstTrack`),help:N(`settings.mixFirstTrackHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.mixFirstTrack`),checked:f.mixFirstTrack,onChange:e=>j({mixFirstTrack:e})})}),(0,Q.jsx)(J,{label:N(`settings.wfMicMode`),help:N(`settings.wfMicModeHelp`),children:(0,Q.jsx)(od,{label:N(`settings.wfMicMode`),value:f.wfMicStrategy,onChange:e=>j({wfMicStrategy:e}),options:[[`prompt`,N(`settings.wfMicPrompt`)],[`backend_fallback`,N(`settings.wfMicFallback`)],[`mic_only`,N(`settings.wfMicOnly`)]]})})]}),(0,Q.jsxs)(Om,{id:`hotkeys`,title:N(`settings.secHotkeys`),register:xe(`hotkeys`),children:[(0,Q.jsx)(J,{label:N(`settings.clipKey`),note:d.hotkeys_available===!1?{text:N(`settings.hotkeysUnavailable`),tone:`warning`}:null,help:N(`settings.clipKeyHelp`),children:(0,Q.jsx)(td,{value:f.clipKey,onUnsupported:()=>n({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3}),onCapture:e=>{j({clipKey:e}),he({hotkeys:{clip:e}},()=>me(N(`settings.clipKeyNow`,{key:e})),N(`settings.errSaveKey`))}})}),(0,Q.jsx)(J,{label:N(`settings.screenshotKey`),help:N(`settings.screenshotKeyHelp`),children:(0,Q.jsxs)(`div`,{className:`key-pair`,children:[(0,Q.jsx)(td,{value:f.screenshotKey,onUnsupported:()=>n({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3}),onCapture:e=>{j({screenshotKey:e}),he({hotkeys:{screenshot:e}},()=>me(N(`settings.screenshotKeyNow`,{key:e})),N(`settings.errSaveKey`))}}),f.screenshotKey?(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>{j({screenshotKey:``}),he({hotkeys:{screenshot:``}},()=>me(N(`settings.screenshotKeyCleared`)),N(`settings.errSaveKey`))},children:N(`settings.clearKey`)}):null]})}),(0,Q.jsx)(J,{label:N(`settings.clipPresets`),stack:!0,help:N(`settings.clipPresetsHelp`),children:(0,Q.jsx)(km,{presets:f.clipPresets,onChange:e=>j({clipPresets:e}),onUnsupported:()=>n({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3})})}),(0,Q.jsx)(J,{label:N(`settings.blocklist`),stack:!0,help:N(`settings.blocklistHelp`),children:(0,Q.jsx)(ld,{label:N(`settings.blocklist`),value:f.hotkeyBlocklist,placeholder:`ggst.exe`,onChange:e=>j({hotkeyBlocklist:e})})})]}),(0,Q.jsxs)(Om,{id:`storage`,title:N(`settings.secStorage`),register:xe(`storage`),children:[(0,Q.jsx)(J,{label:N(`settings.directory`),help:N(`settings.directoryHelp`),children:(0,Q.jsx)(cd,{label:N(`settings.directory`),wide:!0,value:f.directory,placeholder:`~/Videos/Vice`,onChange:e=>j({directory:e})})}),(0,Q.jsx)(J,{label:N(`settings.imageDirectory`),help:N(`settings.imageDirectoryHelp`),children:(0,Q.jsx)(cd,{label:N(`settings.imageDirectory`),wide:!0,value:f.imageDirectory,placeholder:`~/Pictures/Vice`,onChange:e=>j({imageDirectory:e})})}),(0,Q.jsx)(J,{label:N(`settings.tagWithGame`),help:N(`settings.tagWithGameHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.tagWithGame`),checked:f.tagWithGame,onChange:e=>j({tagWithGame:e})})}),(0,Q.jsx)(J,{label:N(`settings.autoPlaylist`),help:N(`settings.autoPlaylistHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.autoPlaylist`),checked:f.autoPlaylist,onChange:e=>j({autoPlaylist:e})})}),(0,Q.jsx)(J,{label:N(`settings.clipFilename`),note:Rm(f),help:(0,Q.jsx)(Q.Fragment,{children:yr(`settings.clipFilenameHelp`,{n:(0,Q.jsx)(`code`,{children:`$n`}),date:(0,Q.jsx)(`code`,{children:`$date`}),time:(0,Q.jsx)(`code`,{children:`$time`}),game:(0,Q.jsx)(`code`,{children:`$game`})})}),children:(0,Q.jsx)(cd,{label:N(`settings.clipFilename`),wide:!0,mono:!0,value:f.clipNameTemplate,placeholder:`clip_$date_$time`,onChange:e=>j({clipNameTemplate:e})})})]}),(0,Q.jsxs)(Om,{id:`sharing`,title:N(`settings.secSharing`),register:xe(`sharing`),children:[(0,Q.jsx)(J,{label:N(`settings.port`),help:N(`settings.portHelp`),children:(0,Q.jsx)(cd,{label:N(`settings.port`),mono:!0,type:`number`,min:1024,max:65535,value:f.port,onChange:e=>j({port:Number(e)||0})})}),(0,Q.jsx)(J,{label:N(`settings.publicLink`),help:N(`settings.publicLinkHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.publicLink`),checked:f.cloudflareTunnel,onChange:e=>j({cloudflareTunnel:e})})})]}),(0,Q.jsxs)(Om,{id:`discord`,title:N(`settings.cardDiscord`),register:xe(`discord`),children:[(0,Q.jsx)(J,{label:N(`settings.discordEnabled`),help:N(`settings.discordEnabledHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.discordEnabled`),checked:f.discordEnabled,onChange:e=>j({discordEnabled:e})})}),(0,Q.jsx)(J,{label:N(`settings.discordCustomGames`),stack:!0,help:(0,Q.jsx)(Q.Fragment,{children:yr(`settings.discordCustomGamesHelp`,{format:(0,Q.jsx)(`code`,{children:`Display Name | match1, match2`})})}),children:(0,Q.jsx)(ld,{label:N(`settings.discordCustomGames`),rows:4,value:f.discordCustomGames,placeholder:N(`settings.discordCustomGamesPlaceholder`),onChange:e=>j({discordCustomGames:e})})}),(0,Q.jsx)(J,{label:N(`settings.discordClientId`),help:N(`settings.discordClientIdHelp`),children:(0,Q.jsx)(cd,{label:N(`settings.discordClientId`),wide:!0,mono:!0,value:f.discordClientId,placeholder:N(`settings.discordClientIdPlaceholder`),onChange:e=>j({discordClientId:e})})})]}),(0,Q.jsxs)(Om,{id:`appearance`,title:N(`settings.secAppearance`),register:xe(`appearance`),children:[(0,Q.jsx)(J,{label:N(`settings.language`),help:N(`settings.languageHelp`),children:(0,Q.jsx)(od,{label:N(`settings.language`),value:xr(),onChange:e=>Cr(e),options:br().map(e=>[e,pr[e]])})}),(0,Q.jsx)(J,{label:N(`settings.accent`),help:N(`settings.accentHelp`),children:(0,Q.jsxs)(`div`,{className:`swatches`,children:[za.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`swatch`,"data-active":u===e||void 0,style:{background:La[e].base},title:N(`accents.${e}`),"aria-label":N(`settings.accentAria`,{name:N(`accents.${e}`)}),"aria-pressed":u===e,onClick:()=>r(e),children:u===e?(0,Q.jsx)(_l,{size:13}):null},e)),(0,Q.jsx)(`button`,{type:`button`,className:`swatch swatch-custom`,"data-active":u===`custom`||void 0,style:c?{background:c}:void 0,title:N(`accents.customTitle`),"aria-label":N(`accents.customTitle`),"aria-pressed":u===`custom`,onClick:()=>s(!0),children:u===`custom`?(0,Q.jsx)(_l,{size:13}):(0,Q.jsx)(xl,{size:13})})]})}),(0,Q.jsx)(J,{label:N(`settings.effects`),note:qp(ie)?{text:qp(ie)}:null,help:N(`settings.effectsHelp`),children:(0,Q.jsx)(od,{label:N(`settings.effects`),value:ie,onChange:e=>be(e),options:$p.map(e=>[e,N(`settings.effects${e[0].toUpperCase()}${e.slice(1)}`)])})})]}),(0,Q.jsxs)(Om,{id:`advanced`,title:N(`settings.secAdvanced`),register:xe(`advanced`),children:[(0,Q.jsx)(J,{label:N(`settings.gsrArgs`),stack:!0,help:(0,Q.jsx)(Q.Fragment,{children:yr(`settings.gsrArgsHelp`,{example:(0,Q.jsx)(`code`,{children:`-k hevc -bm cbr -q 20000 -fm cfr`})})}),children:(0,Q.jsx)(cd,{label:N(`settings.gsrArgs`),wide:!0,mono:!0,value:f.gsrArgs,placeholder:`-k hevc -bm cbr -q 20000 -fm cfr`,onChange:e=>j({gsrArgs:e})})}),(0,Q.jsx)(J,{label:N(`settings.checkForUpdates`),help:N(`settings.checkForUpdatesHelp`),children:(0,Q.jsx)(ad,{label:N(`settings.checkForUpdates`),checked:f.checkForUpdates,onChange:e=>j({checkForUpdates:e})})}),(0,Q.jsx)(J,{label:N(`settings.checkNow`),help:N(`settings.checkNowHelp`),children:(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:oe,onClick:()=>{k(!0),U.checkUpdate().then(e=>{let t=e;me(t?.update?.version?N(`settings.updateAvailable`,{version:t.update.version}):N(`settings.upToDate`))}).catch(e=>pe(N(`settings.errCheckUpdate`),e)).finally(()=>k(!1))},children:N(oe?`settings.checking`:`settings.checkNow`)})})]})]}),(0,Q.jsxs)(`div`,{className:`save-bar`,"data-dirty":fe||void 0,children:[(0,Q.jsx)(`span`,{className:`save-state`,children:fe?N(`settings.unsaved`):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_l,{size:13}),` `,N(`settings.allSaved`)]})}),(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:ye,disabled:!fe||w,children:N(`settings.discard`)}),(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-sm`,onClick:()=>void ve(),disabled:!fe||w,children:N(w?`settings.saving`:`settings.saveSettings`)})]}),(0,Q.jsxs)(wl,{open:E,title:N(`settings.wfMicTitle`),onClose:()=>D(!1),children:[(0,Q.jsx)(`p`,{children:N(`settings.wfMicBody`)}),(0,Q.jsxs)(`div`,{className:`choice-list`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{D(!1),_e(!0,`backend_fallback`)},children:[(0,Q.jsx)(`b`,{children:N(`settings.wfMicChoiceBoth`)}),(0,Q.jsx)(`span`,{children:N(`settings.wfMicChoiceBothBody`)})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{D(!1),_e(!0,`mic_only`)},children:[(0,Q.jsx)(`b`,{children:N(`settings.wfMicChoiceMic`)}),(0,Q.jsx)(`span`,{children:N(`settings.wfMicChoiceMicBody`)})]})]})]}),(0,Q.jsx)(wl,{open:T,title:N(`settings.restartTitle`),onClose:()=>re(!1),footer:(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>re(!1),children:N(`common.gotIt`)}),children:(0,Q.jsx)(`p`,{children:N(`settings.restartBody`)})}),(0,Q.jsx)(Ru,{open:o,initial:a,onCancel:()=>s(!1),onConfirm:e=>{i(e),s(!1)}})]})}function Om({id:e,title:t,register:n,children:r}){return(0,Q.jsxs)(`section`,{className:`settings-card`,id:`settings-${e}`,ref:n,"aria-label":t,children:[(0,Q.jsx)(`h2`,{children:t}),r]})}function km({presets:e,onChange:t,onUnsupported:n}){let r=(n,r)=>t(e.map(e=>e.uid===n?{...e,...r}:e));return(0,Q.jsxs)(`div`,{className:`presets`,children:[e.map(i=>(0,Q.jsxs)(`div`,{className:`preset-row`,children:[(0,Q.jsx)(td,{compact:!0,value:i.key,onUnsupported:n,onCapture:e=>r(i.uid,{key:e})}),(0,Q.jsx)(`input`,{className:`text-input preset-duration`,type:`number`,min:5,max:600,step:5,value:i.duration,"aria-label":N(`settings.presetDuration`),onChange:e=>r(i.uid,{duration:Number(e.target.value)})}),(0,Q.jsx)(`span`,{className:`preset-unit mono`,children:`s`}),(0,Q.jsx)(`button`,{type:`button`,className:`preset-remove`,title:N(`settings.presetRemove`),"aria-label":N(`settings.presetRemove`),onClick:()=>t(e.filter(e=>e.uid!==i.uid)),children:(0,Q.jsx)(fl,{size:12})})]},i.uid)),(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>t([...e,_m()]),children:N(`settings.presetAdd`)})]})}function Am(){return mm.map(([e,t])=>[e,e?t:N(`settings.resolutionAuto`)])}function jm(e,t){let n=Nm(t),r=[[``,N(`settings.displayAuto`)],...n.map(e=>[e.id,e.label||e.id])];return e.display&&!n.some(t=>t.id===e.display)&&r.push([e.display,N(`settings.savedOption`,{id:e.display})]),r}function Mm(e,t){let n=Nm(t);return e.display&&!n.some(t=>t.id===e.display)?{text:N(`settings.displayMissing`,{id:e.display}),tone:`warning`}:t.warning?{text:N(`settings.displayWarning`,{warning:t.warning}),tone:`warning`}:n.length?{text:N(`settings.displayHelp`)}:{text:N(`settings.displayNone`),tone:`warning`}}function Nm(e){let t=e=>{let t=String(e||``).toLowerCase();return t.startsWith(`gsr error`)||t.startsWith(`error:`)||t.includes(`for_each_active_monitor`)||t.includes(`failed to open`)};return(e.displays??[]).filter(e=>!(t(e.id)||t(e.label)))}function Pm(e){if(e.kind)return e.kind;let t=e.id||``;return t===`default_input`||t.startsWith(`device:`)&&!t.endsWith(`.monitor`)?`input`:t.startsWith(`app:`)||t.startsWith(`app-inverse:`)?`app`:`monitor`}function Fm(e,t){let n=t.length?t:[{id:`default_output`,label:N(`settings.defaultOutput`)}],r=[],i=[[`monitor`,N(`settings.groupDesktopAudio`)],[`input`,N(`settings.groupMicrophones`)],[`app`,N(`settings.groupApplications`)]];for(let[e,t]of i){let i=n.filter(t=>Pm(t)===e);i.length&&r.push({group:t,options:i.map(e=>[e.id,e.label||e.id])})}let a=new Set(i.map(([e])=>e)),o=n.filter(e=>!a.has(Pm(e)));return o.length&&r.push({group:N(`settings.groupOther`),options:o.map(e=>[e.id,e.label||e.id])}),e&&!n.some(t=>t.id===e)&&r.push({group:N(`settings.groupSaved`),options:[[e,N(`settings.savedOption`,{id:e})]]}),r}function Im(e,t){let n=t.filter(e=>Pm(e)===`input`);n.some(e=>e.id===`default_input`)||n.unshift({id:`default_input`,label:N(`settings.defaultInput`)});let r=n.map(e=>[e.id,e.label||e.id]);return e&&!n.some(t=>t.id===e)&&r.push([e,N(`settings.savedOption`,{id:e})]),r}function Lm(e,t){let n=t.sources.find(t=>t.id===e.desktopSource);return n&&Pm(n)===`input`?{text:N(`settings.desktopSourceIsMic`),tone:`warning`}:e.desktopSource&&t.sources.length&&!n?{text:t.warning||N(`settings.desktopSourceMissing`),tone:`warning`}:{text:N(`settings.desktopSourceHelp`)}}function Rm(e){let t=e.clipNameTemplate.trim();if(!t)return null;let n=lm(t,4,`Overwatch-2`,new Date);return n?{text:N(`settings.clipFilenameNext`,{name:n}),tone:`accent`}:{text:N(`settings.clipFilenameEmpty`),tone:`warning`}}var zm,Q,Bm,Vm=o((()=>{zm=l(d()),cc(),vc(),Ar(),mr(),rm(),xm(),Ba(),Wc(),Dl(),Cl(),Wu(),qu(),ic(),Em(),id(),md(),Q=M(),Bm=[[`recording`,`settings.secRecording`],[`audio`,`settings.secAudio`],[`hotkeys`,`settings.secHotkeys`],[`storage`,`settings.secStorage`],[`sharing`,`settings.secSharing`],[`discord`,`settings.secDiscord`],[`appearance`,`settings.secAppearance`],[`advanced`,`settings.secAdvanced`]]}));function Hm(e,t=14){return`${e}`}function Um(e){let t=Math.floor(e/60),n=Math.floor(e%60),r=Math.floor(e%1*10);return`${t}:${String(n).padStart(2,`0`)}.${r}`}var Wm,Gm,Km,qm,Jm,Ym,Xm,Zm=o((()=>{Ar(),Wm=[{id:`crossfade`,len:1,glyph:``},{id:`fadeblack`,len:.8,glyph:``},{id:`fadewhite`,len:.8,glyph:``},{id:`dipaccent`,len:.7,glyph:``},{id:`blurdis`,len:1.2,glyph:``},{id:`slide`,len:.8,glyph:``}],Gm={display:{label:`Geist`,stack:`'Geist', sans-serif`},body:{label:`Inter`,stack:`'Inter', sans-serif`},mono:{label:`JetBrains Mono`,stack:`'JetBrains Mono', monospace`}},Km=[{id:`title`,font:`display`,size:64,weight:600,color:`#f2f5fa`,x:50,y:44},{id:`subtitle`,font:`body`,size:34,weight:500,color:`#dbe1ea`,x:50,y:58},{id:`caption`,font:`mono`,size:22,weight:400,color:`#b8c0cd`,x:50,y:88},{id:`lower`,font:`display`,size:40,weight:600,color:`#f2f5fa`,x:22,y:84}],qm=[`#f2f5fa`,`#33adff`,`#c4b5fd`,`#6ee7b7`,`#fdba74`],Jm=e=>Wm.find(t=>t.id===e),Ym=e=>N(`editor.fx.${e}.name`),Xm={film:``,type:``,volumeX:``}}));function Qm(e){let t=null,n=null,r=0,i=!1,a=12,o=null,s=new Set,c=!1,l=!1,u,d=[],f=[],p=`library`,m=``,h=!1,g=null,_=!1,v=!1,y=!0,b=null,x=0,S={},C=``,w={},ee=``,te=null,ne=null,T=null,re=null,E=null,D=new Set,ie=()=>e.clips(),ae=()=>`i`+Math.random().toString(36).slice(2,9),O=e=>Math.round(e*1e3)/1e3,oe=e=>ie().find(t=>t.slug===e.clipId),k=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`,A=e=>String(e).replace(/&/g,`&`).replace(//g,`>`),se=e=>String(e).replace(/&/g,`&`).replace(/'/g,`'`).replace(/"/g,`"`),ce=(e,t)=>{try{e.setPointerCapture(t.pointerId)}catch{}},j=()=>t?t.items.reduce((e,t)=>Math.max(e,t.start+t.dur),0):0,le=e=>t.items.filter(t=>t.trackId===e).sort((e,t)=>e.start-t.start),ue=e=>e?t.items.find(t=>t.id===e)??null:null,de=()=>ue(n),fe=()=>t.tracks.filter(e=>e.type===`video`),pe=()=>Math.max(j()+30,90),me=e=>{let t=oe(e);return t&&t.duration?t.duration:(e.offset||0)+e.dur};function he(){return{version:1,tracks:[{id:`T1`,type:`text`,label:`T1`},{id:`V2`,type:`video`,label:`V2`},{id:`V1`,type:`video`,label:`V1`},{id:`A1`,type:`audio`,label:`A1`}],items:[]}}function ge(){let e=de(),n=!!(e&&r>e.start+.2&&r0,canRedo:f.length>0,preparing:_,empty:y}}function _e(){let e=ge();D.forEach(t=>t(e))}async function ve(){try{let e=await(await fetch(`/api/editor/project`)).json();t=e.project&&Array.isArray(e.project.tracks)&&e.project.tracks.length?e.project:he(),s=new Set(e.missing||[])}catch(e){console.debug(`Loading the editor project failed`,e),t=t||he()}c=!0,_e()}function ye(){l=!0,window.clearTimeout(u),u=window.setTimeout(()=>void be(),800)}async function be(){if(!(!l||!t)){l=!1;try{await fetch(`/api/editor/project`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}catch(e){console.debug(`Autosaving the editor project failed`,e),l=!0}}}function xe(){if(!t)return;let e=new Set(ie().map(e=>e.slug));s=new Set(t.items.filter(t=>t.clipId&&!e.has(t.clipId)).map(e=>e.clipId))}function Se(){d.push(JSON.stringify(t)),d.length>th&&d.shift(),f=[]}function Ce(){d.length&&(f.push(JSON.stringify(t)),t=JSON.parse(d.pop()),Te())}function we(){f.length&&(d.push(JSON.stringify(t)),t=JSON.parse(f.pop()),Te())}function Te(){n&&!ue(n)&&(n=null),xe(),ye(),At(),xt(!0)}function Ee(){t.items.forEach(e=>{if(e.trans&&e.kind===`clip`){let t=Math.min(3,O(e.dur*.8));e.trans.len=Math.min(Math.max(.2,e.trans.len),t)}})}function De(){Ee(),ye(),At(),xt(!0)}function Oe(e){let n=t.items.filter(t=>t.trackId===e.trackId&&t.id!==e.id).sort((e,t)=>e.start-t.start),r=Math.max(0,e.start);for(let t=0;trt.start);if(!t)break;let i=t.start-e.dur,a=t.start+t.dur;r=i>=0&&Math.abs(i-r)<=Math.abs(a-r)?i:a}return e.start=O(Math.max(0,r)),e}function ke(e){return t.items.push(Oe(e)),e}function Ae(e,n){let i=[0,r];t.items.forEach(e=>{e.id!==n&&i.push(e.start,e.start+e.dur)});let o=e,s=8/a;return i.forEach(t=>{let n=Math.abs(t-e);n{if(t.trackId!==e.trackId||t.id===e.id)return;let i=t.start+t.dur;i<=e.start+.001&&i>n&&(n=i),t.start>=e.start+e.dur-.001&&t.starte.slug===r);if(!s||!s.duration){e.notify(N(`editor.noReadableDuration`),`error`);return}Se(),n=ke({id:ae(),kind:o?`audio`:`clip`,trackId:i,clipId:r,start:O(Math.max(0,a)),dur:O(s.duration),offset:0}).id,De()}function Ne(e){if(!t)return;let n=fe(),r=n[n.length-1],i=le(r.id).reduce((e,t)=>Math.max(e,t.start+t.dur),0);Me(e,r.id,i,!1)}function Pe(e,i={}){if(!t)return;let a=Km.find(t=>t.id===e),o=t.tracks.find(e=>e.type===`text`);!a||!o||(Se(),n=ke({id:ae(),kind:`text`,trackId:o.id,start:O(Math.max(0,i.t===void 0?r:i.t)),dur:4,text:N(`editor.textPreset.${a.id}.sample`),font:a.font,size:a.size,weight:a.weight,color:a.color,x:i.x===void 0?a.x:O(i.x),y:i.y===void 0?a.y:O(i.y)}).id,De())}function Fe(e,t){let r=ue(e),i=Jm(t);!r||!i||r.kind!==`clip`||(Se(),r.trans={fx:t,len:Math.min(i.len,O(r.dur*.8))},n=e,De())}function Ie(){let e=de();if(!e||r<=e.start+.2||r>=e.start+e.dur-.2)return;Se();let n=r,i={...e,id:ae(),start:O(n),dur:O(e.start+e.dur-n),offset:O((e.offset||0)+(n-e.start))};delete i.trans,e.dur=O(n-e.start),t.items.push(i),De()}function Le(){let e=de();if(!e||e.kind!==`clip`||e.muted)return;let r=oe(e)?.audio_tracks;if(!r?.length)return;Se(),e.muted=!0;let i=null;for(let n of r){let r=t.tracks.find(n=>n.type===`audio`&&!t.items.some(t=>t.trackId===n.id&&t.starte.start));r||(r={id:ae(),type:`audio`,label:`A${t.tracks.filter(e=>e.type===`audio`).length+1}`},t.tracks.push(r));let a=ke({id:ae(),kind:`audio`,trackId:r.id,clipId:e.clipId,start:e.start,dur:e.dur,offset:e.offset||0,audioStream:n.index,volume:1,muted:n.index!==0});i??(i=a)}n=i.id,De()}function Re(){let e=de();if(!e)return;Se();let t={...e,id:ae(),start:O(e.start+e.dur+.25)};delete t.trans,ke(t),n=t.id,De()}function ze(){let e=de();e&&(o=JSON.parse(JSON.stringify(e)))}function Be(){if(!o||!t.tracks.find(e=>e.id===o.trackId))return;Se();let e={...o,id:ae(),start:O(r)};delete e.trans,ke(e),n=e.id,De()}function Ve(){n&&(Se(),t.items=t.items.filter(e=>e.id!==n),n=null,De())}function He(e){Se();let n=t.tracks.filter(t=>t.type===e).length+1,r={id:ae(),type:e,label:(e===`video`?`V`:`A`)+n};if(e===`audio`)t.tracks.push(r);else{let e=t.tracks.findIndex(e=>e.type===`video`);t.tracks.splice(e===-1?t.tracks.length:e,0,r)}De()}function Ue(e){let r=t.tracks.find(t=>t.id===e);!r||r.type===`text`||r.type===`video`&&fe().length<=1||(Se(),t.tracks=t.tracks.filter(t=>t.id!==e),t.items=t.items.filter(t=>t.trackId!==e),n=null,De())}function We(){Se(),t=he(),n=null,r=0,yt(!1),s=new Set,De()}function Ge(e){n=e,jt(),mt(r),_e()}function Ke(){if(!g||ne)return;let e=()=>{let e=g.stageWrap.getBoundingClientRect();if(e.width<10||e.height<10)return;let t=Math.min(e.width,e.height*16/9);g.stage.style.width=`${t}px`,g.stage.style.height=`${t*9/16}px`,gt()};ne=new ResizeObserver(e),ne.observe(g.stageWrap),e()}function qe(e){e.pause(),e.removeAttribute(`src`),e._key=null;try{e.load()}catch(e){console.debug(`Tearing down a preview element failed`,e)}e.remove()}function Je(){Object.keys(S).forEach(e=>{S[e].els.forEach(e=>qe(e)),delete S[e]}),C=``,te=null,Object.keys(w).forEach(e=>{let t=w[e];t.pause(),t.removeAttribute(`src`);try{t.load()}catch(e){console.debug(`Tearing down a preview audio element failed`,e)}delete w[e]})}function Ye(){if(!g)return;let e=fe(),t=e.map(e=>e.id).join(`,`);t!==C&&(C=t,Object.keys(S).forEach(t=>{e.find(e=>e.id===t)||(S[t].els.forEach(e=>qe(e)),delete S[t])}),e.forEach((t,n)=>{if(!S[t.id]){let e=()=>{let e=document.createElement(`video`);return e.playsInline=!0,e.preload=`auto`,e.className=`ed-vhide`,e._key=null,e._need=0,g.stage.insertBefore(e,g.stage.firstChild),e};S[t.id]={els:[e(),e(),e()],itemKey:null,shown:null,handover:!1,seq:0,zBase:0}}S[t.id].zBase=4*(e.length-n)}))}let Xe=(e,t)=>le(e).find(e=>e.kind===`clip`&&t>=e.start&&tle(e).find(e=>e.kind===`clip`&&e.start>t&&!s.has(e.clipId))||null,Qe=e=>{let t=oe(e);return e.id+`|`+(t?t.video_url:e.clipId)},$e=(e,t)=>le(e).filter(e=>e.kind===`clip`&&e.id!==t.id&&!s.has(e.clipId)&&Math.abs(e.start+e.dur-t.start)<.11).pop()||null;function et(e,t){let n=[],r=(e,t,r)=>{!e||n.some(t=>t.key===Qe(e))||oe(e)&&n.push({key:Qe(e),it:e,role:t,parkAt:r})},i=Xe(e,t);if(r(i,`cur`,(i&&i.offset||0)+(i?Math.max(0,t-i.start):0)),i&&i.trans&&t{let r=e.els.find(e=>e._key===t.key&&!n.has(e));r&&(t.el=r,n.add(r))}),t.forEach(t=>{if(t.el)return;let r=e.els.filter(e=>!n.has(e)),i=r.find(e=>!e._key)||r.sort((e,t)=>e._need-t._need)[0];i&&(i._key=t.key,i.src=kl(oe(t.it)),it(i,t.parkAt),t.el=i,n.add(i))}),t.forEach(t=>{t.el&&(t.el._role=t.role,t.el._need=e.seq)}),e.els.forEach(e=>{let t=e;n.has(e)||(t._role=null,ct(t),!t.paused&&!at(t)&&t.pause(),ot(t))}),t}function nt(e,t,n){if(!(e.readyState<1||e.seeking)&&Math.abs(e.currentTime-t)>(n||rh))try{e.currentTime=t}catch(e){console.debug(`Seeking a preview element failed`,e)}}let rt=()=>i?.45:rh;function it(e,t){e._parkAt=t||0,e._warmUntil=performance.now()+ah,e.muted=!0,e.play().catch(()=>{})}let at=e=>!!(e._warmUntil&&performance.now()e.role===`cur`),s=a.find(e=>e.role===`prev`);if(!o||!o.el)return r.els.forEach(ct),r.itemKey=null,r.shown=null,null;let c=o.it,l=o.el,u=s?s.el??null:null,d=r.itemKey!==o.key,f=n&&!r.wasMaster;r.wasMaster=n,d&&(r.itemKey=o.key,r.handover=!!(r.shown&&r.shown!==l)),r.handover&&l.readyState>=2&&!l.seeking&&(r.handover=!1);let p=!!(c.trans&&t{e===l?st(e,r.zBase+2):e===u&&p||e===r.shown&&r.handover?st(e,r.zBase+1):ct(e)});let m=(c.offset||0)+(t-c.start);return i&&!v?(l._warmUntil=0,l.muted=!!c.muted,l.paused&&l.play().catch(()=>{}),d||f?nt(l,m,rh):n||nt(l,m,rt())):at(l)?l._parkAt=m:(l.paused||l.pause(),l.muted=!!c.muted,nt(l,m)),r.handover||(r.shown=l),{it:c,cur:l,prev:u}}function ut(t,n){if(!g)return;let r=0,i=`#02040a`;t.forEach(t=>{if(!t)return;let{it:a,cur:o,prev:s}=t;if(o.style.opacity=``,o.style.filter=``,o.style.transform=``,s&&(s.style.transform=``,s.style.filter=``),!a.trans)return;let c=a.trans.len;if(n=a.start+c)return;let l=Math.max(0,Math.min(1,(n-a.start)/c)),u=a.trans.fx;if(u===`crossfade`||u===`blurdis`||u===`slide`){if(u===`crossfade`)o.style.opacity=String(l);else if(u===`blurdis`){o.style.opacity=String(l);let e=Math.sin(l*Math.PI)*Math.max(6,(g.stage.clientWidth||640)*.022);o.style.filter=`blur(${e.toFixed(1)}px)`,s&&(s.style.filter=`blur(${e.toFixed(1)}px)`)}else oh()?o.style.opacity=String(l):(o.style.transform=`translateX(${((1-l)*100).toFixed(2)}%)`,s&&(s.style.transform=`translateX(${(-l*100).toFixed(2)}%)`))}else{let t=u===`fadewhite`?`#f2f5fa`:u===`dipaccent`?e.accent():`#02040a`;r=Math.max(r,1-l),i=t}}),g.fadeOverlay.style.background=i,g.fadeOverlay.style.opacity=String(r)}function dt(e,t){if(!e||!e.prev||!e.it.trans)return;let{it:n,prev:r}=e;if(t>=n.start+n.trans.len)return;let a=$e(n.trackId,n);a&&(r.muted=!0,nt(r,Math.min((a.offset||0)+a.dur+(t-n.start),me(a)-.05),rt()),i&&!v&&r.paused?r.play().catch(()=>{}):(!i||v)&&!r.paused&&r.pause())}function ft(n){let r=new Set,a=[];t.items.forEach(t=>{if(t.kind!==`audio`||t.muted||(t.volume??1)===0||n=t.start+t.dur||s.has(t.clipId))return;let o=oe(t);if(!o)return;r.add(t.id);let c=w[t.id];c||(c=new Audio,c.preload=`auto`,c.addEventListener(`loadeddata`,()=>{h&&!i&&xt(!1)}),c.addEventListener(`error`,()=>{!c.getAttribute(`src`)||!h||(yt(!1),e.notify(N(`editor.audioPreviewFailed`),`error`))}),w[t.id]=c);let l=new URL(o.video_url,window.location.href).search,u=`/api/clips/${encodeURIComponent(o.slug)}/audio/${t.audioStream??0}${l}`;c.getAttribute(`src`)!==u&&(c.src=u),c.volume=Math.max(0,Math.min(1,t.volume??1)),nt(c,(t.offset||0)+(n-t.start),rt()),a.push(c)}),v=a.some(e=>e.readyState<2&&!e.error),a.forEach(e=>{i&&!v&&e.paused?e.play().catch(()=>{}):(!i||v)&&!e.paused&&e.pause()}),Object.keys(w).forEach(e=>{r.has(e)||(w[e].pause(),ue(e)||(w[e].removeAttribute(`src`),w[e].load(),delete w[e]))})}let pt=e=>t.items.filter(t=>t.kind===`text`&&e>=t.start&&ee.id).join(`,`)+`|`+n;if(i===ee){gt();return}ee=i,g.stage.querySelectorAll(`.ed-text-overlay`).forEach(e=>e.remove()),r.forEach(e=>{let t=document.createElement(`div`);t.className=`ed-text-overlay`+(n===e.id?` selected`:``),t.dataset.text=e.id;let r=document.createElement(`span`);r.textContent=e.text||``,t.appendChild(r),n===e.id&&[`tl`,`tr`,`bl`,`br`].forEach(n=>{let r=document.createElement(`span`);r.className=`ed-th `+n,r.addEventListener(`pointerdown`,n=>ht(n,t,e.id)),t.appendChild(r)}),g.stage.appendChild(t),t.addEventListener(`pointerdown`,n=>_t(n,t,e.id))}),gt()}function ht(e,t,n){e.stopPropagation(),e.preventDefault();let r=ue(n);if(!r)return;Se();let i=t.getBoundingClientRect(),a=i.left+i.width/2,o=i.top+i.height/2,s=Math.max(12,Math.hypot(e.clientX-a,e.clientY-o)),c=r.size,l=e.currentTarget;ce(l,e);let u=e=>{let t=Math.hypot(e.clientX-a,e.clientY-o);r.size=Math.round(Math.min(1e3,Math.max(8,c*t/s))),gt(),_e()},d=()=>{l.removeEventListener(`pointermove`,u),l.removeEventListener(`pointerup`,d),ye(),_e()};l.addEventListener(`pointermove`,u),l.addEventListener(`pointerup`,d)}function gt(){if(!g)return;let e=g.stage.clientWidth||1;g.stage.querySelectorAll(`.ed-text-overlay`).forEach(t=>{let n=ue(t.dataset.text??null);n&&(t.style.left=`${n.x}%`,t.style.top=`${n.y}%`,t.style.fontFamily=Gm[n.font]?.stack??Gm.display.stack,t.style.fontWeight=String(n.weight),t.style.fontSize=`${n.size*e/1920}px`,t.style.color=n.color,t.style.letterSpacing=n.font===`display`?`-.02em`:`0`)})}function _t(e,t,n){e.stopPropagation(),e.preventDefault(),Ge(n);let r=ue(n);if(!r||!g)return;Se();let i=g.stage.getBoundingClientRect(),a=r.x,o=r.y,s=e.clientX,c=e.clientY;ce(t,e);let l=e=>{r.x=O(Math.min(97,Math.max(3,a+(e.clientX-s)/i.width*100))),r.y=O(Math.min(95,Math.max(4,o+(e.clientY-c)/i.height*100))),gt(),_e()},u=()=>{t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),ye(),At()};t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u)}function vt(e,t){let n=de();if(n){if(n.kind===`audio`&&[`audioStream`,`volume`,`muted`].includes(e)){Se(),e===`muted`?n.muted=!!t:e===`audioStream`?n.audioStream=Number(t):n.volume=Math.max(0,Math.min(1,Number(t))),De();return}n.kind===`text`&&(Se(),n[e]=e===`size`?parseInt(String(t),10):t,ye(),ee=``,mt(r),e===`text`&&At(),_e())}}function yt(e){if(e&&j()<=0)return;if(e&&r>=j()-.01&&(r=0),i=e,_e(),!e){xt(!1);return}if(b)return;xt(!0);let t=()=>{!i||b||(x=performance.now(),b=requestAnimationFrame(bt))},n=te&&te.cur;if(n&&n.readyState<3){let e=!1,r=()=>{e||(e=!0,t())};n.addEventListener(`playing`,r,{once:!0}),n.addEventListener(`canplaythrough`,r,{once:!0}),window.setTimeout(r,400)}else t()}function bt(e){if(b=null,!i||!h){i=!1,xt(!1),_e();return}if(v&&(x=e,xt(!1),v)){b=requestAnimationFrame(bt);return}let t=j(),n=Math.min(.25,(e-x)/1e3);x=e,r=Math.min(t,r+n),xt(!1);let a=te;if(a&&!a.cur.paused&&!a.cur.seeking&&a.cur.readyState>=2){let e=a.it.start+(a.cur.currentTime-(a.it.offset||0));e>=a.it.start&&e<=a.it.start+a.it.dur&&Math.abs(e-r)<.5&&(r=Math.min(t,e))}if(Tt(),_e(),r>=t){yt(!1);return}i&&(b=requestAnimationFrame(bt))}function xt(e){if(!t||!h||!g)return;Ke(),Ye();let n=r;ft(n);let i=fe(),a=null,o=i.map(e=>{let t=lt(e.id,n,!a);return t&&!a&&(a=t),t});te=a,o.forEach(e=>dt(e,n)),ut(o,n),mt(n);let s=!o.some(e=>e),c=v||o.some(e=>{if(!e)return!1;let t=oe(e.it);return!!(t&&Ol(t)&&e.cur.readyState<2)});(s!==y||c!==_)&&(y=s,_=c,_e()),e&&Tt()}function St(e){a=Math.max($m,Math.min(eh,a*e)),At()}function Ct(){let e=g?g.timelineScroll.clientWidth-nh-20:900;a=Math.max($m,Math.min(eh,e/Math.max(10,j()+2))),At()}function wt(e){r=Math.max(0,Math.min(pe(),e)),Tt(),xt(!0),_e()}function Tt(){if(!g)return;let e=g.timelineCanvas.querySelector(`#ed-playhead`),t=g.timelineCanvas.querySelector(`#ed-ruler-cursor`);e&&(e.style.left=`${nh+r*a-.75}px`),t&&(t.style.left=`${r*a-4.5}px`)}function Et(e,t){let n=[],r=e*9301+49297;for(let e=0;et.index===(e.audioStream??0))?.title||N(`editor.recordedTrack`,{number:(e.audioStream??0)+1}),n=Et(Dt(e.clipId||``),Math.max(16,Math.round(e.dur*3))),r=n.map((e,t)=>``).join(``);return`
+`)}\n}`);let s=Qt(e);return s&&(o=o?`${o}\n\n${s}`:s),{prose:a,component:o}}var en,tn,nn,rn=o((()=>{Ot(),jt(),Rt(),en=`[data-${It}-theme]`,tn=new Set([`padding`,`paddingBlock`,`paddingInline`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInlineStart`,`paddingInlineEnd`]),nn={"4xs":`var(--font-size-4xs)`,"3xs":`var(--font-size-3xs)`,"2xs":`var(--font-size-2xs)`,xsm:`var(--font-size-xs)`,sm:`var(--font-size-sm)`,base:`var(--font-size-base)`,lg:`var(--font-size-lg)`,xl:`var(--font-size-xl)`,"2xl":`var(--font-size-2xl)`,"3xl":`var(--font-size-3xl)`,"4xl":`var(--font-size-4xl)`}}));function an(e){return Array.isArray(e)?`light-dark(${e[0]}, ${e[1]})`:e}function on(e,t){if(!e&&!t)return;if(!e)return t;if(!t)return e;let n={};for(let[t,r]of Object.entries(e))n[t]={...r};for(let[e,r]of Object.entries(t))if(!n[e])n[e]={...r};else for(let[t,i]of Object.entries(r))n[e][t]={...n[e][t],...i};return n}function sn(e){return{normal:`var(--font-weight-normal)`,medium:`var(--font-weight-medium)`,semibold:`var(--font-weight-semibold)`,bold:`var(--font-weight-bold)`}[e]??e}function cn(e,t){if(!e)return;let n=e.includes(` `)?`"${e}"`:e;return t?`${n}, ${t}`:n}function ln(e){let t={},n=e.extends;if(n)for(let[e,r]of Object.entries(n.tokens))t[e]=r;let r=e.typography,i;if(r?.scale){let e={},t=r.heading;if(t?.weights)for(let[n,r]of Object.entries(t.weights))r&&(e[Number(n)]=sn(r));let n=t?.weight?sn(t.weight):void 0;if(n)for(let t=1;t<=6;t++)t in e||(e[t]=n);let a={};r.body?.weight&&(a.body=sn(r.body.weight)),r.code?.weight&&(a.code=sn(r.code.weight)),i={base:r.scale.base,ratio:r.scale.ratio,weights:{...Object.keys(e).length>0?{heading:e}:{},...Object.keys(a).length>0?{text:a}:{}}}}if(e.color){let n=ft(e.color);for(let[e,r]of Object.entries(n))t[e]=r}if(i){let e=_e(i);for(let[n,r]of Object.entries(e))t[n]=r}if(e.radius){let n=ke(e.radius);for(let[e,r]of Object.entries(n))t[e]=r}if(e.motion){let n=De(e.motion);for(let[e,r]of Object.entries(n))t[e]=r}if(r){let e=cn(r.body?.family,r.body?.fallbacks),n=cn(r.heading?.family,r.heading?.fallbacks)??e,i=cn(r.code?.family,r.code?.fallbacks);e&&(t[`--font-family-body`]=e),n&&(t[`--font-family-heading`]=n),i&&(t[`--font-family-code`]=i)}if(e.syntax){let n=e.syntax.tokens;for(let[e,r]of Object.entries(n))t[`--color-syntax-`+e]=r}if(e.tokens)for(let[n,r]of Object.entries(e.tokens))r!==void 0&&(t[n]=an(r));let a=e.components;i&&(a=on(ve(i),e.components)),n?.components&&(a=on(n.components,a));let o=le(`dark`,e.onDark),s=le(`light`,e.onLight),c=e.icons&&n?.icons?{...n.icons,...e.icons}:e.icons??n?.icons,l=e.indicators&&n?.indicators?{...n.indicators,...e.indicators}:e.indicators??n?.indicators,u={name:e.name,tokens:t,components:a,icons:c,indicators:l,__inputTokens:e.tokens,__onDark:o,__onLight:s};return wt(u),u}var un=o((()=>{fe(),ce(),Te(),Oe(),Ae(),_t(),Ct(),Et(),rn(),{...ne,...T,...re,...E,...D,...ie,...ae,...O,...oe,...k,...A,...se,...St}})),dn,fn,pn=o((()=>{dn=l(d(),1),fn=(0,dn.createContext)(null),fn.displayName=`ThemeContext`})),mn=o((()=>{})),hn=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=s(((e,t)=>{t.exports=hn()}));function gn(e){let t=(0,yn.useId)();(0,yn.useInsertionEffect)(()=>{if(e.__built)return;let n=`astryx-theme-${e.name}`;if(Cn.has(n))return;`${e.name}`,`${e.name}${e.name}${e.name}${e.name}`;let{prose:r,component:i}=$t(e);if(!(!r&&!i)){if(r){let n=document.createElement(`style`);n.setAttribute(Mt(`theme-prose`),e.name),n.setAttribute(Mt(`id`),t),n.textContent=`@layer reset {\n${r}\n}`,document.head.appendChild(n)}if(i){let n=document.createElement(`style`);n.setAttribute(Mt(`theme`),e.name),n.setAttribute(Mt(`id`),t),n.textContent=`@layer astryx-theme {\n${i}\n}`,document.head.appendChild(n)}return Cn.add(n),()=>{let r=document.querySelector(`style[${Mt(`theme-prose`)}="${e.name}"][${Mt(`id`)}="${t}"]`),i=document.querySelector(`style[${Mt(`theme`)}="${e.name}"][${Mt(`id`)}="${t}"]`);r?.remove(),i?.remove(),Cn.delete(n)}}},[e,t])}function _n(e,t,n){y(()=>{if(!e&&!(typeof document>`u`))return t===`light`||t===`dark`?document.documentElement.setAttribute(`data-theme`,t):document.documentElement.removeAttribute(`data-theme`),document.documentElement.setAttribute(Mt(`theme`),n),()=>{document.documentElement.removeAttribute(`data-theme`),document.documentElement.removeAttribute(Mt(`theme`))}},[e,t,n])}function vn({theme:e,mode:t=`system`,children:n}){let r=(0,yn.use)(Sn);wt(e),gn(e),_n(r,t,e.name);let i=t===`dark`?xn.dark:t===`light`?xn.light:xn.system,a=(0,yn.useMemo)(()=>({theme:e,mode:t}),[e,t]);return(0,bn.jsx)(fn,{value:a,children:(0,bn.jsx)(Sn,{value:!0,children:(0,bn.jsx)(`div`,{...S(xn.base,i),"data-astryx-theme":e.name,"data-theme":t===`system`?void 0:t,children:n})})})}var yn,bn,xn,Sn,Cn,wn=o((()=>{yn=l(d(),1),b(),te(),un(),Et(),Rt(),pn(),mn(),bn=M(),xn={base:{k1xSpc:`xjp7ctv`,kMwMTN:`x1tgivj0`,kMv6JI:`x9ynric`,$$css:!0},light:{kQNsl9:`x19aimcq`,$$css:!0},dark:{kQNsl9:`xntwwlm`,$$css:!0},system:{kQNsl9:`x108lcm5`,$$css:!0}},Sn=yn.createContext(!1),Sn.displayName=`ThemeNestingContext`,Cn=new Set,vn.displayName=`Theme`}));function Tn(e){return Array.isArray(e)?`light-dark(${e[0]}, ${e[1]})`:e}function En(e){let t=On.filter(t=>!(t in e.tokens));t.length>0&&`${e.name}${t.join(`, `)}`;let n={};for(let t of On)n[t]=Tn(e.tokens[t]);return{name:e.name,tokens:n,__inputTokens:{...e.tokens}}}var Dn,On,kn=o((()=>{yt(),mn(),Dn=`--color-syntax-`,On=Object.keys(vt).map(e=>e.replace(Dn,``))})),An=o((()=>{yt(),kn()})),jn=o((()=>{wn(),te(),ce(),Rt(),un(),Et(),Ct(),An(),Te(),_t(),pn(),Re()})),Mn=o((()=>{})),Nn=o((()=>{})),Pn=o((()=>{})),Fn=o((()=>{})),In=o((()=>{})),Ln=o((()=>{})),Rn=o((()=>{})),zn=o((()=>{})),Bn=o((()=>{})),Vn=o((()=>{})),Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr=o((()=>{Hn={name:`Vice`},Un={delete:`Delete`,keepIt:`Keep it`,cancel:`Cancel`,save:`Save`,close:`Close`,noActions:`No actions`,untagged:`Untagged`,create:`Create`,gotIt:`Got it`,new:`New`,dismiss:`Dismiss`},Wn={allClips:`All Clips`,countClips:{one:`{count} clip`,other:`{count} clips`},countMatches:{one:`{count} match for “{query}”`,other:`{count} matches for “{query}”`},playlistOptions:`Playlist options`,newPlaylist:`New playlist`,saveClip:`Save clip`,hotkeysUnavailableTitle:`Global hotkeys are not available.`,hotkeysUnavailableBody:`Vice cannot read your keyboard, so {hotkey} will not save a clip. The Save clip button above still works. Adding your user to the input group and logging back in usually fixes it.`,emptySearch:`Nothing matches “{query}”.`,emptyPlaylist:`This playlist is empty. Drag a clip onto it, or right-click a clip to add it.`,emptyLibrary:`No clips yet. Press {hotkey} to save the last {duration} seconds.`,editPlaylist:`Edit playlist`,deletePlaylist:`Delete playlist`,confirmDeleteTitle:`Delete this playlist?`,confirmDeleteBody:`The clips themselves stay put. Only the playlist goes.`,confirmDeleteAuto:` This one was created automatically, so Vice will not build it again for this game.`,playlistUpdated:`Playlist updated`,playlistDeleted:`Playlist deleted`,playlistCreated:`Playlist “{name}” created`,errSaveClip:`Could not save a clip`,errUpdatePlaylist:`Could not update the playlist`,errCreatePlaylist:`Could not create the playlist`,errDeletePlaylist:`Could not delete the playlist`,imagesHeading:{one:`{count} screenshot`,other:`{count} screenshots`}},Gn={greetingMorning:`Good morning`,greetingAfternoon:`Good afternoon`,greetingEvening:`Good evening`,quickSettings:`Quick settings`,storage:`Storage`,diskFree:`Free space`,diskLibrary:`Vice library`,diskUnknown:`Not measured`,lastClip:`Last clip`,lastClipNever:`None yet`,diskBar:`{used} of {total} used, {library} of it Vice`,microphone:`Microphone`,desktopAudio:`Desktop audio`,publicLink:`Public link`,on:`On`,off:`Off`,active:`Active`,starting:`Starting`,connecting:`Connecting`,localOnly:`Local only`,tapToCopy:`Tap to copy`,cloudflaredStarting:`cloudflared is starting up`,linksWorkOnNetwork:`Links work on this network`,copyPublicLink:`Copy the public link`,noPublicLinkYet:`No public link yet`,saveClipNow:`Save clip now`,allClips:`All clips`,settings:`Settings`,recentClips:`Recent clips`,seeAll:`See all`,mostViewed:`Most viewed`,playlists:`Playlists`,emptyReel:`No clips yet. Press {hotkey} to start your reel.`,lede:`The last {duration} of your gameplay are always in the buffer. Press {hotkey} to keep them. Double-tap to start a session.`,micOn:`Microphone on`,micOff:`Microphone off`,micOnDetail:`Included in new clips`,micOffDetail:`Removed from new clips`,desktopAudioOn:`Desktop audio on`,desktopAudioOff:`Desktop audio off`,publicLinkStarting:`Public link starting`,publicLinkStopped:`Public link stopped`,publicLinkCopied:`Public link copied`,enablePublicLinkFirst:`Enable the public link first`,savedNotApplied:`Saved, but not applied`,errMic:`Could not change the microphone setting`,errDesktopAudio:`Could not change desktop audio`,errPublicLink:`Could not change the public link`,errSaveClip:`Could not save a clip`,wfMicTitle:`How should the microphone be mixed in?`,wfMicBody:`wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.`,wfMicBothLabel:`Use a backend that can do both`,wfMicBothHelp:`Vice records with a compatible backend whenever the microphone is on.`,wfMicOnlyLabel:`Microphone only`,wfMicOnlyHelp:`Desktop audio is dropped while the microphone is on.`,copyLinkTitle:`Copy this link`,copyLinkBody:`The clipboard was not available, so here is the link to copy by hand.`,restartTitle:`Restart Vice to finish`,restartBody:`That setting is saved, but it only takes effect once the daemon restarts.`,gotIt:`Got it`},Kn={unreadable:`Unreadable`,unreadableNote:`{reason}. The file is still on disk.`,unreadableFallback:`ffmpeg could not read this file`,openTitle:`Open {name}`,renameHint:`{name}, double-click to rename`,trim:`Trim`,copyVideo:`Copy video to clipboard`,copyShareLink:`Copy share link`,noShareLink:`No share link yet`,reveal:`Reveal in file manager`,delete:`Delete`,open:`Open`,rename:`Rename`,copyVideoShort:`Copy video`,deleteClip:`Delete clip`,videoCopied:`Video copied, paste it anywhere`,errCopyVideo:`Could not copy the video`,renameFailed:`Rename failed`,savedAs:`Saved as {name}`,addTo:`Add to {playlist}`,removeFrom:`Remove from {playlist}`,addedTo:`Added to {playlist}`,removedFrom:`Removed from {playlist}`,playlistUnchanged:`The playlist did not change`,nameLabel:`Clip name`,views:{one:`{count} view`,other:`{count} views`},noShareLinkYet:`No share link for this clip yet`,linkCopiedLocal:`Link copied, but it is local only`,linkCopiedLocalDetail:`Install cloudflared for links that work off your network`,shareLinkCopied:`Share link copied`,alreadyIn:`Already in {playlist}`,errAddClip:`Could not add the clip`},qn={editTitle:`Edit playlist`,newTitle:`New playlist`,nameRequired:`Give the playlist a name`,name:`Name`,emoji:`Emoji`,emojiPlaceholder:`Optional`,colour:`Playlist colour`},Jn={quitConfirm:`Stop Vice and quit? The recording daemon will shut down.`,minimize:`Minimize`,quit:`Quit`},Yn={notRecording:`Vice is not recording.`,cpuFallback:`Recording on the CPU.`,codecFallback:`Recording with a different codec.`,cannotPlay:`Clips cannot play inside this window.`,notRecordingHelp:`Vice keeps retrying on its own. If it is an encoder problem, a reboot after a driver update usually clears it, or pick a different encoder under Settings, Recording.`,cpuFallbackHelp:`Your GPU encoder would not open, so Vice fell back to CPU encoding to keep clipping. That costs frames in games. This is usually a driver that needs a reboot after an update. Vice tries the GPU first every time it starts, so once that is sorted this goes away on its own.`,codecFallbackHelp:`Your GPU would not encode the codec picked under Settings, Recording, so gpu-screen-recorder chose one it can handle. Recording is still on the GPU and clips are unaffected. Choosing a different encoder yourself stops this notice, and H.264 in particular tops out at 4096 pixels wide on NVIDIA, so HEVC or AV1 is the one to pick on a wide monitor.`,cannotPlayHelp:`The installed Qt WebEngine build has no H.264 decoder. Recording still works, and clips open fine in your system player. To fix in-app playback, install your distro's WebEngine package and reinstall Vice:`},Xn={cannotReach:`Cannot reach the daemon`,notRecording:`Not recording`,keepsRetrying:`Vice keeps retrying`,sessionRecording:`Session recording`,bufferRunning:`Buffer running`,starting:`Starting`},Zn={releaseNotes:`Release notes`,copyCommand:`Copy command`,commandCopied:`Command copied, paste it into a terminal`,copyByHand:`The clipboard was not available, so here is the command to copy by hand.`,later:`Later`,title:`Vice {version} is available`,youAreOn:`You are on {version}.`,olderRelease:`an older release`,updateWith:` Update with:`,copyTitle:`Copy this command`},Qn={addTrack:`Add track`,none:`No separate tracks. Everything is mixed into one, which is what most people want.`,mixOfAll:`Mix of all tracks`,trackLabel:`Track {n}`,sourceToAdd:`Audio source to add as a track`,refresh:`Refresh the source list`,moveEarlier:`Move earlier`,moveLater:`Move later`,removeTrack:`Remove this track`,moveEarlierAria:`Move {name} earlier`,moveLaterAria:`Move {name} later`,removeAria:`Remove {name}`,droppedWarning:{one:`Capture desktop audio is off, so this track will not be recorded: {list}.`,other:`Capture desktop audio is off, so these tracks will not be recorded: {list}.`},trimmedWarning:{one:`{count} more will keep only its microphone sources.`,other:`{count} more will keep only their microphone sources.`},turnBackOn:`Turn desktop audio back on above to keep them.`},$n={pressKey:`Press a key`,setKey:`Set key`},er={allClips:`All Clips`,images:`Images`,home:`Home`,editor:`Editor`,settings:`Settings`,about:`About`,playlists:`Playlists`,newPlaylist:`New playlist`,search:`Search clips`,dragToStart:`Drag a clip here to start one.`,quickStart:`Quick start`,buffer:`Buffer`,update:`Update`,open:`Open`,useEmoji:`Use {emoji}`,errSetEmoji:`Could not set the emoji`,main:`Main`},tr={errReveal:`Could not open the file manager`,errSystemPlayer:`Could not open the system player`,clipDeleted:`Clip deleted`,errDelete:`Could not delete the clip`,confirmDeleteTitle:`Delete this clip?`,confirmDeleteBody:`{name} will be removed from disk. This cannot be undone.`,copyLinkTitle:`Copy this link`,copyLinkBody:`The clipboard was not available, so here is the link to copy by hand.`,highlight:`Highlight`,highlightNumbered:`{base} {n}`,errAddHighlight:`Could not add the highlight`,errMoveHighlight:`Could not move the highlight`,errUpdateHighlight:`Could not update the highlight`,errDeleteHighlight:`Could not delete the highlight`,daemonNoMark:`The daemon did not return the mark`,daemonRejectedMove:`The daemon rejected the move`,daemonRejectedChange:`The daemon rejected the change`,play:`Play`,pause:`Pause`,preparingPreview:`Preparing the H.265 preview`,openInPlayer:`Open in system player`,showInFolder:`Show in folder`,addHighlight:`Add highlight`,noHighlights:`No highlights yet. Press`,addHighlightKey:`Add highlight {key}`,noHighlightsHelp:`No highlights yet. Press {key} to mark the current timestamp.`,prevClip:`Previous clip`,nextClip:`Next clip`,changeColour:`Change colour`,changeColourAria:`Change the colour of {name}`,doubleClickRename:`Double-click to rename`,removeHighlight:`Remove`,removeHighlightAria:`Remove {name}`,copyShareLink:`Copy share link`,closePlayer:`Close the player`,volume:`Volume`,mute:`Mute`,unmute:`Unmute`,highlightLabel:`Highlight label`,highlightAt:`{label} at {time}`,useColour:`Use {color}`,highlightsHeading:`Highlights`,trim:`Trim`,share:`Share`,reveal:`Reveal`,delete:`Delete`,shortcuts:`Left and right step clips · H marks a highlight · Esc closes`,playbackFailed:`Vice could not play this clip in the app window. The file itself is most likely fine.`,noH264Decoder:`This Qt WebEngine build has no H.264 decoder, so clips cannot play inside Vice. The file itself is fine.`,saveFrame:`Save this frame`,saveFrameHint:`Save the current frame as a screenshot (S)`,frameSaved:`Frame saved and copied`,frameSavedNotCopied:`Frame saved, but not copied`,errSaveFrame:`Could not save the frame`,muteHint:`Mute (M)`,unmuteHint:`Unmute (M)`,expand:`Fill the window`,shrink:`Back to normal size`,expandHint:`Fill the window (F, or double-click)`,shrinkHint:`Back to normal size (F, or Esc)`},nr={saved:`Clip trimmed and saved`,failed:`The trim failed`,errTrim:`Could not trim the clip`,preview:`Preview`,stop:`Stop`,loopHelp:`Loops the selection. Cut bounds are lossless.`,saving:`Saving`,saveTrim:`Save trim`,preparingPreview:`Preparing the H.265 preview`,openInPlayer:`Open in system player`,showInFolder:`Show in folder`,title:`Trim · {name}`,in:`In`,out:`Out`,duration:`Duration`,startOfSelection:`Start of the selection`,endOfSelection:`End of the selection`,trimAria:`Trim {name}`,heading:`Trim`},rr={heading:`Images`,countImages:{one:`{count} screenshot`,other:`{count} screenshots`},countMatches:{one:`{count} match for “{query}”`,other:`{count} matches for “{query}”`},emptySearch:`Nothing matches “{query}”.`,emptyLibrary:`No screenshots yet. Press {hotkey} to save what is on screen.`,emptyNoKey:`No screenshots yet. Set a screenshot key in Settings, or open a clip and save a frame from it.`,captureMoment:`Keep a moment`,roomForMore:`Room for your next moment`,captureHint:`Press {hotkey} to save a screenshot.`,captureNoKey:`Set a screenshot key in Settings, or save a frame from a clip.`,openTitle:`Open {name}`,open:`Open`,openExternally:`Open in image viewer`,copy:`Copy image`,copied:`Image copied`,errCopy:`Could not copy the image`,errOpen:`Could not open the image`,deleteImage:`Delete screenshot`,deleted:`Screenshot deleted`,errDelete:`Could not delete the screenshot`,confirmDeleteTitle:`Delete this screenshot?`,confirmDeleteBody:`{name} will be moved to the trash. This cannot be undone from here.`,pen:`Pen`,penOn:`Pen on`,penColour:`Pen colour`,undo:`Undo`,saveDrawing:`Save drawing`,saving:`Saving`,saved:`Drawing saved`,errSave:`Could not save the drawing`,errCanvas:`This window could not render the image`,prev:`Previous image`,next:`Next image`,shortcuts:`Arrows step, F fills the window, Ctrl+Z undoes, Esc closes`},ir={pickColour:`Pick a colour`,startClipping:`Start clipping, then let Vice run`,playlistsTitle:`Playlists sort the reel`,colourBody:`Vice takes its colour from one of these. The whole window changes as you pick, so choose the one you want to look at, and change it any time in Settings.`,quickStartBody:`Vice keeps the buffer live in the background and opens this window only when you need it.`,playlistsBody:`Every clip can live in any number of playlists, and they keep themselves in order.`,saveLast:`Save the last {duration}s`,saveLastHelp:`Press {hotkey} after something worth keeping.`,sessionTitle:`Double-tap {hotkey} for a session`,sessionHelp:`Double-tap to start or stop a full recording. Tap once during a session to mark a highlight.`,reviewTitle:`Review, trim and share`,reviewHelp:`Open any clip to rename it, trim the best moment, share a link, or press H to add highlights.`,backgroundTitle:`Close the window safely`,backgroundHelp:`Minimize or close this window and Vice keeps recording. Discord Rich Presence is on by default and lives in Settings.`,autoTitle:`Auto playlists`,autoHelp:`Clips are filed under the game you were playing when you saved them. Vice builds these on its own.`,customTitle:`Custom playlists`,customHelp:`Create your own from the sidebar, pick an emoji and a colour, then drag clips onto it or right-click a clip to add it.`,safeTitle:`Nothing goes stale`,safeHelp:`Playlists follow clips through renames and trims, and tidy up after deletions.`,next:`Next`,back:`Back`,gotIt:`Got it`,badgeClip:`Clip`,badgeBg:`BG`,badgeAuto:`Auto`,badgeNew:`New`,badgeSafe:`Safe`,accentLabel:`{name} accent`,bufferTitle:`How far back Vice can reach`,bufferBody:`Vice is always recording into a buffer it throws away. Pressing the clip key keeps the last stretch of it, and this is how long that stretch is.`,bufferLabel:`Instant replay length`,bufferNote:`The buffer holds {buffer} at a time. A longer one costs memory, and Settings has the whole picture, including writing it to disk instead.`,clipKeyLabel:`Clip key`,screenshotKeyLabel:`Screenshot key`,screenshotKeyNote:`The screenshot key is unset until you set one. It saves a picture of the screen to the Images section and puts it on your clipboard.`,errSave:`Could not save that`,editorTitle:`The Editor`,editorHelp:`Put several clips on a timeline, cut them together, add text and transitions, and export one video. It is in the sidebar.`,badgeEdit:`Edit`,shareTitle:`Sending a clip to someone`,shareBody:`Every clip has a link, and copying it is one button on the card.`,linkTitle:`Copy link`,linkHelp:`The link button on a clip copies an address that plays the clip in a browser. Paste it into Discord and it embeds.`,tunnelTitle:`Local, or reachable from anywhere`,tunnelHelp:`On its own the link only works on this machine. Turn on the Cloudflare tunnel in Settings and it works anywhere, until the daemon restarts and the address changes.`,badgeLink:`Link`,badgeTunnel:`Net`,moreTitle:`The rest lives in Settings`,moreBody:`That is everything you need. Settings has the parts you only touch once.`,recTitle:`Recording`,recHelp:`Encoder, resolution, frame rate, which monitor, and which audio goes on which track.`,badgeRec:`Rec`},ar={blue:`Blue`,purple:`Purple`,green:`Green`,red:`Red`,orange:`Orange`,customTitle:`Custom colour`,customBody:`Pick any colour and Vice builds a full Material 3 scheme from it. Only the hue carries over: the surfaces, the buttons and the text tones are worked out from it, the same way the five presets are.`,useThis:`Use this colour`,hue:`Hue`,saturation:`Saturation and brightness`,hexLabel:`Hex value`,previewTitle:`Vice_Clip_12`,previewMeta:`20s · 1920x1080 · 14.2 MB`,previewPrimary:`Save clip`,previewQuiet:`Trim`,previewChip:`Deadlock`,lowContrast:`This colour does not leave enough contrast to read comfortably. Vice has lightened the accent as far as it can; try something less dark.`},or={clipSaved:`Clip saved`,savingClip:`Saving clip`,errSaveClip:`Could not save the clip`,recorderSilent:`The recorder did not say why`,publicLinkReady:`Public link ready`,noPublicLink:`No public link`,tunnelUnavailable:`The share tunnel is unavailable`,sessionRecording:`Session recording`,doubleTapToStop:`Double-tap the clip key to stop`,sessionSaved:`Session saved`,highlightMarked:`Highlight marked`,cannotPlay:`Clips cannot play in this window`,noH264:`This Qt WebEngine build has no H.264 decoder`,notSaved:`The change was not saved`,imageSaved:`Screenshot saved`,errScreenshot:`Could not take the screenshot`,screenshotNotCopied:`Screenshot saved, but not copied`,updating:`Vice is updating to {version}`,updatingDetail:`The recorder restarts to pick up the new version. This window reconnects on its own.`},sr={title:`About`,subtitle:`Vice, the game clip recorder for Linux`,tagline:`Linux-first, open source game clipping.`,waylandAndX11:`Wayland and X11`,system:`System`,version:`Version`,backend:`Backend`,buffer:`Buffer`,frameRate:`Frame rate`,clipsOnDisk:`Clips on disk`,totalFootage:`Total footage`,credits:`Credits`,creator:`Creator and maintainer`,community:`Community contributors`,communityHelp:`Bug reports, translations, patches`,dangerZone:`Danger zone`,uninstallHelp:`Uninstalling removes Vice, its systemd units and the udev rules. Your clips stay where they are.`,copy:`Copy`,commandCopied:`Command copied, paste it into a terminal`,copyTitle:`Copy this command`,copyByHand:`The clipboard was not available, so here is the command to copy by hand.`},cr={nothingAtPlayhead:`Nothing at the playhead`,dragFromLibrary:`Drag a clip from the library onto the timeline below.`,preparingPreview:`Preparing the H.265 preview`,removeTitle:`Remove title`,play:`Play`,pause:`Pause`,detachAudio:`Detach audio`,clearTitle:`Clear the timeline?`,clearBody:`Every clip, title and transition on the timeline goes. Your clips stay on disk.`,exportCanceled:`Export canceled`,exportFailed:`Export failed`,pickFolder:`Pick a folder for the export`,exportRefused:`The export was refused`,errStartExport:`Could not start the export`,startExport:`Start export`,cancelExport:`Cancel export`,saveAs:`Save as`,viceLibrary:`Vice library (default)`,customPath:`Custom path`,alsoAddToLibrary:`Also add to the Vice library`,encoding:`Encoding H.264. You can leave this open or carry on elsewhere in Vice.`,videoTrack:`Video track`,audioTrack:`Audio track`,tabLibrary:`Library`,tabEffects:`Effects`,tabText:`Text`,searchClips:`Search clips`,libHintLibrary:`Drag a clip onto the timeline, or double-click to append`,libHintEffects:`Drag an effect onto a clip, or between two clips`,libHintText:`Drag a title onto the preview or the T1 lane`,titleSection:`Title`,closeInspector:`Close the inspector`,titleText:`Title text`,font:`Font`,size:`Size`,colour:`Colour`,titleSize:`Title size`,useColour:`Use {color}`,reset:`Reset`,backToStart:`Back to the start`,playPause:`Play or pause, space`,exportBtn:`Export`,split:`Split`,duplicate:`Duplicate`,fit:`Fit`,zoomOut:`Zoom out`,zoomIn:`Zoom in`,addTrack:`Track`,clear:`Clear`,exportVideo:`Export video`,done:`Done`,exportFilename:`Export filename`,exportFilenamePlaceholder:`Vice_Edit_1 (automatic if empty)`,location:`Location`,exportLocation:`Export location`,folder:`Folder`,exportFolder:`Export folder`,audioDetached:`Audio detached`,transShorter:`Shorter`,transLonger:`Longer`,transRemove:`Remove transition`,junctionTitle:`{name} · {len}s, click to edit`,trackOptionsHint:`Right-click for track options`,libClipHint:`Drag to the timeline, or double-click to append`,libNoMatch:`No clips match`,libNoMatchBody:`Try a different search.`,libEmpty:`No clips yet`,libEmptyBody:`Save some gameplay first.`,noReadableDuration:`That clip has no readable duration yet`,menuSplit:`Split at playhead`,menuDetach:`Detach audio`,menuCopy:`Copy`,menuPaste:`Paste`,menuDuplicate:`Duplicate`,menuDelete:`Delete`,menuAddVideoTrack:`Add video track`,menuAddAudioTrack:`Add audio track`,menuRemoveTrack:`Remove track {name}`,fx:{crossfade:{name:`Crossfade`,desc:`Blend outgoing into incoming`},fadeblack:{name:`Fade to black`,desc:`Dip through pure black`},fadewhite:{name:`Fade to white`,desc:`Bloom through white`},dipaccent:{name:`Dip to accent`,desc:`Flash the theme colour`},blurdis:{name:`Blur dissolve`,desc:`Defocus across the cut`},slide:{name:`Slide`,desc:`Incoming pushes in from the right`}},textPreset:{title:{name:`Title`,sample:`Match point`},subtitle:{name:`Subtitle`,sample:`Ranked grind`},caption:{name:`Caption`,sample:`1920x1080 · 60 fps`},lower:{name:`Lower third`,sample:`Player · support`}},exported:`Exported.`,encodingProgress:`{percent}% encoding`,audioSource:`Recorded source`,recordedTrack:`Track {number}`,audioVolume:`Volume`,audioMuted:`Muted`,audioPreviewFailed:`Could not play this audio track. Try again or check the log.`,detachedTracksHelp:`Each recorded source has its own lane. Only track 1 starts enabled, so a combined track is not mixed twice. Unmute the sources you want to hear.`,preparingMedia:`Preparing preview`},lr=JSON.parse(`{"title":"Settings","subtitle":"Tune Vice to the way you play","sections":"Settings sections","loading":"Loading your settings.","secRecording":"Recording","secAudio":"Audio","secHotkeys":"Hotkeys","secStorage":"Storage","secSharing":"Sharing","secDiscord":"Discord","secAppearance":"Appearance","secAdvanced":"Advanced","cardDiscord":"Discord Rich Presence","optAutoRecommended":"Auto (recommended)","bufferDuration":"Buffer duration","bufferOnDisk":"Buffer is kept on disk, so long durations are fine.","bufferPlain":"Seconds of gameplay kept in the rolling buffer","bufferRamWarning":"A {length} buffer in RAM uses roughly {gb} GB at typical bitrates. Auto storage moves it to disk.","replayStorage":"Replay storage","replayStorageHelp":"Where the rolling buffer lives. Auto keeps short buffers in RAM and moves anything over ten minutes to disk.","replayRam":"RAM","replayDisk":"Disk","clipDuration":"Clip duration","clipDurationHelp":"Seconds saved when you press the clip key","frameRate":"Frame rate","frameRateHelp":"Capture frames per second","fpsOption":"{fps} fps","resolution":"Resolution","resolutionHelp":"Auto matches your display","resolutionAuto":"Auto","resolutionCustom":"Custom","customResolution":"Custom resolution","customResolutionHelp":"Width by height, for example 1600x900","customResolutionWarn":"Write it as width by height, like 1600x900.","badResolutionTitle":"That resolution is not a size","badResolutionDetail":"Write it as width by height, like 1600x900","container":"Container","containerHelp":"MKV survives crashes better and suits multi-track audio. Discord embeds and browsers need MP4.","containerMp4":"MP4 (best compatibility)","containerMkv":"MKV (crash-safe)","encoder":"Video encoder","encoderHelp":"GPU encoders are faster and use less CPU. Vulkan options require the gpu-screen-recorder backend.","encoderH264Vulkan":"H.264 (Vulkan, GSR)","encoderHevcVulkan":"HEVC (Vulkan, GSR)","encoderAv1Vulkan":"AV1 (Vulkan, GSR)","encoderH264Nvenc":"NVIDIA H.264 (NVENC)","encoderHevcNvenc":"NVIDIA H.265 (NVENC)","encoderH264Vaapi":"AMD or Intel H.264 (VAAPI)","encoderHevcVaapi":"AMD or Intel H.265 (VAAPI)","encoderAv1Nvenc":"NVIDIA AV1 (NVENC, RTX 40 and up)","encoderAv1Vaapi":"AMD or Intel AV1 (VAAPI)","encoderX264":"Software H.264 (x264)","encoderX265":"Software H.265 (x265)","colourDepth":"Colour depth","colourDepthHelp":"8-bit suits every player. 10-bit needs an HEVC or AV1 encoder.","colour8":"8-bit (standard)","colour10":"10-bit (HEVC or AV1)","hardwareDecode":"Hardware video decode in previews","hardwareDecodeHelp":"Let your GPU decode clips in this window instead of the CPU. Worth turning on if high-resolution AV1 or HEVC previews stutter. It renders video black on some drivers, so if that happens turn it back off. Takes effect next time you open Vice.","backend":"Recording backend","backendHelp":"Screen capture method","backendWf":"wf-recorder (Wayland)","backendFfmpeg":"ffmpeg (X11)","followMouse":"Follow my mouse","followMouseHelp":"Record whichever monitor the pointer is on. Switching monitors restarts the buffer, so a clip taken right after moving will be short.","followMouseUnsupported":"Needs X11, Hyprland or Sway. Vice cannot tell where the pointer is on this session.","display":"Display","displayAuto":"Auto (backend default)","savedOption":"{id} (saved)","displayMissing":"Display \\"{id}\\" is not being reported right now. It is still saved and will be used if it comes back.","displayWarning":"{warning} Auto will still work.","displayNone":"No individual displays were detected. Auto will still work.","displayHelp":"Choose which display to record. Auto follows the backend default.","displayLoadFailed":"Could not load display options.","captureDesktopAudio":"Capture desktop audio","captureDesktopAudioHelp":"Include system sound in clips","captureMic":"Capture microphone","captureMicHelp":"Record your mic into clips. The same switch as the tile on Home, and saved the moment you flip it.","micOn":"Microphone on","micOff":"Microphone off","micOnDetail":"Included in new clips","micOffDetail":"Removed from new clips","errMic":"Could not change the microphone setting","desktopSource":"Desktop audio source","desktopSourceIsMic":"This is a microphone input, so clips would have no desktop audio. Pick one under Desktop audio instead.","desktopSourceMissing":"That source is not listed right now. It is still saved and will be passed to the recorder.","desktopSourceHelp":"Choose what the recorder captures as desktop audio.","sourceLoadFailed":"Could not load audio sources.","defaultOutput":"Default output","defaultInput":"Default input","groupDesktopAudio":"Desktop audio","groupMicrophones":"Microphones","groupApplications":"Applications","groupOther":"Other","groupSaved":"Saved","micSource":"Microphone source","micSourceHelp":"Used when mic capture is on. Default input follows the system setting.","micMono":"Mono microphone","micMonoHelp":"Centres your mic in the clip. Turn this on if your voice only comes out of one ear, which is what most XLR and single-channel interfaces do. Applied when the clip is saved, so it needs mic capture on and no separate audio tracks.","desktopVolume":"Desktop audio volume","desktopVolumeHelp":"Balanced into new clips as they are saved","micVolume":"Microphone volume","micVolumeHelp":"Turn this down if your mic overpowers the game. Applies while mic capture is on.","notifyVolume":"Notification volume","notifyVolumeHelp":"The ping when a clip is saved, and the session start, stop and highlight tones.","volumeOff":"Off","customSounds":"Custom sounds","customSoundsHelp":"Play your own file instead of the built-in tone. Leave blank for the tone. A path that does not exist falls back to the tone, so you never end up with silence.","soundClip":"Clip saved","soundClipFailed":"Clip failed","soundSessionStart":"Session started","soundSessionEnd":"Session stopped","soundHighlight":"Highlight marked","audioTracks":"Separate audio tracks","audioTracksHelp":"Each source becomes its own track for editing. Players, Discord and share links use track 1. With mic capture on, your microphone gets its own track.","duplicateTrack":"That source is already a track","sourcesRefreshed":"Audio sources refreshed","mixFirstTrack":"Combined first track","mixFirstTrackHelp":"Record an extra track 1 that mixes every source, so players and shared clips carry full audio. Your separate tracks start at 2.","wfMicMode":"wf-recorder microphone mode","wfMicModeHelp":"How wf-recorder handles desktop audio together with a microphone","wfMicPrompt":"Ask when needed","wfMicFallback":"Use a compatible backend","wfMicOnly":"Mic only on wf-recorder","wfMicTitle":"How should the microphone be mixed in?","wfMicBody":"wf-recorder records one audio source at a time. Choose what happens when both the desktop and the microphone are on.","wfMicChoiceBoth":"Use a backend that can do both","wfMicChoiceBothBody":"Vice records with a compatible backend whenever the microphone is on.","wfMicChoiceMic":"Microphone only","wfMicChoiceMicBody":"Desktop audio is dropped while the microphone is on.","clipKey":"Clip key","clipKeyHelp":"Click to rebind, then press a key or a combo like Alt+F9. Escape cancels. Saved the moment you press it.","hotkeysUnavailable":"Vice cannot read your keyboard right now, so no hotkey will fire. Adding your user to the input group and logging back in usually fixes it.","keyUnsupported":"That key cannot be bound, try another","clipKeyNow":"Clip key is now {key}","errSaveKey":"The key was captured but not saved","clipPresets":"Additional clip hotkeys","clipPresetsHelp":"Each key saves its own clip length. Double-tap any clip key to start or stop a session.","presetDuration":"Clip length for this key","presetRemove":"Remove this hotkey","presetAdd":"Add hotkey","blocklist":"Ignore hotkeys in these apps","blocklistHelp":"One per line. Vice leaves its keys alone while a matching app is focused, for games that clip on the same keys. Matched against the window process and class, for example ggst.exe. Needs X11, Hyprland or Sway.","directory":"Save clips to","directoryHelp":"Directory where clips are written","tagWithGame":"Tag clips with the game","tagWithGameHelp":"Append the detected game to clip filenames, like Vice_Clip_4_Overwatch-2.mp4. Uses the same game list as Rich Presence and the auto playlists.","autoPlaylist":"Create a playlist per game","autoPlaylistHelp":"When a known game is focused, file the clip into an auto playlist for it with its own colour.","clipFilename":"Clip filename","clipFilenameNext":"Next clip: {name}.mp4","clipFilenameEmpty":"That template renders to nothing, so the default naming will be used.","port":"HTTP port","portHelp":"Port for the local share server","publicLink":"Public link","publicLinkHelp":"Share links that work outside your own network. Needs the cloudflared binary installed, otherwise links only work on your network.","discordEnabled":"Show what you are playing","discordCustomGames":"Custom games","discordCustomGamesPlaceholder":"My Game | mygame.exe, MyGameClient","discordClientId":"Client ID override","discordClientIdHelp":"Optional. Leave empty to use Vice's own Discord application, or provide your own Application ID for custom branding.","discordClientIdPlaceholder":"Discord Application ID","accent":"Accent colour","accentHelp":"Tints the controls, the highlights and the ambient wash behind the app. Saved straight away, and shared clips pick it up too.","accentAria":"{name} accent","effects":"Visual effects","effectsHelp":"Motion and depth cost a GPU. Auto measures how fast frames arrive in this window and turns them down when it cannot keep up.","effectsAuto":"Auto","effectsFull":"Full","effectsReduced":"Reduced","effectsSoftware":"This window is compositing in software, so effects are reduced.","effectsSlow":"Frames are arriving too slowly here, so effects are reduced.","effectsKeepingUp":"Frames are keeping up, so the full treatment is on.","effectsMeasuring":"Measuring.","gsrArgs":"Extra gpu-screen-recorder arguments","checkForUpdates":"Check for updates","checkForUpdatesHelp":"Ask GitHub once a day whether a newer Vice is out. Nothing about you or your clips is sent.","checkNow":"Check now","checkNowHelp":"Look straight away, ignoring the daily wait.","checking":"Checking","updateAvailable":"Vice {version} is available","upToDate":"You are on the latest release","errCheckUpdate":"Could not reach GitHub","savedNotApplied":"Saved, but not applied","saved":"Settings saved","bufferRaised":"Buffer raised to {length} to cover your longest clip key","errSave":"Could not save your settings","unsaved":"Unsaved changes","allSaved":"Everything saved","discard":"Discard","saving":"Saving","saveSettings":"Save settings","restartTitle":"Restart Vice to finish","restartBody":"The sharing settings are saved, but the server only picks up a new port or tunnel setting when the daemon restarts.","clipFilenameHelp":"Leave empty for the default Vice_Clip_4 naming. Use {n} for the clip number, {date}, {time}, and {game} (needs the toggle above). Clips are never overwritten.","discordEnabledHelp":"Puts \\"Clipping with Vice\\" on your Discord profile while a known game is focused. On by default, and window titles are never sent.","discordCustomGamesHelp":"One game per line: {format}. Matches are case-insensitive substrings checked against the focused window's process name and class. The bundled list already covers over 300 games.","gsrArgsHelp":"Appended to the recorder command as written. Example: {example}","language":"Language","languageHelp":"Vice is translated by the people who use it. If yours is missing or half done, the file to fill in is one JSON file: see docs/TRANSLATING.md.","screenshotKey":"Screenshot key","screenshotKeyHelp":"Saves what is on screen as a picture, in the Images section. Unset by default. Screenshots are copied to the clipboard as well.","screenshotKeyNow":"Screenshots are on {key}","screenshotKeyCleared":"Screenshot key cleared","clearKey":"Clear","imageDirectory":"Image folder","imageDirectoryHelp":"Where screenshots are written. Kept apart from clips so an image viewer is not indexing a folder of video files.","soundScreenshot":"Screenshot"}`),ur={app:Hn,common:Un,clips:Wn,home:Gn,card:Kn,playlistModal:qn,frame:Jn,banners:Yn,island:Xn,update:Zn,audioTracks:Qn,keyCapture:$n,nav:er,viewer:tr,trim:nr,images:rr,tutorial:ir,accents:ar,events:or,about:sr,editor:cr,settings:lr}})),fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr=o((()=>{fr={name:`Vice`},pr={delete:`Supprimer`,keepIt:`Le garder`,cancel:`Annuler`,save:`Enregistrer`,close:`Fermer`,noActions:`Aucune action`,untagged:`Sans étiquette`,create:`Créer`,gotIt:`Compris`,new:`Nouveau`,dismiss:`Ignorer`},mr={allClips:`Tous les clips`,countClips:{one:`{count} clip`,other:`{count} clips`},countMatches:{one:`{count} résultat pour « {query} »`,other:`{count} résultats pour « {query} »`},playlistOptions:`Options de la playlist`,newPlaylist:`Nouvelle playlist`,saveClip:`Enregistrer un clip`,hotkeysUnavailableTitle:`Les raccourcis globaux ne sont pas disponibles.`,hotkeysUnavailableBody:`Vice ne peut pas lire ton clavier, donc {hotkey} n'enregistrera pas de clip. Le bouton Enregistrer un clip ci-dessus fonctionne toujours. Ajouter ton utilisateur au groupe input puis te reconnecter règle généralement le problème.`,emptySearch:`Aucun résultat pour « {query} ».`,emptyPlaylist:`Cette playlist est vide. Glisse un clip dessus, ou fais un clic droit sur un clip pour l'y ajouter.`,emptyLibrary:`Aucun clip pour l'instant. Appuie sur {hotkey} pour enregistrer les {duration} dernières secondes.`,editPlaylist:`Modifier la playlist`,deletePlaylist:`Supprimer la playlist`,confirmDeleteTitle:`Supprimer cette playlist ?`,confirmDeleteBody:`Les clips eux-mêmes ne bougent pas. Seule la playlist disparaît.`,confirmDeleteAuto:` Celle-ci a été créée automatiquement, donc Vice ne la recréera pas pour ce jeu.`,playlistUpdated:`Playlist mise à jour`,playlistDeleted:`Playlist supprimée`,playlistCreated:`Playlist « {name} » créée`,errSaveClip:`Impossible d'enregistrer un clip`,errUpdatePlaylist:`Impossible de mettre à jour la playlist`,errCreatePlaylist:`Impossible de créer la playlist`,errDeletePlaylist:`Impossible de supprimer la playlist`,imagesHeading:{one:`{count} capture d'écran`,other:`{count} captures d'écran`}},hr={greetingMorning:`Bonjour`,greetingAfternoon:`Bon après-midi`,greetingEvening:`Bonsoir`,quickSettings:`Réglages rapides`,storage:`Stockage`,diskFree:`Espace libre`,diskLibrary:`Bibliothèque Vice`,diskUnknown:`Non mesuré`,lastClip:`Dernier clip`,lastClipNever:`Aucun pour l'instant`,diskBar:`{used} utilisés sur {total}, dont {library} pour Vice`,microphone:`Microphone`,desktopAudio:`Audio du bureau`,publicLink:`Lien public`,on:`Activé`,off:`Désactivé`,active:`Actif`,starting:`Démarrage`,connecting:`Connexion`,localOnly:`Local uniquement`,tapToCopy:`Touche pour copier`,cloudflaredStarting:`cloudflared démarre`,linksWorkOnNetwork:`Les liens fonctionnent sur ce réseau`,copyPublicLink:`Copier le lien public`,noPublicLinkYet:`Pas encore de lien public`,saveClipNow:`Enregistrer un clip maintenant`,allClips:`Tous les clips`,settings:`Réglages`,recentClips:`Clips récents`,seeAll:`Tout voir`,mostViewed:`Les plus vus`,playlists:`Playlists`,emptyReel:`Aucun clip pour l'instant. Appuie sur {hotkey} pour lancer ta collection.`,lede:`Les dernières {duration} de ton gameplay sont toujours dans le tampon. Appuie sur {hotkey} pour les garder. Double-appui pour démarrer une session.`,micOn:`Microphone activé`,micOff:`Microphone désactivé`,micOnDetail:`Inclus dans les nouveaux clips`,micOffDetail:`Retiré des nouveaux clips`,desktopAudioOn:`Audio du bureau activé`,desktopAudioOff:`Audio du bureau désactivé`,publicLinkStarting:`Le lien public démarre`,publicLinkStopped:`Lien public arrêté`,publicLinkCopied:`Lien public copié`,enablePublicLinkFirst:`Active d'abord le lien public`,savedNotApplied:`Enregistré, mais pas appliqué`,errMic:`Impossible de modifier le réglage du microphone`,errDesktopAudio:`Impossible de modifier l'audio du bureau`,errPublicLink:`Impossible de modifier le lien public`,errSaveClip:`Impossible d'enregistrer un clip`,wfMicTitle:`Comment mixer le microphone ?`,wfMicBody:`wf-recorder n'enregistre qu'une source audio à la fois. Choisis ce qui se passe quand le bureau et le microphone sont tous les deux activés.`,wfMicBothLabel:`Utiliser un backend qui gère les deux`,wfMicBothHelp:`Vice enregistre avec un backend compatible dès que le microphone est activé.`,wfMicOnlyLabel:`Microphone uniquement`,wfMicOnlyHelp:`L'audio du bureau est coupé tant que le microphone est activé.`,copyLinkTitle:`Copier ce lien`,copyLinkBody:`Le presse-papiers n'était pas disponible, voici donc le lien à copier à la main.`,restartTitle:`Redémarre Vice pour terminer`,restartBody:`Ce réglage est enregistré, mais il ne prend effet qu'au redémarrage du daemon.`,gotIt:`Compris`},gr={unreadable:`Illisible`,unreadableNote:`{reason}. Le fichier est toujours sur le disque.`,unreadableFallback:`ffmpeg n'a pas pu lire ce fichier`,openTitle:`Ouvrir {name}`,renameHint:`{name}, double-clic pour renommer`,trim:`Découper`,copyVideo:`Copier la vidéo dans le presse-papiers`,copyShareLink:`Copier le lien de partage`,noShareLink:`Pas encore de lien de partage`,reveal:`Afficher dans le gestionnaire de fichiers`,delete:`Supprimer`,open:`Ouvrir`,rename:`Renommer`,copyVideoShort:`Copier la vidéo`,deleteClip:`Supprimer le clip`,videoCopied:`Vidéo copiée, colle-la où tu veux`,errCopyVideo:`Impossible de copier la vidéo`,renameFailed:`Échec du renommage`,savedAs:`Enregistré sous {name}`,addTo:`Ajouter à {playlist}`,removeFrom:`Retirer de {playlist}`,addedTo:`Ajouté à {playlist}`,removedFrom:`Retiré de {playlist}`,playlistUnchanged:`La playlist n'a pas changé`,nameLabel:`Nom du clip`,views:{one:`{count} vue`,other:`{count} vues`},noShareLinkYet:`Pas encore de lien de partage pour ce clip`,linkCopiedLocal:`Lien copié, mais il est local uniquement`,linkCopiedLocalDetail:`Installe cloudflared pour des liens qui fonctionnent hors de ton réseau`,shareLinkCopied:`Lien de partage copié`,alreadyIn:`Déjà dans {playlist}`,errAddClip:`Impossible d'ajouter le clip`},_r={editTitle:`Modifier la playlist`,newTitle:`Nouvelle playlist`,nameRequired:`Donne un nom à la playlist`,name:`Nom`,emoji:`Emoji`,emojiPlaceholder:`Facultatif`,colour:`Couleur de la playlist`},vr={quitConfirm:`Arrêter Vice et quitter ? Le daemon d'enregistrement sera arrêté.`,minimize:`Réduire`,quit:`Quitter`},yr={notRecording:`Vice n'enregistre pas.`,cpuFallback:`Enregistrement sur le CPU.`,codecFallback:`Enregistrement avec un autre codec.`,cannotPlay:`Les clips ne peuvent pas être lus dans cette fenêtre.`,notRecordingHelp:`Vice réessaie tout seul. Si c'est un problème d'encodeur, un redémarrage après une mise à jour du pilote suffit généralement, ou choisis un autre encodeur dans Réglages, Enregistrement.`,cpuFallbackHelp:`Ton encodeur GPU n'a pas voulu s'ouvrir, donc Vice est passé à l'encodage CPU pour continuer à faire des clips. Cela coûte des images par seconde en jeu. C'est généralement un pilote qui a besoin d'un redémarrage après une mise à jour. Vice essaie d'abord le GPU à chaque démarrage, donc une fois le problème réglé, ce message disparaît tout seul.`,codecFallbackHelp:`Ton GPU n'a pas voulu encoder le codec choisi dans Réglages, Enregistrement, donc gpu-screen-recorder en a choisi un qu'il sait gérer. L'enregistrement reste sur le GPU et les clips ne sont pas affectés. Choisir toi-même un autre encodeur fait disparaître cet avis. Le H.264 en particulier plafonne à 4096 pixels de large sur NVIDIA, donc HEVC ou AV1 est le bon choix sur un moniteur large.`,cannotPlayHelp:`La version installée de Qt WebEngine n'a pas de décodeur H.264. L'enregistrement fonctionne toujours, et les clips s'ouvrent normalement dans ton lecteur système. Pour réparer la lecture dans l'application, installe le paquet WebEngine de ta distribution puis réinstalle Vice :`},br={cannotReach:`Impossible de joindre le daemon`,notRecording:`N'enregistre pas`,keepsRetrying:`Vice réessaie`,sessionRecording:`Session en cours`,bufferRunning:`Tampon actif`,starting:`Démarrage`},xr={releaseNotes:`Notes de version`,copyCommand:`Copier la commande`,commandCopied:`Commande copiée, colle-la dans un terminal`,copyByHand:`Le presse-papiers n'était pas disponible, voici donc la commande à copier à la main.`,later:`Plus tard`,title:`Vice {version} est disponible`,youAreOn:`Tu utilises la version {version}.`,olderRelease:`une version plus ancienne`,updateWith:` Mets à jour avec :`,copyTitle:`Copier cette commande`},Sr={addTrack:`Ajouter une piste`,none:`Aucune piste séparée. Tout est mixé en une seule, ce que la plupart des gens veulent.`,mixOfAll:`Mix de toutes les pistes`,trackLabel:`Piste {n}`,sourceToAdd:`Source audio à ajouter comme piste`,refresh:`Actualiser la liste des sources`,moveEarlier:`Monter`,moveLater:`Descendre`,removeTrack:`Supprimer cette piste`,moveEarlierAria:`Monter {name}`,moveLaterAria:`Descendre {name}`,removeAria:`Supprimer {name}`,droppedWarning:{one:`La capture de l'audio du bureau est désactivée, donc cette piste ne sera pas enregistrée : {list}.`,other:`La capture de l'audio du bureau est désactivée, donc ces pistes ne seront pas enregistrées : {list}.`},trimmedWarning:{one:`{count} autre ne conservera que ses sources microphone.`,other:`{count} autres ne conserveront que leurs sources microphone.`},turnBackOn:`Réactive l'audio du bureau ci-dessus pour les conserver.`},Cr={pressKey:`Appuie sur une touche`,setKey:`Définir la touche`},wr={allClips:`Tous les clips`,images:`Images`,home:`Accueil`,editor:`Éditeur`,settings:`Réglages`,about:`À propos`,playlists:`Playlists`,newPlaylist:`Nouvelle playlist`,search:`Rechercher des clips`,dragToStart:`Glisse un clip ici pour en créer une.`,quickStart:`Démarrage rapide`,buffer:`Tampon`,update:`Mise à jour`,open:`Ouvrir`,useEmoji:`Utiliser {emoji}`,errSetEmoji:`Impossible de définir l'emoji`,main:`Principal`},Tr={errReveal:`Impossible d'ouvrir le gestionnaire de fichiers`,errSystemPlayer:`Impossible d'ouvrir le lecteur système`,clipDeleted:`Clip supprimé`,errDelete:`Impossible de supprimer le clip`,confirmDeleteTitle:`Supprimer ce clip ?`,confirmDeleteBody:`{name} sera supprimé du disque. Cette action est irréversible.`,copyLinkTitle:`Copier ce lien`,copyLinkBody:`Le presse-papiers n'était pas disponible, voici donc le lien à copier à la main.`,highlight:`Moment fort`,highlightNumbered:`{base} {n}`,errAddHighlight:`Impossible d'ajouter le moment fort`,errMoveHighlight:`Impossible de déplacer le moment fort`,errUpdateHighlight:`Impossible de modifier le moment fort`,errDeleteHighlight:`Impossible de supprimer le moment fort`,daemonNoMark:`Le daemon n'a pas renvoyé le repère`,daemonRejectedMove:`Le daemon a refusé le déplacement`,daemonRejectedChange:`Le daemon a refusé la modification`,play:`Lecture`,pause:`Pause`,preparingPreview:`Préparation de l'aperçu H.265`,openInPlayer:`Ouvrir dans le lecteur système`,showInFolder:`Afficher dans le dossier`,addHighlight:`Ajouter un moment fort`,noHighlights:`Aucun moment fort pour l'instant. Appuie sur`,addHighlightKey:`Ajouter un moment fort {key}`,noHighlightsHelp:`Aucun moment fort pour l'instant. Appuie sur {key} pour marquer l'instant actuel.`,prevClip:`Clip précédent`,nextClip:`Clip suivant`,changeColour:`Changer la couleur`,changeColourAria:`Changer la couleur de {name}`,doubleClickRename:`Double-clic pour renommer`,removeHighlight:`Retirer`,removeHighlightAria:`Retirer {name}`,copyShareLink:`Copier le lien de partage`,closePlayer:`Fermer le lecteur`,volume:`Volume`,mute:`Couper le son`,unmute:`Rétablir le son`,highlightLabel:`Nom du moment fort`,highlightAt:`{label} à {time}`,useColour:`Utiliser {color}`,highlightsHeading:`Moments forts`,trim:`Découper`,share:`Partager`,reveal:`Afficher`,delete:`Supprimer`,shortcuts:`Gauche et droite : clip précédent ou suivant · H marque un moment fort · Échap ferme`,playbackFailed:`Vice n'a pas pu lire ce clip dans la fenêtre de l'application. Le fichier lui-même est très probablement intact.`,noH264Decoder:`Cette version de Qt WebEngine n'a pas de décodeur H.264, donc les clips ne peuvent pas être lus dans Vice. Le fichier lui-même est intact.`,saveFrame:`Enregistrer cette image`,saveFrameHint:`Enregistrer l'image actuelle comme capture d'écran (S)`,frameSaved:`Image enregistrée et copiée`,frameSavedNotCopied:`Image enregistrée, mais pas copiée`,errSaveFrame:`Impossible d'enregistrer l'image`,muteHint:`Couper le son (M)`,unmuteHint:`Rétablir le son (M)`,expand:`Remplir la fenêtre`,shrink:`Revenir à la taille normale`,expandHint:`Remplir la fenêtre (F, ou double-clic)`,shrinkHint:`Revenir à la taille normale (F, ou Échap)`},Er={saved:`Clip découpé et enregistré`,failed:`Le découpage a échoué`,errTrim:`Impossible de découper le clip`,preview:`Aperçu`,stop:`Arrêter`,loopHelp:`Lit la sélection en boucle. Les bornes de coupe sont sans perte.`,saving:`Enregistrement`,saveTrim:`Enregistrer la découpe`,preparingPreview:`Préparation de l'aperçu H.265`,openInPlayer:`Ouvrir dans le lecteur système`,showInFolder:`Afficher dans le dossier`,title:`Découper · {name}`,in:`Début`,out:`Fin`,duration:`Durée`,startOfSelection:`Début de la sélection`,endOfSelection:`Fin de la sélection`,trimAria:`Découper {name}`,heading:`Découper`},Dr={heading:`Images`,countImages:{one:`{count} capture d'écran`,other:`{count} captures d'écran`},countMatches:{one:`{count} résultat pour « {query} »`,other:`{count} résultats pour « {query} »`},emptySearch:`Aucun résultat pour « {query} ».`,emptyLibrary:`Aucune capture d'écran pour l'instant. Appuie sur {hotkey} pour enregistrer ce qui est à l'écran.`,emptyNoKey:`Aucune capture d'écran pour l'instant. Définis une touche de capture dans Réglages, ou ouvre un clip et enregistres-en une image.`,captureMoment:`Garder un instant`,roomForMore:`De la place pour ton prochain instant`,captureHint:`Appuie sur {hotkey} pour enregistrer une capture d'écran.`,captureNoKey:`Définis une touche de capture dans Réglages, ou enregistre une image depuis un clip.`,openTitle:`Ouvrir {name}`,open:`Ouvrir`,openExternally:`Ouvrir dans la visionneuse d'images`,copy:`Copier l'image`,copied:`Image copiée`,errCopy:`Impossible de copier l'image`,errOpen:`Impossible d'ouvrir l'image`,deleteImage:`Supprimer la capture d'écran`,deleted:`Capture d'écran supprimée`,errDelete:`Impossible de supprimer la capture d'écran`,confirmDeleteTitle:`Supprimer cette capture d'écran ?`,confirmDeleteBody:`{name} sera déplacé vers la corbeille. Impossible d'annuler depuis ici.`,pen:`Stylo`,penOn:`Stylo activé`,penColour:`Couleur du stylo`,undo:`Annuler`,saveDrawing:`Enregistrer le dessin`,saving:`Enregistrement`,saved:`Dessin enregistré`,errSave:`Impossible d'enregistrer le dessin`,errCanvas:`Cette fenêtre n'a pas pu afficher l'image`,prev:`Image précédente`,next:`Image suivante`,shortcuts:`Les flèches naviguent, F remplit la fenêtre, Ctrl+Z annule, Échap ferme`},Or={pickColour:`Choisis une couleur`,startClipping:`Lance-toi dans le clipping, puis laisse Vice tourner`,playlistsTitle:`Les playlists rangent ta collection`,colourBody:`Vice prend sa couleur dans l'une de celles-ci. Toute la fenêtre change au fur et à mesure, alors choisis celle que tu as envie de regarder, et change-la quand tu veux dans Réglages.`,quickStartBody:`Vice garde le tampon actif en arrière-plan et n'ouvre cette fenêtre que quand tu en as besoin.`,playlistsBody:`Chaque clip peut se trouver dans autant de playlists que tu veux, et elles se tiennent à jour toutes seules.`,saveLast:`Sauvegarde les {duration} dernières secondes`,saveLastHelp:`Appuie sur {hotkey} après un moment qui vaut la peine d'être gardé.`,sessionTitle:`Double-appui sur {hotkey} pour une session`,sessionHelp:`Double-appui pour démarrer ou arrêter un enregistrement complet. Appuie une fois pendant une session pour marquer un moment fort.`,reviewTitle:`Revoir, découper et partager`,reviewHelp:`Ouvre n'importe quel clip pour le renommer, découper le meilleur moment, partager un lien, ou appuie sur H pour ajouter des moments forts.`,backgroundTitle:`Ferme la fenêtre en toute sécurité`,backgroundHelp:`Réduis ou ferme cette fenêtre et Vice continue d'enregistrer. Discord Rich Presence est activé par défaut et se règle dans Réglages.`,autoTitle:`Playlists automatiques`,autoHelp:`Les clips sont rangés selon le jeu auquel tu jouais quand tu les as enregistrés. Vice les crée tout seul.`,customTitle:`Playlists personnalisées`,customHelp:`Crée les tiennes depuis la barre latérale, choisis un emoji et une couleur, puis glisse des clips dessus ou fais un clic droit sur un clip pour l'y ajouter.`,safeTitle:`Rien n'est jamais périmé`,safeHelp:`Les playlists suivent les clips à travers les renommages et les découpes, et se nettoient après les suppressions.`,next:`Suivant`,back:`Retour`,gotIt:`Compris`,badgeClip:`Clip`,badgeBg:`Fond`,badgeAuto:`Auto`,badgeNew:`Nouveau`,badgeSafe:`Sûr`,accentLabel:`Accent {name}`,bufferTitle:`Jusqu'où Vice peut remonter`,bufferBody:`Vice enregistre en permanence dans un tampon qu'il jette au fur et à mesure. Appuyer sur la touche de clip en conserve la dernière portion, et c'est ici que tu règles sa durée.`,bufferLabel:`Durée du replay instantané`,bufferNote:`Le tampon contient {buffer} à la fois. Un tampon plus long consomme de la mémoire, et Réglages donne tout le détail, y compris l'écriture sur le disque à la place.`,clipKeyLabel:`Touche de clip`,screenshotKeyLabel:`Touche de capture d'écran`,screenshotKeyNote:`La touche de capture d'écran n'est pas définie tant que tu n'en choisis pas une. Elle enregistre une image de l'écran dans la section Images et la place dans ton presse-papiers.`,errSave:`Impossible d'enregistrer cela`,editorTitle:`L'éditeur`,editorHelp:`Place plusieurs clips sur une timeline, monte-les ensemble, ajoute du texte et des transitions, puis exporte une seule vidéo. Il se trouve dans la barre latérale.`,badgeEdit:`Montage`,shareTitle:`Envoyer un clip à quelqu'un`,shareBody:`Chaque clip a un lien, et le copier tient en un seul bouton sur la carte.`,linkTitle:`Copier le lien`,linkHelp:`Le bouton de lien sur un clip copie une adresse qui lit le clip dans un navigateur. Colle-la dans Discord et elle s'intègre.`,tunnelTitle:`En local, ou accessible de partout`,tunnelHelp:`Tout seul, le lien ne fonctionne que sur cette machine. Active le tunnel Cloudflare dans Réglages et il fonctionne partout, jusqu'à ce que le daemon redémarre et que l'adresse change.`,badgeLink:`Lien`,badgeTunnel:`Net`,moreTitle:`Le reste se trouve dans Réglages`,moreBody:`C'est tout ce dont tu as besoin. Réglages contient les options que tu ne touches qu'une fois.`,recTitle:`Enregistrement`,recHelp:`Encodeur, résolution, fréquence d'images, quel moniteur, et quel audio va sur quelle piste.`,badgeRec:`Enr.`},kr={blue:`Bleu`,purple:`Violet`,green:`Vert`,red:`Rouge`,orange:`Orange`,customTitle:`Couleur personnalisée`,customBody:`Choisis n'importe quelle couleur et Vice construit un schéma Material 3 complet à partir de celle-ci. Seule la teinte est conservée : les surfaces, les boutons et les tons du texte en sont déduits, de la même façon que pour les cinq préréglages.`,useThis:`Utiliser cette couleur`,hue:`Teinte`,saturation:`Saturation et luminosité`,hexLabel:`Valeur hexadécimale`,previewTitle:`Vice_Clip_12`,previewMeta:`20 s · 1920x1080 · 14,2 Mo`,previewPrimary:`Enregistrer un clip`,previewQuiet:`Découper`,previewChip:`Deadlock`,lowContrast:`Cette couleur ne laisse pas assez de contraste pour lire confortablement. Vice a éclairci l'accent autant que possible ; essaie quelque chose de moins sombre.`},Ar={clipSaved:`Clip enregistré`,savingClip:`Enregistrement du clip`,errSaveClip:`Impossible d'enregistrer le clip`,recorderSilent:`L'enregistreur n'a pas dit pourquoi`,publicLinkReady:`Lien public prêt`,noPublicLink:`Pas de lien public`,tunnelUnavailable:`Le tunnel de partage est indisponible`,sessionRecording:`Session en cours`,doubleTapToStop:`Double-appui sur la touche de clip pour arrêter`,sessionSaved:`Session enregistrée`,highlightMarked:`Moment fort marqué`,cannotPlay:`Les clips ne peuvent pas être lus dans cette fenêtre`,noH264:`Cette version de Qt WebEngine n'a pas de décodeur H.264`,notSaved:`La modification n'a pas été enregistrée`,imageSaved:`Capture d'écran enregistrée`,errScreenshot:`Impossible de faire la capture d'écran`,screenshotNotCopied:`Capture d'écran enregistrée, mais pas copiée`,updating:`Vice passe à la version {version}`,updatingDetail:`L'enregistreur redémarre pour prendre en compte la nouvelle version. Cette fenêtre se reconnecte toute seule.`},jr={title:`À propos`,subtitle:`Vice, l'enregistreur de clips de jeu pour Linux`,tagline:`Du clipping de jeu open source, pensé d'abord pour Linux.`,waylandAndX11:`Wayland et X11`,system:`Système`,version:`Version`,backend:`Backend`,buffer:`Tampon`,frameRate:`Fréquence d'images`,clipsOnDisk:`Clips sur le disque`,totalFootage:`Durée totale`,credits:`Crédits`,creator:`Créateur et mainteneur`,community:`Contributeurs de la communauté`,communityHelp:`Rapports de bugs, traductions, correctifs`,dangerZone:`Zone dangereuse`,uninstallHelp:`La désinstallation supprime Vice, ses unités systemd et les règles udev. Tes clips restent là où ils sont.`,copy:`Copier`,commandCopied:`Commande copiée, colle-la dans un terminal`,copyTitle:`Copier cette commande`,copyByHand:`Le presse-papiers n'était pas disponible, voici donc la commande à copier à la main.`},Mr={nothingAtPlayhead:`Rien sous la tête de lecture`,dragFromLibrary:`Glisse un clip de la bibliothèque sur la timeline ci-dessous.`,preparingPreview:`Préparation de l'aperçu H.265`,removeTitle:`Supprimer le titre`,play:`Lecture`,pause:`Pause`,detachAudio:`Détacher l'audio`,clearTitle:`Vider la timeline ?`,clearBody:`Chaque clip, titre et transition de la timeline disparaît. Tes clips restent sur le disque.`,exportCanceled:`Export annulé`,exportFailed:`Échec de l'export`,pickFolder:`Choisis un dossier pour l'export`,exportRefused:`L'export a été refusé`,errStartExport:`Impossible de lancer l'export`,startExport:`Lancer l'export`,cancelExport:`Annuler l'export`,saveAs:`Enregistrer sous`,viceLibrary:`Bibliothèque Vice (par défaut)`,customPath:`Chemin personnalisé`,alsoAddToLibrary:`Ajouter aussi à la bibliothèque Vice`,encoding:`Encodage en H.264. Tu peux laisser cette fenêtre ouverte ou continuer ailleurs dans Vice.`,videoTrack:`Piste vidéo`,audioTrack:`Piste audio`,tabLibrary:`Bibliothèque`,tabEffects:`Effets`,tabText:`Texte`,searchClips:`Rechercher des clips`,libHintLibrary:`Glisse un clip sur la timeline, ou double-clique pour l'ajouter à la fin`,libHintEffects:`Glisse un effet sur un clip, ou entre deux clips`,libHintText:`Glisse un titre sur l'aperçu ou sur la piste T1`,titleSection:`Titre`,closeInspector:`Fermer l'inspecteur`,titleText:`Texte du titre`,font:`Police`,size:`Taille`,colour:`Couleur`,titleSize:`Taille du titre`,useColour:`Utiliser {color}`,reset:`Réinitialiser`,backToStart:`Retour au début`,playPause:`Lecture ou pause, espace`,exportBtn:`Exporter`,split:`Scinder`,duplicate:`Dupliquer`,fit:`Ajuster`,zoomOut:`Zoom arrière`,zoomIn:`Zoom avant`,addTrack:`Piste`,clear:`Vider`,exportVideo:`Exporter la vidéo`,done:`Terminé`,exportFilename:`Nom du fichier exporté`,exportFilenamePlaceholder:`Vice_Edit_1 (automatique si vide)`,location:`Emplacement`,exportLocation:`Emplacement de l'export`,folder:`Dossier`,exportFolder:`Dossier d'export`,audioDetached:`Audio détaché`,transShorter:`Plus court`,transLonger:`Plus long`,transRemove:`Supprimer la transition`,junctionTitle:`{name} · {len} s, clique pour modifier`,trackOptionsHint:`Clic droit pour les options de la piste`,libClipHint:`Glisse sur la timeline, ou double-clique pour l'ajouter à la fin`,libNoMatch:`Aucun clip ne correspond`,libNoMatchBody:`Essaie une autre recherche.`,libEmpty:`Aucun clip pour l'instant`,libEmptyBody:`Enregistre d'abord du gameplay.`,noReadableDuration:`Ce clip n'a pas encore de durée lisible`,menuSplit:`Scinder à la tête de lecture`,menuDetach:`Détacher l'audio`,menuCopy:`Copier`,menuPaste:`Coller`,menuDuplicate:`Dupliquer`,menuDelete:`Supprimer`,menuAddVideoTrack:`Ajouter une piste vidéo`,menuAddAudioTrack:`Ajouter une piste audio`,menuRemoveTrack:`Supprimer la piste {name}`,fx:{crossfade:{name:`Fondu enchaîné`,desc:`Fond la sortie dans l'entrée`},fadeblack:{name:`Fondu au noir`,desc:`Passe par le noir complet`},fadewhite:{name:`Fondu au blanc`,desc:`Éclosion à travers le blanc`},dipaccent:{name:`Passage par l'accent`,desc:`Flash de la couleur du thème`},blurdis:{name:`Fondu flou`,desc:`Défocalise à travers la coupe`},slide:{name:`Glissement`,desc:`Le clip entrant arrive par la droite`}},textPreset:{title:{name:`Titre`,sample:`Balle de match`},subtitle:{name:`Sous-titre`,sample:`Grind classé`},caption:{name:`Légende`,sample:`1920x1080 · 60 i/s`},lower:{name:`Bandeau inférieur`,sample:`Joueur · support`}},exported:`Exporté.`,encodingProgress:`{percent} % encodé`,audioSource:`Source enregistrée`,recordedTrack:`Piste {number}`,audioVolume:`Volume`,audioMuted:`Muet`,audioPreviewFailed:`Impossible de lire cette piste audio. Réessaie ou consulte le journal.`,detachedTracksHelp:`Chaque source enregistrée a sa propre piste. Seule la piste 1 est activée au départ, pour qu'une piste combinée ne soit pas mixée deux fois. Réactive le son des sources que tu veux entendre.`,preparingMedia:`Préparation de l'aperçu`},Nr=JSON.parse(`{"title":"Réglages","subtitle":"Adapte Vice à ta façon de jouer","sections":"Sections des réglages","loading":"Chargement de tes réglages.","secRecording":"Enregistrement","secAudio":"Audio","secHotkeys":"Raccourcis","secStorage":"Stockage","secSharing":"Partage","secDiscord":"Discord","secAppearance":"Apparence","secAdvanced":"Avancé","cardDiscord":"Discord Rich Presence","optAutoRecommended":"Auto (recommandé)","bufferDuration":"Durée du tampon","bufferOnDisk":"Le tampon est conservé sur le disque, donc les longues durées ne posent pas de problème.","bufferPlain":"Secondes de gameplay conservées dans le tampon glissant","bufferRamWarning":"Un tampon de {length} en RAM utilise environ {gb} Go avec des débits typiques. Le stockage Auto le déplace sur le disque.","replayStorage":"Stockage du replay","replayStorageHelp":"Là où vit le tampon glissant. Auto garde les tampons courts en RAM et déplace sur le disque tout ce qui dépasse dix minutes.","replayRam":"RAM","replayDisk":"Disque","clipDuration":"Durée du clip","clipDurationHelp":"Secondes enregistrées quand tu appuies sur la touche de clip","frameRate":"Fréquence d'images","frameRateHelp":"Images capturées par seconde","fpsOption":"{fps} i/s","resolution":"Résolution","resolutionHelp":"Auto s'adapte à ton écran","resolutionAuto":"Auto","resolutionCustom":"Personnalisée","customResolution":"Résolution personnalisée","customResolutionHelp":"Largeur par hauteur, par exemple 1600x900","customResolutionWarn":"Écris-la sous la forme largeur par hauteur, comme 1600x900.","badResolutionTitle":"Cette résolution n'est pas une taille","badResolutionDetail":"Écris-la sous la forme largeur par hauteur, comme 1600x900","container":"Conteneur","containerHelp":"Le MKV résiste mieux aux plantages et convient à l'audio multipiste. Les intégrations Discord et les navigateurs demandent du MP4.","containerMp4":"MP4 (meilleure compatibilité)","containerMkv":"MKV (résiste aux plantages)","encoder":"Encodeur vidéo","encoderHelp":"Les encodeurs GPU sont plus rapides et sollicitent moins le CPU. Les options Vulkan nécessitent le backend gpu-screen-recorder.","encoderH264Vulkan":"H.264 (Vulkan, GSR)","encoderHevcVulkan":"HEVC (Vulkan, GSR)","encoderAv1Vulkan":"AV1 (Vulkan, GSR)","encoderH264Nvenc":"NVIDIA H.264 (NVENC)","encoderHevcNvenc":"NVIDIA H.265 (NVENC)","encoderH264Vaapi":"AMD ou Intel H.264 (VAAPI)","encoderHevcVaapi":"AMD ou Intel H.265 (VAAPI)","encoderAv1Nvenc":"NVIDIA AV1 (NVENC, RTX 40 et supérieures)","encoderAv1Vaapi":"AMD ou Intel AV1 (VAAPI)","encoderX264":"H.264 logiciel (x264)","encoderX265":"H.265 logiciel (x265)","colourDepth":"Profondeur de couleur","colourDepthHelp":"Le 8 bits convient à tous les lecteurs. Le 10 bits nécessite un encodeur HEVC ou AV1.","colour8":"8 bits (standard)","colour10":"10 bits (HEVC ou AV1)","hardwareDecode":"Décodage vidéo matériel dans les aperçus","hardwareDecodeHelp":"Laisse ton GPU décoder les clips dans cette fenêtre plutôt que le CPU. À activer si les aperçus AV1 ou HEVC en haute résolution saccadent. Sur certains pilotes, la vidéo s'affiche en noir : si cela arrive, désactive-le. Prend effet à la prochaine ouverture de Vice.","backend":"Backend d'enregistrement","backendHelp":"Méthode de capture d'écran","backendWf":"wf-recorder (Wayland)","backendFfmpeg":"ffmpeg (X11)","followMouse":"Suivre ma souris","followMouseHelp":"Enregistre le moniteur sur lequel se trouve le pointeur. Changer de moniteur redémarre le tampon, donc un clip pris juste après un changement sera court.","followMouseUnsupported":"Nécessite X11, Hyprland ou Sway. Vice ne peut pas savoir où se trouve le pointeur dans cette session.","display":"Écran","displayAuto":"Auto (défaut du backend)","savedOption":"{id} (enregistré)","displayMissing":"L'écran « {id} » n'est pas signalé pour le moment. Il reste enregistré et sera utilisé s'il revient.","displayWarning":"{warning} Auto fonctionnera quand même.","displayNone":"Aucun écran individuel détecté. Auto fonctionnera quand même.","displayHelp":"Choisis l'écran à enregistrer. Auto suit le défaut du backend.","displayLoadFailed":"Impossible de charger les options d'écran.","captureDesktopAudio":"Capturer l'audio du bureau","captureDesktopAudioHelp":"Inclure le son du système dans les clips","captureMic":"Capturer le microphone","captureMicHelp":"Enregistre ton micro dans les clips. C'est le même interrupteur que la tuile de l'Accueil, enregistré dès que tu le bascules.","micOn":"Microphone activé","micOff":"Microphone désactivé","micOnDetail":"Inclus dans les nouveaux clips","micOffDetail":"Retiré des nouveaux clips","errMic":"Impossible de modifier le réglage du microphone","desktopSource":"Source de l'audio du bureau","desktopSourceIsMic":"Il s'agit d'une entrée microphone, donc les clips n'auraient pas d'audio du bureau. Choisis-en une sous Audio du bureau à la place.","desktopSourceMissing":"Cette source n'est pas listée pour le moment. Elle reste enregistrée et sera transmise à l'enregistreur.","desktopSourceHelp":"Choisis ce que l'enregistreur capture comme audio du bureau.","sourceLoadFailed":"Impossible de charger les sources audio.","defaultOutput":"Sortie par défaut","defaultInput":"Entrée par défaut","groupDesktopAudio":"Audio du bureau","groupMicrophones":"Microphones","groupApplications":"Applications","groupOther":"Autres","groupSaved":"Enregistrées","micSource":"Source du microphone","micSourceHelp":"Utilisée quand la capture du micro est activée. L'entrée par défaut suit le réglage du système.","micMono":"Microphone mono","micMonoHelp":"Centre ton micro dans le clip. Active-le si ta voix ne sort que d'une oreille, ce que font la plupart des interfaces XLR et monocanal. Appliqué à l'enregistrement du clip, donc il faut que la capture du micro soit activée et qu'il n'y ait pas de pistes audio séparées.","desktopVolume":"Volume de l'audio du bureau","desktopVolumeHelp":"Équilibré dans les nouveaux clips au moment de leur enregistrement","micVolume":"Volume du microphone","micVolumeHelp":"Baisse-le si ton micro couvre le jeu. S'applique tant que la capture du micro est activée.","notifyVolume":"Volume des notifications","notifyVolumeHelp":"Le ping quand un clip est enregistré, et les sons de début, de fin de session et de moment fort.","volumeOff":"Désactivé","customSounds":"Sons personnalisés","customSoundsHelp":"Joue ton propre fichier à la place du son intégré. Laisse vide pour garder le son intégré. Un chemin qui n'existe pas retombe sur le son intégré, donc tu n'auras jamais de silence.","soundClip":"Clip enregistré","soundClipFailed":"Échec du clip","soundSessionStart":"Session démarrée","soundSessionEnd":"Session arrêtée","soundHighlight":"Moment fort marqué","audioTracks":"Pistes audio séparées","audioTracksHelp":"Chaque source devient sa propre piste pour le montage. Les lecteurs, Discord et les liens de partage utilisent la piste 1. Avec la capture du micro activée, ton microphone a sa propre piste.","duplicateTrack":"Cette source est déjà une piste","sourcesRefreshed":"Sources audio actualisées","mixFirstTrack":"Première piste combinée","mixFirstTrackHelp":"Enregistre une piste 1 supplémentaire qui mixe toutes les sources, pour que les lecteurs et les clips partagés aient tout l'audio. Tes pistes séparées commencent à 2.","wfMicMode":"Mode microphone de wf-recorder","wfMicModeHelp":"Comment wf-recorder gère l'audio du bureau combiné à un microphone","wfMicPrompt":"Demander si besoin","wfMicFallback":"Utiliser un backend compatible","wfMicOnly":"Micro seul sur wf-recorder","wfMicTitle":"Comment mixer le microphone ?","wfMicBody":"wf-recorder n'enregistre qu'une source audio à la fois. Choisis ce qui se passe quand le bureau et le microphone sont tous les deux activés.","wfMicChoiceBoth":"Utiliser un backend qui gère les deux","wfMicChoiceBothBody":"Vice enregistre avec un backend compatible dès que le microphone est activé.","wfMicChoiceMic":"Microphone uniquement","wfMicChoiceMicBody":"L'audio du bureau est coupé tant que le microphone est activé.","clipKey":"Touche de clip","clipKeyHelp":"Clique pour réassigner, puis appuie sur une touche ou une combinaison comme Alt+F9. Échap annule. Enregistré dès que tu appuies.","hotkeysUnavailable":"Vice ne peut pas lire ton clavier pour le moment, donc aucun raccourci ne fonctionnera. Ajouter ton utilisateur au groupe input puis te reconnecter règle généralement le problème.","keyUnsupported":"Cette touche ne peut pas être assignée, essaie-en une autre","clipKeyNow":"La touche de clip est maintenant {key}","errSaveKey":"La touche a été capturée mais pas enregistrée","clipPresets":"Raccourcis de clip supplémentaires","clipPresetsHelp":"Chaque touche enregistre sa propre durée de clip. Double-appui sur n'importe quelle touche de clip pour démarrer ou arrêter une session.","presetDuration":"Durée du clip pour cette touche","presetRemove":"Supprimer ce raccourci","presetAdd":"Ajouter un raccourci","blocklist":"Ignorer les raccourcis dans ces applications","blocklistHelp":"Un par ligne. Vice laisse ses touches tranquilles quand une application correspondante a le focus, pour les jeux qui font des clips avec les mêmes touches. Comparé au processus et à la classe de la fenêtre, par exemple ggst.exe. Nécessite X11, Hyprland ou Sway.","directory":"Enregistrer les clips dans","directoryHelp":"Dossier où les clips sont écrits","tagWithGame":"Étiqueter les clips avec le jeu","tagWithGameHelp":"Ajoute le jeu détecté aux noms de fichiers des clips, comme Vice_Clip_4_Overwatch-2.mp4. Utilise la même liste de jeux que Rich Presence et les playlists automatiques.","autoPlaylist":"Créer une playlist par jeu","autoPlaylistHelp":"Quand un jeu connu a le focus, range le clip dans une playlist automatique qui lui est dédiée, avec sa propre couleur.","clipFilename":"Nom de fichier des clips","clipFilenameNext":"Prochain clip : {name}.mp4","clipFilenameEmpty":"Ce modèle ne produit rien, donc le nom par défaut sera utilisé.","port":"Port HTTP","portHelp":"Port du serveur de partage local","publicLink":"Lien public","publicLinkHelp":"Des liens de partage qui fonctionnent hors de ton propre réseau. Nécessite le binaire cloudflared installé, sinon les liens ne fonctionnent que sur ton réseau.","discordEnabled":"Afficher à quoi tu joues","discordCustomGames":"Jeux personnalisés","discordCustomGamesPlaceholder":"My Game | mygame.exe, MyGameClient","discordClientId":"Client ID personnalisé","discordClientIdHelp":"Facultatif. Laisse vide pour utiliser l'application Discord de Vice, ou fournis ton propre Application ID pour une image de marque personnalisée.","discordClientIdPlaceholder":"Application ID Discord","accent":"Couleur d'accent","accentHelp":"Teinte les contrôles, les surbrillances et le halo d'ambiance derrière l'application. Enregistrée immédiatement, et les clips partagés la reprennent aussi.","accentAria":"Accent {name}","effects":"Effets visuels","effectsHelp":"Le mouvement et la profondeur coûtent du GPU. Auto mesure la vitesse d'arrivée des images dans cette fenêtre et les réduit quand elle n'arrive pas à suivre.","effectsAuto":"Auto","effectsFull":"Complets","effectsReduced":"Réduits","effectsSoftware":"Cette fenêtre fait son rendu en logiciel, donc les effets sont réduits.","effectsSlow":"Les images arrivent trop lentement ici, donc les effets sont réduits.","effectsKeepingUp":"Les images suivent, donc le traitement complet est activé.","effectsMeasuring":"Mesure en cours.","gsrArgs":"Arguments supplémentaires pour gpu-screen-recorder","checkForUpdates":"Rechercher les mises à jour","checkForUpdatesHelp":"Demande à GitHub une fois par jour si une version plus récente de Vice est disponible. Rien sur toi ni sur tes clips n'est envoyé.","checkNow":"Vérifier maintenant","checkNowHelp":"Regarde tout de suite, sans attendre le délai quotidien.","checking":"Vérification","updateAvailable":"Vice {version} est disponible","upToDate":"Tu utilises la dernière version","errCheckUpdate":"Impossible de joindre GitHub","savedNotApplied":"Enregistré, mais pas appliqué","saved":"Réglages enregistrés","bufferRaised":"Tampon porté à {length} pour couvrir ta plus longue touche de clip","errSave":"Impossible d'enregistrer tes réglages","unsaved":"Modifications non enregistrées","allSaved":"Tout est enregistré","discard":"Abandonner","saving":"Enregistrement","saveSettings":"Enregistrer les réglages","restartTitle":"Redémarre Vice pour terminer","restartBody":"Les réglages de partage sont enregistrés, mais le serveur ne prend en compte un nouveau port ou un nouveau réglage de tunnel qu'au redémarrage du daemon.","clipFilenameHelp":"Laisse vide pour le nommage par défaut Vice_Clip_4. Utilise {n} pour le numéro du clip, {date}, {time}, et {game} (nécessite l'option ci-dessus). Les clips ne sont jamais écrasés.","discordEnabledHelp":"Affiche « Clipping with Vice » sur ton profil Discord quand un jeu connu a le focus. Activé par défaut, et les titres de fenêtre ne sont jamais envoyés.","discordCustomGamesHelp":"Un jeu par ligne : {format}. Les correspondances sont des sous-chaînes insensibles à la casse, comparées au nom de processus et à la classe de la fenêtre au premier plan. La liste fournie couvre déjà plus de 300 jeux.","gsrArgsHelp":"Ajoutés tels quels à la commande de l'enregistreur. Exemple : {example}","language":"Langue","languageHelp":"Vice est traduit par les gens qui l'utilisent. Si la tienne manque ou est à moitié faite, le fichier à remplir est un simple fichier JSON : voir docs/TRANSLATING.md.","screenshotKey":"Touche de capture d'écran","screenshotKeyHelp":"Enregistre ce qui est à l'écran sous forme d'image, dans la section Images. Non définie par défaut. Les captures sont aussi copiées dans le presse-papiers.","screenshotKeyNow":"Les captures d'écran sont sur {key}","screenshotKeyCleared":"Touche de capture d'écran effacée","clearKey":"Effacer","imageDirectory":"Dossier des images","imageDirectoryHelp":"Là où les captures d'écran sont écrites. Séparé des clips pour qu'une visionneuse d'images n'indexe pas un dossier de fichiers vidéo.","soundScreenshot":"Capture d'écran"}`),Pr={app:fr,common:pr,clips:mr,home:hr,card:gr,playlistModal:_r,frame:vr,banners:yr,island:br,update:xr,audioTracks:Sr,keyCapture:Cr,nav:wr,viewer:Tr,trim:Er,images:Dr,tutorial:Or,accents:kr,events:Ar,about:jr,editor:Mr,settings:Nr}})),Ir,Lr,Rr=o((()=>{dr(),Fr(),Ir={en:ur,fr:Pr},Lr={en:`English`,fr:`Français`}}));function zr(e){return $r.add(e),()=>$r.delete(e)}function Br(e,t){let n=e;for(let e of t.split(`.`))if(typeof n!=`object`||!n||Array.isArray(n)||(n=n[e],n===void 0))return;return typeof n==`object`&&!Vr(n)?void 0:n}function Vr(e){return typeof e==`object`&&!!e&&`other`in e}function Hr(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):e}function N(e,t){let n=Br(Ir[Zr],e)??Br(Ir[Yr],e);if(n===void 0)return e;if(typeof n==`string`)return Hr(n,t);let r=typeof t?.count==`number`?t.count:0;return Hr(n[Qr.select(r)]??n.other??e,t)}function Ur(e,t){let n=Br(Ir[Zr],e)??Br(Ir[Yr],e)??e,r=typeof n==`string`?n:e,i=[],a=/\{(\w+)\}/g,o=0,s;for(;(s=a.exec(r))!==null;)s.index>o&&i.push(r.slice(o,s.index)),i.push(s[1]in t?t[s[1]]:s[0]),o=s.index+s[0].length;return oe.toLowerCase()===n.toLowerCase());if(r)return r;let i=n.split(`-`)[0].toLowerCase();return t.find(e=>e.split(`-`)[0].toLowerCase()===i)??Yr}function qr(e){Zr=e,Qr=new Intl.PluralRules(e);try{localStorage.setItem(Xr,e)}catch{}document.documentElement.lang=e;for(let e of $r)e()}function Jr(){let e=null;try{e=localStorage.getItem(Xr)}catch{e=null}let t=Kr(e||navigator.language);return Zr=t,Qr=new Intl.PluralRules(t),document.documentElement.lang=t,t}var Yr,Xr,Zr,Qr,$r,P=o((()=>{Rr(),Yr=`en`,Xr=`vice-locale`,Zr=Yr,Qr=new Intl.PluralRules(Yr),$r=new Set})),ei,ti=o((()=>{ei=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim()})),ni,ri=o((()=>{ni=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()})),ii,ai=o((()=>{ii=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase())})),oi,si=o((()=>{ai(),oi=e=>{let t=ii(e);return t.charAt(0).toUpperCase()+t.slice(1)}})),ci,li=o((()=>{ci={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`}})),ui,di=o((()=>{ui=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1}})),fi,pi,mi,hi=o((()=>{fi=l(d(),1),pi=(0,fi.createContext)({}),mi=()=>(0,fi.useContext)(pi)})),gi,_i,vi=o((()=>{gi=l(d(),1),li(),di(),ti(),hi(),_i=(0,gi.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=mi()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,gi.createElement)(`svg`,{ref:c,...ci,width:t??l??ci.width,height:t??l??ci.height,stroke:e??f,strokeWidth:m,className:ei(`lucide`,p,i),...!a&&!ui(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,gi.createElement)(e,t)),...Array.isArray(a)?a:[a]])})})),yi,bi,xi=o((()=>{yi=l(d(),1),ti(),ri(),si(),vi(),bi=(e,t)=>{let n=(0,yi.forwardRef)(({className:n,...r},i)=>(0,yi.createElement)(_i,{ref:i,iconNode:t,className:ei(`lucide-${ni(oi(e))}`,`lucide-${e}`,n),...r}));return n.displayName=oi(e),n}})),Si,Ci,wi=o((()=>{xi(),Si=[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]],Ci=bi(`arrow-down`,Si)})),Ti,Ei,Di=o((()=>{xi(),Ti=[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]],Ei=bi(`arrow-up-down`,Ti)})),Oi,ki,Ai=o((()=>{xi(),Oi=[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]],ki=bi(`arrow-up`,Oi)})),ji,Mi,Ni=o((()=>{xi(),ji=[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]],Mi=bi(`calendar`,ji)})),Pi,Fi,Ii=o((()=>{xi(),Pi=[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]],Fi=bi(`check-check`,Pi)})),Li,Ri,zi=o((()=>{xi(),Li=[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]],Ri=bi(`check`,Li)})),Bi,Vi,Hi=o((()=>{xi(),Bi=[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]],Vi=bi(`chevron-down`,Bi)})),Ui,Wi,Gi=o((()=>{xi(),Ui=[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]],Wi=bi(`chevron-left`,Ui)})),Ki,qi,Ji=o((()=>{xi(),Ki=[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]],qi=bi(`chevron-right`,Ki)})),Yi,Xi,Zi=o((()=>{xi(),Yi=[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]],Xi=bi(`chevrons-left`,Yi)})),Qi,$i,ea=o((()=>{xi(),Qi=[[`path`,{d:`m6 17 5-5-5-5`,key:`xnjwq`}],[`path`,{d:`m13 17 5-5-5-5`,key:`17xmmf`}]],$i=bi(`chevrons-right`,Qi)})),ta,na,ra=o((()=>{xi(),ta=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],na=bi(`circle-check-big`,ta)})),ia,aa,oa=o((()=>{xi(),ia=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aa=bi(`circle-x`,ia)})),sa,ca,la=o((()=>{xi(),sa=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]],ca=bi(`clock`,sa)})),ua,da,fa=o((()=>{xi(),ua=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],da=bi(`columns-2`,ua)})),pa,ma,ha=o((()=>{xi(),pa=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]],ma=bi(`copy`,pa)})),ga,_a,va=o((()=>{xi(),ga=[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],_a=bi(`ellipsis`,ga)})),ya,ba,xa=o((()=>{xi(),ya=[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]],ba=bi(`external-link`,ya)})),Sa,Ca,wa=o((()=>{xi(),Sa=[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]],Ca=bi(`eye-off`,Sa)})),Ta,Ea,Da=o((()=>{xi(),Ta=[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]],Ea=bi(`funnel`,Ta)})),Oa,ka,Aa=o((()=>{xi(),Oa=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]],ka=bi(`info`,Oa)})),ja,Ma,Na=o((()=>{xi(),ja=[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]],Ma=bi(`menu`,ja)})),Pa,Fa,Ia=o((()=>{xi(),Pa=[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]],Fa=bi(`mic`,Pa)})),La,Ra,za=o((()=>{xi(),La=[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]],Ra=bi(`search`,La)})),Ba,Va,Ha=o((()=>{xi(),Ba=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]],Va=bi(`square`,Ba)})),Ua,Wa,Ga=o((()=>{xi(),Ua=[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],Wa=bi(`triangle-alert`,Ua)})),Ka,qa,Ja=o((()=>{xi(),Ka=[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]],qa=bi(`wrench`,Ka)})),Ya,Xa,Za=o((()=>{xi(),Ya=[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]],Xa=bi(`x`,Ya)})),Qa=o((()=>{xi(),ra(),oa(),fa(),va(),Da(),Ga(),wi(),Di(),Ai(),Ni(),Ii(),zi(),Hi(),Gi(),Ji(),Zi(),ea(),la(),ha(),xa(),wa(),Aa(),Na(),Ia(),za(),Ha(),Ja(),Za(),hi(),vi()})),$a,eo,to,no=o((()=>{Qa(),$a=M(),eo={size:`1em`,"aria-hidden":!0},to={close:(0,$a.jsx)(Xa,{...eo}),chevronDown:(0,$a.jsx)(Vi,{...eo}),chevronLeft:(0,$a.jsx)(Wi,{...eo}),chevronRight:(0,$a.jsx)(qi,{...eo}),chevronsLeft:(0,$a.jsx)(Xi,{...eo}),chevronsRight:(0,$a.jsx)($i,{...eo}),check:(0,$a.jsx)(Ri,{...eo}),success:(0,$a.jsx)(na,{...eo}),error:(0,$a.jsx)(aa,{...eo}),warning:(0,$a.jsx)(Wa,{...eo}),info:(0,$a.jsx)(ka,{...eo}),calendar:(0,$a.jsx)(Mi,{...eo}),clock:(0,$a.jsx)(ca,{...eo}),externalLink:(0,$a.jsx)(ba,{...eo}),menu:(0,$a.jsx)(Ma,{...eo}),moreHorizontal:(0,$a.jsx)(_a,{...eo}),search:(0,$a.jsx)(Ra,{...eo}),arrowUp:(0,$a.jsx)(ki,{...eo}),arrowDown:(0,$a.jsx)(Ci,{...eo}),arrowsUpDown:(0,$a.jsx)(Ei,{...eo}),funnel:(0,$a.jsx)(Ea,{...eo}),eyeSlash:(0,$a.jsx)(Ca,{...eo}),viewColumns:(0,$a.jsx)(da,{...eo}),copy:(0,$a.jsx)(ma,{...eo}),checkDouble:(0,$a.jsx)(Fi,{...eo}),wrench:(0,$a.jsx)(qa,{...eo}),stop:(0,$a.jsx)(Va,{...eo}),microphone:(0,$a.jsx)(Fa,{...eo})}})),ro,io,ao=o((()=>{jn(),no(),ro=En({name:`xds-neutral`,tokens:{keyword:[`#700084`,`#efa8ff`],string:[`#005600`,`#a6d2a2`],comment:[`#737373`,`#a3a3a3`],number:[`#6e3500`,`#ffb37f`],function:[`#00458c`,`#a0caff`],type:[`#700084`,`#efa8ff`],variable:[`#171717`,`#e5e5e5`],operator:[`#737373`,`#a3a3a3`],constant:[`#6e3500`,`#ffb37f`],tag:[`#89001a`,`#ffaeaa`],attribute:[`#584400`,`#eec12f`],property:[`#005348`,`#83dac9`],punctuation:[`#a3a3a3`,`#525252`],background:[`#fafafa`,`#0a0a0a`]}}),io=ln({name:`neutral`,typography:{scale:{base:14,ratio:1.2},body:{family:`Figtree`,fallbacks:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`},heading:{family:`Figtree`,fallbacks:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,weights:{3:`bold`,4:`bold`}},code:{family:`ui-monospace`,fallbacks:`"SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace`}},motion:{fast:125,medium:300,slow:700,ratio:.75},syntax:ro,tokens:{"--color-background-surface":[`#ffffff`,`#262626`],"--color-background-body":[`#f1f1f1`,`#1b1b1b`],"--color-background-card":[`#ffffff`,`#1b1b1b`],"--color-background-popover":[`#ffffff`,`#1b1b1b`],"--color-background-muted":[`#f1f1f1`,`#1b1b1b`],"--color-accent":[`#262626`,`#ebebeb`],"--color-accent-muted":[`#f1f1f1`,`#262626`],"--color-neutral":[`#0000000F`,`#FFFFFF1A`],"--color-overlay":[`#00000080`,`#000000CC`],"--color-overlay-hover":[`#0000000D`,`#FFFFFF0D`],"--color-overlay-pressed":[`#0000001A`,`#FFFFFF1A`],"--color-text-primary":[`#171717`,`#fafafa`],"--color-text-secondary":[`#525252`,`#a3a3a3`],"--color-text-disabled":[`#a3a3a3`,`#525252`],"--color-text-accent":[`#262626`,`#ebebeb`],"--color-on-dark":`#ffffff`,"--color-on-light":`#171717`,"--color-on-accent":[`#ffffff`,`#171717`],"--color-on-success":[`#ffffff`,`#171717`],"--color-on-error":[`#ffffff`,`#171717`],"--color-on-warning":`#171717`,"--color-icon-accent":[`#262626`,`#ebebeb`],"--color-icon-primary":[`#171717`,`#fafafa`],"--color-icon-secondary":[`#737373`,`#a3a3a3`],"--color-icon-disabled":[`#a3a3a3`,`#525252`],"--color-success":[`#007004`,`#9fe59b`],"--color-error":[`#a50c25`,`#ffc6c1`],"--color-warning":[`#745b00`,`#fdcf4f`],"--color-success-muted":[`#c5e5c0`,`#84c9803D`],"--color-error-muted":[`#facecb`,`#ff9e973D`],"--color-warning-muted":[`#f8da9d`,`#deb4333D`],"--color-border":[`#00000014`,`#FFFFFF1A`],"--color-border-emphasized":[`#d4d4d4`,`#525252`],"--color-skeleton":[`#ebebeb`,`#525252`],"--color-shadow":[`#0000001A`,`#0000004D`],"--color-tint-hover":[`black`,`white`],"--color-background-red":[`#facecb`,`#ff9e973D`],"--color-border-red":[`#e6bab8`,`#ff6f6c`],"--color-icon-red":[`#89001a`,`#ff9e97`],"--color-text-red":[`#89001a`,`#ffc6c1`],"--color-background-orange":[`#fad0b5`,`#ffa2583D`],"--color-border-orange":[`#e6bda2`,`#e2883e`],"--color-icon-orange":[`#6e3500`,`#ffa258`],"--color-text-orange":[`#6e3500`,`#ffc9a2`],"--color-background-yellow":[`#f8da9d`,`#deb4333D`],"--color-border-yellow":[`#e4c279`,`#c0990e`],"--color-icon-yellow":[`#584400`,`#deb433`],"--color-text-yellow":[`#584400`,`#fdcf4f`],"--color-background-green":[`#c5e5c0`,`#84c9803D`],"--color-border-green":[`#b2d1ac`,`#69ad67`],"--color-icon-green":[`#0c5700`,`#84c980`],"--color-text-green":[`#0c5700`,`#9fe59b`],"--color-background-teal":[`#a5e3d6`,`#7ec6b83D`],"--color-border-teal":[`#94d6c8`,`#63ab9d`],"--color-icon-teal":[`#005348`,`#7ec6b8`],"--color-text-teal":[`#005348`,`#99e2d3`],"--color-background-cyan":[`#a3e0ef`,`#83c2d43D`],"--color-border-cyan":[`#91d3e3`,`#67a7b8`],"--color-icon-cyan":[`#00505f`,`#83c2d4`],"--color-text-cyan":[`#00505f`,`#9edef0`],"--color-background-blue":[`#c4ddfb`,`#9eb7ff3D`],"--color-border-blue":[`#b1c9e7`,`#6d9cfe`],"--color-icon-blue":[`#00458c`,`#9eb7ff`],"--color-text-blue":[`#00458c`,`#c7d3ff`],"--color-background-purple":[`#eccef3`,`#f297ff3D`],"--color-border-purple":[`#d8bbdf`,`#dd74f0`],"--color-icon-purple":[`#700084`,`#f297ff`],"--color-text-purple":[`#700084`,`#fac1ff`],"--color-background-pink":[`#fccadc`,`#ff99c33D`],"--color-border-pink":[`#e7b7c8`,`#f273aa`],"--color-icon-pink":[`#83004b`,`#ff99c3`],"--color-text-pink":[`#83004b`,`#ffc3da`],"--color-background-gray":[`#e5e5e5`,`var(--color-neutral)`],"--color-border-gray":[`#d4d4d4`,`#262626`],"--color-icon-gray":[`#525252`,`#a3a3a3`],"--color-text-gray":[`#262626`,`#e5e5e5`],"--radius-none":`0px`,"--radius-inner":`0.375rem`,"--radius-element":`0.625rem`,"--radius-container":`0.75rem`,"--radius-page":`1.75rem`,"--radius-full":`9999px`,"--shadow-low":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 8%))`,"--shadow-med":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 12%))`,"--shadow-high":`0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 15%))`,"--shadow-inset-hover":`inset 0px 0px 0px 2px #0074e24D`,"--shadow-inset-selected":`inset 0px 0px 0px 2px #0074e280`,"--shadow-inset-success":`inset 0px 0px 0px 2px #1981004D`,"--shadow-inset-warning":`inset 0px 0px 0px 2px #ffce2f4D`,"--shadow-inset-error":`inset 0px 0px 0px 2px #e33f4a4D`},components:{button:{"variant:destructive":{backgroundColor:`var(--color-error-muted)`,color:`var(--color-error)`}},badge:{"variant:info":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`,color:`light-dark(#ffffff, #171717)`},"variant:neutral":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`},"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`,color:`light-dark(#ffffff, #171717)`},"variant:warning":{backgroundColor:`#ffce2f`,color:`#171717`},"variant:error":{backgroundColor:`light-dark(#e33f4a, #ff705d)`,color:`light-dark(#ffffff, #171717)`},"variant:red":{backgroundColor:`var(--color-background-red)`,color:`var(--color-text-red)`},"variant:orange":{backgroundColor:`var(--color-background-orange)`,color:`var(--color-text-orange)`},"variant:yellow":{backgroundColor:`var(--color-background-yellow)`,color:`var(--color-text-yellow)`},"variant:green":{backgroundColor:`var(--color-background-green)`,color:`var(--color-text-green)`},"variant:teal":{backgroundColor:`var(--color-background-teal)`,color:`var(--color-text-teal)`},"variant:cyan":{backgroundColor:`var(--color-background-cyan)`,color:`var(--color-text-cyan)`},"variant:blue":{backgroundColor:`var(--color-background-blue)`,color:`var(--color-text-blue)`},"variant:purple":{backgroundColor:`var(--color-background-purple)`,color:`var(--color-text-purple)`},"variant:pink":{backgroundColor:`var(--color-background-pink)`,color:`var(--color-text-pink)`},"variant:gray":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`}},statusdot:{"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`},"variant:warning":{backgroundColor:`#ffce2f`},"variant:error":{backgroundColor:`light-dark(#e33f4a, #ff705d)`},"variant:accent":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`}},banner:{"status:info":{backgroundColor:`var(--color-background-blue)`,"--color-accent-muted":`transparent`,"--color-text-primary":`var(--color-text-blue)`,"--color-text-secondary":`var(--color-text-blue)`,"--color-accent":`var(--color-text-blue)`},"status:success":{"--color-text-primary":`var(--color-text-green)`,"--color-text-secondary":`var(--color-text-green)`,"--color-success":`var(--color-text-green)`},"status:warning":{"--color-text-primary":`var(--color-text-yellow)`,"--color-text-secondary":`var(--color-text-yellow)`,"--color-warning":`var(--color-text-yellow)`},"status:error":{"--color-text-primary":`var(--color-text-red)`,"--color-text-secondary":`var(--color-text-red)`,"--color-error":`var(--color-text-red)`}},switch:{base:{"--color-background-gray":`var(--color-border-emphasized)`}},progressbar:{base:{"--color-background-muted":`var(--color-border-emphasized)`},"variant:accent":{"--color-accent":`#0074e2`},"variant:success":{"--color-success":`#198100`},"variant:warning":{"--color-warning":`#ffce2f`},"variant:error":{"--color-error":`#e33f4a`}},card:{base:{padding:`var(--spacing-3)`}},section:{base:{padding:`var(--spacing-3)`}}},icons:to})})),oo,so,co,lo=o((()=>{oo={blue:{base:`#8ab9f3`,onBase:`#003259`,hover:`#9fcaff`,active:`#79a9e2`,bg:`#11131a`,surfaceLowest:`#0c0e15`,surfaceLow:`#191b23`,surface:`#1d1f27`,surfaceHigh:`#272a31`,surfaceHighest:`#32343c`,onSurface:`#e1e2ec`,onSurfaceVariant:`#c2c6d6`,primaryContainer:`#08497c`,onPrimaryContainer:`#d2e4ff`,secondaryContainer:`#324862`,onSecondaryContainer:`#d2e4ff`,tertiaryContainer:`#563c69`,onTertiaryContainer:`#f3daff`,outline:`#8c909f`,outlineVariant:`#424654`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#003660`},purple:{base:`#d0bcff`,onBase:`#372463`,hover:`#dfd0ff`,active:`#c0abf4`,bg:`#161219`,surfaceLowest:`#110c14`,surfaceLow:`#1f1a21`,surface:`#231e25`,surfaceHigh:`#2e2830`,surfaceHighest:`#39333b`,onSurface:`#eadfea`,onSurfaceVariant:`#d0c2d3`,primaryContainer:`#4e3b7c`,onPrimaryContainer:`#e9ddff`,secondaryContainer:`#4b4163`,onSecondaryContainer:`#e9ddff`,tertiaryContainer:`#6c3648`,onTertiaryContainer:`#ffd9e2`,outline:`#998d9d`,outlineVariant:`#4d4351`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#3c2968`},green:{base:`#85d7ae`,onBase:`#003824`,hover:`#95e8be`,active:`#74c69e`,bg:`#0c1513`,surfaceLowest:`#07100e`,surfaceLow:`#141d1b`,surface:`#18211f`,surfaceHigh:`#232c29`,surfaceHighest:`#2d3734`,onSurface:`#dbe5e0`,onSurfaceVariant:`#b8cbc4`,primaryContainer:`#005236`,onPrimaryContainer:`#a0f4c9`,secondaryContainer:`#284e3c`,onSecondaryContainer:`#c2ecd3`,tertiaryContainer:`#004d61`,onTertiaryContainer:`#b9eaff`,outline:`#83958f`,outlineVariant:`#3a4a45`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#003d28`},red:{base:`#ffb3ad`,onBase:`#5a1b19`,hover:`#ffcbc6`,active:`#fd9c95`,bg:`#1c110d`,surfaceLowest:`#160c08`,surfaceLow:`#251915`,surface:`#291d19`,surfaceHigh:`#342723`,surfaceHighest:`#40322d`,onSurface:`#f5ded7`,onSurfaceVariant:`#dfc0b6`,primaryContainer:`#77302d`,onPrimaryContainer:`#ffdad7`,secondaryContainer:`#663b38`,onSecondaryContainer:`#ffdad7`,tertiaryContainer:`#5d4202`,onTertiaryContainer:`#ffdea6`,outline:`#a78b81`,outlineVariant:`#58423a`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#5f1f1d`},orange:{base:`#ffb690`,onBase:`#552100`,hover:`#ffcdb4`,active:`#f9a171`,bg:`#1b120a`,surfaceLowest:`#150c06`,surfaceLow:`#231a11`,surface:`#281e15`,surfaceHigh:`#33281f`,surfaceHighest:`#3e3329`,onSurface:`#f2dfd1`,onSurfaceVariant:`#dcc2ad`,primaryContainer:`#73350e`,onPrimaryContainer:`#ffdbca`,secondaryContainer:`#653d27`,onSecondaryContainer:`#ffdbca`,tertiaryContainer:`#4d4808`,onTertiaryContainer:`#ede596`,outline:`#a48c7a`,outlineVariant:`#554334`,error:`#ffb4ab`,onError:`#690005`,errorContainer:`#93000a`,onErrorContainer:`#ffdad6`,ambient:`#5b2400`}},so=`blue`,co=Object.keys(oo)}));function uo(e){return e<0?-1:e===0?0:1}function fo(e,t,n){return(1-n)*e+n*t}function po(e,t,n){return nt?t:n}function mo(e,t,n){return nt?t:n}function ho(e){return e%=360,e<0&&(e+=360),e}function go(e){return e%=360,e<0&&(e+=360),e}function _o(e,t){return 180-Math.abs(Math.abs(e-t)-180)}function vo(e,t){return[e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2],e[0]*t[1][0]+e[1]*t[1][1]+e[2]*t[1][2],e[0]*t[2][0]+e[1]*t[2][1]+e[2]*t[2][2]]}var F=o((()=>{}));function yo(e,t,n){return(255<<24|(e&255)<<16|(t&255)<<8|n&255)>>>0}function bo(e){return yo(Mo(e[0]),Mo(e[1]),Mo(e[2]))}function xo(e){return e>>16&255}function So(e){return e>>8&255}function Co(e){return e&255}function wo(e,t,n){let r=Lo,i=r[0][0]*e+r[0][1]*t+r[0][2]*n,a=r[1][0]*e+r[1][1]*t+r[1][2]*n,o=r[2][0]*e+r[2][1]*t+r[2][2]*n;return yo(Mo(i),Mo(a),Mo(o))}function To(e){return vo([jo(xo(e)),jo(So(e)),jo(Co(e))],Io)}function Eo(e){let t=jo(xo(e)),n=jo(So(e)),r=jo(Co(e)),i=Io,a=i[0][0]*t+i[0][1]*n+i[0][2]*r,o=i[1][0]*t+i[1][1]*n+i[1][2]*r,s=i[2][0]*t+i[2][1]*n+i[2][2]*r,c=Ro,l=a/c[0],u=o/c[1],d=s/c[2],f=Po(l),p=Po(u),m=Po(d);return[116*p-16,500*(f-p),200*(p-m)]}function Do(e){let t=Mo(ko(e));return yo(t,t,t)}function Oo(e){let t=To(e)[1];return 116*Po(t/100)-16}function ko(e){return 100*Fo((e+16)/116)}function Ao(e){return Po(e/100)*116-16}function jo(e){let t=e/255;return t<=.040449936?t/12.92*100:((t+.055)/1.055)**2.4*100}function Mo(e){let t=e/100,n=0;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,po(0,255,Math.round(n*255))}function No(){return Ro}function Po(e){return e>.008856451679035631?e**(1/3):(903.2962962962963*e+16)/116}function Fo(e){let t=e*e*e;return t>.008856451679035631?t:(116*e-16)/903.2962962962963}var Io,Lo,Ro,zo=o((()=>{F(),Io=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Lo=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],Ro=[95.047,100,108.883]})),Bo,Vo=o((()=>{zo(),F(),Bo=class e{static make(t=No(),n=200/Math.PI*ko(50)/100,r=50,i=2,a=!1){let o=t,s=o[0]*.401288+o[1]*.650173+o[2]*-.051461,c=o[0]*-.250268+o[1]*1.204414+o[2]*.045854,l=o[0]*-.002079+o[1]*.048952+o[2]*.953127,u=.8+i/10,d=u>=.9?fo(.59,.69,(u-.9)*10):fo(.525,.59,(u-.8)*10),f=a?1:u*(1-1/3.6*Math.exp((-n-42)/92));f=f>1?1:f<0?0:f;let p=u,m=[100/s*f+1-f,100/c*f+1-f,100/l*f+1-f],h=1/(5*n+1),g=h*h*h*h,_=1-g,v=g*n+.1*_*_*Math.cbrt(5*n),y=ko(r)/t[1],b=1.48+Math.sqrt(y),x=.725/y**.2,S=x,C=[(v*m[0]*s/100)**.42,(v*m[1]*c/100)**.42,(v*m[2]*l/100)**.42],w=[400*C[0]/(C[0]+27.13),400*C[1]/(C[1]+27.13),400*C[2]/(C[2]+27.13)],ee=(2*w[0]+w[1]+.05*w[2])*x;return new e(y,ee,x,S,d,p,m,v,v**.25,b)}constructor(e,t,n,r,i,a,o,s,c,l){this.n=e,this.aw=t,this.nbb=n,this.ncb=r,this.c=i,this.nc=a,this.rgbD=o,this.fl=s,this.fLRoot=c,this.z=l}},Bo.DEFAULT=Bo.make()})),Ho,Uo=o((()=>{zo(),F(),Vo(),Ho=class e{constructor(e,t,n,r,i,a,o,s,c){this.hue=e,this.chroma=t,this.j=n,this.q=r,this.m=i,this.s=a,this.jstar=o,this.astar=s,this.bstar=c}distance(e){let t=this.jstar-e.jstar,n=this.astar-e.astar,r=this.bstar-e.bstar;return 1.41*Math.sqrt(t*t+n*n+r*r)**.63}static fromInt(t){return e.fromIntInViewingConditions(t,Bo.DEFAULT)}static fromIntInViewingConditions(t,n){let r=(t&16711680)>>16,i=(t&65280)>>8,a=t&255,o=jo(r),s=jo(i),c=jo(a),l=.41233895*o+.35762064*s+.18051042*c,u=.2126*o+.7152*s+.0722*c,d=.01932141*o+.11916382*s+.95034478*c,f=.401288*l+.650173*u-.051461*d,p=-.250268*l+1.204414*u+.045854*d,m=-.002079*l+.048952*u+.953127*d,h=n.rgbD[0]*f,g=n.rgbD[1]*p,_=n.rgbD[2]*m,v=(n.fl*Math.abs(h)/100)**.42,y=(n.fl*Math.abs(g)/100)**.42,b=(n.fl*Math.abs(_)/100)**.42,x=uo(h)*400*v/(v+27.13),S=uo(g)*400*y/(y+27.13),C=uo(_)*400*b/(b+27.13),w=(11*x+-12*S+C)/11,ee=(x+S-2*C)/9,te=(20*x+20*S+21*C)/20,ne=(40*x+20*S+C)/20,T=go(Math.atan2(ee,w)*180/Math.PI),re=T*Math.PI/180,E=100*(ne*n.nbb/n.aw)**+(n.c*n.z),D=4/n.c*Math.sqrt(E/100)*(n.aw+4)*n.fLRoot,ie=T<20.14?T+360:T,ae=(5e4/13*(.25*(Math.cos(ie*Math.PI/180+2)+3.8))*n.nc*n.ncb*Math.sqrt(w*w+ee*ee)/(te+.305))**.9*(1.64-.29**n.n)**.73,O=ae*Math.sqrt(E/100),oe=O*n.fLRoot,k=50*Math.sqrt(ae*n.c/(n.aw+4)),A=(1+100*.007)*E/(1+.007*E),se=1/.0228*Math.log(1+.0228*oe),ce=se*Math.cos(re),j=se*Math.sin(re);return new e(T,O,E,D,oe,k,A,ce,j)}static fromJch(t,n,r){return e.fromJchInViewingConditions(t,n,r,Bo.DEFAULT)}static fromJchInViewingConditions(t,n,r,i){let a=4/i.c*Math.sqrt(t/100)*(i.aw+4)*i.fLRoot,o=n*i.fLRoot,s=n/Math.sqrt(t/100),c=50*Math.sqrt(s*i.c/(i.aw+4)),l=r*Math.PI/180,u=(1+100*.007)*t/(1+.007*t),d=1/.0228*Math.log(1+.0228*o),f=d*Math.cos(l),p=d*Math.sin(l);return new e(r,n,t,a,o,c,u,f,p)}static fromUcs(t,n,r){return e.fromUcsInViewingConditions(t,n,r,Bo.DEFAULT)}static fromUcsInViewingConditions(t,n,r,i){let a=n,o=r,s=Math.sqrt(a*a+o*o),c=(Math.exp(s*.0228)-1)/.0228/i.fLRoot,l=180/Math.PI*Math.atan2(o,a);l<0&&(l+=360);let u=t/(1-(t-100)*.007);return e.fromJchInViewingConditions(u,c,l,i)}toInt(){return this.viewed(Bo.DEFAULT)}viewed(e){let t=((this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100))/(1.64-.29**e.n)**.73)**(1/.9),n=this.hue*Math.PI/180,r=.25*(Math.cos(n+2)+3.8),i=e.aw*(this.j/100)**(1/e.c/e.z),a=5e4/13*r*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(n),c=Math.cos(n),l=23*(o+.305)*t/(23*a+11*t*c+108*t*s),u=l*c,d=l*s,f=(460*o+451*u+288*d)/1403,p=(460*o-891*u-261*d)/1403,m=(460*o-220*u-6300*d)/1403,h=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),g=uo(f)*(100/e.fl)*h**(1/.42),_=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),v=uo(p)*(100/e.fl)*_**(1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=uo(m)*(100/e.fl)*y**(1/.42),x=g/e.rgbD[0],S=v/e.rgbD[1],C=b/e.rgbD[2];return wo(1.86206786*x-1.01125463*S+.14918677*C,.38752654*x+.62144744*S-.00897398*C,-.0158415*x-.03412294*S+1.04996444*C)}static fromXyzInViewingConditions(t,n,r,i){let a=.401288*t+.650173*n-.051461*r,o=-.250268*t+1.204414*n+.045854*r,s=-.002079*t+.048952*n+.953127*r,c=i.rgbD[0]*a,l=i.rgbD[1]*o,u=i.rgbD[2]*s,d=(i.fl*Math.abs(c)/100)**.42,f=(i.fl*Math.abs(l)/100)**.42,p=(i.fl*Math.abs(u)/100)**.42,m=uo(c)*400*d/(d+27.13),h=uo(l)*400*f/(f+27.13),g=uo(u)*400*p/(p+27.13),_=(11*m+-12*h+g)/11,v=(m+h-2*g)/9,y=(20*m+20*h+21*g)/20,b=(40*m+20*h+g)/20,x=Math.atan2(v,_)*180/Math.PI,S=x<0?x+360:x>=360?x-360:x,C=S*Math.PI/180,w=100*(b*i.nbb/i.aw)**+(i.c*i.z),ee=4/i.c*Math.sqrt(w/100)*(i.aw+4)*i.fLRoot,te=S<20.14?S+360:S,ne=(5e4/13*(1/4*(Math.cos(te*Math.PI/180+2)+3.8))*i.nc*i.ncb*Math.sqrt(_*_+v*v)/(y+.305))**.9*(1.64-.29**i.n)**.73,T=ne*Math.sqrt(w/100),re=T*i.fLRoot,E=50*Math.sqrt(ne*i.c/(i.aw+4)),D=(1+100*.007)*w/(1+.007*w),ie=Math.log(1+.0228*re)/.0228,ae=ie*Math.cos(C),O=ie*Math.sin(C);return new e(S,T,w,ee,re,E,D,ae,O)}xyzInViewingConditions(e){let t=((this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100))/(1.64-.29**e.n)**.73)**(1/.9),n=this.hue*Math.PI/180,r=.25*(Math.cos(n+2)+3.8),i=e.aw*(this.j/100)**(1/e.c/e.z),a=5e4/13*r*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(n),c=Math.cos(n),l=23*(o+.305)*t/(23*a+11*t*c+108*t*s),u=l*c,d=l*s,f=(460*o+451*u+288*d)/1403,p=(460*o-891*u-261*d)/1403,m=(460*o-220*u-6300*d)/1403,h=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),g=uo(f)*(100/e.fl)*h**(1/.42),_=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),v=uo(p)*(100/e.fl)*_**(1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=uo(m)*(100/e.fl)*y**(1/.42),x=g/e.rgbD[0],S=v/e.rgbD[1],C=b/e.rgbD[2];return[1.86206786*x-1.01125463*S+.14918677*C,.38752654*x+.62144744*S-.00897398*C,-.0158415*x-.03412294*S+1.04996444*C]}}})),Wo,Go=o((()=>{zo(),F(),Uo(),Vo(),Wo=class e{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){let t=e/100,n=0;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,n*255}static chromaticAdaptation(e){let t=Math.abs(e)**.42;return uo(e)*400*t/(t+27.13)}static hueOf(t){let n=vo(t,e.SCALED_DISCOUNT_FROM_LINRGB),r=e.chromaticAdaptation(n[0]),i=e.chromaticAdaptation(n[1]),a=e.chromaticAdaptation(n[2]),o=(11*r+-12*i+a)/11,s=(r+i-2*a)/9;return Math.atan2(s,o)}static areInCyclicOrder(t,n,r){return e.sanitizeRadians(n-t)100.01||y[1]>100.01||y[2]>100.01?0:bo(y);i-=(C-r)*i/(2*C)}return 0}static solveToInt(t,n,r){if(n<1e-4||r<1e-4||r>99.9999)return Do(r);t=go(t);let i=t/180*Math.PI,a=ko(r),o=e.findResultByJ(i,n,a);return o===0?bo(e.bisectToLimit(a,i)):o}static solveToCam(t,n,r){return Ho.fromInt(e.solveToInt(t,n,r))}},Wo.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],Wo.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],Wo.Y_FROM_LINRGB=[.2126,.7152,.0722],Wo.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776]})),I,Ko=o((()=>{zo(),Uo(),Go(),Vo(),I=class e{static from(t,n,r){return new e(Wo.solveToInt(t,n,r))}static fromInt(t){return new e(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(Wo.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(Wo.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(Wo.solveToInt(this.internalHue,this.internalChroma,e))}setValue(e,t){this[e]=t}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(e){return e>=250&&e<270}static isYellow(e){return e>=105&&e<125}static isCyan(e){return e>=170&&e<207}constructor(e){this.argb=e;let t=Ho.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Oo(e),this.argb=e}setInternalState(e){let t=Ho.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Oo(e),this.argb=e}inViewingConditions(t){let n=Ho.fromInt(this.toInt()).xyzInViewingConditions(t),r=Ho.fromXyzInViewingConditions(n[0],n[1],n[2],Bo.make());return e.from(r.hue,r.chroma,Ao(n[1]))}}})),qo=o((()=>{Uo(),Ko()})),Jo,Yo=o((()=>{zo(),F(),Jo=class e{static ratioOfTones(t,n){return t=mo(0,100,t),n=mo(0,100,n),e.ratioOfYs(ko(t),ko(n))}static ratioOfYs(e,t){let n=e>t?e:t,r=n===t?e:t;return(n+5)/(r+5)}static lighter(t,n){if(t<0||t>100)return-1;let r=ko(t),i=n*(r+5)-5,a=e.ratioOfYs(i,r),o=Math.abs(a-n);if(a.04)return-1;let s=Ao(i)+.4;return s<0||s>100?-1:s}static darker(t,n){if(t<0||t>100)return-1;let r=ko(t),i=(r+5)/n-5,a=e.ratioOfYs(r,i),o=Math.abs(a-n);if(a.04)return-1;let s=Ao(i)-.4;return s<0||s>100?-1:s}static lighterUnsafe(t,n){let r=e.lighter(t,n);return r<0?100:r}static darkerUnsafe(t,n){let r=e.darker(t,n);return r<0?0:r}}})),Xo,Zo=o((()=>{Ko(),Xo=class e{static isDisliked(e){let t=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,n=Math.round(e.chroma)>16,r=Math.round(e.tone)<65;return t&&n&&r}static fixIfDisliked(t){return e.isDisliked(t)?I.from(t.hue,t.chroma,70):t}}}));function Qo(e,t,n){if(e.name!==n.name)throw Error(`Attempting to extend color ${e.name} with color ${n.name} of different name for spec version ${t}.`);if(e.isBackground!==n.isBackground)throw Error(`Attempting to extend color ${e.name} as a ${e.isBackground?`background`:`foreground`} with color ${n.name} as a ${n.isBackground?`background`:`foreground`} for spec version ${t}.`)}function L(e,t,n){return Qo(e,t,n),R.fromPalette({name:e.name,palette:r=>r.specVersion===t?n.palette(r):e.palette(r),tone:r=>r.specVersion===t?n.tone(r):e.tone(r),isBackground:e.isBackground,chromaMultiplier:r=>{let i=r.specVersion===t?n.chromaMultiplier:e.chromaMultiplier;return i===void 0?1:i(r)},background:r=>{let i=r.specVersion===t?n.background:e.background;return i===void 0?void 0:i(r)},secondBackground:r=>{let i=r.specVersion===t?n.secondBackground:e.secondBackground;return i===void 0?void 0:i(r)},contrastCurve:r=>{let i=r.specVersion===t?n.contrastCurve:e.contrastCurve;return i===void 0?void 0:i(r)},toneDeltaPair:r=>{let i=r.specVersion===t?n.toneDeltaPair:e.toneDeltaPair;return i===void 0?void 0:i(r)}})}function $o(e){return e===`2025`?rs:ns}var R,es,ts,ns,rs,is=o((()=>{Yo(),Ko(),F(),R=class e{static fromPalette(t){return new e(t.name??``,t.palette,t.tone??e.getInitialToneFromBackground(t.background),t.isBackground??!1,t.chromaMultiplier,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}static getInitialToneFromBackground(e){return e===void 0?e=>50:t=>e(t)?e(t).getTone(t):50}constructor(e,t,n,r,i,a,o,s,c){if(this.name=e,this.palette=t,this.tone=n,this.isBackground=r,this.chromaMultiplier=i,this.background=a,this.secondBackground=o,this.contrastCurve=s,this.toneDeltaPair=c,this.hctCache=new Map,!a&&o)throw Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!a&&s)throw Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(a&&!s)throw Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return e.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(e){return this.getHct(e).toInt()}getHct(e){let t=this.hctCache.get(e);if(t!=null)return t;let n=$o(e.specVersion).getHct(e,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n}getTone(e){return $o(e.specVersion).getTone(e,this)}static foregroundTone(t,n){let r=Jo.lighterUnsafe(t,n),i=Jo.darkerUnsafe(t,n),a=Jo.ratioOfTones(r,t),o=Jo.ratioOfTones(i,t);if(e.tonePrefersLightForeground(t)){let e=Math.abs(a-o)<.1&&a=n||a>=o||e?r:i}return o>=n||o>=a?i:r}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(t){return e.tonePrefersLightForeground(t)&&!e.toneAllowsLightForeground(t)?49:t}},es=class{getHct(e,t){let n=t.getTone(e);return t.palette(e).getHct(n)}getTone(e,t){let n=e.contrastLevel<0,r=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(r){let i=r.roleA,a=r.roleB,o=r.delta,s=r.polarity,c=r.stayTogether,l=s===`nearer`||s===`lighter`&&!e.isDark||s===`darker`&&e.isDark,u=l?i:a,d=l?a:i,f=t.name===u.name,p=e.isDark?1:-1,m=u.tone(e),h=d.tone(e);if(t.background&&u.contrastCurve&&d.contrastCurve){let r=t.background(e),i=u.contrastCurve(e),a=d.contrastCurve(e);if(r&&i&&a){let t=r.getTone(e),o=i.get(e.contrastLevel),s=a.get(e.contrastLevel);Jo.ratioOfTones(t,m)=o||(m=mo(0,100,h-o*p))),50<=m&&m<60?p>0?(m=60,h=Math.max(h,m+o*p)):(m=49,h=Math.min(h,m+o*p)):50<=h&&h<60&&(c?p>0?(m=60,h=Math.max(h,m+o*p)):(m=49,h=Math.min(h,m+o*p)):h=p>0?60:49),f?m:h}{let r=t.tone(e);if(t.background==null||t.background(e)===void 0||t.contrastCurve==null||t.contrastCurve(e)===void 0)return r;let i=t.background(e).getTone(e),a=t.contrastCurve(e).get(e.contrastLevel);if(Jo.ratioOfTones(i,r)>=a||(r=R.foregroundTone(i,a)),n&&(r=R.foregroundTone(i,a)),t.isBackground&&50<=r&&r<60&&(r=Jo.ratioOfTones(49,i)>=a?49:60),t.secondBackground==null||t.secondBackground(e)===void 0)return r;let[o,s]=[t.background,t.secondBackground],[c,l]=[o(e).getTone(e),s(e).getTone(e)],[u,d]=[Math.max(c,l),Math.min(c,l)];if(Jo.ratioOfTones(u,r)>=a&&Jo.ratioOfTones(d,r)>=a)return r;let f=Jo.lighter(u,a),p=Jo.darker(d,a),m=[];return f!==-1&&m.push(f),p!==-1&&m.push(p),R.tonePrefersLightForeground(c)||R.tonePrefersLightForeground(l)?f<0?100:f:m.length===1?m[0]:p<0?0:p}}},ts=class{getHct(e,t){let n=t.palette(e),r=t.getTone(e),i=n.hue,a=n.chroma*(t.chromaMultiplier?t.chromaMultiplier(e):1);return I.from(i,a,r)}getTone(e,t){let n=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(n){let r=n.roleA,i=n.roleB,a=n.polarity,o=n.constraint,s=a===`darker`||a===`relative_lighter`&&e.isDark||a===`relative_darker`&&!e.isDark?-n.delta:n.delta,c=t.name===r.name,l=c?r:i,u=c?i:r,d=l.tone(e),f=u.getTone(e),p=s*(c?1:-1);if(o===`exact`?d=mo(0,100,f+p):o===`nearer`?d=p>0?mo(0,100,mo(f,f+p,d)):mo(0,100,mo(f+p,f,d)):o===`farther`&&(d=p>0?mo(f+p,100,d):mo(0,f+p,d)),t.background&&t.contrastCurve){let n=t.background(e),r=t.contrastCurve(e);if(n&&r){let t=n.getTone(e),i=r.get(e.contrastLevel);d=Jo.ratioOfTones(t,d)>=i&&e.contrastLevel>=0?d:R.foregroundTone(t,i)}}return t.isBackground&&!t.name.endsWith(`_fixed_dim`)&&(d=d>=57?mo(65,100,d):mo(0,49,d)),d}{let n=t.tone(e);if(t.background==null||t.background(e)===void 0||t.contrastCurve==null||t.contrastCurve(e)===void 0)return n;let r=t.background(e).getTone(e),i=t.contrastCurve(e).get(e.contrastLevel);if(n=Jo.ratioOfTones(r,n)>=i&&e.contrastLevel>=0?n:R.foregroundTone(r,i),t.isBackground&&!t.name.endsWith(`_fixed_dim`)&&(n=n>=57?mo(65,100,n):mo(0,49,n)),t.secondBackground==null||t.secondBackground(e)===void 0)return n;let[a,o]=[t.background,t.secondBackground],[s,c]=[a(e).getTone(e),o(e).getTone(e)],[l,u]=[Math.max(s,c),Math.min(s,c)];if(Jo.ratioOfTones(l,n)>=i&&Jo.ratioOfTones(u,n)>=i)return n;let d=Jo.lighter(l,i),f=Jo.darker(u,i),p=[];return d!==-1&&p.push(d),f!==-1&&p.push(f),R.tonePrefersLightForeground(s)||R.tonePrefersLightForeground(c)?d<0?100:d:p.length===1?p[0]:f<0?0:f}}},ns=new es,rs=new ts})),z,as,os=o((()=>{Ko(),z=class e{static fromInt(t){let n=I.fromInt(t);return e.fromHct(n)}static fromHct(t){return new e(t.hue,t.chroma,t)}static fromHueAndChroma(t,n){let r=new as(t,n).create();return new e(t,n,r)}constructor(e,t,n){this.hue=e,this.chroma=t,this.keyColor=n,this.cache=new Map}tone(e){let t=this.cache.get(e);return t===void 0&&(t=e==99&&I.isYellow(this.hue)?this.averageArgb(this.tone(98),this.tone(100)):I.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,t)),t}getHct(e){return I.fromInt(this.tone(e))}averageArgb(e,t){let n=e>>>16&255,r=e>>>8&255,i=e&255,a=t>>>16&255,o=t>>>8&255,s=t&255,c=Math.round((n+a)/2),l=Math.round((r+o)/2),u=Math.round((i+s)/2);return(255<<24|(c&255)<<16|(l&255)<<8|u&255)>>>0}},as=class{constructor(e,t){this.hue=e,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let e=0,t=100;for(;e=this.requestedChroma-.01){if(Math.abs(e-50){Ko(),zo(),F(),ss=class e{constructor(e){this.input=e,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;let e=this.hctsByHue.concat([this.input]),t=this.tempsByHct;return e.sort((e,n)=>t.get(e)-t.get(n)),this.hctsByTempCache=e,e}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(e=5,t=12){let n=Math.round(this.input.hue),r=this.hctsByHue[n],i=this.relativeTemperature(r),a=[r],o=0;for(let e=0;e<360;e++){let t=ho(n+e),r=this.hctsByHue[t],a=this.relativeTemperature(r),s=Math.abs(a-i);i=a,o+=s}let s=1,c=o/t,l=0;for(i=this.relativeTemperature(r);a.length=d,p=1;for(;f&&a.length=e,p++}if(i=o,s++,s>360){for(;a.length=a.length&&(t%=a.length),u.splice(0,0,a[t])}let f=e-d-1;for(let e=1;e=a.length&&(t%=a.length),u.push(a[t])}return u}get complement(){if(this.complementCache!=null)return this.complementCache;let t=this.coldest.hue,n=this.tempsByHct.get(this.coldest),r=this.warmest.hue,i=this.tempsByHct.get(this.warmest)-n,a=e.isBetween(this.input.hue,t,r),o=a?r:t,s=a?t:r,c=1e3,l=this.hctsByHue[Math.round(this.input.hue)],u=1-this.inputRelativeTemperature;for(let t=0;t<=360;t+=1){let r=go(o+1*t);if(!e.isBetween(r,o,s))continue;let a=this.hctsByHue[Math.round(r)],d=(this.tempsByHct.get(a)-n)/i,f=Math.abs(u-d);f=0||(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input)),this.inputRelativeTemperatureCache}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;let t=this.hctsByHue.concat([this.input]),n=new Map;for(let r of t)n.set(r,e.rawTemperature(r));return this.tempsByHctCache=n,n}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;let e=[];for(let t=0;t<=360;t+=1){let n=I.from(t,this.input.chroma,this.input.tone);e.push(n)}return this.hctsByHueCache=e,this.hctsByHueCache}static isBetween(e,t,n){return t{F(),B=class{constructor(e,t,n,r){this.low=e,this.normal=t,this.medium=n,this.high=r}get(e){return e<=-1?this.low:e<0?fo(this.low,this.normal,(e- -1)/1):e<.5?fo(this.normal,this.medium,(e-0)/.5):e<1?fo(this.medium,this.high,(e-.5)/.5):this.high}}})),us,ds=o((()=>{us=class{constructor(e,t,n,r,i,a){this.roleA=e,this.roleB=t,this.delta=n,this.polarity=r,this.stayTogether=i,this.constraint=a,this.constraint=a??`exact`}}})),V,fs=o((()=>{(function(e){e[e.MONOCHROME=0]=`MONOCHROME`,e[e.NEUTRAL=1]=`NEUTRAL`,e[e.TONAL_SPOT=2]=`TONAL_SPOT`,e[e.VIBRANT=3]=`VIBRANT`,e[e.EXPRESSIVE=4]=`EXPRESSIVE`,e[e.FIDELITY=5]=`FIDELITY`,e[e.CONTENT=6]=`CONTENT`,e[e.RAINBOW=7]=`RAINBOW`,e[e.FRUIT_SALAD=8]=`FRUIT_SALAD`})(V||(V={}))}));function ps(e){return e.variant===V.FIDELITY||e.variant===V.CONTENT}function ms(e){return e.variant===V.MONOCHROME}function hs(e,t,n,r){let i=n,a=I.from(e,t,n);if(a.chromao.chroma||Math.abs(o.chroma-t)<.4)break;Math.abs(o.chroma-t){Zo(),Ko(),ls(),is(),ds(),fs(),gs=class{primaryPaletteKeyColor(){return R.fromPalette({name:`primary_palette_key_color`,palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone})}secondaryPaletteKeyColor(){return R.fromPalette({name:`secondary_palette_key_color`,palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone})}tertiaryPaletteKeyColor(){return R.fromPalette({name:`tertiary_palette_key_color`,palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone})}neutralPaletteKeyColor(){return R.fromPalette({name:`neutral_palette_key_color`,palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone})}neutralVariantPaletteKeyColor(){return R.fromPalette({name:`neutral_variant_palette_key_color`,palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone})}errorPaletteKeyColor(){return R.fromPalette({name:`error_palette_key_color`,palette:e=>e.errorPalette,tone:e=>e.errorPalette.keyColor.tone})}background(){return R.fromPalette({name:`background`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}onBackground(){return R.fromPalette({name:`on_background`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.background(),contrastCurve:e=>new B(3,3,4.5,7)})}surface(){return R.fromPalette({name:`surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}surfaceDim(){return R.fromPalette({name:`surface_dim`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new B(87,87,80,75).get(e.contrastLevel),isBackground:!0})}surfaceBright(){return R.fromPalette({name:`surface_bright`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new B(24,24,29,34).get(e.contrastLevel):98,isBackground:!0})}surfaceContainerLowest(){return R.fromPalette({name:`surface_container_lowest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new B(4,4,2,0).get(e.contrastLevel):100,isBackground:!0})}surfaceContainerLow(){return R.fromPalette({name:`surface_container_low`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new B(10,10,11,12).get(e.contrastLevel):new B(96,96,96,95).get(e.contrastLevel),isBackground:!0})}surfaceContainer(){return R.fromPalette({name:`surface_container`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new B(12,12,16,20).get(e.contrastLevel):new B(94,94,92,90).get(e.contrastLevel),isBackground:!0})}surfaceContainerHigh(){return R.fromPalette({name:`surface_container_high`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new B(17,17,21,25).get(e.contrastLevel):new B(92,92,88,85).get(e.contrastLevel),isBackground:!0})}surfaceContainerHighest(){return R.fromPalette({name:`surface_container_highest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new B(22,22,26,30).get(e.contrastLevel):new B(90,90,84,80).get(e.contrastLevel),isBackground:!0})}onSurface(){return R.fromPalette({name:`on_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.highestSurface(e),contrastCurve:e=>new B(4.5,7,11,21)})}surfaceVariant(){return R.fromPalette({name:`surface_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0})}onSurfaceVariant(){return R.fromPalette({name:`on_surface_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>this.highestSurface(e),contrastCurve:e=>new B(3,4.5,7,11)})}inverseSurface(){return R.fromPalette({name:`inverse_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20,isBackground:!0})}inverseOnSurface(){return R.fromPalette({name:`inverse_on_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>this.inverseSurface(),contrastCurve:e=>new B(4.5,7,11,21)})}outline(){return R.fromPalette({name:`outline`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1.5,3,4.5,7)})}outlineVariant(){return R.fromPalette({name:`outline_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5)})}shadow(){return R.fromPalette({name:`shadow`,palette:e=>e.neutralPalette,tone:e=>0})}scrim(){return R.fromPalette({name:`scrim`,palette:e=>e.neutralPalette,tone:e=>0})}surfaceTint(){return R.fromPalette({name:`surface_tint`,palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0})}primary(){return R.fromPalette({name:`primary`,palette:e=>e.primaryPalette,tone:e=>ms(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(3,4.5,7,7),toneDeltaPair:e=>new us(this.primaryContainer(),this.primary(),10,`nearer`,!1)})}primaryDim(){}onPrimary(){return R.fromPalette({name:`on_primary`,palette:e=>e.primaryPalette,tone:e=>ms(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.primary(),contrastCurve:e=>new B(4.5,7,11,21)})}primaryContainer(){return R.fromPalette({name:`primary_container`,palette:e=>e.primaryPalette,tone:e=>ps(e)?e.sourceColorHct.tone:ms(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.primaryContainer(),this.primary(),10,`nearer`,!1)})}onPrimaryContainer(){return R.fromPalette({name:`on_primary_container`,palette:e=>e.primaryPalette,tone:e=>ps(e)?R.foregroundTone(this.primaryContainer().tone(e),4.5):ms(e)?e.isDark?0:100:e.isDark?90:30,background:e=>this.primaryContainer(),contrastCurve:e=>new B(3,4.5,7,11)})}inversePrimary(){return R.fromPalette({name:`inverse_primary`,palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>this.inverseSurface(),contrastCurve:e=>new B(3,4.5,7,7)})}secondary(){return R.fromPalette({name:`secondary`,palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(3,4.5,7,7),toneDeltaPair:e=>new us(this.secondaryContainer(),this.secondary(),10,`nearer`,!1)})}secondaryDim(){}onSecondary(){return R.fromPalette({name:`on_secondary`,palette:e=>e.secondaryPalette,tone:e=>ms(e)?e.isDark?10:100:e.isDark?20:100,background:e=>this.secondary(),contrastCurve:e=>new B(4.5,7,11,21)})}secondaryContainer(){return R.fromPalette({name:`secondary_container`,palette:e=>e.secondaryPalette,tone:e=>{let t=e.isDark?30:90;return ms(e)?e.isDark?30:85:ps(e)?hs(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark):t},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.secondaryContainer(),this.secondary(),10,`nearer`,!1)})}onSecondaryContainer(){return R.fromPalette({name:`on_secondary_container`,palette:e=>e.secondaryPalette,tone:e=>ms(e)?e.isDark?90:10:ps(e)?R.foregroundTone(this.secondaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.secondaryContainer(),contrastCurve:e=>new B(3,4.5,7,11)})}tertiary(){return R.fromPalette({name:`tertiary`,palette:e=>e.tertiaryPalette,tone:e=>ms(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(3,4.5,7,7),toneDeltaPair:e=>new us(this.tertiaryContainer(),this.tertiary(),10,`nearer`,!1)})}tertiaryDim(){}onTertiary(){return R.fromPalette({name:`on_tertiary`,palette:e=>e.tertiaryPalette,tone:e=>ms(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.tertiary(),contrastCurve:e=>new B(4.5,7,11,21)})}tertiaryContainer(){return R.fromPalette({name:`tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>{if(ms(e))return e.isDark?60:49;if(!ps(e))return e.isDark?30:90;let t=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return Xo.fixIfDisliked(t).tone},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.tertiaryContainer(),this.tertiary(),10,`nearer`,!1)})}onTertiaryContainer(){return R.fromPalette({name:`on_tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>ms(e)?e.isDark?0:100:ps(e)?R.foregroundTone(this.tertiaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.tertiaryContainer(),contrastCurve:e=>new B(3,4.5,7,11)})}error(){return R.fromPalette({name:`error`,palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(3,4.5,7,7),toneDeltaPair:e=>new us(this.errorContainer(),this.error(),10,`nearer`,!1)})}errorDim(){}onError(){return R.fromPalette({name:`on_error`,palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>this.error(),contrastCurve:e=>new B(4.5,7,11,21)})}errorContainer(){return R.fromPalette({name:`error_container`,palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.errorContainer(),this.error(),10,`nearer`,!1)})}onErrorContainer(){return R.fromPalette({name:`on_error_container`,palette:e=>e.errorPalette,tone:e=>ms(e)?e.isDark?90:10:e.isDark?90:30,background:e=>this.errorContainer(),contrastCurve:e=>new B(3,4.5,7,11)})}primaryFixed(){return R.fromPalette({name:`primary_fixed`,palette:e=>e.primaryPalette,tone:e=>ms(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.primaryFixed(),this.primaryFixedDim(),10,`lighter`,!0)})}primaryFixedDim(){return R.fromPalette({name:`primary_fixed_dim`,palette:e=>e.primaryPalette,tone:e=>ms(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.primaryFixed(),this.primaryFixedDim(),10,`lighter`,!0)})}onPrimaryFixed(){return R.fromPalette({name:`on_primary_fixed`,palette:e=>e.primaryPalette,tone:e=>ms(e)?100:10,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new B(4.5,7,11,21)})}onPrimaryFixedVariant(){return R.fromPalette({name:`on_primary_fixed_variant`,palette:e=>e.primaryPalette,tone:e=>ms(e)?90:30,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new B(3,4.5,7,11)})}secondaryFixed(){return R.fromPalette({name:`secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>ms(e)?80:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.secondaryFixed(),this.secondaryFixedDim(),10,`lighter`,!0)})}secondaryFixedDim(){return R.fromPalette({name:`secondary_fixed_dim`,palette:e=>e.secondaryPalette,tone:e=>ms(e)?70:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.secondaryFixed(),this.secondaryFixedDim(),10,`lighter`,!0)})}onSecondaryFixed(){return R.fromPalette({name:`on_secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>10,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new B(4.5,7,11,21)})}onSecondaryFixedVariant(){return R.fromPalette({name:`on_secondary_fixed_variant`,palette:e=>e.secondaryPalette,tone:e=>ms(e)?25:30,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new B(3,4.5,7,11)})}tertiaryFixed(){return R.fromPalette({name:`tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>ms(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.tertiaryFixed(),this.tertiaryFixedDim(),10,`lighter`,!0)})}tertiaryFixedDim(){return R.fromPalette({name:`tertiary_fixed_dim`,palette:e=>e.tertiaryPalette,tone:e=>ms(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new B(1,1,3,4.5),toneDeltaPair:e=>new us(this.tertiaryFixed(),this.tertiaryFixedDim(),10,`lighter`,!0)})}onTertiaryFixed(){return R.fromPalette({name:`on_tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>ms(e)?100:10,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new B(4.5,7,11,21)})}onTertiaryFixedVariant(){return R.fromPalette({name:`on_tertiary_fixed_variant`,palette:e=>e.tertiaryPalette,tone:e=>ms(e)?90:30,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new B(3,4.5,7,11)})}highestSurface(e){return e.isDark?this.surfaceBright():this.surfaceDim()}}}));function vs(e,t=0,n=100,r=1){return mo(t,n,bs(e.hue,e.chroma*r,100,!0))}function ys(e,t=0,n=100){return mo(t,n,bs(e.hue,e.chroma,0,!1))}function bs(e,t,n,r){let i=n,a=I.from(e,t,i);for(;a.chroma100);){n+=r?-1:1;let o=I.from(e,t,n);a.chroma{Ko(),F(),_s(),ls(),is(),ds(),fs(),xs=class extends gs{surface(){let e=R.fromPalette({name:`surface`,palette:e=>e.neutralPalette,tone:e=>(super.surface().tone(e),e.platform===`phone`?e.isDark?4:I.isYellow(e.neutralPalette.hue)?99:e.variant===V.VIBRANT?97:98:0),isBackground:!0});return L(super.surface(),`2025`,e)}surfaceDim(){let e=R.fromPalette({name:`surface_dim`,palette:e=>e.neutralPalette,tone:e=>e.isDark?4:I.isYellow(e.neutralPalette.hue)?90:e.variant===V.VIBRANT?85:87,isBackground:!0,chromaMultiplier:e=>{if(!e.isDark){if(e.variant===V.NEUTRAL)return 2.5;if(e.variant===V.TONAL_SPOT)return 1.7;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===V.VIBRANT)return 1.36}return 1}});return L(super.surfaceDim(),`2025`,e)}surfaceBright(){let e=R.fromPalette({name:`surface_bright`,palette:e=>e.neutralPalette,tone:e=>e.isDark?18:I.isYellow(e.neutralPalette.hue)?99:e.variant===V.VIBRANT?97:98,isBackground:!0,chromaMultiplier:e=>{if(e.isDark){if(e.variant===V.NEUTRAL)return 2.5;if(e.variant===V.TONAL_SPOT)return 1.7;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===V.VIBRANT)return 1.36}return 1}});return L(super.surfaceBright(),`2025`,e)}surfaceContainerLowest(){let e=R.fromPalette({name:`surface_container_lowest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?0:100,isBackground:!0});return L(super.surfaceContainerLowest(),`2025`,e)}surfaceContainerLow(){let e=R.fromPalette({name:`surface_container_low`,palette:e=>e.neutralPalette,tone:e=>e.platform===`phone`?e.isDark?6:I.isYellow(e.neutralPalette.hue)?98:e.variant===V.VIBRANT?95:96:15,isBackground:!0,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===V.NEUTRAL)return 1.3;if(e.variant===V.TONAL_SPOT)return 1.25;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?1.3:1.15;if(e.variant===V.VIBRANT)return 1.08}return 1}});return L(super.surfaceContainerLow(),`2025`,e)}surfaceContainer(){let e=R.fromPalette({name:`surface_container`,palette:e=>e.neutralPalette,tone:e=>e.platform===`phone`?e.isDark?9:I.isYellow(e.neutralPalette.hue)?96:e.variant===V.VIBRANT?92:94:20,isBackground:!0,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===V.NEUTRAL)return 1.6;if(e.variant===V.TONAL_SPOT)return 1.4;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?1.6:1.3;if(e.variant===V.VIBRANT)return 1.15}return 1}});return L(super.surfaceContainer(),`2025`,e)}surfaceContainerHigh(){let e=R.fromPalette({name:`surface_container_high`,palette:e=>e.neutralPalette,tone:e=>e.platform===`phone`?e.isDark?12:I.isYellow(e.neutralPalette.hue)?94:e.variant===V.VIBRANT?90:92:25,isBackground:!0,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===V.NEUTRAL)return 1.9;if(e.variant===V.TONAL_SPOT)return 1.5;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?1.95:1.45;if(e.variant===V.VIBRANT)return 1.22}return 1}});return L(super.surfaceContainerHigh(),`2025`,e)}surfaceContainerHighest(){let e=R.fromPalette({name:`surface_container_highest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?15:I.isYellow(e.neutralPalette.hue)?92:e.variant===V.VIBRANT?88:90,isBackground:!0,chromaMultiplier:e=>e.variant===V.NEUTRAL?2.2:e.variant===V.TONAL_SPOT?1.7:e.variant===V.EXPRESSIVE?I.isYellow(e.neutralPalette.hue)?2.3:1.6:e.variant===V.VIBRANT?1.29:1});return L(super.surfaceContainerHighest(),`2025`,e)}onSurface(){let e=R.fromPalette({name:`on_surface`,palette:e=>e.neutralPalette,tone:e=>e.variant===V.VIBRANT?vs(e.neutralPalette,0,100,1.1):R.getInitialToneFromBackground(e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh())(e),chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===V.NEUTRAL)return 2.2;if(e.variant===V.TONAL_SPOT)return 1.7;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.isDark&&e.platform===`phone`?H(11):H(9)});return L(super.onSurface(),`2025`,e)}onSurfaceVariant(){let e=R.fromPalette({name:`on_surface_variant`,palette:e=>e.neutralPalette,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===V.NEUTRAL)return 2.2;if(e.variant===V.TONAL_SPOT)return 1.7;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?e.isDark?H(6):H(4.5):H(7)});return L(super.onSurfaceVariant(),`2025`,e)}outline(){let e=R.fromPalette({name:`outline`,palette:e=>e.neutralPalette,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===V.NEUTRAL)return 2.2;if(e.variant===V.TONAL_SPOT)return 1.7;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?H(3):H(4.5)});return L(super.outline(),`2025`,e)}outlineVariant(){let e=R.fromPalette({name:`outline_variant`,palette:e=>e.neutralPalette,chromaMultiplier:e=>{if(e.platform===`phone`){if(e.variant===V.NEUTRAL)return 2.2;if(e.variant===V.TONAL_SPOT)return 1.7;if(e.variant===V.EXPRESSIVE)return I.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?H(1.5):H(3)});return L(super.outlineVariant(),`2025`,e)}inverseSurface(){let e=R.fromPalette({name:`inverse_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?98:4,isBackground:!0});return L(super.inverseSurface(),`2025`,e)}inverseOnSurface(){let e=R.fromPalette({name:`inverse_on_surface`,palette:e=>e.neutralPalette,background:e=>this.inverseSurface(),contrastCurve:e=>H(7)});return L(super.inverseOnSurface(),`2025`,e)}primary(){let e=R.fromPalette({name:`primary`,palette:e=>e.primaryPalette,tone:e=>e.variant===V.NEUTRAL?e.platform===`phone`?e.isDark?80:40:90:e.variant===V.TONAL_SPOT?e.platform===`phone`?e.isDark?80:vs(e.primaryPalette):vs(e.primaryPalette,0,90):e.variant===V.EXPRESSIVE?e.platform===`phone`?vs(e.primaryPalette,0,I.isYellow(e.primaryPalette.hue)?25:I.isCyan(e.primaryPalette.hue)?88:98):vs(e.primaryPalette):e.platform===`phone`?vs(e.primaryPalette,0,I.isCyan(e.primaryPalette.hue)?88:98):vs(e.primaryPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?H(4.5):H(7),toneDeltaPair:e=>e.platform===`phone`?new us(this.primaryContainer(),this.primary(),5,`relative_lighter`,!0,`farther`):void 0});return L(super.primary(),`2025`,e)}primaryDim(){return R.fromPalette({name:`primary_dim`,palette:e=>e.primaryPalette,tone:e=>e.variant===V.NEUTRAL?85:e.variant===V.TONAL_SPOT?vs(e.primaryPalette,0,90):vs(e.primaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>H(4.5),toneDeltaPair:e=>new us(this.primaryDim(),this.primary(),5,`darker`,!0,`farther`)})}onPrimary(){let e=R.fromPalette({name:`on_primary`,palette:e=>e.primaryPalette,background:e=>e.platform===`phone`?this.primary():this.primaryDim(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.onPrimary(),`2025`,e)}primaryContainer(){let e=R.fromPalette({name:`primary_container`,palette:e=>e.primaryPalette,tone:e=>e.platform===`watch`?30:e.variant===V.NEUTRAL?e.isDark?30:90:e.variant===V.TONAL_SPOT?e.isDark?ys(e.primaryPalette,35,93):vs(e.primaryPalette,0,90):e.variant===V.EXPRESSIVE?e.isDark?vs(e.primaryPalette,30,93):vs(e.primaryPalette,78,I.isCyan(e.primaryPalette.hue)?88:90):e.isDark?ys(e.primaryPalette,66,93):vs(e.primaryPalette,66,I.isCyan(e.primaryPalette.hue)?88:93),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`phone`?void 0:new us(this.primaryContainer(),this.primaryDim(),10,`darker`,!0,`farther`),contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?H(1.5):void 0});return L(super.primaryContainer(),`2025`,e)}onPrimaryContainer(){let e=R.fromPalette({name:`on_primary_container`,palette:e=>e.primaryPalette,background:e=>this.primaryContainer(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.onPrimaryContainer(),`2025`,e)}primaryFixed(){let e=R.fromPalette({name:`primary_fixed`,palette:e=>e.primaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(t)},isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?H(1.5):void 0});return L(super.primaryFixed(),`2025`,e)}primaryFixedDim(){let e=R.fromPalette({name:`primary_fixed_dim`,palette:e=>e.primaryPalette,tone:e=>this.primaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new us(this.primaryFixedDim(),this.primaryFixed(),5,`darker`,!0,`exact`)});return L(super.primaryFixedDim(),`2025`,e)}onPrimaryFixed(){let e=R.fromPalette({name:`on_primary_fixed`,palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>H(7)});return L(super.onPrimaryFixed(),`2025`,e)}onPrimaryFixedVariant(){let e=R.fromPalette({name:`on_primary_fixed_variant`,palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>H(4.5)});return L(super.onPrimaryFixedVariant(),`2025`,e)}inversePrimary(){let e=R.fromPalette({name:`inverse_primary`,palette:e=>e.primaryPalette,tone:e=>vs(e.primaryPalette),background:e=>this.inverseSurface(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.inversePrimary(),`2025`,e)}secondary(){let e=R.fromPalette({name:`secondary`,palette:e=>e.secondaryPalette,tone:e=>e.platform===`watch`?e.variant===V.NEUTRAL?90:vs(e.secondaryPalette,0,90):e.variant===V.NEUTRAL?e.isDark?ys(e.secondaryPalette,0,98):vs(e.secondaryPalette):e.variant===V.VIBRANT?vs(e.secondaryPalette,0,e.isDark?90:98):e.isDark?80:vs(e.secondaryPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?H(4.5):H(7),toneDeltaPair:e=>e.platform===`phone`?new us(this.secondaryContainer(),this.secondary(),5,`relative_lighter`,!0,`farther`):void 0});return L(super.secondary(),`2025`,e)}secondaryDim(){return R.fromPalette({name:`secondary_dim`,palette:e=>e.secondaryPalette,tone:e=>e.variant===V.NEUTRAL?85:vs(e.secondaryPalette,0,90),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>H(4.5),toneDeltaPair:e=>new us(this.secondaryDim(),this.secondary(),5,`darker`,!0,`farther`)})}onSecondary(){let e=R.fromPalette({name:`on_secondary`,palette:e=>e.secondaryPalette,background:e=>e.platform===`phone`?this.secondary():this.secondaryDim(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.onSecondary(),`2025`,e)}secondaryContainer(){let e=R.fromPalette({name:`secondary_container`,palette:e=>e.secondaryPalette,tone:e=>e.platform===`watch`?30:e.variant===V.VIBRANT?e.isDark?ys(e.secondaryPalette,30,40):vs(e.secondaryPalette,84,90):e.variant===V.EXPRESSIVE?e.isDark?15:vs(e.secondaryPalette,90,95):e.isDark?25:90,isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`watch`?new us(this.secondaryContainer(),this.secondaryDim(),10,`darker`,!0,`farther`):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?H(1.5):void 0});return L(super.secondaryContainer(),`2025`,e)}onSecondaryContainer(){let e=R.fromPalette({name:`on_secondary_container`,palette:e=>e.secondaryPalette,background:e=>this.secondaryContainer(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.onSecondaryContainer(),`2025`,e)}secondaryFixed(){let e=R.fromPalette({name:`secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(t)},isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?H(1.5):void 0});return L(super.secondaryFixed(),`2025`,e)}secondaryFixedDim(){let e=R.fromPalette({name:`secondary_fixed_dim`,palette:e=>e.secondaryPalette,tone:e=>this.secondaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new us(this.secondaryFixedDim(),this.secondaryFixed(),5,`darker`,!0,`exact`)});return L(super.secondaryFixedDim(),`2025`,e)}onSecondaryFixed(){let e=R.fromPalette({name:`on_secondary_fixed`,palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>H(7)});return L(super.onSecondaryFixed(),`2025`,e)}onSecondaryFixedVariant(){let e=R.fromPalette({name:`on_secondary_fixed_variant`,palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>H(4.5)});return L(super.onSecondaryFixedVariant(),`2025`,e)}tertiary(){let e=R.fromPalette({name:`tertiary`,palette:e=>e.tertiaryPalette,tone:e=>e.platform===`watch`?e.variant===V.TONAL_SPOT?vs(e.tertiaryPalette,0,90):vs(e.tertiaryPalette):e.variant===V.EXPRESSIVE||e.variant===V.VIBRANT?vs(e.tertiaryPalette,0,I.isCyan(e.tertiaryPalette.hue)?88:e.isDark?98:100):e.isDark?vs(e.tertiaryPalette,0,98):vs(e.tertiaryPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?H(4.5):H(7),toneDeltaPair:e=>e.platform===`phone`?new us(this.tertiaryContainer(),this.tertiary(),5,`relative_lighter`,!0,`farther`):void 0});return L(super.tertiary(),`2025`,e)}tertiaryDim(){return R.fromPalette({name:`tertiary_dim`,palette:e=>e.tertiaryPalette,tone:e=>e.variant===V.TONAL_SPOT?vs(e.tertiaryPalette,0,90):vs(e.tertiaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>H(4.5),toneDeltaPair:e=>new us(this.tertiaryDim(),this.tertiary(),5,`darker`,!0,`farther`)})}onTertiary(){let e=R.fromPalette({name:`on_tertiary`,palette:e=>e.tertiaryPalette,background:e=>e.platform===`phone`?this.tertiary():this.tertiaryDim(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.onTertiary(),`2025`,e)}tertiaryContainer(){let e=R.fromPalette({name:`tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>e.platform===`watch`?e.variant===V.TONAL_SPOT?vs(e.tertiaryPalette,0,90):vs(e.tertiaryPalette):e.variant===V.NEUTRAL?e.isDark?vs(e.tertiaryPalette,0,93):vs(e.tertiaryPalette,0,96):e.variant===V.TONAL_SPOT?vs(e.tertiaryPalette,0,e.isDark?93:100):e.variant===V.EXPRESSIVE?vs(e.tertiaryPalette,75,I.isCyan(e.tertiaryPalette.hue)?88:e.isDark?93:100):e.isDark?vs(e.tertiaryPalette,0,93):vs(e.tertiaryPalette,72,100),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`watch`?new us(this.tertiaryContainer(),this.tertiaryDim(),10,`darker`,!0,`farther`):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?H(1.5):void 0});return L(super.tertiaryContainer(),`2025`,e)}onTertiaryContainer(){let e=R.fromPalette({name:`on_tertiary_container`,palette:e=>e.tertiaryPalette,background:e=>this.tertiaryContainer(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.onTertiaryContainer(),`2025`,e)}tertiaryFixed(){let e=R.fromPalette({name:`tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(t)},isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?H(1.5):void 0});return L(super.tertiaryFixed(),`2025`,e)}tertiaryFixedDim(){let e=R.fromPalette({name:`tertiary_fixed_dim`,palette:e=>e.tertiaryPalette,tone:e=>this.tertiaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new us(this.tertiaryFixedDim(),this.tertiaryFixed(),5,`darker`,!0,`exact`)});return L(super.tertiaryFixedDim(),`2025`,e)}onTertiaryFixed(){let e=R.fromPalette({name:`on_tertiary_fixed`,palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>H(7)});return L(super.onTertiaryFixed(),`2025`,e)}onTertiaryFixedVariant(){let e=R.fromPalette({name:`on_tertiary_fixed_variant`,palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>H(4.5)});return L(super.onTertiaryFixedVariant(),`2025`,e)}error(){let e=R.fromPalette({name:`error`,palette:e=>e.errorPalette,tone:e=>e.platform===`phone`?e.isDark?ys(e.errorPalette,0,98):vs(e.errorPalette):ys(e.errorPalette),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.platform===`phone`?H(4.5):H(7),toneDeltaPair:e=>e.platform===`phone`?new us(this.errorContainer(),this.error(),5,`relative_lighter`,!0,`farther`):void 0});return L(super.error(),`2025`,e)}errorDim(){return R.fromPalette({name:`error_dim`,palette:e=>e.errorPalette,tone:e=>ys(e.errorPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>H(4.5),toneDeltaPair:e=>new us(this.errorDim(),this.error(),5,`darker`,!0,`farther`)})}onError(){let e=R.fromPalette({name:`on_error`,palette:e=>e.errorPalette,background:e=>e.platform===`phone`?this.error():this.errorDim(),contrastCurve:e=>e.platform===`phone`?H(6):H(7)});return L(super.onError(),`2025`,e)}errorContainer(){let e=R.fromPalette({name:`error_container`,palette:e=>e.errorPalette,tone:e=>e.platform===`watch`?30:e.isDark?ys(e.errorPalette,30,93):vs(e.errorPalette,0,90),isBackground:!0,background:e=>e.platform===`phone`?this.highestSurface(e):void 0,toneDeltaPair:e=>e.platform===`watch`?new us(this.errorContainer(),this.errorDim(),10,`darker`,!0,`farther`):void 0,contrastCurve:e=>e.platform===`phone`&&e.contrastLevel>0?H(1.5):void 0});return L(super.errorContainer(),`2025`,e)}onErrorContainer(){let e=R.fromPalette({name:`on_error_container`,palette:e=>e.errorPalette,background:e=>this.errorContainer(),contrastCurve:e=>e.platform===`phone`?H(4.5):H(7)});return L(super.onErrorContainer(),`2025`,e)}surfaceVariant(){let e=Object.assign(this.surfaceContainerHighest().clone(),{name:`surface_variant`});return L(super.surfaceVariant(),`2025`,e)}surfaceTint(){let e=Object.assign(this.primary().clone(),{name:`surface_tint`});return L(super.surfaceTint(),`2025`,e)}background(){let e=Object.assign(this.surface().clone(),{name:`background`});return L(super.background(),`2025`,e)}onBackground(){let e=Object.assign(this.onSurface().clone(),{name:`on_background`,tone:e=>e.platform===`watch`?100:this.onSurface().getTone(e)});return L(super.onBackground(),`2025`,e)}}})),U,Cs=o((()=>{Ss(),U=class e{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(e=>e!==void 0)}highestSurface(t){return e.colorSpec.highestSurface(t)}primaryPaletteKeyColor(){return e.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return e.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return e.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return e.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return e.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return e.colorSpec.errorPaletteKeyColor()}background(){return e.colorSpec.background()}onBackground(){return e.colorSpec.onBackground()}surface(){return e.colorSpec.surface()}surfaceDim(){return e.colorSpec.surfaceDim()}surfaceBright(){return e.colorSpec.surfaceBright()}surfaceContainerLowest(){return e.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return e.colorSpec.surfaceContainerLow()}surfaceContainer(){return e.colorSpec.surfaceContainer()}surfaceContainerHigh(){return e.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return e.colorSpec.surfaceContainerHighest()}onSurface(){return e.colorSpec.onSurface()}surfaceVariant(){return e.colorSpec.surfaceVariant()}onSurfaceVariant(){return e.colorSpec.onSurfaceVariant()}outline(){return e.colorSpec.outline()}outlineVariant(){return e.colorSpec.outlineVariant()}inverseSurface(){return e.colorSpec.inverseSurface()}inverseOnSurface(){return e.colorSpec.inverseOnSurface()}shadow(){return e.colorSpec.shadow()}scrim(){return e.colorSpec.scrim()}surfaceTint(){return e.colorSpec.surfaceTint()}primary(){return e.colorSpec.primary()}primaryDim(){return e.colorSpec.primaryDim()}onPrimary(){return e.colorSpec.onPrimary()}primaryContainer(){return e.colorSpec.primaryContainer()}onPrimaryContainer(){return e.colorSpec.onPrimaryContainer()}inversePrimary(){return e.colorSpec.inversePrimary()}primaryFixed(){return e.colorSpec.primaryFixed()}primaryFixedDim(){return e.colorSpec.primaryFixedDim()}onPrimaryFixed(){return e.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return e.colorSpec.onPrimaryFixedVariant()}secondary(){return e.colorSpec.secondary()}secondaryDim(){return e.colorSpec.secondaryDim()}onSecondary(){return e.colorSpec.onSecondary()}secondaryContainer(){return e.colorSpec.secondaryContainer()}onSecondaryContainer(){return e.colorSpec.onSecondaryContainer()}secondaryFixed(){return e.colorSpec.secondaryFixed()}secondaryFixedDim(){return e.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return e.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return e.colorSpec.onSecondaryFixedVariant()}tertiary(){return e.colorSpec.tertiary()}tertiaryDim(){return e.colorSpec.tertiaryDim()}onTertiary(){return e.colorSpec.onTertiary()}tertiaryContainer(){return e.colorSpec.tertiaryContainer()}onTertiaryContainer(){return e.colorSpec.onTertiaryContainer()}tertiaryFixed(){return e.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return e.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return e.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return e.colorSpec.onTertiaryFixedVariant()}error(){return e.colorSpec.error()}errorDim(){return e.colorSpec.errorDim()}onError(){return e.colorSpec.onError()}errorContainer(){return e.colorSpec.errorContainer()}onErrorContainer(){return e.colorSpec.onErrorContainer()}static highestSurface(t){return e.colorSpec.highestSurface(t)}},U.contentAccentToneDelta=15,U.colorSpec=new xs,U.primaryPaletteKeyColor=U.colorSpec.primaryPaletteKeyColor(),U.secondaryPaletteKeyColor=U.colorSpec.secondaryPaletteKeyColor(),U.tertiaryPaletteKeyColor=U.colorSpec.tertiaryPaletteKeyColor(),U.neutralPaletteKeyColor=U.colorSpec.neutralPaletteKeyColor(),U.neutralVariantPaletteKeyColor=U.colorSpec.neutralVariantPaletteKeyColor(),U.background=U.colorSpec.background(),U.onBackground=U.colorSpec.onBackground(),U.surface=U.colorSpec.surface(),U.surfaceDim=U.colorSpec.surfaceDim(),U.surfaceBright=U.colorSpec.surfaceBright(),U.surfaceContainerLowest=U.colorSpec.surfaceContainerLowest(),U.surfaceContainerLow=U.colorSpec.surfaceContainerLow(),U.surfaceContainer=U.colorSpec.surfaceContainer(),U.surfaceContainerHigh=U.colorSpec.surfaceContainerHigh(),U.surfaceContainerHighest=U.colorSpec.surfaceContainerHighest(),U.onSurface=U.colorSpec.onSurface(),U.surfaceVariant=U.colorSpec.surfaceVariant(),U.onSurfaceVariant=U.colorSpec.onSurfaceVariant(),U.inverseSurface=U.colorSpec.inverseSurface(),U.inverseOnSurface=U.colorSpec.inverseOnSurface(),U.outline=U.colorSpec.outline(),U.outlineVariant=U.colorSpec.outlineVariant(),U.shadow=U.colorSpec.shadow(),U.scrim=U.colorSpec.scrim(),U.surfaceTint=U.colorSpec.surfaceTint(),U.primary=U.colorSpec.primary(),U.onPrimary=U.colorSpec.onPrimary(),U.primaryContainer=U.colorSpec.primaryContainer(),U.onPrimaryContainer=U.colorSpec.onPrimaryContainer(),U.inversePrimary=U.colorSpec.inversePrimary(),U.secondary=U.colorSpec.secondary(),U.onSecondary=U.colorSpec.onSecondary(),U.secondaryContainer=U.colorSpec.secondaryContainer(),U.onSecondaryContainer=U.colorSpec.onSecondaryContainer(),U.tertiary=U.colorSpec.tertiary(),U.onTertiary=U.colorSpec.onTertiary(),U.tertiaryContainer=U.colorSpec.tertiaryContainer(),U.onTertiaryContainer=U.colorSpec.onTertiaryContainer(),U.error=U.colorSpec.error(),U.onError=U.colorSpec.onError(),U.errorContainer=U.colorSpec.errorContainer(),U.onErrorContainer=U.colorSpec.onErrorContainer(),U.primaryFixed=U.colorSpec.primaryFixed(),U.primaryFixedDim=U.colorSpec.primaryFixedDim(),U.onPrimaryFixed=U.colorSpec.onPrimaryFixed(),U.onPrimaryFixedVariant=U.colorSpec.onPrimaryFixedVariant(),U.secondaryFixed=U.colorSpec.secondaryFixed(),U.secondaryFixedDim=U.colorSpec.secondaryFixedDim(),U.onSecondaryFixed=U.colorSpec.onSecondaryFixed(),U.onSecondaryFixedVariant=U.colorSpec.onSecondaryFixedVariant(),U.tertiaryFixed=U.colorSpec.tertiaryFixed(),U.tertiaryFixedDim=U.colorSpec.tertiaryFixedDim(),U.onTertiaryFixed=U.colorSpec.onTertiaryFixed(),U.onTertiaryFixedVariant=U.colorSpec.onTertiaryFixedVariant()}));function ws(e){return e===`2025`?ks:Os}var Ts,Es,Ds,Os,ks,As=o((()=>{Zo(),Ko(),os(),cs(),F(),Cs(),fs(),Ts=class e{static maybeFallbackSpecVersion(e,t){switch(t){case V.EXPRESSIVE:case V.VIBRANT:case V.TONAL_SPOT:case V.NEUTRAL:return e;default:return`2021`}}constructor(t){this.sourceColorArgb=t.sourceColorHct.toInt(),this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.platform=t.platform??`phone`,this.specVersion=e.maybeFallbackSpecVersion(t.specVersion??`2021`,this.variant),this.sourceColorHct=t.sourceColorHct,this.primaryPalette=t.primaryPalette??ws(this.specVersion).getPrimaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.secondaryPalette=t.secondaryPalette??ws(this.specVersion).getSecondaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.tertiaryPalette=t.tertiaryPalette??ws(this.specVersion).getTertiaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralPalette=t.neutralPalette??ws(this.specVersion).getNeutralPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralVariantPalette=t.neutralVariantPalette??ws(this.specVersion).getNeutralVariantPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.errorPalette=t.errorPalette??ws(this.specVersion).getErrorPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel)??z.fromHueAndChroma(25,84),this.colors=new U}toString(){return`Scheme: variant=${V[this.variant]}, mode=${this.isDark?`dark`:`light`}, platform=${this.platform}, contrastLevel=${this.contrastLevel.toFixed(1)}, seed=${this.sourceColorHct.toString()}, specVersion=${this.specVersion}`}static getPiecewiseHue(e,t,n){let r=Math.min(t.length-1,n.length),i=e.hue;for(let e=0;e=t[e]&&i=105&&o<125?1.6:2.3));case V.VIBRANT:let c=e.getVibrantNeutralHue(n),l=e.getVibrantNeutralChroma(n,i);return z.fromHueAndChroma(c,l*1.29);default:return super.getNeutralVariantPalette(t,n,r,i,a)}}getErrorPalette(e,t,n,r,i){let a=Ts.getPiecewiseHue(t,[0,3,13,23,33,43,153,273,360],[12,22,32,12,22,32,22,12]);switch(e){case V.NEUTRAL:return z.fromHueAndChroma(a,r===`phone`?50:40);case V.TONAL_SPOT:return z.fromHueAndChroma(a,r===`phone`?60:48);case V.EXPRESSIVE:return z.fromHueAndChroma(a,r===`phone`?64:48);case V.VIBRANT:return z.fromHueAndChroma(a,r===`phone`?80:60);default:return super.getErrorPalette(e,t,n,r,i)}}},Os=new Es,ks=new Ds})),js=o((()=>{Ko(),os()})),Ms=o((()=>{})),Ns=o((()=>{})),Ps=o((()=>{})),Fs=o((()=>{})),Is=o((()=>{js()})),Ls=o((()=>{js()})),Rs=o((()=>{As(),fs()})),zs=o((()=>{As(),fs()})),Bs=o((()=>{As(),fs()})),Vs=o((()=>{As(),fs()})),Hs=o((()=>{As(),fs()})),Us=o((()=>{As(),fs()})),Ws=o((()=>{As(),fs()})),Gs=o((()=>{As(),fs()})),Ks=o((()=>{As(),fs()}));function qs(e,t){return e.score>t.score?-1:+(e.score{Ko(),F(),Js={desired:4,fallbackColorARGB:4282549748,filter:!0},Ys=class e{constructor(){}static score(t,n){let{desired:r,fallbackColorARGB:i,filter:a}={...Js,...n},o=[],s=Array(360).fill(0),c=0;for(let[e,n]of t.entries()){let t=I.fromInt(e);o.push(t);let r=Math.floor(t.hue);s[r]+=n,c+=n}let l=Array(360).fill(0);for(let e=0;e<360;e++){let t=s[e]/c;for(let n=e-14;n=15;e--){d.length=0;for(let{hct:t}of u)if(d.find(n=>_o(t.hue,n.hue)=r)break;if(d.length>=r)break}let f=[];d.length===0&&f.push(i);for(let e of d)f.push(e.toInt());return f}},Ys.TARGET_CHROMA=48,Ys.WEIGHT_PROPORTION=.7,Ys.WEIGHT_CHROMA_ABOVE=.3,Ys.WEIGHT_CHROMA_BELOW=.1,Ys.CUTOFF_CHROMA=5,Ys.CUTOFF_EXCITED_PROPORTION=.01}));function Zs(e){let t=xo(e),n=So(e),r=Co(e),i=[t.toString(16),n.toString(16),r.toString(16)];for(let[e,t]of i.entries())t.length===1&&(i[e]=`0`+t);return`#`+i.join(``)}function Qs(e){e=e.replace(`#`,``);let t=e.length===3,n=e.length===6,r=e.length===8;if(!t&&!n&&!r)throw Error(`unexpected hex `+e);let i=0,a=0,o=0;return t?(i=$s(e.slice(0,1).repeat(2)),a=$s(e.slice(1,2).repeat(2)),o=$s(e.slice(2,3).repeat(2))):n?(i=$s(e.slice(0,2)),a=$s(e.slice(2,4)),o=$s(e.slice(4,6))):r&&(i=$s(e.slice(2,4)),a=$s(e.slice(4,6)),o=$s(e.slice(6,8))),(255<<24|(i&255)<<16|(a&255)<<8|o&255)>>>0}function $s(e){return parseInt(e,16)}var ec=o((()=>{zo()})),tc=o((()=>{Xs()})),nc=o((()=>{qo(),js(),Is(),tc()})),rc=o((()=>{qo(),Yo(),Zo(),is(),As(),Cs(),fs(),Uo(),Ko(),Vo(),js(),os(),Fs(),Ns(),Ms(),Ps(),Is(),Ls(),Rs(),zs(),Bs(),Vs(),Hs(),Us(),Ws(),Gs(),Ks(),Xs(),cs(),zo(),F(),ec(),tc(),nc()}));function ic(e){let t=e.hue;return new Ts({sourceColorHct:e,variant:V.EXPRESSIVE,contrastLevel:0,isDark:!0,specVersion:`2021`,primaryPalette:z.fromHueAndChroma(t,uc.primary),secondaryPalette:z.fromHueAndChroma(t,uc.secondary),tertiaryPalette:z.fromHueAndChroma((t+fc)%360,uc.tertiary),neutralPalette:z.fromHueAndChroma((t+dc)%360,uc.neutral),neutralVariantPalette:z.fromHueAndChroma((t+dc)%360,uc.neutralVariant)})}function ac(e,t){let[n,r]=[hc(e),hc(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function oc(e){let t=[];for(let[n,r]of gc){let i=ac(e[n],e[r]);i<4.5&&t.push(`${r} on ${n} is ${i.toFixed(2)}`)}for(let n of[`bg`,`surfaceLow`,`surface`]){let r=ac(e[n],e.base);r<4.5&&t.push(`accent text on ${n} is ${r.toFixed(2)}`)}for(let n of[`bg`,`surfaceLowest`])e[n]===`#000000`&&t.push(`${n} is pure black`);return t}function sc(e,t){let n=ic(e),r=e=>Zs(e.getArgb(n)),i=e=>Zs(n.primaryPalette.tone(e));return{base:i(t),onBase:r(U.onPrimary),hover:i(Math.min(t+6,100)),active:i(Math.max(t-6,0)),bg:r(U.surface),surfaceLowest:r(U.surfaceContainerLowest),surfaceLow:r(U.surfaceContainerLow),surface:r(U.surfaceContainer),surfaceHigh:r(U.surfaceContainerHigh),surfaceHighest:r(U.surfaceContainerHighest),onSurface:r(U.onSurface),onSurfaceVariant:r(U.onSurfaceVariant),primaryContainer:r(U.primaryContainer),onPrimaryContainer:r(U.onPrimaryContainer),secondaryContainer:r(U.secondaryContainer),onSecondaryContainer:r(U.onSecondaryContainer),tertiaryContainer:r(U.tertiaryContainer),onTertiaryContainer:r(U.onTertiaryContainer),outline:r(U.outline),outlineVariant:r(U.outlineVariant),error:r(U.error),onError:r(U.onError),errorContainer:r(U.errorContainer),onErrorContainer:r(U.onErrorContainer),ambient:i(22)}}function cc(e,t){let n=I.fromInt(Qs(e)),r=t??pc,i=sc(n,r),a=oc(i);for(let e=r+2;a.length&&e<=92;e+=2){let t=sc(n,e),r=oc(t);r.lengthe+e):t;return/^[0-9a-fA-F]{6}$/.test(n)?`#${n.toLowerCase()}`:null}var uc,dc,fc,pc,mc,hc,gc,_c=o((()=>{rc(),uc={primary:40,secondary:24,tertiary:32,neutral:8,neutralVariant:12},dc=15,fc=60,pc=80,mc=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,hc=e=>{let[t,n,r]=[0,2,4].map(t=>parseInt(e.slice(1+t,3+t),16)/255),[i,a,o]=[t,n,r].map(mc);return .2126*i+.7152*a+.0722*o},gc=[[`base`,`onBase`],[`primaryContainer`,`onPrimaryContainer`],[`secondaryContainer`,`onSecondaryContainer`],[`tertiaryContainer`,`onTertiaryContainer`],[`errorContainer`,`onErrorContainer`],[`bg`,`onSurface`],[`surfaceLow`,`onSurface`],[`surface`,`onSurface`],[`surfaceHigh`,`onSurface`],[`surfaceLowest`,`onSurface`],[`bg`,`onSurfaceVariant`],[`surfaceLow`,`onSurfaceVariant`],[`surface`,`onSurfaceVariant`]]}));function vc(e,t){return ln({name:`vice-${e}`,extends:wc,tokens:{"--color-accent":[t.base,t.base],"--color-text-accent":[t.base,t.base],"--color-icon-accent":[t.base,t.base],"--color-on-accent":[t.onBase,t.onBase],"--color-background-body":[t.bg,t.bg],"--color-background-surface":[t.surfaceLow,t.surfaceLow],"--color-background-popover":[t.surfaceHigh,t.surfaceHigh],"--color-text-primary":[t.onSurface,t.onSurface],"--color-text-secondary":[t.onSurfaceVariant,t.onSurfaceVariant],"--color-text-disabled":[`color-mix(in srgb, ${t.onSurface} 38%, transparent)`,`color-mix(in srgb, ${t.onSurface} 38%, transparent)`],"--color-border":[t.outlineVariant,t.outlineVariant],"--color-error":[t.error,t.error],"--color-on-error":[t.onError,t.onError],"--color-accent-muted":[t.secondaryContainer,t.secondaryContainer],"--shadow-inset-hover":`inset 0px 0px 0px 2px ${t.base}4D`,"--shadow-inset-selected":`inset 0px 0px 0px 2px ${t.base}80`},components:{statusdot:{"variant:accent":{backgroundColor:t.base}},progressbar:{"variant:accent":{"--color-accent":t.base}},button:{"variant:primary":{backgroundColor:t.base,color:t.onBase}},link:{base:{color:t.base}}}})}function yc(e){return{"--vice-accent-hover":e.hover,"--vice-accent-active":e.active,"--vice-ambient":e.ambient,"--vice-bg":e.bg,"--vice-surface-lowest":e.surfaceLowest,"--vice-surface-low":e.surfaceLow,"--vice-surface":e.surface,"--vice-surface-high":e.surfaceHigh,"--vice-surface-highest":e.surfaceHighest,"--vice-secondary-container":e.secondaryContainer,"--vice-on-secondary-container":e.onSecondaryContainer,"--vice-primary-container":e.primaryContainer,"--vice-on-primary-container":e.onPrimaryContainer,"--vice-tertiary-container":e.tertiaryContainer,"--vice-on-tertiary-container":e.onTertiaryContainer,"--vice-outline":e.outline,"--vice-outline-variant":e.outlineVariant,"--vice-error-container":e.errorContainer,"--vice-on-error-container":e.onErrorContainer,"--vice-ease-spring":Cc}}function bc(e){if(Ec?.seed===e)return{ramp:Ec.ramp,theme:Ec.theme,failures:[]};let{ramp:t,failures:n}=cc(e),r=vc(`custom`,t);return Ec={seed:e,ramp:t,theme:r},{ramp:t,theme:r,failures:n}}function xc(e,t){if(e===`custom`&&t){let{ramp:e,theme:n}=bc(t);return{ramp:e,theme:n}}let n=e===`custom`?`blue`:e;return{ramp:oo[n],theme:Tc[n]}}var Sc,Cc,wc,Tc,Ec,Dc=o((()=>{jn(),ao(),lo(),_c(),Sc={"--radius-inner":`0.75rem`,"--radius-element":`1.25rem`,"--radius-container":`1.75rem`,"--radius-page":`2.25rem`},Cc=`cubic-bezier(.34, 1.56, .64, 1)`,wc=ln({name:`vice-base`,extends:io,motion:{fast:140,medium:320,slow:700,ratio:.75,easing:Cc},tokens:{...Sc}}),Tc={blue:vc(`blue`,oo.blue),purple:vc(`purple`,oo.purple),green:vc(`green`,oo.green),red:vc(`red`,oo.red),orange:vc(`orange`,oo.orange)},Ec=null}));async function Oc(e,t){let n=await fetch(e,{...t,headers:t?.body?{"Content-Type":`application/json`,...t?.headers}:t?.headers});if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();t.error&&(e=t.error)}catch{}throw Error(e)}if(n.status!==204)return await n.json()}var kc,Ac,W,jc=o((()=>{kc=(e,t)=>Oc(e,{method:`POST`,body:t===void 0?void 0:JSON.stringify(t)}),Ac=e=>encodeURIComponent(e),W={status:()=>Oc(`/api/status`),getConfig:()=>Oc(`/api/config`),saveConfig:e=>kc(`/api/config`,e),getAppState:()=>Oc(`/api/app-state`),setAppState:e=>kc(`/api/app-state`,e),clips:async()=>(await Oc(`/api/clips`)).clips,deleteClip:e=>Oc(`/api/clips/${Ac(e)}`,{method:`DELETE`}),renameClip:(e,t)=>kc(`/api/clips/${Ac(e)}/rename`,{name:t}),revealClip:e=>kc(`/api/clips/${Ac(e)}/reveal`),openClip:e=>kc(`/api/clips/${Ac(e)}/open`),copyClipFile:e=>kc(`/api/clips/${Ac(e)}/copy-file`),trimClip:(e,t,n)=>kc(`/api/clips/${Ac(e)}/trim`,{start:t,end:n}),markViewed:e=>kc(`/api/clips/${Ac(e)}/view`),saveFrame:(e,t)=>kc(`/api/clips/${Ac(e)}/frame`,{time:t}),images:async()=>(await Oc(`/api/images`)).images,deleteImage:e=>Oc(`/api/images/${Ac(e)}`,{method:`DELETE`}),renameImage:(e,t)=>kc(`/api/images/${Ac(e)}/rename`,{name:t}),revealImage:e=>kc(`/api/images/${Ac(e)}/reveal`),openImage:e=>kc(`/api/images/${Ac(e)}/open`),copyImage:e=>kc(`/api/images/${Ac(e)}/copy`),annotateImage:(e,t)=>Oc(`/api/images/${Ac(e)}/annotate`,{method:`POST`,headers:{"Content-Type":`image/png`},body:t}),highlights:async e=>(await Oc(`/api/clips/${Ac(e)}/highlights`)).highlights??[],addHighlight:(e,t)=>kc(`/api/clips/${Ac(e)}/highlights`,t),updateHighlight:(e,t,n)=>Oc(`/api/clips/${Ac(e)}/highlights/${Ac(t)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}),deleteHighlight:(e,t)=>Oc(`/api/clips/${Ac(e)}/highlights/${Ac(t)}`,{method:`DELETE`}),triggerClip:()=>kc(`/api/trigger`),playlists:async()=>(await Oc(`/api/playlists`)).playlists,createPlaylist:e=>kc(`/api/playlists`,e),updatePlaylist:(e,t)=>Oc(`/api/playlists/${Ac(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),deletePlaylist:e=>Oc(`/api/playlists/${Ac(e)}`,{method:`DELETE`}),addClipToPlaylist:(e,t)=>kc(`/api/playlists/${Ac(e)}/clips`,{slug:t}),removeClipFromPlaylist:(e,t)=>Oc(`/api/playlists/${Ac(e)}/clips/${Ac(t)}`,{method:`DELETE`}),displays:e=>Oc(`/api/displays${e?`?backend=${encodeURIComponent(e)}`:``}`),audioSources:()=>Oc(`/api/audio-sources`),editorProject:()=>Oc(`/api/editor/project`),saveEditorProject:e=>kc(`/api/editor/project`,e),startExport:e=>kc(`/api/editor/export`,e),cancelExport:e=>kc(`/api/editor/export/${Ac(e)}/cancel`),checkUpdate:()=>kc(`/api/update/check`)}}));function Mc(e){return Pc.add(e),()=>Pc.delete(e)}function Nc(e){let t=null,n,r=!1,i=()=>{if(!r)try{t=new WebSocket(`ws://${location.host}/ws`),t.onmessage=t=>{try{let n=JSON.parse(t.data);e(n),Pc.forEach(e=>e(n))}catch(e){console.warn(`Ignored an unreadable WebSocket frame`,e)}},t.onclose=()=>{r||(n=window.setTimeout(i,3e3))},t.onerror=()=>{}}catch(e){console.warn(`WebSocket could not be opened, retrying`,e),r||(n=window.setTimeout(i,3e3))}};return i(),()=>{r=!0,window.clearTimeout(n),t?.close()}}var Pc,Fc=o((()=>{Pc=new Set}));function Ic(e,t=!1){if(!Number.isFinite(e)||e<0)return t?`0s`:`0:00`;let n=Math.floor(e);if(t&&e<60)return`${e.toFixed(e%1?1:0)}s`;let r=Math.floor(n/60),i=n%60;return r>=60?`${Math.floor(r/60)}:${String(r%60).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`}function Lc(e){if(!Number.isFinite(e)||e<0)return`0 s`;if(e<60)return`${Math.round(e)} s`;let t=Math.floor(e/60),n=Math.round(e%60);return n===0?`${t} min`:`${t}:${String(n).padStart(2,`0`)} min`}function Rc(e){if(!Number.isFinite(e)||e<=0)return`0 MB`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r>=10||n===0?Math.round(r):r.toFixed(1)} ${t[n]}`}function zc(e){return e?e.replace(/^KEY_/,``).toLowerCase().replace(/^left/,`left `).replace(/^right/,`right `).replace(/\b\w/g,e=>e.toUpperCase()):`the clip key`}function Bc(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=(Date.now()-t)/1e3;return n<60?`just now`:n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:new Date(t).toLocaleDateString()}var Vc=o((()=>{}));function Hc(e){console.debug(`[vice]`,e);try{let t=window.pywebview;Kc&&t?.api?.log_debug&&t.api.log_debug(String(e))}catch(e){console.debug(`The native log bridge threw`,e)}}function Uc(e){if(e){try{let t=window.pywebview;if(Kc&&t?.api?.open_url){t.api.open_url(String(e));return}}catch(e){console.debug(`The native open_url bridge threw`,e)}window.open(e,`_blank`,`noopener`)}}function Wc(){Kc&&window.pywebview.api.keep_running()}function Gc(){Kc?window.pywebview.api.quit_app():fetch(`/api/quit`,{method:`POST`}).catch(()=>{})}var Kc,qc,Jc,Yc,Xc=o((()=>{Kc=(()=>{try{if(new URLSearchParams(location.search).get(`native`)===`1`)return!0}catch{}return window.pywebview!==void 0})(),qc=(()=>{try{return new URLSearchParams(location.search).get(`sw`)===`1`}catch{return!1}})(),Jc=(()=>{try{return document.createElement(`video`).canPlayType(`video/mp4; codecs="avc1.640028"`)!==``}catch{return!0}})(),Yc=(()=>{try{let e=document.createElement(`video`);return e.canPlayType(`video/mp4; codecs="hev1.1.6.L93.B0"`)!==``||e.canPlayType(`video/mp4; codecs="hvc1.1.6.L93.B0"`)!==``}catch{return!1}})()}));function Zc(e){return e.name.replace(/\.(mp4|mkv|mov|webm)$/i,``)}function Qc(e){return e.name.replace(/\.(png|jpe?g)$/i,``)}var $c,el,tl=o((()=>{$c=`img:`,el=e=>`${$c}${e}`}));function nl(e,t){return{...e,event:{...t,id:++dl}}}function rl(e,t){switch(t.type){case`loaded`:return{...e,ready:!0,loadError:null,config:t.config,clips:t.clips,images:t.images,playlists:t.playlists,status:t.status,tunnelUrl:t.status.public_url??null,update:t.status.update??null,sessionStartedAt:t.status.session_active?Date.now():null};case`loadFailed`:return{...e,ready:!0,loadError:t.error};case`setView`:return{...e,view:t.view,currentPlaylistId:t.playlistId===void 0?t.view===`clips`?e.currentPlaylistId:null:t.playlistId};case`setSearch`:return{...e,searchQuery:t.query};case`setAccent`:return{...e,accent:t.accent,customAccent:t.custom===void 0?e.customAccent:t.custom};case`setConfig`:return{...e,config:t.config};case`mergeConfig`:{if(!e.config)return e;let n={...e.config};for(let[e,r]of Object.entries(t.patch))n[e]={...n[e]??{},...r};return{...e,config:n}}case`setClips`:return{...e,clips:t.clips};case`setImages`:return{...e,images:t.images};case`setPlaylists`:return{...e,playlists:t.playlists};case`event`:return nl(e,t.event);case`clearEvent`:return e.event?.id===t.id?{...e,event:null}:e;case`dismiss`:return e.dismissed.includes(t.banner)?e:{...e,dismissed:[...e.dismissed,t.banner]};case`clearUpdate`:return{...e,update:null};case`ws`:return il(e,t.msg);default:return e}}function il(e,t){switch(t.type){case`clip_saved`:{let n=e.clips.some(e=>e.slug===t.clip.slug),r=n?e.clips.map(e=>e.slug===t.clip.slug?{...e,...t.clip}:e):[t.clip,...e.clips],i={...e,clips:r,recentNew:n?e.recentNew:[...e.recentNew,t.clip.slug]};return n?i:nl(i,{kind:`saved`,title:N(`events.clipSaved`),detail:[Zc(t.clip),t.clip.game].filter(Boolean).join(` · `),tone:`accent`,holdMs:4e3})}case`clip_deleted`:return{...e,clips:e.clips.filter(e=>e.slug!==t.slug),recentNew:e.recentNew.filter(e=>e!==t.slug)};case`image_saved`:{let n=e.images.some(e=>e.slug===t.image.slug),r=n?e.images.map(e=>e.slug===t.image.slug?{...e,...t.image}:e):[t.image,...e.images],i={...e,images:r};return n?i:nl(i,{kind:`saved`,title:N(`events.imageSaved`),detail:[Qc(t.image),t.image.game].filter(Boolean).join(` · `),tone:`accent`,holdMs:4e3})}case`image_deleted`:return{...e,images:e.images.filter(e=>e.slug!==t.slug)};case`image_error`:return nl(e,{kind:`error`,title:N(`events.errScreenshot`),detail:t.error||void 0,tone:`error`,holdMs:9e3});case`image_copy_failed`:return nl(e,{kind:`info`,title:N(`events.screenshotNotCopied`),detail:t.error||void 0,tone:`neutral`,holdMs:6e3});case`playlists_changed`:return{...e,playlists:t.playlists??[]};case`clip_saving`:return nl(e,{kind:`saving`,title:N(`events.savingClip`),tone:`neutral`,holdMs:3e4});case`clip_error`:return nl(e,{kind:`error`,title:N(`events.errSaveClip`),detail:t.error||N(`events.recorderSilent`),tone:`error`,holdMs:9e3});case`status`:{let{type:n,...r}=t,i={...e.status,...r};return{...e,status:i,sessionStartedAt:i.session_active?e.sessionStartedAt??Date.now():null,update:r.update??e.update}}case`tunnel_url`:return nl({...e,tunnelUrl:t.url},{kind:`info`,title:N(`events.publicLinkReady`),detail:t.url,tone:`accent`,holdMs:6e3});case`tunnel_error`:return nl({...e,tunnelUrl:null},{kind:`error`,title:N(`events.noPublicLink`),detail:t.error||N(`events.tunnelUnavailable`),tone:`error`,holdMs:9e3});case`session_start`:return nl({...e,status:{...e.status,recording:!0,session_active:!0},sessionStartedAt:Date.now()},{kind:`info`,title:N(`events.sessionRecording`),detail:N(`events.doubleTapToStop`),tone:`live`,holdMs:5e3});case`session_stop`:return nl({...e,status:{...e.status,session_active:!1},sessionStartedAt:null},{kind:`saved`,title:N(`events.sessionSaved`),tone:`accent`,holdMs:4e3});case`session_highlight`:return nl(e,{kind:`info`,title:N(`events.highlightMarked`),detail:typeof t.time==`number`?Ic(t.time):void 0,tone:`accent`,holdMs:3e3});case`update_available`:{let{type:n,...r}=t;return{...e,update:r}}case`editor_project_changed`:return{...e,editorProjectRevision:e.editorProjectRevision+1};case`daemon_upgrading`:return nl(e,{kind:`info`,title:N(`events.updating`,{version:t.version??``}),detail:N(`events.updatingDetail`),tone:`accent`,holdMs:12e3});case`export_progress`:case`export_done`:case`export_error`:return e;default:return e}}function al({children:e}){let[t,n]=(0,sl.useReducer)(rl,ul);(0,sl.useEffect)(()=>{let e=!1;return(async()=>{try{let[t,r,i,a,o]=await Promise.all([W.getConfig(),W.clips(),W.images(),W.playlists(),W.status()]);e||n({type:`loaded`,config:t,clips:r,images:i,playlists:a,status:o})}catch(t){e||n({type:`loadFailed`,error:t.message})}})(),()=>{e=!0}},[]),(0,sl.useEffect)(()=>{let e=null;try{let t=localStorage.getItem(ll);e=t&&/^#[0-9a-f]{6}$/i.test(t)?t.toLowerCase():null}catch(e){console.debug(`Reading the custom accent failed`,e)}let t=localStorage.getItem(`vice-theme`);t&&co.includes(t)||t===`custom`&&e?n({type:`setAccent`,accent:t,custom:e}):e&&n({type:`setAccent`,accent:so,custom:e})},[]);let r=(0,sl.useRef)(0);(0,sl.useEffect)(()=>Nc(e=>{(e.type===`image_saved`||e.type===`image_deleted`)&&(r.current+=1),n({type:`ws`,msg:e})}),[]),(0,sl.useEffect)(()=>{if(!t.event)return;let{id:e,holdMs:r}=t.event,i=window.setTimeout(()=>n({type:`clearEvent`,id:e}),r);return()=>window.clearTimeout(i)},[t.event]),(0,sl.useEffect)(()=>{t.ready&&!Jc&&n({type:`event`,event:{kind:`error`,title:N(`events.cannotPlay`),detail:N(`events.noH264`),tone:`error`,holdMs:1e4}})},[t.ready]);let i=(0,sl.useCallback)(async()=>{n({type:`setClips`,clips:await W.clips()})},[]),a=(0,sl.useCallback)(async()=>{let e=r.current,t=await W.images();r.current===e&&n({type:`setImages`,images:t})},[]),o=(0,sl.useCallback)(async()=>{n({type:`setPlaylists`,playlists:await W.playlists()})},[]),s=(0,sl.useCallback)(e=>{n({type:`event`,event:e})},[]),c=(0,sl.useCallback)(async e=>{let t=await W.saveConfig(e);if(t.ok===!1)throw Error(t.error||N(`events.notSaved`));return n({type:`mergeConfig`,patch:e}),t},[]),l=(0,sl.useMemo)(()=>{let e=t.searchQuery.trim().toLowerCase(),n=t.currentPlaylistId?t.playlists.find(e=>e.id===t.currentPlaylistId):null,r=t.clips;if(n){let e=new Set(n.clip_slugs??[]);r=r.filter(t=>e.has(t.slug))}return e&&(r=r.filter(t=>t.name.toLowerCase().includes(e)||(t.game??``).toLowerCase().includes(e))),r},[t.clips,t.playlists,t.currentPlaylistId,t.searchQuery]),u=(0,sl.useMemo)(()=>{let e=t.searchQuery.trim().toLowerCase(),n=t.currentPlaylistId?t.playlists.find(e=>e.id===t.currentPlaylistId):null,r=t.images;if(n){let e=new Set(n.clip_slugs??[]);r=r.filter(t=>e.has(el(t.slug)))}return e&&(r=r.filter(t=>t.name.toLowerCase().includes(e)||(t.game??``).toLowerCase().includes(e))),r},[t.images,t.playlists,t.currentPlaylistId,t.searchQuery]),d=(0,sl.useMemo)(()=>zc(t.config?.hotkeys?.clip),[t.config]),f=(0,sl.useMemo)(()=>({state:t,dispatch:n,visibleClips:l,visibleImages:u,hotkey:d,refreshClips:i,refreshImages:a,refreshPlaylists:o,notify:s,saveConfig:c}),[t,l,u,d,i,a,o,s,c]);return(0,cl.jsx)(fl.Provider,{value:f,children:e})}function ol(){let e=(0,sl.useContext)(fl);if(!e)throw Error(`useStore was called outside the provider`);return e}var sl,cl,ll,ul,dl,fl,pl=o((()=>{sl=l(d()),jc(),Fc(),Vc(),Xc(),lo(),tl(),P(),cl=M(),ll=`vice-custom-accent`,ul={ready:!1,loadError:null,config:null,clips:[],images:[],playlists:[],status:{running:!1,version:``,clips:0,local_url:``,public_url:null,base_url:``,public_is_tunnel:!1,recording:!1,backend:`auto`,session_active:!1,hotkeys_available:!0,ready:!0,recorder_error:null,cpu_fallback:!1,codec_fallback:!1},tunnelUrl:null,update:null,recentNew:[],view:`home`,currentPlaylistId:null,searchQuery:``,accent:so,customAccent:null,event:null,sessionStartedAt:null,dismissed:[],editorProjectRevision:0},dl=0,fl=(0,sl.createContext)(null)}));async function ml(e){if(!e)return!1;let t=window.pywebview;if(Kc&&t?.api?.copy_to_clipboard)try{return!!await t.api.copy_to_clipboard(String(e))}catch(e){console.warn(`Native clipboard bridge failed, falling back`,e)}try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch(e){console.warn(`Clipboard API failed, falling back`,e)}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch(e){return console.warn(`Clipboard fallback failed`,e),!1}}var hl=o((()=>{Xc()}));async function gl(e,t,n){if(!e.share_url){t({kind:`error`,title:N(`card.noShareLinkYet`),tone:`error`,holdMs:4e3});return}if(!await ml(e.share_url)){n(e.share_url);return}e.share_is_public===!1?t({kind:`info`,title:N(`card.linkCopiedLocal`),detail:N(`card.linkCopiedLocalDetail`),tone:`neutral`,holdMs:8e3}):t({kind:`info`,title:N(`card.shareLinkCopied`),tone:`accent`,holdMs:3e3})}var _l=o((()=>{hl(),P()}));function vl(e){if(e.key!==`Escape`||xl.length===0)return;let t=e.target?.tagName;t!==`INPUT`&&t!==`TEXTAREA`&&t!==`SELECT`&&(e.preventDefault(),e.stopPropagation(),xl[xl.length-1]?.())}function yl(e,t){(0,bl.useEffect)(()=>{if(e)return xl.length===0&&document.addEventListener(`keydown`,vl,!0),xl.push(t),()=>{let e=xl.lastIndexOf(t);e>=0&&xl.splice(e,1),xl.length===0&&document.removeEventListener(`keydown`,vl,!0)}},[e,t])}var bl,xl,Sl=o((()=>{bl=l(d()),xl=[]}));function Cl(e,t){let[n,r]=(0,wl.useState)(e),[i,a]=(0,wl.useState)(!1);return e&&!n&&(r(!0),a(!1)),(0,wl.useEffect)(()=>{if(e){a(!1);return}if(!n)return;if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||document.documentElement.classList.contains(`perf-low`)){r(!1);return}a(!0);let i=window.setTimeout(()=>{r(!1),a(!1)},t);return()=>window.clearTimeout(i)},[e,n,t]),{mounted:n,closing:i}}var wl,Tl=o((()=>{wl=l(d())})),G,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl=o((()=>{G=M(),El=e=>({width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`}),Dl=({size:e=18,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M3 10.5 12 3l9 7.5`}),(0,G.jsx)(`path`,{d:`M5 9.5V21h14V9.5`})]}),Ol=({size:e=18,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`3`}),(0,G.jsx)(`path`,{d:`M10 9.5v5l4-2.5z`})]}),kl=({size:e=18,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`3`}),(0,G.jsx)(`circle`,{cx:`8.5`,cy:`9.5`,r:`1.6`}),(0,G.jsx)(`path`,{d:`m4 17 4.5-4.5 3.5 3.5 3-2.5L20 18`})]}),Al=({size:e=18,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`6`,cy:`7`,r:`3`}),(0,G.jsx)(`circle`,{cx:`6`,cy:`17`,r:`3`}),(0,G.jsx)(`path`,{d:`M20 5 9 15M20 19 9 9`})]}),jl=({size:e=18,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M4 7h8M16 7h4M4 12h4M12 12h8M4 17h10M18 17h2`}),(0,G.jsx)(`circle`,{cx:`14`,cy:`7`,r:`2`}),(0,G.jsx)(`circle`,{cx:`8`,cy:`12`,r:`2`}),(0,G.jsx)(`circle`,{cx:`16`,cy:`17`,r:`2`})]}),Ml=({size:e=18,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,G.jsx)(`path`,{d:`M12 11v5M12 8h.01`})]}),Nl=({size:e=16,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,G.jsx)(`path`,{d:`m20 20-3.5-3.5`})]}),Pl=({size:e=18,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,G.jsx)(`path`,{d:`M12 8v4.5M12 16h.01`})]}),Fl=({size:e=15,className:t})=>(0,G.jsx)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),Il=({size:e=15,className:t})=>(0,G.jsx)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M5 12h14`})}),Ll=({size:e=15,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M12 4v8`}),(0,G.jsx)(`path`,{d:`M7.5 7a7 7 0 1 0 9 0`})]}),Rl=({size:e=16,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M4 7h11M4 12h11M4 17h7`}),(0,G.jsx)(`path`,{d:`M18 11v7`}),(0,G.jsx)(`circle`,{cx:`16.5`,cy:`18`,r:`1.6`})]}),zl=({size:e=20,className:t})=>(0,G.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.25,className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9.5`}),(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`,fill:`currentColor`})]}),Bl=({size:e=14,className:t})=>(0,G.jsx)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`m4 12.5 5 5L20 6.5`})}),Vl=({size:e=14,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9.5`}),(0,G.jsx)(`path`,{d:`M9.4 9.2a2.7 2.7 0 0 1 5.2.9c0 1.8-2.6 2.7-2.6 2.7`}),(0,G.jsx)(`path`,{d:`M12 17h.01`})]}),Hl=({size:e=12,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,G.jsx)(`path`,{d:`m7 10 5 5 5-5`}),(0,G.jsx)(`path`,{d:`M12 15V3`})]}),Ul=({size:e=16,className:t})=>(0,G.jsxs)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,G.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1.4`,fill:`currentColor`,stroke:`none`})]}),Wl=({size:e=14,className:t})=>(0,G.jsx)(`svg`,{...El(e),className:t,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M12 5v14M5 12h14`})}),Gl=({collapse:e,size:t=15})=>(0,G.jsx)(`svg`,{...El(t),"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:e?`M9 3v4a2 2 0 0 1-2 2H3M15 3v4a2 2 0 0 0 2 2h4M9 21v-4a2 2 0 0 0-2-2H3M15 21v-4a2 2 0 0 1 2-2h4`:`M3 9V5a2 2 0 0 1 2-2h4M21 9V5a2 2 0 0 0-2-2h-4M3 15v4a2 2 0 0 0 2 2h4M21 15v4a2 2 0 0 1-2 2h-4`})})}));function ql({open:e,title:t,onClose:n,children:r,footer:i,wide:a}){let o=(0,Jl.useRef)(null),s=(0,Jl.useRef)(null),c=(0,Jl.useRef)(null);yl(e,n);let{mounted:l,closing:u}=Cl(e,320);(0,Jl.useEffect)(()=>{if(e)return c.current=document.activeElement,o.current?.focus(),()=>{c.current?.focus?.()}},[e]);let d=(0,Jl.useRef)(t);return(0,Jl.useLayoutEffect)(()=>{d.current!==t&&(d.current=t,s.current?.animate?.([{opacity:0,transform:`translateY(-5px)`},{opacity:1,transform:`none`}],{duration:220,easing:`cubic-bezier(0.2, 0, 0, 1)`}))},[t]),l?(0,Yl.jsx)(`div`,{className:`scrim`,"data-closing":u||void 0,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,Yl.jsxs)(`div`,{className:`modal`,"data-closing":u||void 0,"data-wide":a||void 0,role:`dialog`,"aria-modal":`true`,"aria-label":t,tabIndex:-1,ref:o,children:[(0,Yl.jsxs)(`div`,{className:`modal-head`,children:[(0,Yl.jsx)(`h2`,{ref:s,children:t}),(0,Yl.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:n,"aria-label":`Close`,children:(0,Yl.jsx)(Fl,{size:15})})]}),(0,Yl.jsx)(`div`,{className:`modal-body`,children:r}),i?(0,Yl.jsx)(`div`,{className:`modal-foot`,children:i}):null]})}):null}var Jl,Yl,Xl=o((()=>{Jl=l(d()),Sl(),Tl(),Kl(),Yl=M()}));function Zl(e){let t=(e?.vcodec??``).toLowerCase();return(t===`hevc`||t===`h265`)&&!Yc}function Ql(e){return e?.video_url?Zl(e)?`${e.video_url}&proxy=1`:e.video_url:``}function $l(e,t){if(!e)return;let n=Math.max(0,Number(t)||0);try{typeof e.fastSeek==`function`?e.fastSeek(n):e.currentTime=n}catch{e.currentTime=n}}function eu(e){e?.play().catch(()=>{})}function tu(e){let t=Math.max(0,Number(e)||0),n=e=>String(Math.floor(e)).padStart(2,`0`),r=String(Math.round(t%1*1e3)).padStart(3,`0`);return`${n(t/3600)}:${n(t%3600/60)}:${n(t%60)}.${r}`}function nu(e){return e?{1:`ABORTED`,2:`NETWORK`,3:`DECODE`,4:`SRC_NOT_SUPPORTED`}[e.code]??`code ${e.code}`:`unknown`}function ru(){return N(Jc?`viewer.playbackFailed`:`viewer.noH264Decoder`)}function iu(e){let[t,n]=(0,au.useState)(!1);return(0,au.useEffect)(()=>{let t=e.current;if(!t)return;let r=()=>!!t.getAttribute(`src`),i=e=>Hc(`video failed: ${e} h264=${Jc} hevc=${Yc} src=${(t.currentSrc||``).slice(-80)}`),a=()=>{r()&&(i(nu(t.error)),n(!0))},o=()=>{r()&&(t.videoWidth===0&&i(`NO_VIDEO_TRACK`),n(t.videoWidth===0))},s=()=>r()&&n(!1);return t.addEventListener(`error`,a),t.addEventListener(`loadeddata`,o),t.addEventListener(`loadstart`,s),()=>{t.removeEventListener(`error`,a),t.removeEventListener(`loadeddata`,o),t.removeEventListener(`loadstart`,s)}},[e]),t}var au,ou=o((()=>{au=l(d()),Xc(),P()}));function su({initial:e,onSubmit:t,onCancel:n,className:r,label:i,emptyFallback:a,stopPropagation:o}){let[s,c]=(0,cu.useState)(e),l=(0,cu.useRef)(!1),u=()=>{if(l.current)return;l.current=!0;let r=s.trim()||a||``;!r||r===e?n():t(r)};return(0,lu.jsx)(`input`,{className:r,value:s,autoFocus:!0,"aria-label":i,onClick:o?e=>e.stopPropagation():void 0,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),onBlur:u,onKeyDown:e=>{o&&e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),u()),e.key===`Escape`&&(l.current=!0,n())}})}var cu,lu,uu=o((()=>{cu=l(d()),lu=M()}));function du({clip:e,highlights:t,onClose:n,onSaved:r,notify:i,onRename:a,onReveal:o,onOpenExternally:s}){let c=(0,fu.useRef)(null),l=(0,fu.useRef)(null),[u,d]=(0,fu.useState)(0),[f,p]=(0,fu.useState)({start:0,end:0}),[m,h]=(0,fu.useState)(0),[g,_]=(0,fu.useState)(!1),[v,y]=(0,fu.useState)(!1),[b,x]=(0,fu.useState)(null),[S,C]=(0,fu.useState)(!1),[w,ee]=(0,fu.useState)(null),[te,ne]=(0,fu.useState)(!1),T=iu(c),re=(0,fu.useRef)(!1);re.current=g;let E=(0,fu.useRef)(f);if(E.current=f,yl(e!==null,n),(0,fu.useEffect)(()=>{let t=c.current;if(!(!t||!e))return d(0),p({start:0,end:0}),h(0),_(!1),C(!1),ee(null),y(Zl(e)),t.src=Ql(e),t.load(),()=>{t.pause(),t.removeAttribute(`src`),t.load()}},[e]),!e)return null;let D=()=>{_(!1),re.current=!1,c.current?.pause()},ie=()=>{let e=c.current;if(!(!u||!e)){if(g){D();return}_(!0),re.current=!0,e.currentTime=f.start,eu(e)}},ae=()=>{let e=c.current;if(!e||(h(e.currentTime),!re.current||!u))return;let{start:t,end:n}=E.current;(e.currentTime>=n-.05||e.currentTimet=>{if(t.button!==0||!u)return;t.preventDefault(),x(e),re.current&&D();let n=t=>{let n=l.current?.getBoundingClientRect(),r=c.current;if(!n||!r)return;let i=Math.max(0,Math.min(n.width,t-n.left))/n.width*u;p(t=>{let n=e===`start`?{...t,start:Math.max(0,Math.min(i,t.end-pu))}:{...t,end:Math.min(u,Math.max(i,t.start+pu))};return E.current=n,r.currentTime=e===`start`?n.start:n.end,n})},r=e=>n(e.clientX),i=()=>{window.removeEventListener(`pointermove`,r,!0),window.removeEventListener(`pointerup`,i,!0),window.removeEventListener(`pointercancel`,i,!0),x(null)};n(t.clientX),window.addEventListener(`pointermove`,r,!0),window.addEventListener(`pointerup`,i,!0),window.addEventListener(`pointercancel`,i,!0)},oe=async()=>{g&&D(),C(!0),ee(null);try{await W.trimClip(e.slug,f.start,f.end),i(N(`trim.saved`),Zc(e),`accent`),n(),await r()}catch(e){let t=e.message||N(`trim.failed`);ee(t),i(N(`trim.errTrim`),t,`error`),C(!1)}},k=e=>u?e/u*100:0,A=k(f.start),se=k(f.end);return(0,K.jsx)(`div`,{className:`scrim`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,K.jsxs)(`div`,{className:`modal trim-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":N(`trim.trimAria`,{name:Zc(e)}),children:[(0,K.jsxs)(`div`,{className:`modal-head`,children:[(0,K.jsxs)(`h2`,{className:`trim-head`,children:[(0,K.jsx)(`span`,{className:`trim-head-label`,children:N(`trim.heading`)}),te?(0,K.jsx)(su,{className:`trim-rename`,label:N(`card.nameLabel`),initial:Zc(e),onCancel:()=>ne(!1),onSubmit:t=>{ne(!1),a(e,t)}}):(0,K.jsx)(`span`,{className:`trim-head-name`,title:N(`viewer.doubleClickRename`),onDoubleClick:()=>ne(!0),children:Zc(e)})]}),(0,K.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:n,"aria-label":N(`common.close`),children:(0,K.jsx)(Fl,{size:15})})]}),(0,K.jsxs)(`div`,{className:`modal-body`,children:[(0,K.jsxs)(`div`,{className:`trim-stage`,children:[(0,K.jsx)(`video`,{ref:c,className:`trim-video`,controls:!0,playsInline:!0,onLoadedMetadata:e=>{let t=Number.isFinite(e.currentTarget.duration)?e.currentTarget.duration:0;d(t);let n={start:0,end:t};p(n),E.current=n,y(!1)},onTimeUpdate:ae,onEnded:()=>{let e=c.current;!re.current||!e||(e.currentTime=E.current.start,eu(e))},onCanPlay:()=>y(!1),onError:()=>y(!1)}),v?(0,K.jsxs)(`div`,{className:`video-overlay`,children:[(0,K.jsx)(`span`,{className:`video-spinner`,"aria-hidden":`true`}),(0,K.jsx)(`p`,{children:N(`trim.preparingPreview`)})]}):null,T?(0,K.jsxs)(`div`,{className:`video-overlay`,children:[(0,K.jsx)(`p`,{children:ru()}),(0,K.jsxs)(`div`,{className:`video-overlay-actions`,children:[(0,K.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(e),children:N(`trim.openInPlayer`)}),(0,K.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>o(e),children:N(`trim.showInFolder`)})]})]}):null]}),(0,K.jsxs)(`div`,{className:`trim-readout`,children:[(0,K.jsxs)(`span`,{children:[N(`trim.in`),` `,(0,K.jsx)(`b`,{className:`mono`,children:Ic(f.start,!0)})]}),(0,K.jsxs)(`span`,{children:[N(`trim.duration`),` `,(0,K.jsx)(`b`,{className:`mono trim-readout-dur`,children:Ic(Math.max(0,f.end-f.start),!0)})]}),(0,K.jsxs)(`span`,{children:[N(`trim.out`),` `,(0,K.jsx)(`b`,{className:`mono`,children:Ic(f.end,!0)})]})]}),(0,K.jsxs)(`div`,{className:`trim-timeline`,ref:l,children:[(0,K.jsx)(`div`,{className:`trim-track`}),(0,K.jsx)(`div`,{className:`trim-selection`,style:{left:`${A}%`,width:`${se-A}%`}}),t.map(e=>(0,K.jsx)(`div`,{className:`trim-hl`,style:{left:`${k(e.time)}%`,background:e.color||`#f59e0b`},title:e.label},e.id)),(0,K.jsx)(`div`,{className:`trim-playhead`,style:{left:`${k(m)}%`}}),(0,K.jsx)(`button`,{type:`button`,className:`trim-handle`,"data-dragging":b===`start`||void 0,style:{left:`${A}%`},"aria-label":N(`trim.startOfSelection`),onPointerDown:O(`start`)}),(0,K.jsx)(`button`,{type:`button`,className:`trim-handle`,"data-dragging":b===`end`||void 0,style:{left:`${se}%`},"aria-label":N(`trim.endOfSelection`),onPointerDown:O(`end`)})]}),(0,K.jsxs)(`div`,{className:`trim-tc mono`,children:[(0,K.jsxs)(`span`,{children:[`start `,tu(f.start)]}),(0,K.jsxs)(`span`,{children:[`end `,tu(f.end)]})]})]}),(0,K.jsxs)(`div`,{className:`modal-foot trim-foot`,children:[(0,K.jsx)(`button`,{type:`button`,className:g?`btn btn-sm`:`btn btn-quiet btn-sm`,onClick:ie,disabled:!u,children:N(g?`trim.stop`:`trim.preview`)}),(0,K.jsx)(`span`,{className:`trim-status`,children:w??N(`trim.loopHelp`)}),(0,K.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:n,children:N(`common.cancel`)}),(0,K.jsx)(`button`,{type:`button`,className:`btn btn-sm`,onClick:()=>void oe(),disabled:S||!u,children:N(S?`trim.saving`:`trim.saveTrim`)})]})]})})}var fu,K,pu,mu=o((()=>{fu=l(d()),jc(),Sl(),Vc(),ou(),tl(),Kl(),uu(),P(),K=M(),pu=.5})),hu,gu,_u=o((()=>{hu=[`#f59e0b`,`#ef4444`,`#22c55e`,`#3b82f6`,`#ec4899`,`#8b5cf6`,`#06b6d4`,`#f97316`],gu=hu[0]}));function vu(){try{let e=Number(localStorage.getItem(Au));return Number.isFinite(e)&&e>=0&&e<=1?e:1}catch{return 1}}function yu(){try{return localStorage.getItem(ju)===`1`}catch{return!1}}function bu(e,t){try{localStorage.setItem(e,t)}catch{}}function xu(e){let{clips:t,highlights:n,onHighlightsChange:r,onSelect:i,onClose:a}=e,{mounted:o,closing:s}=Cl(e.clip!==null,320),c=(0,Du.useRef)(e.clip);e.clip&&(c.current=e.clip);let l=e.clip??c.current,u=(0,Du.useRef)(null),d=(0,Du.useRef)(null),f=(0,Du.useRef)(null),[p,m]=(0,Du.useState)({current:0,duration:0}),[h,g]=(0,Du.useState)(!0),[_,v]=(0,Du.useState)(!1),[y,b]=(0,Du.useState)(null),[x,S]=(0,Du.useState)(null),[C,w]=(0,Du.useState)(null),[ee,te]=(0,Du.useState)(!1),[ne,T]=(0,Du.useState)(vu),[re,E]=(0,Du.useState)(yu),[D,ie]=(0,Du.useState)(!1),[ae,O]=(0,Du.useState)(!1),[oe,k]=(0,Du.useState)(!1),A=iu(u),se=l?t.findIndex(e=>e.slug===l.slug):-1,ce=e.clip!==null,j=e.trimOpen;(0,Du.useLayoutEffect)(()=>{let e=u.current;if(!e||!l)return;let t=Ql(l);if(e.getAttribute(`src`)===t){j||eu(e);return}e.pause(),e.src=t,e.load(),v(Zl(l)),m({current:0,duration:0}),j||eu(e),W.markViewed(l.slug).catch(e=>console.debug(`Recording the view failed`,e))},[l,j]),(0,Du.useEffect)(()=>{if(ce)return;let e=u.current;e?.getAttribute(`src`)&&(e.pause(),e.removeAttribute(`src`),e.load())},[ce]),(0,Du.useEffect)(()=>{let e=u.current;e&&(e.volume=ne,e.muted=re)}),(0,Du.useEffect)(()=>{ce||ie(!1)},[ce]),(0,Du.useEffect)(()=>{if(!D){O(!1);return}let e=0,t=()=>{O(!1),window.clearTimeout(e),e=window.setTimeout(()=>O(!0),3e3)};return t(),window.addEventListener(`pointermove`,t),window.addEventListener(`pointerdown`,t),()=>{window.clearTimeout(e),window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerdown`,t)}},[D]);let le=(0,Du.useRef)(null),ue=(0,Du.useCallback)(()=>{let e=f.current;le.current=e?{rect:e.getBoundingClientRect(),radius:getComputedStyle(e).borderTopLeftRadius}:null,ie(e=>!e)},[]);(0,Du.useLayoutEffect)(()=>{let e=f.current,t=le.current;if(le.current=null,!e||!t||typeof e.animate!=`function`)return;let n=t.rect,r=e.getBoundingClientRect();if(!n.width||!r.width)return;let i=n.left-r.left,a=n.top-r.top,o=n.width/r.width,s=n.height/r.height;Math.abs(i)<1&&Math.abs(a)<1&&Math.abs(o-1)<.01||e.animate([{transform:`translate(${i}px, ${a}px) scale(${o}, ${s})`,borderRadius:t.radius},{transform:`none`,borderRadius:getComputedStyle(e).borderTopLeftRadius}],{duration:280,easing:`cubic-bezier(0.2, 0, 0, 1)`})},[D]);let de=(0,Du.useCallback)(e=>{let t=Nu(Mu(e));T(t),bu(Au,String(t)),t>0&&(E(!1),bu(ju,`0`))},[]),fe=(0,Du.useCallback)(()=>{E(e=>(bu(ju,e?`0`:`1`),!e))},[]),pe=(0,Du.useCallback)(async()=>{let t=u.current;if(!(!l||!t||oe)){k(!0);try{let n=await W.saveFrame(l.slug,t.currentTime);if(n.ok===!1)throw Error(n.error||N(`viewer.errSaveFrame`));e.notify(n.copied===!1?N(`viewer.frameSavedNotCopied`):N(`viewer.frameSaved`),n.copy_error||Qc(n),`accent`)}catch(t){e.notify(N(`viewer.errSaveFrame`),t.message,`error`)}finally{k(!1)}}},[l,oe,e]),me=(0,Du.useCallback)(e=>{if(se<0)return;let n=t[se+e];n&&i(n.slug)},[t,se,i]),he=(0,Du.useCallback)(async()=>{let t=u.current;if(!l||!t)return;let i=t.currentTime,a=Eu(n),o=Ou[n.length%Ou.length];try{let t=await W.addHighlight(l.slug,{time:i,label:a,color:o});if(!t.highlight)throw Error(t.error||N(`viewer.daemonNoMark`));r(Pu([...n,t.highlight])),e.notify(`${a} at ${Ic(i,!0)}`,void 0,`accent`)}catch(t){e.notify(N(`viewer.errAddHighlight`),t.message,`error`)}},[l,n,r,e]);yl(ce,(0,Du.useCallback)(()=>{if(D){ie(!1);return}a()},[D,a])),(0,Du.useEffect)(()=>{s&&u.current?.pause()},[s]),(0,Du.useEffect)(()=>{j&&u.current?.pause()},[j,l]);let ge=(0,Du.useCallback)(()=>{let e=u.current;e?.getAttribute(`src`)&&(e.paused?eu(e):e.pause())},[]);if((0,Du.useEffect)(()=>{if(!ce||s||j)return;let e=e=>{if(e.defaultPrevented||e.ctrlKey||e.altKey||e.metaKey)return;let t=e.target instanceof HTMLElement?e.target:null;if(!(t?.closest(`input, textarea, select`)||t?.isContentEditable)){if(e.code===`Space`||e.key===` `){if(t?.closest(`button, a, [role="button"], [role="switch"]`))return;e.preventDefault(),e.repeat||ge();return}e.key===`ArrowLeft`?(e.preventDefault(),me(-1)):e.key===`ArrowRight`?(e.preventDefault(),me(1)):e.key===`h`||e.key===`H`?(e.preventDefault(),he()):e.key===`f`||e.key===`F`?(e.preventDefault(),ue()):e.key===`s`||e.key===`S`?(e.preventDefault(),pe()):(e.key===`m`||e.key===`M`)&&(e.preventDefault(),fe())}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[ce,s,j,me,he,ue,pe,fe,ge]),!o||!l)return null;let _e=p.duration,ve=_e>0?p.current/_e*100:0,ye=e=>{let t=d.current;if(!t||!_e)return;let n=t.getBoundingClientRect();$l(u.current,Mu((e-n.left)/n.width)*_e)},be=(t,i)=>{if(t.button!==0||!_e)return;t.preventDefault(),t.stopPropagation(),b(i.id);let a=e=>{let t=d.current?.getBoundingClientRect();return t?Mu((e-t.left)/t.width)*_e:null},o=i.time,s=e=>{let t=a(e.clientX);t!=null&&(o=t,r(Pu(Fu(n,i.id,Nu(t)))))},c=async t=>{window.removeEventListener(`pointermove`,s,!0),window.removeEventListener(`pointerup`,c,!0),window.removeEventListener(`pointercancel`,c,!0),b(null);let u=Nu(a(t.clientX)??o);r(Pu(Fu(n,i.id,u)));try{let t=await W.updateHighlight(l.slug,i.id,{time:u});if(t.ok===!1)throw Error(t.error||N(`viewer.daemonRejectedMove`));e.notify(`Highlight moved to ${Ic(u,!0)}`,void 0,`accent`)}catch(t){r(Pu(Fu(n,i.id,i.time))),e.notify(N(`viewer.errMoveHighlight`),t.message,`error`)}};window.addEventListener(`pointermove`,s,!0),window.addEventListener(`pointerup`,c,!0),window.addEventListener(`pointercancel`,c,!0)},xe=async(t,i)=>{try{let e=await W.updateHighlight(l.slug,t,i);if(e.ok===!1)throw Error(e.error||N(`viewer.daemonRejectedChange`));r(Pu(n.map(e=>e.id===t?{...e,...i}:e)))}catch(t){e.notify(N(`viewer.errUpdateHighlight`),t.message,`error`)}},Se=async t=>{try{await W.deleteHighlight(l.slug,t),r(n.filter(e=>e.id!==t))}catch(t){e.notify(N(`viewer.errDeleteHighlight`),t.message,`error`)}},Ce=[l.duration?Ic(Math.round(l.duration),!0):``,l.width?`${l.width}x${l.height}`:``,l.size?Rc(l.size):``].filter(Boolean).join(` · `);return(0,q.jsxs)(`div`,{className:`scrim viewer-scrim`,"data-closing":s||void 0,onMouseDown:e=>e.target===e.currentTarget&&a(),children:[(0,q.jsxs)(`div`,{className:`viewer-stack`,children:[(0,q.jsxs)(`div`,{className:`modal viewer`,"data-closing":s||void 0,role:`dialog`,"aria-modal":`true`,"aria-label":Zc(l),children:[(0,q.jsxs)(`header`,{className:`viewer-head`,children:[(0,q.jsxs)(`div`,{className:`viewer-heading`,children:[ee?(0,q.jsx)(su,{className:`viewer-rename`,label:N(`card.nameLabel`),initial:Zc(l),onCancel:()=>te(!1),onSubmit:t=>{te(!1),e.onRename(l,t)}}):(0,q.jsx)(`h2`,{title:N(`viewer.doubleClickRename`),onDoubleClick:()=>te(!0),children:Zc(l)}),(0,q.jsx)(`p`,{className:`mono`,children:Ce})]}),t.length>1?(0,q.jsxs)(`span`,{className:`viewer-count mono`,children:[se+1,` / `,t.length]}):null,(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>me(-1),disabled:se<=0,"aria-label":N(`viewer.prevClip`),children:(0,q.jsx)(Lu,{dir:`left`})}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>me(1),disabled:se<0||se>=t.length-1,"aria-label":N(`viewer.nextClip`),children:(0,q.jsx)(Lu,{dir:`right`})}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>void pe(),disabled:oe||l.unreadable,title:N(`viewer.saveFrameHint`),"aria-label":N(`viewer.saveFrame`),children:(0,q.jsx)(Vu,{})}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:ue,"aria-pressed":D,title:N(D?`viewer.shrinkHint`:`viewer.expandHint`),"aria-label":N(D?`viewer.shrink`:`viewer.expand`),children:(0,q.jsx)(Gl,{collapse:D})}),(0,q.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:a,"aria-label":N(`common.close`),children:(0,q.jsx)(Fl,{size:15})})]}),(0,q.jsxs)(`div`,{className:`viewer-stage`,ref:f,"data-expanded":D||void 0,"data-idle":D&&ae||void 0,onClick:ge,onDoubleClick:ue,children:[(0,q.jsx)(`video`,{ref:u,className:`viewer-video`,playsInline:!0,onTimeUpdate:e=>m({current:e.currentTarget.currentTime,duration:Number.isFinite(e.currentTarget.duration)?e.currentTarget.duration:0}),onLoadedMetadata:e=>m({current:e.currentTarget.currentTime,duration:Number.isFinite(e.currentTarget.duration)?e.currentTarget.duration:0}),onPlay:()=>g(!1),onPause:()=>g(!0),onCanPlay:()=>v(!1),onLoadedData:()=>v(!1),onError:()=>v(!1)}),(0,q.jsx)(`button`,{type:`button`,className:`viewer-play`,"data-paused":h||void 0,"aria-label":N(h?`viewer.play`:`viewer.pause`),children:h?(0,q.jsx)(Ru,{}):(0,q.jsx)(zu,{})}),(0,q.jsxs)(`span`,{className:`viewer-timebadge mono`,children:[Ic(p.current,!0),` / `,Ic(_e,!0)]}),_?(0,q.jsxs)(`div`,{className:`video-overlay`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(`span`,{className:`video-spinner`,"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:N(`viewer.preparingPreview`)})]}):null,D?(0,q.jsxs)(`div`,{className:`viewer-expanded-bar`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:[(0,q.jsx)(`span`,{className:`mono player-tc`,children:Ic(p.current,!0)}),(0,q.jsx)(Cu,{percent:ve,onSeek:e=>$l(u.current,e*_e)}),(0,q.jsx)(`span`,{className:`mono player-tc`,children:Ic(_e,!0)}),(0,q.jsx)(wu,{volume:ne,muted:re,onChange:de,onToggleMute:fe}),(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:ue,"aria-label":N(`viewer.shrink`),children:(0,q.jsx)(Gl,{collapse:!0})})]}):null,A?(0,q.jsxs)(`div`,{className:`video-overlay`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(`p`,{children:ru()}),(0,q.jsxs)(`div`,{className:`video-overlay-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>e.onOpenExternally(l),children:N(`viewer.openInPlayer`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>e.onReveal(l),children:N(`viewer.showInFolder`)})]})]}):null]}),(0,q.jsxs)(`div`,{className:`viewer-bottom`,children:[(0,q.jsxs)(`div`,{className:`viewer-timeline`,ref:d,onClick:e=>ye(e.clientX),children:[(0,q.jsx)(`div`,{className:`viewer-progress`,style:{width:`${ve}%`}}),(0,q.jsx)(`div`,{className:`viewer-playhead`,style:{left:`${ve}%`}}),n.map(e=>(0,q.jsx)(`button`,{type:`button`,className:`hl-marker`,"data-dragging":y===e.id||void 0,style:{left:`${_e?e.time/_e*100:0}%`,background:e.color||ku},title:`${e.label}, ${Ic(e.time,!0)}, drag to move`,"aria-label":N(`viewer.highlightAt`,{label:e.label,time:Ic(e.time,!0)}),onPointerDown:t=>be(t,e),onClick:t=>{t.stopPropagation(),y||$l(u.current,e.time)}},e.id))]}),(0,q.jsxs)(`div`,{className:`viewer-hl-head`,children:[(0,q.jsx)(`span`,{className:`eyebrow`,children:N(`viewer.highlightsHeading`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>void he(),children:Ur(`viewer.addHighlightKey`,{key:(0,q.jsx)(`kbd`,{children:`H`},`k`)})})]}),(0,q.jsx)(`div`,{className:`viewer-hl-list`,children:n.length===0?(0,q.jsx)(`p`,{className:`viewer-hl-empty`,children:Ur(`viewer.noHighlightsHelp`,{key:(0,q.jsx)(`kbd`,{children:`H`},`k`)})}):n.map(e=>(0,q.jsxs)(`div`,{className:`hl-item`,onClick:()=>$l(u.current,e.time),children:[(0,q.jsx)(`button`,{type:`button`,className:`hl-swatch`,style:{background:e.color||ku},title:N(`viewer.changeColour`),"aria-label":N(`viewer.changeColourAria`,{name:e.label}),onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();S({id:e.id,color:e.color||ku,at:{x:n.left,y:n.bottom+6}})}}),(0,q.jsx)(`span`,{className:`hl-time mono`,children:Ic(e.time,!0)}),C===e.id?(0,q.jsx)(su,{className:`hl-rename`,label:N(`viewer.highlightLabel`),initial:e.label,emptyFallback:N(`viewer.highlight`),stopPropagation:!0,onCancel:()=>w(null),onSubmit:t=>{w(null),xe(e.id,{label:t})}}):(0,q.jsx)(`span`,{className:`hl-label`,title:N(`viewer.doubleClickRename`),onDoubleClick:t=>{t.stopPropagation(),w(e.id)},children:e.label}),(0,q.jsx)(`button`,{type:`button`,className:`hl-del`,title:N(`viewer.removeHighlight`),"aria-label":N(`viewer.removeHighlightAria`,{name:e.label}),onClick:t=>{t.stopPropagation(),Se(e.id)},children:(0,q.jsx)(Fl,{size:12})})]},e.id))}),(0,q.jsxs)(`footer`,{className:`viewer-foot`,children:[(0,q.jsx)(`span`,{className:`viewer-shortcuts mono`,children:N(`viewer.shortcuts`)}),(0,q.jsxs)(`div`,{className:`viewer-foot-btns`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onTrim(l),children:N(`viewer.trim`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onShare(l),children:N(`viewer.share`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onReveal(l),children:N(`viewer.reveal`)}),(0,q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>e.onDelete(l),children:N(`viewer.delete`)})]})]})]})]}),(0,q.jsx)(Su,{clip:l,paused:h,current:p.current,duration:_e,volume:ne,muted:re,canStepBack:se>0,canStepForward:se>=0&&see.onShare(l),onClose:a})]}),x?(0,q.jsx)(Tu,{at:x.at,current:x.color,onClose:()=>S(null),onPick:e=>{S(null),xe(x.id,{color:e})}}):null]})}function Su({clip:e,paused:t,current:n,duration:r,volume:i,muted:a,canStepBack:o,canStepForward:s,onToggle:c,onStep:l,onVolume:u,onToggleMute:d,onShare:f,onClose:p}){return(0,q.jsxs)(`div`,{className:`player-bar`,children:[(0,q.jsxs)(`div`,{className:`player-clip`,children:[e.thumb_url?(0,q.jsx)(`img`,{src:e.thumb_url,alt:``}):(0,q.jsx)(`span`,{className:`player-thumb-empty`}),(0,q.jsxs)(`div`,{className:`player-titles`,children:[(0,q.jsx)(`b`,{children:Zc(e)}),(0,q.jsx)(`span`,{className:`mono`,children:e.game||``})]})]}),(0,q.jsxs)(`div`,{className:`player-controls`,children:[(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:()=>l(-1),disabled:!o,"aria-label":N(`viewer.prevClip`),children:(0,q.jsx)(Bu,{dir:`back`})}),(0,q.jsx)(`button`,{type:`button`,className:`player-main`,onClick:c,"aria-label":N(t?`viewer.play`:`viewer.pause`),children:t?(0,q.jsx)(Ru,{}):(0,q.jsx)(zu,{})}),(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:()=>l(1),disabled:!s,"aria-label":N(`viewer.nextClip`),children:(0,q.jsx)(Bu,{dir:`forward`})})]}),(0,q.jsxs)(`div`,{className:`player-audio`,children:[(0,q.jsxs)(`span`,{className:`mono player-tc`,children:[Ic(n,!0),` / `,Ic(r,!0)]}),(0,q.jsx)(wu,{volume:i,muted:a,onChange:u,onToggleMute:d})]}),(0,q.jsxs)(`div`,{className:`player-extra`,children:[(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:f,"aria-label":N(`viewer.copyShareLink`),children:(0,q.jsx)(Uu,{})}),(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:p,"aria-label":N(`viewer.closePlayer`),children:(0,q.jsx)(Fl,{size:15})})]})]})}function Cu({percent:e,onSeek:t}){let n=(0,Du.useRef)(null),r=e=>{let t=n.current?.getBoundingClientRect();return!t||!t.width?null:Mu((e-t.left)/t.width)};return(0,q.jsxs)(`div`,{className:`player-track`,ref:n,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault();let n=r(e.clientX);n!==null&&t(n);let i=e=>{let n=r(e.clientX);n!==null&&t(n)},a=()=>{window.removeEventListener(`pointermove`,i,!0),window.removeEventListener(`pointerup`,a,!0),window.removeEventListener(`pointercancel`,a,!0)};window.addEventListener(`pointermove`,i,!0),window.addEventListener(`pointerup`,a,!0),window.addEventListener(`pointercancel`,a,!0)},children:[(0,q.jsx)(`div`,{className:`player-fill`,style:{width:`${e}%`}}),(0,q.jsx)(`div`,{className:`player-knob`,style:{left:`${e}%`}})]})}function wu({volume:e,muted:t,onChange:n,onToggleMute:r}){let i=t?0:e;return(0,q.jsxs)(`div`,{className:`player-volume`,children:[(0,q.jsx)(`button`,{type:`button`,className:`player-btn`,onClick:r,"aria-pressed":t,title:N(t?`viewer.unmuteHint`:`viewer.muteHint`),"aria-label":N(t?`viewer.unmute`:`viewer.mute`),children:(0,q.jsx)(Hu,{level:i})}),(0,q.jsx)(`input`,{type:`range`,className:`player-volume-range`,min:0,max:1,step:.01,value:i,"aria-label":N(`viewer.volume`),style:{"--filled":`${i*100}%`},onChange:e=>n(Number(e.target.value))})]})}function Tu({at:e,current:t,onPick:n,onClose:r}){let i=(0,Du.useRef)(null);return(0,Du.useEffect)(()=>{let e=e=>{i.current?.contains(e.target)||r()},t=window.setTimeout(()=>document.addEventListener(`pointerdown`,e,!0),0);return()=>{window.clearTimeout(t),document.removeEventListener(`pointerdown`,e,!0)}},[r]),(0,q.jsx)(`div`,{className:`hl-picker`,ref:i,style:{left:e.x,top:e.y},role:`menu`,children:Ou.map(e=>(0,q.jsx)(`button`,{type:`button`,className:`hl-picker-dot`,"data-active":e===t||void 0,style:{background:e},title:e,"aria-label":N(`viewer.useColour`,{color:e}),onClick:()=>n(e)},e))})}function Eu(e){let t=N(`viewer.highlight`),n=new Set(e.map(e=>e.label));if(!n.has(t))return t;let r=1;for(;n.has(N(`viewer.highlightNumbered`,{base:t,n:r}));)r++;return N(`viewer.highlightNumbered`,{base:t,n:r})}var Du,q,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu=o((()=>{Du=l(d()),jc(),Sl(),_u(),Tl(),Vc(),ou(),tl(),Kl(),uu(),P(),q=M(),Ou=hu,ku=gu,Au=`vice-volume`,ju=`vice-muted`,Mu=e=>Math.max(0,Math.min(1,e)),Nu=e=>Number(e.toFixed(3)),Pu=e=>[...e].sort((e,t)=>e.time-t.time),Fu=(e,t,n)=>e.map(e=>e.id===t?{...e,time:n}:e),Iu={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},Lu=({dir:e})=>(0,q.jsx)(`svg`,{...Iu,width:16,height:16,children:(0,q.jsx)(`path`,{d:e===`left`?`M15 6 9 12l6 6`:`M9 6l6 6-6 6`})}),Ru=()=>(0,q.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`currentColor`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:`M7 4l13 8-13 8z`})}),zu=()=>(0,q.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`currentColor`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:`M7 4h3.5v16H7zM13.5 4H17v16h-3.5z`})}),Bu=({dir:e})=>(0,q.jsx)(`svg`,{viewBox:`0 0 24 24`,width:13,height:13,fill:`currentColor`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:e===`back`?`M6 4h2v16H6zM20 4 9.5 12 20 20z`:`M18 4h-2v16h2zM4 4l10.5 8L4 20z`})}),Vu=()=>(0,q.jsxs)(`svg`,{...Iu,width:15,height:15,strokeWidth:2,children:[(0,q.jsx)(`path`,{d:`M3 8.5A1.5 1.5 0 0 1 4.5 7h2L8 4.5h8L17.5 7h2A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`13`,r:`3.4`})]}),Hu=({level:e})=>(0,q.jsxs)(`svg`,{...Iu,width:15,height:15,strokeWidth:2,children:[(0,q.jsx)(`path`,{d:`M4 9.5h3L11 6v12L7 14.5H4z`}),e<=0?(0,q.jsx)(`path`,{d:`m15 9.5 4.5 5M19.5 9.5l-4.5 5`}):e<.55?(0,q.jsx)(`path`,{d:`M14.8 9.8a3 3 0 0 1 0 4.4`}):(0,q.jsx)(`path`,{d:`M14.8 9.8a3 3 0 0 1 0 4.4M17.3 7.6a6.5 6.5 0 0 1 0 8.8`})]}),Uu=()=>(0,q.jsxs)(`svg`,{...Iu,width:15,height:15,strokeWidth:2,children:[(0,q.jsx)(`circle`,{cx:`18`,cy:`5`,r:`3`}),(0,q.jsx)(`circle`,{cx:`6`,cy:`12`,r:`3`}),(0,q.jsx)(`circle`,{cx:`18`,cy:`19`,r:`3`}),(0,q.jsx)(`path`,{d:`m8.6 13.5 6.8 4M15.4 6.5l-6.8 4`})]})}));function Gu({at:e,heading:t,items:n,quick:r,emptyLabel:i,onClose:a}){let o=(0,Ku.useRef)(null),[s,c]=(0,Ku.useState)(e);(0,Ku.useLayoutEffect)(()=>{let t=o.current;t&&c({x:Math.max(8,Math.min(e.x,window.innerWidth-t.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-t.offsetHeight-8))})},[e]),(0,Ku.useEffect)(()=>{let e=e=>{e.type===`pointerdown`&&o.current?.contains(e.target)||a()},t=e=>e.key===`Escape`&&a();return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`keydown`,t,!0),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`keydown`,t,!0),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[a]);let l=n.filter(e=>!e.separator);return(0,qu.jsxs)(`div`,{className:`ctx-menu`,ref:o,style:{left:s.x,top:s.y},role:`menu`,children:[(0,qu.jsx)(`p`,{className:`ctx-heading`,children:t}),r?.length?(0,qu.jsx)(`div`,{className:`ctx-quick`,children:r.map(e=>(0,qu.jsx)(`button`,{type:`button`,className:`ctx-quick-btn`,"data-active":e.active||void 0,title:e.title,"aria-label":e.title,onClick:()=>{e.onSelect(),a()},children:e.glyph},e.id))}):null,l.length===0?(0,qu.jsx)(`p`,{className:`ctx-empty`,children:i}):n.map(e=>e.separator?(0,qu.jsx)(`div`,{className:`ctx-sep`,role:`separator`},e.id):(0,qu.jsxs)(`button`,{type:`button`,className:`ctx-item`,"data-danger":e.danger||void 0,role:`menuitem`,disabled:e.disabled,onClick:()=>{e.onSelect?.(),a()},children:[(0,qu.jsx)(`span`,{className:`ctx-mark`,children:e.mark??``}),(0,qu.jsx)(`span`,{children:e.label})]},e.id))]})}var Ku,qu,Ju=o((()=>{Ku=l(d()),qu=M()}));function Yu(){let{notify:e,refreshClips:t}=ol();return(0,Zu.useCallback)(async(n,r)=>{try{let i=await W.renameClip(n.slug,r);return await t(),i?.name&&Zc(i)!==r&&e({kind:`info`,title:N(`card.savedAs`,{name:Zc(i)}),tone:`neutral`,holdMs:4e3}),i??null}catch(t){return e({kind:`error`,title:N(`card.renameFailed`),detail:t.message,tone:`error`,holdMs:7e3}),null}},[e,t])}function Xu(){let{state:e,notify:t,refreshPlaylists:n}=ol(),{openViewer:r,openTrim:i}=td(),{playlists:a}=e,[o,s]=(0,Zu.useState)(null),[c,l]=(0,Zu.useState)(null),[u,d]=(0,Zu.useState)(null),[f,p]=(0,Zu.useState)(null),m=(0,Zu.useCallback)(e=>n=>t({kind:`error`,title:e,detail:n.message,tone:`error`,holdMs:7e3}),[t]),h=(0,Zu.useCallback)((e,n)=>t({kind:`info`,title:e,detail:n,tone:`accent`,holdMs:3500}),[t]),g=(0,Zu.useCallback)(e=>void gl(e,t,d),[t]),_=(0,Zu.useCallback)(e=>void W.revealClip(e.slug).catch(m(N(`viewer.errReveal`))),[m]),v=(0,Zu.useCallback)(e=>void W.copyClipFile(e.slug).then(()=>h(N(`card.videoCopied`))).catch(m(N(`card.errCopyVideo`))),[m,h]),y=Yu(),b=(0,Zu.useCallback)(async(e,t)=>{await y(e,t)},[y]),x=(0,Zu.useMemo)(()=>({onOpen:e=>r(e.slug),onTrim:e=>i(e.slug),onCopyLink:g,onCopyFile:v,onReveal:_,onDelete:l,onRename:b,onContextMenu:(e,t)=>s({clip:e,at:t}),renamingSlug:f,onRenameDone:()=>p(null)}),[r,i,g,v,_,b,f]),S=o?.clip;return{actions:x,overlays:(0,Qu.jsxs)(Qu.Fragment,{children:[o&&S?(0,Qu.jsx)(Gu,{at:o.at,heading:Zc(S),emptyLabel:N(`common.noActions`),onClose:()=>s(null),items:[{id:`open`,label:N(`card.open`),onSelect:()=>r(S.slug)},{id:`trim`,label:N(`card.trim`),onSelect:()=>i(S.slug)},{id:`rename`,label:N(`card.rename`),onSelect:()=>p(S.slug)},{id:`copy-link`,label:S.share_url?N(`card.copyShareLink`):N(`card.noShareLink`),disabled:!S.share_url,onSelect:()=>g(S)},{id:`copy-file`,label:N(`card.copyVideoShort`),onSelect:()=>v(S)},{id:`reveal`,label:N(`card.reveal`),onSelect:()=>_(S)},...a.length?[{id:`sep-playlists`,separator:!0}]:[],...a.map(e=>{let t=e.clip_slugs?.includes(S.slug)??!1;return{id:e.id,label:N(t?`card.removeFrom`:`card.addTo`,{playlist:e.name}),mark:t?`✓`:e.emoji??void 0,onSelect:()=>{(t?W.removeClipFromPlaylist(e.id,S.slug):W.addClipToPlaylist(e.id,S.slug)).then(async r=>{if(r?.ok===!1)throw Error(r.error||N(`card.playlistUnchanged`));await n(),h(N(t?`card.removedFrom`:`card.addedTo`,{playlist:e.name}))}).catch(m(N(`clips.errUpdatePlaylist`)))}}}),{id:`sep-delete`,separator:!0},{id:`delete`,label:N(`card.deleteClip`),danger:!0,onSelect:()=>l(S)}]}):null,(0,Qu.jsx)(ql,{open:c!==null,title:N(`viewer.confirmDeleteTitle`),onClose:()=>l(null),footer:(0,Qu.jsxs)(Qu.Fragment,{children:[(0,Qu.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>l(null),children:N(`common.keepIt`)}),(0,Qu.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=c;l(null),e&&W.deleteClip(e.slug).then(()=>h(N(`viewer.clipDeleted`))).catch(m(N(`viewer.errDelete`)))},children:N(`common.delete`)})]}),children:(0,Qu.jsx)(`p`,{children:N(`viewer.confirmDeleteBody`,{name:c?Zc(c):``})})}),(0,Qu.jsxs)(ql,{open:u!==null,title:N(`viewer.copyLinkTitle`),onClose:()=>d(null),children:[(0,Qu.jsx)(`p`,{children:N(`viewer.copyLinkBody`)}),(0,Qu.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:u??``,rows:3})]})]})}}var Zu,Qu,$u=o((()=>{Zu=l(d()),jc(),_l(),tl(),Ju(),Xl(),pl(),ad(),P(),Qu=M()}));function ed({children:e}){let{state:t,notify:n,refreshClips:r}=ol(),{clips:i}=t,[a,o]=(0,nd.useState)(null),[s,c]=(0,nd.useState)(null),[l,u]=(0,nd.useState)([]),[d,f]=(0,nd.useState)(null),[p,m]=(0,nd.useState)(null),h=i.find(e=>e.slug===a)??null,g=i.find(e=>e.slug===s)??null,_=(0,nd.useCallback)(e=>{document.querySelectorAll(`video.clip-preview`).forEach(e=>e.pause()),o(e)},[]),v=(0,nd.useCallback)(e=>c(e),[]);(0,nd.useEffect)(()=>{if(!a){u([]);return}let e=!1;return W.highlights(a).then(t=>!e&&u(t)).catch(t=>{console.debug(`Loading highlights failed`,t),e||u([])}),()=>{e=!0}},[a]);let y=(0,nd.useRef)(null);(0,nd.useEffect)(()=>{let e=e=>e!==y.current&&!i.some(t=>t.slug===e);a&&e(a)&&o(null),s&&e(s)&&c(null)},[i,a,s]);let b=Yu(),x=(0,nd.useCallback)((e,t)=>{y.current=e.slug,b(e,t).then(t=>{t?.slug&&(o(n=>n===e.slug?t.slug:n),c(n=>n===e.slug?t.slug:n))}).finally(()=>{y.current=null})},[b]),S=(0,nd.useCallback)(e=>t=>n({kind:`error`,title:e,detail:t.message,tone:`error`,holdMs:7e3}),[n]),C=(0,nd.useCallback)((e,t,r=`accent`)=>n({kind:r===`error`?`error`:`info`,title:e,detail:t,tone:r,holdMs:r===`error`?7e3:3500}),[n]),w=(0,nd.useCallback)(e=>void W.revealClip(e.slug).catch(S(N(`viewer.errReveal`))),[S]),ee=(0,nd.useCallback)(e=>void W.openClip(e.slug).catch(S(N(`viewer.errSystemPlayer`))),[S]),te=(0,nd.useCallback)(e=>void gl(e,n,m),[n]),ne=(0,nd.useMemo)(()=>({openViewer:_,openTrim:v}),[_,v]);return(0,rd.jsxs)(id.Provider,{value:ne,children:[e,(0,rd.jsx)(xu,{clip:h,clips:i,highlights:l,onHighlightsChange:u,onSelect:o,onClose:()=>o(null),onTrim:e=>c(e.slug),trimOpen:s!==null,onRename:x,onShare:te,onReveal:w,onOpenExternally:ee,onDelete:f,notify:C}),(0,rd.jsx)(du,{clip:g,highlights:s&&s===a?l:[],onClose:()=>c(null),onSaved:r,notify:C,onRename:x,onReveal:w,onOpenExternally:ee}),(0,rd.jsx)(ql,{open:d!==null,title:N(`viewer.confirmDeleteTitle`),onClose:()=>f(null),footer:(0,rd.jsxs)(rd.Fragment,{children:[(0,rd.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>f(null),children:N(`common.keepIt`)}),(0,rd.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=d;f(null),e&&(o(null),W.deleteClip(e.slug).then(()=>C(N(`viewer.clipDeleted`))).catch(S(N(`viewer.errDelete`))))},children:N(`common.delete`)})]}),children:(0,rd.jsx)(`p`,{children:N(`viewer.confirmDeleteBody`,{name:d?Zc(d):``})})}),(0,rd.jsxs)(ql,{open:p!==null,title:N(`viewer.copyLinkTitle`),onClose:()=>m(null),children:[(0,rd.jsx)(`p`,{children:N(`viewer.copyLinkBody`)}),(0,rd.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:p??``,rows:3})]})]})}function td(){let e=(0,nd.useContext)(id);if(!e)throw Error(`usePlayback was called outside the provider`);return e}var nd,rd,id,ad=o((()=>{nd=l(d()),jc(),_l(),tl(),Xl(),mu(),Wu(),$u(),pl(),P(),rd=M(),id=(0,nd.createContext)(null)}));function od(e,t,n){let r=r=>{let i=(r+e/60)%6,a=n-n*t*Math.max(0,Math.min(i,4-i,1));return Math.round(a*255)};return`#${[r(5),r(3),r(1)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function sd(e){let[t,n,r]=[0,2,4].map(t=>parseInt(e.slice(1+t,3+t),16)/255),i=Math.max(t,n,r),a=i-Math.min(t,n,r),o=0;return a&&(o=i===t?(n-r)/a%6:i===n?(r-t)/a+2:(t-n)/a+4,o*=60,o<0&&(o+=360)),{h:o,s:i?a/i:0,v:i}}function cd({open:e,initial:t,onCancel:n,onConfirm:r}){let[i,a]=(0,ud.useState)(()=>sd(t??`#0099ff`)),[o,s]=(0,ud.useState)(null),c=(0,ud.useRef)(null),l=(0,ud.useRef)(null);(0,ud.useEffect)(()=>{e&&(a(sd(t??`#0099ff`)),s(null))},[e,t]);let u=(0,ud.useMemo)(()=>od(i.h,i.s,i.v),[i]),d=(0,ud.useMemo)(()=>cc(u),[u]),f=(0,ud.useCallback)((e,t)=>n=>{if(n.button!==0)return;n.preventDefault();let r=(n,r)=>{let i=e.current?.getBoundingClientRect();i?.width&&t(pd((n-i.left)/i.width),pd((r-i.top)/i.height))};r(n.clientX,n.clientY);let i=e=>r(e.clientX,e.clientY),a=()=>{window.removeEventListener(`pointermove`,i,!0),window.removeEventListener(`pointerup`,a,!0),window.removeEventListener(`pointercancel`,a,!0)};window.addEventListener(`pointermove`,i,!0),window.addEventListener(`pointerup`,a,!0),window.addEventListener(`pointercancel`,a,!0)},[]),p=f(c,(e,t)=>{s(null),a(n=>({...n,s:e,v:1-t}))}),m=f(l,e=>{s(null),a(t=>({...t,h:e*360}))}),h=(e,t)=>{let n=e.shiftKey?.1:.02,r={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,1],ArrowDown:[0,-1]}[e.key];r&&(e.preventDefault(),s(null),a(i=>t===`h`?{...i,h:(i.h+r[0]*(e.shiftKey?30:6)+360)%360}:{...i,s:pd(i.s+r[0]*n),v:pd(i.v+r[1]*n)}))},g=od(i.h,1,1),_=o??u.toUpperCase();return(0,dd.jsxs)(ql,{open:e,title:N(`accents.customTitle`),onClose:n,footer:(0,dd.jsxs)(dd.Fragment,{children:[(0,dd.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:n,children:N(`common.cancel`)}),(0,dd.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(u),children:N(`accents.useThis`)})]}),children:[(0,dd.jsx)(`p`,{className:`ap-lede`,children:N(`accents.customBody`)}),(0,dd.jsxs)(`div`,{className:`ap-square`,ref:c,style:{background:g,height:fd},role:`slider`,tabIndex:0,"aria-label":N(`accents.saturation`),"aria-valuetext":_,onKeyDown:e=>h(e,`sv`),onPointerDown:p,children:[(0,dd.jsx)(`div`,{className:`ap-square-white`}),(0,dd.jsx)(`div`,{className:`ap-square-black`}),(0,dd.jsx)(`div`,{className:`ap-knob`,style:{left:`${i.s*100}%`,top:`${(1-i.v)*100}%`,background:u}})]}),(0,dd.jsx)(`div`,{className:`ap-hue`,ref:l,role:`slider`,tabIndex:0,"aria-label":N(`accents.hue`),"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Math.round(i.h),onKeyDown:e=>h(e,`h`),onPointerDown:m,children:(0,dd.jsx)(`div`,{className:`ap-knob ap-hue-knob`,style:{left:`${i.h/360*100}%`,background:g}})}),(0,dd.jsxs)(`div`,{className:`ap-row`,children:[(0,dd.jsx)(`span`,{className:`ap-chip`,style:{background:u},"aria-hidden":`true`}),(0,dd.jsx)(`input`,{className:`ap-hex mono`,value:_,"aria-label":N(`accents.hexLabel`),spellCheck:!1,onChange:e=>{s(e.target.value);let t=lc(e.target.value);t&&a(sd(t))},onBlur:()=>s(null)})]}),(0,dd.jsx)(ld,{ramp:d.ramp}),d.failures.length?(0,dd.jsx)(`p`,{className:`ap-warning`,children:N(`accents.lowContrast`)}):null]})}function ld({ramp:e}){return(0,dd.jsx)(`div`,{className:`ap-preview`,style:{background:e.bg},children:(0,dd.jsxs)(`div`,{className:`ap-preview-card`,style:{background:e.surfaceLow},children:[(0,dd.jsx)(`span`,{className:`ap-preview-title`,style:{color:e.onSurface},children:N(`accents.previewTitle`)}),(0,dd.jsx)(`span`,{className:`ap-preview-meta`,style:{color:e.onSurfaceVariant},children:N(`accents.previewMeta`)}),(0,dd.jsxs)(`div`,{className:`ap-preview-row`,children:[(0,dd.jsx)(`span`,{className:`ap-preview-btn`,style:{background:e.base,color:e.onBase},children:N(`accents.previewPrimary`)}),(0,dd.jsx)(`span`,{className:`ap-preview-btn`,style:{background:e.secondaryContainer,color:e.onSecondaryContainer},children:N(`accents.previewQuiet`)}),(0,dd.jsx)(`span`,{className:`ap-preview-chip`,style:{background:e.primaryContainer,color:e.onPrimaryContainer},children:N(`accents.previewChip`)})]})]})})}var ud,dd,fd,pd,md=o((()=>{ud=l(d()),Xl(),_c(),P(),dd=M(),fd=168,pd=e=>Math.max(0,Math.min(1,e))}));function hd(){let{state:e,dispatch:t}=ol(),n=(0,gd.useCallback)((e,t)=>{try{localStorage.setItem(e,t)}catch(e){console.debug(`Saving the accent failed`,e)}},[]),r=(0,gd.useCallback)(e=>{W.saveConfig({sharing:{embed_color:e}}).catch(e=>console.debug(`Saving the embed colour failed`,e))},[]),i=(0,gd.useCallback)(e=>{t({type:`setAccent`,accent:e}),n(`vice-theme`,e),r(oo[e].base)},[t,n,r]),a=(0,gd.useCallback)(e=>{let{ramp:i}=bc(e);t({type:`setAccent`,accent:`custom`,custom:e}),n(`vice-theme`,`custom`),n(ll,e),n(`vice-custom-bg`,i.bg),n(`vice-custom-base`,i.base),r(i.base)},[t,n,r]);return{accent:e.accent,seed:e.customAccent,choose:i,chooseCustom:a}}var gd,_d=o((()=>{gd=l(d()),jc(),pl(),lo(),Dc()}));function vd(e){let t=/^F(\d+)$/.exec(e);if(t)return`KEY_F${t[1]}`;let n=/^Key([A-Z])$/.exec(e);if(n)return`KEY_${n[1]}`;let r=/^Digit(\d)$/.exec(e);return r?`KEY_${r[1]}`:bd[e]??xd[e]??null}function yd(e,t){return[...Sd.filter(([t])=>e[t]).map(([,e])=>e),t].join(`+`)}var bd,xd,Sd,Cd,wd=o((()=>{bd={Numpad0:`KEY_KP0`,Numpad1:`KEY_KP1`,Numpad2:`KEY_KP2`,Numpad3:`KEY_KP3`,Numpad4:`KEY_KP4`,Numpad5:`KEY_KP5`,Numpad6:`KEY_KP6`,Numpad7:`KEY_KP7`,Numpad8:`KEY_KP8`,Numpad9:`KEY_KP9`,NumpadAdd:`KEY_KPPLUS`,NumpadSubtract:`KEY_KPMINUS`,NumpadMultiply:`KEY_KPASTERISK`,NumpadDivide:`KEY_KPSLASH`,NumpadEnter:`KEY_KPENTER`,NumpadDecimal:`KEY_KPDOT`},xd={Insert:`KEY_INSERT`,Delete:`KEY_DELETE`,Home:`KEY_HOME`,End:`KEY_END`,PageUp:`KEY_PAGEUP`,PageDown:`KEY_PAGEDOWN`,ScrollLock:`KEY_SCROLLLOCK`,Pause:`KEY_PAUSE`,PrintScreen:`KEY_SYSRQ`,Tab:`KEY_TAB`,CapsLock:`KEY_CAPSLOCK`,NumLock:`KEY_NUMLOCK`,ArrowUp:`KEY_UP`,ArrowDown:`KEY_DOWN`,ArrowLeft:`KEY_LEFT`,ArrowRight:`KEY_RIGHT`,Backspace:`KEY_BACKSPACE`,Enter:`KEY_ENTER`,Space:`KEY_SPACE`,Minus:`KEY_MINUS`,Equal:`KEY_EQUAL`,BracketLeft:`KEY_LEFTBRACE`,BracketRight:`KEY_RIGHTBRACE`,Backslash:`KEY_BACKSLASH`,Semicolon:`KEY_SEMICOLON`,Quote:`KEY_APOSTROPHE`,Backquote:`KEY_GRAVE`,Comma:`KEY_COMMA`,Period:`KEY_DOT`,Slash:`KEY_SLASH`},Sd=[[`ctrlKey`,`KEY_LEFTCTRL`],[`altKey`,`KEY_LEFTALT`],[`shiftKey`,`KEY_LEFTSHIFT`],[`metaKey`,`KEY_LEFTMETA`]],Cd=new Set([`ShiftLeft`,`ShiftRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`MetaLeft`,`MetaRight`])}));function Td({value:e,onCapture:t,onUnsupported:n,compact:r}){let[i,a]=(0,Ed.useState)(!1);return(0,Ed.useEffect)(()=>{if(!i)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),Cd.has(e.code))return;if(e.code===`Escape`){a(!1);return}let r=vd(e.code);if(!r){n();return}a(!1),t(yd(e,r))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[i,t,n]),(0,Dd.jsx)(`button`,{type:`button`,className:`key-capture mono`,"data-listening":i||void 0,"data-compact":r||void 0,onClick:()=>a(!0),children:i?N(`keyCapture.pressKey`):e||N(`keyCapture.setKey`)})}var Ed,Dd,Od=o((()=>{Ed=l(d()),wd(),P(),Dd=M()}));function J({label:e,help:t,note:n,stack:r,children:i}){return(0,Id.jsxs)(`div`,{className:`srow`,"data-stack":r||void 0,children:[(0,Id.jsxs)(`div`,{className:`srow-label`,children:[(0,Id.jsx)(`strong`,{children:e}),t?(0,Id.jsx)(`span`,{children:t}):null,n?.text?(0,Id.jsx)(`span`,{className:`srow-note`,"data-tone":n.tone??`plain`,children:n.text}):null]}),(0,Id.jsx)(`div`,{className:`srow-control`,children:i})]})}function kd({checked:e,onChange:t,disabled:n,label:r}){return(0,Id.jsx)(`button`,{type:`button`,className:`switch`,role:`switch`,"aria-checked":e,"aria-label":r,disabled:n,onClick:()=>t(!e),children:(0,Id.jsx)(`span`,{className:`switch-thumb`})})}function Ad({value:e,onChange:t,options:n,disabled:r,label:i}){let a=n.length>0&&!Array.isArray(n[0]);return(0,Id.jsxs)(`div`,{className:`select-wrap`,children:[(0,Id.jsx)(`select`,{className:`select`,value:e,"aria-label":i,disabled:r,onChange:e=>t(e.target.value),children:a?n.map(e=>(0,Id.jsx)(`optgroup`,{label:e.group,children:e.options.map(([e,t])=>(0,Id.jsx)(`option`,{value:e,children:t},e))},e.group)):n.map(([e,t])=>(0,Id.jsx)(`option`,{value:e,children:t},e))}),(0,Id.jsx)(Ld,{})]})}function jd({value:e,min:t,max:n,step:r,onChange:i,format:a,label:o}){let s=(e-t)/(n-t)*100;return(0,Id.jsxs)(`div`,{className:`slider`,children:[(0,Id.jsx)(`input`,{type:`range`,value:e,min:t,max:n,step:r,"aria-label":o,style:{"--filled":`${s}%`},onChange:e=>i(Number(e.target.value))}),(0,Id.jsx)(`span`,{className:`slider-value mono`,children:a(e)})]})}function Md({value:e,onChange:t,placeholder:n,label:r,mono:i,wide:a,type:o=`text`,min:s,max:c}){return(0,Id.jsx)(`input`,{className:`text-input`,"data-mono":i||void 0,"data-wide":a||void 0,type:o,min:s,max:c,value:e,placeholder:n,"aria-label":r,spellCheck:!1,onChange:e=>t(e.target.value)})}function Nd({value:e,onChange:t,placeholder:n,label:r,rows:i=3}){return(0,Id.jsx)(`textarea`,{className:`text-area mono`,rows:i,value:e,placeholder:n,"aria-label":r,spellCheck:!1,onChange:e=>t(e.target.value)})}function Pd({fields:e,values:t,onChange:n}){let r=(0,Fd.useId)();return(0,Id.jsx)(`div`,{className:`sound-grid`,children:e.map(([e,i,a])=>(0,Id.jsxs)(`label`,{htmlFor:`${r}-${e}`,children:[(0,Id.jsx)(`span`,{children:N(i)}),(0,Id.jsx)(`input`,{id:`${r}-${e}`,className:`text-input`,"data-mono":!0,value:t[e]??``,placeholder:a,spellCheck:!1,onChange:t=>n(e,t.target.value)})]},e))})}var Fd,Id,Ld,Rd=o((()=>{Fd=l(d()),P(),Id=M(),Ld=()=>(0,Id.jsx)(`svg`,{className:`select-chevron`,width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,Id.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}));function zd({open:e,onClose:t}){let{state:n,hotkey:r,notify:i,saveConfig:a}=ol(),{choose:o,chooseCustom:s,seed:c}=hd(),[l,u]=(0,Vd.useState)(1),[d,f]=(0,Vd.useState)(!1),p=(0,Vd.useRef)(null),m=(0,Vd.useRef)(null),h=(0,Vd.useRef)([]),g=(0,Vd.useRef)(l),_=(0,Vd.useCallback)(e=>{let t=Math.min(Math.max(g.current+e,1),Ud.length);if(t===g.current)return;g.current=t;let n=p.current,r=m.current;if(!n||!r||typeof r.animate!=`function`){u(t);return}for(let e of h.current)e.cancel();h.current=[];let i=e>0?1:-1,a=n.offsetHeight,o=r.animate([{opacity:1,transform:`none`},{opacity:0,transform:`translateX(${-i*18}px)`}],{duration:140,easing:`cubic-bezier(0.3, 0, 1, 1)`,fill:`forwards`});h.current.push(o),o.onfinish=()=>{(0,Hd.flushSync)(()=>u(t));let e=n.offsetHeight;n.style.overflow=`hidden`;let s=n.animate([{height:`${a}px`},{height:`${e}px`}],{duration:280,easing:`cubic-bezier(0.2, 0, 0, 1)`});s.onfinish=s.oncancel=()=>{n.style.overflow=``},o.cancel();let c=r.animate([{opacity:0,transform:`translateX(${i*18}px)`},{opacity:1,transform:`none`}],{duration:240,delay:40,easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`backwards`});h.current=[s,c]}},[]);(0,Vd.useLayoutEffect)(()=>{if(!e){for(let e of h.current)e.cancel();h.current=[],g.current=1,p.current&&(p.current.style.overflow=``)}},[e]);let v=c?bc(c).ramp.base:null,y=n.config?.recording?.clip_duration??20,b=n.config?.recording?.buffer_duration??60,x=n.config?.recording?.clip_duration??20,S=n.config?.hotkeys?.clip??``,C=n.config?.hotkeys?.screenshot??``,w=n.accent,ee=e=>{a(e).catch(e=>i({kind:`error`,title:N(`tutorial.errSave`),detail:e.message,tone:`error`,holdMs:7e3}))},te=()=>{localStorage.setItem(`vice_tutorial_shown`,`1`),W.setAppState({tutorial_seen:!0}).catch(e=>{console.debug(`Recording that the tutorial was seen failed`,e)}),u(1),g.current=1,t()},ne=()=>i({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3});return(0,Y.jsxs)(ql,{open:e,title:N(Ud[l-1]),wide:!0,onClose:te,footer:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`tut-dots`,"aria-hidden":`true`,children:Ud.map((e,t)=>(0,Y.jsx)(`i`,{"data-active":l===t+1||void 0},e))}),l>1?(0,Y.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>_(-1),children:N(`tutorial.back`)}):null,l_(1),children:N(`tutorial.next`)}):(0,Y.jsx)(`button`,{type:`button`,className:`btn`,onClick:te,children:N(`tutorial.gotIt`)})]}),children:[(0,Y.jsx)(`div`,{className:`tut-pages`,ref:p,children:(0,Y.jsx)(`div`,{className:`tut-page`,ref:m,children:l===1?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.colourBody`)}),(0,Y.jsxs)(`div`,{className:`tut-accents`,children:[co.map(e=>(0,Y.jsx)(`button`,{type:`button`,className:`swatch swatch-lg`,"data-active":w===e||void 0,style:{background:oo[e].base},title:N(`accents.${e}`),"aria-label":N(`tutorial.accentLabel`,{name:N(`accents.${e}`)}),"aria-pressed":w===e,onClick:()=>o(e),children:w===e?(0,Y.jsx)(Bl,{size:16}):null},e)),(0,Y.jsx)(`button`,{type:`button`,className:`swatch swatch-lg swatch-custom`,"data-active":w===`custom`||void 0,style:v?{background:v}:void 0,title:N(`accents.customTitle`),"aria-label":N(`accents.customTitle`),"aria-pressed":w===`custom`,onClick:()=>f(!0),children:w===`custom`?(0,Y.jsx)(Bl,{size:16}):(0,Y.jsx)(Wl,{size:16})})]})]}):l===2?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.quickStartBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(Bd,{badge:r,title:N(`tutorial.saveLast`,{duration:y}),children:N(`tutorial.saveLastHelp`,{hotkey:r})}),(0,Y.jsx)(Bd,{badge:`·${r}·`,title:N(`tutorial.sessionTitle`,{hotkey:r}),children:N(`tutorial.sessionHelp`)})]}),(0,Y.jsxs)(`div`,{className:`tut-keys`,children:[(0,Y.jsxs)(`label`,{className:`tut-key`,children:[(0,Y.jsx)(`span`,{children:N(`tutorial.clipKeyLabel`)}),(0,Y.jsx)(Td,{value:S,onUnsupported:ne,onCapture:e=>ee({hotkeys:{clip:e}})})]}),(0,Y.jsxs)(`label`,{className:`tut-key`,children:[(0,Y.jsx)(`span`,{children:N(`tutorial.screenshotKeyLabel`)}),(0,Y.jsx)(Td,{value:C,onUnsupported:ne,onCapture:e=>ee({hotkeys:{screenshot:e}})})]})]}),(0,Y.jsx)(`p`,{className:`tut-note`,children:N(`tutorial.screenshotKeyNote`)})]}):l===3?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.bufferBody`)}),(0,Y.jsx)(`div`,{className:`tut-buffer`,children:(0,Y.jsx)(jd,{label:N(`tutorial.bufferLabel`),value:x,min:5,max:300,step:5,onChange:e=>ee({recording:{clip_duration:e,buffer_duration:Math.max(b,e)}}),format:e=>Ic(e,!0)})}),(0,Y.jsx)(`p`,{className:`tut-note`,children:N(`tutorial.bufferNote`,{buffer:Ic(Math.max(b,x),!0)})})]}):l===4?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.playlistsBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeClip`),title:N(`tutorial.reviewTitle`),children:N(`tutorial.reviewHelp`)}),(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeEdit`),title:N(`tutorial.editorTitle`),children:N(`tutorial.editorHelp`)}),(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeAuto`),title:N(`tutorial.autoTitle`),children:N(`tutorial.autoHelp`)}),(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeNew`),title:N(`tutorial.customTitle`),children:N(`tutorial.customHelp`)})]})]}):l===5?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.shareBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeLink`),title:N(`tutorial.linkTitle`),children:N(`tutorial.linkHelp`)}),(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeTunnel`),title:N(`tutorial.tunnelTitle`),children:N(`tutorial.tunnelHelp`)})]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:N(`tutorial.moreBody`)}),(0,Y.jsxs)(`div`,{className:`tut-steps`,children:[(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeRec`),title:N(`tutorial.recTitle`),children:N(`tutorial.recHelp`)}),(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeBg`),title:N(`tutorial.backgroundTitle`),children:N(`tutorial.backgroundHelp`)}),(0,Y.jsx)(Bd,{badge:N(`tutorial.badgeSafe`),title:N(`tutorial.safeTitle`),children:N(`tutorial.safeHelp`)})]})]})})}),(0,Y.jsx)(cd,{open:d,initial:c,onCancel:()=>f(!1),onConfirm:e=>{s(e),f(!1)}})]})}function Bd({badge:e,title:t,children:n}){return(0,Y.jsxs)(`div`,{className:`tut-step`,children:[(0,Y.jsx)(`span`,{className:`tut-badge mono`,children:e}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`b`,{children:t}),(0,Y.jsx)(`span`,{children:n})]})]})}var Vd,Hd,Y,Ud,Wd=o((()=>{Vd=l(d()),Hd=h(),jc(),pl(),Xl(),Vc(),P(),Kl(),md(),_d(),Dc(),Od(),Rd(),lo(),Y=M(),Ud=[`tutorial.pickColour`,`tutorial.startClipping`,`tutorial.bufferTitle`,`tutorial.playlistsTitle`,`tutorial.shareTitle`,`tutorial.moreTitle`]}));function Gd({forceOpen:e,onClose:t}){let{state:n,notify:r}=ol(),i=n.update,[a,o]=(0,Kd.useState)(!1),[s,c]=(0,Kd.useState)(null);if((0,Kd.useEffect)(()=>{if(!i?.version)return;let e=!1;if(localStorage.getItem(Jd)!==i.version)return W.getAppState().then(t=>{if(!e){if(t.update_dismissed_version===i.version){localStorage.setItem(Jd,i.version);return}o(!0)}}).catch(()=>!e&&o(!0)),()=>{e=!0}},[i?.version]),!i?.version)return null;let l=i.install?.command??``,u=a||e,d=()=>{o(!1),t()},f=()=>{localStorage.setItem(Jd,i.version),W.setAppState({update_dismissed_version:i.version}).catch(e=>{console.debug(`Recording the dismissed update failed`,e)}),d()},p=async()=>{l&&(await ml(l)?r({kind:`info`,title:N(`update.commandCopied`),tone:`accent`,holdMs:4e3}):c(l))};return(0,qd.jsxs)(qd.Fragment,{children:[(0,qd.jsxs)(ql,{open:u,title:N(`update.title`,{version:i.version}),onClose:d,footer:(0,qd.jsxs)(qd.Fragment,{children:[(0,qd.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:f,children:N(`update.later`)}),(0,qd.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>Uc(i.url),children:N(`update.releaseNotes`)}),l?(0,qd.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void p(),children:N(`update.copyCommand`)}):null]}),children:[(0,qd.jsxs)(`p`,{children:[N(`update.youAreOn`,{version:n.status.version||N(`update.olderRelease`)}),l?N(`update.updateWith`):``]}),l?(0,qd.jsx)(`code`,{className:`update-cmd mono`,children:l}):null,i.notes?.length?(0,qd.jsx)(`ul`,{className:`update-notes`,children:i.notes.map(e=>(0,qd.jsx)(`li`,{children:e},e))}):null]}),(0,qd.jsxs)(ql,{open:s!==null,title:N(`update.copyTitle`),onClose:()=>c(null),children:[(0,qd.jsx)(`p`,{children:N(`update.copyByHand`)}),(0,qd.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:s??``,rows:2})]})]})}var Kd,qd,Jd,Yd=o((()=>{Kd=l(d()),jc(),hl(),Xc(),pl(),Xl(),P(),qd=M(),Jd=`vice_update_dismissed`}));function Xd(e,t){Qd(e,t.slug,Zc(t),t.thumb_url)}function Zd(e,t){Qd(e,el(t.slug),Qc(t),t.thumb_url??t.image_url)}function Qd(e,t,n,r){e.dataTransfer.effectAllowed=`copy`,e.dataTransfer.setData(`text/plain`,t),ef();let i=document.createElement(`div`);if(i.className=`clip-drag-ghost`,r){let e=document.createElement(`img`);e.src=r,e.alt=``,i.appendChild(e)}let a=document.createElement(`span`);a.className=`clip-drag-ghost-name`,a.textContent=n,i.appendChild(a),document.body.appendChild(i),af=i,e.dataTransfer.setDragImage(i,24,20)}function $d(){ef()}function ef(){af?.remove(),af=null}function tf(e,t){let[n,r]=(0,nf.useState)(!1),[i,a]=(0,nf.useState)(!1),o=(0,nf.useRef)(void 0);(0,nf.useEffect)(()=>()=>window.clearTimeout(o.current),[]);let s=(0,nf.useCallback)(()=>{a(!0),window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),rf)},[]);return{over:n,caught:i,props:{onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`,r(!0)},onDragLeave:()=>r(!1),onDrop:(0,nf.useCallback)(n=>{n.preventDefault(),r(!1);let i=n.dataTransfer.getData(`text/plain`);if(i){if(e.clip_slugs?.includes(i)){s(),t(N(`card.alreadyIn`,{playlist:e.name}),`accent`);return}W.addClipToPlaylist(e.id,i).then(n=>{if(n.ok===!1)throw Error(n.error||N(`card.errAddClip`));s(),t(N(`card.addedTo`,{playlist:e.name}),`accent`)}).catch(e=>t(e.message,`error`))}},[e.id,e.name,e.clip_slugs,s,t])}}}var nf,rf,af,of=o((()=>{nf=l(d()),jc(),tl(),P(),rf=600,af=null}));function sf({open:e,editing:t,onClose:n,onSubmit:r}){let[i,a]=(0,cf.useState)(``),[o,s]=(0,cf.useState)(``),[c,l]=(0,cf.useState)(df),[u,d]=(0,cf.useState)(null),[f,p]=(0,cf.useState)(!1);(0,cf.useEffect)(()=>{if(e){if(d(null),p(!1),t){a(t.name),s(t.emoji??``);let e=uf.findIndex(([e,n])=>e===t.color1&&n===t.color2);l(e>=0?e:df)}else a(``),s(``),l(df)}},[e,t]);let[m,h]=uf[c],g=async()=>{let e=i.trim();if(!e){d(N(`playlistModal.nameRequired`));return}p(!0);try{await r({name:e,emoji:o.trim(),color1:m,color2:h})}catch(e){d(e.message)}finally{p(!1)}};return(0,lf.jsxs)(ql,{open:e,title:N(t?`playlistModal.editTitle`:`playlistModal.newTitle`),onClose:n,footer:(0,lf.jsxs)(lf.Fragment,{children:[(0,lf.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:n,children:N(`common.cancel`)}),(0,lf.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void g(),disabled:f,children:N(t?`common.save`:`common.create`)})]}),children:[(0,lf.jsxs)(`div`,{className:`npl-head`,children:[(0,lf.jsx)(`span`,{className:`npl-preview`,style:{background:`linear-gradient(150deg, ${m}, ${h})`},"aria-hidden":`true`,children:o.trim()}),(0,lf.jsxs)(`div`,{className:`npl-fields`,children:[(0,lf.jsxs)(`label`,{className:`field`,children:[(0,lf.jsx)(`span`,{children:N(`playlistModal.name`)}),(0,lf.jsx)(`input`,{value:i,autoFocus:!0,onChange:e=>{a(e.target.value),d(null)},onKeyDown:e=>e.key===`Enter`&&void g()})]}),(0,lf.jsxs)(`label`,{className:`field field-narrow`,children:[(0,lf.jsx)(`span`,{children:N(`playlistModal.emoji`)}),(0,lf.jsx)(`input`,{value:o,maxLength:4,placeholder:N(`playlistModal.emojiPlaceholder`),onChange:e=>s(e.target.value)})]})]})]}),(0,lf.jsx)(`div`,{className:`npl-colors`,role:`radiogroup`,"aria-label":N(`playlistModal.colour`),children:uf.map(([e,t],n)=>(0,lf.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":n===c,"aria-label":`Colour ${n+1}`,className:`npl-color`,"data-active":n===c||void 0,style:{background:`linear-gradient(150deg, ${e}, ${t})`},onClick:()=>l(n)},e))}),u?(0,lf.jsx)(`p`,{className:`field-error`,children:u}):null]})}var cf,lf,uf,df,ff=o((()=>{cf=l(d()),Xl(),P(),lf=M(),uf=[[`#ff7a45`,`#9a3412`],[`#f0b429`,`#7c4a03`],[`#34d399`,`#064e3b`],[`#38bdf8`,`#075985`],[`#8b5cf6`,`#3b0a74`],[`#f472b6`,`#831843`],[`#ef4444`,`#7f1d1d`],[`#a3e635`,`#3f6212`]],df=4}));function pf({height:e=20,className:t}){return(0,mf.jsx)(`span`,{className:t?`wordmark ${t}`:`wordmark`,style:{fontSize:e},children:`VICE`})}var mf,hf=o((()=>{mf=M()}));function gf({onShowTutorial:e,onShowUpdate:t}){let{state:n,dispatch:r,notify:i,refreshPlaylists:a}=ol(),[o,s]=(0,vf.useState)(!1),[c,l]=(0,vf.useState)(null),[u,d]=(0,vf.useState)(null),[f,p]=(0,vf.useState)(null),{view:m,currentPlaylistId:h,searchQuery:g,playlists:_,clips:v,images:y,config:b}=n,x=b?.recording?.buffer_duration;return(0,X.jsxs)(`nav`,{className:`sidenav`,"aria-label":N(`nav.main`),children:[(0,X.jsxs)(`div`,{className:`sidenav-brand`,children:[(0,X.jsx)(zl,{size:19,className:`sidenav-mark`}),(0,X.jsx)(pf,{height:15})]}),(0,X.jsxs)(`div`,{className:`sidenav-search`,children:[(0,X.jsx)(Nl,{size:15}),(0,X.jsx)(`input`,{type:`search`,value:g,placeholder:N(`nav.search`),"aria-label":N(`nav.search`),onChange:e=>{r({type:`setSearch`,query:e.target.value}),e.target.value&&m!==`clips`&&r({type:`setView`,view:`clips`})}})]}),(0,X.jsx)(`ul`,{className:`sidenav-list`,children:yf.map(({view:e,labelKey:t,Icon:n})=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:`nav-item`,"aria-current":m===e&&!(e===`clips`&&h)?`page`:void 0,onClick:()=>r({type:`setView`,view:e,playlistId:e===`clips`?null:void 0}),children:[(0,X.jsx)(n,{size:17}),(0,X.jsx)(`span`,{children:N(t)}),e===`clips`&&v.length>0?(0,X.jsx)(`span`,{className:`nav-count`,children:v.length}):null,e===`images`&&y.length>0?(0,X.jsx)(`span`,{className:`nav-count`,children:y.length}):null]})},e))}),(0,X.jsxs)(`div`,{className:`sidenav-heading`,children:[(0,X.jsx)(`span`,{children:N(`nav.playlists`)}),(0,X.jsx)(`button`,{type:`button`,className:`sidenav-add`,title:N(`nav.newPlaylist`),"aria-label":N(`nav.newPlaylist`),onClick:()=>s(!0),children:(0,X.jsx)(Wl,{size:13})})]}),_.length>0?(0,X.jsx)(`ul`,{className:`sidenav-list sidenav-playlists`,children:_.map(e=>(0,X.jsx)(_f,{playlist:e,active:h===e.id,onOpen:()=>r({type:`setView`,view:`clips`,playlistId:e.id}),onContextMenu:t=>l({playlist:e,at:t}),onDone:(e,t)=>i({kind:t===`error`?`error`:`info`,title:e,tone:t,holdMs:t===`error`?7e3:3e3})},e.id))}):(0,X.jsx)(`p`,{className:`sidenav-empty`,children:N(`nav.dragToStart`)}),(0,X.jsxs)(`div`,{className:`sidenav-foot`,children:[n.update?.version?(0,X.jsxs)(`button`,{type:`button`,className:`update-chip`,onClick:t,title:`Vice ${n.update.version} is available`,children:[(0,X.jsx)(Hl,{size:12}),(0,X.jsx)(`span`,{children:N(`nav.update`)})]}):null,(0,X.jsxs)(`div`,{className:`sidenav-foot-row`,children:[x?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sidenav-foot-key`,children:N(`nav.buffer`)}),(0,X.jsx)(`span`,{className:`sidenav-foot-value`,children:Ic(x,!0)})]}):null,(0,X.jsx)(`button`,{type:`button`,className:`sidenav-help`,onClick:e,title:N(`nav.quickStart`),"aria-label":N(`nav.quickStart`),children:(0,X.jsx)(Vl,{size:14})})]})]}),(0,X.jsx)(sf,{open:o,editing:null,onClose:()=>s(!1),onSubmit:async e=>{let t=await W.createPlaylist(e);if(t.ok===!1)throw Error(t.error||N(`clips.errCreatePlaylist`));await a(),r({type:`setView`,view:`clips`,playlistId:t.playlist.id}),i({kind:`info`,title:`Playlist "${e.name}" created`,tone:`accent`,holdMs:3500}),s(!1)}}),c?(0,X.jsx)(Gu,{at:c.at,heading:c.playlist.name,emptyLabel:N(`common.noActions`),onClose:()=>l(null),quick:bf.map(e=>({id:e,glyph:e,title:N(`nav.useEmoji`,{emoji:e}),active:c.playlist.emoji===e,onSelect:()=>{let t=c.playlist;W.updatePlaylist(t.id,{emoji:e}).then(async e=>{if(e?.ok===!1)throw Error(e.error||N(`nav.errSetEmoji`));await a()}).catch(e=>i({kind:`error`,title:N(`nav.errSetEmoji`),detail:e.message,tone:`error`,holdMs:7e3}))}})),items:[{id:`open`,label:N(`nav.open`),onSelect:()=>r({type:`setView`,view:`clips`,playlistId:c.playlist.id})},{id:`edit`,label:N(`clips.editPlaylist`),onSelect:()=>d(c.playlist)},{id:`sep`,separator:!0},{id:`delete`,label:N(`clips.deletePlaylist`),danger:!0,onSelect:()=>p(c.playlist)}]}):null,(0,X.jsx)(sf,{open:u!==null,editing:u,onClose:()=>d(null),onSubmit:async e=>{if(!u)return;let t=await W.updatePlaylist(u.id,e);if(t.ok===!1)throw Error(t.error||N(`clips.errUpdatePlaylist`));await a(),i({kind:`info`,title:N(`clips.playlistUpdated`),tone:`accent`,holdMs:3e3}),d(null)}}),(0,X.jsx)(ql,{open:f!==null,title:N(`clips.confirmDeleteTitle`),onClose:()=>p(null),footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>p(null),children:N(`common.keepIt`)}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=f;p(null),e&&W.deletePlaylist(e.id).then(async()=>{await a(),h===e.id&&r({type:`setView`,view:`clips`,playlistId:null}),i({kind:`info`,title:N(`clips.playlistDeleted`),tone:`neutral`,holdMs:3e3})}).catch(e=>i({kind:`error`,title:N(`clips.errDeletePlaylist`),detail:e.message,tone:`error`,holdMs:7e3}))},children:N(`common.delete`)})]}),children:(0,X.jsxs)(`p`,{children:[N(`clips.confirmDeleteBody`),f?.kind===`auto`?N(`clips.confirmDeleteAuto`):``]})})]})}function _f({playlist:e,active:t,onOpen:n,onContextMenu:r,onDone:i}){let a=tf(e,i);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:`nav-item`,"data-drop-over":a.over||void 0,"data-received":a.caught||void 0,"aria-current":t?`page`:void 0,onClick:n,onContextMenu:e=>{e.preventDefault(),r({x:e.clientX,y:e.clientY})},...a.props,children:[(0,X.jsx)(`span`,{className:`playlist-mark`,"aria-hidden":`true`,children:e.emoji||(0,X.jsx)(Rl,{size:14})}),(0,X.jsx)(`span`,{className:`nav-label`,children:e.name}),(0,X.jsx)(`span`,{className:`nav-count`,children:e.clip_slugs?.length??0})]})})}var vf,X,yf,bf,xf=o((()=>{vf=l(d()),pl(),jc(),of(),Vc(),ff(),P(),Ju(),Xl(),hf(),Kl(),X=M(),yf=[{view:`home`,labelKey:`nav.home`,Icon:Dl},{view:`clips`,labelKey:`nav.allClips`,Icon:Ol},{view:`images`,labelKey:`nav.images`,Icon:kl},{view:`editor`,labelKey:`nav.editor`,Icon:Al},{view:`settings`,labelKey:`nav.settings`,Icon:jl},{view:`about`,labelKey:`nav.about`,Icon:Ml}],bf=[`🎮`,`🕹️`,`🏆`,`⚔️`,`💥`,`🏎️`,`🚀`,`👾`]}));function Sf(){let{state:e}=ol(),{status:t,event:n,sessionStartedAt:r,ready:i,loadError:a}=e,[o,s]=(0,wf.useState)(0);(0,wf.useEffect)(()=>{if(!r){s(0);return}let e=()=>s(Math.floor((Date.now()-r)/1e3));e();let t=window.setInterval(e,1e3);return()=>window.clearInterval(t)},[r]);let c=e.config?.recording?.buffer_duration??null,l=`neutral`,u,d,f=`idle`;n?(f=n.kind,l=n.tone,u=n.title,d=n.detail):a?(f=`error`,l=`error`,u=N(`island.cannotReach`),d=a):i?t.ready===!1&&t.recorder_error?(f=`error`,l=`error`,u=N(`island.notRecording`),d=N(`island.keepsRetrying`)):t.session_active?(f=`session`,l=`live`,u=N(`island.sessionRecording`),d=Ic(o)):t.recording?(f=`buffer`,l=`accent`,u=N(`island.bufferRunning`),d=c?Ic(c,!0):void 0):(f=`idle`,u=N(`island.notRecording`)):(f=`idle`,u=N(`island.starting`));let p=(0,wf.useRef)(null),[m,h]=(0,wf.useState)(null);return(0,wf.useLayoutEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let t=e.offsetWidth,n=e.offsetHeight;h(e=>e&&e.w===t&&e.h===n?e:{w:t,h:n})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[u,d,f]),(0,Tf.jsx)(`div`,{className:`island`,"data-tone":l,"data-wide":f===`saved`||f===`error`||f===`info`||void 0,style:m?{width:m.w,height:m.h}:void 0,role:`status`,"aria-live":`polite`,children:(0,Tf.jsxs)(`div`,{className:`island-content`,ref:p,children:[(0,Tf.jsx)(Cf,{kind:f}),(0,Tf.jsxs)(`div`,{className:`island-text`,children:[(0,Tf.jsx)(`span`,{className:`island-title`,children:u}),d?(0,Tf.jsx)(`span`,{className:`island-detail`,children:d}):null]})]},`${f}-${u}`)})}function Cf({kind:e}){return e===`saving`?(0,Tf.jsx)(`span`,{className:`island-spinner`,"aria-hidden":`true`}):e===`saved`?(0,Tf.jsx)(`span`,{className:`island-badge`,"aria-hidden":`true`,children:(0,Tf.jsx)(Bl,{size:13})}):e===`error`?(0,Tf.jsx)(`span`,{className:`island-glyph`,"aria-hidden":`true`,children:(0,Tf.jsx)(Pl,{size:17})}):e===`idle`?(0,Tf.jsx)(`span`,{className:`island-dot`,"data-idle":`true`,"aria-hidden":`true`}):(0,Tf.jsx)(`span`,{className:`island-dot`,"data-live":e===`session`||void 0,"aria-hidden":`true`})}var wf,Tf,Ef=o((()=>{wf=l(d()),pl(),Vc(),Kl(),P(),Tf=M()}));function Df(){let{state:e,dispatch:t}=ol(),{status:n,dismissed:r}=e,i=e=>!r.includes(e),a=e=>()=>t({type:`dismiss`,banner:e}),o=n.ready===!1&&!!n.recorder_error;return(0,kf.jsxs)(`div`,{className:`banners`,children:[o?(0,kf.jsxs)(Of,{tone:`error`,children:[(0,kf.jsx)(`strong`,{children:N(`banners.notRecording`)}),(0,kf.jsx)(`span`,{className:`banner-mono`,children:n.recorder_error}),(0,kf.jsx)(`span`,{children:N(`banners.notRecordingHelp`)})]}):null,n.cpu_fallback&&i(`cpu`)?(0,kf.jsxs)(Of,{tone:`warning`,onDismiss:a(`cpu`),children:[(0,kf.jsx)(`strong`,{children:N(`banners.cpuFallback`)}),(0,kf.jsx)(`span`,{children:N(`banners.cpuFallbackHelp`)})]}):null,n.codec_fallback&&i(`codec-gpu`)?(0,kf.jsxs)(Of,{tone:`warning`,onDismiss:a(`codec-gpu`),children:[(0,kf.jsx)(`strong`,{children:N(`banners.codecFallback`)}),(0,kf.jsx)(`span`,{children:N(`banners.codecFallbackHelp`)})]}):null,!Jc&&i(`codec-h264`)?(0,kf.jsxs)(Of,{tone:`warning`,onDismiss:a(`codec-h264`),children:[(0,kf.jsx)(`strong`,{children:N(`banners.cannotPlay`)}),(0,kf.jsx)(`span`,{children:N(`banners.cannotPlayHelp`)}),(0,kf.jsx)(`span`,{className:`banner-mono`,children:`sudo apt install python3-pyqt6.qtwebengine`}),(0,kf.jsx)(`span`,{className:`banner-mono`,children:`sudo dnf install python3-pyqt6-webengine`}),(0,kf.jsx)(`span`,{className:`banner-mono`,children:`sudo zypper install python3-qt6-webengine`})]}):null]})}function Of({tone:e,onDismiss:t,children:n}){return(0,kf.jsxs)(`div`,{className:`banner`,"data-tone":e,role:e===`error`?`alert`:`status`,children:[(0,kf.jsx)(Pl,{size:17,className:`banner-icon`}),(0,kf.jsx)(`div`,{className:`banner-text`,children:n}),t?(0,kf.jsx)(`button`,{type:`button`,className:`banner-close`,onClick:t,"aria-label":N(`common.dismiss`),children:(0,kf.jsx)(Fl,{size:14})}):null]})}var kf,Af=o((()=>{pl(),Xc(),Kl(),P(),kf=M()}));function jf({children:e}){let{state:t}=ol(),n=t.view===`editor`||t.view===`settings`,[r,i]=(0,Ff.useState)(!1),[a,o]=(0,Ff.useState)(!1),s=(0,Ff.useRef)(null),[c,l]=(0,Ff.useState)(`narrow`);return(0,Ff.useLayoutEffect)(()=>{let e=s.current;if(!e||t.view!==`home`)return;let n=()=>{let t=getComputedStyle(e),n=e.offsetWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);l(n>=zf?`rail`:n>=Rf?`wide`:`narrow`)},r=new ResizeObserver(n);return r.observe(e),n(),()=>r.disconnect()},[t.view]),(0,Ff.useEffect)(()=>{if(localStorage.getItem(`vice_tutorial_shown`))return;let e=!1;return W.getAppState().then(t=>{e||(t.tutorial_seen?localStorage.setItem(`vice_tutorial_shown`,`1`):i(!0))}).catch(()=>!e&&i(!0)),()=>{e=!0}},[]),(0,If.jsxs)(`div`,{className:`frame`,children:[(0,If.jsx)(gf,{onShowTutorial:()=>i(!0),onShowUpdate:()=>o(!0)}),(0,If.jsx)(Mf,{}),(0,If.jsxs)(`div`,{className:`frame-content`,ref:s,"data-home-wide":t.view===`home`&&c!==`narrow`||void 0,"data-home-rail":t.view===`home`&&c===`rail`||void 0,"data-native":Kc||void 0,children:[(0,If.jsx)(Df,{}),(0,If.jsx)(Bf.Provider,{value:c,children:e})]}),(0,If.jsx)(Sf,{}),Kc?(0,If.jsx)(Pf,{hidden:n}):null,(0,If.jsx)(zd,{open:r,onClose:()=>i(!1)}),(0,If.jsx)(Gd,{forceOpen:a,onClose:()=>o(!1)})]})}function Mf(){return(0,If.jsxs)(`div`,{className:`melt-group`,"aria-hidden":`true`,children:[(0,If.jsx)(`svg`,{width:`0`,height:`0`,className:`melt-defs`,children:(0,If.jsx)(`defs`,{children:(0,If.jsxs)(`linearGradient`,{id:`vice-melt-fade`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,If.jsx)(`stop`,{offset:`0`,stopColor:`#fff`,stopOpacity:`0`}),(0,If.jsx)(`stop`,{offset:`.55`,stopColor:`#fff`,stopOpacity:`.05`}),(0,If.jsx)(`stop`,{offset:`1`,stopColor:`#fff`,stopOpacity:`.10`})]})})}),(0,If.jsx)(`div`,{className:`melt melt-top`,children:(0,If.jsx)(Nf,{})}),(0,If.jsx)(`div`,{className:`melt-line`}),(0,If.jsx)(`div`,{className:`melt melt-bottom`,children:(0,If.jsx)(Nf,{})})]})}function Nf(){return(0,If.jsxs)(`svg`,{width:Lf,height:Lf,viewBox:`0 0 ${Lf} ${Lf}`,children:[(0,If.jsx)(`path`,{d:`M${Lf} 0 A${Lf} ${Lf} 0 0 0 0 ${Lf} L0 0 Z`,fill:`var(--vice-nav-tint)`}),(0,If.jsx)(`path`,{d:`M${Lf} 0 A${Lf} ${Lf} 0 0 0 0 ${Lf}`,fill:`none`,stroke:`url(#vice-melt-fade)`,strokeWidth:`1`})]})}function Pf({hidden:e}){return(0,If.jsxs)(`div`,{className:`quit-row`,"data-hidden":e||void 0,"aria-hidden":e,children:[(0,If.jsxs)(`button`,{type:`button`,className:`quit-btn`,onClick:Wc,children:[(0,If.jsx)(Il,{size:14}),(0,If.jsx)(`span`,{children:N(`frame.minimize`)})]}),(0,If.jsxs)(`button`,{type:`button`,className:`quit-btn quit-btn-danger`,onClick:()=>{window.confirm(N(`frame.quitConfirm`))&&Gc()},children:[(0,If.jsx)(Ll,{size:14}),(0,If.jsx)(`span`,{children:N(`frame.quit`)})]})]})}var Ff,If,Lf,Rf,zf,Bf,Vf,Hf=o((()=>{Ff=l(d()),jc(),Xc(),Wd(),Yd(),Kl(),pl(),xf(),Ef(),Af(),P(),If=M(),Lf=32,Rf=1580,zf=2368,Bf=(0,Ff.createContext)(`narrow`),Vf=()=>(0,Ff.useContext)(Bf)}));function Uf({children:e}){let[t,n]=(0,Gf.useState)(null);return(0,qf.jsxs)(Jf.Provider,{value:t,children:[e,(0,qf.jsx)(`div`,{ref:n,className:`overlay-root`})]})}function Wf({children:e}){let t=(0,Gf.useContext)(Jf);return t?(0,Kf.createPortal)(e,t):null}var Gf,Kf,qf,Jf,Yf=o((()=>{Gf=l(d()),Kf=h(),qf=M(),Jf=(0,Gf.createContext)(null)}));function Xf(e){let{images:t,onSelect:n,onClose:r}=e,{mounted:i,closing:a}=Cl(e.image!==null,320),o=(0,Qf.useRef)(e.image);e.image&&(o.current=e.image);let s=e.image??o.current,c=(0,Qf.useRef)(null),l=(0,Qf.useRef)(null),u=(0,Qf.useRef)(null),d=(0,Qf.useRef)(null),f=(0,Qf.useRef)(null),p=(0,Qf.useRef)(null),m=(0,Qf.useRef)(null),h=(0,Qf.useRef)(null),g=(0,Qf.useRef)(!1),_=(0,Qf.useRef)(null),[v,y]=(0,Qf.useState)([]),[b,x]=(0,Qf.useState)(gu),[S,C]=(0,Qf.useState)(!1),[w,ee]=(0,Qf.useState)(!1),[te,ne]=(0,Qf.useState)(!1),[T,re]=(0,Qf.useState)(!1),E=s?t.findIndex(e=>e.slug===s.slug):-1,D=e.image!==null,ie=v.length>0,ae=(0,Qf.useCallback)(()=>{let e=f.current,t=m.current;if(!e||!t)return;if(!g.current){t.style.width=``,t.style.height=``;return}let n=c.current,r=n?.naturalWidth||s?.width||0,i=n?.naturalHeight||s?.height||0,a=e.getBoundingClientRect();if(!r||!i||!a.width||!a.height)return;let o=Math.min(a.width/r,a.height/i);t.style.width=`${r*o}px`,t.style.height=`${i*o}px`},[s?.width,s?.height]);(0,Qf.useLayoutEffect)(()=>{let e=f.current;if(!e||!D)return;let t=new ResizeObserver(ae);return t.observe(e),()=>t.disconnect()},[D,ae]);let O=(0,Qf.useCallback)(()=>{let e=_.current;if(_.current=null,e){for(let t of e.animations)t.cancel();for(let t of e.ghosts)t.remove();delete e.scrim.dataset.morphing}},[]);(0,Qf.useEffect)(()=>O,[O]);let oe=(0,Qf.useCallback)(()=>{let e=d.current,t=f.current,n=m.current,[r,i]=_.current?.ghosts??[],a=r??e,o=i??t;h.current=a&&o&&n?{dialog:a.getBoundingClientRect(),dialogRadius:getComputedStyle(a).borderTopLeftRadius,stage:o.getBoundingClientRect(),stageRadius:getComputedStyle(o).borderTopLeftRadius,frame:n.getBoundingClientRect()}:null,re(e=>!e)},[]);(0,Qf.useLayoutEffect)(()=>{let e=h.current;h.current=null,g.current=T,ae(),O();let t=d.current,n=f.current,r=m.current,i=t?.closest(`.scrim`),a=t?.parentElement;if(!e||!t||!n||!r||!i||!a||typeof r.animate!=`function`||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||document.documentElement.classList.contains(`perf-low`))return;let o=r.getBoundingClientRect();if(!e.frame.width||!o.width)return;let s=(e,t)=>({left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,borderRadius:t}),c={scrim:i,ghosts:[],animations:[]},l=(e,t,n,r)=>{let o=document.createElement(`div`);o.className=`image-morph image-morph-${e}`,o.setAttribute(`aria-hidden`,`true`),i.insertBefore(o,a),c.ghosts.push(o);let l=r.getBoundingClientRect();c.animations.push(o.animate([s(t,n),s(l,getComputedStyle(r).borderTopLeftRadius)],{...tp,fill:`forwards`}))};if(l(`surface`,e.dialog,e.dialogRadius,t),l(`stage`,e.stage,e.stageRadius,n),i.dataset.morphing=``,T){let n=t.getBoundingClientRect(),r=(e,t)=>`inset(${e.top-n.top}px ${n.right-e.right}px ${n.bottom-e.bottom}px ${e.left-n.left}px round ${t})`;c.animations.push(t.animate([{clipPath:r(e.dialog,e.dialogRadius)},{clipPath:r(n,getComputedStyle(t).borderTopLeftRadius)}],tp))}c.animations.push(r.animate([{transformOrigin:`0 0`,transform:`translate(${e.frame.left-o.left}px, ${e.frame.top-o.top}px) scale(${e.frame.width/o.width}, ${e.frame.height/o.height})`},{transformOrigin:`0 0`,transform:`none`}],tp));let u=T?.35:.6;for(let e of t.querySelectorAll(`:scope > .viewer-head, :scope > .viewer-bottom`))c.animations.push(e.animate([{opacity:0},{opacity:0,offset:u},{opacity:1}],tp));_.current=c,Promise.all(c.animations.map(e=>e.finished)).then(()=>{_.current===c&&O()},()=>void 0)},[T,ae,O]),(0,Qf.useEffect)(()=>{if(!D){O(),re(!1),ne(!1);return}let e=document.activeElement;return p.current?.focus({preventScroll:!0}),()=>{e?.isConnected&&e.focus({preventScroll:!0})}},[D,O]),(0,Qf.useEffect)(()=>{y([]),u.current=null},[s?.slug]);let k=(0,Qf.useCallback)(e=>{if(E<0)return;let r=t[E+e];r&&n(r.slug)},[t,E,n]),A=(0,Qf.useCallback)(()=>{let e=l.current,t=c.current;if(!e||!t)return;let n=t.naturalWidth||s?.width||0,r=t.naturalHeight||s?.height||0;!n||!r||(ae(),(e.width!==n||e.height!==r)&&(e.width=n,e.height=r))},[s?.width,s?.height,ae]);if((0,Qf.useLayoutEffect)(A,[A,s?.slug]),(0,Qf.useEffect)(()=>{let e=l.current,t=e?.getContext(`2d`);if(!(!e||!t)){t.clearRect(0,0,e.width,e.height),t.lineCap=`round`,t.lineJoin=`round`,t.lineWidth=ep;for(let e of v)Zf(t,e)}},[v]),yl(D&&!e.shortcutsBlocked,(0,Qf.useCallback)(()=>{T?oe():r()},[T,r,oe])),(0,Qf.useEffect)(()=>{if(!D||a||e.shortcutsBlocked)return;let t=e=>{if(e.defaultPrevented)return;let t=e.target instanceof HTMLElement?e.target:null;if(e.key===`Tab`){let n=d.current?.querySelectorAll(`button:not(:disabled), input, textarea, [tabindex="0"]`),r=n?.[0],i=n?.[n.length-1];e.shiftKey&&t===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&t===i&&(e.preventDefault(),r?.focus());return}if(!(t?.closest(`input, textarea, select`)||t?.isContentEditable||e.repeat)){if(e.key.toLowerCase()===`z`&&(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey){e.preventDefault(),y(e=>e.slice(0,-1));return}e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||(e.key===`ArrowLeft`?(e.preventDefault(),k(-1)):e.key===`ArrowRight`?(e.preventDefault(),k(1)):e.key.toLowerCase()===`f`&&(e.preventDefault(),oe()))}};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[D,a,e.shortcutsBlocked,k,oe]),!i||!s)return null;let se=e=>{let t=l.current;if(!t)return null;let n=t.getBoundingClientRect();return!n.width||!n.height?null:{x:(e.clientX-n.left)/n.width*t.width,y:(e.clientY-n.top)/n.height*t.height}},ce=e=>{if(!S||e.button!==0)return;let t=se(e);if(!t)return;e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){console.debug(`Capturing the pointer failed`,e)}let n={color:b,points:[t]};u.current=n,y(e=>[...e,n])},j=e=>{let t=u.current;if(!t)return;let n=se(e);n&&(t.points.push(n),y(e=>[...e]))},le=()=>{u.current=null},ue=async()=>{let t=l.current,n=c.current;if(!(!t||!n||!ie)){ee(!0);try{let r=document.createElement(`canvas`);r.width=t.width,r.height=t.height;let i=r.getContext(`2d`);if(!i)throw Error(N(`images.errCanvas`));i.drawImage(n,0,0,r.width,r.height),i.drawImage(t,0,0);let a=await new Promise(e=>r.toBlob(e,`image/png`));if(!a)throw Error(N(`images.errCanvas`));await W.annotateImage(s.slug,a),y([]),e.notify(N(`images.saved`),void 0,`accent`)}catch(t){e.notify(N(`images.errSave`),t.message,`error`)}finally{ee(!1)}}},de=[s.width?`${s.width}x${s.height}`:``,s.size?Rc(s.size):``].filter(Boolean).join(` · `);return(0,$f.jsx)(`div`,{className:`scrim viewer-scrim image-viewer-scrim`,"data-expanded":T||void 0,"data-closing":a||void 0,onMouseDown:e=>e.target===e.currentTarget&&r(),children:(0,$f.jsx)(`div`,{className:`viewer-stack`,children:(0,$f.jsxs)(`div`,{className:`modal viewer image-viewer`,ref:d,"data-closing":a||void 0,role:`dialog`,"aria-modal":`true`,"aria-label":Qc(s),children:[(0,$f.jsxs)(`header`,{className:`viewer-head`,children:[(0,$f.jsxs)(`div`,{className:`viewer-heading`,children:[te?(0,$f.jsx)(su,{className:`viewer-rename`,label:N(`card.nameLabel`),initial:Qc(s),onCancel:()=>ne(!1),onSubmit:t=>{ne(!1),e.onRename(s,t)}}):(0,$f.jsx)(`h2`,{title:N(`viewer.doubleClickRename`),onDoubleClick:()=>ne(!0),children:Qc(s)}),(0,$f.jsx)(`p`,{className:`mono`,children:de})]}),t.length>1?(0,$f.jsxs)(`span`,{className:`viewer-count mono`,children:[E+1,` / `,t.length]}):null,(0,$f.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>k(-1),disabled:E<=0,"aria-label":N(`images.prev`),children:(0,$f.jsx)(np,{dir:`left`})}),(0,$f.jsx)(`button`,{type:`button`,className:`viewer-nav`,onClick:()=>k(1),disabled:E<0||E>=t.length-1,"aria-label":N(`images.next`),children:(0,$f.jsx)(np,{dir:`right`})}),(0,$f.jsx)(`button`,{ref:p,type:`button`,className:`viewer-nav image-expand`,onClick:oe,"aria-label":N(T?`viewer.shrink`:`viewer.expand`),title:N(T?`viewer.shrinkHint`:`viewer.expandHint`),"aria-pressed":T,children:(0,$f.jsx)(Gl,{collapse:T})}),(0,$f.jsx)(`button`,{type:`button`,className:`modal-close`,onClick:r,"aria-label":N(`common.close`),children:(0,$f.jsx)(Fl,{size:15})})]}),(0,$f.jsx)(`div`,{className:`image-stage`,ref:f,onDoubleClick:()=>{S||oe()},children:(0,$f.jsxs)(`div`,{className:`image-frame`,ref:m,children:[(0,$f.jsx)(`img`,{ref:c,className:`image-full`,src:s.image_url,alt:Qc(s),draggable:!1,onLoad:A}),(0,$f.jsx)(`canvas`,{ref:l,className:`image-ink`,"data-pen":S||void 0,onPointerDown:ce,onPointerMove:j,onPointerUp:le,onPointerCancel:le})]})}),(0,$f.jsxs)(`div`,{className:`viewer-bottom`,children:[(0,$f.jsxs)(`div`,{className:`image-tools`,children:[(0,$f.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,"aria-pressed":S,"data-active":S||void 0,onClick:()=>C(e=>!e),children:N(S?`images.penOn`:`images.pen`)}),(0,$f.jsx)(`div`,{className:`image-swatches`,role:`group`,"aria-label":N(`images.penColour`),children:hu.map(e=>(0,$f.jsx)(`button`,{type:`button`,className:`hl-picker-dot`,"data-active":e===b||void 0,style:{background:e},title:e,"aria-label":N(`viewer.useColour`,{color:e}),onClick:()=>{x(e),C(!0)}},e))}),(0,$f.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!ie,onClick:()=>y(e=>e.slice(0,-1)),children:N(`images.undo`)}),(0,$f.jsx)(`button`,{type:`button`,className:`btn btn-sm`,disabled:!ie||w,onClick:()=>void ue(),children:N(w?`images.saving`:`images.saveDrawing`)})]}),(0,$f.jsxs)(`footer`,{className:`viewer-foot`,children:[(0,$f.jsx)(`span`,{className:`viewer-shortcuts mono`,children:N(`images.shortcuts`)}),(0,$f.jsxs)(`div`,{className:`viewer-foot-btns`,children:[(0,$f.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onCopy(s),children:N(`images.copy`)}),(0,$f.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>e.onReveal(s),children:N(`viewer.reveal`)}),(0,$f.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>e.onDelete(s),children:N(`viewer.delete`)})]})]})]})]})})})}function Zf(e,t){let{points:n}=t;if(n.length!==0){if(e.strokeStyle=t.color,n.length===1){e.fillStyle=t.color,e.beginPath(),e.arc(n[0].x,n[0].y,ep/2,0,Math.PI*2),e.fill();return}e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let t=1;t{Qf=l(d()),jc(),Sl(),Tl(),Vc(),_u(),tl(),Kl(),uu(),P(),$f=M(),ep=6,tp={duration:280,easing:`cubic-bezier(0.2, 0, 0, 1)`},np=({dir:e})=>(0,$f.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,$f.jsx)(`path`,{d:e===`left`?`m15 6-6 6 6 6`:`m9 6 6 6-6 6`})})}));function ip(e){let{state:t,visibleImages:n,notify:r,refreshImages:i,refreshPlaylists:a}=ol(),{playlists:o}=t,[s,c]=(0,ap.useState)(null),[l,u]=(0,ap.useState)(null),[d,f]=(0,ap.useState)(null),[p,m]=(0,ap.useState)(null),[h,g]=(0,ap.useState)(null),[_,v]=(0,ap.useState)(null),y=(0,ap.useMemo)(()=>h===null?n:h.map(e=>t.images.find(t=>t.slug===e)).filter(e=>!!e),[h,n,t.images]),b=y.find(e=>e.slug===s)??(_?.slug===s?_:null),x=(0,ap.useCallback)(t=>{g(e?e.map(e=>e.slug):null),c(t.slug)},[e]),S=(0,ap.useCallback)(()=>c(null),[]),C=(0,ap.useCallback)(e=>t=>r({kind:`error`,title:e,detail:t.message,tone:`error`,holdMs:7e3}),[r]),w=(0,ap.useCallback)((e,t,n=`accent`)=>r({kind:n===`error`?`error`:`info`,title:e,detail:t,tone:n,holdMs:n===`error`?7e3:3500}),[r]),ee=(0,ap.useCallback)(e=>void W.copyImage(e.slug).then(e=>{if(e?.ok===!1)throw Error(e.error||N(`images.errCopy`));w(N(`images.copied`))}).catch(C(N(`images.errCopy`))),[C,w]),te=(0,ap.useCallback)(e=>void W.revealImage(e.slug).catch(C(N(`viewer.errReveal`))),[C]),ne=(0,ap.useCallback)(e=>void W.openImage(e.slug).catch(C(N(`images.errOpen`))),[C]),T=(0,ap.useCallback)(async(e,t)=>{v(e);try{let n=await W.renameImage(e.slug,t);n?.slug&&(v(n),c(t=>t===e.slug?n.slug:t),g(t=>t?.map(t=>t===e.slug?n.slug:t)??null),Qc(n)!==t&&r({kind:`info`,title:N(`card.savedAs`,{name:Qc(n)}),tone:`neutral`,holdMs:4e3})),await i()}catch(e){r({kind:`error`,title:N(`card.renameFailed`),detail:e.message,tone:`error`,holdMs:7e3})}finally{v(null)}},[r,i]),re=(0,ap.useMemo)(()=>({onOpen:x,onCopy:ee,onReveal:te,onDelete:f,onRename:T,onContextMenu:(e,t)=>u({image:e,at:t}),renamingSlug:p,onRenameDone:()=>m(null)}),[x,ee,te,T,p]),E=l?.image;return{actions:re,overlays:(0,op.jsxs)(op.Fragment,{children:[(0,op.jsx)(Xf,{image:b,images:y,onSelect:c,onClose:S,shortcutsBlocked:d!==null||l!==null,onRename:T,onCopy:ee,onReveal:te,onDelete:f,notify:w}),l&&E?(0,op.jsx)(Gu,{at:l.at,heading:Qc(E),emptyLabel:N(`common.noActions`),onClose:()=>u(null),items:[{id:`open`,label:N(`images.open`),onSelect:()=>x(E)},{id:`rename`,label:N(`card.rename`),onSelect:()=>m(E.slug)},{id:`copy`,label:N(`images.copy`),onSelect:()=>ee(E)},{id:`reveal`,label:N(`card.reveal`),onSelect:()=>te(E)},{id:`open-external`,label:N(`images.openExternally`),onSelect:()=>ne(E)},...o.length?[{id:`sep-playlists`,separator:!0}]:[],...o.map(e=>{let t=el(E.slug),n=e.clip_slugs?.includes(t)??!1;return{id:e.id,label:N(n?`card.removeFrom`:`card.addTo`,{playlist:e.name}),mark:n?`✓`:e.emoji??void 0,onSelect:()=>{(n?W.removeClipFromPlaylist(e.id,t):W.addClipToPlaylist(e.id,t)).then(async t=>{if(t?.ok===!1)throw Error(t.error||N(`card.playlistUnchanged`));await a(),w(N(n?`card.removedFrom`:`card.addedTo`,{playlist:e.name}))}).catch(C(N(`clips.errUpdatePlaylist`)))}}}),{id:`sep-delete`,separator:!0},{id:`delete`,label:N(`images.deleteImage`),danger:!0,onSelect:()=>f(E)}]}):null,(0,op.jsx)(ql,{open:d!==null,title:N(`images.confirmDeleteTitle`),onClose:()=>f(null),footer:(0,op.jsxs)(op.Fragment,{children:[(0,op.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>f(null),children:N(`common.keepIt`)}),(0,op.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{let e=d;f(null),e&&(c(t=>t===e.slug?null:t),W.deleteImage(e.slug).then(()=>w(N(`images.deleted`))).catch(C(N(`images.errDelete`))))},children:N(`common.delete`)})]}),children:(0,op.jsx)(`p`,{children:N(`images.confirmDeleteBody`,{name:d?Qc(d):``})})})]})}}var ap,op,sp=o((()=>{ap=l(d()),jc(),tl(),Ju(),rp(),Xl(),pl(),P(),op=M()}));function cp({image:e,isNew:t,actions:n={},draggable:r}){let[i,a]=(0,up.useState)(!1),[o,s]=(0,up.useState)(null),c=i||n.renamingSlug===e.slug,l=()=>{a(!1),n.onRenameDone?.()},u=[e.created_at?new Date(e.created_at).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,e.width?`${e.width}x${e.height}`:``,e.size?Rc(e.size):``].filter(Boolean).join(` · `);return(0,dp.jsxs)(`article`,{className:`clip-card image-card`,"data-renaming":c||void 0,draggable:r&&!c,onDragStart:t=>Zd(t,e),onDragEnd:$d,onContextMenu:t=>{n.onContextMenu&&(t.preventDefault(),n.onContextMenu(e,{x:t.clientX,y:t.clientY}))},onClick:t=>{c||t.target.closest(`button, a, input, textarea, .clip-name`)||n.onOpen?.(e)},children:[(0,dp.jsxs)(`button`,{type:`button`,className:`clip-thumb`,onClick:()=>n.onOpen?.(e),"aria-label":N(`images.openTitle`,{name:Qc(e)}),children:[e.thumb_url&&o!==e.thumb_url?(0,dp.jsx)(`img`,{src:e.thumb_url,loading:`lazy`,alt:``,draggable:!1,onError:()=>s(e.thumb_url??null)}):(0,dp.jsx)(`span`,{className:`clip-thumb-empty`,"aria-hidden":`true`,children:(0,dp.jsx)(kl,{size:32})}),(0,dp.jsx)(`span`,{className:`clip-badges`,children:t?(0,dp.jsx)(`span`,{className:`clip-badge clip-badge-new`,children:N(`common.new`)}):null})]}),(0,dp.jsxs)(`div`,{className:`clip-body`,children:[c?(0,dp.jsx)(su,{className:`clip-rename`,label:N(`card.nameLabel`),initial:Qc(e),onCancel:l,onSubmit:async t=>{l(),await n.onRename?.(e,t)}}):(0,dp.jsx)(`h3`,{className:`clip-name`,title:N(`card.renameHint`,{name:Qc(e)}),onDoubleClick:()=>n.onRename&&a(!0),children:Qc(e)}),(0,dp.jsx)(`p`,{className:`clip-meta`,children:u}),(0,dp.jsx)(`span`,{className:`clip-game`,"data-untagged":!e.game||void 0,children:e.game||N(`common.untagged`)}),fp(n)?(0,dp.jsxs)(`div`,{className:`clip-actions`,children:[n.onCopy?(0,dp.jsx)(lp,{label:N(`images.copy`),onClick:()=>n.onCopy?.(e),children:(0,dp.jsx)(mp,{})}):null,n.onReveal?(0,dp.jsx)(lp,{label:N(`card.reveal`),onClick:()=>n.onReveal?.(e),children:(0,dp.jsx)(hp,{})}):null,n.onDelete?(0,dp.jsx)(lp,{label:N(`card.delete`),danger:!0,onClick:()=>n.onDelete?.(e),children:(0,dp.jsx)(gp,{})}):null]}):null]})]})}function lp({label:e,onClick:t,danger:n,children:r}){return(0,dp.jsx)(`button`,{type:`button`,className:`clip-icon-btn`,"data-danger":n||void 0,title:e,"aria-label":e,onClick:e=>{e.stopPropagation(),t()},children:r})}var up,dp,fp,pp,mp,hp,gp,_p=o((()=>{up=l(d()),of(),Vc(),tl(),P(),uu(),Kl(),dp=M(),fp=e=>!!(e.onCopy||e.onReveal||e.onDelete),pp={width:13,height:13,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},mp=()=>(0,dp.jsxs)(`svg`,{...pp,children:[(0,dp.jsx)(`rect`,{x:`8`,y:`8`,width:`13`,height:`13`,rx:`2`}),(0,dp.jsx)(`path`,{d:`M4 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2`})]}),hp=()=>(0,dp.jsx)(`svg`,{...pp,children:(0,dp.jsx)(`path`,{d:`M3 7h6l2 2h10v10H3z`})}),gp=()=>(0,dp.jsx)(`svg`,{...pp,children:(0,dp.jsx)(`path`,{d:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`})})}));function vp(e,t,n,r){let i=(e-n*(r-1))/r,a=i/wp,o=Math.max(0,Math.floor((t+n)/(a+n))),s={rows:o,cardHeight:a,off:1/0};for(let e of[o,o+1]){if(e<1)continue;let r=(t-n*(e-1))/e,a=i/r,o=Math.abs(Math.log(a/wp));a>=Tp&&a<=Ep&&o{let e=n.current;if(!e)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect(),r=parseFloat(getComputedStyle(e).columnGap)||0,a=Math.max(1,Math.min(Cp,Math.floor((t+r)/(Sp+r)))),{rows:o,cardHeight:s}=t>0?vp(t,n,r,a):{rows:0,cardHeight:0};i(e=>e.columns===a&&e.rows===o&&e.height===n&&e.cardHeight===s&&e.gap===r?e:{columns:a,rows:o,height:n,cardHeight:s,gap:r})},r=new ResizeObserver(t);return r.observe(e),t(),()=>r.disconnect()},[]);let a=r.columns*r.rows,o=(0,bp.useMemo)(()=>e.images.slice(0,a),[e.images,a]),{actions:s,overlays:c}=ip(o),l=Math.ceil(o.length/r.columns),u=l{t({type:`setSearch`,query:``}),t({type:`setView`,view:`images`,playlistId:null})},children:N(`home.seeAll`)})]}),(0,xp.jsxs)(`div`,{className:`home-images-grid`,ref:n,style:{gridTemplateColumns:`repeat(${r.columns}, minmax(0, 1fr))`,gridTemplateRows:r.rows?`repeat(${r.rows}, ${r.cardHeight}px)`:`minmax(0, 1fr)`},children:[o.map(e=>(0,xp.jsx)(cp,{image:e,draggable:!0,actions:s},e.slug)),d?(0,xp.jsxs)(`div`,{className:`home-images-placeholder`,"data-compact":r.height<240||!u||void 0,style:{gridColumn:u?`1 / -1`:`${o.length%r.columns+1} / -1`,gridRow:u?`${l+1} / -1`:void 0,height:u?Math.max(0,r.height-l*(r.cardHeight+r.gap)):void 0},children:[(0,xp.jsxs)(`svg`,{className:`home-images-art`,viewBox:`0 0 280 180`,"aria-hidden":`true`,children:[(0,xp.jsx)(`rect`,{className:`image-art-capsule`,x:`26`,y:`85`,width:`230`,height:`72`,rx:`36`,transform:`rotate(-12 140 120)`}),(0,xp.jsx)(`path`,{className:`image-art-burst`,d:`m225 17 12 12 17-1 1 17 12 12-12 12-1 17-17-1-12 12-12-12-17 1-1-17-12-12 12-12 1-17 17 1z`}),(0,xp.jsxs)(`g`,{transform:`rotate(8 135 90)`,children:[(0,xp.jsx)(`rect`,{className:`image-art-picture`,x:`63`,y:`26`,width:`146`,height:`120`,rx:`32`}),(0,xp.jsx)(`circle`,{className:`image-art-ink`,cx:`104`,cy:`65`,r:`12`}),(0,xp.jsx)(`path`,{className:`image-art-ink`,d:`m82 119 32-35q5-5 10 0l17 19 17-15q5-5 10 1l24 30z`})]})]}),(0,xp.jsxs)(`div`,{children:[(0,xp.jsx)(`h3`,{children:N(e.images.length?`images.roomForMore`:`images.captureMoment`)}),(0,xp.jsx)(`p`,{children:f?N(`images.captureHint`,{hotkey:zc(f)}):N(`images.captureNoKey`)}),f?null:(0,xp.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>t({type:`setView`,view:`settings`}),children:N(`home.settings`)})]})]}):null]})]}),(0,xp.jsx)(Wf,{children:c})]})}var bp,xp,Sp,Cp,wp,Tp,Ep,Dp=o((()=>{bp=l(d()),Vc(),P(),sp(),pl(),_p(),Yf(),xp=M(),Sp=230,Cp=4,wp=16/9,Tp=1.45,Ep=2.2}));function Op({clip:e,isNew:t,actions:n={},draggable:r}){let i=(0,Ap.useRef)(null),a=(0,Ap.useRef)(void 0),[o,s]=(0,Ap.useState)(!1),[c,l]=(0,Ap.useState)(!1),u=c||n.renamingSlug===e.slug,d=()=>{l(!1),n.onRenameDone?.()},f=e.unreadable,p=Jc&&!f&&!o&&!!e.thumb_url;(0,Ap.useEffect)(()=>()=>window.clearTimeout(a.current),[]);let m=()=>{let t=i.current;!t||!p||(window.clearTimeout(a.current),t.getAttribute(`src`)||(t.src=Ql(e)),t.play().catch(()=>s(!0)))},h=()=>{let e=i.current;e&&(e.pause(),window.clearTimeout(a.current),a.current=window.setTimeout(()=>{if(e.getAttribute(`src`)){e.removeAttribute(`src`);try{e.load()}catch(e){console.debug(`Releasing the preview buffer failed`,e)}}},Mp))},g=[e.created_at?new Date(e.created_at).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,!f&&e.width?`${e.width}x${e.height}`:``,e.size?Rc(e.size):``,e.views?N(`card.views`,{count:e.views}):``].filter(Boolean).join(` · `);return(0,jp.jsxs)(`article`,{className:`clip-card`,"data-broken":f||void 0,draggable:r&&!u,onDragStart:t=>Xd(t,e),onDragEnd:$d,onContextMenu:t=>{n.onContextMenu&&(t.preventDefault(),n.onContextMenu(e,{x:t.clientX,y:t.clientY}))},onClick:t=>{u||t.target.closest(`button, a, input, textarea, .clip-name`)||n.onOpen?.(e)},children:[(0,jp.jsxs)(`button`,{type:`button`,className:`clip-thumb`,onClick:()=>n.onOpen?.(e),onPointerEnter:m,onPointerLeave:h,"aria-label":N(`card.openTitle`,{name:Zc(e)}),children:[e.thumb_url?(0,jp.jsx)(`img`,{src:e.thumb_url,loading:`lazy`,alt:``,draggable:!1}):(0,jp.jsx)(`span`,{className:`clip-thumb-empty`,"aria-hidden":`true`}),p?(0,jp.jsx)(`video`,{ref:i,className:`clip-preview`,muted:!0,loop:!0,playsInline:!0,preload:`none`,onError:()=>s(!0)}):null,(0,jp.jsxs)(`span`,{className:`clip-badges`,children:[f?(0,jp.jsx)(`span`,{className:`clip-badge clip-badge-broken`,title:e.unreadable_reason,children:N(`card.unreadable`)}):null,t?(0,jp.jsx)(`span`,{className:`clip-badge clip-badge-new`,children:N(`common.new`)}):null]}),e.duration&&!f?(0,jp.jsx)(`span`,{className:`clip-duration`,children:Ic(Math.round(e.duration),!0)}):null]}),(0,jp.jsxs)(`div`,{className:`clip-body`,children:[u?(0,jp.jsx)(su,{className:`clip-rename`,label:N(`card.nameLabel`),initial:Zc(e),onCancel:d,onSubmit:async t=>{d(),await n.onRename?.(e,t)}}):(0,jp.jsx)(`h3`,{className:`clip-name`,title:N(`card.renameHint`,{name:Zc(e)}),onDoubleClick:()=>n.onRename&&l(!0),children:Zc(e)}),(0,jp.jsx)(`p`,{className:`clip-meta`,children:g}),f?(0,jp.jsx)(`p`,{className:`clip-broken-note`,children:N(`card.unreadableNote`,{reason:e.unreadable_reason||N(`card.unreadableFallback`)})}):null,(0,jp.jsx)(`span`,{className:`clip-game`,"data-untagged":!e.game||void 0,children:e.game||N(`common.untagged`)}),Np(n)?(0,jp.jsxs)(`div`,{className:`clip-actions`,children:[n.onTrim?(0,jp.jsx)(kp,{label:N(`card.trim`),onClick:()=>n.onTrim?.(e),children:(0,jp.jsx)(Fp,{})}):null,n.onCopyFile?(0,jp.jsx)(kp,{label:N(`card.copyVideo`),onClick:()=>n.onCopyFile?.(e),children:(0,jp.jsx)(Ip,{})}):null,n.onCopyLink?(0,jp.jsx)(kp,{label:e.share_url?N(`card.copyShareLink`):N(`card.noShareLink`),disabled:!e.share_url,onClick:()=>n.onCopyLink?.(e),children:(0,jp.jsx)(Lp,{})}):null,n.onReveal?(0,jp.jsx)(kp,{label:N(`card.reveal`),onClick:()=>n.onReveal?.(e),children:(0,jp.jsx)(Rp,{})}):null,n.onDelete?(0,jp.jsx)(kp,{label:N(`card.delete`),danger:!0,onClick:()=>n.onDelete?.(e),children:(0,jp.jsx)(zp,{})}):null]}):null]})]})}function kp({label:e,onClick:t,danger:n,disabled:r,children:i}){return(0,jp.jsx)(`button`,{type:`button`,className:`clip-icon-btn`,"data-danger":n||void 0,title:e,"aria-label":e,disabled:r,onClick:e=>{e.stopPropagation(),t()},children:i})}var Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp=o((()=>{Ap=l(d()),of(),Vc(),tl(),Xc(),ou(),P(),uu(),jp=M(),Mp=4e3,Np=e=>!!(e.onTrim||e.onCopyFile||e.onCopyLink||e.onReveal||e.onDelete),Pp={width:13,height:13,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},Fp=()=>(0,jp.jsxs)(`svg`,{...Pp,children:[(0,jp.jsx)(`circle`,{cx:`6`,cy:`7`,r:`3`}),(0,jp.jsx)(`circle`,{cx:`6`,cy:`17`,r:`3`}),(0,jp.jsx)(`path`,{d:`M20 5 9 15M20 19 9 9`})]}),Ip=()=>(0,jp.jsxs)(`svg`,{...Pp,children:[(0,jp.jsx)(`rect`,{x:`8`,y:`8`,width:`13`,height:`13`,rx:`2`}),(0,jp.jsx)(`path`,{d:`M4 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2`})]}),Lp=()=>(0,jp.jsxs)(`svg`,{...Pp,children:[(0,jp.jsx)(`path`,{d:`M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1`}),(0,jp.jsx)(`path`,{d:`M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1`})]}),Rp=()=>(0,jp.jsx)(`svg`,{...Pp,children:(0,jp.jsx)(`path`,{d:`M3 7h6l2 2h10v10H3z`})}),zp=()=>(0,jp.jsx)(`svg`,{...Pp,children:(0,jp.jsx)(`path`,{d:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`})})}));function Vp({label:e,detail:t,icon:n,on:r,busy:i,onToggle:a}){return(0,Up.jsxs)(`button`,{type:`button`,className:`tile`,"aria-pressed":r,"aria-busy":i||void 0,disabled:i,onClick:a,children:[(0,Up.jsx)(`span`,{className:`tile-badge`,"aria-hidden":`true`,children:n}),(0,Up.jsxs)(`span`,{className:`tile-text`,children:[(0,Up.jsx)(`b`,{children:e}),t?(0,Up.jsx)(`span`,{children:t}):null]})]})}function Hp({label:e,icon:t,onClick:n,disabled:r}){return(0,Up.jsxs)(`button`,{type:`button`,className:`tile tile-action`,onClick:n,disabled:r,title:e,"aria-label":e,children:[(0,Up.jsx)(`span`,{className:`tile-badge`,"aria-hidden":`true`,children:t}),(0,Up.jsx)(`span`,{className:`tile-action-label`,children:e})]})}var Up,Wp=o((()=>{Up=M()}));function Gp(e){try{return new URL(e).hostname.replace(/\.trycloudflare\.com$/,``)}catch{return e}}function Kp(){let e=new Date().getHours();return N(e<12?`home.greetingMorning`:e<18?`home.greetingAfternoon`:`home.greetingEvening`)}function qp(){let{state:e,dispatch:t,hotkey:n,saveConfig:r,notify:i}=ol(),{clips:a,playlists:o,config:s,tunnelUrl:c,recentNew:l,status:u}=e,{actions:d,overlays:f}=Xu(),p=Vf(),[m,h]=(0,Zp.useState)(null),[g,_]=(0,Zp.useState)(null),[v,y]=(0,Zp.useState)(!1),[b,x]=(0,Zp.useState)(!1),S=s?.recording?.clip_duration??20,C=s?.recording?.capture_audio!==!1,w=!!s?.recording?.capture_microphone,ee=!!s?.sharing?.cloudflare_tunnel,te=(0,Zp.useMemo)(()=>a.slice(0,Qp),[a]),ne=(0,Zp.useMemo)(()=>a.filter(e=>(e.views??0)>0).sort((e,t)=>(t.views??0)-(e.views??0)).slice(0,Qp),[a]),T=!w&&C&&(s?.recording?.wf_microphone_strategy??`prompt`)===`prompt`&&(s?.recording?.backend===`wf-recorder`||u.backend===`wf-recorder`),re=async(e,t,n,a)=>{h(e);try{let e=await r(t);e.applied===!1&&e.warning?i({kind:`error`,title:N(`home.savedNotApplied`),detail:e.warning,tone:`error`,holdMs:8e3}):n(e),e.restart_required&&y(!0)}catch(e){i({kind:`error`,title:a,detail:e.message,tone:`error`,holdMs:7e3})}finally{h(null)}},E=(e,t)=>re(`mic`,{recording:{capture_microphone:e,...t?{wf_microphone_strategy:t}:{}}},()=>i({kind:`info`,title:N(e?`home.micOn`:`home.micOff`),detail:N(e?`home.micOnDetail`:`home.micOffDetail`),tone:`accent`,holdMs:3e3}),N(`home.errMic`)),D=async()=>{if(!c){i({kind:`error`,title:N(`home.enablePublicLinkFirst`),tone:`error`,holdMs:4e3});return}await ml(c)?i({kind:`info`,title:N(`home.publicLinkCopied`),tone:`accent`,holdMs:3e3}):_(c)},ie=()=>{W.triggerClip().catch(e=>i({kind:`error`,title:N(`home.errSaveClip`),detail:e.message,tone:`error`,holdMs:7e3}))},ae=(0,Z.jsx)(Vp,{label:N(`home.microphone`),detail:N(w?`home.on`:`home.off`),on:w,busy:m===`mic`,icon:(0,Z.jsx)(nm,{}),onToggle:()=>{T?x(!0):E(!w)}}),O=(0,Z.jsx)(Vp,{label:N(`home.desktopAudio`),detail:N(C?`home.on`:`home.off`),on:C,busy:m===`audio`,icon:(0,Z.jsx)(rm,{}),onToggle:()=>void re(`audio`,{recording:{capture_audio:!C}},()=>i({kind:`info`,title:N(C?`home.desktopAudioOff`:`home.desktopAudioOn`),tone:`accent`,holdMs:3e3}),N(`home.errDesktopAudio`))}),oe=(0,Z.jsx)(Vp,{label:N(`home.publicLink`),detail:N(ee?c?`home.active`:`home.starting`:`home.off`),on:ee,busy:m===`tunnel`,icon:(0,Z.jsx)(im,{}),onToggle:()=>void re(`tunnel`,{sharing:{cloudflare_tunnel:!ee}},()=>i({kind:`info`,title:N(ee?`home.publicLinkStopped`:`home.publicLinkStarting`),tone:`accent`,holdMs:3500}),N(`home.errPublicLink`))}),k=(0,Z.jsxs)(`button`,{type:`button`,className:`tile tile-readout`,onClick:D,disabled:!c,"aria-label":N(c?`home.copyPublicLink`:`home.noPublicLinkYet`),children:[(0,Z.jsx)(`span`,{className:`tile-badge`,"aria-hidden":`true`,children:(0,Z.jsx)(em,{})}),(0,Z.jsxs)(`span`,{className:`tile-text`,children:[(0,Z.jsx)(`b`,{children:c?Gp(c):N(ee?`home.connecting`:`home.localOnly`)}),(0,Z.jsx)(`span`,{className:`tile-mono`,children:N(c?`home.tapToCopy`:ee?`home.cloudflaredStarting`:`home.linksWorkOnNetwork`)})]})]}),A=(0,Z.jsx)(Hp,{label:N(`home.allClips`),icon:(0,Z.jsx)(Ol,{size:19}),onClick:()=>t({type:`setView`,view:`clips`,playlistId:null})}),se=(0,Z.jsx)(Hp,{label:N(`home.settings`),icon:(0,Z.jsx)(jl,{size:19}),onClick:()=>t({type:`setView`,view:`settings`})});return(0,Z.jsx)(`div`,{className:`home-layout`,children:(0,Z.jsxs)(`div`,{className:`home-columns`,children:[(0,Z.jsxs)(`div`,{className:`home`,children:[(0,Z.jsxs)(`header`,{className:`home-hero`,children:[(0,Z.jsx)(`h1`,{children:Kp()}),(0,Z.jsx)(`p`,{children:Ur(`home.lede`,{duration:(0,Z.jsx)(`b`,{children:Ic(S,!0)},`d`),hotkey:(0,Z.jsx)(`kbd`,{children:n},`k`)})})]}),p===`rail`?null:(0,Z.jsxs)(`section`,{className:`tiles`,"aria-label":N(`home.quickSettings`),children:[(0,Z.jsxs)(`div`,{className:`tile-row tile-row-2`,children:[ae,O]}),(0,Z.jsxs)(`div`,{className:`tile-row tile-row-2`,children:[oe,k]}),(0,Z.jsxs)(`div`,{className:`tile-row tile-row-3`,children:[(0,Z.jsx)(Hp,{label:N(`home.saveClipNow`),icon:(0,Z.jsx)(am,{}),onClick:ie}),A,se]})]}),(0,Z.jsx)(Xp,{title:N(`home.recentClips`),action:{label:N(`home.seeAll`),onClick:()=>t({type:`setView`,view:`clips`,playlistId:null})},clips:te,recentNew:l,actions:d,empty:N(`home.emptyReel`,{hotkey:n})}),o.length>0?(0,Z.jsxs)(`section`,{className:`home-section`,children:[(0,Z.jsx)(`div`,{className:`home-section-head`,children:(0,Z.jsx)(`h2`,{children:N(`home.playlists`)})}),(0,Z.jsx)(`div`,{className:`playlist-row`,children:o.map(e=>(0,Z.jsx)(Yp,{playlist:e,onOpen:()=>t({type:`setView`,view:`clips`,playlistId:e.id}),onDone:(e,t)=>i({kind:t===`error`?`error`:`info`,title:e,tone:t,holdMs:t===`error`?7e3:3e3})},e.id))})]}):null,ne.length>0?(0,Z.jsx)(Xp,{title:N(`home.mostViewed`),clips:ne,recentNew:l,actions:d}):null,(0,Z.jsxs)(Wf,{children:[f,(0,Z.jsxs)(ql,{open:b,title:N(`home.wfMicTitle`),onClose:()=>x(!1),children:[(0,Z.jsx)(`p`,{children:N(`home.wfMicBody`)}),(0,Z.jsxs)(`div`,{className:`choice-list`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{x(!1),E(!0,`backend_fallback`)},children:[(0,Z.jsx)(`b`,{children:N(`home.wfMicBothLabel`)}),(0,Z.jsx)(`span`,{children:N(`home.wfMicBothHelp`)})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{x(!1),E(!0,`mic_only`)},children:[(0,Z.jsx)(`b`,{children:N(`home.wfMicOnlyLabel`)}),(0,Z.jsx)(`span`,{children:N(`home.wfMicOnlyHelp`)})]})]})]}),(0,Z.jsxs)(ql,{open:g!==null,title:N(`home.copyLinkTitle`),onClose:()=>_(null),children:[(0,Z.jsx)(`p`,{children:N(`home.copyLinkBody`)}),(0,Z.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:g??``,rows:3})]}),(0,Z.jsx)(ql,{open:v,title:N(`home.restartTitle`),onClose:()=>y(!1),footer:(0,Z.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>y(!1),children:N(`home.gotIt`)}),children:(0,Z.jsx)(`p`,{children:N(`home.restartBody`)})})]})]}),(0,Z.jsx)(yp,{}),p===`rail`?(0,Z.jsxs)(`aside`,{className:`home-rail`,"aria-label":N(`home.quickSettings`),children:[(0,Z.jsx)(`h2`,{children:N(`home.quickSettings`)}),(0,Z.jsxs)(`button`,{type:`button`,className:`rail-save`,onClick:ie,children:[(0,Z.jsxs)(`span`,{className:`rail-save-burst`,"aria-hidden":`true`,children:[(0,Z.jsx)(`svg`,{viewBox:`0 0 100 100`,children:(0,Z.jsx)(`path`,{d:$p})}),(0,Z.jsx)(am,{size:40,weight:1.4})]}),(0,Z.jsx)(`span`,{className:`rail-save-label`,children:N(`home.saveClipNow`)}),(0,Z.jsx)(`kbd`,{children:n})]}),(0,Z.jsxs)(`div`,{className:`rail-pair`,children:[ae,O]}),(0,Z.jsxs)(`div`,{className:`rail-group`,children:[oe,k]}),(0,Z.jsxs)(`div`,{className:`rail-group rail-nav`,children:[A,se]}),(0,Z.jsx)(Jp,{})]}):null]})})}function Jp(){let{state:e}=ol(),t=e.status.disk,n=(0,Zp.useMemo)(()=>e.clips.reduce((e,t)=>e+(t.size??0),0)+e.images.reduce((e,t)=>e+(t.size??0),0),[e.clips,e.images]),r=t?.total??0,i=t?.free??0,a=Math.max(0,r-i),o=e.clips[0]?.created_at;return(0,Z.jsxs)(`section`,{className:`rail-storage`,"aria-label":N(`home.storage`),children:[r>0?(0,Z.jsxs)(`div`,{className:`rail-meter`,role:`img`,"aria-label":N(`home.diskBar`,{used:Rc(a),total:Rc(r),library:Rc(n)}),children:[(0,Z.jsx)(`span`,{className:`rail-meter-fill`,style:{width:`${a/r*100}%`}}),(0,Z.jsx)(`span`,{className:`rail-meter-vice`,style:{width:`${Math.min(n,r)/r*100}%`}})]}):null,(0,Z.jsxs)(`dl`,{className:`rail-stats`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:N(`home.diskFree`)}),(0,Z.jsx)(`dd`,{children:r>0?Rc(i):N(`home.diskUnknown`)})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:N(`home.diskLibrary`)}),(0,Z.jsx)(`dd`,{children:Rc(n)})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:N(`home.lastClip`)}),(0,Z.jsx)(`dd`,{children:o?Bc(o):N(`home.lastClipNever`)})]})]})]})}function Yp({playlist:e,onOpen:t,onDone:n}){let r=tf(e,n),i=e.clip_slugs.length;return(0,Z.jsxs)(`button`,{type:`button`,className:`playlist-chip`,"data-drop-over":r.over||void 0,"data-received":r.caught||void 0,style:e.color1?{"--chip":e.color1}:void 0,onClick:t,...r.props,children:[(0,Z.jsx)(`span`,{className:`playlist-chip-mark`,"aria-hidden":`true`,children:e.emoji||(0,Z.jsx)(Rl,{size:15})}),(0,Z.jsxs)(`span`,{className:`playlist-chip-text`,children:[(0,Z.jsx)(`b`,{children:e.name}),(0,Z.jsx)(`span`,{children:N(`clips.countClips`,{count:i})})]})]})}function Xp({title:e,clips:t,recentNew:n,actions:r,action:i,empty:a}){return(0,Z.jsxs)(`section`,{className:`home-section`,children:[(0,Z.jsxs)(`div`,{className:`home-section-head`,children:[(0,Z.jsx)(`h2`,{children:e}),i?(0,Z.jsx)(`button`,{type:`button`,className:`section-link`,onClick:i.onClick,children:i.label}):null]}),t.length===0&&a?(0,Z.jsx)(`p`,{className:`home-empty`,children:a}):(0,Z.jsx)(`div`,{className:`clip-row`,children:t.map(e=>(0,Z.jsx)(Op,{clip:e,draggable:!0,isNew:n.includes(e.slug),actions:r},e.slug))})]})}var Zp,Z,Qp,$p,em,tm,nm,rm,im,am,om=o((()=>{Zp=l(d()),pl(),$u(),Hf(),Dp(),Yf(),of(),jc(),hl(),Vc(),P(),Bp(),Wp(),Xl(),Kl(),Z=M(),Qp=8,$p=(()=>{let e=[];for(let t=0;t<96;t++){let n=t/96*Math.PI*2,r=46+4*Math.cos(n*12);e.push(`${(50+r*Math.cos(n)).toFixed(2)} ${(50+r*Math.sin(n)).toFixed(2)}`)}return`M${e.join(`L`)}Z`})(),em=()=>(0,Z.jsxs)(`svg`,{...tm,width:19,height:19,viewBox:`0 0 24 24`,children:[(0,Z.jsx)(`path`,{d:`M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1`}),(0,Z.jsx)(`path`,{d:`M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1`})]}),tm={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},nm=()=>(0,Z.jsxs)(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,...tm,"aria-hidden":`true`,children:[(0,Z.jsx)(`rect`,{x:`9`,y:`2`,width:`6`,height:`12`,rx:`3`}),(0,Z.jsx)(`path`,{d:`M5 11a7 7 0 0 0 14 0M12 18v4`})]}),rm=()=>(0,Z.jsxs)(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,...tm,"aria-hidden":`true`,children:[(0,Z.jsx)(`path`,{d:`M4 9v6h4l5 4V5L8 9H4z`}),(0,Z.jsx)(`path`,{d:`M17 8.5a5 5 0 0 1 0 7`})]}),im=()=>(0,Z.jsxs)(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,...tm,"aria-hidden":`true`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,Z.jsx)(`path`,{d:`M3 12h18M12 3a15 15 0 0 1 0 18a15 15 0 0 1 0-18`})]}),am=({size:e=19,weight:t=2}={})=>(0,Z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...tm,strokeWidth:t,"aria-hidden":`true`,children:[(0,Z.jsx)(`path`,{d:`M5 3h11l3 3v15H5z`}),(0,Z.jsx)(`path`,{d:`M9 3v6h6`})]})}));function sm(){let{state:e,dispatch:t,visibleClips:n,visibleImages:r,hotkey:i,notify:a,refreshPlaylists:o}=ol(),{playlists:s,currentPlaylistId:c,searchQuery:l,recentNew:u,status:d,config:f}=e,p=c?s.find(e=>e.id===c)??null:null,{actions:m,overlays:h}=Xu(),g=p?r:[],{actions:_,overlays:v}=ip(),[y,b]=(0,cm.useState)(null),[x,S]=(0,cm.useState)(!1),[C,w]=(0,cm.useState)(null),ee=e=>t=>a({kind:`error`,title:e,detail:t.message,tone:`error`,holdMs:7e3}),te=async e=>{if(y===`edit`&&p){let t=await W.updatePlaylist(p.id,e);if(t.ok===!1)throw Error(t.error||N(`clips.errUpdatePlaylist`));await o(),a({kind:`info`,title:N(`clips.playlistUpdated`),tone:`accent`,holdMs:3e3})}else{let n=await W.createPlaylist(e);if(n.ok===!1)throw Error(n.error||N(`clips.errCreatePlaylist`));await o(),t({type:`setView`,view:`clips`,playlistId:n.playlist.id}),a({kind:`info`,title:N(`clips.playlistCreated`,{name:e.name}),tone:`accent`,holdMs:3500})}b(null)},ne=p?p.name:N(`clips.allClips`),T=n.length,re=l.trim(),E=re?N(`clips.countMatches`,{count:T,query:re}):N(`clips.countClips`,{count:T}),D=T===0&&g.length===0,ie=p?.kind===`auto`;return(0,lm.jsxs)(`div`,{className:`clips`,children:[(0,lm.jsxs)(`header`,{className:`clips-head`,children:[(0,lm.jsxs)(`div`,{className:`clips-title`,children:[(0,lm.jsxs)(`h1`,{children:[p?.emoji?(0,lm.jsx)(`span`,{className:`clips-emoji`,children:p.emoji}):null,ne]}),(0,lm.jsx)(`p`,{children:E})]}),(0,lm.jsxs)(`div`,{className:`clips-tools`,children:[p?(0,lm.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-icon-only`,title:N(`clips.playlistOptions`),"aria-label":N(`clips.playlistOptions`),onClick:e=>{let t=e.currentTarget.getBoundingClientRect();w({x:t.right-200,y:t.bottom+6})},children:(0,lm.jsx)(Ul,{size:16})}):null,(0,lm.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>b(`new`),children:N(`clips.newPlaylist`)}),(0,lm.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void W.triggerClip().catch(ee(N(`clips.errSaveClip`))),children:N(`clips.saveClip`)})]})]}),d.hotkeys_available===!1?(0,lm.jsxs)(`div`,{className:`banner`,"data-tone":`warning`,role:`status`,children:[(0,lm.jsx)(Pl,{size:17,className:`banner-icon`}),(0,lm.jsxs)(`div`,{className:`banner-text`,children:[(0,lm.jsx)(`strong`,{children:N(`clips.hotkeysUnavailableTitle`)}),(0,lm.jsx)(`span`,{children:N(`clips.hotkeysUnavailableBody`,{hotkey:i})})]})]}):null,D?(0,lm.jsx)(`p`,{className:`home-empty`,children:re?N(`clips.emptySearch`,{query:re}):p?N(`clips.emptyPlaylist`):N(`clips.emptyLibrary`,{hotkey:i,duration:f?.recording?.clip_duration??20})}):null,T>0?(0,lm.jsx)(`div`,{className:`clip-grid`,children:n.map(e=>(0,lm.jsx)(Op,{clip:e,draggable:!0,isNew:u.includes(e.slug),actions:m},e.slug))}):null,g.length>0?(0,lm.jsxs)(lm.Fragment,{children:[(0,lm.jsx)(`h2`,{className:`clips-section`,children:N(`clips.imagesHeading`,{count:g.length})}),(0,lm.jsx)(`div`,{className:`clip-grid`,children:g.map(e=>(0,lm.jsx)(cp,{image:e,draggable:!0,actions:_},e.slug))})]}):null,C&&p?(0,lm.jsx)(Gu,{at:C,heading:p.name,emptyLabel:N(`common.noActions`),onClose:()=>w(null),items:[{id:`edit`,label:N(`clips.editPlaylist`),onSelect:()=>b(`edit`)},{id:`delete`,label:N(`clips.deletePlaylist`),danger:!0,onSelect:()=>S(!0)}]}):null,(0,lm.jsx)(sf,{open:y!==null,editing:y===`edit`?p:null,onClose:()=>b(null),onSubmit:te}),(0,lm.jsx)(ql,{open:x,title:N(`clips.confirmDeleteTitle`),onClose:()=>S(!1),footer:(0,lm.jsxs)(lm.Fragment,{children:[(0,lm.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>S(!1),children:N(`common.keepIt`)}),(0,lm.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{S(!1),p&&W.deletePlaylist(p.id).then(async()=>{await o(),t({type:`setView`,view:`clips`,playlistId:null}),a({kind:`info`,title:N(`clips.playlistDeleted`),tone:`neutral`,holdMs:3e3})}).catch(ee(N(`clips.errDeletePlaylist`)))},children:N(`common.delete`)})]}),children:(0,lm.jsxs)(`p`,{children:[N(`clips.confirmDeleteBody`),ie?N(`clips.confirmDeleteAuto`):``]})}),h,v]})}var cm,lm,um=o((()=>{cm=l(d()),pl(),$u(),sp(),jc(),P(),Bp(),_p(),Ju(),ff(),Xl(),Kl(),lm=M()}));function dm(){let{state:e,visibleImages:t}=ol(),{searchQuery:n,config:r}=e,{actions:i,overlays:a}=ip(),o=t.length,s=n.trim(),c=r?.hotkeys?.screenshot||``;return(0,fm.jsxs)(`div`,{className:`clips`,children:[(0,fm.jsx)(`header`,{className:`clips-head`,children:(0,fm.jsxs)(`div`,{className:`clips-title`,children:[(0,fm.jsx)(`h1`,{children:N(`images.heading`)}),(0,fm.jsx)(`p`,{children:s?N(`images.countMatches`,{count:o,query:s}):N(`images.countImages`,{count:o})})]})}),o===0?(0,fm.jsx)(`p`,{className:`home-empty`,children:s?N(`images.emptySearch`,{query:s}):c?N(`images.emptyLibrary`,{hotkey:zc(c)}):N(`images.emptyNoKey`)}):(0,fm.jsx)(`div`,{className:`clip-grid`,children:t.map(e=>(0,fm.jsx)(cp,{image:e,draggable:!0,actions:i},e.slug))}),a]})}var fm,pm=o((()=>{pl(),sp(),P(),Vc(),_p(),fm=M()}));function mm(e){return typeof e==`string`&&Cm.includes(e)}function hm(e){return Em.add(e),()=>Em.delete(e)}function gm(e){return e===`reduced`?!0:e===`full`?!1:qc||wm===`reduced`}function _m(e){return e===`auto`?N(qc?`settings.effectsSoftware`:wm===`reduced`?`settings.effectsSlow`:wm===`full`?`settings.effectsKeepingUp`:`settings.effectsMeasuring`):``}function vm(e){document.documentElement.classList.toggle(`perf-low`,gm(e)),e===`auto`&&wm===null&&ym()}function ym(){if(Tm||qc)return;Tm=!0,document.documentElement.classList.remove(`perf-low`);let e=[],t=0,n=Sm,r=i=>{if(n>0){n--,t=i,requestAnimationFrame(r);return}if(t&&e.push(i-t),t=i,e.lengthe-t);let a=e[e.length>>1];wm=a>bm?`reduced`:`full`,Tm=!1,console.debug(`compositor probe: median frame ${a.toFixed(1)}ms, effects ${wm}`),Em.forEach(e=>e())};requestAnimationFrame(r)}var bm,xm,Sm,Cm,wm,Tm,Em,Dm=o((()=>{Xc(),P(),bm=42,xm=48,Sm=4,Cm=[`auto`,`full`,`reduced`],wm=null,Tm=!1,Em=new Set}));function Om(e){let t=e.recording??{},n=e.hotkeys??{},r=e.output??{},i=e.sharing??{},a=e.discord??{},o=e.updates??{},s=e.notifications??{},c=e.ui??{},l=Wm(t.resolution,``),u=Rm.some(([e])=>e===l);return{bufferDuration:Um(t.buffer_duration,120),clipDuration:Um(t.clip_duration,20),fps:String(Um(t.fps,60)),resolution:u?l:`custom`,customResolution:u?``:l,container:Wm(t.container,`mp4`),encoder:Wm(t.encoder,`auto`),colorDepth:String(t.color_depth??`8`),backend:Wm(t.backend,`auto`),replayStorage:Wm(t.gsr_replay_storage,`auto`),display:Wm(t.display,``),followMouse:!!t.follow_mouse_display,hardwareDecode:!!c.hardware_video_decode,captureAudio:t.capture_audio!==!1,captureMic:!!t.capture_microphone,desktopSource:Wm(t.gsr_audio_source,`default_output`),micSource:Wm(t.microphone_source,`default_input`),micMono:!!t.microphone_mono,desktopVolume:Math.round(Um(t.desktop_volume,1)*100),micVolume:Math.round(Um(t.microphone_volume,1)*100),notifyVolume:Math.round(Um(s.sound_volume,1)*100),sounds:Object.fromEntries(Lm.map(([e])=>[e,Wm(s[e],``)])),audioTracks:Array.isArray(t.audio_tracks)?t.audio_tracks.map(String):[],mixFirstTrack:!!t.audio_tracks_mix_first,wfMicStrategy:Wm(t.wf_microphone_strategy,`prompt`),clipKey:Wm(n.clip,`KEY_F9`),screenshotKey:Wm(n.screenshot,``),clipPresets:(Array.isArray(n.clip_presets)?n.clip_presets:[]).map(e=>{let t=e??{};return{uid:Bm(),key:Wm(t.key,``),duration:Um(t.duration,60)}}),hotkeyBlocklist:(Array.isArray(n.disable_while_focused)?n.disable_while_focused:[]).join(` +`),directory:Wm(r.directory,``),imageDirectory:Wm(r.image_directory,``),tagWithGame:r.tag_clips_with_game!==!1,autoPlaylist:r.auto_playlist_by_game!==!1,clipNameTemplate:Wm(r.clip_name_template,``),port:Um(i.port,8765),cloudflareTunnel:i.cloudflare_tunnel!==!1,discordEnabled:!!a.enabled,discordClientId:Wm(a.client_id_override,``),discordCustomGames:(Array.isArray(a.custom_games)?a.custom_games:[]).map(e=>{let t=e??{};return`${t.name??``} | ${(t.matches??[]).join(`, `)}`}).join(` +`),gsrArgs:Wm(t.gsr_args,``),checkForUpdates:o.check_on_start!==!1}}function km(e){if(e.resolution!==`custom`)return e.resolution||null;let t=e.customResolution.trim().toLowerCase().replace(`×`,`x`);return t?/^\d{2,5}x\d{2,5}$/.test(t)?t:!1:null}function Am(e){let t=Math.max(e.clipDuration,...e.clipPresets.map(e=>Number(e.duration)||0));return Math.max(e.bufferDuration,t)}function jm(e){let t=km(e);return{recording:{buffer_duration:Am(e),clip_duration:e.clipDuration,fps:Number(e.fps),display:e.display||null,follow_mouse_display:e.followMouse,resolution:t===!1?null:t,container:e.container,encoder:e.encoder,color_depth:e.colorDepth,backend:e.backend,capture_audio:e.captureAudio,gsr_replay_storage:e.replayStorage,capture_microphone:e.captureMic,microphone_source:e.micSource||`default_input`,microphone_mono:e.micMono,desktop_volume:e.desktopVolume/100,microphone_volume:e.micVolume/100,wf_microphone_strategy:e.wfMicStrategy,gsr_audio_source:e.desktopSource||`default_output`,audio_tracks:[...e.audioTracks],audio_tracks_mix_first:e.mixFirstTrack,gsr_args:e.gsrArgs.trim()},hotkeys:{clip:e.clipKey,screenshot:e.screenshotKey.trim(),clip_presets:e.clipPresets.map(e=>({key:e.key.trim(),duration:Number(e.duration)||60})).filter(e=>e.key||e.duration),disable_while_focused:Hm(e.hotkeyBlocklist)},output:{directory:e.directory,image_directory:e.imageDirectory,tag_clips_with_game:e.tagWithGame,auto_playlist_by_game:e.autoPlaylist,clip_name_template:e.clipNameTemplate.trim()},sharing:{port:Number(e.port),cloudflare_tunnel:e.cloudflareTunnel},updates:{check_on_start:e.checkForUpdates},notifications:{sound_volume:e.notifyVolume/100,...Object.fromEntries(Lm.map(([t])=>[t,e.sounds[t]?.trim()||null]))},ui:{hardware_video_decode:e.hardwareDecode},discord:{enabled:e.discordEnabled,client_id_override:e.discordClientId.trim()||null,custom_games:Mm(e.discordCustomGames)}}}function Mm(e){let t=[];for(let n of(e||``).split(` +`)){let e=n.trim();if(!e)continue;let[r,i=``]=e.split(`|`),a=(r||``).trim(),o=i.split(`,`).map(e=>e.trim()).filter(Boolean);!a||o.length===0||t.push({name:a,matches:o})}return t}function Nm(e,t,n,r){let i=e=>String(e).padStart(2,`0`),a=(e,t,n)=>e.split(t).join(n),o=a(e,`$n`,String(t));return o=a(o,`$date`,`${r.getFullYear()}-${i(r.getMonth()+1)}-${i(r.getDate())}`),o=a(o,`$time`,i(r.getHours())+i(r.getMinutes())),o=a(o,`$game`,n||``),o.replace(/[/\\\x00-\x1f]/g,``).replace(/[_-]{2,}/g,e=>e[0]).replace(/^[_\-. ]+|[_\-. ]+$/g,``)}function Pm(e){let t=e.replayStorage===`ram`||e.replayStorage===`auto`&&e.bufferDuration<=600;if(t&&e.bufferDuration>600){let t=(e.bufferDuration*1.5/1024).toFixed(1);return{text:N(`settings.bufferRamWarning`,{length:Lc(e.bufferDuration),gb:t}),tone:`warning`}}return t?{text:N(`settings.bufferPlain`),tone:`plain`}:{text:N(`settings.bufferOnDisk`),tone:`plain`}}function Fm(e){let t=(e||``).trim();return t===`default_output`?`monitor`:t===`default_input`?`input`:t.startsWith(`app:`)||t.startsWith(`app-inverse:`)?`app`:t.startsWith(`device:`)?t.endsWith(`.monitor`)?`monitor`:`input`:`unknown`}function Im(e){let t=[],n=[];for(let r of e){let e=String(r).split(`|`).filter(Boolean),i=e.filter(e=>Fm(e)===`input`);i.length?i.length!==e.length&&n.push(r):t.push(r)}return{dropped:t,trimmed:n}}var Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm=o((()=>{Vc(),P(),Lm=[[`clip_sound`,`settings.soundClip`,`~/sounds/clip.wav`],[`clip_failed_sound`,`settings.soundClipFailed`,`~/sounds/failed.wav`],[`session_start_sound`,`settings.soundSessionStart`,`~/sounds/start.wav`],[`session_end_sound`,`settings.soundSessionEnd`,`~/sounds/stop.wav`],[`highlight_sound`,`settings.soundHighlight`,`~/sounds/highlight.wav`],[`screenshot_sound`,`settings.soundScreenshot`,`~/sounds/shutter.wav`]],Rm=[[``,`Auto`],[`960x540`,`960x540 (540p)`],[`1280x720`,`1280x720 (720p)`],[`1920x1080`,`1920x1080 (1080p)`],[`2560x1440`,`2560x1440 (1440p)`],[`3840x2160`,`3840x2160 (4K)`]],zm=0,Bm=()=>`preset-${++zm}`,Vm=()=>({uid:Bm(),key:``,duration:60}),Hm=e=>e.split(` +`).map(e=>e.trim()).filter(Boolean),Um=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,Wm=(e,t)=>typeof e==`string`&&e?e:t}));function Km({tracks:e,sources:t,mixFirst:n,desktopAudioOn:r,pick:i,onPickChange:a,onChange:o,onRefresh:s,refreshing:c,onDuplicate:l}){let u=e=>t.find(t=>t.id===e)?.label||e,d=()=>{if(i){if(e.includes(i)){l();return}o([...e,i])}},f=(t,n)=>{let r=t+n;if(r<0||r>=e.length)return;let i=[...e];[i[t],i[r]]=[i[r],i[t]],o(i)},p=n&&e.length>1,m=p?2:1,{dropped:h,trimmed:g}=Im(e),_=!r&&(h.length>0||g.length>0);return(0,qm.jsxs)(`div`,{className:`tracks`,children:[(0,qm.jsxs)(`div`,{className:`tracks-add`,children:[(0,qm.jsx)(`div`,{className:`select-wrap`,children:(0,qm.jsx)(`select`,{className:`select`,value:i,"aria-label":N(`audioTracks.sourceToAdd`),onChange:e=>a(e.target.value),children:t.map(e=>(0,qm.jsx)(`option`,{value:e.id,children:e.label||e.id},e.id))})}),(0,qm.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:d,disabled:!i,children:N(`audioTracks.addTrack`)}),(0,qm.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm btn-icon`,title:N(`audioTracks.refresh`),"aria-label":N(`audioTracks.refresh`),disabled:c,onClick:s,children:(0,qm.jsx)(Jm,{spinning:c})})]}),e.length===0?(0,qm.jsx)(`p`,{className:`tracks-empty`,children:N(`audioTracks.none`)}):(0,qm.jsxs)(`div`,{className:`track-list`,children:[p?(0,qm.jsxs)(`span`,{className:`track track-mix`,children:[(0,qm.jsx)(`span`,{className:`track-num`,children:`1`}),(0,qm.jsx)(`span`,{className:`track-id`,children:N(`audioTracks.mixOfAll`)})]}):null,e.map((t,n)=>(0,qm.jsxs)(`span`,{className:`track`,title:t,children:[(0,qm.jsx)(`span`,{className:`track-num`,children:n+m}),(0,qm.jsx)(`span`,{className:`track-id`,children:u(t)}),(0,qm.jsx)(`button`,{type:`button`,className:`track-btn`,title:N(`audioTracks.moveEarlier`),"aria-label":N(`audioTracks.moveEarlierAria`,{name:u(t)}),disabled:n===0,onClick:()=>f(n,-1),children:(0,qm.jsx)(Ym,{dir:`up`})}),(0,qm.jsx)(`button`,{type:`button`,className:`track-btn`,title:N(`audioTracks.moveLater`),"aria-label":N(`audioTracks.moveLaterAria`,{name:u(t)}),disabled:n===e.length-1,onClick:()=>f(n,1),children:(0,qm.jsx)(Ym,{dir:`down`})}),(0,qm.jsx)(`button`,{type:`button`,className:`track-btn track-btn-remove`,title:N(`audioTracks.removeTrack`),"aria-label":N(`audioTracks.removeAria`,{name:u(t)}),onClick:()=>o(e.filter((e,t)=>t!==n)),children:(0,qm.jsx)(Fl,{size:11})})]},`${t}-${n}`))]}),_?(0,qm.jsxs)(`p`,{className:`tracks-warning`,role:`status`,children:[h.length?`${N(`audioTracks.droppedWarning`,{count:h.length,list:h.map(u).join(`, `)})} `:``,g.length?`${N(`audioTracks.trimmedWarning`,{count:g.length})} `:``,N(`audioTracks.turnBackOn`)]}):null]})}var qm,Jm,Ym,Xm=o((()=>{Kl(),Gm(),P(),qm=M(),Jm=({spinning:e})=>(0,qm.jsxs)(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:e?`spin`:void 0,"aria-hidden":`true`,children:[(0,qm.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,qm.jsx)(`path`,{d:`M21 3v5h-5`}),(0,qm.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,qm.jsx)(`path`,{d:`M8 16H3v5`})]}),Ym=({dir:e})=>(0,qm.jsx)(`svg`,{width:11,height:11,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,qm.jsx)(`path`,{d:e===`up`?`M12 19V5M6 11l6-6 6 6`:`M12 5v14M6 13l6 6 6-6`})})}));function Zm(){let{state:e,saveConfig:t,notify:n}=ol(),{choose:r,chooseCustom:i,seed:a}=hd(),[o,s]=(0,lh.useState)(!1),c=a?bc(a).ramp.base:null,{config:l,accent:u,status:d}=e,[f,p]=(0,lh.useState)(null),[m,h]=(0,lh.useState)(``),[g,_]=(0,lh.useState)({displays:[],warning:null}),[v,y]=(0,lh.useState)({sources:[]}),[b,x]=(0,lh.useState)(``),[S,C]=(0,lh.useState)(!1),[w,ee]=(0,lh.useState)(!1),[te,ne]=(0,lh.useState)(`recording`),[T,re]=(0,lh.useState)(!1),[E,D]=(0,lh.useState)(!1),[ie,ae]=(0,lh.useState)(`auto`),[,O]=(0,lh.useState)(0),[oe,k]=(0,lh.useState)(!1),A=(0,lh.useRef)(null),se=(0,lh.useRef)(new Map),ce=(0,lh.useRef)(null),j=(0,lh.useCallback)(e=>p(t=>t&&{...t,...e}),[]);(0,lh.useEffect)(()=>{if(!l||f)return;let e=Om(l);p(e),h(JSON.stringify(jm(e)))},[l,f]),(0,lh.useEffect)(()=>(W.getAppState().then(e=>{let t=mm(e.effects_mode)?e.effects_mode:`auto`;ae(t),vm(t)}).catch(()=>vm(`auto`)),hm(()=>O(e=>e+1))),[]);let le=(0,lh.useCallback)(async e=>{try{let t=await W.displays(e||`auto`);_(t)}catch{_({displays:[],warning:N(`settings.displayLoadFailed`)})}},[]),ue=(0,lh.useCallback)(async()=>{try{let e=await W.audioSources();y(e),x(t=>t||e.sources[0]?.id||``)}catch{y({sources:[{id:`default_output`,label:N(`settings.defaultOutput`)}],warning:N(`settings.sourceLoadFailed`)})}},[]);(0,lh.useEffect)(()=>{f&&le(f.backend)},[f?.backend,le]),(0,lh.useEffect)(()=>{ue()},[ue]),(0,lh.useEffect)(()=>{let e=A.current;if(!e||!f)return;let t=()=>{if(ce.current)return;let t=e.getBoundingClientRect().top+96,n=uh[0][0];for(let[e]of uh){let r=se.current.get(e);r&&r.getBoundingClientRect().top<=t&&(n=e)}ne(n)};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>e.removeEventListener(`scroll`,t)},[f]);let de=e=>{ne(e),ce.current=e,se.current.get(e)?.scrollIntoView({behavior:`smooth`,block:`start`}),window.setTimeout(()=>{ce.current=null},600)},fe=(0,lh.useMemo)(()=>f?JSON.stringify(jm(f))!==m:!1,[f,m]);if((0,lh.useEffect)(()=>{if(!fe)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[fe]),!f)return(0,Q.jsx)(`div`,{className:`settings`,children:(0,Q.jsx)(`p`,{className:`home-empty`,children:N(`settings.loading`)})});let pe=(e,t)=>n({kind:`error`,title:e,detail:t?.message,tone:`error`,holdMs:7e3}),me=(e,t)=>n({kind:`info`,title:e,detail:t,tone:`accent`,holdMs:3500}),he=async(e,r,i)=>{try{let i=await t(e);i.applied===!1&&i.warning?n({kind:`error`,title:N(`settings.savedNotApplied`),detail:i.warning,tone:`error`,holdMs:8e3}):r(),h(t=>{let n={...JSON.parse(t)};for(let[t,r]of Object.entries(e))n[t]={...n[t]??{},...r};return JSON.stringify(n)})}catch(e){pe(i,e)}},ge=!f.captureMic&&f.captureAudio&&f.wfMicStrategy===`prompt`&&(f.backend===`wf-recorder`||d.backend===`wf-recorder`),_e=async(e,t)=>{j({captureMic:e,...t?{wfMicStrategy:t}:{}}),await he({recording:{capture_microphone:e,...t?{wf_microphone_strategy:t}:{}}},()=>me(N(e?`settings.micOn`:`settings.micOff`),N(e?`settings.micOnDetail`:`settings.micOffDetail`)),N(`settings.errMic`))},ve=async()=>{if(km(f)===!1){n({kind:`error`,title:N(`settings.badResolutionTitle`),detail:N(`settings.badResolutionDetail`),tone:`error`,holdMs:6e3}),de(`recording`);return}let e=Am(f),r=e!==f.bufferDuration;r&&j({bufferDuration:e});let i=jm({...f,bufferDuration:e}),a=Number(i.sharing.port)!==Number(l?.sharing?.port??8765)||!!i.sharing.cloudflare_tunnel!=(l?.sharing?.cloudflare_tunnel!==!1);ee(!0);try{let o=await t(i);o.applied===!1&&o.warning?n({kind:`error`,title:N(`settings.savedNotApplied`),detail:o.warning,tone:`error`,holdMs:9e3}):me(N(`settings.saved`),r?N(`settings.bufferRaised`,{length:Lc(e)}):void 0),o.restart_required&&a&&re(!0),h(JSON.stringify(i))}catch(e){pe(N(`settings.errSave`),e)}finally{ee(!1)}},ye=()=>{if(!l)return;let e=Om(l);p(e),h(JSON.stringify(jm(e)))},be=e=>{ae(e),vm(e),W.setAppState({effects_mode:e}).catch(e=>console.debug(`Saving the effects mode failed`,e))},xe=e=>t=>{t?se.current.set(e,t):se.current.delete(e)},Se=Pm(f),Ce=g.follow_mouse_supported!==!1;return(0,Q.jsxs)(`div`,{className:`settings`,children:[(0,Q.jsx)(`header`,{className:`settings-head`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{children:N(`settings.title`)}),(0,Q.jsx)(`p`,{children:N(`settings.subtitle`)})]})}),(0,Q.jsx)(`nav`,{className:`settings-rail`,"aria-label":N(`settings.sections`),children:uh.map(([e,t])=>(0,Q.jsx)(`button`,{type:`button`,className:`rail-chip`,"aria-current":te===e?`true`:void 0,onClick:()=>de(e),children:N(t)},e))}),(0,Q.jsxs)(`div`,{className:`settings-body`,ref:A,children:[(0,Q.jsxs)(Qm,{id:`recording`,title:N(`settings.secRecording`),register:xe(`recording`),children:[(0,Q.jsx)(J,{label:N(`settings.bufferDuration`),note:Se,children:(0,Q.jsx)(jd,{label:N(`settings.bufferDuration`),value:f.bufferDuration,min:30,max:1800,step:30,onChange:e=>j({bufferDuration:e}),format:Lc})}),(0,Q.jsx)(J,{label:N(`settings.replayStorage`),help:N(`settings.replayStorageHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.replayStorage`),value:f.replayStorage,onChange:e=>j({replayStorage:e}),options:[[`auto`,N(`settings.optAutoRecommended`)],[`ram`,N(`settings.replayRam`)],[`disk`,N(`settings.replayDisk`)]]})}),(0,Q.jsx)(J,{label:N(`settings.clipDuration`),help:N(`settings.clipDurationHelp`),children:(0,Q.jsx)(jd,{label:N(`settings.clipDuration`),value:f.clipDuration,min:5,max:1800,step:5,onChange:e=>j({clipDuration:e}),format:Lc})}),(0,Q.jsx)(J,{label:N(`settings.frameRate`),help:N(`settings.frameRateHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.frameRate`),value:f.fps,onChange:e=>j({fps:e}),options:[`24`,`30`,`50`,`60`,`120`,`144`].map(e=>[e,N(`settings.fpsOption`,{fps:e})])})}),(0,Q.jsx)(J,{label:N(`settings.resolution`),help:N(`settings.resolutionHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.resolution`),value:f.resolution,onChange:e=>j({resolution:e}),options:[...eh(),[`custom`,N(`settings.resolutionCustom`)]]})}),f.resolution===`custom`?(0,Q.jsx)(J,{label:N(`settings.customResolution`),note:km(f)===!1?{text:N(`settings.customResolutionWarn`),tone:`warning`}:null,help:N(`settings.customResolutionHelp`),children:(0,Q.jsx)(Md,{label:N(`settings.customResolution`),mono:!0,value:f.customResolution,placeholder:`1600x900`,onChange:e=>j({customResolution:e})})}):null,(0,Q.jsx)(J,{label:N(`settings.container`),help:N(`settings.containerHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.container`),value:f.container,onChange:e=>j({container:e}),options:[[`mp4`,N(`settings.containerMp4`)],[`mkv`,N(`settings.containerMkv`)]]})}),(0,Q.jsx)(J,{label:N(`settings.encoder`),help:N(`settings.encoderHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.encoder`),value:f.encoder,onChange:e=>j({encoder:e}),options:[[`auto`,N(`settings.optAutoRecommended`)],[`h264_nvenc`,N(`settings.encoderH264Nvenc`)],[`hevc_nvenc`,N(`settings.encoderHevcNvenc`)],[`h264_vaapi`,N(`settings.encoderH264Vaapi`)],[`hevc_vaapi`,N(`settings.encoderHevcVaapi`)],[`av1_nvenc`,N(`settings.encoderAv1Nvenc`)],[`av1_vaapi`,N(`settings.encoderAv1Vaapi`)],[`h264_vulkan`,N(`settings.encoderH264Vulkan`)],[`hevc_vulkan`,N(`settings.encoderHevcVulkan`)],[`av1_vulkan`,N(`settings.encoderAv1Vulkan`)],[`libx264`,N(`settings.encoderX264`)],[`libx265`,N(`settings.encoderX265`)]]})}),(0,Q.jsx)(J,{label:N(`settings.colourDepth`),help:N(`settings.colourDepthHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.colourDepth`),value:f.colorDepth,onChange:e=>j({colorDepth:e}),options:[[`8`,N(`settings.colour8`)],[`10`,N(`settings.colour10`)]]})}),(0,Q.jsx)(J,{label:N(`settings.hardwareDecode`),help:N(`settings.hardwareDecodeHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.hardwareDecode`),checked:f.hardwareDecode,onChange:e=>j({hardwareDecode:e})})}),(0,Q.jsx)(J,{label:N(`settings.backend`),help:N(`settings.backendHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.backend`),value:f.backend,onChange:e=>j({backend:e}),options:[[`auto`,N(`settings.optAutoRecommended`)],[`gsr`,`gpu-screen-recorder`],[`wf-recorder`,N(`settings.backendWf`)],[`ffmpeg`,N(`settings.backendFfmpeg`)]]})}),(0,Q.jsx)(J,{label:N(`settings.followMouse`),note:Ce?null:{text:N(`settings.followMouseUnsupported`),tone:`warning`},help:N(`settings.followMouseHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.followMouse`),checked:Ce&&f.followMouse,disabled:!Ce,onChange:e=>j({followMouse:e})})}),(0,Q.jsx)(J,{label:N(`settings.display`),note:nh(f,g),children:(0,Q.jsx)(Ad,{label:N(`settings.display`),value:f.display,disabled:f.followMouse&&Ce,onChange:e=>j({display:e}),options:th(f,g)})})]}),(0,Q.jsxs)(Qm,{id:`audio`,title:N(`settings.secAudio`),register:xe(`audio`),children:[(0,Q.jsx)(J,{label:N(`settings.captureDesktopAudio`),help:N(`settings.captureDesktopAudioHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.captureDesktopAudio`),checked:f.captureAudio,onChange:e=>j({captureAudio:e})})}),(0,Q.jsx)(J,{label:N(`settings.captureMic`),help:N(`settings.captureMicHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.captureMic`),checked:f.captureMic,onChange:e=>{e&&ge?D(!0):_e(e)}})}),(0,Q.jsx)(J,{label:N(`settings.desktopSource`),note:sh(f,v),children:(0,Q.jsx)(Ad,{label:N(`settings.desktopSource`),value:f.desktopSource,onChange:e=>j({desktopSource:e}),options:ah(f.desktopSource,v.sources)})}),(0,Q.jsx)(J,{label:N(`settings.micSource`),help:N(`settings.micSourceHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.micSource`),value:f.micSource,onChange:e=>j({micSource:e}),options:oh(f.micSource,v.sources)})}),(0,Q.jsx)(J,{label:N(`settings.micMono`),help:N(`settings.micMonoHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.micMono`),checked:f.micMono,onChange:e=>j({micMono:e})})}),f.audioTracks.length===0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(J,{label:N(`settings.desktopVolume`),help:N(`settings.desktopVolumeHelp`),children:(0,Q.jsx)(jd,{label:N(`settings.desktopVolume`),value:f.desktopVolume,min:0,max:200,step:5,onChange:e=>j({desktopVolume:e}),format:e=>`${e}%`})}),(0,Q.jsx)(J,{label:N(`settings.micVolume`),help:N(`settings.micVolumeHelp`),children:(0,Q.jsx)(jd,{label:N(`settings.micVolume`),value:f.micVolume,min:0,max:200,step:5,onChange:e=>j({micVolume:e}),format:e=>`${e}%`})})]}):null,(0,Q.jsx)(J,{label:N(`settings.notifyVolume`),help:N(`settings.notifyVolumeHelp`),children:(0,Q.jsx)(jd,{label:N(`settings.notifyVolume`),value:f.notifyVolume,min:0,max:100,step:5,onChange:e=>j({notifyVolume:e}),format:e=>e>0?`${e}%`:N(`settings.volumeOff`)})}),(0,Q.jsx)(J,{label:N(`settings.customSounds`),stack:!0,help:N(`settings.customSoundsHelp`),children:(0,Q.jsx)(Pd,{fields:Lm,values:f.sounds,onChange:(e,t)=>j({sounds:{...f.sounds,[e]:t}})})}),(0,Q.jsx)(J,{label:N(`settings.audioTracks`),stack:!0,help:N(`settings.audioTracksHelp`),children:(0,Q.jsx)(Km,{tracks:f.audioTracks,sources:v.sources,mixFirst:f.mixFirstTrack,desktopAudioOn:f.captureAudio,pick:b,onPickChange:x,onChange:e=>j({audioTracks:e}),refreshing:S,onDuplicate:()=>n({kind:`error`,title:N(`settings.duplicateTrack`),tone:`error`,holdMs:3500}),onRefresh:()=>{C(!0),ue().then(()=>me(N(`settings.sourcesRefreshed`))).finally(()=>C(!1))}})}),(0,Q.jsx)(J,{label:N(`settings.mixFirstTrack`),help:N(`settings.mixFirstTrackHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.mixFirstTrack`),checked:f.mixFirstTrack,onChange:e=>j({mixFirstTrack:e})})}),(0,Q.jsx)(J,{label:N(`settings.wfMicMode`),help:N(`settings.wfMicModeHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.wfMicMode`),value:f.wfMicStrategy,onChange:e=>j({wfMicStrategy:e}),options:[[`prompt`,N(`settings.wfMicPrompt`)],[`backend_fallback`,N(`settings.wfMicFallback`)],[`mic_only`,N(`settings.wfMicOnly`)]]})})]}),(0,Q.jsxs)(Qm,{id:`hotkeys`,title:N(`settings.secHotkeys`),register:xe(`hotkeys`),children:[(0,Q.jsx)(J,{label:N(`settings.clipKey`),note:d.hotkeys_available===!1?{text:N(`settings.hotkeysUnavailable`),tone:`warning`}:null,help:N(`settings.clipKeyHelp`),children:(0,Q.jsx)(Td,{value:f.clipKey,onUnsupported:()=>n({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3}),onCapture:e=>{j({clipKey:e}),he({hotkeys:{clip:e}},()=>me(N(`settings.clipKeyNow`,{key:e})),N(`settings.errSaveKey`))}})}),(0,Q.jsx)(J,{label:N(`settings.screenshotKey`),help:N(`settings.screenshotKeyHelp`),children:(0,Q.jsxs)(`div`,{className:`key-pair`,children:[(0,Q.jsx)(Td,{value:f.screenshotKey,onUnsupported:()=>n({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3}),onCapture:e=>{j({screenshotKey:e}),he({hotkeys:{screenshot:e}},()=>me(N(`settings.screenshotKeyNow`,{key:e})),N(`settings.errSaveKey`))}}),f.screenshotKey?(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>{j({screenshotKey:``}),he({hotkeys:{screenshot:``}},()=>me(N(`settings.screenshotKeyCleared`)),N(`settings.errSaveKey`))},children:N(`settings.clearKey`)}):null]})}),(0,Q.jsx)(J,{label:N(`settings.clipPresets`),stack:!0,help:N(`settings.clipPresetsHelp`),children:(0,Q.jsx)($m,{presets:f.clipPresets,onChange:e=>j({clipPresets:e}),onUnsupported:()=>n({kind:`error`,title:N(`settings.keyUnsupported`),tone:`error`,holdMs:4e3})})}),(0,Q.jsx)(J,{label:N(`settings.blocklist`),stack:!0,help:N(`settings.blocklistHelp`),children:(0,Q.jsx)(Nd,{label:N(`settings.blocklist`),value:f.hotkeyBlocklist,placeholder:`ggst.exe`,onChange:e=>j({hotkeyBlocklist:e})})})]}),(0,Q.jsxs)(Qm,{id:`storage`,title:N(`settings.secStorage`),register:xe(`storage`),children:[(0,Q.jsx)(J,{label:N(`settings.directory`),help:N(`settings.directoryHelp`),children:(0,Q.jsx)(Md,{label:N(`settings.directory`),wide:!0,value:f.directory,placeholder:`~/Videos/Vice`,onChange:e=>j({directory:e})})}),(0,Q.jsx)(J,{label:N(`settings.imageDirectory`),help:N(`settings.imageDirectoryHelp`),children:(0,Q.jsx)(Md,{label:N(`settings.imageDirectory`),wide:!0,value:f.imageDirectory,placeholder:`~/Pictures/Vice`,onChange:e=>j({imageDirectory:e})})}),(0,Q.jsx)(J,{label:N(`settings.tagWithGame`),help:N(`settings.tagWithGameHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.tagWithGame`),checked:f.tagWithGame,onChange:e=>j({tagWithGame:e})})}),(0,Q.jsx)(J,{label:N(`settings.autoPlaylist`),help:N(`settings.autoPlaylistHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.autoPlaylist`),checked:f.autoPlaylist,onChange:e=>j({autoPlaylist:e})})}),(0,Q.jsx)(J,{label:N(`settings.clipFilename`),note:ch(f),help:(0,Q.jsx)(Q.Fragment,{children:Ur(`settings.clipFilenameHelp`,{n:(0,Q.jsx)(`code`,{children:`$n`}),date:(0,Q.jsx)(`code`,{children:`$date`}),time:(0,Q.jsx)(`code`,{children:`$time`}),game:(0,Q.jsx)(`code`,{children:`$game`})})}),children:(0,Q.jsx)(Md,{label:N(`settings.clipFilename`),wide:!0,mono:!0,value:f.clipNameTemplate,placeholder:`clip_$date_$time`,onChange:e=>j({clipNameTemplate:e})})})]}),(0,Q.jsxs)(Qm,{id:`sharing`,title:N(`settings.secSharing`),register:xe(`sharing`),children:[(0,Q.jsx)(J,{label:N(`settings.port`),help:N(`settings.portHelp`),children:(0,Q.jsx)(Md,{label:N(`settings.port`),mono:!0,type:`number`,min:1024,max:65535,value:f.port,onChange:e=>j({port:Number(e)||0})})}),(0,Q.jsx)(J,{label:N(`settings.publicLink`),help:N(`settings.publicLinkHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.publicLink`),checked:f.cloudflareTunnel,onChange:e=>j({cloudflareTunnel:e})})})]}),(0,Q.jsxs)(Qm,{id:`discord`,title:N(`settings.cardDiscord`),register:xe(`discord`),children:[(0,Q.jsx)(J,{label:N(`settings.discordEnabled`),help:N(`settings.discordEnabledHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.discordEnabled`),checked:f.discordEnabled,onChange:e=>j({discordEnabled:e})})}),(0,Q.jsx)(J,{label:N(`settings.discordCustomGames`),stack:!0,help:(0,Q.jsx)(Q.Fragment,{children:Ur(`settings.discordCustomGamesHelp`,{format:(0,Q.jsx)(`code`,{children:`Display Name | match1, match2`})})}),children:(0,Q.jsx)(Nd,{label:N(`settings.discordCustomGames`),rows:4,value:f.discordCustomGames,placeholder:N(`settings.discordCustomGamesPlaceholder`),onChange:e=>j({discordCustomGames:e})})}),(0,Q.jsx)(J,{label:N(`settings.discordClientId`),help:N(`settings.discordClientIdHelp`),children:(0,Q.jsx)(Md,{label:N(`settings.discordClientId`),wide:!0,mono:!0,value:f.discordClientId,placeholder:N(`settings.discordClientIdPlaceholder`),onChange:e=>j({discordClientId:e})})})]}),(0,Q.jsxs)(Qm,{id:`appearance`,title:N(`settings.secAppearance`),register:xe(`appearance`),children:[(0,Q.jsx)(J,{label:N(`settings.language`),help:N(`settings.languageHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.language`),value:Gr(),onChange:e=>qr(e),options:Wr().map(e=>[e,Lr[e]])})}),(0,Q.jsx)(J,{label:N(`settings.accent`),help:N(`settings.accentHelp`),children:(0,Q.jsxs)(`div`,{className:`swatches`,children:[co.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`swatch`,"data-active":u===e||void 0,style:{background:oo[e].base},title:N(`accents.${e}`),"aria-label":N(`settings.accentAria`,{name:N(`accents.${e}`)}),"aria-pressed":u===e,onClick:()=>r(e),children:u===e?(0,Q.jsx)(Bl,{size:13}):null},e)),(0,Q.jsx)(`button`,{type:`button`,className:`swatch swatch-custom`,"data-active":u===`custom`||void 0,style:c?{background:c}:void 0,title:N(`accents.customTitle`),"aria-label":N(`accents.customTitle`),"aria-pressed":u===`custom`,onClick:()=>s(!0),children:u===`custom`?(0,Q.jsx)(Bl,{size:13}):(0,Q.jsx)(Wl,{size:13})})]})}),(0,Q.jsx)(J,{label:N(`settings.effects`),note:_m(ie)?{text:_m(ie)}:null,help:N(`settings.effectsHelp`),children:(0,Q.jsx)(Ad,{label:N(`settings.effects`),value:ie,onChange:e=>be(e),options:Cm.map(e=>[e,N(`settings.effects${e[0].toUpperCase()}${e.slice(1)}`)])})})]}),(0,Q.jsxs)(Qm,{id:`advanced`,title:N(`settings.secAdvanced`),register:xe(`advanced`),children:[(0,Q.jsx)(J,{label:N(`settings.gsrArgs`),stack:!0,help:(0,Q.jsx)(Q.Fragment,{children:Ur(`settings.gsrArgsHelp`,{example:(0,Q.jsx)(`code`,{children:`-k hevc -bm cbr -q 20000 -fm cfr`})})}),children:(0,Q.jsx)(Md,{label:N(`settings.gsrArgs`),wide:!0,mono:!0,value:f.gsrArgs,placeholder:`-k hevc -bm cbr -q 20000 -fm cfr`,onChange:e=>j({gsrArgs:e})})}),(0,Q.jsx)(J,{label:N(`settings.checkForUpdates`),help:N(`settings.checkForUpdatesHelp`),children:(0,Q.jsx)(kd,{label:N(`settings.checkForUpdates`),checked:f.checkForUpdates,onChange:e=>j({checkForUpdates:e})})}),(0,Q.jsx)(J,{label:N(`settings.checkNow`),help:N(`settings.checkNowHelp`),children:(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:oe,onClick:()=>{k(!0),W.checkUpdate().then(e=>{let t=e;me(t?.update?.version?N(`settings.updateAvailable`,{version:t.update.version}):N(`settings.upToDate`))}).catch(e=>pe(N(`settings.errCheckUpdate`),e)).finally(()=>k(!1))},children:N(oe?`settings.checking`:`settings.checkNow`)})})]})]}),(0,Q.jsxs)(`div`,{className:`save-bar`,"data-dirty":fe||void 0,children:[(0,Q.jsx)(`span`,{className:`save-state`,children:fe?N(`settings.unsaved`):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Bl,{size:13}),` `,N(`settings.allSaved`)]})}),(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:ye,disabled:!fe||w,children:N(`settings.discard`)}),(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-sm`,onClick:()=>void ve(),disabled:!fe||w,children:N(w?`settings.saving`:`settings.saveSettings`)})]}),(0,Q.jsxs)(ql,{open:E,title:N(`settings.wfMicTitle`),onClose:()=>D(!1),children:[(0,Q.jsx)(`p`,{children:N(`settings.wfMicBody`)}),(0,Q.jsxs)(`div`,{className:`choice-list`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{D(!1),_e(!0,`backend_fallback`)},children:[(0,Q.jsx)(`b`,{children:N(`settings.wfMicChoiceBoth`)}),(0,Q.jsx)(`span`,{children:N(`settings.wfMicChoiceBothBody`)})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>{D(!1),_e(!0,`mic_only`)},children:[(0,Q.jsx)(`b`,{children:N(`settings.wfMicChoiceMic`)}),(0,Q.jsx)(`span`,{children:N(`settings.wfMicChoiceMicBody`)})]})]})]}),(0,Q.jsx)(ql,{open:T,title:N(`settings.restartTitle`),onClose:()=>re(!1),footer:(0,Q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>re(!1),children:N(`common.gotIt`)}),children:(0,Q.jsx)(`p`,{children:N(`settings.restartBody`)})}),(0,Q.jsx)(cd,{open:o,initial:a,onCancel:()=>s(!1),onConfirm:e=>{i(e),s(!1)}})]})}function Qm({id:e,title:t,register:n,children:r}){return(0,Q.jsxs)(`section`,{className:`settings-card`,id:`settings-${e}`,ref:n,"aria-label":t,children:[(0,Q.jsx)(`h2`,{children:t}),r]})}function $m({presets:e,onChange:t,onUnsupported:n}){let r=(n,r)=>t(e.map(e=>e.uid===n?{...e,...r}:e));return(0,Q.jsxs)(`div`,{className:`presets`,children:[e.map(i=>(0,Q.jsxs)(`div`,{className:`preset-row`,children:[(0,Q.jsx)(Td,{compact:!0,value:i.key,onUnsupported:n,onCapture:e=>r(i.uid,{key:e})}),(0,Q.jsx)(`input`,{className:`text-input preset-duration`,type:`number`,min:5,max:600,step:5,value:i.duration,"aria-label":N(`settings.presetDuration`),onChange:e=>r(i.uid,{duration:Number(e.target.value)})}),(0,Q.jsx)(`span`,{className:`preset-unit mono`,children:`s`}),(0,Q.jsx)(`button`,{type:`button`,className:`preset-remove`,title:N(`settings.presetRemove`),"aria-label":N(`settings.presetRemove`),onClick:()=>t(e.filter(e=>e.uid!==i.uid)),children:(0,Q.jsx)(Fl,{size:12})})]},i.uid)),(0,Q.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>t([...e,Vm()]),children:N(`settings.presetAdd`)})]})}function eh(){return Rm.map(([e,t])=>[e,e?t:N(`settings.resolutionAuto`)])}function th(e,t){let n=rh(t),r=[[``,N(`settings.displayAuto`)],...n.map(e=>[e.id,e.label||e.id])];return e.display&&!n.some(t=>t.id===e.display)&&r.push([e.display,N(`settings.savedOption`,{id:e.display})]),r}function nh(e,t){let n=rh(t);return e.display&&!n.some(t=>t.id===e.display)?{text:N(`settings.displayMissing`,{id:e.display}),tone:`warning`}:t.warning?{text:N(`settings.displayWarning`,{warning:t.warning}),tone:`warning`}:n.length?{text:N(`settings.displayHelp`)}:{text:N(`settings.displayNone`),tone:`warning`}}function rh(e){let t=e=>{let t=String(e||``).toLowerCase();return t.startsWith(`gsr error`)||t.startsWith(`error:`)||t.includes(`for_each_active_monitor`)||t.includes(`failed to open`)};return(e.displays??[]).filter(e=>!(t(e.id)||t(e.label)))}function ih(e){if(e.kind)return e.kind;let t=e.id||``;return t===`default_input`||t.startsWith(`device:`)&&!t.endsWith(`.monitor`)?`input`:t.startsWith(`app:`)||t.startsWith(`app-inverse:`)?`app`:`monitor`}function ah(e,t){let n=t.length?t:[{id:`default_output`,label:N(`settings.defaultOutput`)}],r=[],i=[[`monitor`,N(`settings.groupDesktopAudio`)],[`input`,N(`settings.groupMicrophones`)],[`app`,N(`settings.groupApplications`)]];for(let[e,t]of i){let i=n.filter(t=>ih(t)===e);i.length&&r.push({group:t,options:i.map(e=>[e.id,e.label||e.id])})}let a=new Set(i.map(([e])=>e)),o=n.filter(e=>!a.has(ih(e)));return o.length&&r.push({group:N(`settings.groupOther`),options:o.map(e=>[e.id,e.label||e.id])}),e&&!n.some(t=>t.id===e)&&r.push({group:N(`settings.groupSaved`),options:[[e,N(`settings.savedOption`,{id:e})]]}),r}function oh(e,t){let n=t.filter(e=>ih(e)===`input`);n.some(e=>e.id===`default_input`)||n.unshift({id:`default_input`,label:N(`settings.defaultInput`)});let r=n.map(e=>[e.id,e.label||e.id]);return e&&!n.some(t=>t.id===e)&&r.push([e,N(`settings.savedOption`,{id:e})]),r}function sh(e,t){let n=t.sources.find(t=>t.id===e.desktopSource);return n&&ih(n)===`input`?{text:N(`settings.desktopSourceIsMic`),tone:`warning`}:e.desktopSource&&t.sources.length&&!n?{text:t.warning||N(`settings.desktopSourceMissing`),tone:`warning`}:{text:N(`settings.desktopSourceHelp`)}}function ch(e){let t=e.clipNameTemplate.trim();if(!t)return null;let n=Nm(t,4,`Overwatch-2`,new Date);return n?{text:N(`settings.clipFilenameNext`,{name:n}),tone:`accent`}:{text:N(`settings.clipFilenameEmpty`),tone:`warning`}}var lh,Q,uh,dh=o((()=>{lh=l(d()),jc(),Vc(),P(),Rr(),Dm(),Gm(),lo(),pl(),Xl(),Kl(),md(),_d(),Dc(),Xm(),Od(),Rd(),Q=M(),uh=[[`recording`,`settings.secRecording`],[`audio`,`settings.secAudio`],[`hotkeys`,`settings.secHotkeys`],[`storage`,`settings.secStorage`],[`sharing`,`settings.secSharing`],[`discord`,`settings.secDiscord`],[`appearance`,`settings.secAppearance`],[`advanced`,`settings.secAdvanced`]]}));function fh(e,t=14){return`${e}`}function ph(e){let t=Math.floor(e/60),n=Math.floor(e%60),r=Math.floor(e%1*10);return`${t}:${String(n).padStart(2,`0`)}.${r}`}var mh,hh,gh,_h,vh,yh,bh,xh=o((()=>{P(),mh=[{id:`crossfade`,len:1,glyph:``},{id:`fadeblack`,len:.8,glyph:``},{id:`fadewhite`,len:.8,glyph:``},{id:`dipaccent`,len:.7,glyph:``},{id:`blurdis`,len:1.2,glyph:``},{id:`slide`,len:.8,glyph:``}],hh={display:{label:`Geist`,stack:`'Geist', sans-serif`},body:{label:`Inter`,stack:`'Inter', sans-serif`},mono:{label:`JetBrains Mono`,stack:`'JetBrains Mono', monospace`}},gh=[{id:`title`,font:`display`,size:64,weight:600,color:`#f2f5fa`,x:50,y:44},{id:`subtitle`,font:`body`,size:34,weight:500,color:`#dbe1ea`,x:50,y:58},{id:`caption`,font:`mono`,size:22,weight:400,color:`#b8c0cd`,x:50,y:88},{id:`lower`,font:`display`,size:40,weight:600,color:`#f2f5fa`,x:22,y:84}],_h=[`#f2f5fa`,`#33adff`,`#c4b5fd`,`#6ee7b7`,`#fdba74`],vh=e=>mh.find(t=>t.id===e),yh=e=>N(`editor.fx.${e}.name`),bh={film:``,type:``,volumeX:``}}));function Sh(e){let t=null,n=null,r=0,i=!1,a=12,o=null,s=new Set,c=!1,l=!1,u,d=[],f=[],p=`library`,m=``,h=!1,g=null,_=!1,v=!1,y=!0,b=null,x=0,S={},C=``,w={},ee=``,te=null,ne=null,T=null,re=null,E=null,D=new Set,ie=()=>e.clips(),ae=()=>`i`+Math.random().toString(36).slice(2,9),O=e=>Math.round(e*1e3)/1e3,oe=e=>ie().find(t=>t.slug===e.clipId),k=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`,A=e=>String(e).replace(/&/g,`&`).replace(//g,`>`),se=e=>String(e).replace(/&/g,`&`).replace(/'/g,`'`).replace(/"/g,`"`),ce=(e,t)=>{try{e.setPointerCapture(t.pointerId)}catch{}},j=()=>t?t.items.reduce((e,t)=>Math.max(e,t.start+t.dur),0):0,le=e=>t.items.filter(t=>t.trackId===e).sort((e,t)=>e.start-t.start),ue=e=>e?t.items.find(t=>t.id===e)??null:null,de=()=>ue(n),fe=()=>t.tracks.filter(e=>e.type===`video`),pe=()=>Math.max(j()+30,90),me=e=>{let t=oe(e);return t&&t.duration?t.duration:(e.offset||0)+e.dur};function he(){return{version:1,tracks:[{id:`T1`,type:`text`,label:`T1`},{id:`V2`,type:`video`,label:`V2`},{id:`V1`,type:`video`,label:`V1`},{id:`A1`,type:`audio`,label:`A1`}],items:[]}}function ge(){let e=de(),n=!!(e&&r>e.start+.2&&r0,canRedo:f.length>0,preparing:_,empty:y}}function _e(){let e=ge();D.forEach(t=>t(e))}async function ve(){try{let e=await(await fetch(`/api/editor/project`)).json();t=e.project&&Array.isArray(e.project.tracks)&&e.project.tracks.length?e.project:he(),s=new Set(e.missing||[])}catch(e){console.debug(`Loading the editor project failed`,e),t=t||he()}c=!0,_e()}function ye(){l=!0,window.clearTimeout(u),u=window.setTimeout(()=>void be(),800)}async function be(){if(!(!l||!t)){l=!1;try{await fetch(`/api/editor/project`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}catch(e){console.debug(`Autosaving the editor project failed`,e),l=!0}}}function xe(){if(!t)return;let e=new Set(ie().map(e=>e.slug));s=new Set(t.items.filter(t=>t.clipId&&!e.has(t.clipId)).map(e=>e.clipId))}function Se(){d.push(JSON.stringify(t)),d.length>Th&&d.shift(),f=[]}function Ce(){d.length&&(f.push(JSON.stringify(t)),t=JSON.parse(d.pop()),Te())}function we(){f.length&&(d.push(JSON.stringify(t)),t=JSON.parse(f.pop()),Te())}function Te(){n&&!ue(n)&&(n=null),xe(),ye(),At(),xt(!0)}function Ee(){t.items.forEach(e=>{if(e.trans&&e.kind===`clip`){let t=Math.min(3,O(e.dur*.8));e.trans.len=Math.min(Math.max(.2,e.trans.len),t)}})}function De(){Ee(),ye(),At(),xt(!0)}function Oe(e){let n=t.items.filter(t=>t.trackId===e.trackId&&t.id!==e.id).sort((e,t)=>e.start-t.start),r=Math.max(0,e.start);for(let t=0;trt.start);if(!t)break;let i=t.start-e.dur,a=t.start+t.dur;r=i>=0&&Math.abs(i-r)<=Math.abs(a-r)?i:a}return e.start=O(Math.max(0,r)),e}function ke(e){return t.items.push(Oe(e)),e}function Ae(e,n){let i=[0,r];t.items.forEach(e=>{e.id!==n&&i.push(e.start,e.start+e.dur)});let o=e,s=8/a;return i.forEach(t=>{let n=Math.abs(t-e);n{if(t.trackId!==e.trackId||t.id===e.id)return;let i=t.start+t.dur;i<=e.start+.001&&i>n&&(n=i),t.start>=e.start+e.dur-.001&&t.starte.slug===r);if(!s||!s.duration){e.notify(N(`editor.noReadableDuration`),`error`);return}Se(),n=ke({id:ae(),kind:o?`audio`:`clip`,trackId:i,clipId:r,start:O(Math.max(0,a)),dur:O(s.duration),offset:0}).id,De()}function Ne(e){if(!t)return;let n=fe(),r=n[n.length-1],i=le(r.id).reduce((e,t)=>Math.max(e,t.start+t.dur),0);Me(e,r.id,i,!1)}function Pe(e,i={}){if(!t)return;let a=gh.find(t=>t.id===e),o=t.tracks.find(e=>e.type===`text`);!a||!o||(Se(),n=ke({id:ae(),kind:`text`,trackId:o.id,start:O(Math.max(0,i.t===void 0?r:i.t)),dur:4,text:N(`editor.textPreset.${a.id}.sample`),font:a.font,size:a.size,weight:a.weight,color:a.color,x:i.x===void 0?a.x:O(i.x),y:i.y===void 0?a.y:O(i.y)}).id,De())}function Fe(e,t){let r=ue(e),i=vh(t);!r||!i||r.kind!==`clip`||(Se(),r.trans={fx:t,len:Math.min(i.len,O(r.dur*.8))},n=e,De())}function Ie(){let e=de();if(!e||r<=e.start+.2||r>=e.start+e.dur-.2)return;Se();let n=r,i={...e,id:ae(),start:O(n),dur:O(e.start+e.dur-n),offset:O((e.offset||0)+(n-e.start))};delete i.trans,e.dur=O(n-e.start),t.items.push(i),De()}function Le(){let e=de();if(!e||e.kind!==`clip`||e.muted)return;let r=oe(e)?.audio_tracks;if(!r?.length)return;Se(),e.muted=!0;let i=null;for(let n of r){let r=t.tracks.find(n=>n.type===`audio`&&!t.items.some(t=>t.trackId===n.id&&t.starte.start));r||(r={id:ae(),type:`audio`,label:`A${t.tracks.filter(e=>e.type===`audio`).length+1}`},t.tracks.push(r));let a=ke({id:ae(),kind:`audio`,trackId:r.id,clipId:e.clipId,start:e.start,dur:e.dur,offset:e.offset||0,audioStream:n.index,volume:1,muted:n.index!==0});i??(i=a)}n=i.id,De()}function Re(){let e=de();if(!e)return;Se();let t={...e,id:ae(),start:O(e.start+e.dur+.25)};delete t.trans,ke(t),n=t.id,De()}function ze(){let e=de();e&&(o=JSON.parse(JSON.stringify(e)))}function Be(){if(!o||!t.tracks.find(e=>e.id===o.trackId))return;Se();let e={...o,id:ae(),start:O(r)};delete e.trans,ke(e),n=e.id,De()}function Ve(){n&&(Se(),t.items=t.items.filter(e=>e.id!==n),n=null,De())}function He(e){Se();let n=t.tracks.filter(t=>t.type===e).length+1,r={id:ae(),type:e,label:(e===`video`?`V`:`A`)+n};if(e===`audio`)t.tracks.push(r);else{let e=t.tracks.findIndex(e=>e.type===`video`);t.tracks.splice(e===-1?t.tracks.length:e,0,r)}De()}function Ue(e){let r=t.tracks.find(t=>t.id===e);!r||r.type===`text`||r.type===`video`&&fe().length<=1||(Se(),t.tracks=t.tracks.filter(t=>t.id!==e),t.items=t.items.filter(t=>t.trackId!==e),n=null,De())}function We(){Se(),t=he(),n=null,r=0,yt(!1),s=new Set,De()}function Ge(e){n=e,jt(),mt(r),_e()}function Ke(){if(!g||ne)return;let e=()=>{let e=g.stageWrap.getBoundingClientRect();if(e.width<10||e.height<10)return;let t=Math.min(e.width,e.height*16/9);g.stage.style.width=`${t}px`,g.stage.style.height=`${t*9/16}px`,gt()};ne=new ResizeObserver(e),ne.observe(g.stageWrap),e()}function qe(e){e.pause(),e.removeAttribute(`src`),e._key=null;try{e.load()}catch(e){console.debug(`Tearing down a preview element failed`,e)}e.remove()}function Je(){Object.keys(S).forEach(e=>{S[e].els.forEach(e=>qe(e)),delete S[e]}),C=``,te=null,Object.keys(w).forEach(e=>{let t=w[e];t.pause(),t.removeAttribute(`src`);try{t.load()}catch(e){console.debug(`Tearing down a preview audio element failed`,e)}delete w[e]})}function Ye(){if(!g)return;let e=fe(),t=e.map(e=>e.id).join(`,`);t!==C&&(C=t,Object.keys(S).forEach(t=>{e.find(e=>e.id===t)||(S[t].els.forEach(e=>qe(e)),delete S[t])}),e.forEach((t,n)=>{if(!S[t.id]){let e=()=>{let e=document.createElement(`video`);return e.playsInline=!0,e.preload=`auto`,e.className=`ed-vhide`,e._key=null,e._need=0,g.stage.insertBefore(e,g.stage.firstChild),e};S[t.id]={els:[e(),e(),e()],itemKey:null,shown:null,handover:!1,seq:0,zBase:0}}S[t.id].zBase=4*(e.length-n)}))}let Xe=(e,t)=>le(e).find(e=>e.kind===`clip`&&t>=e.start&&tle(e).find(e=>e.kind===`clip`&&e.start>t&&!s.has(e.clipId))||null,Qe=e=>{let t=oe(e);return e.id+`|`+(t?t.video_url:e.clipId)},$e=(e,t)=>le(e).filter(e=>e.kind===`clip`&&e.id!==t.id&&!s.has(e.clipId)&&Math.abs(e.start+e.dur-t.start)<.11).pop()||null;function et(e,t){let n=[],r=(e,t,r)=>{!e||n.some(t=>t.key===Qe(e))||oe(e)&&n.push({key:Qe(e),it:e,role:t,parkAt:r})},i=Xe(e,t);if(r(i,`cur`,(i&&i.offset||0)+(i?Math.max(0,t-i.start):0)),i&&i.trans&&t{let r=e.els.find(e=>e._key===t.key&&!n.has(e));r&&(t.el=r,n.add(r))}),t.forEach(t=>{if(t.el)return;let r=e.els.filter(e=>!n.has(e)),i=r.find(e=>!e._key)||r.sort((e,t)=>e._need-t._need)[0];i&&(i._key=t.key,i.src=Ql(oe(t.it)),it(i,t.parkAt),t.el=i,n.add(i))}),t.forEach(t=>{t.el&&(t.el._role=t.role,t.el._need=e.seq)}),e.els.forEach(e=>{let t=e;n.has(e)||(t._role=null,ct(t),!t.paused&&!at(t)&&t.pause(),ot(t))}),t}function nt(e,t,n){if(!(e.readyState<1||e.seeking)&&Math.abs(e.currentTime-t)>(n||Dh))try{e.currentTime=t}catch(e){console.debug(`Seeking a preview element failed`,e)}}let rt=()=>i?.45:Dh;function it(e,t){e._parkAt=t||0,e._warmUntil=performance.now()+kh,e.muted=!0,e.play().catch(()=>{})}let at=e=>!!(e._warmUntil&&performance.now()e.role===`cur`),s=a.find(e=>e.role===`prev`);if(!o||!o.el)return r.els.forEach(ct),r.itemKey=null,r.shown=null,null;let c=o.it,l=o.el,u=s?s.el??null:null,d=r.itemKey!==o.key,f=n&&!r.wasMaster;r.wasMaster=n,d&&(r.itemKey=o.key,r.handover=!!(r.shown&&r.shown!==l)),r.handover&&l.readyState>=2&&!l.seeking&&(r.handover=!1);let p=!!(c.trans&&t{e===l?st(e,r.zBase+2):e===u&&p||e===r.shown&&r.handover?st(e,r.zBase+1):ct(e)});let m=(c.offset||0)+(t-c.start);return i&&!v?(l._warmUntil=0,l.muted=!!c.muted,l.paused&&l.play().catch(()=>{}),d||f?nt(l,m,Dh):n||nt(l,m,rt())):at(l)?l._parkAt=m:(l.paused||l.pause(),l.muted=!!c.muted,nt(l,m)),r.handover||(r.shown=l),{it:c,cur:l,prev:u}}function ut(t,n){if(!g)return;let r=0,i=`#02040a`;t.forEach(t=>{if(!t)return;let{it:a,cur:o,prev:s}=t;if(o.style.opacity=``,o.style.filter=``,o.style.transform=``,s&&(s.style.transform=``,s.style.filter=``),!a.trans)return;let c=a.trans.len;if(n=a.start+c)return;let l=Math.max(0,Math.min(1,(n-a.start)/c)),u=a.trans.fx;if(u===`crossfade`||u===`blurdis`||u===`slide`){if(u===`crossfade`)o.style.opacity=String(l);else if(u===`blurdis`){o.style.opacity=String(l);let e=Math.sin(l*Math.PI)*Math.max(6,(g.stage.clientWidth||640)*.022);o.style.filter=`blur(${e.toFixed(1)}px)`,s&&(s.style.filter=`blur(${e.toFixed(1)}px)`)}else Ah()?o.style.opacity=String(l):(o.style.transform=`translateX(${((1-l)*100).toFixed(2)}%)`,s&&(s.style.transform=`translateX(${(-l*100).toFixed(2)}%)`))}else{let t=u===`fadewhite`?`#f2f5fa`:u===`dipaccent`?e.accent():`#02040a`;r=Math.max(r,1-l),i=t}}),g.fadeOverlay.style.background=i,g.fadeOverlay.style.opacity=String(r)}function dt(e,t){if(!e||!e.prev||!e.it.trans)return;let{it:n,prev:r}=e;if(t>=n.start+n.trans.len)return;let a=$e(n.trackId,n);a&&(r.muted=!0,nt(r,Math.min((a.offset||0)+a.dur+(t-n.start),me(a)-.05),rt()),i&&!v&&r.paused?r.play().catch(()=>{}):(!i||v)&&!r.paused&&r.pause())}function ft(n){let r=new Set,a=[];t.items.forEach(t=>{if(t.kind!==`audio`||t.muted||(t.volume??1)===0||n=t.start+t.dur||s.has(t.clipId))return;let o=oe(t);if(!o)return;r.add(t.id);let c=w[t.id];c||(c=new Audio,c.preload=`auto`,c.addEventListener(`loadeddata`,()=>{h&&!i&&xt(!1)}),c.addEventListener(`error`,()=>{!c.getAttribute(`src`)||!h||(yt(!1),e.notify(N(`editor.audioPreviewFailed`),`error`))}),w[t.id]=c);let l=new URL(o.video_url,window.location.href).search,u=`/api/clips/${encodeURIComponent(o.slug)}/audio/${t.audioStream??0}${l}`;c.getAttribute(`src`)!==u&&(c.src=u),c.volume=Math.max(0,Math.min(1,t.volume??1)),nt(c,(t.offset||0)+(n-t.start),rt()),a.push(c)}),v=a.some(e=>e.readyState<2&&!e.error),a.forEach(e=>{i&&!v&&e.paused?e.play().catch(()=>{}):(!i||v)&&!e.paused&&e.pause()}),Object.keys(w).forEach(e=>{r.has(e)||(w[e].pause(),ue(e)||(w[e].removeAttribute(`src`),w[e].load(),delete w[e]))})}let pt=e=>t.items.filter(t=>t.kind===`text`&&e>=t.start&&ee.id).join(`,`)+`|`+n;if(i===ee){gt();return}ee=i,g.stage.querySelectorAll(`.ed-text-overlay`).forEach(e=>e.remove()),r.forEach(e=>{let t=document.createElement(`div`);t.className=`ed-text-overlay`+(n===e.id?` selected`:``),t.dataset.text=e.id;let r=document.createElement(`span`);r.textContent=e.text||``,t.appendChild(r),n===e.id&&[`tl`,`tr`,`bl`,`br`].forEach(n=>{let r=document.createElement(`span`);r.className=`ed-th `+n,r.addEventListener(`pointerdown`,n=>ht(n,t,e.id)),t.appendChild(r)}),g.stage.appendChild(t),t.addEventListener(`pointerdown`,n=>_t(n,t,e.id))}),gt()}function ht(e,t,n){e.stopPropagation(),e.preventDefault();let r=ue(n);if(!r)return;Se();let i=t.getBoundingClientRect(),a=i.left+i.width/2,o=i.top+i.height/2,s=Math.max(12,Math.hypot(e.clientX-a,e.clientY-o)),c=r.size,l=e.currentTarget;ce(l,e);let u=e=>{let t=Math.hypot(e.clientX-a,e.clientY-o);r.size=Math.round(Math.min(1e3,Math.max(8,c*t/s))),gt(),_e()},d=()=>{l.removeEventListener(`pointermove`,u),l.removeEventListener(`pointerup`,d),ye(),_e()};l.addEventListener(`pointermove`,u),l.addEventListener(`pointerup`,d)}function gt(){if(!g)return;let e=g.stage.clientWidth||1;g.stage.querySelectorAll(`.ed-text-overlay`).forEach(t=>{let n=ue(t.dataset.text??null);n&&(t.style.left=`${n.x}%`,t.style.top=`${n.y}%`,t.style.fontFamily=hh[n.font]?.stack??hh.display.stack,t.style.fontWeight=String(n.weight),t.style.fontSize=`${n.size*e/1920}px`,t.style.color=n.color,t.style.letterSpacing=n.font===`display`?`-.02em`:`0`)})}function _t(e,t,n){e.stopPropagation(),e.preventDefault(),Ge(n);let r=ue(n);if(!r||!g)return;Se();let i=g.stage.getBoundingClientRect(),a=r.x,o=r.y,s=e.clientX,c=e.clientY;ce(t,e);let l=e=>{r.x=O(Math.min(97,Math.max(3,a+(e.clientX-s)/i.width*100))),r.y=O(Math.min(95,Math.max(4,o+(e.clientY-c)/i.height*100))),gt(),_e()},u=()=>{t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),ye(),At()};t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u)}function vt(e,t){let n=de();if(n){if(n.kind===`audio`&&[`audioStream`,`volume`,`muted`].includes(e)){Se(),e===`muted`?n.muted=!!t:e===`audioStream`?n.audioStream=Number(t):n.volume=Math.max(0,Math.min(1,Number(t))),De();return}n.kind===`text`&&(Se(),n[e]=e===`size`?parseInt(String(t),10):t,ye(),ee=``,mt(r),e===`text`&&At(),_e())}}function yt(e){if(e&&j()<=0)return;if(e&&r>=j()-.01&&(r=0),i=e,_e(),!e){xt(!1);return}if(b)return;xt(!0);let t=()=>{!i||b||(x=performance.now(),b=requestAnimationFrame(bt))},n=te&&te.cur;if(n&&n.readyState<3){let e=!1,r=()=>{e||(e=!0,t())};n.addEventListener(`playing`,r,{once:!0}),n.addEventListener(`canplaythrough`,r,{once:!0}),window.setTimeout(r,400)}else t()}function bt(e){if(b=null,!i||!h){i=!1,xt(!1),_e();return}if(v&&(x=e,xt(!1),v)){b=requestAnimationFrame(bt);return}let t=j(),n=Math.min(.25,(e-x)/1e3);x=e,r=Math.min(t,r+n),xt(!1);let a=te;if(a&&!a.cur.paused&&!a.cur.seeking&&a.cur.readyState>=2){let e=a.it.start+(a.cur.currentTime-(a.it.offset||0));e>=a.it.start&&e<=a.it.start+a.it.dur&&Math.abs(e-r)<.5&&(r=Math.min(t,e))}if(Tt(),_e(),r>=t){yt(!1);return}i&&(b=requestAnimationFrame(bt))}function xt(e){if(!t||!h||!g)return;Ke(),Ye();let n=r;ft(n);let i=fe(),a=null,o=i.map(e=>{let t=lt(e.id,n,!a);return t&&!a&&(a=t),t});te=a,o.forEach(e=>dt(e,n)),ut(o,n),mt(n);let s=!o.some(e=>e),c=v||o.some(e=>{if(!e)return!1;let t=oe(e.it);return!!(t&&Zl(t)&&e.cur.readyState<2)});(s!==y||c!==_)&&(y=s,_=c,_e()),e&&Tt()}function St(e){a=Math.max(Ch,Math.min(wh,a*e)),At()}function Ct(){let e=g?g.timelineScroll.clientWidth-Eh-20:900;a=Math.max(Ch,Math.min(wh,e/Math.max(10,j()+2))),At()}function wt(e){r=Math.max(0,Math.min(pe(),e)),Tt(),xt(!0),_e()}function Tt(){if(!g)return;let e=g.timelineCanvas.querySelector(`#ed-playhead`),t=g.timelineCanvas.querySelector(`#ed-ruler-cursor`);e&&(e.style.left=`${Eh+r*a-.75}px`),t&&(t.style.left=`${r*a-4.5}px`)}function Et(e,t){let n=[],r=e*9301+49297;for(let e=0;et.index===(e.audioStream??0))?.title||N(`editor.recordedTrack`,{number:(e.audioStream??0)+1}),n=Et(Dt(e.clipId||``),Math.max(16,Math.round(e.dur*3))),r=n.map((e,t)=>``).join(``);return`
${r} ${A(u)} · ${A(t)}
`}return e.kind===`text`?`
- ${Hm(Xm.type,10)} + ${fh(bh.type,10)} ${A(e.text||``)}
@@ -63,18 +63,18 @@ Error generating stack: `+e.message+` ${A(u)} ${k(e.dur)}
- ${e.muted?`${Hm(Xm.volumeX,10)}`:``} + ${e.muted?`${fh(bh.volumeX,10)}`:``}
-
`}function kt(e){let t=Jm(e.trans.fx);return`
-
+
`}function kt(e){let t=vh(e.trans.fx);return`
+
-
${Hm(t.glyph,8)}
+
${fh(t.glyph,8)}
- ${Hm(t.glyph,11)} - ${A(Ym(t.id))} + ${fh(t.glyph,11)} + ${A(yh(t.id))} ${e.trans.len.toFixed(1)}s @@ -100,9 +100,9 @@ Error generating stack: `+e.message+`
${s} -
`,g.timelineCanvas.style.width=`${nh+n}px`,Mt(),Tt(),_e()}function jt(){g&&g.timelineCanvas.querySelectorAll(`.ed-item`).forEach(e=>{e.classList.toggle(`selected`,e.dataset.item===n)})}function Mt(){if(!g)return;let e=g.timelineCanvas.querySelector(`#ed-ruler`);e&&e.addEventListener(`pointerdown`,t=>{ce(e,t);let n=e.getBoundingClientRect(),r=e=>wt((e.clientX-n.left)/a);r(t);let i=()=>{e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerup`,i)};e.addEventListener(`pointermove`,r),e.addEventListener(`pointerup`,i)}),g.timelineCanvas.querySelectorAll(`.ed-rail`).forEach(e=>{e.addEventListener(`contextmenu`,t=>Wt(t,e.dataset.rail))}),g.timelineCanvas.querySelectorAll(`.ed-lane`).forEach(e=>{let t=e.dataset.lane;e.addEventListener(`pointerdown`,t=>{t.target===e&&Ge(null)}),e.addEventListener(`contextmenu`,n=>{n.target===e&&Wt(n,t)}),e.addEventListener(`dragover`,n=>It(n,e,t)),e.addEventListener(`dragleave`,()=>{E&&E.trackId===t&&Bt()}),e.addEventListener(`drop`,n=>Lt(n,e,t)),e.querySelectorAll(`.ed-item`).forEach(e=>{let t=e.dataset.item;e.addEventListener(`pointerdown`,n=>Pt(n,e,t)),e.addEventListener(`contextmenu`,e=>Ut(e,t)),e.classList.contains(`ed-item-clip`)&&(e.addEventListener(`dragover`,n=>{T&&T.kind===`fx`&&!Nt(n,e,t)&&(n.preventDefault(),n.stopPropagation(),e.classList.add(`fx-target`))}),e.addEventListener(`dragleave`,()=>e.classList.remove(`fx-target`)),e.addEventListener(`drop`,n=>{T&&T.kind===`fx`&&!Nt(n,e,t)&&(n.preventDefault(),n.stopPropagation(),e.classList.remove(`fx-target`),Fe(t,T.id),Xt())}))}),e.querySelectorAll(`.ed-junction`).forEach(e=>Vt(e,e.dataset.junction))})}function Nt(e,t,n){let r=ue(n);if(!r)return!1;let i=t.getBoundingClientRect(),a=e.clientX-i.left,{prevEnd:o,nextStart:s}=je(r);return a<16&&Math.abs(o-r.start)<.11&&r.start>.05||a>i.width-16&&Math.abs(s-(r.start+r.dur))<.11}function Pt(e,n,r){if(e.button!==0)return;let i=ue(r);if(!i)return;e.stopPropagation(),Ge(r);let o=e.target.closest(`[data-handle]`);if(ce(n,e),o){Ft(e,n,i,o.dataset.handle);return}let s=e.clientX,c=e.clientY,l=i.start,u=t.tracks.find(e=>e.id===i.trackId),d=!1,f=i.trackId,p=i.start,m=[...g.timelineCanvas.querySelectorAll(`.ed-lane`)].filter(e=>{let n=t.tracks.find(t=>t.id===e.dataset.lane);return n&&n.type===u.type}),h=e=>{if((Math.abs(e.clientX-s)>3||Math.abs(e.clientY-c)>8)&&(d=!0),d){p=Ae(Math.max(0,l+(e.clientX-s)/a),r);for(let t of m){let n=t.getBoundingClientRect();e.clientY>=n.top-3&&e.clientY<=n.bottom+3&&(f=t.dataset.lane)}n.style.left=`${p*a}px`,n.style.opacity=f===i.trackId?``:`0.65`}},_=()=>{n.removeEventListener(`pointermove`,h),n.removeEventListener(`pointerup`,_),d&&(Se(),i.start=p,i.trackId=f,Oe(i),De())};n.addEventListener(`pointermove`,h),n.addEventListener(`pointerup`,_)}function Ft(e,t,n,r){let i=e.clientX,o=n.start,s=n.dur,c=n.offset||0,{prevEnd:l,nextStart:u}=je(n),d=n.clipId?me(n):1/0,f=Math.min(d-c,u-o),p=null,m=e=>{let u=(e.clientX-i)/a;if(r===`l`){let e=Ae(o+u,n.id)-o;e=Math.max(Math.max(-c,l-o),Math.min(s-.5,e)),p={start:O(o+e),dur:O(s-e),offset:O(c+e)},t.style.left=`${p.start*a}px`,t.style.width=`${Math.max(8,p.dur*a)}px`}else{let e=Ae(o+s+u,n.id)-o;e=Math.max(.5,Math.min(f,e)),p={dur:O(e)},t.style.width=`${Math.max(8,p.dur*a)}px`}},h=()=>{t.removeEventListener(`pointermove`,m),t.removeEventListener(`pointerup`,h),p&&(Se(),Object.assign(n,p),De())};t.addEventListener(`pointermove`,m),t.addEventListener(`pointerup`,h)}function It(e,n,r){if(!T)return;let i=t.tracks.find(e=>e.id===r),o=n.getBoundingClientRect(),s=e.clientX-o.left;if(T.kind===`fx`){if(i.type!==`video`)return;let t=Rt(r,s);t?(e.preventDefault(),zt({trackId:r,junctionX:t.x})):E&&E.junctionX!==void 0&&Bt();return}if(T.kind===`text`){e.preventDefault(),zt({trackId:t.tracks.find(e=>e.type===`text`).id,t:Ae(s/a),w:4*a});return}if(i.type===`text`)return;e.preventDefault();let c=ie().find(e=>e.slug===T.id)?.duration??4;zt({trackId:r,t:Ae(s/a),w:c*a})}function Lt(e,n,r){let i=T;if(!i)return;let o=t.tracks.find(e=>e.id===r),s=n.getBoundingClientRect(),c=e.clientX-s.left;if(i.kind===`fx`){if(o.type!==`video`)return;let t=Rt(r,c);t&&(e.preventDefault(),Fe(t.id,i.id)),Xt();return}let l=Ae(c/a);if(i.kind===`text`){e.preventDefault(),Pe(i.id,{t:l}),Xt();return}o.type!==`text`&&(e.preventDefault(),Me(i.id,r,l,o.type===`audio`),Xt())}function Rt(e,t){let n=le(e).filter(e=>e.kind===`clip`),r=null;for(let e=1;ee.remove()),document.querySelectorAll(`.ed-item.fx-target`).forEach(e=>e.classList.remove(`fx-target`))}function Vt(e,t){let n=()=>e.classList.remove(`open`);e.addEventListener(`pointerdown`,t=>{t.stopPropagation(),e.classList.add(`open`)}),e.addEventListener(`contextmenu`,e=>{e.preventDefault(),e.stopPropagation()}),e.addEventListener(`mouseenter`,()=>e.classList.add(`open`)),e.addEventListener(`mouseleave`,n),e.querySelectorAll(`[data-bump]`).forEach(n=>{n.onclick=r=>{r.preventDefault(),r.stopPropagation();let i=ue(t);if(!i||!i.trans)return;let a=Math.min(3,O(i.dur*.8));i.trans.len=O(Math.max(.2,Math.min(a,i.trans.len+parseFloat(n.dataset.bump)))),e.querySelector(`.fx-len`).textContent=`${i.trans.len.toFixed(1)}s`,ye(),xt(!0)}});let r=e.querySelector(`[data-rm]`);r&&(r.onclick=e=>{e.preventDefault(),e.stopPropagation();let r=ue(t);r&&(n(),Se(),delete r.trans,De())})}function Ht(e,t,n){document.getElementById(`ed-menu`)?.remove();let r=document.createElement(`div`);r.id=`ed-menu`,r.className=`ed-menu`,r.innerHTML=n.map((e,t)=>e===`-`?`
`:``).join(``),document.body.appendChild(r),r.querySelectorAll(`.ed-menu-item`).forEach(e=>{e.onclick=t=>{t.stopPropagation();let i=n[parseInt(e.dataset.i,10)];r.remove(),i&&i!==`-`&&!i.dis&&i.fn()}}),r.style.left=`${Math.max(8,Math.min(e,window.innerWidth-r.offsetWidth-8))}px`,r.style.top=`${Math.max(8,Math.min(t,window.innerHeight-r.offsetHeight-8))}px`;let i=e=>{r.contains(e.target)||(r.remove(),document.removeEventListener(`pointerdown`,i,!0))};window.setTimeout(()=>document.addEventListener(`pointerdown`,i,!0),0)}function Ut(e,t){e.preventDefault(),e.stopPropagation(),Ge(t);let n=ue(t);if(!n)return;let i=r>n.start+.2&&re.id===n);if(!r)return;let i=r.type!==`text`&&!(r.type===`video`&&fe().length<=1);Ht(e.clientX,e.clientY,[{label:N(`editor.menuAddVideoTrack`),fn:()=>He(`video`)},{label:N(`editor.menuAddAudioTrack`),fn:()=>He(`audio`)},{label:N(`editor.menuPaste`),kbd:`Ctrl V`,fn:Be,dis:!o},`-`,{label:N(`editor.menuRemoveTrack`,{name:r.label}),fn:()=>Ue(n),danger:!0,dis:!i}])}function Gt(){if(!g)return;let e=g.libraryScroll;if(p===`library`){let t=m.trim().toLowerCase(),n=ie().filter(e=>(e.duration??0)>0);t&&(n=n.filter(e=>`${e.name} ${e.game||``}`.toLowerCase().includes(t))),e.innerHTML=`
${n.map(e=>{let t=e.thumb_url?``:`
${Hm(Xm.film,24)}
`,n=[e.width?`${e.width}x${e.height}`:``,e.size?hc(e.size):``].filter(Boolean).join(` · `);return` + `).join(``),document.body.appendChild(r),r.querySelectorAll(`.ed-menu-item`).forEach(e=>{e.onclick=t=>{t.stopPropagation();let i=n[parseInt(e.dataset.i,10)];r.remove(),i&&i!==`-`&&!i.dis&&i.fn()}}),r.style.left=`${Math.max(8,Math.min(e,window.innerWidth-r.offsetWidth-8))}px`,r.style.top=`${Math.max(8,Math.min(t,window.innerHeight-r.offsetHeight-8))}px`;let i=e=>{r.contains(e.target)||(r.remove(),document.removeEventListener(`pointerdown`,i,!0))};window.setTimeout(()=>document.addEventListener(`pointerdown`,i,!0),0)}function Ut(e,t){e.preventDefault(),e.stopPropagation(),Ge(t);let n=ue(t);if(!n)return;let i=r>n.start+.2&&re.id===n);if(!r)return;let i=r.type!==`text`&&!(r.type===`video`&&fe().length<=1);Ht(e.clientX,e.clientY,[{label:N(`editor.menuAddVideoTrack`),fn:()=>He(`video`)},{label:N(`editor.menuAddAudioTrack`),fn:()=>He(`audio`)},{label:N(`editor.menuPaste`),kbd:`Ctrl V`,fn:Be,dis:!o},`-`,{label:N(`editor.menuRemoveTrack`,{name:r.label}),fn:()=>Ue(n),danger:!0,dis:!i}])}function Gt(){if(!g)return;let e=g.libraryScroll;if(p===`library`){let t=m.trim().toLowerCase(),n=ie().filter(e=>(e.duration??0)>0);t&&(n=n.filter(e=>`${e.name} ${e.game||``}`.toLowerCase().includes(t))),e.innerHTML=`
${n.map(e=>{let t=e.thumb_url?``:`
${fh(bh.film,24)}
`,n=[e.width?`${e.width}x${e.height}`:``,e.size?Rc(e.size):``].filter(Boolean).join(` · `);return`
@@ -110,21 +110,21 @@ Error generating stack: `+e.message+` ${e.game?`${A(e.game.toUpperCase())}`:``} ${k(e.duration??0)}
-
${A(Oc(e))}
+
${A(Zc(e))}
${A(n)}
-
`}).join(``)||`
${t?`${A(N(`editor.libNoMatch`))}
${A(N(`editor.libNoMatchBody`))}`:`${A(N(`editor.libEmpty`))}
${A(N(`editor.libEmptyBody`))}`}
`}
`}else e.innerHTML=p===`effects`?Kt():qt();Jt()}let Kt=()=>Wm.map(e=>` +
`}).join(``)||`
${t?`${A(N(`editor.libNoMatch`))}
${A(N(`editor.libNoMatchBody`))}`:`${A(N(`editor.libEmpty`))}
${A(N(`editor.libEmptyBody`))}`}
`}
`}else e.innerHTML=p===`effects`?Kt():qt();Jt()}let Kt=()=>mh.map(e=>`
- ${Hm(e.glyph,16)} + ${fh(e.glyph,16)}
-
${A(Ym(e.id))}
+
${A(yh(e.id))}
${A(N(`editor.fx.${e.id}.desc`))}
${e.len.toFixed(1)}s -
`).join(``),qt=()=>Km.map(e=>` + `).join(``),qt=()=>gh.map(e=>`
${A(N(`editor.textPreset.${e.id}.name`).toUpperCase())} - ${Gm[e.font].label} + ${hh[e.font].label}
-
${A(N(`editor.textPreset.${e.id}.sample`))}
-
`).join(``);function Jt(){g&&(g.libraryScroll.querySelectorAll(`.ed-lib-clip`).forEach(e=>{let t=e.dataset.slug;e.addEventListener(`dragstart`,e=>Yt(e,`clip`,t)),e.addEventListener(`dragend`,Xt),e.addEventListener(`dblclick`,()=>Ne(t))}),g.libraryScroll.querySelectorAll(`.ed-fx-row`).forEach(e=>{e.addEventListener(`dragstart`,t=>Yt(t,`fx`,e.dataset.fx)),e.addEventListener(`dragend`,Xt)}),g.libraryScroll.querySelectorAll(`.ed-text-row`).forEach(e=>{e.addEventListener(`dragstart`,t=>Yt(t,`text`,e.dataset.preset)),e.addEventListener(`dragend`,Xt)}))}function Yt(e,t,n){T={kind:t,id:n},e.dataTransfer.effectAllowed=`copy`,e.dataTransfer.setData(`text/plain`,`vice-ed:${t}:${n}`);let r=document.createElement(`div`);if(r.className=`clip-drag-ghost`,t===`clip`){let e=ie().find(e=>e.slug===n);r.innerHTML=e&&e.thumb_url?`${A(e.name||n)}`:`${A(n)}`}else{let e=t===`fx`?Jm(n)?Ym(n):n:Km.some(e=>e.id===n)?N(`editor.textPreset.${n}.name`):n;r.innerHTML=`${A(e)}`}document.body.appendChild(r),re=r,e.dataTransfer.setDragImage(r,24,20)}function Xt(){T=null,re&&(re.remove(),re=null),Bt()}function Zt(){if(!g)return;let e=g.stage;e.addEventListener(`dragover`,e=>{T&&T.kind===`text`&&e.preventDefault()}),e.addEventListener(`drop`,t=>{if(!T||T.kind!==`text`)return;t.preventDefault();let n=e.getBoundingClientRect();Pe(T.id,{t:r,x:(t.clientX-n.left)/n.width*100,y:(t.clientY-n.top)/n.height*100}),Xt()}),e.addEventListener(`pointerdown`,t=>{let n=t.target;(n===e||n.tagName===`VIDEO`)&&Ge(null)})}function Qt(e){if(!h||!t)return;let n=e.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n.isContentEditable||document.querySelector(`.scrim`))return;let a=e.metaKey||e.ctrlKey;e.code===`Space`?(e.preventDefault(),yt(!i)):e.key===`Delete`||e.key===`Backspace`?Ve():a&&!e.shiftKey&&(e.key===`z`||e.key===`Z`)?(e.preventDefault(),Ce()):a&&e.shiftKey&&(e.key===`z`||e.key===`Z`)?(e.preventDefault(),we()):a&&(e.key===`c`||e.key===`C`)?(e.preventDefault(),ze()):a&&(e.key===`v`||e.key===`V`)?(e.preventDefault(),Be()):a&&(e.key===`d`||e.key===`D`)?(e.preventDefault(),Re()):!a&&(e.key===`s`||e.key===`S`)?Ie():e.key===`ArrowLeft`?wt(Math.max(0,r-(e.shiftKey?.1:1))):e.key===`ArrowRight`?wt(Math.min(j(),r+(e.shiftKey?.1:1))):e.key===`Escape`?Ge(null):e.key===`+`||e.key===`=`?St(1.3):e.key===`-`&&St(1/1.3)}function $t(e){g=e,h=!0,document.addEventListener(`keydown`,Qt),Zt(),xe(),Gt(),At(),xt(!0)}function en(){h=!1,document.removeEventListener(`keydown`,Qt),yt(!1),b&&cancelAnimationFrame(b),b=null,Je(),ne?.disconnect(),ne=null,document.getElementById(`ed-menu`)?.remove(),l&&be(),g=null}return{mount:$t,destroy:en,subscribe(e){return D.add(e),()=>D.delete(e)},snapshot:ge,load:ve,setClips(){c&&(xe(),Gt(),At())},onClipDeleted(e){if(!t)return;let r=t.items.length;t.items=t.items.filter(t=>t.clipId!==e),n&&!ue(n)&&(n=null),xe(),r!==t.items.length&&(At(),xt(!0))},async onProjectChanged(){!c||l||(await ve(),n&&!ue(n)&&(n=null),At(),xt(!0))},saveNow:be,isDirty:()=>l,project:()=>t,setTab(e){p=e,Gt(),_e()},search(e){m=e,Gt(),_e()},zoom:St,fit:Ct,seek:wt,setPlaying:yt,split:Ie,detachAudio:Le,duplicate:Re,remove:Ve,addTrack:He,reset:We,select:Ge,inspectorChange:vt,end:j}}var $m,eh,th,nh,rh,ih,ah,oh,sh=o((()=>{vc(),Ar(),Ll(),Mc(),Zm(),$m=4,eh=48,th=50,nh=54,rh=.15,ih=2,ah=350,oh=()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}));function ch(){let{state:e,notify:t,dispatch:n}=Lc(),{clips:r,accent:i,customAccent:a,editorProjectRevision:o,config:s}=e,c=Qs(i,a).ramp.base,l=(0,dh.useRef)(null),u=(0,dh.useRef)(null),d=(0,dh.useRef)(null),f=(0,dh.useRef)(null),p=(0,dh.useRef)(null),m=(0,dh.useRef)(null),h=(0,dh.useRef)(null),g=(0,dh.useRef)(r);g.current=r;let _=(0,dh.useRef)(c);_.current=c;let v=(0,dh.useRef)(null);v.current||(v.current=Qm({clips:()=>g.current,notify:(e,n=`accent`)=>t({kind:n===`error`?`error`:`info`,title:e,tone:n,holdMs:n===`error`?6e3:3e3}),accent:()=>_.current}));let y=v.current,[b,x]=(0,dh.useState)(()=>y.snapshot()),[S,C]=(0,dh.useState)(!1),[w,ee]=(0,dh.useState)(!1);(0,dh.useEffect)(()=>y.subscribe(x),[y]),(0,dh.useEffect)(()=>{let e=!1;return y.load().then(()=>{e||!l.current||y.mount({stage:l.current,stageWrap:u.current,fadeOverlay:d.current,timelineCanvas:f.current,timelineScroll:p.current,libraryScroll:m.current})}),()=>{e=!0,y.destroy()}},[y]),(0,dh.useEffect)(()=>{y.setClips(r)},[y,r]),(0,dh.useEffect)(()=>{o>0&&y.onProjectChanged()},[y,o]);let[te,ne]=(0,dh.useState)(()=>Math.max(240,Math.min(324,Math.round(window.innerWidth*.22)))),[T,re]=(0,dh.useState)(300),E=e=>t=>{t.preventDefault();let n=t.currentTarget;try{n.setPointerCapture(t.pointerId)}catch{}let r=e===`x`?t.clientX:t.clientY,i=e===`x`?te:T,a=t=>{let n=(e===`x`?t.clientX:t.clientY)-r;if(e===`x`)ne(Math.max(232,Math.min(520,i+n)));else{let e=Math.round((h.current?.clientHeight??800)*.7);re(Math.max(170,Math.min(e,i-n)))}},o=()=>{n.removeEventListener(`pointermove`,a),n.removeEventListener(`pointerup`,o)};n.addEventListener(`pointermove`,a),n.addEventListener(`pointerup`,o)},D=b.selected,ie=D?.kind===`text`;return(0,$.jsxs)(`div`,{className:`editor`,ref:h,style:{"--ed-lib-w":`${te}px`,"--ed-tl-h":`${T}px`},children:[(0,$.jsxs)(`div`,{className:`ed-top`,children:[(0,$.jsxs)(`aside`,{className:`ed-panel ed-library`,children:[(0,$.jsxs)(`div`,{className:`ed-tabs`,role:`tablist`,children:[(0,$.jsx)(`div`,{className:`ed-tab-glider`,style:{left:`${ph.findIndex(e=>e[0]===b.tab)*33.333}%`}}),ph.map(([e,t])=>(0,$.jsx)(`button`,{type:`button`,role:`tab`,className:`ed-tab`,"aria-selected":b.tab===e,onClick:()=>y.setTab(e),children:t()},e))]}),b.tab===`library`?(0,$.jsxs)(`div`,{className:`ed-lib-search`,children:[(0,$.jsx)(hh,{}),(0,$.jsx)(`input`,{value:b.query,placeholder:N(`editor.searchClips`),"aria-label":N(`editor.searchClips`),spellCheck:!1,onChange:e=>y.search(e.target.value)})]}):null,(0,$.jsx)(`div`,{className:`ed-lib-scroll`,ref:m}),(0,$.jsx)(`p`,{className:`ed-lib-hint`,children:N(fh[b.tab])})]}),(0,$.jsx)(`div`,{className:`ed-resize ed-resize-x`,onPointerDown:E(`x`),children:(0,$.jsx)(`span`,{})}),(0,$.jsxs)(`div`,{className:`ed-panel ed-preview`,children:[(0,$.jsxs)(`div`,{className:`ed-preview-main`,children:[(0,$.jsx)(`div`,{className:`ed-stage-wrap`,ref:u,children:(0,$.jsxs)(`div`,{className:`ed-stage`,ref:l,children:[b.empty?(0,$.jsxs)(`div`,{className:`ed-stage-empty`,children:[(0,$.jsx)(`b`,{children:N(`editor.nothingAtPlayhead`)}),(0,$.jsx)(`span`,{children:N(`editor.dragFromLibrary`)})]}):null,b.preparing?(0,$.jsx)(`div`,{className:`ed-stage-preparing`,children:N(`editor.preparingMedia`)}):null,(0,$.jsx)(`div`,{className:`ed-fade-overlay`,ref:d})]})}),D?.kind===`audio`?(0,$.jsxs)(`div`,{className:`ed-inspector ed-audio-inspector`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:N(`editor.audioTrack`)}),(0,$.jsxs)(`div`,{className:`ed-insp-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.audioSource`)}),(0,$.jsx)(od,{label:N(`editor.audioSource`),value:String(D.audioStream??0),onChange:e=>y.inspectorChange(`audioStream`,Number(e)),options:(r.find(e=>e.slug===D.clipId)?.audio_tracks??[]).map(e=>[String(e.index),e.title||N(`editor.recordedTrack`,{number:e.index+1})])})]}),(0,$.jsxs)(`label`,{className:`ed-audio-volume`,children:[(0,$.jsxs)(`span`,{children:[N(`editor.audioVolume`),` `,Math.round((D.volume??1)*100),`%`]}),(0,$.jsx)(`input`,{type:`range`,min:`0`,max:`100`,step:`1`,value:Math.round((D.volume??1)*100),onChange:e=>y.inspectorChange(`volume`,Number(e.target.value)/100)})]}),(0,$.jsxs)(`label`,{className:`ed-audio-mute`,children:[(0,$.jsx)(`span`,{children:N(`editor.audioMuted`)}),(0,$.jsx)(ad,{label:N(`editor.audioMuted`),checked:!!D.muted,onChange:e=>y.inspectorChange(`muted`,e)})]}),(0,$.jsx)(`p`,{className:`dim`,children:N(`editor.detachedTracksHelp`)})]}):null,ie?(0,$.jsxs)(`div`,{className:`ed-inspector`,children:[(0,$.jsxs)(`div`,{className:`ed-insp-head`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:N(`editor.titleSection`)}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn`,onClick:()=>y.select(null),"aria-label":N(`editor.closeInspector`),children:(0,$.jsx)(fl,{size:12})})]}),(0,$.jsx)(cd,{label:N(`editor.titleText`),value:D.text??``,placeholder:N(`editor.titleText`),onChange:e=>y.inspectorChange(`text`,e)}),(0,$.jsxs)(`label`,{className:`ed-insp-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.font`)}),(0,$.jsx)(od,{label:N(`editor.font`),value:D.font??`display`,onChange:e=>y.inspectorChange(`font`,e),options:Object.entries(Gm).map(([e,t])=>[e,t.label])})]}),(0,$.jsxs)(`label`,{className:`ed-insp-field`,children:[(0,$.jsxs)(`span`,{children:[N(`editor.size`),` `,(0,$.jsxs)(`b`,{className:`mono`,children:[D.size,`px`]})]}),(0,$.jsx)(`input`,{type:`range`,className:`ed-insp-range`,min:16,max:400,step:2,value:D.size??64,"aria-label":N(`editor.titleSize`),onChange:e=>y.inspectorChange(`size`,e.target.value)})]}),(0,$.jsxs)(`label`,{className:`ed-insp-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.colour`)}),(0,$.jsx)(`div`,{className:`ed-swatches`,children:qm.map(e=>(0,$.jsx)(`button`,{type:`button`,className:`ed-swatch`,"data-active":D.color===e||void 0,style:{background:e},title:e,"aria-label":N(`editor.useColour`,{color:e}),onClick:()=>y.inspectorChange(`color`,e)},e))})]}),(0,$.jsxs)(`p`,{className:`ed-insp-pos`,children:[`x `,Math.round(D.x??0),`% · y `,Math.round(D.y??0),`%, drag it on the preview`]}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>y.remove(),children:N(`editor.removeTitle`)})]}):null]}),(0,$.jsxs)(`div`,{className:`ed-transport`,children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>C(!0),children:N(`editor.reset`)}),(0,$.jsx)(`div`,{className:`ed-spacer`}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn ed-round`,onClick:()=>y.seek(0),title:N(`editor.backToStart`),"aria-label":N(`editor.backToStart`),children:(0,$.jsx)(gh,{})}),(0,$.jsx)(`button`,{type:`button`,className:`ed-play`,onClick:()=>y.setPlaying(!b.playing),title:N(`editor.playPause`),"aria-label":b.playing?N(`editor.pause`):N(`editor.play`),children:b.playing?(0,$.jsx)(vh,{}):(0,$.jsx)(_h,{})}),(0,$.jsx)(`div`,{className:`ed-spacer`}),(0,$.jsxs)(`span`,{className:`ed-time mono`,children:[Um(b.playhead),` `,(0,$.jsxs)(`span`,{className:`dim`,children:[`/ `,Um(b.duration)]})]}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-sm`,disabled:b.duration<=0,onClick:()=>ee(!0),children:N(`editor.exportBtn`)})]})]})]}),(0,$.jsx)(`div`,{className:`ed-resize ed-resize-y`,onPointerDown:E(`y`),children:(0,$.jsx)(`span`,{})}),(0,$.jsxs)(`div`,{className:`ed-panel ed-timeline`,children:[(0,$.jsxs)(`div`,{className:`ed-tl-toolbar`,children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!b.canSplit,onClick:()=>y.split(),children:N(`editor.split`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!b.canDetach,onClick:()=>y.detachAudio(),children:N(`editor.detachAudio`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!b.canDuplicate,onClick:()=>y.duplicate(),children:N(`editor.duplicate`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,disabled:!b.canDelete,onClick:()=>y.remove(),children:N(`common.delete`)}),(0,$.jsx)(`div`,{className:`ed-spacer`}),(0,$.jsxs)(`span`,{className:`ed-pps mono`,children:[Math.round(b.pps),` px/s`]}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn`,onClick:()=>y.zoom(1/1.3),title:N(`editor.zoomOut`),"aria-label":N(`editor.zoomOut`),children:(0,$.jsx)(yh,{})}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn`,onClick:()=>y.zoom(1.3),title:N(`editor.zoomIn`),"aria-label":N(`editor.zoomIn`),children:(0,$.jsx)(bh,{})}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>y.fit(),children:N(`editor.fit`)}),(0,$.jsx)(uh,{onAdd:e=>y.addTrack(e)})]}),(0,$.jsx)(`div`,{className:`ed-tl-scroll`,ref:p,children:(0,$.jsx)(`div`,{className:`ed-tl-canvas`,ref:f})})]}),(0,$.jsx)(wl,{open:S,title:N(`editor.clearTitle`),onClose:()=>C(!1),footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>C(!1),children:N(`common.keepIt`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{C(!1),y.reset()},children:N(`editor.clear`)})]}),children:(0,$.jsx)(`p`,{children:N(`editor.clearBody`)})}),(0,$.jsx)(lh,{open:w,onClose:()=>ee(!1),engine:y,duration:b.duration,libraryDir:s?.output?.directory??`~/Videos/Vice`,accent:c,recording:e.status.recording||e.status.session_active,notify:t,onExported:()=>n({type:`setView`,view:`editor`})})]})}function lh({open:e,onClose:t,engine:n,duration:r,libraryDir:i,accent:a,recording:o,notify:s}){let[c,l]=(0,dh.useState)(``),[u,d]=(0,dh.useState)(`library`),[f,p]=(0,dh.useState)(``),[m,h]=(0,dh.useState)(!0),[g,_]=(0,dh.useState)(`form`),[v,y]=(0,dh.useState)(0),[b,x]=(0,dh.useState)(``),S=(0,dh.useRef)(null);(0,dh.useEffect)(()=>{e&&(_(`form`),y(0))},[e]),(0,dh.useEffect)(()=>{if(e)return lc(e=>{let t=e;!t.type?.startsWith(`export_`)||t.job_id!==S.current||(t.type===`export_progress`?y(Math.min(100,Math.round((t.progress??0)*100))):t.type===`export_done`?(S.current=null,x(t.path??``),_(`done`)):t.type===`export_error`&&(S.current=null,_(`form`),s({kind:t.canceled?`info`:`error`,title:t.canceled?N(`editor.exportCanceled`):N(`editor.exportFailed`),detail:t.canceled?void 0:t.error,tone:t.canceled?`neutral`:`error`,holdMs:7e3})))})},[e,s]);let C=u===`library`?i:u===`videos`?`~/Videos`:f.trim()||``,w=`${Math.round(r)}s · H.264 and AAC into ${C||`a folder you pick`}/${(c.trim()||`Vice_Edit_N`).replace(/\.mp4$/i,``)}.mp4`,ee=async()=>{if(u===`custom`&&!f.trim()){s({kind:`error`,title:N(`editor.pickFolder`),tone:`error`,holdMs:4e3});return}n.isDirty()&&await n.saveNow();let e={project:n.project(),location:u,add_to_library:m,accent:a};c.trim()&&(e.filename=c.trim()),u===`custom`&&(e.path=f.trim());try{let t=await U.startExport(e);if(t.ok===!1||!t.job_id)throw Error(t.error||t.errors?.[0]||N(`editor.exportRefused`));S.current=t.job_id,x(t.path??``),y(0),_(`busy`)}catch(e){s({kind:`error`,title:N(`editor.errStartExport`),detail:e.message,tone:`error`,holdMs:8e3})}};return(0,$.jsx)(wl,{open:e,title:N(`editor.exportVideo`),wide:!0,onClose:()=>{g!==`busy`&&t()},footer:g===`form`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:t,children:N(`common.cancel`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void ee(),children:N(`editor.startExport`)})]}):g===`busy`?(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>{S.current&&U.cancelExport(S.current).catch(()=>{})},children:N(`editor.cancelExport`)}):(0,$.jsx)(`button`,{type:`button`,className:`btn`,onClick:t,children:N(`editor.done`)}),children:g===`form`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.saveAs`)}),(0,$.jsx)(cd,{label:N(`editor.exportFilename`),wide:!0,value:c,placeholder:N(`editor.exportFilenamePlaceholder`),onChange:l})]}),(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.location`)}),(0,$.jsx)(od,{label:N(`editor.exportLocation`),value:u,onChange:d,options:[[`library`,N(`editor.viceLibrary`)],[`videos`,`~/Videos`],[`custom`,N(`editor.customPath`)]]})]}),u===`custom`?(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.folder`)}),(0,$.jsx)(cd,{label:N(`editor.exportFolder`),wide:!0,mono:!0,value:f,placeholder:`/home/you/Videos/edits`,onChange:p})]}):null,u===`library`?null:(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.alsoAddToLibrary`)}),(0,$.jsx)(ad,{label:N(`editor.alsoAddToLibrary`),checked:m,onChange:h})]}),(0,$.jsx)(`p`,{className:`ed-export-summary mono`,children:w}),o?(0,$.jsx)(`p`,{className:`ed-export-warn`,children:`Vice is recording right now. Exporting will compete with the encoder for the GPU, so expect the game to stutter.`}):null]}):g===`busy`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{children:N(`editor.encoding`)}),(0,$.jsx)(`div`,{className:`ed-progress`,children:(0,$.jsx)(`div`,{className:`ed-progress-fill`,style:{width:`${v}%`}})}),(0,$.jsx)(`p`,{className:`mono ed-progress-label`,children:N(`editor.encodingProgress`,{percent:v})})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{children:N(`editor.exported`)}),(0,$.jsx)(`p`,{className:`mono ed-export-path`,children:b})]})})}function uh({onAdd:e}){let[t,n]=(0,dh.useState)(!1),[r,i]=(0,dh.useState)({x:0,y:0}),a=(0,dh.useRef)(null),o=(0,dh.useRef)(null);return(0,dh.useLayoutEffect)(()=>{let e=o.current,n=a.current?.querySelector(`button`);if(!t||!e||!n)return;let r=n.getBoundingClientRect(),s=e.offsetWidth,c=e.offsetHeight;i({x:Math.max(8,Math.min(r.right-s,window.innerWidth-s-8)),y:Math.max(8,r.top-c-6)})},[t]),(0,dh.useEffect)(()=>{if(!t)return;let e=e=>{a.current?.contains(e.target)||n(!1)},r=window.setTimeout(()=>document.addEventListener(`pointerdown`,e,!0),0);return()=>{window.clearTimeout(r),document.removeEventListener(`pointerdown`,e,!0)}},[t]),(0,$.jsxs)(`div`,{className:`ed-addtrack`,ref:a,children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>n(e=>!e),children:N(`editor.addTrack`)}),t?(0,$.jsxs)(`div`,{className:`ed-addtrack-menu`,role:`menu`,ref:o,style:{left:r.x,top:r.y},children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>{e(`video`),n(!1)},children:N(`editor.videoTrack`)}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>{e(`audio`),n(!1)},children:N(`editor.audioTrack`)})]}):null]})}var dh,$,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh=o((()=>{dh=l(d()),cc(),fc(),ic(),Wc(),sh(),Zm(),Dl(),Cl(),md(),Ar(),$=M(),fh={library:`editor.libHintLibrary`,effects:`editor.libHintEffects`,text:`editor.libHintText`},ph=[[`library`,()=>N(`editor.tabLibrary`)],[`effects`,()=>N(`editor.tabEffects`)],[`text`,()=>N(`editor.tabText`)]],mh={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},hh=()=>(0,$.jsxs)(`svg`,{...mh,width:13,height:13,children:[(0,$.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,$.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),gh=()=>(0,$.jsxs)(`svg`,{...mh,width:13,height:13,children:[(0,$.jsx)(`polygon`,{points:`19 20 9 12 19 4 19 20`}),(0,$.jsx)(`line`,{x1:`5`,x2:`5`,y1:`19`,y2:`5`})]}),_h=()=>(0,$.jsx)(`svg`,{viewBox:`0 0 24 24`,width:14,height:14,fill:`currentColor`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M7 4l13 8-13 8z`})}),vh=()=>(0,$.jsx)(`svg`,{viewBox:`0 0 24 24`,width:14,height:14,fill:`currentColor`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M7 4h3.5v16H7zM13.5 4H17v16h-3.5z`})}),yh=()=>(0,$.jsx)(`svg`,{...mh,width:12,height:12,children:(0,$.jsx)(`path`,{d:`M5 12h14`})}),bh=()=>(0,$.jsx)(`svg`,{...mh,width:12,height:12,children:(0,$.jsx)(`path`,{d:`M5 12h14M12 5v14`})})}));function Sh(){let{state:e,notify:t}=Lc(),{status:n,config:r,clips:i}=e,[a,o]=(0,Ch.useState)(null),s=(0,Ch.useMemo)(()=>{let e=i.reduce((e,t)=>e+(t.duration??0),0),t=i.reduce((e,t)=>e+(t.size??0),0);return{count:i.length,bytes:t,footage:e<60?`${Math.round(e)}s`:`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}},[i]),c=r?.recording??{},l=n.version||``,u=[[N(`about.version`),l||`unknown`],[N(`about.backend`),n.backend||c.backend||`auto`],[N(`about.buffer`),mc(c.buffer_duration??120)],[N(`about.frameRate`),`${c.fps??60} fps`],[N(`about.clipsOnDisk`),`${s.count} · ${hc(s.bytes)}`],[N(`about.totalFootage`),s.footage]],d=async()=>{await Gc(Th)?t({kind:`info`,title:N(`about.commandCopied`),tone:`accent`,holdMs:4e3}):o(Th)};return(0,wh.jsxs)(`div`,{className:`about`,children:[(0,wh.jsxs)(`header`,{className:`about-head`,children:[(0,wh.jsx)(`h1`,{children:N(`about.title`)}),(0,wh.jsx)(`p`,{children:N(`about.subtitle`)})]}),(0,wh.jsxs)(`section`,{className:`about-hero`,children:[(0,wh.jsx)(`span`,{className:`about-mark`,children:(0,wh.jsx)(gl,{size:30})}),(0,wh.jsxs)(`div`,{children:[(0,wh.jsx)(`h2`,{children:(0,wh.jsx)(Hd,{height:26})}),(0,wh.jsx)(`p`,{children:N(`about.tagline`)}),(0,wh.jsxs)(`div`,{className:`about-chips`,children:[(0,wh.jsx)(`span`,{className:`about-chip mono`,children:l||`unknown`}),(0,wh.jsx)(`span`,{className:`about-chip mono`,children:`GPL-3.0`}),(0,wh.jsx)(`span`,{className:`about-chip mono`,children:N(`about.waylandAndX11`)})]})]})]}),(0,wh.jsxs)(`div`,{className:`about-grid`,children:[(0,wh.jsxs)(`section`,{className:`about-card`,children:[(0,wh.jsx)(`h3`,{className:`eyebrow`,children:N(`about.system`)}),u.map(([e,t])=>(0,wh.jsxs)(`div`,{className:`about-row`,children:[(0,wh.jsx)(`span`,{children:e}),(0,wh.jsx)(`b`,{className:`mono`,children:t})]},e))]}),(0,wh.jsxs)(`section`,{className:`about-card`,children:[(0,wh.jsx)(`h3`,{className:`eyebrow`,children:N(`about.credits`)}),(0,wh.jsxs)(`div`,{className:`credit`,children:[(0,wh.jsx)(`span`,{className:`credit-avatar`,children:`A`}),(0,wh.jsxs)(`div`,{children:[(0,wh.jsx)(`b`,{children:`Andrew Marin`}),(0,wh.jsx)(`span`,{children:N(`about.creator`)})]})]}),(0,wh.jsxs)(`div`,{className:`credit`,children:[(0,wh.jsx)(`span`,{className:`credit-avatar credit-avatar-dim`,children:`C`}),(0,wh.jsxs)(`div`,{children:[(0,wh.jsx)(`b`,{children:N(`about.community`)}),(0,wh.jsx)(`span`,{children:N(`about.communityHelp`)})]})]})]})]}),(0,wh.jsxs)(`section`,{className:`about-danger`,children:[(0,wh.jsx)(`h3`,{className:`eyebrow`,children:N(`about.dangerZone`)}),(0,wh.jsx)(`p`,{children:N(`about.uninstallHelp`)}),(0,wh.jsxs)(`div`,{className:`about-cmd`,children:[(0,wh.jsx)(`code`,{className:`mono`,children:Th}),(0,wh.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>void d(),children:N(`about.copy`)})]})]}),(0,wh.jsxs)(wl,{open:a!==null,title:N(`about.copyTitle`),onClose:()=>o(null),children:[(0,wh.jsx)(`p`,{children:N(`about.copyByHand`)}),(0,wh.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:a??``,rows:2})]})]})}var Ch,wh,Th,Eh=o((()=>{Ch=l(d()),Wc(),Kc(),vc(),Wd(),Ar(),Dl(),Cl(),wh=M(),Th=`vice uninstall`})),Dh=s((()=>{var e=l(d()),t=_();jn(),Mn(),Nn(),Pn(),Fn(),In(),Ln(),Rn(),zn(),Bn(),Vn(),Ar(),ic(),Wc(),Fu(),vf(),Tf(),Ip(),Bp(),Up(),Vm(),xh(),Eh();var n=M();function r(){let{state:t}=Lc(),{accent:r,customAccent:a,ready:o,view:s}=t,{ramp:c,theme:l}=Qs(r,a),[,u]=(0,e.useState)(0);return(0,e.useEffect)(()=>hr(()=>u(e=>e+1)),[]),(0,e.useEffect)(()=>{if(!o)return;let e=document.getElementById(`boot`);if(!e)return;e.classList.add(`boot-done`);let t=()=>e.remove();e.addEventListener(`transitionend`,t,{once:!0});let n=window.setTimeout(t,1200);return()=>window.clearTimeout(n)},[o]),(0,e.useEffect)(()=>{let e=document.documentElement,t=Xs(c);for(let[n,r]of Object.entries(t))e.style.setProperty(n,r)},[c]),(0,n.jsxs)(vn,{theme:l,mode:`dark`,children:[(0,n.jsx)(`div`,{className:`vice-ambient`,style:Xs(c),"aria-hidden":`true`}),(0,n.jsx)(Au,{children:(0,n.jsx)(`div`,{className:`vice-app`,style:Xs(c),children:(0,n.jsx)(yf,{children:(0,n.jsx)(sf,{children:(0,n.jsx)(i,{view:s})})})})})]})}function i({view:e}){return e===`home`?(0,n.jsx)(Cp,{}):e===`clips`?(0,n.jsx)(Lp,{}):e===`images`?(0,n.jsx)(Vp,{}):e===`settings`?(0,n.jsx)(Dm,{}):e===`editor`?(0,n.jsx)(ch,{}):(0,n.jsx)(Sh,{})}wr(),(0,t.createRoot)(document.getElementById(`root`)).render((0,n.jsx)(e.StrictMode,{children:(0,n.jsx)(Ic,{children:(0,n.jsx)(r,{})})}))}));export default Dh(); \ No newline at end of file +
${A(N(`editor.textPreset.${e.id}.sample`))}
+ `).join(``);function Jt(){g&&(g.libraryScroll.querySelectorAll(`.ed-lib-clip`).forEach(e=>{let t=e.dataset.slug;e.addEventListener(`dragstart`,e=>Yt(e,`clip`,t)),e.addEventListener(`dragend`,Xt),e.addEventListener(`dblclick`,()=>Ne(t))}),g.libraryScroll.querySelectorAll(`.ed-fx-row`).forEach(e=>{e.addEventListener(`dragstart`,t=>Yt(t,`fx`,e.dataset.fx)),e.addEventListener(`dragend`,Xt)}),g.libraryScroll.querySelectorAll(`.ed-text-row`).forEach(e=>{e.addEventListener(`dragstart`,t=>Yt(t,`text`,e.dataset.preset)),e.addEventListener(`dragend`,Xt)}))}function Yt(e,t,n){T={kind:t,id:n},e.dataTransfer.effectAllowed=`copy`,e.dataTransfer.setData(`text/plain`,`vice-ed:${t}:${n}`);let r=document.createElement(`div`);if(r.className=`clip-drag-ghost`,t===`clip`){let e=ie().find(e=>e.slug===n);r.innerHTML=e&&e.thumb_url?`${A(e.name||n)}`:`${A(n)}`}else{let e=t===`fx`?vh(n)?yh(n):n:gh.some(e=>e.id===n)?N(`editor.textPreset.${n}.name`):n;r.innerHTML=`${A(e)}`}document.body.appendChild(r),re=r,e.dataTransfer.setDragImage(r,24,20)}function Xt(){T=null,re&&(re.remove(),re=null),Bt()}function Zt(){if(!g)return;let e=g.stage;e.addEventListener(`dragover`,e=>{T&&T.kind===`text`&&e.preventDefault()}),e.addEventListener(`drop`,t=>{if(!T||T.kind!==`text`)return;t.preventDefault();let n=e.getBoundingClientRect();Pe(T.id,{t:r,x:(t.clientX-n.left)/n.width*100,y:(t.clientY-n.top)/n.height*100}),Xt()}),e.addEventListener(`pointerdown`,t=>{let n=t.target;(n===e||n.tagName===`VIDEO`)&&Ge(null)})}function Qt(e){if(!h||!t)return;let n=e.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n.isContentEditable||document.querySelector(`.scrim`))return;let a=e.metaKey||e.ctrlKey;e.code===`Space`?(e.preventDefault(),yt(!i)):e.key===`Delete`||e.key===`Backspace`?Ve():a&&!e.shiftKey&&(e.key===`z`||e.key===`Z`)?(e.preventDefault(),Ce()):a&&e.shiftKey&&(e.key===`z`||e.key===`Z`)?(e.preventDefault(),we()):a&&(e.key===`c`||e.key===`C`)?(e.preventDefault(),ze()):a&&(e.key===`v`||e.key===`V`)?(e.preventDefault(),Be()):a&&(e.key===`d`||e.key===`D`)?(e.preventDefault(),Re()):!a&&(e.key===`s`||e.key===`S`)?Ie():e.key===`ArrowLeft`?wt(Math.max(0,r-(e.shiftKey?.1:1))):e.key===`ArrowRight`?wt(Math.min(j(),r+(e.shiftKey?.1:1))):e.key===`Escape`?Ge(null):e.key===`+`||e.key===`=`?St(1.3):e.key===`-`&&St(1/1.3)}function $t(e){g=e,h=!0,document.addEventListener(`keydown`,Qt),Zt(),xe(),Gt(),At(),xt(!0)}function en(){h=!1,document.removeEventListener(`keydown`,Qt),yt(!1),b&&cancelAnimationFrame(b),b=null,Je(),ne?.disconnect(),ne=null,document.getElementById(`ed-menu`)?.remove(),l&&be(),g=null}return{mount:$t,destroy:en,subscribe(e){return D.add(e),()=>D.delete(e)},snapshot:ge,load:ve,setClips(){c&&(xe(),Gt(),At())},onClipDeleted(e){if(!t)return;let r=t.items.length;t.items=t.items.filter(t=>t.clipId!==e),n&&!ue(n)&&(n=null),xe(),r!==t.items.length&&(At(),xt(!0))},async onProjectChanged(){!c||l||(await ve(),n&&!ue(n)&&(n=null),At(),xt(!0))},saveNow:be,isDirty:()=>l,project:()=>t,setTab(e){p=e,Gt(),_e()},search(e){m=e,Gt(),_e()},zoom:St,fit:Ct,seek:wt,setPlaying:yt,split:Ie,detachAudio:Le,duplicate:Re,remove:Ve,addTrack:He,reset:We,select:Ge,inspectorChange:vt,end:j}}var Ch,wh,Th,Eh,Dh,Oh,kh,Ah,jh=o((()=>{Vc(),P(),ou(),tl(),xh(),Ch=4,wh=48,Th=50,Eh=54,Dh=.15,Oh=2,kh=350,Ah=()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}));function Mh(){let{state:e,notify:t,dispatch:n}=ol(),{clips:r,accent:i,customAccent:a,editorProjectRevision:o,config:s}=e,c=xc(i,a).ramp.base,l=(0,Fh.useRef)(null),u=(0,Fh.useRef)(null),d=(0,Fh.useRef)(null),f=(0,Fh.useRef)(null),p=(0,Fh.useRef)(null),m=(0,Fh.useRef)(null),h=(0,Fh.useRef)(null),g=(0,Fh.useRef)(r);g.current=r;let _=(0,Fh.useRef)(c);_.current=c;let v=(0,Fh.useRef)(null);v.current||(v.current=Sh({clips:()=>g.current,notify:(e,n=`accent`)=>t({kind:n===`error`?`error`:`info`,title:e,tone:n,holdMs:n===`error`?6e3:3e3}),accent:()=>_.current}));let y=v.current,[b,x]=(0,Fh.useState)(()=>y.snapshot()),[S,C]=(0,Fh.useState)(!1),[w,ee]=(0,Fh.useState)(!1);(0,Fh.useEffect)(()=>y.subscribe(x),[y]),(0,Fh.useEffect)(()=>{let e=!1;return y.load().then(()=>{e||!l.current||y.mount({stage:l.current,stageWrap:u.current,fadeOverlay:d.current,timelineCanvas:f.current,timelineScroll:p.current,libraryScroll:m.current})}),()=>{e=!0,y.destroy()}},[y]),(0,Fh.useEffect)(()=>{y.setClips(r)},[y,r]),(0,Fh.useEffect)(()=>{o>0&&y.onProjectChanged()},[y,o]);let[te,ne]=(0,Fh.useState)(()=>Math.max(240,Math.min(324,Math.round(window.innerWidth*.22)))),[T,re]=(0,Fh.useState)(300),E=e=>t=>{t.preventDefault();let n=t.currentTarget;try{n.setPointerCapture(t.pointerId)}catch{}let r=e===`x`?t.clientX:t.clientY,i=e===`x`?te:T,a=t=>{let n=(e===`x`?t.clientX:t.clientY)-r;if(e===`x`)ne(Math.max(232,Math.min(520,i+n)));else{let e=Math.round((h.current?.clientHeight??800)*.7);re(Math.max(170,Math.min(e,i-n)))}},o=()=>{n.removeEventListener(`pointermove`,a),n.removeEventListener(`pointerup`,o)};n.addEventListener(`pointermove`,a),n.addEventListener(`pointerup`,o)},D=b.selected,ie=D?.kind===`text`;return(0,$.jsxs)(`div`,{className:`editor`,ref:h,style:{"--ed-lib-w":`${te}px`,"--ed-tl-h":`${T}px`},children:[(0,$.jsxs)(`div`,{className:`ed-top`,children:[(0,$.jsxs)(`aside`,{className:`ed-panel ed-library`,children:[(0,$.jsxs)(`div`,{className:`ed-tabs`,role:`tablist`,children:[(0,$.jsx)(`div`,{className:`ed-tab-glider`,style:{left:`${Lh.findIndex(e=>e[0]===b.tab)*33.333}%`}}),Lh.map(([e,t])=>(0,$.jsx)(`button`,{type:`button`,role:`tab`,className:`ed-tab`,"aria-selected":b.tab===e,onClick:()=>y.setTab(e),children:t()},e))]}),b.tab===`library`?(0,$.jsxs)(`div`,{className:`ed-lib-search`,children:[(0,$.jsx)(zh,{}),(0,$.jsx)(`input`,{value:b.query,placeholder:N(`editor.searchClips`),"aria-label":N(`editor.searchClips`),spellCheck:!1,onChange:e=>y.search(e.target.value)})]}):null,(0,$.jsx)(`div`,{className:`ed-lib-scroll`,ref:m}),(0,$.jsx)(`p`,{className:`ed-lib-hint`,children:N(Ih[b.tab])})]}),(0,$.jsx)(`div`,{className:`ed-resize ed-resize-x`,onPointerDown:E(`x`),children:(0,$.jsx)(`span`,{})}),(0,$.jsxs)(`div`,{className:`ed-panel ed-preview`,children:[(0,$.jsxs)(`div`,{className:`ed-preview-main`,children:[(0,$.jsx)(`div`,{className:`ed-stage-wrap`,ref:u,children:(0,$.jsxs)(`div`,{className:`ed-stage`,ref:l,children:[b.empty?(0,$.jsxs)(`div`,{className:`ed-stage-empty`,children:[(0,$.jsx)(`b`,{children:N(`editor.nothingAtPlayhead`)}),(0,$.jsx)(`span`,{children:N(`editor.dragFromLibrary`)})]}):null,b.preparing?(0,$.jsx)(`div`,{className:`ed-stage-preparing`,children:N(`editor.preparingMedia`)}):null,(0,$.jsx)(`div`,{className:`ed-fade-overlay`,ref:d})]})}),D?.kind===`audio`?(0,$.jsxs)(`div`,{className:`ed-inspector ed-audio-inspector`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:N(`editor.audioTrack`)}),(0,$.jsxs)(`div`,{className:`ed-insp-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.audioSource`)}),(0,$.jsx)(Ad,{label:N(`editor.audioSource`),value:String(D.audioStream??0),onChange:e=>y.inspectorChange(`audioStream`,Number(e)),options:(r.find(e=>e.slug===D.clipId)?.audio_tracks??[]).map(e=>[String(e.index),e.title||N(`editor.recordedTrack`,{number:e.index+1})])})]}),(0,$.jsxs)(`label`,{className:`ed-audio-volume`,children:[(0,$.jsxs)(`span`,{children:[N(`editor.audioVolume`),` `,Math.round((D.volume??1)*100),`%`]}),(0,$.jsx)(`input`,{type:`range`,min:`0`,max:`100`,step:`1`,value:Math.round((D.volume??1)*100),onChange:e=>y.inspectorChange(`volume`,Number(e.target.value)/100)})]}),(0,$.jsxs)(`label`,{className:`ed-audio-mute`,children:[(0,$.jsx)(`span`,{children:N(`editor.audioMuted`)}),(0,$.jsx)(kd,{label:N(`editor.audioMuted`),checked:!!D.muted,onChange:e=>y.inspectorChange(`muted`,e)})]}),(0,$.jsx)(`p`,{className:`dim`,children:N(`editor.detachedTracksHelp`)})]}):null,ie?(0,$.jsxs)(`div`,{className:`ed-inspector`,children:[(0,$.jsxs)(`div`,{className:`ed-insp-head`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:N(`editor.titleSection`)}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn`,onClick:()=>y.select(null),"aria-label":N(`editor.closeInspector`),children:(0,$.jsx)(Fl,{size:12})})]}),(0,$.jsx)(Md,{label:N(`editor.titleText`),value:D.text??``,placeholder:N(`editor.titleText`),onChange:e=>y.inspectorChange(`text`,e)}),(0,$.jsxs)(`label`,{className:`ed-insp-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.font`)}),(0,$.jsx)(Ad,{label:N(`editor.font`),value:D.font??`display`,onChange:e=>y.inspectorChange(`font`,e),options:Object.entries(hh).map(([e,t])=>[e,t.label])})]}),(0,$.jsxs)(`label`,{className:`ed-insp-field`,children:[(0,$.jsxs)(`span`,{children:[N(`editor.size`),` `,(0,$.jsxs)(`b`,{className:`mono`,children:[D.size,`px`]})]}),(0,$.jsx)(`input`,{type:`range`,className:`ed-insp-range`,min:16,max:400,step:2,value:D.size??64,"aria-label":N(`editor.titleSize`),onChange:e=>y.inspectorChange(`size`,e.target.value)})]}),(0,$.jsxs)(`label`,{className:`ed-insp-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.colour`)}),(0,$.jsx)(`div`,{className:`ed-swatches`,children:_h.map(e=>(0,$.jsx)(`button`,{type:`button`,className:`ed-swatch`,"data-active":D.color===e||void 0,style:{background:e},title:e,"aria-label":N(`editor.useColour`,{color:e}),onClick:()=>y.inspectorChange(`color`,e)},e))})]}),(0,$.jsxs)(`p`,{className:`ed-insp-pos`,children:[`x `,Math.round(D.x??0),`% · y `,Math.round(D.y??0),`%, drag it on the preview`]}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>y.remove(),children:N(`editor.removeTitle`)})]}):null]}),(0,$.jsxs)(`div`,{className:`ed-transport`,children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,onClick:()=>C(!0),children:N(`editor.reset`)}),(0,$.jsx)(`div`,{className:`ed-spacer`}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn ed-round`,onClick:()=>y.seek(0),title:N(`editor.backToStart`),"aria-label":N(`editor.backToStart`),children:(0,$.jsx)(Bh,{})}),(0,$.jsx)(`button`,{type:`button`,className:`ed-play`,onClick:()=>y.setPlaying(!b.playing),title:N(`editor.playPause`),"aria-label":b.playing?N(`editor.pause`):N(`editor.play`),children:b.playing?(0,$.jsx)(Hh,{}):(0,$.jsx)(Vh,{})}),(0,$.jsx)(`div`,{className:`ed-spacer`}),(0,$.jsxs)(`span`,{className:`ed-time mono`,children:[ph(b.playhead),` `,(0,$.jsxs)(`span`,{className:`dim`,children:[`/ `,ph(b.duration)]})]}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-sm`,disabled:b.duration<=0,onClick:()=>ee(!0),children:N(`editor.exportBtn`)})]})]})]}),(0,$.jsx)(`div`,{className:`ed-resize ed-resize-y`,onPointerDown:E(`y`),children:(0,$.jsx)(`span`,{})}),(0,$.jsxs)(`div`,{className:`ed-panel ed-timeline`,children:[(0,$.jsxs)(`div`,{className:`ed-tl-toolbar`,children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!b.canSplit,onClick:()=>y.split(),children:N(`editor.split`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!b.canDetach,onClick:()=>y.detachAudio(),children:N(`editor.detachAudio`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,disabled:!b.canDuplicate,onClick:()=>y.duplicate(),children:N(`editor.duplicate`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-danger btn-sm`,disabled:!b.canDelete,onClick:()=>y.remove(),children:N(`common.delete`)}),(0,$.jsx)(`div`,{className:`ed-spacer`}),(0,$.jsxs)(`span`,{className:`ed-pps mono`,children:[Math.round(b.pps),` px/s`]}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn`,onClick:()=>y.zoom(1/1.3),title:N(`editor.zoomOut`),"aria-label":N(`editor.zoomOut`),children:(0,$.jsx)(Uh,{})}),(0,$.jsx)(`button`,{type:`button`,className:`ed-iconbtn`,onClick:()=>y.zoom(1.3),title:N(`editor.zoomIn`),"aria-label":N(`editor.zoomIn`),children:(0,$.jsx)(Wh,{})}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>y.fit(),children:N(`editor.fit`)}),(0,$.jsx)(Ph,{onAdd:e=>y.addTrack(e)})]}),(0,$.jsx)(`div`,{className:`ed-tl-scroll`,ref:p,children:(0,$.jsx)(`div`,{className:`ed-tl-canvas`,ref:f})})]}),(0,$.jsx)(ql,{open:S,title:N(`editor.clearTitle`),onClose:()=>C(!1),footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>C(!1),children:N(`common.keepIt`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn btn-danger-solid`,onClick:()=>{C(!1),y.reset()},children:N(`editor.clear`)})]}),children:(0,$.jsx)(`p`,{children:N(`editor.clearBody`)})}),(0,$.jsx)(Nh,{open:w,onClose:()=>ee(!1),engine:y,duration:b.duration,libraryDir:s?.output?.directory??`~/Videos/Vice`,accent:c,recording:e.status.recording||e.status.session_active,notify:t,onExported:()=>n({type:`setView`,view:`editor`})})]})}function Nh({open:e,onClose:t,engine:n,duration:r,libraryDir:i,accent:a,recording:o,notify:s}){let[c,l]=(0,Fh.useState)(``),[u,d]=(0,Fh.useState)(`library`),[f,p]=(0,Fh.useState)(``),[m,h]=(0,Fh.useState)(!0),[g,_]=(0,Fh.useState)(`form`),[v,y]=(0,Fh.useState)(0),[b,x]=(0,Fh.useState)(``),S=(0,Fh.useRef)(null);(0,Fh.useEffect)(()=>{e&&(_(`form`),y(0))},[e]),(0,Fh.useEffect)(()=>{if(e)return Mc(e=>{let t=e;!t.type?.startsWith(`export_`)||t.job_id!==S.current||(t.type===`export_progress`?y(Math.min(100,Math.round((t.progress??0)*100))):t.type===`export_done`?(S.current=null,x(t.path??``),_(`done`)):t.type===`export_error`&&(S.current=null,_(`form`),s({kind:t.canceled?`info`:`error`,title:t.canceled?N(`editor.exportCanceled`):N(`editor.exportFailed`),detail:t.canceled?void 0:t.error,tone:t.canceled?`neutral`:`error`,holdMs:7e3})))})},[e,s]);let C=u===`library`?i:u===`videos`?`~/Videos`:f.trim()||``,w=`${Math.round(r)}s · H.264 and AAC into ${C||`a folder you pick`}/${(c.trim()||`Vice_Edit_N`).replace(/\.mp4$/i,``)}.mp4`,ee=async()=>{if(u===`custom`&&!f.trim()){s({kind:`error`,title:N(`editor.pickFolder`),tone:`error`,holdMs:4e3});return}n.isDirty()&&await n.saveNow();let e={project:n.project(),location:u,add_to_library:m,accent:a};c.trim()&&(e.filename=c.trim()),u===`custom`&&(e.path=f.trim());try{let t=await W.startExport(e);if(t.ok===!1||!t.job_id)throw Error(t.error||t.errors?.[0]||N(`editor.exportRefused`));S.current=t.job_id,x(t.path??``),y(0),_(`busy`)}catch(e){s({kind:`error`,title:N(`editor.errStartExport`),detail:e.message,tone:`error`,holdMs:8e3})}};return(0,$.jsx)(ql,{open:e,title:N(`editor.exportVideo`),wide:!0,onClose:()=>{g!==`busy`&&t()},footer:g===`form`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:t,children:N(`common.cancel`)}),(0,$.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void ee(),children:N(`editor.startExport`)})]}):g===`busy`?(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>{S.current&&W.cancelExport(S.current).catch(()=>{})},children:N(`editor.cancelExport`)}):(0,$.jsx)(`button`,{type:`button`,className:`btn`,onClick:t,children:N(`editor.done`)}),children:g===`form`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.saveAs`)}),(0,$.jsx)(Md,{label:N(`editor.exportFilename`),wide:!0,value:c,placeholder:N(`editor.exportFilenamePlaceholder`),onChange:l})]}),(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.location`)}),(0,$.jsx)(Ad,{label:N(`editor.exportLocation`),value:u,onChange:d,options:[[`library`,N(`editor.viceLibrary`)],[`videos`,`~/Videos`],[`custom`,N(`editor.customPath`)]]})]}),u===`custom`?(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.folder`)}),(0,$.jsx)(Md,{label:N(`editor.exportFolder`),wide:!0,mono:!0,value:f,placeholder:`/home/you/Videos/edits`,onChange:p})]}):null,u===`library`?null:(0,$.jsxs)(`label`,{className:`ed-export-field`,children:[(0,$.jsx)(`span`,{children:N(`editor.alsoAddToLibrary`)}),(0,$.jsx)(kd,{label:N(`editor.alsoAddToLibrary`),checked:m,onChange:h})]}),(0,$.jsx)(`p`,{className:`ed-export-summary mono`,children:w}),o?(0,$.jsx)(`p`,{className:`ed-export-warn`,children:`Vice is recording right now. Exporting will compete with the encoder for the GPU, so expect the game to stutter.`}):null]}):g===`busy`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{children:N(`editor.encoding`)}),(0,$.jsx)(`div`,{className:`ed-progress`,children:(0,$.jsx)(`div`,{className:`ed-progress-fill`,style:{width:`${v}%`}})}),(0,$.jsx)(`p`,{className:`mono ed-progress-label`,children:N(`editor.encodingProgress`,{percent:v})})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{children:N(`editor.exported`)}),(0,$.jsx)(`p`,{className:`mono ed-export-path`,children:b})]})})}function Ph({onAdd:e}){let[t,n]=(0,Fh.useState)(!1),[r,i]=(0,Fh.useState)({x:0,y:0}),a=(0,Fh.useRef)(null),o=(0,Fh.useRef)(null);return(0,Fh.useLayoutEffect)(()=>{let e=o.current,n=a.current?.querySelector(`button`);if(!t||!e||!n)return;let r=n.getBoundingClientRect(),s=e.offsetWidth,c=e.offsetHeight;i({x:Math.max(8,Math.min(r.right-s,window.innerWidth-s-8)),y:Math.max(8,r.top-c-6)})},[t]),(0,Fh.useEffect)(()=>{if(!t)return;let e=e=>{a.current?.contains(e.target)||n(!1)},r=window.setTimeout(()=>document.addEventListener(`pointerdown`,e,!0),0);return()=>{window.clearTimeout(r),document.removeEventListener(`pointerdown`,e,!0)}},[t]),(0,$.jsxs)(`div`,{className:`ed-addtrack`,ref:a,children:[(0,$.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>n(e=>!e),children:N(`editor.addTrack`)}),t?(0,$.jsxs)(`div`,{className:`ed-addtrack-menu`,role:`menu`,ref:o,style:{left:r.x,top:r.y},children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>{e(`video`),n(!1)},children:N(`editor.videoTrack`)}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>{e(`audio`),n(!1)},children:N(`editor.audioTrack`)})]}):null]})}var Fh,$,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh=o((()=>{Fh=l(d()),jc(),Fc(),Dc(),pl(),jh(),xh(),Xl(),Kl(),Rd(),P(),$=M(),Ih={library:`editor.libHintLibrary`,effects:`editor.libHintEffects`,text:`editor.libHintText`},Lh=[[`library`,()=>N(`editor.tabLibrary`)],[`effects`,()=>N(`editor.tabEffects`)],[`text`,()=>N(`editor.tabText`)]],Rh={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0},zh=()=>(0,$.jsxs)(`svg`,{...Rh,width:13,height:13,children:[(0,$.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,$.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),Bh=()=>(0,$.jsxs)(`svg`,{...Rh,width:13,height:13,children:[(0,$.jsx)(`polygon`,{points:`19 20 9 12 19 4 19 20`}),(0,$.jsx)(`line`,{x1:`5`,x2:`5`,y1:`19`,y2:`5`})]}),Vh=()=>(0,$.jsx)(`svg`,{viewBox:`0 0 24 24`,width:14,height:14,fill:`currentColor`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M7 4l13 8-13 8z`})}),Hh=()=>(0,$.jsx)(`svg`,{viewBox:`0 0 24 24`,width:14,height:14,fill:`currentColor`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M7 4h3.5v16H7zM13.5 4H17v16h-3.5z`})}),Uh=()=>(0,$.jsx)(`svg`,{...Rh,width:12,height:12,children:(0,$.jsx)(`path`,{d:`M5 12h14`})}),Wh=()=>(0,$.jsx)(`svg`,{...Rh,width:12,height:12,children:(0,$.jsx)(`path`,{d:`M5 12h14M12 5v14`})})}));function Kh(){let{state:e,notify:t}=ol(),{status:n,config:r,clips:i}=e,[a,o]=(0,qh.useState)(null),s=(0,qh.useMemo)(()=>{let e=i.reduce((e,t)=>e+(t.duration??0),0),t=i.reduce((e,t)=>e+(t.size??0),0);return{count:i.length,bytes:t,footage:e<60?`${Math.round(e)}s`:`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}},[i]),c=r?.recording??{},l=n.version||``,u=[[N(`about.version`),l||`unknown`],[N(`about.backend`),n.backend||c.backend||`auto`],[N(`about.buffer`),Lc(c.buffer_duration??120)],[N(`about.frameRate`),`${c.fps??60} fps`],[N(`about.clipsOnDisk`),`${s.count} · ${Rc(s.bytes)}`],[N(`about.totalFootage`),s.footage]],d=async()=>{await ml(Yh)?t({kind:`info`,title:N(`about.commandCopied`),tone:`accent`,holdMs:4e3}):o(Yh)};return(0,Jh.jsxs)(`div`,{className:`about`,children:[(0,Jh.jsxs)(`header`,{className:`about-head`,children:[(0,Jh.jsx)(`h1`,{children:N(`about.title`)}),(0,Jh.jsx)(`p`,{children:N(`about.subtitle`)})]}),(0,Jh.jsxs)(`section`,{className:`about-hero`,children:[(0,Jh.jsx)(`span`,{className:`about-mark`,children:(0,Jh.jsx)(zl,{size:30})}),(0,Jh.jsxs)(`div`,{children:[(0,Jh.jsx)(`h2`,{children:(0,Jh.jsx)(pf,{height:26})}),(0,Jh.jsx)(`p`,{children:N(`about.tagline`)}),(0,Jh.jsxs)(`div`,{className:`about-chips`,children:[(0,Jh.jsx)(`span`,{className:`about-chip mono`,children:l||`unknown`}),(0,Jh.jsx)(`span`,{className:`about-chip mono`,children:`GPL-3.0`}),(0,Jh.jsx)(`span`,{className:`about-chip mono`,children:N(`about.waylandAndX11`)})]})]})]}),(0,Jh.jsxs)(`div`,{className:`about-grid`,children:[(0,Jh.jsxs)(`section`,{className:`about-card`,children:[(0,Jh.jsx)(`h3`,{className:`eyebrow`,children:N(`about.system`)}),u.map(([e,t])=>(0,Jh.jsxs)(`div`,{className:`about-row`,children:[(0,Jh.jsx)(`span`,{children:e}),(0,Jh.jsx)(`b`,{className:`mono`,children:t})]},e))]}),(0,Jh.jsxs)(`section`,{className:`about-card`,children:[(0,Jh.jsx)(`h3`,{className:`eyebrow`,children:N(`about.credits`)}),(0,Jh.jsxs)(`div`,{className:`credit`,children:[(0,Jh.jsx)(`span`,{className:`credit-avatar`,children:`A`}),(0,Jh.jsxs)(`div`,{children:[(0,Jh.jsx)(`b`,{children:`Andrew Marin`}),(0,Jh.jsx)(`span`,{children:N(`about.creator`)})]})]}),(0,Jh.jsxs)(`div`,{className:`credit`,children:[(0,Jh.jsx)(`span`,{className:`credit-avatar credit-avatar-dim`,children:`C`}),(0,Jh.jsxs)(`div`,{children:[(0,Jh.jsx)(`b`,{children:N(`about.community`)}),(0,Jh.jsx)(`span`,{children:N(`about.communityHelp`)})]})]})]})]}),(0,Jh.jsxs)(`section`,{className:`about-danger`,children:[(0,Jh.jsx)(`h3`,{className:`eyebrow`,children:N(`about.dangerZone`)}),(0,Jh.jsx)(`p`,{children:N(`about.uninstallHelp`)}),(0,Jh.jsxs)(`div`,{className:`about-cmd`,children:[(0,Jh.jsx)(`code`,{className:`mono`,children:Yh}),(0,Jh.jsx)(`button`,{type:`button`,className:`btn btn-quiet btn-sm`,onClick:()=>void d(),children:N(`about.copy`)})]})]}),(0,Jh.jsxs)(ql,{open:a!==null,title:N(`about.copyTitle`),onClose:()=>o(null),children:[(0,Jh.jsx)(`p`,{children:N(`about.copyByHand`)}),(0,Jh.jsx)(`textarea`,{className:`manual-copy`,readOnly:!0,value:a??``,rows:2})]})]})}var qh,Jh,Yh,Xh=o((()=>{qh=l(d()),pl(),hl(),Vc(),hf(),P(),Xl(),Kl(),Jh=M(),Yh=`vice uninstall`})),Zh=s((()=>{var e=l(d()),t=_();jn(),Mn(),Nn(),Pn(),Fn(),In(),Ln(),Rn(),zn(),Bn(),Vn(),P(),Dc(),pl(),ad(),Hf(),Yf(),om(),um(),pm(),dh(),Gh(),Xh();var n=M();function r(){let{state:t}=ol(),{accent:r,customAccent:a,ready:o,view:s}=t,{ramp:c,theme:l}=xc(r,a),[,u]=(0,e.useState)(0);return(0,e.useEffect)(()=>zr(()=>u(e=>e+1)),[]),(0,e.useEffect)(()=>{if(!o)return;let e=document.getElementById(`boot`);if(!e)return;e.classList.add(`boot-done`);let t=()=>e.remove();e.addEventListener(`transitionend`,t,{once:!0});let n=window.setTimeout(t,1200);return()=>window.clearTimeout(n)},[o]),(0,e.useEffect)(()=>{let e=document.documentElement,t=yc(c);for(let[n,r]of Object.entries(t))e.style.setProperty(n,r)},[c]),(0,n.jsxs)(vn,{theme:l,mode:`dark`,children:[(0,n.jsx)(`div`,{className:`vice-ambient`,style:yc(c),"aria-hidden":`true`}),(0,n.jsx)(ed,{children:(0,n.jsx)(`div`,{className:`vice-app`,style:yc(c),children:(0,n.jsx)(Uf,{children:(0,n.jsx)(jf,{children:(0,n.jsx)(i,{view:s})})})})})]})}function i({view:e}){return e===`home`?(0,n.jsx)(qp,{}):e===`clips`?(0,n.jsx)(sm,{}):e===`images`?(0,n.jsx)(dm,{}):e===`settings`?(0,n.jsx)(Zm,{}):e===`editor`?(0,n.jsx)(Mh,{}):(0,n.jsx)(Kh,{})}Jr(),(0,t.createRoot)(document.getElementById(`root`)).render((0,n.jsx)(e.StrictMode,{children:(0,n.jsx)(al,{children:(0,n.jsx)(r,{})})}))}));export default Zh(); \ No newline at end of file From 4f654794f66b8c1b65173d84c93654e85cf0bff0 Mon Sep 17 00:00:00 2001 From: voltek Date: Sun, 20 Sep 2026 21:25:34 +0200 Subject: [PATCH 4/6] =?UTF-8?q?add=20.md=20cr=C3=A9dit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a82707e..e883cd1 100644 --- a/README.md +++ b/README.md @@ -349,7 +349,7 @@ Vice is better because these people sent patches: - [@quadruplea0](https://github.com/quadruplea0), for making the resolution setting actually reach gpu-screen-recorder - [@DeveloperSpoot](https://github.com/DeveloperSpoot), for themed Discord embeds, their idea and their first implementation - [@jethrothelion](https://github.com/jethrothelion), for Chivalry 2 and Clone Drone in The Danger Zone -- [@voltek-laruelle](https://github.com/voltek-laruelle), for the clip volume slider, and for GeoGuessr Steam Edition, Forza Horizon 4, Big Walk, Supermarket Simulator, and Sandustry +- [@voltek-laruelle](https://github.com/voltek-laruelle), for the clip volume slider, the French translation, and for GeoGuessr Steam Edition, Forza Horizon 4, Big Walk, Supermarket Simulator, and Sandustry - [@20plays](https://github.com/20plays), for preserving working Arch installations during installer dependency checks and selecting the distro Python for QtWebEngine - [@KITE-Force](https://github.com/KITE-Force), for game detection on KDE Plasma Wayland through kdotool From 92c9b5a8a73bb2224750b425aac8e3af8fef8589 Mon Sep 17 00:00:00 2001 From: voltek Date: Sun, 20 Sep 2026 21:30:07 +0200 Subject: [PATCH 5/6] add steam jeux --- vice/data/games.json | 1 + 1 file changed, 1 insertion(+) diff --git a/vice/data/games.json b/vice/data/games.json index 5b1d7aa..c387302 100644 --- a/vice/data/games.json +++ b/vice/data/games.json @@ -20,6 +20,7 @@ {"name": "Stardew Valley", "matches": ["StardewValley", "stardew valley"]}, {"name": "Terraria", "matches": ["terraria", "Terraria.bin.x86_64"]}, {"name": "Factorio", "matches": ["factorio"]}, + {"name": "OpenFront", "matches": ["openfront", "openfront.io", "steam_app_3560670"]}, {"name": "Rimworld", "matches": ["RimWorldLinux"]}, {"name": "Risk of Rain 2", "matches": ["Risk of Rain 2.exe"]}, {"name": "Deep Rock Galactic", "matches": ["FSD-Win64-Shipping.exe"]}, From 4d85b237c08335c308c7206bb5e1a3ffd94da397 Mon Sep 17 00:00:00 2001 From: voltek Date: Sun, 20 Sep 2026 21:31:36 +0200 Subject: [PATCH 6/6] =?UTF-8?q?add=20.md=20cr=C3=A9dit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e883cd1..a5b1b45 100644 --- a/README.md +++ b/README.md @@ -349,7 +349,7 @@ Vice is better because these people sent patches: - [@quadruplea0](https://github.com/quadruplea0), for making the resolution setting actually reach gpu-screen-recorder - [@DeveloperSpoot](https://github.com/DeveloperSpoot), for themed Discord embeds, their idea and their first implementation - [@jethrothelion](https://github.com/jethrothelion), for Chivalry 2 and Clone Drone in The Danger Zone -- [@voltek-laruelle](https://github.com/voltek-laruelle), for the clip volume slider, the French translation, and for GeoGuessr Steam Edition, Forza Horizon 4, Big Walk, Supermarket Simulator, and Sandustry +- [@voltek-laruelle](https://github.com/voltek-laruelle), for the clip volume slider, the French translation, and for GeoGuessr Steam Edition, Forza Horizon 4, Big Walk, Supermarket Simulator, Sandustry, and OpenFront - [@20plays](https://github.com/20plays), for preserving working Arch installations during installer dependency checks and selecting the distro Python for QtWebEngine - [@KITE-Force](https://github.com/KITE-Force), for game detection on KDE Plasma Wayland through kdotool