~ianmjones/snippetexpander

1bf4f83aef83f8efe818e0820550b0b3b0c9e9e1 — Ian M. Jones 3 months ago 58134f8
Rename project to snippetexpander
122 files changed, 662 insertions(+), 662 deletions(-)

M .builds/debian-stable.yml
M .builds/nixos-unstable.yml
M Makefile
M README.md
R cmd/{snippetpixie/.gitignore => snippetexpander/.gitignore}
R cmd/{snippetpixie/Makefile => snippetexpander/Makefile}
R cmd/{snippetpixie/config.go => snippetexpander/config.go}
A cmd/snippetexpander/config_test.go
A cmd/snippetexpander/go.mod
R cmd/{snippetpixie/go.sum => snippetexpander/go.sum}
R cmd/{snippetpixie/main.go => snippetexpander/main.go}
A cmd/snippetexpander/snippetexpander
R cmd/{snippetpixied/.gitignore => snippetexpanderd/.gitignore}
R cmd/{snippetpixied/Makefile => snippetexpanderd/Makefile}
R cmd/{snippetpixied/dbus.go => snippetexpanderd/dbus.go}
R cmd/{snippetpixied/dbus_test.go => snippetexpanderd/dbus_test.go}
R cmd/{snippetpixied/go.mod => snippetexpanderd/go.mod}
R cmd/{snippetpixied/go.sum => snippetexpanderd/go.sum}
R cmd/{snippetpixied/main.go => snippetexpanderd/main.go}
R cmd/{snippetpixied/main_test.go => snippetexpanderd/main_test.go}
A cmd/snippetexpanderd/snippetexpanderd
R cmd/{snippetpixiegui/.gitignore => snippetexpandergui/.gitignore}
R cmd/{snippetpixiegui/Makefile => snippetexpandergui/Makefile}
R cmd/{snippetpixiegui/README.md => snippetexpandergui/README.md}
R cmd/{snippetpixiegui/app.go => snippetexpandergui/app.go}
R cmd/{snippetpixiegui/assets.go => snippetexpandergui/assets.go}
R cmd/{snippetpixiegui/assets_bindings.go => snippetexpandergui/assets_bindings.go}
R cmd/{snippetpixiegui/build/README.md => snippetexpandergui/build/README.md}
R cmd/{snippetpixiegui/build/appicon.png => snippetexpandergui/build/appicon.png}
R cmd/{snippetpixiegui/build/darwin/Info.plist => snippetexpandergui/build/darwin/Info.plist}
R cmd/{snippetpixiegui/build/linux/share/applications/snippetpixiegui.desktop => snippetexpandergui/build/linux/share/applications/snippetexpandergui.desktop}
R cmd/{snippetpixiegui/build/linux/share/icons/hicolor/128x128/apps/snippetpixiegui.svg => snippetexpandergui/build/linux/share/icons/hicolor/128x128/apps/snippetexpandergui.svg}
R cmd/{snippetpixiegui/build/linux/share/icons/hicolor/256x256/apps/snippetpixiegui.svg => snippetexpandergui/build/linux/share/icons/hicolor/256x256/apps/snippetexpandergui.svg}
R cmd/{snippetpixiegui/build/linux/share/icons/hicolor/32x32/apps/snippetpixiegui.svg => snippetexpandergui/build/linux/share/icons/hicolor/32x32/apps/snippetexpandergui.svg}
R cmd/{snippetpixiegui/build/linux/share/icons/hicolor/48x48/apps/snippetpixiegui.svg => snippetexpandergui/build/linux/share/icons/hicolor/48x48/apps/snippetexpandergui.svg}
R cmd/{snippetpixiegui/build/linux/share/icons/hicolor/64x64/apps/snippetpixiegui.svg => snippetexpandergui/build/linux/share/icons/hicolor/64x64/apps/snippetexpandergui.svg}
R cmd/{snippetpixiegui/build/windows/icon.ico => snippetexpandergui/build/windows/icon.ico}
R cmd/{snippetpixiegui/build/windows/info.json => snippetexpandergui/build/windows/info.json}
R cmd/{snippetpixiegui/build/windows/installer/project.nsi => snippetexpandergui/build/windows/installer/project.nsi}
R cmd/{snippetpixiegui/build/windows/wails.exe.manifest => snippetexpandergui/build/windows/wails.exe.manifest}
R cmd/{snippetpixiegui/config.go => snippetexpandergui/config.go}
R cmd/{snippetpixiegui/config_test.go => snippetexpandergui/config_test.go}
R cmd/{snippetpixiegui/frontend/README.md => snippetexpandergui/frontend/README.md}
A cmd/snippetexpandergui/frontend/dist/assets/en-GB-f23fefe1.js
R cmd/{snippetpixiegui/frontend/dist/assets/index-288ebb61.js => snippetexpandergui/frontend/dist/assets/index-93f98e6b.js}
R cmd/{snippetpixiegui/frontend/dist/assets/index-e2d949f4.css => snippetexpandergui/frontend/dist/assets/index-e2d949f4.css}
R cmd/{snippetpixiegui/frontend/dist/assets/snippetpixie-icon-128-1d7040bc.svg => snippetexpandergui/frontend/dist/assets/snippetexpander-icon-128-1d7040bc.svg}
R cmd/{snippetpixiegui/frontend/dist/index.html => snippetexpandergui/frontend/dist/index.html}
R cmd/{snippetpixiegui/frontend/index.html => snippetexpandergui/frontend/index.html}
R cmd/{snippetpixiegui/frontend/jsconfig.json => snippetexpandergui/frontend/jsconfig.json}
R cmd/{snippetpixiegui/frontend/package-lock.json => snippetexpandergui/frontend/package-lock.json}
R cmd/{snippetpixiegui/frontend/package.json => snippetexpandergui/frontend/package.json}
R cmd/{snippetpixiegui/frontend/package.json.md5 => snippetexpandergui/frontend/package.json.md5}
R cmd/{snippetpixiegui/frontend/src/App.svelte => snippetexpandergui/frontend/src/App.svelte}
R cmd/{snippetpixiegui/frontend/src/assets/snippetpixie-icon-128.svg => snippetexpandergui/frontend/src/assets/snippetexpander-icon-128.svg}
R cmd/{snippetpixiegui/frontend/src/components/AboutScreen.svelte => snippetexpandergui/frontend/src/components/AboutScreen.svelte}
R cmd/{snippetpixiegui/frontend/src/components/AddSnippetScreen.svelte => snippetexpandergui/frontend/src/components/AddSnippetScreen.svelte}
R cmd/{snippetpixiegui/frontend/src/components/Button.svelte => snippetexpandergui/frontend/src/components/Button.svelte}
R cmd/{snippetpixiegui/frontend/src/components/DaemonNotInstalledNotice.svelte => snippetexpandergui/frontend/src/components/DaemonNotInstalledNotice.svelte}
R cmd/{snippetpixiegui/frontend/src/components/EditSnippetScreen.svelte => snippetexpandergui/frontend/src/components/EditSnippetScreen.svelte}
R cmd/{snippetpixiegui/frontend/src/components/IconButton.svelte => snippetexpandergui/frontend/src/components/IconButton.svelte}
R cmd/{snippetpixiegui/frontend/src/components/Input.svelte => snippetexpandergui/frontend/src/components/Input.svelte}
R cmd/{snippetpixiegui/frontend/src/components/ListSnippetsScreen.svelte => snippetexpandergui/frontend/src/components/ListSnippetsScreen.svelte}
R cmd/{snippetpixiegui/frontend/src/components/MainScreen.svelte => snippetexpandergui/frontend/src/components/MainScreen.svelte}
R cmd/{snippetpixiegui/frontend/src/components/NoConnectionNotice.svelte => snippetexpandergui/frontend/src/components/NoConnectionNotice.svelte}
R cmd/{snippetpixiegui/frontend/src/components/Notice.svelte => snippetexpandergui/frontend/src/components/Notice.svelte}
R cmd/{snippetpixiegui/frontend/src/components/Screen.svelte => snippetexpandergui/frontend/src/components/Screen.svelte}
R cmd/{snippetpixiegui/frontend/src/components/SettingsScreen.svelte => snippetexpandergui/frontend/src/components/SettingsScreen.svelte}
R cmd/{snippetpixiegui/frontend/src/components/ShortcutButton.svelte => snippetexpandergui/frontend/src/components/ShortcutButton.svelte}
R cmd/{snippetpixiegui/frontend/src/components/SnippetsList.svelte => snippetexpandergui/frontend/src/components/SnippetsList.svelte}
R cmd/{snippetpixiegui/frontend/src/components/SnippetsListItem.svelte => snippetexpandergui/frontend/src/components/SnippetsListItem.svelte}
R cmd/{snippetpixiegui/frontend/src/components/StartDaemonNotice.svelte => snippetexpandergui/frontend/src/components/StartDaemonNotice.svelte}
R cmd/{snippetpixiegui/frontend/src/components/StartingDaemonNotice.svelte => snippetexpandergui/frontend/src/components/StartingDaemonNotice.svelte}
R cmd/{snippetpixiegui/frontend/src/components/Toolbar.svelte => snippetexpandergui/frontend/src/components/Toolbar.svelte}
R cmd/{snippetpixiegui/frontend/src/components/ToolbarSpacer.svelte => snippetexpandergui/frontend/src/components/ToolbarSpacer.svelte}
R cmd/{snippetpixiegui/frontend/src/components/WelcomeScreen.svelte => snippetexpandergui/frontend/src/components/WelcomeScreen.svelte}
R cmd/{snippetpixiegui/frontend/src/global.css => snippetexpandergui/frontend/src/global.css}
R cmd/{snippetpixiegui/frontend/src/js/focus.js => snippetexpandergui/frontend/src/js/focus.js}
R cmd/{snippetpixiegui/frontend/src/js/scrollIntoView.js => snippetexpandergui/frontend/src/js/scrollIntoView.js}
R cmd/{snippetpixiegui/frontend/src/js/select.js => snippetexpandergui/frontend/src/js/select.js}
R cmd/{snippetpixiegui/frontend/src/js/stores.js => snippetexpandergui/frontend/src/js/stores.js}
R cmd/{snippetpixiegui/frontend/src/main.js => snippetexpandergui/frontend/src/main.js}
R cmd/{snippetpixiegui/frontend/src/vite-env.d.ts => snippetexpandergui/frontend/src/vite-env.d.ts}
R cmd/{snippetpixiegui/frontend/vite.config.js => snippetexpandergui/frontend/vite.config.js}
R cmd/{snippetpixiegui/go.mod => snippetexpandergui/go.mod}
R cmd/{snippetpixiegui/go.sum => snippetexpandergui/go.sum}
R cmd/{snippetpixiegui/i18n/en-GB.json => snippetexpandergui/i18n/en-GB.json}
R cmd/{snippetpixiegui/main.go => snippetexpandergui/main.go}
R cmd/{snippetpixiegui/wails.json => snippetexpandergui/wails.json}
R cmd/{snippetpixiex/.gitignore => snippetexpanderx/.gitignore}
R cmd/{snippetpixiex/Makefile => snippetexpanderx/Makefile}
A cmd/snippetexpanderx/snippetexpanderx
R cmd/{snippetpixiex/snippetpixiex-application.vala => snippetexpanderx/snippetexpanderx-application.vala}
R cmd/{snippetpixiex/snippetpixiex-snippet.vala => snippetexpanderx/snippetexpanderx-snippet.vala}
R cmd/{snippetpixiex/snippetpixiex-snippets-manager.vala => snippetexpanderx/snippetexpanderx-snippets-manager.vala}
D cmd/snippetpixie/config_test.go
D cmd/snippetpixie/go.mod
D cmd/snippetpixiegui/frontend/dist/assets/en-GB-d3e97a3e.js
M internal/export/export.go
M internal/export/export_test.go
M internal/export/go.mod
M internal/manager/go.mod
M internal/manager/manager_test.go
M internal/manager/placeholders_test.go
M internal/manager/snippet.go
M internal/manager/snippet_test.go
M internal/paste/go.mod
M internal/service/go.mod
M internal/service/service.go
M pkg/dbusservice/dbusservice.go
M pkg/dbusservice/dbusservice_test.go
M pkg/dbusservice/go.mod
M pkg/snippet/go.mod
M pkg/snippet/snippet_test.go
M site/src/routes/+layout.svelte
M site/src/routes/+page.svelte
R site/static/img/{snippetpixie-icon-128.svg => snippetexpander-icon-128.svg}
R site/static/img/{snippetpixie-icon-256.png => snippetexpander-icon-256.png}
R site/static/img/{snippetpixie-icon-256.svg => snippetexpander-icon-256.svg}
R site/static/img/{snippetpixie-icon-32.svg => snippetexpander-icon-32.svg}
R site/static/img/{snippetpixie-icon-48.svg => snippetexpander-icon-48.svg}
R site/static/img/{snippetpixie-icon-64.svg => snippetexpander-icon-64.svg}
M .builds/debian-stable.yml => .builds/debian-stable.yml +5 -5
@@ 16,7 16,7 @@ packages:
  - libibus-1.0-dev
  - libx11-dev
sources:
  - https://git.sr.ht/~ianmjones/snippetpixie
  - https://git.sr.ht/~ianmjones/snippetexpander
tasks:
  - install: |
      go install github.com/wailsapp/wails/v2/cmd/wails@latest


@@ 32,10 32,10 @@ tasks:
      # Add npm to PATH.
      export NVM_DIR="$HOME/.nvm"
      [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
      cd snippetpixie
      cd snippetexpander
      make
  - test: |
      cd snippetpixie
      cd snippetexpander
      xvfb-run make test
  - tgz: |
      # Add wails to PATH.


@@ 43,7 43,7 @@ tasks:
      # Add npm to PATH.
      export NVM_DIR="$HOME/.nvm"
      [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
      cd snippetpixie
      cd snippetexpander
      make tgz
artifacts:
  - snippetpixie/snippetpixie.tgz
  - snippetexpander/snippetexpander.tgz

M .builds/nixos-unstable.yml => .builds/nixos-unstable.yml +8 -7
@@ 3,21 3,22 @@ oauth: pages.sr.ht/PAGES:RW
packages:
  - nixos.hut
sources:
  - https://git.sr.ht/~ianmjones/snippetpixie
  - https://git.sr.ht/~ianmjones/snippetexpander
tasks:
  - build: |
      cd snippetpixie
      cd snippetexpander
      nix-shell --pure --run 'make'
  - test: |
      cd snippetpixie
      cd snippetexpander
      nix-shell --pure --run 'xvfb-run make test'
  - package-site: |
      cd snippetpixie
      cd snippetexpander
      nix-shell --pure --run 'make site-tgz'
  - upload-site: |
      hut pages publish -d snippetpixie.org snippetpixie/site.tgz
      hut pages publish -d snippetpixie.com snippetpixie/site.tgz
      hut pages publish -d www.snippetpixie.com snippetpixie/site.tgz
      hut pages publish -d snippetexpander.org snippetexpander/site.tgz
      hut pages publish -d www.snippetexpander.org snippetexpander/site.tgz
      hut pages publish -d snippetexpander.com snippetexpander/site.tgz
      hut pages publish -d www.snippetexpander.com snippetexpander/site.tgz
triggers:
  - action: email
    condition: always

M Makefile => Makefile +2 -2
@@ 1,9 1,9 @@
sub_dirs := pkg internal cmd
target_dirs := $(foreach dir,$(sub_dirs),$(wildcard $(dir)/*)) site
make_target_dirs = $(foreach dir,$(target_dirs),$(MAKE) -C $(dir) $@;)
binaries := cmd/snippetpixie/snippetpixie cmd/snippetpixied/snippetpixied cmd/snippetpixiegui/build/bin/snippetpixiegui cmd/snippetpixiex/snippetpixiex
binaries := cmd/snippetexpander/snippetexpander cmd/snippetexpanderd/snippetexpanderd cmd/snippetexpandergui/build/bin/snippetexpandergui cmd/snippetexpanderx/snippetexpanderx
tgz_src = $(foreach binary,$(binaries),-C $(dir $(realpath $(binary))) $(notdir $(binary)))
tgz := snippetpixie.tgz
tgz := snippetexpander.tgz
site_tgz := site.tgz

.PHONY: all

M README.md => README.md +12 -11
@@ 1,4 1,4 @@
# Snippet Pixie
# Snippet Expander

Your little expandable text snippet helper.



@@ 7,17 7,18 @@ Your little expandable text snippet helper.
You're very likely wanting the current version
of [Snippet Pixie](https://www.snippetpixie.com).

The repository for the released version is
The repository for the released version of Snippet Pixie is
on [GitHub](https://github.com/bytepixie/snippetpixie).

## Description

Please check out the above sites for the current release of Snippet Pixie.
Please check out the above sites for the current release of Snippet Pixie,
but if you're interested in its successor, Snippet Expander, keep reading.

## Project Status

This version of Snippet Pixie is a rewrite from scratch and is far from
complete.
This version of Snippet Expander is a rewrite from scratch of Snippet Pixie
and is far from complete.

## Why a rewrite?



@@ 42,17 43,17 @@ YouTube video, or post to the mailing list.

## Mailing Lists

To discuss Snippet Pixie please post to
the [snippetpixie-discuss](https://lists.sr.ht/~ianmjones/snippetpixie-discuss)
To discuss Snippet Expander please post to
the [snippetexpander-discuss](https://lists.sr.ht/~ianmjones/snippetexpander-discuss)
mailing list.

There is also a low-volume
[mailing list for announcements](https://lists.sr.ht/~ianmjones/snippetpixie-announce)
related to the Snippet Pixie project. This is a read-only list.
[mailing list for announcements](https://lists.sr.ht/~ianmjones/snippetexpander-announce)
related to the Snippet Expander project. This is a read-only list.

## IRC

There is a [#snippetpixie](irc://irc.libera.chat/#snippetpixie) IRC channel on
There is a [#snippetexpander](irc://irc.libera.chat/#snippetexpander) IRC channel on
the [Libera.Chat](https://libera.chat) network.

## License


@@ 62,4 63,4 @@ details.

## Build Status

[![builds.sr.ht status](https://builds.sr.ht/~ianmjones/snippetpixie.svg)](https://builds.sr.ht/~ianmjones/snippetpixie?)
[![builds.sr.ht status](https://builds.sr.ht/~ianmjones/snippetexpander.svg)](https://builds.sr.ht/~ianmjones/snippetexpander?)

R cmd/snippetpixie/.gitignore => cmd/snippetexpander/.gitignore +0 -0
R cmd/snippetpixie/Makefile => cmd/snippetexpander/Makefile +1 -1
@@ 1,4 1,4 @@
OBJ := snippetpixie
OBJ := snippetexpander

GO_SRC := $(shell find . -type f -name "*.go") $(shell find ../../pkg/ -type f -name "*.go" ) $(shell find ../../internal/ -type f -name "*.go" )
GO_MOD := go.mod $(wildcard ../../pkg/*/go.mod) $(wildcard ../../internal/*/go.mod)

R cmd/snippetpixie/config.go => cmd/snippetexpander/config.go +3 -3
@@ 83,7 83,7 @@ func (c *config) initDefaultFlagset(appName string, args []string, out io.Writer
	flags.BoolVar(&stopFlag, "stop", false, stopUsage)

	var autostart string
	autostartUsage := "turn auto start of Snippet Pixie on login, \"on\", \"off\", or show \"status\" of setting"
	autostartUsage := "turn auto start of Snippet Expander on login, \"on\", \"off\", or show \"status\" of setting"
	flags.StringVar(&autostart, "autostart", "", autostartUsage)

	var autoexpand string


@@ 673,11 673,11 @@ func (c *config) initAutostartFlagset(appName string, args []string, displayHelp
	options := "autostart [flags]"

	var onFlag bool
	onUsage := "Turn on auto start of Snippet Pixie on login"
	onUsage := "Turn on auto start of Snippet Expander on login"
	flags.BoolVar(&onFlag, "on", false, onUsage)

	var offFlag bool
	offUsage := "Turn off auto start of Snippet Pixie on login"
	offUsage := "Turn off auto start of Snippet Expander on login"
	flags.BoolVar(&offFlag, "off", false, offUsage)

	if displayHelp {

A cmd/snippetexpander/config_test.go => cmd/snippetexpander/config_test.go +253 -0
@@ 0,0 1,253 @@
package main

import (
	"bytes"
	"io"
	"os"
	"strings"
	"testing"
	"time"

	isIt "github.com/matryer/is"
)

func TestConfig_Init(t *testing.T) {
	is := isIt.New(t)

	exportDefaultFile := "snippets-" + time.Now().Format("2006-01-02") + ".json"

	cases := []struct {
		args         []string
		expectedCmd  string
		expectedArgs map[string]interface{}
		expectedOut  string
	}{
		{[]string{"snippetexpander", "--help"}, "", nil, "Usage: snippetexpander [COMMAND] [FLAGS]..."},
		{[]string{"snippetexpander", "-h"}, "", nil, "Usage: snippetexpander [COMMAND] [FLAGS]..."},
		{[]string{"snippetexpander", "--start"}, "Start", nil, ""},
		{[]string{"snippetexpander", "--start", "--version"}, "Version", nil, ""},
		{[]string{"snippetexpander", "--start", "-v"}, "Version", nil, ""},
		{[]string{"snippetexpander", "--start", "--status"}, "Status", nil, ""},
		{[]string{"snippetexpander", "--start", "--stop"}, "Start", nil, ""},
		{[]string{"snippetexpander", "--stop"}, "Stop", nil, ""},
		{[]string{"snippetexpander", "--stop", "--version"}, "Version", nil, ""},
		{[]string{"snippetexpander", "--stop", "-v"}, "Version", nil, ""},
		{[]string{"snippetexpander", "--stop", "--status"}, "Status", nil, ""},
		{[]string{"snippetexpander", "--stop", "--start"}, "Start", nil, ""},
		{[]string{"snippetexpander", "--status"}, "Status", nil, ""},
		{[]string{"snippetexpander", "--version"}, "Version", nil, ""},
		{[]string{"snippetexpander", "-v"}, "Version", nil, ""},
		{[]string{"snippetexpander", "--version", "--status"}, "Version", nil, ""},
		{[]string{"snippetexpander", "--status", "--version"}, "Version", nil, ""},
		{[]string{"snippetexpander", "add", "se`", "Snippet Expander"}, "AddSnippet", map[string]interface{}{"abbreviation": "se`", "body": "Snippet Expander"}, ""},
		{[]string{"snippetexpander", "add", "--abbreviation=se`", "--body=Snippet Expander"}, "AddSnippet", map[string]interface{}{"abbreviation": "se`", "body": "Snippet Expander"}, ""},
		{[]string{"snippetexpander", "add", "-a=se`", "-b=Snippet Expander"}, "AddSnippet", map[string]interface{}{"abbreviation": "se`", "body": "Snippet Expander"}, ""},
		{[]string{"snippetexpander", "add", "--body=Snippet Expander", "--abbreviation=se`"}, "AddSnippet", map[string]interface{}{"abbreviation": "se`", "body": "Snippet Expander"}, ""},
		{[]string{"snippetexpander", "add", "-b=Snippet Expander", "-a=se`"}, "AddSnippet", map[string]interface{}{"abbreviation": "se`", "body": "Snippet Expander"}, ""},
		{[]string{"snippetexpander", "copy", "se`"}, "Copy", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "copy", "--abbreviation=se`"}, "Copy", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "copy", "-a=se`"}, "Copy", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "copy", "doesnotexist`"}, "Copy", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "copy", "se`", "--skip-last-used"}, "Copy", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "copy", "--abbreviation=se`", "--skip-last-used"}, "Copy", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "copy", "-a=se`", "-u"}, "Copy", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "copy", "doesnotexist`", "--skip-last-used"}, "Copy", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "expand", "se`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "expand", "--abbreviation=se`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "expand", "-a=se`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "expand", "doesnotexist`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": false}, ""},
		{[]string{"snippetexpander", "expand", "se`", "--skip-last-used"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "expand", "--abbreviation=se`", "--skip-last-used"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "expand", "-a=se`", "-u"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "se`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "expand", "doesnotexist`", "--skip-last-used"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": true}, ""},
		{[]string{"snippetexpander", "export"}, "Export", map[string]interface{}{"filename": exportDefaultFile, "version": 0}, ""},
		{[]string{"snippetexpander", "export", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetexpander", "export", "--filename", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetexpander", "export", "-f", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetexpander", "export", "--filename=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetexpander", "export", "-f=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetexpander", "export", "--version=101"}, "Export", map[string]interface{}{"filename": exportDefaultFile, "version": 101}, ""},
		{[]string{"snippetexpander", "export", "--version=101", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetexpander", "export", "wibble.json", "--version=101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetexpander", "export", "--filename", "wibble.json", "--version", "101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetexpander", "export", "-f", "wibble.json", "-v", "101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetexpander", "export", "--filename=wibble.json", "--version=101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetexpander", "export", "-f=wibble.json", "-v=101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetexpander", "--export"}, "Export", map[string]interface{}{"filename": exportDefaultFile}, ""},
		{[]string{"snippetexpander", "--export", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json"}, ""},
		{[]string{"snippetexpander", "--export=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json"}, ""},
		{[]string{"snippetexpander", "-e=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json"}, ""},
		{[]string{"snippetexpander", "help", "add"}, "", nil, "Usage: snippetexpander add abbreviation body"},
		{[]string{"snippetexpander", "help", "copy"}, "", nil, "Usage: snippetexpander copy [flags] abbreviation"},
		{[]string{"snippetexpander", "help", "expand"}, "", nil, "Usage: snippetexpander expand abbreviation"},
		{[]string{"snippetexpander", "help", "export"}, "", nil, "Usage: snippetexpander export [flags]"},
		{[]string{"snippetexpander", "help", "help"}, "", nil, "Usage: snippetexpander help command"},
		{[]string{"snippetexpander", "help", "import"}, "", nil, "Usage: snippetexpander import [flags] filename"},
		{[]string{"snippetexpander", "help", "list"}, "", nil, "Usage: snippetexpander list [flags] [search string]"},
		{[]string{"snippetexpander", "help", "ping"}, "", nil, "Usage: snippetexpander ping [flags] [response]"},
		{[]string{"snippetexpander", "help", "remove"}, "", nil, "Usage: snippetexpander remove [flags] abbreviation"},
		{[]string{"snippetexpander", "import", "wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetexpander", "import", "--filename=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetexpander", "import", "-f=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetexpander", "import", "--filename=wibble.json", "--update"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": true}, ""},
		{[]string{"snippetexpander", "--import=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetexpander", "-i=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetexpander", "--import=wibble.json", "--force"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": true}, ""},
		{[]string{"snippetexpander", "help", "add"}, "", nil, "Usage: snippetexpander add abbreviation body"},
		{[]string{"snippetexpander", "list"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--search=se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-s=se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--search=se`", "--search=spu`"}, "GetSnippets", map[string]interface{}{"search": "spu`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""}, // 2nd arg wins
		{[]string{"snippetexpander", "list", "--recent"}, "GetSnippets", map[string]interface{}{"search": "", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-r"}, "GetSnippets", map[string]interface{}{"search": "", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--recent", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-r", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--search=se`", "--recent"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-s=se`", "-r"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--delimiter="}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": "", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--delimiter=|"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": "|", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-d=,"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": ",", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--delimiter=|", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": "|", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-d=,", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": ",", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--delimiter=|", "--search=se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": "|", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-d=,", "-s=se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": ",", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--id"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-i"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--id", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-i", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--abbreviation"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-a"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--abbreviation", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-a", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--body"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-b"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--body", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "-b", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetexpander", "list", "--last-used"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetexpander", "list", "-l"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetexpander", "list", "--last-used", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetexpander", "list", "-l", "se`"}, "GetSnippets", map[string]interface{}{"search": "se`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetexpander", "ping"}, "Ping", map[string]interface{}{"response": "pong"}, ""},
		{[]string{"snippetexpander", "ping", "wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetexpander", "ping", "-r=wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetexpander", "ping", "--response=wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetexpander", "ping", "--response", "wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetexpander", "ping", "-r", "wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetexpander", "remove", "se`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "se`"}, ""},
		{[]string{"snippetexpander", "remove", "--abbreviation=se`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "se`"}, ""},
		{[]string{"snippetexpander", "remove", "-a=se`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "se`"}, ""},
		{[]string{"snippetexpander", "remove", "doesnotexist`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "doesnotexist`"}, ""},
		{[]string{"snippetexpander", "autostart"}, "GetAutostartStatus", nil, ""},
		{[]string{"snippetexpander", "autostart", "--on"}, "UpdateAutostart", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetexpander", "autostart", "--off"}, "UpdateAutostart", map[string]interface{}{"on": false}, ""},
		{[]string{"snippetexpander", "--autostart=status"}, "GetAutostartStatus", nil, ""},
		{[]string{"snippetexpander", "--autostart=on"}, "UpdateAutostart", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetexpander", "--autostart=off"}, "UpdateAutostart", map[string]interface{}{"on": false}, ""},
		{[]string{"snippetexpander", "autoexpand"}, "GetAutoexpandStatus", nil, ""},
		{[]string{"snippetexpander", "autoexpand", "--on"}, "UpdateAutoexpand", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetexpander", "autoexpand", "--off"}, "UpdateAutoexpand", map[string]interface{}{"on": false}, ""},
		{[]string{"snippetexpander", "--autoexpand=status"}, "GetAutoexpandStatus", nil, ""},
		{[]string{"snippetexpander", "--autoexpand=on"}, "UpdateAutoexpand", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetexpander", "--autoexpand=off"}, "UpdateAutoexpand", map[string]interface{}{"on": false}, ""},
	}

	for _, spec := range cases {
		var stdout bytes.Buffer
		c := &config{}

		err := c.init(spec.args, &stdout)
		is.NoErr(err) // flags parsed ok

		out := stdout.String()
		if len(spec.expectedOut) > 0 {
			is.True(len(out) > 0)                            // expect output
			is.True(strings.Contains(out, spec.expectedOut)) // expected out to contain string
		} else {
			is.Equal(out, "") // expect empty output
		}

		is.Equal(c.Cmd, spec.expectedCmd)   // expected command name
		is.Equal(c.Args, spec.expectedArgs) // expected arguments
	}
}

func TestConfig_InitFail(t *testing.T) {
	is := isIt.New(t)

	cases := []struct {
		args []string
	}{
		{[]string{"snippetexpander"}},
		{[]string{"snippetexpander", "wibble"}},
		{[]string{"snippetexpander", "--wibble"}},
		{[]string{"snippetexpander", "--wibble", "wobble"}},
		{[]string{"snippetexpander", "add"}},
		{[]string{"snippetexpander", "add", "se`"}},
		{[]string{"snippetexpander", "add", "se`", "Snippet Expander", "Rules!"}},
		{[]string{"snippetexpander", "add", "--abbreviation='se`'"}},
		{[]string{"snippetexpander", "add", "-a='se`'"}},
		{[]string{"snippetexpander", "add", "--body='Snippet Expander'"}},
		{[]string{"snippetexpander", "add", "-b='Snippet Expander'"}},
		{[]string{"snippetexpander", "add", "\t", "\t"}},
		{[]string{"snippetexpander", "add", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "copy"}},
		{[]string{"snippetexpander", "copy", "\t"}},
		{[]string{"snippetexpander", "copy", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "copy", "--skip-last-used"}},
		{[]string{"snippetexpander", "copy", "-u"}},
		{[]string{"snippetexpander", "expand"}},
		{[]string{"snippetexpander", "expand", "\t"}},
		{[]string{"snippetexpander", "expand", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "export", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "help"}},
		{[]string{"snippetexpander", "help", "doesnotexist"}},
		{[]string{"snippetexpander", "help", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "--import"}},
		{[]string{"snippetexpander", "--import="}},
		{[]string{"snippetexpander", "import"}},
		{[]string{"snippetexpander", "import", "\t"}},
		{[]string{"snippetexpander", "import", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "list", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "list", "se`", "spu`"}},
		{[]string{"snippetexpander", "ping", "--nonexistentflag=wibble"}},
		{[]string{"snippetexpander", "ping", "wibble", "wobble"}},
		{[]string{"snippetexpander", "ping", "--response"}},
		{[]string{"snippetexpander", "ping", "-r"}},
		{[]string{"snippetexpander", "remove"}},
		{[]string{"snippetexpander", "remove", "\t"}},
		{[]string{"snippetexpander", "remove", "--nonexistentflag='se`'"}},
		{[]string{"snippetexpander", "autostart", "--nonexistentflag"}},
		{[]string{"snippetexpander", "--autostart"}},
		{[]string{"snippetexpander", "--autostart=wibble"}},
		{[]string{"snippetexpander", "autoexpand", "--nonexistentflag"}},
		{[]string{"snippetexpander", "--autoexpand"}},
		{[]string{"snippetexpander", "--autoexpand=wibble"}},
	}

	for _, spec := range cases {
		var stdout bytes.Buffer

		// Redirect stderr to a variable.
		oldStderr := os.Stderr
		stderrOutput, stderrWriter, _ := os.Pipe()
		os.Stderr = stderrWriter
		c := &config{}

		err := c.init(spec.args, &stdout)

		// Read output sent to stderr and restore stderr to normal operation.
		_ = stderrWriter.Close()
		stderr, _ := io.ReadAll(stderrOutput)
		os.Stderr = oldStderr
		stderrOut := string(stderr)

		is.True(err != nil) // err returned from init

		out := stdout.String()
		is.Equal(out, "") // expect empty output

		is.True(len(stderrOut) > 0)                    // expect output
		is.True(strings.Contains(stderrOut, "Usage:")) // expect usage message
	}
}

A cmd/snippetexpander/go.mod => cmd/snippetexpander/go.mod +25 -0
@@ 0,0 1,25 @@
module git.sr.ht/~ianmjones/snippetexpander/cmd/snippetexpander

go 1.19

replace git.sr.ht/~ianmjones/snippetexpander/internal/export v0.0.0-unpublished => ../../internal/export

replace git.sr.ht/~ianmjones/snippetexpander/internal/service v0.0.0-unpublished => ../../internal/service

replace git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice

replace git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet

require (
	git.sr.ht/~ianmjones/snippetexpander/internal/export v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/internal/service v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished
	github.com/godbus/dbus/v5 v5.1.0
	github.com/matryer/is v1.4.1
	github.com/spf13/pflag v1.0.5
)

require (
	git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished // indirect
	github.com/gofrs/uuid v4.4.0+incompatible // indirect
)

R cmd/snippetpixie/go.sum => cmd/snippetexpander/go.sum +0 -0
R cmd/snippetpixie/main.go => cmd/snippetexpander/main.go +5 -5
@@ 9,9 9,9 @@ import (
	"os/exec"
	"os/signal"

	"git.sr.ht/~ianmjones/snippetpixie/internal/export"
	"git.sr.ht/~ianmjones/snippetpixie/internal/service"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice"
	"git.sr.ht/~ianmjones/snippetexpander/internal/export"
	"git.sr.ht/~ianmjones/snippetexpander/internal/service"
	"git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice"
	"github.com/godbus/dbus/v5"
)



@@ 97,9 97,9 @@ func run(ctx context.Context, c *config, out io.Writer) error {
		}

	case "Start":
		path, err := exec.LookPath("snippetpixied")
		path, err := exec.LookPath("snippetexpanderd")
		if err != nil {
			_, err = fmt.Fprintln(out, "Could not find snippetpixied, is it installed?")
			_, err = fmt.Fprintln(out, "Could not find snippetexpanderd, is it installed?")
			os.Exit(1)
		}


A cmd/snippetexpander/snippetexpander => cmd/snippetexpander/snippetexpander +0 -0
R cmd/snippetpixied/.gitignore => cmd/snippetexpanderd/.gitignore +0 -0
R cmd/snippetpixied/Makefile => cmd/snippetexpanderd/Makefile +1 -1
@@ 1,4 1,4 @@
OBJ := snippetpixied
OBJ := snippetexpanderd

GO_SRC := $(shell find . -type f -name "*.go") $(shell find ../../pkg/ -type f -name "*.go" ) $(shell find ../../internal/ -type f -name "*.go" )
GO_MOD := go.mod $(wildcard ../../pkg/*/go.mod) $(wildcard ../../internal/*/go.mod)

R cmd/snippetpixied/dbus.go => cmd/snippetexpanderd/dbus.go +12 -13
@@ 9,13 9,12 @@ import (
	"os/exec"
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/internal/manager"
	"git.sr.ht/~ianmjones/snippetexpander/internal/paste"
	"git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice"
	"github.com/emersion/go-autostart"
	"github.com/godbus/dbus/v5"
	"github.com/gofrs/uuid"

	"git.sr.ht/~ianmjones/snippetpixie/internal/manager"
	"git.sr.ht/~ianmjones/snippetpixie/internal/paste"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice"
)

type service struct {


@@ 476,9 475,9 @@ func (s *service) UpdateAutoexpand(on bool) *dbus.Error {
		}
	}

	path, err := exec.LookPath("snippetpixiex")
	path, err := exec.LookPath("snippetexpanderx")
	if err != nil {
		return dbus.MakeFailedError(errors.New("Could not find snippetpixiex, is it installed?"))
		return dbus.MakeFailedError(errors.New("Could not find snippetexpanderx, is it installed?"))
	}

	cmd := exec.Command("nohup", path, arg)


@@ 493,7 492,7 @@ func (s *service) UpdateAutoexpand(on bool) *dbus.Error {

// GetAutoexpandStatus to see whether it is turned on.
func (s *service) GetAutoexpandStatus() (bool, *dbus.Error) {
	// TODO: Also check whether snippetpixiex is running via its status param.
	// TODO: Also check whether snippetexpanderx is running via its status param.
	return s.autoexpand.IsEnabled(), nil
}



@@ 505,15 504,15 @@ func NewService(c *config) (*service, error) {
	}

	daemon := &autostart.App{
		Name:        "snippetpixied",
		DisplayName: "Snippet Pixie daemon",
		Exec:        []string{"snippetpixied"},
		Name:        "snippetexpanderd",
		DisplayName: "Snippet Expander daemon",
		Exec:        []string{"snippetexpanderd"},
	}

	autoexpand := &autostart.App{
		Name:        "snippetpixiex",
		DisplayName: "Snippet Pixie auto expander daemon",
		Exec:        []string{"snippetpixiex"},
		Name:        "snippetexpanderx",
		DisplayName: "Snippet Expander auto expander daemon",
		Exec:        []string{"snippetexpanderx"},
	}

	serv := &service{

R cmd/snippetpixied/dbus_test.go => cmd/snippetexpanderd/dbus_test.go +11 -12
@@ 6,11 6,10 @@ import (
	"testing"
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/internal/manager"
	"git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice"
	isIt "github.com/matryer/is"
	_ "github.com/mattn/go-sqlite3"

	"git.sr.ht/~ianmjones/snippetpixie/internal/manager"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice"
)

func skelTestSnippets(t *testing.T) (*isIt.I, *service, *bytes.Buffer) {


@@ 19,7 18,7 @@ func skelTestSnippets(t *testing.T) (*isIt.I, *service, *bytes.Buffer) {
	var stdout bytes.Buffer
	c := &config{}

	err := c.init([]string{"snippetpixie"}, &stdout)
	err := c.init([]string{"snippetexpander"}, &stdout)
	is.NoErr(err) // flags parsed ok

	out := stdout.String()


@@ 36,13 35,13 @@ func skelTestSnippets(t *testing.T) (*isIt.I, *service, *bytes.Buffer) {
	serv.snippets, err = manager.New(serv.db)
	is.NoErr(err)

	_, err = serv.AddSnippet("sp`", "Snippet Pixie")
	_, err = serv.AddSnippet("sp`", "Snippet Expander")
	is.Equal(err, nil) // no err on AddSnippet

	_, err = serv.AddSnippet("ww`", "Wibble Wobble")
	is.Equal(err, nil) // no err on AddSnippet

	_, err = serv.AddSnippet("bp`", "Byte Pixie")
	_, err = serv.AddSnippet("bp`", "Byte Expander")
	is.Equal(err, nil) // no err on AddSnippet

	return is, serv, &stdout


@@ 54,7 53,7 @@ func TestService_Ping(t *testing.T) {
	var stdout bytes.Buffer
	c := &config{}

	err := c.init([]string{"snippetpixie"}, &stdout)
	err := c.init([]string{"snippetexpander"}, &stdout)
	is.NoErr(err) // flags parsed ok

	out := stdout.String()


@@ 81,7 80,7 @@ func TestService_AddSnippet(t *testing.T) {
	var stdout bytes.Buffer
	c := &config{}

	err := c.init([]string{"snippetpixie"}, &stdout)
	err := c.init([]string{"snippetexpander"}, &stdout)
	is.NoErr(err) // flags parsed ok

	out := stdout.String()


@@ 104,11 103,11 @@ func TestService_AddSnippet(t *testing.T) {

	newSnippet := &dbusservice.Snippet{
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Body:         "Snippet Expander",
		LastUsed:     time.Unix(0, 0).UTC().Unix(),
	}

	response, err := serv.AddSnippet("sp`", "Snippet Pixie")
	response, err := serv.AddSnippet("sp`", "Snippet Expander")
	is.Equal(err, nil) // no err on AddSnippet

	is.Equal(response.Abbreviation, newSnippet.Abbreviation) // expected abbreviation


@@ 116,7 115,7 @@ func TestService_AddSnippet(t *testing.T) {
	is.Equal(response.LastUsed, newSnippet.LastUsed)         // expected last used date

	// Test that adding a duplicate abbreviation fails.
	response, err = serv.AddSnippet("sp`", "Snippet Pixie rules!")
	response, err = serv.AddSnippet("sp`", "Snippet Expander rules!")
	is.True(err != nil) // err on AddSnippet with duplicate
	is.Equal(err.Error(), "that Abbreviation already exists")
}


@@ 407,7 406,7 @@ func TestService_SaveSetting(t *testing.T) {
	var stdout bytes.Buffer
	c := &config{}

	err := c.init([]string{"snippetpixie"}, &stdout)
	err := c.init([]string{"snippetexpander"}, &stdout)
	is.NoErr(err) // flags parsed ok

	out := stdout.String()

R cmd/snippetpixied/go.mod => cmd/snippetexpanderd/go.mod +9 -9
@@ 1,19 1,19 @@
module git.sr.ht/~ianmjones/snippetpixie/cmd/snippetpixied
module git.sr.ht/~ianmjones/snippetexpander/cmd/snippetexpanderd

go 1.19

replace git.sr.ht/~ianmjones/snippetpixie/internal/manager v0.0.0-unpublished => ../../internal/manager
replace git.sr.ht/~ianmjones/snippetexpander/internal/manager v0.0.0-unpublished => ../../internal/manager

replace git.sr.ht/~ianmjones/snippetpixie/internal/paste v0.0.0-unpublished => ../../internal/paste
replace git.sr.ht/~ianmjones/snippetexpander/internal/paste v0.0.0-unpublished => ../../internal/paste

replace git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice
replace git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice

replace git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet
replace git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet

require (
	git.sr.ht/~ianmjones/snippetpixie/internal/manager v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/internal/paste v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/internal/manager v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/internal/paste v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished
	github.com/adrg/xdg v0.4.0
	github.com/emersion/go-autostart v0.0.0-20210130080809-00ed301c8e9a
	github.com/godbus/dbus/v5 v5.1.0


@@ 24,7 24,7 @@ require (
)

require (
	git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished // indirect
	git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished // indirect
	github.com/gohugoio/locales v0.14.0 // indirect
	github.com/gohugoio/localescompressed v1.0.1 // indirect
	github.com/lestrrat-go/strftime v1.0.6 // indirect

R cmd/snippetpixied/go.sum => cmd/snippetexpanderd/go.sum +0 -0
R cmd/snippetpixied/main.go => cmd/snippetexpanderd/main.go +4 -4
@@ 4,16 4,16 @@ import (
	"context"
	"database/sql"
	"fmt"
	"github.com/adrg/xdg"
	_ "github.com/mattn/go-sqlite3"
	flag "github.com/spf13/pflag"
	"io"
	"log"
	"os"
	"os/signal"
	"path/filepath"

	"git.sr.ht/~ianmjones/snippetpixie/internal/manager"
	"git.sr.ht/~ianmjones/snippetexpander/internal/manager"
	"github.com/adrg/xdg"
	_ "github.com/mattn/go-sqlite3"
	flag "github.com/spf13/pflag"
)

type config struct {

R cmd/snippetpixied/main_test.go => cmd/snippetexpanderd/main_test.go +3 -3
@@ 14,9 14,9 @@ func TestConfig_Init(t *testing.T) {
		args           []string
		expectedDBPath string
	}{
		{[]string{"snippetpixie"}, "snippetpixie/snippetpixie.db"},
		{[]string{"snippetpixie", "-d", "wibble/wobble.db"}, "wibble/wobble.db"},
		{[]string{"snippetpixie", "--database=wibble/wobble.db"}, "wibble/wobble.db"},
		{[]string{"snippetexpander"}, "snippetexpander/snippetexpander.db"},
		{[]string{"snippetexpander", "-d", "wibble/wobble.db"}, "wibble/wobble.db"},
		{[]string{"snippetexpander", "--database=wibble/wobble.db"}, "wibble/wobble.db"},
	}

	var stdout bytes.Buffer

A cmd/snippetexpanderd/snippetexpanderd => cmd/snippetexpanderd/snippetexpanderd +0 -0
R cmd/snippetpixiegui/.gitignore => cmd/snippetexpandergui/.gitignore +0 -0
R cmd/snippetpixiegui/Makefile => cmd/snippetexpandergui/Makefile +1 -1
@@ 1,4 1,4 @@
OBJ := build/bin/snippetpixiegui
OBJ := build/bin/snippetexpandergui

GO_SRC := $(shell find . -type f -name "*.go") $(shell find ../../pkg/ -type f -name "*.go" ) $(shell find ../../internal/ -type f -name "*.go" )
GO_MOD := go.mod $(wildcard ../../pkg/*/go.mod) $(wildcard ../../internal/*/go.mod)

R cmd/snippetpixiegui/README.md => cmd/snippetexpandergui/README.md +0 -0
R cmd/snippetpixiegui/app.go => cmd/snippetexpandergui/app.go +11 -11
@@ 9,10 9,10 @@ import (
	"strings"
	"time"

	"git.sr.ht/~ianmjones/snippetpixie/internal/export"
	"git.sr.ht/~ianmjones/snippetpixie/internal/service"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
	"git.sr.ht/~ianmjones/snippetexpander/internal/export"
	"git.sr.ht/~ianmjones/snippetexpander/internal/service"
	"git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice"
	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
	"github.com/godbus/dbus/v5"
	"github.com/gofrs/uuid"
	"github.com/wailsapp/wails/v2/pkg/runtime"


@@ 107,13 107,13 @@ func (a *App) GetSnippetWithID(id string) (*snippet.Snippet, error) {
func (a *App) ImportSnippets(update bool) (bool, error) {
	var filters []runtime.FileFilter
	filter := runtime.FileFilter{
		DisplayName: "Snippet Pixie export (*.json)",
		DisplayName: "Snippet Expander export (*.json)",
		Pattern:     "*.json",
	}
	filters = append(filters, filter)

	options := runtime.OpenDialogOptions{
		Title:   "Select Snippet Pixie export file for import",
		Title:   "Select Snippet Expander export file for import",
		Filters: filters,
	}



@@ 181,7 181,7 @@ func (a *App) ExportSnippets() (bool, error) {

	var filters []runtime.FileFilter
	filter := runtime.FileFilter{
		DisplayName: "Snippet Pixie export (*.json)",
		DisplayName: "Snippet Expander export (*.json)",
		Pattern:     "*.json",
	}
	filters = append(filters, filter)


@@ 270,7 270,7 @@ func (a *App) UpdateAutoexpand(on bool) error {

// DaemonInstalled or not?
func (a *App) DaemonInstalled() bool {
	_, err := exec.LookPath("snippetpixied")
	_, err := exec.LookPath("snippetexpanderd")
	if err != nil {
		return false
	}


@@ 288,11 288,11 @@ func (a *App) DaemonRunning() bool {
	return false
}

// StartDaemon tries to start snippetpixied.
// StartDaemon tries to start snippetexpanderd.
func (a *App) StartDaemon() error {
	path, err := exec.LookPath("snippetpixied")
	path, err := exec.LookPath("snippetexpanderd")
	if err != nil {
		return errors.New("Could not find snippetpixied, is it installed?")
		return errors.New("Could not find snippetexpanderd, is it installed?")
	}

	if a.DaemonRunning() {

R cmd/snippetpixiegui/assets.go => cmd/snippetexpandergui/assets.go +0 -0
R cmd/snippetpixiegui/assets_bindings.go => cmd/snippetexpandergui/assets_bindings.go +0 -0
R cmd/snippetpixiegui/build/README.md => cmd/snippetexpandergui/build/README.md +0 -0
R cmd/snippetpixiegui/build/appicon.png => cmd/snippetexpandergui/build/appicon.png +0 -0
R cmd/snippetpixiegui/build/darwin/Info.plist => cmd/snippetexpandergui/build/darwin/Info.plist +0 -0
R cmd/snippetpixiegui/build/linux/share/applications/snippetpixiegui.desktop => cmd/snippetexpandergui/build/linux/share/applications/snippetexpandergui.desktop +0 -0
R cmd/snippetpixiegui/build/linux/share/icons/hicolor/128x128/apps/snippetpixiegui.svg => cmd/snippetexpandergui/build/linux/share/icons/hicolor/128x128/apps/snippetexpandergui.svg +0 -0
R cmd/snippetpixiegui/build/linux/share/icons/hicolor/256x256/apps/snippetpixiegui.svg => cmd/snippetexpandergui/build/linux/share/icons/hicolor/256x256/apps/snippetexpandergui.svg +0 -0
R cmd/snippetpixiegui/build/linux/share/icons/hicolor/32x32/apps/snippetpixiegui.svg => cmd/snippetexpandergui/build/linux/share/icons/hicolor/32x32/apps/snippetexpandergui.svg +0 -0
R cmd/snippetpixiegui/build/linux/share/icons/hicolor/48x48/apps/snippetpixiegui.svg => cmd/snippetexpandergui/build/linux/share/icons/hicolor/48x48/apps/snippetexpandergui.svg +0 -0
R cmd/snippetpixiegui/build/linux/share/icons/hicolor/64x64/apps/snippetpixiegui.svg => cmd/snippetexpandergui/build/linux/share/icons/hicolor/64x64/apps/snippetexpandergui.svg +0 -0
R cmd/snippetpixiegui/build/windows/icon.ico => cmd/snippetexpandergui/build/windows/icon.ico +0 -0
R cmd/snippetpixiegui/build/windows/info.json => cmd/snippetexpandergui/build/windows/info.json +0 -0
R cmd/snippetpixiegui/build/windows/installer/project.nsi => cmd/snippetexpandergui/build/windows/installer/project.nsi +0 -0
R cmd/snippetpixiegui/build/windows/wails.exe.manifest => cmd/snippetexpandergui/build/windows/wails.exe.manifest +0 -0
R cmd/snippetpixiegui/config.go => cmd/snippetexpandergui/config.go +3 -2
@@ 3,10 3,11 @@ package main
import (
	"errors"
	"fmt"
	flag "github.com/spf13/pflag"
	"io"
	"os"
	"path/filepath"

	flag "github.com/spf13/pflag"
)

// init sets up App config based on command line args.


@@ 26,7 27,7 @@ func (a *App) initDefaultFlagset(appName string, args []string, out io.Writer) (
	flags.SetOutput(out)

	var searchAndPasteFlag bool
	searchAndPasteUsage := "show Snippet Pixie's quick search and paste window"
	searchAndPasteUsage := "show Snippet Expander's quick search and paste window"
	flags.BoolVarP(&searchAndPasteFlag, "search-and-paste", "s", false, searchAndPasteUsage)

	var versionFlag bool

R cmd/snippetpixiegui/config_test.go => cmd/snippetexpandergui/config_test.go +15 -15
@@ 19,16 19,16 @@ func TestConfig_Init(t *testing.T) {
		searchAndPaste bool
		expectedOut    string
	}{
		{[]string{"snippetpixiegui", "--help"}, true, false, "Usage: snippetpixiegui [FLAG]"},
		{[]string{"snippetpixiegui", "-h"}, true, false, "Usage: snippetpixiegui [FLAG]"},
		{[]string{"snippetpixiegui", "--version", "--help"}, true, false, "Usage: snippetpixiegui [FLAG]"},
		{[]string{"snippetpixiegui", "--search-and-paste", "--version", "--help"}, true, false, "Usage: snippetpixiegui [FLAG]"},
		{[]string{"snippetpixiegui", "--version"}, true, false, "2.0.0-alpha.7"},
		{[]string{"snippetpixiegui", "-v"}, true, false, "2.0.0-alpha.7"},
		{[]string{"snippetpixiegui", "--search-and-paste", "--version"}, true, false, "2.0.0-alpha.7"},
		{[]string{"snippetpixiegui", "--search-and-paste"}, false, true, ""},
		{[]string{"snippetpixiegui", "-s"}, false, true, ""},
		{[]string{"snippetpixiegui"}, false, false, ""},
		{[]string{"snippetexpandergui", "--help"}, true, false, "Usage: snippetexpandergui [FLAG]"},
		{[]string{"snippetexpandergui", "-h"}, true, false, "Usage: snippetexpandergui [FLAG]"},
		{[]string{"snippetexpandergui", "--version", "--help"}, true, false, "Usage: snippetexpandergui [FLAG]"},
		{[]string{"snippetexpandergui", "--search-and-paste", "--version", "--help"}, true, false, "Usage: snippetexpandergui [FLAG]"},
		{[]string{"snippetexpandergui", "--version"}, true, false, "2.0.0-alpha.7"},
		{[]string{"snippetexpandergui", "-v"}, true, false, "2.0.0-alpha.7"},
		{[]string{"snippetexpandergui", "--search-and-paste", "--version"}, true, false, "2.0.0-alpha.7"},
		{[]string{"snippetexpandergui", "--search-and-paste"}, false, true, ""},
		{[]string{"snippetexpandergui", "-s"}, false, true, ""},
		{[]string{"snippetexpandergui"}, false, false, ""},
	}

	for _, spec := range cases {


@@ 57,11 57,11 @@ func TestConfig_InitFail(t *testing.T) {
	cases := []struct {
		args []string
	}{
		{[]string{"snippetpixiegui", "wibble"}},
		{[]string{"snippetpixiegui", "--wibble"}},
		{[]string{"snippetpixiegui", "--wibble", "wobble"}},
		{[]string{"snippetpixiegui", "-w"}},
		{[]string{"snippetpixiegui", "-w", "wobble"}},
		{[]string{"snippetexpandergui", "wibble"}},
		{[]string{"snippetexpandergui", "--wibble"}},
		{[]string{"snippetexpandergui", "--wibble", "wobble"}},
		{[]string{"snippetexpandergui", "-w"}},
		{[]string{"snippetexpandergui", "-w", "wobble"}},
	}

	for _, spec := range cases {

R cmd/snippetpixiegui/frontend/README.md => cmd/snippetexpandergui/frontend/README.md +0 -0
A cmd/snippetexpandergui/frontend/dist/assets/en-GB-f23fefe1.js => cmd/snippetexpandergui/frontend/dist/assets/en-GB-f23fefe1.js +1 -0
@@ 0,0 1,1 @@
const t={title:"Abbreviation",empty:"Please enter an Abbreviation",exists:"That Abbreviation already exists"},e={title:"Body"},n={title:"Add Snippet",error_title:"Error adding snippet"},o={title:"Edit Snippet",error_title:"Error editing snippet",id_not_supplied:"A Snippet ID was not specified for edit.",snippet_not_found:"Could not find Snippet for edit."},s={title:"Remove Snippet",error_title:"Error removing snippet"},i={title:"Import Snippets",new_only_title:"Import Snippets: Discarding Duplicates",update_title:"Import Snippets: Update Existing",error_title:"Error importing snippets"},r={title:"Export Snippets",error_title:"Error exporting snippets"},p={title:"Settings",import_export_title:"Import & Export",get_error_title:"Error getting settings",save_error_title:"Error saving settings",no_connection:"Settings can only be changed when the daemon is running.",autostart_title:"Auto Start",autostart:"Start daemon on login",autoexpand_title:"Auto Expand Snippets",autoexpand:"Auto expand snippets as they are typed",search_and_paste_title:"Search & Paste",focus_search:"Focus search box",custom_shortcuts_disabled:"Unable to get or set custom shortcut, please set it manually.",custom_shortcut:"Custom Shortcut",custom_shortcut_empty:"none",remove_custom_shortcut:"Remove custom shortcut",change_custom_shortcut_desc:"To change the custom shortcut, please use your system's settings application.",add_default_custom_shortcut:"Add default custom shortcut"},a="Could not connect to the snippetexpanderd daemon.",c={title:"No Snippets Found",description:"Please try entering a different search term."},d={cancel:"Cancel",save:"Save",remove:"Remove",back:"Back",about:"About"},l="Loading…",u="Search…",_="Clear",m={not_installed:"It does not look like the required snippetexpanderd daemon is installed.",installed:"It looks like snippetexpanderd is installed.",start:"Start it?",starting:"Starting snippetexpanderd…"},g={description:"Your little expandable text snippet helper",source:"Source",licence_title:"Licence",licence:"GNU General Public License Version 2 Plus (GPLv2+)",by:"By"},h={abbreviation:t,body:e,add_snippet:n,edit_snippet:o,remove_snippet:s,import_snippets:i,export_snippets:r,settings:p,no_connection:a,no_snippets_found:c,button:d,loading:l,search:u,clear:_,daemon:m,about:g};export{t as abbreviation,g as about,n as add_snippet,e as body,d as button,_ as clear,m as daemon,h as default,o as edit_snippet,r as export_snippets,i as import_snippets,l as loading,a as no_connection,c as no_snippets_found,s as remove_snippet,u as search,p as settings};

R cmd/snippetpixiegui/frontend/dist/assets/index-288ebb61.js => cmd/snippetexpandergui/frontend/dist/assets/index-93f98e6b.js +3 -3
@@ 1,5 1,5 @@
var Di=Object.defineProperty;var Gi=(e,t,n)=>t in e?Di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ft=(e,t,n)=>(Gi(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const $i="modulepreload",ji=function(e){return"/"+e},Ln={},Fi=function(t,n,i){if(!n||n.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(n.map(s=>{if(s=ji(s),s in Ln)return;Ln[s]=!0;const o=s.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!i)for(let f=r.length-1;f>=0;f--){const p=r[f];if(p.href===s&&(!o||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":$i,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,p)=>{u.addEventListener("load",f),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function G(){}function pn(e,t){for(const n in t)e[n]=t[n];return e}function oi(e){return e()}function Pn(){return Object.create(null)}function Ee(e){e.forEach(oi)}function Qe(e){return typeof e=="function"}function Z(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let bt;function zi(e,t){return e===t?!0:(bt||(bt=document.createElement("a")),bt.href=t,e===bt.href)}function Vi(e){return Object.keys(e).length===0}function mn(e,...t){if(e==null){for(const i of t)i(void 0);return G}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Nn(e){let t;return mn(e,n=>t=n)(),t}function ne(e,t,n){e.$$.on_destroy.push(mn(t,n))}function ht(e,t,n,i){if(e){const r=li(e,t,n,i);return e[0](r)}}function li(e,t,n,i){return e[1]&&i?pn(n.ctx.slice(),e[1](i(t))):n.ctx}function pt(e,t,n,i){if(e[2]&&i){const r=e[2](i(n));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let l=0;l<o;l+=1)s[l]=t.dirty[l]|r[l];return s}return t.dirty|r}return t.dirty}function mt(e,t,n,i,r,s){if(r){const o=li(t,n,i,s);e.p(o,r)}}function dt(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;i<n;i++)t[i]=-1;return t}return-1}function Wi(e,t,n){return e.set(n),t}function dn(e){return e&&Qe(e.destroy)?e.destroy:G}function A(e,t){e.appendChild(t)}function g(e,t,n){e.insertBefore(t,n||null)}function _(e){e.parentNode&&e.parentNode.removeChild(e)}function Xi(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function L(e){return document.createElement(e)}function V(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function $(e){return document.createTextNode(e)}function R(){return $(" ")}function ye(){return $("")}function te(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function vt(e){return function(t){return t.preventDefault(),e.call(this,t)}}function c(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function qi(e){return Array.from(e.childNodes)}function z(e,t){t=""+t,e.data!==t&&(e.data=t)}function ze(e,t){e.value=t??""}function X(e,t,n){e.classList.toggle(t,!!n)}function Zi(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}function Ve(e,t){return new e(t)}let at;function st(e){at=e}function Ct(){if(!at)throw new Error("Function called outside component initialization");return at}function Je(e){Ct().$$.on_mount.push(e)}function ai(e){Ct().$$.after_update.push(e)}function _n(e){Ct().$$.on_destroy.push(e)}function _t(){const e=Ct();return(t,n,{cancelable:i=!1}={})=>{const r=e.$$.callbacks[t];if(r){const s=Zi(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function ut(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Ue=[],ve=[];let De=[];const en=[],ui=Promise.resolve();let tn=!1;function fi(){tn||(tn=!0,ui.then(ci))}function gn(){return fi(),ui}function nn(e){De.push(e)}function Ge(e){en.push(e)}const zt=new Set;let xe=0;function ci(){if(xe!==0)return;const e=at;do{try{for(;xe<Ue.length;){const t=Ue[xe];xe++,st(t),Qi(t.$$)}}catch(t){throw Ue.length=0,xe=0,t}for(st(null),Ue.length=0,xe=0;ve.length;)ve.pop()();for(let t=0;t<De.length;t+=1){const n=De[t];zt.has(n)||(zt.add(n),n())}De.length=0}while(Ue.length);for(;en.length;)en.pop()();tn=!1,zt.clear(),st(e)}function Qi(e){if(e.fragment!==null){e.update(),Ee(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(nn)}}function Ji(e){const t=[],n=[];De.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),De=t}const yt=new Set;let Oe;function ue(){Oe={r:0,c:[],p:Oe}}function fe(){Oe.r||Ee(Oe.c),Oe=Oe.p}function w(e,t){e&&e.i&&(yt.delete(e),e.i(t))}function S(e,t,n,i){if(e&&e.o){if(yt.has(e))return;yt.add(e),Oe.c.push(()=>{yt.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function On(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Bt(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],l=t[s];if(l){for(const a in o)a in l||(i[a]=1);for(const a in l)r[a]||(n[a]=l[a],r[a]=1);e[s]=l}else for(const a in o)r[a]=1}for(const o in i)o in n||(n[o]=void 0);return n}function Tt(e){return typeof e=="object"&&e!==null?e:{}}function $e(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function U(e){e&&e.c()}function O(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),nn(()=>{const s=e.$$.on_mount.map(oi).filter(Qe);e.$$.on_destroy?e.$$.on_destroy.push(...s):Ee(s),e.$$.on_mount=[]}),r.forEach(nn)}function M(e,t){const n=e.$$;n.fragment!==null&&(Ji(n.after_update),Ee(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Yi(e,t){e.$$.dirty[0]===-1&&(Ue.push(e),fi(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function J(e,t,n,i,r,s,o,l=[-1]){const a=at;st(e);const u=e.$$={fragment:null,ctx:[],props:s,update:G,not_equal:r,bound:Pn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(a?a.$$.context:[])),callbacks:Pn(),dirty:l,skip_bound:!1,root:t.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=n?n(e,t.props||{},(p,h,...m)=>{const d=m.length?m[0]:h;return u.ctx&&r(u.ctx[p],u.ctx[p]=d)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](d),f&&Yi(e,p)),h}):[],u.update(),f=!0,Ee(u.before_update),u.fragment=i?i(u.ctx):!1,t.target){if(t.hydrate){const p=qi(t.target);u.fragment&&u.fragment.l(p),p.forEach(_)}else u.fragment&&u.fragment.c();t.intro&&w(e.$$.fragment),O(e,t.target,t.anchor),ci()}st(a)}class Y{constructor(){Ft(this,"$$");Ft(this,"$$set")}$destroy(){M(this,1),this.$destroy=G}$on(t,n){if(!Qe(n))return G;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!Vi(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ki="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ki);function Vt(e){window.runtime.LogError(e)}function wt(e){window.runtime.BrowserOpenURL(e)}function er(){window.runtime.Quit()}function tr(e,t){return window.go.main.App.AddSnippet(e,t)}function nr(){return window.go.main.App.CustomShortcutsEnabled()}function ir(){return window.go.main.App.DaemonInstalled()}function rr(e,t){return window.go.main.App.DeleteCustomShortcut(e,t)}function sr(){return window.go.main.App.ExportSnippets()}function or(){return window.go.main.App.GetAllSnippets()}function lr(){return window.go.main.App.GetAutoexpandStatus()}function ar(){return window.go.main.App.GetAutostartStatus()}function ur(e){return window.go.main.App.GetCustomShortcutBinding(e)}function hi(e){return window.go.main.App.GetSetting(e)}function pi(e){return window.go.main.App.GetSnippetWithAbbreviation(e)}function fr(e){return window.go.main.App.GetSnippetWithID(e)}function cr(e,t){return window.go.main.App.GetSnippets(e,t)}function hr(){return window.go.main.App.GetVersion()}function mi(e){return window.go.main.App.ImportSnippets(e)}function pr(e){return window.go.main.App.NilUUID(e)}function mr(e,t){return window.go.main.App.PasteSnippetAndQuit(e,t)}function dr(e){return window.go.main.App.Ping(e)}function _r(e){return window.go.main.App.RemoveSnippet(e)}function gr(e,t,n,i){return window.go.main.App.SaveCustomShortcut(e,t,n,i)}function br(e,t){return window.go.main.App.SaveSetting(e,t)}function vr(){return window.go.main.App.SearchAndPasteMode()}function oe(e,t){return window.go.main.App.ShowError(e,t)}function wr(){return window.go.main.App.StartDaemon()}function Er(e){return window.go.main.App.UpdateAutoexpand(e)}function yr(e){return window.go.main.App.UpdateAutostart(e)}function Sr(e,t){return window.go.main.App.UpdateSnippetWithID(e,t)}const Re=[];function di(e,t){return{subscribe:Te(e,t).subscribe}}function Te(e,t=G){let n;const i=new Set;function r(l){if(Z(e,l)&&(e=l,n)){const a=!Re.length;for(const u of i)u[1](),Re.push(u,e);if(a){for(let u=0;u<Re.length;u+=2)Re[u][0](Re[u+1]);Re.length=0}}}function s(l){r(l(e))}function o(l,a=G){const u=[l,a];return i.add(u),i.size===1&&(n=t(r,s)||G),l(e),()=>{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}function Le(e,t,n){const i=!Array.isArray(e),r=i?[e]:e;if(!r.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=t.length<2;return di(n,(o,l)=>{let a=!1;const u=[];let f=0,p=G;const h=()=>{if(f)return;p();const d=t(i?u[0]:u,o,l);s?o(d):p=Qe(d)?d:G},m=r.map((d,b)=>mn(d,I=>{u[b]=I,f&=~(1<<b),a&&h()},()=>{f|=1<<b}));return a=!0,h(),function(){Ee(m),p(),a=!1}})}function kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ar=function(t){return Br(t)&&!Tr(t)};function Br(e){return!!e&&typeof e=="object"}function Tr(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Cr(e)}var Ir=typeof Symbol=="function"&&Symbol.for,Hr=Ir?Symbol.for("react.element"):60103;function Cr(e){return e.$$typeof===Hr}function Lr(e){return Array.isArray(e)?[]:{}}function ft(e,t){return t.clone!==!1&&t.isMergeableObject(e)?We(Lr(e),e,t):e}function Pr(e,t,n){return e.concat(t).map(function(i){return ft(i,n)})}function Nr(e,t){if(!t.customMerge)return We;var n=t.customMerge(e);return typeof n=="function"?n:We}function Or(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Mn(e){return Object.keys(e).concat(Or(e))}function _i(e,t){try{return t in e}catch{return!1}}function Mr(e,t){return _i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function xr(e,t,n){var i={};return n.isMergeableObject(e)&&Mn(e).forEach(function(r){i[r]=ft(e[r],n)}),Mn(t).forEach(function(r){Mr(e,r)||(_i(e,r)&&n.isMergeableObject(t[r])?i[r]=Nr(r,n)(e[r],t[r],n):i[r]=ft(t[r],n))}),i}function We(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Pr,n.isMergeableObject=n.isMergeableObject||Ar,n.cloneUnlessOtherwiseSpecified=ft;var i=Array.isArray(t),r=Array.isArray(e),s=i===r;return s?i?n.arrayMerge(e,t,n):xr(e,t,n):ft(t,n)}We.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,r){return We(i,r,n)},{})};var Rr=We,Ur=Rr;const Dr=kr(Ur);var rn=function(e,t){return rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},rn(e,t)};function Lt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");rn(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ee=function(){return ee=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ee.apply(this,arguments)};function Wt(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))}var q;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(q||(q={}));var se;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(se||(se={}));var Xe;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Xe||(Xe={}));function xn(e){return e.type===se.literal}function Gr(e){return e.type===se.argument}function gi(e){return e.type===se.number}function bi(e){return e.type===se.date}function vi(e){return e.type===se.time}function wi(e){return e.type===se.select}function Ei(e){return e.type===se.plural}function $r(e){return e.type===se.pound}function yi(e){return e.type===se.tag}function Si(e){return!!(e&&typeof e=="object"&&e.type===Xe.number)}function sn(e){return!!(e&&typeof e=="object"&&e.type===Xe.dateTime)}var ki=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,jr=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Fr(e){var t={};return e.replace(jr,function(n){var i=n.length;switch(n[0]){case"G":t.era=i===4?"long":i===5?"narrow":"short";break;case"y":t.year=i===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=i===4?"short":i===5?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][i-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][i-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][i-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][i-1];break;case"s":t.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var zr=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Vr(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(zr).filter(function(h){return h.length>0}),n=[],i=0,r=t;i<r.length;i++){var s=r[i],o=s.split("/");if(o.length===0)throw new Error("Invalid number skeleton");for(var l=o[0],a=o.slice(1),u=0,f=a;u<f.length;u++){var p=f[u];if(p.length===0)throw new Error("Invalid number skeleton")}n.push({stem:l,options:a})}return n}function Wr(e){return e.replace(/^(.*?)-/,"")}var Rn=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Ai=/^(@+)?(\+|#+)?[rs]?$/g,Xr=/(\*)(0+)|(#+)(0+)|(0+)/g,Bi=/^(0+)$/;function Un(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Ai,function(n,i,r){return typeof r!="string"?(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length):r==="+"?t.minimumSignificantDigits=i.length:i[0]==="#"?t.maximumSignificantDigits=i.length:(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length+(typeof r=="string"?r.length:0)),""}),t}function Ti(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function qr(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Bi.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Dn(e){var t={},n=Ti(e);return n||t}function Zr(e){for(var t={},n=0,i=e;n<i.length;n++){var r=i[n];switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=Wr(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=ee(ee(ee({},t),{notation:"scientific"}),r.options.reduce(function(a,u){return ee(ee({},a),Dn(u))},{}));continue;case"engineering":t=ee(ee(ee({},t),{notation:"engineering"}),r.options.reduce(function(a,u){return ee(ee({},a),Dn(u))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Xr,function(a,u,f,p,h,m){if(u)t.minimumIntegerDigits=f.length;else{if(p&&h)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Bi.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Rn.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Rn,function(a,u,f,p,h,m){return f==="*"?t.minimumFractionDigits=u.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:h&&m?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+m.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var s=r.options[0];s==="w"?t=ee(ee({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=ee(ee({},t),Un(s)));continue}if(Ai.test(r.stem)){t=ee(ee({},t),Un(r.stem));continue}var o=Ti(r.stem);o&&(t=ee(ee({},t),o));var l=qr(r.stem);l&&(t=ee(ee({},t),l))}return t}var Et={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Qr(e,t){for(var n="",i=0;i<e.length;i++){var r=e.charAt(i);if(r==="j"){for(var s=0;i+1<e.length&&e.charAt(i+1)===r;)s++,i++;var o=1+(s&1),l=s<2?1:3+(s>>1),a="a",u=Jr(t);for((u=="H"||u=="k")&&(l=0);l-- >0;)n+=a;for(;o-- >0;)n=u+n}else r==="J"?n+="H":n+=r}return n}function Jr(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,i;n!=="root"&&(i=e.maximize().region);var r=Et[i||""]||Et[n||""]||Et["".concat(n,"-001")]||Et["001"];return r[0]}var Xt,Yr=new RegExp("^".concat(ki.source,"*")),Kr=new RegExp("".concat(ki.source,"*$"));function Q(e,t){return{start:e,end:t}}var es=!!String.prototype.startsWith,ts=!!String.fromCodePoint,ns=!!Object.fromEntries,is=!!String.prototype.codePointAt,rs=!!String.prototype.trimStart,ss=!!String.prototype.trimEnd,os=!!Number.isSafeInteger,ls=os?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},on=!0;try{var as=Hi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");on=((Xt=as.exec("a"))===null||Xt===void 0?void 0:Xt[0])==="a"}catch{on=!1}var Gn=es?function(t,n,i){return t.startsWith(n,i)}:function(t,n,i){return t.slice(i,i+n.length)===n},ln=ts?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i="",r=t.length,s=0,o;r>s;){if(o=t[s++],o>1114111)throw RangeError(o+" is not a valid code point");i+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return i},$n=ns?Object.fromEntries:function(t){for(var n={},i=0,r=t;i<r.length;i++){var s=r[i],o=s[0],l=s[1];n[o]=l}return n},Ii=is?function(t,n){return t.codePointAt(n)}:function(t,n){var i=t.length;if(!(n<0||n>=i)){var r=t.charCodeAt(n),s;return r<55296||r>56319||n+1===i||(s=t.charCodeAt(n+1))<56320||s>57343?r:(r-55296<<10)+(s-56320)+65536}},us=rs?function(t){return t.trimStart()}:function(t){return t.replace(Yr,"")},fs=ss?function(t){return t.trimEnd()}:function(t){return t.replace(Kr,"")};function Hi(e,t){return new RegExp(e,t)}var an;if(on){var jn=Hi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");an=function(t,n){var i;jn.lastIndex=n;var r=jn.exec(t);return(i=r[1])!==null&&i!==void 0?i:""}}else an=function(t,n){for(var i=[];;){var r=Ii(t,n);if(r===void 0||Ci(r)||ms(r))break;i.push(r),n+=r>=65536?2:1}return ln.apply(void 0,i)};var cs=function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,i){for(var r=[];!this.isEOF();){var s=this.char();if(s===123){var o=this.parseArgument(t,i);if(o.err)return o;r.push(o.val)}else{if(s===125&&t>0)break;if(s===35&&(n==="plural"||n==="selectordinal")){var l=this.clonePosition();this.bump(),r.push({type:se.pound,location:Q(l,this.clonePosition())})}else if(s===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(q.UNMATCHED_CLOSING_TAG,Q(this.clonePosition(),this.clonePosition()))}else if(s===60&&!this.ignoreTag&&un(this.peek()||0)){var o=this.parseTag(t,n);if(o.err)return o;r.push(o.val)}else{var o=this.parseLiteral(t,n);if(o.err)return o;r.push(o.val)}}}return{val:r,err:null}},e.prototype.parseTag=function(t,n){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:se.literal,value:"<".concat(r,"/>"),location:Q(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(t+1,n,!0);if(s.err)return s;var o=s.val,l=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!un(this.char()))return this.error(q.INVALID_TAG,Q(l,this.clonePosition()));var a=this.clonePosition(),u=this.parseTagName();return r!==u?this.error(q.UNMATCHED_CLOSING_TAG,Q(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:se.tag,value:r,children:o,location:Q(i,this.clonePosition())},err:null}:this.error(q.INVALID_TAG,Q(l,this.clonePosition())))}else return this.error(q.UNCLOSED_TAG,Q(i,this.clonePosition()))}else return this.error(q.INVALID_TAG,Q(i,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ps(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var i=this.clonePosition(),r="";;){var s=this.tryParseQuote(n);if(s){r+=s;continue}var o=this.tryParseUnquoted(t,n);if(o){r+=o;continue}var l=this.tryParseLeftAngleBracket();if(l){r+=l;continue}break}var a=Q(i,this.clonePosition());return{val:{type:se.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!hs(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return ln.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&t>0?null:(this.bump(),ln(i))},e.prototype.parseArgument=function(t,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(q.EMPTY_ARGUMENT,Q(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:se.argument,value:r,location:Q(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition())):this.parseArgumentOptions(t,n,r,i);default:return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),i=an(this.message,n),r=n+i.length;this.bumpTo(r);var s=this.clonePosition(),o=Q(t,s);return{value:i,location:o}},e.prototype.parseArgumentOptions=function(t,n,i,r){var s,o=this.clonePosition(),l=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(l){case"":return this.error(q.EXPECT_ARGUMENT_TYPE,Q(o,a));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var h=fs(p.val);if(h.length===0)return this.error(q.EXPECT_ARGUMENT_STYLE,Q(this.clonePosition(),this.clonePosition()));var m=Q(f,this.clonePosition());u={style:h,styleLocation:m}}var d=this.tryParseArgumentClose(r);if(d.err)return d;var b=Q(r,this.clonePosition());if(u&&Gn(u==null?void 0:u.style,"::",0)){var I=us(u.style.slice(2));if(l==="number"){var p=this.parseNumberSkeletonFromString(I,u.styleLocation);return p.err?p:{val:{type:se.number,value:i,location:b,style:p.val},err:null}}else{if(I.length===0)return this.error(q.EXPECT_DATE_TIME_SKELETON,b);var B=I;this.locale&&(B=Qr(I,this.locale));var h={type:Xe.dateTime,pattern:B,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?Fr(B):{}},E=l==="date"?se.date:se.time;return{val:{type:E,value:i,location:b,style:h},err:null}}}return{val:{type:l==="number"?se.number:l==="date"?se.date:se.time,value:i,location:b,style:(s=u==null?void 0:u.style)!==null&&s!==void 0?s:null},err:null}}case"plural":case"selectordinal":case"select":{var H=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(q.EXPECT_SELECT_ARGUMENT_OPTIONS,Q(H,ee({},H)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),T=0;if(l!=="select"&&y.value==="offset"){if(!this.bumpIf(":"))return this.error(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Q(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,q.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),y=this.parseIdentifierIfPossible(),T=p.val}var P=this.tryParsePluralOrSelectOptions(t,l,n,y);if(P.err)return P;var d=this.tryParseArgumentClose(r);if(d.err)return d;var k=Q(r,this.clonePosition());return l==="select"?{val:{type:se.select,value:i,options:$n(P.val),location:k},err:null}:{val:{type:se.plural,value:i,options:$n(P.val),offset:T,pluralType:l==="plural"?"cardinal":"ordinal",location:k},err:null}}default:return this.error(q.INVALID_ARGUMENT_TYPE,Q(o,a))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(q.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Q(r,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var i=[];try{i=Vr(t)}catch{return this.error(q.INVALID_NUMBER_SKELETON,n)}return{val:{type:Xe.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Zr(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,i,r){for(var s,o=!1,l=[],a=new Set,u=r.value,f=r.location;;){if(u.length===0){var p=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_SELECTOR,q.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;f=Q(p,this.clonePosition()),u=this.message.slice(p.offset,this.offset())}else break}if(a.has(u))return this.error(n==="select"?q.DUPLICATE_SELECT_ARGUMENT_SELECTOR:q.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);u==="other"&&(o=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:q.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Q(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,n,i);if(d.err)return d;var b=this.tryParseArgumentClose(m);if(b.err)return b;l.push([u,{value:d.val,location:Q(m,this.clonePosition())}]),a.add(u),this.bumpSpace(),s=this.parseIdentifierIfPossible(),u=s.value,f=s.location}return l.length===0?this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR:q.EXPECT_PLURAL_ARGUMENT_SELECTOR,Q(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(q.MISSING_OTHER_CLAUSE,Q(this.clonePosition(),this.clonePosition())):{val:l,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var i=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var s=!1,o=0;!this.isEOF();){var l=this.char();if(l>=48&&l<=57)s=!0,o=o*10+(l-48),this.bump();else break}var a=Q(r,this.clonePosition());return s?(o*=i,ls(o)?{val:o,err:null}:this.error(n,a)):this.error(t,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Ii(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Gn(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),i=this.message.indexOf(t,n);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ci(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(t>=65536?2:1));return i??null},e}();function un(e){return e>=97&&e<=122||e>=65&&e<=90}function hs(e){return un(e)||e===47}function ps(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Ci(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ms(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function fn(e){e.forEach(function(t){if(delete t.location,wi(t)||Ei(t))for(var n in t.options)delete t.options[n].location,fn(t.options[n].value);else gi(t)&&Si(t.style)||(bi(t)||vi(t))&&sn(t.style)?delete t.style.location:yi(t)&&fn(t.children)})}function ds(e,t){t===void 0&&(t={}),t=ee({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new cs(e,t).parse();if(n.err){var i=SyntaxError(q[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return t!=null&&t.captureLocation||fn(n.val),n.val}function qt(e,t){var n=t&&t.cache?t.cache:Es,i=t&&t.serializer?t.serializer:ws,r=t&&t.strategy?t.strategy:gs;return r(e,{cache:n,serializer:i})}function _s(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Li(e,t,n,i){var r=_s(i)?i:n(i),s=t.get(r);return typeof s>"u"&&(s=e.call(this,i),t.set(r,s)),s}function Pi(e,t,n){var i=Array.prototype.slice.call(arguments,3),r=n(i),s=t.get(r);return typeof s>"u"&&(s=e.apply(this,i),t.set(r,s)),s}function bn(e,t,n,i,r){return n.bind(t,e,i,r)}function gs(e,t){var n=e.length===1?Li:Pi;return bn(e,this,n,t.cache.create(),t.serializer)}function bs(e,t){return bn(e,this,Pi,t.cache.create(),t.serializer)}function vs(e,t){return bn(e,this,Li,t.cache.create(),t.serializer)}var ws=function(){return JSON.stringify(arguments)};function vn(){this.cache=Object.create(null)}vn.prototype.get=function(e){return this.cache[e]};vn.prototype.set=function(e,t){this.cache[e]=t};var Es={create:function(){return new vn}},Zt={variadic:bs,monadic:vs},qe;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(qe||(qe={}));var Pt=function(e){Lt(t,e);function t(n,i,r){var s=e.call(this,n)||this;return s.code=i,s.originalMessage=r,s}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Fn=function(e){Lt(t,e);function t(n,i,r,s){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(r).join('", "'),'"'),qe.INVALID_VALUE,s)||this}return t}(Pt),ys=function(e){Lt(t,e);function t(n,i,r){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),qe.INVALID_VALUE,r)||this}return t}(Pt),Ss=function(e){Lt(t,e);function t(n,i){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),qe.MISSING_VALUE,i)||this}return t}(Pt),me;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(me||(me={}));function ks(e){return e.length<2?e:e.reduce(function(t,n){var i=t[t.length-1];return!i||i.type!==me.literal||n.type!==me.literal?t.push(n):i.value+=n.value,t},[])}function As(e){return typeof e=="function"}function St(e,t,n,i,r,s,o){if(e.length===1&&xn(e[0]))return[{type:me.literal,value:e[0].value}];for(var l=[],a=0,u=e;a<u.length;a++){var f=u[a];if(xn(f)){l.push({type:me.literal,value:f.value});continue}if($r(f)){typeof s=="number"&&l.push({type:me.literal,value:n.getNumberFormat(t).format(s)});continue}var p=f.value;if(!(r&&p in r))throw new Ss(p,o);var h=r[p];if(Gr(f)){(!h||typeof h=="string"||typeof h=="number")&&(h=typeof h=="string"||typeof h=="number"?String(h):""),l.push({type:typeof h=="string"?me.literal:me.object,value:h});continue}if(bi(f)){var m=typeof f.style=="string"?i.date[f.style]:sn(f.style)?f.style.parsedOptions:void 0;l.push({type:me.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(vi(f)){var m=typeof f.style=="string"?i.time[f.style]:sn(f.style)?f.style.parsedOptions:i.time.medium;l.push({type:me.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(gi(f)){var m=typeof f.style=="string"?i.number[f.style]:Si(f.style)?f.style.parsedOptions:void 0;m&&m.scale&&(h=h*(m.scale||1)),l.push({type:me.literal,value:n.getNumberFormat(t,m).format(h)});continue}if(yi(f)){var d=f.children,b=f.value,I=r[b];if(!As(I))throw new ys(b,"function",o);var B=St(d,t,n,i,r,s),E=I(B.map(function(T){return T.value}));Array.isArray(E)||(E=[E]),l.push.apply(l,E.map(function(T){return{type:typeof T=="string"?me.literal:me.object,value:T}}))}if(wi(f)){var H=f.options[h]||f.options.other;if(!H)throw new Fn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r));continue}if(Ei(f)){var H=f.options["=".concat(h)];if(!H){if(!Intl.PluralRules)throw new Pt(`Intl.PluralRules is not available in this environment.
var Di=Object.defineProperty;var Gi=(e,t,n)=>t in e?Di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ft=(e,t,n)=>(Gi(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const $i="modulepreload",ji=function(e){return"/"+e},Ln={},Fi=function(t,n,i){if(!n||n.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(n.map(s=>{if(s=ji(s),s in Ln)return;Ln[s]=!0;const o=s.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!i)for(let f=r.length-1;f>=0;f--){const p=r[f];if(p.href===s&&(!o||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":$i,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,p)=>{u.addEventListener("load",f),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function G(){}function pn(e,t){for(const n in t)e[n]=t[n];return e}function oi(e){return e()}function Nn(){return Object.create(null)}function Ee(e){e.forEach(oi)}function Qe(e){return typeof e=="function"}function Z(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let bt;function zi(e,t){return e===t?!0:(bt||(bt=document.createElement("a")),bt.href=t,e===bt.href)}function Vi(e){return Object.keys(e).length===0}function mn(e,...t){if(e==null){for(const i of t)i(void 0);return G}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Pn(e){let t;return mn(e,n=>t=n)(),t}function ne(e,t,n){e.$$.on_destroy.push(mn(t,n))}function ht(e,t,n,i){if(e){const r=li(e,t,n,i);return e[0](r)}}function li(e,t,n,i){return e[1]&&i?pn(n.ctx.slice(),e[1](i(t))):n.ctx}function pt(e,t,n,i){if(e[2]&&i){const r=e[2](i(n));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let l=0;l<o;l+=1)s[l]=t.dirty[l]|r[l];return s}return t.dirty|r}return t.dirty}function mt(e,t,n,i,r,s){if(r){const o=li(t,n,i,s);e.p(o,r)}}function dt(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;i<n;i++)t[i]=-1;return t}return-1}function Wi(e,t,n){return e.set(n),t}function dn(e){return e&&Qe(e.destroy)?e.destroy:G}function A(e,t){e.appendChild(t)}function g(e,t,n){e.insertBefore(t,n||null)}function _(e){e.parentNode&&e.parentNode.removeChild(e)}function Xi(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function L(e){return document.createElement(e)}function V(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function $(e){return document.createTextNode(e)}function R(){return $(" ")}function ye(){return $("")}function te(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function vt(e){return function(t){return t.preventDefault(),e.call(this,t)}}function c(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function qi(e){return Array.from(e.childNodes)}function z(e,t){t=""+t,e.data!==t&&(e.data=t)}function ze(e,t){e.value=t??""}function X(e,t,n){e.classList.toggle(t,!!n)}function Zi(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}function Ve(e,t){return new e(t)}let at;function st(e){at=e}function Ct(){if(!at)throw new Error("Function called outside component initialization");return at}function Je(e){Ct().$$.on_mount.push(e)}function ai(e){Ct().$$.after_update.push(e)}function _n(e){Ct().$$.on_destroy.push(e)}function _t(){const e=Ct();return(t,n,{cancelable:i=!1}={})=>{const r=e.$$.callbacks[t];if(r){const s=Zi(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function ut(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Ue=[],ve=[];let De=[];const en=[],ui=Promise.resolve();let tn=!1;function fi(){tn||(tn=!0,ui.then(ci))}function gn(){return fi(),ui}function nn(e){De.push(e)}function Ge(e){en.push(e)}const zt=new Set;let xe=0;function ci(){if(xe!==0)return;const e=at;do{try{for(;xe<Ue.length;){const t=Ue[xe];xe++,st(t),Qi(t.$$)}}catch(t){throw Ue.length=0,xe=0,t}for(st(null),Ue.length=0,xe=0;ve.length;)ve.pop()();for(let t=0;t<De.length;t+=1){const n=De[t];zt.has(n)||(zt.add(n),n())}De.length=0}while(Ue.length);for(;en.length;)en.pop()();tn=!1,zt.clear(),st(e)}function Qi(e){if(e.fragment!==null){e.update(),Ee(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(nn)}}function Ji(e){const t=[],n=[];De.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),De=t}const yt=new Set;let Oe;function ue(){Oe={r:0,c:[],p:Oe}}function fe(){Oe.r||Ee(Oe.c),Oe=Oe.p}function w(e,t){e&&e.i&&(yt.delete(e),e.i(t))}function S(e,t,n,i){if(e&&e.o){if(yt.has(e))return;yt.add(e),Oe.c.push(()=>{yt.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function On(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Bt(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],l=t[s];if(l){for(const a in o)a in l||(i[a]=1);for(const a in l)r[a]||(n[a]=l[a],r[a]=1);e[s]=l}else for(const a in o)r[a]=1}for(const o in i)o in n||(n[o]=void 0);return n}function Tt(e){return typeof e=="object"&&e!==null?e:{}}function $e(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function U(e){e&&e.c()}function O(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),nn(()=>{const s=e.$$.on_mount.map(oi).filter(Qe);e.$$.on_destroy?e.$$.on_destroy.push(...s):Ee(s),e.$$.on_mount=[]}),r.forEach(nn)}function M(e,t){const n=e.$$;n.fragment!==null&&(Ji(n.after_update),Ee(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Yi(e,t){e.$$.dirty[0]===-1&&(Ue.push(e),fi(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function J(e,t,n,i,r,s,o,l=[-1]){const a=at;st(e);const u=e.$$={fragment:null,ctx:[],props:s,update:G,not_equal:r,bound:Nn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(a?a.$$.context:[])),callbacks:Nn(),dirty:l,skip_bound:!1,root:t.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=n?n(e,t.props||{},(p,h,...m)=>{const d=m.length?m[0]:h;return u.ctx&&r(u.ctx[p],u.ctx[p]=d)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](d),f&&Yi(e,p)),h}):[],u.update(),f=!0,Ee(u.before_update),u.fragment=i?i(u.ctx):!1,t.target){if(t.hydrate){const p=qi(t.target);u.fragment&&u.fragment.l(p),p.forEach(_)}else u.fragment&&u.fragment.c();t.intro&&w(e.$$.fragment),O(e,t.target,t.anchor),ci()}st(a)}class Y{constructor(){Ft(this,"$$");Ft(this,"$$set")}$destroy(){M(this,1),this.$destroy=G}$on(t,n){if(!Qe(n))return G;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!Vi(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ki="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ki);function Vt(e){window.runtime.LogError(e)}function wt(e){window.runtime.BrowserOpenURL(e)}function er(){window.runtime.Quit()}function tr(e,t){return window.go.main.App.AddSnippet(e,t)}function nr(){return window.go.main.App.CustomShortcutsEnabled()}function ir(){return window.go.main.App.DaemonInstalled()}function rr(e,t){return window.go.main.App.DeleteCustomShortcut(e,t)}function sr(){return window.go.main.App.ExportSnippets()}function or(){return window.go.main.App.GetAllSnippets()}function lr(){return window.go.main.App.GetAutoexpandStatus()}function ar(){return window.go.main.App.GetAutostartStatus()}function ur(e){return window.go.main.App.GetCustomShortcutBinding(e)}function hi(e){return window.go.main.App.GetSetting(e)}function pi(e){return window.go.main.App.GetSnippetWithAbbreviation(e)}function fr(e){return window.go.main.App.GetSnippetWithID(e)}function cr(e,t){return window.go.main.App.GetSnippets(e,t)}function hr(){return window.go.main.App.GetVersion()}function mi(e){return window.go.main.App.ImportSnippets(e)}function pr(e){return window.go.main.App.NilUUID(e)}function mr(e,t){return window.go.main.App.PasteSnippetAndQuit(e,t)}function dr(e){return window.go.main.App.Ping(e)}function _r(e){return window.go.main.App.RemoveSnippet(e)}function gr(e,t,n,i){return window.go.main.App.SaveCustomShortcut(e,t,n,i)}function br(e,t){return window.go.main.App.SaveSetting(e,t)}function vr(){return window.go.main.App.SearchAndPasteMode()}function oe(e,t){return window.go.main.App.ShowError(e,t)}function wr(){return window.go.main.App.StartDaemon()}function Er(e){return window.go.main.App.UpdateAutoexpand(e)}function yr(e){return window.go.main.App.UpdateAutostart(e)}function Sr(e,t){return window.go.main.App.UpdateSnippetWithID(e,t)}const Re=[];function di(e,t){return{subscribe:Te(e,t).subscribe}}function Te(e,t=G){let n;const i=new Set;function r(l){if(Z(e,l)&&(e=l,n)){const a=!Re.length;for(const u of i)u[1](),Re.push(u,e);if(a){for(let u=0;u<Re.length;u+=2)Re[u][0](Re[u+1]);Re.length=0}}}function s(l){r(l(e))}function o(l,a=G){const u=[l,a];return i.add(u),i.size===1&&(n=t(r,s)||G),l(e),()=>{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}function Le(e,t,n){const i=!Array.isArray(e),r=i?[e]:e;if(!r.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=t.length<2;return di(n,(o,l)=>{let a=!1;const u=[];let f=0,p=G;const h=()=>{if(f)return;p();const d=t(i?u[0]:u,o,l);s?o(d):p=Qe(d)?d:G},m=r.map((d,b)=>mn(d,I=>{u[b]=I,f&=~(1<<b),a&&h()},()=>{f|=1<<b}));return a=!0,h(),function(){Ee(m),p(),a=!1}})}function kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ar=function(t){return Br(t)&&!Tr(t)};function Br(e){return!!e&&typeof e=="object"}function Tr(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Cr(e)}var Ir=typeof Symbol=="function"&&Symbol.for,Hr=Ir?Symbol.for("react.element"):60103;function Cr(e){return e.$$typeof===Hr}function Lr(e){return Array.isArray(e)?[]:{}}function ft(e,t){return t.clone!==!1&&t.isMergeableObject(e)?We(Lr(e),e,t):e}function Nr(e,t,n){return e.concat(t).map(function(i){return ft(i,n)})}function Pr(e,t){if(!t.customMerge)return We;var n=t.customMerge(e);return typeof n=="function"?n:We}function Or(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Mn(e){return Object.keys(e).concat(Or(e))}function _i(e,t){try{return t in e}catch{return!1}}function Mr(e,t){return _i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function xr(e,t,n){var i={};return n.isMergeableObject(e)&&Mn(e).forEach(function(r){i[r]=ft(e[r],n)}),Mn(t).forEach(function(r){Mr(e,r)||(_i(e,r)&&n.isMergeableObject(t[r])?i[r]=Pr(r,n)(e[r],t[r],n):i[r]=ft(t[r],n))}),i}function We(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Nr,n.isMergeableObject=n.isMergeableObject||Ar,n.cloneUnlessOtherwiseSpecified=ft;var i=Array.isArray(t),r=Array.isArray(e),s=i===r;return s?i?n.arrayMerge(e,t,n):xr(e,t,n):ft(t,n)}We.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,r){return We(i,r,n)},{})};var Rr=We,Ur=Rr;const Dr=kr(Ur);var rn=function(e,t){return rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},rn(e,t)};function Lt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");rn(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ee=function(){return ee=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ee.apply(this,arguments)};function Wt(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))}var q;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(q||(q={}));var se;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(se||(se={}));var Xe;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Xe||(Xe={}));function xn(e){return e.type===se.literal}function Gr(e){return e.type===se.argument}function gi(e){return e.type===se.number}function bi(e){return e.type===se.date}function vi(e){return e.type===se.time}function wi(e){return e.type===se.select}function Ei(e){return e.type===se.plural}function $r(e){return e.type===se.pound}function yi(e){return e.type===se.tag}function Si(e){return!!(e&&typeof e=="object"&&e.type===Xe.number)}function sn(e){return!!(e&&typeof e=="object"&&e.type===Xe.dateTime)}var ki=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,jr=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Fr(e){var t={};return e.replace(jr,function(n){var i=n.length;switch(n[0]){case"G":t.era=i===4?"long":i===5?"narrow":"short";break;case"y":t.year=i===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=i===4?"short":i===5?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][i-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][i-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][i-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][i-1];break;case"s":t.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var zr=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Vr(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(zr).filter(function(h){return h.length>0}),n=[],i=0,r=t;i<r.length;i++){var s=r[i],o=s.split("/");if(o.length===0)throw new Error("Invalid number skeleton");for(var l=o[0],a=o.slice(1),u=0,f=a;u<f.length;u++){var p=f[u];if(p.length===0)throw new Error("Invalid number skeleton")}n.push({stem:l,options:a})}return n}function Wr(e){return e.replace(/^(.*?)-/,"")}var Rn=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Ai=/^(@+)?(\+|#+)?[rs]?$/g,Xr=/(\*)(0+)|(#+)(0+)|(0+)/g,Bi=/^(0+)$/;function Un(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Ai,function(n,i,r){return typeof r!="string"?(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length):r==="+"?t.minimumSignificantDigits=i.length:i[0]==="#"?t.maximumSignificantDigits=i.length:(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length+(typeof r=="string"?r.length:0)),""}),t}function Ti(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function qr(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Bi.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Dn(e){var t={},n=Ti(e);return n||t}function Zr(e){for(var t={},n=0,i=e;n<i.length;n++){var r=i[n];switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=Wr(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=ee(ee(ee({},t),{notation:"scientific"}),r.options.reduce(function(a,u){return ee(ee({},a),Dn(u))},{}));continue;case"engineering":t=ee(ee(ee({},t),{notation:"engineering"}),r.options.reduce(function(a,u){return ee(ee({},a),Dn(u))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Xr,function(a,u,f,p,h,m){if(u)t.minimumIntegerDigits=f.length;else{if(p&&h)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Bi.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Rn.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Rn,function(a,u,f,p,h,m){return f==="*"?t.minimumFractionDigits=u.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:h&&m?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+m.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var s=r.options[0];s==="w"?t=ee(ee({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=ee(ee({},t),Un(s)));continue}if(Ai.test(r.stem)){t=ee(ee({},t),Un(r.stem));continue}var o=Ti(r.stem);o&&(t=ee(ee({},t),o));var l=qr(r.stem);l&&(t=ee(ee({},t),l))}return t}var Et={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Qr(e,t){for(var n="",i=0;i<e.length;i++){var r=e.charAt(i);if(r==="j"){for(var s=0;i+1<e.length&&e.charAt(i+1)===r;)s++,i++;var o=1+(s&1),l=s<2?1:3+(s>>1),a="a",u=Jr(t);for((u=="H"||u=="k")&&(l=0);l-- >0;)n+=a;for(;o-- >0;)n=u+n}else r==="J"?n+="H":n+=r}return n}function Jr(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,i;n!=="root"&&(i=e.maximize().region);var r=Et[i||""]||Et[n||""]||Et["".concat(n,"-001")]||Et["001"];return r[0]}var Xt,Yr=new RegExp("^".concat(ki.source,"*")),Kr=new RegExp("".concat(ki.source,"*$"));function Q(e,t){return{start:e,end:t}}var es=!!String.prototype.startsWith,ts=!!String.fromCodePoint,ns=!!Object.fromEntries,is=!!String.prototype.codePointAt,rs=!!String.prototype.trimStart,ss=!!String.prototype.trimEnd,os=!!Number.isSafeInteger,ls=os?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},on=!0;try{var as=Hi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");on=((Xt=as.exec("a"))===null||Xt===void 0?void 0:Xt[0])==="a"}catch{on=!1}var Gn=es?function(t,n,i){return t.startsWith(n,i)}:function(t,n,i){return t.slice(i,i+n.length)===n},ln=ts?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i="",r=t.length,s=0,o;r>s;){if(o=t[s++],o>1114111)throw RangeError(o+" is not a valid code point");i+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return i},$n=ns?Object.fromEntries:function(t){for(var n={},i=0,r=t;i<r.length;i++){var s=r[i],o=s[0],l=s[1];n[o]=l}return n},Ii=is?function(t,n){return t.codePointAt(n)}:function(t,n){var i=t.length;if(!(n<0||n>=i)){var r=t.charCodeAt(n),s;return r<55296||r>56319||n+1===i||(s=t.charCodeAt(n+1))<56320||s>57343?r:(r-55296<<10)+(s-56320)+65536}},us=rs?function(t){return t.trimStart()}:function(t){return t.replace(Yr,"")},fs=ss?function(t){return t.trimEnd()}:function(t){return t.replace(Kr,"")};function Hi(e,t){return new RegExp(e,t)}var an;if(on){var jn=Hi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");an=function(t,n){var i;jn.lastIndex=n;var r=jn.exec(t);return(i=r[1])!==null&&i!==void 0?i:""}}else an=function(t,n){for(var i=[];;){var r=Ii(t,n);if(r===void 0||Ci(r)||ms(r))break;i.push(r),n+=r>=65536?2:1}return ln.apply(void 0,i)};var cs=function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,i){for(var r=[];!this.isEOF();){var s=this.char();if(s===123){var o=this.parseArgument(t,i);if(o.err)return o;r.push(o.val)}else{if(s===125&&t>0)break;if(s===35&&(n==="plural"||n==="selectordinal")){var l=this.clonePosition();this.bump(),r.push({type:se.pound,location:Q(l,this.clonePosition())})}else if(s===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(q.UNMATCHED_CLOSING_TAG,Q(this.clonePosition(),this.clonePosition()))}else if(s===60&&!this.ignoreTag&&un(this.peek()||0)){var o=this.parseTag(t,n);if(o.err)return o;r.push(o.val)}else{var o=this.parseLiteral(t,n);if(o.err)return o;r.push(o.val)}}}return{val:r,err:null}},e.prototype.parseTag=function(t,n){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:se.literal,value:"<".concat(r,"/>"),location:Q(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(t+1,n,!0);if(s.err)return s;var o=s.val,l=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!un(this.char()))return this.error(q.INVALID_TAG,Q(l,this.clonePosition()));var a=this.clonePosition(),u=this.parseTagName();return r!==u?this.error(q.UNMATCHED_CLOSING_TAG,Q(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:se.tag,value:r,children:o,location:Q(i,this.clonePosition())},err:null}:this.error(q.INVALID_TAG,Q(l,this.clonePosition())))}else return this.error(q.UNCLOSED_TAG,Q(i,this.clonePosition()))}else return this.error(q.INVALID_TAG,Q(i,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ps(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var i=this.clonePosition(),r="";;){var s=this.tryParseQuote(n);if(s){r+=s;continue}var o=this.tryParseUnquoted(t,n);if(o){r+=o;continue}var l=this.tryParseLeftAngleBracket();if(l){r+=l;continue}break}var a=Q(i,this.clonePosition());return{val:{type:se.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!hs(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return ln.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&t>0?null:(this.bump(),ln(i))},e.prototype.parseArgument=function(t,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(q.EMPTY_ARGUMENT,Q(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:se.argument,value:r,location:Q(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition())):this.parseArgumentOptions(t,n,r,i);default:return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),i=an(this.message,n),r=n+i.length;this.bumpTo(r);var s=this.clonePosition(),o=Q(t,s);return{value:i,location:o}},e.prototype.parseArgumentOptions=function(t,n,i,r){var s,o=this.clonePosition(),l=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(l){case"":return this.error(q.EXPECT_ARGUMENT_TYPE,Q(o,a));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var h=fs(p.val);if(h.length===0)return this.error(q.EXPECT_ARGUMENT_STYLE,Q(this.clonePosition(),this.clonePosition()));var m=Q(f,this.clonePosition());u={style:h,styleLocation:m}}var d=this.tryParseArgumentClose(r);if(d.err)return d;var b=Q(r,this.clonePosition());if(u&&Gn(u==null?void 0:u.style,"::",0)){var I=us(u.style.slice(2));if(l==="number"){var p=this.parseNumberSkeletonFromString(I,u.styleLocation);return p.err?p:{val:{type:se.number,value:i,location:b,style:p.val},err:null}}else{if(I.length===0)return this.error(q.EXPECT_DATE_TIME_SKELETON,b);var B=I;this.locale&&(B=Qr(I,this.locale));var h={type:Xe.dateTime,pattern:B,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?Fr(B):{}},E=l==="date"?se.date:se.time;return{val:{type:E,value:i,location:b,style:h},err:null}}}return{val:{type:l==="number"?se.number:l==="date"?se.date:se.time,value:i,location:b,style:(s=u==null?void 0:u.style)!==null&&s!==void 0?s:null},err:null}}case"plural":case"selectordinal":case"select":{var H=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(q.EXPECT_SELECT_ARGUMENT_OPTIONS,Q(H,ee({},H)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),T=0;if(l!=="select"&&y.value==="offset"){if(!this.bumpIf(":"))return this.error(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Q(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,q.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),y=this.parseIdentifierIfPossible(),T=p.val}var N=this.tryParsePluralOrSelectOptions(t,l,n,y);if(N.err)return N;var d=this.tryParseArgumentClose(r);if(d.err)return d;var k=Q(r,this.clonePosition());return l==="select"?{val:{type:se.select,value:i,options:$n(N.val),location:k},err:null}:{val:{type:se.plural,value:i,options:$n(N.val),offset:T,pluralType:l==="plural"?"cardinal":"ordinal",location:k},err:null}}default:return this.error(q.INVALID_ARGUMENT_TYPE,Q(o,a))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(q.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Q(r,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var i=[];try{i=Vr(t)}catch{return this.error(q.INVALID_NUMBER_SKELETON,n)}return{val:{type:Xe.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Zr(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,i,r){for(var s,o=!1,l=[],a=new Set,u=r.value,f=r.location;;){if(u.length===0){var p=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_SELECTOR,q.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;f=Q(p,this.clonePosition()),u=this.message.slice(p.offset,this.offset())}else break}if(a.has(u))return this.error(n==="select"?q.DUPLICATE_SELECT_ARGUMENT_SELECTOR:q.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);u==="other"&&(o=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:q.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Q(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,n,i);if(d.err)return d;var b=this.tryParseArgumentClose(m);if(b.err)return b;l.push([u,{value:d.val,location:Q(m,this.clonePosition())}]),a.add(u),this.bumpSpace(),s=this.parseIdentifierIfPossible(),u=s.value,f=s.location}return l.length===0?this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR:q.EXPECT_PLURAL_ARGUMENT_SELECTOR,Q(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(q.MISSING_OTHER_CLAUSE,Q(this.clonePosition(),this.clonePosition())):{val:l,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var i=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var s=!1,o=0;!this.isEOF();){var l=this.char();if(l>=48&&l<=57)s=!0,o=o*10+(l-48),this.bump();else break}var a=Q(r,this.clonePosition());return s?(o*=i,ls(o)?{val:o,err:null}:this.error(n,a)):this.error(t,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Ii(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Gn(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),i=this.message.indexOf(t,n);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ci(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(t>=65536?2:1));return i??null},e}();function un(e){return e>=97&&e<=122||e>=65&&e<=90}function hs(e){return un(e)||e===47}function ps(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Ci(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ms(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function fn(e){e.forEach(function(t){if(delete t.location,wi(t)||Ei(t))for(var n in t.options)delete t.options[n].location,fn(t.options[n].value);else gi(t)&&Si(t.style)||(bi(t)||vi(t))&&sn(t.style)?delete t.style.location:yi(t)&&fn(t.children)})}function ds(e,t){t===void 0&&(t={}),t=ee({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new cs(e,t).parse();if(n.err){var i=SyntaxError(q[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return t!=null&&t.captureLocation||fn(n.val),n.val}function qt(e,t){var n=t&&t.cache?t.cache:Es,i=t&&t.serializer?t.serializer:ws,r=t&&t.strategy?t.strategy:gs;return r(e,{cache:n,serializer:i})}function _s(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Li(e,t,n,i){var r=_s(i)?i:n(i),s=t.get(r);return typeof s>"u"&&(s=e.call(this,i),t.set(r,s)),s}function Ni(e,t,n){var i=Array.prototype.slice.call(arguments,3),r=n(i),s=t.get(r);return typeof s>"u"&&(s=e.apply(this,i),t.set(r,s)),s}function bn(e,t,n,i,r){return n.bind(t,e,i,r)}function gs(e,t){var n=e.length===1?Li:Ni;return bn(e,this,n,t.cache.create(),t.serializer)}function bs(e,t){return bn(e,this,Ni,t.cache.create(),t.serializer)}function vs(e,t){return bn(e,this,Li,t.cache.create(),t.serializer)}var ws=function(){return JSON.stringify(arguments)};function vn(){this.cache=Object.create(null)}vn.prototype.get=function(e){return this.cache[e]};vn.prototype.set=function(e,t){this.cache[e]=t};var Es={create:function(){return new vn}},Zt={variadic:bs,monadic:vs},qe;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(qe||(qe={}));var Nt=function(e){Lt(t,e);function t(n,i,r){var s=e.call(this,n)||this;return s.code=i,s.originalMessage=r,s}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Fn=function(e){Lt(t,e);function t(n,i,r,s){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(r).join('", "'),'"'),qe.INVALID_VALUE,s)||this}return t}(Nt),ys=function(e){Lt(t,e);function t(n,i,r){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),qe.INVALID_VALUE,r)||this}return t}(Nt),Ss=function(e){Lt(t,e);function t(n,i){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),qe.MISSING_VALUE,i)||this}return t}(Nt),me;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(me||(me={}));function ks(e){return e.length<2?e:e.reduce(function(t,n){var i=t[t.length-1];return!i||i.type!==me.literal||n.type!==me.literal?t.push(n):i.value+=n.value,t},[])}function As(e){return typeof e=="function"}function St(e,t,n,i,r,s,o){if(e.length===1&&xn(e[0]))return[{type:me.literal,value:e[0].value}];for(var l=[],a=0,u=e;a<u.length;a++){var f=u[a];if(xn(f)){l.push({type:me.literal,value:f.value});continue}if($r(f)){typeof s=="number"&&l.push({type:me.literal,value:n.getNumberFormat(t).format(s)});continue}var p=f.value;if(!(r&&p in r))throw new Ss(p,o);var h=r[p];if(Gr(f)){(!h||typeof h=="string"||typeof h=="number")&&(h=typeof h=="string"||typeof h=="number"?String(h):""),l.push({type:typeof h=="string"?me.literal:me.object,value:h});continue}if(bi(f)){var m=typeof f.style=="string"?i.date[f.style]:sn(f.style)?f.style.parsedOptions:void 0;l.push({type:me.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(vi(f)){var m=typeof f.style=="string"?i.time[f.style]:sn(f.style)?f.style.parsedOptions:i.time.medium;l.push({type:me.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(gi(f)){var m=typeof f.style=="string"?i.number[f.style]:Si(f.style)?f.style.parsedOptions:void 0;m&&m.scale&&(h=h*(m.scale||1)),l.push({type:me.literal,value:n.getNumberFormat(t,m).format(h)});continue}if(yi(f)){var d=f.children,b=f.value,I=r[b];if(!As(I))throw new ys(b,"function",o);var B=St(d,t,n,i,r,s),E=I(B.map(function(T){return T.value}));Array.isArray(E)||(E=[E]),l.push.apply(l,E.map(function(T){return{type:typeof T=="string"?me.literal:me.object,value:T}}))}if(wi(f)){var H=f.options[h]||f.options.other;if(!H)throw new Fn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r));continue}if(Ei(f)){var H=f.options["=".concat(h)];if(!H){if(!Intl.PluralRules)throw new Nt(`Intl.PluralRules is not available in this environment.
Try polyfilling it using "@formatjs/intl-pluralrules"
`,qe.MISSING_INTL_API,o);var y=n.getPluralRules(t,{type:f.pluralType}).select(h-(f.offset||0));H=f.options[y]||f.options.other}if(!H)throw new Fn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r,h-(f.offset||0)));continue}}return ks(l)}function Bs(e,t){return t?ee(ee(ee({},e||{}),t||{}),Object.keys(e).reduce(function(n,i){return n[i]=ee(ee({},e[i]),t[i]||{}),n},{})):e}function Ts(e,t){return t?Object.keys(e).reduce(function(n,i){return n[i]=Bs(e[i],t[i]),n},ee({},e)):e}function Qt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function Is(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.NumberFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.number),strategy:Zt.variadic}),getDateTimeFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.DateTimeFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.dateTime),strategy:Zt.variadic}),getPluralRules:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.PluralRules).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.pluralRules),strategy:Zt.variadic})}}var Hs=function(){function e(t,n,i,r){var s=this;if(n===void 0&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(o){var l=s.formatToParts(o);if(l.length===1)return l[0].value;var a=l.reduce(function(u,f){return!u.length||f.type!==me.literal||typeof u[u.length-1]!="string"?u.push(f.value):u[u.length-1]+=f.value,u},[]);return a.length<=1?a[0]||"":a},this.formatToParts=function(o){return St(s.ast,s.locales,s.formatters,s.formats,o,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:r==null?void 0:r.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Ts(e.formats,i),this.formatters=r&&r.formatters||Is(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ds,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Ce={},Cs=(e,t,n)=>n&&(t in Ce||(Ce[t]={}),e in Ce[t]||(Ce[t][e]=n),n),Ni=(e,t)=>{if(t==null)return;if(t in Ce&&e in Ce[t])return Ce[t][e];const n=gt(t);for(let i=0;i<n.length;i++){const r=Ls(n[i],e);if(r)return Cs(e,t,r)}};let wn;const Ye=Te({});function En(e){return e in wn}function Ls(e,t){if(!En(e))return null;const n=function(i){return wn[i]||null}(e);return function(i,r){if(r==null)return;if(r in i)return i[r];const s=r.split(".");let o=i;for(let l=0;l<s.length;l++)if(typeof o=="object"){if(l>0){const a=s.slice(l,s.length).join(".");if(a in o){o=o[a];break}}o=o[s[l]]}else o=void 0;return o}(n,t)}function Ps(e,...t){delete Ce[e],Ye.update(n=>(n[e]=Dr.all([n[e]||{},...t]),n))}Le([Ye],([e])=>Object.keys(e));Ye.subscribe(e=>wn=e);const ot={};function lt(e){return ot[e]}function It(e){return e!=null&&gt(e).some(t=>{var n;return(n=lt(t))===null||n===void 0?void 0:n.size})}function Ns(e,t){return Promise.all(t.map(i=>(function(r,s){ot[r].delete(s),ot[r].size===0&&delete ot[r]}(e,i),i().then(r=>r.default||r)))).then(i=>Ps(e,...i))}const nt={};function Oi(e){if(!It(e))return e in nt?nt[e]:Promise.resolve();const t=function(n){return gt(n).map(i=>{const r=lt(i);return[i,r?[...r]:[]]}).filter(([,i])=>i.length>0)}(e);return nt[e]=Promise.all(t.map(([n,i])=>Ns(n,i))).then(()=>{if(It(e))return Oi(e);delete nt[e]}),nt[e]}function Os(e,t){lt(e)||function(i){ot[i]=new Set}(e);const n=lt(e);lt(e).has(t)||(En(e)||Ye.update(i=>(i[e]={},i)),n.add(t))}function Ms({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${gt(e).join('", "')}".${It(Pe())?`
`,qe.MISSING_INTL_API,o);var y=n.getPluralRules(t,{type:f.pluralType}).select(h-(f.offset||0));H=f.options[y]||f.options.other}if(!H)throw new Fn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r,h-(f.offset||0)));continue}}return ks(l)}function Bs(e,t){return t?ee(ee(ee({},e||{}),t||{}),Object.keys(e).reduce(function(n,i){return n[i]=ee(ee({},e[i]),t[i]||{}),n},{})):e}function Ts(e,t){return t?Object.keys(e).reduce(function(n,i){return n[i]=Bs(e[i],t[i]),n},ee({},e)):e}function Qt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function Is(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.NumberFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.number),strategy:Zt.variadic}),getDateTimeFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.DateTimeFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.dateTime),strategy:Zt.variadic}),getPluralRules:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.PluralRules).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.pluralRules),strategy:Zt.variadic})}}var Hs=function(){function e(t,n,i,r){var s=this;if(n===void 0&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(o){var l=s.formatToParts(o);if(l.length===1)return l[0].value;var a=l.reduce(function(u,f){return!u.length||f.type!==me.literal||typeof u[u.length-1]!="string"?u.push(f.value):u[u.length-1]+=f.value,u},[]);return a.length<=1?a[0]||"":a},this.formatToParts=function(o){return St(s.ast,s.locales,s.formatters,s.formats,o,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:r==null?void 0:r.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Ts(e.formats,i),this.formatters=r&&r.formatters||Is(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ds,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Ce={},Cs=(e,t,n)=>n&&(t in Ce||(Ce[t]={}),e in Ce[t]||(Ce[t][e]=n),n),Pi=(e,t)=>{if(t==null)return;if(t in Ce&&e in Ce[t])return Ce[t][e];const n=gt(t);for(let i=0;i<n.length;i++){const r=Ls(n[i],e);if(r)return Cs(e,t,r)}};let wn;const Ye=Te({});function En(e){return e in wn}function Ls(e,t){if(!En(e))return null;const n=function(i){return wn[i]||null}(e);return function(i,r){if(r==null)return;if(r in i)return i[r];const s=r.split(".");let o=i;for(let l=0;l<s.length;l++)if(typeof o=="object"){if(l>0){const a=s.slice(l,s.length).join(".");if(a in o){o=o[a];break}}o=o[s[l]]}else o=void 0;return o}(n,t)}function Ns(e,...t){delete Ce[e],Ye.update(n=>(n[e]=Dr.all([n[e]||{},...t]),n))}Le([Ye],([e])=>Object.keys(e));Ye.subscribe(e=>wn=e);const ot={};function lt(e){return ot[e]}function It(e){return e!=null&&gt(e).some(t=>{var n;return(n=lt(t))===null||n===void 0?void 0:n.size})}function Ps(e,t){return Promise.all(t.map(i=>(function(r,s){ot[r].delete(s),ot[r].size===0&&delete ot[r]}(e,i),i().then(r=>r.default||r)))).then(i=>Ns(e,...i))}const nt={};function Oi(e){if(!It(e))return e in nt?nt[e]:Promise.resolve();const t=function(n){return gt(n).map(i=>{const r=lt(i);return[i,r?[...r]:[]]}).filter(([,i])=>i.length>0)}(e);return nt[e]=Promise.all(t.map(([n,i])=>Ps(n,i))).then(()=>{if(It(e))return Oi(e);delete nt[e]}),nt[e]}function Os(e,t){lt(e)||function(i){ot[i]=new Set}(e);const n=lt(e);lt(e).has(t)||(En(e)||Ye.update(i=>(i[e]={},i)),n.add(t))}function Ms({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${gt(e).join('", "')}".${It(Ne())?`

Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const it={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Ze(){return it}function xs(e){const{formats:t,...n}=e,i=e.initialLocale||e.fallbackLocale;return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=Ms:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(it,n,{initialLocale:i}),t&&("number"in t&&Object.assign(it.formats.number,t.number),"date"in t&&Object.assign(it.formats.date,t.date),"time"in t&&Object.assign(it.formats.time,t.time)),Ke.set(i)}const kt=Te(!1);let cn;const At=Te(null);function zn(e){return e.split("-").map((t,n,i)=>i.slice(0,n+1).join("-")).reverse()}function gt(e,t=Ze().fallbackLocale){const n=zn(e);return t?[...new Set([...n,...zn(t)])]:n}function Pe(){return cn??void 0}At.subscribe(e=>{cn=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Ke={...At,set:e=>{if(e&&function(t){if(t==null)return;const n=gt(t);for(let i=0;i<n.length;i++){const r=n[i];if(En(r))return r}}(e)&&It(e)){const{loadingDelay:t}=Ze();let n;return typeof window<"u"&&Pe()!=null&&t?n=window.setTimeout(()=>kt.set(!0),t):kt.set(!0),Oi(e).then(()=>{At.set(e)}).finally(()=>{clearTimeout(n),kt.set(!1)})}return At.set(e)}},Rs=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],Nt=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}},ct=(e,t)=>{const{formats:n}=Ze();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Us=Nt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=ct("number",t)),new Intl.NumberFormat(e,n)}),Ds=Nt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=ct("date",t):Object.keys(n).length===0&&(n=ct("date","short")),new Intl.DateTimeFormat(e,n)}),Gs=Nt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=ct("time",t):Object.keys(n).length===0&&(n=ct("time","short")),new Intl.DateTimeFormat(e,n)}),$s=({locale:e=Pe(),...t}={})=>Us({locale:e,...t}),js=({locale:e=Pe(),...t}={})=>Ds({locale:e,...t}),Fs=({locale:e=Pe(),...t}={})=>Gs({locale:e,...t}),zs=Nt((e,t=Pe())=>new Hs(e,t,Ze().formats,{ignoreTag:Ze().ignoreTag})),Vs=(e,t={})=>{var n,i,r,s;let o=t;typeof e=="object"&&(o=e,e=o.id);const{values:l,locale:a=Pe(),default:u}=o;if(a==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=Ni(e,a);if(f){if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f}else f=(s=(r=(i=(n=Ze()).handleMissingMessage)===null||i===void 0?void 0:i.call(n,{locale:a,id:e,defaultValue:u}))!==null&&r!==void 0?r:u)!==null&&s!==void 0?s:e;if(!l)return f;let p=f;try{p=zs(f,a).format(l)}catch(h){h instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,h.message)}return p},Ws=(e,t)=>Fs(t).format(e),Xs=(e,t)=>js(t).format(e),qs=(e,t)=>$s(t).format(e),Zs=(e,t=Pe())=>Ni(e,t),Se=Le([Ke,Ye],()=>Vs);Le([Ke],()=>Ws);Le([Ke],()=>Xs);Le([Ke],()=>qs);Le([Ke,Ye],()=>Zs);function Qs(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,i,r,s,o=[],l="",a=e.split("/");for(a[0]||a.shift();r=a.shift();)n=r[0],n==="*"?(o.push("wild"),l+="/(.*)"):n===":"?(i=r.indexOf("?",1),s=r.indexOf(".",1),o.push(r.substring(1,~i?i:~s?s:r.length)),l+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(l+=(~i?"?":"")+"\\"+r.substring(s))):l+="/"+r;return{keys:o,pattern:new RegExp("^"+l+(t?"(?=$|/)":"/?$"),"i")}}function Js(e){let t,n,i;const r=[e[2]];var s=e[0];function o(l,a){let u={};if(a!==void 0&&a&4)u=Bt(r,[Tt(l[2])]);else for(let f=0;f<r.length;f+=1)u=pn(u,r[f]);return{props:u}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[7])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,a){t&&O(t,l,a),g(l,n,a),i=!0},p(l,a){if(a&1&&s!==(s=l[0])){if(t){ue();const u=t;S(u.$$.fragment,1,0,()=>{M(u,1)}),fe()}s?(t=Ve(s,o(l,a)),t.$on("routeEvent",l[7]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const u=a&4?Bt(r,[Tt(l[2])]):{};t.$set(u)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function Ys(e){let t,n,i;const r=[{params:e[1]},e[2]];var s=e[0];function o(l,a){let u={};if(a!==void 0&&a&6)u=Bt(r,[a&2&&{params:l[1]},a&4&&Tt(l[2])]);else for(let f=0;f<r.length;f+=1)u=pn(u,r[f]);return{props:u}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[6])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,a){t&&O(t,l,a),g(l,n,a),i=!0},p(l,a){if(a&1&&s!==(s=l[0])){if(t){ue();const u=t;S(u.$$.fragment,1,0,()=>{M(u,1)}),fe()}s?(t=Ve(s,o(l,a)),t.$on("routeEvent",l[6]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const u=a&6?Bt(r,[a&2&&{params:l[1]},a&4&&Tt(l[2])]):{};t.$set(u)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function Ks(e){let t,n,i,r;const s=[Ys,Js],o=[];function l(a,u){return a[1]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function Vn(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let i="";return n>-1&&(i=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:i}}const yn=di(null,function(t){t(Vn());const n=()=>{t(Vn())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}});Le(yn,e=>e.location);Le(yn,e=>e.querystring);const Wn=Te(void 0);async function je(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await gn(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}async function Be(){await gn(),window.history.back()}function eo(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function to(e,t,n){let{routes:i={}}=t,{prefix:r=""}=t,{restoreScrollState:s=!1}=t;class o{constructor(T,P){if(!P||typeof P!="function"&&(typeof P!="object"||P._sveltesparouter!==!0))throw Error("Invalid component object");if(!T||typeof T=="string"&&(T.length<1||T.charAt(0)!="/"&&T.charAt(0)!="*")||typeof T=="object"&&!(T instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:k,keys:x}=Qs(T);this.path=T,typeof P=="object"&&P._sveltesparouter===!0?(this.component=P.component,this.conditions=P.conditions||[],this.userData=P.userData,this.props=P.props||{}):(this.component=()=>Promise.resolve(P),this.conditions=[],this.props={}),this._pattern=k,this._keys=x}match(T){if(r){if(typeof r=="string")if(T.startsWith(r))T=T.substr(r.length)||"/";else return null;else if(r instanceof RegExp){const v=T.match(r);if(v&&v[0])T=T.substr(v[0].length)||"/";else return null}}const P=this._pattern.exec(T);if(P===null)return null;if(this._keys===!1)return P;const k={};let x=0;for(;x<this._keys.length;){try{k[this._keys[x]]=decodeURIComponent(P[x+1]||"")||null}catch{k[this._keys[x]]=null}x++}return k}async checkConditions(T){for(let P=0;P<this.conditions.length;P++)if(!await this.conditions[P](T))return!1;return!0}}const l=[];i instanceof Map?i.forEach((y,T)=>{l.push(new o(T,y))}):Object.keys(i).forEach(y=>{l.push(new o(y,i[y]))});let a=null,u=null,f={};const p=_t();async function h(y,T){await gn(),p(y,T)}let m=null,d=null;s&&(d=y=>{y.state&&(y.state.__svelte_spa_router_scrollY||y.state.__svelte_spa_router_scrollX)?m=y.state:m=null},window.addEventListener("popstate",d),ai(()=>{eo(m)}));let b=null,I=null;const B=yn.subscribe(async y=>{b=y;let T=0;for(;T<l.length;){const P=l[T].match(y.location);if(!P){T++;continue}const k={route:l[T].path,location:y.location,querystring:y.querystring,userData:l[T].userData,params:P&&typeof P=="object"&&Object.keys(P).length?P:null};if(!await l[T].checkConditions(k)){n(0,a=null),I=null,h("conditionsFailed",k);return}h("routeLoading",Object.assign({},k));const x=l[T].component;if(I!=x){x.loading?(n(0,a=x.loading),I=x,n(1,u=x.loadingParams),n(2,f={}),h("routeLoaded",Object.assign({},k,{component:a,name:a.name,params:u}))):(n(0,a=null),I=null);const v=await x();if(y!=b)return;n(0,a=v&&v.default||v),I=x}P&&typeof P=="object"&&Object.keys(P).length?n(1,u=P):n(1,u=null),n(2,f=l[T].props),h("routeLoaded",Object.assign({},k,{component:a,name:a.name,params:u})).then(()=>{Wn.set(u)});return}n(0,a=null),I=null,Wn.set(void 0)});_n(()=>{B(),d&&window.removeEventListener("popstate",d)});function E(y){ut.call(this,e,y)}function H(y){ut.call(this,e,y)}return e.$$set=y=>{"routes"in y&&n(3,i=y.routes),"prefix"in y&&n(4,r=y.prefix),"restoreScrollState"in y&&n(5,s=y.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,r,s,E,H]}class no extends Y{constructor(t){super(),J(this,t,to,Ks,Z,{routes:3,prefix:4,restoreScrollState:5})}}const we=Te(!1),rt=Te(!1),Ht=Te(!1);function Mi(){const{subscribe:e,set:t,update:n}=Te([]);return{subscribe:e,fetch:async()=>{if(!Nn(we))return;const i=await or();n(r=>i)},search:async(i,r)=>{if(!Nn(we))return;const s=await cr(i,r);n(o=>s)},reset:()=>t([])}}const Me=Mi(),Jt=Te(""),Yt=Mi();function io(e){let t,n,i,r;return{c(){t=V("svg"),n=V("polyline"),i=V("polyline"),c(n,"points","11 17 6 12 11 7"),c(i,"points","18 17 13 12 18 7"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-chevrons-left "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-chevrons-left "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ro(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class xi extends Y{constructor(t){super(),J(this,t,ro,io,Z,{size:0,strokeWidth:1,class:2})}}function so(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("line"),r=V("line"),c(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),c(i,"x1","18"),c(i,"y1","9"),c(i,"x2","12"),c(i,"y2","15"),c(r,"x1","12"),c(r,"y1","9"),c(r,"x2","18"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-delete "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-delete "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function oo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class lo extends Y{constructor(t){super(),J(this,t,oo,so,Z,{size:0,strokeWidth:1,class:2})}}function ao(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","7 10 12 15 17 10"),c(r,"x1","12"),c(r,"y1","15"),c(r,"x2","12"),c(r,"y2","3"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-download "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-download "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function uo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class fo extends Y{constructor(t){super(),J(this,t,uo,ao,Z,{size:0,strokeWidth:1,class:2})}}function co(e){let t,n,i,r;return{c(){t=V("svg"),n=V("path"),i=V("path"),c(n,"d","M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"),c(i,"d","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-edit "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-edit "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ho(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class po extends Y{constructor(t){super(),J(this,t,ho,co,Z,{size:0,strokeWidth:1,class:2})}}function mo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("path"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"d","M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"),c(r,"x1","12"),c(r,"y1","17"),c(r,"x2","12.01"),c(r,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-help-circle "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-help-circle "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function _o(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class go extends Y{constructor(t){super(),J(this,t,_o,mo,Z,{size:0,strokeWidth:1,class:2})}}function bo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("line"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"x1","12"),c(i,"y1","16"),c(i,"x2","12"),c(i,"y2","12"),c(r,"x1","12"),c(r,"y1","8"),c(r,"x2","12.01"),c(r,"y2","8"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-info "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-info "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function vo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class wo extends Y{constructor(t){super(),J(this,t,vo,bo,Z,{size:0,strokeWidth:1,class:2})}}function Eo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("rect"),i=V("line"),r=V("line"),c(n,"x","3"),c(n,"y","3"),c(n,"width","18"),c(n,"height","18"),c(n,"rx","2"),c(n,"ry","2"),c(i,"x1","12"),c(i,"y1","8"),c(i,"x2","12"),c(i,"y2","16"),c(r,"x1","8"),c(r,"y1","12"),c(r,"x2","16"),c(r,"y2","12"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-plus-square "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-plus-square "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function yo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ot extends Y{constructor(t){super(),J(this,t,yo,Eo,Z,{size:0,strokeWidth:1,class:2})}}function So(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("line"),c(n,"cx","11"),c(n,"cy","11"),c(n,"r","8"),c(i,"x1","21"),c(i,"y1","21"),c(i,"x2","16.65"),c(i,"y2","16.65"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-search "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-search "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ko(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ao extends Y{constructor(t){super(),J(this,t,ko,So,Z,{size:0,strokeWidth:1,class:2})}}function Bo(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("path"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","3"),c(i,"d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-settings "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-settings "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function To(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ri extends Y{constructor(t){super(),J(this,t,To,Bo,Z,{size:0,strokeWidth:1,class:2})}}function Io(e){let t,n,i,r,s,o;return{c(){t=V("svg"),n=V("polyline"),i=V("path"),r=V("line"),s=V("line"),c(n,"points","3 6 5 6 21 6"),c(i,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),c(r,"x1","10"),c(r,"y1","11"),c(r,"x2","10"),c(r,"y2","17"),c(s,"x1","14"),c(s,"y1","11"),c(s,"x2","14"),c(s,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",o="feather feather-trash-2 "+e[2])},m(l,a){g(l,t,a),A(t,n),A(t,i),A(t,r),A(t,s)},p(l,[a]){a&1&&c(t,"width",l[0]),a&1&&c(t,"height",l[0]),a&2&&c(t,"stroke-width",l[1]),a&4&&o!==(o="feather feather-trash-2 "+l[2])&&c(t,"class",o)},i:G,o:G,d(l){l&&_(t)}}}function Ho(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Co extends Y{constructor(t){super(),J(this,t,Ho,Io,Z,{size:0,strokeWidth:1,class:2})}}function Lo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","17 8 12 3 7 8"),c(r,"x1","12"),c(r,"y1","3"),c(r,"x2","12"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-upload "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-upload "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function Po(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class hn extends Y{constructor(t){super(),J(this,t,Po,Lo,Z,{size:0,strokeWidth:1,class:2})}}function No(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=L("p"),r&&r.c(),c(t,"class","svelte-hclhr3"),X(t,"error",e[3]),X(t,"warning",e[0]),X(t,"success",e[1]),X(t,"info",e[2])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&16)&&mt(r,i,s,s[4],n?pt(i,s[4],o,null):dt(s[4]),null),(!n||o&8)&&X(t,"error",s[3]),(!n||o&1)&&X(t,"warning",s[0]),(!n||o&2)&&X(t,"success",s[1]),(!n||o&4)&&X(t,"info",s[2])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function Oo(e,t,n){let{$$slots:i={},$$scope:r}=t,{error:s=!1}=t,{warning:o=!1}=t,{success:l=!1}=t,{info:a=!1}=t;return o=s&&o?!1:o,l=(s||o)&&l?!1:l,a=!(s||o||l),e.$$set=u=>{"error"in u&&n(3,s=u.error),"warning"in u&&n(0,o=u.warning),"success"in u&&n(1,l=u.success),"info"in u&&n(2,a=u.info),"$$scope"in u&&n(4,r=u.$$scope)},[o,l,a,s,r,i]}class Mt extends Y{constructor(t){super(),J(this,t,Oo,No,Z,{error:3,warning:0,success:1,info:2})}}function Mo(e){let t=e[0]("no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("no_connection")+"")&&z(n,t)},d(i){i&&_(n)}}}function xo(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Mo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ro(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Uo extends Y{constructor(t){super(),J(this,t,Ro,xo,Z,{})}}function Do(e){let t,n,i,r;const s=e[5].default,o=ht(s,e,e[4],null);return{c(){t=L("button"),o&&o.c(),t.disabled=e[3],c(t,"class","svelte-1jbd97"),X(t,"primary",e[0]),X(t,"danger",e[1]),X(t,"secondary",e[2])},m(l,a){g(l,t,a),o&&o.m(t,null),n=!0,i||(r=te(t,"click",e[6]),i=!0)},p(l,[a]){o&&o.p&&(!n||a&16)&&mt(o,s,l,l[4],n?pt(s,l[4],a,null):dt(l[4]),null),(!n||a&8)&&(t.disabled=l[3]),(!n||a&1)&&X(t,"primary",l[0]),(!n||a&2)&&X(t,"danger",l[1]),(!n||a&4)&&X(t,"secondary",l[2])},i(l){n||(w(o,l),n=!0)},o(l){S(o,l),n=!1},d(l){l&&_(t),o&&o.d(l),i=!1,r()}}}function Go(e,t,n){let{$$slots:i={},$$scope:r}=t,{primary:s=!1}=t,{danger:o=!1}=t,{secondary:l=!1}=t,{disabled:a=!1}=t;s=!s&&!l&&!o?!0:s,o=s&&o?!1:o,l=(s||o)&&l?!1:l;function u(f){ut.call(this,e,f)}return e.$$set=f=>{"primary"in f&&n(0,s=f.primary),"danger"in f&&n(1,o=f.danger),"secondary"in f&&n(2,l=f.secondary),"disabled"in f&&n(3,a=f.disabled),"$$scope"in f&&n(4,r=f.$$scope)},[s,o,l,a,r,i,u]}class Fe extends Y{constructor(t){super(),J(this,t,Go,Do,Z,{primary:0,danger:1,secondary:2,disabled:3})}}function $o(e){let t=e[0]("daemon.start")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.start")+"")&&z(n,t)},d(i){i&&_(n)}}}function jo(e){let t=e[0]("daemon.installed")+"",n,i,r,s;return r=new Fe({props:{$$slots:{default:[$o]},$$scope:{ctx:e}}}),r.$on("click",e[1]),{c(){n=$(t),i=R(),U(r.$$.fragment)},m(o,l){g(o,n,l),g(o,i,l),O(r,o,l),s=!0},p(o,l){(!s||l&1)&&t!==(t=o[0]("daemon.installed")+"")&&z(n,t);const a={};l&5&&(a.$$scope={dirty:l,ctx:o}),r.$set(a)},i(o){s||(w(r.$$.fragment,o),s=!0)},o(o){S(r.$$.fragment,o),s=!1},d(o){o&&(_(n),_(i)),M(r,o)}}}function Fo(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[jo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&5&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function zo(e,t,n){let i;ne(e,Se,s=>n(0,i=s));async function r(){Ht.update(s=>!0);try{const s=await wr()}catch(s){await oe(i("daemon.start_error_title"),s),Ht.update(o=>!1)}await Me.fetch()}return[i,r]}class Vo extends Y{constructor(t){super(),J(this,t,zo,Fo,Z,{})}}function Wo(e){let t=e[0]("daemon.not_installed")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.not_installed")+"")&&z(n,t)},d(i){i&&_(n)}}}function Xo(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Wo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function qo(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Zo extends Y{constructor(t){super(),J(this,t,qo,Xo,Z,{})}}function Qo(e){let t=e[0]("daemon.starting")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.starting")+"")&&z(n,t)},d(i){i&&_(n)}}}function Jo(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[Qo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Yo(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Ko extends Y{constructor(t){super(),J(this,t,Yo,Jo,Z,{})}}function Xn(e){let t,n,i,r,s,o;t=new Uo({});const l=[nl,tl,el],a=[];function u(f,p){return f[2]&&!f[3]?0:f[2]&&f[3]?1:2}return i=u(e),r=a[i]=l[i](e),{c(){U(t.$$.fragment),n=R(),r.c(),s=ye()},m(f,p){O(t,f,p),g(f,n,p),a[i].m(f,p),g(f,s,p),o=!0},p(f,p){let h=i;i=u(f),i!==h&&(ue(),S(a[h],1,1,()=>{a[h]=null}),fe(),r=a[i],r||(r=a[i]=l[i](f),r.c()),w(r,1),r.m(s.parentNode,s))},i(f){o||(w(t.$$.fragment,f),w(r),o=!0)},o(f){S(t.$$.fragment,f),S(r),o=!1},d(f){f&&(_(n),_(s)),M(t,f),a[i].d(f)}}}function el(e){let t,n;return t=new Zo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function tl(e){let t,n;return t=new Ko({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function nl(e){let t,n;return t=new Vo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function il(e){let t,n,i,r,s,o=!e[1]&&Xn(e);const l=e[6].default,a=ht(l,e,e[5],null);return{c(){t=L("div"),o&&o.c(),n=R(),a&&a.c(),c(t,"class","screen svelte-i096ea"),X(t,"centered",e[0])},m(u,f){g(u,t,f),o&&o.m(t,null),A(t,n),a&&a.m(t,null),i=!0,r||(s=[te(t,"keyup",e[4]),te(t,"keyup",e[7])],r=!0)},p(u,[f]){u[1]?o&&(ue(),S(o,1,1,()=>{o=null}),fe()):o?(o.p(u,f),f&2&&w(o,1)):(o=Xn(u),o.c(),w(o,1),o.m(t,n)),a&&a.p&&(!i||f&32)&&mt(a,l,u,u[5],i?pt(l,u[5],f,null):dt(u[5]),null),(!i||f&1)&&X(t,"centered",u[0])},i(u){i||(w(o),w(a,u),i=!0)},o(u){S(o),S(a,u),i=!1},d(u){u&&_(t),o&&o.d(),a&&a.d(u),r=!1,Ee(s)}}}function rl(e,t,n){let i,r,s;ne(e,we,h=>n(1,i=h)),ne(e,rt,h=>n(2,r=h)),ne(e,Ht,h=>n(3,s=h));let{$$slots:o={},$$scope:l}=t,{centered:a=!1}=t;const u=_t();function f(h){h.key==="Escape"&&(h.preventDefault(),u("cancel"))}function p(h){ut.call(this,e,h)}return e.$$set=h=>{"centered"in h&&n(0,a=h.centered),"$$scope"in h&&n(5,l=h.$$scope)},[a,i,r,s,f,l,o,p]}class et extends Y{constructor(t){super(),J(this,t,rl,il,Z,{centered:0})}}function sl(e){let t,n,i,r,s,o,l,a;var u=e[0];function f(m,d){return{props:{size:m[2],strokeWidth:m[3]}}}u&&(i=Ve(u,f(e)));const p=e[10].default,h=ht(p,e,e[9],null);return{c(){t=L("div"),n=L("div"),i&&U(i.$$.fragment),s=R(),h&&h.c(),c(n,"class",r="icon-wrapper "+e[1]+" svelte-bhj2u4"),c(t,"class","content svelte-bhj2u4"),c(t,"tabindex","0"),c(t,"title",e[5]),X(t,"centered",e[6]),X(t,"horizontal",e[4])},m(m,d){g(m,t,d),A(t,n),i&&O(i,n,null),A(t,s),h&&h.m(t,null),o=!0,l||(a=[te(t,"click",e[7]),te(t,"keyup",e[8])],l=!0)},p(m,[d]){if(d&1&&u!==(u=m[0])){if(i){ue();const b=i;S(b.$$.fragment,1,0,()=>{M(b,1)}),fe()}u?(i=Ve(u,f(m)),U(i.$$.fragment),w(i.$$.fragment,1),O(i,n,null)):i=null}else if(u){const b={};d&4&&(b.size=m[2]),d&8&&(b.strokeWidth=m[3]),i.$set(b)}(!o||d&2&&r!==(r="icon-wrapper "+m[1]+" svelte-bhj2u4"))&&c(n,"class",r),h&&h.p&&(!o||d&512)&&mt(h,p,m,m[9],o?pt(p,m[9],d,null):dt(m[9]),null),(!o||d&32)&&c(t,"title",m[5]),(!o||d&16)&&X(t,"horizontal",m[4])},i(m){o||(i&&w(i.$$.fragment,m),w(h,m),o=!0)},o(m){i&&S(i.$$.fragment,m),S(h,m),o=!1},d(m){m&&_(t),i&&M(i),h&&h.d(m),l=!1,Ee(a)}}}function ol(e,t,n){let{$$slots:i={},$$scope:r}=t,{icon:s=go}=t,{iconClass:o}=t,{size:l="24"}=t,{strokeWidth:a="2"}=t,{horizontal:u=!1}=t,{title:f=""}=t;const p=!u,h=_t();function m(){h("activate")}function d(b){(b.key==="Enter"||b.key===" ")&&h("activate")}return e.$$set=b=>{"icon"in b&&n(0,s=b.icon),"iconClass"in b&&n(1,o=b.iconClass),"size"in b&&n(2,l=b.size),"strokeWidth"in b&&n(3,a=b.strokeWidth),"horizontal"in b&&n(4,u=b.horizontal),"title"in b&&n(5,f=b.title),"$$scope"in b&&n(9,r=b.$$scope)},[s,o,l,a,u,f,p,m,d,r,i]}class de extends Y{constructor(t){super(),J(this,t,ol,sl,Z,{icon:0,iconClass:1,size:2,strokeWidth:3,horizontal:4,title:5})}}function ll(e,t){t&&setTimeout(()=>{e.focus(),e.select()},250)}function qn(e){let t,n;return{c(){t=L("label"),n=$(e[4]),c(t,"for",e[3])},m(i,r){g(i,t,r),A(t,n)},p(i,r){r&16&&z(n,i[4]),r&8&&c(t,"for",i[3])},d(i){i&&_(t)}}}function Zn(e){let t,n,i,r,s;return n=new Ao({}),{c(){t=L("button"),U(n.$$.fragment),c(t,"class","search-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[6]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=te(t,"click",e[14]),r=!0)},p(o,l){(!i||l&64)&&c(t,"title",o[6]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Qn(e){let t,n,i,r,s;return n=new lo({}),{c(){t=L("button"),U(n.$$.fragment),c(t,"class","clear-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[7]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=te(t,"click",e[15]),r=!0)},p(o,l){(!i||l&128)&&c(t,"title",o[7]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Jn(e){let t;return{c(){t=L("div"),c(t,"class","error-message svelte-8p6spj")},m(n,i){g(n,t,i),t.innerHTML=e[11]},p(n,i){i&2048&&(t.innerHTML=n[11])},d(n){n&&_(t)}}}function al(e){let t,n,i,r,s,o,l,a,u,f,p,h,m=e[4]&&qn(e),d=e[9]&&Zn(e),b=e[9]&&e[0]&&Qn(e),I=!e[9]&&Jn(e);return{c(){t=L("div"),m&&m.c(),n=R(),i=L("div"),d&&d.c(),r=R(),s=L("input"),l=R(),b&&b.c(),a=R(),I&&I.c(),u=ye(),c(s,"type","text"),c(s,"id",e[3]),c(s,"name",e[3]),c(s,"placeholder",e[5]),c(s,"tabindex",e[10]),c(s,"class","svelte-8p6spj"),X(s,"search",e[9]),X(s,"focussed",e[2]),X(s,"value",e[0]),c(i,"class","input-control svelte-8p6spj"),c(t,"class","input svelte-8p6spj")},m(B,E){g(B,t,E),m&&m.m(t,null),A(t,n),A(t,i),d&&d.m(i,null),A(i,r),A(i,s),ze(s,e[0]),e[18](s),A(i,l),b&&b.m(i,null),g(B,a,E),I&&I.m(B,E),g(B,u,E),f=!0,p||(h=[te(s,"input",e[17]),te(s,"focusin",e[12]),te(s,"focusout",e[13]),dn(o=ll.call(null,s,e[8]))],p=!0)},p(B,[E]){B[4]?m?m.p(B,E):(m=qn(B),m.c(),m.m(t,n)):m&&(m.d(1),m=null),B[9]?d?(d.p(B,E),E&512&&w(d,1)):(d=Zn(B),d.c(),w(d,1),d.m(i,r)):d&&(ue(),S(d,1,1,()=>{d=null}),fe()),(!f||E&8)&&c(s,"id",B[3]),(!f||E&8)&&c(s,"name",B[3]),(!f||E&32)&&c(s,"placeholder",B[5]),(!f||E&1024)&&c(s,"tabindex",B[10]),E&1&&s.value!==B[0]&&ze(s,B[0]),o&&Qe(o.update)&&E&256&&o.update.call(null,B[8]),(!f||E&512)&&X(s,"search",B[9]),(!f||E&4)&&X(s,"focussed",B[2]),(!f||E&1)&&X(s,"value",B[0]),B[9]&&B[0]?b?(b.p(B,E),E&513&&w(b,1)):(b=Qn(B),b.c(),w(b,1),b.m(i,null)):b&&(ue(),S(b,1,1,()=>{b=null}),fe()),B[9]?I&&(I.d(1),I=null):I?I.p(B,E):(I=Jn(B),I.c(),I.m(u.parentNode,u))},i(B){f||(w(d),w(b),f=!0)},o(B){S(d),S(b),f=!1},d(B){B&&(_(t),_(a),_(u)),m&&m.d(),d&&d.d(),e[18](null),b&&b.d(),I&&I.d(B),p=!1,Ee(h)}}}function ul(e,t,n){let i;const r=_t();let{name:s="input"}=t,{label:o=""}=t,{value:l=""}=t,{errorMessage:a=""}=t,{placeholder:u=""}=t,{searchButtonTitle:f=""}=t,{clearButtonTitle:p=""}=t,{autofocus:h=!1}=t,{search:m=!1}=t,{tabindex:d=0}=t,{ref:b}=t,{focussed:I=h}=t;function B(){n(2,I=!0)}function E(){n(2,I=!1)}function H(){r("query",l),document.getElementById(s).focus()}function y(){n(0,l=""),document.getElementById(s).focus()}function T(){l=this.value,n(0,l)}function P(k){ve[k?"unshift":"push"](()=>{b=k,n(1,b)})}return e.$$set=k=>{"name"in k&&n(3,s=k.name),"label"in k&&n(4,o=k.label),"value"in k&&n(0,l=k.value),"errorMessage"in k&&n(16,a=k.errorMessage),"placeholder"in k&&n(5,u=k.placeholder),"searchButtonTitle"in k&&n(6,f=k.searchButtonTitle),"clearButtonTitle"in k&&n(7,p=k.clearButtonTitle),"autofocus"in k&&n(8,h=k.autofocus),"search"in k&&n(9,m=k.search),"tabindex"in k&&n(10,d=k.tabindex),"ref"in k&&n(1,b=k.ref),"focussed"in k&&n(2,I=k.focussed)},e.$$.update=()=>{e.$$.dirty&65536&&n(11,i=a||"&nbsp;")},[l,b,I,s,o,u,f,p,h,m,d,i,B,E,H,y,a,T,P]}class Sn extends Y{constructor(t){super(),J(this,t,ul,al,Z,{name:3,label:4,value:0,errorMessage:16,placeholder:5,searchButtonTitle:6,clearButtonTitle:7,autofocus:8,search:9,tabindex:10,ref:1,focussed:2})}}function Ui(e,t){t&&e.focus()}function fl(e){let t;return{c(){t=$(e[0])},m(n,i){g(n,t,i)},p(n,i){i&1&&z(t,n[0])},d(n){n&&_(t)}}}function cl(e){let t;return{c(){t=$(" ")},m(n,i){g(n,t,i)},p:G,d(n){n&&_(t)}}}function hl(e){let t;function n(s,o){return s[1]?cl:fl}let r=n(e)(e);return{c(){t=L("span"),r.c(),c(t,"class","shortcut-button svelte-11t060e"),X(t,"hide",e[1])},m(s,o){g(s,t,o),r.m(t,null)},p(s,[o]){r.p(s,o)},i:G,o:G,d(s){s&&_(t),r.d()}}}function pl(e,t,n){let{shortcut:i=""}=t;const r=i.length===0;return e.$$set=s=>{"shortcut"in s&&n(0,i=s.shortcut)},[i,r]}class xt extends Y{constructor(t){super(),J(this,t,pl,hl,Z,{shortcut:0})}}function Yn(e){let t,n;return t=new xt({props:{shortcut:e[6]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&64&&(s.shortcut=i[6]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Kn(e){let t,n,i;return n=new po({props:{size:"1.25x"}}),{c(){t=L("div"),U(n.$$.fragment),c(t,"class","edit-icon-wrapper svelte-1ebkg7o")},m(r,s){g(r,t,s),O(n,t,null),i=!0},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function ml(e){let t,n,i,r,s,o=e[0].body+"",l,a,u,f,p,h=e[4]&&Yn(e);i=new xt({props:{shortcut:e[0].abbreviation}});let m=!e[4]&&Kn();return{c(){t=L("li"),h&&h.c(),n=R(),U(i.$$.fragment),r=R(),s=L("span"),l=$(o),a=R(),m&&m.c(),c(s,"class","body svelte-1ebkg7o"),c(t,"tabindex",e[1]),c(t,"title",e[7]),c(t,"class","svelte-1ebkg7o"),X(t,"focussed",e[2]),X(t,"active",e[3])},m(d,b){g(d,t,b),h&&h.m(t,null),A(t,n),O(i,t,null),A(t,r),A(t,s),A(s,l),A(t,a),m&&m.m(t,null),e[13](t),u=!0,f||(p=te(t,"click",e[12]),f=!0)},p(d,[b]){d[4]?h?(h.p(d,b),b&16&&w(h,1)):(h=Yn(d),h.c(),w(h,1),h.m(t,n)):h&&(ue(),S(h,1,1,()=>{h=null}),fe());const I={};b&1&&(I.shortcut=d[0].abbreviation),i.$set(I),(!u||b&1)&&o!==(o=d[0].body+"")&&z(l,o),d[4]?m&&(ue(),S(m,1,1,()=>{m=null}),fe()):m?b&16&&w(m,1):(m=Kn(),m.c(),w(m,1),m.m(t,null)),(!u||b&2)&&c(t,"tabindex",d[1]),(!u||b&4)&&X(t,"focussed",d[2]),(!u||b&8)&&X(t,"active",d[3])},i(d){u||(w(h),w(i.$$.fragment,d),w(m),u=!0)},o(d){S(h),S(i.$$.fragment,d),S(m),u=!1},d(d){d&&_(t),h&&h.d(),M(i),m&&m.d(),e[13](null),f=!1,p()}}}function dl(e,t,n){let i;ne(e,Se,E=>n(14,i=E));let{snippet:r}=t,{index:s=-1}=t,{tabindex:o=-1}=t,{focussed:l=!1}=t,{active:a=!1}=t,{selectMode:u=!1}=t,{observer:f=null}=t,p,h=i(u?"use_snippet.title":"edit_snippet.title"),m=s>=0&&s<10?s+1:"";m===10&&(m=0);function d(){return p.classList.contains("is-visible")}function b(E){p.scrollIntoView({behavior:"smooth",block:E})}Je(()=>{f&&f.observe(p)}),_n(()=>{f&&f.unobserve(p)});function I(E){ut.call(this,e,E)}function B(E){ve[E?"unshift":"push"](()=>{p=E,n(5,p)})}return e.$$set=E=>{"snippet"in E&&n(0,r=E.snippet),"index"in E&&n(8,s=E.index),"tabindex"in E&&n(1,o=E.tabindex),"focussed"in E&&n(2,l=E.focussed),"active"in E&&n(3,a=E.active),"selectMode"in E&&n(4,u=E.selectMode),"observer"in E&&n(9,f=E.observer)},[r,o,l,a,u,p,m,h,s,f,d,b,I,B]}class _l extends Y{constructor(t){super(),J(this,t,dl,ml,Z,{snippet:0,index:8,tabindex:1,focussed:2,active:3,selectMode:4,observer:9,isVisible:10,scrollIntoView:11})}get isVisible(){return this.$$.ctx[10]}get scrollIntoView(){return this.$$.ctx[11]}}function ei(e,t,n){const i=e.slice();return i[22]=t[n],i[23]=t,i[24]=n,i}function ti(e){let t,n=e[24],i;const r=()=>e[14](t,n),s=()=>e[14](null,n);function o(){return e[15](e[24])}let l={snippet:e[22],index:e[24],focussed:e[24]===e[4],active:e[5],observer:e[8],selectMode:e[2]};return t=new _l({props:l}),r(),t.$on("click",o),{c(){U(t.$$.fragment)},m(a,u){O(t,a,u),i=!0},p(a,u){e=a,n!==e[24]&&(s(),n=e[24],r());const f={};u&128&&(f.snippet=e[22]),u&16&&(f.focussed=e[24]===e[4]),u&32&&(f.active=e[5]),u&4&&(f.selectMode=e[2]),t.$set(f)},i(a){i||(w(t.$$.fragment,a),i=!0)},o(a){S(t.$$.fragment,a),i=!1},d(a){s(),M(t,a)}}}function gl(e){let t,n,i,r,s,o=On(e[7]),l=[];for(let u=0;u<o.length;u+=1)l[u]=ti(ei(e,o,u));const a=u=>S(l[u],1,1,()=>{l[u]=null});return{c(){t=L("ul");for(let u=0;u<l.length;u+=1)l[u].c();c(t,"tabindex",e[1]),c(t,"class","svelte-1wnqbvs")},m(u,f){g(u,t,f);for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(t,null);e[16](t),i=!0,r||(s=[te(t,"focus",e[9]),te(t,"blur",e[10]),te(t,"keydown",e[12]),dn(n=Ui.call(null,t,e[3]))],r=!0)},p(u,[f]){if(f&2548){o=On(u[7]);let p;for(p=0;p<o.length;p+=1){const h=ei(u,o,p);l[p]?(l[p].p(h,f),w(l[p],1)):(l[p]=ti(h),l[p].c(),w(l[p],1),l[p].m(t,null))}for(ue(),p=o.length;p<l.length;p+=1)a(p);fe()}(!i||f&2)&&c(t,"tabindex",u[1]),n&&Qe(n.update)&&f&8&&n.update.call(null,u[3])},i(u){if(!i){for(let f=0;f<o.length;f+=1)w(l[f]);i=!0}},o(u){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)S(l[f]);i=!1},d(u){u&&_(t),Xi(l,u),e[16](null),r=!1,Ee(s)}}}function bl(e,t,n){let i;const r=_t();let{snippets:s=null}=t,{tabindex:o=0}=t,{selectMode:l=!1}=t,{autofocus:a=!1}=t,{ref:u}=t,f=0,p=a,h=[];const m=new IntersectionObserver(function(v){for(let N=0;N<v.length;N++)v[N].isIntersecting?v[N].target.classList.add("is-visible"):v[N].target.classList.remove("is-visible")},{root:u,threshold:[.6]});function d(v){return n(4,f=0),v}function b(){n(5,p=!0)}function I(){n(5,p=!1)}function B(v){l?y(i[v]):T(i[v])}function E(v){!s||s.length===0||H(v)&&v.preventDefault()}function H(v){if(v.key==="Home"||v.key==="g")return n(4,f=0),h[f].scrollIntoView("nearest"),!0;if(v.key==="End"||v.key==="G")return n(4,f=s.length-1),h[f].scrollIntoView("nearest"),!0;if(f<s.length-1&&(v.key==="ArrowDown"||v.key==="j"))return n(4,f++,f),h[f].scrollIntoView("nearest"),!0;if(f>0&&(v.key==="ArrowUp"||v.key==="k"))return n(4,f--,f),h[f].scrollIntoView("nearest"),!0;if(v.key==="PageDown"||v.key==="d"){let N=-1,C=-1;for(let ae=0;ae<h.length;ae++)if(h[ae].isVisible())C=ae,N<0&&(N=ae);else if(C>=0)break;const le=h.length-1,re=C-N;return C+re>le?n(4,f=le):n(4,f=C),h[f].scrollIntoView("start"),!0}if(v.key==="PageUp"||v.key==="u"){let N=-1,C=-1;for(let re=0;re<h.length;re++){const ae=h[re];if(ae.isVisible()&&N<0)N=re,C=re;else if(ae.isVisible())C=re;else if(N>=0)break}const le=C-N;return N-le<=0?n(4,f=0):n(4,f=N),h[f].scrollIntoView("end"),!0}if(l&&f>=0&&f<s.length&&v.key==="Enter")return y(i[f]),!0;if(l&&["1","2","3","4","5","6","7","8","9","0"].includes(v.key)){let N=v.key-1;return N===-1&&(N=9),N+1>i.length?!1:(y(i[N]),!0)}return!l&&f>=0&&f<s.length&&(v.key==="ArrowRight"||v.key==="Enter")?(T(i[f]),!0):!1}function y(v){r("itemActivated",{snippet:v})}function T(v){r("itemEdit",{snippet:v})}ai(()=>{h.length!==i.length&&n(6,h.length=i.length,h)});function P(v,N){ve[v?"unshift":"push"](()=>{h[N]=v,n(6,h)})}const k=v=>B(v);function x(v){ve[v?"unshift":"push"](()=>{u=v,n(0,u)})}return e.$$set=v=>{"snippets"in v&&n(13,s=v.snippets),"tabindex"in v&&n(1,o=v.tabindex),"selectMode"in v&&n(2,l=v.selectMode),"autofocus"in v&&n(3,a=v.autofocus),"ref"in v&&n(0,u=v.ref)},e.$$.update=()=>{e.$$.dirty&8192&&n(7,i=d(s))},[u,o,l,a,f,p,h,i,m,b,I,B,E,s,P,k,x]}class vl extends Y{constructor(t){super(),J(this,t,bl,gl,Z,{snippets:13,tabindex:1,selectMode:2,autofocus:3,ref:0})}}function wl(e){let t,n;const i=e[2].default,r=ht(i,e,e[1],null);return{c(){t=L("div"),r&&r.c(),c(t,"class","toolbar svelte-i867mn"),X(t,"bottom",e[0])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&2)&&mt(r,i,s,s[1],n?pt(i,s[1],o,null):dt(s[1]),null),(!n||o&1)&&X(t,"bottom",s[0])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function El(e,t,n){let{$$slots:i={},$$scope:r}=t,{bottom:s=!1}=t;return e.$$set=o=>{"bottom"in o&&n(0,s=o.bottom),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class Rt extends Y{constructor(t){super(),J(this,t,El,wl,Z,{bottom:0})}}function yl(e){let t;return{c(){t=L("div"),c(t,"class","toolbar-spacer svelte-1a67v9")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}class kn extends Y{constructor(t){super(),J(this,t,null,yl,Z,{})}}function Sl(e){let t,n,i=e[6]("no_snippets_found.title")+"",r,s,o,l=e[6]("no_snippets_found.description")+"",a;return{c(){t=L("div"),n=L("p"),r=$(i),s=R(),o=L("p"),a=$(l),c(n,"class","no-snippets-found svelte-y4605t"),c(o,"class","no-snippets-found description dimmed svelte-y4605t"),c(t,"class","centered")},m(u,f){g(u,t,f),A(t,n),A(n,r),A(t,s),A(t,o),A(o,a)},p(u,f){f&64&&i!==(i=u[6]("no_snippets_found.title")+"")&&z(r,i),f&64&&l!==(l=u[6]("no_snippets_found.description")+"")&&z(a,l)},i:G,o:G,d(u){u&&_(t)}}}function kl(e){let t,n,i;function r(o){e[21](o)}let s={snippets:e[7],tabindex:2,selectMode:e[0],autofocus:e[8]};return e[4]!==void 0&&(s.ref=e[4]),t=new vl({props:s}),ve.push(()=>$e(t,"ref",r)),t.$on("itemActivated",e[12]),t.$on("itemEdit",e[13]),{c(){U(t.$$.fragment)},m(o,l){O(t,o,l),i=!0},p(o,l){const a={};l&128&&(a.snippets=o[7]),l&1&&(a.selectMode=o[0]),!n&&l&16&&(n=!0,a.ref=o[4],Ge(()=>n=!1)),t.$set(a)},i(o){i||(w(t.$$.fragment,o),i=!0)},o(o){S(t.$$.fragment,o),i=!1},d(o){M(t,o)}}}function ni(e){let t,n;return t=new Rt({props:{bottom:!0,$$slots:{default:[Al]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&16777280&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Al(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[6]("add_snippet.title")}}),t.$on("activate",e[10]),i=new kn({}),s=new de({props:{iconClass:"dimmed",icon:Ri,size:"2x",title:e[6]("settings.title")}}),s.$on("activate",e[11]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a&64&&(u.title=l[6]("add_snippet.title")),t.$set(u);const f={};a&64&&(f.title=l[6]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function Bl(e){let t,n,i,r,s,o,l,a,u,f,p;function h(y){e[18](y)}function m(y){e[19](y)}function d(y){e[20](y)}let b={search:!0,autofocus:e[1],placeholder:e[6]("search"),searchButtonTitle:e[6]("search"),clearButtonTitle:e[6]("clear"),tabindex:1};e[2]!==void 0&&(b.value=e[2]),e[3]!==void 0&&(b.ref=e[3]),e[5]!==void 0&&(b.focussed=e[5]),n=new Sn({props:b}),ve.push(()=>$e(n,"value",h)),ve.push(()=>$e(n,"ref",m)),ve.push(()=>$e(n,"focussed",d)),n.$on("query",e[9]);const I=[kl,Sl],B=[];function E(y,T){return y[7]?0:1}l=E(e),a=B[l]=I[l](e);let H=!e[0]&&ni(e);return{c(){t=L("div"),U(n.$$.fragment),o=R(),a.c(),u=R(),H&&H.c(),f=ye(),c(t,"class","toolbar top")},m(y,T){g(y,t,T),O(n,t,null),g(y,o,T),B[l].m(y,T),g(y,u,T),H&&H.m(y,T),g(y,f,T),p=!0},p(y,T){const P={};T&2&&(P.autofocus=y[1]),T&64&&(P.placeholder=y[6]("search")),T&64&&(P.searchButtonTitle=y[6]("search")),T&64&&(P.clearButtonTitle=y[6]("clear")),!i&&T&4&&(i=!0,P.value=y[2],Ge(()=>i=!1)),!r&&T&8&&(r=!0,P.ref=y[3],Ge(()=>r=!1)),!s&&T&32&&(s=!0,P.focussed=y[5],Ge(()=>s=!1)),n.$set(P);let k=l;l=E(y),l===k?B[l].p(y,T):(ue(),S(B[k],1,1,()=>{B[k]=null}),fe(),a=B[l],a?a.p(y,T):(a=B[l]=I[l](y),a.c()),w(a,1),a.m(u.parentNode,u)),y[0]?H&&(ue(),S(H,1,1,()=>{H=null}),fe()):H?(H.p(y,T),T&1&&w(H,1)):(H=ni(y),H.c(),w(H,1),H.m(f.parentNode,f))},i(y){p||(w(n.$$.fragment,y),w(a),w(H),p=!0)},o(y){S(n.$$.fragment,y),S(a),S(H),p=!1},d(y){y&&(_(t),_(o),_(u),_(f)),M(n),B[l].d(y),H&&H.d(y)}}}function Tl(e){let t,n;return t=new et({props:{$$slots:{default:[Bl]},$$scope:{ctx:e}}}),t.$on("keyup",e[14]),t.$on("cancel",e[15]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&16777471&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Il(e,t,n){let i,r,s,o;ne(e,we,C=>n(17,i=C)),ne(e,Jt,C=>n(2,r=C)),ne(e,Se,C=>n(6,s=C)),ne(e,Yt,C=>n(7,o=C));let{orderByLastUsed:l=!1}=t,{selectMode:a=!1}=t,{focusSearchBox:u=!0}=t;const f=!u;let p,h,m=u;function d(C){Wi(Jt,r=C.detail,r),Yt.search(r,l)}function b(){je("/snippet/add")}function I(){je("/settings")}function B(C){mr(C.detail.snippet.abbreviation,500)}function E(C){const le=C.detail.snippet.id;je("/snippet/edit/"+le)}function H(C,le,re){Yt.search(C,le)}function y(){m?h.focus():p.focus()}function T(C){C.ctrlKey&&C.key==="n"&&(b(),C.preventDefault()),C.ctrlKey&&C.altKey&&C.key==="s"&&(I(),C.preventDefault()),C.ctrlKey&&C.key==="f"&&(y(),C.preventDefault())}function P(){a&&er()}function k(C){r=C,Jt.set(r)}function x(C){p=C,n(3,p)}function v(C){m=C,n(5,m)}function N(C){h=C,n(4,h)}return e.$$set=C=>{"orderByLastUsed"in C&&n(16,l=C.orderByLastUsed),"selectMode"in C&&n(0,a=C.selectMode),"focusSearchBox"in C&&n(1,u=C.focusSearchBox)},e.$$.update=()=>{e.$$.dirty&196612&&H(r,l)},[a,u,r,p,h,m,s,o,f,d,b,I,B,E,T,P,l,i,k,x,v,N]}class Hl extends Y{constructor(t){super(),J(this,t,Il,Tl,Z,{orderByLastUsed:16,selectMode:0,focusSearchBox:1})}}function ii(e){let t,n,i,r,s,o,l,a;return n=new de({props:{iconClass:"dimmed",icon:Ot,title:e[0]("add_snippet.title"),size:"5x",$$slots:{default:[Cl]},$$scope:{ctx:e}}}),n.$on("activate",e[2]),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,title:e[0]("import_snippets.title"),size:"1.5x",$$slots:{default:[Ll]},$$scope:{ctx:e}}}),s.$on("activate",e[4]),l=new Rt({props:{bottom:!0,$$slots:{default:[Pl]},$$scope:{ctx:e}}}),{c(){t=L("p"),U(n.$$.fragment),i=R(),r=L("p"),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","add-snippet"),c(r,"class","import-snippets")},m(u,f){g(u,t,f),O(n,t,null),g(u,i,f),g(u,r,f),O(s,r,null),g(u,o,f),O(l,u,f),a=!0},p(u,f){const p={};f&1&&(p.title=u[0]("add_snippet.title")),f&33&&(p.$$scope={dirty:f,ctx:u}),n.$set(p);const h={};f&1&&(h.title=u[0]("import_snippets.title")),f&33&&(h.$$scope={dirty:f,ctx:u}),s.$set(h);const m={};f&33&&(m.$$scope={dirty:f,ctx:u}),l.$set(m)},i(u){a||(w(n.$$.fragment,u),w(s.$$.fragment,u),w(l.$$.fragment,u),a=!0)},o(u){S(n.$$.fragment,u),S(s.$$.fragment,u),S(l.$$.fragment,u),a=!1},d(u){u&&(_(t),_(i),_(r),_(o)),M(n),M(s),M(l,u)}}}function Cl(e){let t=e[0]("add_snippet.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("add_snippet.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ll(e){let t=e[0]("import_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("import_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Pl(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[0]("add_snippet.title")}}),t.$on("activate",e[2]),i=new kn({}),s=new de({props:{iconClass:"dimmed",icon:Ri,size:"2x",title:e[0]("settings.title")}}),s.$on("activate",e[3]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a&1&&(u.title=l[0]("add_snippet.title")),t.$set(u);const f={};a&1&&(f.title=l[0]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function Nl(e){let t,n,i,r=e[0]("no_snippets_found.title")+"",s,o,l,a,u=e[1]&&ii(e);return{c(){t=L("h1"),t.textContent="Snippet Pixie",n=R(),i=L("p"),s=$(r),o=R(),u&&u.c(),l=ye(),c(i,"class","dimmed")},m(f,p){g(f,t,p),g(f,n,p),g(f,i,p),A(i,s),g(f,o,p),u&&u.m(f,p),g(f,l,p),a=!0},p(f,p){(!a||p&1)&&r!==(r=f[0]("no_snippets_found.title")+"")&&z(s,r),f[1]?u?(u.p(f,p),p&2&&w(u,1)):(u=ii(f),u.c(),w(u,1),u.m(l.parentNode,l)):u&&(ue(),S(u,1,1,()=>{u=null}),fe())},i(f){a||(w(u),a=!0)},o(f){S(u),a=!1},d(f){f&&(_(t),_(n),_(i),_(o),_(l)),u&&u.d(f)}}}function Ol(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[Nl]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&35&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ml(e,t,n){let i,r;ne(e,Se,a=>n(0,i=a)),ne(e,we,a=>n(1,r=a));function s(){je("/snippet/add")}function o(){je("/settings")}async function l(){try{const a=await mi(!1)}catch(a){await oe(i("import_snippets.error_title"),a)}await Me.fetch()}return[i,r,s,o,l]}class xl extends Y{constructor(t){super(),J(this,t,Ml,Ol,Z,{})}}function Rl(e){let t,n;return t=new xl({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ul(e){let t,n;return t=new Hl({props:{selectMode:e[2],orderByLastUsed:e[3],focusSearchBox:e[4]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.selectMode=i[2]),r&8&&(s.orderByLastUsed=i[3]),r&16&&(s.focusSearchBox=i[4]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Dl(e){let t;return{c(){t=$("Checking settings ...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Gl(e){let t,n,i,r;const s=[Dl,Ul,Rl],o=[];function l(a,u){return a[1]?0:a[0]&&(a[5]&&a[5].length>0||a[2])?1:2}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function $l(e,t,n){let i,r,s;ne(e,Se,p=>n(6,i=p)),ne(e,we,p=>n(0,r=p)),ne(e,Me,p=>n(5,s=p));let o=!0,l=!1,a=!1,u=!0;function f(p){Me.fetch()}return Je(async()=>{if(n(2,l=await vr()),n(3,a=l),l&&r)try{const p=await hi("FOCUS_SEARCH_BOX");n(4,u=p!=="false")}catch(p){await oe(i("settings.get_error_title"),p)}n(1,o=!1)}),e.$$.update=()=>{e.$$.dirty&1&&f()},[r,o,l,a,u,s]}class jl extends Y{constructor(t){super(),J(this,t,$l,Gl,Z,{})}}function Fl(e){let t=e[4]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function zl(e){let t=e[4]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function Vl(e){let t,n=e[4]("add_snippet.title")+"",i,r,s,o,l,a,u=e[4]("body.title")+"",f,p,h,m,d,b,I,B,E,H,y;function T(k){e[8](k)}let P={label:e[4]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(P.value=e[0]),s=new Sn({props:P}),ve.push(()=>$e(s,"value",T)),b=new Fe({props:{secondary:!0,$$slots:{default:[Fl]},$$scope:{ctx:e}}}),b.$on("click",e[5]),B=new Fe({props:{primary:!0,disabled:e[3],$$slots:{default:[zl]},$$scope:{ctx:e}}}),B.$on("click",e[6]),{c(){t=L("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),a=L("label"),f=$(u),p=R(),h=L("textarea"),m=R(),d=L("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),c(t,"class","svelte-126nfs4"),c(a,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(k,x){g(k,t,x),A(t,i),g(k,r,x),O(s,k,x),g(k,l,x),g(k,a,x),A(a,f),g(k,p,x),g(k,h,x),ze(h,e[2]),g(k,m,x),g(k,d,x),O(b,d,null),A(d,I),O(B,d,null),E=!0,H||(y=te(h,"input",e[9]),H=!0)},p(k,x){(!E||x&16)&&n!==(n=k[4]("add_snippet.title")+"")&&z(i,n);const v={};x&16&&(v.label=k[4]("abbreviation.title")),x&2&&(v.errorMessage=k[1]),!o&&x&1&&(o=!0,v.value=k[0],Ge(()=>o=!1)),s.$set(v),(!E||x&16)&&u!==(u=k[4]("body.title")+"")&&z(f,u),x&4&&ze(h,k[2]);const N={};x&2064&&(N.$$scope={dirty:x,ctx:k}),b.$set(N);const C={};x&8&&(C.disabled=k[3]),x&2064&&(C.$$scope={dirty:x,ctx:k}),B.$set(C)},i(k){E||(w(s.$$.fragment,k),w(b.$$.fragment,k),w(B.$$.fragment,k),E=!0)},o(k){S(s.$$.fragment,k),S(b.$$.fragment,k),S(B.$$.fragment,k),E=!1},d(k){k&&(_(t),_(r),_(l),_(a),_(p),_(h),_(m),_(d)),M(s,k),M(b),M(B),H=!1,y()}}}function Wl(e){let t,n;return t=new et({props:{$$slots:{default:[Vl]},$$scope:{ctx:e}}}),t.$on("cancel",e[5]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&2079&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Xl(e,t,n){let i,r,s;ne(e,Se,d=>n(4,r=d)),ne(e,we,d=>n(7,s=d));let o="",l="";async function a(d){if(d.length===0){n(1,u=r("abbreviation.empty"));return}if(!s){n(1,u="");return}try{const b=await pi(d);if(b.hasOwnProperty("abbreviation")&&b.abbreviation.length>0){n(1,u=r("abbreviation.exists"));return}}catch(b){await oe(r("add_snippet.error_title"),b)}n(1,u="")}let u="";function f(){Be()}async function p(){try{const d=await tr(o,l);await Be()}catch(d){await oe(r("add_snippet.error_title"),d)}}function h(d){o=d,n(0,o)}function m(){l=this.value,n(2,l)}return e.$$.update=()=>{e.$$.dirty&1&&a(o),e.$$.dirty&130&&n(3,i=!s||u.length>0)},[o,u,l,i,r,f,p,s,h,m]}class ql extends Y{constructor(t){super(),J(this,t,Xl,Wl,Z,{})}}function Zl(e){let t=e[5]("button.remove")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.remove")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ql(e){let t=e[5]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function Jl(e){let t=e[5]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function Yl(e){let t,n=e[5]("edit_snippet.title")+"",i,r,s,o,l,a,u=e[5]("body.title")+"",f,p,h,m,d,b,I,B,E,H,y,T,P;function k(v){e[11](v)}let x={label:e[5]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(x.value=e[0]),s=new Sn({props:x}),ve.push(()=>$e(s,"value",k)),b=new Fe({props:{danger:!0,disabled:e[3],$$slots:{default:[Zl]},$$scope:{ctx:e}}}),b.$on("click",e[7]),B=new Fe({props:{secondary:!0,$$slots:{default:[Ql]},$$scope:{ctx:e}}}),B.$on("click",e[6]),H=new Fe({props:{primary:!0,disabled:e[4],$$slots:{default:[Jl]},$$scope:{ctx:e}}}),H.$on("click",e[8]),{c(){t=L("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),a=L("label"),f=$(u),p=R(),h=L("textarea"),m=R(),d=L("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),E=R(),U(H.$$.fragment),c(t,"class","svelte-126nfs4"),c(a,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(v,N){g(v,t,N),A(t,i),g(v,r,N),O(s,v,N),g(v,l,N),g(v,a,N),A(a,f),g(v,p,N),g(v,h,N),ze(h,e[2]),g(v,m,N),g(v,d,N),O(b,d,null),A(d,I),O(B,d,null),A(d,E),O(H,d,null),y=!0,T||(P=te(h,"input",e[12]),T=!0)},p(v,N){(!y||N&32)&&n!==(n=v[5]("edit_snippet.title")+"")&&z(i,n);const C={};N&32&&(C.label=v[5]("abbreviation.title")),N&2&&(C.errorMessage=v[1]),!o&&N&1&&(o=!0,C.value=v[0],Ge(()=>o=!1)),s.$set(C),(!y||N&32)&&u!==(u=v[5]("body.title")+"")&&z(f,u),N&4&&ze(h,v[2]);const le={};N&8&&(le.disabled=v[3]),N&32800&&(le.$$scope={dirty:N,ctx:v}),b.$set(le);const re={};N&32800&&(re.$$scope={dirty:N,ctx:v}),B.$set(re);const ae={};N&16&&(ae.disabled=v[4]),N&32800&&(ae.$$scope={dirty:N,ctx:v}),H.$set(ae)},i(v){y||(w(s.$$.fragment,v),w(b.$$.fragment,v),w(B.$$.fragment,v),w(H.$$.fragment,v),y=!0)},o(v){S(s.$$.fragment,v),S(b.$$.fragment,v),S(B.$$.fragment,v),S(H.$$.fragment,v),y=!1},d(v){v&&(_(t),_(r),_(l),_(a),_(p),_(h),_(m),_(d)),M(s,v),M(b),M(B),M(H),T=!1,P()}}}function Kl(e){let t,n;return t=new et({props:{$$slots:{default:[Yl]},$$scope:{ctx:e}}}),t.$on("cancel",e[6]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&32831&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ea(e,t,n){let i,r,s,o;ne(e,Se,E=>n(5,s=E)),ne(e,we,E=>n(10,o=E));let{params:l={}}=t,a={},u="",f="";async function p(E){if(n(1,h=""),!!a.hasOwnProperty("id")){if(E.length===0){n(1,h=s("abbreviation.empty"));return}if(o)try{const H=await pi(E);H.hasOwnProperty("abbreviation")&&H.abbreviation.length>0&&H.id!==a.id&&n(1,h=s("abbreviation.exists"))}catch(H){await oe(s("edit_snippet.error_title"),H)}}}let h="";function m(){Be()}async function d(){try{await _r(a.abbreviation),await Be()}catch(E){await oe(s("remove_snippet.error_title"),E)}}async function b(){let E={...a};E.abbreviation=u,E.body=f;try{await Sr(a.id,E),await Be()}catch(H){await oe(s("edit_snippet.error_title"),H)}}Je(async()=>{l.hasOwnProperty("id")||(await oe(s("edit_snippet.error_title"),s("edit_snippet.id_not_supplied")),await Be());try{a=await fr(l.id)}catch(H){await oe(s("edit_snippet.error_title"),H),await Be()}let E=!1;try{E=await pr(a.id)}catch(H){await oe(s("edit_snippet.error_title"),H),await Be()}E&&(await oe(s("edit_snippet.error_title"),s("edit_snippet.snippet_not_found")),await Be()),n(0,u=a.abbreviation),n(2,f=a.body)});function I(E){u=E,n(0,u)}function B(){f=this.value,n(2,f)}return e.$$set=E=>{"params"in E&&n(9,l=E.params)},e.$$.update=()=>{e.$$.dirty&1&&p(u),e.$$.dirty&1026&&n(4,i=!o||h.length>0),e.$$.dirty&1024&&n(3,r=!o)},[u,h,f,r,i,s,m,d,b,l,o,I,B]}class ta extends Y{constructor(t){super(),J(this,t,ea,Kl,Z,{params:9})}}function na(e){let t,n,i,r,s,o;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:xi,size:"2.5x",title:e[6]("button.back")}}),t.$on("activate",e[8]),i=new kn({}),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:wo,size:"2.5x",title:e[6]("button.about")}}),s.$on("activate",e[9]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a[0]&64&&(u.title=l[6]("button.back")),t.$set(u);const f={};a[0]&64&&(f.title=l[6]("button.about")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function ia(e){let t,n=e[6]("settings.custom_shortcuts_disabled")+"",i;return{c(){t=L("p"),i=$(n),c(t,"class","dimmed svelte-1fggvh7")},m(r,s){g(r,t,s),A(t,i)},p(r,s){s[0]&64&&n!==(n=r[6]("settings.custom_shortcuts_disabled")+"")&&z(i,n)},i:G,o:G,d(r){r&&_(t)}}}function ra(e){let t,n,i,r;const s=[oa,sa],o=[];function l(a,u){return a[5].length>0?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,u){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function sa(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,a;return s=new xt({props:{shortcut:e[6]("settings.custom_shortcut_empty")}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Ot,size:"2.0x",title:e[6]("settings.add_default_custom_shortcut")}}),l.$on("activate",e[22]),{c(){t=L("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","row svelte-1fggvh7")},m(u,f){g(u,t,f),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),a=!0},p(u,f){(!a||f[0]&64)&&n!==(n=u[6]("settings.custom_shortcut")+"")&&z(i,n);const p={};f[0]&64&&(p.shortcut=u[6]("settings.custom_shortcut_empty")),s.$set(p);const h={};f[0]&64&&(h.title=u[6]("settings.add_default_custom_shortcut")),l.$set(h)},i(u){a||(w(s.$$.fragment,u),w(l.$$.fragment,u),a=!0)},o(u){S(s.$$.fragment,u),S(l.$$.fragment,u),a=!1},d(u){u&&_(t),M(s),M(l)}}}function oa(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,a,u,f=e[6]("settings.change_custom_shortcut_desc")+"",p,h;return s=new xt({props:{shortcut:e[5]}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Co,size:"1.75x",title:e[6]("settings.remove_custom_shortcut")}}),l.$on("activate",e[21]),{c(){t=L("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),a=R(),u=L("p"),p=$(f),c(t,"class","row svelte-1fggvh7"),c(u,"class","dimmed svelte-1fggvh7")},m(m,d){g(m,t,d),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),g(m,a,d),g(m,u,d),A(u,p),h=!0},p(m,d){(!h||d[0]&64)&&n!==(n=m[6]("settings.custom_shortcut")+"")&&z(i,n);const b={};d[0]&32&&(b.shortcut=m[5]),s.$set(b);const I={};d[0]&64&&(I.title=m[6]("settings.remove_custom_shortcut")),l.$set(I),(!h||d[0]&64)&&f!==(f=m[6]("settings.change_custom_shortcut_desc")+"")&&z(p,f)},i(m){h||(w(s.$$.fragment,m),w(l.$$.fragment,m),h=!0)},o(m){S(s.$$.fragment,m),S(l.$$.fragment,m),h=!1},d(m){m&&(_(t),_(a),_(u)),M(s),M(l)}}}function la(e){let t=e[6]("settings.no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("settings.no_connection")+"")&&z(n,t)},i:G,o:G,d(i){i&&_(n)}}}function aa(e){let t,n=e[6]("settings.import_export_title")+"",i,r,s,o,l,a,u,f,p;o=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.new_only_title"),$$slots:{default:[ua]},$$scope:{ctx:e}}}),o.$on("activate",e[25]),a=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.update_title"),$$slots:{default:[fa]},$$scope:{ctx:e}}}),a.$on("activate",e[26]);let h=e[7]&&e[7].length>0&&ri(e);return{c(){t=L("h3"),i=$(n),r=R(),s=L("p"),U(o.$$.fragment),l=R(),U(a.$$.fragment),u=R(),h&&h.c(),f=ye(),c(t,"class","svelte-1fggvh7"),c(s,"class","import-snippets svelte-1fggvh7")},m(m,d){g(m,t,d),A(t,i),g(m,r,d),g(m,s,d),O(o,s,null),A(s,l),O(a,s,null),g(m,u,d),h&&h.m(m,d),g(m,f,d),p=!0},p(m,d){(!p||d[0]&64)&&n!==(n=m[6]("settings.import_export_title")+"")&&z(i,n);const b={};d[0]&64&&(b.title=m[6]("import_snippets.new_only_title")),d[0]&64|d[1]&4&&(b.$$scope={dirty:d,ctx:m}),o.$set(b);const I={};d[0]&64&&(I.title=m[6]("import_snippets.update_title")),d[0]&64|d[1]&4&&(I.$$scope={dirty:d,ctx:m}),a.$set(I),m[7]&&m[7].length>0?h?(h.p(m,d),d[0]&128&&w(h,1)):(h=ri(m),h.c(),w(h,1),h.m(f.parentNode,f)):h&&(ue(),S(h,1,1,()=>{h=null}),fe())},i(m){p||(w(o.$$.fragment,m),w(a.$$.fragment,m),w(h),p=!0)},o(m){S(o.$$.fragment,m),S(a.$$.fragment,m),S(h),p=!1},d(m){m&&(_(t),_(r),_(s),_(u),_(f)),M(o),M(a),h&&h.d(m)}}}function ua(e){let t=e[6]("import_snippets.new_only_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.new_only_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function fa(e){let t=e[6]("import_snippets.update_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.update_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function ri(e){let t,n,i;return n=new de({props:{horizontal:!0,iconClass:"dimmed",icon:fo,size:"1.5x",title:e[6]("export_snippets.title"),$$slots:{default:[ca]},$$scope:{ctx:e}}}),n.$on("activate",e[16]),{c(){t=L("p"),U(n.$$.fragment),c(t,"class","export-snippets svelte-1fggvh7")},m(r,s){g(r,t,s),O(n,t,null),i=!0},p(r,s){const o={};s[0]&64&&(o.title=r[6]("export_snippets.title")),s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),n.$set(o)},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function ca(e){let t=e[6]("export_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("export_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function ha(e){let t,n,i,r=e[6]("settings.title")+"",s,o,l,a=e[6]("settings.autostart_title")+"",u,f,p,h,m,d,b=e[6]("settings.autostart")+"",I,B,E,H=e[6]("settings.autoexpand_title")+"",y,T,P,k,x,v,N=e[6]("settings.autoexpand")+"",C,le,re,ae=e[6]("settings.search_and_paste_title")+"",_e,ge,ce,pe,he,j,ie,F,K,Ne=e[6]("settings.focus_search")+"",Ut,Dt,be,ke,tt,Ae,Gt,An;t=new Rt({props:{$$slots:{default:[na]},$$scope:{ctx:e}}});const Bn=[ra,ia],Ie=[];function Tn(D,W){return D[4]?0:1}ce=Tn(e),pe=Ie[ce]=Bn[ce](e);const In=[aa,la],He=[];function Hn(D,W){return D[0]?0:1}return be=Hn(e),ke=He[be]=In[be](e),{c(){U(t.$$.fragment),n=R(),i=L("h2"),s=$(r),o=R(),l=L("h3"),u=$(a),f=R(),p=L("p"),h=L("label"),m=L("input"),d=R(),I=$(b),B=R(),E=L("h3"),y=$(H),T=R(),P=L("p"),k=L("label"),x=L("input"),v=R(),C=$(N),le=R(),re=L("h3"),_e=$(ae),ge=R(),pe.c(),he=R(),j=L("p"),ie=L("label"),F=L("input"),K=R(),Ut=$(Ne),Dt=R(),ke.c(),tt=ye(),c(i,"class","svelte-1fggvh7"),c(l,"class","svelte-1fggvh7"),c(m,"type","checkbox"),c(p,"class","svelte-1fggvh7"),c(E,"class","svelte-1fggvh7"),c(x,"type","checkbox"),c(P,"class","svelte-1fggvh7"),c(re,"class","svelte-1fggvh7"),c(F,"type","checkbox"),c(j,"class","svelte-1fggvh7")},m(D,W){O(t,D,W),g(D,n,W),g(D,i,W),A(i,s),g(D,o,W),g(D,l,W),A(l,u),g(D,f,W),g(D,p,W),A(p,h),A(h,m),m.checked=e[1],A(h,d),A(h,I),g(D,B,W),g(D,E,W),A(E,y),g(D,T,W),g(D,P,W),A(P,k),A(k,x),x.checked=e[2],A(k,v),A(k,C),g(D,le,W),g(D,re,W),A(re,_e),g(D,ge,W),Ie[ce].m(D,W),g(D,he,W),g(D,j,W),A(j,ie),A(ie,F),F.checked=e[3],A(ie,K),A(ie,Ut),g(D,Dt,W),He[be].m(D,W),g(D,tt,W),Ae=!0,Gt||(An=[te(m,"change",e[17]),te(m,"change",e[18]),dn(Ui.call(null,m,!0)),te(x,"change",e[19]),te(x,"change",e[20]),te(F,"change",e[23]),te(F,"change",e[24])],Gt=!0)},p(D,W){const Cn={};W[0]&64|W[1]&4&&(Cn.$$scope={dirty:W,ctx:D}),t.$set(Cn),(!Ae||W[0]&64)&&r!==(r=D[6]("settings.title")+"")&&z(s,r),(!Ae||W[0]&64)&&a!==(a=D[6]("settings.autostart_title")+"")&&z(u,a),W[0]&2&&(m.checked=D[1]),(!Ae||W[0]&64)&&b!==(b=D[6]("settings.autostart")+"")&&z(I,b),(!Ae||W[0]&64)&&H!==(H=D[6]("settings.autoexpand_title")+"")&&z(y,H),W[0]&4&&(x.checked=D[2]),(!Ae||W[0]&64)&&N!==(N=D[6]("settings.autoexpand")+"")&&z(C,N),(!Ae||W[0]&64)&&ae!==(ae=D[6]("settings.search_and_paste_title")+"")&&z(_e,ae);let $t=ce;ce=Tn(D),ce===$t?Ie[ce].p(D,W):(ue(),S(Ie[$t],1,1,()=>{Ie[$t]=null}),fe(),pe=Ie[ce],pe?pe.p(D,W):(pe=Ie[ce]=Bn[ce](D),pe.c()),w(pe,1),pe.m(he.parentNode,he)),W[0]&8&&(F.checked=D[3]),(!Ae||W[0]&64)&&Ne!==(Ne=D[6]("settings.focus_search")+"")&&z(Ut,Ne);let jt=be;be=Hn(D),be===jt?He[be].p(D,W):(ue(),S(He[jt],1,1,()=>{He[jt]=null}),fe(),ke=He[be],ke?ke.p(D,W):(ke=He[be]=In[be](D),ke.c()),w(ke,1),ke.m(tt.parentNode,tt))},i(D){Ae||(w(t.$$.fragment,D),w(pe),w(ke),Ae=!0)},o(D){S(t.$$.fragment,D),S(pe),S(ke),Ae=!1},d(D){D&&(_(n),_(i),_(o),_(l),_(f),_(p),_(B),_(E),_(T),_(P),_(le),_(re),_(ge),_(he),_(j),_(Dt),_(tt)),M(t,D),Ie[ce].d(D),He[be].d(D),Gt=!1,Ee(An)}}}function pa(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[ha]},$$scope:{ctx:e}}}),t.$on("cancel",e[8]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r[0]&255|r[1]&4&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}const ma="Snippet Pixie Search & Paste pop-up window",Kt="snippetpixiegui --search-and-paste",si="<Ctrl>grave";function da(e,t,n){let i,r,s;ne(e,Se,j=>n(6,i=j)),ne(e,we,j=>n(0,r=j)),ne(e,Me,j=>n(7,s=j));let o=!1,l=!1,a=!0,u=!1,f=si;function p(){Be()}function h(){je("/about")}async function m(){let j=!1;try{j=await ar()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function d(j){try{await yr(j)}catch(ie){await oe(i("settings.save_error_title"),ie);return}return j}async function b(){let j=!1;try{j=await lr()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function I(j){try{await Er(j)}catch(ie){await oe(i("settings.save_error_title"),ie);return}return j}async function B(){let j="";try{j=await hi("FOCUS_SEARCH_BOX")}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j!=="false"}async function E(){let j=!1;try{j=await nr()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function H(){try{n(5,f=await ur(Kt))}catch(j){await oe(i("settings.get_error_title"),j);return}}async function y(){try{await gr(ma,si,Kt,"")}catch(j){await oe(i("settings.save_error_title"),j)}await H()}async function T(){try{await rr(Kt,f)}catch(j){await oe(i("settings.delete_error_title"),j)}await H()}async function P(j){const ie=j?"true":"false";try{await br("FOCUS_SEARCH_BOX",ie)}catch(F){await oe(i("settings.save_error_title"),F);return}return j}function k(j){Me.fetch()}async function x(j){try{const ie=await mi(j)}catch(ie){await oe(i("import_snippets.error_title"),ie)}await Me.fetch()}async function v(){try{const j=await sr()}catch(j){await oe(i("export_snippets.error_title"),j)}}Je(async()=>{n(1,o=await m()),n(2,l=await b()),n(3,a=await B()),n(4,u=await E()),u&&await H()});function N(){o=this.checked,n(1,o)}const C=()=>d(o);function le(){l=this.checked,n(2,l)}const re=()=>I(l),ae=()=>T(),_e=()=>y();function ge(){a=this.checked,n(3,a)}const ce=()=>P(a),pe=()=>x(!1),he=()=>x(!0);return e.$$.update=()=>{e.$$.dirty[0]&1&&k()},[r,o,l,a,u,f,i,s,p,h,d,I,y,T,P,x,v,N,C,le,re,ae,_e,ge,ce,pe,he]}class _a extends Y{constructor(t){super(),J(this,t,da,pa,Z,{},null,[-1,-1])}}const ga="/assets/snippetpixie-icon-128-1d7040bc.svg";function ba(e){let t,n;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:xi,size:"2.5x",title:e[3]("button.back")}}),t.$on("activate",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.title=i[3]("button.back")),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function va(e){let t,n,i,r,s,o,l,a,u,f=e[3]("about.description")+"",p,h,m,d,b,I,B,E,H,y,T=e[3]("about.by")+"",P,k,x,v,N,C,le=e[3]("about.licence_title")+"",re,ae,_e,ge,ce=e[3]("about.licence")+"",pe,he,j,ie;return t=new Rt({props:{$$slots:{default:[ba]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment),n=R(),i=L("img"),s=R(),o=L("h2"),o.textContent="Snippet Pixie",l=R(),a=L("p"),u=L("em"),p=$(f),h=R(),m=L("p"),d=L("a"),b=$(e[2]),I=R(),B=L("p"),E=L("a"),E.textContent="snippetpixie.org",H=R(),y=L("h3"),P=$(T),k=R(),x=L("p"),v=L("a"),v.textContent="ianmjones",N=R(),C=L("h3"),re=$(le),ae=R(),_e=L("p"),ge=L("a"),pe=$(ce),zi(i.src,r=ga)||c(i,"src",r),c(i,"alt","Snippet Pixie icon"),c(o,"class","svelte-sjm2tb"),c(a,"class","svelte-sjm2tb"),c(d,"href",e[0]),c(m,"class","svelte-sjm2tb"),c(E,"href","https://snippetpixie.org"),c(B,"class","svelte-sjm2tb"),c(y,"class","svelte-sjm2tb"),c(v,"href","https://ianmjones.com"),c(x,"class","svelte-sjm2tb"),c(C,"class","svelte-sjm2tb"),c(ge,"href",e[1]),c(_e,"class","svelte-sjm2tb")},m(F,K){O(t,F,K),g(F,n,K),g(F,i,K),g(F,s,K),g(F,o,K),g(F,l,K),g(F,a,K),A(a,u),A(u,p),g(F,h,K),g(F,m,K),A(m,d),A(d,b),g(F,I,K),g(F,B,K),A(B,E),g(F,H,K),g(F,y,K),A(y,P),g(F,k,K),g(F,x,K),A(x,v),g(F,N,K),g(F,C,K),A(C,re),g(F,ae,K),g(F,_e,K),A(_e,ge),A(ge,pe),he=!0,j||(ie=[te(d,"click",vt(e[6])),te(E,"click",vt(e[7])),te(v,"click",vt(e[8])),te(ge,"click",vt(e[9]))],j=!0)},p(F,K){const Ne={};K&1032&&(Ne.$$scope={dirty:K,ctx:F}),t.$set(Ne),(!he||K&8)&&f!==(f=F[3]("about.description")+"")&&z(p,f),(!he||K&4)&&z(b,F[2]),(!he||K&1)&&c(d,"href",F[0]),(!he||K&8)&&T!==(T=F[3]("about.by")+"")&&z(P,T),(!he||K&8)&&le!==(le=F[3]("about.licence_title")+"")&&z(re,le),(!he||K&8)&&ce!==(ce=F[3]("about.licence")+"")&&z(pe,ce),(!he||K&2)&&c(ge,"href",F[1])},i(F){he||(w(t.$$.fragment,F),he=!0)},o(F){S(t.$$.fragment,F),he=!1},d(F){F&&(_(n),_(i),_(s),_(o),_(l),_(a),_(h),_(m),_(I),_(B),_(H),_(y),_(k),_(x),_(N),_(C),_(ae),_(_e)),M(t,F),j=!1,Ee(ie)}}}function wa(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[va]},$$scope:{ctx:e}}}),t.$on("cancel",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&1039&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ea(e,t,n){let i,r,s,o;ne(e,Se,m=>n(3,o=m));function l(){Be()}let a="";Je(async()=>{n(5,a=await hr())});const u=()=>wt(r),f=()=>wt("https://snippetpixie.org"),p=()=>wt("https://ianmjones.com"),h=()=>wt(s);return e.$$.update=()=>{e.$$.dirty&32&&n(2,i="v"+a),e.$$.dirty&32&&n(0,r="https://git.sr.ht/~ianmjones/snippetpixie/tree/"+a),e.$$.dirty&1&&n(1,s=r+"/item/LICENSE")},[r,s,i,o,l,a,u,f,p,h]}class ya extends Y{constructor(t){super(),J(this,t,Ea,wa,Z,{})}}function Sa(e){let t,n;return t=new no({props:{routes:e[1]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ka(e){let t;return{c(){t=$("Loading...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Aa(e){let t,n,i,r;const s=[ka,Sa],o=[];function l(a,u){return a[0]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function Ba(e,t,n){let i;ne(e,kt,a=>n(0,i=a));let r;async function s(){try{const a=await dr("Pong");a==="Pong"?we.update(u=>!0):(we.update(u=>!1),Vt("Got '"+a+"' back from Ping instead of 'Pong'.")),rt.update(u=>!0),Ht.update(u=>!1)}catch(a){we.update(u=>!1),Vt("Ping returned: "+a),o()}}async function o(){try{await ir()?rt.update(u=>!0):rt.update(u=>!1)}catch(a){rt.update(u=>!1),Vt("DaemonInstalled returned: "+a)}}Os("en-GB",()=>Fi(()=>import("./en-GB-d3e97a3e.js"),[])),xs({fallbackLocale:"en-GB",initialLocale:Rs()});const l={"/":jl,"/snippet/add":ql,"/snippet/edit/:id":ta,"/settings":_a,"/about":ya};return Je(async()=>{await s(),r=setInterval(s,5e3)}),_n(()=>{clearInterval(r)}),[i,l]}class Ta extends Y{constructor(t){super(),J(this,t,Ba,Aa,Z,{})}}new Ta({target:document.getElementById("app")});
Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const it={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Ze(){return it}function xs(e){const{formats:t,...n}=e,i=e.initialLocale||e.fallbackLocale;return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=Ms:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(it,n,{initialLocale:i}),t&&("number"in t&&Object.assign(it.formats.number,t.number),"date"in t&&Object.assign(it.formats.date,t.date),"time"in t&&Object.assign(it.formats.time,t.time)),Ke.set(i)}const kt=Te(!1);let cn;const At=Te(null);function zn(e){return e.split("-").map((t,n,i)=>i.slice(0,n+1).join("-")).reverse()}function gt(e,t=Ze().fallbackLocale){const n=zn(e);return t?[...new Set([...n,...zn(t)])]:n}function Ne(){return cn??void 0}At.subscribe(e=>{cn=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Ke={...At,set:e=>{if(e&&function(t){if(t==null)return;const n=gt(t);for(let i=0;i<n.length;i++){const r=n[i];if(En(r))return r}}(e)&&It(e)){const{loadingDelay:t}=Ze();let n;return typeof window<"u"&&Ne()!=null&&t?n=window.setTimeout(()=>kt.set(!0),t):kt.set(!0),Oi(e).then(()=>{At.set(e)}).finally(()=>{clearTimeout(n),kt.set(!1)})}return At.set(e)}},Rs=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],Pt=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}},ct=(e,t)=>{const{formats:n}=Ze();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Us=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=ct("number",t)),new Intl.NumberFormat(e,n)}),Ds=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=ct("date",t):Object.keys(n).length===0&&(n=ct("date","short")),new Intl.DateTimeFormat(e,n)}),Gs=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=ct("time",t):Object.keys(n).length===0&&(n=ct("time","short")),new Intl.DateTimeFormat(e,n)}),$s=({locale:e=Ne(),...t}={})=>Us({locale:e,...t}),js=({locale:e=Ne(),...t}={})=>Ds({locale:e,...t}),Fs=({locale:e=Ne(),...t}={})=>Gs({locale:e,...t}),zs=Pt((e,t=Ne())=>new Hs(e,t,Ze().formats,{ignoreTag:Ze().ignoreTag})),Vs=(e,t={})=>{var n,i,r,s;let o=t;typeof e=="object"&&(o=e,e=o.id);const{values:l,locale:a=Ne(),default:u}=o;if(a==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=Pi(e,a);if(f){if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f}else f=(s=(r=(i=(n=Ze()).handleMissingMessage)===null||i===void 0?void 0:i.call(n,{locale:a,id:e,defaultValue:u}))!==null&&r!==void 0?r:u)!==null&&s!==void 0?s:e;if(!l)return f;let p=f;try{p=zs(f,a).format(l)}catch(h){h instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,h.message)}return p},Ws=(e,t)=>Fs(t).format(e),Xs=(e,t)=>js(t).format(e),qs=(e,t)=>$s(t).format(e),Zs=(e,t=Ne())=>Pi(e,t),Se=Le([Ke,Ye],()=>Vs);Le([Ke],()=>Ws);Le([Ke],()=>Xs);Le([Ke],()=>qs);Le([Ke,Ye],()=>Zs);function Qs(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,i,r,s,o=[],l="",a=e.split("/");for(a[0]||a.shift();r=a.shift();)n=r[0],n==="*"?(o.push("wild"),l+="/(.*)"):n===":"?(i=r.indexOf("?",1),s=r.indexOf(".",1),o.push(r.substring(1,~i?i:~s?s:r.length)),l+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(l+=(~i?"?":"")+"\\"+r.substring(s))):l+="/"+r;return{keys:o,pattern:new RegExp("^"+l+(t?"(?=$|/)":"/?$"),"i")}}function Js(e){let t,n,i;const r=[e[2]];var s=e[0];function o(l,a){let u={};if(a!==void 0&&a&4)u=Bt(r,[Tt(l[2])]);else for(let f=0;f<r.length;f+=1)u=pn(u,r[f]);return{props:u}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[7])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,a){t&&O(t,l,a),g(l,n,a),i=!0},p(l,a){if(a&1&&s!==(s=l[0])){if(t){ue();const u=t;S(u.$$.fragment,1,0,()=>{M(u,1)}),fe()}s?(t=Ve(s,o(l,a)),t.$on("routeEvent",l[7]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const u=a&4?Bt(r,[Tt(l[2])]):{};t.$set(u)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function Ys(e){let t,n,i;const r=[{params:e[1]},e[2]];var s=e[0];function o(l,a){let u={};if(a!==void 0&&a&6)u=Bt(r,[a&2&&{params:l[1]},a&4&&Tt(l[2])]);else for(let f=0;f<r.length;f+=1)u=pn(u,r[f]);return{props:u}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[6])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,a){t&&O(t,l,a),g(l,n,a),i=!0},p(l,a){if(a&1&&s!==(s=l[0])){if(t){ue();const u=t;S(u.$$.fragment,1,0,()=>{M(u,1)}),fe()}s?(t=Ve(s,o(l,a)),t.$on("routeEvent",l[6]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const u=a&6?Bt(r,[a&2&&{params:l[1]},a&4&&Tt(l[2])]):{};t.$set(u)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function Ks(e){let t,n,i,r;const s=[Ys,Js],o=[];function l(a,u){return a[1]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function Vn(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let i="";return n>-1&&(i=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:i}}const yn=di(null,function(t){t(Vn());const n=()=>{t(Vn())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}});Le(yn,e=>e.location);Le(yn,e=>e.querystring);const Wn=Te(void 0);async function je(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await gn(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}async function Be(){await gn(),window.history.back()}function eo(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function to(e,t,n){let{routes:i={}}=t,{prefix:r=""}=t,{restoreScrollState:s=!1}=t;class o{constructor(T,N){if(!N||typeof N!="function"&&(typeof N!="object"||N._sveltesparouter!==!0))throw Error("Invalid component object");if(!T||typeof T=="string"&&(T.length<1||T.charAt(0)!="/"&&T.charAt(0)!="*")||typeof T=="object"&&!(T instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:k,keys:x}=Qs(T);this.path=T,typeof N=="object"&&N._sveltesparouter===!0?(this.component=N.component,this.conditions=N.conditions||[],this.userData=N.userData,this.props=N.props||{}):(this.component=()=>Promise.resolve(N),this.conditions=[],this.props={}),this._pattern=k,this._keys=x}match(T){if(r){if(typeof r=="string")if(T.startsWith(r))T=T.substr(r.length)||"/";else return null;else if(r instanceof RegExp){const v=T.match(r);if(v&&v[0])T=T.substr(v[0].length)||"/";else return null}}const N=this._pattern.exec(T);if(N===null)return null;if(this._keys===!1)return N;const k={};let x=0;for(;x<this._keys.length;){try{k[this._keys[x]]=decodeURIComponent(N[x+1]||"")||null}catch{k[this._keys[x]]=null}x++}return k}async checkConditions(T){for(let N=0;N<this.conditions.length;N++)if(!await this.conditions[N](T))return!1;return!0}}const l=[];i instanceof Map?i.forEach((y,T)=>{l.push(new o(T,y))}):Object.keys(i).forEach(y=>{l.push(new o(y,i[y]))});let a=null,u=null,f={};const p=_t();async function h(y,T){await gn(),p(y,T)}let m=null,d=null;s&&(d=y=>{y.state&&(y.state.__svelte_spa_router_scrollY||y.state.__svelte_spa_router_scrollX)?m=y.state:m=null},window.addEventListener("popstate",d),ai(()=>{eo(m)}));let b=null,I=null;const B=yn.subscribe(async y=>{b=y;let T=0;for(;T<l.length;){const N=l[T].match(y.location);if(!N){T++;continue}const k={route:l[T].path,location:y.location,querystring:y.querystring,userData:l[T].userData,params:N&&typeof N=="object"&&Object.keys(N).length?N:null};if(!await l[T].checkConditions(k)){n(0,a=null),I=null,h("conditionsFailed",k);return}h("routeLoading",Object.assign({},k));const x=l[T].component;if(I!=x){x.loading?(n(0,a=x.loading),I=x,n(1,u=x.loadingParams),n(2,f={}),h("routeLoaded",Object.assign({},k,{component:a,name:a.name,params:u}))):(n(0,a=null),I=null);const v=await x();if(y!=b)return;n(0,a=v&&v.default||v),I=x}N&&typeof N=="object"&&Object.keys(N).length?n(1,u=N):n(1,u=null),n(2,f=l[T].props),h("routeLoaded",Object.assign({},k,{component:a,name:a.name,params:u})).then(()=>{Wn.set(u)});return}n(0,a=null),I=null,Wn.set(void 0)});_n(()=>{B(),d&&window.removeEventListener("popstate",d)});function E(y){ut.call(this,e,y)}function H(y){ut.call(this,e,y)}return e.$$set=y=>{"routes"in y&&n(3,i=y.routes),"prefix"in y&&n(4,r=y.prefix),"restoreScrollState"in y&&n(5,s=y.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,r,s,E,H]}class no extends Y{constructor(t){super(),J(this,t,to,Ks,Z,{routes:3,prefix:4,restoreScrollState:5})}}const we=Te(!1),rt=Te(!1),Ht=Te(!1);function Mi(){const{subscribe:e,set:t,update:n}=Te([]);return{subscribe:e,fetch:async()=>{if(!Pn(we))return;const i=await or();n(r=>i)},search:async(i,r)=>{if(!Pn(we))return;const s=await cr(i,r);n(o=>s)},reset:()=>t([])}}const Me=Mi(),Jt=Te(""),Yt=Mi();function io(e){let t,n,i,r;return{c(){t=V("svg"),n=V("polyline"),i=V("polyline"),c(n,"points","11 17 6 12 11 7"),c(i,"points","18 17 13 12 18 7"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-chevrons-left "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-chevrons-left "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ro(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class xi extends Y{constructor(t){super(),J(this,t,ro,io,Z,{size:0,strokeWidth:1,class:2})}}function so(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("line"),r=V("line"),c(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),c(i,"x1","18"),c(i,"y1","9"),c(i,"x2","12"),c(i,"y2","15"),c(r,"x1","12"),c(r,"y1","9"),c(r,"x2","18"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-delete "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-delete "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function oo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class lo extends Y{constructor(t){super(),J(this,t,oo,so,Z,{size:0,strokeWidth:1,class:2})}}function ao(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","7 10 12 15 17 10"),c(r,"x1","12"),c(r,"y1","15"),c(r,"x2","12"),c(r,"y2","3"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-download "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-download "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function uo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class fo extends Y{constructor(t){super(),J(this,t,uo,ao,Z,{size:0,strokeWidth:1,class:2})}}function co(e){let t,n,i,r;return{c(){t=V("svg"),n=V("path"),i=V("path"),c(n,"d","M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"),c(i,"d","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-edit "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-edit "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ho(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class po extends Y{constructor(t){super(),J(this,t,ho,co,Z,{size:0,strokeWidth:1,class:2})}}function mo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("path"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"d","M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"),c(r,"x1","12"),c(r,"y1","17"),c(r,"x2","12.01"),c(r,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-help-circle "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-help-circle "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function _o(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class go extends Y{constructor(t){super(),J(this,t,_o,mo,Z,{size:0,strokeWidth:1,class:2})}}function bo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("line"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"x1","12"),c(i,"y1","16"),c(i,"x2","12"),c(i,"y2","12"),c(r,"x1","12"),c(r,"y1","8"),c(r,"x2","12.01"),c(r,"y2","8"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-info "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-info "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function vo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class wo extends Y{constructor(t){super(),J(this,t,vo,bo,Z,{size:0,strokeWidth:1,class:2})}}function Eo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("rect"),i=V("line"),r=V("line"),c(n,"x","3"),c(n,"y","3"),c(n,"width","18"),c(n,"height","18"),c(n,"rx","2"),c(n,"ry","2"),c(i,"x1","12"),c(i,"y1","8"),c(i,"x2","12"),c(i,"y2","16"),c(r,"x1","8"),c(r,"y1","12"),c(r,"x2","16"),c(r,"y2","12"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-plus-square "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-plus-square "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function yo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ot extends Y{constructor(t){super(),J(this,t,yo,Eo,Z,{size:0,strokeWidth:1,class:2})}}function So(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("line"),c(n,"cx","11"),c(n,"cy","11"),c(n,"r","8"),c(i,"x1","21"),c(i,"y1","21"),c(i,"x2","16.65"),c(i,"y2","16.65"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-search "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-search "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ko(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ao extends Y{constructor(t){super(),J(this,t,ko,So,Z,{size:0,strokeWidth:1,class:2})}}function Bo(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("path"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","3"),c(i,"d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-settings "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-settings "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function To(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ri extends Y{constructor(t){super(),J(this,t,To,Bo,Z,{size:0,strokeWidth:1,class:2})}}function Io(e){let t,n,i,r,s,o;return{c(){t=V("svg"),n=V("polyline"),i=V("path"),r=V("line"),s=V("line"),c(n,"points","3 6 5 6 21 6"),c(i,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),c(r,"x1","10"),c(r,"y1","11"),c(r,"x2","10"),c(r,"y2","17"),c(s,"x1","14"),c(s,"y1","11"),c(s,"x2","14"),c(s,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",o="feather feather-trash-2 "+e[2])},m(l,a){g(l,t,a),A(t,n),A(t,i),A(t,r),A(t,s)},p(l,[a]){a&1&&c(t,"width",l[0]),a&1&&c(t,"height",l[0]),a&2&&c(t,"stroke-width",l[1]),a&4&&o!==(o="feather feather-trash-2 "+l[2])&&c(t,"class",o)},i:G,o:G,d(l){l&&_(t)}}}function Ho(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Co extends Y{constructor(t){super(),J(this,t,Ho,Io,Z,{size:0,strokeWidth:1,class:2})}}function Lo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","17 8 12 3 7 8"),c(r,"x1","12"),c(r,"y1","3"),c(r,"x2","12"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-upload "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-upload "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function No(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class hn extends Y{constructor(t){super(),J(this,t,No,Lo,Z,{size:0,strokeWidth:1,class:2})}}function Po(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=L("p"),r&&r.c(),c(t,"class","svelte-hclhr3"),X(t,"error",e[3]),X(t,"warning",e[0]),X(t,"success",e[1]),X(t,"info",e[2])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&16)&&mt(r,i,s,s[4],n?pt(i,s[4],o,null):dt(s[4]),null),(!n||o&8)&&X(t,"error",s[3]),(!n||o&1)&&X(t,"warning",s[0]),(!n||o&2)&&X(t,"success",s[1]),(!n||o&4)&&X(t,"info",s[2])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function Oo(e,t,n){let{$$slots:i={},$$scope:r}=t,{error:s=!1}=t,{warning:o=!1}=t,{success:l=!1}=t,{info:a=!1}=t;return o=s&&o?!1:o,l=(s||o)&&l?!1:l,a=!(s||o||l),e.$$set=u=>{"error"in u&&n(3,s=u.error),"warning"in u&&n(0,o=u.warning),"success"in u&&n(1,l=u.success),"info"in u&&n(2,a=u.info),"$$scope"in u&&n(4,r=u.$$scope)},[o,l,a,s,r,i]}class Mt extends Y{constructor(t){super(),J(this,t,Oo,Po,Z,{error:3,warning:0,success:1,info:2})}}function Mo(e){let t=e[0]("no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("no_connection")+"")&&z(n,t)},d(i){i&&_(n)}}}function xo(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Mo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ro(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Uo extends Y{constructor(t){super(),J(this,t,Ro,xo,Z,{})}}function Do(e){let t,n,i,r;const s=e[5].default,o=ht(s,e,e[4],null);return{c(){t=L("button"),o&&o.c(),t.disabled=e[3],c(t,"class","svelte-1jbd97"),X(t,"primary",e[0]),X(t,"danger",e[1]),X(t,"secondary",e[2])},m(l,a){g(l,t,a),o&&o.m(t,null),n=!0,i||(r=te(t,"click",e[6]),i=!0)},p(l,[a]){o&&o.p&&(!n||a&16)&&mt(o,s,l,l[4],n?pt(s,l[4],a,null):dt(l[4]),null),(!n||a&8)&&(t.disabled=l[3]),(!n||a&1)&&X(t,"primary",l[0]),(!n||a&2)&&X(t,"danger",l[1]),(!n||a&4)&&X(t,"secondary",l[2])},i(l){n||(w(o,l),n=!0)},o(l){S(o,l),n=!1},d(l){l&&_(t),o&&o.d(l),i=!1,r()}}}function Go(e,t,n){let{$$slots:i={},$$scope:r}=t,{primary:s=!1}=t,{danger:o=!1}=t,{secondary:l=!1}=t,{disabled:a=!1}=t;s=!s&&!l&&!o?!0:s,o=s&&o?!1:o,l=(s||o)&&l?!1:l;function u(f){ut.call(this,e,f)}return e.$$set=f=>{"primary"in f&&n(0,s=f.primary),"danger"in f&&n(1,o=f.danger),"secondary"in f&&n(2,l=f.secondary),"disabled"in f&&n(3,a=f.disabled),"$$scope"in f&&n(4,r=f.$$scope)},[s,o,l,a,r,i,u]}class Fe extends Y{constructor(t){super(),J(this,t,Go,Do,Z,{primary:0,danger:1,secondary:2,disabled:3})}}function $o(e){let t=e[0]("daemon.start")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.start")+"")&&z(n,t)},d(i){i&&_(n)}}}function jo(e){let t=e[0]("daemon.installed")+"",n,i,r,s;return r=new Fe({props:{$$slots:{default:[$o]},$$scope:{ctx:e}}}),r.$on("click",e[1]),{c(){n=$(t),i=R(),U(r.$$.fragment)},m(o,l){g(o,n,l),g(o,i,l),O(r,o,l),s=!0},p(o,l){(!s||l&1)&&t!==(t=o[0]("daemon.installed")+"")&&z(n,t);const a={};l&5&&(a.$$scope={dirty:l,ctx:o}),r.$set(a)},i(o){s||(w(r.$$.fragment,o),s=!0)},o(o){S(r.$$.fragment,o),s=!1},d(o){o&&(_(n),_(i)),M(r,o)}}}function Fo(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[jo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&5&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function zo(e,t,n){let i;ne(e,Se,s=>n(0,i=s));async function r(){Ht.update(s=>!0);try{const s=await wr()}catch(s){await oe(i("daemon.start_error_title"),s),Ht.update(o=>!1)}await Me.fetch()}return[i,r]}class Vo extends Y{constructor(t){super(),J(this,t,zo,Fo,Z,{})}}function Wo(e){let t=e[0]("daemon.not_installed")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.not_installed")+"")&&z(n,t)},d(i){i&&_(n)}}}function Xo(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Wo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function qo(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Zo extends Y{constructor(t){super(),J(this,t,qo,Xo,Z,{})}}function Qo(e){let t=e[0]("daemon.starting")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.starting")+"")&&z(n,t)},d(i){i&&_(n)}}}function Jo(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[Qo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Yo(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Ko extends Y{constructor(t){super(),J(this,t,Yo,Jo,Z,{})}}function Xn(e){let t,n,i,r,s,o;t=new Uo({});const l=[nl,tl,el],a=[];function u(f,p){return f[2]&&!f[3]?0:f[2]&&f[3]?1:2}return i=u(e),r=a[i]=l[i](e),{c(){U(t.$$.fragment),n=R(),r.c(),s=ye()},m(f,p){O(t,f,p),g(f,n,p),a[i].m(f,p),g(f,s,p),o=!0},p(f,p){let h=i;i=u(f),i!==h&&(ue(),S(a[h],1,1,()=>{a[h]=null}),fe(),r=a[i],r||(r=a[i]=l[i](f),r.c()),w(r,1),r.m(s.parentNode,s))},i(f){o||(w(t.$$.fragment,f),w(r),o=!0)},o(f){S(t.$$.fragment,f),S(r),o=!1},d(f){f&&(_(n),_(s)),M(t,f),a[i].d(f)}}}function el(e){let t,n;return t=new Zo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function tl(e){let t,n;return t=new Ko({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function nl(e){let t,n;return t=new Vo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function il(e){let t,n,i,r,s,o=!e[1]&&Xn(e);const l=e[6].default,a=ht(l,e,e[5],null);return{c(){t=L("div"),o&&o.c(),n=R(),a&&a.c(),c(t,"class","screen svelte-i096ea"),X(t,"centered",e[0])},m(u,f){g(u,t,f),o&&o.m(t,null),A(t,n),a&&a.m(t,null),i=!0,r||(s=[te(t,"keyup",e[4]),te(t,"keyup",e[7])],r=!0)},p(u,[f]){u[1]?o&&(ue(),S(o,1,1,()=>{o=null}),fe()):o?(o.p(u,f),f&2&&w(o,1)):(o=Xn(u),o.c(),w(o,1),o.m(t,n)),a&&a.p&&(!i||f&32)&&mt(a,l,u,u[5],i?pt(l,u[5],f,null):dt(u[5]),null),(!i||f&1)&&X(t,"centered",u[0])},i(u){i||(w(o),w(a,u),i=!0)},o(u){S(o),S(a,u),i=!1},d(u){u&&_(t),o&&o.d(),a&&a.d(u),r=!1,Ee(s)}}}function rl(e,t,n){let i,r,s;ne(e,we,h=>n(1,i=h)),ne(e,rt,h=>n(2,r=h)),ne(e,Ht,h=>n(3,s=h));let{$$slots:o={},$$scope:l}=t,{centered:a=!1}=t;const u=_t();function f(h){h.key==="Escape"&&(h.preventDefault(),u("cancel"))}function p(h){ut.call(this,e,h)}return e.$$set=h=>{"centered"in h&&n(0,a=h.centered),"$$scope"in h&&n(5,l=h.$$scope)},[a,i,r,s,f,l,o,p]}class et extends Y{constructor(t){super(),J(this,t,rl,il,Z,{centered:0})}}function sl(e){let t,n,i,r,s,o,l,a;var u=e[0];function f(m,d){return{props:{size:m[2],strokeWidth:m[3]}}}u&&(i=Ve(u,f(e)));const p=e[10].default,h=ht(p,e,e[9],null);return{c(){t=L("div"),n=L("div"),i&&U(i.$$.fragment),s=R(),h&&h.c(),c(n,"class",r="icon-wrapper "+e[1]+" svelte-bhj2u4"),c(t,"class","content svelte-bhj2u4"),c(t,"tabindex","0"),c(t,"title",e[5]),X(t,"centered",e[6]),X(t,"horizontal",e[4])},m(m,d){g(m,t,d),A(t,n),i&&O(i,n,null),A(t,s),h&&h.m(t,null),o=!0,l||(a=[te(t,"click",e[7]),te(t,"keyup",e[8])],l=!0)},p(m,[d]){if(d&1&&u!==(u=m[0])){if(i){ue();const b=i;S(b.$$.fragment,1,0,()=>{M(b,1)}),fe()}u?(i=Ve(u,f(m)),U(i.$$.fragment),w(i.$$.fragment,1),O(i,n,null)):i=null}else if(u){const b={};d&4&&(b.size=m[2]),d&8&&(b.strokeWidth=m[3]),i.$set(b)}(!o||d&2&&r!==(r="icon-wrapper "+m[1]+" svelte-bhj2u4"))&&c(n,"class",r),h&&h.p&&(!o||d&512)&&mt(h,p,m,m[9],o?pt(p,m[9],d,null):dt(m[9]),null),(!o||d&32)&&c(t,"title",m[5]),(!o||d&16)&&X(t,"horizontal",m[4])},i(m){o||(i&&w(i.$$.fragment,m),w(h,m),o=!0)},o(m){i&&S(i.$$.fragment,m),S(h,m),o=!1},d(m){m&&_(t),i&&M(i),h&&h.d(m),l=!1,Ee(a)}}}function ol(e,t,n){let{$$slots:i={},$$scope:r}=t,{icon:s=go}=t,{iconClass:o}=t,{size:l="24"}=t,{strokeWidth:a="2"}=t,{horizontal:u=!1}=t,{title:f=""}=t;const p=!u,h=_t();function m(){h("activate")}function d(b){(b.key==="Enter"||b.key===" ")&&h("activate")}return e.$$set=b=>{"icon"in b&&n(0,s=b.icon),"iconClass"in b&&n(1,o=b.iconClass),"size"in b&&n(2,l=b.size),"strokeWidth"in b&&n(3,a=b.strokeWidth),"horizontal"in b&&n(4,u=b.horizontal),"title"in b&&n(5,f=b.title),"$$scope"in b&&n(9,r=b.$$scope)},[s,o,l,a,u,f,p,m,d,r,i]}class de extends Y{constructor(t){super(),J(this,t,ol,sl,Z,{icon:0,iconClass:1,size:2,strokeWidth:3,horizontal:4,title:5})}}function ll(e,t){t&&setTimeout(()=>{e.focus(),e.select()},250)}function qn(e){let t,n;return{c(){t=L("label"),n=$(e[4]),c(t,"for",e[3])},m(i,r){g(i,t,r),A(t,n)},p(i,r){r&16&&z(n,i[4]),r&8&&c(t,"for",i[3])},d(i){i&&_(t)}}}function Zn(e){let t,n,i,r,s;return n=new Ao({}),{c(){t=L("button"),U(n.$$.fragment),c(t,"class","search-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[6]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=te(t,"click",e[14]),r=!0)},p(o,l){(!i||l&64)&&c(t,"title",o[6]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Qn(e){let t,n,i,r,s;return n=new lo({}),{c(){t=L("button"),U(n.$$.fragment),c(t,"class","clear-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[7]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=te(t,"click",e[15]),r=!0)},p(o,l){(!i||l&128)&&c(t,"title",o[7]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Jn(e){let t;return{c(){t=L("div"),c(t,"class","error-message svelte-8p6spj")},m(n,i){g(n,t,i),t.innerHTML=e[11]},p(n,i){i&2048&&(t.innerHTML=n[11])},d(n){n&&_(t)}}}function al(e){let t,n,i,r,s,o,l,a,u,f,p,h,m=e[4]&&qn(e),d=e[9]&&Zn(e),b=e[9]&&e[0]&&Qn(e),I=!e[9]&&Jn(e);return{c(){t=L("div"),m&&m.c(),n=R(),i=L("div"),d&&d.c(),r=R(),s=L("input"),l=R(),b&&b.c(),a=R(),I&&I.c(),u=ye(),c(s,"type","text"),c(s,"id",e[3]),c(s,"name",e[3]),c(s,"placeholder",e[5]),c(s,"tabindex",e[10]),c(s,"class","svelte-8p6spj"),X(s,"search",e[9]),X(s,"focussed",e[2]),X(s,"value",e[0]),c(i,"class","input-control svelte-8p6spj"),c(t,"class","input svelte-8p6spj")},m(B,E){g(B,t,E),m&&m.m(t,null),A(t,n),A(t,i),d&&d.m(i,null),A(i,r),A(i,s),ze(s,e[0]),e[18](s),A(i,l),b&&b.m(i,null),g(B,a,E),I&&I.m(B,E),g(B,u,E),f=!0,p||(h=[te(s,"input",e[17]),te(s,"focusin",e[12]),te(s,"focusout",e[13]),dn(o=ll.call(null,s,e[8]))],p=!0)},p(B,[E]){B[4]?m?m.p(B,E):(m=qn(B),m.c(),m.m(t,n)):m&&(m.d(1),m=null),B[9]?d?(d.p(B,E),E&512&&w(d,1)):(d=Zn(B),d.c(),w(d,1),d.m(i,r)):d&&(ue(),S(d,1,1,()=>{d=null}),fe()),(!f||E&8)&&c(s,"id",B[3]),(!f||E&8)&&c(s,"name",B[3]),(!f||E&32)&&c(s,"placeholder",B[5]),(!f||E&1024)&&c(s,"tabindex",B[10]),E&1&&s.value!==B[0]&&ze(s,B[0]),o&&Qe(o.update)&&E&256&&o.update.call(null,B[8]),(!f||E&512)&&X(s,"search",B[9]),(!f||E&4)&&X(s,"focussed",B[2]),(!f||E&1)&&X(s,"value",B[0]),B[9]&&B[0]?b?(b.p(B,E),E&513&&w(b,1)):(b=Qn(B),b.c(),w(b,1),b.m(i,null)):b&&(ue(),S(b,1,1,()=>{b=null}),fe()),B[9]?I&&(I.d(1),I=null):I?I.p(B,E):(I=Jn(B),I.c(),I.m(u.parentNode,u))},i(B){f||(w(d),w(b),f=!0)},o(B){S(d),S(b),f=!1},d(B){B&&(_(t),_(a),_(u)),m&&m.d(),d&&d.d(),e[18](null),b&&b.d(),I&&I.d(B),p=!1,Ee(h)}}}function ul(e,t,n){let i;const r=_t();let{name:s="input"}=t,{label:o=""}=t,{value:l=""}=t,{errorMessage:a=""}=t,{placeholder:u=""}=t,{searchButtonTitle:f=""}=t,{clearButtonTitle:p=""}=t,{autofocus:h=!1}=t,{search:m=!1}=t,{tabindex:d=0}=t,{ref:b}=t,{focussed:I=h}=t;function B(){n(2,I=!0)}function E(){n(2,I=!1)}function H(){r("query",l),document.getElementById(s).focus()}function y(){n(0,l=""),document.getElementById(s).focus()}function T(){l=this.value,n(0,l)}function N(k){ve[k?"unshift":"push"](()=>{b=k,n(1,b)})}return e.$$set=k=>{"name"in k&&n(3,s=k.name),"label"in k&&n(4,o=k.label),"value"in k&&n(0,l=k.value),"errorMessage"in k&&n(16,a=k.errorMessage),"placeholder"in k&&n(5,u=k.placeholder),"searchButtonTitle"in k&&n(6,f=k.searchButtonTitle),"clearButtonTitle"in k&&n(7,p=k.clearButtonTitle),"autofocus"in k&&n(8,h=k.autofocus),"search"in k&&n(9,m=k.search),"tabindex"in k&&n(10,d=k.tabindex),"ref"in k&&n(1,b=k.ref),"focussed"in k&&n(2,I=k.focussed)},e.$$.update=()=>{e.$$.dirty&65536&&n(11,i=a||"&nbsp;")},[l,b,I,s,o,u,f,p,h,m,d,i,B,E,H,y,a,T,N]}class Sn extends Y{constructor(t){super(),J(this,t,ul,al,Z,{name:3,label:4,value:0,errorMessage:16,placeholder:5,searchButtonTitle:6,clearButtonTitle:7,autofocus:8,search:9,tabindex:10,ref:1,focussed:2})}}function Ui(e,t){t&&e.focus()}function fl(e){let t;return{c(){t=$(e[0])},m(n,i){g(n,t,i)},p(n,i){i&1&&z(t,n[0])},d(n){n&&_(t)}}}function cl(e){let t;return{c(){t=$(" ")},m(n,i){g(n,t,i)},p:G,d(n){n&&_(t)}}}function hl(e){let t;function n(s,o){return s[1]?cl:fl}let r=n(e)(e);return{c(){t=L("span"),r.c(),c(t,"class","shortcut-button svelte-11t060e"),X(t,"hide",e[1])},m(s,o){g(s,t,o),r.m(t,null)},p(s,[o]){r.p(s,o)},i:G,o:G,d(s){s&&_(t),r.d()}}}function pl(e,t,n){let{shortcut:i=""}=t;const r=i.length===0;return e.$$set=s=>{"shortcut"in s&&n(0,i=s.shortcut)},[i,r]}class xt extends Y{constructor(t){super(),J(this,t,pl,hl,Z,{shortcut:0})}}function Yn(e){let t,n;return t=new xt({props:{shortcut:e[6]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&64&&(s.shortcut=i[6]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Kn(e){let t,n,i;return n=new po({props:{size:"1.25x"}}),{c(){t=L("div"),U(n.$$.fragment),c(t,"class","edit-icon-wrapper svelte-1ebkg7o")},m(r,s){g(r,t,s),O(n,t,null),i=!0},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function ml(e){let t,n,i,r,s,o=e[0].body+"",l,a,u,f,p,h=e[4]&&Yn(e);i=new xt({props:{shortcut:e[0].abbreviation}});let m=!e[4]&&Kn();return{c(){t=L("li"),h&&h.c(),n=R(),U(i.$$.fragment),r=R(),s=L("span"),l=$(o),a=R(),m&&m.c(),c(s,"class","body svelte-1ebkg7o"),c(t,"tabindex",e[1]),c(t,"title",e[7]),c(t,"class","svelte-1ebkg7o"),X(t,"focussed",e[2]),X(t,"active",e[3])},m(d,b){g(d,t,b),h&&h.m(t,null),A(t,n),O(i,t,null),A(t,r),A(t,s),A(s,l),A(t,a),m&&m.m(t,null),e[13](t),u=!0,f||(p=te(t,"click",e[12]),f=!0)},p(d,[b]){d[4]?h?(h.p(d,b),b&16&&w(h,1)):(h=Yn(d),h.c(),w(h,1),h.m(t,n)):h&&(ue(),S(h,1,1,()=>{h=null}),fe());const I={};b&1&&(I.shortcut=d[0].abbreviation),i.$set(I),(!u||b&1)&&o!==(o=d[0].body+"")&&z(l,o),d[4]?m&&(ue(),S(m,1,1,()=>{m=null}),fe()):m?b&16&&w(m,1):(m=Kn(),m.c(),w(m,1),m.m(t,null)),(!u||b&2)&&c(t,"tabindex",d[1]),(!u||b&4)&&X(t,"focussed",d[2]),(!u||b&8)&&X(t,"active",d[3])},i(d){u||(w(h),w(i.$$.fragment,d),w(m),u=!0)},o(d){S(h),S(i.$$.fragment,d),S(m),u=!1},d(d){d&&_(t),h&&h.d(),M(i),m&&m.d(),e[13](null),f=!1,p()}}}function dl(e,t,n){let i;ne(e,Se,E=>n(14,i=E));let{snippet:r}=t,{index:s=-1}=t,{tabindex:o=-1}=t,{focussed:l=!1}=t,{active:a=!1}=t,{selectMode:u=!1}=t,{observer:f=null}=t,p,h=i(u?"use_snippet.title":"edit_snippet.title"),m=s>=0&&s<10?s+1:"";m===10&&(m=0);function d(){return p.classList.contains("is-visible")}function b(E){p.scrollIntoView({behavior:"smooth",block:E})}Je(()=>{f&&f.observe(p)}),_n(()=>{f&&f.unobserve(p)});function I(E){ut.call(this,e,E)}function B(E){ve[E?"unshift":"push"](()=>{p=E,n(5,p)})}return e.$$set=E=>{"snippet"in E&&n(0,r=E.snippet),"index"in E&&n(8,s=E.index),"tabindex"in E&&n(1,o=E.tabindex),"focussed"in E&&n(2,l=E.focussed),"active"in E&&n(3,a=E.active),"selectMode"in E&&n(4,u=E.selectMode),"observer"in E&&n(9,f=E.observer)},[r,o,l,a,u,p,m,h,s,f,d,b,I,B]}class _l extends Y{constructor(t){super(),J(this,t,dl,ml,Z,{snippet:0,index:8,tabindex:1,focussed:2,active:3,selectMode:4,observer:9,isVisible:10,scrollIntoView:11})}get isVisible(){return this.$$.ctx[10]}get scrollIntoView(){return this.$$.ctx[11]}}function ei(e,t,n){const i=e.slice();return i[22]=t[n],i[23]=t,i[24]=n,i}function ti(e){let t,n=e[24],i;const r=()=>e[14](t,n),s=()=>e[14](null,n);function o(){return e[15](e[24])}let l={snippet:e[22],index:e[24],focussed:e[24]===e[4],active:e[5],observer:e[8],selectMode:e[2]};return t=new _l({props:l}),r(),t.$on("click",o),{c(){U(t.$$.fragment)},m(a,u){O(t,a,u),i=!0},p(a,u){e=a,n!==e[24]&&(s(),n=e[24],r());const f={};u&128&&(f.snippet=e[22]),u&16&&(f.focussed=e[24]===e[4]),u&32&&(f.active=e[5]),u&4&&(f.selectMode=e[2]),t.$set(f)},i(a){i||(w(t.$$.fragment,a),i=!0)},o(a){S(t.$$.fragment,a),i=!1},d(a){s(),M(t,a)}}}function gl(e){let t,n,i,r,s,o=On(e[7]),l=[];for(let u=0;u<o.length;u+=1)l[u]=ti(ei(e,o,u));const a=u=>S(l[u],1,1,()=>{l[u]=null});return{c(){t=L("ul");for(let u=0;u<l.length;u+=1)l[u].c();c(t,"tabindex",e[1]),c(t,"class","svelte-1wnqbvs")},m(u,f){g(u,t,f);for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(t,null);e[16](t),i=!0,r||(s=[te(t,"focus",e[9]),te(t,"blur",e[10]),te(t,"keydown",e[12]),dn(n=Ui.call(null,t,e[3]))],r=!0)},p(u,[f]){if(f&2548){o=On(u[7]);let p;for(p=0;p<o.length;p+=1){const h=ei(u,o,p);l[p]?(l[p].p(h,f),w(l[p],1)):(l[p]=ti(h),l[p].c(),w(l[p],1),l[p].m(t,null))}for(ue(),p=o.length;p<l.length;p+=1)a(p);fe()}(!i||f&2)&&c(t,"tabindex",u[1]),n&&Qe(n.update)&&f&8&&n.update.call(null,u[3])},i(u){if(!i){for(let f=0;f<o.length;f+=1)w(l[f]);i=!0}},o(u){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)S(l[f]);i=!1},d(u){u&&_(t),Xi(l,u),e[16](null),r=!1,Ee(s)}}}function bl(e,t,n){let i;const r=_t();let{snippets:s=null}=t,{tabindex:o=0}=t,{selectMode:l=!1}=t,{autofocus:a=!1}=t,{ref:u}=t,f=0,p=a,h=[];const m=new IntersectionObserver(function(v){for(let P=0;P<v.length;P++)v[P].isIntersecting?v[P].target.classList.add("is-visible"):v[P].target.classList.remove("is-visible")},{root:u,threshold:[.6]});function d(v){return n(4,f=0),v}function b(){n(5,p=!0)}function I(){n(5,p=!1)}function B(v){l?y(i[v]):T(i[v])}function E(v){!s||s.length===0||H(v)&&v.preventDefault()}function H(v){if(v.key==="Home"||v.key==="g")return n(4,f=0),h[f].scrollIntoView("nearest"),!0;if(v.key==="End"||v.key==="G")return n(4,f=s.length-1),h[f].scrollIntoView("nearest"),!0;if(f<s.length-1&&(v.key==="ArrowDown"||v.key==="j"))return n(4,f++,f),h[f].scrollIntoView("nearest"),!0;if(f>0&&(v.key==="ArrowUp"||v.key==="k"))return n(4,f--,f),h[f].scrollIntoView("nearest"),!0;if(v.key==="PageDown"||v.key==="d"){let P=-1,C=-1;for(let ae=0;ae<h.length;ae++)if(h[ae].isVisible())C=ae,P<0&&(P=ae);else if(C>=0)break;const le=h.length-1,re=C-P;return C+re>le?n(4,f=le):n(4,f=C),h[f].scrollIntoView("start"),!0}if(v.key==="PageUp"||v.key==="u"){let P=-1,C=-1;for(let re=0;re<h.length;re++){const ae=h[re];if(ae.isVisible()&&P<0)P=re,C=re;else if(ae.isVisible())C=re;else if(P>=0)break}const le=C-P;return P-le<=0?n(4,f=0):n(4,f=P),h[f].scrollIntoView("end"),!0}if(l&&f>=0&&f<s.length&&v.key==="Enter")return y(i[f]),!0;if(l&&["1","2","3","4","5","6","7","8","9","0"].includes(v.key)){let P=v.key-1;return P===-1&&(P=9),P+1>i.length?!1:(y(i[P]),!0)}return!l&&f>=0&&f<s.length&&(v.key==="ArrowRight"||v.key==="Enter")?(T(i[f]),!0):!1}function y(v){r("itemActivated",{snippet:v})}function T(v){r("itemEdit",{snippet:v})}ai(()=>{h.length!==i.length&&n(6,h.length=i.length,h)});function N(v,P){ve[v?"unshift":"push"](()=>{h[P]=v,n(6,h)})}const k=v=>B(v);function x(v){ve[v?"unshift":"push"](()=>{u=v,n(0,u)})}return e.$$set=v=>{"snippets"in v&&n(13,s=v.snippets),"tabindex"in v&&n(1,o=v.tabindex),"selectMode"in v&&n(2,l=v.selectMode),"autofocus"in v&&n(3,a=v.autofocus),"ref"in v&&n(0,u=v.ref)},e.$$.update=()=>{e.$$.dirty&8192&&n(7,i=d(s))},[u,o,l,a,f,p,h,i,m,b,I,B,E,s,N,k,x]}class vl extends Y{constructor(t){super(),J(this,t,bl,gl,Z,{snippets:13,tabindex:1,selectMode:2,autofocus:3,ref:0})}}function wl(e){let t,n;const i=e[2].default,r=ht(i,e,e[1],null);return{c(){t=L("div"),r&&r.c(),c(t,"class","toolbar svelte-i867mn"),X(t,"bottom",e[0])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&2)&&mt(r,i,s,s[1],n?pt(i,s[1],o,null):dt(s[1]),null),(!n||o&1)&&X(t,"bottom",s[0])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function El(e,t,n){let{$$slots:i={},$$scope:r}=t,{bottom:s=!1}=t;return e.$$set=o=>{"bottom"in o&&n(0,s=o.bottom),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class Rt extends Y{constructor(t){super(),J(this,t,El,wl,Z,{bottom:0})}}function yl(e){let t;return{c(){t=L("div"),c(t,"class","toolbar-spacer svelte-1a67v9")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}class kn extends Y{constructor(t){super(),J(this,t,null,yl,Z,{})}}function Sl(e){let t,n,i=e[6]("no_snippets_found.title")+"",r,s,o,l=e[6]("no_snippets_found.description")+"",a;return{c(){t=L("div"),n=L("p"),r=$(i),s=R(),o=L("p"),a=$(l),c(n,"class","no-snippets-found svelte-y4605t"),c(o,"class","no-snippets-found description dimmed svelte-y4605t"),c(t,"class","centered")},m(u,f){g(u,t,f),A(t,n),A(n,r),A(t,s),A(t,o),A(o,a)},p(u,f){f&64&&i!==(i=u[6]("no_snippets_found.title")+"")&&z(r,i),f&64&&l!==(l=u[6]("no_snippets_found.description")+"")&&z(a,l)},i:G,o:G,d(u){u&&_(t)}}}function kl(e){let t,n,i;function r(o){e[21](o)}let s={snippets:e[7],tabindex:2,selectMode:e[0],autofocus:e[8]};return e[4]!==void 0&&(s.ref=e[4]),t=new vl({props:s}),ve.push(()=>$e(t,"ref",r)),t.$on("itemActivated",e[12]),t.$on("itemEdit",e[13]),{c(){U(t.$$.fragment)},m(o,l){O(t,o,l),i=!0},p(o,l){const a={};l&128&&(a.snippets=o[7]),l&1&&(a.selectMode=o[0]),!n&&l&16&&(n=!0,a.ref=o[4],Ge(()=>n=!1)),t.$set(a)},i(o){i||(w(t.$$.fragment,o),i=!0)},o(o){S(t.$$.fragment,o),i=!1},d(o){M(t,o)}}}function ni(e){let t,n;return t=new Rt({props:{bottom:!0,$$slots:{default:[Al]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&16777280&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Al(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[6]("add_snippet.title")}}),t.$on("activate",e[10]),i=new kn({}),s=new de({props:{iconClass:"dimmed",icon:Ri,size:"2x",title:e[6]("settings.title")}}),s.$on("activate",e[11]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a&64&&(u.title=l[6]("add_snippet.title")),t.$set(u);const f={};a&64&&(f.title=l[6]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function Bl(e){let t,n,i,r,s,o,l,a,u,f,p;function h(y){e[18](y)}function m(y){e[19](y)}function d(y){e[20](y)}let b={search:!0,autofocus:e[1],placeholder:e[6]("search"),searchButtonTitle:e[6]("search"),clearButtonTitle:e[6]("clear"),tabindex:1};e[2]!==void 0&&(b.value=e[2]),e[3]!==void 0&&(b.ref=e[3]),e[5]!==void 0&&(b.focussed=e[5]),n=new Sn({props:b}),ve.push(()=>$e(n,"value",h)),ve.push(()=>$e(n,"ref",m)),ve.push(()=>$e(n,"focussed",d)),n.$on("query",e[9]);const I=[kl,Sl],B=[];function E(y,T){return y[7]?0:1}l=E(e),a=B[l]=I[l](e);let H=!e[0]&&ni(e);return{c(){t=L("div"),U(n.$$.fragment),o=R(),a.c(),u=R(),H&&H.c(),f=ye(),c(t,"class","toolbar top")},m(y,T){g(y,t,T),O(n,t,null),g(y,o,T),B[l].m(y,T),g(y,u,T),H&&H.m(y,T),g(y,f,T),p=!0},p(y,T){const N={};T&2&&(N.autofocus=y[1]),T&64&&(N.placeholder=y[6]("search")),T&64&&(N.searchButtonTitle=y[6]("search")),T&64&&(N.clearButtonTitle=y[6]("clear")),!i&&T&4&&(i=!0,N.value=y[2],Ge(()=>i=!1)),!r&&T&8&&(r=!0,N.ref=y[3],Ge(()=>r=!1)),!s&&T&32&&(s=!0,N.focussed=y[5],Ge(()=>s=!1)),n.$set(N);let k=l;l=E(y),l===k?B[l].p(y,T):(ue(),S(B[k],1,1,()=>{B[k]=null}),fe(),a=B[l],a?a.p(y,T):(a=B[l]=I[l](y),a.c()),w(a,1),a.m(u.parentNode,u)),y[0]?H&&(ue(),S(H,1,1,()=>{H=null}),fe()):H?(H.p(y,T),T&1&&w(H,1)):(H=ni(y),H.c(),w(H,1),H.m(f.parentNode,f))},i(y){p||(w(n.$$.fragment,y),w(a),w(H),p=!0)},o(y){S(n.$$.fragment,y),S(a),S(H),p=!1},d(y){y&&(_(t),_(o),_(u),_(f)),M(n),B[l].d(y),H&&H.d(y)}}}function Tl(e){let t,n;return t=new et({props:{$$slots:{default:[Bl]},$$scope:{ctx:e}}}),t.$on("keyup",e[14]),t.$on("cancel",e[15]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&16777471&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Il(e,t,n){let i,r,s,o;ne(e,we,C=>n(17,i=C)),ne(e,Jt,C=>n(2,r=C)),ne(e,Se,C=>n(6,s=C)),ne(e,Yt,C=>n(7,o=C));let{orderByLastUsed:l=!1}=t,{selectMode:a=!1}=t,{focusSearchBox:u=!0}=t;const f=!u;let p,h,m=u;function d(C){Wi(Jt,r=C.detail,r),Yt.search(r,l)}function b(){je("/snippet/add")}function I(){je("/settings")}function B(C){mr(C.detail.snippet.abbreviation,500)}function E(C){const le=C.detail.snippet.id;je("/snippet/edit/"+le)}function H(C,le,re){Yt.search(C,le)}function y(){m?h.focus():p.focus()}function T(C){C.ctrlKey&&C.key==="n"&&(b(),C.preventDefault()),C.ctrlKey&&C.altKey&&C.key==="s"&&(I(),C.preventDefault()),C.ctrlKey&&C.key==="f"&&(y(),C.preventDefault())}function N(){a&&er()}function k(C){r=C,Jt.set(r)}function x(C){p=C,n(3,p)}function v(C){m=C,n(5,m)}function P(C){h=C,n(4,h)}return e.$$set=C=>{"orderByLastUsed"in C&&n(16,l=C.orderByLastUsed),"selectMode"in C&&n(0,a=C.selectMode),"focusSearchBox"in C&&n(1,u=C.focusSearchBox)},e.$$.update=()=>{e.$$.dirty&196612&&H(r,l)},[a,u,r,p,h,m,s,o,f,d,b,I,B,E,T,N,l,i,k,x,v,P]}class Hl extends Y{constructor(t){super(),J(this,t,Il,Tl,Z,{orderByLastUsed:16,selectMode:0,focusSearchBox:1})}}function ii(e){let t,n,i,r,s,o,l,a;return n=new de({props:{iconClass:"dimmed",icon:Ot,title:e[0]("add_snippet.title"),size:"5x",$$slots:{default:[Cl]},$$scope:{ctx:e}}}),n.$on("activate",e[2]),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,title:e[0]("import_snippets.title"),size:"1.5x",$$slots:{default:[Ll]},$$scope:{ctx:e}}}),s.$on("activate",e[4]),l=new Rt({props:{bottom:!0,$$slots:{default:[Nl]},$$scope:{ctx:e}}}),{c(){t=L("p"),U(n.$$.fragment),i=R(),r=L("p"),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","add-snippet"),c(r,"class","import-snippets")},m(u,f){g(u,t,f),O(n,t,null),g(u,i,f),g(u,r,f),O(s,r,null),g(u,o,f),O(l,u,f),a=!0},p(u,f){const p={};f&1&&(p.title=u[0]("add_snippet.title")),f&33&&(p.$$scope={dirty:f,ctx:u}),n.$set(p);const h={};f&1&&(h.title=u[0]("import_snippets.title")),f&33&&(h.$$scope={dirty:f,ctx:u}),s.$set(h);const m={};f&33&&(m.$$scope={dirty:f,ctx:u}),l.$set(m)},i(u){a||(w(n.$$.fragment,u),w(s.$$.fragment,u),w(l.$$.fragment,u),a=!0)},o(u){S(n.$$.fragment,u),S(s.$$.fragment,u),S(l.$$.fragment,u),a=!1},d(u){u&&(_(t),_(i),_(r),_(o)),M(n),M(s),M(l,u)}}}function Cl(e){let t=e[0]("add_snippet.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("add_snippet.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ll(e){let t=e[0]("import_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("import_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Nl(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[0]("add_snippet.title")}}),t.$on("activate",e[2]),i=new kn({}),s=new de({props:{iconClass:"dimmed",icon:Ri,size:"2x",title:e[0]("settings.title")}}),s.$on("activate",e[3]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a&1&&(u.title=l[0]("add_snippet.title")),t.$set(u);const f={};a&1&&(f.title=l[0]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function Pl(e){let t,n,i,r=e[0]("no_snippets_found.title")+"",s,o,l,a,u=e[1]&&ii(e);return{c(){t=L("h1"),t.textContent="Snippet Expander",n=R(),i=L("p"),s=$(r),o=R(),u&&u.c(),l=ye(),c(i,"class","dimmed")},m(f,p){g(f,t,p),g(f,n,p),g(f,i,p),A(i,s),g(f,o,p),u&&u.m(f,p),g(f,l,p),a=!0},p(f,p){(!a||p&1)&&r!==(r=f[0]("no_snippets_found.title")+"")&&z(s,r),f[1]?u?(u.p(f,p),p&2&&w(u,1)):(u=ii(f),u.c(),w(u,1),u.m(l.parentNode,l)):u&&(ue(),S(u,1,1,()=>{u=null}),fe())},i(f){a||(w(u),a=!0)},o(f){S(u),a=!1},d(f){f&&(_(t),_(n),_(i),_(o),_(l)),u&&u.d(f)}}}function Ol(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[Pl]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&35&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ml(e,t,n){let i,r;ne(e,Se,a=>n(0,i=a)),ne(e,we,a=>n(1,r=a));function s(){je("/snippet/add")}function o(){je("/settings")}async function l(){try{const a=await mi(!1)}catch(a){await oe(i("import_snippets.error_title"),a)}await Me.fetch()}return[i,r,s,o,l]}class xl extends Y{constructor(t){super(),J(this,t,Ml,Ol,Z,{})}}function Rl(e){let t,n;return t=new xl({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ul(e){let t,n;return t=new Hl({props:{selectMode:e[2],orderByLastUsed:e[3],focusSearchBox:e[4]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.selectMode=i[2]),r&8&&(s.orderByLastUsed=i[3]),r&16&&(s.focusSearchBox=i[4]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Dl(e){let t;return{c(){t=$("Checking settings ...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Gl(e){let t,n,i,r;const s=[Dl,Ul,Rl],o=[];function l(a,u){return a[1]?0:a[0]&&(a[5]&&a[5].length>0||a[2])?1:2}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function $l(e,t,n){let i,r,s;ne(e,Se,p=>n(6,i=p)),ne(e,we,p=>n(0,r=p)),ne(e,Me,p=>n(5,s=p));let o=!0,l=!1,a=!1,u=!0;function f(p){Me.fetch()}return Je(async()=>{if(n(2,l=await vr()),n(3,a=l),l&&r)try{const p=await hi("FOCUS_SEARCH_BOX");n(4,u=p!=="false")}catch(p){await oe(i("settings.get_error_title"),p)}n(1,o=!1)}),e.$$.update=()=>{e.$$.dirty&1&&f()},[r,o,l,a,u,s]}class jl extends Y{constructor(t){super(),J(this,t,$l,Gl,Z,{})}}function Fl(e){let t=e[4]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function zl(e){let t=e[4]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function Vl(e){let t,n=e[4]("add_snippet.title")+"",i,r,s,o,l,a,u=e[4]("body.title")+"",f,p,h,m,d,b,I,B,E,H,y;function T(k){e[8](k)}let N={label:e[4]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(N.value=e[0]),s=new Sn({props:N}),ve.push(()=>$e(s,"value",T)),b=new Fe({props:{secondary:!0,$$slots:{default:[Fl]},$$scope:{ctx:e}}}),b.$on("click",e[5]),B=new Fe({props:{primary:!0,disabled:e[3],$$slots:{default:[zl]},$$scope:{ctx:e}}}),B.$on("click",e[6]),{c(){t=L("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),a=L("label"),f=$(u),p=R(),h=L("textarea"),m=R(),d=L("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),c(t,"class","svelte-126nfs4"),c(a,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(k,x){g(k,t,x),A(t,i),g(k,r,x),O(s,k,x),g(k,l,x),g(k,a,x),A(a,f),g(k,p,x),g(k,h,x),ze(h,e[2]),g(k,m,x),g(k,d,x),O(b,d,null),A(d,I),O(B,d,null),E=!0,H||(y=te(h,"input",e[9]),H=!0)},p(k,x){(!E||x&16)&&n!==(n=k[4]("add_snippet.title")+"")&&z(i,n);const v={};x&16&&(v.label=k[4]("abbreviation.title")),x&2&&(v.errorMessage=k[1]),!o&&x&1&&(o=!0,v.value=k[0],Ge(()=>o=!1)),s.$set(v),(!E||x&16)&&u!==(u=k[4]("body.title")+"")&&z(f,u),x&4&&ze(h,k[2]);const P={};x&2064&&(P.$$scope={dirty:x,ctx:k}),b.$set(P);const C={};x&8&&(C.disabled=k[3]),x&2064&&(C.$$scope={dirty:x,ctx:k}),B.$set(C)},i(k){E||(w(s.$$.fragment,k),w(b.$$.fragment,k),w(B.$$.fragment,k),E=!0)},o(k){S(s.$$.fragment,k),S(b.$$.fragment,k),S(B.$$.fragment,k),E=!1},d(k){k&&(_(t),_(r),_(l),_(a),_(p),_(h),_(m),_(d)),M(s,k),M(b),M(B),H=!1,y()}}}function Wl(e){let t,n;return t=new et({props:{$$slots:{default:[Vl]},$$scope:{ctx:e}}}),t.$on("cancel",e[5]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&2079&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Xl(e,t,n){let i,r,s;ne(e,Se,d=>n(4,r=d)),ne(e,we,d=>n(7,s=d));let o="",l="";async function a(d){if(d.length===0){n(1,u=r("abbreviation.empty"));return}if(!s){n(1,u="");return}try{const b=await pi(d);if(b.hasOwnProperty("abbreviation")&&b.abbreviation.length>0){n(1,u=r("abbreviation.exists"));return}}catch(b){await oe(r("add_snippet.error_title"),b)}n(1,u="")}let u="";function f(){Be()}async function p(){try{const d=await tr(o,l);await Be()}catch(d){await oe(r("add_snippet.error_title"),d)}}function h(d){o=d,n(0,o)}function m(){l=this.value,n(2,l)}return e.$$.update=()=>{e.$$.dirty&1&&a(o),e.$$.dirty&130&&n(3,i=!s||u.length>0)},[o,u,l,i,r,f,p,s,h,m]}class ql extends Y{constructor(t){super(),J(this,t,Xl,Wl,Z,{})}}function Zl(e){let t=e[5]("button.remove")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.remove")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ql(e){let t=e[5]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function Jl(e){let t=e[5]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function Yl(e){let t,n=e[5]("edit_snippet.title")+"",i,r,s,o,l,a,u=e[5]("body.title")+"",f,p,h,m,d,b,I,B,E,H,y,T,N;function k(v){e[11](v)}let x={label:e[5]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(x.value=e[0]),s=new Sn({props:x}),ve.push(()=>$e(s,"value",k)),b=new Fe({props:{danger:!0,disabled:e[3],$$slots:{default:[Zl]},$$scope:{ctx:e}}}),b.$on("click",e[7]),B=new Fe({props:{secondary:!0,$$slots:{default:[Ql]},$$scope:{ctx:e}}}),B.$on("click",e[6]),H=new Fe({props:{primary:!0,disabled:e[4],$$slots:{default:[Jl]},$$scope:{ctx:e}}}),H.$on("click",e[8]),{c(){t=L("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),a=L("label"),f=$(u),p=R(),h=L("textarea"),m=R(),d=L("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),E=R(),U(H.$$.fragment),c(t,"class","svelte-126nfs4"),c(a,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(v,P){g(v,t,P),A(t,i),g(v,r,P),O(s,v,P),g(v,l,P),g(v,a,P),A(a,f),g(v,p,P),g(v,h,P),ze(h,e[2]),g(v,m,P),g(v,d,P),O(b,d,null),A(d,I),O(B,d,null),A(d,E),O(H,d,null),y=!0,T||(N=te(h,"input",e[12]),T=!0)},p(v,P){(!y||P&32)&&n!==(n=v[5]("edit_snippet.title")+"")&&z(i,n);const C={};P&32&&(C.label=v[5]("abbreviation.title")),P&2&&(C.errorMessage=v[1]),!o&&P&1&&(o=!0,C.value=v[0],Ge(()=>o=!1)),s.$set(C),(!y||P&32)&&u!==(u=v[5]("body.title")+"")&&z(f,u),P&4&&ze(h,v[2]);const le={};P&8&&(le.disabled=v[3]),P&32800&&(le.$$scope={dirty:P,ctx:v}),b.$set(le);const re={};P&32800&&(re.$$scope={dirty:P,ctx:v}),B.$set(re);const ae={};P&16&&(ae.disabled=v[4]),P&32800&&(ae.$$scope={dirty:P,ctx:v}),H.$set(ae)},i(v){y||(w(s.$$.fragment,v),w(b.$$.fragment,v),w(B.$$.fragment,v),w(H.$$.fragment,v),y=!0)},o(v){S(s.$$.fragment,v),S(b.$$.fragment,v),S(B.$$.fragment,v),S(H.$$.fragment,v),y=!1},d(v){v&&(_(t),_(r),_(l),_(a),_(p),_(h),_(m),_(d)),M(s,v),M(b),M(B),M(H),T=!1,N()}}}function Kl(e){let t,n;return t=new et({props:{$$slots:{default:[Yl]},$$scope:{ctx:e}}}),t.$on("cancel",e[6]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&32831&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ea(e,t,n){let i,r,s,o;ne(e,Se,E=>n(5,s=E)),ne(e,we,E=>n(10,o=E));let{params:l={}}=t,a={},u="",f="";async function p(E){if(n(1,h=""),!!a.hasOwnProperty("id")){if(E.length===0){n(1,h=s("abbreviation.empty"));return}if(o)try{const H=await pi(E);H.hasOwnProperty("abbreviation")&&H.abbreviation.length>0&&H.id!==a.id&&n(1,h=s("abbreviation.exists"))}catch(H){await oe(s("edit_snippet.error_title"),H)}}}let h="";function m(){Be()}async function d(){try{await _r(a.abbreviation),await Be()}catch(E){await oe(s("remove_snippet.error_title"),E)}}async function b(){let E={...a};E.abbreviation=u,E.body=f;try{await Sr(a.id,E),await Be()}catch(H){await oe(s("edit_snippet.error_title"),H)}}Je(async()=>{l.hasOwnProperty("id")||(await oe(s("edit_snippet.error_title"),s("edit_snippet.id_not_supplied")),await Be());try{a=await fr(l.id)}catch(H){await oe(s("edit_snippet.error_title"),H),await Be()}let E=!1;try{E=await pr(a.id)}catch(H){await oe(s("edit_snippet.error_title"),H),await Be()}E&&(await oe(s("edit_snippet.error_title"),s("edit_snippet.snippet_not_found")),await Be()),n(0,u=a.abbreviation),n(2,f=a.body)});function I(E){u=E,n(0,u)}function B(){f=this.value,n(2,f)}return e.$$set=E=>{"params"in E&&n(9,l=E.params)},e.$$.update=()=>{e.$$.dirty&1&&p(u),e.$$.dirty&1026&&n(4,i=!o||h.length>0),e.$$.dirty&1024&&n(3,r=!o)},[u,h,f,r,i,s,m,d,b,l,o,I,B]}class ta extends Y{constructor(t){super(),J(this,t,ea,Kl,Z,{params:9})}}function na(e){let t,n,i,r,s,o;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:xi,size:"2.5x",title:e[6]("button.back")}}),t.$on("activate",e[8]),i=new kn({}),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:wo,size:"2.5x",title:e[6]("button.about")}}),s.$on("activate",e[9]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a[0]&64&&(u.title=l[6]("button.back")),t.$set(u);const f={};a[0]&64&&(f.title=l[6]("button.about")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function ia(e){let t,n=e[6]("settings.custom_shortcuts_disabled")+"",i;return{c(){t=L("p"),i=$(n),c(t,"class","dimmed svelte-1fggvh7")},m(r,s){g(r,t,s),A(t,i)},p(r,s){s[0]&64&&n!==(n=r[6]("settings.custom_shortcuts_disabled")+"")&&z(i,n)},i:G,o:G,d(r){r&&_(t)}}}function ra(e){let t,n,i,r;const s=[oa,sa],o=[];function l(a,u){return a[5].length>0?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,u){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function sa(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,a;return s=new xt({props:{shortcut:e[6]("settings.custom_shortcut_empty")}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Ot,size:"2.0x",title:e[6]("settings.add_default_custom_shortcut")}}),l.$on("activate",e[22]),{c(){t=L("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","row svelte-1fggvh7")},m(u,f){g(u,t,f),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),a=!0},p(u,f){(!a||f[0]&64)&&n!==(n=u[6]("settings.custom_shortcut")+"")&&z(i,n);const p={};f[0]&64&&(p.shortcut=u[6]("settings.custom_shortcut_empty")),s.$set(p);const h={};f[0]&64&&(h.title=u[6]("settings.add_default_custom_shortcut")),l.$set(h)},i(u){a||(w(s.$$.fragment,u),w(l.$$.fragment,u),a=!0)},o(u){S(s.$$.fragment,u),S(l.$$.fragment,u),a=!1},d(u){u&&_(t),M(s),M(l)}}}function oa(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,a,u,f=e[6]("settings.change_custom_shortcut_desc")+"",p,h;return s=new xt({props:{shortcut:e[5]}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Co,size:"1.75x",title:e[6]("settings.remove_custom_shortcut")}}),l.$on("activate",e[21]),{c(){t=L("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),a=R(),u=L("p"),p=$(f),c(t,"class","row svelte-1fggvh7"),c(u,"class","dimmed svelte-1fggvh7")},m(m,d){g(m,t,d),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),g(m,a,d),g(m,u,d),A(u,p),h=!0},p(m,d){(!h||d[0]&64)&&n!==(n=m[6]("settings.custom_shortcut")+"")&&z(i,n);const b={};d[0]&32&&(b.shortcut=m[5]),s.$set(b);const I={};d[0]&64&&(I.title=m[6]("settings.remove_custom_shortcut")),l.$set(I),(!h||d[0]&64)&&f!==(f=m[6]("settings.change_custom_shortcut_desc")+"")&&z(p,f)},i(m){h||(w(s.$$.fragment,m),w(l.$$.fragment,m),h=!0)},o(m){S(s.$$.fragment,m),S(l.$$.fragment,m),h=!1},d(m){m&&(_(t),_(a),_(u)),M(s),M(l)}}}function la(e){let t=e[6]("settings.no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("settings.no_connection")+"")&&z(n,t)},i:G,o:G,d(i){i&&_(n)}}}function aa(e){let t,n=e[6]("settings.import_export_title")+"",i,r,s,o,l,a,u,f,p;o=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.new_only_title"),$$slots:{default:[ua]},$$scope:{ctx:e}}}),o.$on("activate",e[25]),a=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.update_title"),$$slots:{default:[fa]},$$scope:{ctx:e}}}),a.$on("activate",e[26]);let h=e[7]&&e[7].length>0&&ri(e);return{c(){t=L("h3"),i=$(n),r=R(),s=L("p"),U(o.$$.fragment),l=R(),U(a.$$.fragment),u=R(),h&&h.c(),f=ye(),c(t,"class","svelte-1fggvh7"),c(s,"class","import-snippets svelte-1fggvh7")},m(m,d){g(m,t,d),A(t,i),g(m,r,d),g(m,s,d),O(o,s,null),A(s,l),O(a,s,null),g(m,u,d),h&&h.m(m,d),g(m,f,d),p=!0},p(m,d){(!p||d[0]&64)&&n!==(n=m[6]("settings.import_export_title")+"")&&z(i,n);const b={};d[0]&64&&(b.title=m[6]("import_snippets.new_only_title")),d[0]&64|d[1]&4&&(b.$$scope={dirty:d,ctx:m}),o.$set(b);const I={};d[0]&64&&(I.title=m[6]("import_snippets.update_title")),d[0]&64|d[1]&4&&(I.$$scope={dirty:d,ctx:m}),a.$set(I),m[7]&&m[7].length>0?h?(h.p(m,d),d[0]&128&&w(h,1)):(h=ri(m),h.c(),w(h,1),h.m(f.parentNode,f)):h&&(ue(),S(h,1,1,()=>{h=null}),fe())},i(m){p||(w(o.$$.fragment,m),w(a.$$.fragment,m),w(h),p=!0)},o(m){S(o.$$.fragment,m),S(a.$$.fragment,m),S(h),p=!1},d(m){m&&(_(t),_(r),_(s),_(u),_(f)),M(o),M(a),h&&h.d(m)}}}function ua(e){let t=e[6]("import_snippets.new_only_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.new_only_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function fa(e){let t=e[6]("import_snippets.update_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.update_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function ri(e){let t,n,i;return n=new de({props:{horizontal:!0,iconClass:"dimmed",icon:fo,size:"1.5x",title:e[6]("export_snippets.title"),$$slots:{default:[ca]},$$scope:{ctx:e}}}),n.$on("activate",e[16]),{c(){t=L("p"),U(n.$$.fragment),c(t,"class","export-snippets svelte-1fggvh7")},m(r,s){g(r,t,s),O(n,t,null),i=!0},p(r,s){const o={};s[0]&64&&(o.title=r[6]("export_snippets.title")),s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),n.$set(o)},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function ca(e){let t=e[6]("export_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("export_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function ha(e){let t,n,i,r=e[6]("settings.title")+"",s,o,l,a=e[6]("settings.autostart_title")+"",u,f,p,h,m,d,b=e[6]("settings.autostart")+"",I,B,E,H=e[6]("settings.autoexpand_title")+"",y,T,N,k,x,v,P=e[6]("settings.autoexpand")+"",C,le,re,ae=e[6]("settings.search_and_paste_title")+"",_e,ge,ce,pe,he,j,ie,F,K,Pe=e[6]("settings.focus_search")+"",Ut,Dt,be,ke,tt,Ae,Gt,An;t=new Rt({props:{$$slots:{default:[na]},$$scope:{ctx:e}}});const Bn=[ra,ia],Ie=[];function Tn(D,W){return D[4]?0:1}ce=Tn(e),pe=Ie[ce]=Bn[ce](e);const In=[aa,la],He=[];function Hn(D,W){return D[0]?0:1}return be=Hn(e),ke=He[be]=In[be](e),{c(){U(t.$$.fragment),n=R(),i=L("h2"),s=$(r),o=R(),l=L("h3"),u=$(a),f=R(),p=L("p"),h=L("label"),m=L("input"),d=R(),I=$(b),B=R(),E=L("h3"),y=$(H),T=R(),N=L("p"),k=L("label"),x=L("input"),v=R(),C=$(P),le=R(),re=L("h3"),_e=$(ae),ge=R(),pe.c(),he=R(),j=L("p"),ie=L("label"),F=L("input"),K=R(),Ut=$(Pe),Dt=R(),ke.c(),tt=ye(),c(i,"class","svelte-1fggvh7"),c(l,"class","svelte-1fggvh7"),c(m,"type","checkbox"),c(p,"class","svelte-1fggvh7"),c(E,"class","svelte-1fggvh7"),c(x,"type","checkbox"),c(N,"class","svelte-1fggvh7"),c(re,"class","svelte-1fggvh7"),c(F,"type","checkbox"),c(j,"class","svelte-1fggvh7")},m(D,W){O(t,D,W),g(D,n,W),g(D,i,W),A(i,s),g(D,o,W),g(D,l,W),A(l,u),g(D,f,W),g(D,p,W),A(p,h),A(h,m),m.checked=e[1],A(h,d),A(h,I),g(D,B,W),g(D,E,W),A(E,y),g(D,T,W),g(D,N,W),A(N,k),A(k,x),x.checked=e[2],A(k,v),A(k,C),g(D,le,W),g(D,re,W),A(re,_e),g(D,ge,W),Ie[ce].m(D,W),g(D,he,W),g(D,j,W),A(j,ie),A(ie,F),F.checked=e[3],A(ie,K),A(ie,Ut),g(D,Dt,W),He[be].m(D,W),g(D,tt,W),Ae=!0,Gt||(An=[te(m,"change",e[17]),te(m,"change",e[18]),dn(Ui.call(null,m,!0)),te(x,"change",e[19]),te(x,"change",e[20]),te(F,"change",e[23]),te(F,"change",e[24])],Gt=!0)},p(D,W){const Cn={};W[0]&64|W[1]&4&&(Cn.$$scope={dirty:W,ctx:D}),t.$set(Cn),(!Ae||W[0]&64)&&r!==(r=D[6]("settings.title")+"")&&z(s,r),(!Ae||W[0]&64)&&a!==(a=D[6]("settings.autostart_title")+"")&&z(u,a),W[0]&2&&(m.checked=D[1]),(!Ae||W[0]&64)&&b!==(b=D[6]("settings.autostart")+"")&&z(I,b),(!Ae||W[0]&64)&&H!==(H=D[6]("settings.autoexpand_title")+"")&&z(y,H),W[0]&4&&(x.checked=D[2]),(!Ae||W[0]&64)&&P!==(P=D[6]("settings.autoexpand")+"")&&z(C,P),(!Ae||W[0]&64)&&ae!==(ae=D[6]("settings.search_and_paste_title")+"")&&z(_e,ae);let $t=ce;ce=Tn(D),ce===$t?Ie[ce].p(D,W):(ue(),S(Ie[$t],1,1,()=>{Ie[$t]=null}),fe(),pe=Ie[ce],pe?pe.p(D,W):(pe=Ie[ce]=Bn[ce](D),pe.c()),w(pe,1),pe.m(he.parentNode,he)),W[0]&8&&(F.checked=D[3]),(!Ae||W[0]&64)&&Pe!==(Pe=D[6]("settings.focus_search")+"")&&z(Ut,Pe);let jt=be;be=Hn(D),be===jt?He[be].p(D,W):(ue(),S(He[jt],1,1,()=>{He[jt]=null}),fe(),ke=He[be],ke?ke.p(D,W):(ke=He[be]=In[be](D),ke.c()),w(ke,1),ke.m(tt.parentNode,tt))},i(D){Ae||(w(t.$$.fragment,D),w(pe),w(ke),Ae=!0)},o(D){S(t.$$.fragment,D),S(pe),S(ke),Ae=!1},d(D){D&&(_(n),_(i),_(o),_(l),_(f),_(p),_(B),_(E),_(T),_(N),_(le),_(re),_(ge),_(he),_(j),_(Dt),_(tt)),M(t,D),Ie[ce].d(D),He[be].d(D),Gt=!1,Ee(An)}}}function pa(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[ha]},$$scope:{ctx:e}}}),t.$on("cancel",e[8]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r[0]&255|r[1]&4&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}const ma="Snippet Expander Search & Paste pop-up window",Kt="snippetexpandergui --search-and-paste",si="<Ctrl>grave";function da(e,t,n){let i,r,s;ne(e,Se,j=>n(6,i=j)),ne(e,we,j=>n(0,r=j)),ne(e,Me,j=>n(7,s=j));let o=!1,l=!1,a=!0,u=!1,f=si;function p(){Be()}function h(){je("/about")}async function m(){let j=!1;try{j=await ar()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function d(j){try{await yr(j)}catch(ie){await oe(i("settings.save_error_title"),ie);return}return j}async function b(){let j=!1;try{j=await lr()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function I(j){try{await Er(j)}catch(ie){await oe(i("settings.save_error_title"),ie);return}return j}async function B(){let j="";try{j=await hi("FOCUS_SEARCH_BOX")}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j!=="false"}async function E(){let j=!1;try{j=await nr()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function H(){try{n(5,f=await ur(Kt))}catch(j){await oe(i("settings.get_error_title"),j);return}}async function y(){try{await gr(ma,si,Kt,"")}catch(j){await oe(i("settings.save_error_title"),j)}await H()}async function T(){try{await rr(Kt,f)}catch(j){await oe(i("settings.delete_error_title"),j)}await H()}async function N(j){const ie=j?"true":"false";try{await br("FOCUS_SEARCH_BOX",ie)}catch(F){await oe(i("settings.save_error_title"),F);return}return j}function k(j){Me.fetch()}async function x(j){try{const ie=await mi(j)}catch(ie){await oe(i("import_snippets.error_title"),ie)}await Me.fetch()}async function v(){try{const j=await sr()}catch(j){await oe(i("export_snippets.error_title"),j)}}Je(async()=>{n(1,o=await m()),n(2,l=await b()),n(3,a=await B()),n(4,u=await E()),u&&await H()});function P(){o=this.checked,n(1,o)}const C=()=>d(o);function le(){l=this.checked,n(2,l)}const re=()=>I(l),ae=()=>T(),_e=()=>y();function ge(){a=this.checked,n(3,a)}const ce=()=>N(a),pe=()=>x(!1),he=()=>x(!0);return e.$$.update=()=>{e.$$.dirty[0]&1&&k()},[r,o,l,a,u,f,i,s,p,h,d,I,y,T,N,x,v,P,C,le,re,ae,_e,ge,ce,pe,he]}class _a extends Y{constructor(t){super(),J(this,t,da,pa,Z,{},null,[-1,-1])}}const ga="/assets/snippetexpander-icon-128-1d7040bc.svg";function ba(e){let t,n;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:xi,size:"2.5x",title:e[3]("button.back")}}),t.$on("activate",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.title=i[3]("button.back")),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function va(e){let t,n,i,r,s,o,l,a,u,f=e[3]("about.description")+"",p,h,m,d,b,I,B,E,H,y,T=e[3]("about.by")+"",N,k,x,v,P,C,le=e[3]("about.licence_title")+"",re,ae,_e,ge,ce=e[3]("about.licence")+"",pe,he,j,ie;return t=new Rt({props:{$$slots:{default:[ba]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment),n=R(),i=L("img"),s=R(),o=L("h2"),o.textContent="Snippet Expander",l=R(),a=L("p"),u=L("em"),p=$(f),h=R(),m=L("p"),d=L("a"),b=$(e[2]),I=R(),B=L("p"),E=L("a"),E.textContent="snippetexpander.org",H=R(),y=L("h3"),N=$(T),k=R(),x=L("p"),v=L("a"),v.textContent="ianmjones",P=R(),C=L("h3"),re=$(le),ae=R(),_e=L("p"),ge=L("a"),pe=$(ce),zi(i.src,r=ga)||c(i,"src",r),c(i,"alt","Snippet Expander icon"),c(o,"class","svelte-sjm2tb"),c(a,"class","svelte-sjm2tb"),c(d,"href",e[0]),c(m,"class","svelte-sjm2tb"),c(E,"href","https://snippetexpander.org"),c(B,"class","svelte-sjm2tb"),c(y,"class","svelte-sjm2tb"),c(v,"href","https://ianmjones.com"),c(x,"class","svelte-sjm2tb"),c(C,"class","svelte-sjm2tb"),c(ge,"href",e[1]),c(_e,"class","svelte-sjm2tb")},m(F,K){O(t,F,K),g(F,n,K),g(F,i,K),g(F,s,K),g(F,o,K),g(F,l,K),g(F,a,K),A(a,u),A(u,p),g(F,h,K),g(F,m,K),A(m,d),A(d,b),g(F,I,K),g(F,B,K),A(B,E),g(F,H,K),g(F,y,K),A(y,N),g(F,k,K),g(F,x,K),A(x,v),g(F,P,K),g(F,C,K),A(C,re),g(F,ae,K),g(F,_e,K),A(_e,ge),A(ge,pe),he=!0,j||(ie=[te(d,"click",vt(e[6])),te(E,"click",vt(e[7])),te(v,"click",vt(e[8])),te(ge,"click",vt(e[9]))],j=!0)},p(F,K){const Pe={};K&1032&&(Pe.$$scope={dirty:K,ctx:F}),t.$set(Pe),(!he||K&8)&&f!==(f=F[3]("about.description")+"")&&z(p,f),(!he||K&4)&&z(b,F[2]),(!he||K&1)&&c(d,"href",F[0]),(!he||K&8)&&T!==(T=F[3]("about.by")+"")&&z(N,T),(!he||K&8)&&le!==(le=F[3]("about.licence_title")+"")&&z(re,le),(!he||K&8)&&ce!==(ce=F[3]("about.licence")+"")&&z(pe,ce),(!he||K&2)&&c(ge,"href",F[1])},i(F){he||(w(t.$$.fragment,F),he=!0)},o(F){S(t.$$.fragment,F),he=!1},d(F){F&&(_(n),_(i),_(s),_(o),_(l),_(a),_(h),_(m),_(I),_(B),_(H),_(y),_(k),_(x),_(P),_(C),_(ae),_(_e)),M(t,F),j=!1,Ee(ie)}}}function wa(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[va]},$$scope:{ctx:e}}}),t.$on("cancel",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&1039&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ea(e,t,n){let i,r,s,o;ne(e,Se,m=>n(3,o=m));function l(){Be()}let a="";Je(async()=>{n(5,a=await hr())});const u=()=>wt(r),f=()=>wt("https://snippetexpander.org"),p=()=>wt("https://ianmjones.com"),h=()=>wt(s);return e.$$.update=()=>{e.$$.dirty&32&&n(2,i="v"+a),e.$$.dirty&32&&n(0,r="https://git.sr.ht/~ianmjones/snippetexpander/tree/"+a),e.$$.dirty&1&&n(1,s=r+"/item/LICENSE")},[r,s,i,o,l,a,u,f,p,h]}class ya extends Y{constructor(t){super(),J(this,t,Ea,wa,Z,{})}}function Sa(e){let t,n;return t=new no({props:{routes:e[1]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ka(e){let t;return{c(){t=$("Loading...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Aa(e){let t,n,i,r;const s=[ka,Sa],o=[];function l(a,u){return a[0]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function Ba(e,t,n){let i;ne(e,kt,a=>n(0,i=a));let r;async function s(){try{const a=await dr("Pong");a==="Pong"?we.update(u=>!0):(we.update(u=>!1),Vt("Got '"+a+"' back from Ping instead of 'Pong'.")),rt.update(u=>!0),Ht.update(u=>!1)}catch(a){we.update(u=>!1),Vt("Ping returned: "+a),o()}}async function o(){try{await ir()?rt.update(u=>!0):rt.update(u=>!1)}catch(a){rt.update(u=>!1),Vt("DaemonInstalled returned: "+a)}}Os("en-GB",()=>Fi(()=>import("./en-GB-f23fefe1.js"),[])),xs({fallbackLocale:"en-GB",initialLocale:Rs()});const l={"/":jl,"/snippet/add":ql,"/snippet/edit/:id":ta,"/settings":_a,"/about":ya};return Je(async()=>{await s(),r=setInterval(s,5e3)}),_n(()=>{clearInterval(r)}),[i,l]}class Ta extends Y{constructor(t){super(),J(this,t,Ba,Aa,Z,{})}}new Ta({target:document.getElementById("app")});

R cmd/snippetpixiegui/frontend/dist/assets/index-e2d949f4.css => cmd/snippetexpandergui/frontend/dist/assets/index-e2d949f4.css +0 -0
R cmd/snippetpixiegui/frontend/dist/assets/snippetpixie-icon-128-1d7040bc.svg => cmd/snippetexpandergui/frontend/dist/assets/snippetexpander-icon-128-1d7040bc.svg +0 -0
R cmd/snippetpixiegui/frontend/dist/index.html => cmd/snippetexpandergui/frontend/dist/index.html +3 -3
@@ 4,12 4,12 @@
	<meta charset="UTF-8"/>
	<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
	
	<title>Snippet Pixie</title>
  <script type="module" crossorigin src="/assets/index-288ebb61.js"></script>
	<title>Snippet Expander</title>
  <script type="module" crossorigin src="/assets/index-93f98e6b.js"></script>
  <link rel="stylesheet" href="/assets/index-e2d949f4.css">
</head>
<body>
<div id="app"></div>

</body>
</html>
\ No newline at end of file
</html>

R cmd/snippetpixiegui/frontend/index.html => cmd/snippetexpandergui/frontend/index.html +2 -2
@@ 4,10 4,10 @@
	<meta charset="UTF-8"/>
	<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
	<link href="./src/global.css" rel="stylesheet">
	<title>Snippet Pixie</title>
	<title>Snippet Expander</title>
</head>
<body>
<div id="app"></div>
<script src="./src/main.js" type="module"></script>
</body>
</html>
\ No newline at end of file
</html>

R cmd/snippetpixiegui/frontend/jsconfig.json => cmd/snippetexpandergui/frontend/jsconfig.json +0 -0
R cmd/snippetpixiegui/frontend/package-lock.json => cmd/snippetexpandergui/frontend/package-lock.json +0 -0
R cmd/snippetpixiegui/frontend/package.json => cmd/snippetexpandergui/frontend/package.json +0 -0
R cmd/snippetpixiegui/frontend/package.json.md5 => cmd/snippetexpandergui/frontend/package.json.md5 +0 -0
R cmd/snippetpixiegui/frontend/src/App.svelte => cmd/snippetexpandergui/frontend/src/App.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/assets/snippetpixie-icon-128.svg => cmd/snippetexpandergui/frontend/src/assets/snippetexpander-icon-128.svg +0 -0
R cmd/snippetpixiegui/frontend/src/components/AboutScreen.svelte => cmd/snippetexpandergui/frontend/src/components/AboutScreen.svelte +5 -5
@@ 8,7 8,7 @@
	import Screen from "./Screen.svelte";
	import Toolbar from "./Toolbar.svelte";
	import IconButton from "./IconButton.svelte";
	import SnippetPixieIcon from "../assets/snippetpixie-icon-128.svg";
	import SnippetExpanderIcon from "../assets/snippetexpander-icon-128.svg";

	function handleCancel() {
		pop();


@@ 17,7 17,7 @@
	let version = "";

	$: versionStr = "v" + version;
	$: versionURL = "https://git.sr.ht/~ianmjones/snippetpixie/tree/" + version;
	$: versionURL = "https://git.sr.ht/~ianmjones/snippetexpander/tree/" + version;
	$: licenceURL = versionURL + "/item/LICENSE";

	onMount(async () => {


@@ 36,12 36,12 @@
			on:activate={handleCancel}
		/>
	</Toolbar>
	<img src={SnippetPixieIcon} alt="Snippet Pixie icon">
	<h2>Snippet Pixie</h2>
	<img src={SnippetExpanderIcon} alt="Snippet Expander icon">
	<h2>Snippet Expander</h2>
	<p><em>{$_( "about.description" )}</em></p>
	<p><a href={versionURL} on:click|preventDefault={() => BrowserOpenURL(versionURL)}>{versionStr}</a></p>
	<p>
		<a href="https://snippetpixie.org" on:click|preventDefault={() => BrowserOpenURL("https://snippetpixie.org")}>snippetpixie.org</a>
		<a href="https://snippetexpander.org" on:click|preventDefault={() => BrowserOpenURL("https://snippetexpander.org")}>snippetexpander.org</a>
	</p>
	<h3>{$_( "about.by" )}</h3>
	<p><a href="https://ianmjones.com" on:click|preventDefault={() => BrowserOpenURL("https://ianmjones.com")}>ianmjones</a></p>

R cmd/snippetpixiegui/frontend/src/components/AddSnippetScreen.svelte => cmd/snippetexpandergui/frontend/src/components/AddSnippetScreen.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/Button.svelte => cmd/snippetexpandergui/frontend/src/components/Button.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/DaemonNotInstalledNotice.svelte => cmd/snippetexpandergui/frontend/src/components/DaemonNotInstalledNotice.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/EditSnippetScreen.svelte => cmd/snippetexpandergui/frontend/src/components/EditSnippetScreen.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/IconButton.svelte => cmd/snippetexpandergui/frontend/src/components/IconButton.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/Input.svelte => cmd/snippetexpandergui/frontend/src/components/Input.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/ListSnippetsScreen.svelte => cmd/snippetexpandergui/frontend/src/components/ListSnippetsScreen.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/MainScreen.svelte => cmd/snippetexpandergui/frontend/src/components/MainScreen.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/NoConnectionNotice.svelte => cmd/snippetexpandergui/frontend/src/components/NoConnectionNotice.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/Notice.svelte => cmd/snippetexpandergui/frontend/src/components/Notice.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/Screen.svelte => cmd/snippetexpandergui/frontend/src/components/Screen.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/SettingsScreen.svelte => cmd/snippetexpandergui/frontend/src/components/SettingsScreen.svelte +2 -2
@@ 33,8 33,8 @@
	import IconButton from "./IconButton.svelte";
	import ShortcutButton from "./ShortcutButton.svelte";

	const customShortcutName = "Snippet Pixie Search & Paste pop-up window";
	const customShortcutCommand = "snippetpixiegui --search-and-paste";
	const customShortcutName = "Snippet Expander Search & Paste pop-up window";
	const customShortcutCommand = "snippetexpandergui --search-and-paste";
	const customShortcutDefaultBinding = "<Ctrl>grave";

	let autostart = false;

R cmd/snippetpixiegui/frontend/src/components/ShortcutButton.svelte => cmd/snippetexpandergui/frontend/src/components/ShortcutButton.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/SnippetsList.svelte => cmd/snippetexpandergui/frontend/src/components/SnippetsList.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/SnippetsListItem.svelte => cmd/snippetexpandergui/frontend/src/components/SnippetsListItem.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/StartDaemonNotice.svelte => cmd/snippetexpandergui/frontend/src/components/StartDaemonNotice.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/StartingDaemonNotice.svelte => cmd/snippetexpandergui/frontend/src/components/StartingDaemonNotice.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/Toolbar.svelte => cmd/snippetexpandergui/frontend/src/components/Toolbar.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/ToolbarSpacer.svelte => cmd/snippetexpandergui/frontend/src/components/ToolbarSpacer.svelte +0 -0
R cmd/snippetpixiegui/frontend/src/components/WelcomeScreen.svelte => cmd/snippetexpandergui/frontend/src/components/WelcomeScreen.svelte +1 -1
@@ 32,7 32,7 @@
</script>

<Screen centered>
	<h1>Snippet Pixie</h1>
	<h1>Snippet Expander</h1>
	<p class="dimmed">{$_("no_snippets_found.title")}</p>
	{#if $connectionOK}
		<p class="add-snippet">

R cmd/snippetpixiegui/frontend/src/global.css => cmd/snippetexpandergui/frontend/src/global.css +0 -0
R cmd/snippetpixiegui/frontend/src/js/focus.js => cmd/snippetexpandergui/frontend/src/js/focus.js +0 -0
R cmd/snippetpixiegui/frontend/src/js/scrollIntoView.js => cmd/snippetexpandergui/frontend/src/js/scrollIntoView.js +0 -0
R cmd/snippetpixiegui/frontend/src/js/select.js => cmd/snippetexpandergui/frontend/src/js/select.js +0 -0
R cmd/snippetpixiegui/frontend/src/js/stores.js => cmd/snippetexpandergui/frontend/src/js/stores.js +0 -0
R cmd/snippetpixiegui/frontend/src/main.js => cmd/snippetexpandergui/frontend/src/main.js +0 -0
R cmd/snippetpixiegui/frontend/src/vite-env.d.ts => cmd/snippetexpandergui/frontend/src/vite-env.d.ts +0 -0
R cmd/snippetpixiegui/frontend/vite.config.js => cmd/snippetexpandergui/frontend/vite.config.js +0 -0
R cmd/snippetpixiegui/go.mod => cmd/snippetexpandergui/go.mod +9 -9
@@ 1,20 1,20 @@
module git.sr.ht/~ianmjones/snippetpixie/cmd/snippetpixiegui
module git.sr.ht/~ianmjones/snippetexpander/cmd/snippetexpandergui

go 1.19

replace git.sr.ht/~ianmjones/snippetpixie/internal/export v0.0.0-unpublished => ../../internal/export
replace git.sr.ht/~ianmjones/snippetexpander/internal/export v0.0.0-unpublished => ../../internal/export

replace git.sr.ht/~ianmjones/snippetpixie/internal/service v0.0.0-unpublished => ../../internal/service
replace git.sr.ht/~ianmjones/snippetexpander/internal/service v0.0.0-unpublished => ../../internal/service

replace git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice
replace git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice

replace git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet
replace git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet

require (
	git.sr.ht/~ianmjones/snippetpixie/internal/export v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/internal/service v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/internal/export v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/internal/service v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished
	github.com/godbus/dbus/v5 v5.1.0
	github.com/gofrs/uuid v4.4.0+incompatible
	github.com/matryer/is v1.4.1

R cmd/snippetpixiegui/go.sum => cmd/snippetexpandergui/go.sum +0 -0
R cmd/snippetpixiegui/i18n/en-GB.json => cmd/snippetexpandergui/i18n/en-GB.json +79 -79
@@ 1,81 1,81 @@
{
  "abbreviation": {
    "title": "Abbreviation",
    "empty": "Please enter an Abbreviation",
    "exists": "That Abbreviation already exists"
  },
  "body": {
    "title": "Body"
  },
  "add_snippet": {
    "title": "Add Snippet",
    "error_title": "Error adding snippet"
  },
  "edit_snippet": {
    "title": "Edit Snippet",
    "error_title": "Error editing snippet",
    "id_not_supplied": "A Snippet ID was not specified for edit.",
    "snippet_not_found": "Could not find Snippet for edit."
  },
  "remove_snippet": {
    "title": "Remove Snippet",
    "error_title": "Error removing snippet"
  },
  "import_snippets": {
    "title": "Import Snippets",
    "new_only_title": "Import Snippets: Discarding Duplicates",
    "update_title": "Import Snippets: Update Existing",
    "error_title": "Error importing snippets"
  },
  "export_snippets": {
    "title": "Export Snippets",
    "error_title": "Error exporting snippets"
  },
  "settings": {
    "title": "Settings",
    "import_export_title": "Import & Export",
    "get_error_title": "Error getting settings",
    "save_error_title": "Error saving settings",
    "no_connection": "Settings can only be changed when the daemon is running.",
    "autostart_title": "Auto Start",
    "autostart": "Start daemon on login",
    "autoexpand_title": "Auto Expand Snippets",
    "autoexpand": "Auto expand snippets as they are typed",
    "search_and_paste_title": "Search & Paste",
    "focus_search": "Focus search box",
    "custom_shortcuts_disabled": "Unable to get or set custom shortcut, please set it manually.",
    "custom_shortcut": "Custom Shortcut",
    "custom_shortcut_empty": "none",
    "remove_custom_shortcut": "Remove custom shortcut",
    "change_custom_shortcut_desc": "To change the custom shortcut, please use your system's settings application.",
    "add_default_custom_shortcut": "Add default custom shortcut"
  },
  "no_connection": "Could not connect to the snippetpixied daemon.",
  "no_snippets_found": {
    "title": "No Snippets Found",
    "description": "Please try entering a different search term."
  },
  "button": {
    "cancel": "Cancel",
    "save": "Save",
    "remove": "Remove",
    "back": "Back",
    "about": "About"
  },
  "loading": "Loading…",
  "search": "Search…",
  "clear": "Clear",
  "daemon": {
    "not_installed": "It does not look like the required snippetpixied daemon is installed.",
    "installed": "It looks like snippetpixied is installed.",
    "start": "Start it?",
    "starting": "Starting snippetpixied…"
  },
  "about": {
    "description": "Your little expandable text snippet helper",
    "source": "Source",
    "licence_title": "Licence",
    "licence": "GNU General Public License Version 2 Plus (GPLv2+)",
    "by": "By"
  }
	"abbreviation": {
		"title": "Abbreviation",
		"empty": "Please enter an Abbreviation",
		"exists": "That Abbreviation already exists"
	},
	"body": {
		"title": "Body"
	},
	"add_snippet": {
		"title": "Add Snippet",
		"error_title": "Error adding snippet"
	},
	"edit_snippet": {
		"title": "Edit Snippet",
		"error_title": "Error editing snippet",
		"id_not_supplied": "A Snippet ID was not specified for edit.",
		"snippet_not_found": "Could not find Snippet for edit."
	},
	"remove_snippet": {
		"title": "Remove Snippet",
		"error_title": "Error removing snippet"
	},
	"import_snippets": {
		"title": "Import Snippets",
		"new_only_title": "Import Snippets: Discarding Duplicates",
		"update_title": "Import Snippets: Update Existing",
		"error_title": "Error importing snippets"
	},
	"export_snippets": {
		"title": "Export Snippets",
		"error_title": "Error exporting snippets"
	},
	"settings": {
		"title": "Settings",
		"import_export_title": "Import & Export",
		"get_error_title": "Error getting settings",
		"save_error_title": "Error saving settings",
		"no_connection": "Settings can only be changed when the daemon is running.",
		"autostart_title": "Auto Start",
		"autostart": "Start daemon on login",
		"autoexpand_title": "Auto Expand Snippets",
		"autoexpand": "Auto expand snippets as they are typed",
		"search_and_paste_title": "Search & Paste",
		"focus_search": "Focus search box",
		"custom_shortcuts_disabled": "Unable to get or set custom shortcut, please set it manually.",
		"custom_shortcut": "Custom Shortcut",
		"custom_shortcut_empty": "none",
		"remove_custom_shortcut": "Remove custom shortcut",
		"change_custom_shortcut_desc": "To change the custom shortcut, please use your system's settings application.",
		"add_default_custom_shortcut": "Add default custom shortcut"
	},
	"no_connection": "Could not connect to the snippetexpanderd daemon.",
	"no_snippets_found": {
		"title": "No Snippets Found",
		"description": "Please try entering a different search term."
	},
	"button": {
		"cancel": "Cancel",
		"save": "Save",
		"remove": "Remove",
		"back": "Back",
		"about": "About"
	},
	"loading": "Loading…",
	"search": "Search…",
	"clear": "Clear",
	"daemon": {
		"not_installed": "It does not look like the required snippetexpanderd daemon is installed.",
		"installed": "It looks like snippetexpanderd is installed.",
		"start": "Start it?",
		"starting": "Starting snippetexpanderd…"
	},
	"about": {
		"description": "Your little expandable text snippet helper",
		"source": "Source",
		"licence_title": "Licence",
		"licence": "GNU General Public License Version 2 Plus (GPLv2+)",
		"by": "By"
	}
}

R cmd/snippetpixiegui/main.go => cmd/snippetexpandergui/main.go +1 -1
@@ 40,7 40,7 @@ func main() {
	}

	opts := &options.App{
		Title:            "Snippet Pixie",
		Title:            "Snippet Expander",
		Width:            width,
		Height:           height,
		MinWidth:         minWidth,

R cmd/snippetpixiegui/wails.json => cmd/snippetexpandergui/wails.json +10 -10
@@ 1,12 1,12 @@
{
  "name": "snippetpixiegui",
  "outputfilename": "snippetpixiegui",
  "frontend:install": "npm install",
  "frontend:build": "npm run build",
  "frontend:dev:watcher": "npm run dev",
  "frontend:dev:serverUrl": "auto",
  "author": {
    "name": "Ian M. Jones",
    "email": "ian@ianmjones.com"
  }
	"name": "snippetexpandergui",
	"outputfilename": "snippetexpandergui",
	"frontend:install": "npm install",
	"frontend:build": "npm run build",
	"frontend:dev:watcher": "npm run dev",
	"frontend:dev:serverUrl": "auto",
	"author": {
		"name": "Ian M. Jones",
		"email": "ian@ianmjones.com"
	}
}

R cmd/snippetpixiex/.gitignore => cmd/snippetexpanderx/.gitignore +0 -0
R cmd/snippetpixiex/Makefile => cmd/snippetexpanderx/Makefile +1 -1
@@ 1,4 1,4 @@
OBJ := snippetpixiex
OBJ := snippetexpanderx

VALA_SRC := $(shell find . -type f -name "*.vala")
VALA_ARGS := --pkg x11 --pkg ibus-1.0 --pkg gtk+-3.0 --pkg gobject-2.0 --pkg glib-2.0 --pkg gee-0.8 --pkg gdk-x11-3.0 --pkg atspi-2

A cmd/snippetexpanderx/snippetexpanderx => cmd/snippetexpanderx/snippetexpanderx +0 -0
R cmd/snippetpixiex/snippetpixiex-application.vala => cmd/snippetexpanderx/snippetexpanderx-application.vala +5 -5
@@ 19,9 19,9 @@
*
*/

namespace SnippetPixieX {
namespace SnippetExpanderX {
    public class Application : Gtk.Application {
        public const string ID = "org.snippetpixie.snippetpixiex";
        public const string ID = "org.snippetexpander.snippetexpanderx";
        public const string VERSION = "2.0.0-alpha.7";

        private const ulong SLEEP_INTERVAL = (ulong) TimeSpan.MILLISECOND * 10;


@@ 512,9 512,9 @@ namespace SnippetPixieX {
            bool help = false;

            OptionEntry[] options = new OptionEntry[5];
            options[0] = { "start", 0, 0, OptionArg.NONE, ref start, "Start the Snippet Pixie auto expander daemon (default action)", null };
            options[1] = { "stop", 0, 0, OptionArg.NONE, ref stop, "Stop the Snippet Pixie auto expander daemon", null };
            options[2] = { "status", 0, 0, OptionArg.NONE, ref status, "Display status of the Snippet Pixie auto expander daemon, exits with status 0 if running, 1 if not", null };
            options[0] = { "start", 0, 0, OptionArg.NONE, ref start, "Start the Snippet Expander auto expander daemon (default action)", null };
            options[1] = { "stop", 0, 0, OptionArg.NONE, ref stop, "Stop the Snippet Expander auto expander daemon", null };
            options[2] = { "status", 0, 0, OptionArg.NONE, ref status, "Display status of the Snippet Expander auto expander daemon, exits with status 0 if running, 1 if not", null };
            options[3] = { "version", 'v', 0, OptionArg.NONE, ref version, "Display version number", null };
            options[4] = { "help", 'h', 0, OptionArg.NONE, ref help, "Display this help", null };


R cmd/snippetpixiex/snippetpixiex-snippet.vala => cmd/snippetexpanderx/snippetexpanderx-snippet.vala +1 -1
@@ 18,7 18,7 @@
* Boston, MA 02110-1301 USA
*/

public class SnippetPixieX.Snippet : Object {
public class SnippetExpanderX.Snippet : Object {
    public virtual string id { get; construct set; }
    public virtual string abbreviation { get; set; default = "new" + "`"; }
    public virtual string body { get; set; default = "Something to be replaced"; }

R cmd/snippetpixiex/snippetpixiex-snippets-manager.vala => cmd/snippetexpanderx/snippetexpanderx-snippets-manager.vala +6 -6
@@ 18,7 18,7 @@
* Boston, MA 02110-1301 USA
*/

public class SnippetPixieX.SnippetsManager : Object {
public class SnippetExpanderX.SnippetsManager : Object {
    public signal void snippets_changed (Gee.ArrayList<Snippet> snippets, string reason);

    // Current collection of snippets.


@@ 41,15 41,15 @@ public class SnippetPixieX.SnippetsManager : Object {

    private bool dbus_connect (int tries) {
        // Never seems to throw, or return null, so we'll do a quick ping straight after to see whether it really is connected.
        dbus_proxy = new DBusProxy.for_bus_sync (BusType.SESSION, DBusProxyFlags.NONE, null, "org.snippetpixie.daemon", "/org/snippetpixie/daemon", "org.snippetpixie.daemon", null);
        dbus_proxy = new DBusProxy.for_bus_sync (BusType.SESSION, DBusProxyFlags.NONE, null, "org.snippetexpander.daemon", "/org/snippetexpander/daemon", "org.snippetexpander.daemon", null);

        try {
            var pong = dbus_proxy.call_sync ("Ping", new Variant ("(s)", "connected"), DBusCallFlags.NONE, -1, null);

            if (!pong.check_format_string ("(s)", false)) {
                throw new Error (Quark.from_string ("snippetpixiex-ping-connect-error"), PING_CONNECT_ERROR, "Oops, could not ping the daemon.");
                throw new Error (Quark.from_string ("snippetexpanderx-ping-connect-error"), PING_CONNECT_ERROR, "Oops, could not ping the daemon.");
            } else if ("connected" != pong.get_child_value (0).get_string ()) {
                throw new Error (Quark.from_string ("snippetpixiex-ping-response-error"), PING_RESPONSE_ERROR, "Oops, got wrong response when pinging the daemon.");
                throw new Error (Quark.from_string ("snippetexpanderx-ping-response-error"), PING_RESPONSE_ERROR, "Oops, got wrong response when pinging the daemon.");
            }
        } catch (Error e) {
            tries++;


@@ 57,13 57,13 @@ public class SnippetPixieX.SnippetsManager : Object {

            if (tries < MAX_TRIES) {
                var secs = tries * TRIES_DELAY_FACTOR;
                debug ("Could not connect to snippetpixied daemon: %s", e.message);
                debug ("Could not connect to snippetexpanderd daemon: %s", e.message);
                debug ("Trying again in %d seconds...", secs);
                Thread.yield ();
                Thread.usleep (secs * (ulong) TimeSpan.SECOND);
                return dbus_connect (tries);
            } else {
                warning ("Could not connect to snippetpixied daemon: %s", e.message);
                warning ("Could not connect to snippetexpanderd daemon: %s", e.message);
                warning ("Giving up, sorry. 😢");
                var app = Application.get_default ();
                app.quit ();

D cmd/snippetpixie/config_test.go => cmd/snippetpixie/config_test.go +0 -253
@@ 1,253 0,0 @@
package main

import (
	"bytes"
	"io"
	"os"
	"strings"
	"testing"
	"time"

	isIt "github.com/matryer/is"
)

func TestConfig_Init(t *testing.T) {
	is := isIt.New(t)

	exportDefaultFile := "snippets-" + time.Now().Format("2006-01-02") + ".json"

	cases := []struct {
		args         []string
		expectedCmd  string
		expectedArgs map[string]interface{}
		expectedOut  string
	}{
		{[]string{"snippetpixie", "--help"}, "", nil, "Usage: snippetpixie [COMMAND] [FLAGS]..."},
		{[]string{"snippetpixie", "-h"}, "", nil, "Usage: snippetpixie [COMMAND] [FLAGS]..."},
		{[]string{"snippetpixie", "--start"}, "Start", nil, ""},
		{[]string{"snippetpixie", "--start", "--version"}, "Version", nil, ""},
		{[]string{"snippetpixie", "--start", "-v"}, "Version", nil, ""},
		{[]string{"snippetpixie", "--start", "--status"}, "Status", nil, ""},
		{[]string{"snippetpixie", "--start", "--stop"}, "Start", nil, ""},
		{[]string{"snippetpixie", "--stop"}, "Stop", nil, ""},
		{[]string{"snippetpixie", "--stop", "--version"}, "Version", nil, ""},
		{[]string{"snippetpixie", "--stop", "-v"}, "Version", nil, ""},
		{[]string{"snippetpixie", "--stop", "--status"}, "Status", nil, ""},
		{[]string{"snippetpixie", "--stop", "--start"}, "Start", nil, ""},
		{[]string{"snippetpixie", "--status"}, "Status", nil, ""},
		{[]string{"snippetpixie", "--version"}, "Version", nil, ""},
		{[]string{"snippetpixie", "-v"}, "Version", nil, ""},
		{[]string{"snippetpixie", "--version", "--status"}, "Version", nil, ""},
		{[]string{"snippetpixie", "--status", "--version"}, "Version", nil, ""},
		{[]string{"snippetpixie", "add", "sp`", "Snippet Pixie"}, "AddSnippet", map[string]interface{}{"abbreviation": "sp`", "body": "Snippet Pixie"}, ""},
		{[]string{"snippetpixie", "add", "--abbreviation=sp`", "--body=Snippet Pixie"}, "AddSnippet", map[string]interface{}{"abbreviation": "sp`", "body": "Snippet Pixie"}, ""},
		{[]string{"snippetpixie", "add", "-a=sp`", "-b=Snippet Pixie"}, "AddSnippet", map[string]interface{}{"abbreviation": "sp`", "body": "Snippet Pixie"}, ""},
		{[]string{"snippetpixie", "add", "--body=Snippet Pixie", "--abbreviation=sp`"}, "AddSnippet", map[string]interface{}{"abbreviation": "sp`", "body": "Snippet Pixie"}, ""},
		{[]string{"snippetpixie", "add", "-b=Snippet Pixie", "-a=sp`"}, "AddSnippet", map[string]interface{}{"abbreviation": "sp`", "body": "Snippet Pixie"}, ""},
		{[]string{"snippetpixie", "copy", "sp`"}, "Copy", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "copy", "--abbreviation=sp`"}, "Copy", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "copy", "-a=sp`"}, "Copy", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "copy", "doesnotexist`"}, "Copy", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "copy", "sp`", "--skip-last-used"}, "Copy", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "copy", "--abbreviation=sp`", "--skip-last-used"}, "Copy", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "copy", "-a=sp`", "-u"}, "Copy", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "copy", "doesnotexist`", "--skip-last-used"}, "Copy", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "expand", "sp`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "expand", "--abbreviation=sp`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "expand", "-a=sp`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "expand", "doesnotexist`"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": false}, ""},
		{[]string{"snippetpixie", "expand", "sp`", "--skip-last-used"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "expand", "--abbreviation=sp`", "--skip-last-used"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "expand", "-a=sp`", "-u"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "sp`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "expand", "doesnotexist`", "--skip-last-used"}, "ExpandAbbreviation", map[string]interface{}{"abbreviation": "doesnotexist`", "skipLastUsed": true}, ""},
		{[]string{"snippetpixie", "export"}, "Export", map[string]interface{}{"filename": exportDefaultFile, "version": 0}, ""},
		{[]string{"snippetpixie", "export", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetpixie", "export", "--filename", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetpixie", "export", "-f", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetpixie", "export", "--filename=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetpixie", "export", "-f=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 0}, ""},
		{[]string{"snippetpixie", "export", "--version=101"}, "Export", map[string]interface{}{"filename": exportDefaultFile, "version": 101}, ""},
		{[]string{"snippetpixie", "export", "--version=101", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetpixie", "export", "wibble.json", "--version=101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetpixie", "export", "--filename", "wibble.json", "--version", "101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetpixie", "export", "-f", "wibble.json", "-v", "101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetpixie", "export", "--filename=wibble.json", "--version=101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetpixie", "export", "-f=wibble.json", "-v=101"}, "Export", map[string]interface{}{"filename": "wibble.json", "version": 101}, ""},
		{[]string{"snippetpixie", "--export"}, "Export", map[string]interface{}{"filename": exportDefaultFile}, ""},
		{[]string{"snippetpixie", "--export", "wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json"}, ""},
		{[]string{"snippetpixie", "--export=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json"}, ""},
		{[]string{"snippetpixie", "-e=wibble.json"}, "Export", map[string]interface{}{"filename": "wibble.json"}, ""},
		{[]string{"snippetpixie", "help", "add"}, "", nil, "Usage: snippetpixie add abbreviation body"},
		{[]string{"snippetpixie", "help", "copy"}, "", nil, "Usage: snippetpixie copy [flags] abbreviation"},
		{[]string{"snippetpixie", "help", "expand"}, "", nil, "Usage: snippetpixie expand abbreviation"},
		{[]string{"snippetpixie", "help", "export"}, "", nil, "Usage: snippetpixie export [flags]"},
		{[]string{"snippetpixie", "help", "help"}, "", nil, "Usage: snippetpixie help command"},
		{[]string{"snippetpixie", "help", "import"}, "", nil, "Usage: snippetpixie import [flags] filename"},
		{[]string{"snippetpixie", "help", "list"}, "", nil, "Usage: snippetpixie list [flags] [search string]"},
		{[]string{"snippetpixie", "help", "ping"}, "", nil, "Usage: snippetpixie ping [flags] [response]"},
		{[]string{"snippetpixie", "help", "remove"}, "", nil, "Usage: snippetpixie remove [flags] abbreviation"},
		{[]string{"snippetpixie", "import", "wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetpixie", "import", "--filename=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetpixie", "import", "-f=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetpixie", "import", "--filename=wibble.json", "--update"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": true}, ""},
		{[]string{"snippetpixie", "--import=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetpixie", "-i=wibble.json"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": false}, ""},
		{[]string{"snippetpixie", "--import=wibble.json", "--force"}, "Import", map[string]interface{}{"filename": "wibble.json", "update": true}, ""},
		{[]string{"snippetpixie", "help", "add"}, "", nil, "Usage: snippetpixie add abbreviation body"},
		{[]string{"snippetpixie", "list"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--search=sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-s=sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--search=sp`", "--search=spu`"}, "GetSnippets", map[string]interface{}{"search": "spu`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""}, // 2nd arg wins
		{[]string{"snippetpixie", "list", "--recent"}, "GetSnippets", map[string]interface{}{"search": "", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-r"}, "GetSnippets", map[string]interface{}{"search": "", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--recent", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-r", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--search=sp`", "--recent"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-s=sp`", "-r"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": true, "delimiter": " ", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--delimiter="}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": "", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--delimiter=|"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": "|", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-d=,"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": ",", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--delimiter=|", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": "|", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-d=,", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": ",", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--delimiter=|", "--search=sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": "|", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-d=,", "-s=sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": ",", "id": false, "abbreviation": true, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--id"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-i"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--id", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-i", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": true, "abbreviation": false, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--abbreviation"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-a"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--abbreviation", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-a", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": true, "body": false, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--body"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-b"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--body", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "-b", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": true, "lastUsed": false}, ""},
		{[]string{"snippetpixie", "list", "--last-used"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetpixie", "list", "-l"}, "GetSnippets", map[string]interface{}{"search": "", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetpixie", "list", "--last-used", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetpixie", "list", "-l", "sp`"}, "GetSnippets", map[string]interface{}{"search": "sp`", "recent": false, "delimiter": " ", "id": false, "abbreviation": false, "body": false, "lastUsed": true}, ""},
		{[]string{"snippetpixie", "ping"}, "Ping", map[string]interface{}{"response": "pong"}, ""},
		{[]string{"snippetpixie", "ping", "wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetpixie", "ping", "-r=wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetpixie", "ping", "--response=wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetpixie", "ping", "--response", "wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetpixie", "ping", "-r", "wibble"}, "Ping", map[string]interface{}{"response": "wibble"}, ""},
		{[]string{"snippetpixie", "remove", "sp`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "sp`"}, ""},
		{[]string{"snippetpixie", "remove", "--abbreviation=sp`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "sp`"}, ""},
		{[]string{"snippetpixie", "remove", "-a=sp`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "sp`"}, ""},
		{[]string{"snippetpixie", "remove", "doesnotexist`"}, "RemoveSnippet", map[string]interface{}{"abbreviation": "doesnotexist`"}, ""},
		{[]string{"snippetpixie", "autostart"}, "GetAutostartStatus", nil, ""},
		{[]string{"snippetpixie", "autostart", "--on"}, "UpdateAutostart", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetpixie", "autostart", "--off"}, "UpdateAutostart", map[string]interface{}{"on": false}, ""},
		{[]string{"snippetpixie", "--autostart=status"}, "GetAutostartStatus", nil, ""},
		{[]string{"snippetpixie", "--autostart=on"}, "UpdateAutostart", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetpixie", "--autostart=off"}, "UpdateAutostart", map[string]interface{}{"on": false}, ""},
		{[]string{"snippetpixie", "autoexpand"}, "GetAutoexpandStatus", nil, ""},
		{[]string{"snippetpixie", "autoexpand", "--on"}, "UpdateAutoexpand", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetpixie", "autoexpand", "--off"}, "UpdateAutoexpand", map[string]interface{}{"on": false}, ""},
		{[]string{"snippetpixie", "--autoexpand=status"}, "GetAutoexpandStatus", nil, ""},
		{[]string{"snippetpixie", "--autoexpand=on"}, "UpdateAutoexpand", map[string]interface{}{"on": true}, ""},
		{[]string{"snippetpixie", "--autoexpand=off"}, "UpdateAutoexpand", map[string]interface{}{"on": false}, ""},
	}

	for _, spec := range cases {
		var stdout bytes.Buffer
		c := &config{}

		err := c.init(spec.args, &stdout)
		is.NoErr(err) // flags parsed ok

		out := stdout.String()
		if len(spec.expectedOut) > 0 {
			is.True(len(out) > 0)                            // expect output
			is.True(strings.Contains(out, spec.expectedOut)) // expected out to contain string
		} else {
			is.Equal(out, "") // expect empty output
		}

		is.Equal(c.Cmd, spec.expectedCmd)   // expected command name
		is.Equal(c.Args, spec.expectedArgs) // expected arguments
	}
}

func TestConfig_InitFail(t *testing.T) {
	is := isIt.New(t)

	cases := []struct {
		args []string
	}{
		{[]string{"snippetpixie"}},
		{[]string{"snippetpixie", "wibble"}},
		{[]string{"snippetpixie", "--wibble"}},
		{[]string{"snippetpixie", "--wibble", "wobble"}},
		{[]string{"snippetpixie", "add"}},
		{[]string{"snippetpixie", "add", "sp`"}},
		{[]string{"snippetpixie", "add", "sp`", "Snippet Pixie", "Rules!"}},
		{[]string{"snippetpixie", "add", "--abbreviation='sp`'"}},
		{[]string{"snippetpixie", "add", "-a='sp`'"}},
		{[]string{"snippetpixie", "add", "--body='Snippet Pixie'"}},
		{[]string{"snippetpixie", "add", "-b='Snippet Pixie'"}},
		{[]string{"snippetpixie", "add", "\t", "\t"}},
		{[]string{"snippetpixie", "add", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "copy"}},
		{[]string{"snippetpixie", "copy", "\t"}},
		{[]string{"snippetpixie", "copy", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "copy", "--skip-last-used"}},
		{[]string{"snippetpixie", "copy", "-u"}},
		{[]string{"snippetpixie", "expand"}},
		{[]string{"snippetpixie", "expand", "\t"}},
		{[]string{"snippetpixie", "expand", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "export", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "help"}},
		{[]string{"snippetpixie", "help", "doesnotexist"}},
		{[]string{"snippetpixie", "help", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "--import"}},
		{[]string{"snippetpixie", "--import="}},
		{[]string{"snippetpixie", "import"}},
		{[]string{"snippetpixie", "import", "\t"}},
		{[]string{"snippetpixie", "import", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "list", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "list", "sp`", "spu`"}},
		{[]string{"snippetpixie", "ping", "--nonexistentflag=wibble"}},
		{[]string{"snippetpixie", "ping", "wibble", "wobble"}},
		{[]string{"snippetpixie", "ping", "--response"}},
		{[]string{"snippetpixie", "ping", "-r"}},
		{[]string{"snippetpixie", "remove"}},
		{[]string{"snippetpixie", "remove", "\t"}},
		{[]string{"snippetpixie", "remove", "--nonexistentflag='sp`'"}},
		{[]string{"snippetpixie", "autostart", "--nonexistentflag"}},
		{[]string{"snippetpixie", "--autostart"}},
		{[]string{"snippetpixie", "--autostart=wibble"}},
		{[]string{"snippetpixie", "autoexpand", "--nonexistentflag"}},
		{[]string{"snippetpixie", "--autoexpand"}},
		{[]string{"snippetpixie", "--autoexpand=wibble"}},
	}

	for _, spec := range cases {
		var stdout bytes.Buffer

		// Redirect stderr to a variable.
		oldStderr := os.Stderr
		stderrOutput, stderrWriter, _ := os.Pipe()
		os.Stderr = stderrWriter
		c := &config{}

		err := c.init(spec.args, &stdout)

		// Read output sent to stderr and restore stderr to normal operation.
		_ = stderrWriter.Close()
		stderr, _ := io.ReadAll(stderrOutput)
		os.Stderr = oldStderr
		stderrOut := string(stderr)

		is.True(err != nil) // err returned from init

		out := stdout.String()
		is.Equal(out, "") // expect empty output

		is.True(len(stderrOut) > 0)                    // expect output
		is.True(strings.Contains(stderrOut, "Usage:")) // expect usage message
	}
}

D cmd/snippetpixie/go.mod => cmd/snippetpixie/go.mod +0 -25
@@ 1,25 0,0 @@
module git.sr.ht/~ianmjones/snippetpixie/cmd/snippetpixie

go 1.19

replace git.sr.ht/~ianmjones/snippetpixie/internal/export v0.0.0-unpublished => ../../internal/export

replace git.sr.ht/~ianmjones/snippetpixie/internal/service v0.0.0-unpublished => ../../internal/service

replace git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice

replace git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet

require (
	git.sr.ht/~ianmjones/snippetpixie/internal/export v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/internal/service v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished
	github.com/godbus/dbus/v5 v5.1.0
	github.com/matryer/is v1.4.1
	github.com/spf13/pflag v1.0.5
)

require (
	git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished // indirect
	github.com/gofrs/uuid v4.4.0+incompatible // indirect
)

D cmd/snippetpixiegui/frontend/dist/assets/en-GB-d3e97a3e.js => cmd/snippetpixiegui/frontend/dist/assets/en-GB-d3e97a3e.js +0 -1
@@ 1,1 0,0 @@
const t={title:"Abbreviation",empty:"Please enter an Abbreviation",exists:"That Abbreviation already exists"},e={title:"Body"},o={title:"Add Snippet",error_title:"Error adding snippet"},n={title:"Edit Snippet",error_title:"Error editing snippet",id_not_supplied:"A Snippet ID was not specified for edit.",snippet_not_found:"Could not find Snippet for edit."},i={title:"Remove Snippet",error_title:"Error removing snippet"},s={title:"Import Snippets",new_only_title:"Import Snippets: Discarding Duplicates",update_title:"Import Snippets: Update Existing",error_title:"Error importing snippets"},r={title:"Export Snippets",error_title:"Error exporting snippets"},p={title:"Settings",import_export_title:"Import & Export",get_error_title:"Error getting settings",save_error_title:"Error saving settings",no_connection:"Settings can only be changed when the daemon is running.",autostart_title:"Auto Start",autostart:"Start daemon on login",autoexpand_title:"Auto Expand Snippets",autoexpand:"Auto expand snippets as they are typed",search_and_paste_title:"Search & Paste",focus_search:"Focus search box",custom_shortcuts_disabled:"Unable to get or set custom shortcut, please set it manually.",custom_shortcut:"Custom Shortcut",custom_shortcut_empty:"none",remove_custom_shortcut:"Remove custom shortcut",change_custom_shortcut_desc:"To change the custom shortcut, please use your system's settings application.",add_default_custom_shortcut:"Add default custom shortcut"},a="Could not connect to the snippetpixied daemon.",c={title:"No Snippets Found",description:"Please try entering a different search term."},d={cancel:"Cancel",save:"Save",remove:"Remove",back:"Back",about:"About"},l="Loading…",u="Search…",_="Clear",m={not_installed:"It does not look like the required snippetpixied daemon is installed.",installed:"It looks like snippetpixied is installed.",start:"Start it?",starting:"Starting snippetpixied…"},g={description:"Your little expandable text snippet helper",source:"Source",licence_title:"Licence",licence:"GNU General Public License Version 2 Plus (GPLv2+)",by:"By"},h={abbreviation:t,body:e,add_snippet:o,edit_snippet:n,remove_snippet:i,import_snippets:s,export_snippets:r,settings:p,no_connection:a,no_snippets_found:c,button:d,loading:l,search:u,clear:_,daemon:m,about:g};export{t as abbreviation,g as about,o as add_snippet,e as body,d as button,_ as clear,m as daemon,h as default,n as edit_snippet,r as export_snippets,s as import_snippets,l as loading,a as no_connection,c as no_snippets_found,i as remove_snippet,u as search,p as settings};

M internal/export/export.go => internal/export/export.go +3 -2
@@ 3,9 3,10 @@ package export
import (
	"encoding/json"
	"errors"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
	"os"
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
)

type exportheader struct {


@@ 71,7 72,7 @@ func JSON101(snippets []*snippet.Snippet, indented bool) ([]byte, error) {
// JSON creates export formatted output.
func JSON(snippets []*snippet.Snippet, indented bool) ([]byte, error) {
	header := exportheader{
		Generator: "snippetpixie",
		Generator: "snippetexpander",
		Version:   201,
	}


M internal/export/export_test.go => internal/export/export_test.go +18 -18
@@ 3,13 3,13 @@ package export
import (
	"encoding/json"
	"fmt"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
	"github.com/gofrs/uuid"
	"os"
	"strings"
	"testing"
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
	"github.com/gofrs/uuid"
	isIt "github.com/matryer/is"
)



@@ 25,8 25,8 @@ func skelSnippets(t *testing.T) (*isIt.I, time.Time, []*snippet.Snippet) {

	theSnippet := &snippet.Snippet{
		ID:           id,
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
		LastUsed:     now,
	}



@@ 38,7 38,7 @@ func skelSnippets(t *testing.T) (*isIt.I, time.Time, []*snippet.Snippet) {
	theSnippet = &snippet.Snippet{
		ID:           id,
		Abbreviation: "spu`",
		Body:         "https://www.snippetpixie.com",
		Body:         "https://www.snippetexpander.com",
		LastUsed:     now,
	}



@@ 57,19 57,19 @@ func TestJSON(t *testing.T) {
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"data": [`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"snippets": [`))
	is.True(false == strings.Contains(fmt.Sprintf("%s", out), `"id": "`+snippets[0].ID.String()+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"abbreviation": "`+"sp`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"body": "Snippet Pixie"`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"abbreviation": "`+"se`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"body": "Snippet Expander"`))
	is.True(false == strings.Contains(fmt.Sprintf("%s", out), `"lastUsed": `+fmt.Sprintf("%d", now.Unix())))

	out, err = JSON(snippets, true)
	is.NoErr(err)
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"generator": "snippetpixie",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"generator": "snippetexpander",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"version": 201,`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"data": {`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"snippets": [`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"id": "`+snippets[0].ID.String()+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"abbreviation": "`+"sp`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"body": "Snippet Pixie",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"abbreviation": "`+"se`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"body": "Snippet Expander",`))
	is.True(strings.Contains(fmt.Sprintf("%s", out), `"lastUsed": `+fmt.Sprintf("%d", now.Unix())))
}



@@ 92,8 92,8 @@ func TestWriteFile(t *testing.T) {
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"data": [`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"snippets": [`))
	is.True(false == strings.Contains(fmt.Sprintf("%s", contents), `"id": "`+snippets[0].ID.String()+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"abbreviation": "`+"sp`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"body": "Snippet Pixie"`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"abbreviation": "`+"se`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"body": "Snippet Expander"`))
	is.True(false == strings.Contains(fmt.Sprintf("%s", contents), `"lastUsed": `+fmt.Sprintf("%d", now.Unix())))

	err = WriteFile(filename, snippets)


@@ 104,13 104,13 @@ func TestWriteFile(t *testing.T) {

	is.True(json.Valid(contents)) // valid JSON

	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"generator": "snippetpixie",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"generator": "snippetexpander",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"version": 201,`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"data": {`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"snippets": [`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"id": "`+snippets[0].ID.String()+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"abbreviation": "`+"sp`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"body": "Snippet Pixie",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"abbreviation": "`+"se`"+`",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"body": "Snippet Expander",`))
	is.True(strings.Contains(fmt.Sprintf("%s", contents), `"lastUsed": `+fmt.Sprintf("%d", now.Unix())))
}



@@ 141,9 141,9 @@ func TestReadFile(t *testing.T) {
	generator, version, importedSnippets, err = ReadFile(filename)
	is.NoErr(err) // ReadFile v201

	is.Equal(generator, "snippetpixie") // generator
	is.Equal(version, 201)              // version
	is.Equal(len(importedSnippets), 2)  // snippets count
	is.Equal(generator, "snippetexpander") // generator
	is.Equal(version, 201)                 // version
	is.Equal(len(importedSnippets), 2)     // snippets count

	is.Equal(importedSnippets[0].ID, snippets[0].ID)                           // ID
	is.Equal(importedSnippets[0].Abbreviation, snippets[0].Abbreviation)       // Abbreviation

M internal/export/go.mod => internal/export/go.mod +3 -3
@@ 1,11 1,11 @@
module git.sr.ht/~ianmjones/snippetpixie/internal/export
module git.sr.ht/~ianmjones/snippetexpander/internal/export

go 1.19

replace git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet
replace git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet

require (
	git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished
	github.com/gofrs/uuid v4.4.0+incompatible
	github.com/matryer/is v1.4.1
)

M internal/manager/go.mod => internal/manager/go.mod +3 -3
@@ 1,11 1,11 @@
module git.sr.ht/~ianmjones/snippetpixie/internal/manager
module git.sr.ht/~ianmjones/snippetexpander/internal/manager

go 1.19

replace git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet
replace git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet

require (
	git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished
	github.com/gofrs/uuid v4.4.0+incompatible
	github.com/gohugoio/localescompressed v1.0.1
	github.com/lestrrat-go/strftime v1.0.6

M internal/manager/manager_test.go => internal/manager/manager_test.go +13 -13
@@ 2,10 2,10 @@ package manager

import (
	"database/sql"
	"github.com/gofrs/uuid"
	"testing"
	"time"

	"github.com/gofrs/uuid"
	isIt "github.com/matryer/is"
	_ "github.com/mattn/go-sqlite3"
)


@@ 56,10 56,10 @@ func TestNewManagerSchema100(t *testing.T) {
	manager, err := New(db)
	is.NoErr(err)

	result, err := manager.GetSnippetsEndingWithAbbreviation("p`")
	result, err := manager.GetSnippetsEndingWithAbbreviation("e`")
	is.NoErr(err)
	is.Equal(len(result), 2)                // count of records
	is.Equal(result[0].Abbreviation, "bp`") // first returned abbreviation
	is.Equal(result[0].Abbreviation, "se`") // first returned abbreviation
}

// initSchema100 creates the database schema as of schema version 100.


@@ 78,12 78,12 @@ func initSchema100(db *sql.DB) error {
	//goland:noinspection SqlInsertValues
	query = "INSERT INTO snippets(abbreviation, body) VALUES ($1, $2)"

	_, err = db.Exec(query, "sp`", "Snippet Pixie")
	_, err = db.Exec(query, "xe`", "Extreme Snippet Expander")
	if err != nil {
		return err
	}

	_, err = db.Exec(query, "bp`", "Byte Pixie")
	_, err = db.Exec(query, "se`", "Snippet Expander")
	if err != nil {
		return err
	}


@@ 111,10 111,10 @@ func TestNewManagerSchema150(t *testing.T) {
	manager, err := New(db)
	is.NoErr(err)

	result, err := manager.GetSnippetsEndingWithAbbreviation("p`")
	result, err := manager.GetSnippetsEndingWithAbbreviation("e`")
	is.NoErr(err)
	is.Equal(len(result), 2)                // count of records
	is.Equal(result[0].Abbreviation, "bp`") // first returned abbreviation
	is.Equal(result[0].Abbreviation, "se`") // first returned abbreviation
}

// initSchema150 creates the database schema as of schema version 150.


@@ 160,12 160,12 @@ func initSchema150(db *sql.DB) error {

	lastUsed := time.Now().UTC()

	_, err = db.Exec(query, "sp`", "Snippet Pixie", lastUsed)
	_, err = db.Exec(query, "xe`", "Extreme Snippet Expander", lastUsed)
	if err != nil {
		return err
	}

	_, err = db.Exec(query, "bp`", "Byte Pixie", lastUsed)
	_, err = db.Exec(query, "se`", "Snippet Expander", lastUsed)
	if err != nil {
		return err
	}


@@ 193,10 193,10 @@ func TestNewManagerSchema160(t *testing.T) {
	manager, err := New(db)
	is.NoErr(err)

	result, err := manager.GetSnippetsEndingWithAbbreviation("p`")
	result, err := manager.GetSnippetsEndingWithAbbreviation("e`")
	is.NoErr(err)
	is.Equal(len(result), 2)                // count of records
	is.Equal(result[0].Abbreviation, "bp`") // first returned abbreviation
	is.Equal(result[0].Abbreviation, "se`") // first returned abbreviation
}

// initSchema160 creates the database schema as of schema version 160.


@@ 246,7 246,7 @@ func initSchema160(db *sql.DB) error {

	lastUsed := time.Now().UTC()

	_, err = db.Exec(query, id, "sp`", "Snippet Pixie", lastUsed)
	_, err = db.Exec(query, id, "xe`", "Extreme Snippet Expander", lastUsed)
	if err != nil {
		return err
	}


@@ 256,7 256,7 @@ func initSchema160(db *sql.DB) error {
		return err
	}

	_, err = db.Exec(query, id, "bp`", "Byte Pixie", lastUsed)
	_, err = db.Exec(query, id, "se`", "Snippet Expander", lastUsed)
	if err != nil {
		return err
	}

M internal/manager/placeholders_test.go => internal/manager/placeholders_test.go +6 -6
@@ 21,8 21,8 @@ func TestManager_ExpandBodyNoPlaceholder(t *testing.T) {
	 */

	dt := time.Now()
	body := "Snippet Pixie"
	expect := "Snippet Pixie"
	body := "Snippet Expander"
	expect := "Snippet Expander"

	actual, offset := manager.expandBody(body, -1, dt, 0)



@@ 301,7 301,7 @@ func TestManager_ExpandBodySnippetPlaceholder(t *testing.T) {
	 */

	body = "$$@snippet:email`$$"
	expect = "Hi,\n\n\n\nCheers,\n\nTeam Snippet Pixie"
	expect = "Hi,\n\n\n\nCheers,\n\nTeam Snippet Expander"

	actual, offset = manager.expandBody(body, -1, dt, 0)



@@ 401,8 401,8 @@ func TestManager_GetExpandedBodyForAbbreviation(t *testing.T) {
		_ = db.Close()
	}(db)

	abbreviation := "sp`"
	expect := "Snippet Pixie"
	abbreviation := "se`"
	expect := "Snippet Expander"

	actual, offset, err := manager.GetExpandedBodyForAbbreviation(abbreviation, true)
	is.NoErr(err) // GetExpandedBodyForAbbreviation


@@ 428,7 428,7 @@ func TestManager_GetExpandedBodyForAbbreviation(t *testing.T) {
	 */

	abbreviation = "email`"
	expect = "Hi,\n\n\n\nCheers,\n\nTeam Snippet Pixie"
	expect = "Hi,\n\n\n\nCheers,\n\nTeam Snippet Expander"

	actual, offset, err = manager.GetExpandedBodyForAbbreviation(abbreviation, true)
	is.NoErr(err) // GetExpandedBodyForAbbreviation

M internal/manager/snippet.go => internal/manager/snippet.go +1 -3
@@ 6,10 6,9 @@ import (
	"strings"
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
	"github.com/gofrs/uuid"
	"golang.design/x/clipboard"

	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
)

// AddSnippet creates a new Snippet with a unique ID.


@@ 118,7 117,6 @@ func (m *Manager) GetSnippets(search string, orderByLastUsed bool) ([]*snippet.S

	if orderByLastUsed {
		orderby += " last_used DESC,"

	}

	orderby += " abbreviation, id"

M internal/manager/snippet_test.go => internal/manager/snippet_test.go +47 -47
@@ 2,11 2,11 @@ package manager

import (
	"database/sql"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
	"github.com/gofrs/uuid"
	"testing"
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
	"github.com/gofrs/uuid"
	isIt "github.com/matryer/is"
	_ "github.com/mattn/go-sqlite3"
)


@@ 30,14 30,14 @@ func TestManager_AddSnippet(t *testing.T) {
		_ = tx.Rollback()
	}(tx)

	result, err := manager.AddSnippet(tx, "sp`", "Snippet Pixie")
	result, err := manager.AddSnippet(tx, "se`", "Snippet Expander")
	is.NoErr(err)

	err = tx.Commit()
	is.NoErr(err) // commit

	is.Equal(result.Abbreviation, "sp`")
	is.Equal(result.Body, "Snippet Pixie")
	is.Equal(result.Abbreviation, "se`")
	is.Equal(result.Body, "Snippet Expander")
}

func TestManager_GetSnippetWithAbbreviation(t *testing.T) {


@@ 59,13 59,13 @@ func TestManager_GetSnippetWithAbbreviation(t *testing.T) {
		_ = tx.Rollback()
	}(tx)

	newSnippet, err := manager.AddSnippet(tx, "sp`", "Snippet Pixie")
	newSnippet, err := manager.AddSnippet(tx, "se`", "Snippet Expander")
	is.NoErr(err)

	err = tx.Commit()
	is.NoErr(err) // commit

	result, err := manager.GetSnippetWithAbbreviation("sp`")
	result, err := manager.GetSnippetWithAbbreviation("se`")
	is.NoErr(err)

	is.Equal(result.ID, newSnippet.ID)


@@ 90,19 90,19 @@ func skelTestSnippets(t *testing.T) (*isIt.I, *sql.DB, *Manager) {
		_ = tx.Rollback()
	}(tx)

	_, err = manager.AddSnippet(tx, "sp`", "Snippet Pixie")
	_, err = manager.AddSnippet(tx, "xe`", "Extreme Snippet Expander")
	is.NoErr(err) // add snippet

	_, err = manager.AddSnippet(tx, "ww`", "Wibble Wobble")
	is.NoErr(err) // add snippet

	_, err = manager.AddSnippet(tx, "bp`", "Byte Pixie")
	_, err = manager.AddSnippet(tx, "se`", "Snippet Expander")
	is.NoErr(err) // add snippet

	_, err = manager.AddSnippet(tx, "dt`", "$$@date:%Y-%m-%d$$")
	is.NoErr(err) // add snippet

	_, err = manager.AddSnippet(tx, "sigg`", "\nCheers,\n\nTeam $$@snippet:sp`$$")
	_, err = manager.AddSnippet(tx, "sigg`", "\nCheers,\n\nTeam $$@snippet:se`$$")
	is.NoErr(err) // add snippet

	_, err = manager.AddSnippet(tx, "email`", "Hi,\n\n$$@cursor$$\n$$@snippet:sigg`$$")


@@ 138,10 138,10 @@ func TestManager_GetSnippetsEndingWithAbbreviation(t *testing.T) {
		_ = db.Close()
	}(db)

	result, err := manager.GetSnippetsEndingWithAbbreviation("p`")
	result, err := manager.GetSnippetsEndingWithAbbreviation("e`")
	is.NoErr(err)
	is.Equal(len(result), 2)                // count of records
	is.Equal(result[0].Abbreviation, "bp`") // first returned abbreviation
	is.Equal(result[0].Abbreviation, "se`") // first returned abbreviation
}

func TestManager_GetSnippetsEndingWithAbbreviationNoRecords(t *testing.T) {


@@ 156,7 156,7 @@ func TestManager_GetSnippetsEndingWithAbbreviationNoRecords(t *testing.T) {
	manager, err := New(db)
	is.NoErr(err)

	result, err := manager.GetSnippetsEndingWithAbbreviation("p`")
	result, err := manager.GetSnippetsEndingWithAbbreviation("e`")
	is.NoErr(err)
	is.Equal(len(result), 0) // count of records
}


@@ 192,15 192,15 @@ func TestManager_GetSnippets(t *testing.T) {
		_ = db.Close()
	}(db)

	result, err := manager.GetSnippets("p`", false)
	result, err := manager.GetSnippets("e`", false)
	is.NoErr(err)
	is.Equal(len(result), 3)                // count of records
	is.Equal(result[0].Abbreviation, "bp`") // first returned abbreviation
	is.Equal(result[0].Abbreviation, "se`") // first returned abbreviation

	result, err = manager.GetSnippets("", false)
	is.NoErr(err)
	is.Equal(len(result), 12)               // count of records
	is.Equal(result[0].Abbreviation, "bp`") // first returned abbreviation
	is.Equal(result[4].Abbreviation, "se`") // fifth returned abbreviation

	result, err = manager.GetSnippets("wibble", false)
	is.NoErr(err)


@@ 218,11 218,11 @@ func TestManager_UpdateSnippetWithID(t *testing.T) {
		_ = db.Close()
	}(db)

	origSnippet, err := manager.GetSnippetWithAbbreviation("sp`")
	origSnippet, err := manager.GetSnippetWithAbbreviation("se`")
	is.NoErr(err)

	is.Equal(origSnippet.Abbreviation, "sp`")   // returned abbreviation
	is.Equal(origSnippet.Body, "Snippet Pixie") // returned body
	is.Equal(origSnippet.Abbreviation, "se`")      // returned abbreviation
	is.Equal(origSnippet.Body, "Snippet Expander") // returned body
	lastUsed := time.Unix(0, 0).UTC()
	is.Equal(origSnippet.LastUsed, lastUsed) // returned snippet last used



@@ 234,19 234,19 @@ func TestManager_UpdateSnippetWithID(t *testing.T) {
	}(tx)

	// Update body.
	origSnippet.Body += " rules!"
	origSnippet.Body += " rulez!"
	err = manager.UpdateSnippetWithID(tx, origSnippet.ID, origSnippet)
	is.NoErr(err) // update

	err = tx.Commit()
	is.NoErr(err) // commit

	updatedSnippet, err := manager.GetSnippetWithAbbreviation("sp`")
	updatedSnippet, err := manager.GetSnippetWithAbbreviation("se`")
	is.NoErr(err)

	is.Equal(updatedSnippet.ID, origSnippet.ID)                     // updated snippet id
	is.Equal(updatedSnippet.Abbreviation, origSnippet.Abbreviation) // updated snippet abbreviation
	is.Equal(updatedSnippet.Body, "Snippet Pixie rules!")           // updated snippet body
	is.Equal(updatedSnippet.Body, "Snippet Expander rulez!")        // updated snippet body
	is.Equal(updatedSnippet.LastUsed, origSnippet.LastUsed)         // updated snippet last used datetime

	tx, err = manager.db.Begin()


@@ 265,7 265,7 @@ func TestManager_UpdateSnippetWithID(t *testing.T) {
	err = tx.Commit()
	is.NoErr(err) // commit

	updatedSnippet, err = manager.GetSnippetWithAbbreviation("sp`")
	updatedSnippet, err = manager.GetSnippetWithAbbreviation("se`")
	is.NoErr(err)

	is.Equal(updatedSnippet.LastUsed, origSnippet.LastUsed) // updated snippet last used datetime changed


@@ 278,24 278,24 @@ func TestManager_UpdateSnippetWithID(t *testing.T) {
	}(tx)

	// Update abbreviation.
	origSnippet.Abbreviation = "spr`"
	origSnippet.Abbreviation = "ser`"
	err = manager.UpdateSnippetWithID(tx, origSnippet.ID, origSnippet)
	is.NoErr(err) // update

	err = tx.Commit()
	is.NoErr(err) // commit

	// "sp`" no longer exists.
	updatedSnippet, err = manager.GetSnippetWithAbbreviation("sp`")
	// "se`" no longer exists.
	updatedSnippet, err = manager.GetSnippetWithAbbreviation("se`")
	is.NoErr(err)
	is.Equal(updatedSnippet, nil)

	updatedSnippet, err = manager.GetSnippetWithAbbreviation("spr`")
	updatedSnippet, err = manager.GetSnippetWithAbbreviation("ser`")
	is.NoErr(err)

	is.Equal(updatedSnippet.ID, origSnippet.ID)                     // updated snippet id
	is.Equal(updatedSnippet.Abbreviation, origSnippet.Abbreviation) // updated snippet abbreviation
	is.Equal(updatedSnippet.Body, "Snippet Pixie rules!")           // updated snippet body
	is.Equal(updatedSnippet.Body, "Snippet Expander rulez!")        // updated snippet body
	is.Equal(updatedSnippet.LastUsed, origSnippet.LastUsed)         // updated snippet last used datetime

	// TODO: Update ID.


@@ 310,12 310,12 @@ func TestManager_RemoveSnippetWithID(t *testing.T) {
	result, err := manager.GetSnippets("", false)
	is.NoErr(err)
	is.Equal(len(result), 12)                // count of records
	is.Equal(result[10].Abbreviation, "sp`") // sp` snippet is 2nd result
	is.Equal(result[11].Abbreviation, "xe`") // xe` snippet is 12th result

	origSnippet, err := manager.GetSnippetWithAbbreviation("sp`")
	origSnippet, err := manager.GetSnippetWithAbbreviation("xe`")
	is.NoErr(err)
	is.Equal(origSnippet.Abbreviation, "sp`")   // returned abbreviation
	is.Equal(origSnippet.Body, "Snippet Pixie") // returned abbreviation
	is.Equal(origSnippet.Abbreviation, "xe`")              // returned abbreviation
	is.Equal(origSnippet.Body, "Extreme Snippet Expander") // returned abbreviation

	tx, err := manager.db.Begin()
	is.NoErr(err)


@@ 333,7 333,7 @@ func TestManager_RemoveSnippetWithID(t *testing.T) {
	result, err = manager.GetSnippets("", false)
	is.NoErr(err)
	is.Equal(len(result), 11)                // count of records
	is.Equal(result[10].Abbreviation, "ww`") // sp` snippet is 2nd result
	is.Equal(result[10].Abbreviation, "ww`") // ww` snippet is 11th result

	tx, err = manager.db.Begin()
	is.NoErr(err)


@@ 363,8 363,8 @@ func TestManager_InsertSnippet(t *testing.T) {
	is.NoErr(err)

	newSnippet := &snippet.Snippet{
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
	}

	tx, err := manager.db.Begin()


@@ 381,10 381,10 @@ func TestManager_InsertSnippet(t *testing.T) {
	is.NoErr(err) // commit

	lastUsed := time.Unix(0, 0).UTC()
	is.True(result.ID != uuid.Nil)         // ID auto assigned
	is.Equal(result.Abbreviation, "sp`")   // Abbreviation
	is.Equal(result.Body, "Snippet Pixie") // Body
	is.Equal(result.LastUsed, lastUsed)    // 0 timestamp
	is.True(result.ID != uuid.Nil)            // ID auto assigned
	is.Equal(result.Abbreviation, "se`")      // Abbreviation
	is.Equal(result.Body, "Snippet Expander") // Body
	is.Equal(result.LastUsed, lastUsed)       // 0 timestamp

	id, err := uuid.NewV4()
	is.NoErr(err)


@@ 394,8 394,8 @@ func TestManager_InsertSnippet(t *testing.T) {
	// New snippet but with duplicate abbreviation.
	newSnippet = &snippet.Snippet{
		ID:           id,
		Abbreviation: "sp`",
		Body:         "Snippet Pixie rules!",
		Abbreviation: "se`",
		Body:         "Snippet Expander rules!",
		LastUsed:     lastUsed,
	}



@@ 407,11 407,11 @@ func TestManager_InsertSnippet(t *testing.T) {
	}(tx)

	// This should fail abbreviation's unique constraint.
	result, err = manager.InsertSnippet(tx, newSnippet)
	_, err = manager.InsertSnippet(tx, newSnippet)
	is.True(err != nil)

	// Change to non-duplicate abbreviation.
	newSnippet.Abbreviation = "spr`"
	newSnippet.Abbreviation = "ser`"

	result, err = manager.InsertSnippet(tx, newSnippet)
	is.NoErr(err)


@@ 419,8 419,8 @@ func TestManager_InsertSnippet(t *testing.T) {
	err = tx.Commit()
	is.NoErr(err) // commit

	is.Equal(result.ID, id)                       // ID
	is.Equal(result.Abbreviation, "spr`")         // Abbreviation
	is.Equal(result.Body, "Snippet Pixie rules!") // Body
	is.Equal(result.LastUsed, lastUsed)           // LastUsed
	is.Equal(result.ID, id)                          // ID
	is.Equal(result.Abbreviation, "ser`")            // Abbreviation
	is.Equal(result.Body, "Snippet Expander rules!") // Body
	is.Equal(result.LastUsed, lastUsed)              // LastUsed
}

M internal/paste/go.mod => internal/paste/go.mod +1 -1
@@ 1,3 1,3 @@
module git.sr.ht/~ianmjones/snippetpixie/internal/paste
module git.sr.ht/~ianmjones/snippetexpander/internal/paste

go 1.19

M internal/service/go.mod => internal/service/go.mod +5 -5
@@ 1,14 1,14 @@
module git.sr.ht/~ianmjones/snippetpixie/internal/service
module git.sr.ht/~ianmjones/snippetexpander/internal/service

go 1.19

replace git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice
replace git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished => ../../pkg/dbusservice

replace git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet
replace git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished => ../../pkg/snippet

require (
	git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished
	github.com/godbus/dbus/v5 v5.1.0
)


M internal/service/service.go => internal/service/service.go +3 -3
@@ 3,8 3,8 @@ package service
import (
	"errors"

	"git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice"
	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
	"git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice"
	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
	"github.com/godbus/dbus/v5"
	"github.com/gofrs/uuid"
)


@@ 205,7 205,7 @@ func (service *Service) RemoveSnippet(abbreviation string) (bool, error) {

// SyncSnippets in database with options to handle clashes.
func (service *Service) SyncSnippets(snippets []*snippet.Snippet, options dbusservice.SyncOptions) (dbusservice.SyncResult, error) {
	var stats = dbusservice.SyncResult{}
	stats := dbusservice.SyncResult{}
	var dbusSnippets []*dbusservice.Snippet

	for _, syncSnippet := range snippets {

M pkg/dbusservice/dbusservice.go => pkg/dbusservice/dbusservice.go +5 -4
@@ 3,13 3,14 @@ package dbusservice
import (
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
	"github.com/gofrs/uuid"

	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
)

const BaseDest = "org.snippetpixie.daemon"
const BasePath = "/org/snippetpixie/daemon"
const (
	BaseDest = "org.snippetexpander.daemon"
	BasePath = "/org/snippetexpander/daemon"
)

type Snippet struct {
	ID           string

M pkg/dbusservice/dbusservice_test.go => pkg/dbusservice/dbusservice_test.go +8 -9
@@ 1,13 1,12 @@
package dbusservice

import (
	"github.com/gofrs/uuid"
	"testing"
	"time"

	"git.sr.ht/~ianmjones/snippetexpander/pkg/snippet"
	"github.com/gofrs/uuid"
	isIt "github.com/matryer/is"

	"git.sr.ht/~ianmjones/snippetpixie/pkg/snippet"
)

func TestSnippet_FromSnippet(t *testing.T) {


@@ 18,8 17,8 @@ func TestSnippet_FromSnippet(t *testing.T) {

	in := &snippet.Snippet{
		ID:           id,
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
		LastUsed:     time.Now().UTC(),
	}



@@ 39,8 38,8 @@ func TestSnippet_ToSnippet(t *testing.T) {

	in := &Snippet{
		ID:           id.String(),
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
		LastUsed:     time.Now().UTC().Unix(),
	}



@@ 56,8 55,8 @@ func TestSnippet_ToSnippetEmptyID(t *testing.T) {
	is := isIt.New(t)

	in := &Snippet{
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
		LastUsed:     time.Now().UTC().Unix(),
	}


M pkg/dbusservice/go.mod => pkg/dbusservice/go.mod +3 -3
@@ 1,11 1,11 @@
module git.sr.ht/~ianmjones/snippetpixie/pkg/dbusservice
module git.sr.ht/~ianmjones/snippetexpander/pkg/dbusservice

go 1.19

replace git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished => ../snippet
replace git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished => ../snippet

require (
	git.sr.ht/~ianmjones/snippetpixie/pkg/snippet v0.0.0-unpublished
	git.sr.ht/~ianmjones/snippetexpander/pkg/snippet v0.0.0-unpublished
	github.com/gofrs/uuid v4.4.0+incompatible
)


M pkg/snippet/go.mod => pkg/snippet/go.mod +1 -1
@@ 1,4 1,4 @@
module git.sr.ht/~ianmjones/snippetpixie/pkg/snippet
module git.sr.ht/~ianmjones/snippetexpander/pkg/snippet

go 1.19


M pkg/snippet/snippet_test.go => pkg/snippet/snippet_test.go +21 -21
@@ 3,11 3,11 @@ package snippet
import (
	"encoding/json"
	"fmt"
	"github.com/gofrs/uuid"
	"strings"
	"testing"
	"time"

	"github.com/gofrs/uuid"
	isIt "github.com/matryer/is"
)



@@ 21,15 21,15 @@ func TestSnippet_String(t *testing.T) {

	in := &Snippet{
		ID:           id,
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
		LastUsed:     now,
	}

	out := in.String()
	is.True(strings.Contains(out, id.String()) == false)  // should not contain id
	is.True(strings.Contains(out, now.String()) == false) // should not contain lastUsed
	is.Equal(out, "sp` Snippet Pixie")                    // expected output
	is.Equal(out, "se` Snippet Expander")                 // expected output
}

func TestSnippet_FormattedString(t *testing.T) {


@@ 42,40 42,40 @@ func TestSnippet_FormattedString(t *testing.T) {

	in := &Snippet{
		ID:           id,
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
		LastUsed:     now,
	}

	out := in.FormattedString(true, true, true, true, "|")
	is.True(strings.Contains(out, id.String()+"|"))
	is.True(strings.Contains(out, "|sp`|"))
	is.True(strings.Contains(out, "|Snippet Pixie|"))
	is.True(strings.Contains(out, "|se`|"))
	is.True(strings.Contains(out, "|Snippet Expander|"))
	is.True(strings.Contains(out, "|"+now.String()))
	is.Equal(out, id.String()+"|sp`|Snippet Pixie|"+now.String())
	is.Equal(out, id.String()+"|se`|Snippet Expander|"+now.String())

	out = in.FormattedString(false, true, true, false, " ")
	is.True(strings.Contains(out, id.String()) == false)  // should not contain id
	is.True(strings.Contains(out, now.String()) == false) // should not contain lastUsed
	is.Equal(out, "sp` Snippet Pixie")                    // expected output
	is.Equal(out, "se` Snippet Expander")                 // expected output

	out = in.FormattedString(false, false, false, false, "|")
	is.True(strings.Contains(out, id.String()) == false)     // should not contain id
	is.True(strings.Contains(out, "sp`") == false)           // should not contain abbreviation
	is.True(strings.Contains(out, "Snippet Pixie") == false) // should not contain body
	is.True(strings.Contains(out, now.String()) == false)    // should not contain lastUsed
	is.True(strings.Contains(out, "|") == false)             // should not contain pipe delimiter
	is.Equal(out, "")                                        // expected output
	is.True(strings.Contains(out, id.String()) == false)        // should not contain id
	is.True(strings.Contains(out, "se`") == false)              // should not contain abbreviation
	is.True(strings.Contains(out, "Snippet Expander") == false) // should not contain body
	is.True(strings.Contains(out, now.String()) == false)       // should not contain lastUsed
	is.True(strings.Contains(out, "|") == false)                // should not contain pipe delimiter
	is.Equal(out, "")                                           // expected output

	out = in.FormattedString(false, true, true, false, "")
	is.True(strings.Contains(out, id.String()) == false)  // should not contain id
	is.True(strings.Contains(out, now.String()) == false) // should not contain lastUsed
	is.Equal(out, "sp`Snippet Pixie")                     // expected output
	is.Equal(out, "se`Snippet Expander")                  // expected output

	out = in.FormattedString(false, true, true, false, "\t")
	is.True(strings.Contains(out, id.String()) == false)  // should not contain id
	is.True(strings.Contains(out, now.String()) == false) // should not contain lastUsed
	is.Equal(out, "sp`\tSnippet Pixie")                   // expected output
	is.Equal(out, "se`\tSnippet Expander")                // expected output
}

func TestSnippet_MarshalSJSON(t *testing.T) {


@@ 88,12 88,12 @@ func TestSnippet_MarshalSJSON(t *testing.T) {

	in := &Snippet{
		ID:           id,
		Abbreviation: "sp`",
		Body:         "Snippet Pixie",
		Abbreviation: "se`",
		Body:         "Snippet Expander",
		LastUsed:     now,
	}

	out, err := json.Marshal(in)
	is.NoErr(err)
	is.Equal(fmt.Sprintf("%s", out), `{"id":"`+id.String()+`","abbreviation":"`+"sp`"+`","body":"Snippet Pixie","lastUsed":`+fmt.Sprintf("%d", now.Unix())+`}`)
	is.Equal(fmt.Sprintf("%s", out), `{"id":"`+id.String()+`","abbreviation":"`+"se`"+`","body":"Snippet Expander","lastUsed":`+fmt.Sprintf("%d", now.Unix())+`}`)
}

M site/src/routes/+layout.svelte => site/src/routes/+layout.svelte +2 -2
@@ 1,5 1,5 @@
<svelte:head>
	<title>Snippet Pixie</title>
	<title>Snippet Expander</title>
</svelte:head>
<div>
	<slot/>


@@ 11,4 11,4 @@
		flex-direction: column;
		align-items: center;
	}
</style>
\ No newline at end of file
</style>

M site/src/routes/+page.svelte => site/src/routes/+page.svelte +6 -6
@@ 1,8 1,8 @@
<svelte:head>
	<title>Snippet Pixie: Next</title>
	<title>Snippet Expander: Next</title>
</svelte:head>
<img src="img/snippetpixie-icon-128.svg" alt="Snippet Pixie icon">
<h1>Snippet Pixie</h1>
<img src="img/snippetexpander-icon-128.svg" alt="Snippet Expander icon">
<h1>Snippet Expander</h1>
<p>Your little expandable text snippets helper</p>
<p>
	This site is under construction, you probably want to grab Snippet Pixie


@@ 16,8 16,8 @@
	<li><a href="https://github.com/bytepixie/snippetpixie">GitHub</a></li>
</ul>
<p>
	If you're curious about the next version of Snippet Pixie that is still in heavy development,
	you can check out its <a href="https://git.sr.ht/~ianmjones/snippetpixie/">sr.ht repository</a>.
	If you're curious about the next version of Snippet Pixie, renamed to Snippet Expander, that is still in heavy development,
	you can check out its <a href="https://git.sr.ht/~ianmjones/snippetexpander/">sr.ht repository</a>.
</p>
<p>
	You can also check out the <a href="https://www.youtube.com/playlist?list=PLDWtdmaxq1ffF88D6T5ogj0co0z71iOl9">Snippet Pixie:Next YouTube playlist</a>.


@@ 38,4 38,4 @@
		content: "=> ";
		color: var(--warning-color);
	}
</style>
\ No newline at end of file
</style>

R site/static/img/snippetpixie-icon-128.svg => site/static/img/snippetexpander-icon-128.svg +0 -0
R site/static/img/snippetpixie-icon-256.png => site/static/img/snippetexpander-icon-256.png +0 -0
R site/static/img/snippetpixie-icon-256.svg => site/static/img/snippetexpander-icon-256.svg +0 -0
R site/static/img/snippetpixie-icon-32.svg => site/static/img/snippetexpander-icon-32.svg +0 -0
R site/static/img/snippetpixie-icon-48.svg => site/static/img/snippetexpander-icon-48.svg +0 -0
R site/static/img/snippetpixie-icon-64.svg => site/static/img/snippetexpander-icon-64.svg +0 -0