diff --git a/core/settings.go b/core/settings.go index 18e910e17..4beb5dd31 100644 --- a/core/settings.go +++ b/core/settings.go @@ -10,48 +10,46 @@ import ( validation "github.com/go-ozzo/ozzo-validation/v4" "github.com/go-ozzo/ozzo-validation/v4/is" "github.com/pocketbase/pocketbase/tools/auth" + "github.com/pocketbase/pocketbase/tools/rest" "github.com/pocketbase/pocketbase/tools/security" ) -// Common settings placeholder tokens -const ( - EmailPlaceholderAppUrl string = "%APP_URL%" - EmailPlaceholderToken string = "%TOKEN%" -) - // Settings defines common app configuration options. type Settings struct { mux sync.RWMutex - Meta MetaConfig `form:"meta" json:"meta"` - Logs LogsConfig `form:"logs" json:"logs"` - Smtp SmtpConfig `form:"smtp" json:"smtp"` - S3 S3Config `form:"s3" json:"s3"` - AdminAuthToken TokenConfig `form:"adminAuthToken" json:"adminAuthToken"` - AdminPasswordResetToken TokenConfig `form:"adminPasswordResetToken" json:"adminPasswordResetToken"` - UserAuthToken TokenConfig `form:"userAuthToken" json:"userAuthToken"` - UserPasswordResetToken TokenConfig `form:"userPasswordResetToken" json:"userPasswordResetToken"` - UserEmailChangeToken TokenConfig `form:"userEmailChangeToken" json:"userEmailChangeToken"` - UserVerificationToken TokenConfig `form:"userVerificationToken" json:"userVerificationToken"` - EmailAuth EmailAuthConfig `form:"emailAuth" json:"emailAuth"` - GoogleAuth AuthProviderConfig `form:"googleAuth" json:"googleAuth"` - FacebookAuth AuthProviderConfig `form:"facebookAuth" json:"facebookAuth"` - GithubAuth AuthProviderConfig `form:"githubAuth" json:"githubAuth"` - GitlabAuth AuthProviderConfig `form:"gitlabAuth" json:"gitlabAuth"` + Meta MetaConfig `form:"meta" json:"meta"` + Logs LogsConfig `form:"logs" json:"logs"` + Smtp SmtpConfig `form:"smtp" json:"smtp"` + S3 S3Config `form:"s3" json:"s3"` + + AdminAuthToken TokenConfig `form:"adminAuthToken" json:"adminAuthToken"` + AdminPasswordResetToken TokenConfig `form:"adminPasswordResetToken" json:"adminPasswordResetToken"` + UserAuthToken TokenConfig `form:"userAuthToken" json:"userAuthToken"` + UserPasswordResetToken TokenConfig `form:"userPasswordResetToken" json:"userPasswordResetToken"` + UserEmailChangeToken TokenConfig `form:"userEmailChangeToken" json:"userEmailChangeToken"` + UserVerificationToken TokenConfig `form:"userVerificationToken" json:"userVerificationToken"` + + EmailAuth EmailAuthConfig `form:"emailAuth" json:"emailAuth"` + GoogleAuth AuthProviderConfig `form:"googleAuth" json:"googleAuth"` + FacebookAuth AuthProviderConfig `form:"facebookAuth" json:"facebookAuth"` + GithubAuth AuthProviderConfig `form:"githubAuth" json:"githubAuth"` + GitlabAuth AuthProviderConfig `form:"gitlabAuth" json:"gitlabAuth"` } // NewSettings creates and returns a new default Settings instance. func NewSettings() *Settings { return &Settings{ Meta: MetaConfig{ - AppName: "Acme", - AppUrl: "http://localhost:8090", - SenderName: "Support", - SenderAddress: "support@example.com", - UserVerificationUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-verification/" + EmailPlaceholderToken, - UserResetPasswordUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-password-reset/" + EmailPlaceholderToken, - UserConfirmEmailChangeUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-email-change/" + EmailPlaceholderToken, + AppName: "Acme", + AppUrl: "http://localhost:8090", + SenderName: "Support", + SenderAddress: "support@example.com", + VerificationTemplate: defaultVerificationTemplate, + ResetPasswordTemplate: defaultResetPasswordTemplate, + ConfirmEmailChangeTemplate: defaultConfirmEmailChangeTemplate, }, + Logs: LogsConfig{ MaxDays: 7, }, @@ -194,6 +192,9 @@ func (s *Settings) RedactClone() (*Settings, error) { // NamedAuthProviderConfigs returns a map with all registered OAuth2 // provider configurations (indexed by their name identifier). func (s *Settings) NamedAuthProviderConfigs() map[string]AuthProviderConfig { + s.mux.RLock() + defer s.mux.RUnlock() + return map[string]AuthProviderConfig{ auth.NameGoogle: s.GoogleAuth, auth.NameFacebook: s.FacebookAuth, @@ -267,13 +268,13 @@ func (c S3Config) Validate() error { // ------------------------------------------------------------------- type MetaConfig struct { - AppName string `form:"appName" json:"appName"` - AppUrl string `form:"appUrl" json:"appUrl"` - SenderName string `form:"senderName" json:"senderName"` - SenderAddress string `form:"senderAddress" json:"senderAddress"` - UserVerificationUrl string `form:"userVerificationUrl" json:"userVerificationUrl"` - UserResetPasswordUrl string `form:"userResetPasswordUrl" json:"userResetPasswordUrl"` - UserConfirmEmailChangeUrl string `form:"userConfirmEmailChangeUrl" json:"userConfirmEmailChangeUrl"` + AppName string `form:"appName" json:"appName"` + AppUrl string `form:"appUrl" json:"appUrl"` + SenderName string `form:"senderName" json:"senderName"` + SenderAddress string `form:"senderAddress" json:"senderAddress"` + VerificationTemplate EmailTemplate `form:"verificationTemplate" json:"verificationTemplate"` + ResetPasswordTemplate EmailTemplate `form:"resetPasswordTemplate" json:"resetPasswordTemplate"` + ConfirmEmailChangeTemplate EmailTemplate `form:"confirmEmailChangeTemplate" json:"confirmEmailChangeTemplate"` } // Validate makes MetaConfig validatable by implementing [validation.Validatable] interface. @@ -283,34 +284,45 @@ func (c MetaConfig) Validate() error { validation.Field(&c.AppUrl, validation.Required, is.URL), validation.Field(&c.SenderName, validation.Required, validation.Length(1, 255)), validation.Field(&c.SenderAddress, is.Email, validation.Required), + validation.Field(&c.VerificationTemplate, validation.Required), + validation.Field(&c.ResetPasswordTemplate, validation.Required), + validation.Field(&c.ConfirmEmailChangeTemplate, validation.Required), + ) +} + +type EmailTemplate struct { + Body string `form:"body" json:"body"` + Subject string `form:"subject" json:"subject"` + ActionUrl string `form:"actionUrl" json:"actionUrl"` +} + +// Validate makes EmailTemplate validatable by implementing [validation.Validatable] interface. +func (t EmailTemplate) Validate() error { + return validation.ValidateStruct(&t, + validation.Field(&t.Subject, validation.Required), validation.Field( - &c.UserVerificationUrl, - validation.Required, - validation.By(c.checkPlaceholders(EmailPlaceholderToken)), - ), - validation.Field( - &c.UserResetPasswordUrl, + &t.Body, validation.Required, - validation.By(c.checkPlaceholders(EmailPlaceholderToken)), + validation.By(checkPlaceholderParams(EmailPlaceholderActionUrl)), ), validation.Field( - &c.UserConfirmEmailChangeUrl, + &t.ActionUrl, validation.Required, - validation.By(c.checkPlaceholders(EmailPlaceholderToken)), + validation.By(checkPlaceholderParams(EmailPlaceholderToken)), ), ) } -func (c *MetaConfig) checkPlaceholders(params ...string) validation.RuleFunc { +func checkPlaceholderParams(params ...string) validation.RuleFunc { return func(value any) error { v, _ := value.(string) - if v == "" { - return nil // nothing to check - } for _, param := range params { if !strings.Contains(v, param) { - return validation.NewError("validation_missing_required_param", fmt.Sprintf("Missing required parameter %q", param)) + return validation.NewError( + "validation_missing_required_param", + fmt.Sprintf("Missing required parameter %q", param), + ) } } @@ -318,6 +330,50 @@ func (c *MetaConfig) checkPlaceholders(params ...string) validation.RuleFunc { } } +// Resolve replaces the placeholder parameters in the current email +// template and returns its components as ready-to-use strings. +func (t EmailTemplate) Resolve( + appName string, + appUrl, + token string, +) (subject, body, actionUrl string) { + // replace action url placeholder params (if any) + actionUrlParams := map[string]string{ + EmailPlaceholderAppName: appName, + EmailPlaceholderAppUrl: appUrl, + EmailPlaceholderToken: token, + } + actionUrl = t.ActionUrl + for k, v := range actionUrlParams { + actionUrl = strings.ReplaceAll(actionUrl, k, v) + } + actionUrl, _ = rest.NormalizeUrl(actionUrl) + + // replace body placeholder params (if any) + bodyParams := map[string]string{ + EmailPlaceholderAppName: appName, + EmailPlaceholderAppUrl: appUrl, + EmailPlaceholderToken: token, + EmailPlaceholderActionUrl: actionUrl, + } + body = t.Body + for k, v := range bodyParams { + body = strings.ReplaceAll(body, k, v) + } + + // replace subject placeholder params (if any) + subjectParams := map[string]string{ + EmailPlaceholderAppName: appName, + EmailPlaceholderAppUrl: appUrl, + } + subject = t.Subject + for k, v := range subjectParams { + subject = strings.ReplaceAll(subject, k, v) + } + + return subject, body, actionUrl +} + // ------------------------------------------------------------------- type LogsConfig struct { @@ -333,6 +389,35 @@ func (c LogsConfig) Validate() error { // ------------------------------------------------------------------- +type EmailAuthConfig struct { + Enabled bool `form:"enabled" json:"enabled"` + ExceptDomains []string `form:"exceptDomains" json:"exceptDomains"` + OnlyDomains []string `form:"onlyDomains" json:"onlyDomains"` + MinPasswordLength int `form:"minPasswordLength" json:"minPasswordLength"` +} + +// Validate makes `EmailAuthConfig` validatable by implementing [validation.Validatable] interface. +func (c EmailAuthConfig) Validate() error { + return validation.ValidateStruct(&c, + validation.Field( + &c.ExceptDomains, + validation.When(len(c.OnlyDomains) > 0, validation.Empty).Else(validation.Each(is.Domain)), + ), + validation.Field( + &c.OnlyDomains, + validation.When(len(c.ExceptDomains) > 0, validation.Empty).Else(validation.Each(is.Domain)), + ), + validation.Field( + &c.MinPasswordLength, + validation.When(c.Enabled, validation.Required), + validation.Min(5), + validation.Max(100), + ), + ) +} + +// ------------------------------------------------------------------- + type AuthProviderConfig struct { Enabled bool `form:"enabled" json:"enabled"` AllowRegistrations bool `form:"allowRegistrations" json:"allowRegistrations"` @@ -382,32 +467,3 @@ func (c AuthProviderConfig) SetupProvider(provider auth.Provider) error { return nil } - -// ------------------------------------------------------------------- - -type EmailAuthConfig struct { - Enabled bool `form:"enabled" json:"enabled"` - ExceptDomains []string `form:"exceptDomains" json:"exceptDomains"` - OnlyDomains []string `form:"onlyDomains" json:"onlyDomains"` - MinPasswordLength int `form:"minPasswordLength" json:"minPasswordLength"` -} - -// Validate makes `EmailAuthConfig` validatable by implementing [validation.Validatable] interface. -func (c EmailAuthConfig) Validate() error { - return validation.ValidateStruct(&c, - validation.Field( - &c.ExceptDomains, - validation.When(len(c.OnlyDomains) > 0, validation.Empty).Else(validation.Each(is.Domain)), - ), - validation.Field( - &c.OnlyDomains, - validation.When(len(c.ExceptDomains) > 0, validation.Empty).Else(validation.Each(is.Domain)), - ), - validation.Field( - &c.MinPasswordLength, - validation.When(c.Enabled, validation.Required), - validation.Min(5), - validation.Max(100), - ), - ) -} diff --git a/core/settings_templates.go b/core/settings_templates.go new file mode 100644 index 000000000..0e25e677a --- /dev/null +++ b/core/settings_templates.go @@ -0,0 +1,55 @@ +package core + +// Common settings placeholder tokens +const ( + EmailPlaceholderAppName string = "{APP_NAME}" + EmailPlaceholderAppUrl string = "{APP_URL}" + EmailPlaceholderToken string = "{TOKEN}" + EmailPlaceholderActionUrl string = "{ACTION_URL}" +) + +var defaultVerificationTemplate = EmailTemplate{ + Subject: "Verify your " + EmailPlaceholderAppName + " email", + Body: `

Hello,

+

Thank you for joining us at ` + EmailPlaceholderAppName + `.

+

Click on the button below to verify your email address.

+

+ Verify +

+ +

+ Thanks,
+ ` + EmailPlaceholderAppName + ` team +

`, + ActionUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-verification/" + EmailPlaceholderToken, +} + +var defaultResetPasswordTemplate = EmailTemplate{ + Subject: "Reset your " + EmailPlaceholderAppName + " password", + Body: `

Hello,

+

Click on the button below to reset your password.

+

+ Reset password +

+

If you didn't ask to reset your password, you can ignore this email.

+

+ Thanks,
+ ` + EmailPlaceholderAppName + ` team +

`, + ActionUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-password-reset/" + EmailPlaceholderToken, +} + +var defaultConfirmEmailChangeTemplate = EmailTemplate{ + Subject: "Confirm your " + EmailPlaceholderAppName + " new email address", + Body: `

Hello,

+

Click on the button below to confirm your new email address.

+

+ Confirm new email +

+

If you didn't ask to change your email address, you can ignore this email.

+

+ Thanks,
+ ` + EmailPlaceholderAppName + ` team +

`, + ActionUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-email-change/" + EmailPlaceholderToken, +} diff --git a/core/settings_test.go b/core/settings_test.go index de7aa146d..923333785 100644 --- a/core/settings_test.go +++ b/core/settings_test.go @@ -2,9 +2,11 @@ package core_test import ( "encoding/json" + "fmt" "strings" "testing" + validation "github.com/go-ozzo/ozzo-validation/v4" "github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/tools/auth" ) @@ -172,7 +174,7 @@ func TestSettingsRedactClone(t *testing.T) { t.Fatal(err) } - expected := `{"meta":{"appName":"test123","appUrl":"http://localhost:8090","senderName":"Support","senderAddress":"support@example.com","userVerificationUrl":"%APP_URL%/_/#/users/confirm-verification/%TOKEN%","userResetPasswordUrl":"%APP_URL%/_/#/users/confirm-password-reset/%TOKEN%","userConfirmEmailChangeUrl":"%APP_URL%/_/#/users/confirm-email-change/%TOKEN%"},"logs":{"maxDays":7},"smtp":{"enabled":false,"host":"smtp.example.com","port":587,"username":"","password":"******","tls":true},"s3":{"enabled":false,"bucket":"","region":"","endpoint":"","accessKey":"","secret":"******","forcePathStyle":false},"adminAuthToken":{"secret":"******","duration":1209600},"adminPasswordResetToken":{"secret":"******","duration":1800},"userAuthToken":{"secret":"******","duration":1209600},"userPasswordResetToken":{"secret":"******","duration":1800},"userEmailChangeToken":{"secret":"******","duration":1800},"userVerificationToken":{"secret":"******","duration":604800},"emailAuth":{"enabled":true,"exceptDomains":null,"onlyDomains":null,"minPasswordLength":8},"googleAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"},"facebookAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"},"githubAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"},"gitlabAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"}}` + expected := `{"meta":{"appName":"test123","appUrl":"http://localhost:8090","senderName":"Support","senderAddress":"support@example.com","verificationTemplate":{"body":"\u003cp\u003eHello,\u003c/p\u003e\n\u003cp\u003eThank you for joining us at {APP_NAME}.\u003c/p\u003e\n\u003cp\u003eClick on the button below to verify your email address.\u003c/p\u003e\n\u003cp\u003e\n \u003ca class=\"btn\" href=\"{ACTION_URL}\" target=\"_blank\" rel=\"noopener\"\u003eVerify\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n Thanks,\u003cbr/\u003e\n {APP_NAME} team\n\u003c/p\u003e","subject":"Verify your {APP_NAME} email","actionUrl":"{APP_URL}/_/#/users/confirm-verification/{TOKEN}"},"resetPasswordTemplate":{"body":"\u003cp\u003eHello,\u003c/p\u003e\n\u003cp\u003eClick on the button below to reset your password.\u003c/p\u003e\n\u003cp\u003e\n \u003ca class=\"btn\" href=\"{ACTION_URL}\" target=\"_blank\" rel=\"noopener\"\u003eReset password\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003e\u003ci\u003eIf you didn't ask to reset your password, you can ignore this email.\u003c/i\u003e\u003c/p\u003e\n\u003cp\u003e\n Thanks,\u003cbr/\u003e\n {APP_NAME} team\n\u003c/p\u003e","subject":"Reset your {APP_NAME} password","actionUrl":"{APP_URL}/_/#/users/confirm-password-reset/{TOKEN}"},"confirmEmailChangeTemplate":{"body":"\u003cp\u003eHello,\u003c/p\u003e\n\u003cp\u003eClick on the button below to confirm your new email address.\u003c/p\u003e\n\u003cp\u003e\n \u003ca class=\"btn\" href=\"{ACTION_URL}\" target=\"_blank\" rel=\"noopener\"\u003eConfirm new email\u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003e\u003ci\u003eIf you didn't ask to change your email address, you can ignore this email.\u003c/i\u003e\u003c/p\u003e\n\u003cp\u003e\n Thanks,\u003cbr/\u003e\n {APP_NAME} team\n\u003c/p\u003e","subject":"Confirm your {APP_NAME} new email address","actionUrl":"{APP_URL}/_/#/users/confirm-email-change/{TOKEN}"}},"logs":{"maxDays":7},"smtp":{"enabled":false,"host":"smtp.example.com","port":587,"username":"","password":"******","tls":true},"s3":{"enabled":false,"bucket":"","region":"","endpoint":"","accessKey":"","secret":"******","forcePathStyle":false},"adminAuthToken":{"secret":"******","duration":1209600},"adminPasswordResetToken":{"secret":"******","duration":1800},"userAuthToken":{"secret":"******","duration":1209600},"userPasswordResetToken":{"secret":"******","duration":1800},"userEmailChangeToken":{"secret":"******","duration":1800},"userVerificationToken":{"secret":"******","duration":604800},"emailAuth":{"enabled":true,"exceptDomains":null,"onlyDomains":null,"minPasswordLength":8},"googleAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"},"facebookAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"},"githubAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"},"gitlabAuth":{"enabled":false,"allowRegistrations":true,"clientSecret":"******"}}` if encodedStr := string(encoded); encodedStr != expected { t.Fatalf("Expected %v, got \n%v", expected, encodedStr) @@ -355,6 +357,24 @@ func TestS3ConfigValidate(t *testing.T) { } func TestMetaConfigValidate(t *testing.T) { + invalidTemplate := core.EmailTemplate{ + Subject: "test", + ActionUrl: "test", + Body: "test", + } + + noPlaceholdersTemplate := core.EmailTemplate{ + Subject: "test", + ActionUrl: "http://example.com", + Body: "test", + } + + withPlaceholdersTemplate := core.EmailTemplate{ + Subject: "test", + ActionUrl: "http://example.com" + core.EmailPlaceholderToken, + Body: "test" + core.EmailPlaceholderActionUrl, + } + scenarios := []struct { config core.MetaConfig expectError bool @@ -367,39 +387,39 @@ func TestMetaConfigValidate(t *testing.T) { // invalid data { core.MetaConfig{ - AppName: strings.Repeat("a", 300), - AppUrl: "test", - SenderName: strings.Repeat("a", 300), - SenderAddress: "invalid_email", - UserVerificationUrl: "test", - UserResetPasswordUrl: "test", - UserConfirmEmailChangeUrl: "test", + AppName: strings.Repeat("a", 300), + AppUrl: "test", + SenderName: strings.Repeat("a", 300), + SenderAddress: "invalid_email", + VerificationTemplate: invalidTemplate, + ResetPasswordTemplate: invalidTemplate, + ConfirmEmailChangeTemplate: invalidTemplate, }, true, }, // invalid data (missing required placeholders) { core.MetaConfig{ - AppName: "test", - AppUrl: "https://example.com", - SenderName: "test", - SenderAddress: "test@example.com", - UserVerificationUrl: "https://example.com", - UserResetPasswordUrl: "https://example.com", - UserConfirmEmailChangeUrl: "https://example.com", + AppName: "test", + AppUrl: "https://example.com", + SenderName: "test", + SenderAddress: "test@example.com", + VerificationTemplate: noPlaceholdersTemplate, + ResetPasswordTemplate: noPlaceholdersTemplate, + ConfirmEmailChangeTemplate: noPlaceholdersTemplate, }, true, }, // valid data { core.MetaConfig{ - AppName: "test", - AppUrl: "https://example.com", - SenderName: "test", - SenderAddress: "test@example.com", - UserVerificationUrl: "https://example.com/" + core.EmailPlaceholderToken, - UserResetPasswordUrl: "https://example.com/" + core.EmailPlaceholderToken, - UserConfirmEmailChangeUrl: "https://example.com/" + core.EmailPlaceholderToken, + AppName: "test", + AppUrl: "https://example.com", + SenderName: "test", + SenderAddress: "test@example.com", + VerificationTemplate: withPlaceholdersTemplate, + ResetPasswordTemplate: withPlaceholdersTemplate, + ConfirmEmailChangeTemplate: withPlaceholdersTemplate, }, false, }, @@ -418,6 +438,130 @@ func TestMetaConfigValidate(t *testing.T) { } } +func TestEmailTemplateValidate(t *testing.T) { + scenarios := []struct { + emailTemplate core.EmailTemplate + expectedErrors []string + }{ + // require values + { + core.EmailTemplate{}, + []string{"subject", "actionUrl", "body"}, + }, + // missing placeholders + { + core.EmailTemplate{ + Subject: "test", + ActionUrl: "test", + Body: "test", + }, + []string{"actionUrl", "body"}, + }, + // valid data + { + core.EmailTemplate{ + Subject: "test", + ActionUrl: "test" + core.EmailPlaceholderToken, + Body: "test" + core.EmailPlaceholderActionUrl, + }, + []string{}, + }, + } + + for i, s := range scenarios { + result := s.emailTemplate.Validate() + + // parse errors + errs, ok := result.(validation.Errors) + if !ok && result != nil { + t.Errorf("(%d) Failed to parse errors %v", i, result) + continue + } + + // check errors + if len(errs) > len(s.expectedErrors) { + t.Errorf("(%d) Expected error keys %v, got %v", i, s.expectedErrors, errs) + } + for _, k := range s.expectedErrors { + if _, ok := errs[k]; !ok { + t.Errorf("(%d) Missing expected error key %q in %v", i, k, errs) + } + } + } +} + +func TestEmailTemplateResolve(t *testing.T) { + allPlaceholders := core.EmailPlaceholderActionUrl + core.EmailPlaceholderToken + core.EmailPlaceholderAppName + core.EmailPlaceholderAppUrl + + scenarios := []struct { + emailTemplate core.EmailTemplate + expectedSubject string + expectedBody string + expectedActionUrl string + }{ + // no placeholders + { + emailTemplate: core.EmailTemplate{ + Subject: "subject:", + Body: "body:", + ActionUrl: "/actionUrl////", + }, + expectedSubject: "subject:", + expectedActionUrl: "/actionUrl/", + expectedBody: "body:", + }, + // with placeholders + { + emailTemplate: core.EmailTemplate{ + ActionUrl: "/actionUrl////" + allPlaceholders, + Subject: "subject:" + allPlaceholders, + Body: "body:" + allPlaceholders, + }, + expectedActionUrl: fmt.Sprintf( + "/actionUrl/%%7BACTION_URL%%7D%s%s%s", + "token_test", + "name_test", + "url_test", + ), + expectedSubject: fmt.Sprintf( + "subject:%s%s%s%s", + core.EmailPlaceholderActionUrl, + core.EmailPlaceholderToken, + "name_test", + "url_test", + ), + expectedBody: fmt.Sprintf( + "body:%s%s%s%s", + fmt.Sprintf( + "/actionUrl/%%7BACTION_URL%%7D%s%s%s", + "token_test", + "name_test", + "url_test", + ), + "token_test", + "name_test", + "url_test", + ), + }, + } + + for i, s := range scenarios { + subject, body, actionUrl := s.emailTemplate.Resolve("name_test", "url_test", "token_test") + + if s.expectedSubject != subject { + t.Errorf("(%d) Expected subject %q got %q", i, s.expectedSubject, subject) + } + + if s.expectedBody != body { + t.Errorf("(%d) Expected body \n%v got \n%v", i, s.expectedBody, body) + } + + if s.expectedActionUrl != actionUrl { + t.Errorf("(%d) Expected actionUrl \n%v got \n%v", i, s.expectedActionUrl, actionUrl) + } + } +} + func TestLogsConfigValidate(t *testing.T) { scenarios := []struct { config core.LogsConfig diff --git a/go.mod b/go.mod index 3d31fa804..9c279d7fb 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/AlecAivazis/survey/v2 v2.3.5 - github.com/aws/aws-sdk-go v1.44.48 + github.com/aws/aws-sdk-go v1.44.76 github.com/disintegration/imaging v1.6.2 github.com/domodwyer/mailyak/v3 v3.3.3 github.com/fatih/color v1.13.0 @@ -13,44 +13,41 @@ require ( github.com/golang-jwt/jwt/v4 v4.4.2 github.com/labstack/echo/v5 v5.0.0-20220201181537-ed2888cfa198 github.com/mattn/go-sqlite3 v1.14.14 - github.com/microcosm-cc/bluemonday v1.0.19 github.com/pocketbase/dbx v1.6.0 github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.5.0 - gocloud.dev v0.25.0 - golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d - golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 - modernc.org/sqlite v1.17.3 + gocloud.dev v0.26.0 + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa + golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 + modernc.org/sqlite v1.18.1 ) require ( github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect - github.com/aws/aws-sdk-go-v2 v1.16.7 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.3 // indirect - github.com/aws/aws-sdk-go-v2/config v1.15.13 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.12.8 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.8 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.19 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.15 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.11 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.16.9 // indirect - github.com/aws/smithy-go v1.12.0 // indirect - github.com/aymerick/douceur v0.2.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.16.11 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4 // indirect + github.com/aws/aws-sdk-go-v2/config v1.16.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.12.13 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.9 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.5 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.13 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.16 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 // indirect + github.com/aws/smithy-go v1.12.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/uuid v1.3.0 // indirect github.com/google/wire v0.5.0 // indirect - github.com/googleapis/gax-go/v2 v2.4.0 // indirect - github.com/gorilla/css v1.0.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/googleapis/gax-go/v2 v2.5.1 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/mattn/go-colorable v0.1.12 // indirect @@ -61,24 +58,24 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.1 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/image v0.0.0-20220617043117-41969df76e82 // indirect + golang.org/x/image v0.0.0-20220722155232-062f8c9fd539 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect - golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect - golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect + golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect + golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect + golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - golang.org/x/tools v0.1.11 // indirect + golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect + golang.org/x/tools v0.1.12 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect - google.golang.org/api v0.86.0 // indirect + google.golang.org/api v0.92.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220706132729-d86698d07c53 // indirect - google.golang.org/grpc v1.47.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/genproto v0.0.0-20220812140447-cec7f5303424 // indirect + google.golang.org/grpc v1.48.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect lukechampine.com/uint128 v1.2.0 // indirect - modernc.org/cc/v3 v3.36.0 // indirect - modernc.org/ccgo/v3 v3.16.6 // indirect - modernc.org/libc v1.16.14 // indirect + modernc.org/cc/v3 v3.36.1 // indirect + modernc.org/ccgo/v3 v3.16.8 // indirect + modernc.org/libc v1.16.19 // indirect modernc.org/mathutil v1.4.1 // indirect modernc.org/memory v1.1.1 // indirect modernc.org/opt v0.1.3 // indirect diff --git a/go.sum b/go.sum index 7f10de2de..fc3e78f38 100644 --- a/go.sum +++ b/go.sum @@ -122,68 +122,66 @@ github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:W github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.48 h1:jLDC9RsNoYMLFlKpB8LdqUnoDdC2yvkS4QbuyPQJ8+M= -github.com/aws/aws-sdk-go v1.44.48/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.76 h1:5e8yGO/XeNYKckOjpBKUd5wStf0So3CrQIiOMCVLpOI= +github.com/aws/aws-sdk-go v1.44.76/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v1.16.2/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU= -github.com/aws/aws-sdk-go-v2 v1.16.7 h1:zfBwXus3u14OszRxGcqCDS4MfMCv10e8SMJ2r8Xm0Ns= -github.com/aws/aws-sdk-go-v2 v1.16.7/go.mod h1:6CpKuLXg2w7If3ABZCl/qZ6rEgwtjZTn4eAf4RcEyuw= +github.com/aws/aws-sdk-go-v2 v1.16.11 h1:xM1ZPSvty3xVmdxiGr7ay/wlqv+MWhH0rMlyLdbC0YQ= +github.com/aws/aws-sdk-go-v2 v1.16.11/go.mod h1:WTACcleLz6VZTp7fak4EO5b9Q4foxbn+8PIz3PmyKlo= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1/go.mod h1:n8Bs1ElDD2wJ9kCRTczA83gYbBmjSwZp3umc6zF4EeM= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.3 h1:S/ZBwevQkr7gv5YxONYpGQxlMFFYSRfz3RMcjsC9Qhk= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.3/go.mod h1:gNsR5CaXKmQSSzrmGxmwmct/r+ZBfbxorAuXYsj/M5Y= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4 h1:zfT11pa7ifu/VlLDpmc5OY2W4nYmnKkFDGeMVnmqAI0= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4/go.mod h1:ES0I1GBs+YYgcDS1ek47Erbn4TOL811JKqBXtgzqyZ8= github.com/aws/aws-sdk-go-v2/config v1.15.3/go.mod h1:9YL3v07Xc/ohTsxFXzan9ZpFpdTOFl4X65BAKYaz8jg= -github.com/aws/aws-sdk-go-v2/config v1.15.13 h1:CJH9zn/Enst7lDiGpoguVt0lZr5HcpNVlRJWbJ6qreo= -github.com/aws/aws-sdk-go-v2/config v1.15.13/go.mod h1:AcMu50uhV6wMBUlURnEXhr9b3fX6FLSTlEV89krTEGk= +github.com/aws/aws-sdk-go-v2/config v1.16.1 h1:jasqFPOoNPXHOYGEEuvyT87ACiXhD3OkQckIm5uqi5I= +github.com/aws/aws-sdk-go-v2/config v1.16.1/go.mod h1:4SKzBMiB8lV0fw2w7eDBo/LjQyHFITN4vUUuqpurFmI= github.com/aws/aws-sdk-go-v2/credentials v1.11.2/go.mod h1:j8YsY9TXTm31k4eFhspiQicfXPLZ0gYXA50i4gxPE8g= -github.com/aws/aws-sdk-go-v2/credentials v1.12.8 h1:niTa7zc7uyOP2ufri0jPESBt1h9yP3Zc0q+xzih3h8o= -github.com/aws/aws-sdk-go-v2/credentials v1.12.8/go.mod h1:P2Hd4Sy7mXRxPNcQMPBmqszSJoDXexX8XEDaT6lucO0= +github.com/aws/aws-sdk-go-v2/credentials v1.12.13 h1:cuPzIsjKAWBUAAk8ZUR2l02Sxafl9hiaMsc7tlnjwAY= +github.com/aws/aws-sdk-go-v2/credentials v1.12.13/go.mod h1:9fDEemXizwXrxPU1MTzv69LP/9D8HVl5qHAQO9A9ikY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.3/go.mod h1:uk1vhHHERfSVCUnqSqz8O48LBYDSC+k6brng09jcMOk= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.8 h1:VfBdn2AxwMbFyJN/lF/xuT3SakomJ86PZu3rCxb5K0s= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.8/go.mod h1:oL1Q3KuCq1D4NykQnIvtRiBGLUXhcpY5pl6QZB2XEPU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 h1:wgJBHO58Pc1V1QAnzdVM3JK3WbE/6eUF0JxCZ+/izz0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12/go.mod h1:aZ4vZnyUuxedC7eD4JyEHpGnCz+O2sHQEx3VvAwklSE= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.3/go.mod h1:0dHuD2HZZSiwfJSy1FO5bX1hQ1TxVV1QXXjpn3XUE44= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.19 h1:WfCYqsAADDRNCQQ5LGcrlqbR7SK3PYrP/UCh7qNGBQM= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.19/go.mod h1:koLPv2oF6ksE3zBKLDP0GFmKfaCmYwVHqGIbaPrHIRg= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.25 h1:ShUxLkMxarXylGxfYwg8p+xEKY+C1y54oUU3wFsUMFo= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.25/go.mod h1:cam5wV1ebd3ZVuh2r2CA8FtSAA/eUMtRH4owk0ygfFs= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.9/go.mod h1:AnVH5pvai0pAF4lXRq0bmhbes1u9R8wTE+g+183bZNM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14 h1:2C0pYHcUBmdzPj+EKNC4qj97oK6yjrUhc1KoSodglvk= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14/go.mod h1:kdjrMwHwrC3+FsKhNcCMJ7tUVj/8uSD5CZXeQ4wV6fM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 h1:OmiwoVyLKEqqD5GvB683dbSqxiOfvx4U2lDZhG2Esc4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18/go.mod h1:348MLhzV1GSlZSMusdwQpXKbhD7X2gbI/TxwAPKkYZQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.3/go.mod h1:ssOhaLpRlh88H3UmEcsBoVKq309quMvm3Ds8e9d4eJM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8 h1:2J+jdlBJWEmTyAwC82Ym68xCykIvnSnIN18b8xHGlcc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8/go.mod h1:ZIV8GYoC6WLBW5KGs+o4rsc65/ozd+eQ0L31XF5VDwk= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 h1:5mvQDtNWtI6H56+E4LUnLWEmATMB7oEh+Z9RurtIuC0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12/go.mod h1:ckaCVTEdGAxO6KwTGzgskxR1xM+iJW4lxMyDFVda2Fc= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.10/go.mod h1:8DcYQcz0+ZJaSxANlHIsbbi6S+zMwjwdDqwW3r9AzaE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.15 h1:QquxR7NH3ULBsKC+NoTpilzbKKS+5AELfNREInbhvas= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.15/go.mod h1:Tkrthp/0sNBShQQsamR7j/zY4p19tVTAs+nnqhH6R3c= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5 h1:tEEHn+PGAxRVqMPEhtU8oCSW/1Ge3zP5nUgPrGQNUPs= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.5/go.mod h1:aIwFF3dUk95ocCcA3zfk3nhz0oLkpzHFWuMp8l/4nNs= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 h1:g5qq9sgtEzt2szMaDqQO6fqKe026T6dHTFJp5NsPzkQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19/go.mod h1:cVHo8KTuHjShb9V8/VjH3S/8+xPu16qx8fdGwmotJhE= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.9 h1:agLpf3vtYX1rtKTrOGpevdP3iC2W0hKDmzmhhxJzL+A= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.9/go.mod h1:cv+n1mdyh+0B8tAtlEBzTYFA2Uv15SISEn6kabYhIgE= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.1/go.mod h1:GeUru+8VzrTXV/83XyMJ80KpH8xO89VPoUileyNQ+tc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.3 h1:4n4KCtv5SUoT5Er5XV41huuzrCqepxlW3SDI9qHQebc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.3/go.mod h1:gkb2qADY+OHaGLKNTYxMaQNacfeyQpZ4csDTQMeFmcw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.5 h1:g1ITJ9i9ixa+/WVggLNK20KyliAA8ltnuxfZEDfo2hM= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.5/go.mod h1:oehQLbMQkppKLXvpx/1Eo0X47Fe+0971DXC9UjGnKcI= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.3/go.mod h1:Seb8KNmD6kVTjwRjVEgOT5hPin6sq+v4C2ycJQDwuH8= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9 h1:gVv2vXOMqJeR4ZHHV32K7LElIJIIzyw/RU1b0lSfWTQ= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.9/go.mod h1:EF5RLnD9l0xvEWwMRcktIS/dI6lF8lU5eV3B13k6sWo= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.13 h1:3GamN8jcdz/a3nvL/ZVtoH/6xxeshfsiXj5O+6GW4Rg= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.13/go.mod h1:89CSPn69UECDLVn0H6FwKNgbtirksl8C8i3aBeeeihw= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.3/go.mod h1:wlY6SVjuwvh3TVRpTqdy4I1JpBFLX4UGeKZdWntaocw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8 h1:oKnAXxSF2FUvfgw8uzU/v9OTYorJJZ8eBmWhr9TWVVQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8/go.mod h1:rDVhIMAX9N2r8nWxDUlbubvvaFMnfsm+3jAV7q+rpM4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 h1:7iPTTX4SAI2U2VOogD7/gmHlsgnYSgoNHt7MSQXtG2M= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12/go.mod h1:1TODGhheLWjpQWSuhYuAUWYTCKwEjx2iblIFKDHjeTc= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.3/go.mod h1:Bm/v2IaN6rZ+Op7zX+bOUMdL4fsrYZiD0dsjLhNKwZc= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8 h1:TlN1UC39A0LUNoD51ubO5h32haznA+oVe15jO9O4Lj0= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.8/go.mod h1:JlVwmWtT/1c5W+6oUsjXjAJ0iJZ+hlghdrDy/8JxGCU= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12 h1:QFjSOmHSb77qRTv7KI9UFon9X5wLWY5/M+6la3dTcZc= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12/go.mod h1:MADjAN0GHFDuc5lRa5Y5ki+oIO/w7X4qczHy+OUx0IA= github.com/aws/aws-sdk-go-v2/service/kms v1.16.3/go.mod h1:QuiHPBqlOFCi4LqdSskYYAWpQlx3PKmohy+rE2F+o5g= github.com/aws/aws-sdk-go-v2/service/s3 v1.26.3/go.mod h1:g1qvDuRsJY+XghsV6zg00Z4KJ7DtFFCx8fJD2a491Ak= -github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1 h1:OKQIQ0QhEBmGr2LfT952meIZz3ujrPYnxH+dO/5ldnI= -github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1/go.mod h1:NffjpNsMUFXp6Ok/PahrktAncoekWrywvmIK83Q2raE= +github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5 h1:h9qqTedYnA9JcWjKyLV6UYIMSdp91ExLCUbjbpDLH7A= +github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5/go.mod h1:J8SS5Tp/zeLxaubB0xGfKnVrvssNBNLwTipreTKLhjQ= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.4/go.mod h1:PJc8s+lxyU8rrre0/4a0pn2wgwiDvOEzoOjcJUBr67o= github.com/aws/aws-sdk-go-v2/service/sns v1.17.4/go.mod h1:kElt+uCcXxcqFyc+bQqZPFD9DME/eC6oHBXvFzQ9Bcw= github.com/aws/aws-sdk-go-v2/service/sqs v1.18.3/go.mod h1:skmQo0UPvsjsuYYSYMVmrPc1HWCbHUJyrCEp+ZaLzqM= github.com/aws/aws-sdk-go-v2/service/ssm v1.24.1/go.mod h1:NR/xoKjdbRJ+qx0pMR4mI+N/H1I1ynHwXnO6FowXJc0= github.com/aws/aws-sdk-go-v2/service/sso v1.11.3/go.mod h1:7UQ/e69kU7LDPtY40OyoHYgRmgfGM4mgsLYtcObdveU= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.11 h1:XOJWXNFXJyapJqQuCIPfftsOf0XZZioM0kK6OPRt9MY= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.11/go.mod h1:MO4qguFjs3wPGcCSpQ7kOFTwRvb+eu+fn+1vKleGHUk= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.16 h1:YK8L7TNlGwMWHYqLs+i6dlITpxqzq08FqQUy26nm+T8= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.16/go.mod h1:mS5xqLZc/6kc06IpXn5vRxdLaED+jEuaSRv5BxtnsiY= github.com/aws/aws-sdk-go-v2/service/sts v1.16.3/go.mod h1:bfBj0iVmsUyUg4weDB4NxktD9rDGeKSVWnjTnwbx9b8= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.9 h1:yOfILxyjmtr2ubRkRJldlHDFBhf5vw4CzhbwWIBmimQ= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.9/go.mod h1:O1IvkYxr+39hRf960Us6j0x1P8pDqhTX+oXM5kQNl/Y= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 h1:dl8T0PJlN92rvEGOEUiD0+YPYdPEaCZK0TqHukvSfII= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.13/go.mod h1:Ru3QVMLygVs/07UQ3YDur1AQZZp2tUNje8wfloFttC0= github.com/aws/smithy-go v1.11.2/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= -github.com/aws/smithy-go v1.12.0 h1:gXpeZel/jPoWQ7OEmLIgCUnhkFftqNfwWUwAHSlp1v0= -github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/aws/smithy-go v1.12.1 h1:yQRC55aXN/y1W10HgwHle01DRuV9Dpf31iGkotjt3Ag= +github.com/aws/smithy-go v1.12.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -370,12 +368,11 @@ github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pf github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1 h1:kBRZU0PSuI7PspsSb/ChWoVResUcwNVIdpB049pKTiw= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok= @@ -386,8 +383,9 @@ github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -464,23 +462,19 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-ieproxy v0.0.3 h1:YkaHmK1CzE5C4O7A3hv3TCbfNDPSCf0RKZFX+VhBeYk= -github.com/mattn/go-ieproxy v0.0.3/go.mod h1:6ZpRmhBaYuBX1U2za+9rC9iCGLsSp2tftelZne7CPko= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.14 h1:qZgc/Rwetq+MtyE18WhzjokPD93dNqLGNT3QJuLvBGw= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/microcosm-cc/bluemonday v1.0.19 h1:OI7hoF5FY4pFz2VA//RN8TfM0YJ2dJcl4P4APrCWy6c= -github.com/microcosm-cc/bluemonday v1.0.19/go.mod h1:QNzV2UbLK2/53oIIwTOyLUSABMkjZ4tqiyC1g/DyqxE= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -565,8 +559,8 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -gocloud.dev v0.25.0 h1:Y7vDq8xj7SyM848KXf32Krda2e6jQ4CLh/mTeCSqXtk= -gocloud.dev v0.25.0/go.mod h1:7HegHVCYZrMiU3IE1qtnzf/vRrDwLYnRNR3EhWX8x9Y= +gocloud.dev v0.26.0 h1:4rM/SVL0lLs+rhC0Gmc+gt/82DBpb7nbpIZKXXnfMXg= +gocloud.dev v0.26.0/go.mod h1:mkUgejbnbLotorqDyvedJO20XcZNTynmSeVSQS9btVg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -582,8 +576,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -597,8 +591,8 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20220617043117-41969df76e82 h1:KpZB5pUSBvrHltNEdK/tw0xlPeD13M6M6aGP32gKqiw= -golang.org/x/image v0.0.0-20220617043117-41969df76e82/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY= +golang.org/x/image v0.0.0-20220722155232-062f8c9fd539 h1:/eM0PCrQI2xd471rI+snWuu251/+/jpBpZqir2mPdnU= +golang.org/x/image v0.0.0-20220722155232-062f8c9fd539/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -665,7 +659,6 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -674,8 +667,8 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 h1:8NSylCMxLW4JvserAndSgFL7aPli6A68yf0bYFTcWCM= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220812174116-3211cb980234 h1:RDqmgfe7SvlMWoqC3xwQ2blLO3fcWcxMa3eBLRdRW7E= +golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -699,8 +692,8 @@ golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 h1:VnGaRqoLmqZH/3TMLJwYCEWkR4j1nuIU1U9TvbqsDUw= -golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 h1:dtndE8FcEta75/4kHF3AbpuWzV6f1LjnLrM4pe2SZrw= +golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -776,7 +769,6 @@ golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220110181412-a018aaa089fe/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -791,14 +783,14 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= +golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -814,8 +806,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -874,8 +866,8 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -932,8 +924,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.86.0 h1:ZAnyOHQFIuWso1BodVfSaRyffD74T9ERGFa3k1fNk/U= -google.golang.org/api v0.86.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.92.0 h1:8JHk7q/+rJla+iRsWj9FQ9/wjv2M1SKtpKSdmLhxPT0= +google.golang.org/api v0.92.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1036,8 +1028,8 @@ google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220706132729-d86698d07c53 h1:liFd7OL799HvMNYG5xozhUoWDj944y+zXPDOhu4PyaM= -google.golang.org/genproto v0.0.0-20220706132729-d86698d07c53/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220812140447-cec7f5303424 h1:zZnTt15U44/Txe/9cN/tVbteBkPMiyXK48hPsKRmqj4= +google.golang.org/genproto v0.0.0-20220812140447-cec7f5303424/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1068,8 +1060,9 @@ google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1084,8 +1077,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -1109,13 +1103,14 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.36.0 h1:0kmRkTmqNidmu3c7BNDSdVHCxXCkWLmWmCIVX4LUboo= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.1 h1:CICrjwr/1M4+6OQ4HJZ/AHxjcwe67r5vPUF518MkO8A= +modernc.org/cc/v3 v3.36.1/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6 h1:3l18poV+iUemQ98O3X5OMr97LOqlzis+ytivU4NqGhA= modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8 h1:G0QNlTqI5uVgczBWfGKs7B++EPwCfXPWGD2MdeKloDs= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= @@ -1123,9 +1118,9 @@ modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.7/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= -modernc.org/libc v1.16.14 h1:MUIjk9Xwlkrp0BqGhMfRkiq0EkZsqfNiP4eixL3YiPk= -modernc.org/libc v1.16.14/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19 h1:S8flPn5ZeXx6iw/8yNa986hwTQDrY8RXU7tObZuAozo= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= @@ -1134,17 +1129,15 @@ modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.17.3 h1:iE+coC5g17LtByDYDWKpR6m2Z9022YrSh3bumwOnIrI= -modernc.org/sqlite v1.17.3/go.mod h1:10hPVYar9C0kfXuTWGz8s0XtB8uAGymUy51ZzStYe3k= +modernc.org/sqlite v1.18.1 h1:ko32eKt3jf7eqIkCgPAeHMBXw3riNSLhl2f3loEF7o8= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= modernc.org/strutil v1.1.2 h1:iFBDH6j1Z0bN/Q9udJnnFoFpENA4252qe/7/5woE5MI= modernc.org/strutil v1.1.2/go.mod h1:OYajnUAcI/MX+XD/Wx7v1bbdvcQSvxgtb0gC+u3d3eg= modernc.org/tcl v1.13.1 h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao= -modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.5.1 h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/mails/admin.go b/mails/admin.go index 2d7d1a386..a2b7fbb61 100644 --- a/mails/admin.go +++ b/mails/admin.go @@ -3,12 +3,12 @@ package mails import ( "fmt" "net/mail" - "strings" "github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/mails/templates" "github.com/pocketbase/pocketbase/models" "github.com/pocketbase/pocketbase/tokens" + "github.com/pocketbase/pocketbase/tools/rest" ) // SendAdminPasswordReset sends a password reset request email to the specified admin. @@ -18,9 +18,9 @@ func SendAdminPasswordReset(app core.App, admin *models.Admin) error { return tokenErr } - actionUrl, urlErr := normalizeUrl(fmt.Sprintf( + actionUrl, urlErr := rest.NormalizeUrl(fmt.Sprintf( "%s/_/#/confirm-password-reset/%s", - strings.TrimSuffix(app.Settings().Meta.AppUrl, "/"), + app.Settings().Meta.AppUrl, token, )) if urlErr != nil { diff --git a/mails/base.go b/mails/base.go index 156389b39..91a0ab7a3 100644 --- a/mails/base.go +++ b/mails/base.go @@ -4,34 +4,9 @@ package mails import ( "bytes" - "net/url" - "path" - "strings" "text/template" ) -// normalizeUrl removes duplicated slashes from a url path. -func normalizeUrl(originalUrl string) (string, error) { - u, err := url.Parse(originalUrl) - if err != nil { - return "", err - } - - hasSlash := strings.HasSuffix(u.Path, "/") - - // clean up path by removing duplicated / - u.Path = path.Clean(u.Path) - u.RawPath = path.Clean(u.RawPath) - - // restore original trailing slash - if hasSlash && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - u.RawPath += "/" - } - - return u.String(), nil -} - // resolveTemplateContent resolves inline html template strings. func resolveTemplateContent(data any, content ...string) (string, error) { if len(content) == 0 { diff --git a/mails/templates/admin_password_reset.go b/mails/templates/admin_password_reset.go index f950ec623..1a38d8d35 100644 --- a/mails/templates/admin_password_reset.go +++ b/mails/templates/admin_password_reset.go @@ -17,7 +17,6 @@ const AdminPasswordResetBody = `

Reset password - {{.ActionUrl}}

If you did not request to reset your password, please ignore this email and the link will expire on its own.

diff --git a/mails/templates/layout.go b/mails/templates/layout.go index cbc657273..7e3375831 100644 --- a/mails/templates/layout.go +++ b/mails/templates/layout.go @@ -50,12 +50,6 @@ const Layout = ` .hidden { display: none !important; } - .fallback-link { - display: none !important; - word-break: break-all; - font-size: 11px; - color: #666f75; - } .btn { display: inline-block; vertical-align: top; diff --git a/mails/templates/user_confirm_email_change.go b/mails/templates/user_confirm_email_change.go deleted file mode 100644 index 66a7c3aaa..000000000 --- a/mails/templates/user_confirm_email_change.go +++ /dev/null @@ -1,26 +0,0 @@ -package templates - -// Available variables: -// -// ``` -// User *models.User -// AppName string -// AppUrl string -// Token string -// ActionUrl string -// ``` -const UserConfirmEmailChangeBody = ` -{{define "content"}} -

Hello,

-

Click on the button below to confirm your new email address.

-

- Confirm new email - {{.ActionUrl}} -

-

If you didn’t ask to change your email address, you can ignore this email.

-

- Thanks,
- {{.AppName}} team -

-{{end}} -` diff --git a/mails/templates/user_password_reset.go b/mails/templates/user_password_reset.go deleted file mode 100644 index cbeb67de9..000000000 --- a/mails/templates/user_password_reset.go +++ /dev/null @@ -1,26 +0,0 @@ -package templates - -// Available variables: -// -// ``` -// User *models.User -// AppName string -// AppUrl string -// Token string -// ActionUrl string -// ``` -const UserPasswordResetBody = ` -{{define "content"}} -

Hello,

-

Click on the button below to reset your password.

-

- Reset password - {{.ActionUrl}} -

-

If you didn’t ask to reset your password, you can ignore this email.

-

- Thanks,
- {{.AppName}} team -

-{{end}} -` diff --git a/mails/templates/user_verification.go b/mails/templates/user_verification.go deleted file mode 100644 index 6423ed44f..000000000 --- a/mails/templates/user_verification.go +++ /dev/null @@ -1,26 +0,0 @@ -package templates - -// Available variables: -// -// ``` -// User *models.User -// AppName string -// AppUrl string -// Token string -// ActionUrl string -// ``` -const UserVerificationBody = ` -{{define "content"}} -

Hello,

-

Thank you for joining us at {{.AppName}}.

-

Click on the button below to verify your email address.

-

- Verify - {{.ActionUrl}} -

-

- Thanks,
- {{.AppName}} team -

-{{end}} -` diff --git a/mails/user.go b/mails/user.go index e9f61828f..d21909a85 100644 --- a/mails/user.go +++ b/mails/user.go @@ -1,8 +1,8 @@ package mails import ( + "html/template" "net/mail" - "strings" "github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/mails/templates" @@ -10,46 +10,6 @@ import ( "github.com/pocketbase/pocketbase/tokens" ) -func prepareUserEmailBody( - app core.App, - user *models.User, - token string, - actionUrl string, - bodyTemplate string, -) (string, error) { - settings := app.Settings() - - // replace action url placeholder params (if any) - actionUrlParams := map[string]string{ - core.EmailPlaceholderAppUrl: settings.Meta.AppUrl, - core.EmailPlaceholderToken: token, - } - for k, v := range actionUrlParams { - actionUrl = strings.ReplaceAll(actionUrl, k, v) - } - var urlErr error - actionUrl, urlErr = normalizeUrl(actionUrl) - if urlErr != nil { - return "", urlErr - } - - params := struct { - AppName string - AppUrl string - User *models.User - Token string - ActionUrl string - }{ - AppName: settings.Meta.AppName, - AppUrl: settings.Meta.AppUrl, - User: user, - Token: token, - ActionUrl: actionUrl, - } - - return resolveTemplateContent(params, templates.Layout, bodyTemplate) -} - // SendUserPasswordReset sends a password reset request email to the specified user. func SendUserPasswordReset(app core.App, user *models.User) error { token, tokenErr := tokens.NewUserResetPasswordToken(app, user) @@ -66,24 +26,20 @@ func SendUserPasswordReset(app core.App, user *models.User) error { } sendErr := app.OnMailerBeforeUserResetPasswordSend().Trigger(event, func(e *core.MailerUserEvent) error { - body, err := prepareUserEmailBody( - app, - user, - token, - app.Settings().Meta.UserResetPasswordUrl, - templates.UserPasswordResetBody, - ) + settings := app.Settings() + + subject, body, err := resolveEmailTemplate(app, token, settings.Meta.ResetPasswordTemplate) if err != nil { return err } return e.MailClient.Send( mail.Address{ - Name: app.Settings().Meta.SenderName, - Address: app.Settings().Meta.SenderAddress, + Name: settings.Meta.SenderName, + Address: settings.Meta.SenderAddress, }, mail.Address{Address: e.User.Email}, - ("Reset your " + app.Settings().Meta.AppName + " password"), + subject, body, nil, ) @@ -112,24 +68,20 @@ func SendUserVerification(app core.App, user *models.User) error { } sendErr := app.OnMailerBeforeUserVerificationSend().Trigger(event, func(e *core.MailerUserEvent) error { - body, err := prepareUserEmailBody( - app, - user, - token, - app.Settings().Meta.UserVerificationUrl, - templates.UserVerificationBody, - ) + settings := app.Settings() + + subject, body, err := resolveEmailTemplate(app, token, settings.Meta.VerificationTemplate) if err != nil { return err } return e.MailClient.Send( mail.Address{ - Name: app.Settings().Meta.SenderName, - Address: app.Settings().Meta.SenderAddress, + Name: settings.Meta.SenderName, + Address: settings.Meta.SenderAddress, }, mail.Address{Address: e.User.Email}, - ("Verify your " + app.Settings().Meta.AppName + " email"), + subject, body, nil, ) @@ -161,24 +113,20 @@ func SendUserChangeEmail(app core.App, user *models.User, newEmail string) error } sendErr := app.OnMailerBeforeUserChangeEmailSend().Trigger(event, func(e *core.MailerUserEvent) error { - body, err := prepareUserEmailBody( - app, - user, - token, - app.Settings().Meta.UserConfirmEmailChangeUrl, - templates.UserConfirmEmailChangeBody, - ) + settings := app.Settings() + + subject, body, err := resolveEmailTemplate(app, token, settings.Meta.ConfirmEmailChangeTemplate) if err != nil { return err } return e.MailClient.Send( mail.Address{ - Name: app.Settings().Meta.SenderName, - Address: app.Settings().Meta.SenderAddress, + Name: settings.Meta.SenderName, + Address: settings.Meta.SenderAddress, }, mail.Address{Address: newEmail}, - ("Confirm your " + app.Settings().Meta.AppName + " new email address"), + subject, body, nil, ) @@ -190,3 +138,30 @@ func SendUserChangeEmail(app core.App, user *models.User, newEmail string) error return sendErr } + +func resolveEmailTemplate( + app core.App, + token string, + emailTemplate core.EmailTemplate, +) (subject string, body string, err error) { + settings := app.Settings() + + subject, rawBody, _ := emailTemplate.Resolve( + settings.Meta.AppName, + settings.Meta.AppUrl, + token, + ) + + params := struct { + HtmlContent template.HTML + }{ + HtmlContent: template.HTML(rawBody), + } + + body, err = resolveTemplateContent(params, templates.Layout, templates.HtmlBody) + if err != nil { + return "", "", err + } + + return subject, body, nil +} diff --git a/mails/user_test.go b/mails/user_test.go index 4f3aa3690..ddaf64637 100644 --- a/mails/user_test.go +++ b/mails/user_test.go @@ -27,7 +27,7 @@ func TestSendUserPasswordReset(t *testing.T) { } expectedParts := []string{ - "http://localhost:8090/#/users/confirm-password-reset/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.", + "http://localhost:8090/_/#/users/confirm-password-reset/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.", } for _, part := range expectedParts { if !strings.Contains(testApp.TestMailer.LastHtmlBody, part) { @@ -52,7 +52,7 @@ func TestSendUserVerification(t *testing.T) { } expectedParts := []string{ - "http://localhost:8090/#/users/confirm-verification/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.", + "http://localhost:8090/_/#/users/confirm-verification/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.", } for _, part := range expectedParts { if !strings.Contains(testApp.TestMailer.LastHtmlBody, part) { @@ -77,7 +77,7 @@ func TestSendUserChangeEmail(t *testing.T) { } expectedParts := []string{ - "http://localhost:8090/#/users/confirm-email-change/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.", + "http://localhost:8090/_/#/users/confirm-email-change/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.", } for _, part := range expectedParts { if !strings.Contains(testApp.TestMailer.LastHtmlBody, part) { diff --git a/models/base.go b/models/base.go index b965416f7..034e81e4f 100644 --- a/models/base.go +++ b/models/base.go @@ -9,8 +9,13 @@ import ( "golang.org/x/crypto/bcrypt" ) -// DefaultIdLength is the default length of the generated model id. -const DefaultIdLength = 15 +const ( + // DefaultIdLength is the default length of the generated model id. + DefaultIdLength = 15 + + // DefaultIdAlphabet is the default characters set used for generating the model id. + DefaultIdAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789" +) // ColumnValueMapper defines an interface for custom db model data serialization. type ColumnValueMapper interface { @@ -98,7 +103,7 @@ func (m *BaseModel) GetUpdated() types.DateTime { // // The generated id is a cryptographically random 15 characters length string. func (m *BaseModel) RefreshId() { - m.Id = security.RandomString(DefaultIdLength) + m.Id = security.RandomStringWithAlphabet(DefaultIdLength, DefaultIdAlphabet) } // RefreshCreated updates the model Created field with the current datetime. diff --git a/tests/data/data.db b/tests/data/data.db index 4cc026479..f91720355 100644 Binary files a/tests/data/data.db and b/tests/data/data.db differ diff --git a/tools/mailer/smtp.go b/tools/mailer/smtp.go index a69a55095..3915e5d8d 100644 --- a/tools/mailer/smtp.go +++ b/tools/mailer/smtp.go @@ -5,18 +5,12 @@ import ( "io" "net/mail" "net/smtp" - "regexp" - "strings" "github.com/domodwyer/mailyak/v3" - "github.com/microcosm-cc/bluemonday" ) var _ Mailer = (*SmtpClient)(nil) -// regex to select all tabs -var tabsRegex = regexp.MustCompile(`\t+`) - // NewSmtpClient creates new `SmtpClient` with the provided configuration. func NewSmtpClient( host string, @@ -74,10 +68,6 @@ func (m *SmtpClient) Send( yak.Subject(subject) yak.HTML().Set(htmlBody) - // set also plain text content - policy := bluemonday.StrictPolicy() // strips all tags - yak.Plain().Set(strings.TrimSpace(tabsRegex.ReplaceAllString(policy.Sanitize(htmlBody), ""))) - for name, data := range attachments { yak.Attach(name, data) } diff --git a/tools/rest/url.go b/tools/rest/url.go new file mode 100644 index 000000000..87dd6b21c --- /dev/null +++ b/tools/rest/url.go @@ -0,0 +1,29 @@ +package rest + +import ( + "net/url" + "path" + "strings" +) + +// NormalizeUrl removes duplicated slashes from a url path. +func NormalizeUrl(originalUrl string) (string, error) { + u, err := url.Parse(originalUrl) + if err != nil { + return "", err + } + + hasSlash := strings.HasSuffix(u.Path, "/") + + // clean up path by removing duplicated / + u.Path = path.Clean(u.Path) + u.RawPath = path.Clean(u.RawPath) + + // restore original trailing slash + if hasSlash && !strings.HasSuffix(u.Path, "/") { + u.Path += "/" + u.RawPath += "/" + } + + return u.String(), nil +} diff --git a/tools/rest/url_test.go b/tools/rest/url_test.go new file mode 100644 index 000000000..091d5bc4e --- /dev/null +++ b/tools/rest/url_test.go @@ -0,0 +1,40 @@ +package rest_test + +import ( + "testing" + + "github.com/pocketbase/pocketbase/tools/rest" +) + +func TestNormalizeUrl(t *testing.T) { + scenarios := []struct { + url string + expectError bool + expectUrl string + }{ + {":/", true, ""}, + {"./", false, "./"}, + {"../../test////", false, "../../test/"}, + {"/a/b/c", false, "/a/b/c"}, + {"a/////b//c/", false, "a/b/c/"}, + {"/a/////b//c", false, "/a/b/c"}, + {"///a/b/c", false, "/a/b/c"}, + {"//a/b/c", false, "//a/b/c"}, // preserve "auto-schema" + {"http://a/b/c", false, "http://a/b/c"}, + {"a//bc?test=1//dd", false, "a/bc?test=1//dd"}, // only the path is normalized + {"a//bc?test=1#12///3", false, "a/bc?test=1#12///3"}, // only the path is normalized + } + + for i, s := range scenarios { + result, err := rest.NormalizeUrl(s.url) + + hasErr := err != nil + if hasErr != s.expectError { + t.Errorf("(%d) Expected hasErr %v, got %v", i, s.expectError, hasErr) + } + + if result != s.expectUrl { + t.Errorf("(%d) Expected url %q, got %q", i, s.expectUrl, result) + } + } +} diff --git a/tools/security/random.go b/tools/security/random.go index 4a6ed33c2..d9ae48a18 100644 --- a/tools/security/random.go +++ b/tools/security/random.go @@ -4,15 +4,23 @@ import ( "crypto/rand" ) -// RandomString generates a random string of specified length. +// RandomString generates a random string with the specified length. // // The generated string is cryptographically random and matches // [A-Za-z0-9]+ (aka. it's transparent to URL-encoding). func RandomString(length int) string { const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + return RandomStringWithAlphabet(length, alphabet) +} + +// RandomStringWithAlphabet generates a cryptographically random string +// with the specified length and characters set. +func RandomStringWithAlphabet(length int, alphabet string) string { bytes := make([]byte, length) + rand.Read(bytes) + for i, b := range bytes { bytes[i] = alphabet[b%byte(len(alphabet))] } diff --git a/tools/security/random_test.go b/tools/security/random_test.go index 034b3d4dc..5f6fd1439 100644 --- a/tools/security/random_test.go +++ b/tools/security/random_test.go @@ -10,25 +10,62 @@ import ( func TestRandomString(t *testing.T) { generated := []string{} reg := regexp.MustCompile(`[a-zA-Z0-9]+`) + length := 10 - for i := 0; i < 30; i++ { - length := 5 + i + for i := 0; i < 100; i++ { result := security.RandomString(length) if len(result) != length { - t.Errorf("(%d) Expected the length of the string to be %d, got %d", i, length, len(result)) + t.Fatalf("(%d) Expected the length of the string to be %d, got %d", i, length, len(result)) } if match := reg.MatchString(result); !match { - t.Errorf("(%d) The generated strings should have only [a-zA-Z0-9]+ characters, got %q", i, result) + t.Fatalf("(%d) The generated string should have only [a-zA-Z0-9]+ characters, got %q", i, result) } for _, str := range generated { if str == result { - t.Errorf("(%d) Repeating random string - found %q in \n%v", i, result, generated) + t.Fatalf("(%d) Repeating random string - found %q in \n%v", i, result, generated) } } generated = append(generated, result) } } + +func TestRandomStringWithAlphabet(t *testing.T) { + scenarios := []struct { + alphabet string + expectPattern string + }{ + {"0123456789_", `[0-9_]+`}, + {"abcd", `[abcd]+`}, + {"!@#$%^&*()", `[\!\@\#\$\%\^\&\*\(\)]+`}, + } + + for i, s := range scenarios { + generated := make([]string, 100) + length := 10 + + for j := 0; j < 100; j++ { + result := security.RandomStringWithAlphabet(length, s.alphabet) + + if len(result) != length { + t.Fatalf("(%d:%d) Expected the length of the string to be %d, got %d", i, j, length, len(result)) + } + + reg := regexp.MustCompile(s.expectPattern) + if match := reg.MatchString(result); !match { + t.Fatalf("(%d:%d) The generated string should have only %s characters, got %q", i, j, s.expectPattern, result) + } + + for _, str := range generated { + if str == result { + t.Fatalf("(%d:%d) Repeating random string - found %q in %q", i, j, result, generated) + } + } + + generated = append(generated, result) + } + } +} diff --git a/tools/subscriptions/broker.go b/tools/subscriptions/broker.go index 0ca648717..b90161ed3 100644 --- a/tools/subscriptions/broker.go +++ b/tools/subscriptions/broker.go @@ -27,6 +27,9 @@ func (b *Broker) Clients() map[string]Client { // // Returns non-nil error when client with clientId is not registered. func (b *Broker) ClientById(clientId string) (Client, error) { + b.mux.RLock() + defer b.mux.RUnlock() + client, ok := b.clients[clientId] if !ok { return nil, fmt.Errorf("No client associated with connection ID %q", clientId) diff --git a/ui/dist/assets/FilterAutocompleteInput.8c09e039.js b/ui/dist/assets/FilterAutocompleteInput.7c46ad8a.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput.8c09e039.js rename to ui/dist/assets/FilterAutocompleteInput.7c46ad8a.js index b20483e8c..c8b9f868e 100644 --- a/ui/dist/assets/FilterAutocompleteInput.8c09e039.js +++ b/ui/dist/assets/FilterAutocompleteInput.7c46ad8a.js @@ -1,4 +1,4 @@ -import{S as ka,i as Sa,s as va,e as Ca,f as Aa,g as Ma,y as Sn,o as Da,G as Oa,H as Ta,I as Ba,J as La,K as Ra,C as vn,L as Pa}from"./index.02c04c04.js";class z{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ve.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),Ve.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Zt(this),r=new Zt(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Zt(this,e)}iterRange(e,t=this.length){return new zo(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new qo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new Q(e):Ve.from(Q.split(e,[]))}}class Q extends z{constructor(e,t=Ea(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Ia(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(ar(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Pi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new Q(l,o.length+r.length));else{let h=l.length>>1;i.push(new Q(l.slice(0,h)),new Q(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Q))return super.replace(e,t,i);let s=Pi(this.text,Pi(i.text,ar(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Q(s,r):Ve.from(Q.split(s,[]),r)}sliceString(e,t=this.length,i=` +import{S as ka,i as Sa,s as va,e as Ca,f as Aa,g as Ma,y as Sn,o as Da,G as Oa,H as Ta,I as Ba,J as La,K as Ra,C as vn,L as Pa}from"./index.46d73605.js";class z{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ve.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),Ve.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Zt(this),r=new Zt(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Zt(this,e)}iterRange(e,t=this.length){return new zo(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new qo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new Q(e):Ve.from(Q.split(e,[]))}}class Q extends z{constructor(e,t=Ea(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Ia(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(ar(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Pi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new Q(l,o.length+r.length));else{let h=l.length>>1;i.push(new Q(l.slice(0,h)),new Q(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Q))return super.replace(e,t,i);let s=Pi(this.text,Pi(i.text,ar(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Q(s,r):Ve.from(Q.split(s,[]),r)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=h+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new Q(i,s)),i=[],s=-1);return s>-1&&t.push(new Q(i,s)),t}}class Ve extends z{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,h=i+o.lines-1;if((t?h:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=h+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let a=s&((o<=e?1:0)|(h>=t?2:0));o>=e&&h<=t&&!a?i.push(l):l.decompose(e-o,t-o,i,a)}o=h+1}}replace(e,t,i){if(i.lines=r&&t<=l){let h=o.replace(e-r,t-r,i),a=this.lines-o.lines+h.lines;if(h.lines>5-1&&h.lines>a>>5+1){let c=this.children.slice();return c[s]=h,new Ve(c,this.length-(t-e)+i.length)}return super.replace(r,l,h)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=h+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ve))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let h=this.children[s],a=e.children[r];if(h!=a)return i+h.scanIdentical(a,t);i+=h.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new Q(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],h=0,a=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Ve)for(let g of d.children)f(g);else d.lines>o&&(h>o||!h)?(u(),l.push(d)):d instanceof Q&&h&&(p=c[c.length-1])instanceof Q&&d.lines+p.lines<=32?(h+=d.lines,a+=d.length+1,c[c.length-1]=new Q(p.text.concat(d.text),p.length+1+d.length)):(h+d.lines>s&&u(),h+=d.lines,a+=d.length+1,c.push(d))}function u(){h!=0&&(l.push(c.length==1?c[0]:Ve.from(c,a)),a=-1,h=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Ve(l,t)}}z.empty=new Q([""],0);function Ea(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Pi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(h>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof Q?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof Q?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(s instanceof Q){let h=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=s.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof Q?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class zo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Zt(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class qo{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},Zt.prototype[Symbol.iterator]=zo.prototype[Symbol.iterator]=qo.prototype[Symbol.iterator]=function(){return this});class Ia{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Dt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Dt[e-1]<=n;return!1}function cr(n){return n>=127462&&n<=127487}const fr=8205;function Ae(n,e,t=!0,i=!0){return(t?Ko:Va)(n,e,i)}function Ko(n,e,t){if(e==n.length)return e;e&&Uo(n.charCodeAt(e))&&jo(n.charCodeAt(e-1))&&e--;let i=re(n,e);for(e+=ve(i);e=0&&cr(re(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Va(n,e,t){for(;e>0;){let i=Ko(n,e-2,t);if(i=56320&&n<57344}function jo(n){return n>=55296&&n<56320}function re(n,e){let t=n.charCodeAt(e);if(!jo(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Uo(i)?(t-55296<<10)+(i-56320)+65536:t}function Rs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ve(n){return n<65536?1:2}const jn=/\r\n?|\n/;var me=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(me||(me={}));class He{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=me.Simple&&a>=e&&(i==me.TrackDel&&se||i==me.TrackBefore&&se))return null;if(a>e||a==e&&t<0&&!l)return e==s||t<0?r:r+h;r+=h}s=a}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new He(e)}static create(e){return new He(e)}}class ee extends He{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Gn(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Jn(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let h=s>>1;for(;i.length0&&Ye(i,t,r.text),r.forward(c),l+=c}let a=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function h(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?z.of(d.split(i||jn)):d:z.empty,g=p.length;if(f==u&&g==0)return;fo&&he(s,f-o,-1),he(s,u-f,g),Ye(r,s,p),o=u}}return a(e),h(!l),l}static empty(e){return new ee(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Ye(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],h=n.sections[o++];e(s,a,r,c,f),s=a,r=c}}}function Jn(n,e,t,i=!1){let s=[],r=i?[]:null,o=new si(n),l=new si(e);for(let h=-1;;)if(o.ins==-1&&l.ins==-1){let a=Math.min(o.len,l.len);he(s,a,-1),o.forward(a),l.forward(a)}else if(l.ins>=0&&(o.ins<0||h==o.i||o.off==0&&(l.len=0&&h=0){let a=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);a+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lenh||o.ins>=0&&o.len>h)&&(l||i.length>a),r.forward2(h),o.forward(h)}}}}class si{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?z.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?z.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ft{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new ft(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return m.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return m.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return m.range(e.anchor,e.head)}static create(e,t,i){return new ft(e,t,i)}}class m{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:m.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new m(e.ranges.map(t=>ft.fromJSON(t)),e.main)}static single(e,t=e){return new m([m.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0))}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?m.range(h,l):m.range(l,h))}}return new m(e,t)}}function Jo(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Ps=0;class T{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Ps++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new T(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Es),!!e.static,e.enables)}of(e){return new Ei([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ei(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ei(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Es(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Ei{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Ps++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,h=!1,a=!1,c=[];for(let f of this.dependencies)f=="doc"?h=!0:f=="selection"?a=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(h&&u.docChanged||a&&(u.docChanged||u.selection)||$n(f,c)){let d=i(f);if(l?!ur(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d=i(f),p=u.config.address[r];if(p!=null){let g=Hi(u,p);if(this.dependencies.every(y=>y instanceof T?u.facet(y)===f.facet(y):y instanceof ke?u.field(y,!1)==f.field(y,!1):!0)||(l?ur(d,g,s):s(d,g)))return f.values[o]=g,0}return f.values[o]=d,1}}}}function ur(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[h.id]),s=t.map(h=>h.type),r=i.filter(h=>!(h&1)),o=n[e.id]>>1;function l(h){let a=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(dr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,dr.of({field:this,create:e})]}get extension(){return this}}const ct={lowest:4,low:3,default:2,high:1,highest:0};function Kt(n){return e=>new $o(e,n)}const Ht={highest:Kt(ct.highest),high:Kt(ct.high),default:Kt(ct.default),low:Kt(ct.low),lowest:Kt(ct.lowest)};class $o{constructor(e,t){this.inner=e,this.prec=t}}class Qe{of(e){return new _n(this,e)}reconfigure(e){return Qe.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class _n{constructor(e,t){this.compartment=e,this.inner=t}}class Wi{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Wa(e,t,o))u instanceof ke?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),h=[],a=[];for(let u of s)l[u.id]=a.length<<1,a.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(y=>y.type==0))if(l[p.id]=h.length<<1|1,Es(g,d))h.push(i.facet(p));else{let y=p.combine(d.map(b=>b.value));h.push(i&&p.compare(y,i.facet(p))?i.facet(p):y)}else{for(let y of d)y.type==0?(l[y.id]=h.length<<1|1,h.push(y.value)):(l[y.id]=a.length<<1,a.push(b=>y.dynamicSlot(b)));l[p.id]=a.length<<1,a.push(y=>Fa(y,p,d))}}let f=a.map(u=>u(l));return new Wi(e,o,f,l,h,r)}}function Wa(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let h=s.get(o);if(h!=null){if(h<=l)return;let a=i[h].indexOf(o);a>-1&&i[h].splice(a,1),o instanceof _n&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let a of o)r(a,l);else if(o instanceof _n){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let a=e.get(o.compartment)||o.inner;t.set(o.compartment,a),r(a,l)}else if(o instanceof $o)r(o.inner,o.prec);else if(o instanceof ke)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Ei)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,ct.default);else{let a=o.extension;if(!a)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(a,l)}}return r(n,ct.default),i.reduce((o,l)=>o.concat(l))}function ei(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Hi(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const _o=T.define(),Xo=T.define({combine:n=>n.some(e=>e),static:!0}),Yo=T.define({combine:n=>n.length?n[0]:void 0,static:!0}),Qo=T.define(),Zo=T.define(),el=T.define(),tl=T.define({combine:n=>n.length?n[0]:!1});class xt{constructor(e,t){this.type=e,this.value=t}static define(){return new Ha}}class Ha{of(e){return new xt(this,e)}}class za{constructor(e){this.map=e}of(e){return new W(this,e)}}class W{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new W(this.type,t)}is(e){return this.type==e}static define(e={}){return new za(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}W.reconfigure=W.define();W.appendConfig=W.define();class te{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Jo(i,t.newLength),r.some(l=>l.type==te.time)||(this.annotations=r.concat(te.time.of(Date.now())))}static create(e,t,i,s,r,o){return new te(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(te.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}te.time=xt.define();te.userEvent=xt.define();te.addToHistory=xt.define();te.remote=xt.define();function qa(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof te?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof te?n=r[0]:n=nl(e,Ot(r),!1)}return n}function Ua(n){let e=n.startState,t=e.facet(el),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=il(n,Xn(e,r,n.changes.newLength),!0))}return i==n?n:te.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const ja=[];function Ot(n){return n==null?ja:Array.isArray(n)?n:[n]}var ce=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(ce||(ce={}));const Ga=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Yn;try{Yn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Ja(n){if(Yn)return Yn.test(n);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||Ga.test(t)))return!0}return!1}function $a(n){return e=>{if(!/\S/.test(e))return ce.Space;if(Ja(e))return ce.Word;for(let t=0;t-1)return ce.Word;return ce.Other}}class V{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(h,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(W.reconfigure)?(t=null,i=o.value):o.is(W.appendConfig)&&(t=null,i=Ot(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Wi.resolve(i,s,this),r=new V(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,h)=>h.reconfigure(l,this),null).values),new V(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:m.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Ot(i.effects);for(let l=1;lo.spec.fromJSON(l,h)))}}return V.create({doc:e.doc,selection:m.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Wi.resolve(e.extensions||[],new Map),i=e.doc instanceof z?e.doc:z.of((e.doc||"").split(t.staticFacet(V.lineSeparator)||jn)),s=e.selection?e.selection instanceof m?e.selection:m.single(e.selection.anchor,e.selection.head):m.single(0);return Jo(s,i.length),t.staticFacet(Xo)||(s=s.asSingle()),new V(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(V.tabSize)}get lineBreak(){return this.facet(V.lineSeparator)||` diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset.f56cbabc.js b/ui/dist/assets/PageAdminConfirmPasswordReset.4d20a793.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset.f56cbabc.js rename to ui/dist/assets/PageAdminConfirmPasswordReset.4d20a793.js index 8b8665dc1..20c5c13b6 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset.f56cbabc.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset.4d20a793.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as k,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index.02c04c04.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as k,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index.46d73605.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password `),m&&m.c(),t=k(),A(r.$$.fragment),p=k(),A(d.$$.fragment),n=k(),i=c("button"),g=c("span"),g.textContent="Set new password",R=k(),C=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(C,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,C,$),_(C,v),P=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!P||$&4)&&(i.disabled=a[2]),$&4&&L(i,"btn-loading",a[2])},i(a){P||(H(r.$$.fragment,a),H(d.$$.fragment,a),P=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),P=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(C),F=!1,V(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset.eb56e2a2.js b/ui/dist/assets/PageAdminRequestPasswordReset.f94ba44f.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset.eb56e2a2.js rename to ui/dist/assets/PageAdminRequestPasswordReset.f94ba44f.js index 35c010faf..5ae45288b 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset.eb56e2a2.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset.f94ba44f.js @@ -1,2 +1,2 @@ -import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index.02c04c04.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`

Forgotten admin password

+import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index.46d73605.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`

Forgotten admin password

Enter the email associated with your account and we\u2019ll send you a recovery link:

`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),$&2&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){S(e,n)}}}function W(c,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageUserConfirmEmailChange.0781911d.js b/ui/dist/assets/PageUserConfirmEmailChange.1fe681aa.js similarity index 81% rename from ui/dist/assets/PageUserConfirmEmailChange.0781911d.js rename to ui/dist/assets/PageUserConfirmEmailChange.1fe681aa.js index 68a4599db..b0979f0d7 100644 --- a/ui/dist/assets/PageUserConfirmEmailChange.0781911d.js +++ b/ui/dist/assets/PageUserConfirmEmailChange.1fe681aa.js @@ -1,4 +1,4 @@ -import{S as M,i as N,s as R,F as U,c as S,m as z,t as $,a as v,d as J,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,q as B,e as m,w as y,b as C,f as d,r as H,h as k,u as E,v as D,y as h,x as G,z as T}from"./index.02c04c04.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&L(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address - `),p&&p.c(),n=C(),S(o.$$.fragment),c=C(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","m-b-xs"),d(s,"class","content txt-center m-b-sm"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,s),k(s,t),k(t,l),p&&p.m(t,null),k(e,n),z(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||(q=E(e,"submit",D(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=L(f),p.c(),p.m(t,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(a.disabled=f[1]),w&2&&H(a,"btn-loading",f[1])},i(f){u||($(o.$$.fragment,f),u=!0)},o(f){v(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),J(o),g=!1,q()}}}function K(r){let e,s,t,l,n;return{c(){e=m("div"),e.innerHTML=`
-

Email address changed

-

You can now sign in with your new email address.

`,s=C(),t=m("button"),t.textContent="Close",d(e,"class","alert alert-success"),d(t,"type","button"),d(t,"class","btn btn-secondary btn-block")},m(o,c){_(o,e,c),_(o,s,c),_(o,t,c),l||(n=E(t,"click",r[6]),l=!0)},p:h,i:h,o:h,d(o){o&&b(e),o&&b(s),o&&b(t),l=!1,n()}}}function L(r){let e,s,t;return{c(){e=y("to "),s=m("strong"),t=y(r[3]),d(s,"class","txt-nowrap")},m(l,n){_(l,e,n),_(l,s,n),k(s,t)},p(l,n){n&8&&G(t,l[3])},d(l){l&&b(e),l&&b(s)}}}function O(r){let e,s,t,l,n,o,c,a;return{c(){e=m("label"),s=y("Password"),l=C(),n=m("input"),d(e,"for",t=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,s),_(i,l,u),_(i,n,u),T(n,r[0]),n.focus(),c||(a=E(n,"input",r[7]),c=!0)},p(i,u){u&256&&t!==(t=i[8])&&d(e,"for",t),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&T(n,i[0])},d(i){i&&b(e),i&&b(l),i&&b(n),c=!1,a()}}}function Q(r){let e,s,t,l;const n=[K,I],o=[];function c(a,i){return a[2]?0:1}return e=c(r),s=o[e]=n[e](r),{c(){s.c(),t=Y()},m(a,i){o[e].m(a,i),_(a,t,i),l=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(j(),v(o[u],1,1,()=>{o[u]=null}),A(),s=o[e],s?s.p(a,i):(s=o[e]=n[e](a),s.c()),$(s,1),s.m(t.parentNode,t))},i(a){l||($(s),l=!0)},o(a){v(s),l=!1},d(a){o[e].d(a),a&&b(t)}}}function V(r){let e,s;return e=new U({props:{nobranding:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(t,l){z(e,t,l),s=!0},p(t,[l]){const n={};l&527&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||($(e.$$.fragment,t),s=!0)},o(t){v(e.$$.fragment,t),s=!1},d(t){J(e,t)}}}function X(r,e,s){let t,{params:l}=e,n="",o=!1,c=!1;async function a(){if(!o){s(1,o=!0);try{await F.users.confirmEmailChange(l==null?void 0:l.token,n),s(2,c=!0)}catch(g){F.errorResponseHandler(g)}s(1,o=!1)}}const i=()=>window.close();function u(){n=this.value,s(0,n)}return r.$$set=g=>{"params"in g&&s(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&s(3,t=W.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[n,o,c,t,a,l,i,u]}class x extends M{constructor(e){super(),N(this,e,X,V,R,{params:5})}}export{x as default}; +import{S as M,i as N,s as R,F as U,c as L,m as z,t as $,a as v,d as J,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,q as B,e as m,w as y,b as C,f as d,r as H,h as k,u as E,v as D,y as h,x as G,z as S}from"./index.46d73605.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&T(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address + `),p&&p.c(),n=C(),L(o.$$.fragment),c=C(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","m-b-xs"),d(s,"class","content txt-center m-b-sm"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,s),k(s,t),k(t,l),p&&p.m(t,null),k(e,n),z(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||(q=E(e,"submit",D(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=T(f),p.c(),p.m(t,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(a.disabled=f[1]),w&2&&H(a,"btn-loading",f[1])},i(f){u||($(o.$$.fragment,f),u=!0)},o(f){v(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),J(o),g=!1,q()}}}function K(r){let e,s,t,l,n;return{c(){e=m("div"),e.innerHTML=`
+

Successfully changed the user email address.

+

You can now sign in with your new email address.

`,s=C(),t=m("button"),t.textContent="Close",d(e,"class","alert alert-success"),d(t,"type","button"),d(t,"class","btn btn-secondary btn-block")},m(o,c){_(o,e,c),_(o,s,c),_(o,t,c),l||(n=E(t,"click",r[6]),l=!0)},p:h,i:h,o:h,d(o){o&&b(e),o&&b(s),o&&b(t),l=!1,n()}}}function T(r){let e,s,t;return{c(){e=y("to "),s=m("strong"),t=y(r[3]),d(s,"class","txt-nowrap")},m(l,n){_(l,e,n),_(l,s,n),k(s,t)},p(l,n){n&8&&G(t,l[3])},d(l){l&&b(e),l&&b(s)}}}function O(r){let e,s,t,l,n,o,c,a;return{c(){e=m("label"),s=y("Password"),l=C(),n=m("input"),d(e,"for",t=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,s),_(i,l,u),_(i,n,u),S(n,r[0]),n.focus(),c||(a=E(n,"input",r[7]),c=!0)},p(i,u){u&256&&t!==(t=i[8])&&d(e,"for",t),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&S(n,i[0])},d(i){i&&b(e),i&&b(l),i&&b(n),c=!1,a()}}}function Q(r){let e,s,t,l;const n=[K,I],o=[];function c(a,i){return a[2]?0:1}return e=c(r),s=o[e]=n[e](r),{c(){s.c(),t=Y()},m(a,i){o[e].m(a,i),_(a,t,i),l=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(j(),v(o[u],1,1,()=>{o[u]=null}),A(),s=o[e],s?s.p(a,i):(s=o[e]=n[e](a),s.c()),$(s,1),s.m(t.parentNode,t))},i(a){l||($(s),l=!0)},o(a){v(s),l=!1},d(a){o[e].d(a),a&&b(t)}}}function V(r){let e,s;return e=new U({props:{nobranding:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),{c(){L(e.$$.fragment)},m(t,l){z(e,t,l),s=!0},p(t,[l]){const n={};l&527&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||($(e.$$.fragment,t),s=!0)},o(t){v(e.$$.fragment,t),s=!1},d(t){J(e,t)}}}function X(r,e,s){let t,{params:l}=e,n="",o=!1,c=!1;async function a(){if(!o){s(1,o=!0);try{await F.users.confirmEmailChange(l==null?void 0:l.token,n),s(2,c=!0)}catch(g){F.errorResponseHandler(g)}s(1,o=!1)}}const i=()=>window.close();function u(){n=this.value,s(0,n)}return r.$$set=g=>{"params"in g&&s(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&s(3,t=W.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[n,o,c,t,a,l,i,u]}class x extends M{constructor(e){super(),N(this,e,X,V,R,{params:5})}}export{x as default}; diff --git a/ui/dist/assets/PageUserConfirmPasswordReset.31f21d03.js b/ui/dist/assets/PageUserConfirmPasswordReset.31f21d03.js new file mode 100644 index 000000000..af30f3a97 --- /dev/null +++ b/ui/dist/assets/PageUserConfirmPasswordReset.31f21d03.js @@ -0,0 +1,4 @@ +import{S as W,i as Y,s as j,F as A,c as F,m as H,t as P,a as q,d as N,C as B,E as D,g as _,k as G,n as I,o as m,p as E,q as J,e as b,w as y,b as C,f as c,r as M,h as w,u as R,v as K,y as S,x as O,z as h}from"./index.46d73605.js";function Q(i){let e,l,t,n,s,o,p,u,r,a,v,g,k,L,d=i[4]&&U(i);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),u=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password + `),d&&d.c(),s=C(),F(o.$$.fragment),p=C(),F(u.$$.fragment),r=C(),a=b("button"),v=b("span"),v.textContent="Set new password",c(t,"class","m-b-xs"),c(l,"class","content txt-center m-b-sm"),c(v,"class","txt"),c(a,"type","submit"),c(a,"class","btn btn-lg btn-block"),a.disabled=i[2],M(a,"btn-loading",i[2])},m(f,$){_(f,e,$),w(e,l),w(l,t),w(t,n),d&&d.m(t,null),w(e,s),H(o,e,null),w(e,p),H(u,e,null),w(e,r),w(e,a),w(a,v),g=!0,k||(L=R(e,"submit",K(i[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=U(f),d.c(),d.m(t,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),u.$set(z),(!g||$&4)&&(a.disabled=f[2]),$&4&&M(a,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(u.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(u.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),N(o),N(u),k=!1,L()}}}function V(i){let e,l,t,n,s;return{c(){e=b("div"),e.innerHTML=`
+

Successfully changed the user password.

+

You can now sign in with your new password.

`,l=C(),t=b("button"),t.textContent="Close",c(e,"class","alert alert-success"),c(t,"type","button"),c(t,"class","btn btn-secondary btn-block")},m(o,p){_(o,e,p),_(o,l,p),_(o,t,p),n||(s=R(t,"click",i[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(t),n=!1,s()}}}function U(i){let e,l,t;return{c(){e=y("for "),l=b("strong"),t=y(i[4])},m(n,s){_(n,e,s),_(n,l,s),w(l,t)},p(n,s){s&16&&O(t,n[4])},d(n){n&&m(e),n&&m(l)}}}function X(i){let e,l,t,n,s,o,p,u;return{c(){e=b("label"),l=y("New password"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0,s.autofocus=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,s,a),h(s,i[0]),s.focus(),p||(u=R(s,"input",i[8]),p=!0)},p(r,a){a&1024&&t!==(t=r[10])&&c(e,"for",t),a&1024&&o!==(o=r[10])&&c(s,"id",o),a&1&&s.value!==r[0]&&h(s,r[0])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,u()}}}function Z(i){let e,l,t,n,s,o,p,u;return{c(){e=b("label"),l=y("New password confirm"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,s,a),h(s,i[1]),p||(u=R(s,"input",i[9]),p=!0)},p(r,a){a&1024&&t!==(t=r[10])&&c(e,"for",t),a&1024&&o!==(o=r[10])&&c(s,"id",o),a&2&&s.value!==r[1]&&h(s,r[1])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,u()}}}function x(i){let e,l,t,n;const s=[V,Q],o=[];function p(u,r){return u[3]?0:1}return e=p(i),l=o[e]=s[e](i),{c(){l.c(),t=D()},m(u,r){o[e].m(u,r),_(u,t,r),n=!0},p(u,r){let a=e;e=p(u),e===a?o[e].p(u,r):(G(),q(o[a],1,1,()=>{o[a]=null}),I(),l=o[e],l?l.p(u,r):(l=o[e]=s[e](u),l.c()),P(l,1),l.m(t.parentNode,t))},i(u){n||(P(l),n=!0)},o(u){q(l),n=!1},d(u){o[e].d(u),u&&m(t)}}}function ee(i){let e,l;return e=new A({props:{nobranding:!0,$$slots:{default:[x]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},m(t,n){H(e,t,n),l=!0},p(t,[n]){const s={};n&2079&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(P(e.$$.fragment,t),l=!0)},o(t){q(e.$$.fragment,t),l=!1},d(t){N(e,t)}}}function te(i,e,l){let t,{params:n}=e,s="",o="",p=!1,u=!1;async function r(){if(!p){l(2,p=!0);try{await E.users.confirmPasswordReset(n==null?void 0:n.token,s,o),l(3,u=!0)}catch(k){E.errorResponseHandler(k)}l(2,p=!1)}}const a=()=>window.close();function v(){s=this.value,l(0,s)}function g(){o=this.value,l(1,o)}return i.$$set=k=>{"params"in k&&l(6,n=k.params)},i.$$.update=()=>{i.$$.dirty&64&&l(4,t=B.getJWTPayload(n==null?void 0:n.token).email||"")},[s,o,p,u,t,r,n,a,v,g]}class le extends W{constructor(e){super(),Y(this,e,te,ee,j,{params:6})}}export{le as default}; diff --git a/ui/dist/assets/PageUserConfirmPasswordReset.e5379b54.js b/ui/dist/assets/PageUserConfirmPasswordReset.e5379b54.js deleted file mode 100644 index d5c28afc4..000000000 --- a/ui/dist/assets/PageUserConfirmPasswordReset.e5379b54.js +++ /dev/null @@ -1,4 +0,0 @@ -import{S as W,i as Y,s as j,F as A,c as H,m as N,t as P,a as q,d as S,C as B,E as D,g as _,k as G,n as I,o as m,p as E,q as J,e as b,w as y,b as C,f as c,r as M,h as w,u as h,v as K,y as F,x as O,z as R}from"./index.02c04c04.js";function Q(i){let e,l,t,n,s,o,p,a,r,u,v,g,k,L,d=i[4]&&U(i);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),a=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password - `),d&&d.c(),s=C(),H(o.$$.fragment),p=C(),H(a.$$.fragment),r=C(),u=b("button"),v=b("span"),v.textContent="Set new password",c(t,"class","m-b-xs"),c(l,"class","content txt-center m-b-sm"),c(v,"class","txt"),c(u,"type","submit"),c(u,"class","btn btn-lg btn-block"),u.disabled=i[2],M(u,"btn-loading",i[2])},m(f,$){_(f,e,$),w(e,l),w(l,t),w(t,n),d&&d.m(t,null),w(e,s),N(o,e,null),w(e,p),N(a,e,null),w(e,r),w(e,u),w(u,v),g=!0,k||(L=h(e,"submit",K(i[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=U(f),d.c(),d.m(t,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),a.$set(z),(!g||$&4)&&(u.disabled=f[2]),$&4&&M(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(a.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(a.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),S(o),S(a),k=!1,L()}}}function V(i){let e,l,t,n,s;return{c(){e=b("div"),e.innerHTML=`
-

Password changed

-

You can now sign in with your new password.

`,l=C(),t=b("button"),t.textContent="Close",c(e,"class","alert alert-success"),c(t,"type","button"),c(t,"class","btn btn-secondary btn-block")},m(o,p){_(o,e,p),_(o,l,p),_(o,t,p),n||(s=h(t,"click",i[7]),n=!0)},p:F,i:F,o:F,d(o){o&&m(e),o&&m(l),o&&m(t),n=!1,s()}}}function U(i){let e,l,t;return{c(){e=y("for "),l=b("strong"),t=y(i[4])},m(n,s){_(n,e,s),_(n,l,s),w(l,t)},p(n,s){s&16&&O(t,n[4])},d(n){n&&m(e),n&&m(l)}}}function X(i){let e,l,t,n,s,o,p,a;return{c(){e=b("label"),l=y("New password"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),w(e,l),_(r,n,u),_(r,s,u),R(s,i[0]),s.focus(),p||(a=h(s,"input",i[8]),p=!0)},p(r,u){u&1024&&t!==(t=r[10])&&c(e,"for",t),u&1024&&o!==(o=r[10])&&c(s,"id",o),u&1&&s.value!==r[0]&&R(s,r[0])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,a()}}}function Z(i){let e,l,t,n,s,o,p,a;return{c(){e=b("label"),l=y("New password confirm"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0},m(r,u){_(r,e,u),w(e,l),_(r,n,u),_(r,s,u),R(s,i[1]),p||(a=h(s,"input",i[9]),p=!0)},p(r,u){u&1024&&t!==(t=r[10])&&c(e,"for",t),u&1024&&o!==(o=r[10])&&c(s,"id",o),u&2&&s.value!==r[1]&&R(s,r[1])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,a()}}}function x(i){let e,l,t,n;const s=[V,Q],o=[];function p(a,r){return a[3]?0:1}return e=p(i),l=o[e]=s[e](i),{c(){l.c(),t=D()},m(a,r){o[e].m(a,r),_(a,t,r),n=!0},p(a,r){let u=e;e=p(a),e===u?o[e].p(a,r):(G(),q(o[u],1,1,()=>{o[u]=null}),I(),l=o[e],l?l.p(a,r):(l=o[e]=s[e](a),l.c()),P(l,1),l.m(t.parentNode,t))},i(a){n||(P(l),n=!0)},o(a){q(l),n=!1},d(a){o[e].d(a),a&&m(t)}}}function ee(i){let e,l;return e=new A({props:{nobranding:!0,$$slots:{default:[x]},$$scope:{ctx:i}}}),{c(){H(e.$$.fragment)},m(t,n){N(e,t,n),l=!0},p(t,[n]){const s={};n&2079&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(P(e.$$.fragment,t),l=!0)},o(t){q(e.$$.fragment,t),l=!1},d(t){S(e,t)}}}function te(i,e,l){let t,{params:n}=e,s="",o="",p=!1,a=!1;async function r(){if(!p){l(2,p=!0);try{await E.users.confirmPasswordReset(n==null?void 0:n.token,s,o),l(3,a=!0)}catch(k){E.errorResponseHandler(k)}l(2,p=!1)}}const u=()=>window.close();function v(){s=this.value,l(0,s)}function g(){o=this.value,l(1,o)}return i.$$set=k=>{"params"in k&&l(6,n=k.params)},i.$$.update=()=>{i.$$.dirty&64&&l(4,t=B.getJWTPayload(n==null?void 0:n.token).email||"")},[s,o,p,a,t,r,n,u,v,g]}class le extends W{constructor(e){super(),Y(this,e,te,ee,j,{params:6})}}export{le as default}; diff --git a/ui/dist/assets/PageUserConfirmVerification.221aab81.js b/ui/dist/assets/PageUserConfirmVerification.2b1045ba.js similarity index 97% rename from ui/dist/assets/PageUserConfirmVerification.221aab81.js rename to ui/dist/assets/PageUserConfirmVerification.2b1045ba.js index c2feea467..9814219fd 100644 --- a/ui/dist/assets/PageUserConfirmVerification.221aab81.js +++ b/ui/dist/assets/PageUserConfirmVerification.2b1045ba.js @@ -1,3 +1,3 @@ -import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.02c04c04.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`
+import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.46d73605.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`

Invalid or expired verification token.

`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[4]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function S(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`

Successfully verified email address.

`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[3]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function T(o){let t;return{c(){t=u("div"),t.innerHTML='
Please wait...
',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function F(o){let t;function s(i,l){return i[1]?T:i[0]?S:P}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(i,l){n.m(i,l),r(i,t,l)},p(i,l){e===(e=s(i))&&n?n.p(i,l):(n.d(1),n=e(i),n&&(n.c(),n.m(t.parentNode,t)))},d(i){n.d(i),i&&a(t)}}}function V(o){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[F]},$$scope:{ctx:o}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const i={};n&67&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){s||(g(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(o,t,s){let{params:e}=t,n=!1,i=!1;l();async function l(){s(1,i=!0);try{await H.users.confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch(d){console.warn(d),s(0,n=!1)}s(1,i=!1)}const c=()=>window.close(),b=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,i,e,c,b]}class I extends k{constructor(t){super(),v(this,t,q,V,y,{params:2})}}export{I as default}; diff --git a/ui/dist/assets/index.02c04c04.js b/ui/dist/assets/index.02c04c04.js deleted file mode 100644 index 0a0daea8a..000000000 --- a/ui/dist/assets/index.02c04c04.js +++ /dev/null @@ -1,638 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function re(){}const gl=n=>n;function pt(n,e){for(const t in e)n[t]=e[t];return n}function lm(n){return n()}function Za(){return Object.create(null)}function Qe(n){n.forEach(lm)}function Kn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function R_(n){return Object.keys(n).length===0}function om(n,...e){if(n==null)return re;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function kt(n,e,t){n.$$.on_destroy.push(om(e,t))}function wn(n,e,t,i){if(n){const s=rm(n,e,t,i);return n[0](s)}}function rm(n,e,t,i){return n[1]&&i?pt(t.ctx.slice(),n[1](i(e))):t.ctx}function $n(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),la=am?n=>requestAnimationFrame(n):re;const bs=new Set;function um(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&la(um)}function Io(n){let e;return bs.size===0&&la(um),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function fm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function H_(n){const e=_("style");return j_(fm(n),e),e.sheet}function j_(n,e){g(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function xt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ei(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function cm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function fi(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function At(n){return n===""?null:+n}function q_(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function Ga(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ie(n,e,t){n.classList[t?"add":"remove"](e)}function dm(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const ao=new Map;let uo=0;function V_(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function z_(n,e){const t={stylesheet:H_(e),rules:{}};return ao.set(n,t),t}function ol(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ -`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}} -`}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${V_(f)}_${r}`,d=fm(n),{stylesheet:h,rules:m}=ao.get(d)||z_(d,n);m[c]||(m[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,uo+=1,c}function rl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),uo-=s,uo||B_())}function B_(){la(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function U_(n,e,t,i){if(!e)return re;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return re;const{delay:l=0,duration:o=300,easing:r=gl,start:a=Lo()+l,end:u=a+o,tick:f=re,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,m;function v(){c&&(m=ol(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&rl(n,m),d=!1}return Io(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),v(),f(0,1),b}function W_(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,pm(n,s)}}function pm(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let al;function Xs(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Zn(n){Fo().$$.on_mount.push(n)}function Y_(n){Fo().$$.after_update.push(n)}function K_(n){Fo().$$.on_destroy.push(n)}function on(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=dm(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ut(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ys=[],he=[],no=[],Tr=[],hm=Promise.resolve();let Dr=!1;function mm(){Dr||(Dr=!0,hm.then(gm))}function ni(){return mm(),hm}function Dt(n){no.push(n)}function He(n){Tr.push(n)}const Qo=new Set;let Il=0;function gm(){const n=al;do{for(;Il{Is=null})),Is}function es(n,e,t){n.dispatchEvent(dm(`${e?"intro":"outro"}${t}`))}const io=new Set;let oi;function Pe(){oi={r:0,c:[],p:oi}}function Le(){oi.r||Qe(oi.c),oi=oi.p}function E(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),oi.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ra={duration:0};function _m(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=gl,tick:m=re,css:v}=i||ra;v&&(l=ol(n,0,1,d,c,h,v,r++)),m(0,1);const b=Lo()+c,y=b+d;o&&o.abort(),s=!0,Dt(()=>es(n,!0,"start")),o=Io(S=>{if(s){if(S>=y)return m(1,0),es(n,!0,"end"),a(),s=!1;if(S>=b){const C=h((S-b)/d);m(C,1-C)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Kn(i)?(i=i(),oa().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function bm(n,e,t){let i=e(n,t),s=!0,l;const o=oi;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=gl,tick:c=re,css:d}=i||ra;d&&(l=ol(n,1,0,u,a,f,d));const h=Lo()+a,m=h+u;Dt(()=>es(n,!1,"start")),Io(v=>{if(s){if(v>=m)return c(0,1),es(n,!1,"end"),--o.r||Qe(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Kn(i)?oa().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function rt(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&rl(n,a)}function f(d,h){const m=d.b-l;return h*=Math.abs(m),{a:l,b:d.b,d:m,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:m=300,easing:v=gl,tick:b=re,css:y}=s||ra,S={start:Lo()+h,b:d};d||(S.group=oi,oi.r+=1),o||r?r=S:(y&&(u(),a=ol(n,l,d,m,h,v,y)),d&&b(0,1),o=f(S,m),Dt(()=>es(n,d,"start")),Io(C=>{if(r&&C>r.start&&(o=f(r,m),r=null,es(n,o.b,"start"),y&&(u(),a=ol(n,l,o.b,o.duration,0,v,s.css))),o){if(C>=o.end)b(l=o.b,1-l),es(n,o.b,"end"),r||(o.b?u():--o.group.r||Qe(o.group.c)),o=null;else if(C>=o.start){const $=C-o.start;l=o.a+o.d*v($/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Kn(s)?oa().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function Mn(n,e){n.d(1),e.delete(n.key)}function Gt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function J_(n,e){n.f(),Gt(n,e)}function bt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,m=d;const v={};for(;m--;)v[n[m].key]=m;const b=[],y=new Map,S=new Map;for(m=h;m--;){const D=c(s,l,m),O=t(D);let A=o.get(O);A?i&&A.p(D,e):(A=u(O,D),A.c()),y.set(O,b[m]=A),O in v&&S.set(O,Math.abs(m-v[O]))}const C=new Set,$=new Set;function M(D){E(D,1),D.m(r,f),o.set(D.key,D),f=D.first,h--}for(;d&&h;){const D=b[h-1],O=n[d-1],A=D.key,I=O.key;D===O?(f=D.first,d--,h--):y.has(I)?!o.has(A)||C.has(A)?M(D):$.has(I)?d--:S.get(A)>S.get(I)?($.add(A),M(D)):(C.add(I),d--):(a(O,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;h;)M(b[h-1]);return b}function _n(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function pi(n){return typeof n=="object"&&n!==null?n:{}}function Re(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function j(n,e,t,i){const{fragment:s,on_mount:l,on_destroy:o,after_update:r}=n.$$;s&&s.m(e,t),i||Dt(()=>{const a=l.map(lm).filter(Kn);o?o.push(...a):Qe(a),n.$$.on_mount=[]}),r.forEach(Dt)}function q(n,e){const t=n.$$;t.fragment!==null&&(Qe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function G_(n,e){n.$$.dirty[0]===-1&&(Ys.push(n),mm(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const m=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=m)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](m),f&&G_(n,c)),d}):[],u.update(),f=!0,Qe(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=q_(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&E(n.$$.fragment),j(n,e.target,e.anchor,e.customElement),gm()}Xs(a)}class Ee{$destroy(){q(this,1),this.$destroy=re}$on(e,t){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!R_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function en(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function ym(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return vm(t,o=>{let r=!1;const a=[];let u=0,f=re;const c=()=>{if(u)return;f();const h=e(i?a[0]:a,o);l?o(h):f=Kn(h)?h:re},d=s.map((h,m)=>om(h,v=>{a[m]=v,u&=~(1<{u|=1<{q(f,1)}),Le()}l?(e=new l(o()),e.$on("routeEvent",r[7]),V(e.$$.fragment),E(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Q_(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{q(f,1)}),Le()}l?(e=new l(o()),e.$on("routeEvent",r[6]),V(e.$$.fragment),E(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function x_(n){let e,t,i,s;const l=[Q_,X_],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Je()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(Pe(),P(o[f],1,1,()=>{o[f]=null}),Le(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function Xa(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const No=vm(null,function(e){e(Xa());const t=()=>{e(Xa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ym(No,n=>n.location);const Ro=ym(No,n=>n.querystring),Qa=ii(void 0);async function $i(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ni();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function hn(n,e){if(e=eu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with
tags');return xa(n,e),{update(t){t=eu(t),xa(n,t)}}}function e0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function xa(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||t0(i.currentTarget.getAttribute("href"))})}function eu(n){return n&&typeof n=="string"?{href:n}:n||{}}function t0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function n0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:A}=km(M);this.path=M,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=O,this._keys=A}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=M.match(s);if(I&&I[0])M=M.substr(I[0].length)||"/";else return null}}const D=this._pattern.exec(M);if(D===null)return null;if(this._keys===!1)return D;const O={};let A=0;for(;A{r.push(new o(M,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=on();async function d($,M){await ni(),c($,M)}let h=null,m=null;l&&(m=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?h=$.state:h=null},window.addEventListener("popstate",m),Y_(()=>{e0(h)}));let v=null,b=null;const y=No.subscribe(async $=>{v=$;let M=0;for(;M{Qa.set(u)});return}t(0,a=null),b=null,Qa.set(void 0)});K_(()=>{y(),m&&window.removeEventListener("popstate",m)});function S($){ut.call(this,n,$)}function C($){ut.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,s=$.prefix),"restoreScrollState"in $&&t(5,l=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,C]}class i0 extends Ee{constructor(e){super(),Oe(this,e,n0,x_,De,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let wm;function $m(n){const e=n.pattern.test(wm);tu(n,n.className,e),tu(n,n.inactiveClassName,!e)}function tu(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}No.subscribe(n=>{wm=n.location+(n.querystring?"?"+n.querystring:""),so.map($m)});function Hn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?km(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),$m(i),{destroy(){so.splice(so.indexOf(i),1)}}}const s0="modulepreload",l0=function(n,e){return new URL(n,e).href},nu={},Xi=function(e,t,i){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=l0(s,i),s in nu)return;nu[s]=!0;const l=s.endsWith(".css"),o=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const r=document.createElement("link");if(r.rel=l?"stylesheet":s0,l||(r.as="script",r.crossOrigin=""),r.href=s,document.head.appendChild(r),l)return new Promise((a,u)=>{r.addEventListener("load",a),r.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())};var Or=function(n,e){return Or=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Or(n,e)};function ln(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Or(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Er=function(){return Er=Object.assign||function(n){for(var e,t=1,i=arguments.length;t0&&s[s.length-1])||f[0]!==6&&f[0]!==2)){o=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]0&&(!i.exp||i.exp-t>Date.now()/1e3))},n}(),r0=function(){function n(){this.baseToken="",this.baseModel={},this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!o0.isExpired(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e,this.baseModel=t,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel={},this.triggerChange()},n.prototype.onChange=function(e){var t=this;return this._onChangeCallbacks.push(e),function(){for(var i=t._onChangeCallbacks.length-1;i>=0;i--)if(t._onChangeCallbacks[i]==e)return delete t._onChangeCallbacks[i],void t._onChangeCallbacks.splice(i,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.totalPages=i>=0?i:0,this.items=s||[]},Tm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return ts(l,void 0,void 0,function(){return ns(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,h=c.totalItems;return o=o.concat(d),d.length&&h>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u=400)throw new iu({url:$.url,status:$.status,data:M});return[2,M]}})})}).catch(function($){throw new iu($)})]})})},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o"u"}function is(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function y0(n){return typeof n=="string"}function k0(n){return Object.prototype.toString.call(n)==="[object Date]"}function Zm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function w0(n){return Array.isArray(n)?n:[n]}function su(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function $0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ss(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function yi(n,e,t){return jo(n)&&n>=e&&n<=t}function S0(n,e){return n-e*Math.floor(n/e)}function Kt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Oi(n){if(!(mt(n)||n===null||n===""))return parseInt(n,10)}function zi(n){if(!(mt(n)||n===null||n===""))return parseFloat(n)}function fa(n){if(!(mt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ca(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function bl(n){return n%4===0&&(n%100!==0||n%400===0)}function Qs(n){return bl(n)?366:365}function po(n,e){const t=S0(e-1,12)+1,i=n+(e-t)/12;return t===2?bl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function da(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function ho(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Lr(n){return n>99?n:n>60?1900+n:2e3+n}function Jm(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function qo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function Gm(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new qn(`Invalid unit value ${n}`);return e}function mo(n,e){const t={};for(const i in n)if(Ss(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Gm(s)}return t}function xs(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Kt(t,2)}:${Kt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Kt(t,2)}${Kt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return $0(n,["hour","minute","second","millisecond"])}const Xm=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,C0=["January","February","March","April","May","June","July","August","September","October","November","December"],Qm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],M0=["J","F","M","A","M","J","J","A","S","O","N","D"];function xm(n){switch(n){case"narrow":return[...M0];case"short":return[...Qm];case"long":return[...C0];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const eg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],tg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],T0=["M","T","W","T","F","S","S"];function ng(n){switch(n){case"narrow":return[...T0];case"short":return[...tg];case"long":return[...eg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ig=["AM","PM"],D0=["Before Christ","Anno Domini"],O0=["BC","AD"],E0=["B","A"];function sg(n){switch(n){case"narrow":return[...E0];case"short":return[...O0];case"long":return[...D0];default:return null}}function A0(n){return ig[n.hour<12?0:1]}function P0(n,e){return ng(e)[n.weekday-1]}function L0(n,e){return xm(e)[n.month-1]}function I0(n,e){return sg(e)[n.year<0?0:1]}function F0(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function lu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const N0={D:Pr,DD:Om,DDD:Em,DDDD:Am,t:Pm,tt:Lm,ttt:Im,tttt:Fm,T:Nm,TT:Rm,TTT:Hm,TTTT:jm,f:qm,ff:zm,fff:Um,ffff:Ym,F:Vm,FF:Bm,FFF:Wm,FFFF:Km};class kn{static create(e,t={}){return new kn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return N0[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Kt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,m)=>this.loc.extract(e,h,m),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?A0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,m)=>i?L0(e,h):l(m?{month:h}:{month:h,day:"numeric"},"month"),u=(h,m)=>i?P0(e,h):l(m?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const m=kn.macroTokenToFormatOpts(h);return m?this.formatWithSystemDefault(e,m):h},c=h=>i?I0(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return lu(kn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=kn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return lu(l,s(r))}}class Xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class vl{get type(){throw new Ti}get name(){throw new Ti}get ianaName(){return this.name}get isUniversal(){throw new Ti}offsetName(e,t){throw new Ti}formatOffset(e,t){throw new Ti}offset(e){throw new Ti}equals(e){throw new Ti}get isValid(){throw new Ti}}let xo=null;class pa extends vl{static get instance(){return xo===null&&(xo=new pa),xo}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Jm(e,t,i)}formatOffset(e,t){return xs(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let lo={};function R0(n){return lo[n]||(lo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),lo[n]}const H0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function j0(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function q0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?m:1e3+m,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let er=null;class mn extends vl{static get utcInstance(){return er===null&&(er=new mn(0)),er}static instance(e){return e===0?mn.utcInstance:new mn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new mn(qo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${xs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${xs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return xs(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class V0 extends vl{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ei(n,e){if(mt(n)||n===null)return e;if(n instanceof vl)return n;if(y0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?mn.utcInstance:mn.parseSpecifier(t)||ki.create(n)}else return is(n)?mn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new V0(n)}let ou=()=>Date.now(),ru="system",au=null,uu=null,fu=null,cu;class Qt{static get now(){return ou}static set now(e){ou=e}static set defaultZone(e){ru=e}static get defaultZone(){return Ei(ru,pa.instance)}static get defaultLocale(){return au}static set defaultLocale(e){au=e}static get defaultNumberingSystem(){return uu}static set defaultNumberingSystem(e){uu=e}static get defaultOutputCalendar(){return fu}static set defaultOutputCalendar(e){fu=e}static get throwOnInvalid(){return cu}static set throwOnInvalid(e){cu=e}static resetCaches(){Ht.resetCache(),ki.resetCache()}}let du={};function z0(n,e={}){const t=JSON.stringify([n,e]);let i=du[t];return i||(i=new Intl.ListFormat(n,e),du[t]=i),i}let Ir={};function Fr(n,e={}){const t=JSON.stringify([n,e]);let i=Ir[t];return i||(i=new Intl.DateTimeFormat(n,e),Ir[t]=i),i}let Nr={};function B0(n,e={}){const t=JSON.stringify([n,e]);let i=Nr[t];return i||(i=new Intl.NumberFormat(n,e),Nr[t]=i),i}let Rr={};function U0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Rr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Rr[s]=l),l}let Zs=null;function W0(){return Zs||(Zs=new Intl.DateTimeFormat().resolvedOptions().locale,Zs)}function Y0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Fr(n).resolvedOptions()}catch{t=Fr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function K0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Z0(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2016,t,1);e.push(n(i))}return e}function J0(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function Nl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function G0(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class X0{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=B0(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):ca(e,3);return Kt(t,this.padTo)}}}class Q0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ki.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Xe.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Fr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class x0{constructor(e,t,i){this.opts={style:"long",...i},!t&&Zm()&&(this.rtf=U0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):F0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ht{static fromOpts(e){return Ht.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Qt.defaultLocale,o=l||(s?"en-US":W0()),r=t||Qt.defaultNumberingSystem,a=i||Qt.defaultOutputCalendar;return new Ht(o,r,a,l)}static resetCache(){Zs=null,Ir={},Nr={},Rr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Ht.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=Y0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=K0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=G0(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Ht.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Nl(this,e,i,xm,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=Z0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Nl(this,e,i,ng,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=J0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Nl(this,void 0,e,()=>ig,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Nl(this,e,t,sg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Xe.utc(-40,1,1),Xe.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new X0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Q0(e,this.intl,t)}relFormatter(e={}){return new x0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return z0(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Os(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Es(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function As(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function lg(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(m||h&&f)?-h:h;return[{years:d(zi(t)),months:d(zi(i)),weeks:d(zi(s)),days:d(zi(l)),hours:d(zi(o)),minutes:d(zi(r)),seconds:d(zi(a),a==="-0"),milliseconds:d(fa(u),c)}]}const db={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ga(n,e,t,i,s,l,o){const r={year:e.length===2?Lr(Oi(e)):Oi(e),month:Qm.indexOf(t)+1,day:Oi(i),hour:Oi(s),minute:Oi(l)};return o&&(r.second=Oi(o)),n&&(r.weekday=n.length>3?eg.indexOf(n)+1:tg.indexOf(n)+1),r}const pb=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function hb(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=ga(e,s,i,t,l,o,r);let h;return a?h=db[a]:u?h=0:h=qo(f,c),[d,new mn(h)]}function mb(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const gb=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,_b=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,bb=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function pu(n){const[,e,t,i,s,l,o,r]=n;return[ga(e,s,i,t,l,o,r),mn.utcInstance]}function vb(n){const[,e,t,i,s,l,o,r]=n;return[ga(e,r,t,i,s,l,o),mn.utcInstance]}const yb=Os(tb,ma),kb=Os(nb,ma),wb=Os(ib,ma),$b=Os(rg),ug=Es(ab,Ps,yl,kl),Sb=Es(sb,Ps,yl,kl),Cb=Es(lb,Ps,yl,kl),Mb=Es(Ps,yl,kl);function Tb(n){return As(n,[yb,ug],[kb,Sb],[wb,Cb],[$b,Mb])}function Db(n){return As(mb(n),[pb,hb])}function Ob(n){return As(n,[gb,pu],[_b,pu],[bb,vb])}function Eb(n){return As(n,[fb,cb])}const Ab=Es(Ps);function Pb(n){return As(n,[ub,Ab])}const Lb=Os(ob,rb),Ib=Os(ag),Fb=Es(Ps,yl,kl);function Nb(n){return As(n,[Lb,ug],[Ib,Fb])}const Rb="Invalid Duration",fg={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Hb={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...fg},In=146097/400,hs=146097/4800,jb={years:{quarters:4,months:12,weeks:In/7,days:In,hours:In*24,minutes:In*24*60,seconds:In*24*60*60,milliseconds:In*24*60*60*1e3},quarters:{months:3,weeks:In/28,days:In/4,hours:In*24/4,minutes:In*24*60/4,seconds:In*24*60*60/4,milliseconds:In*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...fg},Zi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],qb=Zi.slice(0).reverse();function Bi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new yt(i)}function Vb(n){return n<0?Math.floor(n):Math.ceil(n)}function cg(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?Vb(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function zb(n,e){qb.reduce((t,i)=>mt(e[i])?t:(t&&cg(n,e,t,e,i),i),null)}class yt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Ht.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?jb:Hb,this.isLuxonDuration=!0}static fromMillis(e,t){return yt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new qn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new yt({values:mo(e,yt.normalizeUnit),loc:Ht.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(is(e))return yt.fromMillis(e);if(yt.isDuration(e))return e;if(typeof e=="object")return yt.fromObject(e);throw new qn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=Eb(e);return i?yt.fromObject(i,t):yt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Pb(e);return i?yt.fromObject(i,t):yt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new qn("need to specify a reason the Duration is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Qt.throwOnInvalid)throw new _0(i);return new yt({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Dm(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?kn.create(this.loc,i).formatDurationFromString(this,e):Rb}toHuman(e={}){const t=Zi.map(i=>{const s=this.values[i];return mt(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ca(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=yt.fromDurationLike(e),i={};for(const s of Zi)(Ss(t.values,s)||Ss(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Bi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=yt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=Gm(e(this.values[i],i));return Bi(this,{values:t},!0)}get(e){return this[yt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...mo(e,yt.normalizeUnit)};return Bi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Bi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return zb(this.matrix,e),Bi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>yt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Zi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;is(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Zi.indexOf(u)>Zi.indexOf(o)&&cg(this.matrix,s,u,t,o)}else is(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Bi(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Bi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Zi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Fs="Invalid Interval";function Bb(n,e){return!n||!n.isValid?Vt.invalid("missing or invalid start"):!e||!e.isValid?Vt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Vt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Vt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=yt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Vt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Vt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Vt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Vt.fromDateTimes(t,a.time)),t=null);return Vt.merge(s)}difference(...e){return Vt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Fs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Fs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Fs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Fs}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Fs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):yt.invalid(this.invalidReason)}mapEndpoints(e){return Vt.fromDateTimes(e(this.s),e(this.e))}}class Rl{static hasDST(e=Qt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ki.isValidZone(e)}static normalizeZone(e){return Ei(e,Qt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ht.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ht.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ht.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ht.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ht.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ht.create(t,null,"gregory").eras(e)}static features(){return{relative:Zm()}}}function hu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(yt.fromMillis(i).as("days"))}function Ub(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=hu(r,a);return(u-u%7)/7}],["days",hu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function Wb(n,e,t,i){let[s,l,o,r]=Ub(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?yt.fromMillis(a,i).shiftTo(...u).plus(f):f}const _a={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},mu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Yb=_a.hanidec.replace(/[\[|\]]/g,"").split("");function Kb(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Jn({numberingSystem:n},e=""){return new RegExp(`${_a[n||"latn"]}${e}`)}const Zb="missing Intl.DateTimeFormat.formatToParts support";function $t(n,e=t=>t){return{regex:n,deser:([t])=>e(Kb(t))}}const Jb=String.fromCharCode(160),dg=`[ ${Jb}]`,pg=new RegExp(dg,"g");function Gb(n){return n.replace(/\./g,"\\.?").replace(pg,dg)}function gu(n){return n.replace(/\./g,"").replace(pg," ").toLowerCase()}function Gn(n,e){return n===null?null:{regex:RegExp(n.map(Gb).join("|")),deser:([t])=>n.findIndex(i=>gu(t)===gu(i))+e}}function _u(n,e){return{regex:n,deser:([,t,i])=>qo(t,i),groups:e}}function tr(n){return{regex:n,deser:([e])=>e}}function Xb(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Qb(n,e){const t=Jn(e),i=Jn(e,"{2}"),s=Jn(e,"{3}"),l=Jn(e,"{4}"),o=Jn(e,"{6}"),r=Jn(e,"{1,2}"),a=Jn(e,"{1,3}"),u=Jn(e,"{1,6}"),f=Jn(e,"{1,9}"),c=Jn(e,"{2,4}"),d=Jn(e,"{4,6}"),h=b=>({regex:RegExp(Xb(b.val)),deser:([y])=>y,literal:!0}),v=(b=>{if(n.literal)return h(b);switch(b.val){case"G":return Gn(e.eras("short",!1),0);case"GG":return Gn(e.eras("long",!1),0);case"y":return $t(u);case"yy":return $t(c,Lr);case"yyyy":return $t(l);case"yyyyy":return $t(d);case"yyyyyy":return $t(o);case"M":return $t(r);case"MM":return $t(i);case"MMM":return Gn(e.months("short",!0,!1),1);case"MMMM":return Gn(e.months("long",!0,!1),1);case"L":return $t(r);case"LL":return $t(i);case"LLL":return Gn(e.months("short",!1,!1),1);case"LLLL":return Gn(e.months("long",!1,!1),1);case"d":return $t(r);case"dd":return $t(i);case"o":return $t(a);case"ooo":return $t(s);case"HH":return $t(i);case"H":return $t(r);case"hh":return $t(i);case"h":return $t(r);case"mm":return $t(i);case"m":return $t(r);case"q":return $t(r);case"qq":return $t(i);case"s":return $t(r);case"ss":return $t(i);case"S":return $t(a);case"SSS":return $t(s);case"u":return tr(f);case"uu":return tr(r);case"uuu":return $t(t);case"a":return Gn(e.meridiems(),0);case"kkkk":return $t(l);case"kk":return $t(c,Lr);case"W":return $t(r);case"WW":return $t(i);case"E":case"c":return $t(t);case"EEE":return Gn(e.weekdays("short",!1,!1),1);case"EEEE":return Gn(e.weekdays("long",!1,!1),1);case"ccc":return Gn(e.weekdays("short",!0,!1),1);case"cccc":return Gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return _u(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return _u(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return tr(/[a-z_+-/]{1,256}?/i);default:return h(b)}})(n)||{invalidReason:Zb};return v.token=n,v}const xb={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function e1(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=xb[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function t1(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function n1(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ss(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function i1(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return mt(n.z)||(t=ki.create(n.z)),mt(n.Z)||(t||(t=new mn(n.Z)),i=n.Z),mt(n.q)||(n.M=(n.q-1)*3+1),mt(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),mt(n.u)||(n.S=fa(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let nr=null;function s1(){return nr||(nr=Xe.fromMillis(1555555555555)),nr}function l1(n,e){if(n.literal)return n;const t=kn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=kn.create(e,t).formatDateTimeParts(s1()).map(o=>e1(o,e,t));return l.includes(void 0)?n:l}function o1(n,e){return Array.prototype.concat(...n.map(t=>l1(t,e)))}function hg(n,e,t){const i=o1(kn.parseFormat(t),n),s=i.map(o=>Qb(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=t1(s),a=RegExp(o,"i"),[u,f]=n1(e,a,r),[c,d,h]=f?i1(f):[null,null,void 0];if(Ss(f,"a")&&Ss(f,"H"))throw new Ks("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function r1(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=hg(n,e,t);return[i,s,l,o]}const mg=[0,31,59,90,120,151,181,212,243,273,304,334],gg=[0,31,60,91,121,152,182,213,244,274,305,335];function zn(n,e){return new Xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function _g(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function bg(n,e,t){return t+(bl(n)?gg:mg)[e-1]}function vg(n,e){const t=bl(n)?gg:mg,i=t.findIndex(l=>lho(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function bu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=_g(e,1,4),l=Qs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=Qs(r)):o>l?(r=e+1,o-=Qs(e)):r=e;const{month:a,day:u}=vg(r,o);return{year:r,month:a,day:u,...Vo(n)}}function ir(n){const{year:e,month:t,day:i}=n,s=bg(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function vu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=vg(e,t);return{year:e,month:i,day:s,...Vo(n)}}function a1(n){const e=jo(n.weekYear),t=yi(n.weekNumber,1,ho(n.weekYear)),i=yi(n.weekday,1,7);return e?t?i?!1:zn("weekday",n.weekday):zn("week",n.week):zn("weekYear",n.weekYear)}function u1(n){const e=jo(n.year),t=yi(n.ordinal,1,Qs(n.year));return e?t?!1:zn("ordinal",n.ordinal):zn("year",n.year)}function yg(n){const e=jo(n.year),t=yi(n.month,1,12),i=yi(n.day,1,po(n.year,n.month));return e?t?i?!1:zn("day",n.day):zn("month",n.month):zn("year",n.year)}function kg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=yi(e,0,23)||e===24&&t===0&&i===0&&s===0,o=yi(t,0,59),r=yi(i,0,59),a=yi(s,0,999);return l?o?r?a?!1:zn("millisecond",s):zn("second",i):zn("minute",t):zn("hour",e)}const sr="Invalid DateTime",yu=864e13;function Hl(n){return new Xn("unsupported zone",`the zone "${n.name}" is not supported`)}function lr(n){return n.weekData===null&&(n.weekData=Hr(n.c)),n.weekData}function Ns(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function wg(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function ku(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function oo(n,e,t){return wg(da(n),e,t)}function wu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,po(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=yt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=da(l);let[a,u]=wg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Rs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Xe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Xe.invalid(new Xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function jl(n,e,t=!0){return n.isValid?kn.create(Ht.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function or(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Kt(n.c.year,t?6:4),e?(i+="-",i+=Kt(n.c.month),i+="-",i+=Kt(n.c.day)):(i+=Kt(n.c.month),i+=Kt(n.c.day)),i}function $u(n,e,t,i,s,l){let o=Kt(n.c.hour);return e?(o+=":",o+=Kt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Kt(n.c.minute),(n.c.second!==0||!t)&&(o+=Kt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Kt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Kt(Math.trunc(-n.o/60)),o+=":",o+=Kt(Math.trunc(-n.o%60))):(o+="+",o+=Kt(Math.trunc(n.o/60)),o+=":",o+=Kt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const $g={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},f1={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},c1={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Sg=["year","month","day","hour","minute","second","millisecond"],d1=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],p1=["year","ordinal","hour","minute","second","millisecond"];function Su(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Dm(n);return e}function Cu(n,e){const t=Ei(e.zone,Qt.defaultZone),i=Ht.fromObject(e),s=Qt.now();let l,o;if(mt(n.year))l=s;else{for(const u of Sg)mt(n[u])&&(n[u]=$g[u]);const r=yg(n)||kg(n);if(r)return Xe.invalid(r);const a=t.offset(s);[l,o]=oo(n,a,t)}return new Xe({ts:l,zone:t,loc:i,o})}function Mu(n,e,t){const i=mt(t.round)?!0:t.round,s=(o,r)=>(o=ca(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Tu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Xe{constructor(e){const t=e.zone||Qt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Xn("invalid input"):null)||(t.isValid?null:Hl(t));this.ts=mt(e.ts)?Qt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=ku(this.ts,r),i=Number.isNaN(s.year)?new Xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Ht.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Tu(arguments),[i,s,l,o,r,a,u]=t;return Cu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Tu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=mn.utcInstance,Cu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=k0(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const s=Ei(t.zone,Qt.defaultZone);return s.isValid?new Xe({ts:i,zone:s,loc:Ht.fromObject(t)}):Xe.invalid(Hl(s))}static fromMillis(e,t={}){if(is(e))return e<-yu||e>yu?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Ei(t.zone,Qt.defaultZone),loc:Ht.fromObject(t)});throw new qn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(is(e))return new Xe({ts:e*1e3,zone:Ei(t.zone,Qt.defaultZone),loc:Ht.fromObject(t)});throw new qn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ei(t.zone,Qt.defaultZone);if(!i.isValid)return Xe.invalid(Hl(i));const s=Qt.now(),l=mt(t.specificOffset)?i.offset(s):t.specificOffset,o=mo(e,Su),r=!mt(o.ordinal),a=!mt(o.year),u=!mt(o.month)||!mt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Ht.fromObject(t);if((f||r)&&c)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Ks("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let m,v,b=ku(s,l);h?(m=d1,v=f1,b=Hr(b)):r?(m=p1,v=c1,b=ir(b)):(m=Sg,v=$g);let y=!1;for(const A of m){const I=o[A];mt(I)?y?o[A]=v[A]:o[A]=b[A]:y=!0}const S=h?a1(o):r?u1(o):yg(o),C=S||kg(o);if(C)return Xe.invalid(C);const $=h?bu(o):r?vu(o):o,[M,D]=oo($,l,i),O=new Xe({ts:M,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=Tb(e);return Rs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=Db(e);return Rs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=Ob(e);return Rs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(mt(e)||mt(t))throw new qn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Ht.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=r1(o,e,t);return f?Xe.invalid(f):Rs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Nb(e);return Rs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new qn("need to specify a reason the DateTime is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Qt.throwOnInvalid)throw new m0(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?lr(this).weekYear:NaN}get weekNumber(){return this.isValid?lr(this).weekNumber:NaN}get weekday(){return this.isValid?lr(this).weekday:NaN}get ordinal(){return this.isValid?ir(this.c).ordinal:NaN}get monthShort(){return this.isValid?Rl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Rl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Rl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Rl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return bl(this.year)}get daysInMonth(){return po(this.year,this.month)}get daysInYear(){return this.isValid?Qs(this.year):NaN}get weeksInWeekYear(){return this.isValid?ho(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=kn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(mn.instance(e),t)}toLocal(){return this.setZone(Qt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ei(e,Qt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=oo(o,l,e)}return Ns(this,{ts:s,zone:e})}else return Xe.invalid(Hl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Ns(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=mo(e,Su),i=!mt(t.weekYear)||!mt(t.weekNumber)||!mt(t.weekday),s=!mt(t.ordinal),l=!mt(t.year),o=!mt(t.month)||!mt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Ks("Can't mix ordinal dates with month/day");let u;i?u=bu({...Hr(this.c),...t}):mt(t.ordinal)?(u={...this.toObject(),...t},mt(t.day)&&(u.day=Math.min(po(u.year,u.month),u.day))):u=vu({...ir(this.c),...t});const[f,c]=oo(u,this.o,this.zone);return Ns(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=yt.fromDurationLike(e);return Ns(this,wu(this,t))}minus(e){if(!this.isValid)return this;const t=yt.fromDurationLike(e).negate();return Ns(this,wu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=yt.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?kn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):sr}toLocaleString(e=Pr,t={}){return this.isValid?kn.create(this.loc.clone(t),e).formatDateTime(this):sr}toLocaleParts(e={}){return this.isValid?kn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=or(this,o);return r+="T",r+=$u(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?or(this,e==="extended"):null}toISOWeekDate(){return jl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+$u(this,o==="extended",t,e,i,l):null}toRFC2822(){return jl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return jl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?or(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),jl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():sr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return yt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=w0(t).map(yt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Wb(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Vt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new qn("max requires all arguments be DateTimes");return su(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Ht.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return hg(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Pr}static get DATE_MED(){return Om}static get DATE_MED_WITH_WEEKDAY(){return b0}static get DATE_FULL(){return Em}static get DATE_HUGE(){return Am}static get TIME_SIMPLE(){return Pm}static get TIME_WITH_SECONDS(){return Lm}static get TIME_WITH_SHORT_OFFSET(){return Im}static get TIME_WITH_LONG_OFFSET(){return Fm}static get TIME_24_SIMPLE(){return Nm}static get TIME_24_WITH_SECONDS(){return Rm}static get TIME_24_WITH_SHORT_OFFSET(){return Hm}static get TIME_24_WITH_LONG_OFFSET(){return jm}static get DATETIME_SHORT(){return qm}static get DATETIME_SHORT_WITH_SECONDS(){return Vm}static get DATETIME_MED(){return zm}static get DATETIME_MED_WITH_SECONDS(){return Bm}static get DATETIME_MED_WITH_WEEKDAY(){return v0}static get DATETIME_FULL(){return Um}static get DATETIME_FULL_WITH_SECONDS(){return Wm}static get DATETIME_HUGE(){return Ym}static get DATETIME_HUGE_WITH_SECONDS(){return Km}}function Hs(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&is(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new qn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}class U{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01T00:00:00Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||U.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return U.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!U.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e:(t||!U.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){U.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=U.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=t.split(s);for(const r of o){if(!U.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(!U.isObject(e)&&!Array.isArray(e)){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!U.isObject(l)&&!Array.isArray(l)||!U.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=t.split(i),o=l.pop();for(const r of l)(!U.isObject(s)&&!Array.isArray(s)||!U.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):U.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||U.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||U.isObject(e)&&Object.keys(e).length>0)&&U.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s{console.warn("Failed to copy.",i)})}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return/\.jpg|\.jpeg|\.png|\.svg|\.gif|\.webp|\.avif$/.test(e)}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(U.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)U.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):U.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static dummyCollectionRecord(e){var s,l,o,r,a;const t=(e==null?void 0:e.schema)||[],i={"@collectionId":e==null?void 0:e.id,"@collectionName":e==null?void 0:e.name,id:"RECORD_ID",created:"2022-01-01 01:00:00",updated:"2022-01-01 23:59:59"};for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON (array/object)":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)>1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)>1&&(f=[f])):u.type==="relation"||u.type==="user"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)>1&&(f=[f])):f="test",i[u.name]=f}return i}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e=e||{},e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":case"user":return((t=e.options)==null?void 0:t.maxSelect)>1?"Array":"String";default:return"String"}}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=U.isObject(u)&&U.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}}const ba=ii([]);function h1(n,e=4e3){return va(n,"info",e)}function cn(n,e=3e3){return va(n,"success",e)}function go(n,e=4500){return va(n,"error",e)}function va(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Cg(i)},t)};ba.update(s=>(Mg(s,i.message),U.pushOrReplaceByKey(s,i,"message"),s))}function Cg(n){ba.update(e=>(Mg(e,n),e))}function Mg(n,e){let t;typeof e=="string"?t=U.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),U.removeByKey(n,"message",t.message))}const as=ii({});function Si(n){as.set(n||{})}function Tg(n){as.update(e=>(U.deleteByPath(e,n),e))}const ya=ii({});function jr(n){ya.set(n||{})}ua.prototype.logout=function(n=!0){this.authStore.clear(),n&&$i("/login")};ua.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&go(l)}if(U.isEmpty(s.data)||Si(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),$i("/")};class m1 extends Cm{save(e,t){super.save(e,t),t instanceof $s&&jr(t)}clear(){super.clear(),jr(null)}}const be=new ua("../","en-US",new m1("pb_admin_auth"));be.authStore.model instanceof $s&&jr(be.authStore.model);function g1(n){let e,t,i,s,l,o,r,a;const u=n[3].default,f=wn(u,n,n[2],null);return{c(){e=_("div"),t=_("main"),f&&f.c(),i=T(),s=_("footer"),l=_("a"),o=_("span"),o.textContent="PocketBase v0.4.2",p(t,"class","page-content"),p(o,"class","txt"),p(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"class","inline-flex flex-gap-5"),p(l,"target","_blank"),p(l,"rel","noopener"),p(l,"title","Releases"),p(s,"class","page-footer"),p(e,"class",r="page-wrapper "+n[1]),ie(e,"center-content",n[0])},m(c,d){w(c,e,d),g(e,t),f&&f.m(t,null),g(e,i),g(e,s),g(s,l),g(l,o),a=!0},p(c,[d]){f&&f.p&&(!a||d&4)&&Sn(f,u,c,c[2],a?$n(u,c[2],d,null):Cn(c[2]),null),(!a||d&2&&r!==(r="page-wrapper "+c[1]))&&p(e,"class",r),d&3&&ie(e,"center-content",c[0])},i(c){a||(E(f,c),a=!0)},o(c){P(f,c),a=!1},d(c){c&&k(e),f&&f.d(c)}}}function _1(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Dn extends Ee{constructor(e){super(),Oe(this,e,_1,g1,De,{center:0,class:1})}}function Du(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=``,t=T(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function b1(n){let e,t,i,s=!n[0]&&Du();const l=n[1].default,o=wn(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=T(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Du(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Sn(o,l,r,r[2],i?$n(l,r[2],a,null):Cn(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function v1(n){let e,t;return e=new Dn({props:{class:"full-page",center:!0,$$slots:{default:[b1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function y1(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Dg extends Ee{constructor(e){super(),Oe(this,e,y1,v1,De,{nobranding:0})}}function Ou(n,e,t){const i=n.slice();return i[11]=e[t],i}const k1=n=>({}),Eu=n=>({uniqueId:n[3]});function w1(n){let e=(n[11]||_o)+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||_o)+"")&&ue(t,e)},d(i){i&&k(t)}}}function $1(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||_o)+"",i;return{c(){e=_("pre"),i=F(t)},m(o,r){w(o,e,r),g(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||_o)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Au(n){let e,t;function i(o,r){return typeof o[11]=="object"?$1:w1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function S1(n){let e,t,i,s,l;const o=n[7].default,r=wn(o,n,n[6],Eu);let a=n[2],u=[];for(let f=0;ft(5,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Tg(r)}Zn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(m){ut.call(this,n,m)}function h(m){he[m?"unshift":"push"](()=>{u=m,t(1,u)})}return n.$$set=m=>{"name"in m&&t(4,r=m.name),"class"in m&&t(0,a=m.class),"$$scope"in m&&t(6,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=U.toArray(U.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Ne extends Ee{constructor(e){super(),Oe(this,e,C1,S1,De,{name:4,class:0})}}function M1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Email"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Me(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function T1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),Me(l,n[1]),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&Me(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function D1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Password confirm"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[2]),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&Me(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function O1(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[M1,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[T1,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[D1,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="

Create your first admin account in order to continue

",i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("button"),f.innerHTML=`Create and login - `,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ie(f,"btn-disabled",n[3]),ie(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(m,v){w(m,e,v),g(e,t),g(e,i),j(s,e,null),g(e,l),j(o,e,null),g(e,r),j(a,e,null),g(e,u),g(e,f),c=!0,d||(h=G(e,"submit",Yt(n[4])),d=!0)},p(m,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:m}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:m}),o.$set(y);const S={};v&1540&&(S.$$scope={dirty:v,ctx:m}),a.$set(S),v&8&&ie(f,"btn-disabled",m[3]),v&8&&ie(f,"btn-loading",m[3])},i(m){c||(E(s.$$.fragment,m),E(o.$$.fragment,m),E(a.$$.fragment,m),c=!0)},o(m){P(s.$$.fragment,m),P(o.$$.fragment,m),P(a.$$.fragment,m),c=!1},d(m){m&&k(e),q(s),q(o),q(a),d=!1,h()}}}function E1(n,e,t){const i=on();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await be.admins.create({email:s,password:l,passwordConfirm:o}),await be.admins.authViaEmail(s,l),i("submit")}catch(d){be.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class A1 extends Ee{constructor(e){super(),Oe(this,e,E1,O1,De,{})}}function Pu(n){let e,t;return e=new Dg({props:{$$slots:{default:[P1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function P1(n){let e,t;return e=new A1({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:re,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function L1(n){let e,t,i=n[0]&&Pu(n);return{c(){i&&i.c(),e=Je()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&E(i,1)):(i=Pu(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(Pe(),P(i,1,1,()=>{i=null}),Le())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function I1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){be.logout(!1),t(0,i=!0);return}be.authStore.isValid?$i("/collections"):be.logout()}return[i,async()=>{t(0,i=!1),await ni(),window.location.search=""}]}class F1 extends Ee{constructor(e){super(),Oe(this,e,I1,L1,De,{})}}const Rt=ii(""),bo=ii("");function zo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=gl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Bn(n,{delay:e=0,duration:t=400,easing:i=zo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>` - transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px); - opacity: ${a-f*d}`}}function tn(n,{delay:e=0,duration:t=400,easing:i=zo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Un(n,{delay:e=0,duration:t=400,easing:i=zo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` - transform: ${a} scale(${1-u*d}); - opacity: ${r-f*d} - `}}function N1(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Me(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Me(e,l[7])},i:re,o:re,d(l){l&&k(e),n[13](null),i=!1,s()}}}function R1(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),he.push(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Je()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),he.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(e,a)}}}function Lu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Iu();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='Clear',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&E(r,1):(r=Iu(),r.c(),E(r,1),r.m(e.parentNode,e)):r&&(Pe(),P(r,1,1,()=>{r=null}),Le())},i(a){s||(E(r),a&&Dt(()=>{i||(i=rt(t,Bn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=rt(t,Bn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Iu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Dt(()=>{t||(t=rt(e,Bn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=rt(e,Bn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function H1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[R1,N1],h=[];function m(b,y){return b[4]&&!b[5]?0:1}o=m(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Lu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(i,s),g(t,l),h[o].m(t,null),g(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Yt(n[10])),G(e,"click",ei(n[11]))],f=!0)},p(b,[y]){let S=o;o=m(b),o===S?h[o].p(b,y):(Pe(),P(h[S],1,1,()=>{h[S]=null}),Le(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),E(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&E(v,1)):(v=Lu(b),v.c(),E(v,1),v.m(t,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){u||(E(r),E(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Qe(c)}}}function j1(n,e,t){const i=on(),s="search_"+U.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new fn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function m(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Xi(()=>import("./FilterAutocompleteInput.8c09e039.js"),[],import.meta.url)).default),t(5,f=!1))}Zn(()=>{v()});function b(M){ut.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function S(M){he[M?"unshift":"push"](()=>{c=M,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),m()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,m,b,y,S,C,$]}class Bo extends Ee{constructor(e){super(),Oe(this,e,j1,H1,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let qr,Ui;const Vr="app-tooltip";function Fu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ii(){return Ui=Ui||document.querySelector("."+Vr),Ui||(Ui=document.createElement("div"),Ui.classList.add(Vr),document.body.appendChild(Ui)),Ui}function Og(n,e){let t=Ii();if(!t.classList.contains("active")||!(e!=null&&e.text)){zr();return}t.textContent=e.text,t.className=Vr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function zr(){clearTimeout(qr),Ii().classList.remove("active"),Ii().activeNode=void 0}function q1(n,e){Ii().activeNode=n,clearTimeout(qr),qr=setTimeout(()=>{Ii().classList.add("active"),Og(n,e)},isNaN(e.delay)?200:e.delay)}function Ct(n,e){let t=Fu(e);function i(){q1(n,t)}function s(){zr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",s),Ii(),{update(l){var o,r;t=Fu(l),(r=(o=Ii())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Og(n,t)},destroy(){var l,o;(o=(l=Ii())==null?void 0:l.activeNode)!=null&&o.contains(n)&&zr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function V1(n){let e,t,i,s;return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle svelte-b7gb6q"),ie(e,"refreshing",n[1])},m(l,o){w(l,e,o),i||(s=[Ye(t=Ct.call(null,e,n[0])),G(e,"click",n[2])],i=!0)},p(l,[o]){t&&Kn(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&ie(e,"refreshing",l[1])},i:re,o:re,d(l){l&&k(e),i=!1,Qe(s)}}}function z1(n,e,t){const i=on();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},200))}return Zn(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Uo extends Ee{constructor(e){super(),Oe(this,e,z1,V1,De,{tooltip:0})}}function B1(n){let e,t,i,s,l;const o=n[6].default,r=wn(o,n,n[5],null);return{c(){e=_("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),ie(e,"col-sort-disabled",n[3]),ie(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ie(e,"sort-desc",n[0]==="-"+n[2]),ie(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[G(e,"click",n[7]),G(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Sn(r,o,a,a[5],i?$n(o,a[5],u,null):Cn(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),u&10&&ie(e,"col-sort-disabled",a[3]),u&7&&ie(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&ie(e,"sort-desc",a[0]==="-"+a[2]),u&7&&ie(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Qe(l)}}}function U1(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class sn extends Ee{constructor(e){super(),Oe(this,e,U1,B1,De,{class:1,name:2,sort:0,disable:3})}}function W1(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Y1(n){let e,t=U.formatToUTCDate(n[0])+"",i,s,l,o,r;return{c(){e=_("span"),i=F(t),s=F(" UTC"),p(e,"class","txt")},m(a,u){w(a,e,u),g(e,i),g(e,s),o||(r=Ye(l=Ct.call(null,e,U.formatToLocalDate(n[0])+" Local")),o=!0)},p(a,u){u&1&&t!==(t=U.formatToUTCDate(a[0])+"")&&ue(i,t),l&&Kn(l.update)&&u&1&&l.update.call(null,U.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),o=!1,r()}}}function K1(n){let e;function t(l,o){return l[0]?Y1:W1}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:re,o:re,d(l){s.d(l),l&&k(e)}}}function Z1(n,e,t){let{date:i=""}=e;return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i]}class wi extends Ee{constructor(e){super(),Oe(this,e,Z1,K1,De,{date:0})}}function Nu(n,e,t){const i=n.slice();return i[21]=e[t],i}function J1(n){let e;return{c(){e=_("div"),e.innerHTML=` - method`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function G1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function X1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function Q1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",p(t,"class",U.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function x1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function Ru(n){let e;function t(l,o){return l[6]?tv:ev}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function ev(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Hu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Hu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function tv(n){let e;return{c(){e=_("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Hu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function ju(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qu(n,e){var se,ge,ke;let t,i,s,l=((se=e[21].method)==null?void 0:se.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,m,v,b,y,S=(e[21].referer||"N/A")+"",C,$,M,D,O,A=e[21].status+"",I,L,R,B,K,J,H,X,W,te,x=(((ge=e[21].meta)==null?void 0:ge.errorMessage)||((ke=e[21].meta)==null?void 0:ke.errorData))&&ju();B=new wi({props:{date:e[21].created}});function oe(){return e[16](e[21])}function me(...Y){return e[17](e[21],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=F(l),a=T(),u=_("td"),f=_("span"),d=F(c),m=T(),x&&x.c(),v=T(),b=_("td"),y=_("span"),C=F(S),M=T(),D=_("td"),O=_("span"),I=F(A),L=T(),R=_("td"),V(B.$$.fragment),K=T(),J=_("td"),J.innerHTML='',H=T(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",$=e[21].referer),ie(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),ie(O,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(R,"class","col-type-date col-field-created"),p(J,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,ve){w(Y,t,ve),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,m),x&&x.m(u,null),g(t,v),g(t,b),g(b,y),g(y,C),g(t,M),g(t,D),g(D,O),g(O,I),g(t,L),g(t,R),j(B,R,null),g(t,K),g(t,J),g(t,H),X=!0,W||(te=[G(t,"click",oe),G(t,"keydown",me)],W=!0)},p(Y,ve){var Q,Se,je;e=Y,(!X||ve&8)&&l!==(l=((Q=e[21].method)==null?void 0:Q.toUpperCase())+"")&&ue(o,l),(!X||ve&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!X||ve&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!X||ve&8&&h!==(h=e[21].url))&&p(f,"title",h),((Se=e[21].meta)==null?void 0:Se.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?x||(x=ju(),x.c(),x.m(u,null)):x&&(x.d(1),x=null),(!X||ve&8)&&S!==(S=(e[21].referer||"N/A")+"")&&ue(C,S),(!X||ve&8&&$!==($=e[21].referer))&&p(y,"title",$),ve&8&&ie(y,"txt-hint",!e[21].referer),(!X||ve&8)&&A!==(A=e[21].status+"")&&ue(I,A),ve&8&&ie(O,"label-danger",e[21].status>=400);const ee={};ve&8&&(ee.date=e[21].created),B.$set(ee)},i(Y){X||(E(B.$$.fragment,Y),X=!0)},o(Y){P(B.$$.fragment,Y),X=!1},d(Y){Y&&k(t),x&&x.d(),q(B),W=!1,Qe(te)}}}function Vu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function zu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[6]),ie(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&ie(t,"btn-loading",f[6]),c&64&&ie(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function nv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O=[],A=new Map,I,L,R,B;function K(Q){n[11](Q)}let J={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[J1]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),l=new sn({props:J}),he.push(()=>Re(l,"sort",K));function H(Q){n[12](Q)}let X={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[G1]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),a=new sn({props:X}),he.push(()=>Re(a,"sort",H));function W(Q){n[13](Q)}let te={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[X1]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),c=new sn({props:te}),he.push(()=>Re(c,"sort",W));function x(Q){n[14](Q)}let oe={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Q1]},$$scope:{ctx:n}};n[1]!==void 0&&(oe.sort=n[1]),m=new sn({props:oe}),he.push(()=>Re(m,"sort",x));function me(Q){n[15](Q)}let se={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[x1]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),y=new sn({props:se}),he.push(()=>Re(y,"sort",me));let ge=n[3];const ke=Q=>Q[21].id;for(let Q=0;Qo=!1)),l.$set(je);const Ue={};Se&16777216&&(Ue.$$scope={dirty:Se,ctx:Q}),!u&&Se&2&&(u=!0,Ue.sort=Q[1],He(()=>u=!1)),a.$set(Ue);const Z={};Se&16777216&&(Z.$$scope={dirty:Se,ctx:Q}),!d&&Se&2&&(d=!0,Z.sort=Q[1],He(()=>d=!1)),c.$set(Z);const pe={};Se&16777216&&(pe.$$scope={dirty:Se,ctx:Q}),!v&&Se&2&&(v=!0,pe.sort=Q[1],He(()=>v=!1)),m.$set(pe);const ce={};Se&16777216&&(ce.$$scope={dirty:Se,ctx:Q}),!S&&Se&2&&(S=!0,ce.sort=Q[1],He(()=>S=!1)),y.$set(ce),Se&841&&(ge=Q[3],Pe(),O=bt(O,Se,ke,1,Q,ge,A,D,Gt,qu,null,Nu),Le(),!ge.length&&Y?Y.p(Q,Se):ge.length?Y&&(Y.d(1),Y=null):(Y=Ru(Q),Y.c(),Y.m(D,null))),Se&64&&ie(t,"table-loading",Q[6]),Q[3].length?ve?ve.p(Q,Se):(ve=Vu(Q),ve.c(),ve.m(L.parentNode,L)):ve&&(ve.d(1),ve=null),Q[3].length&&Q[7]?ee?ee.p(Q,Se):(ee=zu(Q),ee.c(),ee.m(R.parentNode,R)):ee&&(ee.d(1),ee=null)},i(Q){if(!B){E(l.$$.fragment,Q),E(a.$$.fragment,Q),E(c.$$.fragment,Q),E(m.$$.fragment,Q),E(y.$$.fragment,Q);for(let Se=0;Se{A<=1&&m(),t(6,d=!1),t(3,u=u.concat(I.items)),t(5,f=I.page),t(4,c=I.totalItems),s("load",u)}).catch(I=>{I!=null&&I.isAbort||(t(6,d=!1),console.warn(I),m(),be.errorResponseHandler(I,!1))})}function m(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(A){a=A,t(1,a)}function b(A){a=A,t(1,a)}function y(A){a=A,t(1,a)}function S(A){a=A,t(1,a)}function C(A){a=A,t(1,a)}const $=A=>s("select",A),M=(A,I)=>{I.code==="Enter"&&(I.preventDefault(),s("select",A))},D=()=>t(0,o=""),O=()=>h(f+1);return n.$$set=A=>{"filter"in A&&t(0,o=A.filter),"presets"in A&&t(10,r=A.presets),"sort"in A&&t(1,a=A.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(m(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,v,b,y,S,C,$,M,D,O]}class sv extends Ee{constructor(e){super(),Oe(this,e,iv,nv,De,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! - * Chart.js v3.9.1 - * https://www.chartjs.org - * (c) 2022 Chart.js Contributors - * Released under the MIT License - */function gi(){}const lv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function Ft(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function dt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Nn(n,e){return Wt(n)?n:e}function gt(n,e){return typeof n>"u"?e:n}const ov=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Eg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function zt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Tt(n,e,t,i){let s,l,o;if(Ft(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Ni(n,e){return(Bu[e]||(Bu[e]=uv(e)))(n)}function uv(n){const e=fv(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function fv(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function ka(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",Ri=n=>typeof n=="function",Uu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function cv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,Et=2*Ut,dv=Et+Ut,wo=Number.POSITIVE_INFINITY,pv=Ut/180,Bt=Ut/2,js=Ut/4,Wu=Ut*2/3,Vn=Math.log10,ai=Math.sign;function Yu(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Vn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function hv(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)=n}function Pg(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function $a(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const xi=(n,e,t,i)=>$a(n,t,i?s=>n[s][e]<=t:s=>n[s][e]$a(n,t,i=>n[i][e]>=t);function vv(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+ka(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function Zu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Ig.forEach(l=>{delete n[l]}),delete n._chartjs)}function Fg(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function Rg(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,Ng.call(window,()=>{s=!1,n.apply(e,l)}))}}function kv(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const wv=n=>n==="start"?"left":n==="end"?"right":"center",Ju=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Hg(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=un(Math.min(xi(r,o.axis,u).lo,t?i:xi(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=un(Math.max(xi(r,o.axis,f,!0).hi+1,t?0:xi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function jg(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const ql=n=>n===0||n===1,Gu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Et/t)),Xu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Et/t)+1,nl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Bt)+1,easeOutSine:n=>Math.sin(n*Bt),easeInOutSine:n=>-.5*(Math.cos(Ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>ql(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>ql(n)?n:Gu(n,.075,.3),easeOutElastic:n=>ql(n)?n:Xu(n,.075,.3),easeInOutElastic(n){return ql(n)?n:n<.5?.5*Gu(n*2,.1125,.45):.5+.5*Xu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-nl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?nl.easeInBounce(n*2)*.5:nl.easeOutBounce(n*2-1)*.5+.5};/*! - * @kurkle/color v0.2.1 - * https://github.com/kurkle/color#readme - * (c) 2022 Jukka Kurkela - * Released under the MIT License - */function wl(n){return n+.5|0}const Pi=(n,e,t)=>Math.max(Math.min(n,t),e);function Js(n){return Pi(wl(n*2.55),0,255)}function Fi(n){return Pi(wl(n*255),0,255)}function vi(n){return Pi(wl(n/2.55)/100,0,1)}function Qu(n){return Pi(wl(n*100),0,100)}const Fn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ur=[..."0123456789ABCDEF"],$v=n=>Ur[n&15],Sv=n=>Ur[(n&240)>>4]+Ur[n&15],Vl=n=>(n&240)>>4===(n&15),Cv=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Mv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Fn[n[1]]*17,g:255&Fn[n[2]]*17,b:255&Fn[n[3]]*17,a:e===5?Fn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Fn[n[1]]<<4|Fn[n[2]],g:Fn[n[3]]<<4|Fn[n[4]],b:Fn[n[5]]<<4|Fn[n[6]],a:e===9?Fn[n[7]]<<4|Fn[n[8]]:255})),t}const Tv=(n,e)=>n<255?e(n):"";function Dv(n){var e=Cv(n)?$v:Sv;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Tv(n.a,e):void 0}const Ov=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function qg(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function Ev(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function Av(n,e,t){const i=qg(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function Pv(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=Pv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ca(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Fi)}function Ma(n,e,t){return Ca(qg,n,e,t)}function Lv(n,e,t){return Ca(Av,n,e,t)}function Iv(n,e,t){return Ca(Ev,n,e,t)}function Vg(n){return(n%360+360)%360}function Fv(n){const e=Ov.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Js(+e[5]):Fi(+e[5]));const s=Vg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=Lv(s,l,o):e[1]==="hsv"?i=Iv(s,l,o):i=Ma(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Nv(n,e){var t=Sa(n);t[0]=Vg(t[0]+e),t=Ma(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Rv(n){if(!n)return;const e=Sa(n),t=e[0],i=Qu(e[1]),s=Qu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${vi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const xu={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ef={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Hv(){const n={},e=Object.keys(ef),t=Object.keys(xu);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let zl;function jv(n){zl||(zl=Hv(),zl.transparent=[0,0,0,0]);const e=zl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const qv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Vv(n){const e=qv.exec(n);let t=255,i,s,l;if(!!e){if(e[7]!==i){const o=+e[7];t=e[8]?Js(o):Pi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Js(i):Pi(i,0,255)),s=255&(e[4]?Js(s):Pi(s,0,255)),l=255&(e[6]?Js(l):Pi(l,0,255)),{r:i,g:s,b:l,a:t}}}function zv(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${vi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const rr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ms=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Bv(n,e,t){const i=ms(vi(n.r)),s=ms(vi(n.g)),l=ms(vi(n.b));return{r:Fi(rr(i+t*(ms(vi(e.r))-i))),g:Fi(rr(s+t*(ms(vi(e.g))-s))),b:Fi(rr(l+t*(ms(vi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Bl(n,e,t){if(n){let i=Sa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ma(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function zg(n,e){return n&&Object.assign(e||{},n)}function tf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Fi(n[3]))):(e=zg(n,{r:0,g:0,b:0,a:1}),e.a=Fi(e.a)),e}function Uv(n){return n.charAt(0)==="r"?Vv(n):Fv(n)}class $o{constructor(e){if(e instanceof $o)return e;const t=typeof e;let i;t==="object"?i=tf(e):t==="string"&&(i=Mv(e)||jv(e)||Uv(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=zg(this._rgb);return e&&(e.a=vi(e.a)),e}set rgb(e){this._rgb=tf(e)}rgbString(){return this._valid?zv(this._rgb):void 0}hexString(){return this._valid?Dv(this._rgb):void 0}hslString(){return this._valid?Rv(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=Bv(this._rgb,e._rgb,t)),this}clone(){return new $o(this.rgb)}alpha(e){return this._rgb.a=Fi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=wl(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Bl(this._rgb,2,e),this}darken(e){return Bl(this._rgb,2,-e),this}saturate(e){return Bl(this._rgb,1,e),this}desaturate(e){return Bl(this._rgb,1,-e),this}rotate(e){return Nv(this._rgb,e),this}}function Bg(n){return new $o(n)}function Ug(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function nf(n){return Ug(n)?n:Bg(n)}function ar(n){return Ug(n)?n:Bg(n).saturate(.5).darken(.1).hexString()}const os=Object.create(null),Wr=Object.create(null);function il(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>ar(i.backgroundColor),this.hoverBorderColor=(t,i)=>ar(i.borderColor),this.hoverColor=(t,i)=>ar(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return ur(this,e,t)}get(e){return il(this,e)}describe(e,t){return ur(Wr,e,t)}override(e,t){return ur(os,e,t)}route(e,t,i,s){const l=il(this,e),o=il(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return dt(a)?Object.assign({},u,a):gt(a,u)},set(a){this[r]=a}}})}}var _t=new Wv({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Yv(n){return!n||Mt(n.size)||Mt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function So(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function Kv(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function dl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,Xv(n,l),a=0;a+n||0;function Oa(n,e){const t={},i=dt(e),s=i?Object.keys(e):e,l=dt(n)?i?o=>gt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=ny(l(o));return t}function Wg(n){return Oa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return Oa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Yn(n){const e=Wg(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Pn(n,e){n=n||{},e=e||_t.font;let t=gt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=gt(n.style,e.style);i&&!(""+i).match(ey)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:gt(n.family,e.family),lineHeight:ty(gt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:gt(n.weight,e.weight),string:""};return s.string=Yv(s),s}function Ul(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Hi(n,e){return Object.assign(Object.create(n),e)}function Ea(n,e=[""],t=n,i,s=()=>n[0]){Wn(i)||(i=Jg("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ea([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return Kg(o,r,()=>cy(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return of(o).includes(r)},ownKeys(o){return of(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ms(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Yg(n,i),setContext:l=>Ms(n,l,t,i),override:l=>Ms(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return Kg(l,o,()=>ly(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function Yg(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Ri(t)?t:()=>t,isIndexable:Ri(i)?i:()=>i}}const sy=(n,e)=>n?n+ka(e):e,Aa=(n,e)=>dt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Kg(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function ly(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Ri(r)&&o.isScriptable(e)&&(r=oy(e,r,n,t)),Ft(r)&&r.length&&(r=ry(e,r,n,o.isIndexable)),Aa(e,r)&&(r=Ms(r,s,l&&l[e],o)),r}function oy(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Aa(n,e)&&(e=Pa(s._scopes,s,n,e)),e}function ry(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Wn(l.index)&&i(n))e=e[l.index%e.length];else if(dt(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Pa(u,s,n,f);e.push(Ms(c,l,o&&o[n],r))}}return e}function Zg(n,e,t){return Ri(n)?n(e,t):n}const ay=(n,e)=>n===!0?e:typeof n=="string"?Ni(e,n):void 0;function uy(n,e,t,i,s){for(const l of e){const o=ay(t,l);if(o){n.add(o);const r=Zg(o._fallback,t,s);if(Wn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Wn(i)&&t!==i)return null}return!1}function Pa(n,e,t,i){const s=e._rootScopes,l=Zg(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=lf(r,o,t,l||t,i);return a===null||Wn(l)&&l!==t&&(a=lf(r,o,l,a,i),a===null)?!1:Ea(Array.from(r),[""],s,l,()=>fy(e,t,i))}function lf(n,e,t,i,s){for(;t;)t=uy(n,e,t,i,s);return t}function fy(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Ft(s)&&dt(t)?t:s}function cy(n,e,t,i){let s;for(const l of e)if(s=Jg(sy(l,n),t),Wn(s))return Aa(n,s)?Pa(t,i,n,s):s}function Jg(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Wn(i))return i}}function of(n){let e=n._keys;return e||(e=n._keys=dy(n._scopes)),e}function dy(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function Gg(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function hy(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Br(l,s),a=Br(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function my(n,e,t){const i=n.length;let s,l,o,r,a,u=Ts(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")_y(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function yy(n,e){return Wo(n).getPropertyValue(e)}const ky=["top","right","bottom","left"];function ss(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=ky[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const wy=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function $y(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(wy(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Ji(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Wo(t),l=s.boxSizing==="border-box",o=ss(s,"padding"),r=ss(s,"border","width"),{x:a,y:u,box:f}=$y(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:m}=e;return l&&(h-=o.width+r.width,m-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/m*t.height/i)}}function Sy(n,e,t){let i,s;if(e===void 0||t===void 0){const l=La(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Wo(l),a=ss(r,"border","width"),u=ss(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=To(r.maxWidth,l,"clientWidth"),s=To(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||wo,maxHeight:s||wo}}const fr=n=>Math.round(n*10)/10;function Cy(n,e,t,i){const s=Wo(n),l=ss(s,"margin"),o=To(s.maxWidth,n,"clientWidth")||wo,r=To(s.maxHeight,n,"clientHeight")||wo,a=Sy(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=ss(s,"border","width"),d=ss(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=fr(Math.min(u,o,a.maxWidth)),f=fr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=fr(u/2)),{width:u,height:f}}function rf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const My=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function af(n,e){const t=yy(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Gi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Ty(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Dy(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Gi(n,s,t),r=Gi(s,l,t),a=Gi(l,e,t),u=Gi(o,r,t),f=Gi(r,a,t);return Gi(u,f,t)}const uf=new Map;function Oy(n,e){e=e||{};const t=n+JSON.stringify(e);let i=uf.get(t);return i||(i=new Intl.NumberFormat(n,e),uf.set(t,i)),i}function $l(n,e,t){return Oy(e,t).format(n)}const Ey=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Ay=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function cr(n,e,t){return n?Ey(e,t):Ay()}function Py(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Ly(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function xg(n){return n==="angle"?{between:fl,compare:gv,normalize:An}:{between:cl,compare:(e,t)=>e-t,normalize:e=>e}}function ff({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Iy(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=xg(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;da(s,C,y)&&r(s,C)!==0,M=()=>r(l,y)===0||a(l,C,y),D=()=>v||$(),O=()=>!v||M();for(let A=f,I=f;A<=c;++A)S=e[A%o],!S.skip&&(y=u(S[i]),y!==C&&(v=a(y,s,l),b===null&&D()&&(b=r(y,s)===0?A:I),b!==null&&O()&&(m.push(ff({start:b,end:A,loop:d,count:o,style:h})),b=null),I=A,C=y));return b!==null&&m.push(ff({start:b,end:c,loop:d,count:o,style:h})),m}function t_(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function Ny(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function Ry(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Fy(t,s,l,i);if(i===!0)return cf(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Ng.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var _i=new qy;const pf="transparent",Vy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=nf(n||pf),s=i.valid&&nf(e||pf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class zy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||Vy[e.type||typeof o],this._easing=nl[e.easing]||nl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Ul([e.to,t,s,e.from]),this._from=Ul([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});_t.set("animations",{colors:{type:"color",properties:Uy},numbers:{type:"number",properties:By}});_t.describe("animations",{_fallback:"animation"});_t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class n_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!dt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!dt(s))return;const l={};for(const o of Wy)l[o]=s[o];(Ft(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Ky(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Yy(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new zy(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return _i.add(this._chart,i),!0}}function Yy(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function bf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=Xy(l,o,i),c=e.length;let d;for(let h=0;ht[i].axis===e).shift()}function ek(n,e){return Hi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function tk(n,e,t){return Hi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function qs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const pr=n=>n==="reset"||n==="none",vf=(n,e)=>e?n:Object.assign({},n),nk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:i_(t,!0),values:null};class si{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=gf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&qs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,m)=>c==="x"?d:c==="r"?m:h,l=t.xAxisID=gt(i.xAxisID,dr(e,"x")),o=t.yAxisID=gt(i.yAxisID,dr(e,"y")),r=t.rAxisID=gt(i.rAxisID,dr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Zu(this._data,this),e._stacked&&qs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(dt(t))this._data=Gy(t);else if(i!==t){if(i){Zu(i,this);const s=this._cachedMeta;qs(s),s._parsed=[]}t&&Object.isExtensible(t)&&yv(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=gf(t.vScale,t),t.stack!==i.stack&&(s=!0,qs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&bf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{Ft(s[e])?d=this.parseArrayData(i,s,e,t):dt(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]v||c=0;--d)if(!m()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),v=u.resolveNamedOptions(d,h,m,c);return v.$shared&&(v.$shared=a,l[o]=Object.freeze(vf(v,a))),v}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new n_(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||pr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){pr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!pr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function sk(n){const e=n.iScale,t=ik(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Wn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function s_(n,e,t,i){return Ft(n)?rk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function yf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function uk(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(Mt(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;dfl(C,r,a,!0)?1:Math.max($,$*t,M,M*t),m=(C,$,M)=>fl(C,r,a,!0)?-1:Math.min($,$*t,M,M*t),v=h(0,u,c),b=h(Bt,f,d),y=m(Ut,u,c),S=m(Ut+Bt,f,d);i=(v-y)/2,s=(b-S)/2,l=-(v+y)/2,o=-(b+S)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Sl extends si{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(dt(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ni(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?Et*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Sl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return Ft(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Yo extends si{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Hg(t,s,o);this._drawStart=r,this._drawCount=a,jg(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:m,segment:v}=this.options,b=Cs(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let S=t>0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs(M[d]-S[d])>b,v&&(D.parsed=M,D.raw=u.data[C]),c&&(D.options=f||this.resolveDataElementOptions(C,$.active?"active":s)),y||this.updateElement($,C,D,s),S=M}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Yo.id="line";Yo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Na extends si{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return Gg.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Ut;let h=d,m;const v=360/this.countVisibleElements();for(m=0;m{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Qn(this.resolveDataElementOptions(e,t).angle||i):0}}Na.id="polarArea";Na.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Na.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class l_ extends Sl{}l_.id="pie";l_.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ra extends si{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return Gg.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}Ci.defaults={};Ci.defaultRoutes=void 0;const o_={values(n){return Ft(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=hk(n,t)}const o=Vn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),$l(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Vn(n)));return i===1||i===2||i===5?o_.numeric.call(this,n,e,t):""}};function hk(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Ko={formatters:o_};_t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ko.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});_t.route("scale.ticks","color","","color");_t.route("scale.grid","color","","borderColor");_t.route("scale.grid","borderColor","","borderColor");_t.route("scale.title","color","","color");_t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});_t.describe("scales",{_fallback:"scale"});_t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function mk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||gk(n),s=t.major.enabled?bk(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return vk(e,a,s,l/i),a;const u=_k(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Yl(e,a,u,Mt(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function bk(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,$f=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Sf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function $k(n,e){Tt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Nn(t,Nn(i,t)),max:Nn(i,Nn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){zt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=iy(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,h=un(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Vs(e.grid)-t.padding-Cf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=wa(Math.min(Math.asin(un((f.highest.height+6)/r,-1,1)),Math.asin(un(a/u,-1,1))-Math.asin(un(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){zt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){zt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Cf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Vs(l)+a):(e.height=this.maxHeight,e.width=Vs(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,m=Qn(this.labelRotation),v=Math.cos(m),b=Math.sin(m);if(r){const y=i.mirror?0:b*c.width+v*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:v*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,b,v)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){zt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[O]||0,height:o[O]||0});return{first:D(0),last:D(t-1),widest:D($),highest:D(M),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return _v(this._alignToPixels?Wi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Vs(l),d=[],h=l.setContext(this.getContext()),m=h.drawBorder?h.borderWidth:0,v=m/2,b=function(H){return Wi(i,H,m)};let y,S,C,$,M,D,O,A,I,L,R,B;if(o==="top")y=b(this.bottom),D=this.bottom-c,A=y-v,L=b(e.top)+v,B=e.bottom;else if(o==="bottom")y=b(this.top),L=e.top,B=b(e.bottom)-v,D=y+v,A=this.top+c;else if(o==="left")y=b(this.right),M=this.right-c,O=y-v,I=b(e.left)+v,R=e.right;else if(o==="right")y=b(this.left),I=e.left,R=b(e.right)-v,M=y+v,O=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(dt(o)){const H=Object.keys(o)[0],X=o[H];y=b(this.chart.scales[H].getPixelForValue(X))}L=e.top,B=e.bottom,D=y+v,A=D+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(dt(o)){const H=Object.keys(o)[0],X=o[H];y=b(this.chart.scales[H].getPixelForValue(X))}M=y-v,O=M-c,I=e.left,R=e.right}const K=gt(s.ticks.maxTicksLimit,f),J=Math.max(1,Math.ceil(f/K));for(S=0;Sl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");_t.route(l,s,a,r)})}function Ek(n){return"id"in n&&"defaults"in n}class Ak{constructor(){this.controllers=new Kl(si,"datasets",!0),this.elements=new Kl(Ci,"elements"),this.plugins=new Kl(Object,"plugins"),this.scales=new Kl(us,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):Tt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=ka(e);zt(i["before"+s],[],i),t[e](i),zt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let $=t;$0&&Math.abs(D[h]-C[h])>y,b&&(O.parsed=D,O.raw=u.data[$]),d&&(O.options=c||this.resolveDataElementOptions($,M.active?"active":s)),S||this.updateElement(M,$,O,s),C=D}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Ha.id="scatter";Ha.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ha.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Yi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Kr{constructor(e){this.options=e||{}}init(e){}formats(){return Yi()}parse(e,t){return Yi()}format(e,t){return Yi()}add(e,t,i){return Yi()}diff(e,t,i){return Yi()}startOf(e,t,i){return Yi()}endOf(e,t){return Yi()}}Kr.override=function(n){Object.assign(Kr.prototype,n)};var r_={_date:Kr};function Pk(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?bv:xi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Cl(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var Nk={evaluateInteractionItems:Cl,modes:{index(n,e,t,i){const s=Ji(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?mr(n,s,l,i,o):gr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Ji(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?mr(n,s,l,i,o):gr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Tf(n,e){return n.filter(t=>a_.indexOf(t.pos)===-1&&t.box.axis===e)}function Bs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function Rk(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Bs(zs(e,"left"),!0),s=Bs(zs(e,"right")),l=Bs(zs(e,"top"),!0),o=Bs(zs(e,"bottom")),r=Tf(e,"x"),a=Tf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:zs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Df(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function u_(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function Vk(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!dt(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&u_(o,l.getPadding());const r=Math.max(0,e.outerWidth-Df(o,n,"left","right")),a=Math.max(0,e.outerHeight-Df(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function zk(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function Bk(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Gs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof v.beforeLayout=="function"&&v.beforeLayout()});const f=a.reduce((v,b)=>b.box.options&&b.box.options.display===!1?v:v+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);u_(d,Yn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),m=jk(a.concat(u),c);Gs(r.fullSize,h,c,m),Gs(a,h,c,m),Gs(u,h,c,m)&&Gs(a,h,c,m),zk(h),Of(r.leftAndTop,h,c,m),h.x+=h.w,h.y+=h.h,Of(r.rightAndBottom,h,c,m),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Tt(r.chartArea,v=>{const b=v.box;Object.assign(b,n.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class f_{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Uk extends f_{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ro="$chartjs",Wk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ef=n=>n===null||n==="";function Yk(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ro]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Ef(s)){const l=af(n,"width");l!==void 0&&(n.width=l)}if(Ef(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=af(n,"height");l!==void 0&&(n.height=l)}return n}const c_=My?{passive:!0}:!1;function Kk(n,e,t){n.addEventListener(e,t,c_)}function Zk(n,e,t){n.canvas.removeEventListener(e,t,c_)}function Jk(n,e){const t=Wk[n.type]||n.type,{x:i,y:s}=Ji(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Do(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function Gk(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.addedNodes,i),o=o&&!Do(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function Xk(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.removedNodes,i),o=o&&!Do(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const pl=new Map;let Af=0;function d_(){const n=window.devicePixelRatio;n!==Af&&(Af=n,pl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function Qk(n,e){pl.size||window.addEventListener("resize",d_),pl.set(n,e)}function xk(n){pl.delete(n),pl.size||window.removeEventListener("resize",d_)}function e2(n,e,t){const i=n.canvas,s=i&&La(i);if(!s)return;const l=Rg((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),Qk(n,l),o}function _r(n,e,t){t&&t.disconnect(),e==="resize"&&xk(n)}function t2(n,e,t){const i=n.canvas,s=Rg(l=>{n.ctx!==null&&t(Jk(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return Kk(i,e,s),s}class n2 extends f_{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Yk(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ro])return!1;const i=t[ro].initial;["height","width"].forEach(l=>{const o=i[l];Mt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[ro],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:Gk,detach:Xk,resize:e2}[t]||t2;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:_r,detach:_r,resize:_r}[t]||Zk)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Cy(e,t,i,s)}isAttached(e){const t=La(e);return!!(t&&t.isConnected)}}function i2(n){return!Qg()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Uk:n2}class s2{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(zt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=gt(i.options&&i.options.plugins,{}),l=l2(i);return s===!1&&!t?[]:r2(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function l2(n){const e={},t=[],i=Object.keys(ri.plugins.items);for(let l=0;l{const a=i[r];if(!dt(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=Jr(r,a),f=f2(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=el(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||Zr(a,e),c=(os[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=u2(d,u),m=r[h+"AxisID"]||l[h]||h;o[m]=o[m]||Object.create(null),el(o[m],[{axis:h},i[m],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];el(a,[_t.scales[a.type],_t.scale])}),o}function p_(n){const e=n.options||(n.options={});e.plugins=gt(e.plugins,{}),e.scales=d2(n,e)}function h_(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function p2(n){return n=n||{},n.data=h_(n.data),p_(n),n}const Pf=new Map,m_=new Set;function Gl(n,e){let t=Pf.get(n);return t||(t=e(),Pf.set(n,t),m_.add(t)),t}const Us=(n,e,t)=>{const i=Ni(e,t);i!==void 0&&n.add(i)};class h2{constructor(e){this._config=p2(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=h_(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),p_(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gl(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Us(a,e,c))),f.forEach(c=>Us(a,s,c)),f.forEach(c=>Us(a,os[l]||{},c)),f.forEach(c=>Us(a,_t,c)),f.forEach(c=>Us(a,Wr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),m_.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,os[t]||{},_t.datasets[t]||{},{type:t},_t,Wr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Lf(this._resolverCache,e,s);let a=o;if(g2(o,t)){l.$shared=!1,i=Ri(i)?i():i;const u=this.createResolver(e,i,r);a=Ms(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Lf(this._resolverCache,e,i);return dt(t)?Ms(l,t,void 0,s):l}}function Lf(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Ea(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const m2=n=>dt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Ri(n[t]),!1);function g2(n,e){const{isScriptable:t,isIndexable:i}=Yg(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Ri(r)||m2(r))||o&&Ft(r))return!0}return!1}var _2="3.9.1";const b2=["top","bottom","left","right","chartArea"];function If(n,e){return n==="top"||n==="bottom"||b2.indexOf(n)===-1&&e==="x"}function Ff(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Nf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),zt(t&&t.onComplete,[n],e)}function v2(n){const e=n.chart,t=e.options.animation;zt(t&&t.onProgress,[n],e)}function g_(n){return Qg()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Oo={},__=n=>{const e=g_(n);return Object.values(Oo).filter(t=>t.canvas===e).pop()};function y2(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function k2(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Eo{constructor(e,t){const i=this.config=new h2(t),s=g_(e),l=__(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||i2(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=lv(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new s2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=kv(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Oo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}_i.listen(this,"complete",Nf),_i.listen(this,"progress",v2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Mt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return sf(this.canvas,this.ctx),this}stop(){return _i.stop(this),this}resize(e,t){_i.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),zt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Tt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=Jr(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Tt(l,o=>{const r=o.options,a=r.id,u=Jr(a,r),f=gt(r.type,o.dtype);(r.position===void 0||If(r.position,u)!==If(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ri.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),Tt(s,(o,r)=>{o||delete i[r]}),Tt(i,o=>{Jl.configure(this,o,o.options),Jl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Ff("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Tt(this.scales,e=>{Jl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Uu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;y2(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Jl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Tt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ta(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Da(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return dl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Nk.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Hi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Wn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),_i.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};Tt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){Tt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Tt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!yo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=cv(e),u=k2(e,this._lastEvent,i,a);i&&(this._lastEvent=null,zt(l.onHover,[e,r,this],this),a&&zt(l.onClick,[e,r,this],this));const f=!yo(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const Rf=()=>Tt(Eo.instances,n=>n._plugins.invalidate()),Di=!0;Object.defineProperties(Eo,{defaults:{enumerable:Di,value:_t},instances:{enumerable:Di,value:Oo},overrides:{enumerable:Di,value:os},registry:{enumerable:Di,value:ri},version:{enumerable:Di,value:_2},getChart:{enumerable:Di,value:__},register:{enumerable:Di,value:(...n)=>{ri.add(...n),Rf()}},unregister:{enumerable:Di,value:(...n)=>{ri.remove(...n),Rf()}}});function b_(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+Bt,i-Bt),n.closePath(),n.clip()}function w2(n){return Oa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function $2(n,e,t,i){const s=w2(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return un(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:un(s.innerStart,0,o),innerEnd:un(s.innerEnd,0,o)}}function gs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Gr(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const m=s-a;if(i){const H=f>0?f-i:0,X=c>0?c-i:0,W=(H+X)/2,te=W!==0?m*W/(W+i):m;h=(m-te)/2}const v=Math.max(.001,m*c-t/Ut)/c,b=(m-v)/2,y=a+b+h,S=s-b-h,{outerStart:C,outerEnd:$,innerStart:M,innerEnd:D}=$2(e,d,c,S-y),O=c-C,A=c-$,I=y+C/O,L=S-$/A,R=d+M,B=d+D,K=y+M/R,J=S-D/B;if(n.beginPath(),l){if(n.arc(o,r,c,I,L),$>0){const W=gs(A,L,o,r);n.arc(W.x,W.y,$,L,S+Bt)}const H=gs(B,S,o,r);if(n.lineTo(H.x,H.y),D>0){const W=gs(B,J,o,r);n.arc(W.x,W.y,D,S+Bt,J+Math.PI)}if(n.arc(o,r,d,S-D/d,y+M/d,!0),M>0){const W=gs(R,K,o,r);n.arc(W.x,W.y,M,K+Math.PI,y-Bt)}const X=gs(O,y,o,r);if(n.lineTo(X.x,X.y),C>0){const W=gs(O,I,o,r);n.arc(W.x,W.y,C,y-Bt,I)}}else{n.moveTo(o,r);const H=Math.cos(I)*c+o,X=Math.sin(I)*c+r;n.lineTo(H,X);const W=Math.cos(L)*c+o,te=Math.sin(L)*c+r;n.lineTo(W,te)}n.closePath()}function S2(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){Gr(n,e,t,i,o+Et,s);for(let u=0;u=Et||fl(l,r,a),v=cl(o,u+d,f+d);return m&&v}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>Et?Math.floor(i/Et):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Ut&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=S2(e,this,r,l,o);M2(e,this,r,l,a,o),e.restore()}}ja.id="arc";ja.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};ja.defaultRoutes={backgroundColor:"backgroundColor"};function v_(n,e,t=e){n.lineCap=gt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(gt(t.borderDash,e.borderDash)),n.lineDashOffset=gt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=gt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=gt(t.borderWidth,e.borderWidth),n.strokeStyle=gt(t.borderColor,e.borderColor)}function T2(n,e,t){n.lineTo(t.x,t.y)}function D2(n){return n.stepped?Jv:n.tension||n.cubicInterpolationMode==="monotone"?Gv:T2}function y_(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-$:$))%l,C=()=>{v!==b&&(n.lineTo(f,b),n.lineTo(f,v),n.lineTo(f,y))};for(a&&(h=s[S(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[S(d)],h.skip)continue;const $=h.x,M=h.y,D=$|0;D===m?(Mb&&(b=M),f=(c*f+$)/++c):(C(),n.lineTo($,M),m=D,c=0,v=b=M),y=M}C()}function Xr(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?E2:O2}function A2(n){return n.stepped?Ty:n.tension||n.cubicInterpolationMode==="monotone"?Dy:Gi}function P2(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),v_(n,e.options),n.stroke(s)}function L2(n,e,t,i){const{segments:s,options:l}=e,o=Xr(e);for(const r of s)v_(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const I2=typeof Path2D=="function";function F2(n,e,t,i){I2&&!e.options.segment?P2(n,e,t,i):L2(n,e,t,i)}class ji extends Ci{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;vy(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ry(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=t_(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=A2(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function Hf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Va(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function Va(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function jf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function w_(n,e){let t=[],i=!1;return Ft(n)?(i=!0,t=n):t=z2(n,e),t.length?new ji({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function qf(n){return n&&n.fill!==!1}function B2(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Wt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function U2(n,e,t){const i=Z2(n);if(dt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Wt(s)&&Math.floor(s)===s?W2(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function W2(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function Y2(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:dt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function K2(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:dt(n)?i=n.value:i=e.getBaseValue(),i}function Z2(n){const e=n.options,t=e.fill;let i=gt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function J2(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=G2(e,t);r.push(w_({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;!r||(r.line.updateControlPoints(l,r.axis),i&&r.fill&&yr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;qf(l)&&yr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!qf(i)||t.drawTime!=="beforeDatasetDraw"||yr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const sl={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function rw(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function Uf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Pn(e.bodyFont),u=Pn(e.titleFont),f=Pn(e.footerFont),c=l.length,d=s.length,h=i.length,m=Yn(e.padding);let v=m.height,b=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function($){b=Math.max(b,t.measureText($).width+S)};return t.save(),t.font=u.string,Tt(n.title,C),t.font=a.string,Tt(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,Tt(i,$=>{Tt($.before,C),Tt($.lines,C),Tt($.after,C)}),S=0,t.font=f.string,Tt(n.footer,C),t.restore(),b+=m.width,{width:b,height:v}}function aw(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function uw(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function fw(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),uw(u,n,e,t)&&(u="center"),u}function Wf(n,e,t){const i=t.yAlign||e.yAlign||aw(n,t);return{xAlign:t.xAlign||e.xAlign||fw(n,e,t,i),yAlign:i}}function cw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function dw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Yf(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=ys(o);let m=cw(e,r);const v=dw(e,a,u);return a==="center"?r==="left"?m+=u:r==="right"&&(m-=u):r==="left"?m-=Math.max(f,d)+s:r==="right"&&(m+=Math.max(c,h)+s),{x:un(m,0,i.width-e.width),y:un(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Kf(n){return li([],bi(n))}function pw(n,e,t){return Hi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Zf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class xr extends Ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new n_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=pw(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=li(r,bi(s)),r=li(r,bi(l)),r=li(r,bi(o)),r}getBeforeBody(e,t){return Kf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Tt(e,l=>{const o={before:[],lines:[],after:[]},r=Zf(i,l);li(o.before,bi(r.beforeLabel.call(this,l))),li(o.lines,r.label.call(this,l)),li(o.after,bi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return Kf(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=li(r,bi(s)),r=li(r,bi(l)),r=li(r,bi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),Tt(r,f=>{const c=Zf(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=sl[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Uf(this,i),u=Object.assign({},r,a),f=Wf(this.chart,i,u),c=Yf(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=ys(r),{x:d,y:h}=e,{width:m,height:v}=t;let b,y,S,C,$,M;return l==="center"?($=h+v/2,s==="left"?(b=d,y=b-o,C=$+o,M=$-o):(b=d+m,y=b+o,C=$-o,M=$+o),S=b):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+m-Math.max(u,c)-o:y=this.caretX,l==="top"?(C=h,$=C-o,b=y-o,S=y+o):(C=h+v,$=C+o,b=y+o,S=y-o),M=C),{x1:b,x2:y,x3:S,y1:C,y2:$,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=cr(i.rtl,this.x,this.width);for(e.x=Xl(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Pn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aC!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Mo(e,{x:b,y:v,w:u,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Mo(e,{x:y,y:v+1,w:u-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,v,u,a),e.strokeRect(b,v,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,v+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Pn(i.bodyFont);let d=c.lineHeight,h=0;const m=cr(i.rtl,this.x,this.width),v=function(A){t.fillText(A,m.x(e.x+h),e.y+d/2),e.y+=d+l},b=m.textAlign(o);let y,S,C,$,M,D,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xl(this,b,i),t.fillStyle=i.bodyColor,Tt(this.beforeBody,v),h=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,D=s.length;$0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=sl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Uf(this,e),a=Object.assign({},o,this._size),u=Wf(t,e,a),f=Yf(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Yn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),Py(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),Ly(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!yo(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!yo(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=sl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}xr.positioners=sl;var hw={id:"tooltip",_element:xr,positioners:sl,afterInit(n,e,t){t&&(n.tooltip=new xr({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:gi,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const mw=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function gw(n,e,t,i){const s=n.indexOf(e);if(s===-1)return mw(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const _w=(n,e)=>n===null?null:un(Math.round(n),0,e);class ea extends us{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(Mt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:gw(i,e,gt(t,e),this._addedLabels),_w(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}ea.id="category";ea.defaults={ticks:{callback:ea.prototype.getLabelForValue}};function bw(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,m=f-1,{min:v,max:b}=e,y=!Mt(o),S=!Mt(r),C=!Mt(u),$=(b-v)/(c+1);let M=Yu((b-v)/m/h)*h,D,O,A,I;if(M<1e-14&&!y&&!S)return[{value:v},{value:b}];I=Math.ceil(b/M)-Math.floor(v/M),I>m&&(M=Yu(I*M/m/h)*h),Mt(a)||(D=Math.pow(10,a),M=Math.ceil(M*D)/D),s==="ticks"?(O=Math.floor(v/M)*M,A=Math.ceil(b/M)*M):(O=v,A=b),y&&S&&l&&mv((r-o)/l,M/1e3)?(I=Math.round(Math.min((r-o)/M,f)),M=(r-o)/I,O=o,A=r):C?(O=y?o:O,A=S?r:A,I=u-1,M=(A-O)/I):(I=(A-O)/M,tl(I,Math.round(I),M/1e3)?I=Math.round(I):I=Math.ceil(I));const L=Math.max(Ku(M),Ku(O));D=Math.pow(10,Mt(a)?L:a),O=Math.round(O*D)/D,A=Math.round(A*D)/D;let R=0;for(y&&(d&&O!==o?(t.push({value:o}),Os=t?s:a,r=a=>l=i?l:a;if(e){const a=ai(s),u=ai(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=bw(s,l);return e.bounds==="ticks"&&Pg(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return $l(e,this.chart.options.locale,this.options.ticks.format)}}class za extends Ao{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Wt(e)?e:0,this.max=Wt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Qn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}za.id="linear";za.defaults={ticks:{callback:Ko.formatters.numeric}};function Gf(n){return n/Math.pow(10,Math.floor(Vn(n)))===1}function vw(n,e){const t=Math.floor(Vn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Nn(n.min,Math.pow(10,Math.floor(Vn(e.min)))),o=Math.floor(Vn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:Gf(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Wt(e)?Math.max(0,e):null,this.max=Wt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(Vn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=vw(t,this);return e.bounds==="ticks"&&Pg(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":$l(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Vn(e),this._valueRange=Vn(this.max)-Vn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Vn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}S_.id="logarithmic";S_.defaults={ticks:{callback:Ko.formatters.logarithmic,major:{enabled:!0}}};function ta(n){const e=n.ticks;if(e.display&&n.display){const t=Yn(e.backdropPadding);return gt(e.font&&e.font.size,_t.font.size)+t.height}return 0}function yw(n,e,t){return t=Ft(t)?t:[t],{w:Kv(n,e.string,t),h:t.length*e.lineHeight}}function Xf(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function kw(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Ut/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function $w(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ta(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Ut/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function Tw(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=Pn(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:m}=l;if(!Mt(m)){const v=ys(l.borderRadius),b=Yn(l.backdropPadding);t.fillStyle=m;const y=f-b.left,S=c-b.top,C=d-f+b.width,$=h-c+b.height;Object.values(v).some(M=>M!==0)?(t.beginPath(),Mo(t,{x:y,y:S,w:C,h:$,radius:v}),t.fill()):t.fillRect(y,S,C,$)}Co(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function C_(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,Et);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=zt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?kw(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=Et/(this._pointLabels.length||1),i=this.options.startAngle||0;return An(e*t+Qn(i))}getDistanceFromCenterForValue(e){if(Mt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(Mt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));Dw(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=Pn(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Yn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Co(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Jo.id="radialLinear";Jo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ko.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Jo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Jo.descriptors={angleLines:{_fallback:"grid"}};const Go={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},yn=Object.keys(Go);function Ew(n,e){return n-e}function Qf(n,e){if(Mt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Wt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Cs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function xf(n,e,t,i){const s=yn.length;for(let l=yn.indexOf(n);l=yn.indexOf(t);l--){const o=yn[l];if(Go[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return yn[t?yn.indexOf(t):0]}function Pw(n){for(let e=yn.indexOf(n)+1,t=yn.length;e=e?t[i]:t[s];n[l]=!0}}function Lw(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function tc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=un(t,0,o),i=un(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||xf(l.minUnit,t,i,this._getLabelCapacity(t)),r=gt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Cs(a)||a===!0,f={};let c=t,d,h;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;dv-b).map(v=>+v)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),m=l.ticks.callback;return m?zt(m,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=xi(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=xi(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class M_ extends Ml{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Ql(t,this.min),this._tableRange=Ql(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{t||(t=rt(e,Un,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=rt(e,Un,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function Fw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=F(n[1]),t=T(),s=F(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Nw(n){let e;return{c(){e=F("Loading...")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Rw(n){let e,t,i,s,l,o=n[2]&&nc();function r(f,c){return f[2]?Nw:Fw}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Ga(i,"height","250px"),Ga(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ie(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&E(o,1):(o=nc(),o.c(),E(o,1),o.m(e,t)):o&&(Pe(),P(o,1,1,()=>{o=null}),Le()),c&4&&ie(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){E(o)},o(f){P(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function Hw(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),be.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let m of h)r.push({x:U.getDateTime(m.date).toLocal().toJSDate(),y:m.total}),t(1,a+=m.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),be.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zn(()=>(Eo.register(ji,Zo,Yo,za,Ml,ow,hw),t(6,o=new Eo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){he[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class jw extends Ee{constructor(e){super(),Oe(this,e,Hw,Rw,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var ic=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},T_={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** - * Prism: Lightweight, robust, elegant syntax highlighting - * - * @license MIT - * @author Lea Verou - * @namespace - * @public - */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var $ in C)if(C[$].src==S)return C[$]}return null}},isActive:function(S,C,$){for(var M="no-"+C;S;){var D=S.classList;if(D.contains(C))return!0;if(D.contains(M))return!1;S=S.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,C){var $=r.util.clone(r.languages[S]);for(var M in C)$[M]=C[M];return $},insertBefore:function(S,C,$,M){M=M||r.languages;var D=M[S],O={};for(var A in D)if(D.hasOwnProperty(A)){if(A==C)for(var I in $)$.hasOwnProperty(I)&&(O[I]=$[I]);$.hasOwnProperty(A)||(O[A]=D[A])}var L=M[S];return M[S]=O,r.languages.DFS(r.languages,function(R,B){B===L&&R!=S&&(this[R]=O)}),O},DFS:function S(C,$,M,D){D=D||{};var O=r.util.objId;for(var A in C)if(C.hasOwnProperty(A)){$.call(C,A,C[A],M||A);var I=C[A],L=r.util.type(I);L==="Object"&&!D[O(I)]?(D[O(I)]=!0,S(I,$,null,D)):L==="Array"&&!D[O(I)]&&(D[O(I)]=!0,S(I,$,A,D))}}},plugins:{},highlightAll:function(S,C){r.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,$){var M={callback:$,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var D=0,O;O=M.elements[D++];)r.highlightElement(O,C===!0,M.callback)},highlightElement:function(S,C,$){var M=r.util.getLanguage(S),D=r.languages[M];r.util.setLanguage(S,M);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var A=S.textContent,I={element:S,language:M,grammar:D,code:A};function L(B){I.highlightedCode=B,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),$&&$.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),$&&$.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if(C&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(B){L(B.data)},R.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,C,$){var M={code:S,grammar:C,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(S,C){var $=C.rest;if($){for(var M in $)C[M]=$[M];delete C.rest}var D=new c;return d(D,D.head,S),f(S,D,C,D.head,0),m(D)},hooks:{all:{},add:function(S,C){var $=r.hooks.all;$[S]=$[S]||[],$[S].push(C)},run:function(S,C){var $=r.hooks.all[S];if(!(!$||!$.length))for(var M=0,D;D=$[M++];)D(C)}},Token:a};i.Prism=r;function a(S,C,$,M){this.type=S,this.content=C,this.alias=$,this.length=(M||"").length|0}a.stringify=function S(C,$){if(typeof C=="string")return C;if(Array.isArray(C)){var M="";return C.forEach(function(L){M+=S(L,$)}),M}var D={type:C.type,content:S(C.content,$),tag:"span",classes:["token",C.type],attributes:{},language:$},O=C.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(D.classes,O):D.classes.push(O)),r.hooks.run("wrap",D);var A="";for(var I in D.attributes)A+=" "+I+'="'+(D.attributes[I]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+A+">"+D.content+""};function u(S,C,$,M){S.lastIndex=C;var D=S.exec($);if(D&&M&&D[1]){var O=D[1].length;D.index+=O,D[0]=D[0].slice(O)}return D}function f(S,C,$,M,D,O){for(var A in $)if(!(!$.hasOwnProperty(A)||!$[A])){var I=$[A];I=Array.isArray(I)?I:[I];for(var L=0;L=O.reach);x+=te.value.length,te=te.next){var oe=te.value;if(C.length>S.length)return;if(!(oe instanceof a)){var me=1,se;if(J){if(se=u(W,x,S,K),!se||se.index>=S.length)break;var ve=se.index,ge=se.index+se[0].length,ke=x;for(ke+=te.value.length;ve>=ke;)te=te.next,ke+=te.value.length;if(ke-=te.value.length,x=ke,te.value instanceof a)continue;for(var Y=te;Y!==C.tail&&(keO.reach&&(O.reach=je);var Ue=te.prev;Q&&(Ue=d(C,Ue,Q),x+=Q.length),h(C,Ue,me);var Z=new a(A,B?r.tokenize(ee,B):ee,H,ee);if(te=d(C,Ue,Z),Se&&d(C,te,Se),me>1){var pe={cause:A+","+L,reach:je};f(S,C,$,te.prev,x,pe),O&&pe.reach>O.reach&&(O.reach=pe.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},C={value:null,prev:S,next:null};S.next=C,this.head=S,this.tail=C,this.length=0}function d(S,C,$){var M=C.next,D={value:$,prev:C,next:M};return C.next=D,M.prev=D,S.length++,D}function h(S,C,$){for(var M=C.next,D=0;D<$&&M!==S.tail;D++)M=M.next;C.next=M,M.prev=C,S.length-=D}function m(S){for(var C=[],$=S.head.next;$!==S.tail;)C.push($.value),$=$.next;return C}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(S){var C=JSON.parse(S.data),$=C.language,M=C.code,D=C.immediateClose;i.postMessage(r.highlight(M,r.languages[$],$)),D&&i.close()},!1)),r;var v=r.util.currentScript();v&&(r.filename=v.src,v.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof ic<"u"&&(ic.Prism=t),t.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading\u2026",s=function(v,b){return"\u2716 Error "+v+" while fetching file: "+b},l="\u2716 Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(v,b,y){var S=new XMLHttpRequest;S.open("GET",v,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?b(S.responseText):S.status>=400?y(s(S.status,S.statusText)):y(l))},S.send(null)}function h(v){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(b){var y=Number(b[1]),S=b[2],C=b[3];return S?C?[y,Number(C)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(v){v.selector+=", "+c}),t.hooks.add("before-sanity-check",function(v){var b=v.element;if(b.matches(c)){v.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var S=b.getAttribute("data-src"),C=v.language;if(C==="none"){var $=(/\.(\w+)$/.exec(S)||[,"none"])[1];C=o[$]||$}t.util.setLanguage(y,C),t.util.setLanguage(b,C);var M=t.plugins.autoloader;M&&M.loadLanguages(C),d(S,function(D){b.setAttribute(r,u);var O=h(b.getAttribute("data-range"));if(O){var A=D.split(/\r\n?|\n/g),I=O[0],L=O[1]==null?A.length:O[1];I<0&&(I+=A.length),I=Math.max(0,Math.min(I-1,A.length)),L<0&&(L+=A.length),L=Math.max(0,Math.min(L,A.length)),D=A.slice(I,L).join(` -`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(I+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};var m=!1;t.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(T_);const Ws=T_.exports;var qw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;ro&&(u[c]=` -`+u[c],f=d)}r[a]=u.join("")}return r.join(` -`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function Vw(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),g(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:re,o:re,d(s){s&&k(e)}}}function zw(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Ws.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Ws.highlight(a,Ws.languages[l]||Ws.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Ws<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class gn extends Ee{constructor(e){super(),Oe(this,e,zw,Vw,De,{class:0,content:2,language:3})}}const Bw=n=>({}),sc=n=>({}),Uw=n=>({}),lc=n=>({});function oc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C=n[4]&&!n[2]&&rc(n);const $=n[18].header,M=wn($,n,n[17],lc);let D=n[4]&&n[2]&&ac(n);const O=n[18].default,A=wn(O,n,n[17],null),I=n[18].footer,L=wn(I,n,n[17],sc);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),C&&C.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),A&&A.c(),c=T(),d=_("div"),L&&L.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),ie(l,"popup",n[2]),p(e,"class","overlay-panel-container"),ie(e,"padded",n[2]),ie(e,"active",n[0])},m(R,B){w(R,e,B),g(e,t),g(e,s),g(e,l),g(l,o),C&&C.m(o,null),g(o,r),M&&M.m(o,null),g(o,a),D&&D.m(o,null),g(l,u),g(l,f),A&&A.m(f,null),n[20](f),g(l,c),g(l,d),L&&L.m(d,null),b=!0,y||(S=[G(t,"click",Yt(n[19])),G(f,"scroll",n[21])],y=!0)},p(R,B){n=R,n[4]&&!n[2]?C?C.p(n,B):(C=rc(n),C.c(),C.m(o,r)):C&&(C.d(1),C=null),M&&M.p&&(!b||B&131072)&&Sn(M,$,n,n[17],b?$n($,n[17],B,Uw):Cn(n[17]),lc),n[4]&&n[2]?D?D.p(n,B):(D=ac(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),A&&A.p&&(!b||B&131072)&&Sn(A,O,n,n[17],b?$n(O,n[17],B,null):Cn(n[17]),null),L&&L.p&&(!b||B&131072)&&Sn(L,I,n,n[17],b?$n(I,n[17],B,Bw):Cn(n[17]),sc),(!b||B&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),B&262&&ie(l,"popup",n[2]),B&4&&ie(e,"padded",n[2]),B&1&&ie(e,"active",n[0])},i(R){b||(Dt(()=>{i||(i=rt(t,vo,{duration:_s,opacity:0},!0)),i.run(1)}),E(M,R),E(A,R),E(L,R),Dt(()=>{v&&v.end(1),m=_m(l,Bn,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),m.start()}),b=!0)},o(R){i||(i=rt(t,vo,{duration:_s,opacity:0},!1)),i.run(0),P(M,R),P(A,R),P(L,R),m&&m.invalidate(),v=bm(l,Bn,n[2]?{duration:_s,y:10}:{duration:_s,x:50}),b=!1},d(R){R&&k(e),R&&i&&i.end(),C&&C.d(),M&&M.d(R),D&&D.d(),A&&A.d(R),n[20](null),L&&L.d(R),R&&v&&v.end(),y=!1,Qe(S)}}}function rc(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[5])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function ac(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[5])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Ww(n){let e,t,i,s,l=n[0]&&oc(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(o,r){w(o,e,r),l&&l.m(e,null),n[22](e),t=!0,i||(s=[G(window,"resize",n[10]),G(window,"keydown",n[9])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&E(l,1)):(l=oc(o),l.c(),E(l,1),l.m(e,null)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){t||(E(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[22](null),i=!1,Qe(s)}}}let Ki;function D_(){return Ki=Ki||document.querySelector(".overlays"),Ki||(Ki=document.createElement("div"),Ki.classList.add("overlays"),document.body.appendChild(Ki)),Ki}let _s=150;function uc(){return 1e3+D_().querySelectorAll(".overlay-panel-container.active").length}function Yw(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=on();let m,v,b,y,S="";function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function $(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(H){H?(b=document.activeElement,m==null||m.focus(),h("show")):(clearTimeout(y),b==null||b.focus(),h("hide")),await ni(),O()}function O(){!m||(o?t(6,m.style.zIndex=uc(),m):t(6,m.style="",m))}function A(H){o&&f&&H.code=="Escape"&&!U.isInput(H.target)&&m&&m.style.zIndex==uc()&&(H.preventDefault(),$())}function I(H){o&&L(v)}function L(H,X){X&&t(8,S=""),H&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!H)return;if(H.scrollHeight-H.offsetHeight>0)t(8,S="scrollable");else{t(8,S="");return}H.scrollTop==0?t(8,S+=" scroll-top-reached"):H.scrollTop+H.offsetHeight==H.scrollHeight&&t(8,S+=" scroll-bottom-reached")},100)))}Zn(()=>(D_().appendChild(m),()=>{var H;clearTimeout(y),(H=m==null?void 0:m.classList)==null||H.add("hidden")}));const R=()=>a?$():!0;function B(H){he[H?"unshift":"push"](()=>{v=H,t(7,v)})}const K=H=>L(H.target);function J(H){he[H?"unshift":"push"](()=>{m=H,t(6,m)})}return n.$$set=H=>{"class"in H&&t(1,l=H.class),"active"in H&&t(0,o=H.active),"popup"in H&&t(2,r=H.popup),"overlayClose"in H&&t(3,a=H.overlayClose),"btnClose"in H&&t(4,u=H.btnClose),"escClose"in H&&t(12,f=H.escClose),"beforeOpen"in H&&t(13,c=H.beforeOpen),"beforeHide"in H&&t(14,d=H.beforeHide),"$$scope"in H&&t(17,s=H.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&D(o),n.$$.dirty&128&&L(v,!0),n.$$.dirty&64&&m&&O()},[o,l,r,a,u,$,m,v,S,A,I,L,f,c,d,C,M,s,i,R,B,K,J]}class hi extends Ee{constructor(e){super(),Oe(this,e,Yw,Ww,De,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16})}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function Kw(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Zw(n){let e,t=n[2].referer+"",i,s;return{c(){e=_("a"),i=F(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),g(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&ue(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function Jw(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function Gw(n){let e,t;return e=new gn({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.content=JSON.stringify(i[2].meta,null,2)),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Xw(n){var Lt;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,m,v=n[2].status+"",b,y,S,C,$,M,D=((Lt=n[2].method)==null?void 0:Lt.toUpperCase())+"",O,A,I,L,R,B,K=n[2].auth+"",J,H,X,W,te,x,oe=n[2].url+"",me,se,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z=n[2].ip+"",pe,ce,we,Ze,tt,We,it=n[2].userAgent+"",Ce,ze,Ge,st,ct,_e,Ie,nt,ft,vt,ot,Ot,wt,jt,Nt,Ke;function $e(lt,N){return lt[2].referer?Zw:Kw}let Be=$e(n),et=Be(n);const at=[Gw,Jw],Pt=[];function It(lt,N){return N&4&&(Ie=null),Ie==null&&(Ie=!U.isEmpty(lt[2].meta)),Ie?0:1}return nt=It(n,-1),ft=Pt[nt]=at[nt](n),Nt=new wi({props:{date:n[2].created}}),{c(){e=_("table"),t=_("tbody"),i=_("tr"),s=_("td"),s.textContent="ID",l=T(),o=_("td"),a=F(r),u=T(),f=_("tr"),c=_("td"),c.textContent="Status",d=T(),h=_("td"),m=_("span"),b=F(v),y=T(),S=_("tr"),C=_("td"),C.textContent="Method",$=T(),M=_("td"),O=F(D),A=T(),I=_("tr"),L=_("td"),L.textContent="Auth",R=T(),B=_("td"),J=F(K),H=T(),X=_("tr"),W=_("td"),W.textContent="URL",te=T(),x=_("td"),me=F(oe),se=T(),ge=_("tr"),ke=_("td"),ke.textContent="Referer",Y=T(),ve=_("td"),et.c(),ee=T(),Q=_("tr"),Se=_("td"),Se.textContent="IP",je=T(),Ue=_("td"),pe=F(Z),ce=T(),we=_("tr"),Ze=_("td"),Ze.textContent="UserAgent",tt=T(),We=_("td"),Ce=F(it),ze=T(),Ge=_("tr"),st=_("td"),st.textContent="Meta",ct=T(),_e=_("td"),ft.c(),vt=T(),ot=_("tr"),Ot=_("td"),Ot.textContent="Created",wt=T(),jt=_("td"),V(Nt.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(m,"class","label"),ie(m,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(L,"class","min-width txt-hint txt-bold"),p(W,"class","min-width txt-hint txt-bold"),p(ke,"class","min-width txt-hint txt-bold"),p(Se,"class","min-width txt-hint txt-bold"),p(Ze,"class","min-width txt-hint txt-bold"),p(st,"class","min-width txt-hint txt-bold"),p(Ot,"class","min-width txt-hint txt-bold"),p(e,"class","table-compact table-border")},m(lt,N){w(lt,e,N),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(o,a),g(t,u),g(t,f),g(f,c),g(f,d),g(f,h),g(h,m),g(m,b),g(t,y),g(t,S),g(S,C),g(S,$),g(S,M),g(M,O),g(t,A),g(t,I),g(I,L),g(I,R),g(I,B),g(B,J),g(t,H),g(t,X),g(X,W),g(X,te),g(X,x),g(x,me),g(t,se),g(t,ge),g(ge,ke),g(ge,Y),g(ge,ve),et.m(ve,null),g(t,ee),g(t,Q),g(Q,Se),g(Q,je),g(Q,Ue),g(Ue,pe),g(t,ce),g(t,we),g(we,Ze),g(we,tt),g(we,We),g(We,Ce),g(t,ze),g(t,Ge),g(Ge,st),g(Ge,ct),g(Ge,_e),Pt[nt].m(_e,null),g(t,vt),g(t,ot),g(ot,Ot),g(ot,wt),g(ot,jt),j(Nt,jt,null),Ke=!0},p(lt,N){var ae;(!Ke||N&4)&&r!==(r=lt[2].id+"")&&ue(a,r),(!Ke||N&4)&&v!==(v=lt[2].status+"")&&ue(b,v),N&4&&ie(m,"label-danger",lt[2].status>=400),(!Ke||N&4)&&D!==(D=((ae=lt[2].method)==null?void 0:ae.toUpperCase())+"")&&ue(O,D),(!Ke||N&4)&&K!==(K=lt[2].auth+"")&&ue(J,K),(!Ke||N&4)&&oe!==(oe=lt[2].url+"")&&ue(me,oe),Be===(Be=$e(lt))&&et?et.p(lt,N):(et.d(1),et=Be(lt),et&&(et.c(),et.m(ve,null))),(!Ke||N&4)&&Z!==(Z=lt[2].ip+"")&&ue(pe,Z),(!Ke||N&4)&&it!==(it=lt[2].userAgent+"")&&ue(Ce,it);let z=nt;nt=It(lt,N),nt===z?Pt[nt].p(lt,N):(Pe(),P(Pt[z],1,1,()=>{Pt[z]=null}),Le(),ft=Pt[nt],ft?ft.p(lt,N):(ft=Pt[nt]=at[nt](lt),ft.c()),E(ft,1),ft.m(_e,null));const ne={};N&4&&(ne.date=lt[2].created),Nt.$set(ne)},i(lt){Ke||(E(ft),E(Nt.$$.fragment,lt),Ke=!0)},o(lt){P(ft),P(Nt.$$.fragment,lt),Ke=!1},d(lt){lt&&k(e),et.d(),Pt[nt].d(),q(Nt)}}}function Qw(n){let e;return{c(){e=_("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function xw(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[4]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function e$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[xw],header:[Qw],default:[Xw]},$$scope:{ctx:n}};return e=new hi({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),q(e,s)}}}function t$(n,e,t){let i,s=new Ar;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){he[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){ut.call(this,n,c)}function f(c){ut.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class n$ extends Ee{constructor(e){super(),Oe(this,e,t$,e$,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function i$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[0],w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function fc(n){let e,t,i;function s(o){n[10](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new jw({props:l}),he.push(()=>Re(e,"filter",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function cc(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new sv({props:l}),he.push(()=>Re(e,"filter",s)),e.$on("select",n[12]),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function s$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S=n[3],C,$=n[3],M,D;r=new Uo({}),r.$on("refresh",n[7]),d=new Ne({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[i$,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),m=new Bo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","ip","referer","status","auth","userAgent"]}}),m.$on("submit",n[9]);let O=fc(n),A=cc(n);return{c(){e=_("div"),t=_("header"),i=_("nav"),s=_("div"),l=F(n[5]),o=T(),V(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("div"),V(d.$$.fragment),h=T(),V(m.$$.fragment),v=T(),b=_("div"),y=T(),O.c(),C=T(),A.c(),M=Je(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(b,"class","clearfix m-b-xs"),p(e,"class","page-header-wrapper m-b-0")},m(I,L){w(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(t,o),j(r,t,null),g(t,a),g(t,u),g(t,f),g(t,c),j(d,c,null),g(e,h),j(m,e,null),g(e,v),g(e,b),g(e,y),O.m(e,null),w(I,C,L),A.m(I,L),w(I,M,L),D=!0},p(I,L){(!D||L&32)&&ue(l,I[5]);const R={};L&49153&&(R.$$scope={dirty:L,ctx:I}),d.$set(R);const B={};L&4&&(B.value=I[2]),m.$set(B),L&8&&De(S,S=I[3])?(Pe(),P(O,1,1,re),Le(),O=fc(I),O.c(),E(O,1),O.m(e,null)):O.p(I,L),L&8&&De($,$=I[3])?(Pe(),P(A,1,1,re),Le(),A=cc(I),A.c(),E(A,1),A.m(M.parentNode,M)):A.p(I,L)},i(I){D||(E(r.$$.fragment,I),E(d.$$.fragment,I),E(m.$$.fragment,I),E(O),E(A),D=!0)},o(I){P(r.$$.fragment,I),P(d.$$.fragment,I),P(m.$$.fragment,I),P(O),P(A),D=!1},d(I){I&&k(e),q(r),q(d),q(m),O.d(I),I&&k(C),I&&k(M),A.d(I)}}}function l$(n){let e,t,i,s;e=new Dn({props:{$$slots:{default:[s$]},$$scope:{ctx:n}}});let l={};return i=new n$({props:l}),n[13](i),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(o,r){j(e,o,r),w(o,t,r),j(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(E(e.$$.fragment,o),E(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){q(e,o),o&&k(t),n[13](null),q(i,o)}}}const dc="includeAdminLogs";function o$(n,e,t){var y;let i,s;kt(n,Rt,S=>t(5,s=S)),dn(Rt,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem(dc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=S=>t(2,o=S.detail);function h(S){o=S,t(2,o)}function m(S){o=S,t(2,o)}const v=S=>l==null?void 0:l.show(S==null?void 0:S.detail);function b(S){he[S?"unshift":"push"](()=>{l=S,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(dc,r<<0)},[r,l,o,a,i,s,u,f,c,d,h,m,v,b]}class r$ extends Ee{constructor(e){super(),Oe(this,e,o$,l$,De,{})}}const Ds=ii([]),ui=ii({}),na=ii(!1);function a$(n){ui.update(e=>U.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Ds.update(e=>(U.pushOrReplaceByKey(e,n,"id"),e))}function u$(n){Ds.update(e=>(U.removeByKey(e,"id",n.id),ui.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function f$(n=null){return na.set(!0),ui.set({}),Ds.set([]),be.collections.getFullList(200,{sort:"+created"}).then(e=>{Ds.set(e);const t=n&&U.findByKey(e,"id",n);if(t)ui.set(t);else if(e.length){const i=e.find(s=>s.name!="profiles");i&&ui.set(i)}}).catch(e=>{be.errorResponseHandler(e)}).finally(()=>{na.set(!1)})}const Ba=ii({});function ci(n,e,t){Ba.set({text:n,yesCallback:e,noCallback:t})}function O_(){Ba.set({})}function pc(n){let e,t,i,s;const l=n[13].default,o=wn(l,n,n[12],null);return{c(){e=_("div"),o&&o.c(),p(e,"class",n[1]),ie(e,"active",n[0])},m(r,a){w(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&4096)&&Sn(o,l,r,r[12],s?$n(l,r[12],a,null):Cn(r[12]),null),(!s||a&2)&&p(e,"class",r[1]),a&3&&ie(e,"active",r[0])},i(r){s||(E(o,r),r&&Dt(()=>{i&&i.end(1),t=_m(e,Bn,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=bm(e,Bn,{duration:150,y:2})),s=!1},d(r){r&&k(e),o&&o.d(r),r&&i&&i.end()}}}function c$(n){let e,t,i,s,l=n[0]&&pc(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","toggler-container")},m(o,r){w(o,e,r),l&&l.m(e,null),n[14](e),t=!0,i||(s=[G(window,"click",n[3]),G(window,"keydown",n[4]),G(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&E(l,1)):(l=pc(o),l.c(),E(l,1),l.m(e,null)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){t||(E(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[14](null),i=!1,Qe(s)}}}function d$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f;const c=on();function d(){t(0,o=!1)}function h(){t(0,o=!0)}function m(){o?d():h()}function v(D){return!f||D.classList.contains(a)||(l==null?void 0:l.contains(D))&&!f.contains(D)||f.contains(D)&&D.closest&&D.closest("."+a)}function b(D){(!o||v(D.target))&&(D.preventDefault(),m())}function y(D){(D.code==="Enter"||D.code==="Space")&&(!o||v(D.target))&&(D.preventDefault(),D.stopPropagation(),m())}function S(D){o&&!(f!=null&&f.contains(D.target))&&!(l!=null&&l.contains(D.target))&&d()}function C(D){o&&r&&D.code=="Escape"&&(D.preventDefault(),d())}function $(D){return S(D)}Zn(()=>(t(6,l=l||f.parentNode),l.addEventListener("click",b),l.addEventListener("keydown",y),()=>{l.removeEventListener("click",b),l.removeEventListener("keydown",y)}));function M(D){he[D?"unshift":"push"](()=>{f=D,t(2,f)})}return n.$$set=D=>{"trigger"in D&&t(6,l=D.trigger),"active"in D&&t(0,o=D.active),"escClose"in D&&t(7,r=D.escClose),"closableClass"in D&&t(8,a=D.closableClass),"class"in D&&t(1,u=D.class),"$$scope"in D&&t(12,s=D.$$scope)},n.$$.update=()=>{var D,O;n.$$.dirty&65&&(o?((D=l==null?void 0:l.classList)==null||D.add("active"),c("show")):((O=l==null?void 0:l.classList)==null||O.remove("active"),c("hide")))},[o,u,f,S,C,$,l,r,a,d,h,m,s,i,M]}class qi extends Ee{constructor(e){super(),Oe(this,e,d$,c$,De,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const p$=n=>({active:n&1}),hc=n=>({active:n[0]});function mc(n){let e,t,i;const s=n[12].default,l=wn(s,n,n[11],null);return{c(){e=_("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&2048)&&Sn(l,s,o,o[11],i?$n(s,o[11],r,null):Cn(o[11]),null)},i(o){i||(E(l,o),o&&Dt(()=>{t||(t=rt(e,tn,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=rt(e,tn,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function h$(n){let e,t,i,s,l,o,r,a;const u=n[12].header,f=wn(u,n,n[11],hc);let c=n[0]&&mc(n);return{c(){e=_("div"),t=_("header"),f&&f.c(),i=T(),c&&c.c(),p(t,"class","accordion-header"),ie(t,"interactive",n[2]),p(e,"tabindex",s=n[2]?0:-1),p(e,"class",l="accordion "+n[1]),ie(e,"active",n[0])},m(d,h){w(d,e,h),g(e,t),f&&f.m(t,null),g(e,i),c&&c.m(e,null),n[14](e),o=!0,r||(a=[G(t,"click",Yt(n[13])),G(e,"keydown",cm(n[5]))],r=!0)},p(d,[h]){f&&f.p&&(!o||h&2049)&&Sn(f,u,d,d[11],o?$n(u,d[11],h,p$):Cn(d[11]),hc),h&4&&ie(t,"interactive",d[2]),d[0]?c?(c.p(d,h),h&1&&E(c,1)):(c=mc(d),c.c(),E(c,1),c.m(e,null)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le()),(!o||h&4&&s!==(s=d[2]?0:-1))&&p(e,"tabindex",s),(!o||h&2&&l!==(l="accordion "+d[1]))&&p(e,"class",l),h&3&&ie(e,"active",d[0])},i(d){o||(E(f,d),E(c),o=!0)},o(d){P(f,d),P(c),o=!1},d(d){d&&k(e),f&&f.d(d),c&&c.d(),n[14](null),r=!1,Qe(a)}}}function m$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=on();let o,r,{class:a=""}=e,{active:u=!1}=e,{interactive:f=!0}=e,{single:c=!1}=e;function d(){v(),t(0,u=!0),l("expand")}function h(){t(0,u=!1),clearTimeout(r),l("collapse")}function m(){l("toggle"),u?h():d()}function v(){if(c&&o.parentElement){const C=o.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const $ of C)$.click()}}function b(C){!f||(C.code==="Enter"||C.code==="Space")&&(C.preventDefault(),m())}Zn(()=>()=>clearTimeout(r));const y=()=>f&&m();function S(C){he[C?"unshift":"push"](()=>{o=C,t(4,o)})}return n.$$set=C=>{"class"in C&&t(1,a=C.class),"active"in C&&t(0,u=C.active),"interactive"in C&&t(2,f=C.interactive),"single"in C&&t(6,c=C.single),"$$scope"in C&&t(11,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1041&&u&&(clearTimeout(r),t(10,r=setTimeout(()=>{o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},250)))},[u,a,f,m,o,b,c,d,h,v,r,s,i,y,S]}class Ua extends Ee{constructor(e){super(),Oe(this,e,m$,h$,De,{class:1,active:0,interactive:2,single:6,expand:7,collapse:8,toggle:3,collapseSiblings:9})}get expand(){return this.$$.ctx[7]}get collapse(){return this.$$.ctx[8]}get toggle(){return this.$$.ctx[3]}get collapseSiblings(){return this.$$.ctx[9]}}const g$=n=>({}),gc=n=>({});function _c(n,e,t){const i=n.slice();return i[45]=e[t],i}const _$=n=>({}),bc=n=>({});function vc(n,e,t){const i=n.slice();return i[45]=e[t],i}function yc(n){let e,t;return{c(){e=_("div"),t=F(n[2]),p(e,"class","txt-placeholder")},m(i,s){w(i,e,s),g(e,t)},p(i,s){s[0]&4&&ue(t,i[2])},d(i){i&&k(e)}}}function b$(n){let e,t=n[45]+"",i;return{c(){e=_("span"),i=F(t),p(e,"class","txt")},m(s,l){w(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=s[45]+"")&&ue(i,t)},i:re,o:re,d(s){s&&k(e)}}}function v$(n){let e,t,i;const s=[{item:n[45]},n[8]];var l=n[7];function o(r){let a={};for(let u=0;u{q(f,1)}),Le()}l?(e=new l(o()),V(e.$$.fragment),E(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function kc(n){let e,t,i;function s(){return n[33](n[45])}return{c(){e=_("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Ye(Ct.call(null,e,"Clear")),G(e,"click",ei(Yt(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Qe(i)}}}function wc(n){let e,t,i,s,l,o;const r=[v$,b$],a=[];function u(c,d){return c[7]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&kc(n);return{c(){e=_("div"),i.c(),s=T(),f&&f.c(),l=T(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),g(e,s),f&&f.m(e,null),g(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(Pe(),P(a[h],1,1,()=>{a[h]=null}),Le(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=kc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(E(i),o=!0)},o(c){P(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function $c(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[w$]},$$scope:{ctx:n}};return e=new qi({props:i}),n[38](e),e.$on("show",n[23]),e.$on("hide",n[39]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&131072&&(o.trigger=s[17]),l[0]&806410|l[1]&1024&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[38](null),q(e,s)}}}function Sc(n){let e,t,i,s,l,o,r,a,u=n[14].length&&Cc(n);return{c(){e=_("div"),t=_("label"),i=_("div"),i.innerHTML='',s=T(),l=_("input"),o=T(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),g(e,t),g(t,i),g(t,s),g(t,l),Me(l,n[14]),g(t,o),u&&u.m(t,null),l.focus(),r||(a=G(l,"input",n[35]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&16384&&l.value!==f[14]&&Me(l,f[14]),f[14].length?u?u.p(f,c):(u=Cc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function Cc(n){let e,t,i,s;return{c(){e=_("div"),t=_("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-secondary clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),g(e,t),i||(s=G(t,"click",ei(Yt(n[20]))),i=!0)},p:re,d(l){l&&k(e),i=!1,s()}}}function Mc(n){let e,t=n[1]&&Tc(n);return{c(){t&&t.c(),e=Je()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=Tc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Tc(n){let e,t;return{c(){e=_("div"),t=F(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),g(e,t)},p(i,s){s[0]&2&&ue(t,i[1])},d(i){i&&k(e)}}}function y$(n){let e=n[45]+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&524288&&e!==(e=i[45]+"")&&ue(t,e)},i:re,o:re,d(i){i&&k(t)}}}function k$(n){let e,t,i;const s=[{item:n[45]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u{q(f,1)}),Le()}l?(e=new l(o()),V(e.$$.fragment),E(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&q(e,r)}}}function Dc(n){let e,t,i,s,l,o,r;const a=[k$,y$],u=[];function f(h,m){return h[9]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[36](n[45],...h)}function d(...h){return n[37](n[45],...h)}return{c(){e=_("div"),i.c(),s=T(),p(e,"tabindex","0"),p(e,"class","dropdown-item option closable"),ie(e,"selected",n[18](n[45]))},m(h,m){w(h,e,m),u[t].m(e,null),g(e,s),l=!0,o||(r=[G(e,"click",c),G(e,"keydown",d)],o=!0)},p(h,m){n=h;let v=t;t=f(n),t===v?u[t].p(n,m):(Pe(),P(u[v],1,1,()=>{u[v]=null}),Le(),i=u[t],i?i.p(n,m):(i=u[t]=a[t](n),i.c()),E(i,1),i.m(e,s)),m[0]&786432&&ie(e,"selected",n[18](n[45]))},i(h){l||(E(i),l=!0)},o(h){P(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,Qe(r)}}}function w$(n){let e,t,i,s,l,o=n[11]&&Sc(n);const r=n[32].beforeOptions,a=wn(r,n,n[41],bc);let u=n[19],f=[];for(let v=0;vP(f[v],1,1,()=>{f[v]=null});let d=null;u.length||(d=Mc(n));const h=n[32].afterOptions,m=wn(h,n,n[41],gc);return{c(){o&&o.c(),e=T(),a&&a.c(),t=T(),i=_("div");for(let v=0;vP(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=yc(n));let c=!n[5]&&$c(n);return{c(){e=_("div"),t=_("div");for(let d=0;d{c=null}),Le()):c?(c.p(d,h),h[0]&32&&E(c,1)):(c=$c(d),c.c(),E(c,1),c.m(e,null)),(!o||h[0]&4096&&l!==(l="select "+d[12]))&&p(e,"class",l),h[0]&4112&&ie(e,"multiple",d[4]),h[0]&4128&&ie(e,"disabled",d[5])},i(d){if(!o){for(let h=0;hce(we,pe))||[]}function oe(Z,pe){Z.preventDefault(),v&&d?K(pe):B(pe)}function me(Z,pe){(Z.code==="Enter"||Z.code==="Space")&&oe(Z,pe)}function se(){te(),setTimeout(()=>{const Z=I==null?void 0:I.querySelector(".dropdown-item.option.selected");Z&&(Z.focus(),Z.scrollIntoView({block:"nearest"}))},0)}function ge(Z){Z.stopPropagation(),!h&&(O==null||O.toggle())}Zn(()=>{const Z=document.querySelectorAll(`label[for="${r}"]`);for(const pe of Z)pe.addEventListener("click",ge);return()=>{for(const pe of Z)pe.removeEventListener("click",ge)}});const ke=Z=>R(Z);function Y(Z){he[Z?"unshift":"push"](()=>{L=Z,t(17,L)})}function ve(){A=this.value,t(14,A)}const ee=(Z,pe)=>oe(pe,Z),Q=(Z,pe)=>me(pe,Z);function Se(Z){he[Z?"unshift":"push"](()=>{O=Z,t(15,O)})}function je(Z){ut.call(this,n,Z)}function Ue(Z){he[Z?"unshift":"push"](()=>{I=Z,t(16,I)})}return n.$$set=Z=>{"id"in Z&&t(24,r=Z.id),"noOptionsText"in Z&&t(1,a=Z.noOptionsText),"selectPlaceholder"in Z&&t(2,u=Z.selectPlaceholder),"searchPlaceholder"in Z&&t(3,f=Z.searchPlaceholder),"items"in Z&&t(25,c=Z.items),"multiple"in Z&&t(4,d=Z.multiple),"disabled"in Z&&t(5,h=Z.disabled),"selected"in Z&&t(0,m=Z.selected),"toggle"in Z&&t(6,v=Z.toggle),"labelComponent"in Z&&t(7,b=Z.labelComponent),"labelComponentProps"in Z&&t(8,y=Z.labelComponentProps),"optionComponent"in Z&&t(9,S=Z.optionComponent),"optionComponentProps"in Z&&t(10,C=Z.optionComponentProps),"searchable"in Z&&t(11,$=Z.searchable),"searchFunc"in Z&&t(26,M=Z.searchFunc),"class"in Z&&t(12,D=Z.class),"$$scope"in Z&&t(41,o=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&c&&(W(),te()),n.$$.dirty[0]&33570816&&t(19,i=x(c,A)),n.$$.dirty[0]&1&&t(18,s=function(Z){let pe=U.toArray(m);return U.inArray(pe,Z)})},[m,a,u,f,d,h,v,b,y,S,C,$,D,R,A,O,I,L,s,i,te,oe,me,se,r,c,M,B,K,J,H,X,l,ke,Y,ve,ee,Q,Se,je,Ue,o]}class E_ extends Ee{constructor(e){super(),Oe(this,e,C$,$$,De,{id:24,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:25,multiple:4,disabled:5,selected:0,toggle:6,labelComponent:7,labelComponentProps:8,optionComponent:9,optionComponentProps:10,searchable:11,searchFunc:26,class:12,deselectItem:13,selectItem:27,toggleItem:28,reset:29,showDropdown:30,hideDropdown:31},null,[-1,-1])}get deselectItem(){return this.$$.ctx[13]}get selectItem(){return this.$$.ctx[27]}get toggleItem(){return this.$$.ctx[28]}get reset(){return this.$$.ctx[29]}get showDropdown(){return this.$$.ctx[30]}get hideDropdown(){return this.$$.ctx[31]}}function Oc(n){let e,t;return{c(){e=_("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function M$(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&Oc(n);return{c(){l&&l.c(),e=T(),t=_("span"),s=F(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),g(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Oc(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&ue(s,i)},i:re,o:re,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function T$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Ec extends Ee{constructor(e){super(),Oe(this,e,T$,M$,De,{item:0})}}const D$=n=>({}),Ac=n=>({});function O$(n){let e;const t=n[8].afterOptions,i=wn(t,n,n[12],Ac);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Sn(i,t,s,s[12],e?$n(t,s[12],l,D$):Cn(s[12]),Ac)},i(s){e||(E(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function E$(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[O$]},$$scope:{ctx:n}};for(let r=0;rRe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&62?_n(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&pi(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function A$(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Jt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Ec}=e,{optionComponent:c=Ec}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function m(C){C=U.toArray(C,!0);let $=[];for(let M of r)U.inArray(C,M[d])&&$.push(M);C.length&&!$.length||t(0,u=a?$:$[0])}async function v(C){let $=U.toArray(C,!0).map(M=>M[d]);!r.length||t(6,h=a?$:$[0])}function b(C){u=C,t(0,u)}function y(C){ut.call(this,n,C)}function S(C){ut.call(this,n,C)}return n.$$set=C=>{e=pt(pt({},e),di(C)),t(5,s=Jt(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&m(h),n.$$.dirty&1&&v(u)},[u,r,a,f,c,s,h,d,l,b,y,S,o]}class fs extends Ee{constructor(e){super(),Oe(this,e,A$,E$,De,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function P$(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{searchable:!0},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;rRe(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&14?_n(s,[a&2&&{class:"field-type-select "+r[1]},s[1],a&4&&{items:r[2]},a&8&&pi(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function L$(n,e,t){const i=["value","class"];let s=Jt(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Text",value:"text",icon:U.getFieldTypeIcon("text")},{label:"Number",value:"number",icon:U.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:U.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:U.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:U.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:U.getFieldTypeIcon("date")},{label:"Multiple choices",value:"select",icon:U.getFieldTypeIcon("select")},{label:"JSON",value:"json",icon:U.getFieldTypeIcon("json")},{label:"File",value:"file",icon:U.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:U.getFieldTypeIcon("relation")},{label:"User",value:"user",icon:U.getFieldTypeIcon("user")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=pt(pt({},e),di(u)),t(3,s=Jt(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class I$ extends Ee{constructor(e){super(),Oe(this,e,L$,P$,De,{value:0,class:1})}}function F$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&At(l.value)!==u[0].min&&Me(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function N$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){w(f,e,c),g(e,t),w(f,s,c),w(f,l,c),Me(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&At(l.value)!==f[0].max&&Me(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function R$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Regex pattern"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML="Valid Go regular expression, eg. ^\\w+$.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),Me(l,n[0].pattern),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&Me(l,c[0].pattern)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function H$(n){let e,t,i,s,l,o,r,a,u,f;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[F$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[N$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[R$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),g(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&97&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const m={};d&2&&(m.name="schema."+c[1]+".options.max"),d&97&&(m.$$scope={dirty:d,ctx:c}),o.$set(m);const v={};d&2&&(v.name="schema."+c[1]+".options.pattern"),d&97&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),q(i),q(o),q(u)}}}function j$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=At(this.value),t(0,s)}function o(){s.max=At(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class q$ extends Ee{constructor(e){super(),Oe(this,e,j$,H$,De,{key:1,options:0})}}function V$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&At(l.value)!==u[0].min&&Me(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function z$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),g(e,t),w(f,s,c),w(f,l,c),Me(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&At(l.value)!==f[0].max&&Me(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function B$(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[V$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[z$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function U$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=At(this.value),t(0,s)}function o(){s.max=At(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class W$ extends Ee{constructor(e){super(),Oe(this,e,U$,B$,De,{key:1,options:0})}}function Y$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class K$ extends Ee{constructor(e){super(),Oe(this,e,Y$,null,De,{key:0,options:1})}}function Z$(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r{t(0,o=U.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=pt(pt({},e),di(u)),t(3,l=Jt(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(","))},[o,r,i,l,a]}class cs extends Ee{constructor(e){super(),Oe(this,e,J$,Z$,De,{value:0,separator:1})}}function G$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[2](b)}let v={id:n[4],disabled:!U.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new cs({props:v}),he.push(()=>Re(r,"value",m)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]),p(f,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(Ct.call(null,s,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const S={};y&16&&(S.id=b[4]),y&1&&(S.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function X$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new cs({props:v}),he.push(()=>Re(r,"value",m)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(Ct.call(null,s,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&16&&(S.id=b[4]+".options.onlyDomains"),y&1&&(S.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function Q$(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[G$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[X$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function x$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class A_ extends Ee{constructor(e){super(),Oe(this,e,x$,Q$,De,{key:1,options:0})}}function eS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new A_({props:r}),he.push(()=>Re(e,"key",l)),he.push(()=>Re(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(E(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){q(e,a)}}}function tS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class nS extends Ee{constructor(e){super(),Oe(this,e,tS,eS,De,{key:0,options:1})}}var kr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},hl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},bn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Rn=function(n){return n===!0?1:0};function Pc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var wr=function(n){return n instanceof Array?n:[n]};function pn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function St(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function xl(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function P_(n,e){if(e(n))return n;if(n.parentNode)return P_(n.parentNode,e)}function eo(n,e){var t=St("div","numInputWrapper"),i=St("input","numInput "+n),s=St("span","arrowUp"),l=St("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function On(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var $r=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},iS={D:$r,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Rn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:$r,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:$r,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Qi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ll={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ll.w(n,e,t)]},F:function(n,e,t){return Po(ll.n(n,e,t)-1,!1,e)},G:function(n,e,t){return bn(ll.h(n,e,t))},H:function(n){return bn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Rn(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return bn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return bn(n.getFullYear(),4)},d:function(n){return bn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return bn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return bn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},L_=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return ll[c]&&h[d-1]!=="\\"?ll[c](r,f,t):c!=="\\"?c:""}).join("")}},ia=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?hl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ks).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var m=void 0,v=[],b=0,y=0,S="";bMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Cr(t.config);z.setHours(ne.hours,ne.minutes,ne.seconds,z.getMilliseconds()),t.selectedDates=[z],t.latestSelectedDateObj=z}N!==void 0&&N.type!=="blur"&<(N);var ae=t._input.value;c(),It(),t._input.value!==ae&&t._debouncedChange()}function u(N,z){return N%12+12*Rn(z===t.l10n.amPM[1])}function f(N){switch(N%24){case 0:case 12:return 12;default:return N%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var N=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(N=u(N,t.amPM.textContent));var ae=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&En(t.latestSelectedDateObj,t.config.minDate,!0)===0,Ae=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&En(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var le=Sr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),ye=Sr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Te=Sr(N,z,ne);if(Te>ye&&Te=12)]),t.secondElement!==void 0&&(t.secondElement.value=bn(ne)))}function m(N){var z=On(N),ne=parseInt(z.value)+(N.delta||0);(ne/1e3>1||N.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&ee(ne)}function v(N,z,ne,ae){if(z instanceof Array)return z.forEach(function(Ae){return v(N,Ae,ne,ae)});if(N instanceof Array)return N.forEach(function(Ae){return v(Ae,z,ne,ae)});N.addEventListener(z,ne,ae),t._handlers.push({remove:function(){return N.removeEventListener(z,ne,ae)}})}function b(){Ke("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(ae){return v(ae,"click",t[ne])})}),t.isMobile){jt();return}var N=Pc(pe,50);if(t._debouncedChange=Pc(b,rS),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Z(On(ne))}),v(t._input,"keydown",Ue),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Ue),!t.config.inline&&!t.config.static&&v(window,"resize",N),window.ontouchstart!==void 0?v(window.document,"touchstart",ve):v(window.document,"mousedown",ve),v(window.document,"focus",ve,{capture:!0}),t.config.clickOpens===!0&&(v(t._input,"focus",t.open),v(t._input,"click",t.open)),t.daysContainer!==void 0&&(v(t.monthNav,"click",Lt),v(t.monthNav,["keyup","increment"],m),v(t.daysContainer,"click",ct)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var z=function(ne){return On(ne).select()};v(t.timeContainer,["increment"],a),v(t.timeContainer,"blur",a,{capture:!0}),v(t.timeContainer,"click",C),v([t.hourElement,t.minuteElement],["focus","click"],z),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&v(t._input,"blur",je)}function S(N,z){var ne=N!==void 0?t.parseDate(N):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(N);var Ae=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Ae&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var le=St("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(le,t.element),le.appendChild(t.element),t.altInput&&le.appendChild(t.altInput),le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(N,z,ne,ae){var Ae=Q(z,!0),le=St("span",N,z.getDate().toString());return le.dateObj=z,le.$i=ae,le.setAttribute("aria-label",t.formatDate(z,t.config.ariaDateFormat)),N.indexOf("hidden")===-1&&En(z,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),Ae?(le.tabIndex=-1,Be(z)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&(pn(le,"startRange",t.selectedDates[0]&&En(z,t.selectedDates[0],!0)===0),pn(le,"endRange",t.selectedDates[1]&&En(z,t.selectedDates[1],!0)===0),N==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&et(z)&&!Be(z)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&N!=="prevMonthDay"&&ae%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(z)+""),Ke("onDayCreate",le),le}function O(N){N.focus(),t.config.mode==="range"&&Z(N)}function A(N){for(var z=N>0?0:t.config.showMonths-1,ne=N>0?t.config.showMonths:-1,ae=z;ae!=ne;ae+=N)for(var Ae=t.daysContainer.children[ae],le=N>0?0:Ae.children.length-1,ye=N>0?Ae.children.length:-1,Te=le;Te!=ye;Te+=N){var fe=Ae.children[Te];if(fe.className.indexOf("hidden")===-1&&Q(fe.dateObj))return fe}}function I(N,z){for(var ne=N.className.indexOf("Month")===-1?N.dateObj.getMonth():t.currentMonth,ae=z>0?t.config.showMonths:-1,Ae=z>0?1:-1,le=ne-t.currentMonth;le!=ae;le+=Ae)for(var ye=t.daysContainer.children[le],Te=ne-t.currentMonth===le?N.$i+z:z<0?ye.children.length-1:0,fe=ye.children.length,de=Te;de>=0&&de0?fe:-1);de+=Ae){var Fe=ye.children[de];if(Fe.className.indexOf("hidden")===-1&&Q(Fe.dateObj)&&Math.abs(N.$i-de)>=Math.abs(z))return O(Fe)}t.changeMonth(Ae),L(A(Ae),0)}function L(N,z){var ne=l(),ae=Se(ne||document.body),Ae=N!==void 0?N:ae?ne:t.selectedDateElem!==void 0&&Se(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Se(t.todayDateElem)?t.todayDateElem:A(z>0?1:-1);Ae===void 0?t._input.focus():ae?I(Ae,z):O(Ae)}function R(N,z){for(var ne=(new Date(N,z,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ae=t.utils.getDaysInMonth((z-1+12)%12,N),Ae=t.utils.getDaysInMonth(z,N),le=window.document.createDocumentFragment(),ye=t.config.showMonths>1,Te=ye?"prevMonthDay hidden":"prevMonthDay",fe=ye?"nextMonthDay hidden":"nextMonthDay",de=ae+1-ne,Fe=0;de<=ae;de++,Fe++)le.appendChild(D("flatpickr-day "+Te,new Date(N,z-1,de),de,Fe));for(de=1;de<=Ae;de++,Fe++)le.appendChild(D("flatpickr-day",new Date(N,z,de),de,Fe));for(var ht=Ae+1;ht<=42-ne&&(t.config.showMonths===1||Fe%7!==0);ht++,Fe++)le.appendChild(D("flatpickr-day "+fe,new Date(N,z+1,ht%Ae),ht,Fe));var rn=St("div","dayContainer");return rn.appendChild(le),rn}function B(){if(t.daysContainer!==void 0){xl(t.daysContainer),t.weekNumbers&&xl(t.weekNumbers);for(var N=document.createDocumentFragment(),z=0;z1||t.config.monthSelectorType!=="dropdown")){var N=function(ae){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&aet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(!!N(z)){var ne=St("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,z).getMonth().toString(),ne.textContent=Po(z,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===z&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function J(){var N=St("div","flatpickr-month"),z=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=St("span","cur-month"):(t.monthsDropdownContainer=St("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(ye){var Te=On(ye),fe=parseInt(Te.value,10);t.changeMonth(fe-t.currentMonth),Ke("onMonthChange")}),K(),ne=t.monthsDropdownContainer);var ae=eo("cur-year",{tabindex:"-1"}),Ae=ae.getElementsByTagName("input")[0];Ae.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Ae.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Ae.setAttribute("max",t.config.maxDate.getFullYear().toString()),Ae.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var le=St("div","flatpickr-current-month");return le.appendChild(ne),le.appendChild(ae),z.appendChild(le),N.appendChild(z),{container:N,yearElement:Ae,monthElement:ne}}function H(){xl(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var N=t.config.showMonths;N--;){var z=J();t.yearElements.push(z.yearElement),t.monthElements.push(z.monthElement),t.monthNav.appendChild(z.container)}t.monthNav.appendChild(t.nextMonthNav)}function X(){return t.monthNav=St("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=St("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=St("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(N){t.__hidePrevMonthArrow!==N&&(pn(t.prevMonthNav,"flatpickr-disabled",N),t.__hidePrevMonthArrow=N)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(N){t.__hideNextMonthArrow!==N&&(pn(t.nextMonthNav,"flatpickr-disabled",N),t.__hideNextMonthArrow=N)}}),t.currentYearElement=t.yearElements[0],at(),t.monthNav}function W(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var N=Cr(t.config);t.timeContainer=St("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var z=St("span","flatpickr-time-separator",":"),ne=eo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var ae=eo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ae.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?N.hours:f(N.hours)),t.minuteElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():N.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(z),t.timeContainer.appendChild(ae),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Ae=eo("flatpickr-second");t.secondElement=Ae.getElementsByTagName("input")[0],t.secondElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():N.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(St("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Ae)}return t.config.time_24hr||(t.amPM=St("span","flatpickr-am-pm",t.l10n.amPM[Rn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function te(){t.weekdayContainer?xl(t.weekdayContainer):t.weekdayContainer=St("div","flatpickr-weekdays");for(var N=t.config.showMonths;N--;){var z=St("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(z)}return x(),t.weekdayContainer}function x(){if(!!t.weekdayContainer){var N=t.l10n.firstDayOfWeek,z=Lc(t.l10n.weekdays.shorthand);N>0&&N - `+z.join("")+` - - `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var N=St("div","flatpickr-weekwrapper");N.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return N.appendChild(z),{weekWrapper:N,weekNumbers:z}}function me(N,z){z===void 0&&(z=!0);var ne=z?N:N-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ke("onYearChange"),K()),B(),Ke("onMonthChange"),at())}function se(N,z){if(N===void 0&&(N=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Cr(t.config),ae=ne.hours,Ae=ne.minutes,le=ne.seconds;h(ae,Ae,le)}t.redraw(),N&&Ke("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ke("onClose")}function ke(){t.config!==void 0&&Ke("onDestroy");for(var N=t._handlers.length;N--;)t._handlers[N].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Y(N){return t.calendarContainer.contains(N)}function ve(N){if(t.isOpen&&!t.config.inline){var z=On(N),ne=Y(z),ae=z===t.input||z===t.altInput||t.element.contains(z)||N.path&&N.path.indexOf&&(~N.path.indexOf(t.input)||~N.path.indexOf(t.altInput)),Ae=!ae&&!ne&&!Y(N.relatedTarget),le=!t.config.ignoredFocusElements.some(function(ye){return ye.contains(z)});Ae&&le&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ee(N){if(!(!N||t.config.minDate&&Nt.config.maxDate.getFullYear())){var z=N,ne=t.currentYear!==z;t.currentYear=z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),Ke("onYearChange"),K())}}function Q(N,z){var ne;z===void 0&&(z=!0);var ae=t.parseDate(N,void 0,z);if(t.config.minDate&&ae&&En(ae,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&ae&&En(ae,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ae===void 0)return!1;for(var Ae=!!t.config.enable,le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,ye=0,Te=void 0;ye=Te.from.getTime()&&ae.getTime()<=Te.to.getTime())return Ae}return!Ae}function Se(N){return t.daysContainer!==void 0?N.className.indexOf("hidden")===-1&&N.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(N):!1}function je(N){var z=N.target===t._input,ne=t._input.value.trimEnd()!==Pt();z&&ne&&!(N.relatedTarget&&Y(N.relatedTarget))&&t.setDate(t._input.value,!0,N.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ue(N){var z=On(N),ne=t.config.wrap?n.contains(z):z===t._input,ae=t.config.allowInput,Ae=t.isOpen&&(!ae||!ne),le=t.config.inline&&ne&&!ae;if(N.keyCode===13&&ne){if(ae)return t.setDate(t._input.value,!0,z===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),z.blur();t.open()}else if(Y(z)||Ae||le){var ye=!!t.timeContainer&&t.timeContainer.contains(z);switch(N.keyCode){case 13:ye?(N.preventDefault(),a(),st()):ct(N);break;case 27:N.preventDefault(),st();break;case 8:case 46:ne&&!t.config.allowInput&&(N.preventDefault(),t.clear());break;case 37:case 39:if(!ye&&!ne){N.preventDefault();var Te=l();if(t.daysContainer!==void 0&&(ae===!1||Te&&Se(Te))){var fe=N.keyCode===39?1:-1;N.ctrlKey?(N.stopPropagation(),me(fe),L(A(1),0)):L(void 0,fe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:N.preventDefault();var de=N.keyCode===40?1:-1;t.daysContainer&&z.$i!==void 0||z===t.input||z===t.altInput?N.ctrlKey?(N.stopPropagation(),ee(t.currentYear-de),L(A(1),0)):ye||L(void 0,de*7):z===t.currentYearElement?ee(t.currentYear-de):t.config.enableTime&&(!ye&&t.hourElement&&t.hourElement.focus(),a(N),t._debouncedChange());break;case 9:if(ye){var Fe=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(qt){return qt}),ht=Fe.indexOf(z);if(ht!==-1){var rn=Fe[ht+(N.shiftKey?-1:1)];N.preventDefault(),(rn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(z)&&N.shiftKey&&(N.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&z===t.amPM)switch(N.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),It();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),It();break}(ne||Y(z))&&Ke("onKeyDown",N)}function Z(N,z){if(z===void 0&&(z="flatpickr-day"),!(t.selectedDates.length!==1||N&&(!N.classList.contains(z)||N.classList.contains("flatpickr-disabled")))){for(var ne=N?N.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ae=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Ae=Math.min(ne,t.selectedDates[0].getTime()),le=Math.max(ne,t.selectedDates[0].getTime()),ye=!1,Te=0,fe=0,de=Ae;deAe&&deTe)?Te=de:de>ae&&(!fe||de ."+z));Fe.forEach(function(ht){var rn=ht.dateObj,qt=rn.getTime(),Mi=Te>0&&qt0&&qt>fe;if(Mi){ht.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(mi){ht.classList.remove(mi)});return}else if(ye&&!Mi)return;["startRange","inRange","endRange","notAllowed"].forEach(function(mi){ht.classList.remove(mi)}),N!==void 0&&(N.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),aene&&qt===ae&&ht.classList.add("endRange"),qt>=Te&&(fe===0||qt<=fe)&&sS(qt,ae,ne)&&ht.classList.add("inRange"))})}}function pe(){t.isOpen&&!t.config.static&&!t.config.inline&&it()}function ce(N,z){if(z===void 0&&(z=t._positionElement),t.isMobile===!0){if(N){N.preventDefault();var ne=On(N);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Ke("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ae=t.isOpen;t.isOpen=!0,ae||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Ke("onOpen"),it(z)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(N===void 0||!t.timeContainer.contains(N.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function we(N){return function(z){var ne=t.config["_"+N+"Date"]=t.parseDate(z,t.config.dateFormat),ae=t.config["_"+(N==="min"?"max":"min")+"Date"];ne!==void 0&&(t[N==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Ae){return Q(Ae)}),!t.selectedDates.length&&N==="min"&&d(ne),It()),t.daysContainer&&(Ge(),ne!==void 0?t.currentYearElement[N]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(N),t.currentYearElement.disabled=!!ae&&ne!==void 0&&ae.getFullYear()===ne.getFullYear())}}function Ze(){var N=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],z=an(an({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=z.parseDate,t.config.formatDate=z.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Fe){t.config._enable=vt(Fe)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Fe){t.config._disable=vt(Fe)}});var ae=z.mode==="time";if(!z.dateFormat&&(z.enableTime||ae)){var Ae=Zt.defaultConfig.dateFormat||ks.dateFormat;ne.dateFormat=z.noCalendar||ae?"H:i"+(z.enableSeconds?":S":""):Ae+" H:i"+(z.enableSeconds?":S":"")}if(z.altInput&&(z.enableTime||ae)&&!z.altFormat){var le=Zt.defaultConfig.altFormat||ks.altFormat;ne.altFormat=z.noCalendar||ae?"h:i"+(z.enableSeconds?":S K":" K"):le+(" h:i"+(z.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:we("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:we("max")});var ye=function(Fe){return function(ht){t.config[Fe==="min"?"_minTime":"_maxTime"]=t.parseDate(ht,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:ye("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:ye("max")}),z.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,z);for(var Te=0;Te-1?t.config[de]=wr(fe[de]).map(o).concat(t.config[de]):typeof z[de]>"u"&&(t.config[de]=fe[de])}z.altInputClass||(t.config.altInputClass=tt().className+" "+t.config.altInputClass),Ke("onParseConfig")}function tt(){return t.config.wrap?n.querySelector("[data-input]"):n}function We(){typeof t.config.locale!="object"&&typeof Zt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=an(an({},Zt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Zt.l10ns[t.config.locale]:void 0),Qi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Qi.l="("+t.l10n.weekdays.longhand.join("|")+")",Qi.M="("+t.l10n.months.shorthand.join("|")+")",Qi.F="("+t.l10n.months.longhand.join("|")+")",Qi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var N=an(an({},e),JSON.parse(JSON.stringify(n.dataset||{})));N.time_24hr===void 0&&Zt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=L_(t),t.parseDate=ia({config:t.config,l10n:t.l10n})}function it(N){if(typeof t.config.position=="function")return void t.config.position(t,N);if(t.calendarContainer!==void 0){Ke("onPreCalendarPosition");var z=N||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(Al,Pl){return Al+Pl.offsetHeight},0),ae=t.calendarContainer.offsetWidth,Ae=t.config.position.split(" "),le=Ae[0],ye=Ae.length>1?Ae[1]:null,Te=z.getBoundingClientRect(),fe=window.innerHeight-Te.bottom,de=le==="above"||le!=="below"&&fene,Fe=window.pageYOffset+Te.top+(de?-ne-2:z.offsetHeight+2);if(pn(t.calendarContainer,"arrowTop",!de),pn(t.calendarContainer,"arrowBottom",de),!t.config.inline){var ht=window.pageXOffset+Te.left,rn=!1,qt=!1;ye==="center"?(ht-=(ae-Te.width)/2,rn=!0):ye==="right"&&(ht-=ae-Te.width,qt=!0),pn(t.calendarContainer,"arrowLeft",!rn&&!qt),pn(t.calendarContainer,"arrowCenter",rn),pn(t.calendarContainer,"arrowRight",qt);var Mi=window.document.body.offsetWidth-(window.pageXOffset+Te.right),mi=ht+ae>window.document.body.offsetWidth,Tl=Mi+ae>window.document.body.offsetWidth;if(pn(t.calendarContainer,"rightMost",mi),!t.config.static)if(t.calendarContainer.style.top=Fe+"px",!mi)t.calendarContainer.style.left=ht+"px",t.calendarContainer.style.right="auto";else if(!Tl)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Mi+"px";else{var ds=Ce();if(ds===void 0)return;var Dl=window.document.body.offsetWidth,qe=Math.max(0,Dl/2-ae/2),xe=".flatpickr-calendar.centerMost:before",Xt=".flatpickr-calendar.centerMost:after",Ol=ds.cssRules.length,El="{left:"+Te.left+"px;right:auto;}";pn(t.calendarContainer,"rightMost",!1),pn(t.calendarContainer,"centerMost",!0),ds.insertRule(xe+","+Xt+El,Ol),t.calendarContainer.style.left=qe+"px",t.calendarContainer.style.right="auto"}}}}function Ce(){for(var N=null,z=0;zt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ae,t.config.mode==="single")t.selectedDates=[Ae];else if(t.config.mode==="multiple"){var ye=Be(Ae);ye?t.selectedDates.splice(parseInt(ye),1):t.selectedDates.push(Ae)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Ae,t.selectedDates.push(Ae),En(Ae,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Fe,ht){return Fe.getTime()-ht.getTime()}));if(c(),le){var Te=t.currentYear!==Ae.getFullYear();t.currentYear=Ae.getFullYear(),t.currentMonth=Ae.getMonth(),Te&&(Ke("onYearChange"),K()),Ke("onMonthChange")}if(at(),B(),It(),!le&&t.config.mode!=="range"&&t.config.showMonths===1?O(ae):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var fe=t.config.mode==="single"&&!t.config.enableTime,de=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(fe||de)&&st()}b()}}var _e={locale:[We,x],showMonths:[H,r,te],minDate:[S],maxDate:[S],positionElement:[wt],clickOpens:[function(){t.config.clickOpens===!0?(v(t._input,"focus",t.open),v(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ie(N,z){if(N!==null&&typeof N=="object"){Object.assign(t.config,N);for(var ne in N)_e[ne]!==void 0&&_e[ne].forEach(function(ae){return ae()})}else t.config[N]=z,_e[N]!==void 0?_e[N].forEach(function(ae){return ae()}):kr.indexOf(N)>-1&&(t.config[N]=wr(z));t.redraw(),It(!0)}function nt(N,z){var ne=[];if(N instanceof Array)ne=N.map(function(ae){return t.parseDate(ae,z)});else if(N instanceof Date||typeof N=="number")ne=[t.parseDate(N,z)];else if(typeof N=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(N,z)];break;case"multiple":ne=N.split(t.config.conjunction).map(function(ae){return t.parseDate(ae,z)});break;case"range":ne=N.split(t.l10n.rangeSeparator).map(function(ae){return t.parseDate(ae,z)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(N)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(ae){return ae instanceof Date&&Q(ae,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ae,Ae){return ae.getTime()-Ae.getTime()})}function ft(N,z,ne){if(z===void 0&&(z=!1),ne===void 0&&(ne=t.config.dateFormat),N!==0&&!N||N instanceof Array&&N.length===0)return t.clear(z);nt(N,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,z),d(),t.selectedDates.length===0&&t.clear(!1),It(z),z&&Ke("onChange")}function vt(N){return N.slice().map(function(z){return typeof z=="string"||typeof z=="number"||z instanceof Date?t.parseDate(z,void 0,!0):z&&typeof z=="object"&&z.from&&z.to?{from:t.parseDate(z.from,void 0),to:t.parseDate(z.to,void 0)}:z}).filter(function(z){return z})}function ot(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var N=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);N&&nt(N,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Ot(){if(t.input=tt(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=St(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),wt()}function wt(){t._positionElement=t.config.positionElement||t._input}function jt(){var N=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=St("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=N,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}v(t.mobileInput,"change",function(z){t.setDate(On(z).value,!1,t.mobileFormatStr),Ke("onChange"),Ke("onClose")})}function Nt(N){if(t.isOpen===!0)return t.close();t.open(N)}function Ke(N,z){if(t.config!==void 0){var ne=t.config[N];if(ne!==void 0&&ne.length>0)for(var ae=0;ne[ae]&&ae=0&&En(N,t.selectedDates[1])<=0}function at(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(N,z){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+z),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[z].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),N.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Pt(N){var z=N||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,z)}).filter(function(ne,ae,Ae){return t.config.mode!=="range"||t.config.enableTime||Ae.indexOf(ne)===ae}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function It(N){N===void 0&&(N=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Pt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Pt(t.config.altFormat)),N!==!1&&Ke("onValueUpdate")}function Lt(N){var z=On(N),ne=t.prevMonthNav.contains(z),ae=t.nextMonthNav.contains(z);ne||ae?me(ne?-1:1):t.yearElements.indexOf(z)>=0?z.select():z.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):z.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function lt(N){N.preventDefault();var z=N.type==="keydown",ne=On(N),ae=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Rn(t.amPM.textContent===t.l10n.amPM[0])]);var Ae=parseFloat(ae.getAttribute("min")),le=parseFloat(ae.getAttribute("max")),ye=parseFloat(ae.getAttribute("step")),Te=parseInt(ae.value,10),fe=N.delta||(z?N.which===38?1:-1:0),de=Te+ye*fe;if(typeof ae.value<"u"&&ae.value.length===2){var Fe=ae===t.hourElement,ht=ae===t.minuteElement;dele&&(de=ae===t.hourElement?de-le-Rn(!t.amPM):Ae,ht&&$(void 0,1,t.hourElement)),t.amPM&&Fe&&(ye===1?de+Te===23:Math.abs(de-Te)>ye)&&(t.amPM.textContent=t.l10n.amPM[Rn(t.amPM.textContent===t.l10n.amPM[0])]),ae.value=bn(de)}}return s(),t}function ws(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s{const $=f||m,M=y(d);return M.onReady.push(()=>{t(8,h=!0)}),t(3,v=Zt($,Object.assign(M,f?{wrap:!0}:{}))),()=>{v.destroy()}});const b=on();function y($={}){$=Object.assign({},$);for(const M of r){const D=(O,A,I)=>{b(cS(M),[O,A,I])};M in $?(Array.isArray($[M])||($[M]=[$[M]]),$[M].push(D)):$[M]=[D]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,M,D){var A,I;const O=(I=(A=D==null?void 0:D.config)==null?void 0:A.mode)!=null?I:"single";t(2,a=O==="single"?$[0]:$),t(4,u=M)}function C($){he[$?"unshift":"push"](()=>{m=$,t(0,m)})}return n.$$set=$=>{e=pt(pt({},e),di($)),t(1,s=Jt(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,m=$.input),"flatpickr"in $&&t(3,v=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&h&&v.setDate(a,!1,c),n.$$.dirty&392&&v&&h)for(const[$,M]of Object.entries(y(d)))v.set($,M)},[m,s,a,v,u,f,c,d,h,o,l,C]}class Wa extends Ee{constructor(e){super(),Oe(this,e,dS,fS,De,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function pS(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:U.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new Wa({props:u}),he.push(()=>Re(l,"formattedValue",a)),{c(){e=_("label"),t=F("Min date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),g(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,He(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function hS(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:U.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new Wa({props:u}),he.push(()=>Re(l,"formattedValue",a)),{c(){e=_("label"),t=F("Max date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),g(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,He(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function mS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[pS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[hS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function gS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class _S extends Ee{constructor(e){super(),Oe(this,e,gS,mS,De,{key:1,options:0})}}function bS(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new cs({props:c}),he.push(()=>Re(l,"value",f)),{c(){e=_("label"),t=F("Choices"),s=T(),V(l.$$.fragment),r=T(),a=_("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,h){w(d,e,h),g(e,t),w(d,s,h),j(l,d,h),w(d,r,h),w(d,a,h),u=!0},p(d,h){(!u||h&16&&i!==(i=d[4]))&&p(e,"for",i);const m={};h&16&&(m.id=d[4]),!o&&h&1&&(o=!0,m.value=d[0].values,He(()=>o=!1)),l.$set(m)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&k(e),d&&k(s),q(l,d),d&&k(r),d&&k(a)}}}function vS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function yS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[bS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[vS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){w(a,e,u),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function kS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=At(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class wS extends Ee{constructor(e){super(),Oe(this,e,kS,yS,De,{key:1,options:0})}}function $S(n,e,t){return["",{}]}class SS extends Ee{constructor(e){super(),Oe(this,e,$S,null,De,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function CS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max file size (bytes)"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSize),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSize&&Me(l,u[0].maxSize)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function MS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max files"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min",""),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("div"),e.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',t=T(),i=_("div"),i.innerHTML='Images (jpg, png, svg, gif)',s=T(),l=_("div"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=T(),r=_("div"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"tabindex","0"),p(e,"class","dropdown-item closable"),p(i,"tabindex","0"),p(i,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable"),p(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[G(e,"click",n[5]),G(i,"click",n[6]),G(l,"click",n[7]),G(r,"click",n[8])],a=!0)},p:re,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,Qe(u)}}}function DS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S;function C(M){n[4](M)}let $={id:n[10],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&($.value=n[0].mimeTypes),r=new cs({props:$}),he.push(()=>Re(r,"value",C)),v=new qi({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[TS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Mime types",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=F(`Use comma as separator. - `),d=_("span"),h=_("span"),h.textContent="Choose presets",m=T(),V(v.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(f,"class","help-block")},m(M,D){w(M,e,D),g(e,t),g(e,i),g(e,s),w(M,o,D),j(r,M,D),w(M,u,D),w(M,f,D),g(f,c),g(f,d),g(d,h),g(d,m),j(v,d,null),b=!0,y||(S=Ye(Ct.call(null,s,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&p(e,"for",l);const O={};D&1024&&(O.id=M[10]),!a&&D&1&&(a=!0,O.value=M[0].mimeTypes,He(()=>a=!1)),r.$set(O);const A={};D&2049&&(A.$$scope={dirty:D,ctx:M}),v.$set(A)},i(M){b||(E(r.$$.fragment,M),E(v.$$.fragment,M),b=!0)},o(M){P(r.$$.fragment,M),P(v.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(o),q(r,M),M&&k(u),M&&k(f),q(v),y=!1,S()}}}function OS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[9](b)}let v={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),r=new cs({props:v}),he.push(()=>Re(r,"value",m)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(f,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(Ct.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&1024&&l!==(l=b[10]))&&p(e,"for",l);const S={};y&1024&&(S.id=b[10]),!a&&y&1&&(a=!0,S.value=b[0].thumbs,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function ES(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[CS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[MS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[DS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[OS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(m,v){w(m,e,v),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),g(e,a),j(u,a,null),g(e,f),g(e,c),j(d,c,null),h=!0},p(m,[v]){const b={};v&2&&(b.name="schema."+m[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:m}),i.$set(b);const y={};v&2&&(y.name="schema."+m[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:m}),o.$set(y);const S={};v&2&&(S.name="schema."+m[1]+".options.mimeTypes"),v&3073&&(S.$$scope={dirty:v,ctx:m}),u.$set(S);const C={};v&2&&(C.name="schema."+m[1]+".options.thumbs"),v&3073&&(C.$$scope={dirty:v,ctx:m}),d.$set(C)},i(m){h||(E(i.$$.fragment,m),E(o.$$.fragment,m),E(u.$$.fragment,m),E(d.$$.fragment,m),h=!0)},o(m){P(i.$$.fragment,m),P(o.$$.fragment,m),P(u.$$.fragment,m),P(d.$$.fragment,m),h=!1},d(m){m&&k(e),q(i),q(o),q(u),q(d)}}}function AS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=At(this.value),t(0,s)}function o(){s.maxSelect=At(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.options)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class PS extends Ee{constructor(e){super(),Oe(this,e,AS,ES,De,{key:1,options:0})}}function LS(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new fs({props:u}),he.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Collection"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),g(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,He(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function IS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function FS(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={id:n[9],items:n[4]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new fs({props:u}),he.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on relation delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),g(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&512&&(d.id=f[9]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function NS(n){let e,t,i,s,l,o,r,a,u,f;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[LS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[IS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[FS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),g(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&1549&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const m={};d&2&&(m.name="schema."+c[1]+".options.maxSelect"),d&1537&&(m.$$scope={dirty:d,ctx:c}),o.$set(m);const v={};d&2&&(v.name="schema."+c[1]+".options.cascadeDelete"),d&1537&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),q(i),q(o),q(u)}}}function RS(n,e,t){let{key:i=""}=e,{options:s={}}=e;const l=[{label:"False",value:!1},{label:"True",value:!0}];let o=!1,r=[];a();function a(){t(2,o=!0),be.collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,r=d)}).catch(d=>{be.errorResponseHandler(d)}).finally(()=>{t(2,o=!1)})}function u(d){n.$$.not_equal(s.collectionId,d)&&(s.collectionId=d,t(0,s))}function f(){s.maxSelect=At(this.value),t(0,s)}function c(d){n.$$.not_equal(s.cascadeDelete,d)&&(s.cascadeDelete=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(s)&&t(0,s={maxSelect:1,collectionId:null,cascadeDelete:!1})},[s,i,o,r,l,u,f,c]}class HS extends Ee{constructor(e){super(),Oe(this,e,RS,NS,De,{key:1,options:0})}}function jS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&At(l.value)!==u[0].maxSelect&&Me(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function qS(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new fs({props:u}),he.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on user delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[5])},m(f,c){w(f,e,c),g(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&p(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function VS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[jS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[qS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.maxSelect"),u&97&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.cascadeDelete"),u&97&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function zS(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=At(this.value),t(0,l)}function r(a){n.$$.not_equal(l.cascadeDelete,a)&&(l.cascadeDelete=a,t(0,l))}return n.$$set=a=>{"key"in a&&t(1,s=a.key),"options"in a&&t(0,l=a.options)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(l)&&t(0,l={maxSelect:1,cascadeDelete:!1})},[l,s,i,o,r]}class BS extends Ee{constructor(e){super(),Oe(this,e,zS,VS,De,{key:1,options:0})}}function US(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[38],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new I$({props:u}),he.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=F("Type"),s=T(),V(l.$$.fragment),p(e,"for",i=n[38])},m(f,c){w(f,e,c),g(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c[1]&128&&i!==(i=f[38]))&&p(e,"for",i);const d={};c[1]&128&&(d.id=f[38]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,He(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),q(l,f)}}}function Ic(n){let e,t,i;return{c(){e=_("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=rt(e,Bn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=rt(e,Bn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function WS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m=!n[5]&&Ic();return{c(){e=_("label"),t=_("span"),t.textContent="Name",i=T(),m&&m.c(),l=T(),o=_("input"),p(t,"class","txt"),p(e,"for",s=n[38]),p(o,"type","text"),p(o,"id",r=n[38]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(v,b){w(v,e,b),g(e,t),g(e,i),m&&m.m(e,null),w(v,l,b),w(v,o,b),c=!0,n[0].id||o.focus(),d||(h=G(o,"input",n[17]),d=!0)},p(v,b){v[5]?m&&(Pe(),P(m,1,1,()=>{m=null}),Le()):m?b[0]&32&&E(m,1):(m=Ic(),m.c(),E(m,1),m.m(e,null)),(!c||b[1]&128&&s!==(s=v[38]))&&p(e,"for",s),(!c||b[1]&128&&r!==(r=v[38]))&&p(o,"id",r),(!c||b[0]&1&&a!==(a=v[0].id&&v[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!v[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=v[0].name)&&o.value!==f)&&(o.value=f)},i(v){c||(E(m),c=!0)},o(v){P(m),c=!1},d(v){v&&k(e),m&&m.d(),v&&k(l),v&&k(o),d=!1,h()}}}function YS(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new BS({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function KS(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new HS({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function ZS(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new PS({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function JS(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new SS({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function GS(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new wS({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function XS(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new _S({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function QS(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new nS({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function xS(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new A_({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function e3(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new K$({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function t3(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new W$({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function n3(n){let e,t,i;function s(o){n[18](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new q$({props:l}),he.push(()=>Re(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function i3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Required"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].required,w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[29]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].required),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Fc(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[s3,({uniqueId:i})=>({38:i}),({uniqueId:i})=>[0,i?128:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&384&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function s3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].unique,w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[30]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Nc(n){let e,t,i,s,l,o,r,a,u,f;a=new qi({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[l3]},$$scope:{ctx:n}}});let c=n[8]&&Rc(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),l=_("button"),o=_("i"),r=T(),V(a.$$.fragment),u=T(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"class","btn btn-circle btn-sm btn-secondary"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,h){w(d,e,h),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),j(a,l,null),g(s,u),c&&c.m(s,null),f=!0},p(d,h){const m={};h[1]&256&&(m.$$scope={dirty:h,ctx:d}),a.$set(m),d[8]?c?c.p(d,h):(c=Rc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(E(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&k(e),q(a),c&&c.d()}}}function l3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[9]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Rc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Done',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[3])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function o3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D;s=new Ne({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[US,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}}),r=new Ne({props:{class:` - form-field - required - `+(n[5]?"":"invalid")+` - `+(n[0].id&&n[0].system?"disabled":"")+` - `,name:"schema."+n[1]+".name",$$slots:{default:[WS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const O=[n3,t3,e3,xS,QS,XS,GS,JS,ZS,KS,YS],A=[];function I(B,K){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=I(n))&&(c=A[f]=O[f](n)),m=new Ne({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[i3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&Fc(n),R=!n[0].toDelete&&Nc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),V(m.$$.fragment),v=T(),b=_("div"),L&&L.c(),y=T(),R&&R.c(),S=T(),C=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(C,"type","submit"),p(C,"class","hidden"),p(C,"tabindex","-1"),p(e,"class","field-form")},m(B,K){w(B,e,K),g(e,t),g(t,i),j(s,i,null),g(t,l),g(t,o),j(r,o,null),g(t,a),g(t,u),~f&&A[f].m(u,null),g(t,d),g(t,h),j(m,h,null),g(t,v),g(t,b),L&&L.m(b,null),g(t,y),R&&R.m(t,null),g(e,S),g(e,C),$=!0,M||(D=G(e,"submit",Yt(n[31])),M=!0)},p(B,K){const J={};K[0]&1&&(J.class="form-field required "+(B[0].id?"disabled":"")),K[0]&2&&(J.name="schema."+B[1]+".type"),K[0]&1|K[1]&384&&(J.$$scope={dirty:K,ctx:B}),s.$set(J);const H={};K[0]&33&&(H.class=` - form-field - required - `+(B[5]?"":"invalid")+` - `+(B[0].id&&B[0].system?"disabled":"")+` - `),K[0]&2&&(H.name="schema."+B[1]+".name"),K[0]&33|K[1]&384&&(H.$$scope={dirty:K,ctx:B}),r.$set(H);let X=f;f=I(B),f===X?~f&&A[f].p(B,K):(c&&(Pe(),P(A[X],1,1,()=>{A[X]=null}),Le()),~f?(c=A[f],c?c.p(B,K):(c=A[f]=O[f](B),c.c()),E(c,1),c.m(u,null)):c=null);const W={};K[0]&1|K[1]&384&&(W.$$scope={dirty:K,ctx:B}),m.$set(W),B[0].type!=="file"?L?(L.p(B,K),K[0]&1&&E(L,1)):(L=Fc(B),L.c(),E(L,1),L.m(b,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),B[0].toDelete?R&&(Pe(),P(R,1,1,()=>{R=null}),Le()):R?(R.p(B,K),K[0]&1&&E(R,1)):(R=Nc(B),R.c(),E(R,1),R.m(t,null))},i(B){$||(E(s.$$.fragment,B),E(r.$$.fragment,B),E(c),E(m.$$.fragment,B),E(L),E(R),$=!0)},o(B){P(s.$$.fragment,B),P(r.$$.fragment,B),P(c),P(m.$$.fragment,B),P(L),P(R),$=!1},d(B){B&&k(e),q(s),q(r),~f&&A[f].d(),q(m),L&&L.d(),R&&R.d(),M=!1,D()}}}function Hc(n){let e,t,i,s,l=n[0].system&&jc(),o=!n[0].id&&qc(n),r=n[0].required&&Vc(),a=n[0].unique&&zc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=jc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=qc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Vc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=zc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function jc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ie(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ie(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=rt(e,Un,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=rt(e,Un,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Uc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[15])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function r3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,m,v,b,y=!n[0].toDelete&&Hc(n),S=n[7]&&!n[0].system&&Bc(),C=n[0].toDelete&&Uc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=F(r),f=T(),y&&y.c(),c=T(),d=_("div"),h=T(),S&&S.c(),m=T(),C&&C.c(),v=Je(),p(i,"class",s=Ja(U.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ie(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){w($,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),w($,f,M),y&&y.m($,M),w($,c,M),w($,d,M),w($,h,M),S&&S.m($,M),w($,m,M),C&&C.m($,M),w($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Ja(U.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&ue(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ie(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?y&&(y.d(1),y=null):y?y.p($,M):(y=Hc($),y.c(),y.m(c.parentNode,c)),$[7]&&!$[0].system?S?M[0]&129&&E(S,1):(S=Bc(),S.c(),E(S,1),S.m(m.parentNode,m)):S&&(Pe(),P(S,1,1,()=>{S=null}),Le()),$[0].toDelete?C?C.p($,M):(C=Uc($),C.c(),C.m(v.parentNode,v)):C&&(C.d(1),C=null)},i($){b||(E(S),b=!0)},o($){P(S),b=!1},d($){$&&k(e),$&&k(f),y&&y.d($),$&&k(c),$&&k(d),$&&k(h),S&&S.d($),$&&k(m),C&&C.d($),$&&k(v)}}}function a3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[r3],default:[o3]},$$scope:{ctx:n}};return e=new Ua({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&256&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[32](null),q(e,s)}}}function u3(n,e,t){let i,s,l,o,r;kt(n,as,Y=>t(14,r=Y));const a=on();let{key:u="0"}=e,{field:f=new Tn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,h,m=f.type;function v(){h==null||h.expand()}function b(){h==null||h.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function S(Y){if(Y=(""+Y).toLowerCase(),!Y)return!1;for(const ve of d)if(ve.toLowerCase()===Y)return!1;return!0}function C(Y){return U.slugify(Y)}Zn(()=>{f.id||v()});const $=()=>{t(0,f.toDelete=!1,f)};function M(Y){n.$$.not_equal(f.type,Y)&&(f.type=Y,t(0,f),t(13,m),t(4,h))}const D=Y=>{t(0,f.name=C(Y.target.value),f),Y.target.value=f.name};function O(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function A(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function I(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function L(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function R(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function B(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function K(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function J(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function H(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function X(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function W(Y){n.$$.not_equal(f.options,Y)&&(f.options=Y,t(0,f),t(13,m),t(4,h))}function te(){f.required=this.checked,t(0,f),t(13,m),t(4,h)}function x(){f.unique=this.checked,t(0,f),t(13,m),t(4,h)}const oe=()=>{i&&b()};function me(Y){he[Y?"unshift":"push"](()=>{h=Y,t(4,h)})}function se(Y){ut.call(this,n,Y)}function ge(Y){ut.call(this,n,Y)}function ke(Y){ut.call(this,n,Y)}return n.$$set=Y=>{"key"in Y&&t(1,u=Y.key),"field"in Y&&t(0,f=Y.field),"disabled"in Y&&t(2,c=Y.disabled),"excludeNames"in Y&&t(11,d=Y.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&8193&&m!=f.type&&(t(13,m=f.type),t(0,f.options={},f),t(0,f.unique=!1,f)),n.$$.dirty[0]&17&&f.toDelete&&(h&&b(),f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f)),n.$$.dirty[0]&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty[0]&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty[0]&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty[0]&1&&t(6,i=!U.isEmpty(f.name)&&f.type),n.$$.dirty[0]&80&&(i||h&&v()),n.$$.dirty[0]&69&&t(8,s=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=S(f.name)),n.$$.dirty[0]&16418&&t(7,o=!l||!U.isEmpty(U.getNestedVal(r,`schema.${u}`)))},[f,u,c,b,h,l,i,o,s,y,C,d,v,m,r,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke]}class f3 extends Ee{constructor(e){super(),Oe(this,e,u3,a3,De,{key:1,field:0,disabled:2,excludeNames:11,expand:12,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[12]}get collapse(){return this.$$.ctx[3]}}function Wc(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Yc(n,e){let t,i,s,l;function o(u){e[5](u,e[9],e[10],e[11])}function r(){return e[6](e[11])}let a={key:e[11],excludeNames:e[1].concat(e[4](e[9]))};return e[9]!==void 0&&(a.field=e[9]),i=new f3({props:a}),he.push(()=>Re(i,"field",o)),i.$on("remove",r),{key:n,first:null,c(){t=Je(),V(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),j(i,u,f),l=!0},p(u,f){e=u;const c={};f&1&&(c.key=e[11]),f&1&&(c.excludeNames=e[1].concat(e[4](e[9]))),!s&&f&1&&(s=!0,c.field=e[9],He(()=>s=!1)),i.$set(c)},i(u){l||(E(i.$$.fragment,u),l=!0)},o(u){P(i.$$.fragment,u),l=!1},d(u){u&&k(t),q(i,u)}}}function c3(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,h,m,v=n[0].schema;const b=y=>y[11];for(let y=0;yh.name===d)}function u(d){let h=[];if(d.toDelete)return h;for(let m of s.schema)m===d||m.toDelete||h.push(m.name);return h}function f(d,h,m,v){m[v]=d,t(0,s)}const c=d=>l(d);return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof(s==null?void 0:s.schema)>"u"&&(t(0,s=s||{}),t(0,s.schema=[],s))},[s,i,l,o,u,f,c]}class p3 extends Ee{constructor(e){super(),Oe(this,e,d3,c3,De,{collection:0})}}function Kc(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[16]=e,i[17]=t,i}function Zc(n,e,t){const i=n.slice();return i[19]=e[t],i}function Jc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L,R,B,K,J,H=n[0].schema,X=[];for(let W=0;W@request filter:",y=T(),S=_("div"),S.innerHTML=`@request.method - @request.query.* - @request.data.* - @request.user.*`,C=T(),$=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the @collection filter:",O=T(),A=_("div"),A.innerHTML="@collection.ANY_COLLECTION_NAME.*",I=T(),L=_("hr"),R=T(),B=_("p"),B.innerHTML=`Example rule: -
- @request.user.id!="" && created>"2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(m,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(A,"class","inline-flex flex-gap-5"),p(L,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(W,te){w(W,e,te),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(o,r),g(o,a),g(o,u),g(o,f),g(o,c),g(o,d);for(let x=0;x{K||(K=rt(e,tn,{duration:150},!0)),K.run(1)}),J=!0)},o(W){W&&(K||(K=rt(e,tn,{duration:150},!1)),K.run(0)),J=!1},d(W){W&&k(e),xt(X,W),W&&K&&K.end()}}}function h3(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=F(t)},m(s,l){w(s,e,l),g(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function m3(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=F(t),s=F(".*")},m(l,o){w(l,e,o),g(e,i),g(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function Gc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?m3:h3}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function g3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[14];for(let r=0;r',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function b3(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(Ct.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Qe(i)}}}function v3(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(Ct.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Qe(i)}}}function y3(n){let e;return{c(){e=F("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function k3(n){let e;return{c(){e=F("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function w3(n){let e,t=n[15]+"",i,s,l=Ai(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,h,m,v,b,y;function S(){return n[10](n[14])}const C=()=>n[11](u,f),$=()=>n[11](null,f);function M(R){n[12](R,n[14])}var D=n[4];function O(R){let B={baseCollection:R[0],disabled:Ai(R[0][R[14]])};return R[0][R[14]]!==void 0&&(B.value=R[0][R[14]]),{props:B}}D&&(u=new D(O(n)),C(),he.push(()=>Re(u,"value",M)));function A(R,B){return B&1&&(m=null),m==null&&(m=!!Ai(R[0][R[14]])),m?k3:y3}let I=A(n,-1),L=I(n);return{c(){e=_("label"),i=F(t),s=F(" - "),o=F(l),a=T(),u&&V(u.$$.fragment),d=T(),h=_("div"),L.c(),p(e,"for",r=n[18]),p(h,"class","help-block")},m(R,B){w(R,e,B),g(e,i),g(e,s),g(e,o),w(R,a,B),u&&j(u,R,B),w(R,d,B),w(R,h,B),L.m(h,null),v=!0,b||(y=G(e,"click",S),b=!0)},p(R,B){n=R,(!v||B&1)&&l!==(l=Ai(n[0][n[14]])?"Admins only":"Custom rule")&&ue(o,l),(!v||B&262144&&r!==(r=n[18]))&&p(e,"for",r),f!==n[14]&&($(),f=n[14],C());const K={};if(B&1&&(K.baseCollection=n[0]),B&1&&(K.disabled=Ai(n[0][n[14]])),!c&&B&65&&(c=!0,K.value=n[0][n[14]],He(()=>c=!1)),D!==(D=n[4])){if(u){Pe();const J=u;P(J.$$.fragment,1,0,()=>{q(J,1)}),Le()}D?(u=new D(O(n)),C(),he.push(()=>Re(u,"value",M)),V(u.$$.fragment),E(u.$$.fragment,1),j(u,d.parentNode,d)):u=null}else D&&u.$set(K);I!==(I=A(n,B))&&(L.d(1),L=I(n),L&&(L.c(),L.m(h,null)))},i(R){v||(u&&E(u.$$.fragment,R),v=!0)},o(R){u&&P(u.$$.fragment,R),v=!1},d(R){R&&k(e),R&&k(a),$(),u&&q(u,R),R&&k(d),R&&k(h),L.d(),b=!1,y()}}}function Xc(n,e){let t,i,s,l,o,r,a,u;function f(h,m){return m&1&&(l=null),l==null&&(l=!!Ai(h[0][h[14]])),l?v3:b3}let c=f(e,-1),d=c(e);return r=new Ne({props:{class:"form-field rule-field m-0 "+(Ai(e[0][e[14]])?"disabled":""),name:e[14],$$slots:{default:[w3,({uniqueId:h})=>({18:h}),({uniqueId:h})=>h?262144:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=_("hr"),i=T(),s=_("div"),d.c(),o=T(),V(r.$$.fragment),a=T(),p(t,"class","m-t-sm m-b-sm"),p(s,"class","rule-block svelte-fjxz7k"),this.first=t},m(h,m){w(h,t,m),w(h,i,m),w(h,s,m),d.m(s,null),g(s,o),j(r,s,null),g(s,a),u=!0},p(h,m){e=h,c===(c=f(e,m))&&d?d.p(e,m):(d.d(1),d=c(e),d&&(d.c(),d.m(s,o)));const v={};m&1&&(v.class="form-field rule-field m-0 "+(Ai(e[0][e[14]])?"disabled":"")),m&4456473&&(v.$$scope={dirty:m,ctx:e}),r.$set(v)},i(h){u||(E(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&k(t),h&&k(i),h&&k(s),d.d(),q(r)}}}function $3(n){let e,t,i,s,l,o=n[2]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,m,v,b=n[2]&&Jc(n);const y=[_3,g3],S=[];function C($,M){return $[5]?0:1}return f=C(n),c=S[f]=y[f](n),{c(){e=_("div"),t=_("div"),i=_("p"),i.innerHTML=`All rules follow the -
PocketBase filter syntax and operators - .`,s=T(),l=_("span"),r=F(o),a=T(),b&&b.c(),u=T(),c.c(),d=Je(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),b&&b.m(e,null),w($,u,M),S[f].m($,M),w($,d,M),h=!0,m||(v=G(l,"click",n[7]),m=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ue(r,o),$[2]?b?(b.p($,M),M&4&&E(b,1)):(b=Jc($),b.c(),E(b,1),b.m(e,null)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le());let D=f;f=C($),f===D?S[f].p($,M):(Pe(),P(S[D],1,1,()=>{S[D]=null}),Le(),c=S[f],c?c.p($,M):(c=S[f]=y[f]($),c.c()),E(c,1),c.m(d.parentNode,d))},i($){h||(E(b),E(c),h=!0)},o($){P(b),P(c),h=!1},d($){$&&k(e),b&&b.d(),$&&k(u),S[f].d($),$&&k(d),m=!1,v()}}}function Ai(n){return n===null}function S3(n,e,t){let{collection:i=new fn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Xi(()=>import("./FilterAutocompleteInput.8c09e039.js"),[],import.meta.url)).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Zn(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var S;t(0,i[y]=s[y]||"",i),await ni(),(S=o[y])==null||S.focus()},h=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},m=y=>{var S;return(S=o[y])==null?void 0:S.focus()};function v(y,S){he[y?"unshift":"push"](()=>{o[S]=y,t(3,o)})}function b(y,S){n.$$.not_equal(i[S],y)&&(i[S]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,h,m,v,b]}class C3 extends Ee{constructor(e){super(),Oe(this,e,S3,$3,De,{collection:0})}}function Qc(n,e,t){const i=n.slice();return i[14]=e[t],i}function xc(n,e,t){const i=n.slice();return i[14]=e[t],i}function ed(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function td(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed collection - `),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,m){w(h,e,m),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(h,m){m&2&&l!==(l=h[1].originalName+"")&&ue(o,l),m&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function nd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed field - `),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,m){w(h,e,m),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(h,m){m&16&&l!==(l=h[14].originalName+"")&&ue(o,l),m&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function id(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=F("Removed field "),i=_("span"),l=F(s),o=T(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function M3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&ed(),m=n[5]&&td(n),v=n[4],b=[];for(let C=0;C',i=T(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to - update it manually!`,o=T(),h&&h.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),m&&m.c(),c=T();for(let C=0;CCancel',t=T(),i=_("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:re,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Qe(l)}}}function O3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[D3],header:[T3],default:[M3]},$$scope:{ctx:n}};return e=new hi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),q(e,s)}}}function E3(n,e,t){let i,s,l;const o=on();let r,a;async function u(y){t(1,a=y),await ni(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function m(y){he[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){ut.call(this,n,y)}function b(y){ut.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,m,v,b]}class A3 extends Ee{constructor(e){super(),Oe(this,e,E3,O3,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function sd(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new C3({props:o}),he.push(()=>Re(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),q(t)}}}function P3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new p3({props:a}),he.push(()=>Re(i,"collection",r));let u=n[9]===ml&&sd(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ie(t,"active",n[9]===ls),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),g(e,t),j(i,t,null),g(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),c[0]&512&&ie(t,"active",f[9]===ls),f[9]===ml?u?(u.p(f,c),c[0]&512&&E(u,1)):(u=sd(f),u.c(),E(u,1),u.m(e,null)):u&&(Pe(),P(u,1,1,()=>{u=null}),Le())},i(f){o||(E(i.$$.fragment,f),E(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),q(i),u&&u.d()}}}function ld(n){let e,t,i,s,l,o,r;return o=new qi({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[L3]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("i"),l=T(),V(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),g(i,s),g(i,l),j(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),q(o)}}}function L3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=` - Delete`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[20]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function od(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function I3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&od();return{c(){e=_("label"),t=F("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Je(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(m,v){w(m,e,v),g(e,t),w(m,s,v),w(m,l,v),w(m,u,v),h&&h.m(m,v),w(m,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(m,v){v[1]&128&&i!==(i=m[38])&&p(e,"for",i),v[1]&128&&o!==(o=m[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=m[11]),v[0]&4&&r!==(r=m[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=m[2].name)&&l.value!==a&&(l.value=a),m[2].system?h||(h=od(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(m){m&&k(e),m&&k(s),m&&k(l),m&&k(u),h&&h.d(m),m&&k(f),c=!1,d()}}}function rd(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=Ct.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Dt(()=>{i||(i=rt(e,Un,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=rt(e,Un,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function ad(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Dt(()=>{t||(t=rt(e,Un,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=rt(e,Un,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function F3(n){var R,B,K,J,H,X;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,m,v=!U.isEmpty((R=n[4])==null?void 0:R.schema),b,y,S,C,$=!U.isEmpty((B=n[4])==null?void 0:B.listRule)||!U.isEmpty((K=n[4])==null?void 0:K.viewRule)||!U.isEmpty((J=n[4])==null?void 0:J.createRule)||!U.isEmpty((H=n[4])==null?void 0:H.updateRule)||!U.isEmpty((X=n[4])==null?void 0:X.deleteRule),M,D,O,A=!n[2].isNew&&!n[2].system&&ld(n);r=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[I3,({uniqueId:W})=>({38:W}),({uniqueId:W})=>[0,W?128:0]]},$$scope:{ctx:n}}});let I=v&&rd(n),L=$&&ad();return{c(){e=_("h4"),i=F(t),s=T(),A&&A.c(),l=T(),o=_("form"),V(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",m=T(),I&&I.c(),b=T(),y=_("button"),S=_("span"),S.textContent="API Rules",C=T(),L&&L.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ie(d,"active",n[9]===ls),p(S,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ie(y,"active",n[9]===ml),p(c,"class","tabs-header stretched")},m(W,te){w(W,e,te),g(e,i),w(W,s,te),A&&A.m(W,te),w(W,l,te),w(W,o,te),j(r,o,null),g(o,a),g(o,u),w(W,f,te),w(W,c,te),g(c,d),g(d,h),g(d,m),I&&I.m(d,null),g(c,b),g(c,y),g(y,S),g(y,C),L&&L.m(y,null),M=!0,D||(O=[G(o,"submit",Yt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(W,te){var oe,me,se,ge,ke,Y;(!M||te[0]&4)&&t!==(t=W[2].isNew?"New collection":"Edit collection")&&ue(i,t),!W[2].isNew&&!W[2].system?A?(A.p(W,te),te[0]&4&&E(A,1)):(A=ld(W),A.c(),E(A,1),A.m(l.parentNode,l)):A&&(Pe(),P(A,1,1,()=>{A=null}),Le());const x={};te[0]&2048&&(x.class="form-field required m-b-0 "+(W[11]?"disabled":"")),te[0]&2052|te[1]&384&&(x.$$scope={dirty:te,ctx:W}),r.$set(x),te[0]&16&&(v=!U.isEmpty((oe=W[4])==null?void 0:oe.schema)),v?I?(I.p(W,te),te[0]&16&&E(I,1)):(I=rd(W),I.c(),E(I,1),I.m(d,null)):I&&(Pe(),P(I,1,1,()=>{I=null}),Le()),te[0]&512&&ie(d,"active",W[9]===ls),te[0]&16&&($=!U.isEmpty((me=W[4])==null?void 0:me.listRule)||!U.isEmpty((se=W[4])==null?void 0:se.viewRule)||!U.isEmpty((ge=W[4])==null?void 0:ge.createRule)||!U.isEmpty((ke=W[4])==null?void 0:ke.updateRule)||!U.isEmpty((Y=W[4])==null?void 0:Y.deleteRule)),$?L?te[0]&16&&E(L,1):(L=ad(),L.c(),E(L,1),L.m(y,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),te[0]&512&&ie(y,"active",W[9]===ml)},i(W){M||(E(A),E(r.$$.fragment,W),E(I),E(L),M=!0)},o(W){P(A),P(r.$$.fragment,W),P(I),P(L),M=!1},d(W){W&&k(e),W&&k(s),A&&A.d(W),W&&k(l),W&&k(o),q(r),W&&k(f),W&&k(c),I&&I.d(),L&&L.d(),D=!1,Qe(O)}}}function N3(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(l,r),u||(f=[G(e,"click",n[18]),G(s,"click",n[19])],u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Qe(f)}}}function R3(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header compact-header collection-panel",beforeHide:n[27],$$slots:{footer:[N3],header:[F3],default:[P3]},$$scope:{ctx:n}};e=new hi({props:l}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let o={};return i=new A3({props:o}),n[31](i),i.$on("confirm",n[32]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),s=!0},p(r,a){const u={};a[0]&264&&(u.beforeHide=r[27]),a[0]&7828|a[1]&256&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[28](null),q(e,r),r&&k(t),n[31](null),q(i,r)}}}const ls="fields",ml="api_rules";function Mr(n){return JSON.stringify(n)}function H3(n,e,t){let i,s,l,o,r,a;kt(n,ui,Y=>t(34,r=Y)),kt(n,as,Y=>t(4,a=Y));const u=on();let f,c,d=null,h=new fn,m=!1,v=!1,b=ls,y=Mr(h);function S(Y){t(9,b=Y)}function C(Y){return M(Y),t(8,v=!0),S(ls),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(Y){Si({}),typeof Y<"u"?(d=Y,t(2,h=Y==null?void 0:Y.clone())):(d=null,t(2,h=new fn)),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await ni(),t(17,y=Mr(h))}function D(){if(h.isNew)return O();c==null||c.show(h)}function O(){if(m)return;t(7,m=!0);const Y=A();let ve;h.isNew?ve=be.collections.create(Y):ve=be.collections.update(h.id,Y),ve.then(ee=>{t(8,v=!1),$(),cn(h.isNew?"Successfully created collection.":"Successfully updated collection."),a$(ee),h.isNew&&dn(ui,r=ee,r),u("save",ee)}).catch(ee=>{be.errorResponseHandler(ee)}).finally(()=>{t(7,m=!1)})}function A(){const Y=h.export();Y.schema=Y.schema.slice(0);for(let ve=Y.schema.length-1;ve>=0;ve--)Y.schema[ve].toDelete&&Y.schema.splice(ve,1);return Y}function I(){!(d!=null&&d.id)||ci(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>be.collections.delete(d==null?void 0:d.id).then(()=>{$(),cn(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),u$(d)}).catch(Y=>{be.errorResponseHandler(Y)}))}const L=()=>$(),R=()=>D(),B=()=>I(),K=Y=>{t(2,h.name=U.slugify(Y.target.value),h),Y.target.value=h.name},J=()=>{o&&D()},H=()=>S(ls),X=()=>S(ml);function W(Y){h=Y,t(2,h)}function te(Y){h=Y,t(2,h)}const x=()=>l&&v?(ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),$()}),!1):!0;function oe(Y){he[Y?"unshift":"push"](()=>{f=Y,t(5,f)})}function me(Y){ut.call(this,n,Y)}function se(Y){ut.call(this,n,Y)}function ge(Y){he[Y?"unshift":"push"](()=>{c=Y,t(6,c)})}const ke=()=>O();return n.$$.update=()=>{n.$$.dirty[0]&16&&t(12,i=typeof U.getNestedVal(a,"schema.message",null)=="string"?U.getNestedVal(a,"schema.message"):"Has errors"),n.$$.dirty[0]&4&&t(11,s=!h.isNew&&h.system),n.$$.dirty[0]&131076&&t(3,l=y!=Mr(h)),n.$$.dirty[0]&12&&t(10,o=h.isNew||l)},[S,$,h,l,a,f,c,m,v,b,o,s,i,D,O,I,C,y,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke]}class Ya extends Ee{constructor(e){super(),Oe(this,e,H3,R3,De,{changeTab:0,show:16,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[1]}}function ud(n,e,t){const i=n.slice();return i[13]=e[t],i}function fd(n){let e,t=n[1].length&&cd();return{c(){t&&t.c(),e=Je()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=cd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function cd(n){let e;return{c(){e=_("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function j3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function q3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dd(n,e){let t,i,s,l=e[13].name+"",o,r,a,u;function f(m,v){var b;return((b=m[5])==null?void 0:b.id)===m[13].id?q3:j3}let c=f(e),d=c(e);function h(){return e[10](e[13])}return{key:n,first:null,c(){var m;t=_("div"),d.c(),i=T(),s=_("span"),o=F(l),r=T(),p(s,"class","txt"),p(t,"tabindex","0"),p(t,"class","sidebar-list-item"),ie(t,"active",((m=e[5])==null?void 0:m.id)===e[13].id),this.first=t},m(m,v){w(m,t,v),d.m(t,null),g(t,i),g(t,s),g(s,o),g(t,r),a||(u=G(t,"click",h),a=!0)},p(m,v){var b;e=m,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i))),v&8&&l!==(l=e[13].name+"")&&ue(o,l),v&40&&ie(t,"active",((b=e[5])==null?void 0:b.id)===e[13].id)},d(m){m&&k(t),d.d(),a=!1,u()}}}function V3(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,m,v,b,y,S,C,$,M,D=n[3];const O=L=>L[13].id;for(let L=0;L',o=T(),r=_("input"),a=T(),u=_("hr"),f=T(),c=_("div");for(let L=0;L - New collection`,y=T(),V(S.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ie(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),ie(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(L,R){w(L,e,R),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),Me(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let B=0;Bt(5,o=b)),kt(n,Ds,b=>t(7,r=b));let a,u="";function f(b){dn(ui,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),m=()=>a==null?void 0:a.show();function v(b){he[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,h,m,v]}class B3 extends Ee{constructor(e){super(),Oe(this,e,z3,V3,De,{})}}function U3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format - OPERAND - OPERATOR - OPERAND, where:`,t=T(),i=_("ul"),s=_("li"),s.innerHTML=`OPERAND - could be any of the above field literal, string (single or double - quoted), number, null, true, false`,l=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=F(` - is one of: - `),u=_("br"),f=T(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",m=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),S=_("code"),S.textContent="!=",C=T(),$=_("span"),$.textContent="NOT equal",M=T(),D=_("li"),O=_("code"),O.textContent=">",A=T(),I=_("span"),I.textContent="Greater than",L=T(),R=_("li"),B=_("code"),B.textContent=">=",K=T(),J=_("span"),J.textContent="Greater than or equal",H=T(),X=_("li"),W=_("code"),W.textContent="<",te=T(),x=_("span"),x.textContent="Less than or equal",oe=T(),me=_("li"),se=_("code"),se.textContent="<=",ge=T(),ke=_("span"),ke.textContent="Less than or equal",Y=T(),ve=_("li"),ee=_("code"),ee.textContent="~",Q=T(),Se=_("span"),Se.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard - match)`,je=T(),Ue=_("li"),Z=_("code"),Z.textContent="!~",pe=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for - wildcard match)`,we=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets - (...), && (AND) and || (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(S,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(I,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(J,"class","txt-hint"),p(W,"class","filter-op svelte-1w7s5nw"),p(x,"class","txt-hint"),p(se,"class","filter-op svelte-1w7s5nw"),p(ke,"class","txt-hint"),p(ee,"class","filter-op svelte-1w7s5nw"),p(Se,"class","txt-hint"),p(Z,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(tt,We){w(tt,e,We),w(tt,t,We),w(tt,i,We),g(i,s),g(i,l),g(i,o),g(o,r),g(o,a),g(o,u),g(o,f),g(o,c),g(c,d),g(d,h),g(d,m),g(d,v),g(c,b),g(c,y),g(y,S),g(y,C),g(y,$),g(c,M),g(c,D),g(D,O),g(D,A),g(D,I),g(c,L),g(c,R),g(R,B),g(R,K),g(R,J),g(c,H),g(c,X),g(X,W),g(X,te),g(X,x),g(c,oe),g(c,me),g(me,se),g(me,ge),g(me,ke),g(c,Y),g(c,ve),g(ve,ee),g(ve,Q),g(ve,Se),g(c,je),g(c,Ue),g(Ue,Z),g(Ue,pe),g(Ue,ce),w(tt,we,We),w(tt,Ze,We)},p:re,i:re,o:re,d(tt){tt&&k(e),tt&&k(t),tt&&k(i),tt&&k(we),tt&&k(Ze)}}}class W3 extends Ee{constructor(e){super(),Oe(this,e,null,U3,De,{})}}function pd(n,e,t){const i=n.slice();return i[5]=e[t],i}function hd(n,e,t){const i=n.slice();return i[5]=e[t],i}function md(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=F(s),o=T(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),g(t,i),g(i,l),g(t,o),r||(a=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ie(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function gd(n,e){let t,i,s,l;return i=new gn({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ie(t,"active",e[0]===e[5].language)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function Y3(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=m=>m[5].language;for(let m=0;mm[5].language;for(let m=0;mt(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(_d,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Ls extends Ee{constructor(e){super(),Oe(this,e,K3,Y3,De,{js:2,dart:3})}}function bd(n,e,t){const i=n.slice();return i[6]=e[t],i}function vd(n,e,t){const i=n.slice();return i[6]=e[t],i}function yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("div"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function wd(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function Z3(n){var mi,Tl,ds,Dl;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y=n[0].name+"",S,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze,tt,We,it,Ce,ze,Ge,st,ct,_e,Ie,nt,ft,vt,ot,Ot,wt,jt,Nt,Ke,$e,Be,et,at,Pt,It,Lt,lt,N,z,ne,ae=[],Ae=new Map,le,ye,Te=[],fe=new Map,de,Fe=n[1]&&yd();O=new Ls({props:{js:` - import PocketBase from 'pocketbase'; - - const client = new PocketBase('${n[3]}'); - - ... - - // fetch a paginated records list - const resultList = await client.records.getList('${(mi=n[0])==null?void 0:mi.name}', 1, 50, { - filter: 'created >= "2022-01-01 00:00:00"', - }); - - // alternatively you can also fetch all records at once via getFullList: - const records = await client.records.getFullList('${(Tl=n[0])==null?void 0:Tl.name}', 200 /* batch size */, { - sort: '-created', - }); - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${n[3]}'); - - ... - - // fetch a paginated records list - final result = await client.records.getList( - '${(ds=n[0])==null?void 0:ds.name}', - page: 1, - perPage: 50, - filter: 'created >= "2022-01-01 00:00:00"', - ); - - // alternatively you can also fetch all records at once via getFullList: - final records = await client.records.getFullList('${(Dl=n[0])==null?void 0:Dl.name}', batch: 200, sort: '-created'); - `}}),Z=new gn({props:{content:` - // DESC by created and ASC by id - ?sort=-created,id - `}}),ze=new gn({props:{content:` - ?filter=(id='abc' && created>'2022-01-01') - `}}),st=new W3({}),wt=new gn({props:{content:` - ?expand=rel1,rel2.subrel21.subrel22 - `}});let ht=n[4];const rn=qe=>qe[6].code;for(let qe=0;qeqe[6].code;for(let qe=0;qeParam - Type - Description`,K=T(),J=_("tbody"),H=_("tr"),H.innerHTML=`page - Number - The page (aka. offset) of the paginated list (default to 1).`,X=T(),W=_("tr"),W.innerHTML=`perPage - Number - Specify the max returned records per page (default to 30).`,te=T(),x=_("tr"),oe=_("td"),oe.textContent="sort",me=T(),se=_("td"),se.innerHTML='String',ge=T(),ke=_("td"),Y=F("Specify the records order attribute(s). "),ve=_("br"),ee=F(` - Add `),Q=_("code"),Q.textContent="-",Se=F(" / "),je=_("code"),je.textContent="+",Ue=F(` (default) in front of the attribute for DESC / ASC order. - Ex.: - `),V(Z.$$.fragment),pe=T(),ce=_("tr"),we=_("td"),we.textContent="filter",Ze=T(),tt=_("td"),tt.innerHTML='String',We=T(),it=_("td"),Ce=F(`Filter the returned records. Ex.: - `),V(ze.$$.fragment),Ge=T(),V(st.$$.fragment),ct=T(),_e=_("tr"),Ie=_("td"),Ie.textContent="expand",nt=T(),ft=_("td"),ft.innerHTML='String',vt=T(),ot=_("td"),Ot=F(`Auto expand record relations. Ex.: - `),V(wt.$$.fragment),jt=F(` - Supports up to 6-levels depth nested relations expansion. `),Nt=_("br"),Ke=F(` - The expanded relations will be appended to each individual record under the - `),$e=_("code"),$e.textContent="@expand",Be=F(" property (eg. "),et=_("code"),et.textContent='"@expand": {"rel1": {...}, ...}',at=F(`). Only the - relations that the user has permissions to `),Pt=_("strong"),Pt.textContent="view",It=F(" will be expanded."),Lt=T(),lt=_("div"),lt.textContent="Responses",N=T(),z=_("div"),ne=_("div");for(let qe=0;qe= "2022-01-01 00:00:00"', - }); - - // alternatively you can also fetch all records at once via getFullList: - const records = await client.records.getFullList('${(El=qe[0])==null?void 0:El.name}', 200 /* batch size */, { - sort: '-created', - }); - `),xe&9&&(Xt.dart=` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${qe[3]}'); - - ... - - // fetch a paginated records list - final result = await client.records.getList( - '${(Al=qe[0])==null?void 0:Al.name}', - page: 1, - perPage: 50, - filter: 'created >= "2022-01-01 00:00:00"', - ); - - // alternatively you can also fetch all records at once via getFullList: - final records = await client.records.getFullList('${(Pl=qe[0])==null?void 0:Pl.name}', batch: 200, sort: '-created'); - `),O.$set(Xt),xe&20&&(ht=qe[4],ae=bt(ae,xe,rn,1,qe,ht,Ae,ne,Mn,kd,null,vd)),xe&20&&(qt=qe[4],Pe(),Te=bt(Te,xe,Mi,1,qe,qt,fe,ye,Gt,wd,null,bd),Le())},i(qe){if(!de){E(O.$$.fragment,qe),E(Z.$$.fragment,qe),E(ze.$$.fragment,qe),E(st.$$.fragment,qe),E(wt.$$.fragment,qe);for(let xe=0;xet(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[U.dummyCollectionRecord(l),U.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:` - { - "code": 400, - "message": "Something went wrong while processing your request. Invalid filter.", - "data": {} - } - `}),i&&r.push({code:403,body:` - { - "code": 403, - "message": "Only admins can access this action.", - "data": {} - } - `}),r.push({code:404,body:` - { - "code": 404, - "message": "The requested resource wasn't found.", - "data": {} - } - `}))},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,i,o,s,r,a]}class G3 extends Ee{constructor(e){super(),Oe(this,e,J3,Z3,De,{collection:0})}}function $d(n,e,t){const i=n.slice();return i[6]=e[t],i}function Sd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Cd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Md(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Td(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function X3(n){var Nt,Ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y,S=n[0].name+"",C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze,tt,We,it,Ce,ze,Ge=[],st=new Map,ct,_e,Ie=[],nt=new Map,ft,vt=n[1]&&Cd();A=new Ls({props:{js:` - import PocketBase from 'pocketbase'; - - const client = new PocketBase('${n[3]}'); - - ... - - const record = await client.records.getOne('${(Nt=n[0])==null?void 0:Nt.name}', 'RECORD_ID', { - expand: 'some_relation' - }); - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${n[3]}'); - - ... - - final record = await client.records.getOne('${(Ke=n[0])==null?void 0:Ke.name}', 'RECORD_ID', query: { - 'expand': 'some_relation', - }); - `}}),ee=new gn({props:{content:` - ?expand=rel1,rel2.subrel21.subrel22 - `}});let ot=n[4];const Ot=$e=>$e[6].code;for(let $e=0;$e$e[6].code;for(let $e=0;$eParam - Type - Description - id - String - ID of the record to view.`,K=T(),J=_("div"),J.textContent="Query parameters",H=T(),X=_("table"),W=_("thead"),W.innerHTML=`Param - Type - Description`,te=T(),x=_("tbody"),oe=_("tr"),me=_("td"),me.textContent="expand",se=T(),ge=_("td"),ge.innerHTML='String',ke=T(),Y=_("td"),ve=F(`Auto expand record relations. Ex.: - `),V(ee.$$.fragment),Q=F(` - Supports up to 6-levels depth nested relations expansion. `),Se=_("br"),je=F(` - The expanded relations will be appended to the record under the - `),Ue=_("code"),Ue.textContent="@expand",Z=F(" property (eg. "),pe=_("code"),pe.textContent='"@expand": {"rel1": {...}, ...}',ce=F(`). Only the - relations that the user has permissions to `),we=_("strong"),we.textContent="view",Ze=F(" will be expanded."),tt=T(),We=_("div"),We.textContent="Responses",it=T(),Ce=_("div"),ze=_("div");for(let $e=0;$et(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(U.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:` - { - "code": 403, - "message": "Only admins can access this action.", - "data": {} - } - `}),r.push({code:404,body:` - { - "code": 404, - "message": "The requested resource wasn't found.", - "data": {} - } - `}))},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,i,o,s,r,a]}class x3 extends Ee{constructor(e){super(),Oe(this,e,Q3,X3,De,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Od(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ad(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function eC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function tC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function iC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function sC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(` - Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:re,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function lC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function oC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function rC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function aC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function uC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Pd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=U.getFieldValueType(e[11])+"",h,m,v,b;function y(O,A){return O[11].required?tC:eC}let S=y(e),C=S(e);function $(O,A){if(O[11].type==="text")return uC;if(O[11].type==="number")return aC;if(O[11].type==="json")return rC;if(O[11].type==="email")return oC;if(O[11].type==="url")return lC;if(O[11].type==="file")return sC;if(O[11].type==="relation")return iC;if(O[11].type==="user")return nC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),m=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,A){w(O,t,A),g(t,i),g(i,s),C.m(s,null),g(s,l),g(s,o),g(o,a),g(t,u),g(t,f),g(f,c),g(c,h),g(t,m),g(t,v),D&&D.m(v,null),g(t,b)},p(O,A){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(s,l))),A&1&&r!==(r=e[11].name+"")&&ue(a,r),A&1&&d!==(d=U.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,A):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&k(t),C.d(),D&&D.d()}}}function Ld(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Id(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function fC(n){var ne,ae,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y=n[0].name+"",S,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me=[],se=new Map,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze,tt,We,it,Ce,ze,Ge,st,ct,_e,Ie,nt,ft,vt,ot,Ot,wt=[],jt=new Map,Nt,Ke,$e=[],Be=new Map,et,at=n[4]&&Ad();R=new Ls({props:{js:` - import PocketBase from 'pocketbase'; - - const client = new PocketBase('${n[3]}'); - - ... - - const data = { ... }; - - const record = await client.records.create('${(ne=n[0])==null?void 0:ne.name}', data); - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${n[3]}'); - - ... - - final body = { ... }; - - final record = await client.records.create('${(ae=n[0])==null?void 0:ae.name}', body: body); - `}});let Pt=(Ae=n[0])==null?void 0:Ae.schema;const It=le=>le[11].name;for(let le=0;lele[6].code;for(let le=0;lele[6].code;for(let le=0;leapplication/json or - multipart/form-data.`,D=T(),O=_("p"),O.innerHTML="File upload is supported only via multipart/form-data.",A=T(),I=_("div"),I.textContent="Client SDKs example",L=T(),V(R.$$.fragment),B=T(),K=_("div"),K.textContent="Body Parameters",J=T(),H=_("table"),X=_("thead"),X.innerHTML=`Param - Type - Description`,W=T(),te=_("tbody"),x=_("tr"),x.innerHTML=`
Optional - id
- String - 15 characters string to store as record ID. -
- If not set, it will be auto generated.`,oe=T();for(let le=0;leParam - Type - Description`,Q=T(),Se=_("tbody"),je=_("tr"),Ue=_("td"),Ue.textContent="expand",Z=T(),pe=_("td"),pe.innerHTML='String',ce=T(),we=_("td"),Ze=F(`Auto expand relations when returning the created record. Ex.: - `),V(tt.$$.fragment),We=F(` - Supports up to 6-levels depth nested relations expansion. `),it=_("br"),Ce=F(` - The expanded relations will be appended to the record under the - `),ze=_("code"),ze.textContent="@expand",Ge=F(" property (eg. "),st=_("code"),st.textContent='"@expand": {"rel1": {...}, ...}',ct=F(`). Only the - relations that the user has permissions to `),_e=_("strong"),_e.textContent="view",Ie=F(" will be expanded."),nt=T(),ft=_("div"),ft.textContent="Responses",vt=T(),ot=_("div"),Ot=_("div");for(let le=0;le{ ... }; - - final record = await client.records.create('${(de=le[0])==null?void 0:de.name}', body: body); - `),R.$set(Te),ye&1&&(Pt=(Fe=le[0])==null?void 0:Fe.schema,me=bt(me,ye,It,1,le,Pt,se,te,Mn,Pd,null,Ed)),ye&6&&(Lt=le[2],wt=bt(wt,ye,lt,1,le,Lt,jt,Ot,Mn,Ld,null,Od)),ye&6&&(N=le[2],Pe(),$e=bt($e,ye,z,1,le,N,Be,Ke,Gt,Id,null,Dd),Le())},i(le){if(!et){E(R.$$.fragment,le),E(tt.$$.fragment,le);for(let ye=0;yet(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(l),null,2)},{code:400,body:` - { - "code": 400, - "message": "Failed to create record.", - "data": { - "${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": { - "code": "validation_required", - "message": "Missing required value." - } - } - } - `},{code:403,body:` - { - "code": 403, - "message": "You are not allowed to perform this request.", - "data": {} - } - `}])},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,o,r,s,i,a]}class dC extends Ee{constructor(e){super(),Oe(this,e,cC,fC,De,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Nd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Hd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function mC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function gC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function _C(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(` - Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:re,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function bC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function vC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function yC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function wC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function jd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=U.getFieldValueType(e[11])+"",h,m,v,b;function y(O,A){return O[11].required?hC:pC}let S=y(e),C=S(e);function $(O,A){if(O[11].type==="text")return wC;if(O[11].type==="number")return kC;if(O[11].type==="json")return yC;if(O[11].type==="email")return vC;if(O[11].type==="url")return bC;if(O[11].type==="file")return _C;if(O[11].type==="relation")return gC;if(O[11].type==="user")return mC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),m=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,A){w(O,t,A),g(t,i),g(i,s),C.m(s,null),g(s,l),g(s,o),g(o,a),g(t,u),g(t,f),g(f,c),g(c,h),g(t,m),g(t,v),D&&D.m(v,null),g(t,b)},p(O,A){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(s,l))),A&1&&r!==(r=e[11].name+"")&&ue(a,r),A&1&&d!==(d=U.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,A):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&k(t),C.d(),D&&D.d()}}}function qd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Vd(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function $C(n){var le,ye,Te;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y,S=n[0].name+"",C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke=[],Y=new Map,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze,tt,We,it,Ce,ze,Ge,st,ct,_e,Ie,nt,ft,vt,ot,Ot,wt,jt,Nt,Ke=[],$e=new Map,Be,et,at=[],Pt=new Map,It,Lt=n[4]&&Hd();B=new Ls({props:{js:` - import PocketBase from 'pocketbase'; - - const client = new PocketBase('${n[3]}'); - - ... - - const data = { ... }; - - const record = await client.records.update('${(le=n[0])==null?void 0:le.name}', 'RECORD_ID', data); - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${n[3]}'); - - ... - - final body = { ... }; - - final record = await client.records.update('${(ye=n[0])==null?void 0:ye.name}', 'RECORD_ID', body: body); - `}});let lt=(Te=n[0])==null?void 0:Te.schema;const N=fe=>fe[11].name;for(let fe=0;fefe[6].code;for(let fe=0;fefe[6].code;for(let fe=0;feapplication/json or - multipart/form-data.`,O=T(),A=_("p"),A.innerHTML="File upload is supported only via multipart/form-data.",I=T(),L=_("div"),L.textContent="Client SDKs example",R=T(),V(B.$$.fragment),K=T(),J=_("div"),J.textContent="Path parameters",H=T(),X=_("table"),X.innerHTML=`Param - Type - Description - id - String - ID of the record to update.`,W=T(),te=_("div"),te.textContent="Body Parameters",x=T(),oe=_("table"),me=_("thead"),me.innerHTML=`Param - Type - Description`,se=T(),ge=_("tbody");for(let fe=0;feParam - Type - Description`,Ue=T(),Z=_("tbody"),pe=_("tr"),ce=_("td"),ce.textContent="expand",we=T(),Ze=_("td"),Ze.innerHTML='String',tt=T(),We=_("td"),it=F(`Auto expand relations when returning the updated record. Ex.: - `),V(Ce.$$.fragment),ze=F(` - Supports up to 6-levels depth nested relations expansion. `),Ge=_("br"),st=F(` - The expanded relations will be appended to the record under the - `),ct=_("code"),ct.textContent="@expand",_e=F(" property (eg. "),Ie=_("code"),Ie.textContent='"@expand": {"rel1": {...}, ...}',nt=F(`). Only the - relations that the user has permissions to `),ft=_("strong"),ft.textContent="view",vt=F(" will be expanded."),ot=T(),Ot=_("div"),Ot.textContent="Responses",wt=T(),jt=_("div"),Nt=_("div");for(let fe=0;fe{ ... }; - - final record = await client.records.update('${(rn=fe[0])==null?void 0:rn.name}', 'RECORD_ID', body: body); - `),B.$set(Fe),de&1&&(lt=(qt=fe[0])==null?void 0:qt.schema,ke=bt(ke,de,N,1,fe,lt,Y,ge,Mn,jd,null,Rd)),de&6&&(z=fe[2],Ke=bt(Ke,de,ne,1,fe,z,$e,Nt,Mn,qd,null,Nd)),de&6&&(ae=fe[2],Pe(),at=bt(at,de,Ae,1,fe,ae,Pt,et,Gt,Vd,null,Fd),Le())},i(fe){if(!It){E(B.$$.fragment,fe),E(Ce.$$.fragment,fe);for(let de=0;det(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(l),null,2)},{code:400,body:` - { - "code": 400, - "message": "Failed to update record.", - "data": { - "${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": { - "code": "validation_required", - "message": "Missing required value." - } - } - } - `},{code:403,body:` - { - "code": 403, - "message": "You are not allowed to perform this request.", - "data": {} - } - `},{code:404,body:` - { - "code": 404, - "message": "The requested resource wasn't found.", - "data": {} - } - `}])},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,o,r,s,i,a]}class CC extends Ee{constructor(e){super(),Oe(this,e,SC,$C,De,{collection:0})}}function zd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Bd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ud(n){let e;return{c(){e=_("p"),e.innerHTML="Requires Authorization: Admin TOKEN header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Yd(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function MC(n){var je,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y,S=n[0].name+"",C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te=[],x=new Map,oe,me,se=[],ge=new Map,ke,Y=n[1]&&Ud();A=new Ls({props:{js:` - import PocketBase from 'pocketbase'; - - const client = new PocketBase('${n[3]}'); - - ... - - await client.records.delete('${(je=n[0])==null?void 0:je.name}', 'RECORD_ID'); - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${n[3]}'); - - ... - - await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID'); - `}});let ve=n[4];const ee=Z=>Z[6].code;for(let Z=0;ZZ[6].code;for(let Z=0;ZParam - Type - Description - id - String - ID of the record to delete.`,K=T(),J=_("div"),J.textContent="Responses",H=T(),X=_("div"),W=_("div");for(let Z=0;Zt(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:` - null - `}),r.push({code:400,body:` - { - "code": 400, - "message": "Failed to delete record. Make sure that the record is not part of a required relation reference.", - "data": {} - } - `}),i&&r.push({code:403,body:` - { - "code": 403, - "message": "Only admins can access this action.", - "data": {} - } - `}),r.push({code:404,body:` - { - "code": 404, - "message": "The requested resource wasn't found.", - "data": {} - } - `}))},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,i,o,s,r,a]}class DC extends Ee{constructor(e){super(),Oe(this,e,TC,MC,De,{collection:0})}}function OC(n){var h,m,v,b,y,S,C,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Ls({props:{js:` - import PocketBase from 'pocketbase'; - - const client = new PocketBase('${n[1]}'); - - ... - - // (Optionally) authenticate - client.users.authViaEmail('test@example.com', '123456'); - - // Subscribe to changes in any record from the collection - client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) { - console.log(e.record); - }); - - // Subscribe to changes in a single record - client.realtime.subscribe('${(m=n[0])==null?void 0:m.name}/RECORD_ID', function (e) { - console.log(e.record); - }); - - // Unsubscribe - client.realtime.unsubscribe() // remove all subscriptions - client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription - client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription - `,dart:` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${n[1]}'); - - ... - - // (Optionally) authenticate - client.users.authViaEmail('test@example.com', '123456'); - - // Subscribe to changes in any record from the collection - client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) { - print(e.record); - }); - - // Subscribe to changes in a single record - client.realtime.subscribe('${(S=n[0])==null?void 0:S.name}/RECORD_ID', (e) { - print(e.record); - }); - - // Unsubscribe - client.realtime.unsubscribe() // remove all subscriptions - client.realtime.unsubscribe('${(C=n[0])==null?void 0:C.name}') // remove only the collection subscription - client.realtime.unsubscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID') // remove only the record subscription - `}}),c=new gn({props:{content:JSON.stringify({action:"create",record:U.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`SSE -

/api/realtime

`,t=T(),i=_("div"),i.innerHTML=`

Subscribe to realtime changes via Server-Sent Events (SSE).

-

Events are send for create, update - and delete record operations (see "Event data format" section below).

-
-

You could subscribe to a single record or to an entire collection.

-

When you subscribe to a single record, the collection's - ViewRule will be used to determine whether the subscriber has access to receive - the event message.

-

When you subscribe to an entire collection, the collection's - ListRule will be used to determine whether the subscriber has access to receive - the event message.

`,s=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),V(r.$$.fragment),a=T(),u=_("div"),u.textContent="Event data format",f=T(),V(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(M,D){w(M,e,D),w(M,t,D),w(M,i,D),w(M,s,D),w(M,l,D),w(M,o,D),j(r,M,D),w(M,a,D),w(M,u,D),w(M,f,D),j(c,M,D),d=!0},p(M,[D]){var I,L,R,B,K,J,H,X;const O={};D&3&&(O.js=` - import PocketBase from 'pocketbase'; - - const client = new PocketBase('${M[1]}'); - - ... - - // (Optionally) authenticate - client.users.authViaEmail('test@example.com', '123456'); - - // Subscribe to changes in any record from the collection - client.realtime.subscribe('${(I=M[0])==null?void 0:I.name}', function (e) { - console.log(e.record); - }); - - // Subscribe to changes in a single record - client.realtime.subscribe('${(L=M[0])==null?void 0:L.name}/RECORD_ID', function (e) { - console.log(e.record); - }); - - // Unsubscribe - client.realtime.unsubscribe() // remove all subscriptions - client.realtime.unsubscribe('${(R=M[0])==null?void 0:R.name}') // remove only the collection subscription - client.realtime.unsubscribe('${(B=M[0])==null?void 0:B.name}/RECORD_ID') // remove only the record subscription - `),D&3&&(O.dart=` - import 'package:pocketbase/pocketbase.dart'; - - final client = PocketBase('${M[1]}'); - - ... - - // (Optionally) authenticate - client.users.authViaEmail('test@example.com', '123456'); - - // Subscribe to changes in any record from the collection - client.realtime.subscribe('${(K=M[0])==null?void 0:K.name}', (e) { - print(e.record); - }); - - // Subscribe to changes in a single record - client.realtime.subscribe('${(J=M[0])==null?void 0:J.name}/RECORD_ID', (e) { - print(e.record); - }); - - // Unsubscribe - client.realtime.unsubscribe() // remove all subscriptions - client.realtime.unsubscribe('${(H=M[0])==null?void 0:H.name}') // remove only the collection subscription - client.realtime.unsubscribe('${(X=M[0])==null?void 0:X.name}/RECORD_ID') // remove only the record subscription - `),r.$set(O);const A={};D&1&&(A.content=JSON.stringify({action:"create",record:U.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(A)},i(M){d||(E(r.$$.fragment,M),E(c.$$.fragment,M),d=!0)},o(M){P(r.$$.fragment,M),P(c.$$.fragment,M),d=!1},d(M){M&&k(e),M&&k(t),M&&k(i),M&&k(s),M&&k(l),M&&k(o),q(r,M),M&&k(a),M&&k(u),M&&k(f),q(c,M)}}}function EC(n,e,t){let i,{collection:s=new fn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=U.getApiExampleUrl(be.baseUrl)),[s,i]}class AC extends Ee{constructor(e){super(),Oe(this,e,EC,OC,De,{collection:0})}}function Kd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jd(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&V(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&j(t,e,null),g(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Pe();const f=t;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(t=new l(o(r)),V(t.$$.fragment),E(t.$$.fragment,1),j(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&E(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&q(t)}}}function Gd(n,e){let t,i,s,l=e[4]===e[14].id&&Jd(e);return{key:n,first:null,c(){t=Je(),l&&l.c(),i=Je(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&E(l,1)):(l=Jd(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(E(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function PC(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;rd[14].id;for(let d=0;dClose',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[8]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function FC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[IC],header:[LC],default:[PC]},$$scope:{ctx:n}};return e=new hi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function NC(n,e,t){const i=[{id:"list",label:"List",component:G3},{id:"view",label:"View",component:x3},{id:"create",label:"Create",component:dC},{id:"update",label:"Update",component:CC},{id:"delete",label:"Delete",component:DC},{id:"realtime",label:"Realtime",component:AC}];let s,l=new fn,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,S){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(S))}const c=()=>a(),d=y=>u(y.id),h=(y,S)=>f(S,y.id);function m(y){he[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){ut.call(this,n,y)}function b(y){ut.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,h,m,v,b]}class RC extends Ee{constructor(e){super(),Oe(this,e,NC,FC,De,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function HC(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const m=r.closest("form");m!=null&&m.requestSubmit&&m.requestSubmit()}}Zn(()=>(u(),()=>clearTimeout(a)));function c(h){he[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=pt(pt({},e),di(h)),t(3,s=Jt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class qC extends Ee{constructor(e){super(),Oe(this,e,jC,HC,De,{value:0,maxHeight:4})}}function VC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(v){n[2](v)}let m={id:n[3],required:n[1].required};return n[0]!==void 0&&(m.value=n[0]),f=new qC({props:m}),he.push(()=>Re(f,"value",h)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(v,b){w(v,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(v,u,b),j(f,v,b),d=!0},p(v,b){(!d||b&2&&i!==(i=U.getFieldTypeIcon(v[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=v[1].name+"")&&ue(r,o),(!d||b&8&&a!==(a=v[3]))&&p(e,"for",a);const y={};b&8&&(y.id=v[3]),b&2&&(y.required=v[1].required),!c&&b&1&&(c=!0,y.value=v[0],He(()=>c=!1)),f.$set(y)},i(v){d||(E(f.$$.fragment,v),d=!0)},o(v){P(f.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(u),q(f,v)}}}function zC(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[VC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function BC(n,e,t){let{field:i=new Tn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class UC extends Ee{constructor(e){super(),Oe(this,e,BC,zC,De,{field:1,value:0})}}function WC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m,v,b;return{c(){var y,S;e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",m=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),g(e,t),g(e,s),g(e,l),g(l,r),w(y,u,S),w(y,f,S),Me(f,n[0]),v||(b=G(f,"input",n[2]),v=!0)},p(y,S){var C,$;S&2&&i!==(i=U.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&ue(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(f,"min",h),S&2&&m!==(m=($=y[1].options)==null?void 0:$.max)&&p(f,"max",m),S&1&&At(f.value)!==y[0]&&Me(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),v=!1,b()}}}function YC(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[WC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function KC(n,e,t){let{field:i=new Tn}=e,{value:s=void 0}=e;function l(){s=At(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class ZC extends Ee{constructor(e){super(),Oe(this,e,KC,YC,De,{field:1,value:0})}}function JC(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=_("input"),i=T(),s=_("label"),o=F(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),g(s,o),a||(u=G(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&ue(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function GC(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[JC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function XC(n,e,t){let{field:i=new Tn}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class QC extends Ee{constructor(e){super(),Oe(this,e,XC,GC,De,{field:1,value:0})}}function xC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(v,u,b),w(v,f,b),Me(f,n[0]),h||(m=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=U.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&f.value!==v[0]&&Me(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,m()}}}function e4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[xC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function t4(n,e,t){let{field:i=new Tn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class n4 extends Ee{constructor(e){super(),Oe(this,e,t4,e4,De,{field:1,value:0})}}function i4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(v,u,b),w(v,f,b),Me(f,n[0]),h||(m=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=U.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Me(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,m()}}}function s4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[i4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function l4(n,e,t){let{field:i=new Tn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class o4 extends Ee{constructor(e){super(),Oe(this,e,l4,s4,De,{field:1,value:0})}}function r4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;function m(b){n[2](b)}let v={id:n[3],options:U.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(v.formattedValue=n[0]),c=new Wa({props:v}),he.push(()=>Re(c,"formattedValue",m)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),a=F(" (UTC)"),f=T(),V(c.$$.fragment),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",u=n[3])},m(b,y){w(b,e,y),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),w(b,f,y),j(c,b,y),h=!0},p(b,y){(!h||y&2&&i!==(i=U.getFieldTypeIcon(b[1].type)))&&p(t,"class",i),(!h||y&2)&&o!==(o=b[1].name+"")&&ue(r,o),(!h||y&8&&u!==(u=b[3]))&&p(e,"for",u);const S={};y&8&&(S.id=b[3]),y&1&&(S.value=b[0]),!d&&y&1&&(d=!0,S.formattedValue=b[0],He(()=>d=!1)),c.$set(S)},i(b){h||(E(c.$$.fragment,b),h=!0)},o(b){P(c.$$.fragment,b),h=!1},d(b){b&&k(e),b&&k(f),q(c,b)}}}function a4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[r4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function u4(n,e,t){let{field:i=new Tn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class f4 extends Ee{constructor(e){super(),Oe(this,e,u4,a4,De,{field:1,value:0})}}function Qd(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function c4(n){var S,C,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;function v(M){n[3](M)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(S=n[1].options)==null?void 0:S.values,searchable:((C=n[1].options)==null?void 0:C.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new E_({props:b}),he.push(()=>Re(f,"selected",v));let y=(($=n[1].options)==null?void 0:$.maxSelect)>1&&Qd(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Je(),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(M,D){w(M,e,D),g(e,t),g(e,s),g(e,l),g(l,r),w(M,u,D),j(f,M,D),w(M,d,D),y&&y.m(M,D),w(M,h,D),m=!0},p(M,D){var A,I,L;(!m||D&2&&i!==(i=U.getFieldTypeIcon(M[1].type)))&&p(t,"class",i),(!m||D&2)&&o!==(o=M[1].name+"")&&ue(r,o),(!m||D&16&&a!==(a=M[4]))&&p(e,"for",a);const O={};D&16&&(O.id=M[4]),D&6&&(O.toggle=!M[1].required||M[2]),D&4&&(O.multiple=M[2]),D&2&&(O.items=(A=M[1].options)==null?void 0:A.values),D&2&&(O.searchable=((I=M[1].options)==null?void 0:I.values)>5),!c&&D&1&&(c=!0,O.selected=M[0],He(()=>c=!1)),f.$set(O),((L=M[1].options)==null?void 0:L.maxSelect)>1?y?y.p(M,D):(y=Qd(M),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(M){m||(E(f.$$.fragment,M),m=!0)},o(M){P(f.$$.fragment,M),m=!1},d(M){M&&k(e),M&&k(u),q(f,M),M&&k(d),y&&y.d(M),M&&k(h)}}}function d4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[c4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function p4(n,e,t){let i,{field:s=new Tn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class h4 extends Ee{constructor(e){super(),Oe(this,e,p4,d4,De,{field:1,value:0})}}function m4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("textarea"),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"class","txt-mono")},m(v,b){w(v,e,b),g(e,t),g(e,s),g(e,l),g(l,r),w(v,u,b),w(v,f,b),Me(f,n[0]),h||(m=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=U.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Me(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,m()}}}function g4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[m4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function _4(n,e,t){let{field:i=new Tn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&typeof s!="string"&&s!==null&&t(0,s=JSON.stringify(s,null,2))},[s,i,l]}class b4 extends Ee{constructor(e){super(),Oe(this,e,_4,g4,De,{field:1,value:0})}}function v4(n){let e,t;return{c(){e=_("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function y4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function k4(n){let e;function t(l,o){return l[2]?y4:v4}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:re,o:re,d(l){s.d(l),l&&k(e)}}}function w4(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),U.hasImageExtension(s==null?void 0:s.name)&&U.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{console.warn("Unable to generate thumb: ",r)})}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class $4 extends Ee{constructor(e){super(),Oe(this,e,w4,k4,De,{file:0,size:1})}}function S4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function C4(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[0])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function M4(n){let e,t=n[2].substring(n[2].lastIndexOf("/")+1)+"",i,s,l,o,r,a,u;return{c(){e=_("a"),i=F(t),s=T(),l=_("div"),o=T(),r=_("button"),r.textContent="Close",p(e,"href",n[2]),p(e,"title","Download"),p(e,"class","link-hint txt-ellipsis"),p(l,"class","flex-fill"),p(r,"type","button"),p(r,"class","btn btn-secondary")},m(f,c){w(f,e,c),g(e,i),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=G(r,"click",n[0]),a=!0)},p(f,c){c&4&&t!==(t=f[2].substring(f[2].lastIndexOf("/")+1)+"")&&ue(i,t),c&4&&p(e,"href",f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,u()}}}function T4(n){let e,t,i={class:"image-preview",btnClose:!1,popup:!0,$$slots:{footer:[M4],header:[C4],default:[S4]},$$scope:{ctx:n}};return e=new hi({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&132&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[4](null),q(e,s)}}}function D4(n,e,t){let i,s="";function l(f){f!==""&&(t(2,s=f),i==null||i.show())}function o(){return i==null?void 0:i.hide()}function r(f){he[f?"unshift":"push"](()=>{i=f,t(1,i)})}function a(f){ut.call(this,n,f)}function u(f){ut.call(this,n,f)}return[o,i,s,l,r,a,u]}class O4 extends Ee{constructor(e){super(),Oe(this,e,D4,T4,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function E4(n){let e;return{c(){e=_("i"),p(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function A4(n){let e,t,i,s,l;return{c(){e=_("img"),xn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),ie(e,"link-fade",n[2])},m(o,r){w(o,e,r),s||(l=[G(e,"click",n[7]),G(e,"error",n[5])],s=!0)},p(o,r){r&16&&!xn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i),r&4&&ie(e,"link-fade",o[2])},d(o){o&&k(e),s=!1,Qe(l)}}}function P4(n){let e,t,i;function s(a,u){return a[2]?A4:E4}let l=s(n),o=l(n),r={};return t=new O4({props:r}),n[8](t),{c(){o.c(),e=T(),V(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),j(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(E(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[8](null),q(t,a)}}}function L4(n,e,t){let i,{record:s}=e,{filename:l}=e,o,r="",a="";function u(){t(4,r="")}const f=d=>{d.stopPropagation(),o==null||o.show(a)};function c(d){he[d?"unshift":"push"](()=>{o=d,t(3,o)})}return n.$$set=d=>{"record"in d&&t(6,s=d.record),"filename"in d&&t(0,l=d.filename)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=U.hasImageExtension(l)),n.$$.dirty&69&&i&&t(1,a=be.records.getFileUrl(s,`${l}`)),n.$$.dirty&2&&t(4,r=a?a+"?thumb=100x100":"")},[l,a,i,o,r,u,s,f,c]}class I_ extends Ee{constructor(e){super(),Oe(this,e,L4,P4,De,{record:6,filename:0})}}function xd(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function ep(n,e,t){const i=n.slice();return i[25]=e[t],i[24]=t,i}function I4(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=_("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-circle btn-remove txt-hint")},m(l,o){w(l,e,o),t||(i=[Ye(Ct.call(null,e,"Remove file")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Qe(i)}}}function F4(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=_("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(l,o){w(l,e,o),t||(i=G(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function tp(n,e){let t,i,s,l,o,r=e[25]+"",a,u,f,c,d,h,m;s=new I_({props:{record:e[2],filename:e[25]}});function v(S,C){return C&18&&(c=null),c==null&&(c=!!S[1].includes(S[24])),c?F4:I4}let b=v(e,-1),y=b(e);return{key:n,first:null,c(){t=_("div"),i=_("figure"),V(s.$$.fragment),l=T(),o=_("a"),a=F(r),f=T(),y.c(),p(i,"class","thumb"),ie(i,"fade",e[1].includes(e[24])),p(o,"href",u=be.records.getFileUrl(e[2],e[25])),p(o,"class","filename link-hint"),p(o,"target","_blank"),p(o,"rel","noopener"),ie(o,"txt-strikethrough",e[1].includes(e[24])),p(t,"class","list-item"),this.first=t},m(S,C){w(S,t,C),g(t,i),j(s,i,null),g(t,l),g(t,o),g(o,a),g(t,f),y.m(t,null),d=!0,h||(m=Ye(Ct.call(null,o,{position:"right",text:"Download"})),h=!0)},p(S,C){e=S;const $={};C&4&&($.record=e[2]),C&16&&($.filename=e[25]),s.$set($),C&18&&ie(i,"fade",e[1].includes(e[24])),(!d||C&16)&&r!==(r=e[25]+"")&&ue(a,r),(!d||C&20&&u!==(u=be.records.getFileUrl(e[2],e[25])))&&p(o,"href",u),C&18&&ie(o,"txt-strikethrough",e[1].includes(e[24])),b===(b=v(e,C))&&y?y.p(e,C):(y.d(1),y=b(e),y&&(y.c(),y.m(t,null)))},i(S){d||(E(s.$$.fragment,S),d=!0)},o(S){P(s.$$.fragment,S),d=!1},d(S){S&&k(t),q(s),y.d(),h=!1,m()}}}function np(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,h,m,v,b;i=new $4({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=_("div"),t=_("figure"),V(i.$$.fragment),s=T(),l=_("div"),o=_("small"),o.textContent="New",r=T(),a=_("span"),f=F(u),d=T(),h=_("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename"),p(l,"title",c=n[22].name),p(h,"type","button"),p(h,"class","btn btn-secondary btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(S,C){w(S,e,C),g(e,t),j(i,t,null),g(e,s),g(e,l),g(l,o),g(l,r),g(l,a),g(a,f),g(e,d),g(e,h),m=!0,v||(b=[Ye(Ct.call(null,h,"Remove file")),G(h,"click",y)],v=!0)},p(S,C){n=S;const $={};C&1&&($.file=n[22]),i.$set($),(!m||C&1)&&u!==(u=n[22].name+"")&&ue(f,u),(!m||C&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(S){m||(E(i.$$.fragment,S),m=!0)},o(S){P(i.$$.fragment,S),m=!1},d(S){S&&k(e),q(i),v=!1,Qe(b)}}}function ip(n){let e,t,i,s,l,o;return{c(){e=_("div"),t=_("input"),i=T(),s=_("button"),s.innerHTML=` - Upload new file`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),g(e,t),n[16](t),g(e,i),g(e,s),l||(o=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Qe(o)}}}function N4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,m,v,b=n[4];const y=D=>D[25];for(let D=0;DP(C[D],1,1,()=>{C[D]=null});let M=!n[8]&&ip(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("div");for(let D=0;D({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function H4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Tn}=e,c,d;function h(A){U.removeByValue(u,A),t(1,u)}function m(A){U.pushUnique(u,A),t(1,u)}function v(A){U.isEmpty(a[A])||a.splice(A,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=A=>h(A),S=A=>m(A),C=A=>v(A);function $(A){he[A?"unshift":"push"](()=>{c=A,t(6,c)})}const M=()=>{for(let A of c.files)a.push(A);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function O(A){he[A?"unshift":"push"](()=>{d=A,t(7,d)})}return n.$$set=A=>{"record"in A&&t(2,o=A.record),"value"in A&&t(12,r=A.value),"uploadedFiles"in A&&t(0,a=A.uploadedFiles),"deletedFileIndexes"in A&&t(1,u=A.deletedFileIndexes),"field"in A&&t(3,f=A.field)},n.$$.update=()=>{var A,I;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=U.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=U.toArray(u))),n.$$.dirty&8&&t(5,i=((A=f.options)==null?void 0:A.maxSelect)>1),n.$$.dirty&4128&&U.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=U.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((I=f.options)==null?void 0:I.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,m,v,r,y,S,C,$,M,D,O]}class j4 extends Ee{constructor(e){super(),Oe(this,e,H4,R4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function sp(n){let e,t;return{c(){e=_("small"),t=F(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),g(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function q4(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&sp(n);return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),g(s,l),g(l,r),g(s,a),c&&c.m(s,null),u||(f=Ye(t=Ct.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Kn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,h):(c=sp(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:re,o:re,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function V4(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...Object.keys(r)];for(const u of a)if(typeof r[u]=="string"&&!U.isEmpty(r[u])&&!s.includes(u))return u+": "+r[u];return""}return n.$$set=r=>{"item"in r&&t(0,l=r.item)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=o(l))},[l,i]}class z4 extends Ee{constructor(e){super(),Oe(this,e,V4,q4,De,{item:0})}}function lp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Load more',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[14])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function B4(n){let e,t=n[7]&&lp(n);return{c(){t&&t.c(),e=Je()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=lp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function U4(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:n[4]},{optionComponent:n[4]},{multiple:n[2]},{class:"records-select block-options"},n[10]];function o(u){n[15](u)}function r(u){n[16](u)}let a={$$slots:{afterOptions:[B4]},$$scope:{ctx:n}};for(let u=0;uRe(e,"keyOfSelected",o)),he.push(()=>Re(e,"selected",r)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?_n(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&16&&{labelComponent:u[4]},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&pi(u[10])]):{};f&4194496&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function W4(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let o=Jt(e,l);const r="select_"+U.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=z4}=e,{collectionId:h}=e,m=[],v=1,b=0,y=!1,S=!1;C();async function C(){const L=U.toArray(f);if(!(!h||!L.length)){t(13,S=!0);try{const R=[];for(const B of L)R.push(`id="${B}"`);t(0,u=await be.records.getFullList(h,200,{sort:"-created",filter:R.join("||"),$cancelKey:r+"loadSelected"})),t(5,m=U.filterDuplicatesByKey(m.concat(u)))}catch(R){be.errorResponseHandler(R)}t(13,S=!1)}}async function $(L=!1){if(!!h){t(6,y=!0);try{const R=L?1:v+1,B=await be.records.getList(h,R,200,{sort:"-created",$cancelKey:r+"loadList"});L&&t(5,m=[]),t(5,m=U.filterDuplicatesByKey(m.concat(B.items))),v=B.page,t(12,b=B.totalItems)}catch(R){be.errorResponseHandler(R)}t(6,y=!1)}}const M=()=>$();function D(L){f=L,t(1,f)}function O(L){u=L,t(0,u)}function A(L){ut.call(this,n,L)}function I(L){ut.call(this,n,L)}return n.$$set=L=>{e=pt(pt({},e),di(L)),t(10,o=Jt(e,l)),"multiple"in L&&t(2,a=L.multiple),"selected"in L&&t(0,u=L.selected),"keyOfSelected"in L&&t(1,f=L.keyOfSelected),"selectPlaceholder"in L&&t(3,c=L.selectPlaceholder),"optionComponent"in L&&t(4,d=L.optionComponent),"collectionId"in L&&t(11,h=L.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&h&&$(!0),n.$$.dirty&8256&&t(8,i=y||S),n.$$.dirty&4128&&t(7,s=b>m.length)},[u,f,a,c,d,m,y,s,i,$,o,h,b,S,M,D,O,A,I]}class Y4 extends Ee{constructor(e){super(),Oe(this,e,W4,U4,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function op(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function K4(n){var S,C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;function v($){n[3]($)}let b={toggle:!0,id:n[4],multiple:n[2],collectionId:(S=n[1].options)==null?void 0:S.collectionId};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new Y4({props:b}),he.push(()=>Re(f,"keyOfSelected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&op(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Je(),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m($,M){w($,e,M),g(e,t),g(e,s),g(e,l),g(l,r),w($,u,M),j(f,$,M),w($,d,M),y&&y.m($,M),w($,h,M),m=!0},p($,M){var O,A;(!m||M&2&&i!==(i=U.getFieldTypeIcon($[1].type)))&&p(t,"class",i),(!m||M&2)&&o!==(o=$[1].name+"")&&ue(r,o),(!m||M&16&&a!==(a=$[4]))&&p(e,"for",a);const D={};M&16&&(D.id=$[4]),M&4&&(D.multiple=$[2]),M&2&&(D.collectionId=(O=$[1].options)==null?void 0:O.collectionId),!c&&M&1&&(c=!0,D.keyOfSelected=$[0],He(()=>c=!1)),f.$set(D),((A=$[1].options)==null?void 0:A.maxSelect)>1?y?y.p($,M):(y=op($),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i($){m||(E(f.$$.fragment,$),m=!0)},o($){P(f.$$.fragment,$),m=!1},d($){$&&k(e),$&&k(u),q(f,$),$&&k(d),y&&y.d($),$&&k(h)}}}function Z4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function J4(n,e,t){let i,{field:s=new Tn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(s.options.maxSelect-1))},[l,s,i,o]}class G4 extends Ee{constructor(e){super(),Oe(this,e,J4,Z4,De,{field:1,value:0})}}function X4(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f=n[0].email+"",c,d,h;return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),u=_("small"),c=F(f),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(u,"class","block txt-hint txt-ellipsis"),p(s,"class","content")},m(m,v){w(m,e,v),w(m,i,v),w(m,s,v),g(s,l),g(l,r),g(s,a),g(s,u),g(u,c),d||(h=Ye(t=Ct.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),d=!0)},p(m,[v]){t&&Kn(t.update)&&v&1&&t.update.call(null,{text:JSON.stringify(m[0],null,2),position:"left",class:"code"}),v&1&&o!==(o=m[0].id+"")&&ue(r,o),v&1&&f!==(f=m[0].email+"")&&ue(c,f)},i:re,o:re,d(m){m&&k(e),m&&k(i),m&&k(s),d=!1,h()}}}function Q4(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class sa extends Ee{constructor(e){super(),Oe(this,e,Q4,X4,De,{item:0})}}function rp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Load more',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[13])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function x4(n){let e,t=n[7]&&rp(n);return{c(){t&&t.c(),e=Je()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=rp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function eM(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:sa},{optionComponent:n[4]},{multiple:n[2]},{class:"users-select block-options"},n[10]];function o(u){n[14](u)}function r(u){n[15](u)}let a={$$slots:{afterOptions:[x4]},$$scope:{ctx:n}};for(let u=0;uRe(e,"keyOfSelected",o)),he.push(()=>Re(e,"selected",r)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?_n(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&0&&{labelComponent:sa},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&pi(u[10])]):{};f&2097344&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function tM(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let o=Jt(e,l);const r="select_"+U.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=sa}=e,h=[],m=1,v=0,b=!1,y=!1;C(!0),S();async function S(){const I=U.toArray(f);if(!!I.length){t(12,y=!0);try{const L=[];for(const R of I)L.push(`id="${R}"`);t(0,u=await be.users.getFullList(100,{sort:"-created",filter:L.join("||"),$cancelKey:r+"loadSelected"})),t(5,h=U.filterDuplicatesByKey(h.concat(u)))}catch(L){be.errorResponseHandler(L)}t(12,y=!1)}}async function C(I=!1){t(6,b=!0);try{const L=I?1:m+1,R=await be.users.getList(L,200,{sort:"-created",$cancelKey:r+"loadList"});I&&t(5,h=[]),t(5,h=U.filterDuplicatesByKey(h.concat(R.items))),m=R.page,t(11,v=R.totalItems)}catch(L){be.errorResponseHandler(L)}t(6,b=!1)}const $=()=>C();function M(I){f=I,t(1,f)}function D(I){u=I,t(0,u)}function O(I){ut.call(this,n,I)}function A(I){ut.call(this,n,I)}return n.$$set=I=>{e=pt(pt({},e),di(I)),t(10,o=Jt(e,l)),"multiple"in I&&t(2,a=I.multiple),"selected"in I&&t(0,u=I.selected),"keyOfSelected"in I&&t(1,f=I.keyOfSelected),"selectPlaceholder"in I&&t(3,c=I.selectPlaceholder),"optionComponent"in I&&t(4,d=I.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=b||y),n.$$.dirty&2080&&t(7,s=v>h.length)},[u,f,a,c,d,h,b,s,i,C,o,v,y,$,M,D,O,A]}class nM extends Ee{constructor(e){super(),Oe(this,e,tM,eM,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function ap(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" users."),p(e,"class","help-block")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function iM(n){var S;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;function v(C){n[4](C)}let b={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new nM({props:b}),he.push(()=>Re(f,"keyOfSelected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&ap(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Je(),p(t,"class",i=U.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[5])},m(C,$){w(C,e,$),g(e,t),g(e,s),g(e,l),g(l,r),w(C,u,$),j(f,C,$),w(C,d,$),y&&y.m(C,$),w(C,h,$),m=!0},p(C,$){var D;(!m||$&2&&i!==(i=U.getFieldTypeIcon(C[1].type)))&&p(t,"class",i),(!m||$&2)&&o!==(o=C[1].name+"")&&ue(r,o),(!m||$&32&&a!==(a=C[5]))&&p(e,"for",a);const M={};$&32&&(M.id=C[5]),$&4&&(M.multiple=C[2]),$&8&&(M.disabled=C[3]),!c&&$&1&&(c=!0,M.keyOfSelected=C[0],He(()=>c=!1)),f.$set(M),((D=C[1].options)==null?void 0:D.maxSelect)>1?y?y.p(C,$):(y=ap(C),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(C){m||(E(f.$$.fragment,C),m=!0)},o(C){P(f.$$.fragment,C),m=!1},d(C){C&&k(e),C&&k(u),q(f,C),C&&k(d),y&&y.d(C),C&&k(h)}}}function sM(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[iM,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&10&&(l.class="form-field "+(i[1].required?"required":"")+" "+(i[3]?"disabled":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function lM(n,e,t){let i,s,{field:l=new Tn}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(2,s),t(1,l)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{var a;n.$$.dirty&2&&t(2,s=((a=l.options)==null?void 0:a.maxSelect)>1),n.$$.dirty&7&&s&&Array.isArray(o)&&o.length>l.options.maxSelect&&t(0,o=o.slice(l.options.maxSelect-1)),n.$$.dirty&3&&t(3,i=!U.isEmpty(o)&&l.system)},[o,l,s,i,r]}class oM extends Ee{constructor(e){super(),Oe(this,e,lM,sM,De,{field:1,value:0})}}function up(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function fp(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[rM,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function rM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="id",l=T(),o=_("span"),a=T(),u=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[43]),p(u,"type","text"),p(u,"id",f=n[43]),u.value=c=n[2].id,u.disabled=!0},m(d,h){w(d,e,h),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),w(d,a,h),w(d,u,h)},p(d,h){h[1]&4096&&r!==(r=d[43])&&p(e,"for",r),h[1]&4096&&f!==(f=d[43])&&p(u,"id",f),h[0]&4&&c!==(c=d[2].id)&&u.value!==c&&(u.value=c)},d(d){d&&k(e),d&&k(a),d&&k(u)}}}function cp(n){let e;return{c(){e=_("div"),e.innerHTML=`
No custom fields to be set
- `,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function aM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new oM({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function uM(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new G4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function fM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new j4({props:u}),he.push(()=>Re(e,"value",o)),he.push(()=>Re(e,"uploadedFiles",r)),he.push(()=>Re(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(E(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function cM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new b4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function dM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new h4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function pM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new f4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function hM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new o4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function mM(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new n4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function gM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new QC({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function _M(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new ZC({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function bM(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new UC({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function dp(n,e){let t,i,s,l,o;const r=[bM,_M,gM,mM,hM,pM,dM,cM,fM,uM,aM],a=[];function u(f,c){return f[40].type==="text"?0:f[40].type==="number"?1:f[40].type==="bool"?2:f[40].type==="email"?3:f[40].type==="url"?4:f[40].type==="date"?5:f[40].type==="select"?6:f[40].type==="json"?7:f[40].type==="file"?8:f[40].type==="relation"?9:f[40].type==="user"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Je(),s&&s.c(),l=Je(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(Pe(),P(a[d],1,1,()=>{a[d]=null}),Le()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),E(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(E(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(t),~i&&a[i].d(f),f&&k(l)}}}function vM(n){var d;let e,t,i=[],s=new Map,l,o,r,a=!n[2].isNew&&fp(n),u=((d=n[0])==null?void 0:d.schema)||[];const f=h=>h[40].name;for(let h=0;h{a=null}),Le()):a?(a.p(h,m),m[0]&4&&E(a,1)):(a=fp(h),a.c(),E(a,1),a.m(e,t)),m[0]&29&&(u=((v=h[0])==null?void 0:v.schema)||[],Pe(),i=bt(i,m,f,1,h,u,s,e,Gt,dp,null,up),Le(),!u.length&&c?c.p(h,m):u.length?c&&(c.d(1),c=null):(c=cp(),c.c(),c.m(e,null)))},i(h){if(!l){E(a);for(let m=0;m - Delete`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function kM(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&pp(n);return{c(){e=_("h4"),i=F(t),s=T(),o=F(l),r=F(" record"),a=T(),c&&c.c(),u=Je()},m(d,h){w(d,e,h),g(e,i),g(e,s),g(e,o),g(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&E(c,1)):(c=pp(d),c.c(),E(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(E(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function wM(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(l,r),u||(f=G(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function $M(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[wM],header:[kM],default:[vM]},$$scope:{ctx:n}};return e=new hi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),q(e,s)}}}function hp(n){return JSON.stringify(n)}function SM(n,e,t){let i,s,l,o;const r=on(),a="record_"+U.randomString(5);let{collection:u}=e,f,c=null,d=new fo,h=!1,m=!1,v={},b={},y="";function S(ee){return $(ee),t(8,m=!0),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function $(ee){Si({}),c=ee||{},t(2,d=ee!=null&&ee.clone?ee.clone():new fo),t(3,v={}),t(4,b={}),await ni(),t(15,y=hp(d))}function M(){if(h||!l)return;t(7,h=!0);const ee=O();let Q;d.isNew?Q=be.records.create(u==null?void 0:u.id,ee):Q=be.records.update(u==null?void 0:u.id,d.id,ee),Q.then(async Se=>{cn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,m=!1),C(),r("save",Se)}).catch(Se=>{be.errorResponseHandler(Se)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||ci("Do you really want to delete the selected record?",()=>be.records.delete(c["@collectionId"],c.id).then(()=>{C(),cn("Successfully deleted record."),r("delete",c)}).catch(ee=>{be.errorResponseHandler(ee)}))}function O(){const ee=(d==null?void 0:d.export())||{},Q=new FormData,Se={};for(const je of(u==null?void 0:u.schema)||[])Se[je.name]=je;for(const je in ee)!Se[je]||(typeof ee[je]>"u"&&(ee[je]=null),U.addValueToFormData(Q,je,ee[je]));for(const je in v){const Ue=U.toArray(v[je]);for(const Z of Ue)Q.append(je,Z)}for(const je in b){const Ue=U.toArray(b[je]);for(const Z of Ue)Q.append(je+"."+Z,"")}return Q}const A=()=>C(),I=()=>D();function L(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function R(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function B(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function K(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function J(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function H(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function X(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function W(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function te(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function x(ee,Q){n.$$.not_equal(v[Q.name],ee)&&(v[Q.name]=ee,t(3,v))}function oe(ee,Q){n.$$.not_equal(b[Q.name],ee)&&(b[Q.name]=ee,t(4,b))}function me(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function se(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}const ge=()=>s&&m?(ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,m=!1),C()}),!1):!0;function ke(ee){he[ee?"unshift":"push"](()=>{f=ee,t(6,f)})}function Y(ee){ut.call(this,n,ee)}function ve(ee){ut.call(this,n,ee)}return n.$$set=ee=>{"collection"in ee&&t(0,u=ee.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=U.hasNonEmptyProps(v)||U.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=hp(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,C,d,v,b,s,f,h,m,l,o,a,M,D,S,y,i,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke,Y,ve]}class F_ extends Ee{constructor(e){super(),Oe(this,e,SM,$M,De,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function CM(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function MM(n){let e,t;return{c(){e=_("span"),t=F(n[1]),p(e,"class","label txt-base txt-mono"),p(e,"title",n[0])},m(i,s){w(i,e,s),g(e,t)},p(i,s){s&2&&ue(t,i[1]),s&1&&p(e,"title",i[0])},d(i){i&&k(e)}}}function TM(n){let e;function t(l,o){return l[0]?MM:CM}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:re,o:re,d(l){s.d(l),l&&k(e)}}}function DM(n,e,t){let{id:i=""}=e,s=i;return n.$$set=l=>{"id"in l&&t(0,i=l.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,s=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,s]}class Xo extends Ee{constructor(e){super(),Oe(this,e,DM,TM,De,{id:0})}}function mp(n,e,t){const i=n.slice();return i[8]=e[t],i}function gp(n,e,t){const i=n.slice();return i[3]=e[t],i}function _p(n,e,t){const i=n.slice();return i[3]=e[t],i}function OM(n){let e,t=n[0][n[1].name]+"",i,s;return{c(){e=_("span"),i=F(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[0][n[1].name])},m(l,o){w(l,e,o),g(e,i)},p(l,o){o&3&&t!==(t=l[0][l[1].name]+"")&&ue(i,t),o&3&&s!==(s=l[0][l[1].name])&&p(e,"title",s)},i:re,o:re,d(l){l&&k(e)}}}function EM(n){let e,t,i=U.toArray(n[0][n[1].name]),s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o{a[d]=null}),Le(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),E(s,1),s.m(e,null)),(!o||c&2&&l!==(l="col-type-"+f[1].type+" col-field-"+f[1].name))&&p(e,"class",l)},i(f){o||(E(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(e),a[i].d()}}}function jM(n,e,t){let{record:i}=e,{field:s}=e;function l(o){ut.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record),"field"in o&&t(1,s=o.field)},[i,s,l]}class N_ extends Ee{constructor(e){super(),Oe(this,e,jM,HM,De,{record:0,field:1})}}function kp(n,e,t){const i=n.slice();return i[35]=e[t],i}function wp(n,e,t){const i=n.slice();return i[38]=e[t],i}function $p(n,e,t){const i=n.slice();return i[38]=e[t],i}function qM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function VM(n){let e,t,i,s,l,o=n[38].name+"",r;return{c(){e=_("div"),t=_("i"),s=T(),l=_("span"),r=F(o),p(t,"class",i=U.getFieldTypeIcon(n[38].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),g(e,t),g(e,s),g(e,l),g(l,r)},p(a,u){u[0]&2048&&i!==(i=U.getFieldTypeIcon(a[38].type))&&p(t,"class",i),u[0]&2048&&o!==(o=a[38].name+"")&&ue(r,o)},d(a){a&&k(e)}}}function Sp(n,e){let t,i,s,l;function o(a){e[22](a)}let r={class:"col-type-"+e[38].type+" col-field-"+e[38].name,name:e[38].name,$$slots:{default:[VM]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new sn({props:r}),he.push(()=>Re(i,"sort",o)),{key:n,first:null,c(){t=Je(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&2048&&(f.class="col-type-"+e[38].type+" col-field-"+e[38].name),u[0]&2048&&(f.name=e[38].name),u[0]&2048|u[1]&4096&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],He(()=>s=!1)),i.$set(f)},i(a){l||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&k(t),q(i,a)}}}function zM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function BM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function Cp(n){let e;function t(l,o){return l[8]?WM:UM}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function UM(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Mp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No records found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Mp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function WM(n){let e;return{c(){e=_("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Mp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Tp(n,e){let t,i,s;return i=new N_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Je(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Dp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,m,v=[],b=new Map,y,S,C,$,M,D,O,A,I,L,R,B;function K(){return e[25](e[35])}h=new Xo({props:{id:e[35].id}});let J=e[11];const H=te=>te[38].name;for(let te=0;te',I=T(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,x){w(te,t,x),g(t,i),g(i,s),g(s,l),g(s,a),g(s,u),g(t,c),g(t,d),j(h,d,null),g(t,m);for(let oe=0;oeReset',c=T(),d=_("div"),h=T(),m=_("button"),m.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ie(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-sm btn-secondary btn-danger"),ie(m,"btn-loading",n[9]),ie(m,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(C,$){w(C,e,$),g(e,t),g(t,i),g(t,s),g(s,l),g(t,o),g(t,a),g(e,u),g(e,f),g(e,c),g(e,d),g(e,h),g(e,m),b=!0,y||(S=[G(f,"click",n[30]),G(m,"click",n[31])],y=!0)},p(C,$){(!b||$[0]&64)&&ue(l,C[6]),(!b||$[0]&64)&&r!==(r=C[6]===1?"record":"records")&&ue(a,r),$[0]&512&&ie(f,"btn-disabled",C[9]),$[0]&512&&ie(m,"btn-loading",C[9]),$[0]&512&&ie(m,"btn-disabled",C[9])},i(C){b||(C&&Dt(()=>{v||(v=rt(e,Bn,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(C){C&&(v||(v=rt(e,Bn,{duration:150,y:5},!1)),v.run(0)),b=!1},d(C){C&&k(e),C&&v&&v.end(),y=!1,Qe(S)}}}function YM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v=[],b=new Map,y,S,C,$,M,D,O,A,I,L,R=[],B=new Map,K,J,H,X,W,te,x;function oe(ce){n[21](ce)}let me={class:"col-type-text col-field-id",name:"id",$$slots:{default:[qM]},$$scope:{ctx:n}};n[0]!==void 0&&(me.sort=n[0]),d=new sn({props:me}),he.push(()=>Re(d,"sort",oe));let se=n[11];const ge=ce=>ce[38].name;for(let ce=0;ceRe(S,"sort",ke));function ve(ce){n[24](ce)}let ee={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[BM]},$$scope:{ctx:n}};n[0]!==void 0&&(ee.sort=n[0]),M=new sn({props:ee}),he.push(()=>Re(M,"sort",ve));let Q=n[3];const Se=ce=>ce[35].id;for(let ce=0;ceh=!1)),d.$set(Ze),we[0]&2049&&(se=ce[11],Pe(),v=bt(v,we,ge,1,ce,se,b,s,Gt,Sp,y,$p),Le());const tt={};we[1]&4096&&(tt.$$scope={dirty:we,ctx:ce}),!C&&we[0]&1&&(C=!0,tt.sort=ce[0],He(()=>C=!1)),S.$set(tt);const We={};we[1]&4096&&(We.$$scope={dirty:we,ctx:ce}),!D&&we[0]&1&&(D=!0,We.sort=ce[0],He(()=>D=!1)),M.$set(We),we[0]&76074&&(Q=ce[3],Pe(),R=bt(R,we,Se,1,ce,Q,B,L,Gt,Dp,null,kp),Le(),!Q.length&&je?je.p(ce,we):Q.length?je&&(je.d(1),je=null):(je=Cp(ce),je.c(),je.m(L,null))),we[0]&256&&ie(t,"table-loading",ce[8]),ce[3].length?Ue?Ue.p(ce,we):(Ue=Op(ce),Ue.c(),Ue.m(J.parentNode,J)):Ue&&(Ue.d(1),Ue=null),ce[3].length&&ce[12]?Z?Z.p(ce,we):(Z=Ep(ce),Z.c(),Z.m(H.parentNode,H)):Z&&(Z.d(1),Z=null),ce[6]?pe?(pe.p(ce,we),we[0]&64&&E(pe,1)):(pe=Ap(ce),pe.c(),E(pe,1),pe.m(X.parentNode,X)):pe&&(Pe(),P(pe,1,1,()=>{pe=null}),Le())},i(ce){if(!W){E(d.$$.fragment,ce);for(let we=0;we{t(8,v=!1),t(3,c=c.concat(ge.items)),t(7,d=ge.page),t(4,h=ge.totalItems),r("load",c)}).catch(ge=>{ge!=null&&ge.isAbort||(t(8,v=!1),console.warn(ge),S(),be.errorResponseHandler(ge,!1))})}function S(){t(3,c=[]),t(7,d=1),t(4,h=0),t(5,m={})}function C(){o?$():M()}function $(){t(5,m={})}function M(){for(const se of c)t(5,m[se.id]=se,m);t(5,m)}function D(se){m[se.id]?delete m[se.id]:t(5,m[se.id]=se,m),t(5,m)}function O(){ci(`Do you really want to delete the selected ${l===1?"record":"records"}?`,A)}async function A(){if(b||!l)return;let se=[];for(const ge of Object.keys(m))se.push(be.records.delete(a==null?void 0:a.id,ge));return t(9,b=!0),Promise.all(se).then(()=>{cn(`Successfully deleted the selected ${l===1?"record":"records"}.`),$()}).catch(ge=>{be.errorResponseHandler(ge)}).finally(()=>(t(9,b=!1),y()))}function I(se){ut.call(this,n,se)}const L=()=>C();function R(se){u=se,t(0,u)}function B(se){u=se,t(0,u)}function K(se){u=se,t(0,u)}function J(se){u=se,t(0,u)}const H=se=>D(se),X=se=>r("select",se),W=(se,ge)=>{ge.code==="Enter"&&(ge.preventDefault(),r("select",se))},te=()=>t(1,f=""),x=()=>y(d+1),oe=()=>$(),me=()=>O();return n.$$set=se=>{"collection"in se&&t(18,a=se.collection),"sort"in se&&t(0,u=se.sort),"filter"in se&&t(1,f=se.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&u!==-1&&f!==-1&&(S(),y(1)),n.$$.dirty[0]&24&&t(12,i=h>c.length),n.$$.dirty[0]&262144&&t(11,s=(a==null?void 0:a.schema)||[]),n.$$.dirty[0]&32&&t(6,l=Object.keys(m).length),n.$$.dirty[0]&72&&t(10,o=c.length&&l===c.length)},[u,f,y,c,h,m,l,d,v,b,o,s,i,r,C,$,D,O,a,I,L,R,B,K,J,H,X,W,te,x,oe,me]}class ZM extends Ee{constructor(e){super(),Oe(this,e,KM,YM,De,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function JM(n){let e,t,i,s;return e=new B3({}),i=new Dn({props:{$$slots:{default:[QM]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o&1073741951&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function GM(n){let e,t;return e=new Dn({props:{center:!0,$$slots:{default:[xM]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741832&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function XM(n){let e,t;return e=new Dn({props:{center:!0,$$slots:{default:[eT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function QM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L;d=new Uo({}),d.$on("refresh",n[13]),C=new Bo({props:{value:n[0],autocompleteCollection:n[2]}}),C.$on("submit",n[16]);function R(J){n[18](J)}function B(J){n[19](J)}let K={collection:n[2]};return n[0]!==void 0&&(K.filter=n[0]),n[1]!==void 0&&(K.sort=n[1]),M=new ZM({props:K}),n[17](M),he.push(()=>Re(M,"filter",R)),he.push(()=>Re(M,"sort",B)),M.$on("select",n[20]),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Collections",s=T(),l=_("div"),r=F(o),a=T(),u=_("div"),f=_("button"),f.innerHTML='',c=T(),V(d.$$.fragment),h=T(),m=_("div"),v=_("button"),v.innerHTML=` - API Preview`,b=T(),y=_("button"),y.innerHTML=` - New record`,S=T(),V(C.$$.fragment),$=T(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"type","button"),p(f,"class","btn btn-secondary btn-circle"),p(u,"class","inline-flex gap-5"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(m,"class","btns-group"),p(e,"class","page-header")},m(J,H){w(J,e,H),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),g(u,f),g(u,c),j(d,u,null),g(e,h),g(e,m),g(m,v),g(m,b),g(m,y),w(J,S,H),j(C,J,H),w(J,$,H),j(M,J,H),A=!0,I||(L=[Ye(Ct.call(null,f,{text:"Edit collection",position:"right"})),G(f,"click",n[12]),G(v,"click",n[14]),G(y,"click",n[15])],I=!0)},p(J,H){(!A||H&4)&&o!==(o=J[2].name+"")&&ue(r,o);const X={};H&1&&(X.value=J[0]),H&4&&(X.autocompleteCollection=J[2]),C.$set(X);const W={};H&4&&(W.collection=J[2]),!D&&H&1&&(D=!0,W.filter=J[0],He(()=>D=!1)),!O&&H&2&&(O=!0,W.sort=J[1],He(()=>O=!1)),M.$set(W)},i(J){A||(E(d.$$.fragment,J),E(C.$$.fragment,J),E(M.$$.fragment,J),A=!0)},o(J){P(d.$$.fragment,J),P(C.$$.fragment,J),P(M.$$.fragment,J),A=!1},d(J){J&&k(e),q(d),J&&k(S),q(C,J),J&&k($),n[17](null),q(M,J),I=!1,Qe(L)}}}function xM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=` - Create new collection`,p(t,"class","icon"),p(s,"class","m-b-10"),p(o,"type","button"),p(o,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=G(o,"click",n[11]),r=!0)},p:re,d(u){u&&k(e),r=!1,a()}}}function eT(n){let e;return{c(){e=_("div"),e.innerHTML=` -

Loading collections...

`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function tT(n){let e,t,i,s,l,o,r,a,u;const f=[XM,GM,JM],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Ya({props:h}),n[21](s);let m={};o=new RC({props:m}),n[22](o);let v={collection:n[2]};return a=new F_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),j(s,b,y),w(b,l,y),j(o,b,y),w(b,r,y),j(a,b,y),u=!0},p(b,[y]){let S=e;e=d(b),e===S?c[e].p(b,y):(Pe(),P(c[S],1,1,()=>{c[S]=null}),Le(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),E(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const $={};o.$set($);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(E(t),E(s.$$.fragment,b),E(o.$$.fragment,b),E(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),q(s,b),b&&k(l),n[22](null),q(o,b),b&&k(r),n[23](null),q(a,b)}}}function nT(n,e,t){let i,s,l,o,r,a;kt(n,ui,W=>t(2,s=W)),kt(n,Ds,W=>t(10,l=W)),kt(n,Ro,W=>t(26,o=W)),kt(n,Rt,W=>t(27,r=W)),kt(n,na,W=>t(8,a=W)),dn(Rt,r="Collections",r);const u=new URLSearchParams(o);let f,c,d,h,m=u.get("filter")||"",v=u.get("sort")||"-created",b=u.get("collectionId")||"";function y(){t(9,b=s.id),t(1,v="-created"),t(0,m="")}f$(b);const S=()=>f==null?void 0:f.show(),C=()=>f==null?void 0:f.show(s),$=()=>h==null?void 0:h.load(),M=()=>c==null?void 0:c.show(s),D=()=>d==null?void 0:d.show(),O=W=>t(0,m=W.detail);function A(W){he[W?"unshift":"push"](()=>{h=W,t(6,h)})}function I(W){m=W,t(0,m)}function L(W){v=W,t(1,v)}const R=W=>d==null?void 0:d.show(W==null?void 0:W.detail);function B(W){he[W?"unshift":"push"](()=>{f=W,t(3,f)})}function K(W){he[W?"unshift":"push"](()=>{c=W,t(4,c)})}function J(W){he[W?"unshift":"push"](()=>{d=W,t(5,d)})}const H=()=>h==null?void 0:h.load(),X=()=>h==null?void 0:h.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(W=>W.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&y(),n.$$.dirty&7&&(v||m||(s==null?void 0:s.id))){const W=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:m,sort:v}).toString();$i("/collections?"+W)}},[m,v,s,f,c,d,h,i,a,b,l,S,C,$,M,D,O,A,I,L,R,B,K,J,H,X]}class iT extends Ee{constructor(e){super(),Oe(this,e,nT,tT,De,{})}}function Pp(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[sT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function sT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),g(e,t),g(e,i),g(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Lp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Ye(Ct.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function lT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Lp();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,m){w(h,e,m),g(e,t),g(e,i),g(e,s),w(h,o,m),d&&d.m(h,m),w(h,r,m),w(h,a,m),Me(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(h,m){m[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Lp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),m[1]&1&&u!==(u=h[31])&&p(a,"id",u),m[0]&4&&a.value!==h[2]&&Me(a,h[2])},d(h){h&&k(e),h&&k(o),d&&d.d(h),h&&k(r),h&&k(a),f=!1,c()}}}function Ip(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[oT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[20]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Fp(n){let e,t,i,s,l,o,r,a,u;return s=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[rT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[aT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),g(e,t),g(t,i),j(s,i,null),g(t,l),g(t,o),j(r,o,null),u=!0},p(f,c){const d={};c[0]&128|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&256|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(E(s.$$.fragment,f),E(r.$$.fragment,f),f&&Dt(()=>{a||(a=rt(t,tn,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=rt(t,tn,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(s),q(r),f&&a&&a.end()}}}function rT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password",o=T(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),Me(r,n[7]),u||(f=G(r,"input",n[21]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&128&&r.value!==c[7]&&Me(r,c[7])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function aT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password confirm",o=T(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),Me(r,n[8]),u||(f=G(r,"input",n[22]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&Me(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function Np(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[uT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&512|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function uT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Send verification email"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[9],w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[23]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&512&&(e.checked=u[9]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function fT(n){let e,t,i,s,l,o,r,a,u,f=!n[1].isNew&&Pp(n);i=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[lT,({uniqueId:m})=>({31:m}),({uniqueId:m})=>[0,m?1:0]]},$$scope:{ctx:n}}});let c=!n[1].isNew&&Ip(n),d=(n[1].isNew||n[3])&&Fp(n),h=n[1].isNew&&Np(n);return{c(){e=_("form"),f&&f.c(),t=T(),V(i.$$.fragment),s=T(),c&&c.c(),l=T(),d&&d.c(),o=T(),h&&h.c(),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(m,v){w(m,e,v),f&&f.m(e,null),g(e,t),j(i,e,null),g(e,s),c&&c.m(e,null),g(e,l),d&&d.m(e,null),g(e,o),h&&h.m(e,null),r=!0,a||(u=G(e,"submit",Yt(n[12])),a=!0)},p(m,v){m[1].isNew?f&&(Pe(),P(f,1,1,()=>{f=null}),Le()):f?(f.p(m,v),v[0]&2&&E(f,1)):(f=Pp(m),f.c(),E(f,1),f.m(e,t));const b={};v[0]&6|v[1]&3&&(b.$$scope={dirty:v,ctx:m}),i.$set(b),m[1].isNew?c&&(Pe(),P(c,1,1,()=>{c=null}),Le()):c?(c.p(m,v),v[0]&2&&E(c,1)):(c=Ip(m),c.c(),E(c,1),c.m(e,l)),m[1].isNew||m[3]?d?(d.p(m,v),v[0]&10&&E(d,1)):(d=Fp(m),d.c(),E(d,1),d.m(e,o)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le()),m[1].isNew?h?(h.p(m,v),v[0]&2&&E(h,1)):(h=Np(m),h.c(),E(h,1),h.m(e,null)):h&&(Pe(),P(h,1,1,()=>{h=null}),Le())},i(m){r||(E(f),E(i.$$.fragment,m),E(c),E(d),E(h),r=!0)},o(m){P(f),P(i.$$.fragment,m),P(c),P(d),P(h),r=!1},d(m){m&&k(e),f&&f.d(),q(i),c&&c.d(),d&&d.d(),h&&h.d(),a=!1,u()}}}function cT(n){let e,t=n[1].isNew?"New user":"Edit user",i;return{c(){e=_("h4"),i=F(t)},m(s,l){w(s,e,l),g(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New user":"Edit user")&&ue(i,t)},d(s){s&&k(e)}}}function Rp(n){let e,t,i,s,l,o,r,a,u;return o=new qi({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[dT]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),V(o.$$.fragment),r=T(),a=_("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),g(e,t),g(e,i),g(e,s),g(e,l),j(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[0]&2|c[1]&2&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(E(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&k(e),q(o),f&&k(r),f&&k(a)}}}function Hp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=` - Send verification email`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function dT(n){let e,t,i,s,l=!n[1].verified&&Hp(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=` - Delete`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=Hp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function pT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&Rp(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ie(l,"btn-loading",n[5])},m(m,v){h&&h.m(m,v),w(m,e,v),w(m,t,v),g(t,i),w(m,s,v),w(m,l,v),g(l,o),g(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(m,v){m[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(m,v),v[0]&2&&E(h,1)):(h=Rp(m),h.c(),E(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=m[5]),(!f||v[0]&2)&&r!==(r=m[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1056&&u!==(u=!m[10]||m[5]))&&(l.disabled=u),v[0]&32&&ie(l,"btn-loading",m[5])},i(m){f||(E(h),f=!0)},o(m){P(h),f=!1},d(m){h&&h.d(m),m&&k(e),m&&k(t),m&&k(s),m&&k(l),c=!1,d()}}}function hT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[pT],header:[cT],default:[fT]},$$scope:{ctx:n}};return e=new hi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),q(e,s)}}}function mT(n,e,t){let i;const s=on(),l="user_"+U.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",h=!1,m=!0;function v(te){return y(te),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(te){Si({}),t(1,r=te!=null&&te.clone?te.clone():new co),S()}function S(){t(3,h=!1),t(9,m=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function C(){if(a||!i)return;t(5,a=!0);const te={email:f};(r.isNew||h)&&(te.password=c,te.passwordConfirm=d);let x;r.isNew?x=be.users.create(te):x=be.users.update(r.id,te),x.then(async oe=>{m&&M(!1),t(6,u=!1),b(),cn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",oe)}).catch(oe=>{be.errorResponseHandler(oe)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||ci("Do you really want to delete the selected user?",()=>be.users.delete(r.id).then(()=>{t(6,u=!1),b(),cn("Successfully deleted user."),s("delete",r)}).catch(te=>{be.errorResponseHandler(te)}))}function M(te=!0){return be.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),te&&cn(`Successfully sent verification email to ${r.email}.`)}).catch(x=>{be.errorResponseHandler(x)})}const D=()=>M(),O=()=>$(),A=()=>b();function I(){f=this.value,t(2,f)}function L(){h=this.checked,t(3,h)}function R(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function K(){m=this.checked,t(9,m)}const J=()=>i&&u?(ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function H(te){he[te?"unshift":"push"](()=>{o=te,t(4,o)})}function X(te){ut.call(this,n,te)}function W(te){ut.call(this,n,te)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||h||f!==r.email)},[b,r,f,h,o,a,u,c,d,m,i,l,C,$,M,v,D,O,A,I,L,R,B,K,J,H,X,W]}class gT extends Ee{constructor(e){super(),Oe(this,e,mT,hT,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function jp(n,e,t){const i=n.slice();return i[40]=e[t],i}function qp(n,e,t){const i=n.slice();return i[43]=e[t],i}function Vp(n,e,t){const i=n.slice();return i[43]=e[t],i}function _T(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L=[],R=new Map,B,K,J,H,X,W,te,x,oe,me,se=[],ge=new Map,ke,Y,ve,ee,Q,Se;a=new Uo({}),a.$on("refresh",n[17]),m=new Bo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),m.$on("submit",n[19]);function je(_e){n[20](_e)}let Ue={class:"col-type-text col-field-id",name:"id",$$slots:{default:[vT]},$$scope:{ctx:n}};n[4]!==void 0&&(Ue.sort=n[4]),$=new sn({props:Ue}),he.push(()=>Re($,"sort",je));function Z(_e){n[21](_e)}let pe={class:"col-type-email col-field-email",name:"email",$$slots:{default:[yT]},$$scope:{ctx:n}};n[4]!==void 0&&(pe.sort=n[4]),O=new sn({props:pe}),he.push(()=>Re(O,"sort",Z));let ce=n[12];const we=_e=>_e[43].name;for(let _e=0;_eRe(K,"sort",Ze));function We(_e){n[23](_e)}let it={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[wT]},$$scope:{ctx:n}};n[4]!==void 0&&(it.sort=n[4]),X=new sn({props:it}),he.push(()=>Re(X,"sort",We));let Ce=n[1];const ze=_e=>_e[40].id;for(let _e=0;_e',r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=T(),d=_("button"),d.innerHTML=` - New user`,h=T(),V(m.$$.fragment),v=T(),b=_("div"),y=_("table"),S=_("thead"),C=_("tr"),V($.$$.fragment),D=T(),V(O.$$.fragment),I=T();for(let _e=0;_eM=!1)),$.$set(ft);const vt={};Ie[1]&131072&&(vt.$$scope={dirty:Ie,ctx:_e}),!A&&Ie[0]&16&&(A=!0,vt.sort=_e[4],He(()=>A=!1)),O.$set(vt),Ie[0]&4096&&(ce=_e[12],L=bt(L,Ie,we,1,_e,ce,R,C,Mn,zp,B,Vp));const ot={};Ie[1]&131072&&(ot.$$scope={dirty:Ie,ctx:_e}),!J&&Ie[0]&16&&(J=!0,ot.sort=_e[4],He(()=>J=!1)),K.$set(ot);const Ot={};Ie[1]&131072&&(Ot.$$scope={dirty:Ie,ctx:_e}),!W&&Ie[0]&16&&(W=!0,Ot.sort=_e[4],He(()=>W=!1)),X.$set(Ot),Ie[0]&5450&&(Ce=_e[1],Pe(),se=bt(se,Ie,ze,1,_e,Ce,ge,me,Gt,Yp,null,jp),Le(),!Ce.length&&Ge?Ge.p(_e,Ie):Ce.length?Ge&&(Ge.d(1),Ge=null):(Ge=Bp(_e),Ge.c(),Ge.m(me,null))),Ie[0]&1024&&ie(y,"table-loading",_e[10]),_e[1].length?st?st.p(_e,Ie):(st=Kp(_e),st.c(),st.m(Y.parentNode,Y)):st&&(st.d(1),st=null),_e[1].length&&_e[13]?ct?ct.p(_e,Ie):(ct=Zp(_e),ct.c(),ct.m(ve.parentNode,ve)):ct&&(ct.d(1),ct=null)},i(_e){if(!ee){E(a.$$.fragment,_e),E(m.$$.fragment,_e),E($.$$.fragment,_e),E(O.$$.fragment,_e),E(K.$$.fragment,_e),E(X.$$.fragment,_e);for(let Ie=0;Ie -

Loading users...

`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function vT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function yT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function zp(n,e){let t,i,s,l,o,r,a,u=e[43].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=F("profile."),f=F(u),p(s,"class",l=U.getFieldTypeIcon(e[43].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[43].type+" col-field-"+e[43].name),p(t,"name",d=e[43].name),this.first=t},m(h,m){w(h,t,m),g(t,i),g(i,s),g(i,o),g(i,r),g(r,a),g(r,f)},p(h,m){e=h,m[0]&4096&&l!==(l=U.getFieldTypeIcon(e[43].type))&&p(s,"class",l),m[0]&4096&&u!==(u=e[43].name+"")&&ue(f,u),m[0]&4096&&c!==(c="col-type-"+e[43].type+" col-field-"+e[43].name)&&p(t,"class",c),m[0]&4096&&d!==(d=e[43].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function kT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function wT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function Bp(n){let e;function t(l,o){return l[10]?ST:$T}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function $T(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&Up(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=Up(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function ST(n){let e;return{c(){e=_("tr"),e.innerHTML=` - `},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Up(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[26]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Wp(n,e){let t,i,s;return i=new N_({props:{field:e[43],record:e[40].profile||{}}}),{key:n,first:null,c(){t=Je(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[43]),o[0]&2&&(r.record=e[40].profile||{}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Yp(n,e){let t,i,s,l,o,r,a,u=e[40].email+"",f,c,d,h,m=e[40].verified?"Verified":"Unverified",v,b,y=[],S=new Map,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W;s=new Xo({props:{id:e[40].id}});let te=e[12];const x=se=>se[43].name;for(let se=0;se